@workglow/ai-provider 0.0.107 → 0.0.109

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (82) hide show
  1. package/README.md +1 -1
  2. package/dist/{HFT_JobRunFns-c40ex37f.js → HFT_JobRunFns-n802m09b.js} +5 -3
  3. package/dist/{HFT_JobRunFns-c40ex37f.js.map → HFT_JobRunFns-n802m09b.js.map} +1 -1
  4. package/dist/anthropic/AnthropicProvider.d.ts +3 -1
  5. package/dist/anthropic/AnthropicProvider.d.ts.map +1 -1
  6. package/dist/anthropic/common/Anthropic_JobRunFns.d.ts +2 -1
  7. package/dist/anthropic/common/Anthropic_JobRunFns.d.ts.map +1 -1
  8. package/dist/anthropic/index.js +16 -2
  9. package/dist/anthropic/index.js.map +3 -3
  10. package/dist/google-gemini/GoogleGeminiProvider.d.ts +3 -1
  11. package/dist/google-gemini/GoogleGeminiProvider.d.ts.map +1 -1
  12. package/dist/google-gemini/common/Gemini_JobRunFns.d.ts +2 -1
  13. package/dist/google-gemini/common/Gemini_JobRunFns.d.ts.map +1 -1
  14. package/dist/google-gemini/index.js +16 -2
  15. package/dist/google-gemini/index.js.map +3 -3
  16. package/dist/hf-transformers/HuggingFaceTransformersProvider.d.ts +5 -3
  17. package/dist/hf-transformers/HuggingFaceTransformersProvider.d.ts.map +1 -1
  18. package/dist/hf-transformers/common/HFT_JobRunFns.d.ts +80 -1
  19. package/dist/hf-transformers/common/HFT_JobRunFns.d.ts.map +1 -1
  20. package/dist/hf-transformers/index.js +9 -7
  21. package/dist/hf-transformers/index.js.map +2 -2
  22. package/dist/{index-5qjdc78z.js → index-60ev6k93.js} +4 -1
  23. package/dist/{index-5qjdc78z.js.map → index-60ev6k93.js.map} +3 -3
  24. package/dist/{index-5hjgs1z7.js → index-8651nz8y.js} +4 -1
  25. package/dist/{index-5hjgs1z7.js.map → index-8651nz8y.js.map} +3 -3
  26. package/dist/index-m0r2hvfz.js +57 -0
  27. package/dist/index-m0r2hvfz.js.map +10 -0
  28. package/dist/{index-drcnh4z5.js → index-q2t627d5.js} +4 -1
  29. package/dist/{index-drcnh4z5.js.map → index-q2t627d5.js.map} +3 -3
  30. package/dist/{index-14pbwsc9.js → index-tp5s7355.js} +4 -1
  31. package/dist/{index-14pbwsc9.js.map → index-tp5s7355.js.map} +3 -3
  32. package/dist/{index-aef54vq3.js → index-v72vr07f.js} +4 -1
  33. package/dist/{index-aef54vq3.js.map → index-v72vr07f.js.map} +3 -3
  34. package/dist/{index-xc6m9mcp.js → index-wr57rwyx.js} +4 -1
  35. package/dist/{index-xc6m9mcp.js.map → index-wr57rwyx.js.map} +3 -3
  36. package/dist/{index-4fr8p4gy.js → index-y0yn7yrm.js} +66 -18
  37. package/dist/index-y0yn7yrm.js.map +10 -0
  38. package/dist/{index-zqq3kw0n.js → index-zjd89edn.js} +58 -55
  39. package/dist/index-zjd89edn.js.map +11 -0
  40. package/dist/index.js +15 -12
  41. package/dist/index.js.map +3 -3
  42. package/dist/provider-hf-inference/HfInferenceProvider.d.ts +3 -1
  43. package/dist/provider-hf-inference/HfInferenceProvider.d.ts.map +1 -1
  44. package/dist/provider-hf-inference/common/HFI_JobRunFns.d.ts +2 -1
  45. package/dist/provider-hf-inference/common/HFI_JobRunFns.d.ts.map +1 -1
  46. package/dist/provider-hf-inference/index.js +17 -3
  47. package/dist/provider-hf-inference/index.js.map +3 -3
  48. package/dist/provider-llamacpp/LlamaCppProvider.d.ts +3 -1
  49. package/dist/provider-llamacpp/LlamaCppProvider.d.ts.map +1 -1
  50. package/dist/provider-llamacpp/common/LlamaCpp_JobRunFns.d.ts +2 -1
  51. package/dist/provider-llamacpp/common/LlamaCpp_JobRunFns.d.ts.map +1 -1
  52. package/dist/provider-llamacpp/index.js +32 -2
  53. package/dist/provider-llamacpp/index.js.map +3 -3
  54. package/dist/provider-ollama/OllamaProvider.d.ts +3 -1
  55. package/dist/provider-ollama/OllamaProvider.d.ts.map +1 -1
  56. package/dist/provider-ollama/common/Ollama_JobRunFns.browser.d.ts +2 -1
  57. package/dist/provider-ollama/common/Ollama_JobRunFns.browser.d.ts.map +1 -1
  58. package/dist/provider-ollama/common/Ollama_JobRunFns.d.ts +2 -1
  59. package/dist/provider-ollama/common/Ollama_JobRunFns.d.ts.map +1 -1
  60. package/dist/provider-ollama/index.browser.js +35 -1
  61. package/dist/provider-ollama/index.browser.js.map +4 -4
  62. package/dist/provider-ollama/index.js +33 -2
  63. package/dist/provider-ollama/index.js.map +3 -3
  64. package/dist/provider-openai/OpenAiProvider.d.ts +3 -1
  65. package/dist/provider-openai/OpenAiProvider.d.ts.map +1 -1
  66. package/dist/provider-openai/common/OpenAI_JobRunFns.d.ts +2 -1
  67. package/dist/provider-openai/common/OpenAI_JobRunFns.d.ts.map +1 -1
  68. package/dist/provider-openai/index.js +16 -2
  69. package/dist/provider-openai/index.js.map +3 -3
  70. package/dist/tf-mediapipe/TensorFlowMediaPipeProvider.d.ts +3 -1
  71. package/dist/tf-mediapipe/TensorFlowMediaPipeProvider.d.ts.map +1 -1
  72. package/dist/tf-mediapipe/common/TFMP_JobRunFns.d.ts +56 -1
  73. package/dist/tf-mediapipe/common/TFMP_JobRunFns.d.ts.map +1 -1
  74. package/dist/tf-mediapipe/index.js +20 -1
  75. package/dist/tf-mediapipe/index.js.map +4 -4
  76. package/package.json +18 -19
  77. package/dist/hf-transformers/common/HFT_CallbackStatus.d.ts +0 -36
  78. package/dist/hf-transformers/common/HFT_CallbackStatus.d.ts.map +0 -1
  79. package/dist/index-4fr8p4gy.js.map +0 -10
  80. package/dist/index-cejxxqcz.js +0 -55
  81. package/dist/index-cejxxqcz.js.map +0 -10
  82. package/dist/index-zqq3kw0n.js.map +0 -11
@@ -3,7 +3,7 @@
3
3
  * Copyright 2025 Steven Roussey <sroussey@gmail.com>
4
4
  * SPDX-License-Identifier: Apache-2.0
5
5
  */
6
- import type { AiProviderReactiveRunFn, AiProviderRunFn, AiProviderStreamFn, BackgroundRemovalTaskInput, BackgroundRemovalTaskOutput, CountTokensTaskInput, CountTokensTaskOutput, DownloadModelTaskRunInput, DownloadModelTaskRunOutput, ImageClassificationTaskInput, ImageClassificationTaskOutput, ImageEmbeddingTaskInput, ImageEmbeddingTaskOutput, ImageSegmentationTaskInput, ImageSegmentationTaskOutput, ImageToTextTaskInput, ImageToTextTaskOutput, ObjectDetectionTaskInput, ObjectDetectionTaskOutput, TextClassificationTaskInput, TextClassificationTaskOutput, TextEmbeddingTaskInput, TextEmbeddingTaskOutput, TextFillMaskTaskInput, TextFillMaskTaskOutput, TextGenerationTaskInput, TextGenerationTaskOutput, TextLanguageDetectionTaskInput, TextLanguageDetectionTaskOutput, TextNamedEntityRecognitionTaskInput, TextNamedEntityRecognitionTaskOutput, TextQuestionAnswerTaskInput, TextQuestionAnswerTaskOutput, TextRewriterTaskInput, TextRewriterTaskOutput, TextSummaryTaskInput, TextSummaryTaskOutput, TextTranslationTaskInput, TextTranslationTaskOutput, ToolCallingTaskInput, ToolCallingTaskOutput, UnloadModelTaskRunInput, UnloadModelTaskRunOutput } from "@workglow/ai";
6
+ import type { AiProviderReactiveRunFn, AiProviderRunFn, AiProviderStreamFn, BackgroundRemovalTaskInput, BackgroundRemovalTaskOutput, CountTokensTaskInput, CountTokensTaskOutput, DownloadModelTaskRunInput, DownloadModelTaskRunOutput, ImageClassificationTaskInput, ImageClassificationTaskOutput, ImageEmbeddingTaskInput, ImageEmbeddingTaskOutput, ImageSegmentationTaskInput, ImageSegmentationTaskOutput, ImageToTextTaskInput, ImageToTextTaskOutput, ObjectDetectionTaskInput, ObjectDetectionTaskOutput, TextClassificationTaskInput, TextClassificationTaskOutput, TextEmbeddingTaskInput, TextEmbeddingTaskOutput, TextFillMaskTaskInput, TextFillMaskTaskOutput, TextGenerationTaskInput, TextGenerationTaskOutput, TextLanguageDetectionTaskInput, TextLanguageDetectionTaskOutput, TextNamedEntityRecognitionTaskInput, TextNamedEntityRecognitionTaskOutput, TextQuestionAnswerTaskInput, TextQuestionAnswerTaskOutput, TextRewriterTaskInput, TextRewriterTaskOutput, TextSummaryTaskInput, TextSummaryTaskOutput, TextTranslationTaskInput, TextTranslationTaskOutput, ToolCallingTaskInput, ToolCallingTaskOutput, ModelInfoTaskInput, ModelInfoTaskOutput, UnloadModelTaskRunInput, UnloadModelTaskRunOutput } from "@workglow/ai";
7
7
  import { TypedArray } from "@workglow/util";
8
8
  import { HfTransformersOnnxModelConfig } from "./HFT_ModelSchema";
9
9
  /**
@@ -122,6 +122,7 @@ export declare function parseToolCallsFromText(responseText: string): {
122
122
  };
123
123
  export declare const HFT_ToolCalling: AiProviderRunFn<ToolCallingTaskInput, ToolCallingTaskOutput, HfTransformersOnnxModelConfig>;
124
124
  export declare const HFT_ToolCalling_Stream: AiProviderStreamFn<ToolCallingTaskInput, ToolCallingTaskOutput, HfTransformersOnnxModelConfig>;
125
+ export declare const HFT_ModelInfo: AiProviderRunFn<ModelInfoTaskInput, ModelInfoTaskOutput, HfTransformersOnnxModelConfig>;
125
126
  /**
126
127
  * All HuggingFace Transformers task run functions, keyed by task type name.
127
128
  * Pass this to `new HuggingFaceTransformersProvider(HFT_TASKS, HFT_STREAM_TASKS, HFT_REACTIVE_TASKS)` when the
@@ -270,6 +271,84 @@ export declare const HFT_TASKS: {
270
271
  model_path: string;
271
272
  };
272
273
  }>;
274
+ readonly ModelInfoTask: AiProviderRunFn<{
275
+ model: string | {
276
+ [x: string]: unknown;
277
+ title?: string | undefined;
278
+ description?: string | undefined;
279
+ model_id?: string | undefined;
280
+ tasks?: string[] | undefined;
281
+ metadata?: {
282
+ [x: string]: unknown;
283
+ } | undefined;
284
+ provider: string;
285
+ provider_config: {
286
+ [x: string]: unknown;
287
+ credential_key?: string | undefined;
288
+ };
289
+ };
290
+ }, {
291
+ model: string | {
292
+ [x: string]: unknown;
293
+ title?: string | undefined;
294
+ description?: string | undefined;
295
+ model_id?: string | undefined;
296
+ tasks?: string[] | undefined;
297
+ metadata?: {
298
+ [x: string]: unknown;
299
+ } | undefined;
300
+ provider: string;
301
+ provider_config: {
302
+ [x: string]: unknown;
303
+ credential_key?: string | undefined;
304
+ };
305
+ };
306
+ is_local: boolean;
307
+ is_remote: boolean;
308
+ supports_browser: boolean;
309
+ supports_node: boolean;
310
+ is_cached: boolean;
311
+ is_loaded: boolean;
312
+ file_sizes: unknown;
313
+ }, {
314
+ title?: string | undefined;
315
+ description?: string | undefined;
316
+ model_id?: string | undefined;
317
+ tasks?: string[] | undefined;
318
+ metadata?: {
319
+ [x: string]: unknown;
320
+ } | undefined;
321
+ provider: "HF_TRANSFORMERS_ONNX";
322
+ provider_config: {
323
+ normalize?: boolean | undefined;
324
+ dtype?: "auto" | "fp32" | "fp16" | "q8" | "int8" | "uint8" | "q4" | "bnb4" | "q4f16" | undefined;
325
+ device?: "cpu" | "gpu" | "webgpu" | "wasm" | "metal" | undefined;
326
+ execution_providers?: string[] | undefined;
327
+ intra_op_num_threads?: number | undefined;
328
+ inter_op_num_threads?: number | undefined;
329
+ use_external_data_format?: boolean | undefined;
330
+ pooling?: "mean" | "last_token" | "cls" | undefined;
331
+ language_style?: string | undefined;
332
+ mrl?: boolean | undefined;
333
+ pipeline: "feature-extraction";
334
+ model_path: string;
335
+ native_dimensions: number;
336
+ } | {
337
+ normalize?: boolean | undefined;
338
+ dtype?: "auto" | "fp32" | "fp16" | "q8" | "int8" | "uint8" | "q4" | "bnb4" | "q4f16" | undefined;
339
+ device?: "cpu" | "gpu" | "webgpu" | "wasm" | "metal" | undefined;
340
+ execution_providers?: string[] | undefined;
341
+ intra_op_num_threads?: number | undefined;
342
+ inter_op_num_threads?: number | undefined;
343
+ use_external_data_format?: boolean | undefined;
344
+ native_dimensions?: number | undefined;
345
+ pooling?: "mean" | "last_token" | "cls" | undefined;
346
+ language_style?: string | undefined;
347
+ mrl?: boolean | undefined;
348
+ pipeline: "fill-mask" | "token-classification" | "text-generation" | "text2text-generation" | "text-classification" | "summarization" | "translation" | "zero-shot-classification" | "question-answering" | "background-removal" | "image-segmentation" | "depth-estimation" | "image-classification" | "image-to-image" | "object-detection" | "image-feature-extraction" | "audio-classification" | "automatic-speech-recognition" | "text-to-speech" | "document-question-answering" | "image-to-text" | "zero-shot-audio-classification" | "zero-shot-image-classification" | "zero-shot-object-detection";
349
+ model_path: string;
350
+ };
351
+ }>;
273
352
  readonly CountTokensTask: AiProviderRunFn<{
274
353
  model: string | {
275
354
  [x: string]: unknown;
@@ -1 +1 @@
1
- {"version":3,"file":"HFT_JobRunFns.d.ts","sourceRoot":"","sources":["../../../src/hf-transformers/common/HFT_JobRunFns.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AA8BH,OAAO,KAAK,EACV,uBAAuB,EACvB,eAAe,EACf,kBAAkB,EAClB,0BAA0B,EAC1B,2BAA2B,EAC3B,oBAAoB,EACpB,qBAAqB,EACrB,yBAAyB,EACzB,0BAA0B,EAC1B,4BAA4B,EAC5B,6BAA6B,EAC7B,uBAAuB,EACvB,wBAAwB,EACxB,0BAA0B,EAC1B,2BAA2B,EAC3B,oBAAoB,EACpB,qBAAqB,EACrB,wBAAwB,EACxB,yBAAyB,EACzB,2BAA2B,EAC3B,4BAA4B,EAC5B,sBAAsB,EACtB,uBAAuB,EACvB,qBAAqB,EACrB,sBAAsB,EACtB,uBAAuB,EACvB,wBAAwB,EACxB,8BAA8B,EAC9B,+BAA+B,EAC/B,mCAAmC,EACnC,oCAAoC,EACpC,2BAA2B,EAC3B,4BAA4B,EAC5B,qBAAqB,EACrB,sBAAsB,EACtB,oBAAoB,EACpB,qBAAqB,EACrB,wBAAwB,EACxB,yBAAyB,EACzB,oBAAoB,EACpB,qBAAqB,EAErB,uBAAuB,EACvB,wBAAwB,EACzB,MAAM,cAAc,CAAC;AAmBtB,OAAO,EAAa,UAAU,EAAE,MAAM,gBAAgB,CAAC;AAGvD,OAAO,EAAE,6BAA6B,EAAE,MAAM,mBAAmB,CAAC;AA0BlE;;GAEG;AACH,wBAAgB,kBAAkB,IAAI,IAAI,CAEzC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5D,CAAC;AAEF,eAAO,MAAM,kBAAkB,EAAE,MAAM,CACrC,MAAM,EACN,uBAAuB,CAAC,GAAG,EAAE,GAAG,EAAE,6BAA6B,CAAC,CAGjE,CAAC"}
1
+ {"version":3,"file":"HFT_JobRunFns.d.ts","sourceRoot":"","sources":["../../../src/hf-transformers/common/HFT_JobRunFns.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAgCH,OAAO,KAAK,EACV,uBAAuB,EACvB,eAAe,EACf,kBAAkB,EAClB,0BAA0B,EAC1B,2BAA2B,EAC3B,oBAAoB,EACpB,qBAAqB,EACrB,yBAAyB,EACzB,0BAA0B,EAC1B,4BAA4B,EAC5B,6BAA6B,EAC7B,uBAAuB,EACvB,wBAAwB,EACxB,0BAA0B,EAC1B,2BAA2B,EAC3B,oBAAoB,EACpB,qBAAqB,EACrB,wBAAwB,EACxB,yBAAyB,EACzB,2BAA2B,EAC3B,4BAA4B,EAC5B,sBAAsB,EACtB,uBAAuB,EACvB,qBAAqB,EACrB,sBAAsB,EACtB,uBAAuB,EACvB,wBAAwB,EACxB,8BAA8B,EAC9B,+BAA+B,EAC/B,mCAAmC,EACnC,oCAAoC,EACpC,2BAA2B,EAC3B,4BAA4B,EAC5B,qBAAqB,EACrB,sBAAsB,EACtB,oBAAoB,EACpB,qBAAqB,EACrB,wBAAwB,EACxB,yBAAyB,EACzB,oBAAoB,EACpB,qBAAqB,EAErB,kBAAkB,EAClB,mBAAmB,EACnB,uBAAuB,EACvB,wBAAwB,EACzB,MAAM,cAAc,CAAC;AAmBtB,OAAO,EAAa,UAAU,EAAE,MAAM,gBAAgB,CAAC;AAEvD,OAAO,EAAE,6BAA6B,EAAE,MAAM,mBAAmB,CAAC;AA0BlE;;GAEG;AACH,wBAAgB,kBAAkB,IAAI,IAAI,CAEzC;AAkYD;;;GAGG;AACH,eAAO,MAAM,YAAY,EAAE,eAAe,CACxC,yBAAyB,EACzB,0BAA0B,EAC1B,6BAA6B,CAc9B,CAAC;AAEF;;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C,MAAM,EACN,kBAAkB,CAAC,GAAG,EAAE,GAAG,EAAE,6BAA6B,CAAC,CAQ5D,CAAC;AAEF,eAAO,MAAM,kBAAkB,EAAE,MAAM,CACrC,MAAM,EACN,uBAAuB,CAAC,GAAG,EAAE,GAAG,EAAE,6BAA6B,CAAC,CAGjE,CAAC"}
@@ -7,6 +7,7 @@ import {
7
7
  HFT_ImageEmbedding,
8
8
  HFT_ImageSegmentation,
9
9
  HFT_ImageToText,
10
+ HFT_ModelInfo,
10
11
  HFT_ObjectDetection,
11
12
  HFT_REACTIVE_TASKS,
12
13
  HFT_STREAM_TASKS,
@@ -32,23 +33,23 @@ import {
32
33
  clearPipelineCache,
33
34
  createToolCallMarkupFilter,
34
35
  parseToolCallsFromText
35
- } from "../index-4fr8p4gy.js";
36
+ } from "../index-y0yn7yrm.js";
36
37
  import {
38
+ HfTransformersOnnxModelConfigSchema,
39
+ HfTransformersOnnxModelRecordSchema,
40
+ HfTransformersOnnxModelSchema,
37
41
  HuggingFaceTransformersProvider
38
- } from "../index-cejxxqcz.js";
42
+ } from "../index-zjd89edn.js";
39
43
  import {
40
44
  AudioPipelineUseCase,
41
45
  HF_TRANSFORMERS_ONNX,
42
46
  HTF_CACHE_NAME,
43
- HfTransformersOnnxModelConfigSchema,
44
- HfTransformersOnnxModelRecordSchema,
45
- HfTransformersOnnxModelSchema,
46
47
  MultimodalPipelineUseCase,
47
48
  PipelineUseCase,
48
49
  QuantizationDataType,
49
50
  TextPipelineUseCase,
50
51
  VisionPipelineUseCase
51
- } from "../index-zqq3kw0n.js";
52
+ } from "../index-m0r2hvfz.js";
52
53
  import"../index-6j5pq722.js";
53
54
  // src/hf-transformers/HFT_Worker.ts
54
55
  import { getLogger, globalServiceRegistry, WORKER_SERVER } from "@workglow/util";
@@ -96,6 +97,7 @@ export {
96
97
  HFT_STREAM_TASKS,
97
98
  HFT_REACTIVE_TASKS,
98
99
  HFT_ObjectDetection,
100
+ HFT_ModelInfo,
99
101
  HFT_ImageToText,
100
102
  HFT_ImageSegmentation,
101
103
  HFT_ImageEmbedding,
@@ -107,4 +109,4 @@ export {
107
109
  AudioPipelineUseCase
108
110
  };
109
111
 
110
- //# debugId=58657301F35DE2C764756E2164756E21
112
+ //# debugId=F4A47A1E4C74B85964756E2164756E21
@@ -4,7 +4,7 @@
4
4
  "sourcesContent": [
5
5
  "/**\n * @license\n * Copyright 2025 Steven Roussey <sroussey@gmail.com>\n * SPDX-License-Identifier: Apache-2.0\n */\n\nimport { getLogger, globalServiceRegistry, WORKER_SERVER } from \"@workglow/util\";\nimport { HFT_REACTIVE_TASKS, HFT_STREAM_TASKS, HFT_TASKS } from \"./common/HFT_JobRunFns\";\nimport { HuggingFaceTransformersProvider } from \"./HuggingFaceTransformersProvider\";\n\nexport function HFT_WORKER_JOBRUN_REGISTER() {\n const workerServer = globalServiceRegistry.get(WORKER_SERVER);\n new HuggingFaceTransformersProvider(\n HFT_TASKS,\n HFT_STREAM_TASKS,\n HFT_REACTIVE_TASKS\n ).registerOnWorkerServer(workerServer);\n workerServer.sendReady();\n getLogger().info(\"HFT_WORKER_JOBRUN registered\");\n}\n"
6
6
  ],
7
- "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAMA;AAIO,SAAS,0BAA0B,GAAG;AAAA,EAC3C,MAAM,eAAe,sBAAsB,IAAI,aAAa;AAAA,EAC5D,IAAI,gCACF,WACA,kBACA,kBACF,EAAE,uBAAuB,YAAY;AAAA,EACrC,aAAa,UAAU;AAAA,EACvB,UAAU,EAAE,KAAK,8BAA8B;AAAA;",
8
- "debugId": "58657301F35DE2C764756E2164756E21",
7
+ "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAMA;AAIO,SAAS,0BAA0B,GAAG;AAAA,EAC3C,MAAM,eAAe,sBAAsB,IAAI,aAAa;AAAA,EAC5D,IAAI,gCACF,WACA,kBACA,kBACF,EAAE,uBAAuB,YAAY;AAAA,EACrC,aAAa,UAAU;AAAA,EACvB,UAAU,EAAE,KAAK,8BAA8B;AAAA;",
8
+ "debugId": "F4A47A1E4C74B85964756E2164756E21",
9
9
  "names": []
10
10
  }
@@ -67,8 +67,11 @@ import {
67
67
  } from "@workglow/ai";
68
68
  class AnthropicProvider extends AiProvider {
69
69
  name = ANTHROPIC;
70
+ isLocal = false;
71
+ supportsBrowser = true;
70
72
  taskTypes = [
71
73
  "CountTokensTask",
74
+ "ModelInfoTask",
72
75
  "TextGenerationTask",
73
76
  "TextRewriterTask",
74
77
  "TextSummaryTask",
@@ -82,4 +85,4 @@ class AnthropicProvider extends AiProvider {
82
85
 
83
86
  export { ANTHROPIC, AnthropicModelSchema, AnthropicModelRecordSchema, AnthropicModelConfigSchema, AnthropicProvider };
84
87
 
85
- //# debugId=D055A8C24598025D64756E2164756E21
88
+ //# debugId=EE098295D2CDEBD564756E2164756E21
@@ -4,9 +4,9 @@
4
4
  "sourcesContent": [
5
5
  "/**\n * @license\n * Copyright 2025 Steven Roussey <sroussey@gmail.com>\n * SPDX-License-Identifier: Apache-2.0\n */\n\nexport const ANTHROPIC = \"ANTHROPIC\";\n",
6
6
  "/**\n * @license\n * Copyright 2025 Steven Roussey <sroussey@gmail.com>\n * SPDX-License-Identifier: Apache-2.0\n */\n\nimport { ModelConfigSchema, ModelRecordSchema } from \"@workglow/ai\";\nimport { DataPortSchemaObject, FromSchema } from \"@workglow/util\";\nimport { ANTHROPIC } from \"./Anthropic_Constants\";\n\nexport const AnthropicModelSchema = {\n type: \"object\",\n properties: {\n provider: {\n const: ANTHROPIC,\n description: \"Discriminator: Anthropic cloud provider.\",\n },\n provider_config: {\n type: \"object\",\n description: \"Anthropic-specific configuration.\",\n properties: {\n model_name: {\n type: \"string\",\n description:\n \"The Anthropic model identifier (e.g., 'claude-sonnet-4-20250514', 'claude-3-5-haiku-20241022').\",\n },\n credential_key: {\n type: \"string\",\n format: \"credential\",\n description: \"Key to look up in the credential store for the API key.\",\n \"x-ui-hidden\": true,\n },\n base_url: {\n type: \"string\",\n description: \"Base URL for the Anthropic API (optional).\",\n },\n max_tokens: {\n type: \"integer\",\n description: \"Default max tokens for responses. Anthropic requires this parameter.\",\n default: 1024,\n minimum: 1,\n },\n },\n required: [\"model_name\"],\n additionalProperties: false,\n },\n },\n required: [\"provider\", \"provider_config\"],\n additionalProperties: true,\n} as const satisfies DataPortSchemaObject;\n\nexport const AnthropicModelRecordSchema = {\n type: \"object\",\n properties: {\n ...ModelRecordSchema.properties,\n ...AnthropicModelSchema.properties,\n },\n required: [...ModelRecordSchema.required, ...AnthropicModelSchema.required],\n additionalProperties: false,\n} as const satisfies DataPortSchemaObject;\n\nexport type AnthropicModelRecord = FromSchema<typeof AnthropicModelRecordSchema>;\n\nexport const AnthropicModelConfigSchema = {\n type: \"object\",\n properties: {\n ...ModelConfigSchema.properties,\n ...AnthropicModelSchema.properties,\n },\n required: [...ModelConfigSchema.required, ...AnthropicModelSchema.required],\n additionalProperties: false,\n} as const satisfies DataPortSchemaObject;\n\nexport type AnthropicModelConfig = FromSchema<typeof AnthropicModelConfigSchema>;\n",
7
- "/**\n * @license\n * Copyright 2025 Steven Roussey <sroussey@gmail.com>\n * SPDX-License-Identifier: Apache-2.0\n */\n\nimport {\n AiProvider,\n type AiProviderReactiveRunFn,\n type AiProviderRunFn,\n type AiProviderStreamFn,\n} from \"@workglow/ai\";\nimport { ANTHROPIC } from \"./common/Anthropic_Constants\";\nimport type { AnthropicModelConfig } from \"./common/Anthropic_ModelSchema\";\n\n/**\n * AI provider for Anthropic cloud models.\n *\n * Supports text generation, text rewriting, and text summarization via the\n * Anthropic Messages API using the `@anthropic-ai/sdk` SDK.\n *\n * Note: Anthropic does not offer an embeddings API, so TextEmbeddingTask\n * is not supported by this provider.\n *\n * Task run functions are injected via the constructor so that the SDK\n * is only imported where actually needed (inline mode, worker server), not on\n * the main thread in worker mode.\n *\n * @example\n * ```typescript\n * // Worker mode (main thread) -- lightweight, no SDK import:\n * await new AnthropicProvider().register({\n * mode: \"worker\",\n * worker: new Worker(new URL(\"./worker_anthropic.ts\", import.meta.url), { type: \"module\" }),\n * });\n *\n * // Inline mode -- caller provides the tasks:\n * import { ANTHROPIC_TASKS } from \"@workglow/ai-provider/anthropic\";\n * await new AnthropicProvider(ANTHROPIC_TASKS, ANTHROPIC_STREAM_TASKS, ANTHROPIC_REACTIVE_TASKS).register({ mode: \"inline\" });\n * ```\n */\nexport class AnthropicProvider extends AiProvider<AnthropicModelConfig> {\n readonly name = ANTHROPIC;\n\n readonly taskTypes = [\n \"CountTokensTask\",\n \"TextGenerationTask\",\n \"TextRewriterTask\",\n \"TextSummaryTask\",\n \"StructuredGenerationTask\",\n \"ToolCallingTask\",\n ] as const;\n\n constructor(\n tasks?: Record<string, AiProviderRunFn<any, any, AnthropicModelConfig>>,\n streamTasks?: Record<string, AiProviderStreamFn<any, any, AnthropicModelConfig>>,\n reactiveTasks?: Record<string, AiProviderReactiveRunFn<any, any, AnthropicModelConfig>>\n ) {\n super(tasks, streamTasks, reactiveTasks);\n }\n}\n"
7
+ "/**\n * @license\n * Copyright 2025 Steven Roussey <sroussey@gmail.com>\n * SPDX-License-Identifier: Apache-2.0\n */\n\nimport {\n AiProvider,\n type AiProviderReactiveRunFn,\n type AiProviderRunFn,\n type AiProviderStreamFn,\n} from \"@workglow/ai\";\nimport { ANTHROPIC } from \"./common/Anthropic_Constants\";\nimport type { AnthropicModelConfig } from \"./common/Anthropic_ModelSchema\";\n\n/**\n * AI provider for Anthropic cloud models.\n *\n * Supports text generation, text rewriting, and text summarization via the\n * Anthropic Messages API using the `@anthropic-ai/sdk` SDK.\n *\n * Note: Anthropic does not offer an embeddings API, so TextEmbeddingTask\n * is not supported by this provider.\n *\n * Task run functions are injected via the constructor so that the SDK\n * is only imported where actually needed (inline mode, worker server), not on\n * the main thread in worker mode.\n *\n * @example\n * ```typescript\n * // Worker mode (main thread) -- lightweight, no SDK import:\n * await new AnthropicProvider().register({\n * mode: \"worker\",\n * worker: new Worker(new URL(\"./worker_anthropic.ts\", import.meta.url), { type: \"module\" }),\n * });\n *\n * // Inline mode -- caller provides the tasks:\n * import { ANTHROPIC_TASKS } from \"@workglow/ai-provider/anthropic\";\n * await new AnthropicProvider(ANTHROPIC_TASKS, ANTHROPIC_STREAM_TASKS, ANTHROPIC_REACTIVE_TASKS).register({ mode: \"inline\" });\n * ```\n */\nexport class AnthropicProvider extends AiProvider<AnthropicModelConfig> {\n readonly name = ANTHROPIC;\n readonly isLocal = false;\n readonly supportsBrowser = true;\n\n readonly taskTypes = [\n \"CountTokensTask\",\n \"ModelInfoTask\",\n \"TextGenerationTask\",\n \"TextRewriterTask\",\n \"TextSummaryTask\",\n \"StructuredGenerationTask\",\n \"ToolCallingTask\",\n ] as const;\n\n constructor(\n tasks?: Record<string, AiProviderRunFn<any, any, AnthropicModelConfig>>,\n streamTasks?: Record<string, AiProviderStreamFn<any, any, AnthropicModelConfig>>,\n reactiveTasks?: Record<string, AiProviderReactiveRunFn<any, any, AnthropicModelConfig>>\n ) {\n super(tasks, streamTasks, reactiveTasks);\n }\n}\n"
8
8
  ],
9
- "mappings": ";AAMO,IAAM,YAAY;;;ACAzB;AAIO,IAAM,uBAAuB;AAAA,EAClC,MAAM;AAAA,EACN,YAAY;AAAA,IACV,UAAU;AAAA,MACR,OAAO;AAAA,MACP,aAAa;AAAA,IACf;AAAA,IACA,iBAAiB;AAAA,MACf,MAAM;AAAA,MACN,aAAa;AAAA,MACb,YAAY;AAAA,QACV,YAAY;AAAA,UACV,MAAM;AAAA,UACN,aACE;AAAA,QACJ;AAAA,QACA,gBAAgB;AAAA,UACd,MAAM;AAAA,UACN,QAAQ;AAAA,UACR,aAAa;AAAA,UACb,eAAe;AAAA,QACjB;AAAA,QACA,UAAU;AAAA,UACR,MAAM;AAAA,UACN,aAAa;AAAA,QACf;AAAA,QACA,YAAY;AAAA,UACV,MAAM;AAAA,UACN,aAAa;AAAA,UACb,SAAS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b,eAAe;AAAA,QACjB;AAAA,QACA,UAAU;AAAA,UACR,MAAM;AAAA,UACN,aAAa;AAAA,QACf;AAAA,QACA,YAAY;AAAA,UACV,MAAM;AAAA,UACN,aAAa;AAAA,UACb,SAAS;AAAA,UACT,SAAS;AAAA,QACX;AAAA,MACF;AAAA,MACA,UAAU,CAAC,YAAY;AAAA,MACvB,sBAAsB;AAAA,IACxB;AAAA,EACF;AAAA,EACA,UAAU,CAAC,YAAY,iBAAiB;AAAA,EACxC,sBAAsB;AACxB;AAEO,IAAM,6BAA6B;AAAA,EACxC,MAAM;AAAA,EACN,YAAY;AAAA,OACP,kBAAkB;AAAA,OAClB,qBAAqB;AAAA,EAC1B;AAAA,EACA,UAAU,CAAC,GAAG,kBAAkB,UAAU,GAAG,qBAAqB,QAAQ;AAAA,EAC1E,sBAAsB;AACxB;AAIO,IAAM,6BAA6B;AAAA,EACxC,MAAM;AAAA,EACN,YAAY;AAAA,OACP,kBAAkB;AAAA,OAClB,qBAAqB;AAAA,EAC1B;AAAA,EACA,UAAU,CAAC,GAAG,kBAAkB,UAAU,GAAG,qBAAqB,QAAQ;AAAA,EAC1E,sBAAsB;AACxB;;;ACjEA;AAAA;AAAA;AAmCO,MAAM,0BAA0B,WAAiC;AAAA,EAC7D,OAAO;AAAA,EACP,UAAU;AAAA,EACV,kBAAkB;AAAA,EAElB,YAAY;AAAA,IACnB;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,EACF;AAAA,EAEA,WAAW,CACT,OACA,aACA,eACA;AAAA,IACA,MAAM,OAAO,aAAa,aAAa;AAAA;AAE3C;",
10
+ "debugId": "EE098295D2CDEBD564756E2164756E21",
11
11
  "names": []
12
12
  }
@@ -74,8 +74,11 @@ import {
74
74
  } from "@workglow/ai";
75
75
  class GoogleGeminiProvider extends AiProvider {
76
76
  name = GOOGLE_GEMINI;
77
+ isLocal = false;
78
+ supportsBrowser = true;
77
79
  taskTypes = [
78
80
  "CountTokensTask",
81
+ "ModelInfoTask",
79
82
  "TextGenerationTask",
80
83
  "TextEmbeddingTask",
81
84
  "TextRewriterTask",
@@ -90,4 +93,4 @@ class GoogleGeminiProvider extends AiProvider {
90
93
 
91
94
  export { GOOGLE_GEMINI, GeminiModelSchema, GeminiModelRecordSchema, GeminiModelConfigSchema, GoogleGeminiProvider };
92
95
 
93
- //# debugId=B2238B00454B90FB64756E2164756E21
96
+ //# debugId=B1E4CAA560CE1F7064756E2164756E21
@@ -4,9 +4,9 @@
4
4
  "sourcesContent": [
5
5
  "/**\n * @license\n * Copyright 2025 Steven Roussey <sroussey@gmail.com>\n * SPDX-License-Identifier: Apache-2.0\n */\n\nexport const GOOGLE_GEMINI = \"GOOGLE_GEMINI\";\n",
6
6
  "/**\n * @license\n * Copyright 2025 Steven Roussey <sroussey@gmail.com>\n * SPDX-License-Identifier: Apache-2.0\n */\n\nimport { ModelConfigSchema, ModelRecordSchema } from \"@workglow/ai\";\nimport { DataPortSchemaObject, FromSchema } from \"@workglow/util\";\nimport { GOOGLE_GEMINI } from \"./Gemini_Constants\";\n\nexport const GeminiModelSchema = {\n type: \"object\",\n properties: {\n provider: {\n const: GOOGLE_GEMINI,\n description: \"Discriminator: Google Gemini cloud provider.\",\n },\n provider_config: {\n type: \"object\",\n description: \"Google Gemini-specific configuration.\",\n properties: {\n model_name: {\n type: \"string\",\n description:\n \"The Gemini model identifier (e.g., 'gemini-2.0-flash', 'text-embedding-004').\",\n },\n credential_key: {\n type: \"string\",\n format: \"credential\",\n description: \"Key to look up in the credential store for the API key.\",\n \"x-ui-hidden\": true,\n },\n embedding_task_type: {\n oneOf: [\n { type: \"null\" },\n {\n type: \"string\",\n enum: [\n \"RETRIEVAL_QUERY\",\n \"RETRIEVAL_DOCUMENT\",\n \"SEMANTIC_SIMILARITY\",\n \"CLASSIFICATION\",\n \"CLUSTERING\",\n ],\n },\n ],\n description: \"Task type hint for embedding models.\",\n default: null,\n },\n },\n required: [\"model_name\"],\n additionalProperties: false,\n },\n },\n required: [\"provider\", \"provider_config\"],\n additionalProperties: true,\n} as const satisfies DataPortSchemaObject;\n\nexport const GeminiModelRecordSchema = {\n type: \"object\",\n properties: {\n ...ModelRecordSchema.properties,\n ...GeminiModelSchema.properties,\n },\n required: [...ModelRecordSchema.required, ...GeminiModelSchema.required],\n additionalProperties: false,\n} as const satisfies DataPortSchemaObject;\n\nexport type GeminiModelRecord = FromSchema<typeof GeminiModelRecordSchema>;\n\nexport const GeminiModelConfigSchema = {\n type: \"object\",\n properties: {\n ...ModelConfigSchema.properties,\n ...GeminiModelSchema.properties,\n },\n required: [...ModelConfigSchema.required, ...GeminiModelSchema.required],\n additionalProperties: false,\n} as const satisfies DataPortSchemaObject;\n\nexport type GeminiModelConfig = FromSchema<typeof GeminiModelConfigSchema>;\n",
7
- "/**\n * @license\n * Copyright 2025 Steven Roussey <sroussey@gmail.com>\n * SPDX-License-Identifier: Apache-2.0\n */\n\nimport {\n AiProvider,\n type AiProviderReactiveRunFn,\n type AiProviderRunFn,\n type AiProviderStreamFn,\n} from \"@workglow/ai\";\nimport { GOOGLE_GEMINI } from \"./common/Gemini_Constants\";\nimport type { GeminiModelConfig } from \"./common/Gemini_ModelSchema\";\n\n/**\n * AI provider for Google Gemini cloud models.\n *\n * Supports text generation, text embedding, text rewriting, and text summarization\n * via the Google Generative AI API using the `@google/generative-ai` SDK.\n *\n * Task run functions are injected via the constructor so that the SDK\n * is only imported where actually needed (inline mode, worker server), not on\n * the main thread in worker mode.\n *\n * @example\n * ```typescript\n * // Worker mode (main thread) -- lightweight, no SDK import:\n * await new GoogleGeminiProvider().register({\n * mode: \"worker\",\n * worker: new Worker(new URL(\"./worker_gemini.ts\", import.meta.url), { type: \"module\" }),\n * });\n *\n * // Inline mode -- caller provides the tasks:\n * import { GEMINI_TASKS } from \"@workglow/ai-provider/google-gemini\";\n * await new GoogleGeminiProvider(GEMINI_TASKS).register({ mode: \"inline\" });\n * ```\n */\nexport class GoogleGeminiProvider extends AiProvider<GeminiModelConfig> {\n readonly name = GOOGLE_GEMINI;\n\n readonly taskTypes = [\n \"CountTokensTask\",\n \"TextGenerationTask\",\n \"TextEmbeddingTask\",\n \"TextRewriterTask\",\n \"TextSummaryTask\",\n \"StructuredGenerationTask\",\n \"ToolCallingTask\",\n ] as const;\n\n constructor(\n tasks?: Record<string, AiProviderRunFn<any, any, GeminiModelConfig>>,\n streamTasks?: Record<string, AiProviderStreamFn<any, any, GeminiModelConfig>>,\n reactiveTasks?: Record<string, AiProviderReactiveRunFn<any, any, GeminiModelConfig>>\n ) {\n super(tasks, streamTasks, reactiveTasks);\n }\n}\n"
7
+ "/**\n * @license\n * Copyright 2025 Steven Roussey <sroussey@gmail.com>\n * SPDX-License-Identifier: Apache-2.0\n */\n\nimport {\n AiProvider,\n type AiProviderReactiveRunFn,\n type AiProviderRunFn,\n type AiProviderStreamFn,\n} from \"@workglow/ai\";\nimport { GOOGLE_GEMINI } from \"./common/Gemini_Constants\";\nimport type { GeminiModelConfig } from \"./common/Gemini_ModelSchema\";\n\n/**\n * AI provider for Google Gemini cloud models.\n *\n * Supports text generation, text embedding, text rewriting, and text summarization\n * via the Google Generative AI API using the `@google/generative-ai` SDK.\n *\n * Task run functions are injected via the constructor so that the SDK\n * is only imported where actually needed (inline mode, worker server), not on\n * the main thread in worker mode.\n *\n * @example\n * ```typescript\n * // Worker mode (main thread) -- lightweight, no SDK import:\n * await new GoogleGeminiProvider().register({\n * mode: \"worker\",\n * worker: new Worker(new URL(\"./worker_gemini.ts\", import.meta.url), { type: \"module\" }),\n * });\n *\n * // Inline mode -- caller provides the tasks:\n * import { GEMINI_TASKS } from \"@workglow/ai-provider/google-gemini\";\n * await new GoogleGeminiProvider(GEMINI_TASKS).register({ mode: \"inline\" });\n * ```\n */\nexport class GoogleGeminiProvider extends AiProvider<GeminiModelConfig> {\n readonly name = GOOGLE_GEMINI;\n readonly isLocal = false;\n readonly supportsBrowser = true;\n\n readonly taskTypes = [\n \"CountTokensTask\",\n \"ModelInfoTask\",\n \"TextGenerationTask\",\n \"TextEmbeddingTask\",\n \"TextRewriterTask\",\n \"TextSummaryTask\",\n \"StructuredGenerationTask\",\n \"ToolCallingTask\",\n ] as const;\n\n constructor(\n tasks?: Record<string, AiProviderRunFn<any, any, GeminiModelConfig>>,\n streamTasks?: Record<string, AiProviderStreamFn<any, any, GeminiModelConfig>>,\n reactiveTasks?: Record<string, AiProviderReactiveRunFn<any, any, GeminiModelConfig>>\n ) {\n super(tasks, streamTasks, reactiveTasks);\n }\n}\n"
8
8
  ],
9
- "mappings": ";AAMO,IAAM,gBAAgB;;;ACA7B;AAIO,IAAM,oBAAoB;AAAA,EAC/B,MAAM;AAAA,EACN,YAAY;AAAA,IACV,UAAU;AAAA,MACR,OAAO;AAAA,MACP,aAAa;AAAA,IACf;AAAA,IACA,iBAAiB;AAAA,MACf,MAAM;AAAA,MACN,aAAa;AAAA,MACb,YAAY;AAAA,QACV,YAAY;AAAA,UACV,MAAM;AAAA,UACN,aACE;AAAA,QACJ;AAAA,QACA,gBAAgB;AAAA,UACd,MAAM;AAAA,UACN,QAAQ;AAAA,UACR,aAAa;AAAA,UACb,eAAe;AAAA,QACjB;AAAA,QACA,qBAAqB;AAAA,UACnB,OAAO;AAAA,YACL,EAAE,MAAM,OAAO;AAAA,YACf;AAAA,cACE,MAAM;AAAA,cACN,MAAM;AAAA,gBACJ;AAAA,gBACA;AAAA,gBACA;AAAA,gBACA;AAAA,gBACA;AAAA,cACF;AAAA,YACF;AAAA,UACF;AAAA,UACA,aAAa;AAAA,UACb,SAAS;AAAA,QACX;AAAA,MACF;AAAA,MACA,UAAU,CAAC,YAAY;AAAA,MACvB,sBAAsB;AAAA,IACxB;AAAA,EACF;AAAA,EACA,UAAU,CAAC,YAAY,iBAAiB;AAAA,EACxC,sBAAsB;AACxB;AAEO,IAAM,0BAA0B;AAAA,EACrC,MAAM;AAAA,EACN,YAAY;AAAA,OACP,kBAAkB;AAAA,OAClB,kBAAk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;AAAA,QACX;AAAA,MACF;AAAA,MACA,UAAU,CAAC,YAAY;AAAA,MACvB,sBAAsB;AAAA,IACxB;AAAA,EACF;AAAA,EACA,UAAU,CAAC,YAAY,iBAAiB;AAAA,EACxC,sBAAsB;AACxB;AAEO,IAAM,0BAA0B;AAAA,EACrC,MAAM;AAAA,EACN,YAAY;AAAA,OACP,kBAAkB;AAAA,OAClB,kBAAkB;AAAA,EACvB;AAAA,EACA,UAAU,CAAC,GAAG,kBAAkB,UAAU,GAAG,kBAAkB,QAAQ;AAAA,EACvE,sBAAsB;AACxB;AAIO,IAAM,0BAA0B;AAAA,EACrC,MAAM;AAAA,EACN,YAAY;AAAA,OACP,kBAAkB;AAAA,OAClB,kBAAkB;AAAA,EACvB;AAAA,EACA,UAAU,CAAC,GAAG,kBAAkB,UAAU,GAAG,kBAAkB,QAAQ;AAAA,EACvE,sBAAsB;AACxB;;;ACxEA;AAAA;AAAA;AAgCO,MAAM,6BAA6B,WAA8B;AAAA,EAC7D,OAAO;AAAA,EACP,UAAU;AAAA,EACV,kBAAkB;AAAA,EAElB,YAAY;AAAA,IACnB;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,EACF;AAAA,EAEA,WAAW,CACT,OACA,aACA,eACA;AAAA,IACA,MAAM,OAAO,aAAa,aAAa;AAAA;AAE3C;",
10
+ "debugId": "B1E4CAA560CE1F7064756E2164756E21",
11
11
  "names": []
12
12
  }
@@ -0,0 +1,57 @@
1
+ // src/hf-transformers/common/HFT_Constants.ts
2
+ var HF_TRANSFORMERS_ONNX = "HF_TRANSFORMERS_ONNX";
3
+ var HTF_CACHE_NAME = "transformers-cache";
4
+ var QuantizationDataType = {
5
+ auto: "auto",
6
+ fp32: "fp32",
7
+ fp16: "fp16",
8
+ q8: "q8",
9
+ int8: "int8",
10
+ uint8: "uint8",
11
+ q4: "q4",
12
+ bnb4: "bnb4",
13
+ q4f16: "q4f16"
14
+ };
15
+ var TextPipelineUseCase = {
16
+ "fill-mask": "fill-mask",
17
+ "token-classification": "token-classification",
18
+ "text-generation": "text-generation",
19
+ "text2text-generation": "text2text-generation",
20
+ "text-classification": "text-classification",
21
+ summarization: "summarization",
22
+ translation: "translation",
23
+ "feature-extraction": "feature-extraction",
24
+ "zero-shot-classification": "zero-shot-classification",
25
+ "question-answering": "question-answering"
26
+ };
27
+ var VisionPipelineUseCase = {
28
+ "background-removal": "background-removal",
29
+ "image-segmentation": "image-segmentation",
30
+ "depth-estimation": "depth-estimation",
31
+ "image-classification": "image-classification",
32
+ "image-to-image": "image-to-image",
33
+ "object-detection": "object-detection",
34
+ "image-feature-extraction": "image-feature-extraction"
35
+ };
36
+ var AudioPipelineUseCase = {
37
+ "audio-classification": "audio-classification",
38
+ "automatic-speech-recognition": "automatic-speech-recognition",
39
+ "text-to-speech": "text-to-speech"
40
+ };
41
+ var MultimodalPipelineUseCase = {
42
+ "document-question-answering": "document-question-answering",
43
+ "image-to-text": "image-to-text",
44
+ "zero-shot-audio-classification": "zero-shot-audio-classification",
45
+ "zero-shot-image-classification": "zero-shot-image-classification",
46
+ "zero-shot-object-detection": "zero-shot-object-detection"
47
+ };
48
+ var PipelineUseCase = {
49
+ ...TextPipelineUseCase,
50
+ ...VisionPipelineUseCase,
51
+ ...AudioPipelineUseCase,
52
+ ...MultimodalPipelineUseCase
53
+ };
54
+
55
+ export { HF_TRANSFORMERS_ONNX, HTF_CACHE_NAME, QuantizationDataType, TextPipelineUseCase, VisionPipelineUseCase, AudioPipelineUseCase, MultimodalPipelineUseCase, PipelineUseCase };
56
+
57
+ //# debugId=297B2C0A21F958E264756E2164756E21
@@ -0,0 +1,10 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../src/hf-transformers/common/HFT_Constants.ts"],
4
+ "sourcesContent": [
5
+ "/**\n * @license\n * Copyright 2025 Steven Roussey <sroussey@gmail.com>\n * SPDX-License-Identifier: Apache-2.0\n */\n\nexport const HF_TRANSFORMERS_ONNX = \"HF_TRANSFORMERS_ONNX\";\nexport const HTF_CACHE_NAME = \"transformers-cache\";\n\nexport type QuantizationDataType =\n | \"auto\" // Auto-detect based on environment\n | \"fp32\"\n | \"fp16\"\n | \"q8\"\n | \"int8\"\n | \"uint8\"\n | \"q4\"\n | \"bnb4\"\n | \"q4f16\"; // fp16 model with int4 block weight quantization\n\nexport const QuantizationDataType = {\n auto: \"auto\",\n fp32: \"fp32\",\n fp16: \"fp16\",\n q8: \"q8\",\n int8: \"int8\",\n uint8: \"uint8\",\n q4: \"q4\",\n bnb4: \"bnb4\",\n q4f16: \"q4f16\",\n} as const satisfies Record<QuantizationDataType, QuantizationDataType>;\n\nexport type TextPipelineUseCase =\n | \"fill-mask\" // https://huggingface.co/tasks/fill-mask\n | \"token-classification\" // https://huggingface.co/tasks/token-classification\n | \"text-generation\" // https://huggingface.co/tasks/text-generation#completion-generation-models\n | \"text2text-generation\" // https://huggingface.co/tasks/text-generation#text-to-text-generation-models\n | \"text-classification\" // https://huggingface.co/tasks/text-classification\n | \"summarization\" // https://huggingface.co/tasks/sentence-similarity\n | \"translation\" // https://huggingface.co/tasks/translation\n | \"feature-extraction\" // https://huggingface.co/tasks/feature-extraction\n | \"zero-shot-classification\" // https://huggingface.co/tasks/zero-shot-classification\n | \"question-answering\"; // https://huggingface.co/tasks/question-answering\n\nexport const TextPipelineUseCase = {\n \"fill-mask\": \"fill-mask\",\n \"token-classification\": \"token-classification\",\n \"text-generation\": \"text-generation\",\n \"text2text-generation\": \"text2text-generation\",\n \"text-classification\": \"text-classification\",\n summarization: \"summarization\",\n translation: \"translation\",\n \"feature-extraction\": \"feature-extraction\",\n \"zero-shot-classification\": \"zero-shot-classification\",\n \"question-answering\": \"question-answering\",\n} as const satisfies Record<TextPipelineUseCase, TextPipelineUseCase>;\n\nexport type VisionPipelineUseCase =\n | \"background-removal\" // https://huggingface.co/tasks/image-segmentation#background-removal\n | \"image-segmentation\" // https://huggingface.co/tasks/image-segmentation\n | \"depth-estimation\" // https://huggingface.co/tasks/depth-estimation\n | \"image-classification\" // https://huggingface.co/tasks/image-classification\n | \"image-to-image\" // https://huggingface.co/tasks/image-to-image\n | \"object-detection\" // https://huggingface.co/tasks/object-detection\n | \"image-feature-extraction\"; // https://huggingface.co/tasks/image-feature-extraction\n\nexport const VisionPipelineUseCase = {\n \"background-removal\": \"background-removal\",\n \"image-segmentation\": \"image-segmentation\",\n \"depth-estimation\": \"depth-estimation\",\n \"image-classification\": \"image-classification\",\n \"image-to-image\": \"image-to-image\",\n \"object-detection\": \"object-detection\",\n \"image-feature-extraction\": \"image-feature-extraction\",\n} as const satisfies Record<VisionPipelineUseCase, VisionPipelineUseCase>;\n\nexport type AudioPipelineUseCase =\n | \"audio-classification\" // https://huggingface.co/tasks/audio-classification\n | \"automatic-speech-recognition\" // https://huggingface.co/tasks/automatic-speech-recognition\n | \"text-to-speech\"; // https://huggingface.co/tasks/text-to-speech\n\nexport const AudioPipelineUseCase = {\n \"audio-classification\": \"audio-classification\",\n \"automatic-speech-recognition\": \"automatic-speech-recognition\",\n \"text-to-speech\": \"text-to-speech\",\n} as const satisfies Record<AudioPipelineUseCase, AudioPipelineUseCase>;\n\nexport type MultimodalPipelineUseCase =\n | \"document-question-answering\" // https://huggingface.co/tasks/document-question-answering\n | \"image-to-text\" // https://huggingface.co/tasks/image-to-text\n | \"zero-shot-audio-classification\" // https://huggingface.co/tasks/zero-shot-audio-classification\n | \"zero-shot-image-classification\" // https://huggingface.co/tasks/zero-shot-image-classification\n | \"zero-shot-object-detection\"; // https://huggingface.co/tasks/zero-shot-object-detection\n\nexport const MultimodalPipelineUseCase = {\n \"document-question-answering\": \"document-question-answering\",\n \"image-to-text\": \"image-to-text\",\n \"zero-shot-audio-classification\": \"zero-shot-audio-classification\",\n \"zero-shot-image-classification\": \"zero-shot-image-classification\",\n \"zero-shot-object-detection\": \"zero-shot-object-detection\",\n} as const satisfies Record<MultimodalPipelineUseCase, MultimodalPipelineUseCase>;\n\nexport type PipelineUseCase =\n | TextPipelineUseCase\n | VisionPipelineUseCase\n | AudioPipelineUseCase\n | MultimodalPipelineUseCase;\n\nexport const PipelineUseCase = {\n ...TextPipelineUseCase,\n ...VisionPipelineUseCase,\n ...AudioPipelineUseCase,\n ...MultimodalPipelineUseCase,\n} as const satisfies Record<PipelineUseCase, PipelineUseCase>;\n"
6
+ ],
7
+ "mappings": ";AAMO,IAAM,uBAAuB;AAC7B,IAAM,iBAAiB;AAavB,IAAM,uBAAuB;AAAA,EAClC,MAAM;AAAA,EACN,MAAM;AAAA,EACN,MAAM;AAAA,EACN,IAAI;AAAA,EACJ,MAAM;AAAA,EACN,OAAO;AAAA,EACP,IAAI;AAAA,EACJ,MAAM;AAAA,EACN,OAAO;AACT;AAcO,IAAM,sBAAsB;AAAA,EACjC,aAAa;AAAA,EACb,wBAAwB;AAAA,EACxB,mBAAmB;AAAA,EACnB,wBAAwB;AAAA,EACxB,uBAAuB;AAAA,EACvB,eAAe;AAAA,EACf,aAAa;AAAA,EACb,sBAAsB;AAAA,EACtB,4BAA4B;AAAA,EAC5B,sBAAsB;AACxB;AAWO,IAAM,wBAAwB;AAAA,EACnC,sBAAsB;AAAA,EACtB,sBAAsB;AAAA,EACtB,oBAAoB;AAAA,EACpB,wBAAwB;AAAA,EACxB,kBAAkB;AAAA,EAClB,oBAAoB;AAAA,EACpB,4BAA4B;AAC9B;AAOO,IAAM,uBAAuB;AAAA,EAClC,wBAAwB;AAAA,EACxB,gCAAgC;AAAA,EAChC,kBAAkB;AACpB;AASO,IAAM,4BAA4B;AAAA,EACvC,+BAA+B;AAAA,EAC/B,iBAAiB;AAAA,EACjB,kCAAkC;AAAA,EAClC,kCAAkC;AAAA,EAClC,8BAA8B;AAChC;AAQO,IAAM,kBAAkB;AAAA,KAC1B;AAAA,KACA;AAAA,KACA;AAAA,KACA;AACL;",
8
+ "debugId": "297B2C0A21F958E264756E2164756E21",
9
+ "names": []
10
+ }
@@ -66,12 +66,15 @@ import {
66
66
  } from "@workglow/ai";
67
67
  class OpenAiProvider extends AiProvider {
68
68
  name = OPENAI;
69
+ isLocal = false;
70
+ supportsBrowser = true;
69
71
  taskTypes = [
70
72
  "TextGenerationTask",
71
73
  "TextEmbeddingTask",
72
74
  "TextRewriterTask",
73
75
  "TextSummaryTask",
74
76
  "CountTokensTask",
77
+ "ModelInfoTask",
75
78
  "StructuredGenerationTask",
76
79
  "ToolCallingTask"
77
80
  ];
@@ -82,4 +85,4 @@ class OpenAiProvider extends AiProvider {
82
85
 
83
86
  export { OPENAI, OpenAiModelSchema, OpenAiModelRecordSchema, OpenAiModelConfigSchema, OpenAiProvider };
84
87
 
85
- //# debugId=BDF1CFC6F529EA6C64756E2164756E21
88
+ //# debugId=938CB24770C7FEB864756E2164756E21
@@ -4,9 +4,9 @@
4
4
  "sourcesContent": [
5
5
  "/**\n * @license\n * Copyright 2025 Steven Roussey <sroussey@gmail.com>\n * SPDX-License-Identifier: Apache-2.0\n */\n\nexport const OPENAI = \"OPENAI\";\n",
6
6
  "/**\n * @license\n * Copyright 2025 Steven Roussey <sroussey@gmail.com>\n * SPDX-License-Identifier: Apache-2.0\n */\n\nimport { ModelConfigSchema, ModelRecordSchema } from \"@workglow/ai\";\nimport { DataPortSchemaObject, FromSchema } from \"@workglow/util\";\nimport { OPENAI } from \"./OpenAI_Constants\";\n\nexport const OpenAiModelSchema = {\n type: \"object\",\n properties: {\n provider: {\n const: OPENAI,\n description: \"Discriminator: OpenAI cloud provider.\",\n },\n provider_config: {\n type: \"object\",\n description: \"OpenAI-specific configuration.\",\n properties: {\n model_name: {\n type: \"string\",\n description: \"The OpenAI model identifier (e.g., 'gpt-4o', 'text-embedding-3-small').\",\n },\n credential_key: {\n type: \"string\",\n format: \"credential\",\n description: \"Key to look up in the credential store for the API key.\",\n \"x-ui-hidden\": true,\n },\n base_url: {\n type: \"string\",\n description: \"Base URL for the OpenAI API. Useful for Azure OpenAI or proxy servers.\",\n default: \"https://api.openai.com/v1\",\n },\n organization: {\n type: \"string\",\n description: \"OpenAI organization ID (optional).\",\n },\n },\n required: [\"model_name\"],\n additionalProperties: false,\n },\n },\n required: [\"provider\", \"provider_config\"],\n additionalProperties: true,\n} as const satisfies DataPortSchemaObject;\n\nexport const OpenAiModelRecordSchema = {\n type: \"object\",\n properties: {\n ...ModelRecordSchema.properties,\n ...OpenAiModelSchema.properties,\n },\n required: [...ModelRecordSchema.required, ...OpenAiModelSchema.required],\n additionalProperties: false,\n} as const satisfies DataPortSchemaObject;\n\nexport type OpenAiModelRecord = FromSchema<typeof OpenAiModelRecordSchema>;\n\nexport const OpenAiModelConfigSchema = {\n type: \"object\",\n properties: {\n ...ModelConfigSchema.properties,\n ...OpenAiModelSchema.properties,\n },\n required: [...ModelConfigSchema.required, ...OpenAiModelSchema.required],\n additionalProperties: false,\n} as const satisfies DataPortSchemaObject;\n\nexport type OpenAiModelConfig = FromSchema<typeof OpenAiModelConfigSchema>;\n",
7
- "/**\n * @license\n * Copyright 2025 Steven Roussey <sroussey@gmail.com>\n * SPDX-License-Identifier: Apache-2.0\n */\n\nimport {\n AiProvider,\n type AiProviderReactiveRunFn,\n type AiProviderRunFn,\n type AiProviderStreamFn,\n} from \"@workglow/ai\";\nimport { OPENAI } from \"./common/OpenAI_Constants\";\nimport type { OpenAiModelConfig } from \"./common/OpenAI_ModelSchema\";\n\n/**\n * AI provider for OpenAI cloud models.\n *\n * Supports text generation, text embedding, text rewriting, and text summarization\n * via the OpenAI API using the `openai` SDK.\n *\n * Task run functions are injected via the constructor so that the `openai` SDK\n * is only imported where actually needed (inline mode, worker server), not on\n * the main thread in worker mode.\n *\n * @example\n * ```typescript\n * // Worker mode (main thread) -- lightweight, no SDK import:\n * await new OpenAiProvider().register({\n * mode: \"worker\",\n * worker: new Worker(new URL(\"./worker_openai.ts\", import.meta.url), { type: \"module\" }),\n * });\n *\n * // Inline mode -- caller provides the tasks:\n * import { OPENAI_TASKS } from \"@workglow/ai-provider/openai\";\n * await new OpenAiProvider(OPENAI_TASKS).register({ mode: \"inline\" });\n *\n * // Worker side -- caller provides the tasks:\n * import { OPENAI_TASKS } from \"@workglow/ai-provider/openai\";\n * new OpenAiProvider(OPENAI_TASKS).registerOnWorkerServer(workerServer);\n * ```\n */\nexport class OpenAiProvider extends AiProvider<OpenAiModelConfig> {\n readonly name = OPENAI;\n\n readonly taskTypes = [\n \"TextGenerationTask\",\n \"TextEmbeddingTask\",\n \"TextRewriterTask\",\n \"TextSummaryTask\",\n \"CountTokensTask\",\n \"StructuredGenerationTask\",\n \"ToolCallingTask\",\n ] as const;\n\n constructor(\n tasks?: Record<string, AiProviderRunFn<any, any, OpenAiModelConfig>>,\n streamTasks?: Record<string, AiProviderStreamFn<any, any, OpenAiModelConfig>>,\n reactiveTasks?: Record<string, AiProviderReactiveRunFn<any, any, OpenAiModelConfig>>\n ) {\n super(tasks, streamTasks, reactiveTasks);\n }\n}\n"
7
+ "/**\n * @license\n * Copyright 2025 Steven Roussey <sroussey@gmail.com>\n * SPDX-License-Identifier: Apache-2.0\n */\n\nimport {\n AiProvider,\n type AiProviderReactiveRunFn,\n type AiProviderRunFn,\n type AiProviderStreamFn,\n} from \"@workglow/ai\";\nimport { OPENAI } from \"./common/OpenAI_Constants\";\nimport type { OpenAiModelConfig } from \"./common/OpenAI_ModelSchema\";\n\n/**\n * AI provider for OpenAI cloud models.\n *\n * Supports text generation, text embedding, text rewriting, and text summarization\n * via the OpenAI API using the `openai` SDK.\n *\n * Task run functions are injected via the constructor so that the `openai` SDK\n * is only imported where actually needed (inline mode, worker server), not on\n * the main thread in worker mode.\n *\n * @example\n * ```typescript\n * // Worker mode (main thread) -- lightweight, no SDK import:\n * await new OpenAiProvider().register({\n * mode: \"worker\",\n * worker: new Worker(new URL(\"./worker_openai.ts\", import.meta.url), { type: \"module\" }),\n * });\n *\n * // Inline mode -- caller provides the tasks:\n * import { OPENAI_TASKS } from \"@workglow/ai-provider/openai\";\n * await new OpenAiProvider(OPENAI_TASKS).register({ mode: \"inline\" });\n *\n * // Worker side -- caller provides the tasks:\n * import { OPENAI_TASKS } from \"@workglow/ai-provider/openai\";\n * new OpenAiProvider(OPENAI_TASKS).registerOnWorkerServer(workerServer);\n * ```\n */\nexport class OpenAiProvider extends AiProvider<OpenAiModelConfig> {\n readonly name = OPENAI;\n readonly isLocal = false;\n readonly supportsBrowser = true;\n\n readonly taskTypes = [\n \"TextGenerationTask\",\n \"TextEmbeddingTask\",\n \"TextRewriterTask\",\n \"TextSummaryTask\",\n \"CountTokensTask\",\n \"ModelInfoTask\",\n \"StructuredGenerationTask\",\n \"ToolCallingTask\",\n ] as const;\n\n constructor(\n tasks?: Record<string, AiProviderRunFn<any, any, OpenAiModelConfig>>,\n streamTasks?: Record<string, AiProviderStreamFn<any, any, OpenAiModelConfig>>,\n reactiveTasks?: Record<string, AiProviderReactiveRunFn<any, any, OpenAiModelConfig>>\n ) {\n super(tasks, streamTasks, reactiveTasks);\n }\n}\n"
8
8
  ],
9
- "mappings": ";AAMO,IAAM,SAAS;;;ACAtB;AAIO,IAAM,oBAAoB;AAAA,EAC/B,MAAM;AAAA,EACN,YAAY;AAAA,IACV,UAAU;AAAA,MACR,OAAO;AAAA,MACP,aAAa;AAAA,IACf;AAAA,IACA,iBAAiB;AAAA,MACf,MAAM;AAAA,MACN,aAAa;AAAA,MACb,YAAY;AAAA,QACV,YAAY;AAAA,UACV,MAAM;AAAA,UACN,aAAa;AAAA,QACf;AAAA,QACA,gBAAgB;AAAA,UACd,MAAM;AAAA,UACN,QAAQ;AAAA,UACR,aAAa;AAAA,UACb,eAAe;AAAA,QACjB;AAAA,QACA,UAAU;AAAA,UACR,MAAM;AAAA,UACN,aAAa;AAAA,UACb,SAAS;AAAA,QACX;AAAA,QACA,cAAc;AAAA,UACZ,MAAM;AAAA,UACN,aAAa;AAAA,QACf;AAAA,MACF;AAAA,MACA,UAAU,CAAC,YAAY;AAAA,MACvB,sBAAsB;AAAA,IACxB;AAAA,EACF;AAAA,EACA,UAAU,CAAC,Y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Z,MAAM;AAAA,UACN,aAAa;AAAA,QACf;AAAA,MACF;AAAA,MACA,UAAU,CAAC,YAAY;AAAA,MACvB,sBAAsB;AAAA,IACxB;AAAA,EACF;AAAA,EACA,UAAU,CAAC,YAAY,iBAAiB;AAAA,EACxC,sBAAsB;AACxB;AAEO,IAAM,0BAA0B;AAAA,EACrC,MAAM;AAAA,EACN,YAAY;AAAA,OACP,kBAAkB;AAAA,OAClB,kBAAkB;AAAA,EACvB;AAAA,EACA,UAAU,CAAC,GAAG,kBAAkB,UAAU,GAAG,kBAAkB,QAAQ;AAAA,EACvE,sBAAsB;AACxB;AAIO,IAAM,0BAA0B;AAAA,EACrC,MAAM;AAAA,EACN,YAAY;AAAA,OACP,kBAAkB;AAAA,OAClB,kBAAkB;AAAA,EACvB;AAAA,EACA,UAAU,CAAC,GAAG,kBAAkB,UAAU,GAAG,kBAAkB,QAAQ;AAAA,EACvE,sBAAsB;AACxB;;;AC/DA;AAAA;AAAA;AAoCO,MAAM,uBAAuB,WAA8B;AAAA,EACvD,OAAO;AAAA,EACP,UAAU;AAAA,EACV,kBAAkB;AAAA,EAElB,YAAY;AAAA,IACnB;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,EACF;AAAA,EAEA,WAAW,CACT,OACA,aACA,eACA;AAAA,IACA,MAAM,OAAO,aAAa,aAAa;AAAA;AAE3C;",
10
+ "debugId": "938CB24770C7FEB864756E2164756E21",
11
11
  "names": []
12
12
  }
@@ -57,7 +57,10 @@ import {
57
57
  } from "@workglow/ai";
58
58
  class OllamaProvider extends AiProvider {
59
59
  name = OLLAMA;
60
+ isLocal = true;
61
+ supportsBrowser = true;
60
62
  taskTypes = [
63
+ "ModelInfoTask",
61
64
  "TextGenerationTask",
62
65
  "TextEmbeddingTask",
63
66
  "TextRewriterTask",
@@ -71,4 +74,4 @@ class OllamaProvider extends AiProvider {
71
74
 
72
75
  export { OLLAMA, OLLAMA_DEFAULT_BASE_URL, OllamaModelSchema, OllamaModelRecordSchema, OllamaModelConfigSchema, OllamaProvider };
73
76
 
74
- //# debugId=49EE3B03113820A564756E2164756E21
77
+ //# debugId=98288E03B31C8BBC64756E2164756E21
@@ -4,9 +4,9 @@
4
4
  "sourcesContent": [
5
5
  "/**\n * @license\n * Copyright 2025 Steven Roussey <sroussey@gmail.com>\n * SPDX-License-Identifier: Apache-2.0\n */\n\nexport const OLLAMA = \"OLLAMA\";\nexport const OLLAMA_DEFAULT_BASE_URL = \"http://localhost:11434\";\n",
6
6
  "/**\n * @license\n * Copyright 2025 Steven Roussey <sroussey@gmail.com>\n * SPDX-License-Identifier: Apache-2.0\n */\n\nimport { ModelConfigSchema, ModelRecordSchema } from \"@workglow/ai\";\nimport { DataPortSchemaObject, FromSchema } from \"@workglow/util\";\nimport { OLLAMA, OLLAMA_DEFAULT_BASE_URL } from \"./Ollama_Constants\";\n\nexport const OllamaModelSchema = {\n type: \"object\",\n properties: {\n provider: {\n const: OLLAMA,\n description: \"Discriminator: Ollama local LLM server.\",\n },\n provider_config: {\n type: \"object\",\n description: \"Ollama-specific configuration.\",\n properties: {\n model_name: {\n type: \"string\",\n description: \"The Ollama model identifier (e.g., 'llama3.2', 'nomic-embed-text').\",\n },\n base_url: {\n type: \"string\",\n description: \"Base URL for the Ollama server.\",\n default: OLLAMA_DEFAULT_BASE_URL,\n },\n },\n required: [\"model_name\"],\n additionalProperties: false,\n },\n },\n required: [\"provider\", \"provider_config\"],\n additionalProperties: true,\n} as const satisfies DataPortSchemaObject;\n\nexport const OllamaModelRecordSchema = {\n type: \"object\",\n properties: {\n ...ModelRecordSchema.properties,\n ...OllamaModelSchema.properties,\n },\n required: [...ModelRecordSchema.required, ...OllamaModelSchema.required],\n additionalProperties: false,\n} as const satisfies DataPortSchemaObject;\n\nexport type OllamaModelRecord = FromSchema<typeof OllamaModelRecordSchema>;\n\nexport const OllamaModelConfigSchema = {\n type: \"object\",\n properties: {\n ...ModelConfigSchema.properties,\n ...OllamaModelSchema.properties,\n },\n required: [...ModelConfigSchema.required, ...OllamaModelSchema.required],\n additionalProperties: false,\n} as const satisfies DataPortSchemaObject;\n\nexport type OllamaModelConfig = FromSchema<typeof OllamaModelConfigSchema>;\n",
7
- "/**\n * @license\n * Copyright 2025 Steven Roussey <sroussey@gmail.com>\n * SPDX-License-Identifier: Apache-2.0\n */\n\nimport {\n AiProvider,\n type AiProviderReactiveRunFn,\n type AiProviderRunFn,\n type AiProviderStreamFn,\n} from \"@workglow/ai\";\nimport { OLLAMA } from \"./common/Ollama_Constants\";\nimport type { OllamaModelConfig } from \"./common/Ollama_ModelSchema\";\n\n/**\n * AI provider for Ollama local LLM server.\n *\n * Supports text generation, text embedding, text rewriting, and text summarization\n * via the Ollama API using the `ollama` SDK.\n *\n * Ollama runs locally and does not require an API key -- only a `base_url`\n * (defaults to `http://localhost:11434`).\n *\n * Task run functions are injected via the constructor so that the `ollama` SDK\n * is only imported where actually needed (inline mode, worker server), not on\n * the main thread in worker mode.\n *\n * @example\n * ```typescript\n * // Worker mode (main thread) -- lightweight, no SDK import:\n * await new OllamaProvider().register({\n * mode: \"worker\",\n * worker: new Worker(new URL(\"./worker_ollama.ts\", import.meta.url), { type: \"module\" }),\n * });\n *\n * // Inline mode -- caller provides the tasks:\n * import { OLLAMA_TASKS } from \"@workglow/ai-provider/ollama\";\n * await new OllamaProvider(OLLAMA_TASKS).register({ mode: \"inline\" });\n * ```\n */\nexport class OllamaProvider extends AiProvider<OllamaModelConfig> {\n readonly name = OLLAMA;\n\n readonly taskTypes = [\n \"TextGenerationTask\",\n \"TextEmbeddingTask\",\n \"TextRewriterTask\",\n \"TextSummaryTask\",\n \"ToolCallingTask\",\n ] as const;\n\n constructor(\n tasks?: Record<string, AiProviderRunFn<any, any, OllamaModelConfig>>,\n streamTasks?: Record<string, AiProviderStreamFn<any, any, OllamaModelConfig>>,\n reactiveTasks?: Record<string, AiProviderReactiveRunFn<any, any, OllamaModelConfig>>\n ) {\n super(tasks, streamTasks, reactiveTasks);\n }\n}\n"
7
+ "/**\n * @license\n * Copyright 2025 Steven Roussey <sroussey@gmail.com>\n * SPDX-License-Identifier: Apache-2.0\n */\n\nimport {\n AiProvider,\n type AiProviderReactiveRunFn,\n type AiProviderRunFn,\n type AiProviderStreamFn,\n} from \"@workglow/ai\";\nimport { OLLAMA } from \"./common/Ollama_Constants\";\nimport type { OllamaModelConfig } from \"./common/Ollama_ModelSchema\";\n\n/**\n * AI provider for Ollama local LLM server.\n *\n * Supports text generation, text embedding, text rewriting, and text summarization\n * via the Ollama API using the `ollama` SDK.\n *\n * Ollama runs locally and does not require an API key -- only a `base_url`\n * (defaults to `http://localhost:11434`).\n *\n * Task run functions are injected via the constructor so that the `ollama` SDK\n * is only imported where actually needed (inline mode, worker server), not on\n * the main thread in worker mode.\n *\n * @example\n * ```typescript\n * // Worker mode (main thread) -- lightweight, no SDK import:\n * await new OllamaProvider().register({\n * mode: \"worker\",\n * worker: new Worker(new URL(\"./worker_ollama.ts\", import.meta.url), { type: \"module\" }),\n * });\n *\n * // Inline mode -- caller provides the tasks:\n * import { OLLAMA_TASKS } from \"@workglow/ai-provider/ollama\";\n * await new OllamaProvider(OLLAMA_TASKS).register({ mode: \"inline\" });\n * ```\n */\nexport class OllamaProvider extends AiProvider<OllamaModelConfig> {\n readonly name = OLLAMA;\n readonly isLocal = true;\n readonly supportsBrowser = true;\n\n readonly taskTypes = [\n \"ModelInfoTask\",\n \"TextGenerationTask\",\n \"TextEmbeddingTask\",\n \"TextRewriterTask\",\n \"TextSummaryTask\",\n \"ToolCallingTask\",\n ] as const;\n\n constructor(\n tasks?: Record<string, AiProviderRunFn<any, any, OllamaModelConfig>>,\n streamTasks?: Record<string, AiProviderStreamFn<any, any, OllamaModelConfig>>,\n reactiveTasks?: Record<string, AiProviderReactiveRunFn<any, any, OllamaModelConfig>>\n ) {\n super(tasks, streamTasks, reactiveTasks);\n }\n}\n"
8
8
  ],
9
- "mappings": ";AAMO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@@ -61,7 +61,10 @@ import {
61
61
  } from "@workglow/ai";
62
62
  class HfInferenceProvider extends AiProvider {
63
63
  name = HF_INFERENCE;
64
+ isLocal = false;
65
+ supportsBrowser = true;
64
66
  taskTypes = [
67
+ "ModelInfoTask",
65
68
  "TextGenerationTask",
66
69
  "TextEmbeddingTask",
67
70
  "TextRewriterTask",
@@ -75,4 +78,4 @@ class HfInferenceProvider extends AiProvider {
75
78
 
76
79
  export { HF_INFERENCE, HfInferenceModelSchema, HfInferenceModelRecordSchema, HfInferenceModelConfigSchema, HfInferenceProvider };
77
80
 
78
- //# debugId=C5AC7908B46DD27F64756E2164756E21
81
+ //# debugId=CEE4DE4732887FF264756E2164756E21
@@ -4,9 +4,9 @@
4
4
  "sourcesContent": [
5
5
  "/**\n * @license\n * Copyright 2025 Steven Roussey <sroussey@gmail.com>\n * SPDX-License-Identifier: Apache-2.0\n */\n\nexport const HF_INFERENCE = \"HF_INFERENCE\";\n",
6
6
  "/**\n * @license\n * Copyright 2025 Steven Roussey <sroussey@gmail.com>\n * SPDX-License-Identifier: Apache-2.0\n */\n\nimport { ModelConfigSchema, ModelRecordSchema } from \"@workglow/ai\";\nimport { DataPortSchemaObject, FromSchema } from \"@workglow/util\";\nimport { HF_INFERENCE } from \"./HFI_Constants\";\n\nexport const HfInferenceModelSchema = {\n type: \"object\",\n properties: {\n provider: {\n const: HF_INFERENCE,\n description: \"Discriminator: Hugging Face Inference API provider.\",\n },\n provider_config: {\n type: \"object\",\n description: \"Hugging Face Inference-specific configuration.\",\n properties: {\n model_name: {\n type: \"string\",\n description:\n \"The Hugging Face model identifier (e.g., 'meta-llama/Llama-3.3-70B-Instruct').\",\n },\n credential_key: {\n type: \"string\",\n format: \"credential\",\n description: \"Key to look up in the credential store for the API key.\",\n \"x-ui-hidden\": true,\n },\n provider: {\n type: \"string\",\n description:\n \"Optional provider to route to specific HF inference providers (e.g., 'fal-ai', 'fireworks-ai').\",\n },\n },\n required: [\"model_name\"],\n additionalProperties: false,\n },\n },\n required: [\"provider\", \"provider_config\"],\n additionalProperties: true,\n} as const satisfies DataPortSchemaObject;\n\nexport const HfInferenceModelRecordSchema = {\n type: \"object\",\n properties: {\n ...ModelRecordSchema.properties,\n ...HfInferenceModelSchema.properties,\n },\n required: [...ModelRecordSchema.required, ...HfInferenceModelSchema.required],\n additionalProperties: false,\n} as const satisfies DataPortSchemaObject;\n\nexport type HfInferenceModelRecord = FromSchema<typeof HfInferenceModelRecordSchema>;\n\nexport const HfInferenceModelConfigSchema = {\n type: \"object\",\n properties: {\n ...ModelConfigSchema.properties,\n ...HfInferenceModelSchema.properties,\n },\n required: [...ModelConfigSchema.required, ...HfInferenceModelSchema.required],\n additionalProperties: false,\n} as const satisfies DataPortSchemaObject;\n\nexport type HfInferenceModelConfig = FromSchema<typeof HfInferenceModelConfigSchema>;\n",
7
- "/**\n * @license\n * Copyright 2025 Steven Roussey <sroussey@gmail.com>\n * SPDX-License-Identifier: Apache-2.0\n */\n\nimport {\n AiProvider,\n type AiProviderReactiveRunFn,\n type AiProviderRunFn,\n type AiProviderStreamFn,\n} from \"@workglow/ai\";\nimport { HF_INFERENCE } from \"./common/HFI_Constants\";\nimport type { HfInferenceModelConfig } from \"./common/HFI_ModelSchema\";\n\n/**\n * AI provider for Hugging Face Inference API.\n *\n * Supports text generation, text embedding, text rewriting, and text summarization\n * via the Hugging Face Inference API using the `@huggingface/inference` SDK.\n *\n * Task run functions are injected via the constructor so that the `@huggingface/inference` SDK\n * is only imported where actually needed (inline mode, worker server), not on\n * the main thread in worker mode.\n *\n * @example\n * ```typescript\n * // Worker mode (main thread) -- lightweight, no SDK import:\n * await new HfInferenceProvider().register({\n * mode: \"worker\",\n * worker: new Worker(new URL(\"./worker_hfi.ts\", import.meta.url), { type: \"module\" }),\n * });\n *\n * // Inline mode -- caller provides the tasks:\n * import { HFI_TASKS } from \"@workglow/ai-provider/hf-inference\";\n * await new HfInferenceProvider(HFI_TASKS).register({ mode: \"inline\" });\n *\n * // Worker side -- caller provides the tasks:\n * import { HFI_TASKS } from \"@workglow/ai-provider/hf-inference\";\n * new HfInferenceProvider(HFI_TASKS).registerOnWorkerServer(workerServer);\n * ```\n */\nexport class HfInferenceProvider extends AiProvider<HfInferenceModelConfig> {\n readonly name = HF_INFERENCE;\n\n readonly taskTypes = [\n \"TextGenerationTask\",\n \"TextEmbeddingTask\",\n \"TextRewriterTask\",\n \"TextSummaryTask\",\n \"ToolCallingTask\",\n ] as const;\n\n constructor(\n tasks?: Record<string, AiProviderRunFn<any, any, HfInferenceModelConfig>>,\n streamTasks?: Record<string, AiProviderStreamFn<any, any, HfInferenceModelConfig>>,\n reactiveTasks?: Record<string, AiProviderReactiveRunFn<any, any, HfInferenceModelConfig>>\n ) {\n super(tasks, streamTasks, reactiveTasks);\n }\n}\n"
7
+ "/**\n * @license\n * Copyright 2025 Steven Roussey <sroussey@gmail.com>\n * SPDX-License-Identifier: Apache-2.0\n */\n\nimport {\n AiProvider,\n type AiProviderReactiveRunFn,\n type AiProviderRunFn,\n type AiProviderStreamFn,\n} from \"@workglow/ai\";\nimport { HF_INFERENCE } from \"./common/HFI_Constants\";\nimport type { HfInferenceModelConfig } from \"./common/HFI_ModelSchema\";\n\n/**\n * AI provider for Hugging Face Inference API.\n *\n * Supports text generation, text embedding, text rewriting, and text summarization\n * via the Hugging Face Inference API using the `@huggingface/inference` SDK.\n *\n * Task run functions are injected via the constructor so that the `@huggingface/inference` SDK\n * is only imported where actually needed (inline mode, worker server), not on\n * the main thread in worker mode.\n *\n * @example\n * ```typescript\n * // Worker mode (main thread) -- lightweight, no SDK import:\n * await new HfInferenceProvider().register({\n * mode: \"worker\",\n * worker: new Worker(new URL(\"./worker_hfi.ts\", import.meta.url), { type: \"module\" }),\n * });\n *\n * // Inline mode -- caller provides the tasks:\n * import { HFI_TASKS } from \"@workglow/ai-provider/hf-inference\";\n * await new HfInferenceProvider(HFI_TASKS).register({ mode: \"inline\" });\n *\n * // Worker side -- caller provides the tasks:\n * import { HFI_TASKS } from \"@workglow/ai-provider/hf-inference\";\n * new HfInferenceProvider(HFI_TASKS).registerOnWorkerServer(workerServer);\n * ```\n */\nexport class HfInferenceProvider extends AiProvider<HfInferenceModelConfig> {\n readonly name = HF_INFERENCE;\n readonly isLocal = false;\n readonly supportsBrowser = true;\n\n readonly taskTypes = [\n \"ModelInfoTask\",\n \"TextGenerationTask\",\n \"TextEmbeddingTask\",\n \"TextRewriterTask\",\n \"TextSummaryTask\",\n \"ToolCallingTask\",\n ] as const;\n\n constructor(\n tasks?: Record<string, AiProviderRunFn<any, any, HfInferenceModelConfig>>,\n streamTasks?: Record<string, AiProviderStreamFn<any, any, HfInferenceModelConfig>>,\n reactiveTasks?: Record<string, AiProviderReactiveRunFn<any, any, HfInferenceModelConfig>>\n ) {\n super(tasks, streamTasks, reactiveTasks);\n }\n}\n"
8
8
  ],
9
- "mappings": ";AAMO,IAAM,eAAe;;;ACA5B;AAIO,IAAM,yBAAyB;AAAA,EACpC,MAAM;AAAA,EACN,YAAY;AAAA,IACV,UAAU;AAAA,MACR,OAAO;AAAA,MACP,aAAa;AAAA,IACf;AAAA,IACA,iBAAiB;AAAA,MACf,MAAM;AAAA,MACN,aAAa;AAAA,MACb,YAAY;AAAA,QACV,YAAY;AAAA,UACV,MAAM;AAAA,UACN,aACE;AAAA,QACJ;AAAA,QACA,gBAAgB;AAAA,UACd,MAAM;AAAA,UACN,QAAQ;AAAA,UACR,aAAa;AAAA,UACb,eAAe;AAAA,QACjB;AAAA,QACA,UAAU;AAAA,UACR,MAAM;AAAA,UACN,aACE;AAAA,QACJ;AAAA,MACF;AAAA,MACA,UAAU,CAAC,YAAY;AAAA,MACvB,sBAAsB;AAAA,IACxB;AAAA,EACF;AAAA,EACA,UAAU,CAAC,YAAY,iBAAiB;AAAA,EACxC,sBAAsB;AACxB;AAEO,IAAM,+BAA+B;AAAA,EAC1C,MAAM;AAAA,EACN,YAAY;AAAA,OACP,kBAAkB;AAAA,OAClB,uBAAuB;AAAA,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;AAAA,OACP,kBAAkB;AAAA,OAClB,uBAAuB;AAAA,EAC5B;AAAA,EACA,UAAU,CAAC,GAAG,kBAAkB,UAAU,GAAG,uBAAuB,QAAQ;AAAA,EAC5E,sBAAsB;AACxB;AAIO,IAAM,+BAA+B;AAAA,EAC1C,MAAM;AAAA,EACN,YAAY;AAAA,OACP,kBAAkB;AAAA,OAClB,uBAAuB;AAAA,EAC5B;AAAA,EACA,UAAU,CAAC,GAAG,kBAAkB,UAAU,GAAG,uBAAuB,QAAQ;AAAA,EAC5E,sBAAsB;AACxB;;;AC5DA;AAAA;AAAA;AAoCO,MAAM,4BAA4B,WAAmC;AAAA,EACjE,OAAO;AAAA,EACP,UAAU;AAAA,EACV,kBAAkB;AAAA,EAElB,YAAY;AAAA,IACnB;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,EACF;AAAA,EAEA,WAAW,CACT,OACA,aACA,eACA;AAAA,IACA,MAAM,OAAO,aAAa,aAAa;AAAA;AAE3C;",
10
+ "debugId": "CEE4DE4732887FF264756E2164756E21",
11
11
  "names": []
12
12
  }
@@ -81,9 +81,12 @@ import {
81
81
  } from "@workglow/ai";
82
82
  class LlamaCppProvider extends AiProvider {
83
83
  name = LOCAL_LLAMACPP;
84
+ isLocal = true;
85
+ supportsBrowser = false;
84
86
  taskTypes = [
85
87
  "DownloadModelTask",
86
88
  "UnloadModelTask",
89
+ "ModelInfoTask",
87
90
  "CountTokensTask",
88
91
  "TextGenerationTask",
89
92
  "TextEmbeddingTask",
@@ -98,4 +101,4 @@ class LlamaCppProvider extends AiProvider {
98
101
 
99
102
  export { LOCAL_LLAMACPP, LLAMACPP_DEFAULT_MODELS_DIR, LlamaCppModelSchema, LlamaCppModelRecordSchema, LlamaCppModelConfigSchema, LlamaCppProvider };
100
103
 
101
- //# debugId=DCB18DB135F4CE9464756E2164756E21
104
+ //# debugId=01C8E0AD216CEF7764756E2164756E21
@@ -4,9 +4,9 @@
4
4
  "sourcesContent": [
5
5
  "/**\n * @license\n * Copyright 2025 Steven Roussey <sroussey@gmail.com>\n * SPDX-License-Identifier: Apache-2.0\n */\n\nexport const LOCAL_LLAMACPP = \"LOCAL_LLAMACPP\";\nexport const LLAMACPP_DEFAULT_MODELS_DIR = \"./models\";\n",
6
6
  "/**\n * @license\n * Copyright 2025 Steven Roussey <sroussey@gmail.com>\n * SPDX-License-Identifier: Apache-2.0\n */\n\nimport { ModelConfigSchema, ModelRecordSchema } from \"@workglow/ai\";\nimport { DataPortSchemaObject, FromSchema } from \"@workglow/util\";\nimport { LLAMACPP_DEFAULT_MODELS_DIR, LOCAL_LLAMACPP } from \"./LlamaCpp_Constants\";\n\nexport const LlamaCppModelSchema = {\n type: \"object\",\n properties: {\n provider: {\n const: LOCAL_LLAMACPP,\n description: \"Discriminator: local node-llama-cpp (GGUF) model.\",\n },\n provider_config: {\n type: \"object\",\n description: \"node-llama-cpp specific configuration.\",\n properties: {\n model_path: {\n type: \"string\",\n description: \"Filesystem path to the .gguf model file.\",\n },\n model_url: {\n type: \"string\",\n description:\n \"URI or URL to download the model from (e.g. 'hf:user/repo:quant' or an https URL). Used by DownloadModelTask.\",\n },\n models_dir: {\n type: \"string\",\n description: \"Directory to download models into.\",\n default: LLAMACPP_DEFAULT_MODELS_DIR,\n },\n gpu_layers: {\n type: \"integer\",\n description: \"Number of model layers to offload to GPU. Use -1 for auto-detection.\",\n minimum: -1,\n },\n context_size: {\n type: \"integer\",\n description: \"Context window size in tokens.\",\n minimum: 1,\n },\n flash_attention: {\n type: \"boolean\",\n description: \"Enable flash attention for improved performance where supported.\",\n default: true,\n },\n embedding: {\n type: \"boolean\",\n description: \"Whether this model is used for text embedding (vs text generation).\",\n default: false,\n },\n },\n required: [\"model_path\"],\n additionalProperties: false,\n },\n },\n required: [\"provider\", \"provider_config\"],\n additionalProperties: true,\n} as const satisfies DataPortSchemaObject;\n\nexport const LlamaCppModelRecordSchema = {\n type: \"object\",\n properties: {\n ...ModelRecordSchema.properties,\n ...LlamaCppModelSchema.properties,\n },\n required: [...ModelRecordSchema.required, ...LlamaCppModelSchema.required],\n additionalProperties: false,\n} as const satisfies DataPortSchemaObject;\n\nexport type LlamaCppModelRecord = FromSchema<typeof LlamaCppModelRecordSchema>;\n\nexport const LlamaCppModelConfigSchema = {\n type: \"object\",\n properties: {\n ...ModelConfigSchema.properties,\n ...LlamaCppModelSchema.properties,\n },\n required: [...ModelConfigSchema.required, ...LlamaCppModelSchema.required],\n additionalProperties: false,\n} as const satisfies DataPortSchemaObject;\n\nexport type LlamaCppModelConfig = FromSchema<typeof LlamaCppModelConfigSchema>;\n",
7
- "/**\n * @license\n * Copyright 2025 Steven Roussey <sroussey@gmail.com>\n * SPDX-License-Identifier: Apache-2.0\n */\n\nimport {\n AiProvider,\n type AiProviderReactiveRunFn,\n type AiProviderRunFn,\n type AiProviderStreamFn,\n} from \"@workglow/ai\";\nimport { LOCAL_LLAMACPP } from \"./common/LlamaCpp_Constants\";\nimport type { LlamaCppModelConfig } from \"./common/LlamaCpp_ModelSchema\";\n\n/**\n * AI provider for running GGUF models locally via node-llama-cpp.\n *\n * Supports model downloading, unloading, text generation, text embedding,\n * text rewriting, and text summarization using llama.cpp under the hood.\n *\n * This provider is server-side only (Node.js/Bun) — it requires native binaries\n * and cannot run in the browser.\n *\n * Models are cached in memory after the first load. Use UnloadModelTask to\n * release memory when a model is no longer needed.\n *\n * @example\n * ```typescript\n * // Inline mode:\n * import { LLAMACPP_TASKS, LLAMACPP_STREAM_TASKS } from \"@workglow/ai-provider/llamacpp\";\n * await new LlamaCppProvider(LLAMACPP_TASKS, LLAMACPP_STREAM_TASKS).register({ mode: \"inline\" });\n *\n * // Worker mode (main thread) -- lightweight, no SDK import:\n * await new LlamaCppProvider().register({\n * mode: \"worker\",\n * worker: new Worker(new URL(\"./worker_llamacpp.ts\", import.meta.url), { type: \"module\" }),\n * });\n * ```\n */\nexport class LlamaCppProvider extends AiProvider<LlamaCppModelConfig> {\n readonly name = LOCAL_LLAMACPP;\n\n readonly taskTypes = [\n \"DownloadModelTask\",\n \"UnloadModelTask\",\n \"CountTokensTask\",\n \"TextGenerationTask\",\n \"TextEmbeddingTask\",\n \"TextRewriterTask\",\n \"TextSummaryTask\",\n \"ToolCallingTask\",\n ] as const;\n\n constructor(\n tasks?: Record<string, AiProviderRunFn<any, any, LlamaCppModelConfig>>,\n streamTasks?: Record<string, AiProviderStreamFn<any, any, LlamaCppModelConfig>>,\n reactiveTasks?: Record<string, AiProviderReactiveRunFn<any, any, LlamaCppModelConfig>>\n ) {\n super(tasks, streamTasks, reactiveTasks);\n }\n}\n"
7
+ "/**\n * @license\n * Copyright 2025 Steven Roussey <sroussey@gmail.com>\n * SPDX-License-Identifier: Apache-2.0\n */\n\nimport {\n AiProvider,\n type AiProviderReactiveRunFn,\n type AiProviderRunFn,\n type AiProviderStreamFn,\n} from \"@workglow/ai\";\nimport { LOCAL_LLAMACPP } from \"./common/LlamaCpp_Constants\";\nimport type { LlamaCppModelConfig } from \"./common/LlamaCpp_ModelSchema\";\n\n/**\n * AI provider for running GGUF models locally via node-llama-cpp.\n *\n * Supports model downloading, unloading, text generation, text embedding,\n * text rewriting, and text summarization using llama.cpp under the hood.\n *\n * This provider is server-side only (Node.js/Bun) — it requires native binaries\n * and cannot run in the browser.\n *\n * Models are cached in memory after the first load. Use UnloadModelTask to\n * release memory when a model is no longer needed.\n *\n * @example\n * ```typescript\n * // Inline mode:\n * import { LLAMACPP_TASKS, LLAMACPP_STREAM_TASKS } from \"@workglow/ai-provider/llamacpp\";\n * await new LlamaCppProvider(LLAMACPP_TASKS, LLAMACPP_STREAM_TASKS).register({ mode: \"inline\" });\n *\n * // Worker mode (main thread) -- lightweight, no SDK import:\n * await new LlamaCppProvider().register({\n * mode: \"worker\",\n * worker: new Worker(new URL(\"./worker_llamacpp.ts\", import.meta.url), { type: \"module\" }),\n * });\n * ```\n */\nexport class LlamaCppProvider extends AiProvider<LlamaCppModelConfig> {\n readonly name = LOCAL_LLAMACPP;\n readonly isLocal = true;\n readonly supportsBrowser = false;\n\n readonly taskTypes = [\n \"DownloadModelTask\",\n \"UnloadModelTask\",\n \"ModelInfoTask\",\n \"CountTokensTask\",\n \"TextGenerationTask\",\n \"TextEmbeddingTask\",\n \"TextRewriterTask\",\n \"TextSummaryTask\",\n \"ToolCallingTask\",\n ] as const;\n\n constructor(\n tasks?: Record<string, AiProviderRunFn<any, any, LlamaCppModelConfig>>,\n streamTasks?: Record<string, AiProviderStreamFn<any, any, LlamaCppModelConfig>>,\n reactiveTasks?: Record<string, AiProviderReactiveRunFn<any, any, LlamaCppModelConfig>>\n ) {\n super(tasks, streamTasks, reactiveTasks);\n }\n}\n"
8
8
  ],
9
- "mappings": ";AAMO,IAAM,iBAAiB;AACvB,IAAM,8BAA8B;;;ACD3C;AAIO,IAAM,sBAAsB;AAAA,EACjC,MAAM;AAAA,EACN,YAAY;AAAA,IACV,UAAU;AAAA,MACR,OAAO;AAAA,MACP,aAAa;AAAA,IACf;AAAA,IACA,iBAAiB;AAAA,MACf,MAAM;AAAA,MACN,aAAa;AAAA,MACb,YAAY;AAAA,QACV,YAAY;AAAA,UACV,MAAM;AAAA,UACN,aAAa;AAAA,QACf;AAAA,QACA,WAAW;AAAA,UACT,MAAM;AAAA,UACN,aACE;AAAA,QACJ;AAAA,QACA,YAAY;AAAA,UACV,MAAM;AAAA,UACN,aAAa;AAAA,UACb,SAAS;AAAA,QACX;AAAA,QACA,YAAY;AAAA,UACV,MAAM;AAAA,UACN,aAAa;AAAA,UACb,SAAS;AAAA,QACX;AAAA,QACA,cAAc;AAAA,UACZ,MAAM;AAAA,UACN,aAAa;AAAA,UACb,SAAS;AAAA,QACX;AAAA,QACA,iBAAiB;AAAA,UACf,MAAM;AAAA,UACN,aAAa;AAAA,UACb,SAAS;AAAA,QACX;AAAA,QACA,WAAW;AAAA,UACT,MAAM;AAAA,UACN,aAAa;AAAA,UACb,SAAS;AAAA,QACX;AAAA,MACF;AAAA,MACA,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