@nexus-cortex/core 4.124.45 → 4.124.47
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/.env.defaults +90 -1
- package/dist/adapters/ChatCompletionsAPIAdapter.d.ts.map +1 -1
- package/dist/adapters/ChatCompletionsAPIAdapter.js +10 -0
- package/dist/adapters/ChatCompletionsAPIAdapter.js.map +1 -1
- package/dist/adapters/GatewayTranslationLayer.d.ts.map +1 -1
- package/dist/adapters/GatewayTranslationLayer.js +33 -0
- package/dist/adapters/GatewayTranslationLayer.js.map +1 -1
- package/dist/adapters/ServerSideToolDetection.d.ts.map +1 -1
- package/dist/adapters/ServerSideToolDetection.js +5 -1
- package/dist/adapters/ServerSideToolDetection.js.map +1 -1
- package/dist/config/SettingsSchema.js +2 -2
- package/dist/config/SettingsSchema.js.map +1 -1
- package/dist/config/effectiveConfig.d.ts.map +1 -1
- package/dist/config/effectiveConfig.js +9 -0
- package/dist/config/effectiveConfig.js.map +1 -1
- package/dist/models/cards/xai/grok-4-3-chat.d.ts +15 -0
- package/dist/models/cards/xai/grok-4-3-chat.d.ts.map +1 -0
- package/dist/models/cards/xai/grok-4-3-chat.js +28 -0
- package/dist/models/cards/xai/grok-4-3-chat.js.map +1 -0
- package/dist/models/cards/xai/grok-build-0-1-chat.d.ts +17 -0
- package/dist/models/cards/xai/grok-build-0-1-chat.d.ts.map +1 -0
- package/dist/models/cards/xai/grok-build-0-1-chat.js +31 -0
- package/dist/models/cards/xai/grok-build-0-1-chat.js.map +1 -0
- package/dist/models/cards/xai/index.d.ts +2 -0
- package/dist/models/cards/xai/index.d.ts.map +1 -1
- package/dist/models/cards/xai/index.js +2 -0
- package/dist/models/cards/xai/index.js.map +1 -1
- package/dist/models/configurators/XAIConfigurator.d.ts +7 -1
- package/dist/models/configurators/XAIConfigurator.d.ts.map +1 -1
- package/dist/models/configurators/XAIConfigurator.js +15 -3
- package/dist/models/configurators/XAIConfigurator.js.map +1 -1
- package/dist/models/registry/ModularModelRegistry.d.ts.map +1 -1
- package/dist/models/registry/ModularModelRegistry.js +2 -0
- package/dist/models/registry/ModularModelRegistry.js.map +1 -1
- package/dist/orchestrator/APIClient.d.ts +4 -0
- package/dist/orchestrator/APIClient.d.ts.map +1 -1
- package/dist/orchestrator/APIClient.js +181 -25
- package/dist/orchestrator/APIClient.js.map +1 -1
- package/dist/orchestrator/CortexOrchestrator.d.ts.map +1 -1
- package/dist/orchestrator/CortexOrchestrator.js +8 -2
- package/dist/orchestrator/CortexOrchestrator.js.map +1 -1
- package/dist/orchestrator/appendOnlyHistory.d.ts.map +1 -1
- package/dist/orchestrator/appendOnlyHistory.js +4 -0
- package/dist/orchestrator/appendOnlyHistory.js.map +1 -1
- package/dist/orchestrator/geminiExplicitCache.d.ts +79 -0
- package/dist/orchestrator/geminiExplicitCache.d.ts.map +1 -0
- package/dist/orchestrator/geminiExplicitCache.js +324 -0
- package/dist/orchestrator/geminiExplicitCache.js.map +1 -0
- package/dist/orchestrator/transportEffortFixes.d.ts +62 -0
- package/dist/orchestrator/transportEffortFixes.d.ts.map +1 -0
- package/dist/orchestrator/transportEffortFixes.js +114 -0
- package/dist/orchestrator/transportEffortFixes.js.map +1 -0
- package/dist/orchestrator/xaiChatTransport.d.ts +27 -0
- package/dist/orchestrator/xaiChatTransport.d.ts.map +1 -0
- package/dist/orchestrator/xaiChatTransport.js +33 -0
- package/dist/orchestrator/xaiChatTransport.js.map +1 -0
- package/package.json +3 -3
|
@@ -0,0 +1,114 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Transport reasoning-effort fixes (2026-10-02; stack-portability map
|
|
3
|
+
* .cortex/research/stack-portability-2026-10-02.md, note N1). Each is DARK behind its own env flag; with the flag off
|
|
4
|
+
* every caller takes its pre-existing code path unchanged (byte-identical requests).
|
|
5
|
+
*
|
|
6
|
+
* - CORTEX_OPENAI_TOOLS_REASONING: the gateway forwards the request/action effort for OpenAI reasoning cards even though they
|
|
7
|
+
* do not declare `reasoning.toggleable`, so CORTEX_ACTION_EFFORT reaches `reasoning.effort` on the RESPONSES API. Chat/completions
|
|
8
|
+
* is unchanged: R19b's drop stays because OpenAI still rejects reasoning_effort + function tools there (live probe 2026-10-03:
|
|
9
|
+
* gpt-5.4-nano + gpt-5.6-luna → 400 "use /v1/responses"); Responses accepts it with tools (200 on both).
|
|
10
|
+
* - CORTEX_ANTHROPIC_EFFORT: Anthropic adaptive-thinking families (claude-4.7 / 4.8 / claude-5 / claude-fable-5) got
|
|
11
|
+
* `thinking:{type:'adaptive'}` only, so the action effort never reached the wire. On: `output_config.effort` = the
|
|
12
|
+
* effort (low|medium|high|xhigh|max; GA, no beta header). Non-adaptive families: `max` was not in the budget map and
|
|
13
|
+
* fell to 10000; on, `max` maps to a large budget clamped below max_tokens (budget_tokens must be < max_tokens, >= 1024).
|
|
14
|
+
* - CORTEX_GEMINI_TOOLS_THINKING: Gemini thinkingConfig was never sent with tools (the @google/genai builders skipped
|
|
15
|
+
* it — "cannot coexist", a Gemini 2.0-era observation) and the REST builder only ever sent a card-level thinkingLevel.
|
|
16
|
+
* On: the action effort maps to generationConfig.thinkingConfig — `thinkingLevel` on Gemini 3.x, `thinkingBudget` on
|
|
17
|
+
* 2.5 and older — on REST and SDK, with or without tools.
|
|
18
|
+
*
|
|
19
|
+
* Pure helpers — no client state. Flags are resolved per call so tests/benches can flip them.
|
|
20
|
+
*/
|
|
21
|
+
function flagOn(raw) {
|
|
22
|
+
const v = String(raw ?? '').trim().toLowerCase();
|
|
23
|
+
return v === 'on' || v === 'true' || v === '1';
|
|
24
|
+
}
|
|
25
|
+
export function isOpenAIToolsReasoningEnabled() {
|
|
26
|
+
return flagOn(process.env.CORTEX_OPENAI_TOOLS_REASONING);
|
|
27
|
+
}
|
|
28
|
+
export function isAnthropicEffortEnabled() {
|
|
29
|
+
return flagOn(process.env.CORTEX_ANTHROPIC_EFFORT);
|
|
30
|
+
}
|
|
31
|
+
export function isGeminiToolsThinkingEnabled() {
|
|
32
|
+
return flagOn(process.env.CORTEX_GEMINI_TOOLS_THINKING);
|
|
33
|
+
}
|
|
34
|
+
// ---------------------------------------------------------------------------------------------------------
|
|
35
|
+
// Anthropic
|
|
36
|
+
// ---------------------------------------------------------------------------------------------------------
|
|
37
|
+
const ANTHROPIC_EFFORT_LEVELS = new Set(['low', 'medium', 'high', 'xhigh', 'max']);
|
|
38
|
+
/**
|
|
39
|
+
* `output_config.effort` value for an adaptive-thinking family, or undefined (send nothing → provider default).
|
|
40
|
+
* 'none' / unknown values send nothing (adaptive families have no "off" effort).
|
|
41
|
+
*/
|
|
42
|
+
export function anthropicOutputEffort(reasoningEffort) {
|
|
43
|
+
const e = String(reasoningEffort ?? '').trim().toLowerCase();
|
|
44
|
+
return ANTHROPIC_EFFORT_LEVELS.has(e) ? e : undefined;
|
|
45
|
+
}
|
|
46
|
+
/** Target thinking budget for effort `max` on budget_tokens families (before the max_tokens clamp). */
|
|
47
|
+
export const ANTHROPIC_MAX_EFFORT_BUDGET = 120000;
|
|
48
|
+
/** Visible-output room kept below max_tokens when clamping the `max` budget. */
|
|
49
|
+
export const ANTHROPIC_MAX_EFFORT_OUTPUT_ROOM = 1024;
|
|
50
|
+
/**
|
|
51
|
+
* budget_tokens for effort `max` on a non-adaptive family: ANTHROPIC_MAX_EFFORT_BUDGET clamped to
|
|
52
|
+
* max_tokens - ANTHROPIC_MAX_EFFORT_OUTPUT_ROOM (the API requires budget_tokens < max_tokens and >= 1024).
|
|
53
|
+
* Returns undefined when max_tokens is too small to honour the floor — the caller keeps its legacy value.
|
|
54
|
+
*/
|
|
55
|
+
export function anthropicMaxEffortBudget(maxTokens) {
|
|
56
|
+
const mt = Number(maxTokens);
|
|
57
|
+
if (!Number.isFinite(mt) || mt <= 0)
|
|
58
|
+
return undefined;
|
|
59
|
+
const b = Math.min(ANTHROPIC_MAX_EFFORT_BUDGET, Math.floor(mt) - ANTHROPIC_MAX_EFFORT_OUTPUT_ROOM);
|
|
60
|
+
return b >= 1024 ? b : undefined;
|
|
61
|
+
}
|
|
62
|
+
// ---------------------------------------------------------------------------------------------------------
|
|
63
|
+
// Gemini
|
|
64
|
+
// ---------------------------------------------------------------------------------------------------------
|
|
65
|
+
/** Gemini 3.x takes `thinkingLevel`; 2.5 and older take `thinkingBudget` (sending both is a 400). */
|
|
66
|
+
export function isGeminiThinkingLevelModel(modelId) {
|
|
67
|
+
return /^(models\/)?gemini-([3-9]|\d{2,})/i.test(String(modelId ?? '').trim());
|
|
68
|
+
}
|
|
69
|
+
/** thinkingBudget per effort for Gemini 2.5 (Flash range 0-24576; Pro 128-32768 — every value here is valid on both). */
|
|
70
|
+
export const GEMINI_BUDGET_BY_EFFORT = {
|
|
71
|
+
low: 2048,
|
|
72
|
+
medium: 8192,
|
|
73
|
+
high: 16384,
|
|
74
|
+
xhigh: 24576,
|
|
75
|
+
max: 24576,
|
|
76
|
+
};
|
|
77
|
+
/** thinkingLevel per effort for Gemini 3.x (levels low|medium|high; xhigh/max clamp to high). */
|
|
78
|
+
export const GEMINI_LEVEL_BY_EFFORT = {
|
|
79
|
+
low: 'low',
|
|
80
|
+
medium: 'medium',
|
|
81
|
+
high: 'high',
|
|
82
|
+
xhigh: 'high',
|
|
83
|
+
max: 'high',
|
|
84
|
+
};
|
|
85
|
+
/**
|
|
86
|
+
* The generationConfig.thinkingConfig for an effort, or undefined (none / unknown effort → send nothing, API default).
|
|
87
|
+
*/
|
|
88
|
+
export function geminiThinkingConfigForEffort(modelId, reasoningEffort) {
|
|
89
|
+
const e = String(reasoningEffort ?? '').trim().toLowerCase();
|
|
90
|
+
if (isGeminiThinkingLevelModel(modelId)) {
|
|
91
|
+
const level = GEMINI_LEVEL_BY_EFFORT[e];
|
|
92
|
+
return level ? { thinkingLevel: level } : undefined;
|
|
93
|
+
}
|
|
94
|
+
const budget = GEMINI_BUDGET_BY_EFFORT[e];
|
|
95
|
+
return budget !== undefined ? { thinkingBudget: budget } : undefined;
|
|
96
|
+
}
|
|
97
|
+
// ---------------------------------------------------------------------------------------------------------
|
|
98
|
+
// CORTEX_ACTION_EFFORT_FIRST — request 0 of each user turn
|
|
99
|
+
// ---------------------------------------------------------------------------------------------------------
|
|
100
|
+
/**
|
|
101
|
+
* CORTEX_ACTION_EFFORT is filled into the request params AFTER the first request of each user turn is built
|
|
102
|
+
* (CortexOrchestrator initialPrepOpts vs the `??=` in the loop setup), so request 0 ran at the card default and
|
|
103
|
+
* requests 1+ at the action effort. On DeepSeek that is harmless (card 'medium' is coerced to 'high' server-side and
|
|
104
|
+
* the anchor-lift bust lands on the same boundary); on other providers it sends a different effort on request 0 and
|
|
105
|
+
* costs one extra cache break per user turn. DARK: CORTEX_ACTION_EFFORT_FIRST=on → request 0 gets the action effort
|
|
106
|
+
* when no ramp / request param set one. Off → undefined (byte-identical).
|
|
107
|
+
*/
|
|
108
|
+
export function firstRequestActionEffort(env = process.env) {
|
|
109
|
+
if (!flagOn(env.CORTEX_ACTION_EFFORT_FIRST))
|
|
110
|
+
return undefined;
|
|
111
|
+
const e = String(env.CORTEX_ACTION_EFFORT ?? '').trim();
|
|
112
|
+
return e || undefined;
|
|
113
|
+
}
|
|
114
|
+
//# sourceMappingURL=transportEffortFixes.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"transportEffortFixes.js","sourceRoot":"","sources":["../../src/orchestrator/transportEffortFixes.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AAEH,SAAS,MAAM,CAAC,GAAuB;IACrC,MAAM,CAAC,GAAG,MAAM,CAAC,GAAG,IAAI,EAAE,CAAC,CAAC,IAAI,EAAE,CAAC,WAAW,EAAE,CAAC;IACjD,OAAO,CAAC,KAAK,IAAI,IAAI,CAAC,KAAK,MAAM,IAAI,CAAC,KAAK,GAAG,CAAC;AACjD,CAAC;AAED,MAAM,UAAU,6BAA6B;IAC3C,OAAO,MAAM,CAAC,OAAO,CAAC,GAAG,CAAC,6BAA6B,CAAC,CAAC;AAC3D,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yB,OAAO,CAAC,GAAG;IAC3E,IAAI,CAAC,MAAM,CAAC,GAAG,CAAC,0BAA0B,CAAC;QAAE,OAAO,SAAS,CAAC;IAC9D,MAAM,CAAC,GAAG,MAAM,CAAC,GAAG,CAAC,oBAAoB,IAAI,EAAE,CAAC,CAAC,IAAI,EAAE,CAAC;IACxD,OAAO,CAAC,IAAI,SAAS,CAAC;AACxB,CAAC"}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* xAI chat/completions transport helpers (2026-10-03; stack-portability map
|
|
3
|
+
* .cortex/research/stack-portability-2026-10-02.md §"xAI CHAT/COMPLETIONS THEORY TEST").
|
|
4
|
+
*
|
|
5
|
+
* The third xAI transport, ADDITIVE beside /v1/messages (the interleaved-thinking path — untouched) and /v1/responses.
|
|
6
|
+
* Selected per card (`apiMode: 'chat'`, e.g. grok-4.3-chat / grok-build-0.1-chat) or globally for un-pinned xAI cards via
|
|
7
|
+
* XAI_API_MODE=chat. Reachable ONLY when an xAI card resolves to pattern 'chat/completions' — nothing on the shipped default
|
|
8
|
+
* path does, so every helper here is dark by construction.
|
|
9
|
+
*
|
|
10
|
+
* Pure helpers — no client state.
|
|
11
|
+
*/
|
|
12
|
+
import type { ModelConfig } from '../models/ModelConfig.interface.js';
|
|
13
|
+
/** True when this request rides api.x.ai /v1/chat/completions. */
|
|
14
|
+
export declare function isXAIChatRoute(modelConfig: Pick<ModelConfig, 'provider' | 'api'>): boolean;
|
|
15
|
+
/**
|
|
16
|
+
* `reasoning_effort` for an xAI chat/completions request, or undefined (send nothing → provider default, 'high').
|
|
17
|
+
*
|
|
18
|
+
* Per-card capability: a card that declares no default effort (`reasoning.defaultEffort` / `reasoning.effort` — the
|
|
19
|
+
* XAIConfigurator `reasoningEffort` option) NEVER gets the field. grok-build-0.1 400s on it ("does not support parameter
|
|
20
|
+
* reasoningEffort", live 2026-10-02) and its cards deliberately omit `reasoningEffort`.
|
|
21
|
+
*
|
|
22
|
+
* Precedence: explicit request / action effort (CORTEX_ACTION_EFFORT, effort pulse) > card default. Mapping: the harness's
|
|
23
|
+
* `max` (the DeepSeek ladder top) → `high` (xAI has no `max`; `xhigh` is not accepted on every grok — pass it explicitly to
|
|
24
|
+
* use it); `none` / unknown → the card default (xAI reasoning cannot be disabled).
|
|
25
|
+
*/
|
|
26
|
+
export declare function xaiChatReasoningEffort(requested: unknown, modelConfig: Pick<ModelConfig, 'reasoning'>): string | undefined;
|
|
27
|
+
//# sourceMappingURL=xaiChatTransport.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"xaiChatTransport.d.ts","sourceRoot":"","sources":["../../src/orchestrator/xaiChatTransport.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AACH,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,oCAAoC,CAAC;AAEtE,kEAAkE;AAClE,wBAAgB,cAAc,CAAC,WAAW,EAAE,IAAI,CAAC,WAAW,EAAE,UAAU,GAAG,KAAK,CAAC,GAAG,OAAO,CAE1F;AAKD;;;;;;;;;;GAUG;AACH,wBAAgB,sBAAsB,CAAC,SAAS,EAAE,OAAO,EAAE,WAAW,EAAE,IAAI,CAAC,WAAW,EAAE,WAAW,CAAC,GAAG,MAAM,GAAG,SAAS,CAW1H"}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
/** True when this request rides api.x.ai /v1/chat/completions. */
|
|
2
|
+
export function isXAIChatRoute(modelConfig) {
|
|
3
|
+
return modelConfig.api?.pattern === 'chat/completions' && String(modelConfig.provider ?? '').toLowerCase() === 'xai';
|
|
4
|
+
}
|
|
5
|
+
/** xAI reasoning_effort values (docs: model-capabilities/text/reasoning). `xhigh` = grok-4.6+; older models treat it as high. */
|
|
6
|
+
const XAI_EFFORT_LEVELS = new Set(['low', 'medium', 'high', 'xhigh']);
|
|
7
|
+
/**
|
|
8
|
+
* `reasoning_effort` for an xAI chat/completions request, or undefined (send nothing → provider default, 'high').
|
|
9
|
+
*
|
|
10
|
+
* Per-card capability: a card that declares no default effort (`reasoning.defaultEffort` / `reasoning.effort` — the
|
|
11
|
+
* XAIConfigurator `reasoningEffort` option) NEVER gets the field. grok-build-0.1 400s on it ("does not support parameter
|
|
12
|
+
* reasoningEffort", live 2026-10-02) and its cards deliberately omit `reasoningEffort`.
|
|
13
|
+
*
|
|
14
|
+
* Precedence: explicit request / action effort (CORTEX_ACTION_EFFORT, effort pulse) > card default. Mapping: the harness's
|
|
15
|
+
* `max` (the DeepSeek ladder top) → `high` (xAI has no `max`; `xhigh` is not accepted on every grok — pass it explicitly to
|
|
16
|
+
* use it); `none` / unknown → the card default (xAI reasoning cannot be disabled).
|
|
17
|
+
*/
|
|
18
|
+
export function xaiChatReasoningEffort(requested, modelConfig) {
|
|
19
|
+
const r = modelConfig.reasoning;
|
|
20
|
+
if (!r?.supported)
|
|
21
|
+
return undefined;
|
|
22
|
+
const cardDefault = r.effort ?? r.defaultEffort;
|
|
23
|
+
if (!cardDefault)
|
|
24
|
+
return undefined; // capability gate — no declared effort, no field
|
|
25
|
+
const norm = (v) => {
|
|
26
|
+
const e = String(v ?? '').trim().toLowerCase();
|
|
27
|
+
if (e === 'max')
|
|
28
|
+
return 'high';
|
|
29
|
+
return XAI_EFFORT_LEVELS.has(e) ? e : undefined;
|
|
30
|
+
};
|
|
31
|
+
return norm(requested) ?? norm(cardDefault);
|
|
32
|
+
}
|
|
33
|
+
//# sourceMappingURL=xaiChatTransport.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"xaiChatTransport.js","sourceRoot":"","sources":["../../src/orchestrator/xaiChatTransport.ts"],"names":[],"mappings":"AAaA,kEAAkE;AAClE,MAAM,UAAU,cAAc,CAAC,WAAkD;IAC/E,OAAO,WAAW,CAAC,GAAG,EAAE,OAAO,KAAK,kBAAkB,IAAI,MAAM,CAAC,WAAW,CAAC,QAAQ,IAAI,EAAE,CAAC,CAAC,WAAW,EAAE,KAAK,KAAK,CAAC;AACvH,CAAC;AAED,iIAAiI;AACjI,MAAM,iBAAiB,GAAG,IAAI,GAAG,CAAC,CAAC,KAAK,EAAE,QAAQ,EAAE,MAAM,EAAE,OAAO,CAAC,CAAC,CAAC;AAEtE;;;;;;;;;;GAUG;AACH,MAAM,UAAU,sBAAsB,CAAC,SAAkB,EAAE,WAA2C;IACpG,MAAM,CAAC,GAAG,WAAW,CAAC,SAAyF,CAAC;IAChH,IAAI,CAAC,CAAC,EAAE,SAAS;QAAE,OAAO,SAAS,CAAC;IACpC,MAAM,WAAW,GAAG,CAAC,CAAC,MAAM,IAAI,CAAC,CAAC,aAAa,CAAC;IAChD,IAAI,CAAC,WAAW;QAAE,OAAO,SAAS,CAAC,CAAC,iDAAiD;IACrF,MAAM,IAAI,GAAG,CAAC,CAAU,EAAsB,EAAE;QAC9C,MAAM,CAAC,GAAG,MAAM,CAAC,CAAC,IAAI,EAAE,CAAC,CAAC,IAAI,EAAE,CAAC,WAAW,EAAE,CAAC;QAC/C,IAAI,CAAC,KAAK,KAAK;YAAE,OAAO,MAAM,CAAC;QAC/B,OAAO,iBAAiB,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC;IAClD,CAAC,CAAC;IACF,OAAO,IAAI,CAAC,SAAS,CAAC,IAAI,IAAI,CAAC,WAAW,CAAC,CAAC;AAC9C,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@nexus-cortex/core",
|
|
3
|
-
"version": "4.124.
|
|
3
|
+
"version": "4.124.47",
|
|
4
4
|
"description": "Core orchestration library implementing Claude CLI architecture patterns",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/index.js",
|
|
@@ -47,8 +47,8 @@
|
|
|
47
47
|
"@google/generative-ai": "^0.2.1",
|
|
48
48
|
"@gradio/client": "^2.3.1",
|
|
49
49
|
"@modelcontextprotocol/sdk": "^1.20.2",
|
|
50
|
-
"@nexus-cortex/executors": "4.124.
|
|
51
|
-
"@nexus-cortex/types": "4.124.
|
|
50
|
+
"@nexus-cortex/executors": "4.124.47",
|
|
51
|
+
"@nexus-cortex/types": "4.124.47",
|
|
52
52
|
"@types/uuid": "^10.0.0",
|
|
53
53
|
"ajv": "^8.12.0",
|
|
54
54
|
"chokidar": "^3.6.0",
|