octaflow 0.28.0 → 0.29.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,7 +1,7 @@
1
1
  import { A as TypedStep, H as RetryPolicy, M as TypedWorkflow, f as Decider, j as TypedStepContext, vt as FlowErrorShape, yt as Result } from "../index-B8SvtiYn.js";
2
2
  import { n as Logger } from "../logger-BCus3AOa.js";
3
3
  import { i as BuildStepContextArgs, o as WorkflowHooks } from "../hooks-BV-Vany9.js";
4
- import { C as isSubprocessorResidency, S as embeddingDimensionsFor, _ as EmbeddingProviderMeta, a as AiProcessingRegion, b as OpenAiCompatibleProviderId, c as AiProviderModelOption, d as AiVendorResidency, f as DEFAULT_AI_PROVIDER, g as EmbeddingProviderId, h as EMBEDDING_PROVIDER_IDS, i as AiEndpointResidency, l as AiResidencyError, m as EMBEDDING_PROVIDERS, n as AI_PROVIDER_IDS, o as AiProviderId, p as DEFAULT_EMBEDDING_PROVIDER, r as AiEndpointRegion, s as AiProviderMeta, t as AI_PROVIDERS, u as AiResidencyResult, v as OPENAI_COMPATIBLE_PROVIDER, w as resolveEndpointResidency, x as OpenAiCompatibleProviderMeta, y as OPENAI_COMPATIBLE_PROVIDER_ID } from "../provider-registry-BvXBqJDR.js";
4
+ import { C as isSubprocessorResidency, S as embeddingDimensionsFor, _ as EmbeddingProviderMeta, a as AiProcessingRegion, b as OpenAiCompatibleProviderId, c as AiProviderModelOption, d as AiVendorResidency, f as DEFAULT_AI_PROVIDER, g as EmbeddingProviderId, h as EMBEDDING_PROVIDER_IDS, i as AiEndpointResidency, l as AiResidencyError, m as EMBEDDING_PROVIDERS, n as AI_PROVIDER_IDS, o as AiProviderId, p as DEFAULT_EMBEDDING_PROVIDER, r as AiEndpointRegion, s as AiProviderMeta, t as AI_PROVIDERS, u as AiResidencyResult, v as OPENAI_COMPATIBLE_PROVIDER, w as resolveEndpointResidency, x as OpenAiCompatibleProviderMeta, y as OPENAI_COMPATIBLE_PROVIDER_ID } from "../provider-registry-C_mOfdHH.js";
5
5
  import { z } from "zod";
6
6
  import { EmbeddingModelV4, LanguageModelV4, SharedV4ProviderMetadata } from "@ai-sdk/provider";
7
7
  //#region src/ai/instrumented-model.d.ts
@@ -73,8 +73,8 @@ export interface TokenUsage {
73
73
  cacheWriteTokens: number;
74
74
  }
75
75
  /**
76
- * Default pricing, USD per million tokens — Anthropic as of 2026-09, Mistral and
77
- * the OpenAI embeddings as of 2026-08. A best-effort estimate, not a billing
76
+ * Default pricing, USD per million tokens — Anthropic as of 2026-10, Mistral and
77
+ * the OpenAI embeddings as of 2026-08, the OpenAI language models as of 2026-10. A best-effort estimate, not a billing
78
78
  * record: a BYOK caller can name any model id, and an unknown id prices at the
79
79
  * priciest row (safe overcounting — see {@link createCostEstimator}). Retired ids
80
80
  * are kept rather than deleted: dropping one silently reprices every historical
@@ -507,7 +507,8 @@ export declare function createRefusalAwareModel(model: LanguageModelV4): Languag
507
507
  /**
508
508
  * Per-model API capability switches.
509
509
  *
510
- * Claude 4.6+ models (Opus 4.6/4.7/4.8/5, Sonnet 4.6/5, Fable/Mythos 5) use
510
+ * Claude 4.6+ models (Opus 4.6/4.7/4.8/5/5.5, Sonnet 4.6/5/5.5, Haiku 5.5,
511
+ * Fable/Mythos 5) use
511
512
  * adaptive thinking; on 4.7+ the legacy `thinking: { type: 'enabled',
512
513
  * budget_tokens }` shape and non-default sampling params (`temperature`,
513
514
  * `top_p`, `top_k`) are rejected with a 400. Older models (Haiku 4.5,
@@ -519,7 +520,7 @@ export declare function createRefusalAwareModel(model: LanguageModelV4): Languag
519
520
  * functions are that branch, written once. `providerId` is a plain string:
520
521
  * only `'anthropic'` has provider-specific shapes today.
521
522
  */
522
- /** True for Claude 4.6+ / 5-family models: adaptive thinking, no budgetTokens, no sampling params. */
523
+ /** True for Claude 4.6+ / 5-family models (`claude-opus-5` covers `claude-opus-5-5`, and so on): adaptive thinking, no budgetTokens, no sampling params. */
523
524
  export declare function supportsAdaptiveThinking(modelId: string): boolean;
524
525
  export interface AnthropicThinkingSettings {
525
526
  temperature?: number;
package/dist/ai/index.js CHANGED
@@ -1,6 +1,6 @@
1
1
  import { D as ok, E as err, T as noopLogger, _ as defineStep, m as buildWorkflow } from "../core-C9h3-KFr.js";
2
2
  import { a as readRefusalDetails, i as isAiRefusalError, n as REFUSAL_FINISH_REASON, r as createRefusalAwareModel, t as AiRefusalError } from "../refusal-BsL2HPDb.js";
3
- import { a as EMBEDDING_PROVIDERS, c as OPENAI_COMPATIBLE_PROVIDER_ID, d as resolveEndpointResidency, i as DEFAULT_EMBEDDING_PROVIDER, l as embeddingDimensionsFor, n as AI_PROVIDER_IDS, o as EMBEDDING_PROVIDER_IDS, r as DEFAULT_AI_PROVIDER, s as OPENAI_COMPATIBLE_PROVIDER, t as AI_PROVIDERS, u as isSubprocessorResidency } from "../provider-registry-BRwjC6_3.js";
3
+ import { a as EMBEDDING_PROVIDERS, c as OPENAI_COMPATIBLE_PROVIDER_ID, d as resolveEndpointResidency, i as DEFAULT_EMBEDDING_PROVIDER, l as embeddingDimensionsFor, n as AI_PROVIDER_IDS, o as EMBEDDING_PROVIDER_IDS, r as DEFAULT_AI_PROVIDER, s as OPENAI_COMPATIBLE_PROVIDER, t as AI_PROVIDERS, u as isSubprocessorResidency } from "../provider-registry-B91lgOmu.js";
4
4
  import { z } from "zod";
5
5
  import { Output, generateText, wrapEmbeddingModel, wrapLanguageModel } from "ai";
6
6
  //#region src/ai/instrumented-model.ts
@@ -125,8 +125,8 @@ function createInstrumentedEmbeddingModel(model, accumulator) {
125
125
  //#endregion
126
126
  //#region src/ai/cost.ts
127
127
  /**
128
- * Default pricing, USD per million tokens — Anthropic as of 2026-09, Mistral and
129
- * the OpenAI embeddings as of 2026-08. A best-effort estimate, not a billing
128
+ * Default pricing, USD per million tokens — Anthropic as of 2026-10, Mistral and
129
+ * the OpenAI embeddings as of 2026-08, the OpenAI language models as of 2026-10. A best-effort estimate, not a billing
130
130
  * record: a BYOK caller can name any model id, and an unknown id prices at the
131
131
  * priciest row (safe overcounting — see {@link createCostEstimator}). Retired ids
132
132
  * are kept rather than deleted: dropping one silently reprices every historical
@@ -170,6 +170,12 @@ const DEFAULT_MODEL_PRICING = {
170
170
  cacheReadPerMillion: .25,
171
171
  cacheWritePerMillion: 12.5
172
172
  },
173
+ "claude-opus-5-5": {
174
+ inputPerMillion: 4,
175
+ outputPerMillion: 20,
176
+ cacheReadPerMillion: .2,
177
+ cacheWritePerMillion: 5
178
+ },
173
179
  "claude-opus-5": {
174
180
  inputPerMillion: 5,
175
181
  outputPerMillion: 25,
@@ -182,6 +188,18 @@ const DEFAULT_MODEL_PRICING = {
182
188
  cacheReadPerMillion: .2,
183
189
  cacheWritePerMillion: 2.5
184
190
  },
191
+ "claude-sonnet-5-5": {
192
+ inputPerMillion: 2,
193
+ outputPerMillion: 10,
194
+ cacheReadPerMillion: .2,
195
+ cacheWritePerMillion: 2.5
196
+ },
197
+ "claude-haiku-5-5": {
198
+ inputPerMillion: .1,
199
+ outputPerMillion: .5,
200
+ cacheReadPerMillion: .01,
201
+ cacheWritePerMillion: .125
202
+ },
185
203
  "claude-opus-4-8": {
186
204
  inputPerMillion: 5,
187
205
  outputPerMillion: 25,
@@ -265,6 +283,30 @@ const DEFAULT_MODEL_PRICING = {
265
283
  outputPerMillion: 0,
266
284
  cacheReadPerMillion: 0,
267
285
  cacheWritePerMillion: 0
286
+ },
287
+ "gpt-6-astra": {
288
+ inputPerMillion: 10,
289
+ outputPerMillion: 50,
290
+ cacheReadPerMillion: 1,
291
+ cacheWritePerMillion: 12.5
292
+ },
293
+ "gpt-6.1-sol": {
294
+ inputPerMillion: 2,
295
+ outputPerMillion: 10,
296
+ cacheReadPerMillion: .1,
297
+ cacheWritePerMillion: 2.5
298
+ },
299
+ "gpt-6-sol": {
300
+ inputPerMillion: 2,
301
+ outputPerMillion: 10,
302
+ cacheReadPerMillion: .2,
303
+ cacheWritePerMillion: 2.5
304
+ },
305
+ "gpt-6-luna": {
306
+ inputPerMillion: .1,
307
+ outputPerMillion: .5,
308
+ cacheReadPerMillion: .01,
309
+ cacheWritePerMillion: .125
268
310
  }
269
311
  };
270
312
  /**
@@ -627,7 +669,8 @@ function createAiUsageAggregationService(deps) {
627
669
  /**
628
670
  * Per-model API capability switches.
629
671
  *
630
- * Claude 4.6+ models (Opus 4.6/4.7/4.8/5, Sonnet 4.6/5, Fable/Mythos 5) use
672
+ * Claude 4.6+ models (Opus 4.6/4.7/4.8/5/5.5, Sonnet 4.6/5/5.5, Haiku 5.5,
673
+ * Fable/Mythos 5) use
631
674
  * adaptive thinking; on 4.7+ the legacy `thinking: { type: 'enabled',
632
675
  * budget_tokens }` shape and non-default sampling params (`temperature`,
633
676
  * `top_p`, `top_k`) are rejected with a 400. Older models (Haiku 4.5,
@@ -647,9 +690,10 @@ const ADAPTIVE_THINKING_MODEL_PREFIXES = [
647
690
  "claude-opus-4-7",
648
691
  "claude-opus-4-6",
649
692
  "claude-sonnet-5",
650
- "claude-sonnet-4-6"
693
+ "claude-sonnet-4-6",
694
+ "claude-haiku-5"
651
695
  ];
652
- /** True for Claude 4.6+ / 5-family models: adaptive thinking, no budgetTokens, no sampling params. */
696
+ /** True for Claude 4.6+ / 5-family models (`claude-opus-5` covers `claude-opus-5-5`, and so on): adaptive thinking, no budgetTokens, no sampling params. */
653
697
  function supportsAdaptiveThinking(modelId) {
654
698
  return ADAPTIVE_THINKING_MODEL_PREFIXES.some((prefix) => modelId.startsWith(prefix));
655
699
  }
@@ -1,4 +1,4 @@
1
- import { b as OpenAiCompatibleProviderId, g as EmbeddingProviderId, i as AiEndpointResidency, o as AiProviderId } from "../../provider-registry-BvXBqJDR.js";
1
+ import { b as OpenAiCompatibleProviderId, g as EmbeddingProviderId, i as AiEndpointResidency, o as AiProviderId } from "../../provider-registry-C_mOfdHH.js";
2
2
  import { EmbeddingModelV4, LanguageModelV4 } from "@ai-sdk/provider";
3
3
  //#region src/ai/providers/index.d.ts
4
4
  export type LanguageModelFactory = (modelId: string) => LanguageModelV4;
@@ -1,5 +1,5 @@
1
1
  import { r as createRefusalAwareModel } from "../../refusal-BsL2HPDb.js";
2
- import { a as EMBEDDING_PROVIDERS, c as OPENAI_COMPATIBLE_PROVIDER_ID, d as resolveEndpointResidency, t as AI_PROVIDERS } from "../../provider-registry-BRwjC6_3.js";
2
+ import { a as EMBEDDING_PROVIDERS, c as OPENAI_COMPATIBLE_PROVIDER_ID, d as resolveEndpointResidency, t as AI_PROVIDERS } from "../../provider-registry-B91lgOmu.js";
3
3
  import { wrapLanguageModel } from "ai";
4
4
  //#region src/ai/providers/index.ts
5
5
  const LLM_LOADERS = {
@@ -16,6 +16,13 @@ const LLM_LOADERS = {
16
16
  apiKey,
17
17
  baseURL
18
18
  });
19
+ },
20
+ openai: async (apiKey, baseURL) => {
21
+ const { createOpenAI } = await import("@ai-sdk/openai");
22
+ return createOpenAI({
23
+ apiKey,
24
+ baseURL
25
+ });
19
26
  }
20
27
  };
21
28
  const EMBEDDING_LOADERS = {
@@ -1,2 +1,2 @@
1
- import { C as isSubprocessorResidency, S as embeddingDimensionsFor, _ as EmbeddingProviderMeta, a as AiProcessingRegion, b as OpenAiCompatibleProviderId, c as AiProviderModelOption, d as AiVendorResidency, f as DEFAULT_AI_PROVIDER, g as EmbeddingProviderId, h as EMBEDDING_PROVIDER_IDS, i as AiEndpointResidency, l as AiResidencyError, m as EMBEDDING_PROVIDERS, n as AI_PROVIDER_IDS, o as AiProviderId, p as DEFAULT_EMBEDDING_PROVIDER, r as AiEndpointRegion, s as AiProviderMeta, t as AI_PROVIDERS, u as AiResidencyResult, v as OPENAI_COMPATIBLE_PROVIDER, w as resolveEndpointResidency, x as OpenAiCompatibleProviderMeta, y as OPENAI_COMPATIBLE_PROVIDER_ID } from "../provider-registry-BvXBqJDR.js";
1
+ import { C as isSubprocessorResidency, S as embeddingDimensionsFor, _ as EmbeddingProviderMeta, a as AiProcessingRegion, b as OpenAiCompatibleProviderId, c as AiProviderModelOption, d as AiVendorResidency, f as DEFAULT_AI_PROVIDER, g as EmbeddingProviderId, h as EMBEDDING_PROVIDER_IDS, i as AiEndpointResidency, l as AiResidencyError, m as EMBEDDING_PROVIDERS, n as AI_PROVIDER_IDS, o as AiProviderId, p as DEFAULT_EMBEDDING_PROVIDER, r as AiEndpointRegion, s as AiProviderMeta, t as AI_PROVIDERS, u as AiResidencyResult, v as OPENAI_COMPATIBLE_PROVIDER, w as resolveEndpointResidency, x as OpenAiCompatibleProviderMeta, y as OPENAI_COMPATIBLE_PROVIDER_ID } from "../provider-registry-C_mOfdHH.js";
2
2
  export { AI_PROVIDERS, AI_PROVIDER_IDS, AiEndpointRegion, AiEndpointResidency, AiProcessingRegion, AiProviderId, AiProviderMeta, AiProviderModelOption, AiResidencyError, AiResidencyResult, AiVendorResidency, DEFAULT_AI_PROVIDER, DEFAULT_EMBEDDING_PROVIDER, EMBEDDING_PROVIDERS, EMBEDDING_PROVIDER_IDS, EmbeddingProviderId, EmbeddingProviderMeta, OPENAI_COMPATIBLE_PROVIDER, OPENAI_COMPATIBLE_PROVIDER_ID, OpenAiCompatibleProviderId, OpenAiCompatibleProviderMeta, embeddingDimensionsFor, isSubprocessorResidency, resolveEndpointResidency };
@@ -1,2 +1,2 @@
1
- import { a as EMBEDDING_PROVIDERS, c as OPENAI_COMPATIBLE_PROVIDER_ID, d as resolveEndpointResidency, i as DEFAULT_EMBEDDING_PROVIDER, l as embeddingDimensionsFor, n as AI_PROVIDER_IDS, o as EMBEDDING_PROVIDER_IDS, r as DEFAULT_AI_PROVIDER, s as OPENAI_COMPATIBLE_PROVIDER, t as AI_PROVIDERS, u as isSubprocessorResidency } from "../provider-registry-BRwjC6_3.js";
1
+ import { a as EMBEDDING_PROVIDERS, c as OPENAI_COMPATIBLE_PROVIDER_ID, d as resolveEndpointResidency, i as DEFAULT_EMBEDDING_PROVIDER, l as embeddingDimensionsFor, n as AI_PROVIDER_IDS, o as EMBEDDING_PROVIDER_IDS, r as DEFAULT_AI_PROVIDER, s as OPENAI_COMPATIBLE_PROVIDER, t as AI_PROVIDERS, u as isSubprocessorResidency } from "../provider-registry-B91lgOmu.js";
2
2
  export { AI_PROVIDERS, AI_PROVIDER_IDS, DEFAULT_AI_PROVIDER, DEFAULT_EMBEDDING_PROVIDER, EMBEDDING_PROVIDERS, EMBEDDING_PROVIDER_IDS, OPENAI_COMPATIBLE_PROVIDER, OPENAI_COMPATIBLE_PROVIDER_ID, embeddingDimensionsFor, isSubprocessorResidency, resolveEndpointResidency };
@@ -9,7 +9,11 @@
9
9
  * Adding a provider: an id here with its metadata, a factory in
10
10
  * `providers/`, and pricing rows in `cost.ts`.
11
11
  */
12
- const AI_PROVIDER_IDS = ["anthropic", "mistral"];
12
+ const AI_PROVIDER_IDS = [
13
+ "anthropic",
14
+ "mistral",
15
+ "openai"
16
+ ];
13
17
  const EMBEDDING_PROVIDER_IDS = ["openai", "mistral"];
14
18
  /**
15
19
  * What an unset provider resolves to: the EU-established vendor, so a deployment
@@ -29,27 +33,31 @@ const AI_PROVIDERS = {
29
33
  legalName: "Anthropic PBC",
30
34
  country: "US"
31
35
  },
32
- defaultModel: "claude-sonnet-5",
33
- classifierModel: "claude-haiku-4-5",
34
- testModel: "claude-haiku-4-5",
36
+ defaultModel: "claude-sonnet-5-5",
37
+ classifierModel: "claude-haiku-5-5",
38
+ testModel: "claude-haiku-5-5",
35
39
  keyPrefix: "sk-ant-",
36
40
  consoleKeyUrl: "https://console.anthropic.com/settings/keys",
37
41
  modelOptions: [
38
42
  {
39
- label: "Claude Opus 5",
40
- value: "claude-opus-5"
43
+ label: "Claude Opus 5.5",
44
+ value: "claude-opus-5-5"
41
45
  },
42
46
  {
43
- label: "Claude Opus 4.8",
44
- value: "claude-opus-4-8"
47
+ label: "Claude Sonnet 5.5",
48
+ value: "claude-sonnet-5-5"
45
49
  },
46
50
  {
47
- label: "Claude Sonnet 5",
48
- value: "claude-sonnet-5"
51
+ label: "Claude Haiku 5.5",
52
+ value: "claude-haiku-5-5"
53
+ },
54
+ {
55
+ label: "Claude Opus 5",
56
+ value: "claude-opus-5"
49
57
  },
50
58
  {
51
- label: "Claude Haiku 4.5",
52
- value: "claude-haiku-4-5"
59
+ label: "Claude Sonnet 5",
60
+ value: "claude-sonnet-5"
53
61
  }
54
62
  ]
55
63
  },
@@ -80,6 +88,34 @@ const AI_PROVIDERS = {
80
88
  value: "mistral-small-latest"
81
89
  }
82
90
  ]
91
+ },
92
+ openai: {
93
+ id: "openai",
94
+ label: "OpenAI",
95
+ residency: {
96
+ region: "third-country",
97
+ legalName: "OpenAI, L.L.C.",
98
+ country: "US"
99
+ },
100
+ defaultModel: "gpt-6.1-sol",
101
+ classifierModel: "gpt-6-luna",
102
+ testModel: "gpt-6-luna",
103
+ keyPrefix: "sk-",
104
+ consoleKeyUrl: "https://platform.openai.com/api-keys",
105
+ modelOptions: [
106
+ {
107
+ label: "GPT-6 Astra",
108
+ value: "gpt-6-astra"
109
+ },
110
+ {
111
+ label: "GPT-6.1 Sol",
112
+ value: "gpt-6.1-sol"
113
+ },
114
+ {
115
+ label: "GPT-6 Luna",
116
+ value: "gpt-6-luna"
117
+ }
118
+ ]
83
119
  }
84
120
  };
85
121
  const EMBEDDING_PROVIDERS = {
@@ -9,7 +9,7 @@
9
9
  * Adding a provider: an id here with its metadata, a factory in
10
10
  * `providers/`, and pricing rows in `cost.ts`.
11
11
  */
12
- declare const AI_PROVIDER_IDS: readonly ['anthropic', 'mistral'];
12
+ declare const AI_PROVIDER_IDS: readonly ['anthropic', 'mistral', 'openai'];
13
13
  type AiProviderId = (typeof AI_PROVIDER_IDS)[number];
14
14
  declare const EMBEDDING_PROVIDER_IDS: readonly ['openai', 'mistral'];
15
15
  type EmbeddingProviderId = (typeof EMBEDDING_PROVIDER_IDS)[number];
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "octaflow",
3
- "version": "0.28.0",
3
+ "version": "0.29.0",
4
4
  "description": "Durable DAG workflow engine: Zod-typed steps over Postgres + pg-boss, with an optional AI add-on (token/cost/quota). Layered single package.",
5
5
  "license": "MIT",
6
6
  "type": "module",
@@ -116,18 +116,18 @@
116
116
  }
117
117
  },
118
118
  "devDependencies": {
119
- "@ai-sdk/anthropic": "^4.0.71",
120
- "@ai-sdk/mistral": "^4.0.56",
121
- "@ai-sdk/openai": "^4.0.83",
122
- "@ai-sdk/openai-compatible": "^3.0.62",
123
- "@ai-sdk/provider": "^4.0.21",
119
+ "@ai-sdk/anthropic": "^4.0.74",
120
+ "@ai-sdk/mistral": "^4.0.59",
121
+ "@ai-sdk/openai": "^4.0.86",
122
+ "@ai-sdk/openai-compatible": "^3.0.65",
123
+ "@ai-sdk/provider": "^4.0.24",
124
124
  "@testcontainers/postgresql": "^12.2.0",
125
125
  "@types/node": "^26.6.4",
126
126
  "@types/pg": "^8.23.1",
127
- "ai": "^7.0.127",
127
+ "ai": "^7.0.130",
128
128
  "drizzle-orm": "^0.45.3",
129
129
  "pg": "^8.23.1",
130
- "pg-boss": "^12.35.1",
130
+ "pg-boss": "^12.37.0",
131
131
  "testcontainers": "^12.2.0",
132
132
  "tsdown": "^0.23.0",
133
133
  "typescript": "^7.0.2",