@adaptic/lumic-utils 1.0.25 → 1.0.27
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-D6jG5B1n.js → apollo-client.client-DD13VF_T.js} +3 -3
- package/dist/{apollo-client.client-D6jG5B1n.js.map → apollo-client.client-DD13VF_T.js.map} +1 -1
- package/dist/{apollo-client.client-DLW-p46Y.js → apollo-client.client-eo-xgmdi.js} +4 -4
- package/dist/{apollo-client.client-DLW-p46Y.js.map → apollo-client.client-eo-xgmdi.js.map} +1 -1
- package/dist/{apollo-client.server-Cx30LaNh.js → apollo-client.server-2zi9dbLa.js} +3 -3
- package/dist/{apollo-client.server-Cx30LaNh.js.map → apollo-client.server-2zi9dbLa.js.map} +1 -1
- package/dist/{apollo-client.server-CXLiLmSz.js → apollo-client.server-BxpJcsVI.js} +3 -3
- package/dist/{apollo-client.server-CXLiLmSz.js.map → apollo-client.server-BxpJcsVI.js.map} +1 -1
- package/dist/{index-CqnZ-XiI.js → index-BQ1buNZm.js} +2 -2
- package/dist/{index-CqnZ-XiI.js.map → index-BQ1buNZm.js.map} +1 -1
- package/dist/{index-Bvc61lYS.js → index-BbwdRyPk.js} +232 -84
- package/dist/{index-ChygDqeG.js.map → index-BbwdRyPk.js.map} +1 -1
- package/dist/{index-D2TPDKw0.js → index-CV0UmY0w.js} +2 -2
- package/dist/{index-D2TPDKw0.js.map → index-CV0UmY0w.js.map} +1 -1
- package/dist/{index-ChygDqeG.js → index-zDK1X6HR.js} +232 -84
- package/dist/{index-Bvc61lYS.js.map → index-zDK1X6HR.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/functions/llm-deepseek.d.ts +4 -0
- package/dist/types/types/openai-types.d.ts +37 -1
- package/package.json +1 -1
|
@@ -79,7 +79,38 @@ const OPENAI_COMPATIBLE_PROVIDERS = {
|
|
|
79
79
|
* Supported models with their capabilities
|
|
80
80
|
*/
|
|
81
81
|
const SUPPORTED_MODELS = {
|
|
82
|
-
// ── OpenAI GPT-5.
|
|
82
|
+
// ── OpenAI GPT-5.6 series (current flagship) ─────────────────────────
|
|
83
|
+
// sol / terra / luna are the 2026 flagship trio (developers.openai.com/
|
|
84
|
+
// api/docs/models/all). Same GPT-5.x API surface + the temperature
|
|
85
|
+
// constraint documented below.
|
|
86
|
+
'gpt-5.6-sol': {
|
|
87
|
+
provider: 'openai',
|
|
88
|
+
supportsTools: true,
|
|
89
|
+
supportsJson: true,
|
|
90
|
+
supportsStructuredOutput: true,
|
|
91
|
+
supportsDeveloperPrompt: true,
|
|
92
|
+
supportsTemperature: false,
|
|
93
|
+
isReasoningModel: false,
|
|
94
|
+
},
|
|
95
|
+
'gpt-5.6-terra': {
|
|
96
|
+
provider: 'openai',
|
|
97
|
+
supportsTools: true,
|
|
98
|
+
supportsJson: true,
|
|
99
|
+
supportsStructuredOutput: true,
|
|
100
|
+
supportsDeveloperPrompt: true,
|
|
101
|
+
supportsTemperature: false,
|
|
102
|
+
isReasoningModel: false,
|
|
103
|
+
},
|
|
104
|
+
'gpt-5.6-luna': {
|
|
105
|
+
provider: 'openai',
|
|
106
|
+
supportsTools: true,
|
|
107
|
+
supportsJson: true,
|
|
108
|
+
supportsStructuredOutput: true,
|
|
109
|
+
supportsDeveloperPrompt: true,
|
|
110
|
+
supportsTemperature: false,
|
|
111
|
+
isReasoningModel: false,
|
|
112
|
+
},
|
|
113
|
+
// ── OpenAI GPT-5.5 series ────────────────────────────────────────────
|
|
83
114
|
// GPT-5.x series: OpenAI's 2026 API constraint — only the default
|
|
84
115
|
// temperature value (1.0) is accepted. Passing any other value returns
|
|
85
116
|
// HTTP 400: "Unsupported value: 'temperature' does not support 0.2 with
|
|
@@ -134,6 +165,15 @@ const SUPPORTED_MODELS = {
|
|
|
134
165
|
supportsTemperature: false,
|
|
135
166
|
isReasoningModel: false,
|
|
136
167
|
},
|
|
168
|
+
'gpt-5.4-pro': {
|
|
169
|
+
provider: 'openai',
|
|
170
|
+
supportsTools: true,
|
|
171
|
+
supportsJson: true,
|
|
172
|
+
supportsStructuredOutput: true,
|
|
173
|
+
supportsDeveloperPrompt: true,
|
|
174
|
+
supportsTemperature: false,
|
|
175
|
+
isReasoningModel: false,
|
|
176
|
+
},
|
|
137
177
|
// ── OpenAI GPT-5 series ──────────────────────────────────────────────
|
|
138
178
|
'gpt-5': {
|
|
139
179
|
provider: 'openai',
|
|
@@ -554,7 +594,7 @@ function getModelProvider(model) {
|
|
|
554
594
|
* Default model tiers per provider for use with LLM_MODEL_MINI/NORMAL/ADVANCED env vars
|
|
555
595
|
*/
|
|
556
596
|
const PROVIDER_DEFAULT_MODELS = {
|
|
557
|
-
openai: { mini: 'gpt-5.4-nano', normal: 'gpt-5.4-mini', advanced: 'gpt-5.
|
|
597
|
+
openai: { mini: 'gpt-5.4-nano', normal: 'gpt-5.4-mini', advanced: 'gpt-5.6-sol' },
|
|
558
598
|
anthropic: { mini: 'claude-haiku-4-5', normal: 'claude-sonnet-4-6', advanced: 'claude-opus-4-7' },
|
|
559
599
|
deepseek: { mini: 'deepseek-v4-flash', normal: 'deepseek-v4-flash', advanced: 'deepseek-v4-pro' },
|
|
560
600
|
kimi: { mini: 'kimi-k2-0905-preview', normal: 'kimi-k2.5', advanced: 'kimi-k2.6' },
|
|
@@ -1628,8 +1668,17 @@ async function parseResponse(content, responseFormat, options = {}) {
|
|
|
1628
1668
|
getLumicLogger().info(`Code block for type ${detectedType} detected and removed. Cleaned content: ${cleanedContent}`);
|
|
1629
1669
|
}
|
|
1630
1670
|
}
|
|
1631
|
-
//
|
|
1632
|
-
//
|
|
1671
|
+
// Whether the cleaned content structurally resembles JSON. Used to gate the
|
|
1672
|
+
// lenient fixBrokenJson strategy, which will otherwise coerce arbitrary
|
|
1673
|
+
// prose into a bogus object/array.
|
|
1674
|
+
const inputResemblesJson = cleanedContent.startsWith('{') || cleanedContent.startsWith('[');
|
|
1675
|
+
// Multiple JSON parsing strategies.
|
|
1676
|
+
// Default pipeline: direct parse -> extract from brackets -> remove
|
|
1677
|
+
// leading/trailing text -> GATED fixBrokenJson -> FAIL. fixBrokenJson is
|
|
1678
|
+
// deliberately gated (Strategy 4): its output is accepted only when the
|
|
1679
|
+
// input looked like JSON AND the repaired value round-trips through
|
|
1680
|
+
// JSON.stringify/JSON.parse, so a "successful" repair of non-JSON text is
|
|
1681
|
+
// rejected instead of silently returned as garbage.
|
|
1633
1682
|
const jsonParsingStrategies = [
|
|
1634
1683
|
// Strategy 1: Direct parsing
|
|
1635
1684
|
() => {
|
|
@@ -1663,45 +1712,65 @@ async function parseResponse(content, responseFormat, options = {}) {
|
|
|
1663
1712
|
return null;
|
|
1664
1713
|
}
|
|
1665
1714
|
},
|
|
1666
|
-
// Strategy 4:
|
|
1715
|
+
// Strategy 4: Gated fixBrokenJson (string manipulation only, no AI)
|
|
1667
1716
|
() => {
|
|
1668
|
-
|
|
1717
|
+
if (!inputResemblesJson) {
|
|
1718
|
+
return null;
|
|
1719
|
+
}
|
|
1720
|
+
const fixed = fixBrokenJson(cleanedContent);
|
|
1721
|
+
if (fixed === null) {
|
|
1722
|
+
return null;
|
|
1723
|
+
}
|
|
1724
|
+
try {
|
|
1725
|
+
// Round-trip guard: ensures the repaired value is genuinely
|
|
1726
|
+
// JSON-serializable before we trust it.
|
|
1727
|
+
return JSON.parse(JSON.stringify(fixed));
|
|
1728
|
+
}
|
|
1729
|
+
catch {
|
|
1730
|
+
return null;
|
|
1731
|
+
}
|
|
1669
1732
|
},
|
|
1670
1733
|
];
|
|
1671
1734
|
// Try each parsing strategy
|
|
1672
1735
|
for (const strategy of jsonParsingStrategies) {
|
|
1673
|
-
const result =
|
|
1736
|
+
const result = strategy();
|
|
1674
1737
|
if (result !== null) {
|
|
1675
|
-
return result;
|
|
1738
|
+
return finalizeJsonResult(result, responseFormat);
|
|
1676
1739
|
}
|
|
1677
1740
|
}
|
|
1678
1741
|
// Strategy 5: Use AI fixing (only if explicitly enabled)
|
|
1679
1742
|
if (enableAiFix) {
|
|
1680
1743
|
getLumicLogger().warn('Using AI-powered JSON fixing. This adds cost and latency. Consider improving JSON generation instead.');
|
|
1744
|
+
let aiFixedJson = null;
|
|
1681
1745
|
try {
|
|
1682
|
-
|
|
1683
|
-
if (aiFixedJson !== null) {
|
|
1684
|
-
// Validate the AI-fixed JSON by attempting to stringify and re-parse it
|
|
1685
|
-
// This ensures it's actually valid JSON and not just something that passed fixJsonWithAI
|
|
1686
|
-
try {
|
|
1687
|
-
const validated = JSON.parse(JSON.stringify(aiFixedJson));
|
|
1688
|
-
return validated;
|
|
1689
|
-
}
|
|
1690
|
-
catch {
|
|
1691
|
-
// AI returned something that looks like JSON but isn't valid
|
|
1692
|
-
// Increment recursion depth and try parsing the AI response
|
|
1693
|
-
getLumicLogger().warn('AI fixing returned invalid JSON, attempting recursive parse...');
|
|
1694
|
-
return parseResponse(JSON.stringify(aiFixedJson), responseFormat, {
|
|
1695
|
-
...options,
|
|
1696
|
-
_recursionDepth: recursionDepth + 1,
|
|
1697
|
-
});
|
|
1698
|
-
}
|
|
1699
|
-
}
|
|
1746
|
+
aiFixedJson = await fixJsonWithAI(cleanedContent);
|
|
1700
1747
|
}
|
|
1701
1748
|
catch (error) {
|
|
1702
1749
|
const errorMessage = error instanceof Error ? error.message : 'Unknown error';
|
|
1703
1750
|
getLumicLogger().error(`AI JSON fixing failed: ${errorMessage}`);
|
|
1704
|
-
//
|
|
1751
|
+
// Fall through to the final error below.
|
|
1752
|
+
}
|
|
1753
|
+
if (aiFixedJson !== null) {
|
|
1754
|
+
let validated;
|
|
1755
|
+
try {
|
|
1756
|
+
// Validate the AI-fixed JSON by attempting to stringify and re-parse
|
|
1757
|
+
// it. This ensures it is actually valid JSON, not just something that
|
|
1758
|
+
// passed fixJsonWithAI.
|
|
1759
|
+
validated = JSON.parse(JSON.stringify(aiFixedJson));
|
|
1760
|
+
}
|
|
1761
|
+
catch {
|
|
1762
|
+
// AI returned something that looks like JSON but isn't valid.
|
|
1763
|
+
// Increment recursion depth and try parsing the AI response.
|
|
1764
|
+
getLumicLogger().warn('AI fixing returned invalid JSON, attempting recursive parse...');
|
|
1765
|
+
return parseResponse(JSON.stringify(aiFixedJson), responseFormat, {
|
|
1766
|
+
...options,
|
|
1767
|
+
_recursionDepth: recursionDepth + 1,
|
|
1768
|
+
});
|
|
1769
|
+
}
|
|
1770
|
+
// Schema validation (json_schema format) happens here, OUTSIDE the
|
|
1771
|
+
// JSON.parse try/catch, so a schema mismatch propagates as a thrown
|
|
1772
|
+
// JsonParseError rather than being mistaken for invalid JSON.
|
|
1773
|
+
return finalizeJsonResult(validated, responseFormat);
|
|
1705
1774
|
}
|
|
1706
1775
|
}
|
|
1707
1776
|
// If all strategies fail, throw an error
|
|
@@ -1712,6 +1781,106 @@ async function parseResponse(content, responseFormat, options = {}) {
|
|
|
1712
1781
|
return content;
|
|
1713
1782
|
}
|
|
1714
1783
|
}
|
|
1784
|
+
/**
|
|
1785
|
+
* Reports the JSON type of a runtime value for schema-validation diagnostics.
|
|
1786
|
+
*
|
|
1787
|
+
* @param value The value whose JSON type should be described.
|
|
1788
|
+
* @returns One of `'null' | 'array' | 'object' | 'string' | 'number' | 'boolean' | 'undefined'`.
|
|
1789
|
+
*/
|
|
1790
|
+
function jsonTypeOf(value) {
|
|
1791
|
+
if (value === null)
|
|
1792
|
+
return 'null';
|
|
1793
|
+
if (Array.isArray(value))
|
|
1794
|
+
return 'array';
|
|
1795
|
+
return typeof value;
|
|
1796
|
+
}
|
|
1797
|
+
/**
|
|
1798
|
+
* Extracts a declared primitive `type` string from a property schema, if present.
|
|
1799
|
+
*
|
|
1800
|
+
* @param propertySchema The (untyped) per-property JSON-Schema fragment.
|
|
1801
|
+
* @returns The declared type string, or null when none is declared.
|
|
1802
|
+
*/
|
|
1803
|
+
function extractSchemaType(propertySchema) {
|
|
1804
|
+
if (typeof propertySchema === 'object' && propertySchema !== null && 'type' in propertySchema) {
|
|
1805
|
+
const declared = propertySchema.type;
|
|
1806
|
+
return typeof declared === 'string' ? declared : null;
|
|
1807
|
+
}
|
|
1808
|
+
return null;
|
|
1809
|
+
}
|
|
1810
|
+
/**
|
|
1811
|
+
* Checks whether a runtime value satisfies a declared JSON-Schema primitive
|
|
1812
|
+
* type. Unknown/unsupported type keywords are treated permissively (they never
|
|
1813
|
+
* cause a rejection), so this validator only ever rejects clear mismatches.
|
|
1814
|
+
*
|
|
1815
|
+
* @param value The runtime value to check.
|
|
1816
|
+
* @param expectedType The declared JSON-Schema type keyword.
|
|
1817
|
+
* @returns True when the value matches (or the keyword is unsupported).
|
|
1818
|
+
*/
|
|
1819
|
+
function valueMatchesJsonType(value, expectedType) {
|
|
1820
|
+
switch (expectedType) {
|
|
1821
|
+
case 'string':
|
|
1822
|
+
return typeof value === 'string';
|
|
1823
|
+
case 'number':
|
|
1824
|
+
return typeof value === 'number';
|
|
1825
|
+
case 'integer':
|
|
1826
|
+
return typeof value === 'number' && Number.isInteger(value);
|
|
1827
|
+
case 'boolean':
|
|
1828
|
+
return typeof value === 'boolean';
|
|
1829
|
+
case 'object':
|
|
1830
|
+
return typeof value === 'object' && value !== null && !Array.isArray(value);
|
|
1831
|
+
case 'array':
|
|
1832
|
+
return Array.isArray(value);
|
|
1833
|
+
case 'null':
|
|
1834
|
+
return value === null;
|
|
1835
|
+
default:
|
|
1836
|
+
return true;
|
|
1837
|
+
}
|
|
1838
|
+
}
|
|
1839
|
+
/**
|
|
1840
|
+
* Validates a parsed value against a `json_schema` object schema. Enforces that
|
|
1841
|
+
* the value is a plain object, that every `required` property is present, and
|
|
1842
|
+
* that present properties whose schema declares a primitive `type` match it.
|
|
1843
|
+
*
|
|
1844
|
+
* @param value The parsed value to validate.
|
|
1845
|
+
* @param schema The object schema supplied on the response format.
|
|
1846
|
+
* @throws {JsonParseError} When the value violates the schema.
|
|
1847
|
+
*/
|
|
1848
|
+
function validateJsonSchema(value, schema) {
|
|
1849
|
+
if (typeof value !== 'object' || value === null || Array.isArray(value)) {
|
|
1850
|
+
throw new JsonParseError(`JSON schema validation failed: expected an object but received ${jsonTypeOf(value)}.`);
|
|
1851
|
+
}
|
|
1852
|
+
const record = value;
|
|
1853
|
+
const missing = (schema.required ?? []).filter((key) => !(key in record));
|
|
1854
|
+
if (missing.length > 0) {
|
|
1855
|
+
throw new JsonParseError(`JSON schema validation failed: missing required properties: ${missing.join(', ')}.`);
|
|
1856
|
+
}
|
|
1857
|
+
for (const [key, propertySchema] of Object.entries(schema.properties)) {
|
|
1858
|
+
if (!(key in record))
|
|
1859
|
+
continue;
|
|
1860
|
+
const expectedType = extractSchemaType(propertySchema);
|
|
1861
|
+
if (expectedType !== null && !valueMatchesJsonType(record[key], expectedType)) {
|
|
1862
|
+
throw new JsonParseError(`JSON schema validation failed: property "${key}" expected type "${expectedType}" but received ${jsonTypeOf(record[key])}.`);
|
|
1863
|
+
}
|
|
1864
|
+
}
|
|
1865
|
+
}
|
|
1866
|
+
/**
|
|
1867
|
+
* Finalizes a successfully-parsed JSON value. When the caller supplied a
|
|
1868
|
+
* `json_schema` response format, the value is validated against that schema
|
|
1869
|
+
* before being returned so schema violations surface as a thrown
|
|
1870
|
+
* {@link JsonParseError} instead of flowing silently downstream. For plain
|
|
1871
|
+
* `json` formats the value is returned unchanged.
|
|
1872
|
+
*
|
|
1873
|
+
* @param value The parsed value produced by a parsing strategy.
|
|
1874
|
+
* @param responseFormat The originally requested response format.
|
|
1875
|
+
* @returns The value narrowed to `T`.
|
|
1876
|
+
* @throws {JsonParseError} When a supplied json_schema is not satisfied.
|
|
1877
|
+
*/
|
|
1878
|
+
function finalizeJsonResult(value, responseFormat) {
|
|
1879
|
+
if (typeof responseFormat === 'object' && responseFormat?.type === 'json_schema') {
|
|
1880
|
+
validateJsonSchema(value, responseFormat.schema);
|
|
1881
|
+
}
|
|
1882
|
+
return value;
|
|
1883
|
+
}
|
|
1715
1884
|
|
|
1716
1885
|
/**
|
|
1717
1886
|
* Default timeout values (in milliseconds) for external service calls.
|
|
@@ -9048,6 +9217,10 @@ async function createDeepseekCompletion(content, responseFormat, options = {}) {
|
|
|
9048
9217
|
* @param responseFormat The format of the response. Defaults to 'json'.
|
|
9049
9218
|
* @param options Configuration options including model ('deepseek-chat' or 'deepseek-reasoner'), tools, and apiKey.
|
|
9050
9219
|
* @return A promise that resolves to the response from the Deepseek API.
|
|
9220
|
+
* @throws {Error} If the requested capability (JSON output / tool calling) is
|
|
9221
|
+
* unsupported by the model, or if the underlying API call fails. This matches
|
|
9222
|
+
* the OpenAI and Anthropic providers, which surface failures by throwing
|
|
9223
|
+
* rather than returning a success-shaped response carrying an error payload.
|
|
9051
9224
|
*/
|
|
9052
9225
|
const makeDeepseekCall = async (content, responseFormat = 'json', options = {}) => {
|
|
9053
9226
|
// Set default model if not provided
|
|
@@ -9058,43 +9231,15 @@ const makeDeepseekCall = async (content, responseFormat = 'json', options = {})
|
|
|
9058
9231
|
mergedOptions.model = DEFAULT_DEEPSEEK_OPTIONS.defaultModel;
|
|
9059
9232
|
}
|
|
9060
9233
|
const modelName = normalizeModelName(mergedOptions.model);
|
|
9061
|
-
// Check if the requested response format is compatible with the model
|
|
9234
|
+
// Check if the requested response format is compatible with the model.
|
|
9235
|
+
// Throw rather than returning a fake-success LLMResponse: a caller that
|
|
9236
|
+
// asked for JSON must not silently receive an { error } payload typed as T.
|
|
9062
9237
|
if (responseFormat !== 'text' && !supportsJsonOutput(modelName)) {
|
|
9063
|
-
|
|
9064
|
-
return {
|
|
9065
|
-
response: {
|
|
9066
|
-
error: `Model ${modelName} does not support JSON output format.`
|
|
9067
|
-
},
|
|
9068
|
-
usage: {
|
|
9069
|
-
prompt_tokens: 0,
|
|
9070
|
-
completion_tokens: 0,
|
|
9071
|
-
reasoning_tokens: 0,
|
|
9072
|
-
provider: 'deepseek',
|
|
9073
|
-
model: modelName,
|
|
9074
|
-
cached_tokens: 0,
|
|
9075
|
-
cost: 0,
|
|
9076
|
-
},
|
|
9077
|
-
tool_calls: undefined,
|
|
9078
|
-
};
|
|
9238
|
+
throw new Error(`Model ${modelName} does not support JSON output format.`);
|
|
9079
9239
|
}
|
|
9080
|
-
// Check if tools are requested with a model that doesn't support them
|
|
9240
|
+
// Check if tools are requested with a model that doesn't support them.
|
|
9081
9241
|
if (mergedOptions.tools && mergedOptions.tools.length > 0 && !supportsToolCalling(modelName)) {
|
|
9082
|
-
|
|
9083
|
-
return {
|
|
9084
|
-
response: {
|
|
9085
|
-
error: `Model ${modelName} does not support tool calling.`
|
|
9086
|
-
},
|
|
9087
|
-
usage: {
|
|
9088
|
-
prompt_tokens: 0,
|
|
9089
|
-
completion_tokens: 0,
|
|
9090
|
-
reasoning_tokens: 0,
|
|
9091
|
-
provider: 'deepseek',
|
|
9092
|
-
model: modelName,
|
|
9093
|
-
cached_tokens: 0,
|
|
9094
|
-
cost: 0,
|
|
9095
|
-
},
|
|
9096
|
-
tool_calls: undefined,
|
|
9097
|
-
};
|
|
9242
|
+
throw new Error(`Model ${modelName} does not support tool calling.`);
|
|
9098
9243
|
}
|
|
9099
9244
|
try {
|
|
9100
9245
|
const completion = await createDeepseekCompletion(content, responseFormat, mergedOptions);
|
|
@@ -9144,23 +9289,13 @@ const makeDeepseekCall = async (content, responseFormat = 'json', options = {})
|
|
|
9144
9289
|
};
|
|
9145
9290
|
}
|
|
9146
9291
|
catch (error) {
|
|
9147
|
-
//
|
|
9292
|
+
// Mirror the OpenAI/Anthropic providers: log with sanitized context and
|
|
9293
|
+
// rethrow so callers observe the failure. Returning a success-shaped
|
|
9294
|
+
// response with an { error } payload here previously let hard failures
|
|
9295
|
+
// (auth, timeout, rate-limit exhaustion, unparseable output) masquerade as
|
|
9296
|
+
// successful completions downstream.
|
|
9148
9297
|
getLumicLogger().error(`Error in Deepseek API call: ${sanitizeError(error)}`);
|
|
9149
|
-
|
|
9150
|
-
response: {
|
|
9151
|
-
error: sanitizeError(error)
|
|
9152
|
-
},
|
|
9153
|
-
usage: {
|
|
9154
|
-
prompt_tokens: 0,
|
|
9155
|
-
completion_tokens: 0,
|
|
9156
|
-
reasoning_tokens: 0,
|
|
9157
|
-
provider: 'deepseek',
|
|
9158
|
-
model: modelName,
|
|
9159
|
-
cached_tokens: 0,
|
|
9160
|
-
cost: 0,
|
|
9161
|
-
},
|
|
9162
|
-
tool_calls: undefined,
|
|
9163
|
-
};
|
|
9298
|
+
throw error;
|
|
9164
9299
|
}
|
|
9165
9300
|
};
|
|
9166
9301
|
|
|
@@ -10094,14 +10229,27 @@ async function downloadFile(s3Client, bucketName, s3Key, localFilePath) {
|
|
|
10094
10229
|
async function unzipFile(zipPath, destPath) {
|
|
10095
10230
|
const zip = new AdmZip(zipPath);
|
|
10096
10231
|
try {
|
|
10097
|
-
|
|
10098
|
-
|
|
10099
|
-
|
|
10232
|
+
// extractAllToAsync is fire-and-forget: it returns void and reports
|
|
10233
|
+
// failures through its callback. The previous call neither awaited it nor
|
|
10234
|
+
// observed the callback, so getDirectoryStats raced an in-flight (or
|
|
10235
|
+
// failed) extraction and any extraction error was silently dropped. Wrap
|
|
10236
|
+
// it in a Promise so the extraction is fully awaited and errors surface.
|
|
10237
|
+
await new Promise((resolve, reject) => {
|
|
10238
|
+
zip.extractAllToAsync(destPath, true, false, (error) => {
|
|
10239
|
+
if (error) {
|
|
10240
|
+
reject(error);
|
|
10241
|
+
}
|
|
10242
|
+
else {
|
|
10243
|
+
resolve();
|
|
10244
|
+
}
|
|
10245
|
+
});
|
|
10246
|
+
});
|
|
10247
|
+
return await getDirectoryStats(destPath);
|
|
10100
10248
|
}
|
|
10101
10249
|
catch (error) {
|
|
10102
10250
|
const errorMessage = error instanceof Error ? error.message : String(error);
|
|
10103
10251
|
getLumicLogger().error(`Error unzipping file: ${errorMessage}`);
|
|
10104
|
-
throw error;
|
|
10252
|
+
throw new ZipError(`Failed to extract archive "${zipPath}" to "${destPath}": ${errorMessage}`, error);
|
|
10105
10253
|
}
|
|
10106
10254
|
}
|
|
10107
10255
|
async function getDirectoryStats(dirPath) {
|
|
@@ -23055,11 +23203,11 @@ let poolConfig = DEFAULT_POOL_CONFIG;
|
|
|
23055
23203
|
async function loadApolloModules() {
|
|
23056
23204
|
if (typeof window === "undefined" || process.env.AWS_EXECUTION_ENV) {
|
|
23057
23205
|
// Server-side (or Lambda): load the CommonJS‑based implementation.
|
|
23058
|
-
return (await import('./apollo-client.server-
|
|
23206
|
+
return (await import('./apollo-client.server-BxpJcsVI.js'));
|
|
23059
23207
|
}
|
|
23060
23208
|
else {
|
|
23061
23209
|
// Client-side: load the ESM‑based implementation.
|
|
23062
|
-
return (await import('./apollo-client.client-
|
|
23210
|
+
return (await import('./apollo-client.client-eo-xgmdi.js'));
|
|
23063
23211
|
}
|
|
23064
23212
|
}
|
|
23065
23213
|
/**
|
|
@@ -81583,4 +81731,4 @@ const lumic = {
|
|
|
81583
81731
|
};
|
|
81584
81732
|
|
|
81585
81733
|
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, PDFError 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, openAIChatCompletionSchema as bA, openAIImageResponseSchema as bB, validateOpenAIChatCompletion as bC, safeValidateOpenAIChatCompletion as bD, perplexityResponseSchema as bE, validatePerplexityResponse as bF, safeValidatePerplexityResponse as bG, googleSheetsValueRangeSchema as bH, validateGoogleSheetsResponse as bI, safeValidateGoogleSheetsResponse as bJ, s3ListObjectsSchema as bK, s3GetObjectSchema as bL, lambdaInvokeResponseSchema as bM, validateS3ListObjects as bN, safeValidateS3ListObjects as bO, validateLambdaResponse as bP, safeValidateLambdaResponse as bQ, createValidator as bR, createSafeValidator as bS, LumicError as bT, SlackError as bU, LLMError as bV, AWSLambdaError as bW, AWSS3Error as bX, GoogleSheetsError as bY, PerplexityError as bZ, JsonParseError 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_PROVIDER as bu, LLM_MODEL_MINI as bv, LLM_MODEL_NORMAL as bw, LLM_MODEL_ADVANCED as bx, makeAnthropicCall as by, makeOpenAICompatibleCall as bz, isInterfaceType as c, ZipError as c0, SLACK_TIMEOUT_MS as c1, PERPLEXITY_TIMEOUT_MS as c2, GOOGLE_SHEETS_TIMEOUT_MS as c3, LLM_TIMEOUT_MS as c4, AWS_LAMBDA_TIMEOUT_MS as c5, AWS_S3_TIMEOUT_MS as c6, OPENWEATHER_TIMEOUT_MS as c7, GENERIC_FETCH_TIMEOUT_MS as c8, 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 };
|
|
81586
|
-
//# sourceMappingURL=index-
|
|
81734
|
+
//# sourceMappingURL=index-BbwdRyPk.js.map
|