@workglow/ai 0.0.78 → 0.0.80
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +3 -3
- package/dist/browser.js +235 -183
- package/dist/browser.js.map +36 -36
- package/dist/bun.js +235 -183
- package/dist/bun.js.map +36 -36
- package/dist/job/AiJob.d.ts +2 -1
- package/dist/job/AiJob.d.ts.map +1 -1
- package/dist/model/ModelRepository.d.ts +3 -3
- package/dist/model/ModelRepository.d.ts.map +1 -1
- package/dist/model/ModelSchema.d.ts +47 -2
- package/dist/model/ModelSchema.d.ts.map +1 -1
- package/dist/node.js +235 -183
- package/dist/node.js.map +36 -36
- package/dist/provider/AiProviderRegistry.d.ts +9 -9
- package/dist/provider/AiProviderRegistry.d.ts.map +1 -1
- package/dist/task/BackgroundRemovalTask.d.ts +4 -4
- package/dist/task/DocumentSplitterTask.d.ts +2 -2
- package/dist/task/DocumentSplitterTask.d.ts.map +1 -1
- package/dist/task/DownloadModelTask.d.ts +20 -20
- package/dist/task/FaceDetectorTask.d.ts +4 -4
- package/dist/task/FaceLandmarkerTask.d.ts +4 -4
- package/dist/task/GestureRecognizerTask.d.ts +4 -4
- package/dist/task/HandLandmarkerTask.d.ts +4 -4
- package/dist/task/ImageClassificationTask.d.ts +4 -4
- package/dist/task/ImageEmbeddingTask.d.ts +4 -4
- package/dist/task/ImageSegmentationTask.d.ts +4 -4
- package/dist/task/ImageToTextTask.d.ts +4 -4
- package/dist/task/ObjectDetectionTask.d.ts +4 -4
- package/dist/task/PoseLandmarkerTask.d.ts +4 -4
- package/dist/task/TextClassificationTask.d.ts +4 -4
- package/dist/task/TextEmbeddingTask.d.ts +4 -4
- package/dist/task/TextFillMaskTask.d.ts +4 -4
- package/dist/task/TextGenerationTask.d.ts +4 -4
- package/dist/task/TextLanguageDetectionTask.d.ts +4 -4
- package/dist/task/TextNamedEntityRecognitionTask.d.ts +4 -4
- package/dist/task/TextQuestionAnswerTask.d.ts +4 -4
- package/dist/task/TextRewriterTask.d.ts +4 -4
- package/dist/task/TextSummaryTask.d.ts +4 -4
- package/dist/task/TextTranslationTask.d.ts +4 -4
- package/dist/task/UnloadModelTask.d.ts +20 -20
- package/dist/task/UnloadModelTask.d.ts.map +1 -1
- package/dist/task/VectorSimilarityTask.d.ts +2 -2
- package/dist/task/VectorSimilarityTask.d.ts.map +1 -1
- package/dist/task/base/AiTask.d.ts +11 -3
- package/dist/task/base/AiTask.d.ts.map +1 -1
- package/dist/task/base/AiTaskSchemas.d.ts +2 -2
- package/dist/task/base/AiVisionTask.d.ts +3 -3
- package/dist/task/base/AiVisionTask.d.ts.map +1 -1
- package/package.json +9 -9
package/dist/node.js.map
CHANGED
|
@@ -1,47 +1,47 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
|
-
"sources": ["../src/job/AiJob.ts", "../src/
|
|
3
|
+
"sources": ["../src/job/AiJob.ts", "../src/provider/AiProviderRegistry.ts", "../src/model/InMemoryModelRepository.ts", "../src/model/ModelRepository.ts", "../src/model/ModelSchema.ts", "../src/model/ModelRegistry.ts", "../src/source/Document.ts", "../src/source/DocumentConverter.ts", "../src/source/DocumentConverterMarkdown.ts", "../src/source/DocumentConverterText.ts", "../src/task/BackgroundRemovalTask.ts", "../src/task/base/AiTaskSchemas.ts", "../src/task/base/AiVisionTask.ts", "../src/task/base/AiTask.ts", "../src/task/DocumentSplitterTask.ts", "../src/task/DownloadModelTask.ts", "../src/task/FaceDetectorTask.ts", "../src/task/FaceLandmarkerTask.ts", "../src/task/GestureRecognizerTask.ts", "../src/task/HandLandmarkerTask.ts", "../src/task/ImageClassificationTask.ts", "../src/task/ImageEmbeddingTask.ts", "../src/task/ImageSegmentationTask.ts", "../src/task/ImageToTextTask.ts", "../src/task/ObjectDetectionTask.ts", "../src/task/PoseLandmarkerTask.ts", "../src/task/TextClassificationTask.ts", "../src/task/TextEmbeddingTask.ts", "../src/task/TextFillMaskTask.ts", "../src/task/TextGenerationTask.ts", "../src/task/TextLanguageDetectionTask.ts", "../src/task/TextNamedEntityRecognitionTask.ts", "../src/task/TextQuestionAnswerTask.ts", "../src/task/TextRewriterTask.ts", "../src/task/TextSummaryTask.ts", "../src/task/TextTranslationTask.ts", "../src/task/UnloadModelTask.ts", "../src/task/VectorSimilarityTask.ts"],
|
|
4
4
|
"sourcesContent": [
|
|
5
|
-
"/**\n * @license\n * Copyright 2025 Steven Roussey <sroussey@gmail.com>\n * SPDX-License-Identifier: Apache-2.0\n */\n\nimport {\n AbortSignalJobError,\n IJobExecuteContext,\n Job,\n JobStatus,\n PermanentJobError,\n} from \"@workglow/job-queue\";\nimport { TaskInput, TaskOutput } from \"@workglow/task-graph\";\nimport {
|
|
5
|
+
"/**\n * @license\n * Copyright 2025 Steven Roussey <sroussey@gmail.com>\n * SPDX-License-Identifier: Apache-2.0\n */\n\nimport {\n AbortSignalJobError,\n IJobExecuteContext,\n Job,\n JobStatus,\n PermanentJobError,\n} from \"@workglow/job-queue\";\nimport { TaskInput, TaskOutput } from \"@workglow/task-graph\";\nimport type { ModelConfig } from \"../model/ModelSchema\";\nimport { getAiProviderRegistry } from \"../provider/AiProviderRegistry\";\n\n/**\n * Input data for the AiJob\n */\nexport interface AiJobInput<Input extends TaskInput = TaskInput> {\n taskType: string;\n aiProvider: string;\n taskInput: Input & { model: ModelConfig };\n}\n\n/**\n * Extends the base Job class to provide custom execution functionality\n * through a provided function.\n */\nexport class AiJob<\n Input extends AiJobInput<TaskInput> = AiJobInput<TaskInput>,\n Output extends TaskOutput = TaskOutput,\n> extends Job<Input, Output> {\n /**\n * Executes the job using the provided function.\n */\n async execute(input: Input, context: IJobExecuteContext): Promise<Output> {\n if (context.signal.aborted || this.status === JobStatus.ABORTING) {\n throw new AbortSignalJobError(\"Abort signal aborted before execution of job\");\n }\n\n let abortHandler: (() => void) | undefined;\n\n try {\n const abortPromise = new Promise<never>((_resolve, reject) => {\n const handler = () => {\n reject(new AbortSignalJobError(\"Abort signal seen, ending job\"));\n };\n\n context.signal.addEventListener(\"abort\", handler, { once: true });\n abortHandler = () => context.signal.removeEventListener(\"abort\", handler);\n });\n\n const runFn = async () => {\n const fn = getAiProviderRegistry().getDirectRunFn<Input[\"taskInput\"], Output>(\n input.aiProvider,\n input.taskType\n );\n if (!fn) {\n throw new PermanentJobError(\n `No run function found for task type ${input.taskType} and model provider ${input.aiProvider}`\n );\n }\n const model = input.taskInput.model;\n if (context.signal?.aborted) {\n throw new AbortSignalJobError(\"Job aborted\");\n }\n return await fn(input.taskInput, model, context.updateProgress, context.signal);\n };\n const runFnPromise = runFn();\n\n return await Promise.race([runFnPromise, abortPromise]);\n } finally {\n // Clean up the abort event listener to prevent memory leaks\n if (abortHandler) {\n abortHandler();\n }\n }\n }\n}\n",
|
|
6
|
+
"/**\n * @license\n * Copyright 2025 Steven Roussey <sroussey@gmail.com>\n * SPDX-License-Identifier: Apache-2.0\n */\n\nimport { TaskInput, TaskOutput } from \"@workglow/task-graph\";\nimport { globalServiceRegistry, WORKER_MANAGER } from \"@workglow/util\";\nimport type { ModelConfig } from \"../model/ModelSchema\";\n\n/**\n * Type for the run function for the AiJob\n */\nexport type AiProviderRunFn<\n Input extends TaskInput = TaskInput,\n Output extends TaskOutput = TaskOutput,\n Model extends ModelConfig = ModelConfig,\n> = (\n input: Input,\n model: Model | undefined,\n update_progress: (progress: number, message?: string, details?: any) => void,\n signal: AbortSignal\n) => Promise<Output>;\n\n/**\n * Registry that manages provider-specific task execution functions and job queues.\n * Handles the registration, retrieval, and execution of task processing functions\n * for different model providers and task types.\n */\nexport class AiProviderRegistry {\n runFnRegistry: Map<string, Map<string, AiProviderRunFn<any, any>>> = new Map();\n\n /**\n * Registers a task execution function for a specific task type and model provider\n * @param taskType - The type of task (e.g., 'text-generation', 'embedding')\n * @param modelProvider - The provider of the model (e.g., 'hf-transformers', 'tf-mediapipe', 'openai', etc)\n * @param runFn - The function that executes the task\n */\n registerRunFn<Input extends TaskInput = TaskInput, Output extends TaskOutput = TaskOutput>(\n modelProvider: string,\n taskType: string,\n runFn: AiProviderRunFn<Input, Output>\n ) {\n if (!this.runFnRegistry.has(taskType)) {\n this.runFnRegistry.set(taskType, new Map());\n }\n this.runFnRegistry.get(taskType)!.set(modelProvider, runFn);\n }\n\n registerAsWorkerRunFn<\n Input extends TaskInput = TaskInput,\n Output extends TaskOutput = TaskOutput,\n >(modelProvider: string, taskType: string) {\n const workerFn: AiProviderRunFn<Input, Output> = async (\n input: Input,\n model: ModelConfig | undefined,\n update_progress: (progress: number, message?: string, details?: any) => void,\n signal?: AbortSignal\n ) => {\n const workerManager = globalServiceRegistry.get(WORKER_MANAGER);\n const result = await workerManager.callWorkerFunction<Output>(\n modelProvider,\n taskType,\n [input, model],\n {\n signal: signal,\n onProgress: update_progress,\n }\n );\n return result;\n };\n this.registerRunFn<Input, Output>(modelProvider, taskType, workerFn);\n }\n\n /**\n * Retrieves the direct execution function for a task type and model\n * Bypasses the job queue system for immediate execution\n */\n getDirectRunFn<Input extends TaskInput = TaskInput, Output extends TaskOutput = TaskOutput>(\n modelProvider: string,\n taskType: string\n ) {\n const taskTypeMap = this.runFnRegistry.get(taskType);\n const runFn = taskTypeMap?.get(modelProvider) as AiProviderRunFn<Input, Output> | undefined;\n if (!runFn) {\n throw new Error(\n `No run function found for task type ${taskType} and model provider ${modelProvider}`\n );\n }\n return runFn;\n }\n}\n\n// Singleton instance management for the ProviderRegistry\nlet providerRegistry: AiProviderRegistry;\nexport function getAiProviderRegistry() {\n if (!providerRegistry) providerRegistry = new AiProviderRegistry();\n return providerRegistry;\n}\nexport function setAiProviderRegistry(pr: AiProviderRegistry) {\n providerRegistry = pr;\n}\n",
|
|
7
|
+
"/**\n * @license\n * Copyright 2025 Steven Roussey <sroussey@gmail.com>\n * SPDX-License-Identifier: Apache-2.0\n */\n\nimport { InMemoryTabularRepository } from \"@workglow/storage\";\nimport { ModelRepository } from \"./ModelRepository\";\nimport { ModelPrimaryKeyNames, ModelRecordSchema } from \"./ModelSchema\";\n\n/**\n * In-memory implementation of a model repository.\n * Provides storage and retrieval for models and task-to-model mappings.\n */\nexport class InMemoryModelRepository extends ModelRepository {\n constructor() {\n super(new InMemoryTabularRepository(ModelRecordSchema, ModelPrimaryKeyNames));\n }\n}\n",
|
|
8
|
+
"/**\n * @license\n * Copyright 2025 Steven Roussey <sroussey@gmail.com>\n * SPDX-License-Identifier: Apache-2.0\n */\n\nimport { type TabularRepository } from \"@workglow/storage\";\nimport { EventEmitter, EventParameters } from \"@workglow/util\";\n\nimport { ModelPrimaryKeyNames, ModelRecord, ModelRecordSchema } from \"./ModelSchema\";\n\n/**\n * Events that can be emitted by the ModelRepository\n */\n\nexport type ModelEventListeners = {\n model_added: (model: ModelRecord) => void;\n model_removed: (model: ModelRecord) => void;\n model_updated: (model: ModelRecord) => void;\n};\n\nexport type ModelEvents = keyof ModelEventListeners;\n\nexport type ModelEventListener<Event extends ModelEvents> = ModelEventListeners[Event];\n\nexport type ModelEventParameters<Event extends ModelEvents> = EventParameters<\n ModelEventListeners,\n Event\n>;\n\n/**\n * Base class for managing AI models and their relationships with tasks.\n * Provides functionality for storing, retrieving, and managing the lifecycle of models\n * and their associations with specific tasks.\n */\nexport class ModelRepository {\n /**\n * Repository for storing and managing Model instances\n */\n protected readonly modelTabularRepository: TabularRepository<\n typeof ModelRecordSchema,\n typeof ModelPrimaryKeyNames\n >;\n constructor(\n modelTabularRepository: TabularRepository<typeof ModelRecordSchema, typeof ModelPrimaryKeyNames>\n ) {\n this.modelTabularRepository = modelTabularRepository;\n }\n\n /** Event emitter for repository events */\n protected events = new EventEmitter<ModelEventListeners>();\n\n /**\n * Sets up the database for the repository.\n * Must be called before using any other methods.\n */\n async setupDatabase(): Promise<void> {\n await this.modelTabularRepository.setupDatabase?.();\n }\n\n /**\n * Registers an event listener for the specified event\n * @param name - The event name to listen for\n * @param fn - The callback function to execute when the event occurs\n */\n on<Event extends ModelEvents>(name: Event, fn: ModelEventListener<Event>) {\n this.events.on(name, fn);\n }\n\n /**\n * Removes an event listener for the specified event\n * @param name - The event name to stop listening for\n * @param fn - The callback function to remove\n */\n off<Event extends ModelEvents>(name: Event, fn: ModelEventListener<Event>) {\n this.events.off(name, fn);\n }\n\n /**\n * Adds an event listener that will only be called once\n * @param name - The event name to listen for\n * @param fn - The callback function to execute when the event occurs\n */\n once<Event extends ModelEvents>(name: Event, fn: ModelEventListener<Event>) {\n this.events.once(name, fn);\n }\n\n /**\n * Returns when the event was emitted (promise form of once)\n * @param name - The event name to check\n * @returns a promise that resolves to the event listener parameters\n */\n waitOn<Event extends ModelEvents>(name: Event) {\n return this.events.waitOn(name);\n }\n\n /**\n * Adds a new model to the repository\n * @param model - The model instance to add\n */\n async addModel(model: ModelRecord) {\n await this.modelTabularRepository.put(model);\n this.events.emit(\"model_added\", model);\n return model;\n }\n\n /**\n * Finds all models associated with a specific task\n * @param task - The task identifier to search for\n * @returns Promise resolving to an array of associated models, or undefined if none found\n */\n async findModelsByTask(task: string) {\n if (typeof task != \"string\") return undefined;\n const allModels = await this.modelTabularRepository.getAll();\n if (!allModels || allModels.length === 0) return undefined;\n const models = allModels.filter((model) => model.tasks?.includes(task));\n if (models.length === 0) return undefined;\n return models;\n }\n\n /**\n * Finds all tasks associated with a specific model\n * @param model - The model identifier to search for\n * @returns Promise resolving to an array of associated tasks, or undefined if none found\n */\n async findTasksByModel(model_id: string) {\n if (typeof model_id != \"string\") return undefined;\n const modelRecord = await this.modelTabularRepository.get({ model_id });\n if (!modelRecord) return undefined;\n return modelRecord.tasks && modelRecord.tasks.length > 0 ? modelRecord.tasks : undefined;\n }\n\n /**\n * Enumerates all tasks in the repository\n * @returns Promise resolving to an array of task identifiers\n */\n async enumerateAllTasks() {\n const allModels = await this.modelTabularRepository.getAll();\n if (!allModels || allModels.length === 0) return undefined;\n const uniqueTasks = new Set<string>();\n for (const model of allModels) {\n if (model.tasks) {\n for (const task of model.tasks) {\n uniqueTasks.add(task);\n }\n }\n }\n return uniqueTasks.size > 0 ? Array.from(uniqueTasks) : undefined;\n }\n\n /**\n * Enumerates all models in the repository\n * @returns Promise resolving to an array of model instances\n */\n async enumerateAllModels() {\n const models = await this.modelTabularRepository.getAll();\n if (!models || models.length === 0) return undefined;\n return models;\n }\n\n /**\n * Retrieves a model by its identifier\n * @param modelId - The model_id of the model to find\n * @returns Promise resolving to the found model or undefined if not found\n */\n async findByName(model_id: string) {\n if (typeof model_id != \"string\") return undefined;\n const model = await this.modelTabularRepository.get({ model_id });\n return model ?? undefined;\n }\n\n /**\n * Gets the total number of models in the repository\n * @returns Promise resolving to the number of stored models\n */\n async size(): Promise<number> {\n return await this.modelTabularRepository.size();\n }\n}\n",
|
|
9
|
+
"/**\n * @license\n * Copyright 2025 Steven Roussey <sroussey@gmail.com>\n * SPDX-License-Identifier: Apache-2.0\n */\n\nimport { DataPortSchemaObject, FromSchema } from \"@workglow/util\";\n\n/**\n * A model configuration suitable for task/job inputs.\n *\n * @remarks\n * This is intentionally less strict than {@link ModelRecord} so jobs can carry only the\n * provider configuration required to execute, without requiring access to a model repository.\n */\nexport const ModelConfigSchema = {\n type: \"object\",\n properties: {\n model_id: { type: \"string\" },\n tasks: { type: \"array\", items: { type: \"string\" } },\n title: { type: \"string\" },\n description: { type: \"string\" },\n provider: { type: \"string\" },\n providerConfig: { type: \"object\", default: {} },\n metadata: { type: \"object\", default: {} },\n },\n required: [\"provider\", \"providerConfig\"],\n format: \"model\",\n additionalProperties: false,\n} as const satisfies DataPortSchemaObject;\n\n/**\n * A fully-specified model record suitable for persistence in a repository.\n */\nexport const ModelRecordSchema = {\n type: \"object\",\n properties: {\n ...ModelConfigSchema.properties,\n },\n required: [\"model_id\", \"tasks\", \"provider\", \"title\", \"description\", \"providerConfig\", \"metadata\"],\n format: \"model\",\n additionalProperties: false,\n} as const satisfies DataPortSchemaObject;\n\nexport type ModelConfig = FromSchema<typeof ModelConfigSchema>;\nexport type ModelRecord = FromSchema<typeof ModelRecordSchema>;\nexport const ModelPrimaryKeyNames = [\"model_id\"] as const;\n",
|
|
6
10
|
"/**\n * @license\n * Copyright 2025 Steven Roussey <sroussey@gmail.com>\n * SPDX-License-Identifier: Apache-2.0\n */\n\nimport { createServiceToken, globalServiceRegistry } from \"@workglow/util\";\nimport { InMemoryModelRepository } from \"./InMemoryModelRepository\";\nimport { ModelRepository } from \"./ModelRepository\";\n\n/**\n * Service token for the global model repository\n */\nexport const MODEL_REPOSITORY = createServiceToken<ModelRepository>(\"model.repository\");\n\n// Register default factory if not already registered\nif (!globalServiceRegistry.has(MODEL_REPOSITORY)) {\n globalServiceRegistry.register(\n MODEL_REPOSITORY,\n (): ModelRepository => new InMemoryModelRepository(),\n true\n );\n}\n\n/**\n * Gets the global model repository instance\n * @returns The model repository instance\n */\nexport function getGlobalModelRepository(): ModelRepository {\n return globalServiceRegistry.get(MODEL_REPOSITORY);\n}\n\n/**\n * Sets the global model repository instance\n * @param pr The model repository instance to register\n */\nexport function setGlobalModelRepository(pr: ModelRepository): void {\n globalServiceRegistry.registerInstance(MODEL_REPOSITORY, pr);\n}\n",
|
|
7
|
-
"/**\n * @license\n * Copyright 2025 Steven Roussey <sroussey@gmail.com>\n * SPDX-License-Identifier: Apache-2.0\n */\n\nimport { InMemoryTabularRepository } from \"@workglow/storage\";\nimport { ModelRepository } from \"./ModelRepository\";\nimport { ModelPrimaryKeyNames, ModelSchema } from \"./ModelSchema\";\n\n/**\n * In-memory implementation of a model repository.\n * Provides storage and retrieval for models and task-to-model mappings.\n */\nexport class InMemoryModelRepository extends ModelRepository {\n constructor() {\n super(new InMemoryTabularRepository(ModelSchema, ModelPrimaryKeyNames));\n }\n}\n",
|
|
8
|
-
"/**\n * @license\n * Copyright 2025 Steven Roussey <sroussey@gmail.com>\n * SPDX-License-Identifier: Apache-2.0\n */\n\nimport { type TabularRepository } from \"@workglow/storage\";\nimport { EventEmitter, EventParameters } from \"@workglow/util\";\n\nimport { ModelPrimaryKeyNames, ModelRecord, ModelSchema } from \"./ModelSchema\";\n\n/**\n * Events that can be emitted by the ModelRepository\n */\n\nexport type ModelEventListeners = {\n model_added: (model: ModelRecord) => void;\n model_removed: (model: ModelRecord) => void;\n model_updated: (model: ModelRecord) => void;\n};\n\nexport type ModelEvents = keyof ModelEventListeners;\n\nexport type ModelEventListener<Event extends ModelEvents> = ModelEventListeners[Event];\n\nexport type ModelEventParameters<Event extends ModelEvents> = EventParameters<\n ModelEventListeners,\n Event\n>;\n\n/**\n * Base class for managing AI models and their relationships with tasks.\n * Provides functionality for storing, retrieving, and managing the lifecycle of models\n * and their associations with specific tasks.\n */\nexport class ModelRepository {\n /**\n * Repository for storing and managing Model instances\n */\n protected readonly modelTabularRepository: TabularRepository<\n typeof ModelSchema,\n typeof ModelPrimaryKeyNames\n >;\n constructor(\n modelTabularRepository: TabularRepository<typeof ModelSchema, typeof ModelPrimaryKeyNames>\n ) {\n this.modelTabularRepository = modelTabularRepository;\n }\n\n /** Event emitter for repository events */\n protected events = new EventEmitter<ModelEventListeners>();\n\n /**\n * Sets up the database for the repository.\n * Must be called before using any other methods.\n */\n async setupDatabase(): Promise<void> {\n await this.modelTabularRepository.setupDatabase?.();\n }\n\n /**\n * Registers an event listener for the specified event\n * @param name - The event name to listen for\n * @param fn - The callback function to execute when the event occurs\n */\n on<Event extends ModelEvents>(name: Event, fn: ModelEventListener<Event>) {\n this.events.on(name, fn);\n }\n\n /**\n * Removes an event listener for the specified event\n * @param name - The event name to stop listening for\n * @param fn - The callback function to remove\n */\n off<Event extends ModelEvents>(name: Event, fn: ModelEventListener<Event>) {\n this.events.off(name, fn);\n }\n\n /**\n * Adds an event listener that will only be called once\n * @param name - The event name to listen for\n * @param fn - The callback function to execute when the event occurs\n */\n once<Event extends ModelEvents>(name: Event, fn: ModelEventListener<Event>) {\n this.events.once(name, fn);\n }\n\n /**\n * Returns when the event was emitted (promise form of once)\n * @param name - The event name to check\n * @returns a promise that resolves to the event listener parameters\n */\n waitOn<Event extends ModelEvents>(name: Event) {\n return this.events.waitOn(name);\n }\n\n /**\n * Adds a new model to the repository\n * @param model - The model instance to add\n */\n async addModel(model: ModelRecord) {\n await this.modelTabularRepository.put(model);\n this.events.emit(\"model_added\", model);\n return model;\n }\n\n /**\n * Finds all models associated with a specific task\n * @param task - The task identifier to search for\n * @returns Promise resolving to an array of associated models, or undefined if none found\n */\n async findModelsByTask(task: string) {\n if (typeof task != \"string\") return undefined;\n const allModels = await this.modelTabularRepository.getAll();\n if (!allModels || allModels.length === 0) return undefined;\n const models = allModels.filter((model) => model.tasks?.includes(task));\n if (models.length === 0) return undefined;\n return models;\n }\n\n /**\n * Finds all tasks associated with a specific model\n * @param model - The model identifier to search for\n * @returns Promise resolving to an array of associated tasks, or undefined if none found\n */\n async findTasksByModel(model_id: string) {\n if (typeof model_id != \"string\") return undefined;\n const modelRecord = await this.modelTabularRepository.get({ model_id });\n if (!modelRecord) return undefined;\n return modelRecord.tasks && modelRecord.tasks.length > 0 ? modelRecord.tasks : undefined;\n }\n\n /**\n * Enumerates all tasks in the repository\n * @returns Promise resolving to an array of task identifiers\n */\n async enumerateAllTasks() {\n const allModels = await this.modelTabularRepository.getAll();\n if (!allModels || allModels.length === 0) return undefined;\n const uniqueTasks = new Set<string>();\n for (const model of allModels) {\n if (model.tasks) {\n for (const task of model.tasks) {\n uniqueTasks.add(task);\n }\n }\n }\n return uniqueTasks.size > 0 ? Array.from(uniqueTasks) : undefined;\n }\n\n /**\n * Enumerates all models in the repository\n * @returns Promise resolving to an array of model instances\n */\n async enumerateAllModels() {\n const models = await this.modelTabularRepository.getAll();\n if (!models || models.length === 0) return undefined;\n return models;\n }\n\n /**\n * Retrieves a model by its identifier\n * @param modelId - The model_id of the model to find\n * @returns Promise resolving to the found model or undefined if not found\n */\n async findByName(model_id: string) {\n if (typeof model_id != \"string\") return undefined;\n const model = await this.modelTabularRepository.get({ model_id });\n return model ?? undefined;\n }\n\n /**\n * Gets the total number of models in the repository\n * @returns Promise resolving to the number of stored models\n */\n async size(): Promise<number> {\n return await this.modelTabularRepository.size();\n }\n}\n",
|
|
9
|
-
"/**\n * @license\n * Copyright 2025 Steven Roussey <sroussey@gmail.com>\n * SPDX-License-Identifier: Apache-2.0\n */\n\nimport { DataPortSchemaObject, FromSchema } from \"@workglow/util\";\n\nexport const ModelSchema = {\n type: \"object\",\n properties: {\n model_id: { type: \"string\" },\n tasks: { type: \"array\", items: { type: \"string\" } },\n title: { type: \"string\" },\n description: { type: \"string\" },\n provider: { type: \"string\" },\n providerConfig: { type: \"object\", default: {} },\n metadata: { type: \"object\", default: {} },\n },\n required: [\"model_id\", \"tasks\", \"provider\", \"title\", \"description\", \"providerConfig\", \"metadata\"],\n format: \"model\",\n additionalProperties: false,\n} as const satisfies DataPortSchemaObject;\n\nexport type ModelRecord = FromSchema<typeof ModelSchema>;\nexport const ModelPrimaryKeyNames = [\"model_id\"] as const;\n",
|
|
10
|
-
"/**\n * @license\n * Copyright 2025 Steven Roussey <sroussey@gmail.com>\n * SPDX-License-Identifier: Apache-2.0\n */\n\nimport { TaskInput, TaskOutput } from \"@workglow/task-graph\";\nimport { globalServiceRegistry, WORKER_MANAGER } from \"@workglow/util\";\nimport { ModelRecord } from \"../model/ModelSchema\";\n\n/**\n * Type for the run function for the AiJob\n */\nexport type AiProviderRunFn<\n Input extends TaskInput = TaskInput,\n Output extends TaskOutput = TaskOutput,\n Model extends ModelRecord = ModelRecord,\n> = (\n input: Input,\n model: Model | undefined,\n update_progress: (progress: number, message?: string, details?: any) => void,\n signal: AbortSignal\n) => Promise<Output>;\n\n/**\n * Registry that manages provider-specific task execution functions and job queues.\n * Handles the registration, retrieval, and execution of task processing functions\n * for different model providers and task types.\n */\nexport class AiProviderRegistry {\n runFnRegistry: Map<string, Map<string, AiProviderRunFn<any, any>>> = new Map();\n\n /**\n * Registers a task execution function for a specific task type and model provider\n * @param taskType - The type of task (e.g., 'text-generation', 'embedding')\n * @param modelProvider - The provider of the model (e.g., 'hf-transformers', 'tf-mediapipe', 'openai', etc)\n * @param runFn - The function that executes the task\n */\n registerRunFn<Input extends TaskInput = TaskInput, Output extends TaskOutput = TaskOutput>(\n modelProvider: string,\n taskType: string,\n runFn: AiProviderRunFn<Input, Output>\n ) {\n if (!this.runFnRegistry.has(taskType)) {\n this.runFnRegistry.set(taskType, new Map());\n }\n this.runFnRegistry.get(taskType)!.set(modelProvider, runFn);\n }\n\n registerAsWorkerRunFn<\n Input extends TaskInput = TaskInput,\n Output extends TaskOutput = TaskOutput,\n >(modelProvider: string, taskType: string) {\n const workerFn: AiProviderRunFn<Input, Output> = async (\n input: Input,\n model: ModelRecord | undefined,\n update_progress: (progress: number, message?: string, details?: any) => void,\n signal?: AbortSignal\n ) => {\n const workerManager = globalServiceRegistry.get(WORKER_MANAGER);\n const result = await workerManager.callWorkerFunction<Output>(\n modelProvider,\n taskType,\n [input, model],\n {\n signal: signal,\n onProgress: update_progress,\n }\n );\n return result;\n };\n this.registerRunFn<Input, Output>(modelProvider, taskType, workerFn);\n }\n\n /**\n * Retrieves the direct execution function for a task type and model\n * Bypasses the job queue system for immediate execution\n */\n getDirectRunFn<Input extends TaskInput = TaskInput, Output extends TaskOutput = TaskOutput>(\n modelProvider: string,\n taskType: string\n ) {\n const taskTypeMap = this.runFnRegistry.get(taskType);\n const runFn = taskTypeMap?.get(modelProvider) as AiProviderRunFn<Input, Output> | undefined;\n if (!runFn) {\n throw new Error(\n `No run function found for task type ${taskType} and model provider ${modelProvider}`\n );\n }\n return runFn;\n }\n}\n\n// Singleton instance management for the ProviderRegistry\nlet providerRegistry: AiProviderRegistry;\nexport function getAiProviderRegistry() {\n if (!providerRegistry) providerRegistry = new AiProviderRegistry();\n return providerRegistry;\n}\nexport function setAiProviderRegistry(pr: AiProviderRegistry) {\n providerRegistry = pr;\n}\n",
|
|
11
11
|
"/**\n * @license\n * Copyright 2025 Steven Roussey <sroussey@gmail.com>\n * SPDX-License-Identifier: Apache-2.0\n */\n\nenum DocumentType {\n DOCUMENT = \"document\",\n SECTION = \"section\",\n TEXT = \"text\",\n IMAGE = \"image\",\n TABLE = \"table\",\n}\n\nconst doc_variants = [\n \"tree\",\n \"flat\",\n \"tree-paragraphs\",\n \"flat-paragraphs\",\n \"tree-sentences\",\n \"flat-sentences\",\n] as const;\ntype DocVariant = (typeof doc_variants)[number];\nconst doc_parsers = [\"txt\", \"md\"] as const; // | \"html\" | \"pdf\" | \"csv\";\ntype DocParser = (typeof doc_parsers)[number];\n\nexport interface DocumentMetadata {\n title: string;\n}\n\nexport interface DocumentSectionMetadata {\n title: string;\n}\n\n/**\n * Represents a document with its content and metadata.\n */\nexport class Document {\n public metadata: DocumentMetadata;\n\n constructor(content?: ContentType, metadata: DocumentMetadata = { title: \"\" }) {\n this.metadata = metadata;\n if (content) {\n if (Array.isArray(content)) {\n for (const line of content) {\n this.addContent(line);\n }\n } else {\n this.addContent(content);\n }\n }\n }\n\n public addContent(content: ContentTypeItem) {\n if (typeof content === \"string\") {\n this.addText(content);\n } else if (content instanceof DocumentBaseFragment || content instanceof DocumentSection) {\n this.fragments.push(content);\n } else {\n throw new Error(\"Unknown content type\");\n }\n }\n\n public addSection(content?: ContentType, metadata?: DocumentSectionMetadata): DocumentSection {\n const section = new DocumentSection(this, content, metadata);\n this.fragments.push(section);\n return section;\n }\n\n public addText(content: string): TextFragment {\n const f = new TextFragment(content);\n this.fragments.push(f);\n return f;\n }\n public addImage(content: unknown): ImageFragment {\n const f = new ImageFragment(content);\n this.fragments.push(f);\n return f;\n }\n public addTable(content: unknown): TableFragment {\n const f = new TableFragment(content);\n this.fragments.push(f);\n return f;\n }\n\n public fragments: Array<DocumentFragment | DocumentSection> = [];\n\n toJSON(): unknown {\n return {\n type: DocumentType.DOCUMENT,\n metadata: this.metadata,\n fragments: this.fragments.map((f) => f.toJSON()),\n };\n }\n}\n\nexport class DocumentSection extends Document {\n constructor(\n public parent: Document,\n content?: ContentType,\n metadata?: DocumentSectionMetadata\n ) {\n super(content, metadata);\n this.parent = parent;\n }\n\n toJSON(): unknown {\n return {\n type: DocumentType.SECTION,\n metadata: this.metadata,\n fragments: this.fragments.map((f) => f.toJSON()),\n };\n }\n}\n\ninterface DocumentFragmentMetadata {}\n\nexport class DocumentBaseFragment {\n metadata?: DocumentFragmentMetadata;\n constructor(metadata?: DocumentFragmentMetadata) {\n this.metadata = metadata;\n }\n}\n\nexport class TextFragment extends DocumentBaseFragment {\n content: string;\n constructor(content: string, metadata?: DocumentFragmentMetadata) {\n super(metadata);\n this.content = content;\n }\n toJSON(): unknown {\n return {\n type: DocumentType.TEXT,\n metadata: this.metadata,\n content: this.content,\n };\n }\n}\n\nexport class TableFragment extends DocumentBaseFragment {\n content: any;\n constructor(content: any, metadata?: DocumentFragmentMetadata) {\n super(metadata);\n this.content = content;\n }\n toJSON(): unknown {\n return {\n type: DocumentType.TABLE,\n metadata: this.metadata,\n content: this.content,\n };\n }\n}\n\nexport class ImageFragment extends DocumentBaseFragment {\n content: any;\n constructor(content: any, metadata?: DocumentFragmentMetadata) {\n super(metadata);\n this.content = content;\n }\n toJSON(): unknown {\n return {\n type: DocumentType.IMAGE,\n metadata: this.metadata,\n content: this.content,\n };\n }\n}\n\nexport type DocumentFragment = TextFragment | TableFragment | ImageFragment;\n\nexport type ContentTypeItem = string | DocumentFragment | DocumentSection;\nexport type ContentType = ContentTypeItem | ContentTypeItem[];\n",
|
|
12
12
|
"/**\n * @license\n * Copyright 2025 Steven Roussey <sroussey@gmail.com>\n * SPDX-License-Identifier: Apache-2.0\n */\n\nimport { Document, DocumentMetadata } from \"./Document\";\n\n/**\n * Abstract class for converting different types of content into a Document.\n */\nexport abstract class DocumentConverter {\n public metadata: DocumentMetadata;\n constructor(metadata: DocumentMetadata) {\n this.metadata = metadata;\n }\n public abstract convert(): Document;\n}\n",
|
|
13
13
|
"/**\n * @license\n * Copyright 2025 Steven Roussey <sroussey@gmail.com>\n * SPDX-License-Identifier: Apache-2.0\n */\n\nimport { Document, type DocumentMetadata, type DocumentSection } from \"./Document\";\nimport { DocumentConverter } from \"./DocumentConverter\";\n\nexport class DocumentConverterMarkdown extends DocumentConverter {\n constructor(\n metadata: DocumentMetadata,\n public markdown: string\n ) {\n super(metadata);\n }\n public convert(): Document {\n const parser = new MarkdownParser(this.metadata.title);\n const document = parser.parse(this.markdown);\n return document;\n }\n}\n\nclass MarkdownParser {\n private document: Document;\n private currentSection: Document | DocumentSection;\n private textBuffer: string[] = []; // Buffer to accumulate text lines\n\n constructor(title: string) {\n this.document = new Document(title);\n this.currentSection = this.document;\n }\n\n parse(markdown: string): Document {\n const lines = markdown.split(\"\\n\");\n\n lines.forEach((line, index) => {\n if (this.isHeader(line)) {\n this.flushTextBuffer();\n const { level, content } = this.parseHeader(line);\n this.currentSection =\n level === 1 ? this.document.addSection(content) : this.currentSection.addSection(content);\n } else if (this.isTableStart(line)) {\n this.flushTextBuffer();\n const tableLines = this.collectTableLines(lines, index);\n this.currentSection.addTable(tableLines.join(\"\\n\"));\n } else if (this.isImageInline(line)) {\n this.parseLineWithPossibleImages(line);\n } else {\n this.textBuffer.push(line); // Accumulate text lines in the buffer\n }\n });\n\n this.flushTextBuffer(); // Flush any remaining text in the buffer\n return this.document;\n }\n\n private flushTextBuffer() {\n if (this.textBuffer.length > 0) {\n const textContent = this.textBuffer.join(\"\\n\").trim();\n if (textContent) {\n this.currentSection.addText(textContent);\n }\n this.textBuffer = []; // Clear the buffer after flushing\n }\n }\n\n private parseLineWithPossibleImages(line: string) {\n // Split the line by image markdown, keeping the delimiter (image markdown)\n const parts = line.split(/(!\\[.*?\\]\\(.*?\\))/).filter((part) => part !== \"\");\n parts.forEach((part) => {\n if (this.isImage(part)) {\n const { alt, src } = this.parseImage(part);\n this.flushTextBuffer();\n this.currentSection.addImage({ alt, src });\n } else {\n this.textBuffer.push(part);\n }\n });\n this.flushTextBuffer();\n }\n\n private isHeader(line: string): boolean {\n return /^#{1,6}\\s/.test(line);\n }\n\n private parseHeader(line: string): { level: number; content: string } {\n const match = line.match(/^(#{1,6})\\s+(.*)$/);\n return match ? { level: match[1].length, content: match[2] } : { level: 0, content: \"\" };\n }\n\n private isTableStart(line: string): boolean {\n return line.trim().startsWith(\"|\") && line.includes(\"|\", line.indexOf(\"|\") + 1);\n }\n\n private collectTableLines(lines: string[], startIndex: number): string[] {\n const tableLines = [];\n for (let i = startIndex; i < lines.length && this.isTableLine(lines[i]); i++) {\n tableLines.push(lines[i]);\n }\n return tableLines;\n }\n\n private isTableLine(line: string): boolean {\n return line.includes(\"|\");\n }\n\n private isImageInline(line: string): boolean {\n return line.includes(\";\n }\n\n private isImage(part: string): boolean {\n return /^!\\[.*\\]\\(.*\\)$/.test(part);\n }\n\n private parseImage(markdown: string): { alt: string; src: string } {\n const match = markdown.match(/^!\\[(.*)\\]\\((.*)\\)$/);\n return match ? { alt: match[1], src: match[2] } : { alt: \"\", src: \"\" };\n }\n}\n",
|
|
14
14
|
"/**\n * @license\n * Copyright 2025 Steven Roussey <sroussey@gmail.com>\n * SPDX-License-Identifier: Apache-2.0\n */\n\nimport { Document, DocumentMetadata } from \"./Document\";\nimport { DocumentConverter } from \"./DocumentConverter\";\n\nexport class DocumentConverterText extends DocumentConverter {\n constructor(\n metadata: DocumentMetadata,\n public text: string\n ) {\n super(metadata);\n }\n public convert(): Document {\n return new Document(this.text, this.metadata);\n }\n}\n",
|
|
15
|
-
"/**\n * @license\n * Copyright 2025 Steven Roussey <sroussey@gmail.com>\n * SPDX-License-Identifier: Apache-2.0\n */\n\nimport { CreateWorkflow, JobQueueTaskConfig, TaskRegistry, Workflow } from \"@workglow/task-graph\";\nimport { DataPortSchema, FromSchema } from \"@workglow/util\";\nimport {\n DeReplicateFromSchema,\n TypeImageInput,\n TypeModel,\n TypeReplicateArray,\n} from \"./base/AiTaskSchemas\";\nimport { AiVisionTask } from \"./base/AiVisionTask\";\n\nconst modelSchema = TypeReplicateArray(TypeModel(\"model:BackgroundRemovalTask\"));\n\nconst processedImageSchema = {\n type: \"string\",\n contentEncoding: \"base64\",\n contentMediaType: \"image/png\",\n title: \"Image\",\n description: \"Base64-encoded PNG image with transparent background\",\n} as const;\n\nexport const BackgroundRemovalInputSchema = {\n type: \"object\",\n properties: {\n image: TypeReplicateArray(TypeImageInput),\n model: modelSchema,\n },\n required: [\"image\", \"model\"],\n additionalProperties: false,\n} as const satisfies DataPortSchema;\n\nexport const BackgroundRemovalOutputSchema = {\n type: \"object\",\n properties: {\n image: {\n oneOf: [processedImageSchema, { type: \"array\", items: processedImageSchema }],\n title: processedImageSchema.title,\n description: processedImageSchema.description,\n },\n },\n required: [\"image\"],\n additionalProperties: false,\n} as const satisfies DataPortSchema;\n\nexport type BackgroundRemovalTaskInput = FromSchema<typeof BackgroundRemovalInputSchema>;\nexport type BackgroundRemovalTaskOutput = FromSchema<typeof BackgroundRemovalOutputSchema>;\nexport type BackgroundRemovalTaskExecuteInput = DeReplicateFromSchema<\n typeof BackgroundRemovalInputSchema\n>;\nexport type BackgroundRemovalTaskExecuteOutput = DeReplicateFromSchema<\n typeof BackgroundRemovalOutputSchema\n>;\n\n/**\n * Removes backgrounds from images using computer vision models\n */\nexport class BackgroundRemovalTask extends AiVisionTask<\n BackgroundRemovalTaskInput,\n BackgroundRemovalTaskOutput\n> {\n public static type = \"BackgroundRemovalTask\";\n public static category = \"AI Vision Model\";\n public static title = \"Background Removal\";\n public static description =\n \"Removes backgrounds from images, producing images with transparent backgrounds\";\n public static inputSchema(): DataPortSchema {\n return BackgroundRemovalInputSchema as DataPortSchema;\n }\n public static outputSchema(): DataPortSchema {\n return BackgroundRemovalOutputSchema as DataPortSchema;\n }\n}\n\nTaskRegistry.registerTask(BackgroundRemovalTask);\n\n/**\n * Convenience function to run background removal tasks.\n * Creates and executes a BackgroundRemovalTask with the provided input.\n * @param input The input parameters for background removal (image and model)\n * @returns Promise resolving to the image with transparent background\n */\nexport const
|
|
16
|
-
"/**\n * @license\n * Copyright 2025 Steven Roussey <sroussey@gmail.com>\n * SPDX-License-Identifier: Apache-2.0\n */\n\nimport {\n DataPortSchemaNonBoolean,\n FromSchema,\n FromSchemaDefaultOptions,\n FromSchemaOptions,\n JsonSchema,\n} from \"@workglow/util\";\nimport { ModelSchema } from \"../../model/ModelSchema\";\n\nexport type TypedArray =\n | Float64Array\n | Float32Array\n | Int32Array\n | Int16Array\n | Int8Array\n | Uint32Array\n | Uint16Array\n | Uint8Array\n | Uint8ClampedArray;\n\n// Type-only value for use in deserialize patterns\nconst TypedArrayType = null as any as TypedArray;\n\nconst TypedArraySchemaOptions = {\n ...FromSchemaDefaultOptions,\n deserialize: [\n // {\n // pattern: {\n // type: \"number\";\n // \"format\": \"BigInt\" | \"Float64\";\n // };\n // output: bigint;\n // },\n // {\n // pattern: {\n // type: \"number\";\n // \"format\": \"Float64Array\";\n // };\n // output: Float64Array;\n // },\n // {\n // pattern: {\n // type: \"number\";\n // \"format\": \"Float32Array\";\n // };\n // output: Float32Array;\n // },\n // {\n // pattern: {\n // type: \"number\";\n // \"format\": \"Int32Array\";\n // };\n // output: Int32Array;\n // },\n // {\n // pattern: {\n // type: \"number\";\n // \"format\": \"Int16Array\";\n // };\n // output: Int16Array;\n // },\n // {\n // pattern: {\n // type: \"number\";\n // \"format\": \"Int8Array\";\n // };\n // output: Int8Array;\n // },\n // {\n // pattern: {\n // type: \"number\";\n // \"format\": \"Uint8Array\";\n // };\n // output: Uint8Array;\n // },\n // {\n // pattern: {\n // type: \"number\";\n // \"format\": \"Uint16Array\";\n // };\n // output: Uint16Array;\n // },\n // {\n // pattern: {\n // type: \"number\";\n // \"format\": \"Uint32Array\";\n // };\n // output: Uint32Array;\n // },\n // {\n // pattern: { type: \"array\"; items: { type: \"number\" }; \"format\": \"Uint8ClampedArray\" };\n // output: Uint8ClampedArray;\n // },\n {\n pattern: { format: \"TypedArray\" },\n output: TypedArrayType,\n },\n ],\n} as const satisfies FromSchemaOptions;\n\nexport type TypedArraySchemaOptions = typeof TypedArraySchemaOptions;\n\nexport const TypedArraySchema = (annotations: Record<string, unknown> = {}) =>\n ({\n oneOf: [\n {\n type: \"array\",\n items: { type: \"number\", format: \"Float64\" },\n title: \"Float64Array\",\n description: \"A 64-bit floating point array\",\n format: \"Float64Array\",\n },\n {\n type: \"array\",\n items: { type: \"number\", format: \"Float32\" },\n title: \"Float32Array\",\n description: \"A 32-bit floating point array\",\n format: \"Float32Array\",\n },\n {\n type: \"array\",\n items: { type: \"number\", format: \"Int32\" },\n title: \"Int32Array\",\n description: \"A 32-bit integer array\",\n format: \"Int32Array\",\n },\n {\n type: \"array\",\n items: { type: \"number\", format: \"Int16\" },\n title: \"Int16Array\",\n description: \"A 16-bit integer array\",\n format: \"Int16Array\",\n },\n {\n type: \"array\",\n items: { type: \"number\", format: \"Int8\" },\n title: \"Int8Array\",\n },\n {\n type: \"array\",\n items: { type: \"number\", format: \"Uint8\" },\n title: \"Uint8Array\",\n description: \"A 8-bit unsigned integer array\",\n format: \"Uint8Array\",\n },\n {\n type: \"array\",\n items: { type: \"number\", format: \"Uint16\" },\n title: \"Uint16Array\",\n description: \"A 16-bit unsigned integer array\",\n format: \"Uint16Array\",\n },\n {\n type: \"array\",\n items: { type: \"number\", format: \"Uint32\" },\n title: \"Uint32Array\",\n description: \"A 32-bit unsigned integer array\",\n format: \"Uint32Array\",\n },\n {\n type: \"array\",\n items: { type: \"number\", format: \"Uint8Clamped\" },\n title: \"Uint8ClampedArray\",\n description: \"A 8-bit unsigned integer array with values clamped to 0-255\",\n format: \"Uint8ClampedArray\",\n },\n ],\n format: \"TypedArray\",\n ...annotations,\n }) as const satisfies JsonSchema;\n\nexport const TypeLanguage = (annotations: Record<string, unknown> = {}) =>\n ({\n type: \"string\",\n title: \"Language\",\n description: \"The language to use\",\n maxLength: 2,\n minLength: 2,\n ...annotations,\n }) as const;\n\nexport type TypeModelSemantic = \"model\" | `model:${string}`;\n\nexport type TTypeModel = DataPortSchemaNonBoolean & {\n readonly type: \"string\";\n readonly format: TypeModelSemantic;\n};\n\nexport function TypeModelAsString<\n S extends TypeModelSemantic = \"model\",\n O extends Record<string, unknown> = {},\n>(semantic: S = \"model\" as S, options: O = {} as O) {\n if (semantic !== \"model\" && !semantic.startsWith(\"model:\")) {\n throw new Error(\"Invalid semantic value\");\n }\n const taskName = semantic.startsWith(\"model:\")\n ? semantic\n .slice(6)\n .replace(/Task$/, \"\")\n .replaceAll(/[A-Z]/g, (char) => \" \" + char.toLowerCase())\n .trim()\n : null;\n return {\n title: \"Model\",\n description: `The model ${taskName ? `for ${taskName} ` : \"to use\"}`,\n ...options,\n format: semantic,\n type: \"string\",\n } as const satisfies JsonSchema;\n}\n\nexport function TypeModelByDetail<\n S extends TypeModelSemantic = \"model\",\n O extends Record<string, unknown> = {},\n>(semantic: S = \"model\" as S, options: O = {} as O) {\n if (semantic !== \"model\" && !semantic.startsWith(\"model:\")) {\n throw new Error(\"Invalid semantic value\");\n }\n return {\n ...ModelSchema,\n ...options,\n format: semantic,\n } as const satisfies JsonSchema;\n}\n\nexport function TypeModel<\n S extends TypeModelSemantic = \"model\",\n O extends Record<string, unknown> = {},\n>(semantic: S = \"model\" as S, options: O = {} as O) {\n return {\n oneOf: [TypeModelAsString<S, O>(semantic, options), TypeModelByDetail<S, O>(semantic, options)],\n ...options,\n format: semantic,\n } as const satisfies JsonSchema;\n}\n\nexport const TypeReplicateArray = <T extends DataPortSchemaNonBoolean>(\n type: T,\n annotations: Record<string, unknown> = {}\n) =>\n ({\n oneOf: [type, { type: \"array\", items: type }],\n title: type.title,\n description: type.description,\n ...(type.format ? { format: type.format } : {}),\n ...annotations,\n \"x-replicate\": true,\n }) as const;\n\nexport type TypedArrayFromSchema<SCHEMA extends JsonSchema> = FromSchema<\n SCHEMA,\n TypedArraySchemaOptions\n>;\n\n/**\n * Removes array types from a union, leaving only non-array types.\n * For example, `string | string[]` becomes `string`.\n * Used to extract the single-value type from schemas with x-replicate annotation.\n * Uses distributive conditional types to filter out arrays from unions.\n * Checks for both array types and types with numeric index signatures (FromSchema array output).\n * Preserves TypedArray types like Float64Array which also have numeric indices.\n */\ntype UnwrapArrayUnion<T> = T extends readonly any[]\n ? T extends TypedArray\n ? T\n : never\n : number extends keyof T\n ? \"push\" extends keyof T\n ? never\n : T\n : T;\n\n/**\n * Transforms a schema by removing array variants from properties marked with x-replicate.\n * Properties with x-replicate use {@link TypeReplicateArray} which creates a union of\n * `T | T[]`, and this type extracts just `T`.\n */\nexport type DeReplicateFromSchema<S extends { properties: Record<string, any> }> = {\n [K in keyof S[\"properties\"]]: S[\"properties\"][K] extends { \"x-replicate\": true }\n ? UnwrapArrayUnion<TypedArrayFromSchema<S[\"properties\"][K]>>\n : TypedArrayFromSchema<S[\"properties\"][K]>;\n};\n\nexport type ImageSource = ImageBitmap | OffscreenCanvas | VideoFrame;\n\n/**\n * Image input schema supporting URIs and base64-encoded images in multiple formats\n */\nexport const TypeImageInput = {\n oneOf: [\n {\n type: \"string\",\n title: \"Image Data\",\n description: \"Image as data-uri\",\n format: \"image:data-uri\",\n },\n {\n type: \"object\",\n additionalProperties: false,\n properties: {\n data: {\n oneOf: [\n {\n type: \"object\",\n format: \"image:ImageBitmap\",\n title: \"ImageBitmap\",\n },\n {\n type: \"object\",\n format: \"image:OffscreenCanvas\",\n title: \"OffscreenCanvas\",\n },\n {\n type: \"object\",\n format: \"image:VideoFrame\",\n title: \"VideoFrame\",\n },\n {\n type: \"object\",\n properties: {\n data: {\n type: \"array\",\n items: { type: \"number\", format: \"Uint8Clamped\" },\n format: \"Uint8ClampedArray\",\n title: \"Data\",\n description: \"Data of the image\",\n },\n width: { type: \"number\", title: \"Width\", description: \"Width of the image\" },\n height: { type: \"number\", title: \"Height\", description: \"Height of the image\" },\n channels: {\n type: \"number\",\n title: \"Channels\",\n description: \"Channels of the image\",\n },\n rawChannels: {\n type: \"number\",\n title: \"Raw Channels\",\n description: \"Raw channels of the image\",\n },\n },\n additionalProperties: false,\n required: [\"data\", \"width\", \"height\", \"channels\"],\n format: \"image:ImageBinary\",\n title: \"ImageBinary\",\n },\n ],\n },\n width: { type: \"number\", title: \"Width\", description: \"Width of the image\" },\n height: { type: \"number\", title: \"Height\", description: \"Height of the image\" },\n channels: {\n type: \"number\",\n title: \"Channels\",\n description: \"Channels of the image\",\n minimum: 1,\n maximum: 4,\n },\n },\n required: [\"data\", \"width\", \"height\", \"channels\"],\n },\n ],\n title: \"Image\",\n format: \"image\",\n description: \"Image as URL or base64-encoded data\",\n} as const satisfies JsonSchema;\n\n/**\n * Audio input schema supporting URIs and base64-encoded audio in multiple formats\n */\nexport const TypeAudioInput = {\n type: \"string\",\n title: \"Audio\",\n format: \"audio:data-uri\",\n description: \"Audio as data-uri, or Blob\",\n} as const satisfies JsonSchema;\n\n/**\n * Bounding box coordinates\n */\nexport const TypeBoundingBox = {\n type: \"object\",\n properties: {\n x: { type: \"number\", title: \"X coordinate\", description: \"Left edge of the bounding box\" },\n y: { type: \"number\", title: \"Y coordinate\", description: \"Top edge of the bounding box\" },\n width: { type: \"number\", title: \"Width\", description: \"Width of the bounding box\" },\n height: { type: \"number\", title: \"Height\", description: \"Height of the bounding box\" },\n },\n required: [\"x\", \"y\", \"width\", \"height\"],\n additionalProperties: false,\n title: \"Bounding Box\",\n description: \"Bounding box coordinates\",\n} as const satisfies JsonSchema;\n\n/**\n * Classification category with label and confidence score\n */\nexport const TypeCategory = {\n type: \"object\",\n properties: {\n label: { type: \"string\", title: \"Label\", description: \"Category label\" },\n score: {\n type: \"number\",\n title: \"Confidence Score\",\n description: \"Confidence score between 0 and 1\",\n minimum: 0,\n maximum: 1,\n },\n },\n required: [\"label\", \"score\"],\n additionalProperties: false,\n title: \"Category\",\n description: \"Classification category with label and score\",\n} as const satisfies JsonSchema;\n",
|
|
17
|
-
"/**\n * @license\n * Copyright 2025 Steven Roussey <sroussey@gmail.com>\n * SPDX-License-Identifier: Apache-2.0\n */\n\n/**\n * @description This file contains the implementation of the JobQueueTask class and its derived classes.\n */\n\nimport { JobQueueTaskConfig, TaskInput, type TaskOutput } from \"@workglow/task-graph\";\nimport { convertImageDataToUseableForm, ImageDataSupport } from \"@workglow/util\";\n\nimport { AiJobInput } from \"../../job/AiJob\";\nimport type {
|
|
18
|
-
"/**\n * @license\n * Copyright 2025 Steven Roussey <sroussey@gmail.com>\n * SPDX-License-Identifier: Apache-2.0\n */\n\n/**\n * @description This file contains the implementation of the JobQueueTask class and its derived classes.\n */\n\nimport { Job } from \"@workglow/job-queue\";\nimport {\n JobQueueTask,\n JobQueueTaskConfig,\n TaskConfigurationError,\n TaskInput,\n type TaskOutput,\n} from \"@workglow/task-graph\";\nimport { type JsonSchema } from \"@workglow/util\";\n\nimport { AiJob, AiJobInput } from \"../../job/AiJob\";\nimport { getGlobalModelRepository } from \"../../model/ModelRegistry\";\nimport type { ModelRecord } from \"../../model/ModelSchema\";\n\nfunction schemaFormat(schema: JsonSchema): string | undefined {\n return typeof schema === \"object\" && schema !== null && \"format\" in schema\n ? schema.format\n : undefined;\n}\n\nexport interface AiSingleTaskInput extends TaskInput {\n model: string;\n}\n\nexport interface AiArrayTaskInput extends TaskInput {\n model: string | ModelRecord | (string | ModelRecord)[];\n}\n\n/**\n * A base class for AI related tasks that run in a job queue.\n * Extends the JobQueueTask class to provide LLM-specific functionality.\n */\nexport class AiTask<\n Input extends AiArrayTaskInput = AiArrayTaskInput,\n Output extends TaskOutput = TaskOutput,\n Config extends JobQueueTaskConfig = JobQueueTaskConfig,\n> extends JobQueueTask<Input, Output, Config> {\n public static type: string = \"AiTask\";\n private modelCache?: { name: string; model: ModelRecord };\n\n /**\n * Creates a new AiTask instance\n * @param config - Configuration object for the task\n */\n constructor(input: Input = {} as Input, config: Config = {} as Config) {\n config.name ||= `${new.target.type || new.target.name}${\n input.model ? \" with model \" + input.model : \"\"\n }`;\n super(input, config);\n }\n\n // ========================================================================\n // Job creation\n // ========================================================================\n\n /**\n * Get the input to submit to the job queue.\n * Transforms the task input to AiJobInput format.\n * @param input - The task input\n * @returns The AiJobInput to submit to the queue\n */\n protected override async getJobInput(input: Input): Promise<AiJobInput<Input>> {\n if (typeof input.model !== \"string\") {\n console.error(\"AiTask: Model is not a string\", input);\n throw new TaskConfigurationError(\n \"AiTask: Model is not a string, only create job for single model tasks\"\n );\n }\n const runtype = (this.constructor as any).runtype ?? (this.constructor as any).type;\n const model = await this.getModelForInput(input as AiSingleTaskInput);\n\n // TODO: if the queue is not memory based, we need to convert to something that can structure clone to the queue\n // const registeredQueue = await this.resolveQueue(input);\n // const queueName = registeredQueue?.server.queueName;\n\n return {\n taskType: runtype,\n aiProvider: model.provider,\n taskInput: input as Input & { model: string },\n };\n }\n\n /**\n * Creates a new Job instance for direct execution (without a queue).\n * @param input - The task input\n * @param queueName - The queue name (if any)\n * @returns Promise<Job> - The created job\n */\n override async createJob(\n input: Input,\n queueName?: string\n ): Promise<Job<AiJobInput<Input>, Output>> {\n const jobInput = await this.getJobInput(input);\n const resolvedQueueName = queueName ?? (await this.getDefaultQueueName(input));\n if (!resolvedQueueName) {\n throw new TaskConfigurationError(\"JobQueueTask: Unable to determine queue for AI provider\");\n }\n const job = new AiJob<AiJobInput<Input>, Output>({\n queueName: resolvedQueueName,\n jobRunId: this.config.runnerId, // could be undefined\n input: jobInput,\n });\n return job;\n }\n\n protected async getModelForInput(input: AiSingleTaskInput): Promise<ModelRecord> {\n const modelname = input.model;\n if (!modelname) throw new TaskConfigurationError(\"AiTask: No model name found\");\n if (this.modelCache && this.modelCache.name === modelname) {\n return this.modelCache.model;\n }\n const model = await getGlobalModelRepository().findByName(modelname);\n if (!model) {\n throw new TaskConfigurationError(`JobQueueTask: No model ${modelname} found`);\n }\n this.modelCache = { name: modelname, model };\n return model;\n }\n\n protected override async getDefaultQueueName(input: Input): Promise<string | undefined> {\n if (typeof input.model === \"string\") {\n const model = await this.getModelForInput(input as AiSingleTaskInput);\n return model.provider;\n }\n return undefined;\n }\n\n /**\n * Validates that a model name really exists\n * @param schema The schema to validate against\n * @param item The item to validate\n * @returns True if the item is valid, false otherwise\n */\n async validateInput(input: Input): Promise<boolean> {\n // TODO(str): this is very inefficient, we should cache the results, including intermediate results\n const inputSchema = this.inputSchema();\n if (typeof inputSchema === \"boolean\") {\n if (inputSchema === false) {\n throw new TaskConfigurationError(`AiTask: Input schema is 'false' and accepts no inputs`);\n }\n return true;\n }\n const modelTaskProperties = Object.entries<JsonSchema>(\n (inputSchema.properties || {}) as Record<string, JsonSchema>\n ).filter(([key, schema]) => schemaFormat(schema)?.startsWith(\"model:\"));\n\n if (modelTaskProperties.length > 0) {\n const taskModels = await getGlobalModelRepository().findModelsByTask(this.type);\n for (const [key, propSchema] of modelTaskProperties) {\n let requestedModels = Array.isArray(input[key]) ? input[key] : [input[key]];\n for (const model of requestedModels) {\n const foundModel = taskModels?.find((m) => m.model_id === model);\n if (!foundModel) {\n throw new TaskConfigurationError(\n `AiTask: Missing model for '${key}' named '${model}' for task '${this.type}'`\n );\n }\n }\n }\n }\n\n const modelPlainProperties = Object.entries<JsonSchema>(\n (inputSchema.properties || {}) as Record<string, JsonSchema>\n ).filter(([key, schema]) => schemaFormat(schema) === \"model\");\n\n if (modelPlainProperties.length > 0) {\n for (const [key, propSchema] of modelPlainProperties) {\n let requestedModels = Array.isArray(input[key]) ? input[key] : [input[key]];\n for (const model of requestedModels) {\n const foundModel = await getGlobalModelRepository().findByName(model);\n if (!foundModel) {\n throw new TaskConfigurationError(`AiTask: Missing model for \"${key}\" named \"${model}\"`);\n }\n }\n }\n }\n\n return super.validateInput(input);\n }\n\n // dataflows can strip some models that are incompatible with the target task\n // if all of them are stripped, then the task will fail in validateInput\n async narrowInput(input: Input): Promise<Input> {\n // TODO(str): this is very inefficient, we should cache the results, including intermediate results\n const inputSchema = this.inputSchema();\n if (typeof inputSchema === \"boolean\") {\n if (inputSchema === false) {\n throw new TaskConfigurationError(`AiTask: Input schema is 'false' and accepts no inputs`);\n }\n return input;\n }\n const modelTaskProperties = Object.entries<JsonSchema>(\n (inputSchema.properties || {}) as Record<string, JsonSchema>\n ).filter(([key, schema]) => schemaFormat(schema)?.startsWith(\"model:\"));\n if (modelTaskProperties.length > 0) {\n const taskModels = await getGlobalModelRepository().findModelsByTask(this.type);\n for (const [key, propSchema] of modelTaskProperties) {\n let requestedModels = Array.isArray(input[key]) ? input[key] : [input[key]];\n let usingModels = requestedModels.filter((model: string) =>\n taskModels?.find((m) => m.model_id === model)\n );\n\n // we alter input to be the models that were found for this kind of input\n usingModels = usingModels.length > 1 ? usingModels : usingModels[0];\n (input as any)[key] = usingModels;\n }\n }\n return input;\n }\n}\n",
|
|
19
|
-
"/**\n * @license\n * Copyright 2025 Steven Roussey <sroussey@gmail.com>\n * SPDX-License-Identifier: Apache-2.0\n */\n\nimport {\n
|
|
20
|
-
"/**\n * @license\n * Copyright 2025 Steven Roussey <sroussey@gmail.com>\n * SPDX-License-Identifier: Apache-2.0\n */\n\nimport { CreateWorkflow, JobQueueTaskConfig, TaskRegistry, Workflow } from \"@workglow/task-graph\";\nimport { DataPortSchema, FromSchema } from \"@workglow/util\";\nimport { AiTask } from \"./base/AiTask\";\nimport { DeReplicateFromSchema, TypeModel, TypeReplicateArray } from \"./base/AiTaskSchemas\";\n\nconst modelSchema = TypeReplicateArray(TypeModel(\"model\"));\n\nconst DownloadModelInputSchema = {\n type: \"object\",\n properties: {\n model: modelSchema,\n },\n required: [\"model\"],\n additionalProperties: false,\n} as const satisfies DataPortSchema;\n\nconst DownloadModelOutputSchema = {\n type: \"object\",\n properties: {\n model: modelSchema,\n },\n required: [\"model\"],\n additionalProperties: false,\n} as const satisfies DataPortSchema;\n\nexport type DownloadModelTaskRunInput = FromSchema<typeof DownloadModelInputSchema>;\nexport type DownloadModelTaskRunOutput = FromSchema<typeof DownloadModelOutputSchema>;\nexport type DownloadModelTaskExecuteInput = DeReplicateFromSchema<typeof DownloadModelInputSchema>;\nexport type DownloadModelTaskExecuteOutput = DeReplicateFromSchema<\n typeof DownloadModelOutputSchema\n>;\n\n/**\n * Download a model from a remote source and cache it locally.\n *\n * @remarks\n * This task has a side effect of downloading the model and caching it locally outside of the task system\n */\nexport class DownloadModelTask extends AiTask<\n DownloadModelTaskRunInput,\n DownloadModelTaskRunOutput,\n JobQueueTaskConfig\n> {\n public static type = \"DownloadModelTask\";\n public static category = \"AI Text Model\";\n public static title = \"Download Model\";\n public static description = \"Downloads and caches AI models locally with progress tracking\";\n public static inputSchema(): DataPortSchema {\n return DownloadModelInputSchema satisfies DataPortSchema;\n }\n public static outputSchema(): DataPortSchema {\n return DownloadModelOutputSchema satisfies DataPortSchema;\n }\n public static cacheable = false;\n\n public files: { file: string; progress: number }[] = [];\n\n constructor(input: Partial<DownloadModelTaskRunInput>, config: JobQueueTaskConfig = {}) {\n super(input as DownloadModelTaskRunInput, config);\n this.on(\"progress\", this.processProgress.bind(this));\n this.on(\"start\", () => {\n this.files = [];\n });\n }\n\n /**\n * Handles progress updates for the download task\n * @param progress - The progress value (0-100)\n * @param message - The message to display\n * @param details - Additional details about the progress\n */\n processProgress(\n progress: number,\n message: string = \"\",\n details?: { file?: string; progress: number; text?: number }\n ): void {\n if (details?.file) {\n const file = this.files.find((f) => f.file === details.file);\n if (file) {\n file.progress = details.progress;\n } else {\n this.files.push({ file: details.file, progress: details.progress });\n }\n this.progress = this.files.reduce((acc, f) => acc + f.progress, 0) / this.files.length;\n } else {\n this.progress = progress;\n }\n }\n}\n\nTaskRegistry.registerTask(DownloadModelTask);\n\n/**\n * Download a model from a remote source and cache it locally.\n *\n * @param input - Input containing model(s) to download\n * @returns Promise resolving to the downloaded model(s)\n */\nexport const
|
|
21
|
-
"/**\n * @license\n * Copyright 2025 Steven Roussey <sroussey@gmail.com>\n * SPDX-License-Identifier: Apache-2.0\n */\n\nimport { CreateWorkflow, JobQueueTaskConfig, TaskRegistry, Workflow } from \"@workglow/task-graph\";\nimport { DataPortSchema, FromSchema } from \"@workglow/util\";\nimport {\n DeReplicateFromSchema,\n TypeImageInput,\n TypeModel,\n TypeReplicateArray,\n} from \"./base/AiTaskSchemas\";\nimport { AiVisionTask } from \"./base/AiVisionTask\";\n\nconst modelSchema = TypeReplicateArray(TypeModel(\"model:FaceDetectorTask\"));\n\n/**\n * A bounding box for face detection.\n */\nconst TypeBoundingBox = {\n type: \"object\",\n properties: {\n x: {\n type: \"number\",\n title: \"X Coordinate\",\n description: \"X coordinate of the top-left corner\",\n },\n y: {\n type: \"number\",\n title: \"Y Coordinate\",\n description: \"Y coordinate of the top-left corner\",\n },\n width: {\n type: \"number\",\n title: \"Width\",\n description: \"Width of the bounding box\",\n },\n height: {\n type: \"number\",\n title: \"Height\",\n description: \"Height of the bounding box\",\n },\n },\n required: [\"x\", \"y\", \"width\", \"height\"],\n additionalProperties: false,\n} as const;\n\n/**\n * A keypoint on the face.\n */\nconst TypeKeypoint = {\n type: \"object\",\n properties: {\n x: {\n type: \"number\",\n title: \"X Coordinate\",\n description: \"X coordinate normalized to [0.0, 1.0]\",\n },\n y: {\n type: \"number\",\n title: \"Y Coordinate\",\n description: \"Y coordinate normalized to [0.0, 1.0]\",\n },\n label: {\n type: \"string\",\n title: \"Keypoint Label\",\n description: \"Label for the keypoint (e.g., 'leftEye', 'rightEye', 'noseTip', etc.)\",\n },\n },\n required: [\"x\", \"y\"],\n additionalProperties: false,\n} as const;\n\n/**\n * A detected face with bounding box and keypoints.\n */\nconst TypeFaceDetection = {\n type: \"object\",\n properties: {\n box: TypeBoundingBox,\n keypoints: {\n type: \"array\",\n items: TypeKeypoint,\n title: \"Keypoints\",\n description: \"Facial keypoints (left eye, right eye, nose tip, mouth, left/right tragion)\",\n },\n score: {\n type: \"number\",\n title: \"Confidence Score\",\n description: \"Confidence score for the face detection\",\n },\n },\n required: [\"box\", \"keypoints\", \"score\"],\n additionalProperties: false,\n} as const;\n\nexport const FaceDetectorInputSchema = {\n type: \"object\",\n properties: {\n image: TypeReplicateArray(TypeImageInput),\n model: modelSchema,\n minDetectionConfidence: {\n type: \"number\",\n minimum: 0,\n maximum: 1,\n default: 0.5,\n title: \"Min Detection Confidence\",\n description: \"Minimum confidence score for face detection\",\n \"x-ui-group\": \"Configuration\",\n },\n minSuppressionThreshold: {\n type: \"number\",\n minimum: 0,\n maximum: 1,\n default: 0.3,\n title: \"Min Suppression Threshold\",\n description: \"Minimum non-maximum-suppression threshold for overlapping detections\",\n \"x-ui-group\": \"Configuration\",\n },\n },\n required: [\"image\", \"model\"],\n additionalProperties: false,\n} as const satisfies DataPortSchema;\n\nexport const FaceDetectorOutputSchema = {\n type: \"object\",\n properties: {\n faces: {\n oneOf: [\n { type: \"array\", items: TypeFaceDetection },\n { type: \"array\", items: { type: \"array\", items: TypeFaceDetection } },\n ],\n title: \"Face Detections\",\n description: \"Detected faces with bounding boxes, keypoints, and confidence scores\",\n },\n },\n required: [\"faces\"],\n additionalProperties: false,\n} as const satisfies DataPortSchema;\n\nexport type FaceDetectorTaskInput = FromSchema<typeof FaceDetectorInputSchema>;\nexport type FaceDetectorTaskOutput = FromSchema<typeof FaceDetectorOutputSchema>;\nexport type FaceDetectorTaskExecuteInput = DeReplicateFromSchema<typeof FaceDetectorInputSchema>;\nexport type FaceDetectorTaskExecuteOutput = DeReplicateFromSchema<typeof FaceDetectorOutputSchema>;\n\n/**\n * Detects faces in images using MediaPipe Face Detector.\n * Locates faces and identifies facial keypoints like eyes, nose, and mouth.\n */\nexport class FaceDetectorTask extends AiVisionTask<\n FaceDetectorTaskInput,\n FaceDetectorTaskOutput,\n JobQueueTaskConfig\n> {\n public static type = \"FaceDetectorTask\";\n public static category = \"AI Vision Model\";\n public static title = \"Face Detector\";\n public static description =\n \"Detects faces in images. Locates faces and identifies facial keypoints like eyes, nose, and mouth.\";\n public static inputSchema(): DataPortSchema {\n return FaceDetectorInputSchema as DataPortSchema;\n }\n public static outputSchema(): DataPortSchema {\n return FaceDetectorOutputSchema as DataPortSchema;\n }\n}\n\nTaskRegistry.registerTask(FaceDetectorTask);\n\n/**\n * Convenience function to run face detection tasks.\n * Creates and executes a FaceDetectorTask with the provided input.\n * @param input The input parameters for face detection (image, model, and optional configuration)\n * @returns Promise resolving to the detected faces with bounding boxes and keypoints\n */\nexport const
|
|
22
|
-
"/**\n * @license\n * Copyright 2025 Steven Roussey <sroussey@gmail.com>\n * SPDX-License-Identifier: Apache-2.0\n */\n\nimport { CreateWorkflow, JobQueueTaskConfig, TaskRegistry, Workflow } from \"@workglow/task-graph\";\nimport { DataPortSchema, FromSchema } from \"@workglow/util\";\nimport {\n DeReplicateFromSchema,\n TypeImageInput,\n TypeModel,\n TypeReplicateArray,\n} from \"./base/AiTaskSchemas\";\nimport { AiVisionTask } from \"./base/AiVisionTask\";\n\nconst modelSchema = TypeReplicateArray(TypeModel(\"model:FaceLandmarkerTask\"));\n\n/**\n * A landmark point with x, y, z coordinates.\n */\nconst TypeLandmark = {\n type: \"object\",\n properties: {\n x: {\n type: \"number\",\n title: \"X Coordinate\",\n description: \"X coordinate normalized to [0.0, 1.0]\",\n },\n y: {\n type: \"number\",\n title: \"Y Coordinate\",\n description: \"Y coordinate normalized to [0.0, 1.0]\",\n },\n z: {\n type: \"number\",\n title: \"Z Coordinate\",\n description: \"Z coordinate (depth)\",\n },\n },\n required: [\"x\", \"y\", \"z\"],\n additionalProperties: false,\n} as const;\n\n/**\n * A blendshape coefficient representing facial expression.\n */\nconst TypeBlendshape = {\n type: \"object\",\n properties: {\n label: {\n type: \"string\",\n title: \"Blendshape Label\",\n description: \"Name of the blendshape (e.g., 'browDownLeft', 'eyeBlinkRight', etc.)\",\n },\n score: {\n type: \"number\",\n title: \"Coefficient Value\",\n description: \"Coefficient value for this blendshape\",\n },\n },\n required: [\"label\", \"score\"],\n additionalProperties: false,\n} as const;\n\n/**\n * A 4x4 transformation matrix.\n */\nconst TypeTransformationMatrix = {\n type: \"array\",\n items: { type: \"number\" },\n minItems: 16,\n maxItems: 16,\n title: \"Transformation Matrix\",\n description: \"4x4 transformation matrix for face effects rendering\",\n} as const;\n\n/**\n * Detection result for a single face.\n */\nconst TypeFaceLandmarkerDetection = {\n type: \"object\",\n properties: {\n landmarks: {\n type: \"array\",\n items: TypeLandmark,\n title: \"Landmarks\",\n description: \"478 facial landmarks in image coordinates\",\n },\n blendshapes: {\n type: \"array\",\n items: TypeBlendshape,\n title: \"Blendshapes\",\n description: \"52 blendshape coefficients representing facial expressions\",\n },\n transformationMatrix: TypeTransformationMatrix,\n },\n required: [\"landmarks\"],\n additionalProperties: false,\n} as const;\n\nexport const FaceLandmarkerInputSchema = {\n type: \"object\",\n properties: {\n image: TypeReplicateArray(TypeImageInput),\n model: modelSchema,\n numFaces: {\n type: \"number\",\n minimum: 1,\n maximum: 10,\n default: 1,\n title: \"Number of Faces\",\n description: \"The maximum number of faces to detect\",\n \"x-ui-group\": \"Configuration\",\n },\n minFaceDetectionConfidence: {\n type: \"number\",\n minimum: 0,\n maximum: 1,\n default: 0.5,\n title: \"Min Face Detection Confidence\",\n description: \"Minimum confidence score for face detection\",\n \"x-ui-group\": \"Configuration\",\n },\n minFacePresenceConfidence: {\n type: \"number\",\n minimum: 0,\n maximum: 1,\n default: 0.5,\n title: \"Min Face Presence Confidence\",\n description: \"Minimum confidence score for face presence\",\n \"x-ui-group\": \"Configuration\",\n },\n minTrackingConfidence: {\n type: \"number\",\n minimum: 0,\n maximum: 1,\n default: 0.5,\n title: \"Min Tracking Confidence\",\n description: \"Minimum confidence score for face tracking\",\n \"x-ui-group\": \"Configuration\",\n },\n outputFaceBlendshapes: {\n type: \"boolean\",\n default: false,\n title: \"Output Face Blendshapes\",\n description: \"Whether to output blendshape coefficients for facial expressions\",\n \"x-ui-group\": \"Configuration\",\n },\n outputFacialTransformationMatrixes: {\n type: \"boolean\",\n default: false,\n title: \"Output Facial Transformation Matrix\",\n description: \"Whether to output transformation matrix for effects rendering\",\n \"x-ui-group\": \"Configuration\",\n },\n },\n required: [\"image\", \"model\"],\n additionalProperties: false,\n} as const satisfies DataPortSchema;\n\nexport const FaceLandmarkerOutputSchema = {\n type: \"object\",\n properties: {\n faces: {\n oneOf: [\n { type: \"array\", items: TypeFaceLandmarkerDetection },\n { type: \"array\", items: { type: \"array\", items: TypeFaceLandmarkerDetection } },\n ],\n title: \"Face Detections\",\n description: \"Detected faces with landmarks, blendshapes, and transformation matrices\",\n },\n },\n required: [\"faces\"],\n additionalProperties: false,\n} as const satisfies DataPortSchema;\n\nexport type FaceLandmarkerTaskInput = FromSchema<typeof FaceLandmarkerInputSchema>;\nexport type FaceLandmarkerTaskOutput = FromSchema<typeof FaceLandmarkerOutputSchema>;\nexport type FaceLandmarkerTaskExecuteInput = DeReplicateFromSchema<\n typeof FaceLandmarkerInputSchema\n>;\nexport type FaceLandmarkerTaskExecuteOutput = DeReplicateFromSchema<\n typeof FaceLandmarkerOutputSchema\n>;\n\n/**\n * Detects facial landmarks and expressions in images using MediaPipe Face Landmarker.\n * Identifies 478 facial landmarks, 52 blendshape coefficients for expressions,\n * and provides transformation matrices for AR effects.\n */\nexport class FaceLandmarkerTask extends AiVisionTask<\n FaceLandmarkerTaskInput,\n FaceLandmarkerTaskOutput,\n JobQueueTaskConfig\n> {\n public static type = \"FaceLandmarkerTask\";\n public static category = \"AI Vision Model\";\n public static title = \"Face Landmarker\";\n public static description =\n \"Detects facial landmarks and expressions in images. Identifies 478 facial landmarks, blendshapes for expressions, and transformation matrices for AR effects.\";\n public static inputSchema(): DataPortSchema {\n return FaceLandmarkerInputSchema as DataPortSchema;\n }\n public static outputSchema(): DataPortSchema {\n return FaceLandmarkerOutputSchema as DataPortSchema;\n }\n}\n\nTaskRegistry.registerTask(FaceLandmarkerTask);\n\n/**\n * Convenience function to run face landmark detection tasks.\n * Creates and executes a FaceLandmarkerTask with the provided input.\n * @param input The input parameters for face landmark detection (image, model, and optional configuration)\n * @returns Promise resolving to the detected facial landmarks, blendshapes, and transformation matrices\n */\nexport const
|
|
23
|
-
"/**\n * @license\n * Copyright 2025 Steven Roussey <sroussey@gmail.com>\n * SPDX-License-Identifier: Apache-2.0\n */\n\nimport { CreateWorkflow, JobQueueTaskConfig, TaskRegistry, Workflow } from \"@workglow/task-graph\";\nimport { DataPortSchema, FromSchema } from \"@workglow/util\";\nimport {\n DeReplicateFromSchema,\n TypeImageInput,\n TypeModel,\n TypeReplicateArray,\n} from \"./base/AiTaskSchemas\";\nimport { AiVisionTask } from \"./base/AiVisionTask\";\n\nconst modelSchema = TypeReplicateArray(TypeModel(\"model:GestureRecognizerTask\"));\n\n/**\n * A landmark point with x, y, z coordinates.\n */\nconst TypeLandmark = {\n type: \"object\",\n properties: {\n x: {\n type: \"number\",\n title: \"X Coordinate\",\n description: \"X coordinate normalized to [0.0, 1.0]\",\n },\n y: {\n type: \"number\",\n title: \"Y Coordinate\",\n description: \"Y coordinate normalized to [0.0, 1.0]\",\n },\n z: {\n type: \"number\",\n title: \"Z Coordinate\",\n description: \"Z coordinate (depth)\",\n },\n },\n required: [\"x\", \"y\", \"z\"],\n additionalProperties: false,\n} as const;\n\n/**\n * A recognized gesture with label and confidence score.\n */\nconst TypeGesture = {\n type: \"object\",\n properties: {\n label: {\n type: \"string\",\n title: \"Gesture Label\",\n description: \"The recognized gesture (e.g., 'Thumb_Up', 'Victory', etc.)\",\n },\n score: {\n type: \"number\",\n title: \"Confidence Score\",\n description: \"Confidence score for the gesture\",\n },\n },\n required: [\"label\", \"score\"],\n additionalProperties: false,\n} as const;\n\n/**\n * Handedness classification (left or right hand).\n */\nconst TypeHandedness = {\n type: \"object\",\n properties: {\n label: {\n type: \"string\",\n title: \"Hand Label\",\n description: \"Whether the hand is 'Left' or 'Right'\",\n },\n score: {\n type: \"number\",\n title: \"Confidence Score\",\n description: \"Confidence score for the handedness classification\",\n },\n },\n required: [\"label\", \"score\"],\n additionalProperties: false,\n} as const;\n\n/**\n * Detection result for a single hand.\n */\nconst TypeHandGestureDetection = {\n type: \"object\",\n properties: {\n gestures: {\n type: \"array\",\n items: TypeGesture,\n title: \"Gestures\",\n description: \"Recognized gestures for this hand\",\n },\n handedness: {\n type: \"array\",\n items: TypeHandedness,\n title: \"Handedness\",\n description: \"Handedness classification (left/right)\",\n },\n landmarks: {\n type: \"array\",\n items: TypeLandmark,\n title: \"Landmarks\",\n description: \"21 hand landmarks in image coordinates\",\n },\n worldLandmarks: {\n type: \"array\",\n items: TypeLandmark,\n title: \"World Landmarks\",\n description: \"21 hand landmarks in 3D world coordinates (meters)\",\n },\n },\n required: [\"gestures\", \"handedness\", \"landmarks\", \"worldLandmarks\"],\n additionalProperties: false,\n} as const;\n\nexport const GestureRecognizerInputSchema = {\n type: \"object\",\n properties: {\n image: TypeReplicateArray(TypeImageInput),\n model: modelSchema,\n numHands: {\n type: \"number\",\n minimum: 1,\n maximum: 10,\n default: 1,\n title: \"Number of Hands\",\n description: \"The maximum number of hands to detect\",\n \"x-ui-group\": \"Configuration\",\n },\n minHandDetectionConfidence: {\n type: \"number\",\n minimum: 0,\n maximum: 1,\n default: 0.5,\n title: \"Min Hand Detection Confidence\",\n description: \"Minimum confidence score for hand detection\",\n \"x-ui-group\": \"Configuration\",\n },\n minHandPresenceConfidence: {\n type: \"number\",\n minimum: 0,\n maximum: 1,\n default: 0.5,\n title: \"Min Hand Presence Confidence\",\n description: \"Minimum confidence score for hand presence\",\n \"x-ui-group\": \"Configuration\",\n },\n minTrackingConfidence: {\n type: \"number\",\n minimum: 0,\n maximum: 1,\n default: 0.5,\n title: \"Min Tracking Confidence\",\n description: \"Minimum confidence score for hand tracking\",\n \"x-ui-group\": \"Configuration\",\n },\n },\n required: [\"image\", \"model\"],\n additionalProperties: false,\n} as const satisfies DataPortSchema;\n\nexport const GestureRecognizerOutputSchema = {\n type: \"object\",\n properties: {\n hands: {\n oneOf: [\n { type: \"array\", items: TypeHandGestureDetection },\n { type: \"array\", items: { type: \"array\", items: TypeHandGestureDetection } },\n ],\n title: \"Hand Detections\",\n description: \"Detected hands with gestures, handedness, and landmarks\",\n },\n },\n required: [\"hands\"],\n additionalProperties: false,\n} as const satisfies DataPortSchema;\n\nexport type GestureRecognizerTaskInput = FromSchema<typeof GestureRecognizerInputSchema>;\nexport type GestureRecognizerTaskOutput = FromSchema<typeof GestureRecognizerOutputSchema>;\nexport type GestureRecognizerTaskExecuteInput = DeReplicateFromSchema<\n typeof GestureRecognizerInputSchema\n>;\nexport type GestureRecognizerTaskExecuteOutput = DeReplicateFromSchema<\n typeof GestureRecognizerOutputSchema\n>;\n\n/**\n * Recognizes hand gestures in images using MediaPipe Gesture Recognizer.\n * Detects hand landmarks, identifies gestures (like thumbs up, victory sign, etc.),\n * and classifies left vs. right hands.\n */\nexport class GestureRecognizerTask extends AiVisionTask<\n GestureRecognizerTaskInput,\n GestureRecognizerTaskOutput,\n JobQueueTaskConfig\n> {\n public static type = \"GestureRecognizerTask\";\n public static category = \"AI Vision Model\";\n public static title = \"Gesture Recognizer\";\n public static description =\n \"Recognizes hand gestures in images. Detects hand landmarks, identifies gestures (thumbs up, victory, etc.), and classifies handedness.\";\n public static inputSchema(): DataPortSchema {\n return GestureRecognizerInputSchema as DataPortSchema;\n }\n public static outputSchema(): DataPortSchema {\n return GestureRecognizerOutputSchema as DataPortSchema;\n }\n}\n\nTaskRegistry.registerTask(GestureRecognizerTask);\n\n/**\n * Convenience function to run gesture recognition tasks.\n * Creates and executes a GestureRecognizerTask with the provided input.\n * @param input The input parameters for gesture recognition (image, model, and optional configuration)\n * @returns Promise resolving to the detected gestures with landmarks and handedness\n */\nexport const
|
|
24
|
-
"/**\n * @license\n * Copyright 2025 Steven Roussey <sroussey@gmail.com>\n * SPDX-License-Identifier: Apache-2.0\n */\n\nimport { CreateWorkflow, JobQueueTaskConfig, TaskRegistry, Workflow } from \"@workglow/task-graph\";\nimport { DataPortSchema, FromSchema } from \"@workglow/util\";\nimport {\n DeReplicateFromSchema,\n TypeImageInput,\n TypeModel,\n TypeReplicateArray,\n} from \"./base/AiTaskSchemas\";\nimport { AiVisionTask } from \"./base/AiVisionTask\";\n\nconst modelSchema = TypeReplicateArray(TypeModel(\"model:HandLandmarkerTask\"));\n\n/**\n * A landmark point with x, y, z coordinates.\n */\nconst TypeLandmark = {\n type: \"object\",\n properties: {\n x: {\n type: \"number\",\n title: \"X Coordinate\",\n description: \"X coordinate normalized to [0.0, 1.0]\",\n },\n y: {\n type: \"number\",\n title: \"Y Coordinate\",\n description: \"Y coordinate normalized to [0.0, 1.0]\",\n },\n z: {\n type: \"number\",\n title: \"Z Coordinate\",\n description: \"Z coordinate (depth)\",\n },\n },\n required: [\"x\", \"y\", \"z\"],\n additionalProperties: false,\n} as const;\n\n/**\n * Handedness classification (left or right hand).\n */\nconst TypeHandedness = {\n type: \"object\",\n properties: {\n label: {\n type: \"string\",\n title: \"Hand Label\",\n description: \"Whether the hand is 'Left' or 'Right'\",\n },\n score: {\n type: \"number\",\n title: \"Confidence Score\",\n description: \"Confidence score for the handedness classification\",\n },\n },\n required: [\"label\", \"score\"],\n additionalProperties: false,\n} as const;\n\n/**\n * Detection result for a single hand.\n */\nconst TypeHandDetection = {\n type: \"object\",\n properties: {\n handedness: {\n type: \"array\",\n items: TypeHandedness,\n title: \"Handedness\",\n description: \"Handedness classification (left/right)\",\n },\n landmarks: {\n type: \"array\",\n items: TypeLandmark,\n title: \"Landmarks\",\n description: \"21 hand landmarks in image coordinates\",\n },\n worldLandmarks: {\n type: \"array\",\n items: TypeLandmark,\n title: \"World Landmarks\",\n description: \"21 hand landmarks in 3D world coordinates (meters)\",\n },\n },\n required: [\"handedness\", \"landmarks\", \"worldLandmarks\"],\n additionalProperties: false,\n} as const;\n\nexport const HandLandmarkerInputSchema = {\n type: \"object\",\n properties: {\n image: TypeReplicateArray(TypeImageInput),\n model: modelSchema,\n numHands: {\n type: \"number\",\n minimum: 1,\n maximum: 10,\n default: 1,\n title: \"Number of Hands\",\n description: \"The maximum number of hands to detect\",\n \"x-ui-group\": \"Configuration\",\n },\n minHandDetectionConfidence: {\n type: \"number\",\n minimum: 0,\n maximum: 1,\n default: 0.5,\n title: \"Min Hand Detection Confidence\",\n description: \"Minimum confidence score for hand detection\",\n \"x-ui-group\": \"Configuration\",\n },\n minHandPresenceConfidence: {\n type: \"number\",\n minimum: 0,\n maximum: 1,\n default: 0.5,\n title: \"Min Hand Presence Confidence\",\n description: \"Minimum confidence score for hand presence\",\n \"x-ui-group\": \"Configuration\",\n },\n minTrackingConfidence: {\n type: \"number\",\n minimum: 0,\n maximum: 1,\n default: 0.5,\n title: \"Min Tracking Confidence\",\n description: \"Minimum confidence score for hand tracking\",\n \"x-ui-group\": \"Configuration\",\n },\n },\n required: [\"image\", \"model\"],\n additionalProperties: false,\n} as const satisfies DataPortSchema;\n\nexport const HandLandmarkerOutputSchema = {\n type: \"object\",\n properties: {\n hands: {\n oneOf: [\n { type: \"array\", items: TypeHandDetection },\n { type: \"array\", items: { type: \"array\", items: TypeHandDetection } },\n ],\n title: \"Hand Detections\",\n description: \"Detected hands with handedness and landmarks\",\n },\n },\n required: [\"hands\"],\n additionalProperties: false,\n} as const satisfies DataPortSchema;\n\nexport type HandLandmarkerTaskInput = FromSchema<typeof HandLandmarkerInputSchema>;\nexport type HandLandmarkerTaskOutput = FromSchema<typeof HandLandmarkerOutputSchema>;\nexport type HandLandmarkerTaskExecuteInput = DeReplicateFromSchema<\n typeof HandLandmarkerInputSchema\n>;\nexport type HandLandmarkerTaskExecuteOutput = DeReplicateFromSchema<\n typeof HandLandmarkerOutputSchema\n>;\n\n/**\n * Detects hand landmarks in images using MediaPipe Hand Landmarker.\n * Identifies 21 hand landmarks and classifies left vs. right hands.\n */\nexport class HandLandmarkerTask extends AiVisionTask<\n HandLandmarkerTaskInput,\n HandLandmarkerTaskOutput,\n JobQueueTaskConfig\n> {\n public static type = \"HandLandmarkerTask\";\n public static category = \"AI Vision Model\";\n public static title = \"Hand Landmarker\";\n public static description =\n \"Detects hand landmarks in images. Identifies 21 hand landmarks and classifies left vs. right hands.\";\n public static inputSchema(): DataPortSchema {\n return HandLandmarkerInputSchema as DataPortSchema;\n }\n public static outputSchema(): DataPortSchema {\n return HandLandmarkerOutputSchema as DataPortSchema;\n }\n}\n\nTaskRegistry.registerTask(HandLandmarkerTask);\n\n/**\n * Convenience function to run hand landmark detection tasks.\n * Creates and executes a HandLandmarkerTask with the provided input.\n * @param input The input parameters for hand landmark detection (image, model, and optional configuration)\n * @returns Promise resolving to the detected hand landmarks and handedness\n */\nexport const
|
|
25
|
-
"/**\n * @license\n * Copyright 2025 Steven Roussey <sroussey@gmail.com>\n * SPDX-License-Identifier: Apache-2.0\n */\n\nimport { CreateWorkflow, JobQueueTaskConfig, TaskRegistry, Workflow } from \"@workglow/task-graph\";\nimport { DataPortSchema, FromSchema } from \"@workglow/util\";\nimport {\n DeReplicateFromSchema,\n TypeCategory,\n TypeImageInput,\n TypeModel,\n TypeReplicateArray,\n} from \"./base/AiTaskSchemas\";\nimport { AiVisionTask } from \"./base/AiVisionTask\";\n\nconst modelSchema = TypeReplicateArray(TypeModel(\"model:ImageClassificationTask\"));\n\nexport const ImageClassificationInputSchema = {\n type: \"object\",\n properties: {\n image: TypeReplicateArray(TypeImageInput),\n model: modelSchema,\n categories: {\n type: \"array\",\n items: {\n type: \"string\",\n },\n title: \"Categories\",\n description:\n \"List of candidate categories (optional, if provided uses zero-shot classification)\",\n \"x-ui-group\": \"Configuration\",\n },\n maxCategories: {\n type: \"number\",\n minimum: 1,\n maximum: 1000,\n default: 5,\n title: \"Max Categories\",\n description: \"The maximum number of categories to return\",\n \"x-ui-group\": \"Configuration\",\n },\n },\n required: [\"image\", \"model\"],\n additionalProperties: false,\n} as const satisfies DataPortSchema;\n\nexport const ImageClassificationOutputSchema = {\n type: \"object\",\n properties: {\n categories: {\n oneOf: [\n { type: \"array\", items: TypeCategory },\n { type: \"array\", items: { type: \"array\", items: TypeCategory } },\n ],\n title: \"Categories\",\n description: \"The classification categories with their scores\",\n },\n },\n required: [\"categories\"],\n additionalProperties: false,\n} as const satisfies DataPortSchema;\n\nexport type ImageClassificationTaskInput = FromSchema<typeof ImageClassificationInputSchema>;\nexport type ImageClassificationTaskOutput = FromSchema<typeof ImageClassificationOutputSchema>;\nexport type ImageClassificationTaskExecuteInput = DeReplicateFromSchema<\n typeof ImageClassificationInputSchema\n>;\nexport type ImageClassificationTaskExecuteOutput = DeReplicateFromSchema<\n typeof ImageClassificationOutputSchema\n>;\n\n/**\n * Classifies images into categories using vision models.\n * Automatically selects between regular and zero-shot classification based on whether categories are provided.\n */\nexport class ImageClassificationTask extends AiVisionTask<\n ImageClassificationTaskInput,\n ImageClassificationTaskOutput,\n JobQueueTaskConfig\n> {\n public static type = \"ImageClassificationTask\";\n public static category = \"AI Vision Model\";\n public static title = \"Image Classification\";\n public static description =\n \"Classifies images into categories using vision models. Supports zero-shot classification when categories are provided.\";\n public static inputSchema(): DataPortSchema {\n return ImageClassificationInputSchema as DataPortSchema;\n }\n public static outputSchema(): DataPortSchema {\n return ImageClassificationOutputSchema as DataPortSchema;\n }\n}\n\nTaskRegistry.registerTask(ImageClassificationTask);\n\n/**\n * Convenience function to run image classification tasks.\n * Creates and executes an ImageClassificationTask with the provided input.\n * @param input The input parameters for image classification (image, model, and optional categories)\n * @returns Promise resolving to the classification categories with scores\n */\nexport const
|
|
26
|
-
"/**\n * @license\n * Copyright 2025 Steven Roussey <sroussey@gmail.com>\n * SPDX-License-Identifier: Apache-2.0\n */\n\nimport { CreateWorkflow, JobQueueTaskConfig, TaskRegistry, Workflow } from \"@workglow/task-graph\";\nimport { DataPortSchema, FromSchema } from \"@workglow/util\";\nimport {\n DeReplicateFromSchema,\n TypedArraySchema,\n TypeImageInput,\n TypeModel,\n TypeReplicateArray,\n} from \"./base/AiTaskSchemas\";\nimport { AiVisionTask } from \"./base/AiVisionTask\";\n\nconst modelSchema = TypeReplicateArray(TypeModel(\"model:ImageEmbeddingTask\"));\n\nconst embeddingSchema = TypedArraySchema({\n title: \"Embedding\",\n description: \"The image embedding vector\",\n});\n\nexport const ImageEmbeddingInputSchema = {\n type: \"object\",\n properties: {\n image: TypeReplicateArray(TypeImageInput),\n model: modelSchema,\n },\n required: [\"image\", \"model\"],\n additionalProperties: false,\n} as const satisfies DataPortSchema;\n\nexport const ImageEmbeddingOutputSchema = {\n type: \"object\",\n properties: {\n vector: {\n oneOf: [embeddingSchema, { type: \"array\", items: embeddingSchema }],\n title: \"Embedding\",\n description: \"The image embedding vector\",\n },\n },\n required: [\"vector\"],\n additionalProperties: false,\n} as const satisfies DataPortSchema;\n\nexport type ImageEmbeddingTaskInput = FromSchema<typeof ImageEmbeddingInputSchema>;\nexport type ImageEmbeddingTaskOutput = FromSchema<typeof ImageEmbeddingOutputSchema>;\nexport type ImageEmbeddingTaskExecuteInput = DeReplicateFromSchema<\n typeof ImageEmbeddingInputSchema\n>;\nexport type ImageEmbeddingTaskExecuteOutput = DeReplicateFromSchema<\n typeof ImageEmbeddingOutputSchema\n>;\n\n/**\n * Generates embeddings from images using vision models\n */\nexport class ImageEmbeddingTask extends AiVisionTask<\n ImageEmbeddingTaskInput,\n ImageEmbeddingTaskOutput,\n JobQueueTaskConfig\n> {\n public static type = \"ImageEmbeddingTask\";\n public static category = \"AI Vision Model\";\n public static title = \"Image Embedding\";\n public static description = \"Generates embeddings from images using vision models\";\n public static inputSchema(): DataPortSchema {\n return ImageEmbeddingInputSchema as DataPortSchema;\n }\n public static outputSchema(): DataPortSchema {\n return ImageEmbeddingOutputSchema as DataPortSchema;\n }\n}\n\nTaskRegistry.registerTask(ImageEmbeddingTask);\n\n/**\n * Convenience function to run image embedding tasks.\n * Creates and executes an ImageEmbeddingTask with the provided input.\n * @param input The input parameters for image embedding (image and model)\n * @returns Promise resolving to the image embedding vector\n */\nexport const
|
|
27
|
-
"/**\n * @license\n * Copyright 2025 Steven Roussey <sroussey@gmail.com>\n * SPDX-License-Identifier: Apache-2.0\n */\n\nimport { CreateWorkflow, JobQueueTaskConfig, TaskRegistry, Workflow } from \"@workglow/task-graph\";\nimport { DataPortSchema, FromSchema } from \"@workglow/util\";\nimport {\n DeReplicateFromSchema,\n TypeImageInput,\n TypeModel,\n TypeReplicateArray,\n} from \"./base/AiTaskSchemas\";\nimport { AiVisionTask } from \"./base/AiVisionTask\";\n\nconst modelSchema = TypeReplicateArray(TypeModel(\"model:ImageSegmentationTask\"));\n\nexport const ImageSegmentationInputSchema = {\n type: \"object\",\n properties: {\n image: TypeReplicateArray(TypeImageInput),\n model: modelSchema,\n threshold: {\n type: \"number\",\n title: \"Threshold\",\n description: \"The threshold for filtering masks by score\",\n minimum: 0,\n maximum: 1,\n default: 0.5,\n \"x-ui-group\": \"Configuration\",\n },\n maskThreshold: {\n type: \"number\",\n title: \"Mask Threshold\",\n description: \"Threshold to use when turning predicted masks into binary values\",\n minimum: 0,\n maximum: 1,\n default: 0.5,\n \"x-ui-group\": \"Configuration\",\n },\n },\n required: [\"image\", \"model\"],\n additionalProperties: false,\n} as const satisfies DataPortSchema;\n\nconst segmentationMaskSchema = {\n type: \"object\",\n properties: {\n label: {\n type: \"string\",\n title: \"Label\",\n description: \"The label of the segmented region\",\n },\n score: {\n type: \"number\",\n title: \"Score\",\n description: \"The confidence score for this segmentation\",\n minimum: 0,\n maximum: 1,\n },\n mask: {\n type: \"object\",\n format: \"image\",\n title: \"Mask\",\n description: \"Mask image\",\n },\n },\n required: [\"label\", \"score\", \"mask\"],\n additionalProperties: false,\n} as const;\n\nexport const ImageSegmentationOutputSchema = {\n type: \"object\",\n properties: {\n masks: {\n oneOf: [\n { type: \"array\", items: segmentationMaskSchema },\n { type: \"array\", items: { type: \"array\", items: segmentationMaskSchema } },\n ],\n title: \"Segmentation Masks\",\n description: \"The segmented regions with their labels, scores, and masks\",\n },\n },\n required: [\"masks\"],\n additionalProperties: false,\n} as const satisfies DataPortSchema;\n\nexport type ImageSegmentationTaskInput = FromSchema<typeof ImageSegmentationInputSchema>;\nexport type ImageSegmentationTaskOutput = FromSchema<typeof ImageSegmentationOutputSchema>;\nexport type ImageSegmentationTaskExecuteInput = DeReplicateFromSchema<\n typeof ImageSegmentationInputSchema\n>;\nexport type ImageSegmentationTaskExecuteOutput = DeReplicateFromSchema<\n typeof ImageSegmentationOutputSchema\n>;\n\n/**\n * Segments images into regions using computer vision models\n */\nexport class ImageSegmentationTask extends AiVisionTask<\n ImageSegmentationTaskInput,\n ImageSegmentationTaskOutput,\n JobQueueTaskConfig\n> {\n public static type = \"ImageSegmentationTask\";\n public static category = \"AI Vision Model\";\n public static title = \"Image Segmentation\";\n public static description =\n \"Segments images into regions with labels using computer vision models\";\n public static inputSchema(): DataPortSchema {\n return ImageSegmentationInputSchema as DataPortSchema;\n }\n public static outputSchema(): DataPortSchema {\n return ImageSegmentationOutputSchema as DataPortSchema;\n }\n}\n\nTaskRegistry.registerTask(ImageSegmentationTask);\n\n/**\n * Convenience function to run image segmentation tasks.\n * Creates and executes an ImageSegmentationTask with the provided input.\n * @param input The input parameters for image segmentation (image and model)\n * @returns Promise resolving to the segmentation masks with labels and scores\n */\nexport const
|
|
28
|
-
"/**\n * @license\n * Copyright 2025 Steven Roussey <sroussey@gmail.com>\n * SPDX-License-Identifier: Apache-2.0\n */\n\nimport { CreateWorkflow, JobQueueTaskConfig, TaskRegistry, Workflow } from \"@workglow/task-graph\";\nimport { DataPortSchema, FromSchema } from \"@workglow/util\";\nimport {\n DeReplicateFromSchema,\n TypeImageInput,\n TypeModel,\n TypeReplicateArray,\n} from \"./base/AiTaskSchemas\";\nimport { AiVisionTask } from \"./base/AiVisionTask\";\n\nconst modelSchema = TypeReplicateArray(TypeModel(\"model:ImageToTextTask\"));\n\nconst generatedTextSchema = {\n type: \"string\",\n title: \"Text\",\n description: \"The generated text description\",\n} as const;\n\nexport const ImageToTextInputSchema = {\n type: \"object\",\n properties: {\n image: TypeReplicateArray(TypeImageInput),\n model: modelSchema,\n maxTokens: {\n type: \"number\",\n title: \"Max Tokens\",\n description: \"The maximum number of tokens to generate\",\n minimum: 1,\n maximum: 4096,\n \"x-ui-group\": \"Configuration\",\n },\n },\n required: [\"image\", \"model\"],\n additionalProperties: false,\n} as const satisfies DataPortSchema;\n\nexport const ImageToTextOutputSchema = {\n type: \"object\",\n properties: {\n text: {\n oneOf: [generatedTextSchema, { type: \"array\", items: generatedTextSchema }],\n title: generatedTextSchema.title,\n description: generatedTextSchema.description,\n },\n },\n required: [\"text\"],\n additionalProperties: false,\n} as const satisfies DataPortSchema;\n\nexport type ImageToTextTaskInput = FromSchema<typeof ImageToTextInputSchema>;\nexport type ImageToTextTaskOutput = FromSchema<typeof ImageToTextOutputSchema>;\nexport type ImageToTextTaskExecuteInput = DeReplicateFromSchema<typeof ImageToTextInputSchema>;\nexport type ImageToTextTaskExecuteOutput = DeReplicateFromSchema<typeof ImageToTextOutputSchema>;\n\n/**\n * Generates text descriptions from images using vision-language models\n */\nexport class ImageToTextTask extends AiVisionTask<\n ImageToTextTaskInput,\n ImageToTextTaskOutput,\n JobQueueTaskConfig\n> {\n public static type = \"ImageToTextTask\";\n public static category = \"AI Vision Model\";\n public static title = \"Image to Text\";\n public static description =\n \"Generates text descriptions from images using vision-language models\";\n public static inputSchema(): DataPortSchema {\n return ImageToTextInputSchema as DataPortSchema;\n }\n public static outputSchema(): DataPortSchema {\n return ImageToTextOutputSchema as DataPortSchema;\n }\n}\n\nTaskRegistry.registerTask(ImageToTextTask);\n\n/**\n * Convenience function to run image to text tasks.\n * Creates and executes an ImageToTextTask with the provided input.\n * @param input The input parameters for image to text (image and model)\n * @returns Promise resolving to the generated text description\n */\nexport const
|
|
29
|
-
"/**\n * @license\n * Copyright 2025 Steven Roussey <sroussey@gmail.com>\n * SPDX-License-Identifier: Apache-2.0\n */\n\nimport { CreateWorkflow, JobQueueTaskConfig, TaskRegistry, Workflow } from \"@workglow/task-graph\";\nimport { DataPortSchema, FromSchema } from \"@workglow/util\";\nimport {\n DeReplicateFromSchema,\n TypeBoundingBox,\n TypeImageInput,\n TypeModel,\n TypeReplicateArray,\n} from \"./base/AiTaskSchemas\";\nimport { AiVisionTask } from \"./base/AiVisionTask\";\n\nconst modelSchema = TypeReplicateArray(TypeModel(\"model:ObjectDetectionTask\"));\n\nconst detectionSchema = {\n type: \"object\",\n properties: {\n label: {\n type: \"string\",\n title: \"Label\",\n description: \"The label of the detected object\",\n },\n score: {\n type: \"number\",\n title: \"Confidence Score\",\n description: \"The confidence score for this detection\",\n minimum: 0,\n maximum: 1,\n },\n box: TypeBoundingBox,\n },\n required: [\"label\", \"score\", \"box\"],\n additionalProperties: false,\n} as const;\n\nexport const ObjectDetectionInputSchema = {\n type: \"object\",\n properties: {\n image: TypeReplicateArray(TypeImageInput),\n model: modelSchema,\n labels: {\n type: \"array\",\n items: {\n type: \"string\",\n },\n title: \"Labels\",\n description:\n \"List of object labels to detect (optional, if provided uses zero-shot detection)\",\n \"x-ui-group\": \"Configuration\",\n },\n threshold: {\n type: \"number\",\n title: \"Threshold\",\n description: \"The threshold for filtering detections by score\",\n minimum: 0,\n maximum: 1,\n default: 0.5,\n \"x-ui-group\": \"Configuration\",\n },\n },\n required: [\"image\", \"model\"],\n additionalProperties: false,\n} as const satisfies DataPortSchema;\n\nexport const ObjectDetectionOutputSchema = {\n type: \"object\",\n properties: {\n detections: {\n oneOf: [\n { type: \"array\", items: detectionSchema },\n { type: \"array\", items: { type: \"array\", items: detectionSchema } },\n ],\n title: \"Detections\",\n description: \"The detected objects with their labels, scores, and bounding boxes\",\n },\n },\n required: [\"detections\"],\n additionalProperties: false,\n} as const satisfies DataPortSchema;\n\nexport type ObjectDetectionTaskInput = FromSchema<typeof ObjectDetectionInputSchema>;\nexport type ObjectDetectionTaskOutput = FromSchema<typeof ObjectDetectionOutputSchema>;\nexport type ObjectDetectionTaskExecuteInput = DeReplicateFromSchema<\n typeof ObjectDetectionInputSchema\n>;\nexport type ObjectDetectionTaskExecuteOutput = DeReplicateFromSchema<\n typeof ObjectDetectionOutputSchema\n>;\n\n/**\n * Detects objects in images using vision models.\n * Automatically selects between regular and zero-shot detection based on whether labels are provided.\n */\nexport class ObjectDetectionTask extends AiVisionTask<\n ObjectDetectionTaskInput,\n ObjectDetectionTaskOutput,\n JobQueueTaskConfig\n> {\n public static type = \"ObjectDetectionTask\";\n public static category = \"AI Vision Model\";\n public static title = \"Object Detection\";\n public static description =\n \"Detects objects in images using vision models. Supports zero-shot detection when labels are provided.\";\n public static inputSchema(): DataPortSchema {\n return ObjectDetectionInputSchema as DataPortSchema;\n }\n public static outputSchema(): DataPortSchema {\n return ObjectDetectionOutputSchema as DataPortSchema;\n }\n}\n\nTaskRegistry.registerTask(ObjectDetectionTask);\n\n/**\n * Convenience function to run object detection tasks.\n * Creates and executes an ObjectDetectionTask with the provided input.\n * @param input The input parameters for object detection (image, model, and optional labels)\n * @returns Promise resolving to the detected objects with labels, scores, and bounding boxes\n */\nexport const
|
|
30
|
-
"/**\n * @license\n * Copyright 2025 Steven Roussey <sroussey@gmail.com>\n * SPDX-License-Identifier: Apache-2.0\n */\n\nimport { CreateWorkflow, JobQueueTaskConfig, TaskRegistry, Workflow } from \"@workglow/task-graph\";\nimport { DataPortSchema, FromSchema } from \"@workglow/util\";\nimport {\n DeReplicateFromSchema,\n TypeImageInput,\n TypeModel,\n TypeReplicateArray,\n} from \"./base/AiTaskSchemas\";\nimport { AiVisionTask } from \"./base/AiVisionTask\";\n\nconst modelSchema = TypeReplicateArray(TypeModel(\"model:PoseLandmarkerTask\"));\n\n/**\n * A landmark point with x, y, z coordinates and visibility/presence scores.\n */\nconst TypePoseLandmark = {\n type: \"object\",\n properties: {\n x: {\n type: \"number\",\n title: \"X Coordinate\",\n description: \"X coordinate normalized to [0.0, 1.0]\",\n },\n y: {\n type: \"number\",\n title: \"Y Coordinate\",\n description: \"Y coordinate normalized to [0.0, 1.0]\",\n },\n z: {\n type: \"number\",\n title: \"Z Coordinate\",\n description: \"Z coordinate (depth)\",\n },\n visibility: {\n type: \"number\",\n title: \"Visibility\",\n description: \"Likelihood of the landmark being visible within the image\",\n },\n presence: {\n type: \"number\",\n title: \"Presence\",\n description: \"Likelihood of the landmark being present in the image\",\n },\n },\n required: [\"x\", \"y\", \"z\"],\n additionalProperties: false,\n} as const;\n\n/**\n * A segmentation mask for the detected person.\n */\nconst TypeSegmentationMask = {\n type: \"object\",\n properties: {\n data: {\n type: \"object\",\n title: \"Mask Data\",\n description: \"Canvas or image data containing the segmentation mask\",\n },\n width: {\n type: \"number\",\n title: \"Width\",\n description: \"Width of the segmentation mask\",\n },\n height: {\n type: \"number\",\n title: \"Height\",\n description: \"Height of the segmentation mask\",\n },\n },\n required: [\"data\", \"width\", \"height\"],\n additionalProperties: false,\n} as const;\n\n/**\n * Detection result for a single pose.\n */\nconst TypePoseDetection = {\n type: \"object\",\n properties: {\n landmarks: {\n type: \"array\",\n items: TypePoseLandmark,\n title: \"Landmarks\",\n description: \"33 pose landmarks in image coordinates\",\n },\n worldLandmarks: {\n type: \"array\",\n items: TypePoseLandmark,\n title: \"World Landmarks\",\n description: \"33 pose landmarks in 3D world coordinates (meters)\",\n },\n segmentationMask: TypeSegmentationMask,\n },\n required: [\"landmarks\", \"worldLandmarks\"],\n additionalProperties: false,\n} as const;\n\nexport const PoseLandmarkerInputSchema = {\n type: \"object\",\n properties: {\n image: TypeReplicateArray(TypeImageInput),\n model: modelSchema,\n numPoses: {\n type: \"number\",\n minimum: 1,\n maximum: 10,\n default: 1,\n title: \"Number of Poses\",\n description: \"The maximum number of poses to detect\",\n \"x-ui-group\": \"Configuration\",\n },\n minPoseDetectionConfidence: {\n type: \"number\",\n minimum: 0,\n maximum: 1,\n default: 0.5,\n title: \"Min Pose Detection Confidence\",\n description: \"Minimum confidence score for pose detection\",\n \"x-ui-group\": \"Configuration\",\n },\n minPosePresenceConfidence: {\n type: \"number\",\n minimum: 0,\n maximum: 1,\n default: 0.5,\n title: \"Min Pose Presence Confidence\",\n description: \"Minimum confidence score for pose presence\",\n \"x-ui-group\": \"Configuration\",\n },\n minTrackingConfidence: {\n type: \"number\",\n minimum: 0,\n maximum: 1,\n default: 0.5,\n title: \"Min Tracking Confidence\",\n description: \"Minimum confidence score for pose tracking\",\n \"x-ui-group\": \"Configuration\",\n },\n outputSegmentationMasks: {\n type: \"boolean\",\n default: false,\n title: \"Output Segmentation Masks\",\n description: \"Whether to output segmentation masks for detected poses\",\n \"x-ui-group\": \"Configuration\",\n },\n },\n required: [\"image\", \"model\"],\n additionalProperties: false,\n} as const satisfies DataPortSchema;\n\nexport const PoseLandmarkerOutputSchema = {\n type: \"object\",\n properties: {\n poses: {\n oneOf: [\n { type: \"array\", items: TypePoseDetection },\n { type: \"array\", items: { type: \"array\", items: TypePoseDetection } },\n ],\n title: \"Pose Detections\",\n description: \"Detected poses with landmarks and optional segmentation masks\",\n },\n },\n required: [\"poses\"],\n additionalProperties: false,\n} as const satisfies DataPortSchema;\n\nexport type PoseLandmarkerTaskInput = FromSchema<typeof PoseLandmarkerInputSchema>;\nexport type PoseLandmarkerTaskOutput = FromSchema<typeof PoseLandmarkerOutputSchema>;\nexport type PoseLandmarkerTaskExecuteInput = DeReplicateFromSchema<\n typeof PoseLandmarkerInputSchema\n>;\nexport type PoseLandmarkerTaskExecuteOutput = DeReplicateFromSchema<\n typeof PoseLandmarkerOutputSchema\n>;\n\n/**\n * Detects pose landmarks in images using MediaPipe Pose Landmarker.\n * Identifies 33 body landmarks for pose estimation and optional segmentation.\n */\nexport class PoseLandmarkerTask extends AiVisionTask<\n PoseLandmarkerTaskInput,\n PoseLandmarkerTaskOutput,\n JobQueueTaskConfig\n> {\n public static type = \"PoseLandmarkerTask\";\n public static category = \"AI Vision Model\";\n public static title = \"Pose Landmarker\";\n public static description =\n \"Detects pose landmarks in images. Identifies 33 body landmarks for pose estimation and optional segmentation.\";\n public static inputSchema(): DataPortSchema {\n return PoseLandmarkerInputSchema as DataPortSchema;\n }\n public static outputSchema(): DataPortSchema {\n return PoseLandmarkerOutputSchema as DataPortSchema;\n }\n}\n\nTaskRegistry.registerTask(PoseLandmarkerTask);\n\n/**\n * Convenience function to run pose landmark detection tasks.\n * Creates and executes a PoseLandmarkerTask with the provided input.\n * @param input The input parameters for pose landmark detection (image, model, and optional configuration)\n * @returns Promise resolving to the detected pose landmarks and optional segmentation masks\n */\nexport const
|
|
31
|
-
"/**\n * @license\n * Copyright 2025 Steven Roussey <sroussey@gmail.com>\n * SPDX-License-Identifier: Apache-2.0\n */\n\nimport { CreateWorkflow, JobQueueTaskConfig, TaskRegistry, Workflow } from \"@workglow/task-graph\";\nimport { DataPortSchema, FromSchema } from \"@workglow/util\";\nimport { AiTask } from \"./base/AiTask\";\nimport { DeReplicateFromSchema, TypeModel, TypeReplicateArray } from \"./base/AiTaskSchemas\";\n\nconst modelSchema = TypeReplicateArray(TypeModel(\"model:TextClassificationTask\"));\n\nexport const TextClassificationInputSchema = {\n type: \"object\",\n properties: {\n text: TypeReplicateArray({\n type: \"string\",\n title: \"Text\",\n description: \"The text to classify\",\n }),\n candidateLabels: {\n type: \"array\",\n items: {\n type: \"string\",\n },\n title: \"Candidate Labels\",\n description: \"List of candidate labels (optional, if provided uses zero-shot classification)\",\n \"x-ui-group\": \"Configuration\",\n },\n maxCategories: {\n type: \"number\",\n minimum: 1,\n maximum: 1000,\n default: 5,\n title: \"Max Categories\",\n description: \"The maximum number of categories to return\",\n \"x-ui-group\": \"Configuration\",\n },\n model: modelSchema,\n },\n required: [\"text\", \"model\"],\n additionalProperties: false,\n} as const satisfies DataPortSchema;\n\nexport const TextClassificationOutputSchema = {\n type: \"object\",\n properties: {\n categories: {\n type: \"array\",\n items: {\n type: \"object\",\n properties: {\n label: {\n type: \"string\",\n title: \"Label\",\n description: \"The name of the category\",\n },\n score: {\n type: \"number\",\n title: \"Score\",\n description: \"The confidence score for this category\",\n },\n },\n required: [\"label\", \"score\"],\n additionalProperties: false,\n },\n title: \"Categories\",\n description: \"The classification categories with their scores\",\n },\n },\n required: [\"categories\"],\n additionalProperties: false,\n} as const satisfies DataPortSchema;\n\nexport type TextClassificationTaskInput = FromSchema<typeof TextClassificationInputSchema>;\nexport type TextClassificationTaskOutput = FromSchema<typeof TextClassificationOutputSchema>;\nexport type TextClassificationTaskExecuteInput = DeReplicateFromSchema<\n typeof TextClassificationInputSchema\n>;\nexport type TextClassificationTaskExecuteOutput = DeReplicateFromSchema<\n typeof TextClassificationOutputSchema\n>;\n\n/**\n * Classifies text into categories using language models.\n * Automatically selects between regular and zero-shot classification based on whether candidate labels are provided.\n */\nexport class TextClassificationTask extends AiTask<\n TextClassificationTaskInput,\n TextClassificationTaskOutput\n> {\n public static type = \"TextClassificationTask\";\n public static category = \"AI Text Model\";\n public static title = \"Text Classifier\";\n public static description =\n \"Classifies text into categories using language models. Supports zero-shot classification when candidate labels are provided.\";\n public static inputSchema(): DataPortSchema {\n return TextClassificationInputSchema as DataPortSchema;\n }\n public static outputSchema(): DataPortSchema {\n return TextClassificationOutputSchema as DataPortSchema;\n }\n}\n\nTaskRegistry.registerTask(TextClassificationTask);\n\n/**\n * Convenience function to run text classifier tasks.\n * Creates and executes a TextClassificationTask with the provided input.\n * @param input The input parameters for text classification (text and model)\n * @returns Promise resolving to the classification categories with scores\n */\nexport const
|
|
32
|
-
"/**\n * @license\n * Copyright 2025 Steven Roussey <sroussey@gmail.com>\n * SPDX-License-Identifier: Apache-2.0\n */\n\nimport { CreateWorkflow, JobQueueTaskConfig, TaskRegistry, Workflow } from \"@workglow/task-graph\";\nimport { DataPortSchema, FromSchema } from \"@workglow/util\";\nimport { AiTask } from \"./base/AiTask\";\nimport {\n DeReplicateFromSchema,\n TypedArraySchema,\n TypedArraySchemaOptions,\n TypeModel,\n TypeReplicateArray,\n} from \"./base/AiTaskSchemas\";\n\nconst modelSchema = TypeReplicateArray(TypeModel(\"model:TextEmbeddingTask\"));\n\nexport const TextEmbeddingInputSchema = {\n type: \"object\",\n properties: {\n text: TypeReplicateArray({\n type: \"string\",\n title: \"Text\",\n description: \"The text to embed\",\n }),\n model: modelSchema,\n },\n required: [\"text\", \"model\"],\n additionalProperties: false,\n} as const satisfies DataPortSchema;\n\nexport const TextEmbeddingOutputSchema = {\n type: \"object\",\n properties: {\n vector: TypeReplicateArray(\n TypedArraySchema({\n title: \"Vector\",\n description: \"The vector embedding of the text\",\n })\n ),\n },\n required: [\"vector\"],\n additionalProperties: false,\n} as const satisfies DataPortSchema;\n\nexport type TextEmbeddingTaskInput = FromSchema<\n typeof TextEmbeddingInputSchema,\n TypedArraySchemaOptions\n>;\nexport type TextEmbeddingTaskOutput = FromSchema<\n typeof TextEmbeddingOutputSchema,\n TypedArraySchemaOptions\n>;\nexport type TextEmbeddingTaskExecuteInput = DeReplicateFromSchema<typeof TextEmbeddingInputSchema>;\nexport type TextEmbeddingTaskExecuteOutput = DeReplicateFromSchema<\n typeof TextEmbeddingOutputSchema\n>;\n\n/**\n * A task that generates vector embeddings for text using a specified embedding model.\n * Embeddings are numerical representations of text that capture semantic meaning,\n * useful for similarity comparisons and semantic search.\n *\n * @extends AiTask\n */\nexport class TextEmbeddingTask extends AiTask<TextEmbeddingTaskInput, TextEmbeddingTaskOutput> {\n public static type = \"TextEmbeddingTask\";\n public static category = \"AI Text Model\";\n public static title = \"Text Embedding\";\n public static description = \"Generates vector embeddings for text to capture semantic meaning\";\n public static inputSchema(): DataPortSchema {\n return TextEmbeddingInputSchema as DataPortSchema;\n }\n public static outputSchema(): DataPortSchema {\n return TextEmbeddingOutputSchema as DataPortSchema;\n }\n}\n\nTaskRegistry.registerTask(TextEmbeddingTask);\n\n/**\n * Convenience function to create and run a text embedding task.\n * @param input - Input containing text(s) and model(s) for embedding\n * @returns Promise resolving to the generated embeddings\n */\nexport const
|
|
33
|
-
"/**\n * @license\n * Copyright 2025 Steven Roussey <sroussey@gmail.com>\n * SPDX-License-Identifier: Apache-2.0\n */\n\nimport { CreateWorkflow, JobQueueTaskConfig, TaskRegistry, Workflow } from \"@workglow/task-graph\";\nimport { DataPortSchema, FromSchema } from \"@workglow/util\";\nimport { AiTask } from \"./base/AiTask\";\nimport { DeReplicateFromSchema, TypeModel, TypeReplicateArray } from \"./base/AiTaskSchemas\";\n\nconst modelSchema = TypeReplicateArray(TypeModel(\"model:TextFillMaskTask\"));\n\nexport const TextFillMaskInputSchema = {\n type: \"object\",\n properties: {\n text: TypeReplicateArray({\n type: \"string\",\n title: \"Text\",\n description: \"The text with a mask token to fill\",\n }),\n model: modelSchema,\n },\n required: [\"text\", \"model\"],\n additionalProperties: false,\n} as const satisfies DataPortSchema;\n\nexport const TextFillMaskOutputSchema = {\n type: \"object\",\n properties: {\n predictions: {\n type: \"array\",\n items: {\n type: \"object\",\n properties: {\n entity: {\n type: \"string\",\n title: \"Entity\",\n description: \"The token that was predicted to fill the mask\",\n },\n score: {\n type: \"number\",\n title: \"Score\",\n description: \"The confidence score for this prediction\",\n },\n sequence: {\n type: \"string\",\n title: \"Sequence\",\n description: \"The complete text with the mask filled\",\n },\n },\n required: [\"entity\", \"score\", \"sequence\"],\n additionalProperties: false,\n },\n title: \"Predictions\",\n description: \"The predicted tokens to fill the mask with their scores and complete sequences\",\n },\n },\n required: [\"predictions\"],\n additionalProperties: false,\n} as const satisfies DataPortSchema;\n\nexport type TextFillMaskTaskInput = FromSchema<typeof TextFillMaskInputSchema>;\nexport type TextFillMaskTaskOutput = FromSchema<typeof TextFillMaskOutputSchema>;\nexport type TextFillMaskTaskExecuteInput = DeReplicateFromSchema<typeof TextFillMaskInputSchema>;\nexport type TextFillMaskTaskExecuteOutput = DeReplicateFromSchema<typeof TextFillMaskOutputSchema>;\n\n/**\n * Fills masked tokens in text using language models\n */\nexport class TextFillMaskTask extends AiTask<TextFillMaskTaskInput, TextFillMaskTaskOutput> {\n public static type = \"TextFillMaskTask\";\n public static category = \"AI Text Model\";\n public static title = \"Fill Mask\";\n public static description = \"Fills masked tokens in text\";\n public static inputSchema(): DataPortSchema {\n return TextFillMaskInputSchema as DataPortSchema;\n }\n public static outputSchema(): DataPortSchema {\n return TextFillMaskOutputSchema as DataPortSchema;\n }\n}\n\nTaskRegistry.registerTask(TextFillMaskTask);\n\n/**\n * Convenience function to run fill mask tasks.\n * Creates and executes a TextFillMaskTask with the provided input.\n * @param input The input parameters for fill mask (text with mask token and model)\n * @returns Promise resolving to the predicted tokens with scores and complete sequences\n */\nexport const
|
|
34
|
-
"/**\n * @license\n * Copyright 2025 Steven Roussey <sroussey@gmail.com>\n * SPDX-License-Identifier: Apache-2.0\n */\n\nimport { CreateWorkflow, JobQueueTaskConfig, TaskRegistry, Workflow } from \"@workglow/task-graph\";\nimport { DataPortSchema, FromSchema } from \"@workglow/util\";\nimport { AiTask } from \"./base/AiTask\";\nimport { DeReplicateFromSchema, TypeModel, TypeReplicateArray } from \"./base/AiTaskSchemas\";\n\nconst generatedTextSchema = {\n type: \"string\",\n title: \"Text\",\n description: \"The generated text\",\n} as const;\n\nconst modelSchema = TypeReplicateArray(TypeModel(\"model:TextGenerationTask\"));\n\nexport const TextGenerationInputSchema = {\n type: \"object\",\n properties: {\n model: modelSchema,\n prompt: TypeReplicateArray({\n type: \"string\",\n title: \"Prompt\",\n description: \"The prompt to generate text from\",\n }),\n maxTokens: {\n type: \"number\",\n title: \"Max Tokens\",\n description: \"The maximum number of tokens to generate\",\n minimum: 1,\n maximum: 4096,\n \"x-ui-group\": \"Configuration\",\n },\n temperature: {\n type: \"number\",\n title: \"Temperature\",\n description: \"The temperature to use for sampling\",\n minimum: 0,\n maximum: 2,\n \"x-ui-group\": \"Configuration\",\n },\n topP: {\n type: \"number\",\n title: \"Top-p\",\n description: \"The top-p value to use for sampling\",\n minimum: 0,\n maximum: 1,\n \"x-ui-group\": \"Configuration\",\n },\n frequencyPenalty: {\n type: \"number\",\n title: \"Frequency Penalty\",\n description: \"The frequency penalty to use\",\n minimum: -2,\n maximum: 2,\n \"x-ui-group\": \"Configuration\",\n },\n presencePenalty: {\n type: \"number\",\n title: \"Presence Penalty\",\n description: \"The presence penalty to use\",\n minimum: -2,\n maximum: 2,\n \"x-ui-group\": \"Configuration\",\n },\n },\n required: [\"model\", \"prompt\"],\n additionalProperties: false,\n} as const satisfies DataPortSchema;\n\nexport const TextGenerationOutputSchema = {\n type: \"object\",\n properties: {\n text: {\n oneOf: [generatedTextSchema, { type: \"array\", items: generatedTextSchema }],\n title: generatedTextSchema.title,\n description: generatedTextSchema.description,\n },\n },\n required: [\"text\"],\n additionalProperties: false,\n} as const satisfies DataPortSchema;\n\nexport type TextGenerationTaskInput = FromSchema<typeof TextGenerationInputSchema>;\nexport type TextGenerationTaskOutput = FromSchema<typeof TextGenerationOutputSchema>;\nexport type TextGenerationTaskExecuteInput = DeReplicateFromSchema<\n typeof TextGenerationInputSchema\n>;\nexport type TextGenerationTaskExecuteOutput = DeReplicateFromSchema<\n typeof TextGenerationOutputSchema\n>;\n\nexport class TextGenerationTask extends AiTask<\n TextGenerationTaskInput,\n TextGenerationTaskOutput,\n JobQueueTaskConfig\n> {\n public static type = \"TextGenerationTask\";\n public static category = \"AI Text Model\";\n public static title = \"Text Generation\";\n public static description =\n \"Generates text from a prompt using language models with configurable parameters\";\n public static inputSchema(): DataPortSchema {\n return TextGenerationInputSchema as DataPortSchema;\n }\n public static outputSchema(): DataPortSchema {\n return TextGenerationOutputSchema as DataPortSchema;\n }\n}\n\nTaskRegistry.registerTask(TextGenerationTask);\n/**\n * Task for generating text using a language model\n */\nexport const
|
|
35
|
-
"/**\n * @license\n * Copyright 2025 Steven Roussey <sroussey@gmail.com>\n * SPDX-License-Identifier: Apache-2.0\n */\n\nimport { CreateWorkflow, JobQueueTaskConfig, TaskRegistry, Workflow } from \"@workglow/task-graph\";\nimport { DataPortSchema, FromSchema } from \"@workglow/util\";\nimport { AiTask } from \"./base/AiTask\";\nimport { DeReplicateFromSchema, TypeModel, TypeReplicateArray } from \"./base/AiTaskSchemas\";\n\nconst modelSchema = TypeReplicateArray(TypeModel(\"model:TextLanguageDetectionTask\"));\n\nexport const TextLanguageDetectionInputSchema = {\n type: \"object\",\n properties: {\n text: TypeReplicateArray({\n type: \"string\",\n title: \"Text\",\n description: \"The text to detect the language of\",\n }),\n maxLanguages: {\n type: \"number\",\n minimum: 0,\n maximum: 100,\n default: 5,\n title: \"Max Languages\",\n description: \"The maximum number of languages to return\",\n },\n // scoreThreshold: {\n // type: \"number\",\n // minimum: 0,\n // maximum: 1,\n // title: \"Score Threshold\",\n // description: \"The score threshold for the languages to return\",\n // \"x-ui-group\": \"Configuration\",\n // \"x-ui-order\": 1,\n // \"x-ui-group-open\": false,\n // },\n // allowList: {\n // type: \"array\",\n // items: {\n // type: \"string\",\n // },\n // title: \"Allow List\",\n // description: \"The languages to allow (mutually exclusive with blockList)\",\n // \"x-ui-group\": \"Configuration\",\n // \"x-ui-order\": 2,\n // \"x-ui-group-open\": false,\n // },\n // blockList: {\n // type: \"array\",\n // items: {\n // type: \"string\",\n // },\n // title: \"Block List\",\n // description: \"The languages to block (mutually exclusive with allowList)\",\n // \"x-ui-group\": \"Configuration\",\n // \"x-ui-order\": 3,\n // \"x-ui-group-open\": false,\n // },\n model: modelSchema,\n },\n required: [\"text\", \"model\"],\n additionalProperties: false,\n // not: {\n // required: [\"allowList\", \"blockList\"],\n // },\n} as const satisfies DataPortSchema;\n\nexport const TextLanguageDetectionOutputSchema = {\n type: \"object\",\n properties: {\n languages: {\n type: \"array\",\n items: {\n type: \"object\",\n properties: {\n language: {\n type: \"string\",\n title: \"Language\",\n description: \"The language\",\n },\n score: {\n type: \"number\",\n title: \"Score\",\n description: \"The confidence score for this language\",\n },\n },\n required: [\"language\", \"score\"],\n additionalProperties: false,\n },\n title: \"Languages\",\n description: \"The languages with their scores\",\n },\n },\n required: [\"languages\"],\n additionalProperties: false,\n} as const satisfies DataPortSchema;\n\nexport type TextLanguageDetectionTaskInput = FromSchema<typeof TextLanguageDetectionInputSchema>;\nexport type TextLanguageDetectionTaskOutput = FromSchema<typeof TextLanguageDetectionOutputSchema>;\nexport type TextLanguageDetectionTaskExecuteInput = DeReplicateFromSchema<\n typeof TextLanguageDetectionInputSchema\n>;\nexport type TextLanguageDetectionTaskExecuteOutput = DeReplicateFromSchema<\n typeof TextLanguageDetectionOutputSchema\n>;\n\n/**\n * Detects the language of text using language models\n */\nexport class TextLanguageDetectionTask extends AiTask<\n TextLanguageDetectionTaskInput,\n TextLanguageDetectionTaskOutput\n> {\n public static type = \"TextLanguageDetectionTask\";\n public static category = \"AI Text Model\";\n public static title = \"Language Detection\";\n public static description = \"Detects the language of text using language models\";\n public static inputSchema(): DataPortSchema {\n return TextLanguageDetectionInputSchema as DataPortSchema;\n }\n public static outputSchema(): DataPortSchema {\n return TextLanguageDetectionOutputSchema as DataPortSchema;\n }\n}\n\nTaskRegistry.registerTask(TextLanguageDetectionTask);\n\n/**\n * Convenience function to run language detection tasks.\n * Creates and executes a TextLanguageDetectionTask with the provided input.\n * @param input The input parameters for language detection (text and model)\n * @returns Promise resolving to the languages with scores\n */\nexport const
|
|
36
|
-
"/**\n * @license\n * Copyright 2025 Steven Roussey <sroussey@gmail.com>\n * SPDX-License-Identifier: Apache-2.0\n */\n\nimport { CreateWorkflow, JobQueueTaskConfig, TaskRegistry, Workflow } from \"@workglow/task-graph\";\nimport { DataPortSchema, FromSchema } from \"@workglow/util\";\nimport { AiTask } from \"./base/AiTask\";\nimport { DeReplicateFromSchema, TypeModel, TypeReplicateArray } from \"./base/AiTaskSchemas\";\n\nconst modelSchema = TypeReplicateArray(TypeModel(\"model:NamedEntityRecognitionTask\"));\n\nexport const TextNamedEntityRecognitionInputSchema = {\n type: \"object\",\n properties: {\n text: TypeReplicateArray({\n type: \"string\",\n title: \"Text\",\n description: \"The text to extract named entities from\",\n }),\n blockList: {\n type: \"array\",\n items: {\n type: \"string\",\n },\n title: \"Block List\",\n description: \"The entity types to exclude from results\",\n \"x-ui-group\": \"Configuration\",\n \"x-ui-group-open\": false,\n },\n model: modelSchema,\n },\n required: [\"text\", \"model\"],\n additionalProperties: false,\n} as const satisfies DataPortSchema;\n\nexport const TextNamedEntityRecognitionOutputSchema = {\n type: \"object\",\n properties: {\n entities: {\n type: \"array\",\n items: {\n type: \"object\",\n properties: {\n entity: {\n type: \"string\",\n title: \"Entity\",\n description: \"The type of the named entity\",\n },\n score: {\n type: \"number\",\n title: \"Score\",\n description: \"The confidence score for this entity\",\n },\n word: {\n type: \"string\",\n title: \"Word\",\n description: \"The extracted text of the named entity\",\n },\n },\n required: [\"entity\", \"score\", \"word\"],\n additionalProperties: false,\n },\n title: \"Entities\",\n description: \"The extracted named entities with their types, scores, and text\",\n },\n },\n required: [\"entities\"],\n additionalProperties: false,\n} as const satisfies DataPortSchema;\n\nexport type TextNamedEntityRecognitionTaskInput = FromSchema<\n typeof TextNamedEntityRecognitionInputSchema\n>;\nexport type TextNamedEntityRecognitionTaskOutput = FromSchema<\n typeof TextNamedEntityRecognitionOutputSchema\n>;\nexport type TextNamedEntityRecognitionTaskExecuteInput = DeReplicateFromSchema<\n typeof TextNamedEntityRecognitionInputSchema\n>;\nexport type TextNamedEntityRecognitionTaskExecuteOutput = DeReplicateFromSchema<\n typeof TextNamedEntityRecognitionOutputSchema\n>;\n\n/**\n * Extracts named entities from text using language models\n */\nexport class TextNamedEntityRecognitionTask extends AiTask<\n TextNamedEntityRecognitionTaskInput,\n TextNamedEntityRecognitionTaskOutput\n> {\n public static type = \"TextNamedEntityRecognitionTask\";\n public static category = \"AI Text Model\";\n public static title = \"Named Entity Recognition\";\n public static description = \"Extracts named entities from text\";\n public static inputSchema(): DataPortSchema {\n return TextNamedEntityRecognitionInputSchema as DataPortSchema;\n }\n public static outputSchema(): DataPortSchema {\n return TextNamedEntityRecognitionOutputSchema as DataPortSchema;\n }\n}\n\nTaskRegistry.registerTask(TextNamedEntityRecognitionTask);\n\n/**\n * Convenience function to run named entity recognition tasks.\n * Creates and executes a TextNamedEntityRecognitionTask with the provided input.\n * @param input The input parameters for named entity recognition (text and model)\n * @returns Promise resolving to the extracted named entities with types, scores, and text\n */\nexport const
|
|
37
|
-
"/**\n * @license\n * Copyright 2025 Steven Roussey <sroussey@gmail.com>\n * SPDX-License-Identifier: Apache-2.0\n */\n\nimport { CreateWorkflow, JobQueueTaskConfig, TaskRegistry, Workflow } from \"@workglow/task-graph\";\nimport { DataPortSchema, FromSchema } from \"@workglow/util\";\nimport { AiTask } from \"./base/AiTask\";\nimport { DeReplicateFromSchema, TypeModel, TypeReplicateArray } from \"./base/AiTaskSchemas\";\n\nconst contextSchema = {\n type: \"string\",\n title: \"Context\",\n description: \"The context of the question\",\n} as const;\n\nconst questionSchema = {\n type: \"string\",\n title: \"Question\",\n description: \"The question to answer\",\n} as const;\n\nconst textSchema = {\n type: \"string\",\n title: \"Text\",\n description: \"The generated text\",\n} as const;\n\nconst modelSchema = TypeReplicateArray(TypeModel(\"model:TextQuestionAnswerTask\"));\n\nexport const TextQuestionAnswerInputSchema = {\n type: \"object\",\n properties: {\n context: TypeReplicateArray(contextSchema),\n question: TypeReplicateArray(questionSchema),\n model: modelSchema,\n },\n required: [\"context\", \"question\", \"model\"],\n additionalProperties: false,\n} as const satisfies DataPortSchema;\n\nexport const TextQuestionAnswerOutputSchema = {\n type: \"object\",\n properties: {\n text: {\n oneOf: [textSchema, { type: \"array\", items: textSchema }],\n title: textSchema.title,\n description: textSchema.description,\n },\n },\n required: [\"text\"],\n additionalProperties: false,\n} as const satisfies DataPortSchema;\n\nexport type TextQuestionAnswerTaskInput = FromSchema<typeof TextQuestionAnswerInputSchema>;\nexport type TextQuestionAnswerTaskOutput = FromSchema<typeof TextQuestionAnswerOutputSchema>;\nexport type TextQuestionAnswerTaskExecuteInput = DeReplicateFromSchema<\n typeof TextQuestionAnswerInputSchema\n>;\nexport type TextQuestionAnswerTaskExecuteOutput = DeReplicateFromSchema<\n typeof TextQuestionAnswerOutputSchema\n>;\n\n/**\n * This is a special case of text generation that takes a context and a question\n */\nexport class TextQuestionAnswerTask extends AiTask<\n TextQuestionAnswerTaskInput,\n TextQuestionAnswerTaskOutput,\n JobQueueTaskConfig\n> {\n public static type = \"TextQuestionAnswerTask\";\n public static category = \"AI Text Model\";\n public static title = \"Text Question Answer\";\n public static description = \"Answers questions based on provided context using language models\";\n public static inputSchema(): DataPortSchema {\n return TextQuestionAnswerInputSchema as DataPortSchema;\n }\n public static outputSchema(): DataPortSchema {\n return TextQuestionAnswerOutputSchema as DataPortSchema;\n }\n}\n\nTaskRegistry.registerTask(TextQuestionAnswerTask);\n\n/**\n * Convenience function to run text question answer tasks.\n * Creates and executes a TextQuestionAnswerCompoundTask with the provided input.\n * @param input The input parameters for text question answer (context, question, and model)\n * @returns Promise resolving to the generated answer(s)\n */\nexport const
|
|
38
|
-
"/**\n * @license\n * Copyright 2025 Steven Roussey <sroussey@gmail.com>\n * SPDX-License-Identifier: Apache-2.0\n */\n\nimport { CreateWorkflow, JobQueueTaskConfig, TaskRegistry, Workflow } from \"@workglow/task-graph\";\nimport { DataPortSchema, FromSchema } from \"@workglow/util\";\nimport { AiTask } from \"./base/AiTask\";\nimport { DeReplicateFromSchema, TypeModel, TypeReplicateArray } from \"./base/AiTaskSchemas\";\n\nconst modelSchema = TypeReplicateArray(TypeModel(\"model:TextRewriterTask\"));\n\nexport const TextRewriterInputSchema = {\n type: \"object\",\n properties: {\n text: TypeReplicateArray({\n type: \"string\",\n title: \"Text\",\n description: \"The text to rewrite\",\n }),\n prompt: TypeReplicateArray({\n type: \"string\",\n title: \"Prompt\",\n description: \"The prompt to direct the rewriting\",\n }),\n model: modelSchema,\n },\n required: [\"text\", \"prompt\", \"model\"],\n additionalProperties: false,\n} as const satisfies DataPortSchema;\n\nexport const TextRewriterOutputSchema = {\n type: \"object\",\n properties: {\n text: {\n type: \"string\",\n title: \"Text\",\n description: \"The rewritten text\",\n },\n },\n required: [\"text\"],\n additionalProperties: false,\n} as const satisfies DataPortSchema;\n\nexport type TextRewriterTaskInput = FromSchema<typeof TextRewriterInputSchema>;\nexport type TextRewriterTaskOutput = FromSchema<typeof TextRewriterOutputSchema>;\nexport type TextRewriterTaskExecuteInput = DeReplicateFromSchema<typeof TextRewriterInputSchema>;\nexport type TextRewriterTaskExecuteOutput = DeReplicateFromSchema<typeof TextRewriterOutputSchema>;\n\n/**\n * This is a special case of text generation that takes a prompt and text to rewrite\n */\nexport class TextRewriterTask extends AiTask<TextRewriterTaskInput, TextRewriterTaskOutput> {\n public static type = \"TextRewriterTask\";\n public static category = \"AI Text Model\";\n public static title = \"Text Rewriter\";\n public static description = \"Rewrites text according to a given prompt using language models\";\n public static inputSchema(): DataPortSchema {\n return TextRewriterInputSchema as DataPortSchema;\n }\n public static outputSchema(): DataPortSchema {\n return TextRewriterOutputSchema as DataPortSchema;\n }\n}\n\nTaskRegistry.registerTask(TextRewriterTask);\n\n/**\n * Convenience function to run text rewriter tasks.\n * Creates and executes a TextRewriterCompoundTask with the provided input.\n * @param input The input parameters for text rewriting (text, prompt, and model)\n * @returns Promise resolving to the rewritten text output(s)\n */\nexport const
|
|
39
|
-
"/**\n * @license\n * Copyright 2025 Steven Roussey <sroussey@gmail.com>\n * SPDX-License-Identifier: Apache-2.0\n */\n\nimport { CreateWorkflow, JobQueueTaskConfig, TaskRegistry, Workflow } from \"@workglow/task-graph\";\nimport { DataPortSchema, FromSchema } from \"@workglow/util\";\nimport { AiTask } from \"./base/AiTask\";\nimport { DeReplicateFromSchema, TypeModel, TypeReplicateArray } from \"./base/AiTaskSchemas\";\n\nconst modelSchema = TypeReplicateArray(TypeModel(\"model:TextSummaryTask\"));\n\nexport const TextSummaryInputSchema = {\n type: \"object\",\n properties: {\n text: TypeReplicateArray({\n type: \"string\",\n title: \"Text\",\n description: \"The text to summarize\",\n }),\n model: modelSchema,\n },\n required: [\"text\", \"model\"],\n additionalProperties: false,\n} as const satisfies DataPortSchema;\n\nexport const TextSummaryOutputSchema = {\n type: \"object\",\n properties: {\n text: {\n type: \"string\",\n title: \"Text\",\n description: \"The summarized text\",\n },\n },\n required: [\"text\"],\n additionalProperties: false,\n} as const satisfies DataPortSchema;\n\nexport type TextSummaryTaskInput = FromSchema<typeof TextSummaryInputSchema>;\nexport type TextSummaryTaskOutput = FromSchema<typeof TextSummaryOutputSchema>;\nexport type TextSummaryTaskExecuteInput = DeReplicateFromSchema<typeof TextSummaryInputSchema>;\nexport type TextSummaryTaskExecuteOutput = DeReplicateFromSchema<typeof TextSummaryOutputSchema>;\n\n/**\n * This summarizes a piece of text\n */\n\nexport class TextSummaryTask extends AiTask<TextSummaryTaskInput, TextSummaryTaskOutput> {\n public static type = \"TextSummaryTask\";\n public static category = \"AI Text Model\";\n public static title = \"Text Summary\";\n public static description =\n \"Summarizes text into a shorter form while preserving key information\";\n public static inputSchema(): DataPortSchema {\n return TextSummaryInputSchema as DataPortSchema;\n }\n public static outputSchema(): DataPortSchema {\n return TextSummaryOutputSchema as DataPortSchema;\n }\n}\n\nTaskRegistry.registerTask(TextSummaryTask);\n\n/**\n * Convenience function to run text summary tasks.\n * Creates and executes a text summary task with the provided input.\n * @param input The input parameters for text summary (text and model)\n * @returns Promise resolving to the summarized text output(s)\n */\nexport const
|
|
40
|
-
"/**\n * @license\n * Copyright 2025 Steven Roussey <sroussey@gmail.com>\n * SPDX-License-Identifier: Apache-2.0\n */\n\nimport { CreateWorkflow, JobQueueTaskConfig, TaskRegistry, Workflow } from \"@workglow/task-graph\";\nimport { DataPortSchema, FromSchema } from \"@workglow/util\";\nimport { AiTask } from \"./base/AiTask\";\nimport {\n DeReplicateFromSchema,\n TypeLanguage,\n TypeModel,\n TypeReplicateArray,\n} from \"./base/AiTaskSchemas\";\n\nconst modelSchema = TypeReplicateArray(TypeModel(\"model:TextTranslationTask\"));\n\nconst translationTextSchema = {\n type: \"string\",\n title: \"Text\",\n description: \"The translated text\",\n} as const;\n\nexport const TextTranslationInputSchema = {\n type: \"object\",\n properties: {\n text: TypeReplicateArray({\n type: \"string\",\n title: \"Text\",\n description: \"The text to translate\",\n }),\n source_lang: TypeReplicateArray(\n TypeLanguage({\n title: \"Source Language\",\n description: \"The source language\",\n minLength: 2,\n maxLength: 2,\n })\n ),\n target_lang: TypeReplicateArray(\n TypeLanguage({\n title: \"Target Language\",\n description: \"The target language\",\n minLength: 2,\n maxLength: 2,\n })\n ),\n model: modelSchema,\n },\n required: [\"text\", \"source_lang\", \"target_lang\", \"model\"],\n additionalProperties: false,\n} as const satisfies DataPortSchema;\n\nexport const TextTranslationOutputSchema = {\n type: \"object\",\n properties: {\n text: {\n oneOf: [translationTextSchema, { type: \"array\", items: translationTextSchema }],\n title: translationTextSchema.title,\n description: translationTextSchema.description,\n },\n target_lang: TypeLanguage({\n title: \"Output Language\",\n description: \"The output language\",\n minLength: 2,\n maxLength: 2,\n }),\n },\n required: [\"text\", \"target_lang\"],\n additionalProperties: false,\n} as const satisfies DataPortSchema;\n\nexport type TextTranslationTaskInput = FromSchema<typeof TextTranslationInputSchema>;\nexport type TextTranslationTaskOutput = FromSchema<typeof TextTranslationOutputSchema>;\nexport type TextTranslationTaskExecuteInput = DeReplicateFromSchema<\n typeof TextTranslationInputSchema\n>;\nexport type TextTranslationTaskExecuteOutput = DeReplicateFromSchema<\n typeof TextTranslationOutputSchema\n>;\n\n/**\n * This translates text from one language to another\n */\nexport class TextTranslationTask extends AiTask<\n TextTranslationTaskInput,\n TextTranslationTaskOutput\n> {\n public static type = \"TextTranslationTask\";\n public static category = \"AI Text Model\";\n public static title = \"Text Translation\";\n public static description = \"Translates text from one language to another using language models\";\n public static inputSchema(): DataPortSchema {\n return TextTranslationInputSchema as DataPortSchema;\n }\n public static outputSchema(): DataPortSchema {\n return TextTranslationOutputSchema as DataPortSchema;\n }\n}\n\nTaskRegistry.registerTask(TextTranslationTask);\n\n/**\n * Convenience function to run text translation tasks.\n * Creates and executes a TextTranslationCompoundTask with the provided input.\n * @param input The input parameters for text translation (text, model, source_lang, and target_lang)\n * @returns Promise resolving to the translated text output(s)\n */\nexport const
|
|
41
|
-
"/**\n * @license\n * Copyright 2025 Steven Roussey <sroussey@gmail.com>\n * SPDX-License-Identifier: Apache-2.0\n */\n\nimport { CreateWorkflow, JobQueueTaskConfig, TaskRegistry, Workflow } from \"@workglow/task-graph\";\nimport { DataPortSchema, FromSchema } from \"@workglow/util\";\nimport { AiTask } from \"./base/AiTask\";\nimport { DeReplicateFromSchema, TypeModel, TypeReplicateArray } from \"./base/AiTaskSchemas\";\n\nconst modelSchema = TypeReplicateArray(TypeModel(\"model\"));\n\nconst UnloadModelInputSchema = {\n type: \"object\",\n properties: {\n model: modelSchema,\n },\n required: [\"model\"],\n additionalProperties: false,\n} as const satisfies DataPortSchema;\n\nconst UnloadModelOutputSchema = {\n type: \"object\",\n properties: {\n model: modelSchema,\n },\n required: [\"model\"],\n additionalProperties: false,\n} as const satisfies DataPortSchema;\n\nexport type UnloadModelTaskRunInput = FromSchema<typeof UnloadModelInputSchema>;\nexport type UnloadModelTaskRunOutput = FromSchema<typeof UnloadModelOutputSchema>;\nexport type UnloadModelTaskExecuteInput = DeReplicateFromSchema<typeof UnloadModelInputSchema>;\nexport type UnloadModelTaskExecuteOutput = DeReplicateFromSchema
|
|
42
|
-
"/**\n * @license\n * Copyright 2025 Steven Roussey <sroussey@gmail.com>\n * SPDX-License-Identifier: Apache-2.0\n */\n\nimport {\n
|
|
15
|
+
"/**\n * @license\n * Copyright 2025 Steven Roussey <sroussey@gmail.com>\n * SPDX-License-Identifier: Apache-2.0\n */\n\nimport { CreateWorkflow, JobQueueTaskConfig, TaskRegistry, Workflow } from \"@workglow/task-graph\";\nimport { DataPortSchema, FromSchema } from \"@workglow/util\";\nimport {\n DeReplicateFromSchema,\n TypeImageInput,\n TypeModel,\n TypeReplicateArray,\n} from \"./base/AiTaskSchemas\";\nimport { AiVisionTask } from \"./base/AiVisionTask\";\n\nconst modelSchema = TypeReplicateArray(TypeModel(\"model:BackgroundRemovalTask\"));\n\nconst processedImageSchema = {\n type: \"string\",\n contentEncoding: \"base64\",\n contentMediaType: \"image/png\",\n title: \"Image\",\n description: \"Base64-encoded PNG image with transparent background\",\n} as const;\n\nexport const BackgroundRemovalInputSchema = {\n type: \"object\",\n properties: {\n image: TypeReplicateArray(TypeImageInput),\n model: modelSchema,\n },\n required: [\"image\", \"model\"],\n additionalProperties: false,\n} as const satisfies DataPortSchema;\n\nexport const BackgroundRemovalOutputSchema = {\n type: \"object\",\n properties: {\n image: {\n oneOf: [processedImageSchema, { type: \"array\", items: processedImageSchema }],\n title: processedImageSchema.title,\n description: processedImageSchema.description,\n },\n },\n required: [\"image\"],\n additionalProperties: false,\n} as const satisfies DataPortSchema;\n\nexport type BackgroundRemovalTaskInput = FromSchema<typeof BackgroundRemovalInputSchema>;\nexport type BackgroundRemovalTaskOutput = FromSchema<typeof BackgroundRemovalOutputSchema>;\nexport type BackgroundRemovalTaskExecuteInput = DeReplicateFromSchema<\n typeof BackgroundRemovalInputSchema\n>;\nexport type BackgroundRemovalTaskExecuteOutput = DeReplicateFromSchema<\n typeof BackgroundRemovalOutputSchema\n>;\n\n/**\n * Removes backgrounds from images using computer vision models\n */\nexport class BackgroundRemovalTask extends AiVisionTask<\n BackgroundRemovalTaskInput,\n BackgroundRemovalTaskOutput\n> {\n public static type = \"BackgroundRemovalTask\";\n public static category = \"AI Vision Model\";\n public static title = \"Background Removal\";\n public static description =\n \"Removes backgrounds from images, producing images with transparent backgrounds\";\n public static inputSchema(): DataPortSchema {\n return BackgroundRemovalInputSchema as DataPortSchema;\n }\n public static outputSchema(): DataPortSchema {\n return BackgroundRemovalOutputSchema as DataPortSchema;\n }\n}\n\nTaskRegistry.registerTask(BackgroundRemovalTask);\n\n/**\n * Convenience function to run background removal tasks.\n * Creates and executes a BackgroundRemovalTask with the provided input.\n * @param input The input parameters for background removal (image and model)\n * @returns Promise resolving to the image with transparent background\n */\nexport const backgroundRemoval = (\n input: BackgroundRemovalTaskInput,\n config?: JobQueueTaskConfig\n) => {\n return new BackgroundRemovalTask(input, config).run();\n};\n\ndeclare module \"@workglow/task-graph\" {\n interface Workflow {\n backgroundRemoval: CreateWorkflow<\n BackgroundRemovalTaskInput,\n BackgroundRemovalTaskOutput,\n JobQueueTaskConfig\n >;\n }\n}\n\nWorkflow.prototype.backgroundRemoval = CreateWorkflow(BackgroundRemovalTask);\n",
|
|
16
|
+
"/**\n * @license\n * Copyright 2025 Steven Roussey <sroussey@gmail.com>\n * SPDX-License-Identifier: Apache-2.0\n */\n\nimport {\n DataPortSchemaNonBoolean,\n FromSchema,\n FromSchemaDefaultOptions,\n FromSchemaOptions,\n JsonSchema,\n} from \"@workglow/util\";\nimport { ModelConfigSchema } from \"../../model/ModelSchema\";\n\nexport type TypedArray =\n | Float64Array\n | Float32Array\n | Int32Array\n | Int16Array\n | Int8Array\n | Uint32Array\n | Uint16Array\n | Uint8Array\n | Uint8ClampedArray;\n\n// Type-only value for use in deserialize patterns\nconst TypedArrayType = null as any as TypedArray;\n\nconst TypedArraySchemaOptions = {\n ...FromSchemaDefaultOptions,\n deserialize: [\n // {\n // pattern: {\n // type: \"number\";\n // \"format\": \"BigInt\" | \"Float64\";\n // };\n // output: bigint;\n // },\n // {\n // pattern: {\n // type: \"number\";\n // \"format\": \"Float64Array\";\n // };\n // output: Float64Array;\n // },\n // {\n // pattern: {\n // type: \"number\";\n // \"format\": \"Float32Array\";\n // };\n // output: Float32Array;\n // },\n // {\n // pattern: {\n // type: \"number\";\n // \"format\": \"Int32Array\";\n // };\n // output: Int32Array;\n // },\n // {\n // pattern: {\n // type: \"number\";\n // \"format\": \"Int16Array\";\n // };\n // output: Int16Array;\n // },\n // {\n // pattern: {\n // type: \"number\";\n // \"format\": \"Int8Array\";\n // };\n // output: Int8Array;\n // },\n // {\n // pattern: {\n // type: \"number\";\n // \"format\": \"Uint8Array\";\n // };\n // output: Uint8Array;\n // },\n // {\n // pattern: {\n // type: \"number\";\n // \"format\": \"Uint16Array\";\n // };\n // output: Uint16Array;\n // },\n // {\n // pattern: {\n // type: \"number\";\n // \"format\": \"Uint32Array\";\n // };\n // output: Uint32Array;\n // },\n // {\n // pattern: { type: \"array\"; items: { type: \"number\" }; \"format\": \"Uint8ClampedArray\" };\n // output: Uint8ClampedArray;\n // },\n {\n pattern: { format: \"TypedArray\" },\n output: TypedArrayType,\n },\n ],\n} as const satisfies FromSchemaOptions;\n\nexport type TypedArraySchemaOptions = typeof TypedArraySchemaOptions;\n\nexport const TypedArraySchema = (annotations: Record<string, unknown> = {}) =>\n ({\n oneOf: [\n {\n type: \"array\",\n items: { type: \"number\", format: \"Float64\" },\n title: \"Float64Array\",\n description: \"A 64-bit floating point array\",\n format: \"Float64Array\",\n },\n {\n type: \"array\",\n items: { type: \"number\", format: \"Float32\" },\n title: \"Float32Array\",\n description: \"A 32-bit floating point array\",\n format: \"Float32Array\",\n },\n {\n type: \"array\",\n items: { type: \"number\", format: \"Int32\" },\n title: \"Int32Array\",\n description: \"A 32-bit integer array\",\n format: \"Int32Array\",\n },\n {\n type: \"array\",\n items: { type: \"number\", format: \"Int16\" },\n title: \"Int16Array\",\n description: \"A 16-bit integer array\",\n format: \"Int16Array\",\n },\n {\n type: \"array\",\n items: { type: \"number\", format: \"Int8\" },\n title: \"Int8Array\",\n },\n {\n type: \"array\",\n items: { type: \"number\", format: \"Uint8\" },\n title: \"Uint8Array\",\n description: \"A 8-bit unsigned integer array\",\n format: \"Uint8Array\",\n },\n {\n type: \"array\",\n items: { type: \"number\", format: \"Uint16\" },\n title: \"Uint16Array\",\n description: \"A 16-bit unsigned integer array\",\n format: \"Uint16Array\",\n },\n {\n type: \"array\",\n items: { type: \"number\", format: \"Uint32\" },\n title: \"Uint32Array\",\n description: \"A 32-bit unsigned integer array\",\n format: \"Uint32Array\",\n },\n {\n type: \"array\",\n items: { type: \"number\", format: \"Uint8Clamped\" },\n title: \"Uint8ClampedArray\",\n description: \"A 8-bit unsigned integer array with values clamped to 0-255\",\n format: \"Uint8ClampedArray\",\n },\n ],\n format: \"TypedArray\",\n ...annotations,\n }) as const satisfies JsonSchema;\n\nexport const TypeLanguage = (annotations: Record<string, unknown> = {}) =>\n ({\n type: \"string\",\n title: \"Language\",\n description: \"The language to use\",\n maxLength: 2,\n minLength: 2,\n ...annotations,\n }) as const;\n\nexport type TypeModelSemantic = \"model\" | `model:${string}`;\n\nexport type TTypeModel = DataPortSchemaNonBoolean & {\n readonly type: \"string\";\n readonly format: TypeModelSemantic;\n};\n\nexport function TypeModelAsString<\n S extends TypeModelSemantic = \"model\",\n O extends Record<string, unknown> = {},\n>(semantic: S = \"model\" as S, options: O = {} as O) {\n if (semantic !== \"model\" && !semantic.startsWith(\"model:\")) {\n throw new Error(\"Invalid semantic value\");\n }\n const taskName = semantic.startsWith(\"model:\")\n ? semantic\n .slice(6)\n .replace(/Task$/, \"\")\n .replaceAll(/[A-Z]/g, (char) => \" \" + char.toLowerCase())\n .trim()\n : null;\n return {\n title: \"Model\",\n description: `The model ${taskName ? `for ${taskName} ` : \"to use\"}`,\n ...options,\n format: semantic,\n type: \"string\",\n } as const satisfies JsonSchema;\n}\n\nexport function TypeModelByDetail<\n S extends TypeModelSemantic = \"model\",\n O extends Record<string, unknown> = {},\n>(semantic: S = \"model\" as S, options: O = {} as O) {\n if (semantic !== \"model\" && !semantic.startsWith(\"model:\")) {\n throw new Error(\"Invalid semantic value\");\n }\n return {\n ...ModelConfigSchema,\n ...options,\n format: semantic,\n } as const satisfies JsonSchema;\n}\n\nexport function TypeModel<\n S extends TypeModelSemantic = \"model\",\n O extends Record<string, unknown> = {},\n>(semantic: S = \"model\" as S, options: O = {} as O) {\n return {\n oneOf: [TypeModelAsString<S, O>(semantic, options), TypeModelByDetail<S, O>(semantic, options)],\n ...options,\n format: semantic,\n } as const satisfies JsonSchema;\n}\n\nexport const TypeReplicateArray = <T extends DataPortSchemaNonBoolean>(\n type: T,\n annotations: Record<string, unknown> = {}\n) =>\n ({\n oneOf: [type, { type: \"array\", items: type }],\n title: type.title,\n description: type.description,\n ...(type.format ? { format: type.format } : {}),\n ...annotations,\n \"x-replicate\": true,\n }) as const;\n\nexport type TypedArrayFromSchema<SCHEMA extends JsonSchema> = FromSchema<\n SCHEMA,\n TypedArraySchemaOptions\n>;\n\n/**\n * Removes array types from a union, leaving only non-array types.\n * For example, `string | string[]` becomes `string`.\n * Used to extract the single-value type from schemas with x-replicate annotation.\n * Uses distributive conditional types to filter out arrays from unions.\n * Checks for both array types and types with numeric index signatures (FromSchema array output).\n * Preserves TypedArray types like Float64Array which also have numeric indices.\n */\ntype UnwrapArrayUnion<T> = T extends readonly any[]\n ? T extends TypedArray\n ? T\n : never\n : number extends keyof T\n ? \"push\" extends keyof T\n ? never\n : T\n : T;\n\n/**\n * Transforms a schema by removing array variants from properties marked with x-replicate.\n * Properties with x-replicate use {@link TypeReplicateArray} which creates a union of\n * `T | T[]`, and this type extracts just `T`.\n */\nexport type DeReplicateFromSchema<S extends { properties: Record<string, any> }> = {\n [K in keyof S[\"properties\"]]: S[\"properties\"][K] extends { \"x-replicate\": true }\n ? UnwrapArrayUnion<TypedArrayFromSchema<S[\"properties\"][K]>>\n : TypedArrayFromSchema<S[\"properties\"][K]>;\n};\n\nexport type ImageSource = ImageBitmap | OffscreenCanvas | VideoFrame;\n\n/**\n * Image input schema supporting URIs and base64-encoded images in multiple formats\n */\nexport const TypeImageInput = {\n oneOf: [\n {\n type: \"string\",\n title: \"Image Data\",\n description: \"Image as data-uri\",\n format: \"image:data-uri\",\n },\n {\n type: \"object\",\n additionalProperties: false,\n properties: {\n data: {\n oneOf: [\n {\n type: \"object\",\n format: \"image:ImageBitmap\",\n title: \"ImageBitmap\",\n },\n {\n type: \"object\",\n format: \"image:OffscreenCanvas\",\n title: \"OffscreenCanvas\",\n },\n {\n type: \"object\",\n format: \"image:VideoFrame\",\n title: \"VideoFrame\",\n },\n {\n type: \"object\",\n properties: {\n data: {\n type: \"array\",\n items: { type: \"number\", format: \"Uint8Clamped\" },\n format: \"Uint8ClampedArray\",\n title: \"Data\",\n description: \"Data of the image\",\n },\n width: { type: \"number\", title: \"Width\", description: \"Width of the image\" },\n height: { type: \"number\", title: \"Height\", description: \"Height of the image\" },\n channels: {\n type: \"number\",\n title: \"Channels\",\n description: \"Channels of the image\",\n },\n rawChannels: {\n type: \"number\",\n title: \"Raw Channels\",\n description: \"Raw channels of the image\",\n },\n },\n additionalProperties: false,\n required: [\"data\", \"width\", \"height\", \"channels\"],\n format: \"image:ImageBinary\",\n title: \"ImageBinary\",\n },\n ],\n },\n width: { type: \"number\", title: \"Width\", description: \"Width of the image\" },\n height: { type: \"number\", title: \"Height\", description: \"Height of the image\" },\n channels: {\n type: \"number\",\n title: \"Channels\",\n description: \"Channels of the image\",\n minimum: 1,\n maximum: 4,\n },\n },\n required: [\"data\", \"width\", \"height\", \"channels\"],\n },\n ],\n title: \"Image\",\n format: \"image\",\n description: \"Image as URL or base64-encoded data\",\n} as const satisfies JsonSchema;\n\n/**\n * Audio input schema supporting URIs and base64-encoded audio in multiple formats\n */\nexport const TypeAudioInput = {\n type: \"string\",\n title: \"Audio\",\n format: \"audio:data-uri\",\n description: \"Audio as data-uri, or Blob\",\n} as const satisfies JsonSchema;\n\n/**\n * Bounding box coordinates\n */\nexport const TypeBoundingBox = {\n type: \"object\",\n properties: {\n x: { type: \"number\", title: \"X coordinate\", description: \"Left edge of the bounding box\" },\n y: { type: \"number\", title: \"Y coordinate\", description: \"Top edge of the bounding box\" },\n width: { type: \"number\", title: \"Width\", description: \"Width of the bounding box\" },\n height: { type: \"number\", title: \"Height\", description: \"Height of the bounding box\" },\n },\n required: [\"x\", \"y\", \"width\", \"height\"],\n additionalProperties: false,\n title: \"Bounding Box\",\n description: \"Bounding box coordinates\",\n} as const satisfies JsonSchema;\n\n/**\n * Classification category with label and confidence score\n */\nexport const TypeCategory = {\n type: \"object\",\n properties: {\n label: { type: \"string\", title: \"Label\", description: \"Category label\" },\n score: {\n type: \"number\",\n title: \"Confidence Score\",\n description: \"Confidence score between 0 and 1\",\n minimum: 0,\n maximum: 1,\n },\n },\n required: [\"label\", \"score\"],\n additionalProperties: false,\n title: \"Category\",\n description: \"Classification category with label and score\",\n} as const satisfies JsonSchema;\n",
|
|
17
|
+
"/**\n * @license\n * Copyright 2025 Steven Roussey <sroussey@gmail.com>\n * SPDX-License-Identifier: Apache-2.0\n */\n\n/**\n * @description This file contains the implementation of the JobQueueTask class and its derived classes.\n */\n\nimport { JobQueueTaskConfig, TaskInput, type TaskOutput } from \"@workglow/task-graph\";\nimport { convertImageDataToUseableForm, ImageDataSupport } from \"@workglow/util\";\n\nimport { AiJobInput } from \"../../job/AiJob\";\nimport type { ModelConfig } from \"../../model/ModelSchema\";\nimport { AiTask } from \"./AiTask\";\n\nexport interface AiVisionTaskSingleInput extends TaskInput {\n model: string | ModelConfig;\n}\n\nexport interface AiVisionArrayTaskInput extends TaskInput {\n model: string | ModelConfig | (string | ModelConfig)[];\n}\n\n/**\n * A base class for AI related tasks that run in a job queue.\n * Extends the JobQueueTask class to provide LLM-specific functionality.\n */\nexport class AiVisionTask<\n Input extends AiVisionArrayTaskInput = AiVisionArrayTaskInput,\n Output extends TaskOutput = TaskOutput,\n Config extends JobQueueTaskConfig = JobQueueTaskConfig,\n> extends AiTask<Input, Output, Config> {\n public static type: string = \"AiVisionTask\";\n /**\n * Get the input to submit to the job queue.\n * Transforms the task input to AiJobInput format.\n * @param input - The task input\n * @returns The AiJobInput to submit to the queue\n */\n protected override async getJobInput(input: Input): Promise<AiJobInput<Input>> {\n const jobInput = await super.getJobInput(input);\n // TODO: if the queue is not memory based, we need to convert to base64 (or blob?)\n const registeredQueue = await this.resolveQueue(input);\n const queueName = registeredQueue?.server.queueName;\n\n // Image format support by model type and platform, that are transferable:\n // ┌─────────────────────────┬──────────────────────────────────────────────────────────────┬────────────────────────────────────────────┐\n // │ Model Type │ Web Support │ Node Support │\n // ├─────────────────────────┼──────────────────────────────────────────────────────────────┼────────────────────────────────────────────┤\n // │ TENSORFLOW_MEDIAPIPE │ Blob, ImageBitmap, VideoFrame, │ (none) │\n // │ │ OffscreenCanvas (no rendering ctx) │ │\n // ├─────────────────────────┼──────────────────────────────────────────────────────────────┼────────────────────────────────────────────┤\n // │ HF_TRANSFORMERS_ONNX │ Blob, OffscreenCanvas (no rendering ctx), │ Blob, Tensor, ImageBinary, │\n // │ │ ImageBinary, Tensor, DataUri │ DataUri, Sharp │\n // └─────────────────────────┴──────────────────────────────────────────────────────────────┴────────────────────────────────────────────┘\n const supports: ImageDataSupport[] = [\"Blob\"];\n if (input.image) {\n if (queueName === \"TENSORFLOW_MEDIAPIPE\" && \"ImageBitmap\" in globalThis) {\n supports.push(\"ImageBitmap\");\n } else if (queueName === \"TENSORFLOW_MEDIAPIPE\" && \"VideoFrame\" in globalThis) {\n supports.push(\"VideoFrame\");\n }\n const image = await convertImageDataToUseableForm(input.image, supports);\n // @ts-ignore\n jobInput.taskInput.image = image;\n }\n return jobInput;\n }\n}\n",
|
|
18
|
+
"/**\n * @license\n * Copyright 2025 Steven Roussey <sroussey@gmail.com>\n * SPDX-License-Identifier: Apache-2.0\n */\n\n/**\n * @description This file contains the implementation of the JobQueueTask class and its derived classes.\n */\n\nimport { Job } from \"@workglow/job-queue\";\nimport {\n JobQueueTask,\n JobQueueTaskConfig,\n TaskConfigurationError,\n TaskInput,\n type TaskOutput,\n} from \"@workglow/task-graph\";\nimport { type JsonSchema } from \"@workglow/util\";\n\nimport { AiJob, AiJobInput } from \"../../job/AiJob\";\nimport { getGlobalModelRepository } from \"../../model/ModelRegistry\";\nimport type { ModelConfig, ModelRecord } from \"../../model/ModelSchema\";\n\nfunction schemaFormat(schema: JsonSchema): string | undefined {\n return typeof schema === \"object\" && schema !== null && \"format\" in schema\n ? schema.format\n : undefined;\n}\n\nexport interface AiSingleTaskInput extends TaskInput {\n model: string | ModelConfig;\n}\n\nexport interface AiArrayTaskInput extends TaskInput {\n model: string | ModelConfig | (string | ModelConfig)[];\n}\n\n/**\n * A base class for AI related tasks that run in a job queue.\n * Extends the JobQueueTask class to provide LLM-specific functionality.\n */\nexport class AiTask<\n Input extends AiArrayTaskInput = AiArrayTaskInput,\n Output extends TaskOutput = TaskOutput,\n Config extends JobQueueTaskConfig = JobQueueTaskConfig,\n> extends JobQueueTask<Input, Output, Config> {\n public static type: string = \"AiTask\";\n private modelCache?: { name: string; model: ModelRecord };\n\n /**\n * Creates a new AiTask instance\n * @param config - Configuration object for the task\n */\n constructor(input: Input = {} as Input, config: Config = {} as Config) {\n const modelLabel =\n typeof input.model === \"string\"\n ? input.model\n : Array.isArray(input.model)\n ? undefined\n : typeof input.model === \"object\" && input.model\n ? input.model.model_id || input.model.title || input.model.provider\n : undefined;\n config.name ||= `${new.target.type || new.target.name}${\n modelLabel ? \" with model \" + modelLabel : \"\"\n }`;\n super(input, config);\n }\n\n // ========================================================================\n // Job creation\n // ========================================================================\n\n /**\n * Get the input to submit to the job queue.\n * Transforms the task input to AiJobInput format.\n * @param input - The task input\n * @returns The AiJobInput to submit to the queue\n */\n protected override async getJobInput(input: Input): Promise<AiJobInput<Input>> {\n if (Array.isArray(input.model)) {\n console.error(\"AiTask: Model is an array\", input);\n throw new TaskConfigurationError(\n \"AiTask: Model is an array, only create job for single model tasks\"\n );\n }\n const runtype = (this.constructor as any).runtype ?? (this.constructor as any).type;\n const model = await this.getModelConfigForInput(input as AiSingleTaskInput);\n\n // TODO: if the queue is not memory based, we need to convert to something that can structure clone to the queue\n // const registeredQueue = await this.resolveQueue(input);\n // const queueName = registeredQueue?.server.queueName;\n\n return {\n taskType: runtype,\n aiProvider: model.provider,\n taskInput: { ...(input as any), model } as Input & { model: ModelConfig },\n };\n }\n\n /**\n * Resolves a model configuration for the given input.\n *\n * @remarks\n * - If `input.model` is a string, it is resolved via the global model repository.\n * - If `input.model` is already a config object, it is used directly.\n */\n protected async getModelConfigForInput(input: AiSingleTaskInput): Promise<ModelConfig> {\n const modelValue = input.model;\n if (!modelValue) throw new TaskConfigurationError(\"AiTask: No model found\");\n if (typeof modelValue === \"string\") {\n const modelname = modelValue;\n if (this.modelCache && this.modelCache.name === modelname) {\n return this.modelCache.model;\n }\n const model = await getGlobalModelRepository().findByName(modelname);\n if (!model) {\n throw new TaskConfigurationError(`AiTask: No model ${modelname} found`);\n }\n this.modelCache = { name: modelname, model };\n return model;\n }\n if (typeof modelValue === \"object\") {\n return modelValue;\n }\n throw new TaskConfigurationError(\"AiTask: Invalid model value\");\n }\n\n /**\n * Creates a new Job instance for direct execution (without a queue).\n * @param input - The task input\n * @param queueName - The queue name (if any)\n * @returns Promise<Job> - The created job\n */\n override async createJob(\n input: Input,\n queueName?: string\n ): Promise<Job<AiJobInput<Input>, Output>> {\n const jobInput = await this.getJobInput(input);\n const resolvedQueueName = queueName ?? (await this.getDefaultQueueName(input));\n if (!resolvedQueueName) {\n throw new TaskConfigurationError(\"JobQueueTask: Unable to determine queue for AI provider\");\n }\n const job = new AiJob<AiJobInput<Input>, Output>({\n queueName: resolvedQueueName,\n jobRunId: this.config.runnerId, // could be undefined\n input: jobInput,\n });\n return job;\n }\n\n protected async getModelForInput(input: AiSingleTaskInput): Promise<ModelRecord> {\n const modelname = input.model;\n if (!modelname) throw new TaskConfigurationError(\"AiTask: No model name found\");\n if (typeof modelname !== \"string\") {\n throw new TaskConfigurationError(\"AiTask: Model name is not a string\");\n }\n if (this.modelCache && this.modelCache.name === modelname) {\n return this.modelCache.model;\n }\n const model = await getGlobalModelRepository().findByName(modelname);\n if (!model) {\n throw new TaskConfigurationError(`JobQueueTask: No model ${modelname} found`);\n }\n this.modelCache = { name: modelname, model };\n return model;\n }\n\n protected override async getDefaultQueueName(input: Input): Promise<string | undefined> {\n if (typeof input.model === \"string\") {\n const model = await this.getModelForInput(input as AiSingleTaskInput);\n return model.provider;\n }\n if (typeof input.model === \"object\" && input.model !== null && !Array.isArray(input.model)) {\n return (input.model as ModelConfig).provider;\n }\n return undefined;\n }\n\n /**\n * Validates that a model name really exists\n * @param schema The schema to validate against\n * @param item The item to validate\n * @returns True if the item is valid, false otherwise\n */\n async validateInput(input: Input): Promise<boolean> {\n // TODO(str): this is very inefficient, we should cache the results, including intermediate results\n const inputSchema = this.inputSchema();\n if (typeof inputSchema === \"boolean\") {\n if (inputSchema === false) {\n throw new TaskConfigurationError(`AiTask: Input schema is 'false' and accepts no inputs`);\n }\n return true;\n }\n const modelTaskProperties = Object.entries<JsonSchema>(\n (inputSchema.properties || {}) as Record<string, JsonSchema>\n ).filter(([key, schema]) => schemaFormat(schema)?.startsWith(\"model:\"));\n\n if (modelTaskProperties.length > 0) {\n const taskModels = await getGlobalModelRepository().findModelsByTask(this.type);\n for (const [key, propSchema] of modelTaskProperties) {\n let requestedModels = Array.isArray(input[key]) ? input[key] : [input[key]];\n for (const model of requestedModels) {\n if (typeof model === \"string\") {\n const foundModel = taskModels?.find((m) => m.model_id === model);\n if (!foundModel) {\n throw new TaskConfigurationError(\n `AiTask: Missing model for '${key}' named '${model}' for task '${this.type}'`\n );\n }\n } else if (typeof model === \"object\" && model !== null) {\n // Inline configs are accepted without requiring repository access.\n // If 'tasks' is provided, do a best-effort compatibility check.\n const tasks = (model as ModelConfig).tasks;\n if (Array.isArray(tasks) && tasks.length > 0 && !tasks.includes(this.type)) {\n throw new TaskConfigurationError(\n `AiTask: Inline model for '${key}' is not compatible with task '${this.type}'`\n );\n }\n } else {\n throw new TaskConfigurationError(`AiTask: Invalid model for '${key}'`);\n }\n }\n }\n }\n\n const modelPlainProperties = Object.entries<JsonSchema>(\n (inputSchema.properties || {}) as Record<string, JsonSchema>\n ).filter(([key, schema]) => schemaFormat(schema) === \"model\");\n\n if (modelPlainProperties.length > 0) {\n for (const [key, propSchema] of modelPlainProperties) {\n let requestedModels = Array.isArray(input[key]) ? input[key] : [input[key]];\n for (const model of requestedModels) {\n if (typeof model === \"string\") {\n const foundModel = await getGlobalModelRepository().findByName(model);\n if (!foundModel) {\n throw new TaskConfigurationError(\n `AiTask: Missing model for \"${key}\" named \"${model}\"`\n );\n }\n } else if (typeof model === \"object\" && model !== null) {\n // Inline configs are accepted without requiring repository access.\n } else {\n throw new TaskConfigurationError(`AiTask: Invalid model for \"${key}\"`);\n }\n }\n }\n }\n\n return super.validateInput(input);\n }\n\n // dataflows can strip some models that are incompatible with the target task\n // if all of them are stripped, then the task will fail in validateInput\n async narrowInput(input: Input): Promise<Input> {\n // TODO(str): this is very inefficient, we should cache the results, including intermediate results\n const inputSchema = this.inputSchema();\n if (typeof inputSchema === \"boolean\") {\n if (inputSchema === false) {\n throw new TaskConfigurationError(`AiTask: Input schema is 'false' and accepts no inputs`);\n }\n return input;\n }\n const modelTaskProperties = Object.entries<JsonSchema>(\n (inputSchema.properties || {}) as Record<string, JsonSchema>\n ).filter(([key, schema]) => schemaFormat(schema)?.startsWith(\"model:\"));\n if (modelTaskProperties.length > 0) {\n const taskModels = await getGlobalModelRepository().findModelsByTask(this.type);\n for (const [key, propSchema] of modelTaskProperties) {\n let requestedModels = Array.isArray(input[key]) ? input[key] : [input[key]];\n const requestedStrings = requestedModels.filter(\n (m: unknown): m is string => typeof m === \"string\"\n );\n const requestedInline = requestedModels.filter(\n (m: unknown): m is ModelConfig => typeof m === \"object\" && m !== null\n );\n\n const usingStrings = requestedStrings.filter((model: string) =>\n taskModels?.find((m) => m.model_id === model)\n );\n\n const usingInline = requestedInline.filter((model: ModelConfig) => {\n const tasks = model.tasks;\n // Filter out inline configs with explicit incompatible tasks arrays\n // This matches the validation logic in validateInput\n if (Array.isArray(tasks) && tasks.length > 0 && !tasks.includes(this.type)) {\n return false;\n }\n return true;\n });\n\n const combined: (string | ModelConfig)[] = [...usingInline, ...usingStrings];\n\n // we alter input to be the models that were found for this kind of input\n (input as any)[key] = combined.length > 1 ? combined : combined[0];\n }\n }\n return input;\n }\n}\n",
|
|
19
|
+
"/**\n * @license\n * Copyright 2025 Steven Roussey <sroussey@gmail.com>\n * SPDX-License-Identifier: Apache-2.0\n */\n\nimport {\n CreateWorkflow,\n JobQueueTaskConfig,\n Task,\n TaskRegistry,\n Workflow,\n} from \"@workglow/task-graph\";\nimport { DataPortSchema, FromSchema } from \"@workglow/util\";\nimport { Document, DocumentFragment } from \"../source/Document\";\n\nconst inputSchema = {\n type: \"object\",\n properties: {\n parser: {\n type: \"string\",\n enum: [\"txt\", \"md\"],\n title: \"Document Kind\",\n description: \"The kind of document (txt or md)\",\n },\n // file: Type.Instance(Document),\n },\n required: [\"parser\"],\n additionalProperties: false,\n} as const satisfies DataPortSchema;\n\nconst outputSchema = {\n type: \"object\",\n properties: {\n texts: {\n type: \"array\",\n items: { type: \"string\" },\n title: \"Text Chunks\",\n description: \"The text chunks of the document\",\n },\n },\n required: [\"texts\"],\n additionalProperties: false,\n} as const satisfies DataPortSchema;\n\nexport type DocumentSplitterTaskInput = FromSchema<typeof inputSchema>;\nexport type DocumentSplitterTaskOutput = FromSchema<typeof outputSchema>;\n\nexport class DocumentSplitterTask extends Task<\n DocumentSplitterTaskInput,\n DocumentSplitterTaskOutput,\n JobQueueTaskConfig\n> {\n public static type = \"DocumentSplitterTask\";\n public static category = \"Document\";\n public static title = \"Document Splitter\";\n public static description = \"Splits documents into text chunks for processing\";\n public static inputSchema(): DataPortSchema {\n return inputSchema as DataPortSchema;\n }\n public static outputSchema(): DataPortSchema {\n return outputSchema as DataPortSchema;\n }\n\n flattenFragmentsToTexts(item: DocumentFragment | Document): string[] {\n if (item instanceof Document) {\n const texts: string[] = [];\n item.fragments.forEach((fragment) => {\n texts.push(...this.flattenFragmentsToTexts(fragment));\n });\n return texts;\n } else {\n return [item.content];\n }\n }\n\n async executeReactive(): Promise<DocumentSplitterTaskOutput> {\n return { texts: this.flattenFragmentsToTexts(this.runInputData.file) };\n }\n}\n\nTaskRegistry.registerTask(DocumentSplitterTask);\n\nexport const documentSplitter = (input: DocumentSplitterTaskInput) => {\n return new DocumentSplitterTask(input).run();\n};\n\ndeclare module \"@workglow/task-graph\" {\n interface Workflow {\n documentSplitter: CreateWorkflow<\n DocumentSplitterTaskInput,\n DocumentSplitterTaskOutput,\n JobQueueTaskConfig\n >;\n }\n}\n\nWorkflow.prototype.documentSplitter = CreateWorkflow(DocumentSplitterTask);\n",
|
|
20
|
+
"/**\n * @license\n * Copyright 2025 Steven Roussey <sroussey@gmail.com>\n * SPDX-License-Identifier: Apache-2.0\n */\n\nimport { CreateWorkflow, JobQueueTaskConfig, TaskRegistry, Workflow } from \"@workglow/task-graph\";\nimport { DataPortSchema, FromSchema } from \"@workglow/util\";\nimport { AiTask } from \"./base/AiTask\";\nimport { DeReplicateFromSchema, TypeModel, TypeReplicateArray } from \"./base/AiTaskSchemas\";\n\nconst modelSchema = TypeReplicateArray(TypeModel(\"model\"));\n\nconst DownloadModelInputSchema = {\n type: \"object\",\n properties: {\n model: modelSchema,\n },\n required: [\"model\"],\n additionalProperties: false,\n} as const satisfies DataPortSchema;\n\nconst DownloadModelOutputSchema = {\n type: \"object\",\n properties: {\n model: modelSchema,\n },\n required: [\"model\"],\n additionalProperties: false,\n} as const satisfies DataPortSchema;\n\nexport type DownloadModelTaskRunInput = FromSchema<typeof DownloadModelInputSchema>;\nexport type DownloadModelTaskRunOutput = FromSchema<typeof DownloadModelOutputSchema>;\nexport type DownloadModelTaskExecuteInput = DeReplicateFromSchema<typeof DownloadModelInputSchema>;\nexport type DownloadModelTaskExecuteOutput = DeReplicateFromSchema<\n typeof DownloadModelOutputSchema\n>;\n\n/**\n * Download a model from a remote source and cache it locally.\n *\n * @remarks\n * This task has a side effect of downloading the model and caching it locally outside of the task system\n */\nexport class DownloadModelTask extends AiTask<\n DownloadModelTaskRunInput,\n DownloadModelTaskRunOutput,\n JobQueueTaskConfig\n> {\n public static type = \"DownloadModelTask\";\n public static category = \"AI Text Model\";\n public static title = \"Download Model\";\n public static description = \"Downloads and caches AI models locally with progress tracking\";\n public static inputSchema(): DataPortSchema {\n return DownloadModelInputSchema satisfies DataPortSchema;\n }\n public static outputSchema(): DataPortSchema {\n return DownloadModelOutputSchema satisfies DataPortSchema;\n }\n public static cacheable = false;\n\n public files: { file: string; progress: number }[] = [];\n\n constructor(input: Partial<DownloadModelTaskRunInput>, config: JobQueueTaskConfig = {}) {\n super(input as DownloadModelTaskRunInput, config);\n this.on(\"progress\", this.processProgress.bind(this));\n this.on(\"start\", () => {\n this.files = [];\n });\n }\n\n /**\n * Handles progress updates for the download task\n * @param progress - The progress value (0-100)\n * @param message - The message to display\n * @param details - Additional details about the progress\n */\n processProgress(\n progress: number,\n message: string = \"\",\n details?: { file?: string; progress: number; text?: number }\n ): void {\n if (details?.file) {\n const file = this.files.find((f) => f.file === details.file);\n if (file) {\n file.progress = details.progress;\n } else {\n this.files.push({ file: details.file, progress: details.progress });\n }\n this.progress = this.files.reduce((acc, f) => acc + f.progress, 0) / this.files.length;\n } else {\n this.progress = progress;\n }\n }\n}\n\nTaskRegistry.registerTask(DownloadModelTask);\n\n/**\n * Download a model from a remote source and cache it locally.\n *\n * @param input - Input containing model(s) to download\n * @returns Promise resolving to the downloaded model(s)\n */\nexport const downloadModel = (input: DownloadModelTaskRunInput, config?: JobQueueTaskConfig) => {\n return new DownloadModelTask(input, config).run();\n};\n\ndeclare module \"@workglow/task-graph\" {\n interface Workflow {\n downloadModel: CreateWorkflow<\n DownloadModelTaskRunInput,\n DownloadModelTaskRunOutput,\n JobQueueTaskConfig\n >;\n }\n}\n\nWorkflow.prototype.downloadModel = CreateWorkflow(DownloadModelTask);\n",
|
|
21
|
+
"/**\n * @license\n * Copyright 2025 Steven Roussey <sroussey@gmail.com>\n * SPDX-License-Identifier: Apache-2.0\n */\n\nimport { CreateWorkflow, JobQueueTaskConfig, TaskRegistry, Workflow } from \"@workglow/task-graph\";\nimport { DataPortSchema, FromSchema } from \"@workglow/util\";\nimport {\n DeReplicateFromSchema,\n TypeImageInput,\n TypeModel,\n TypeReplicateArray,\n} from \"./base/AiTaskSchemas\";\nimport { AiVisionTask } from \"./base/AiVisionTask\";\n\nconst modelSchema = TypeReplicateArray(TypeModel(\"model:FaceDetectorTask\"));\n\n/**\n * A bounding box for face detection.\n */\nconst TypeBoundingBox = {\n type: \"object\",\n properties: {\n x: {\n type: \"number\",\n title: \"X Coordinate\",\n description: \"X coordinate of the top-left corner\",\n },\n y: {\n type: \"number\",\n title: \"Y Coordinate\",\n description: \"Y coordinate of the top-left corner\",\n },\n width: {\n type: \"number\",\n title: \"Width\",\n description: \"Width of the bounding box\",\n },\n height: {\n type: \"number\",\n title: \"Height\",\n description: \"Height of the bounding box\",\n },\n },\n required: [\"x\", \"y\", \"width\", \"height\"],\n additionalProperties: false,\n} as const;\n\n/**\n * A keypoint on the face.\n */\nconst TypeKeypoint = {\n type: \"object\",\n properties: {\n x: {\n type: \"number\",\n title: \"X Coordinate\",\n description: \"X coordinate normalized to [0.0, 1.0]\",\n },\n y: {\n type: \"number\",\n title: \"Y Coordinate\",\n description: \"Y coordinate normalized to [0.0, 1.0]\",\n },\n label: {\n type: \"string\",\n title: \"Keypoint Label\",\n description: \"Label for the keypoint (e.g., 'leftEye', 'rightEye', 'noseTip', etc.)\",\n },\n },\n required: [\"x\", \"y\"],\n additionalProperties: false,\n} as const;\n\n/**\n * A detected face with bounding box and keypoints.\n */\nconst TypeFaceDetection = {\n type: \"object\",\n properties: {\n box: TypeBoundingBox,\n keypoints: {\n type: \"array\",\n items: TypeKeypoint,\n title: \"Keypoints\",\n description: \"Facial keypoints (left eye, right eye, nose tip, mouth, left/right tragion)\",\n },\n score: {\n type: \"number\",\n title: \"Confidence Score\",\n description: \"Confidence score for the face detection\",\n },\n },\n required: [\"box\", \"keypoints\", \"score\"],\n additionalProperties: false,\n} as const;\n\nexport const FaceDetectorInputSchema = {\n type: \"object\",\n properties: {\n image: TypeReplicateArray(TypeImageInput),\n model: modelSchema,\n minDetectionConfidence: {\n type: \"number\",\n minimum: 0,\n maximum: 1,\n default: 0.5,\n title: \"Min Detection Confidence\",\n description: \"Minimum confidence score for face detection\",\n \"x-ui-group\": \"Configuration\",\n },\n minSuppressionThreshold: {\n type: \"number\",\n minimum: 0,\n maximum: 1,\n default: 0.3,\n title: \"Min Suppression Threshold\",\n description: \"Minimum non-maximum-suppression threshold for overlapping detections\",\n \"x-ui-group\": \"Configuration\",\n },\n },\n required: [\"image\", \"model\"],\n additionalProperties: false,\n} as const satisfies DataPortSchema;\n\nexport const FaceDetectorOutputSchema = {\n type: \"object\",\n properties: {\n faces: {\n oneOf: [\n { type: \"array\", items: TypeFaceDetection },\n { type: \"array\", items: { type: \"array\", items: TypeFaceDetection } },\n ],\n title: \"Face Detections\",\n description: \"Detected faces with bounding boxes, keypoints, and confidence scores\",\n },\n },\n required: [\"faces\"],\n additionalProperties: false,\n} as const satisfies DataPortSchema;\n\nexport type FaceDetectorTaskInput = FromSchema<typeof FaceDetectorInputSchema>;\nexport type FaceDetectorTaskOutput = FromSchema<typeof FaceDetectorOutputSchema>;\nexport type FaceDetectorTaskExecuteInput = DeReplicateFromSchema<typeof FaceDetectorInputSchema>;\nexport type FaceDetectorTaskExecuteOutput = DeReplicateFromSchema<typeof FaceDetectorOutputSchema>;\n\n/**\n * Detects faces in images using MediaPipe Face Detector.\n * Locates faces and identifies facial keypoints like eyes, nose, and mouth.\n */\nexport class FaceDetectorTask extends AiVisionTask<\n FaceDetectorTaskInput,\n FaceDetectorTaskOutput,\n JobQueueTaskConfig\n> {\n public static type = \"FaceDetectorTask\";\n public static category = \"AI Vision Model\";\n public static title = \"Face Detector\";\n public static description =\n \"Detects faces in images. Locates faces and identifies facial keypoints like eyes, nose, and mouth.\";\n public static inputSchema(): DataPortSchema {\n return FaceDetectorInputSchema as DataPortSchema;\n }\n public static outputSchema(): DataPortSchema {\n return FaceDetectorOutputSchema as DataPortSchema;\n }\n}\n\nTaskRegistry.registerTask(FaceDetectorTask);\n\n/**\n * Convenience function to run face detection tasks.\n * Creates and executes a FaceDetectorTask with the provided input.\n * @param input The input parameters for face detection (image, model, and optional configuration)\n * @returns Promise resolving to the detected faces with bounding boxes and keypoints\n */\nexport const faceDetector = (input: FaceDetectorTaskInput, config?: JobQueueTaskConfig) => {\n return new FaceDetectorTask(input, config).run();\n};\n\ndeclare module \"@workglow/task-graph\" {\n interface Workflow {\n faceDetector: CreateWorkflow<FaceDetectorTaskInput, FaceDetectorTaskOutput, JobQueueTaskConfig>;\n }\n}\n\nWorkflow.prototype.faceDetector = CreateWorkflow(FaceDetectorTask);\n",
|
|
22
|
+
"/**\n * @license\n * Copyright 2025 Steven Roussey <sroussey@gmail.com>\n * SPDX-License-Identifier: Apache-2.0\n */\n\nimport { CreateWorkflow, JobQueueTaskConfig, TaskRegistry, Workflow } from \"@workglow/task-graph\";\nimport { DataPortSchema, FromSchema } from \"@workglow/util\";\nimport {\n DeReplicateFromSchema,\n TypeImageInput,\n TypeModel,\n TypeReplicateArray,\n} from \"./base/AiTaskSchemas\";\nimport { AiVisionTask } from \"./base/AiVisionTask\";\n\nconst modelSchema = TypeReplicateArray(TypeModel(\"model:FaceLandmarkerTask\"));\n\n/**\n * A landmark point with x, y, z coordinates.\n */\nconst TypeLandmark = {\n type: \"object\",\n properties: {\n x: {\n type: \"number\",\n title: \"X Coordinate\",\n description: \"X coordinate normalized to [0.0, 1.0]\",\n },\n y: {\n type: \"number\",\n title: \"Y Coordinate\",\n description: \"Y coordinate normalized to [0.0, 1.0]\",\n },\n z: {\n type: \"number\",\n title: \"Z Coordinate\",\n description: \"Z coordinate (depth)\",\n },\n },\n required: [\"x\", \"y\", \"z\"],\n additionalProperties: false,\n} as const;\n\n/**\n * A blendshape coefficient representing facial expression.\n */\nconst TypeBlendshape = {\n type: \"object\",\n properties: {\n label: {\n type: \"string\",\n title: \"Blendshape Label\",\n description: \"Name of the blendshape (e.g., 'browDownLeft', 'eyeBlinkRight', etc.)\",\n },\n score: {\n type: \"number\",\n title: \"Coefficient Value\",\n description: \"Coefficient value for this blendshape\",\n },\n },\n required: [\"label\", \"score\"],\n additionalProperties: false,\n} as const;\n\n/**\n * A 4x4 transformation matrix.\n */\nconst TypeTransformationMatrix = {\n type: \"array\",\n items: { type: \"number\" },\n minItems: 16,\n maxItems: 16,\n title: \"Transformation Matrix\",\n description: \"4x4 transformation matrix for face effects rendering\",\n} as const;\n\n/**\n * Detection result for a single face.\n */\nconst TypeFaceLandmarkerDetection = {\n type: \"object\",\n properties: {\n landmarks: {\n type: \"array\",\n items: TypeLandmark,\n title: \"Landmarks\",\n description: \"478 facial landmarks in image coordinates\",\n },\n blendshapes: {\n type: \"array\",\n items: TypeBlendshape,\n title: \"Blendshapes\",\n description: \"52 blendshape coefficients representing facial expressions\",\n },\n transformationMatrix: TypeTransformationMatrix,\n },\n required: [\"landmarks\"],\n additionalProperties: false,\n} as const;\n\nexport const FaceLandmarkerInputSchema = {\n type: \"object\",\n properties: {\n image: TypeReplicateArray(TypeImageInput),\n model: modelSchema,\n numFaces: {\n type: \"number\",\n minimum: 1,\n maximum: 10,\n default: 1,\n title: \"Number of Faces\",\n description: \"The maximum number of faces to detect\",\n \"x-ui-group\": \"Configuration\",\n },\n minFaceDetectionConfidence: {\n type: \"number\",\n minimum: 0,\n maximum: 1,\n default: 0.5,\n title: \"Min Face Detection Confidence\",\n description: \"Minimum confidence score for face detection\",\n \"x-ui-group\": \"Configuration\",\n },\n minFacePresenceConfidence: {\n type: \"number\",\n minimum: 0,\n maximum: 1,\n default: 0.5,\n title: \"Min Face Presence Confidence\",\n description: \"Minimum confidence score for face presence\",\n \"x-ui-group\": \"Configuration\",\n },\n minTrackingConfidence: {\n type: \"number\",\n minimum: 0,\n maximum: 1,\n default: 0.5,\n title: \"Min Tracking Confidence\",\n description: \"Minimum confidence score for face tracking\",\n \"x-ui-group\": \"Configuration\",\n },\n outputFaceBlendshapes: {\n type: \"boolean\",\n default: false,\n title: \"Output Face Blendshapes\",\n description: \"Whether to output blendshape coefficients for facial expressions\",\n \"x-ui-group\": \"Configuration\",\n },\n outputFacialTransformationMatrixes: {\n type: \"boolean\",\n default: false,\n title: \"Output Facial Transformation Matrix\",\n description: \"Whether to output transformation matrix for effects rendering\",\n \"x-ui-group\": \"Configuration\",\n },\n },\n required: [\"image\", \"model\"],\n additionalProperties: false,\n} as const satisfies DataPortSchema;\n\nexport const FaceLandmarkerOutputSchema = {\n type: \"object\",\n properties: {\n faces: {\n oneOf: [\n { type: \"array\", items: TypeFaceLandmarkerDetection },\n { type: \"array\", items: { type: \"array\", items: TypeFaceLandmarkerDetection } },\n ],\n title: \"Face Detections\",\n description: \"Detected faces with landmarks, blendshapes, and transformation matrices\",\n },\n },\n required: [\"faces\"],\n additionalProperties: false,\n} as const satisfies DataPortSchema;\n\nexport type FaceLandmarkerTaskInput = FromSchema<typeof FaceLandmarkerInputSchema>;\nexport type FaceLandmarkerTaskOutput = FromSchema<typeof FaceLandmarkerOutputSchema>;\nexport type FaceLandmarkerTaskExecuteInput = DeReplicateFromSchema<\n typeof FaceLandmarkerInputSchema\n>;\nexport type FaceLandmarkerTaskExecuteOutput = DeReplicateFromSchema<\n typeof FaceLandmarkerOutputSchema\n>;\n\n/**\n * Detects facial landmarks and expressions in images using MediaPipe Face Landmarker.\n * Identifies 478 facial landmarks, 52 blendshape coefficients for expressions,\n * and provides transformation matrices for AR effects.\n */\nexport class FaceLandmarkerTask extends AiVisionTask<\n FaceLandmarkerTaskInput,\n FaceLandmarkerTaskOutput,\n JobQueueTaskConfig\n> {\n public static type = \"FaceLandmarkerTask\";\n public static category = \"AI Vision Model\";\n public static title = \"Face Landmarker\";\n public static description =\n \"Detects facial landmarks and expressions in images. Identifies 478 facial landmarks, blendshapes for expressions, and transformation matrices for AR effects.\";\n public static inputSchema(): DataPortSchema {\n return FaceLandmarkerInputSchema as DataPortSchema;\n }\n public static outputSchema(): DataPortSchema {\n return FaceLandmarkerOutputSchema as DataPortSchema;\n }\n}\n\nTaskRegistry.registerTask(FaceLandmarkerTask);\n\n/**\n * Convenience function to run face landmark detection tasks.\n * Creates and executes a FaceLandmarkerTask with the provided input.\n * @param input The input parameters for face landmark detection (image, model, and optional configuration)\n * @returns Promise resolving to the detected facial landmarks, blendshapes, and transformation matrices\n */\nexport const faceLandmarker = (input: FaceLandmarkerTaskInput, config?: JobQueueTaskConfig) => {\n return new FaceLandmarkerTask(input, config).run();\n};\n\ndeclare module \"@workglow/task-graph\" {\n interface Workflow {\n faceLandmarker: CreateWorkflow<\n FaceLandmarkerTaskInput,\n FaceLandmarkerTaskOutput,\n JobQueueTaskConfig\n >;\n }\n}\n\nWorkflow.prototype.faceLandmarker = CreateWorkflow(FaceLandmarkerTask);\n",
|
|
23
|
+
"/**\n * @license\n * Copyright 2025 Steven Roussey <sroussey@gmail.com>\n * SPDX-License-Identifier: Apache-2.0\n */\n\nimport { CreateWorkflow, JobQueueTaskConfig, TaskRegistry, Workflow } from \"@workglow/task-graph\";\nimport { DataPortSchema, FromSchema } from \"@workglow/util\";\nimport {\n DeReplicateFromSchema,\n TypeImageInput,\n TypeModel,\n TypeReplicateArray,\n} from \"./base/AiTaskSchemas\";\nimport { AiVisionTask } from \"./base/AiVisionTask\";\n\nconst modelSchema = TypeReplicateArray(TypeModel(\"model:GestureRecognizerTask\"));\n\n/**\n * A landmark point with x, y, z coordinates.\n */\nconst TypeLandmark = {\n type: \"object\",\n properties: {\n x: {\n type: \"number\",\n title: \"X Coordinate\",\n description: \"X coordinate normalized to [0.0, 1.0]\",\n },\n y: {\n type: \"number\",\n title: \"Y Coordinate\",\n description: \"Y coordinate normalized to [0.0, 1.0]\",\n },\n z: {\n type: \"number\",\n title: \"Z Coordinate\",\n description: \"Z coordinate (depth)\",\n },\n },\n required: [\"x\", \"y\", \"z\"],\n additionalProperties: false,\n} as const;\n\n/**\n * A recognized gesture with label and confidence score.\n */\nconst TypeGesture = {\n type: \"object\",\n properties: {\n label: {\n type: \"string\",\n title: \"Gesture Label\",\n description: \"The recognized gesture (e.g., 'Thumb_Up', 'Victory', etc.)\",\n },\n score: {\n type: \"number\",\n title: \"Confidence Score\",\n description: \"Confidence score for the gesture\",\n },\n },\n required: [\"label\", \"score\"],\n additionalProperties: false,\n} as const;\n\n/**\n * Handedness classification (left or right hand).\n */\nconst TypeHandedness = {\n type: \"object\",\n properties: {\n label: {\n type: \"string\",\n title: \"Hand Label\",\n description: \"Whether the hand is 'Left' or 'Right'\",\n },\n score: {\n type: \"number\",\n title: \"Confidence Score\",\n description: \"Confidence score for the handedness classification\",\n },\n },\n required: [\"label\", \"score\"],\n additionalProperties: false,\n} as const;\n\n/**\n * Detection result for a single hand.\n */\nconst TypeHandGestureDetection = {\n type: \"object\",\n properties: {\n gestures: {\n type: \"array\",\n items: TypeGesture,\n title: \"Gestures\",\n description: \"Recognized gestures for this hand\",\n },\n handedness: {\n type: \"array\",\n items: TypeHandedness,\n title: \"Handedness\",\n description: \"Handedness classification (left/right)\",\n },\n landmarks: {\n type: \"array\",\n items: TypeLandmark,\n title: \"Landmarks\",\n description: \"21 hand landmarks in image coordinates\",\n },\n worldLandmarks: {\n type: \"array\",\n items: TypeLandmark,\n title: \"World Landmarks\",\n description: \"21 hand landmarks in 3D world coordinates (meters)\",\n },\n },\n required: [\"gestures\", \"handedness\", \"landmarks\", \"worldLandmarks\"],\n additionalProperties: false,\n} as const;\n\nexport const GestureRecognizerInputSchema = {\n type: \"object\",\n properties: {\n image: TypeReplicateArray(TypeImageInput),\n model: modelSchema,\n numHands: {\n type: \"number\",\n minimum: 1,\n maximum: 10,\n default: 1,\n title: \"Number of Hands\",\n description: \"The maximum number of hands to detect\",\n \"x-ui-group\": \"Configuration\",\n },\n minHandDetectionConfidence: {\n type: \"number\",\n minimum: 0,\n maximum: 1,\n default: 0.5,\n title: \"Min Hand Detection Confidence\",\n description: \"Minimum confidence score for hand detection\",\n \"x-ui-group\": \"Configuration\",\n },\n minHandPresenceConfidence: {\n type: \"number\",\n minimum: 0,\n maximum: 1,\n default: 0.5,\n title: \"Min Hand Presence Confidence\",\n description: \"Minimum confidence score for hand presence\",\n \"x-ui-group\": \"Configuration\",\n },\n minTrackingConfidence: {\n type: \"number\",\n minimum: 0,\n maximum: 1,\n default: 0.5,\n title: \"Min Tracking Confidence\",\n description: \"Minimum confidence score for hand tracking\",\n \"x-ui-group\": \"Configuration\",\n },\n },\n required: [\"image\", \"model\"],\n additionalProperties: false,\n} as const satisfies DataPortSchema;\n\nexport const GestureRecognizerOutputSchema = {\n type: \"object\",\n properties: {\n hands: {\n oneOf: [\n { type: \"array\", items: TypeHandGestureDetection },\n { type: \"array\", items: { type: \"array\", items: TypeHandGestureDetection } },\n ],\n title: \"Hand Detections\",\n description: \"Detected hands with gestures, handedness, and landmarks\",\n },\n },\n required: [\"hands\"],\n additionalProperties: false,\n} as const satisfies DataPortSchema;\n\nexport type GestureRecognizerTaskInput = FromSchema<typeof GestureRecognizerInputSchema>;\nexport type GestureRecognizerTaskOutput = FromSchema<typeof GestureRecognizerOutputSchema>;\nexport type GestureRecognizerTaskExecuteInput = DeReplicateFromSchema<\n typeof GestureRecognizerInputSchema\n>;\nexport type GestureRecognizerTaskExecuteOutput = DeReplicateFromSchema<\n typeof GestureRecognizerOutputSchema\n>;\n\n/**\n * Recognizes hand gestures in images using MediaPipe Gesture Recognizer.\n * Detects hand landmarks, identifies gestures (like thumbs up, victory sign, etc.),\n * and classifies left vs. right hands.\n */\nexport class GestureRecognizerTask extends AiVisionTask<\n GestureRecognizerTaskInput,\n GestureRecognizerTaskOutput,\n JobQueueTaskConfig\n> {\n public static type = \"GestureRecognizerTask\";\n public static category = \"AI Vision Model\";\n public static title = \"Gesture Recognizer\";\n public static description =\n \"Recognizes hand gestures in images. Detects hand landmarks, identifies gestures (thumbs up, victory, etc.), and classifies handedness.\";\n public static inputSchema(): DataPortSchema {\n return GestureRecognizerInputSchema as DataPortSchema;\n }\n public static outputSchema(): DataPortSchema {\n return GestureRecognizerOutputSchema as DataPortSchema;\n }\n}\n\nTaskRegistry.registerTask(GestureRecognizerTask);\n\n/**\n * Convenience function to run gesture recognition tasks.\n * Creates and executes a GestureRecognizerTask with the provided input.\n * @param input The input parameters for gesture recognition (image, model, and optional configuration)\n * @returns Promise resolving to the detected gestures with landmarks and handedness\n */\nexport const gestureRecognizer = (\n input: GestureRecognizerTaskInput,\n config?: JobQueueTaskConfig\n) => {\n return new GestureRecognizerTask(input, config).run();\n};\n\ndeclare module \"@workglow/task-graph\" {\n interface Workflow {\n gestureRecognizer: CreateWorkflow<\n GestureRecognizerTaskInput,\n GestureRecognizerTaskOutput,\n JobQueueTaskConfig\n >;\n }\n}\n\nWorkflow.prototype.gestureRecognizer = CreateWorkflow(GestureRecognizerTask);\n",
|
|
24
|
+
"/**\n * @license\n * Copyright 2025 Steven Roussey <sroussey@gmail.com>\n * SPDX-License-Identifier: Apache-2.0\n */\n\nimport { CreateWorkflow, JobQueueTaskConfig, TaskRegistry, Workflow } from \"@workglow/task-graph\";\nimport { DataPortSchema, FromSchema } from \"@workglow/util\";\nimport {\n DeReplicateFromSchema,\n TypeImageInput,\n TypeModel,\n TypeReplicateArray,\n} from \"./base/AiTaskSchemas\";\nimport { AiVisionTask } from \"./base/AiVisionTask\";\n\nconst modelSchema = TypeReplicateArray(TypeModel(\"model:HandLandmarkerTask\"));\n\n/**\n * A landmark point with x, y, z coordinates.\n */\nconst TypeLandmark = {\n type: \"object\",\n properties: {\n x: {\n type: \"number\",\n title: \"X Coordinate\",\n description: \"X coordinate normalized to [0.0, 1.0]\",\n },\n y: {\n type: \"number\",\n title: \"Y Coordinate\",\n description: \"Y coordinate normalized to [0.0, 1.0]\",\n },\n z: {\n type: \"number\",\n title: \"Z Coordinate\",\n description: \"Z coordinate (depth)\",\n },\n },\n required: [\"x\", \"y\", \"z\"],\n additionalProperties: false,\n} as const;\n\n/**\n * Handedness classification (left or right hand).\n */\nconst TypeHandedness = {\n type: \"object\",\n properties: {\n label: {\n type: \"string\",\n title: \"Hand Label\",\n description: \"Whether the hand is 'Left' or 'Right'\",\n },\n score: {\n type: \"number\",\n title: \"Confidence Score\",\n description: \"Confidence score for the handedness classification\",\n },\n },\n required: [\"label\", \"score\"],\n additionalProperties: false,\n} as const;\n\n/**\n * Detection result for a single hand.\n */\nconst TypeHandDetection = {\n type: \"object\",\n properties: {\n handedness: {\n type: \"array\",\n items: TypeHandedness,\n title: \"Handedness\",\n description: \"Handedness classification (left/right)\",\n },\n landmarks: {\n type: \"array\",\n items: TypeLandmark,\n title: \"Landmarks\",\n description: \"21 hand landmarks in image coordinates\",\n },\n worldLandmarks: {\n type: \"array\",\n items: TypeLandmark,\n title: \"World Landmarks\",\n description: \"21 hand landmarks in 3D world coordinates (meters)\",\n },\n },\n required: [\"handedness\", \"landmarks\", \"worldLandmarks\"],\n additionalProperties: false,\n} as const;\n\nexport const HandLandmarkerInputSchema = {\n type: \"object\",\n properties: {\n image: TypeReplicateArray(TypeImageInput),\n model: modelSchema,\n numHands: {\n type: \"number\",\n minimum: 1,\n maximum: 10,\n default: 1,\n title: \"Number of Hands\",\n description: \"The maximum number of hands to detect\",\n \"x-ui-group\": \"Configuration\",\n },\n minHandDetectionConfidence: {\n type: \"number\",\n minimum: 0,\n maximum: 1,\n default: 0.5,\n title: \"Min Hand Detection Confidence\",\n description: \"Minimum confidence score for hand detection\",\n \"x-ui-group\": \"Configuration\",\n },\n minHandPresenceConfidence: {\n type: \"number\",\n minimum: 0,\n maximum: 1,\n default: 0.5,\n title: \"Min Hand Presence Confidence\",\n description: \"Minimum confidence score for hand presence\",\n \"x-ui-group\": \"Configuration\",\n },\n minTrackingConfidence: {\n type: \"number\",\n minimum: 0,\n maximum: 1,\n default: 0.5,\n title: \"Min Tracking Confidence\",\n description: \"Minimum confidence score for hand tracking\",\n \"x-ui-group\": \"Configuration\",\n },\n },\n required: [\"image\", \"model\"],\n additionalProperties: false,\n} as const satisfies DataPortSchema;\n\nexport const HandLandmarkerOutputSchema = {\n type: \"object\",\n properties: {\n hands: {\n oneOf: [\n { type: \"array\", items: TypeHandDetection },\n { type: \"array\", items: { type: \"array\", items: TypeHandDetection } },\n ],\n title: \"Hand Detections\",\n description: \"Detected hands with handedness and landmarks\",\n },\n },\n required: [\"hands\"],\n additionalProperties: false,\n} as const satisfies DataPortSchema;\n\nexport type HandLandmarkerTaskInput = FromSchema<typeof HandLandmarkerInputSchema>;\nexport type HandLandmarkerTaskOutput = FromSchema<typeof HandLandmarkerOutputSchema>;\nexport type HandLandmarkerTaskExecuteInput = DeReplicateFromSchema<\n typeof HandLandmarkerInputSchema\n>;\nexport type HandLandmarkerTaskExecuteOutput = DeReplicateFromSchema<\n typeof HandLandmarkerOutputSchema\n>;\n\n/**\n * Detects hand landmarks in images using MediaPipe Hand Landmarker.\n * Identifies 21 hand landmarks and classifies left vs. right hands.\n */\nexport class HandLandmarkerTask extends AiVisionTask<\n HandLandmarkerTaskInput,\n HandLandmarkerTaskOutput,\n JobQueueTaskConfig\n> {\n public static type = \"HandLandmarkerTask\";\n public static category = \"AI Vision Model\";\n public static title = \"Hand Landmarker\";\n public static description =\n \"Detects hand landmarks in images. Identifies 21 hand landmarks and classifies left vs. right hands.\";\n public static inputSchema(): DataPortSchema {\n return HandLandmarkerInputSchema as DataPortSchema;\n }\n public static outputSchema(): DataPortSchema {\n return HandLandmarkerOutputSchema as DataPortSchema;\n }\n}\n\nTaskRegistry.registerTask(HandLandmarkerTask);\n\n/**\n * Convenience function to run hand landmark detection tasks.\n * Creates and executes a HandLandmarkerTask with the provided input.\n * @param input The input parameters for hand landmark detection (image, model, and optional configuration)\n * @returns Promise resolving to the detected hand landmarks and handedness\n */\nexport const handLandmarker = (input: HandLandmarkerTaskInput, config?: JobQueueTaskConfig) => {\n return new HandLandmarkerTask(input, config).run();\n};\n\ndeclare module \"@workglow/task-graph\" {\n interface Workflow {\n handLandmarker: CreateWorkflow<\n HandLandmarkerTaskInput,\n HandLandmarkerTaskOutput,\n JobQueueTaskConfig\n >;\n }\n}\n\nWorkflow.prototype.handLandmarker = CreateWorkflow(HandLandmarkerTask);\n",
|
|
25
|
+
"/**\n * @license\n * Copyright 2025 Steven Roussey <sroussey@gmail.com>\n * SPDX-License-Identifier: Apache-2.0\n */\n\nimport { CreateWorkflow, JobQueueTaskConfig, TaskRegistry, Workflow } from \"@workglow/task-graph\";\nimport { DataPortSchema, FromSchema } from \"@workglow/util\";\nimport {\n DeReplicateFromSchema,\n TypeCategory,\n TypeImageInput,\n TypeModel,\n TypeReplicateArray,\n} from \"./base/AiTaskSchemas\";\nimport { AiVisionTask } from \"./base/AiVisionTask\";\n\nconst modelSchema = TypeReplicateArray(TypeModel(\"model:ImageClassificationTask\"));\n\nexport const ImageClassificationInputSchema = {\n type: \"object\",\n properties: {\n image: TypeReplicateArray(TypeImageInput),\n model: modelSchema,\n categories: {\n type: \"array\",\n items: {\n type: \"string\",\n },\n title: \"Categories\",\n description:\n \"List of candidate categories (optional, if provided uses zero-shot classification)\",\n \"x-ui-group\": \"Configuration\",\n },\n maxCategories: {\n type: \"number\",\n minimum: 1,\n maximum: 1000,\n default: 5,\n title: \"Max Categories\",\n description: \"The maximum number of categories to return\",\n \"x-ui-group\": \"Configuration\",\n },\n },\n required: [\"image\", \"model\"],\n additionalProperties: false,\n} as const satisfies DataPortSchema;\n\nexport const ImageClassificationOutputSchema = {\n type: \"object\",\n properties: {\n categories: {\n oneOf: [\n { type: \"array\", items: TypeCategory },\n { type: \"array\", items: { type: \"array\", items: TypeCategory } },\n ],\n title: \"Categories\",\n description: \"The classification categories with their scores\",\n },\n },\n required: [\"categories\"],\n additionalProperties: false,\n} as const satisfies DataPortSchema;\n\nexport type ImageClassificationTaskInput = FromSchema<typeof ImageClassificationInputSchema>;\nexport type ImageClassificationTaskOutput = FromSchema<typeof ImageClassificationOutputSchema>;\nexport type ImageClassificationTaskExecuteInput = DeReplicateFromSchema<\n typeof ImageClassificationInputSchema\n>;\nexport type ImageClassificationTaskExecuteOutput = DeReplicateFromSchema<\n typeof ImageClassificationOutputSchema\n>;\n\n/**\n * Classifies images into categories using vision models.\n * Automatically selects between regular and zero-shot classification based on whether categories are provided.\n */\nexport class ImageClassificationTask extends AiVisionTask<\n ImageClassificationTaskInput,\n ImageClassificationTaskOutput,\n JobQueueTaskConfig\n> {\n public static type = \"ImageClassificationTask\";\n public static category = \"AI Vision Model\";\n public static title = \"Image Classification\";\n public static description =\n \"Classifies images into categories using vision models. Supports zero-shot classification when categories are provided.\";\n public static inputSchema(): DataPortSchema {\n return ImageClassificationInputSchema as DataPortSchema;\n }\n public static outputSchema(): DataPortSchema {\n return ImageClassificationOutputSchema as DataPortSchema;\n }\n}\n\nTaskRegistry.registerTask(ImageClassificationTask);\n\n/**\n * Convenience function to run image classification tasks.\n * Creates and executes an ImageClassificationTask with the provided input.\n * @param input The input parameters for image classification (image, model, and optional categories)\n * @returns Promise resolving to the classification categories with scores\n */\nexport const imageClassification = (\n input: ImageClassificationTaskInput,\n config?: JobQueueTaskConfig\n) => {\n return new ImageClassificationTask(input, config).run();\n};\n\ndeclare module \"@workglow/task-graph\" {\n interface Workflow {\n imageClassification: CreateWorkflow<\n ImageClassificationTaskInput,\n ImageClassificationTaskOutput,\n JobQueueTaskConfig\n >;\n }\n}\n\nWorkflow.prototype.imageClassification = CreateWorkflow(ImageClassificationTask);\n",
|
|
26
|
+
"/**\n * @license\n * Copyright 2025 Steven Roussey <sroussey@gmail.com>\n * SPDX-License-Identifier: Apache-2.0\n */\n\nimport { CreateWorkflow, JobQueueTaskConfig, TaskRegistry, Workflow } from \"@workglow/task-graph\";\nimport { DataPortSchema, FromSchema } from \"@workglow/util\";\nimport {\n DeReplicateFromSchema,\n TypedArraySchema,\n TypeImageInput,\n TypeModel,\n TypeReplicateArray,\n} from \"./base/AiTaskSchemas\";\nimport { AiVisionTask } from \"./base/AiVisionTask\";\n\nconst modelSchema = TypeReplicateArray(TypeModel(\"model:ImageEmbeddingTask\"));\n\nconst embeddingSchema = TypedArraySchema({\n title: \"Embedding\",\n description: \"The image embedding vector\",\n});\n\nexport const ImageEmbeddingInputSchema = {\n type: \"object\",\n properties: {\n image: TypeReplicateArray(TypeImageInput),\n model: modelSchema,\n },\n required: [\"image\", \"model\"],\n additionalProperties: false,\n} as const satisfies DataPortSchema;\n\nexport const ImageEmbeddingOutputSchema = {\n type: \"object\",\n properties: {\n vector: {\n oneOf: [embeddingSchema, { type: \"array\", items: embeddingSchema }],\n title: \"Embedding\",\n description: \"The image embedding vector\",\n },\n },\n required: [\"vector\"],\n additionalProperties: false,\n} as const satisfies DataPortSchema;\n\nexport type ImageEmbeddingTaskInput = FromSchema<typeof ImageEmbeddingInputSchema>;\nexport type ImageEmbeddingTaskOutput = FromSchema<typeof ImageEmbeddingOutputSchema>;\nexport type ImageEmbeddingTaskExecuteInput = DeReplicateFromSchema<\n typeof ImageEmbeddingInputSchema\n>;\nexport type ImageEmbeddingTaskExecuteOutput = DeReplicateFromSchema<\n typeof ImageEmbeddingOutputSchema\n>;\n\n/**\n * Generates embeddings from images using vision models\n */\nexport class ImageEmbeddingTask extends AiVisionTask<\n ImageEmbeddingTaskInput,\n ImageEmbeddingTaskOutput,\n JobQueueTaskConfig\n> {\n public static type = \"ImageEmbeddingTask\";\n public static category = \"AI Vision Model\";\n public static title = \"Image Embedding\";\n public static description = \"Generates embeddings from images using vision models\";\n public static inputSchema(): DataPortSchema {\n return ImageEmbeddingInputSchema as DataPortSchema;\n }\n public static outputSchema(): DataPortSchema {\n return ImageEmbeddingOutputSchema as DataPortSchema;\n }\n}\n\nTaskRegistry.registerTask(ImageEmbeddingTask);\n\n/**\n * Convenience function to run image embedding tasks.\n * Creates and executes an ImageEmbeddingTask with the provided input.\n * @param input The input parameters for image embedding (image and model)\n * @returns Promise resolving to the image embedding vector\n */\nexport const imageEmbedding = (input: ImageEmbeddingTaskInput, config?: JobQueueTaskConfig) => {\n return new ImageEmbeddingTask(input, config).run();\n};\n\ndeclare module \"@workglow/task-graph\" {\n interface Workflow {\n imageEmbedding: CreateWorkflow<\n ImageEmbeddingTaskInput,\n ImageEmbeddingTaskOutput,\n JobQueueTaskConfig\n >;\n }\n}\n\nWorkflow.prototype.imageEmbedding = CreateWorkflow(ImageEmbeddingTask);\n",
|
|
27
|
+
"/**\n * @license\n * Copyright 2025 Steven Roussey <sroussey@gmail.com>\n * SPDX-License-Identifier: Apache-2.0\n */\n\nimport { CreateWorkflow, JobQueueTaskConfig, TaskRegistry, Workflow } from \"@workglow/task-graph\";\nimport { DataPortSchema, FromSchema } from \"@workglow/util\";\nimport {\n DeReplicateFromSchema,\n TypeImageInput,\n TypeModel,\n TypeReplicateArray,\n} from \"./base/AiTaskSchemas\";\nimport { AiVisionTask } from \"./base/AiVisionTask\";\n\nconst modelSchema = TypeReplicateArray(TypeModel(\"model:ImageSegmentationTask\"));\n\nexport const ImageSegmentationInputSchema = {\n type: \"object\",\n properties: {\n image: TypeReplicateArray(TypeImageInput),\n model: modelSchema,\n threshold: {\n type: \"number\",\n title: \"Threshold\",\n description: \"The threshold for filtering masks by score\",\n minimum: 0,\n maximum: 1,\n default: 0.5,\n \"x-ui-group\": \"Configuration\",\n },\n maskThreshold: {\n type: \"number\",\n title: \"Mask Threshold\",\n description: \"Threshold to use when turning predicted masks into binary values\",\n minimum: 0,\n maximum: 1,\n default: 0.5,\n \"x-ui-group\": \"Configuration\",\n },\n },\n required: [\"image\", \"model\"],\n additionalProperties: false,\n} as const satisfies DataPortSchema;\n\nconst segmentationMaskSchema = {\n type: \"object\",\n properties: {\n label: {\n type: \"string\",\n title: \"Label\",\n description: \"The label of the segmented region\",\n },\n score: {\n type: \"number\",\n title: \"Score\",\n description: \"The confidence score for this segmentation\",\n minimum: 0,\n maximum: 1,\n },\n mask: {\n type: \"object\",\n format: \"image\",\n title: \"Mask\",\n description: \"Mask image\",\n },\n },\n required: [\"label\", \"score\", \"mask\"],\n additionalProperties: false,\n} as const;\n\nexport const ImageSegmentationOutputSchema = {\n type: \"object\",\n properties: {\n masks: {\n oneOf: [\n { type: \"array\", items: segmentationMaskSchema },\n { type: \"array\", items: { type: \"array\", items: segmentationMaskSchema } },\n ],\n title: \"Segmentation Masks\",\n description: \"The segmented regions with their labels, scores, and masks\",\n },\n },\n required: [\"masks\"],\n additionalProperties: false,\n} as const satisfies DataPortSchema;\n\nexport type ImageSegmentationTaskInput = FromSchema<typeof ImageSegmentationInputSchema>;\nexport type ImageSegmentationTaskOutput = FromSchema<typeof ImageSegmentationOutputSchema>;\nexport type ImageSegmentationTaskExecuteInput = DeReplicateFromSchema<\n typeof ImageSegmentationInputSchema\n>;\nexport type ImageSegmentationTaskExecuteOutput = DeReplicateFromSchema<\n typeof ImageSegmentationOutputSchema\n>;\n\n/**\n * Segments images into regions using computer vision models\n */\nexport class ImageSegmentationTask extends AiVisionTask<\n ImageSegmentationTaskInput,\n ImageSegmentationTaskOutput,\n JobQueueTaskConfig\n> {\n public static type = \"ImageSegmentationTask\";\n public static category = \"AI Vision Model\";\n public static title = \"Image Segmentation\";\n public static description =\n \"Segments images into regions with labels using computer vision models\";\n public static inputSchema(): DataPortSchema {\n return ImageSegmentationInputSchema as DataPortSchema;\n }\n public static outputSchema(): DataPortSchema {\n return ImageSegmentationOutputSchema as DataPortSchema;\n }\n}\n\nTaskRegistry.registerTask(ImageSegmentationTask);\n\n/**\n * Convenience function to run image segmentation tasks.\n * Creates and executes an ImageSegmentationTask with the provided input.\n * @param input The input parameters for image segmentation (image and model)\n * @returns Promise resolving to the segmentation masks with labels and scores\n */\nexport const imageSegmentation = (\n input: ImageSegmentationTaskInput,\n config?: JobQueueTaskConfig\n) => {\n return new ImageSegmentationTask(input, config).run();\n};\n\ndeclare module \"@workglow/task-graph\" {\n interface Workflow {\n imageSegmentation: CreateWorkflow<\n ImageSegmentationTaskInput,\n ImageSegmentationTaskOutput,\n JobQueueTaskConfig\n >;\n }\n}\n\nWorkflow.prototype.imageSegmentation = CreateWorkflow(ImageSegmentationTask);\n",
|
|
28
|
+
"/**\n * @license\n * Copyright 2025 Steven Roussey <sroussey@gmail.com>\n * SPDX-License-Identifier: Apache-2.0\n */\n\nimport { CreateWorkflow, JobQueueTaskConfig, TaskRegistry, Workflow } from \"@workglow/task-graph\";\nimport { DataPortSchema, FromSchema } from \"@workglow/util\";\nimport {\n DeReplicateFromSchema,\n TypeImageInput,\n TypeModel,\n TypeReplicateArray,\n} from \"./base/AiTaskSchemas\";\nimport { AiVisionTask } from \"./base/AiVisionTask\";\n\nconst modelSchema = TypeReplicateArray(TypeModel(\"model:ImageToTextTask\"));\n\nconst generatedTextSchema = {\n type: \"string\",\n title: \"Text\",\n description: \"The generated text description\",\n} as const;\n\nexport const ImageToTextInputSchema = {\n type: \"object\",\n properties: {\n image: TypeReplicateArray(TypeImageInput),\n model: modelSchema,\n maxTokens: {\n type: \"number\",\n title: \"Max Tokens\",\n description: \"The maximum number of tokens to generate\",\n minimum: 1,\n maximum: 4096,\n \"x-ui-group\": \"Configuration\",\n },\n },\n required: [\"image\", \"model\"],\n additionalProperties: false,\n} as const satisfies DataPortSchema;\n\nexport const ImageToTextOutputSchema = {\n type: \"object\",\n properties: {\n text: {\n oneOf: [generatedTextSchema, { type: \"array\", items: generatedTextSchema }],\n title: generatedTextSchema.title,\n description: generatedTextSchema.description,\n },\n },\n required: [\"text\"],\n additionalProperties: false,\n} as const satisfies DataPortSchema;\n\nexport type ImageToTextTaskInput = FromSchema<typeof ImageToTextInputSchema>;\nexport type ImageToTextTaskOutput = FromSchema<typeof ImageToTextOutputSchema>;\nexport type ImageToTextTaskExecuteInput = DeReplicateFromSchema<typeof ImageToTextInputSchema>;\nexport type ImageToTextTaskExecuteOutput = DeReplicateFromSchema<typeof ImageToTextOutputSchema>;\n\n/**\n * Generates text descriptions from images using vision-language models\n */\nexport class ImageToTextTask extends AiVisionTask<\n ImageToTextTaskInput,\n ImageToTextTaskOutput,\n JobQueueTaskConfig\n> {\n public static type = \"ImageToTextTask\";\n public static category = \"AI Vision Model\";\n public static title = \"Image to Text\";\n public static description =\n \"Generates text descriptions from images using vision-language models\";\n public static inputSchema(): DataPortSchema {\n return ImageToTextInputSchema as DataPortSchema;\n }\n public static outputSchema(): DataPortSchema {\n return ImageToTextOutputSchema as DataPortSchema;\n }\n}\n\nTaskRegistry.registerTask(ImageToTextTask);\n\n/**\n * Convenience function to run image to text tasks.\n * Creates and executes an ImageToTextTask with the provided input.\n * @param input The input parameters for image to text (image and model)\n * @returns Promise resolving to the generated text description\n */\nexport const imageToText = (input: ImageToTextTaskInput, config?: JobQueueTaskConfig) => {\n return new ImageToTextTask(input, config).run();\n};\n\ndeclare module \"@workglow/task-graph\" {\n interface Workflow {\n imageToText: CreateWorkflow<ImageToTextTaskInput, ImageToTextTaskOutput, JobQueueTaskConfig>;\n }\n}\n\nWorkflow.prototype.imageToText = CreateWorkflow(ImageToTextTask);\n",
|
|
29
|
+
"/**\n * @license\n * Copyright 2025 Steven Roussey <sroussey@gmail.com>\n * SPDX-License-Identifier: Apache-2.0\n */\n\nimport { CreateWorkflow, JobQueueTaskConfig, TaskRegistry, Workflow } from \"@workglow/task-graph\";\nimport { DataPortSchema, FromSchema } from \"@workglow/util\";\nimport {\n DeReplicateFromSchema,\n TypeBoundingBox,\n TypeImageInput,\n TypeModel,\n TypeReplicateArray,\n} from \"./base/AiTaskSchemas\";\nimport { AiVisionTask } from \"./base/AiVisionTask\";\n\nconst modelSchema = TypeReplicateArray(TypeModel(\"model:ObjectDetectionTask\"));\n\nconst detectionSchema = {\n type: \"object\",\n properties: {\n label: {\n type: \"string\",\n title: \"Label\",\n description: \"The label of the detected object\",\n },\n score: {\n type: \"number\",\n title: \"Confidence Score\",\n description: \"The confidence score for this detection\",\n minimum: 0,\n maximum: 1,\n },\n box: TypeBoundingBox,\n },\n required: [\"label\", \"score\", \"box\"],\n additionalProperties: false,\n} as const;\n\nexport const ObjectDetectionInputSchema = {\n type: \"object\",\n properties: {\n image: TypeReplicateArray(TypeImageInput),\n model: modelSchema,\n labels: {\n type: \"array\",\n items: {\n type: \"string\",\n },\n title: \"Labels\",\n description:\n \"List of object labels to detect (optional, if provided uses zero-shot detection)\",\n \"x-ui-group\": \"Configuration\",\n },\n threshold: {\n type: \"number\",\n title: \"Threshold\",\n description: \"The threshold for filtering detections by score\",\n minimum: 0,\n maximum: 1,\n default: 0.5,\n \"x-ui-group\": \"Configuration\",\n },\n },\n required: [\"image\", \"model\"],\n additionalProperties: false,\n} as const satisfies DataPortSchema;\n\nexport const ObjectDetectionOutputSchema = {\n type: \"object\",\n properties: {\n detections: {\n oneOf: [\n { type: \"array\", items: detectionSchema },\n { type: \"array\", items: { type: \"array\", items: detectionSchema } },\n ],\n title: \"Detections\",\n description: \"The detected objects with their labels, scores, and bounding boxes\",\n },\n },\n required: [\"detections\"],\n additionalProperties: false,\n} as const satisfies DataPortSchema;\n\nexport type ObjectDetectionTaskInput = FromSchema<typeof ObjectDetectionInputSchema>;\nexport type ObjectDetectionTaskOutput = FromSchema<typeof ObjectDetectionOutputSchema>;\nexport type ObjectDetectionTaskExecuteInput = DeReplicateFromSchema<\n typeof ObjectDetectionInputSchema\n>;\nexport type ObjectDetectionTaskExecuteOutput = DeReplicateFromSchema<\n typeof ObjectDetectionOutputSchema\n>;\n\n/**\n * Detects objects in images using vision models.\n * Automatically selects between regular and zero-shot detection based on whether labels are provided.\n */\nexport class ObjectDetectionTask extends AiVisionTask<\n ObjectDetectionTaskInput,\n ObjectDetectionTaskOutput,\n JobQueueTaskConfig\n> {\n public static type = \"ObjectDetectionTask\";\n public static category = \"AI Vision Model\";\n public static title = \"Object Detection\";\n public static description =\n \"Detects objects in images using vision models. Supports zero-shot detection when labels are provided.\";\n public static inputSchema(): DataPortSchema {\n return ObjectDetectionInputSchema as DataPortSchema;\n }\n public static outputSchema(): DataPortSchema {\n return ObjectDetectionOutputSchema as DataPortSchema;\n }\n}\n\nTaskRegistry.registerTask(ObjectDetectionTask);\n\n/**\n * Convenience function to run object detection tasks.\n * Creates and executes an ObjectDetectionTask with the provided input.\n * @param input The input parameters for object detection (image, model, and optional labels)\n * @returns Promise resolving to the detected objects with labels, scores, and bounding boxes\n */\nexport const objectDetection = (input: ObjectDetectionTaskInput, config?: JobQueueTaskConfig) => {\n return new ObjectDetectionTask(input, config).run();\n};\n\ndeclare module \"@workglow/task-graph\" {\n interface Workflow {\n objectDetection: CreateWorkflow<\n ObjectDetectionTaskInput,\n ObjectDetectionTaskOutput,\n JobQueueTaskConfig\n >;\n }\n}\n\nWorkflow.prototype.objectDetection = CreateWorkflow(ObjectDetectionTask);\n",
|
|
30
|
+
"/**\n * @license\n * Copyright 2025 Steven Roussey <sroussey@gmail.com>\n * SPDX-License-Identifier: Apache-2.0\n */\n\nimport { CreateWorkflow, JobQueueTaskConfig, TaskRegistry, Workflow } from \"@workglow/task-graph\";\nimport { DataPortSchema, FromSchema } from \"@workglow/util\";\nimport {\n DeReplicateFromSchema,\n TypeImageInput,\n TypeModel,\n TypeReplicateArray,\n} from \"./base/AiTaskSchemas\";\nimport { AiVisionTask } from \"./base/AiVisionTask\";\n\nconst modelSchema = TypeReplicateArray(TypeModel(\"model:PoseLandmarkerTask\"));\n\n/**\n * A landmark point with x, y, z coordinates and visibility/presence scores.\n */\nconst TypePoseLandmark = {\n type: \"object\",\n properties: {\n x: {\n type: \"number\",\n title: \"X Coordinate\",\n description: \"X coordinate normalized to [0.0, 1.0]\",\n },\n y: {\n type: \"number\",\n title: \"Y Coordinate\",\n description: \"Y coordinate normalized to [0.0, 1.0]\",\n },\n z: {\n type: \"number\",\n title: \"Z Coordinate\",\n description: \"Z coordinate (depth)\",\n },\n visibility: {\n type: \"number\",\n title: \"Visibility\",\n description: \"Likelihood of the landmark being visible within the image\",\n },\n presence: {\n type: \"number\",\n title: \"Presence\",\n description: \"Likelihood of the landmark being present in the image\",\n },\n },\n required: [\"x\", \"y\", \"z\"],\n additionalProperties: false,\n} as const;\n\n/**\n * A segmentation mask for the detected person.\n */\nconst TypeSegmentationMask = {\n type: \"object\",\n properties: {\n data: {\n type: \"object\",\n title: \"Mask Data\",\n description: \"Canvas or image data containing the segmentation mask\",\n },\n width: {\n type: \"number\",\n title: \"Width\",\n description: \"Width of the segmentation mask\",\n },\n height: {\n type: \"number\",\n title: \"Height\",\n description: \"Height of the segmentation mask\",\n },\n },\n required: [\"data\", \"width\", \"height\"],\n additionalProperties: false,\n} as const;\n\n/**\n * Detection result for a single pose.\n */\nconst TypePoseDetection = {\n type: \"object\",\n properties: {\n landmarks: {\n type: \"array\",\n items: TypePoseLandmark,\n title: \"Landmarks\",\n description: \"33 pose landmarks in image coordinates\",\n },\n worldLandmarks: {\n type: \"array\",\n items: TypePoseLandmark,\n title: \"World Landmarks\",\n description: \"33 pose landmarks in 3D world coordinates (meters)\",\n },\n segmentationMask: TypeSegmentationMask,\n },\n required: [\"landmarks\", \"worldLandmarks\"],\n additionalProperties: false,\n} as const;\n\nexport const PoseLandmarkerInputSchema = {\n type: \"object\",\n properties: {\n image: TypeReplicateArray(TypeImageInput),\n model: modelSchema,\n numPoses: {\n type: \"number\",\n minimum: 1,\n maximum: 10,\n default: 1,\n title: \"Number of Poses\",\n description: \"The maximum number of poses to detect\",\n \"x-ui-group\": \"Configuration\",\n },\n minPoseDetectionConfidence: {\n type: \"number\",\n minimum: 0,\n maximum: 1,\n default: 0.5,\n title: \"Min Pose Detection Confidence\",\n description: \"Minimum confidence score for pose detection\",\n \"x-ui-group\": \"Configuration\",\n },\n minPosePresenceConfidence: {\n type: \"number\",\n minimum: 0,\n maximum: 1,\n default: 0.5,\n title: \"Min Pose Presence Confidence\",\n description: \"Minimum confidence score for pose presence\",\n \"x-ui-group\": \"Configuration\",\n },\n minTrackingConfidence: {\n type: \"number\",\n minimum: 0,\n maximum: 1,\n default: 0.5,\n title: \"Min Tracking Confidence\",\n description: \"Minimum confidence score for pose tracking\",\n \"x-ui-group\": \"Configuration\",\n },\n outputSegmentationMasks: {\n type: \"boolean\",\n default: false,\n title: \"Output Segmentation Masks\",\n description: \"Whether to output segmentation masks for detected poses\",\n \"x-ui-group\": \"Configuration\",\n },\n },\n required: [\"image\", \"model\"],\n additionalProperties: false,\n} as const satisfies DataPortSchema;\n\nexport const PoseLandmarkerOutputSchema = {\n type: \"object\",\n properties: {\n poses: {\n oneOf: [\n { type: \"array\", items: TypePoseDetection },\n { type: \"array\", items: { type: \"array\", items: TypePoseDetection } },\n ],\n title: \"Pose Detections\",\n description: \"Detected poses with landmarks and optional segmentation masks\",\n },\n },\n required: [\"poses\"],\n additionalProperties: false,\n} as const satisfies DataPortSchema;\n\nexport type PoseLandmarkerTaskInput = FromSchema<typeof PoseLandmarkerInputSchema>;\nexport type PoseLandmarkerTaskOutput = FromSchema<typeof PoseLandmarkerOutputSchema>;\nexport type PoseLandmarkerTaskExecuteInput = DeReplicateFromSchema<\n typeof PoseLandmarkerInputSchema\n>;\nexport type PoseLandmarkerTaskExecuteOutput = DeReplicateFromSchema<\n typeof PoseLandmarkerOutputSchema\n>;\n\n/**\n * Detects pose landmarks in images using MediaPipe Pose Landmarker.\n * Identifies 33 body landmarks for pose estimation and optional segmentation.\n */\nexport class PoseLandmarkerTask extends AiVisionTask<\n PoseLandmarkerTaskInput,\n PoseLandmarkerTaskOutput,\n JobQueueTaskConfig\n> {\n public static type = \"PoseLandmarkerTask\";\n public static category = \"AI Vision Model\";\n public static title = \"Pose Landmarker\";\n public static description =\n \"Detects pose landmarks in images. Identifies 33 body landmarks for pose estimation and optional segmentation.\";\n public static inputSchema(): DataPortSchema {\n return PoseLandmarkerInputSchema as DataPortSchema;\n }\n public static outputSchema(): DataPortSchema {\n return PoseLandmarkerOutputSchema as DataPortSchema;\n }\n}\n\nTaskRegistry.registerTask(PoseLandmarkerTask);\n\n/**\n * Convenience function to run pose landmark detection tasks.\n * Creates and executes a PoseLandmarkerTask with the provided input.\n * @param input The input parameters for pose landmark detection (image, model, and optional configuration)\n * @returns Promise resolving to the detected pose landmarks and optional segmentation masks\n */\nexport const poseLandmarker = (input: PoseLandmarkerTaskInput, config?: JobQueueTaskConfig) => {\n return new PoseLandmarkerTask(input, config).run();\n};\n\ndeclare module \"@workglow/task-graph\" {\n interface Workflow {\n poseLandmarker: CreateWorkflow<\n PoseLandmarkerTaskInput,\n PoseLandmarkerTaskOutput,\n JobQueueTaskConfig\n >;\n }\n}\n\nWorkflow.prototype.poseLandmarker = CreateWorkflow(PoseLandmarkerTask);\n",
|
|
31
|
+
"/**\n * @license\n * Copyright 2025 Steven Roussey <sroussey@gmail.com>\n * SPDX-License-Identifier: Apache-2.0\n */\n\nimport { CreateWorkflow, JobQueueTaskConfig, TaskRegistry, Workflow } from \"@workglow/task-graph\";\nimport { DataPortSchema, FromSchema } from \"@workglow/util\";\nimport { AiTask } from \"./base/AiTask\";\nimport { DeReplicateFromSchema, TypeModel, TypeReplicateArray } from \"./base/AiTaskSchemas\";\n\nconst modelSchema = TypeReplicateArray(TypeModel(\"model:TextClassificationTask\"));\n\nexport const TextClassificationInputSchema = {\n type: \"object\",\n properties: {\n text: TypeReplicateArray({\n type: \"string\",\n title: \"Text\",\n description: \"The text to classify\",\n }),\n candidateLabels: {\n type: \"array\",\n items: {\n type: \"string\",\n },\n title: \"Candidate Labels\",\n description: \"List of candidate labels (optional, if provided uses zero-shot classification)\",\n \"x-ui-group\": \"Configuration\",\n },\n maxCategories: {\n type: \"number\",\n minimum: 1,\n maximum: 1000,\n default: 5,\n title: \"Max Categories\",\n description: \"The maximum number of categories to return\",\n \"x-ui-group\": \"Configuration\",\n },\n model: modelSchema,\n },\n required: [\"text\", \"model\"],\n additionalProperties: false,\n} as const satisfies DataPortSchema;\n\nexport const TextClassificationOutputSchema = {\n type: \"object\",\n properties: {\n categories: {\n type: \"array\",\n items: {\n type: \"object\",\n properties: {\n label: {\n type: \"string\",\n title: \"Label\",\n description: \"The name of the category\",\n },\n score: {\n type: \"number\",\n title: \"Score\",\n description: \"The confidence score for this category\",\n },\n },\n required: [\"label\", \"score\"],\n additionalProperties: false,\n },\n title: \"Categories\",\n description: \"The classification categories with their scores\",\n },\n },\n required: [\"categories\"],\n additionalProperties: false,\n} as const satisfies DataPortSchema;\n\nexport type TextClassificationTaskInput = FromSchema<typeof TextClassificationInputSchema>;\nexport type TextClassificationTaskOutput = FromSchema<typeof TextClassificationOutputSchema>;\nexport type TextClassificationTaskExecuteInput = DeReplicateFromSchema<\n typeof TextClassificationInputSchema\n>;\nexport type TextClassificationTaskExecuteOutput = DeReplicateFromSchema<\n typeof TextClassificationOutputSchema\n>;\n\n/**\n * Classifies text into categories using language models.\n * Automatically selects between regular and zero-shot classification based on whether candidate labels are provided.\n */\nexport class TextClassificationTask extends AiTask<\n TextClassificationTaskInput,\n TextClassificationTaskOutput\n> {\n public static type = \"TextClassificationTask\";\n public static category = \"AI Text Model\";\n public static title = \"Text Classifier\";\n public static description =\n \"Classifies text into categories using language models. Supports zero-shot classification when candidate labels are provided.\";\n public static inputSchema(): DataPortSchema {\n return TextClassificationInputSchema as DataPortSchema;\n }\n public static outputSchema(): DataPortSchema {\n return TextClassificationOutputSchema as DataPortSchema;\n }\n}\n\nTaskRegistry.registerTask(TextClassificationTask);\n\n/**\n * Convenience function to run text classifier tasks.\n * Creates and executes a TextClassificationTask with the provided input.\n * @param input The input parameters for text classification (text and model)\n * @returns Promise resolving to the classification categories with scores\n */\nexport const textClassification = (\n input: TextClassificationTaskInput,\n config?: JobQueueTaskConfig\n) => {\n return new TextClassificationTask(input, config).run();\n};\n\ndeclare module \"@workglow/task-graph\" {\n interface Workflow {\n textClassification: CreateWorkflow<\n TextClassificationTaskInput,\n TextClassificationTaskOutput,\n JobQueueTaskConfig\n >;\n }\n}\n\nWorkflow.prototype.textClassification = CreateWorkflow(TextClassificationTask);\n",
|
|
32
|
+
"/**\n * @license\n * Copyright 2025 Steven Roussey <sroussey@gmail.com>\n * SPDX-License-Identifier: Apache-2.0\n */\n\nimport { CreateWorkflow, JobQueueTaskConfig, TaskRegistry, Workflow } from \"@workglow/task-graph\";\nimport { DataPortSchema, FromSchema } from \"@workglow/util\";\nimport { AiTask } from \"./base/AiTask\";\nimport {\n DeReplicateFromSchema,\n TypedArraySchema,\n TypedArraySchemaOptions,\n TypeModel,\n TypeReplicateArray,\n} from \"./base/AiTaskSchemas\";\n\nconst modelSchema = TypeReplicateArray(TypeModel(\"model:TextEmbeddingTask\"));\n\nexport const TextEmbeddingInputSchema = {\n type: \"object\",\n properties: {\n text: TypeReplicateArray({\n type: \"string\",\n title: \"Text\",\n description: \"The text to embed\",\n }),\n model: modelSchema,\n },\n required: [\"text\", \"model\"],\n additionalProperties: false,\n} as const satisfies DataPortSchema;\n\nexport const TextEmbeddingOutputSchema = {\n type: \"object\",\n properties: {\n vector: TypeReplicateArray(\n TypedArraySchema({\n title: \"Vector\",\n description: \"The vector embedding of the text\",\n })\n ),\n },\n required: [\"vector\"],\n additionalProperties: false,\n} as const satisfies DataPortSchema;\n\nexport type TextEmbeddingTaskInput = FromSchema<\n typeof TextEmbeddingInputSchema,\n TypedArraySchemaOptions\n>;\nexport type TextEmbeddingTaskOutput = FromSchema<\n typeof TextEmbeddingOutputSchema,\n TypedArraySchemaOptions\n>;\nexport type TextEmbeddingTaskExecuteInput = DeReplicateFromSchema<typeof TextEmbeddingInputSchema>;\nexport type TextEmbeddingTaskExecuteOutput = DeReplicateFromSchema<\n typeof TextEmbeddingOutputSchema\n>;\n\n/**\n * A task that generates vector embeddings for text using a specified embedding model.\n * Embeddings are numerical representations of text that capture semantic meaning,\n * useful for similarity comparisons and semantic search.\n *\n * @extends AiTask\n */\nexport class TextEmbeddingTask extends AiTask<TextEmbeddingTaskInput, TextEmbeddingTaskOutput> {\n public static type = \"TextEmbeddingTask\";\n public static category = \"AI Text Model\";\n public static title = \"Text Embedding\";\n public static description = \"Generates vector embeddings for text to capture semantic meaning\";\n public static inputSchema(): DataPortSchema {\n return TextEmbeddingInputSchema as DataPortSchema;\n }\n public static outputSchema(): DataPortSchema {\n return TextEmbeddingOutputSchema as DataPortSchema;\n }\n}\n\nTaskRegistry.registerTask(TextEmbeddingTask);\n\n/**\n * Convenience function to create and run a text embedding task.\n * @param input - Input containing text(s) and model(s) for embedding\n * @returns Promise resolving to the generated embeddings\n */\nexport const textEmbedding = async (input: TextEmbeddingTaskInput, config?: JobQueueTaskConfig) => {\n return new TextEmbeddingTask(input, config).run();\n};\n\ndeclare module \"@workglow/task-graph\" {\n interface Workflow {\n textEmbedding: CreateWorkflow<\n TextEmbeddingTaskInput,\n TextEmbeddingTaskOutput,\n JobQueueTaskConfig\n >;\n }\n}\n\nWorkflow.prototype.textEmbedding = CreateWorkflow(TextEmbeddingTask);\n",
|
|
33
|
+
"/**\n * @license\n * Copyright 2025 Steven Roussey <sroussey@gmail.com>\n * SPDX-License-Identifier: Apache-2.0\n */\n\nimport { CreateWorkflow, JobQueueTaskConfig, TaskRegistry, Workflow } from \"@workglow/task-graph\";\nimport { DataPortSchema, FromSchema } from \"@workglow/util\";\nimport { AiTask } from \"./base/AiTask\";\nimport { DeReplicateFromSchema, TypeModel, TypeReplicateArray } from \"./base/AiTaskSchemas\";\n\nconst modelSchema = TypeReplicateArray(TypeModel(\"model:TextFillMaskTask\"));\n\nexport const TextFillMaskInputSchema = {\n type: \"object\",\n properties: {\n text: TypeReplicateArray({\n type: \"string\",\n title: \"Text\",\n description: \"The text with a mask token to fill\",\n }),\n model: modelSchema,\n },\n required: [\"text\", \"model\"],\n additionalProperties: false,\n} as const satisfies DataPortSchema;\n\nexport const TextFillMaskOutputSchema = {\n type: \"object\",\n properties: {\n predictions: {\n type: \"array\",\n items: {\n type: \"object\",\n properties: {\n entity: {\n type: \"string\",\n title: \"Entity\",\n description: \"The token that was predicted to fill the mask\",\n },\n score: {\n type: \"number\",\n title: \"Score\",\n description: \"The confidence score for this prediction\",\n },\n sequence: {\n type: \"string\",\n title: \"Sequence\",\n description: \"The complete text with the mask filled\",\n },\n },\n required: [\"entity\", \"score\", \"sequence\"],\n additionalProperties: false,\n },\n title: \"Predictions\",\n description: \"The predicted tokens to fill the mask with their scores and complete sequences\",\n },\n },\n required: [\"predictions\"],\n additionalProperties: false,\n} as const satisfies DataPortSchema;\n\nexport type TextFillMaskTaskInput = FromSchema<typeof TextFillMaskInputSchema>;\nexport type TextFillMaskTaskOutput = FromSchema<typeof TextFillMaskOutputSchema>;\nexport type TextFillMaskTaskExecuteInput = DeReplicateFromSchema<typeof TextFillMaskInputSchema>;\nexport type TextFillMaskTaskExecuteOutput = DeReplicateFromSchema<typeof TextFillMaskOutputSchema>;\n\n/**\n * Fills masked tokens in text using language models\n */\nexport class TextFillMaskTask extends AiTask<TextFillMaskTaskInput, TextFillMaskTaskOutput> {\n public static type = \"TextFillMaskTask\";\n public static category = \"AI Text Model\";\n public static title = \"Fill Mask\";\n public static description = \"Fills masked tokens in text\";\n public static inputSchema(): DataPortSchema {\n return TextFillMaskInputSchema as DataPortSchema;\n }\n public static outputSchema(): DataPortSchema {\n return TextFillMaskOutputSchema as DataPortSchema;\n }\n}\n\nTaskRegistry.registerTask(TextFillMaskTask);\n\n/**\n * Convenience function to run fill mask tasks.\n * Creates and executes a TextFillMaskTask with the provided input.\n * @param input The input parameters for fill mask (text with mask token and model)\n * @returns Promise resolving to the predicted tokens with scores and complete sequences\n */\nexport const textFillMask = (input: TextFillMaskTaskInput, config?: JobQueueTaskConfig) => {\n return new TextFillMaskTask(input, config).run();\n};\n\ndeclare module \"@workglow/task-graph\" {\n interface Workflow {\n textFillMask: CreateWorkflow<TextFillMaskTaskInput, TextFillMaskTaskOutput, JobQueueTaskConfig>;\n }\n}\n\nWorkflow.prototype.textFillMask = CreateWorkflow(TextFillMaskTask);\n",
|
|
34
|
+
"/**\n * @license\n * Copyright 2025 Steven Roussey <sroussey@gmail.com>\n * SPDX-License-Identifier: Apache-2.0\n */\n\nimport { CreateWorkflow, JobQueueTaskConfig, TaskRegistry, Workflow } from \"@workglow/task-graph\";\nimport { DataPortSchema, FromSchema } from \"@workglow/util\";\nimport { AiTask } from \"./base/AiTask\";\nimport { DeReplicateFromSchema, TypeModel, TypeReplicateArray } from \"./base/AiTaskSchemas\";\n\nconst generatedTextSchema = {\n type: \"string\",\n title: \"Text\",\n description: \"The generated text\",\n} as const;\n\nconst modelSchema = TypeReplicateArray(TypeModel(\"model:TextGenerationTask\"));\n\nexport const TextGenerationInputSchema = {\n type: \"object\",\n properties: {\n model: modelSchema,\n prompt: TypeReplicateArray({\n type: \"string\",\n title: \"Prompt\",\n description: \"The prompt to generate text from\",\n }),\n maxTokens: {\n type: \"number\",\n title: \"Max Tokens\",\n description: \"The maximum number of tokens to generate\",\n minimum: 1,\n maximum: 4096,\n \"x-ui-group\": \"Configuration\",\n },\n temperature: {\n type: \"number\",\n title: \"Temperature\",\n description: \"The temperature to use for sampling\",\n minimum: 0,\n maximum: 2,\n \"x-ui-group\": \"Configuration\",\n },\n topP: {\n type: \"number\",\n title: \"Top-p\",\n description: \"The top-p value to use for sampling\",\n minimum: 0,\n maximum: 1,\n \"x-ui-group\": \"Configuration\",\n },\n frequencyPenalty: {\n type: \"number\",\n title: \"Frequency Penalty\",\n description: \"The frequency penalty to use\",\n minimum: -2,\n maximum: 2,\n \"x-ui-group\": \"Configuration\",\n },\n presencePenalty: {\n type: \"number\",\n title: \"Presence Penalty\",\n description: \"The presence penalty to use\",\n minimum: -2,\n maximum: 2,\n \"x-ui-group\": \"Configuration\",\n },\n },\n required: [\"model\", \"prompt\"],\n additionalProperties: false,\n} as const satisfies DataPortSchema;\n\nexport const TextGenerationOutputSchema = {\n type: \"object\",\n properties: {\n text: {\n oneOf: [generatedTextSchema, { type: \"array\", items: generatedTextSchema }],\n title: generatedTextSchema.title,\n description: generatedTextSchema.description,\n },\n },\n required: [\"text\"],\n additionalProperties: false,\n} as const satisfies DataPortSchema;\n\nexport type TextGenerationTaskInput = FromSchema<typeof TextGenerationInputSchema>;\nexport type TextGenerationTaskOutput = FromSchema<typeof TextGenerationOutputSchema>;\nexport type TextGenerationTaskExecuteInput = DeReplicateFromSchema<\n typeof TextGenerationInputSchema\n>;\nexport type TextGenerationTaskExecuteOutput = DeReplicateFromSchema<\n typeof TextGenerationOutputSchema\n>;\n\nexport class TextGenerationTask extends AiTask<\n TextGenerationTaskInput,\n TextGenerationTaskOutput,\n JobQueueTaskConfig\n> {\n public static type = \"TextGenerationTask\";\n public static category = \"AI Text Model\";\n public static title = \"Text Generation\";\n public static description =\n \"Generates text from a prompt using language models with configurable parameters\";\n public static inputSchema(): DataPortSchema {\n return TextGenerationInputSchema as DataPortSchema;\n }\n public static outputSchema(): DataPortSchema {\n return TextGenerationOutputSchema as DataPortSchema;\n }\n}\n\nTaskRegistry.registerTask(TextGenerationTask);\n/**\n * Task for generating text using a language model\n */\nexport const textGeneration = (input: TextGenerationTaskInput, config?: JobQueueTaskConfig) => {\n return new TextGenerationTask(input, config).run();\n};\n\ndeclare module \"@workglow/task-graph\" {\n interface Workflow {\n textGeneration: CreateWorkflow<\n TextGenerationTaskInput,\n TextGenerationTaskOutput,\n JobQueueTaskConfig\n >;\n }\n}\n\nWorkflow.prototype.textGeneration = CreateWorkflow(TextGenerationTask);\n",
|
|
35
|
+
"/**\n * @license\n * Copyright 2025 Steven Roussey <sroussey@gmail.com>\n * SPDX-License-Identifier: Apache-2.0\n */\n\nimport { CreateWorkflow, JobQueueTaskConfig, TaskRegistry, Workflow } from \"@workglow/task-graph\";\nimport { DataPortSchema, FromSchema } from \"@workglow/util\";\nimport { AiTask } from \"./base/AiTask\";\nimport { DeReplicateFromSchema, TypeModel, TypeReplicateArray } from \"./base/AiTaskSchemas\";\n\nconst modelSchema = TypeReplicateArray(TypeModel(\"model:TextLanguageDetectionTask\"));\n\nexport const TextLanguageDetectionInputSchema = {\n type: \"object\",\n properties: {\n text: TypeReplicateArray({\n type: \"string\",\n title: \"Text\",\n description: \"The text to detect the language of\",\n }),\n maxLanguages: {\n type: \"number\",\n minimum: 0,\n maximum: 100,\n default: 5,\n title: \"Max Languages\",\n description: \"The maximum number of languages to return\",\n },\n // scoreThreshold: {\n // type: \"number\",\n // minimum: 0,\n // maximum: 1,\n // title: \"Score Threshold\",\n // description: \"The score threshold for the languages to return\",\n // \"x-ui-group\": \"Configuration\",\n // \"x-ui-order\": 1,\n // \"x-ui-group-open\": false,\n // },\n // allowList: {\n // type: \"array\",\n // items: {\n // type: \"string\",\n // },\n // title: \"Allow List\",\n // description: \"The languages to allow (mutually exclusive with blockList)\",\n // \"x-ui-group\": \"Configuration\",\n // \"x-ui-order\": 2,\n // \"x-ui-group-open\": false,\n // },\n // blockList: {\n // type: \"array\",\n // items: {\n // type: \"string\",\n // },\n // title: \"Block List\",\n // description: \"The languages to block (mutually exclusive with allowList)\",\n // \"x-ui-group\": \"Configuration\",\n // \"x-ui-order\": 3,\n // \"x-ui-group-open\": false,\n // },\n model: modelSchema,\n },\n required: [\"text\", \"model\"],\n additionalProperties: false,\n // not: {\n // required: [\"allowList\", \"blockList\"],\n // },\n} as const satisfies DataPortSchema;\n\nexport const TextLanguageDetectionOutputSchema = {\n type: \"object\",\n properties: {\n languages: {\n type: \"array\",\n items: {\n type: \"object\",\n properties: {\n language: {\n type: \"string\",\n title: \"Language\",\n description: \"The language\",\n },\n score: {\n type: \"number\",\n title: \"Score\",\n description: \"The confidence score for this language\",\n },\n },\n required: [\"language\", \"score\"],\n additionalProperties: false,\n },\n title: \"Languages\",\n description: \"The languages with their scores\",\n },\n },\n required: [\"languages\"],\n additionalProperties: false,\n} as const satisfies DataPortSchema;\n\nexport type TextLanguageDetectionTaskInput = FromSchema<typeof TextLanguageDetectionInputSchema>;\nexport type TextLanguageDetectionTaskOutput = FromSchema<typeof TextLanguageDetectionOutputSchema>;\nexport type TextLanguageDetectionTaskExecuteInput = DeReplicateFromSchema<\n typeof TextLanguageDetectionInputSchema\n>;\nexport type TextLanguageDetectionTaskExecuteOutput = DeReplicateFromSchema<\n typeof TextLanguageDetectionOutputSchema\n>;\n\n/**\n * Detects the language of text using language models\n */\nexport class TextLanguageDetectionTask extends AiTask<\n TextLanguageDetectionTaskInput,\n TextLanguageDetectionTaskOutput\n> {\n public static type = \"TextLanguageDetectionTask\";\n public static category = \"AI Text Model\";\n public static title = \"Language Detection\";\n public static description = \"Detects the language of text using language models\";\n public static inputSchema(): DataPortSchema {\n return TextLanguageDetectionInputSchema as DataPortSchema;\n }\n public static outputSchema(): DataPortSchema {\n return TextLanguageDetectionOutputSchema as DataPortSchema;\n }\n}\n\nTaskRegistry.registerTask(TextLanguageDetectionTask);\n\n/**\n * Convenience function to run language detection tasks.\n * Creates and executes a TextLanguageDetectionTask with the provided input.\n * @param input The input parameters for language detection (text and model)\n * @returns Promise resolving to the languages with scores\n */\nexport const textLanguageDetection = (\n input: TextLanguageDetectionTaskInput,\n config?: JobQueueTaskConfig\n) => {\n return new TextLanguageDetectionTask(input, config).run();\n};\n\ndeclare module \"@workglow/task-graph\" {\n interface Workflow {\n textLanguageDetection: CreateWorkflow<\n TextLanguageDetectionTaskInput,\n TextLanguageDetectionTaskOutput,\n JobQueueTaskConfig\n >;\n }\n}\n\nWorkflow.prototype.textLanguageDetection = CreateWorkflow(TextLanguageDetectionTask);\n",
|
|
36
|
+
"/**\n * @license\n * Copyright 2025 Steven Roussey <sroussey@gmail.com>\n * SPDX-License-Identifier: Apache-2.0\n */\n\nimport { CreateWorkflow, JobQueueTaskConfig, TaskRegistry, Workflow } from \"@workglow/task-graph\";\nimport { DataPortSchema, FromSchema } from \"@workglow/util\";\nimport { AiTask } from \"./base/AiTask\";\nimport { DeReplicateFromSchema, TypeModel, TypeReplicateArray } from \"./base/AiTaskSchemas\";\n\nconst modelSchema = TypeReplicateArray(TypeModel(\"model:NamedEntityRecognitionTask\"));\n\nexport const TextNamedEntityRecognitionInputSchema = {\n type: \"object\",\n properties: {\n text: TypeReplicateArray({\n type: \"string\",\n title: \"Text\",\n description: \"The text to extract named entities from\",\n }),\n blockList: {\n type: \"array\",\n items: {\n type: \"string\",\n },\n title: \"Block List\",\n description: \"The entity types to exclude from results\",\n \"x-ui-group\": \"Configuration\",\n \"x-ui-group-open\": false,\n },\n model: modelSchema,\n },\n required: [\"text\", \"model\"],\n additionalProperties: false,\n} as const satisfies DataPortSchema;\n\nexport const TextNamedEntityRecognitionOutputSchema = {\n type: \"object\",\n properties: {\n entities: {\n type: \"array\",\n items: {\n type: \"object\",\n properties: {\n entity: {\n type: \"string\",\n title: \"Entity\",\n description: \"The type of the named entity\",\n },\n score: {\n type: \"number\",\n title: \"Score\",\n description: \"The confidence score for this entity\",\n },\n word: {\n type: \"string\",\n title: \"Word\",\n description: \"The extracted text of the named entity\",\n },\n },\n required: [\"entity\", \"score\", \"word\"],\n additionalProperties: false,\n },\n title: \"Entities\",\n description: \"The extracted named entities with their types, scores, and text\",\n },\n },\n required: [\"entities\"],\n additionalProperties: false,\n} as const satisfies DataPortSchema;\n\nexport type TextNamedEntityRecognitionTaskInput = FromSchema<\n typeof TextNamedEntityRecognitionInputSchema\n>;\nexport type TextNamedEntityRecognitionTaskOutput = FromSchema<\n typeof TextNamedEntityRecognitionOutputSchema\n>;\nexport type TextNamedEntityRecognitionTaskExecuteInput = DeReplicateFromSchema<\n typeof TextNamedEntityRecognitionInputSchema\n>;\nexport type TextNamedEntityRecognitionTaskExecuteOutput = DeReplicateFromSchema<\n typeof TextNamedEntityRecognitionOutputSchema\n>;\n\n/**\n * Extracts named entities from text using language models\n */\nexport class TextNamedEntityRecognitionTask extends AiTask<\n TextNamedEntityRecognitionTaskInput,\n TextNamedEntityRecognitionTaskOutput\n> {\n public static type = \"TextNamedEntityRecognitionTask\";\n public static category = \"AI Text Model\";\n public static title = \"Named Entity Recognition\";\n public static description = \"Extracts named entities from text\";\n public static inputSchema(): DataPortSchema {\n return TextNamedEntityRecognitionInputSchema as DataPortSchema;\n }\n public static outputSchema(): DataPortSchema {\n return TextNamedEntityRecognitionOutputSchema as DataPortSchema;\n }\n}\n\nTaskRegistry.registerTask(TextNamedEntityRecognitionTask);\n\n/**\n * Convenience function to run named entity recognition tasks.\n * Creates and executes a TextNamedEntityRecognitionTask with the provided input.\n * @param input The input parameters for named entity recognition (text and model)\n * @returns Promise resolving to the extracted named entities with types, scores, and text\n */\nexport const textNamedEntityRecognition = (\n input: TextNamedEntityRecognitionTaskInput,\n config?: JobQueueTaskConfig\n) => {\n return new TextNamedEntityRecognitionTask(input, config).run();\n};\n\ndeclare module \"@workglow/task-graph\" {\n interface Workflow {\n textNamedEntityRecognition: CreateWorkflow<\n TextNamedEntityRecognitionTaskInput,\n TextNamedEntityRecognitionTaskOutput,\n JobQueueTaskConfig\n >;\n }\n}\n\nWorkflow.prototype.textNamedEntityRecognition = CreateWorkflow(TextNamedEntityRecognitionTask);\n",
|
|
37
|
+
"/**\n * @license\n * Copyright 2025 Steven Roussey <sroussey@gmail.com>\n * SPDX-License-Identifier: Apache-2.0\n */\n\nimport { CreateWorkflow, JobQueueTaskConfig, TaskRegistry, Workflow } from \"@workglow/task-graph\";\nimport { DataPortSchema, FromSchema } from \"@workglow/util\";\nimport { AiTask } from \"./base/AiTask\";\nimport { DeReplicateFromSchema, TypeModel, TypeReplicateArray } from \"./base/AiTaskSchemas\";\n\nconst contextSchema = {\n type: \"string\",\n title: \"Context\",\n description: \"The context of the question\",\n} as const;\n\nconst questionSchema = {\n type: \"string\",\n title: \"Question\",\n description: \"The question to answer\",\n} as const;\n\nconst textSchema = {\n type: \"string\",\n title: \"Text\",\n description: \"The generated text\",\n} as const;\n\nconst modelSchema = TypeReplicateArray(TypeModel(\"model:TextQuestionAnswerTask\"));\n\nexport const TextQuestionAnswerInputSchema = {\n type: \"object\",\n properties: {\n context: TypeReplicateArray(contextSchema),\n question: TypeReplicateArray(questionSchema),\n model: modelSchema,\n },\n required: [\"context\", \"question\", \"model\"],\n additionalProperties: false,\n} as const satisfies DataPortSchema;\n\nexport const TextQuestionAnswerOutputSchema = {\n type: \"object\",\n properties: {\n text: {\n oneOf: [textSchema, { type: \"array\", items: textSchema }],\n title: textSchema.title,\n description: textSchema.description,\n },\n },\n required: [\"text\"],\n additionalProperties: false,\n} as const satisfies DataPortSchema;\n\nexport type TextQuestionAnswerTaskInput = FromSchema<typeof TextQuestionAnswerInputSchema>;\nexport type TextQuestionAnswerTaskOutput = FromSchema<typeof TextQuestionAnswerOutputSchema>;\nexport type TextQuestionAnswerTaskExecuteInput = DeReplicateFromSchema<\n typeof TextQuestionAnswerInputSchema\n>;\nexport type TextQuestionAnswerTaskExecuteOutput = DeReplicateFromSchema<\n typeof TextQuestionAnswerOutputSchema\n>;\n\n/**\n * This is a special case of text generation that takes a context and a question\n */\nexport class TextQuestionAnswerTask extends AiTask<\n TextQuestionAnswerTaskInput,\n TextQuestionAnswerTaskOutput,\n JobQueueTaskConfig\n> {\n public static type = \"TextQuestionAnswerTask\";\n public static category = \"AI Text Model\";\n public static title = \"Text Question Answer\";\n public static description = \"Answers questions based on provided context using language models\";\n public static inputSchema(): DataPortSchema {\n return TextQuestionAnswerInputSchema as DataPortSchema;\n }\n public static outputSchema(): DataPortSchema {\n return TextQuestionAnswerOutputSchema as DataPortSchema;\n }\n}\n\nTaskRegistry.registerTask(TextQuestionAnswerTask);\n\n/**\n * Convenience function to run text question answer tasks.\n * Creates and executes a TextQuestionAnswerCompoundTask with the provided input.\n * @param input The input parameters for text question answer (context, question, and model)\n * @returns Promise resolving to the generated answer(s)\n */\nexport const textQuestionAnswer = (\n input: TextQuestionAnswerTaskInput,\n config?: JobQueueTaskConfig\n) => {\n return new TextQuestionAnswerTask(input, config).run();\n};\n\ndeclare module \"@workglow/task-graph\" {\n interface Workflow {\n textQuestionAnswer: CreateWorkflow<\n TextQuestionAnswerTaskInput,\n TextQuestionAnswerTaskOutput,\n JobQueueTaskConfig\n >;\n }\n}\n\nWorkflow.prototype.textQuestionAnswer = CreateWorkflow(TextQuestionAnswerTask);\n",
|
|
38
|
+
"/**\n * @license\n * Copyright 2025 Steven Roussey <sroussey@gmail.com>\n * SPDX-License-Identifier: Apache-2.0\n */\n\nimport { CreateWorkflow, JobQueueTaskConfig, TaskRegistry, Workflow } from \"@workglow/task-graph\";\nimport { DataPortSchema, FromSchema } from \"@workglow/util\";\nimport { AiTask } from \"./base/AiTask\";\nimport { DeReplicateFromSchema, TypeModel, TypeReplicateArray } from \"./base/AiTaskSchemas\";\n\nconst modelSchema = TypeReplicateArray(TypeModel(\"model:TextRewriterTask\"));\n\nexport const TextRewriterInputSchema = {\n type: \"object\",\n properties: {\n text: TypeReplicateArray({\n type: \"string\",\n title: \"Text\",\n description: \"The text to rewrite\",\n }),\n prompt: TypeReplicateArray({\n type: \"string\",\n title: \"Prompt\",\n description: \"The prompt to direct the rewriting\",\n }),\n model: modelSchema,\n },\n required: [\"text\", \"prompt\", \"model\"],\n additionalProperties: false,\n} as const satisfies DataPortSchema;\n\nexport const TextRewriterOutputSchema = {\n type: \"object\",\n properties: {\n text: {\n type: \"string\",\n title: \"Text\",\n description: \"The rewritten text\",\n },\n },\n required: [\"text\"],\n additionalProperties: false,\n} as const satisfies DataPortSchema;\n\nexport type TextRewriterTaskInput = FromSchema<typeof TextRewriterInputSchema>;\nexport type TextRewriterTaskOutput = FromSchema<typeof TextRewriterOutputSchema>;\nexport type TextRewriterTaskExecuteInput = DeReplicateFromSchema<typeof TextRewriterInputSchema>;\nexport type TextRewriterTaskExecuteOutput = DeReplicateFromSchema<typeof TextRewriterOutputSchema>;\n\n/**\n * This is a special case of text generation that takes a prompt and text to rewrite\n */\nexport class TextRewriterTask extends AiTask<TextRewriterTaskInput, TextRewriterTaskOutput> {\n public static type = \"TextRewriterTask\";\n public static category = \"AI Text Model\";\n public static title = \"Text Rewriter\";\n public static description = \"Rewrites text according to a given prompt using language models\";\n public static inputSchema(): DataPortSchema {\n return TextRewriterInputSchema as DataPortSchema;\n }\n public static outputSchema(): DataPortSchema {\n return TextRewriterOutputSchema as DataPortSchema;\n }\n}\n\nTaskRegistry.registerTask(TextRewriterTask);\n\n/**\n * Convenience function to run text rewriter tasks.\n * Creates and executes a TextRewriterCompoundTask with the provided input.\n * @param input The input parameters for text rewriting (text, prompt, and model)\n * @returns Promise resolving to the rewritten text output(s)\n */\nexport const textRewriter = (input: TextRewriterTaskInput, config?: JobQueueTaskConfig) => {\n return new TextRewriterTask(input, config).run();\n};\n\ndeclare module \"@workglow/task-graph\" {\n interface Workflow {\n textRewriter: CreateWorkflow<TextRewriterTaskInput, TextRewriterTaskOutput, JobQueueTaskConfig>;\n }\n}\n\nWorkflow.prototype.textRewriter = CreateWorkflow(TextRewriterTask);\n",
|
|
39
|
+
"/**\n * @license\n * Copyright 2025 Steven Roussey <sroussey@gmail.com>\n * SPDX-License-Identifier: Apache-2.0\n */\n\nimport { CreateWorkflow, JobQueueTaskConfig, TaskRegistry, Workflow } from \"@workglow/task-graph\";\nimport { DataPortSchema, FromSchema } from \"@workglow/util\";\nimport { AiTask } from \"./base/AiTask\";\nimport { DeReplicateFromSchema, TypeModel, TypeReplicateArray } from \"./base/AiTaskSchemas\";\n\nconst modelSchema = TypeReplicateArray(TypeModel(\"model:TextSummaryTask\"));\n\nexport const TextSummaryInputSchema = {\n type: \"object\",\n properties: {\n text: TypeReplicateArray({\n type: \"string\",\n title: \"Text\",\n description: \"The text to summarize\",\n }),\n model: modelSchema,\n },\n required: [\"text\", \"model\"],\n additionalProperties: false,\n} as const satisfies DataPortSchema;\n\nexport const TextSummaryOutputSchema = {\n type: \"object\",\n properties: {\n text: {\n type: \"string\",\n title: \"Text\",\n description: \"The summarized text\",\n },\n },\n required: [\"text\"],\n additionalProperties: false,\n} as const satisfies DataPortSchema;\n\nexport type TextSummaryTaskInput = FromSchema<typeof TextSummaryInputSchema>;\nexport type TextSummaryTaskOutput = FromSchema<typeof TextSummaryOutputSchema>;\nexport type TextSummaryTaskExecuteInput = DeReplicateFromSchema<typeof TextSummaryInputSchema>;\nexport type TextSummaryTaskExecuteOutput = DeReplicateFromSchema<typeof TextSummaryOutputSchema>;\n\n/**\n * This summarizes a piece of text\n */\n\nexport class TextSummaryTask extends AiTask<TextSummaryTaskInput, TextSummaryTaskOutput> {\n public static type = \"TextSummaryTask\";\n public static category = \"AI Text Model\";\n public static title = \"Text Summary\";\n public static description =\n \"Summarizes text into a shorter form while preserving key information\";\n public static inputSchema(): DataPortSchema {\n return TextSummaryInputSchema as DataPortSchema;\n }\n public static outputSchema(): DataPortSchema {\n return TextSummaryOutputSchema as DataPortSchema;\n }\n}\n\nTaskRegistry.registerTask(TextSummaryTask);\n\n/**\n * Convenience function to run text summary tasks.\n * Creates and executes a text summary task with the provided input.\n * @param input The input parameters for text summary (text and model)\n * @returns Promise resolving to the summarized text output(s)\n */\nexport const textSummary = async (input: TextSummaryTaskInput, config?: JobQueueTaskConfig) => {\n return new TextSummaryTask(input, config).run();\n};\n\ndeclare module \"@workglow/task-graph\" {\n interface Workflow {\n textSummary: CreateWorkflow<TextSummaryTaskInput, TextSummaryTaskOutput, JobQueueTaskConfig>;\n }\n}\n\nWorkflow.prototype.textSummary = CreateWorkflow(TextSummaryTask);\n",
|
|
40
|
+
"/**\n * @license\n * Copyright 2025 Steven Roussey <sroussey@gmail.com>\n * SPDX-License-Identifier: Apache-2.0\n */\n\nimport { CreateWorkflow, JobQueueTaskConfig, TaskRegistry, Workflow } from \"@workglow/task-graph\";\nimport { DataPortSchema, FromSchema } from \"@workglow/util\";\nimport { AiTask } from \"./base/AiTask\";\nimport {\n DeReplicateFromSchema,\n TypeLanguage,\n TypeModel,\n TypeReplicateArray,\n} from \"./base/AiTaskSchemas\";\n\nconst modelSchema = TypeReplicateArray(TypeModel(\"model:TextTranslationTask\"));\n\nconst translationTextSchema = {\n type: \"string\",\n title: \"Text\",\n description: \"The translated text\",\n} as const;\n\nexport const TextTranslationInputSchema = {\n type: \"object\",\n properties: {\n text: TypeReplicateArray({\n type: \"string\",\n title: \"Text\",\n description: \"The text to translate\",\n }),\n source_lang: TypeReplicateArray(\n TypeLanguage({\n title: \"Source Language\",\n description: \"The source language\",\n minLength: 2,\n maxLength: 2,\n })\n ),\n target_lang: TypeReplicateArray(\n TypeLanguage({\n title: \"Target Language\",\n description: \"The target language\",\n minLength: 2,\n maxLength: 2,\n })\n ),\n model: modelSchema,\n },\n required: [\"text\", \"source_lang\", \"target_lang\", \"model\"],\n additionalProperties: false,\n} as const satisfies DataPortSchema;\n\nexport const TextTranslationOutputSchema = {\n type: \"object\",\n properties: {\n text: {\n oneOf: [translationTextSchema, { type: \"array\", items: translationTextSchema }],\n title: translationTextSchema.title,\n description: translationTextSchema.description,\n },\n target_lang: TypeLanguage({\n title: \"Output Language\",\n description: \"The output language\",\n minLength: 2,\n maxLength: 2,\n }),\n },\n required: [\"text\", \"target_lang\"],\n additionalProperties: false,\n} as const satisfies DataPortSchema;\n\nexport type TextTranslationTaskInput = FromSchema<typeof TextTranslationInputSchema>;\nexport type TextTranslationTaskOutput = FromSchema<typeof TextTranslationOutputSchema>;\nexport type TextTranslationTaskExecuteInput = DeReplicateFromSchema<\n typeof TextTranslationInputSchema\n>;\nexport type TextTranslationTaskExecuteOutput = DeReplicateFromSchema<\n typeof TextTranslationOutputSchema\n>;\n\n/**\n * This translates text from one language to another\n */\nexport class TextTranslationTask extends AiTask<\n TextTranslationTaskInput,\n TextTranslationTaskOutput\n> {\n public static type = \"TextTranslationTask\";\n public static category = \"AI Text Model\";\n public static title = \"Text Translation\";\n public static description = \"Translates text from one language to another using language models\";\n public static inputSchema(): DataPortSchema {\n return TextTranslationInputSchema as DataPortSchema;\n }\n public static outputSchema(): DataPortSchema {\n return TextTranslationOutputSchema as DataPortSchema;\n }\n}\n\nTaskRegistry.registerTask(TextTranslationTask);\n\n/**\n * Convenience function to run text translation tasks.\n * Creates and executes a TextTranslationCompoundTask with the provided input.\n * @param input The input parameters for text translation (text, model, source_lang, and target_lang)\n * @returns Promise resolving to the translated text output(s)\n */\nexport const textTranslation = (input: TextTranslationTaskInput, config?: JobQueueTaskConfig) => {\n return new TextTranslationTask(input, config).run();\n};\n\ndeclare module \"@workglow/task-graph\" {\n interface Workflow {\n textTranslation: CreateWorkflow<\n TextTranslationTaskInput,\n TextTranslationTaskOutput,\n JobQueueTaskConfig\n >;\n }\n}\n\nWorkflow.prototype.textTranslation = CreateWorkflow(TextTranslationTask);\n",
|
|
41
|
+
"/**\n * @license\n * Copyright 2025 Steven Roussey <sroussey@gmail.com>\n * SPDX-License-Identifier: Apache-2.0\n */\n\nimport { CreateWorkflow, JobQueueTaskConfig, TaskRegistry, Workflow } from \"@workglow/task-graph\";\nimport { DataPortSchema, FromSchema } from \"@workglow/util\";\nimport { AiTask } from \"./base/AiTask\";\nimport { DeReplicateFromSchema, TypeModel, TypeReplicateArray } from \"./base/AiTaskSchemas\";\n\nconst modelSchema = TypeReplicateArray(TypeModel(\"model\"));\n\nconst UnloadModelInputSchema = {\n type: \"object\",\n properties: {\n model: modelSchema,\n },\n required: [\"model\"],\n additionalProperties: false,\n} as const satisfies DataPortSchema;\n\nconst UnloadModelOutputSchema = {\n type: \"object\",\n properties: {\n model: modelSchema,\n },\n required: [\"model\"],\n additionalProperties: false,\n} as const satisfies DataPortSchema;\n\nexport type UnloadModelTaskRunInput = FromSchema<typeof UnloadModelInputSchema>;\nexport type UnloadModelTaskRunOutput = FromSchema<typeof UnloadModelOutputSchema>;\nexport type UnloadModelTaskExecuteInput = DeReplicateFromSchema<typeof UnloadModelInputSchema>;\nexport type UnloadModelTaskExecuteOutput = DeReplicateFromSchema<typeof UnloadModelOutputSchema>;\n\n/**\n * Unload a model from memory and clear its cache.\n *\n * @remarks\n * This task has a side effect of removing the model from memory and deleting cached files\n */\nexport class UnloadModelTask extends AiTask<\n UnloadModelTaskRunInput,\n UnloadModelTaskRunOutput,\n JobQueueTaskConfig\n> {\n public static type = \"UnloadModelTask\";\n public static category = \"Hidden\";\n public static title = \"Unload Model\";\n public static description = \"Unloads and clears cached AI models from memory and storage\";\n public static inputSchema(): DataPortSchema {\n return UnloadModelInputSchema satisfies DataPortSchema;\n }\n public static outputSchema(): DataPortSchema {\n return UnloadModelOutputSchema satisfies DataPortSchema;\n }\n public static cacheable = false;\n}\n\nTaskRegistry.registerTask(UnloadModelTask);\n\n/**\n * Unload a model from memory and clear its cache.\n *\n * @param input - Input containing model(s) to unload\n * @returns Promise resolving to the unloaded model(s)\n */\nexport const unloadModel = (input: UnloadModelTaskRunInput, config?: JobQueueTaskConfig) => {\n return new UnloadModelTask(input, config).run();\n};\n\ndeclare module \"@workglow/task-graph\" {\n interface Workflow {\n unloadModel: CreateWorkflow<\n UnloadModelTaskRunInput,\n UnloadModelTaskRunOutput,\n JobQueueTaskConfig\n >;\n }\n}\n\nWorkflow.prototype.unloadModel = CreateWorkflow(UnloadModelTask);\n",
|
|
42
|
+
"/**\n * @license\n * Copyright 2025 Steven Roussey <sroussey@gmail.com>\n * SPDX-License-Identifier: Apache-2.0\n */\n\nimport {\n ArrayTask,\n CreateWorkflow,\n JobQueueTaskConfig,\n TaskError,\n TaskRegistry,\n Workflow,\n} from \"@workglow/task-graph\";\nimport { DataPortSchema, FromSchema } from \"@workglow/util\";\nimport { TypedArray, TypedArraySchema, TypedArraySchemaOptions } from \"./base/AiTaskSchemas\";\n\nexport const SimilarityFn = {\n COSINE: \"cosine\",\n JACCARD: \"jaccard\",\n HAMMING: \"hamming\",\n} as const;\n\nexport type SimilarityFn = (typeof SimilarityFn)[keyof typeof SimilarityFn];\n\nconst SimilarityInputSchema = {\n type: \"object\",\n properties: {\n query: TypedArraySchema({\n title: \"Query\",\n description: \"Query vector to compare against\",\n }),\n input: {\n type: \"array\",\n items: TypedArraySchema({\n title: \"Input\",\n description: \"Array of vectors to compare against the query\",\n }),\n },\n topK: {\n type: \"number\",\n title: \"Top K\",\n description: \"Number of top results to return\",\n minimum: 1,\n default: 10,\n },\n similarity: {\n type: \"string\",\n enum: Object.values(SimilarityFn),\n title: \"Similarity 𝑓\",\n description: \"Similarity function to use for comparisons\",\n default: SimilarityFn.COSINE,\n },\n },\n required: [\"query\", \"input\", \"similarity\"],\n additionalProperties: false,\n} as const satisfies DataPortSchema;\n\nconst SimilarityOutputSchema = {\n type: \"object\",\n properties: {\n output: {\n type: \"array\",\n items: TypedArraySchema({\n title: \"Output\",\n description: \"Ranked output vectors\",\n }),\n },\n score: {\n type: \"array\",\n items: {\n type: \"number\",\n title: \"Score\",\n description: \"Similarity scores for each output vector\",\n },\n },\n },\n required: [\"output\", \"score\"],\n additionalProperties: false,\n} as const satisfies DataPortSchema;\n\nexport type VectorSimilarityTaskInput = FromSchema<\n typeof SimilarityInputSchema,\n TypedArraySchemaOptions\n>;\nexport type VectorSimilarityTaskOutput = FromSchema<\n typeof SimilarityOutputSchema,\n TypedArraySchemaOptions\n>;\n\nexport class VectorSimilarityTask extends ArrayTask<\n VectorSimilarityTaskInput,\n VectorSimilarityTaskOutput,\n JobQueueTaskConfig\n> {\n static readonly type = \"VectorSimilarityTask\";\n static readonly category = \"Analysis\";\n static readonly title = \"Vector Similarity\";\n public static description =\n \"Compares vectors using similarity functions and returns top-K ranked results\";\n static readonly cacheable = true;\n\n public static override inputSchema(): DataPortSchema {\n return SimilarityInputSchema as DataPortSchema;\n }\n public static override outputSchema(): DataPortSchema {\n return SimilarityOutputSchema as DataPortSchema;\n }\n\n // @ts-ignore (TODO: fix this)\n async executeReactive(\n { query, input, similarity, topK }: VectorSimilarityTaskInput,\n oldOutput: VectorSimilarityTaskOutput\n ) {\n let similarities = [];\n const fns = { cosine };\n const fnName = similarity as keyof typeof fns;\n const fn = fns[fnName];\n\n for (const embedding of input) {\n similarities.push({\n similarity: fn(embedding, query),\n embedding,\n });\n }\n similarities = similarities.sort((a, b) => b.similarity - a.similarity).slice(0, topK);\n\n const outputs = similarities.map((s) => s.embedding);\n const scores = similarities.map((s) => s.similarity);\n return {\n output: outputs,\n score: scores,\n };\n }\n}\n\nTaskRegistry.registerTask(VectorSimilarityTask);\n\nexport const similarity = (input: VectorSimilarityTaskInput, config?: JobQueueTaskConfig) => {\n return new VectorSimilarityTask(input, config).run();\n};\n\ndeclare module \"@workglow/task-graph\" {\n interface Workflow {\n similarity: CreateWorkflow<\n VectorSimilarityTaskInput,\n VectorSimilarityTaskOutput,\n JobQueueTaskConfig\n >;\n }\n}\n\nWorkflow.prototype.similarity = CreateWorkflow(VectorSimilarityTask);\n\n// ===============================================================================\n\nexport function inner(arr1: TypedArray, arr2: TypedArray): number {\n // @ts-ignore\n return 1 - arr1.reduce((acc, val, i) => acc + val * arr2[i], 0);\n}\n\nexport function magnitude(arr: TypedArray) {\n // @ts-ignore\n return Math.sqrt(arr.reduce((acc, val) => acc + val * val, 0));\n}\n\nfunction cosine(arr1: TypedArray, arr2: TypedArray) {\n const dotProduct = inner(arr1, arr2);\n const magnitude1 = magnitude(arr1);\n const magnitude2 = magnitude(arr2);\n return 1 - dotProduct / (magnitude1 * magnitude2);\n}\n\nexport function normalize(vector: TypedArray): TypedArray {\n const mag = magnitude(vector);\n\n if (mag === 0) {\n throw new TaskError(\"Cannot normalize a zero vector.\");\n }\n\n const normalized = vector.map((val) => Number(val) / mag);\n\n if (vector instanceof Float64Array) {\n return new Float64Array(normalized);\n }\n if (vector instanceof Float32Array) {\n return new Float32Array(normalized);\n }\n // For integer arrays and bigint[], use Float32Array since normalization produces floats\n return new Float32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