@adaptic/lumic-utils 1.0.29 → 1.0.31
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{apollo-client.client-C1dwHT2X.js → apollo-client.client-CNrz3Xod.js} +3 -3
- package/dist/{apollo-client.client-C1dwHT2X.js.map → apollo-client.client-CNrz3Xod.js.map} +1 -1
- package/dist/{apollo-client.client-BQLzKbg9.js → apollo-client.client-DsFSBlst.js} +4 -4
- package/dist/{apollo-client.client-BQLzKbg9.js.map → apollo-client.client-DsFSBlst.js.map} +1 -1
- package/dist/{apollo-client.server-DoI6FK_-.js → apollo-client.server-DMz8cEcx.js} +3 -3
- package/dist/{apollo-client.server-DoI6FK_-.js.map → apollo-client.server-DMz8cEcx.js.map} +1 -1
- package/dist/{apollo-client.server-Crk0lXFR.js → apollo-client.server-YkSyk6OJ.js} +3 -3
- package/dist/{apollo-client.server-Crk0lXFR.js.map → apollo-client.server-YkSyk6OJ.js.map} +1 -1
- package/dist/{index-CV8HlDp8.js → index-BZ9x9UfI.js} +37 -27
- package/dist/{index-CV8HlDp8.js.map → index-BZ9x9UfI.js.map} +1 -1
- package/dist/{index-DA066GXe.js → index-CGlW9JSL.js} +2 -2
- package/dist/{index-DA066GXe.js.map → index-CGlW9JSL.js.map} +1 -1
- package/dist/{index-CtY-7qjs.js → index-DlAW691N.js} +37 -27
- package/dist/{index-CtY-7qjs.js.map → index-DlAW691N.js.map} +1 -1
- package/dist/{index-IAFN9E4Q.js → index-VsQMFi2M.js} +2 -2
- package/dist/{index-IAFN9E4Q.js.map → index-VsQMFi2M.js.map} +1 -1
- package/dist/index.cjs +1 -1
- package/dist/index.mjs +1 -1
- package/dist/test.cjs +1 -1
- package/dist/test.mjs +1 -1
- package/dist/types/types/openai-types.d.ts +7 -5
- package/package.json +3 -3
|
@@ -2668,10 +2668,11 @@ function requiresResponsesApiForTools(model) {
|
|
|
2668
2668
|
}
|
|
2669
2669
|
/**
|
|
2670
2670
|
* OpenAI's `reasoning_effort` ladder, ordered from least to most effort. This is
|
|
2671
|
-
* the full 2026 ladder (developers.openai.com)
|
|
2671
|
+
* the full 2026 ladder (developers.openai.com), including `'max'` — the OpenAI
|
|
2672
|
+
* SDK v6 `Shared.ReasoningEffort` type accepts this entire set on the wire.
|
|
2672
2673
|
* Mirrors the widened {@link LLMOptions.reasoning_effort} union.
|
|
2673
2674
|
*/
|
|
2674
|
-
const REASONING_EFFORT_LADDER = ['none', 'minimal', 'low', 'medium', 'high', 'xhigh'];
|
|
2675
|
+
const REASONING_EFFORT_LADDER = ['none', 'minimal', 'low', 'medium', 'high', 'xhigh', 'max'];
|
|
2675
2676
|
/**
|
|
2676
2677
|
* Per-model `reasoning_effort` support window for OpenAI reasoning models,
|
|
2677
2678
|
* expressed on {@link REASONING_EFFORT_LADDER}. `min`/`max` are the lowest and
|
|
@@ -2698,27 +2699,19 @@ const MODEL_REASONING_EFFORT_SUPPORT = {
|
|
|
2698
2699
|
// o1-mini is intentionally omitted — it rejects reasoning_effort outright.
|
|
2699
2700
|
};
|
|
2700
2701
|
/**
|
|
2701
|
-
*
|
|
2702
|
-
* SDK
|
|
2703
|
-
*
|
|
2704
|
-
*
|
|
2705
|
-
*
|
|
2702
|
+
* Identity pass-through from a full-ladder effort level to an SDK-sendable value.
|
|
2703
|
+
* Under OpenAI SDK v6 the wire type ({@link SdkReasoningEffort}) spans the entire
|
|
2704
|
+
* ladder, so every level is sendable as-is; the per-model
|
|
2705
|
+
* {@link MODEL_REASONING_EFFORT_SUPPORT} window (applied in
|
|
2706
|
+
* {@link clampReasoningEffort}) is what keeps a request within a model's range.
|
|
2707
|
+
* Retained as a named seam so a future SDK narrowing has one obvious place to
|
|
2708
|
+
* re-introduce folding.
|
|
2706
2709
|
*
|
|
2707
2710
|
* @param level A level on {@link REASONING_EFFORT_LADDER}.
|
|
2708
|
-
* @returns The
|
|
2711
|
+
* @returns The same level, typed as SDK-sendable.
|
|
2709
2712
|
*/
|
|
2710
2713
|
function toSdkReasoningEffort(level) {
|
|
2711
|
-
|
|
2712
|
-
case 'none':
|
|
2713
|
-
case 'minimal':
|
|
2714
|
-
case 'low':
|
|
2715
|
-
return 'low';
|
|
2716
|
-
case 'medium':
|
|
2717
|
-
return 'medium';
|
|
2718
|
-
case 'high':
|
|
2719
|
-
case 'xhigh':
|
|
2720
|
-
return 'high';
|
|
2721
|
-
}
|
|
2714
|
+
return level;
|
|
2722
2715
|
}
|
|
2723
2716
|
/**
|
|
2724
2717
|
* Clamps a requested {@link LLMOptions.reasoning_effort} to a value the target
|
|
@@ -2965,7 +2958,10 @@ async function createCompletion(content, responseFormat, options = DEFAULT_OPTIO
|
|
|
2965
2958
|
const response = {
|
|
2966
2959
|
id: completion.id,
|
|
2967
2960
|
content: completion.choices[0]?.message?.content || '',
|
|
2968
|
-
|
|
2961
|
+
// OpenAI SDK v6 widened tool calls into a function/custom union; the engine
|
|
2962
|
+
// only emits + parses function calls, so narrow to the function variant to
|
|
2963
|
+
// preserve the byte-identical `{ id, type, function }` shape.
|
|
2964
|
+
tool_calls: completion.choices[0]?.message?.tool_calls?.filter((tc) => tc.type === 'function'),
|
|
2969
2965
|
usage: {
|
|
2970
2966
|
prompt_tokens: completion.usage?.prompt_tokens ?? 0,
|
|
2971
2967
|
completion_tokens: completion.usage?.completion_tokens ?? 0,
|
|
@@ -8900,7 +8896,12 @@ const isRetryableAnthropicError = (error) => {
|
|
|
8900
8896
|
* Anthropic: { name, description, input_schema }
|
|
8901
8897
|
*/
|
|
8902
8898
|
function translateToolsToAnthropic(tools) {
|
|
8903
|
-
|
|
8899
|
+
// OpenAI SDK v6 widened `ChatCompletionTool` into a function/custom union.
|
|
8900
|
+
// lumic-utils only supports function tools, so narrow to the function variant
|
|
8901
|
+
// before reading `.function`. Custom tools (which lumic never emits) are skipped.
|
|
8902
|
+
return tools
|
|
8903
|
+
.filter((tool) => tool.type === 'function')
|
|
8904
|
+
.map((tool) => ({
|
|
8904
8905
|
name: tool.function.name,
|
|
8905
8906
|
description: tool.function.description || '',
|
|
8906
8907
|
input_schema: (tool.function.parameters || { type: 'object', properties: {} }),
|
|
@@ -9294,8 +9295,11 @@ async function makeOpenAICompatibleCall(content, responseFormat = 'text', option
|
|
|
9294
9295
|
const completionTokens = completion.usage?.completion_tokens || 0;
|
|
9295
9296
|
// Track cost
|
|
9296
9297
|
getLLMCostTracker().trackUsage(providerConfig.name, model, promptTokens, completionTokens);
|
|
9297
|
-
// Handle tool calls
|
|
9298
|
-
|
|
9298
|
+
// Handle tool calls. OpenAI SDK v6 widened tool calls into a function/custom
|
|
9299
|
+
// union; these OpenAI-compatible providers only return function calls, so
|
|
9300
|
+
// narrow to the function variant to preserve the byte-identical
|
|
9301
|
+
// `function.{name,arguments}` shape the engine parses.
|
|
9302
|
+
const toolCalls = completion.choices[0]?.message?.tool_calls?.filter((tc) => tc.type === 'function');
|
|
9299
9303
|
if (toolCalls && toolCalls.length > 0) {
|
|
9300
9304
|
const toolCallResponse = {
|
|
9301
9305
|
tool_calls: toolCalls.map((tc) => ({
|
|
@@ -9844,7 +9848,13 @@ const makeDeepseekCall = async (content, responseFormat = 'json', options = {})
|
|
|
9844
9848
|
// Handle tool calls similarly to OpenAI
|
|
9845
9849
|
if (completion.tool_calls && completion.tool_calls.length > 0) {
|
|
9846
9850
|
const toolCallResponse = {
|
|
9847
|
-
|
|
9851
|
+
// OpenAI SDK v6 widened tool calls into a function/custom union. DeepSeek
|
|
9852
|
+
// (called via the OpenAI-compatible surface) only returns function calls,
|
|
9853
|
+
// so narrow to the function variant to preserve the byte-identical
|
|
9854
|
+
// `function.{name,arguments}` shape.
|
|
9855
|
+
tool_calls: completion.tool_calls
|
|
9856
|
+
.filter((tc) => tc.type === 'function')
|
|
9857
|
+
.map((tc) => ({
|
|
9848
9858
|
id: tc.id,
|
|
9849
9859
|
name: tc.function.name,
|
|
9850
9860
|
arguments: JSON.parse(tc.function.arguments),
|
|
@@ -23798,11 +23808,11 @@ let poolConfig = DEFAULT_POOL_CONFIG;
|
|
|
23798
23808
|
async function loadApolloModules() {
|
|
23799
23809
|
if (typeof window === "undefined" || process.env.AWS_EXECUTION_ENV) {
|
|
23800
23810
|
// Server-side (or Lambda): load the CommonJS‑based implementation.
|
|
23801
|
-
return (await import('./apollo-client.server-
|
|
23811
|
+
return (await import('./apollo-client.server-YkSyk6OJ.js'));
|
|
23802
23812
|
}
|
|
23803
23813
|
else {
|
|
23804
23814
|
// Client-side: load the ESM‑based implementation.
|
|
23805
|
-
return (await import('./apollo-client.client-
|
|
23815
|
+
return (await import('./apollo-client.client-DsFSBlst.js'));
|
|
23806
23816
|
}
|
|
23807
23817
|
}
|
|
23808
23818
|
/**
|
|
@@ -82408,4 +82418,4 @@ const lumic = {
|
|
|
82408
82418
|
};
|
|
82409
82419
|
|
|
82410
82420
|
export { GraphQLInterfaceType as $, print as A, getNamedType as B, isInputType as C, isRequiredArgument as D, isNamedType as E, GraphQLError as F, GraphQLNonNull as G, isOutputType as H, isRequiredInputField as I, isCompositeType as J, Kind as K, getNullableType as L, getEnterLeaveForKind as M, isNode as N, OperationTypeNode as O, didYouMean as P, naturalCompare as Q, suggestionList as R, specifiedScalarTypes as S, keyMap as T, isType as U, isNullableType as V, visit as W, visitInParallel as X, keyValMap as Y, assertObjectType as Z, GraphQLScalarType as _, isListType as a, validateGoogleSheetsRange as a$, GraphQLUnionType as a0, GraphQLInputObjectType as a1, assertNullableType as a2, assertInterfaceType as a3, mapValue as a4, isSpecifiedScalarType as a5, isPrintableAsBlockString as a6, printBlockString as a7, BREAK as a8, GRAPHQL_MAX_INT as a9, printSourceLocation as aA, resolveObjMapThunk as aB, resolveReadonlyArrayThunk as aC, valueFromASTUntyped as aD, version$4 as aE, versionInfo as aF, getAugmentedNamespace as aG, isDigit$1 as aH, isNameStart as aI, dedentBlockStringLines as aJ, isNameContinue as aK, setLumicLogger as aL, getLumicLogger as aM, sanitizeForLog as aN, sanitizeError as aO, sanitizeAWSAuth as aP, sanitizeObject as aQ, getSecrets as aR, resetSecrets as aS, requireSecret as aT, withRetry as aU, CircuitBreaker as aV, CircuitBreakerState as aW, CircuitBreakerOpenError as aX, DEFAULT_CIRCUIT_BREAKER_CONFIG as aY, validateSlackChannel as aZ, validateS3Key as a_, GRAPHQL_MIN_INT as aa, GraphQLFloat as ab, GraphQLInt as ac, Location as ad, Token as ae, assertAbstractType as af, assertCompositeType as ag, assertEnumType as ah, assertEnumValueName as ai, assertInputObjectType as aj, assertInputType as ak, assertLeafType as al, assertListType as am, assertNamedType as an, assertNonNullType as ao, assertOutputType as ap, assertScalarType as aq, assertType as ar, assertUnionType as as, assertWrappingType as at, formatError as au, getLocation as av, getVisitFn as aw, isWrappingType as ax, printError as ay, printLocation as az, isAbstractType as b, PerplexityError as b$, LLMCostTracker as b0, getLLMCostTracker as b1, setLLMCostTracker as b2, resetLLMCostTracker as b3, setMetricsCollector as b4, getMetricsCollector as b5, resetMetricsCollector as b6, withMetrics as b7, generateCorrelationId as b8, getCorrelationId as b9, makeAnthropicCall as bA, makeOpenAICompatibleCall as bB, openAIChatCompletionSchema as bC, openAIImageResponseSchema as bD, validateOpenAIChatCompletion as bE, safeValidateOpenAIChatCompletion as bF, perplexityResponseSchema as bG, validatePerplexityResponse as bH, safeValidatePerplexityResponse as bI, googleSheetsValueRangeSchema as bJ, validateGoogleSheetsResponse as bK, safeValidateGoogleSheetsResponse as bL, s3ListObjectsSchema as bM, s3GetObjectSchema as bN, lambdaInvokeResponseSchema as bO, validateS3ListObjects as bP, safeValidateS3ListObjects as bQ, validateLambdaResponse as bR, safeValidateLambdaResponse as bS, createValidator as bT, createSafeValidator as bU, LumicError as bV, SlackError as bW, LLMError as bX, AWSLambdaError as bY, AWSS3Error as bZ, GoogleSheetsError as b_, getCorrelationContext as ba, withCorrelationId as bb, getCorrelationHeaders as bc, TokenBucketRateLimiter as bd, RATE_LIMIT_PROFILES as be, getRateLimiter as bf, resetAllRateLimiters as bg, withRateLimit as bh, checkIntegrationHealth as bi, SUPPORTED_MODELS as bj, isValidModel as bk, getModelCapabilities as bl, getModelProvider as bm, MODEL_ALIASES as bn, OPENAI_COMPATIBLE_PROVIDERS as bo, PROVIDER_DEFAULT_MODELS as bp, LLM_DEFAULT_PROVIDER as bq, LLM_MINI_PROVIDER as br, LLM_NORMAL_PROVIDER as bs, LLM_ADVANCED_PROVIDER as bt, LLM_CRITICAL_PROVIDER as bu, LLM_PROVIDER as bv, LLM_MODEL_MINI as bw, LLM_MODEL_NORMAL as bx, LLM_MODEL_ADVANCED as by, LLM_MODEL_CRITICAL as bz, isInterfaceType as c, JsonParseError as c0, PDFError as c1, ZipError as c2, SLACK_TIMEOUT_MS as c3, PERPLEXITY_TIMEOUT_MS as c4, GOOGLE_SHEETS_TIMEOUT_MS as c5, LLM_TIMEOUT_MS as c6, AWS_LAMBDA_TIMEOUT_MS as c7, AWS_S3_TIMEOUT_MS as c8, OPENWEATHER_TIMEOUT_MS as c9, GENERIC_FETCH_TIMEOUT_MS as ca, isObjectType as d, assertName as e, devAssert as f, isObjectLike as g, defineArguments as h, isNonNullType as i, argsToArgsConfig as j, GraphQLBoolean as k, lumic as l, GraphQLString as m, instanceOf as n, inspect as o, isInputObjectType as p, isLeafType as q, isEnumType as r, GraphQLID as s, toObjMap as t, invariant as u, GraphQLObjectType as v, GraphQLEnumType as w, GraphQLList as x, isScalarType as y, isUnionType as z };
|
|
82411
|
-
//# sourceMappingURL=index-
|
|
82421
|
+
//# sourceMappingURL=index-BZ9x9UfI.js.map
|