@workglow/openai 0.2.34 → 0.2.36

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 (60) hide show
  1. package/dist/ai/OpenAiProvider.d.ts +15 -21
  2. package/dist/ai/OpenAiProvider.d.ts.map +1 -1
  3. package/dist/ai/OpenAiQueuedProvider.d.ts +16 -22
  4. package/dist/ai/OpenAiQueuedProvider.d.ts.map +1 -1
  5. package/dist/ai/common/OpenAI_Capabilities.d.ts +38 -0
  6. package/dist/ai/common/OpenAI_Capabilities.d.ts.map +1 -0
  7. package/dist/ai/common/OpenAI_CapabilitySets.d.ts +30 -0
  8. package/dist/ai/common/OpenAI_CapabilitySets.d.ts.map +1 -0
  9. package/dist/ai/common/OpenAI_CountTokens.browser.d.ts +6 -1
  10. package/dist/ai/common/OpenAI_CountTokens.browser.d.ts.map +1 -1
  11. package/dist/ai/common/OpenAI_CountTokens.d.ts +6 -1
  12. package/dist/ai/common/OpenAI_CountTokens.d.ts.map +1 -1
  13. package/dist/ai/common/OpenAI_ImageEdit.d.ts +5 -5
  14. package/dist/ai/common/OpenAI_ImageEdit.d.ts.map +1 -1
  15. package/dist/ai/common/OpenAI_ImageGenerate.d.ts +7 -8
  16. package/dist/ai/common/OpenAI_ImageGenerate.d.ts.map +1 -1
  17. package/dist/ai/common/OpenAI_JobRunFns.browser.d.ts +7 -3
  18. package/dist/ai/common/OpenAI_JobRunFns.browser.d.ts.map +1 -1
  19. package/dist/ai/common/OpenAI_JobRunFns.d.ts +10 -3
  20. package/dist/ai/common/OpenAI_JobRunFns.d.ts.map +1 -1
  21. package/dist/ai/common/OpenAI_ModelInfo.d.ts +6 -1
  22. package/dist/ai/common/OpenAI_ModelInfo.d.ts.map +1 -1
  23. package/dist/ai/common/OpenAI_ModelSchema.d.ts +3 -3
  24. package/dist/ai/common/OpenAI_ModelSearch.d.ts +6 -1
  25. package/dist/ai/common/OpenAI_ModelSearch.d.ts.map +1 -1
  26. package/dist/ai/common/OpenAI_StructuredGeneration.d.ts +8 -3
  27. package/dist/ai/common/OpenAI_StructuredGeneration.d.ts.map +1 -1
  28. package/dist/ai/common/OpenAI_TextEmbedding.d.ts +6 -1
  29. package/dist/ai/common/OpenAI_TextEmbedding.d.ts.map +1 -1
  30. package/dist/ai/common/OpenAI_TextGeneration.d.ts +9 -3
  31. package/dist/ai/common/OpenAI_TextGeneration.d.ts.map +1 -1
  32. package/dist/ai/common/OpenAI_TextRewriter.d.ts +6 -3
  33. package/dist/ai/common/OpenAI_TextRewriter.d.ts.map +1 -1
  34. package/dist/ai/common/OpenAI_TextSummary.d.ts +6 -3
  35. package/dist/ai/common/OpenAI_TextSummary.d.ts.map +1 -1
  36. package/dist/ai/common/OpenAI_ToolCalling.d.ts +11 -3
  37. package/dist/ai/common/OpenAI_ToolCalling.d.ts.map +1 -1
  38. package/dist/ai/index.browser.d.ts.map +1 -1
  39. package/dist/ai/index.d.ts +26 -0
  40. package/dist/ai/index.d.ts.map +1 -1
  41. package/dist/ai/registerOpenAiInline.browser.d.ts.map +1 -1
  42. package/dist/ai/registerOpenAiWorker.browser.d.ts.map +1 -1
  43. package/dist/ai/registerOpenAiWorker.d.ts.map +1 -1
  44. package/dist/ai/runtime.browser.d.ts.map +1 -1
  45. package/dist/ai/runtime.d.ts.map +1 -1
  46. package/dist/ai-runtime.browser.d.ts.map +1 -1
  47. package/dist/ai-runtime.browser.js +434 -509
  48. package/dist/ai-runtime.browser.js.map +21 -19
  49. package/dist/ai-runtime.d.ts.map +1 -1
  50. package/dist/ai-runtime.js +432 -549
  51. package/dist/ai-runtime.js.map +21 -20
  52. package/dist/ai.browser.d.ts.map +1 -1
  53. package/dist/ai.browser.js +73 -15
  54. package/dist/ai.browser.js.map +6 -4
  55. package/dist/ai.d.ts.map +1 -1
  56. package/dist/ai.js +548 -25
  57. package/dist/ai.js.map +19 -5
  58. package/package.json +12 -13
  59. package/dist/ai/common/OpenAI_Chat.d.ts +0 -10
  60. package/dist/ai/common/OpenAI_Chat.d.ts.map +0 -1
@@ -4,7 +4,9 @@
4
4
  * SPDX-License-Identifier: Apache-2.0
5
5
  */
6
6
  import { AiProvider } from "@workglow/ai/worker";
7
- declare const OpenAiProvider_base: new (tasks?: Record<string, import("@workglow/ai").AiProviderRunFn<any, any, {
7
+ import type { Capability, ModelRecord } from "@workglow/ai/worker";
8
+ declare const OpenAiProvider_base: new (promiseRunFns?: readonly import("@workglow/ai").AiProviderRunFnRegistration<any, any, {
9
+ capabilities?: string[] | undefined;
8
10
  description?: string | undefined;
9
11
  metadata?: {
10
12
  [x: string]: unknown;
@@ -17,9 +19,9 @@ declare const OpenAiProvider_base: new (tasks?: Record<string, import("@workglow
17
19
  model_name: string;
18
20
  organization?: string | undefined;
19
21
  };
20
- tasks?: string[] | undefined;
21
22
  title?: string | undefined;
22
- }>> | undefined, streamTasks?: Record<string, import("@workglow/ai").AiProviderStreamFn<any, any, {
23
+ }>[] | undefined, previewTasks?: Record<string, import("@workglow/ai").AiProviderPreviewRunFn<any, any, {
24
+ capabilities?: string[] | undefined;
23
25
  description?: string | undefined;
24
26
  metadata?: {
25
27
  [x: string]: unknown;
@@ -32,24 +34,9 @@ declare const OpenAiProvider_base: new (tasks?: Record<string, import("@workglow
32
34
  model_name: string;
33
35
  organization?: string | undefined;
34
36
  };
35
- tasks?: string[] | undefined;
36
- title?: string | undefined;
37
- }>> | undefined, previewTasks?: Record<string, import("@workglow/ai").AiProviderPreviewRunFn<any, any, {
38
- description?: string | undefined;
39
- metadata?: {
40
- [x: string]: unknown;
41
- } | undefined;
42
- model_id?: string | undefined;
43
- provider: "OPENAI";
44
- provider_config: {
45
- base_url?: string | undefined;
46
- credential_key?: string | undefined;
47
- model_name: string;
48
- organization?: string | undefined;
49
- };
50
- tasks?: string[] | undefined;
51
37
  title?: string | undefined;
52
38
  }>> | undefined) => AiProvider<{
39
+ capabilities?: string[] | undefined;
53
40
  description?: string | undefined;
54
41
  metadata?: {
55
42
  [x: string]: unknown;
@@ -62,20 +49,27 @@ declare const OpenAiProvider_base: new (tasks?: Record<string, import("@workglow
62
49
  model_name: string;
63
50
  organization?: string | undefined;
64
51
  };
65
- tasks?: string[] | undefined;
66
52
  title?: string | undefined;
67
53
  }> & {
68
54
  readonly name: string;
69
55
  readonly displayName: string;
70
56
  readonly isLocal: boolean;
71
57
  readonly supportsBrowser: boolean;
72
- readonly taskTypes: readonly ["TextGenerationTask", "TextEmbeddingTask", "TextRewriterTask", "TextSummaryTask", "CountTokensTask", "ModelInfoTask", "StructuredGenerationTask", "ToolCallingTask", "ModelSearchTask"];
73
58
  };
74
59
  /**
75
60
  * Worker-server registration for OpenAI cloud models. Imports `AiProvider`
76
61
  * from `@workglow/ai/worker` so the SDK is only loaded in the worker.
62
+ *
63
+ * The class extends the {@link createCloudProviderClass} mixin (which
64
+ * supplies `name` / `displayName` / `isLocal` / `supportsBrowser`) and adds
65
+ * the OpenAI-specific {@link AiProvider.inferCapabilities} and
66
+ * {@link AiProvider.workerRunFnSpecs} overrides.
77
67
  */
78
68
  export declare class OpenAiProvider extends OpenAiProvider_base {
69
+ inferCapabilities(model: ModelRecord): readonly Capability[];
70
+ protected workerRunFnSpecs(): readonly {
71
+ serves: readonly Capability[];
72
+ }[];
79
73
  }
80
74
  export {};
81
75
  //# sourceMappingURL=OpenAiProvider.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"OpenAiProvider.d.ts","sourceRoot":"","sources":["../../src/ai/OpenAiProvider.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAE,UAAU,EAAE,MAAM,qBAAqB,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAiBjD;;;GAGG;AACH,qBAAa,cAAe,SAAQ,mBAOlC;CAAG"}
1
+ {"version":3,"file":"OpenAiProvider.d.ts","sourceRoot":"","sources":["../../src/ai/OpenAiProvider.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAE,UAAU,EAAE,MAAM,qBAAqB,CAAC;AACjD,OAAO,KAAK,EAAE,UAAU,EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAMnE;;;;;;;;GAQG;AACH,qBAAa,cAAe,SAAQ,mBAGlC;IACS,iBAAiB,CAAC,KAAK,EAAE,WAAW,GAAG,SAAS,UAAU,EAAE,CAEpE;IAED,UAAmB,gBAAgB,IAAI,SAAS;QAAE,MAAM,EAAE,SAAS,UAAU,EAAE,CAAA;KAAE,EAAE,CAElF;CACF"}
@@ -4,7 +4,9 @@
4
4
  * SPDX-License-Identifier: Apache-2.0
5
5
  */
6
6
  import { AiProvider } from "@workglow/ai";
7
- declare const OpenAiQueuedProvider_base: new (tasks?: Record<string, import("@workglow/ai").AiProviderRunFn<any, any, {
7
+ import type { Capability, ModelRecord } from "@workglow/ai";
8
+ declare const OpenAiQueuedProvider_base: new (promiseRunFns?: readonly import("@workglow/ai").AiProviderRunFnRegistration<any, any, {
9
+ capabilities?: string[] | undefined;
8
10
  description?: string | undefined;
9
11
  metadata?: {
10
12
  [x: string]: unknown;
@@ -17,9 +19,9 @@ declare const OpenAiQueuedProvider_base: new (tasks?: Record<string, import("@wo
17
19
  model_name: string;
18
20
  organization?: string | undefined;
19
21
  };
20
- tasks?: string[] | undefined;
21
22
  title?: string | undefined;
22
- }>> | undefined, streamTasks?: Record<string, import("@workglow/ai").AiProviderStreamFn<any, any, {
23
+ }>[] | undefined, previewTasks?: Record<string, import("@workglow/ai").AiProviderPreviewRunFn<any, any, {
24
+ capabilities?: string[] | undefined;
23
25
  description?: string | undefined;
24
26
  metadata?: {
25
27
  [x: string]: unknown;
@@ -32,24 +34,9 @@ declare const OpenAiQueuedProvider_base: new (tasks?: Record<string, import("@wo
32
34
  model_name: string;
33
35
  organization?: string | undefined;
34
36
  };
35
- tasks?: string[] | undefined;
36
- title?: string | undefined;
37
- }>> | undefined, previewTasks?: Record<string, import("@workglow/ai").AiProviderPreviewRunFn<any, any, {
38
- description?: string | undefined;
39
- metadata?: {
40
- [x: string]: unknown;
41
- } | undefined;
42
- model_id?: string | undefined;
43
- provider: "OPENAI";
44
- provider_config: {
45
- base_url?: string | undefined;
46
- credential_key?: string | undefined;
47
- model_name: string;
48
- organization?: string | undefined;
49
- };
50
- tasks?: string[] | undefined;
51
37
  title?: string | undefined;
52
38
  }>> | undefined) => AiProvider<{
39
+ capabilities?: string[] | undefined;
53
40
  description?: string | undefined;
54
41
  metadata?: {
55
42
  [x: string]: unknown;
@@ -62,17 +49,24 @@ declare const OpenAiQueuedProvider_base: new (tasks?: Record<string, import("@wo
62
49
  model_name: string;
63
50
  organization?: string | undefined;
64
51
  };
65
- tasks?: string[] | undefined;
66
52
  title?: string | undefined;
67
53
  }> & {
68
54
  readonly name: string;
69
55
  readonly displayName: string;
70
56
  readonly isLocal: boolean;
71
57
  readonly supportsBrowser: boolean;
72
- readonly taskTypes: readonly ["TextGenerationTask", "TextEmbeddingTask", "TextRewriterTask", "TextSummaryTask", "CountTokensTask", "ModelInfoTask", "StructuredGenerationTask", "ToolCallingTask", "ModelSearchTask", "ImageGenerateTask", "ImageEditTask"];
73
58
  };
74
- /** Main-thread registration (inline or worker-backed). No queue — uses direct execution. */
59
+ /**
60
+ * Main-thread registration shell for OpenAI. Used both for inline mode
61
+ * (constructed with the run-fn registrations array) and worker-backed mode
62
+ * (constructed empty so the base class registers worker proxies). No queue
63
+ * is created — OpenAI uses {@link DirectExecutionStrategy}.
64
+ */
75
65
  export declare class OpenAiQueuedProvider extends OpenAiQueuedProvider_base {
66
+ inferCapabilities(model: ModelRecord): readonly Capability[];
67
+ protected workerRunFnSpecs(): readonly {
68
+ serves: readonly Capability[];
69
+ }[];
76
70
  }
77
71
  export {};
78
72
  //# sourceMappingURL=OpenAiQueuedProvider.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"OpenAiQueuedProvider.d.ts","sourceRoot":"","sources":["../../src/ai/OpenAiQueuedProvider.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAmB1C,4FAA4F;AAC5F,qBAAa,oBAAqB,SAAQ,yBAOxC;CAAG"}
1
+ {"version":3,"file":"OpenAiQueuedProvider.d.ts","sourceRoot":"","sources":["../../src/ai/OpenAiQueuedProvider.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAC1C,OAAO,KAAK,EAAE,UAAU,EAAE,WAAW,EAAE,MAAM,cAAc,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAM5D;;;;;GAKG;AACH,qBAAa,oBAAqB,SAAQ,yBAMzC;IACU,iBAAiB,CAAC,KAAK,EAAE,WAAW,GAAG,SAAS,UAAU,EAAE,CAEpE;IAED,UAAmB,gBAAgB,IAAI,SAAS;QAAE,MAAM,EAAE,SAAS,UAAU,EAAE,CAAA;KAAE,EAAE,CAElF;CACF"}
@@ -0,0 +1,38 @@
1
+ /**
2
+ * @license
3
+ * Copyright 2026 Steven Roussey <sroussey@gmail.com>
4
+ * SPDX-License-Identifier: Apache-2.0
5
+ */
6
+ import type { Capability, ModelRecord } from "@workglow/ai/worker";
7
+ /**
8
+ * Closed list of capability-set specs the OpenAI provider serves. Derived
9
+ * from {@link OPENAI_CAPABILITY_SETS} — do not edit here. Used by the
10
+ * main-thread provider shells when registering worker-mode proxies (the
11
+ * actual runFns live in {@link OPENAI_RUN_FNS} on the worker side, but the
12
+ * main thread still needs to know which `serves` sets to register so the
13
+ * dispatcher can route requests to the worker proxy).
14
+ */
15
+ export declare const OPENAI_RUN_FN_SPECS: {
16
+ serves: ["image.editing"] | ["image.generation"] | ["model.count-tokens"] | ["model.info"] | ["model.search"] | ["text.embedding"] | ["text.generation"] | ["text.rewriter"] | ["text.summary"] | ["text.generation", "json-mode"] | ["text.generation", "tool-use"];
17
+ }[];
18
+ export declare function openAiWorkerRunFnSpecs(): readonly {
19
+ readonly serves: readonly Capability[];
20
+ }[];
21
+ /**
22
+ * Shape used by the model-name regexes — `model_id` is required, the rest
23
+ * is loosely-typed metadata only used to opportunistically widen the
24
+ * inferred capability set.
25
+ */
26
+ type CapabilityHints = Pick<ModelRecord, "model_id" | "provider_config" | "capabilities">;
27
+ /**
28
+ * Heuristic capability inference for an OpenAI {@link ModelRecord}. Pattern-
29
+ * matches the canonical OpenAI model id strings (and the `provider_config.
30
+ * model_name` if present) to a closed set of {@link Capability}s. Falls back
31
+ * to the model's stored `capabilities` array (or a baseline of search +
32
+ * info) when no pattern matches.
33
+ *
34
+ * Main-thread method only — workers do not run capability inference.
35
+ */
36
+ export declare function inferOpenAiCapabilities(model: CapabilityHints): readonly Capability[];
37
+ export {};
38
+ //# sourceMappingURL=OpenAI_Capabilities.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"OpenAI_Capabilities.d.ts","sourceRoot":"","sources":["../../../src/ai/common/OpenAI_Capabilities.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,KAAK,EAAE,UAAU,EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAC;AAOnE;;;;;;;GAOG;AACH,eAAO,MAAM,mBAAmB;;GAAuD,CAAC;AAExF,wBAAgB,sBAAsB,IAAI,SAAS;IAAE,QAAQ,CAAC,MAAM,EAAE,SAAS,UAAU,EAAE,CAAA;CAAE,EAAE,CAE9F;AAED;;;;GAIG;AACH,KAAK,eAAe,GAAG,IAAI,CAAC,WAAW,EAAE,UAAU,GAAG,iBAAiB,GAAG,cAAc,CAAC,CAAC;AAE1F;;;;;;;;GAQG;AACH,wBAAgB,uBAAuB,CAAC,KAAK,EAAE,eAAe,GAAG,SAAS,UAAU,EAAE,CAgDrF"}
@@ -0,0 +1,30 @@
1
+ /**
2
+ * @license
3
+ * Copyright 2026 Steven Roussey <sroussey@gmail.com>
4
+ * SPDX-License-Identifier: Apache-2.0
5
+ */
6
+ /**
7
+ * Single source of truth for OpenAI's capability sets.
8
+ *
9
+ * Both `OPENAI_RUN_FNS` (the worker-side registration list) and
10
+ * `workerRunFnSpecs()` (the main-thread proxy declaration) derive their
11
+ * `serves` arrays from these named exports. SDK-free so the main thread
12
+ * can import without paying the OpenAI client cost.
13
+ *
14
+ * To add a new capability set: declare a new `as const` constant here,
15
+ * then reference it from both `OPENAI_RUN_FNS` and `OPENAI_RUN_FN_SPECS`.
16
+ */
17
+ export declare const OPENAI_TEXT_GENERATION: ["text.generation"];
18
+ export declare const OPENAI_TOOL_USE: ["text.generation", "tool-use"];
19
+ export declare const OPENAI_JSON_MODE: ["text.generation", "json-mode"];
20
+ export declare const OPENAI_TEXT_REWRITER: ["text.rewriter"];
21
+ export declare const OPENAI_TEXT_SUMMARY: ["text.summary"];
22
+ export declare const OPENAI_TEXT_EMBEDDING: ["text.embedding"];
23
+ export declare const OPENAI_IMAGE_GENERATION: ["image.generation"];
24
+ export declare const OPENAI_IMAGE_EDITING: ["image.editing"];
25
+ export declare const OPENAI_COUNT_TOKENS: ["model.count-tokens"];
26
+ export declare const OPENAI_MODEL_SEARCH: ["model.search"];
27
+ export declare const OPENAI_MODEL_INFO: ["model.info"];
28
+ /** Aggregated list — for `workerRunFnSpecs()` derivation. Order MUST match `OPENAI_RUN_FNS`. */
29
+ export declare const OPENAI_CAPABILITY_SETS: readonly [["text.generation"], ["text.generation", "tool-use"], ["text.generation", "json-mode"], ["text.rewriter"], ["text.summary"], ["text.embedding"], ["image.generation"], ["image.editing"], ["model.count-tokens"], ["model.search"], ["model.info"]];
30
+ //# sourceMappingURL=OpenAI_CapabilitySets.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"OpenAI_CapabilitySets.d.ts","sourceRoot":"","sources":["../../../src/ai/common/OpenAI_CapabilitySets.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAIH;;;;;;;;;;GAUG;AACH,eAAO,MAAM,sBAAsB,qBAAsD,CAAC;AAC1F,eAAO,MAAM,eAAe,iCAAkE,CAAC;AAC/F,eAAO,MAAM,gBAAgB,kCAAmE,CAAC;AACjG,eAAO,MAAM,oBAAoB,mBAAoD,CAAC;AACtF,eAAO,MAAM,mBAAmB,kBAAmD,CAAC;AACpF,eAAO,MAAM,qBAAqB,oBAAqD,CAAC;AACxF,eAAO,MAAM,uBAAuB,sBAAuD,CAAC;AAC5F,eAAO,MAAM,oBAAoB,mBAAoD,CAAC;AACtF,eAAO,MAAM,mBAAmB,wBAAyD,CAAC;AAC1F,eAAO,MAAM,mBAAmB,kBAAmD,CAAC;AACpF,eAAO,MAAM,iBAAiB,gBAAiD,CAAC;AAEhF,gGAAgG;AAChG,eAAO,MAAM,sBAAsB,+PAYzB,CAAC"}
@@ -5,6 +5,11 @@
5
5
  */
6
6
  import type { AiProviderPreviewRunFn, AiProviderRunFn, CountTokensTaskInput, CountTokensTaskOutput } from "@workglow/ai";
7
7
  import type { OpenAiModelConfig } from "./OpenAI_ModelSchema";
8
- export declare const OpenAI_CountTokens: AiProviderRunFn<CountTokensTaskInput, CountTokensTaskOutput, OpenAiModelConfig>;
8
+ /**
9
+ * One-shot run-fn for `["model.count-tokens"]` in the browser.
10
+ * Emits a single `finish` event carrying the token count.
11
+ */
12
+ export declare const OpenAI_CountTokens_Stream: AiProviderRunFn<CountTokensTaskInput, CountTokensTaskOutput, OpenAiModelConfig>;
13
+ /** Lightweight preview path used by `AiTask.executePreview()`. */
9
14
  export declare const OpenAI_CountTokens_Preview: AiProviderPreviewRunFn<CountTokensTaskInput, CountTokensTaskOutput, OpenAiModelConfig>;
10
15
  //# sourceMappingURL=OpenAI_CountTokens.browser.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"OpenAI_CountTokens.browser.d.ts","sourceRoot":"","sources":["../../../src/ai/common/OpenAI_CountTokens.browser.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,KAAK,EACV,sBAAsB,EACtB,eAAe,EACf,oBAAoB,EACpB,qBAAqB,EACtB,MAAM,cAAc,CAAC;AACtB,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,sBAAsB,CAAC;AAqC9D,eAAO,MAAM,kBAAkB,EAAE,eAAe,CAC9C,oBAAoB,EACpB,qBAAqB,EACrB,iBAAiB,CAKlB,CAAC;AAEF,eAAO,MAAM,0BAA0B,EAAE,sBAAsB,CAC7D,oBAAoB,EACpB,qBAAqB,EACrB,iBAAiB,CAGlB,CAAC"}
1
+ {"version":3,"file":"OpenAI_CountTokens.browser.d.ts","sourceRoot":"","sources":["../../../src/ai/common/OpenAI_CountTokens.browser.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,KAAK,EACV,sBAAsB,EACtB,eAAe,EACf,oBAAoB,EACpB,qBAAqB,EACtB,MAAM,cAAc,CAAC;AACtB,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,sBAAsB,CAAC;AA8C9D;;;GAGG;AACH,eAAO,MAAM,yBAAyB,EAAE,eAAe,CACrD,oBAAoB,EACpB,qBAAqB,EACrB,iBAAiB,CAIlB,CAAC;AAEF,kEAAkE;AAClE,eAAO,MAAM,0BAA0B,EAAE,sBAAsB,CAC7D,oBAAoB,EACpB,qBAAqB,EACrB,iBAAiB,CAGlB,CAAC"}
@@ -5,6 +5,11 @@
5
5
  */
6
6
  import type { AiProviderPreviewRunFn, AiProviderRunFn, CountTokensTaskInput, CountTokensTaskOutput } from "@workglow/ai";
7
7
  import type { OpenAiModelConfig } from "./OpenAI_ModelSchema";
8
- export declare const OpenAI_CountTokens: AiProviderRunFn<CountTokensTaskInput, CountTokensTaskOutput, OpenAiModelConfig>;
8
+ /**
9
+ * One-shot run-fn for `["model.count-tokens"]`. Emits a single
10
+ * `finish` event carrying the token count.
11
+ */
12
+ export declare const OpenAI_CountTokens_Stream: AiProviderRunFn<CountTokensTaskInput, CountTokensTaskOutput, OpenAiModelConfig>;
13
+ /** Lightweight preview path used by `AiTask.executePreview()`. */
9
14
  export declare const OpenAI_CountTokens_Preview: AiProviderPreviewRunFn<CountTokensTaskInput, CountTokensTaskOutput, OpenAiModelConfig>;
10
15
  //# sourceMappingURL=OpenAI_CountTokens.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"OpenAI_CountTokens.d.ts","sourceRoot":"","sources":["../../../src/ai/common/OpenAI_CountTokens.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,KAAK,EACV,sBAAsB,EACtB,eAAe,EACf,oBAAoB,EACpB,qBAAqB,EACtB,MAAM,cAAc,CAAC;AACtB,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,sBAAsB,CAAC;AAqC9D,eAAO,MAAM,kBAAkB,EAAE,eAAe,CAC9C,oBAAoB,EACpB,qBAAqB,EACrB,iBAAiB,CAKlB,CAAC;AAEF,eAAO,MAAM,0BAA0B,EAAE,sBAAsB,CAC7D,oBAAoB,EACpB,qBAAqB,EACrB,iBAAiB,CAGlB,CAAC"}
1
+ {"version":3,"file":"OpenAI_CountTokens.d.ts","sourceRoot":"","sources":["../../../src/ai/common/OpenAI_CountTokens.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,KAAK,EACV,sBAAsB,EACtB,eAAe,EACf,oBAAoB,EACpB,qBAAqB,EACtB,MAAM,cAAc,CAAC;AACtB,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,sBAAsB,CAAC;AA8C9D;;;GAGG;AACH,eAAO,MAAM,yBAAyB,EAAE,eAAe,CACrD,oBAAoB,EACpB,qBAAqB,EACrB,iBAAiB,CAIlB,CAAC;AAEF,kEAAkE;AAClE,eAAO,MAAM,0BAA0B,EAAE,sBAAsB,CAC7D,oBAAoB,EACpB,qBAAqB,EACrB,iBAAiB,CAGlB,CAAC"}
@@ -3,12 +3,12 @@
3
3
  * Copyright 2025 Steven Roussey <sroussey@gmail.com>
4
4
  * SPDX-License-Identifier: Apache-2.0
5
5
  */
6
- import type { AiProviderRunFn, AiProviderStreamFn, ImageEditTaskInput, ImageEditTaskOutput } from "@workglow/ai";
6
+ import type { AiProviderRunFn, ImageEditTaskInput, ImageEditTaskOutput } from "@workglow/ai";
7
7
  import type { OpenAiModelConfig } from "./OpenAI_ModelSchema";
8
- export declare const OpenAI_ImageEdit: AiProviderRunFn<ImageEditTaskInput, ImageEditTaskOutput, OpenAiModelConfig>;
9
8
  /**
10
- * Streaming edit path. Yields snapshot events for each partial + final image, then finish.
11
- * SDK v6.35+ supports `stream: true` on `images.edit` for GPT image models.
9
+ * Streaming run-fn for `["image.editing"]`. SDK v6.35+ supports
10
+ * `stream: true` on `images.edit` for GPT image models — emits snapshot
11
+ * events for each partial + final image, then finish.
12
12
  */
13
- export declare const OpenAI_ImageEdit_Stream: AiProviderStreamFn<ImageEditTaskInput, ImageEditTaskOutput, OpenAiModelConfig>;
13
+ export declare const OpenAI_ImageEdit_Stream: AiProviderRunFn<ImageEditTaskInput, ImageEditTaskOutput, OpenAiModelConfig>;
14
14
  //# sourceMappingURL=OpenAI_ImageEdit.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"OpenAI_ImageEdit.d.ts","sourceRoot":"","sources":["../../../src/ai/common/OpenAI_ImageEdit.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,KAAK,EACV,eAAe,EACf,kBAAkB,EAClB,kBAAkB,EAClB,mBAAmB,EAEpB,MAAM,cAAc,CAAC;AAQtB,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,sBAAsB,CAAC;AA6F9D,eAAO,MAAM,gBAAgB,EAAE,eAAe,CAC5C,kBAAkB,EAClB,mBAAmB,EACnB,iBAAiB,CAmClB,CAAC;AAEF;;;GAGG;AACH,eAAO,MAAM,uBAAuB,EAAE,kBAAkB,CACtD,kBAAkB,EAClB,mBAAmB,EACnB,iBAAiB,CAgClB,CAAC"}
1
+ {"version":3,"file":"OpenAI_ImageEdit.d.ts","sourceRoot":"","sources":["../../../src/ai/common/OpenAI_ImageEdit.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,KAAK,EACV,eAAe,EACf,kBAAkB,EAClB,mBAAmB,EAEpB,MAAM,cAAc,CAAC;AAMtB,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,sBAAsB,CAAC;AA6F9D;;;;GAIG;AACH,eAAO,MAAM,uBAAuB,EAAE,eAAe,CACnD,kBAAkB,EAClB,mBAAmB,EACnB,iBAAiB,CAgClB,CAAC"}
@@ -3,15 +3,14 @@
3
3
  * Copyright 2025 Steven Roussey <sroussey@gmail.com>
4
4
  * SPDX-License-Identifier: Apache-2.0
5
5
  */
6
- import type { AiProviderRunFn, AiProviderStreamFn, ImageGenerateTaskInput, ImageGenerateTaskOutput } from "@workglow/ai";
6
+ import type { AiProviderRunFn, ImageGenerateTaskInput, ImageGenerateTaskOutput } from "@workglow/ai";
7
7
  import type { OpenAiModelConfig } from "./OpenAI_ModelSchema";
8
- /** Non-streaming path. Used for DALL-E or when streaming is not requested. */
9
- export declare const OpenAI_ImageGenerate: AiProviderRunFn<ImageGenerateTaskInput, ImageGenerateTaskOutput, OpenAiModelConfig>;
10
8
  /**
11
- * Streaming path. Yields snapshot events for each partial + final image, then finish.
12
- * Uses SDK v6+ streaming support: `stream: true` + `partial_images: 3` on GPT image models.
13
- * DALL-E 3 does not support streaming (the SDK overload for stream=true is not valid for it),
14
- * so this function falls back to the non-streaming path for DALL-E models.
9
+ * Streaming run-fn for `["image.generation"]`. GPT-image models support
10
+ * native streaming via `stream: true` + `partial_images: 3` and emit a
11
+ * `snapshot` event per partial frame plus a final snapshot. DALL-E models
12
+ * do not support streaming so this falls back to a single non-streaming
13
+ * call and emits one snapshot before finish.
15
14
  */
16
- export declare const OpenAI_ImageGenerate_Stream: AiProviderStreamFn<ImageGenerateTaskInput, ImageGenerateTaskOutput, OpenAiModelConfig>;
15
+ export declare const OpenAI_ImageGenerate_Stream: AiProviderRunFn<ImageGenerateTaskInput, ImageGenerateTaskOutput, OpenAiModelConfig>;
17
16
  //# sourceMappingURL=OpenAI_ImageGenerate.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"OpenAI_ImageGenerate.d.ts","sourceRoot":"","sources":["../../../src/ai/common/OpenAI_ImageGenerate.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,KAAK,EACV,eAAe,EACf,kBAAkB,EAClB,sBAAsB,EACtB,uBAAuB,EAExB,MAAM,cAAc,CAAC;AAOtB,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,sBAAsB,CAAC;AAgC9D,8EAA8E;AAC9E,eAAO,MAAM,oBAAoB,EAAE,eAAe,CAChD,sBAAsB,EACtB,uBAAuB,EACvB,iBAAiB,CAqDlB,CAAC;AAEF;;;;;GAKG;AACH,eAAO,MAAM,2BAA2B,EAAE,kBAAkB,CAC1D,sBAAsB,EACtB,uBAAuB,EACvB,iBAAiB,CAiFlB,CAAC"}
1
+ {"version":3,"file":"OpenAI_ImageGenerate.d.ts","sourceRoot":"","sources":["../../../src/ai/common/OpenAI_ImageGenerate.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,KAAK,EACV,eAAe,EACf,sBAAsB,EACtB,uBAAuB,EAExB,MAAM,cAAc,CAAC;AAKtB,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,sBAAsB,CAAC;AAgC9D;;;;;;GAMG;AACH,eAAO,MAAM,2BAA2B,EAAE,eAAe,CACvD,sBAAsB,EACtB,uBAAuB,EACvB,iBAAiB,CAiFlB,CAAC"}
@@ -3,10 +3,14 @@
3
3
  * Copyright 2025 Steven Roussey <sroussey@gmail.com>
4
4
  * SPDX-License-Identifier: Apache-2.0
5
5
  */
6
- import type { AiProviderPreviewRunFn, AiProviderRunFn, AiProviderStreamFn } from "@workglow/ai";
6
+ import type { AiProviderRunFnRegistration, AiProviderPreviewRunFn } from "@workglow/ai";
7
7
  import type { OpenAiModelConfig } from "./OpenAI_ModelSchema";
8
8
  export { loadOpenAISDK, getClient, getModelName } from "./OpenAI_Client";
9
- export declare const OPENAI_TASKS: Record<string, AiProviderRunFn<any, any, OpenAiModelConfig>>;
10
- export declare const OPENAI_STREAM_TASKS: Record<string, AiProviderStreamFn<any, any, OpenAiModelConfig>>;
9
+ /**
10
+ * Browser build of {@link OPENAI_RUN_FNS}. Identical to the node build
11
+ * except for the count-tokens import (uses `js-tiktoken` rather than the
12
+ * WASM `tiktoken` package).
13
+ */
14
+ export declare const OPENAI_RUN_FNS: readonly AiProviderRunFnRegistration<any, any, OpenAiModelConfig>[];
11
15
  export declare const OPENAI_PREVIEW_TASKS: Record<string, AiProviderPreviewRunFn<any, any, OpenAiModelConfig>>;
12
16
  //# sourceMappingURL=OpenAI_JobRunFns.browser.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"OpenAI_JobRunFns.browser.d.ts","sourceRoot":"","sources":["../../../src/ai/common/OpenAI_JobRunFns.browser.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,KAAK,EAAE,sBAAsB,EAAE,eAAe,EAAE,kBAAkB,EAAE,MAAM,cAAc,CAAC;AAChG,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,sBAAsB,CAAC;AAG9D,OAAO,EAAE,aAAa,EAAE,SAAS,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAgBzE,eAAO,MAAM,YAAY,EAAE,MAAM,CAAC,MAAM,EAAE,eAAe,CAAC,GAAG,EAAE,GAAG,EAAE,iBAAiB,CAAC,CAYrF,CAAC;AAEF,eAAO,MAAM,mBAAmB,EAAE,MAAM,CACtC,MAAM,EACN,kBAAkB,CAAC,GAAG,EAAE,GAAG,EAAE,iBAAiB,CAAC,CAShD,CAAC;AAEF,eAAO,MAAM,oBAAoB,EAAE,MAAM,CACvC,MAAM,EACN,sBAAsB,CAAC,GAAG,EAAE,GAAG,EAAE,iBAAiB,CAAC,CAGpD,CAAC"}
1
+ {"version":3,"file":"OpenAI_JobRunFns.browser.d.ts","sourceRoot":"","sources":["../../../src/ai/common/OpenAI_JobRunFns.browser.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,KAAK,EACV,2BAA2B,EAC3B,sBAAsB,EACvB,MAAM,cAAc,CAAC;AACtB,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,sBAAsB,CAAC;AAe9D,OAAO,EAAE,aAAa,EAAE,SAAS,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAiBzE;;;;GAIG;AACH,eAAO,MAAM,cAAc,EAAE,SAAS,2BAA2B,CAE/D,GAAG,EAEH,GAAG,EACH,iBAAiB,CAClB,EAYA,CAAC;AAEF,eAAO,MAAM,oBAAoB,EAAE,MAAM,CACvC,MAAM,EAEN,sBAAsB,CAAC,GAAG,EAAE,GAAG,EAAE,iBAAiB,CAAC,CAGpD,CAAC"}
@@ -3,10 +3,17 @@
3
3
  * Copyright 2025 Steven Roussey <sroussey@gmail.com>
4
4
  * SPDX-License-Identifier: Apache-2.0
5
5
  */
6
- import type { AiProviderPreviewRunFn, AiProviderRunFn, AiProviderStreamFn } from "@workglow/ai";
6
+ import type { AiProviderRunFnRegistration, AiProviderPreviewRunFn } from "@workglow/ai";
7
7
  import type { OpenAiModelConfig } from "./OpenAI_ModelSchema";
8
8
  export { loadOpenAISDK, getClient, getModelName } from "./OpenAI_Client";
9
- export declare const OPENAI_TASKS: Record<string, AiProviderRunFn<any, any, OpenAiModelConfig>>;
10
- export declare const OPENAI_STREAM_TASKS: Record<string, AiProviderStreamFn<any, any, OpenAiModelConfig>>;
9
+ /**
10
+ * Capability-set run-fn registrations for the OpenAI provider. Order is
11
+ * significant only as a tiebreaker — the dispatcher prefers the smallest
12
+ * `serves` set that is a superset of the task's `requires`, so the bare
13
+ * `["text.generation"]` entry wins for a plain {@link TextGenerationTask} or
14
+ * {@link AiChatTask} while the `["text.generation", "tool-use"]` entry wins
15
+ * for {@link ToolCallingTask}.
16
+ */
17
+ export declare const OPENAI_RUN_FNS: readonly AiProviderRunFnRegistration<any, any, OpenAiModelConfig>[];
11
18
  export declare const OPENAI_PREVIEW_TASKS: Record<string, AiProviderPreviewRunFn<any, any, OpenAiModelConfig>>;
12
19
  //# sourceMappingURL=OpenAI_JobRunFns.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"OpenAI_JobRunFns.d.ts","sourceRoot":"","sources":["../../../src/ai/common/OpenAI_JobRunFns.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,KAAK,EAAE,sBAAsB,EAAE,eAAe,EAAE,kBAAkB,EAAE,MAAM,cAAc,CAAC;AAChG,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,sBAAsB,CAAC;AAG9D,OAAO,EAAE,aAAa,EAAE,SAAS,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAiBzE,eAAO,MAAM,YAAY,EAAE,MAAM,CAAC,MAAM,EAAE,eAAe,CAAC,GAAG,EAAE,GAAG,EAAE,iBAAiB,CAAC,CAarF,CAAC;AAEF,eAAO,MAAM,mBAAmB,EAAE,MAAM,CACtC,MAAM,EACN,kBAAkB,CAAC,GAAG,EAAE,GAAG,EAAE,iBAAiB,CAAC,CAUhD,CAAC;AAEF,eAAO,MAAM,oBAAoB,EAAE,MAAM,CACvC,MAAM,EACN,sBAAsB,CAAC,GAAG,EAAE,GAAG,EAAE,iBAAiB,CAAC,CAGpD,CAAC"}
1
+ {"version":3,"file":"OpenAI_JobRunFns.d.ts","sourceRoot":"","sources":["../../../src/ai/common/OpenAI_JobRunFns.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,KAAK,EACV,2BAA2B,EAC3B,sBAAsB,EACvB,MAAM,cAAc,CAAC;AACtB,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,sBAAsB,CAAC;AAe9D,OAAO,EAAE,aAAa,EAAE,SAAS,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAczE;;;;;;;GAOG;AACH,eAAO,MAAM,cAAc,EAAE,SAAS,2BAA2B,CAE/D,GAAG,EAEH,GAAG,EACH,iBAAiB,CAClB,EAYA,CAAC;AAEF,eAAO,MAAM,oBAAoB,EAAE,MAAM,CACvC,MAAM,EAEN,sBAAsB,CAAC,GAAG,EAAE,GAAG,EAAE,iBAAiB,CAAC,CAGpD,CAAC"}
@@ -5,5 +5,10 @@
5
5
  */
6
6
  import type { AiProviderRunFn, ModelInfoTaskInput, ModelInfoTaskOutput } from "@workglow/ai";
7
7
  import type { OpenAiModelConfig } from "./OpenAI_ModelSchema";
8
- export declare const OpenAI_ModelInfo: AiProviderRunFn<ModelInfoTaskInput, ModelInfoTaskOutput, OpenAiModelConfig>;
8
+ /**
9
+ * One-shot run-fn for `["model.info"]`. Returns a synchronous
10
+ * info record from the in-process embedding-dimensions table; OpenAI does not
11
+ * expose an HTTP endpoint for this metadata. Emits a single `finish` event.
12
+ */
13
+ export declare const OpenAI_ModelInfo_Stream: AiProviderRunFn<ModelInfoTaskInput, ModelInfoTaskOutput, OpenAiModelConfig>;
9
14
  //# sourceMappingURL=OpenAI_ModelInfo.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"OpenAI_ModelInfo.d.ts","sourceRoot":"","sources":["../../../src/ai/common/OpenAI_ModelInfo.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,KAAK,EAAE,eAAe,EAAE,kBAAkB,EAAE,mBAAmB,EAAE,MAAM,cAAc,CAAC;AAC7F,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,sBAAsB,CAAC;AAS9D,eAAO,MAAM,gBAAgB,EAAE,eAAe,CAC5C,kBAAkB,EAClB,mBAAmB,EACnB,iBAAiB,CA0ClB,CAAC"}
1
+ {"version":3,"file":"OpenAI_ModelInfo.d.ts","sourceRoot":"","sources":["../../../src/ai/common/OpenAI_ModelInfo.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,KAAK,EAAE,eAAe,EAAE,kBAAkB,EAAE,mBAAmB,EAAE,MAAM,cAAc,CAAC;AAC7F,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,sBAAsB,CAAC;AAS9D;;;;GAIG;AACH,eAAO,MAAM,uBAAuB,EAAE,eAAe,CACnD,kBAAkB,EAClB,mBAAmB,EACnB,iBAAiB,CAiDlB,CAAC"}
@@ -48,7 +48,7 @@ export declare const OpenAiModelRecordSchema: {
48
48
  readonly model_id: {
49
49
  readonly type: "string";
50
50
  };
51
- readonly tasks: {
51
+ readonly capabilities: {
52
52
  readonly type: "array";
53
53
  readonly items: {
54
54
  readonly type: "string";
@@ -99,7 +99,7 @@ export declare const OpenAiModelRecordSchema: {
99
99
  readonly additionalProperties: false;
100
100
  };
101
101
  };
102
- readonly required: readonly ["model_id", "tasks", "provider", "title", "description", "provider_config", "metadata", "provider", "provider_config"];
102
+ readonly required: readonly ["model_id", "capabilities", "provider", "title", "description", "provider_config", "metadata", "provider", "provider_config"];
103
103
  readonly additionalProperties: false;
104
104
  };
105
105
  export type OpenAiModelRecord = FromSchema<typeof OpenAiModelRecordSchema>;
@@ -109,7 +109,7 @@ export declare const OpenAiModelConfigSchema: {
109
109
  readonly model_id: {
110
110
  readonly type: "string";
111
111
  };
112
- readonly tasks: {
112
+ readonly capabilities: {
113
113
  readonly type: "array";
114
114
  readonly items: {
115
115
  readonly type: "string";
@@ -4,5 +4,10 @@
4
4
  * SPDX-License-Identifier: Apache-2.0
5
5
  */
6
6
  import type { AiProviderRunFn, ModelSearchTaskInput, ModelSearchTaskOutput } from "@workglow/ai";
7
- export declare const OpenAI_ModelSearch: AiProviderRunFn<ModelSearchTaskInput, ModelSearchTaskOutput>;
7
+ /**
8
+ * One-shot run-fn for `["model.search"]`. Emits a
9
+ * single `finish` event with the search results. When no credential key is
10
+ * provided, falls back to a curated static list of well-known OpenAI models.
11
+ */
12
+ export declare const OpenAI_ModelSearch_Stream: AiProviderRunFn<ModelSearchTaskInput, ModelSearchTaskOutput>;
8
13
  //# sourceMappingURL=OpenAI_ModelSearch.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"OpenAI_ModelSearch.d.ts","sourceRoot":"","sources":["../../../src/ai/common/OpenAI_ModelSearch.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,KAAK,EACV,eAAe,EAEf,oBAAoB,EACpB,qBAAqB,EACtB,MAAM,cAAc,CAAC;AAuEtB,eAAO,MAAM,kBAAkB,EAAE,eAAe,CAC9C,oBAAoB,EACpB,qBAAqB,CAUtB,CAAC"}
1
+ {"version":3,"file":"OpenAI_ModelSearch.d.ts","sourceRoot":"","sources":["../../../src/ai/common/OpenAI_ModelSearch.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,KAAK,EACV,eAAe,EAEf,oBAAoB,EACpB,qBAAqB,EACtB,MAAM,cAAc,CAAC;AAuEtB;;;;GAIG;AACH,eAAO,MAAM,yBAAyB,EAAE,eAAe,CACrD,oBAAoB,EACpB,qBAAqB,CAUtB,CAAC"}
@@ -3,8 +3,13 @@
3
3
  * Copyright 2025 Steven Roussey <sroussey@gmail.com>
4
4
  * SPDX-License-Identifier: Apache-2.0
5
5
  */
6
- import type { AiProviderRunFn, AiProviderStreamFn, StructuredGenerationTaskInput, StructuredGenerationTaskOutput } from "@workglow/ai";
6
+ import type { AiProviderRunFn, StructuredGenerationTaskInput, StructuredGenerationTaskOutput } from "@workglow/ai";
7
7
  import type { OpenAiModelConfig } from "./OpenAI_ModelSchema";
8
- export declare const OpenAI_StructuredGeneration: AiProviderRunFn<StructuredGenerationTaskInput, StructuredGenerationTaskOutput, OpenAiModelConfig>;
9
- export declare const OpenAI_StructuredGeneration_Stream: AiProviderStreamFn<StructuredGenerationTaskInput, StructuredGenerationTaskOutput, OpenAiModelConfig>;
8
+ /**
9
+ * Streaming run-fn for `["text.generation", "json-mode"]`. Emits
10
+ * `object-delta` events with progressively-completed partial JSON snapshots
11
+ * on the `object` port, ending with a `finish` event carrying the parsed
12
+ * final object.
13
+ */
14
+ export declare const OpenAI_StructuredGeneration_Stream: AiProviderRunFn<StructuredGenerationTaskInput, StructuredGenerationTaskOutput, OpenAiModelConfig>;
10
15
  //# sourceMappingURL=OpenAI_StructuredGeneration.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"OpenAI_StructuredGeneration.d.ts","sourceRoot":"","sources":["../../../src/ai/common/OpenAI_StructuredGeneration.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,KAAK,EACV,eAAe,EACf,kBAAkB,EAClB,6BAA6B,EAC7B,8BAA8B,EAC/B,MAAM,cAAc,CAAC;AAGtB,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,sBAAsB,CAAC;AAG9D,eAAO,MAAM,2BAA2B,EAAE,eAAe,CACvD,6BAA6B,EAC7B,8BAA8B,EAC9B,iBAAiB,CA6BlB,CAAC;AAEF,eAAO,MAAM,kCAAkC,EAAE,kBAAkB,CACjE,6BAA6B,EAC7B,8BAA8B,EAC9B,iBAAiB,CAkDlB,CAAC"}
1
+ {"version":3,"file":"OpenAI_StructuredGeneration.d.ts","sourceRoot":"","sources":["../../../src/ai/common/OpenAI_StructuredGeneration.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,KAAK,EACV,eAAe,EACf,6BAA6B,EAC7B,8BAA8B,EAC/B,MAAM,cAAc,CAAC;AAEtB,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,sBAAsB,CAAC;AAG9D;;;;;GAKG;AACH,eAAO,MAAM,kCAAkC,EAAE,eAAe,CAC9D,6BAA6B,EAC7B,8BAA8B,EAC9B,iBAAiB,CA6ClB,CAAC"}
@@ -5,5 +5,10 @@
5
5
  */
6
6
  import type { AiProviderRunFn, TextEmbeddingTaskInput, TextEmbeddingTaskOutput } from "@workglow/ai";
7
7
  import type { OpenAiModelConfig } from "./OpenAI_ModelSchema";
8
- export declare const OpenAI_TextEmbedding: AiProviderRunFn<TextEmbeddingTaskInput, TextEmbeddingTaskOutput, OpenAiModelConfig>;
8
+ /**
9
+ * One-shot run-fn for `["text.embedding"]`. Calls the OpenAI
10
+ * embeddings endpoint and emits a single `finish` event carrying the vector
11
+ * (or array of vectors when `input.text` is an array).
12
+ */
13
+ export declare const OpenAI_TextEmbedding_Stream: AiProviderRunFn<TextEmbeddingTaskInput, TextEmbeddingTaskOutput, OpenAiModelConfig>;
9
14
  //# sourceMappingURL=OpenAI_TextEmbedding.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"OpenAI_TextEmbedding.d.ts","sourceRoot":"","sources":["../../../src/ai/common/OpenAI_TextEmbedding.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,KAAK,EACV,eAAe,EACf,sBAAsB,EACtB,uBAAuB,EACxB,MAAM,cAAc,CAAC;AAEtB,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,sBAAsB,CAAC;AAG9D,eAAO,MAAM,oBAAoB,EAAE,eAAe,CAChD,sBAAsB,EACtB,uBAAuB,EACvB,iBAAiB,CA6BlB,CAAC"}
1
+ {"version":3,"file":"OpenAI_TextEmbedding.d.ts","sourceRoot":"","sources":["../../../src/ai/common/OpenAI_TextEmbedding.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,KAAK,EAAE,eAAe,EAAE,sBAAsB,EAAE,uBAAuB,EAAE,MAAM,cAAc,CAAC;AAErG,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,sBAAsB,CAAC;AAG9D;;;;GAIG;AACH,eAAO,MAAM,2BAA2B,EAAE,eAAe,CACvD,sBAAsB,EACtB,uBAAuB,EACvB,iBAAiB,CA6BlB,CAAC"}
@@ -3,8 +3,14 @@
3
3
  * Copyright 2025 Steven Roussey <sroussey@gmail.com>
4
4
  * SPDX-License-Identifier: Apache-2.0
5
5
  */
6
- import type { AiProviderRunFn, AiProviderStreamFn, TextGenerationTaskInput, TextGenerationTaskOutput } from "@workglow/ai";
6
+ import type { AiProviderRunFn, TextGenerationTaskInput, TextGenerationTaskOutput } from "@workglow/ai";
7
7
  import type { OpenAiModelConfig } from "./OpenAI_ModelSchema";
8
- export declare const OpenAI_TextGeneration: AiProviderRunFn<TextGenerationTaskInput, TextGenerationTaskOutput, OpenAiModelConfig>;
9
- export declare const OpenAI_TextGeneration_Stream: AiProviderStreamFn<TextGenerationTaskInput, TextGenerationTaskOutput, OpenAiModelConfig>;
8
+ /**
9
+ * Streaming run-fn for the `["text.generation"]` capability. Used by both
10
+ * {@link TextGenerationTask} (prompt-only input) and {@link AiChatTask}
11
+ * (full conversation history). Emits `text-delta` events on the `text` port
12
+ * and a final empty `finish` event per the streaming convention (consumer
13
+ * accumulates).
14
+ */
15
+ export declare const OpenAI_TextGeneration_Stream: AiProviderRunFn<TextGenerationTaskInput, TextGenerationTaskOutput, OpenAiModelConfig>;
10
16
  //# sourceMappingURL=OpenAI_TextGeneration.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"OpenAI_TextGeneration.d.ts","sourceRoot":"","sources":["../../../src/ai/common/OpenAI_TextGeneration.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,KAAK,EACV,eAAe,EACf,kBAAkB,EAClB,uBAAuB,EACvB,wBAAwB,EACzB,MAAM,cAAc,CAAC;AAGtB,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,sBAAsB,CAAC;AAG9D,eAAO,MAAM,qBAAqB,EAAE,eAAe,CACjD,uBAAuB,EACvB,wBAAwB,EACxB,iBAAiB,CA0BlB,CAAC;AAEF,eAAO,MAAM,4BAA4B,EAAE,kBAAkB,CAC3D,uBAAuB,EACvB,wBAAwB,EACxB,iBAAiB,CA0BlB,CAAC"}
1
+ {"version":3,"file":"OpenAI_TextGeneration.d.ts","sourceRoot":"","sources":["../../../src/ai/common/OpenAI_TextGeneration.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,KAAK,EAAE,eAAe,EAAE,uBAAuB,EAAE,wBAAwB,EAAE,MAAM,cAAc,CAAC;AAGvG,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,sBAAsB,CAAC;AAiD9D;;;;;;GAMG;AACH,eAAO,MAAM,4BAA4B,EAAE,eAAe,CACxD,uBAAuB,EACvB,wBAAwB,EACxB,iBAAiB,CA0BlB,CAAC"}
@@ -3,8 +3,11 @@
3
3
  * Copyright 2025 Steven Roussey <sroussey@gmail.com>
4
4
  * SPDX-License-Identifier: Apache-2.0
5
5
  */
6
- import type { AiProviderRunFn, AiProviderStreamFn, TextRewriterTaskInput, TextRewriterTaskOutput } from "@workglow/ai";
6
+ import type { AiProviderRunFn, TextRewriterTaskInput, TextRewriterTaskOutput } from "@workglow/ai";
7
7
  import type { OpenAiModelConfig } from "./OpenAI_ModelSchema";
8
- export declare const OpenAI_TextRewriter: AiProviderRunFn<TextRewriterTaskInput, TextRewriterTaskOutput, OpenAiModelConfig>;
9
- export declare const OpenAI_TextRewriter_Stream: AiProviderStreamFn<TextRewriterTaskInput, TextRewriterTaskOutput, OpenAiModelConfig>;
8
+ /**
9
+ * Streaming run-fn for `["text.rewriter"]`. Emits `text-delta` events on
10
+ * the `text` port and a final empty `finish` event.
11
+ */
12
+ export declare const OpenAI_TextRewriter_Stream: AiProviderRunFn<TextRewriterTaskInput, TextRewriterTaskOutput, OpenAiModelConfig>;
10
13
  //# sourceMappingURL=OpenAI_TextRewriter.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"OpenAI_TextRewriter.d.ts","sourceRoot":"","sources":["../../../src/ai/common/OpenAI_TextRewriter.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,KAAK,EACV,eAAe,EACf,kBAAkB,EAClB,qBAAqB,EACrB,sBAAsB,EACvB,MAAM,cAAc,CAAC;AAEtB,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,sBAAsB,CAAC;AAG9D,eAAO,MAAM,mBAAmB,EAAE,eAAe,CAC/C,qBAAqB,EACrB,sBAAsB,EACtB,iBAAiB,CAmBlB,CAAC;AAEF,eAAO,MAAM,0BAA0B,EAAE,kBAAkB,CACzD,qBAAqB,EACrB,sBAAsB,EACtB,iBAAiB,CAwBlB,CAAC"}
1
+ {"version":3,"file":"OpenAI_TextRewriter.d.ts","sourceRoot":"","sources":["../../../src/ai/common/OpenAI_TextRewriter.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,KAAK,EAAE,eAAe,EAAE,qBAAqB,EAAE,sBAAsB,EAAE,MAAM,cAAc,CAAC;AACnG,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,sBAAsB,CAAC;AAG9D;;;GAGG;AACH,eAAO,MAAM,0BAA0B,EAAE,eAAe,CACtD,qBAAqB,EACrB,sBAAsB,EACtB,iBAAiB,CAwBlB,CAAC"}
@@ -3,8 +3,11 @@
3
3
  * Copyright 2025 Steven Roussey <sroussey@gmail.com>
4
4
  * SPDX-License-Identifier: Apache-2.0
5
5
  */
6
- import type { AiProviderRunFn, AiProviderStreamFn, TextSummaryTaskInput, TextSummaryTaskOutput } from "@workglow/ai";
6
+ import type { AiProviderRunFn, TextSummaryTaskInput, TextSummaryTaskOutput } from "@workglow/ai";
7
7
  import type { OpenAiModelConfig } from "./OpenAI_ModelSchema";
8
- export declare const OpenAI_TextSummary: AiProviderRunFn<TextSummaryTaskInput, TextSummaryTaskOutput, OpenAiModelConfig>;
9
- export declare const OpenAI_TextSummary_Stream: AiProviderStreamFn<TextSummaryTaskInput, TextSummaryTaskOutput, OpenAiModelConfig>;
8
+ /**
9
+ * Streaming run-fn for `["text.summary"]`. Emits `text-delta` events on
10
+ * the `text` port and a final empty `finish` event.
11
+ */
12
+ export declare const OpenAI_TextSummary_Stream: AiProviderRunFn<TextSummaryTaskInput, TextSummaryTaskOutput, OpenAiModelConfig>;
10
13
  //# sourceMappingURL=OpenAI_TextSummary.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"OpenAI_TextSummary.d.ts","sourceRoot":"","sources":["../../../src/ai/common/OpenAI_TextSummary.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,KAAK,EACV,eAAe,EACf,kBAAkB,EAClB,oBAAoB,EACpB,qBAAqB,EACtB,MAAM,cAAc,CAAC;AAEtB,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,sBAAsB,CAAC;AAG9D,eAAO,MAAM,kBAAkB,EAAE,eAAe,CAC9C,oBAAoB,EACpB,qBAAqB,EACrB,iBAAiB,CAmBlB,CAAC;AAEF,eAAO,MAAM,yBAAyB,EAAE,kBAAkB,CACxD,oBAAoB,EACpB,qBAAqB,EACrB,iBAAiB,CAwBlB,CAAC"}
1
+ {"version":3,"file":"OpenAI_TextSummary.d.ts","sourceRoot":"","sources":["../../../src/ai/common/OpenAI_TextSummary.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,KAAK,EAAE,eAAe,EAAE,oBAAoB,EAAE,qBAAqB,EAAE,MAAM,cAAc,CAAC;AACjG,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,sBAAsB,CAAC;AAG9D;;;GAGG;AACH,eAAO,MAAM,yBAAyB,EAAE,eAAe,CACrD,oBAAoB,EACpB,qBAAqB,EACrB,iBAAiB,CAwBlB,CAAC"}
@@ -3,8 +3,16 @@
3
3
  * Copyright 2025 Steven Roussey <sroussey@gmail.com>
4
4
  * SPDX-License-Identifier: Apache-2.0
5
5
  */
6
- import type { AiProviderRunFn, AiProviderStreamFn, ToolCallingTaskInput, ToolCallingTaskOutput } from "@workglow/ai";
6
+ import type { AiProviderRunFn, ToolCallingTaskInput, ToolCallingTaskOutput } from "@workglow/ai";
7
7
  import type { OpenAiModelConfig } from "./OpenAI_ModelSchema";
8
- export declare const OpenAI_ToolCalling: AiProviderRunFn<ToolCallingTaskInput, ToolCallingTaskOutput, OpenAiModelConfig>;
9
- export declare const OpenAI_ToolCalling_Stream: AiProviderStreamFn<ToolCallingTaskInput, ToolCallingTaskOutput, OpenAiModelConfig>;
8
+ /**
9
+ * Streaming run-fn for `["text.generation", "tool-use"]`. Calls the OpenAI
10
+ * chat-completions endpoint with `stream: true` and forwards delta events via
11
+ * {@link accumulateOpenAIStream}, which emits `text-delta` and tool-call
12
+ * `object-delta` events plus a final empty `finish`.
13
+ *
14
+ * Defence-in-depth: each tool-call `object-delta` is filtered against
15
+ * `input.tools` so a hallucinated function name never reaches the consumer.
16
+ */
17
+ export declare const OpenAI_ToolCalling_Stream: AiProviderRunFn<ToolCallingTaskInput, ToolCallingTaskOutput, OpenAiModelConfig>;
10
18
  //# sourceMappingURL=OpenAI_ToolCalling.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"OpenAI_ToolCalling.d.ts","sourceRoot":"","sources":["../../../src/ai/common/OpenAI_ToolCalling.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAGH,OAAO,KAAK,EACV,eAAe,EACf,kBAAkB,EAClB,oBAAoB,EACpB,qBAAqB,EACtB,MAAM,cAAc,CAAC;AAQtB,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,sBAAsB,CAAC;AAG9D,eAAO,MAAM,kBAAkB,EAAE,eAAe,CAC9C,oBAAoB,EACpB,qBAAqB,EACrB,iBAAiB,CA2BlB,CAAC;AAEF,eAAO,MAAM,yBAAyB,EAAE,kBAAkB,CACxD,oBAAoB,EACpB,qBAAqB,EACrB,iBAAiB,CAuBlB,CAAC"}
1
+ {"version":3,"file":"OpenAI_ToolCalling.d.ts","sourceRoot":"","sources":["../../../src/ai/common/OpenAI_ToolCalling.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAGH,OAAO,KAAK,EACV,eAAe,EAEf,oBAAoB,EACpB,qBAAqB,EACtB,MAAM,cAAc,CAAC;AAMtB,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,sBAAsB,CAAC;AAG9D;;;;;;;;GAQG;AACH,eAAO,MAAM,yBAAyB,EAAE,eAAe,CACrD,oBAAoB,EACpB,qBAAqB,EACrB,iBAAiB,CAgClB,CAAC"}