@nexus-cortex/core 4.63.7 → 4.63.9

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 (32) hide show
  1. package/dist/middleware/SystemMessageMiddleware.d.ts.map +1 -1
  2. package/dist/middleware/SystemMessageMiddleware.js +10 -1
  3. package/dist/middleware/SystemMessageMiddleware.js.map +1 -1
  4. package/dist/models/cards/deepseek/deepseek-v4-flash.d.ts.map +1 -1
  5. package/dist/models/cards/deepseek/deepseek-v4-flash.js +2 -0
  6. package/dist/models/cards/deepseek/deepseek-v4-flash.js.map +1 -1
  7. package/dist/models/cards/deepseek/deepseek-v4-pro.d.ts.map +1 -1
  8. package/dist/models/cards/deepseek/deepseek-v4-pro.js +2 -0
  9. package/dist/models/cards/deepseek/deepseek-v4-pro.js.map +1 -1
  10. package/dist/models/cards/xai/grok-4-6.d.ts.map +1 -1
  11. package/dist/models/cards/xai/grok-4-6.js +2 -0
  12. package/dist/models/cards/xai/grok-4-6.js.map +1 -1
  13. package/dist/models/cards/xai/grok-build-0-1.d.ts.map +1 -1
  14. package/dist/models/cards/xai/grok-build-0-1.js +2 -0
  15. package/dist/models/cards/xai/grok-build-0-1.js.map +1 -1
  16. package/dist/models/configurators/DeepSeekConfigurator.d.ts +2 -0
  17. package/dist/models/configurators/DeepSeekConfigurator.d.ts.map +1 -1
  18. package/dist/models/configurators/DeepSeekConfigurator.js +1 -0
  19. package/dist/models/configurators/DeepSeekConfigurator.js.map +1 -1
  20. package/dist/models/configurators/XAIConfigurator.d.ts +2 -0
  21. package/dist/models/configurators/XAIConfigurator.d.ts.map +1 -1
  22. package/dist/models/configurators/XAIConfigurator.js +1 -0
  23. package/dist/models/configurators/XAIConfigurator.js.map +1 -1
  24. package/dist/orchestrator/CortexOrchestrator.d.ts +12 -0
  25. package/dist/orchestrator/CortexOrchestrator.d.ts.map +1 -1
  26. package/dist/orchestrator/CortexOrchestrator.js +78 -7
  27. package/dist/orchestrator/CortexOrchestrator.js.map +1 -1
  28. package/dist/tools/ToolProfile.d.ts +12 -1
  29. package/dist/tools/ToolProfile.d.ts.map +1 -1
  30. package/dist/tools/ToolProfile.js +40 -1
  31. package/dist/tools/ToolProfile.js.map +1 -1
  32. package/package.json +3 -3
@@ -19,8 +19,19 @@
19
19
  * Resolved FRESH per call (env tier — hot-toggleable via RuntimeConfigRegistry).
20
20
  * Unknown values resolve to 'full' (fail-open: never brick the tool surface).
21
21
  */
22
- export type ToolProfileName = 'full' | 'lean' | 'bash-only';
22
+ export type ToolProfileName = 'full' | 'lean' | 'bash-only' | 'bash-plus' | 'bash-edit';
23
23
  export declare function resolveToolProfile(env?: NodeJS.ProcessEnv): ToolProfileName;
24
+ /**
25
+ * CORTEX_TOOL_ANCHOR — first-turn policy anchoring (BASH_PLUS_SPEC.md P0).
26
+ * When set to a narrow profile, the FIRST model request of a session presents
27
+ * only that profile's tool schemas; after the first executed tool call the
28
+ * session's own profile applies (injection at the first tool_result boundary
29
+ * — the dsh anchored-standard point). 'full' or unknown → no anchor.
30
+ */
31
+ export declare function resolveToolAnchor(env?: NodeJS.ProcessEnv, cardAnchor?: string | null): ToolProfileName | null;
32
+ /** Do MCP / management / context tools ride along? Narrow arms suppress them
33
+ * (surface leak otherwise); full and lean keep them. */
34
+ export declare function isNarrowProfile(profile?: ToolProfileName): boolean;
24
35
  /**
25
36
  * Filter a tool list to the active profile.
26
37
  * - full: unchanged.
@@ -1 +1 @@
1
- {"version":3,"file":"ToolProfile.d.ts","sourceRoot":"","sources":["../../src/tools/ToolProfile.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;GAoBG;AAEH,MAAM,MAAM,eAAe,GAAG,MAAM,GAAG,MAAM,GAAG,WAAW,CAAC;AAW5D,wBAAgB,kBAAkB,CAAC,GAAG,GAAE,MAAM,CAAC,UAAwB,GAAG,eAAe,CAIxF;AAED;;;;;;;;GAQG;AACH,wBAAgB,gBAAgB,CAAC,CAAC,SAAS;IAAE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,43 @@
26
26
  const ALWAYS_KEEP = new Set(['EndTurn', 'AskUserQuestion']);
27
27
  /** bash-only: the mini-SWE-agent arm — one general-purpose action. */
28
28
  const BASH_ONLY = new Set(['Bash', ...ALWAYS_KEEP]);
29
+ /** bash-plus: the minimal-harness arm (BASH_PLUS_SPEC.md, R61) — the Pi/dsh
30
+ * surface class: shell + structural file ops, nothing else. The shell-native
31
+ * small-model graduation target and P1 anchoring-A/B arm. */
32
+ const BASH_PLUS = new Set(['Bash', 'Read', 'Edit', 'Write', ...ALWAYS_KEEP]);
33
+ /** bash-edit: the dsh-Minimal shape — shell + structural editor ONLY (their
34
+ * bash + str_replace_editor). The deepseek home-door candidate. */
35
+ const BASH_EDIT = new Set(['Bash', 'Edit', ...ALWAYS_KEEP]);
29
36
  export function resolveToolProfile(env = process.env) {
30
37
  const raw = (env.CORTEX_TOOL_PROFILE ?? 'full').trim().toLowerCase();
31
- if (raw === 'lean' || raw === 'bash-only')
38
+ if (raw === 'lean' || raw === 'bash-only' || raw === 'bash-plus' || raw === 'bash-edit')
32
39
  return raw;
33
40
  return 'full';
34
41
  }
42
+ /**
43
+ * CORTEX_TOOL_ANCHOR — first-turn policy anchoring (BASH_PLUS_SPEC.md P0).
44
+ * When set to a narrow profile, the FIRST model request of a session presents
45
+ * only that profile's tool schemas; after the first executed tool call the
46
+ * session's own profile applies (injection at the first tool_result boundary
47
+ * — the dsh anchored-standard point). 'full' or unknown → no anchor.
48
+ */
49
+ export function resolveToolAnchor(env = process.env, cardAnchor) {
50
+ const valid = (v) => v === 'lean' || v === 'bash-only' || v === 'bash-plus' || v === 'bash-edit';
51
+ const raw = (env.CORTEX_TOOL_ANCHOR ?? '').trim().toLowerCase();
52
+ if (valid(raw))
53
+ return raw;
54
+ if (raw === 'full' || raw === 'none' || raw === 'off')
55
+ return null; // explicit env off overrides card
56
+ const card = (cardAnchor ?? '').trim().toLowerCase();
57
+ if (valid(card))
58
+ return card;
59
+ return null;
60
+ }
61
+ /** Do MCP / management / context tools ride along? Narrow arms suppress them
62
+ * (surface leak otherwise); full and lean keep them. */
63
+ export function isNarrowProfile(profile = resolveToolProfile()) {
64
+ return profile === 'bash-only' || profile === 'bash-plus' || profile === 'bash-edit';
65
+ }
35
66
  /**
36
67
  * Filter a tool list to the active profile.
37
68
  * - full: unchanged.
@@ -46,6 +77,10 @@ export function applyToolProfile(tools, profile = resolveToolProfile()) {
46
77
  return tools;
47
78
  if (profile === 'bash-only')
48
79
  return tools.filter((t) => BASH_ONLY.has(t.name));
80
+ if (profile === 'bash-plus')
81
+ return tools.filter((t) => BASH_PLUS.has(t.name));
82
+ if (profile === 'bash-edit')
83
+ return tools.filter((t) => BASH_EDIT.has(t.name));
49
84
  return tools.filter((t) => t.discoveryTier === 'essential' || ALWAYS_KEEP.has(t.name));
50
85
  }
51
86
  /** Is this tool callable under the active profile? (Dispatch-guard face —
@@ -57,6 +92,10 @@ export function isToolAllowedByProfile(name, lookupTier, profile = resolveToolPr
57
92
  return true;
58
93
  if (profile === 'bash-only')
59
94
  return BASH_ONLY.has(name);
95
+ if (profile === 'bash-plus')
96
+ return BASH_PLUS.has(name);
97
+ if (profile === 'bash-edit')
98
+ return BASH_EDIT.has(name);
60
99
  return lookupTier(name) === 'essential';
61
100
  }
62
101
  //# sourceMappingURL=ToolProfile.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"ToolProfile.js","sourceRoot":"","sources":["../../src/tools/ToolProfile.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;GAoBG;AAIH;;;6BAG6B;AAC7B,MAAM,WAAW,GAAG,IAAI,GAAG,CAAC,CAAC,SAAS,EAAE,iBAAiB,CAAC,CAAC,CAAC;AAE5D,sEAAsE;AACtE,MAAM,SAAS,GAAG,IAAI,GAAG,CAAC,CAAC,MAAM,EAAE,GAAG,WAAW,CAAC,CAAC,CAAC;AAEpD,MAAM,UAAU,kBAAkB,CAAC,MAAyB,OAAO,CAAC,GAAG;IACrE,MAAM,GAAG,GA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ACZ,UAAgD,EAChD,UAA2B,kBAAkB,EAAE;IAE/C,IAAI,OAAO,KAAK,MAAM;QAAE,OAAO,IAAI,CAAC;IACpC,IAAI,WAAW,CAAC,GAAG,CAAC,IAAI,CAAC;QAAE,OAAO,IAAI,CAAC;IACvC,IAAI,OAAO,KAAK,WAAW;QAAE,OAAO,SAAS,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC;IACxD,IAAI,OAAO,KAAK,WAAW;QAAE,OAAO,SAAS,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC;IACxD,IAAI,OAAO,KAAK,WAAW;QAAE,OAAO,SAAS,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC;IACxD,OAAO,UAAU,CAAC,IAAI,CAAC,KAAK,WAAW,CAAC;AAC1C,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nexus-cortex/core",
3
- "version": "4.63.7",
3
+ "version": "4.63.9",
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.63.7",
51
- "@nexus-cortex/types": "4.63.7",
50
+ "@nexus-cortex/executors": "4.63.9",
51
+ "@nexus-cortex/types": "4.63.9",
52
52
  "@types/uuid": "^10.0.0",
53
53
  "ajv": "^8.12.0",
54
54
  "chokidar": "^3.6.0",