@juspay/neurolink 13.4.4 → 13.4.5

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.
@@ -221,7 +221,7 @@ export const decideCommand = {
221
221
  })
222
222
  .example('$0 decide "Refund request for a damaged item" --questions \'{"urgent":{"type":"boolean","instructions":"Is this urgent?"}}\'', "Ask a single yes/no question")
223
223
  .example("$0 decide --state-file ticket.json --questions-file questions.json --format json", "Read state and questions from files, emit raw JSON")
224
- .example('$0 decide "What color is this?" --provider xor --image ./photo.png --questions \'{"color":{"type":"choice","instructions":"What color is the image?","criteria":{"red":"red","blue":"blue"}}}\'', "Ask about an image (XOR, Perplexity, Cloudflare Clef and OpenAI Decisions read images)"),
224
+ .example('$0 decide "What color is this?" --provider xor --model xor-omni --image ./photo.png --questions \'{"color":{"type":"choice","instructions":"What color is the image?","criteria":{"red":"red","blue":"blue"}}}\'', "Ask about an image (XOR with its xor-omni model, Perplexity, Cloudflare Clef and OpenAI Decisions read images)"),
225
225
  handler: async (argv) => {
226
226
  const outputFormat = argv.format ?? "text";
227
227
  // --- Validate before any provider work ---------------------------------
@@ -1777,6 +1777,8 @@ export declare enum XiaomiMimoModels {
1777
1777
  MIMO_V2_6_FLASH = "mimo-v2.6-flash"
1778
1778
  }
1779
1779
  export declare enum XorModels {
1780
+ XOR_LATEST = "xor-latest",
1781
+ XOR_OMNI = "xor-omni",
1780
1782
  XOR_1_1 = "xor-1.1"
1781
1783
  }
1782
1784
  export declare enum ZAiModels {
@@ -2104,6 +2104,8 @@ export var XiaomiMimoModels;
2104
2104
  })(XiaomiMimoModels || (XiaomiMimoModels = {}));
2105
2105
  export var XorModels;
2106
2106
  (function (XorModels) {
2107
+ XorModels["XOR_LATEST"] = "xor-latest";
2108
+ XorModels["XOR_OMNI"] = "xor-omni";
2107
2109
  XorModels["XOR_1_1"] = "xor-1.1";
2108
2110
  })(XorModels || (XorModels = {}));
2109
2111
  export var ZAiModels;
@@ -49,7 +49,7 @@ export class HITLManager extends EventEmitter {
49
49
  dangerousActions: config.dangerousActions,
50
50
  timeout: config.timeout ?? DEFAULT_TIMEOUT, // Default: 30 seconds
51
51
  confirmationMethod: config.confirmationMethod ?? "event", // Default: "event"
52
- allowArgumentModification: config.allowArgumentModification ?? DEFAULT_ALLOW_MODIFICATION, // Default: true
52
+ allowArgumentModification: config.allowArgumentModification ?? DEFAULT_ALLOW_MODIFICATION, // Default: false
53
53
  autoApproveOnTimeout: config.autoApproveOnTimeout ?? false, // Default: false (safe)
54
54
  autoApproveExclusions: Array.isArray(config.autoApproveExclusions)
55
55
  ? [...config.autoApproveExclusions]
@@ -334,9 +334,9 @@ export declare class NeuroLink {
334
334
  * @param config.enableOrchestration - Whether to enable smart model orchestration (default: false)
335
335
  * @param config.hitl - Configuration for Human-in-the-Loop safety features
336
336
  * @param config.hitl.enabled - Whether to enable HITL tool confirmation (default: false)
337
- * @param config.hitl.dangerousActions - Keywords that trigger confirmation (default: ['delete', 'remove', 'drop'])
337
+ * @param config.hitl.dangerousActions - Keywords that trigger confirmation; required when HITL is enabled
338
338
  * @param config.hitl.timeout - Confirmation timeout in milliseconds (default: 30000)
339
- * @param config.hitl.allowArgumentModification - Allow users to modify tool parameters (default: true)
339
+ * @param config.hitl.allowArgumentModification - Advertised to the approval UI as `allowModification` (default: false); not enforced, a response's `modifiedArguments` is applied either way
340
340
  * @param config.toolRegistry - Optional tool registry instance for advanced use cases (default: new MCPToolRegistry())
341
341
  *
342
342
  * @example
package/dist/neurolink.js CHANGED
@@ -242,13 +242,26 @@ const MEMORY_WRITE_TIMEOUT_MS = 30_000;
242
242
  *
243
243
  * @example With HITL security
244
244
  * ```typescript
245
+ * import type { ConfirmationRequestEvent } from '@juspay/neurolink';
246
+ *
245
247
  * const neurolink = new NeuroLink({
246
248
  * hitl: {
247
249
  * enabled: true,
248
- * requireApproval: ['writeFile', 'executeCode'],
249
- * confidenceThreshold: 0.85
250
+ * dangerousActions: ['writeFile', 'executeCode'],
251
+ * timeout: 30000
250
252
  * }
251
253
  * });
254
+ *
255
+ * // Approval is event-based; answer each request with the matching id
256
+ * const emitter = neurolink.getEventEmitter();
257
+ * emitter.on('hitl:confirmation-request', async (event) => {
258
+ * const { payload } = event as ConfirmationRequestEvent; // listeners are typed unknown
259
+ * const approved = await askUser(payload); // your approval UI
260
+ * emitter.emit('hitl:confirmation-response', {
261
+ * type: 'hitl:confirmation-response',
262
+ * payload: { confirmationId: payload.confirmationId, approved }
263
+ * });
264
+ * });
252
265
  * ```
253
266
  *
254
267
  * @example With Redis memory
@@ -1173,9 +1186,9 @@ export class NeuroLink {
1173
1186
  * @param config.enableOrchestration - Whether to enable smart model orchestration (default: false)
1174
1187
  * @param config.hitl - Configuration for Human-in-the-Loop safety features
1175
1188
  * @param config.hitl.enabled - Whether to enable HITL tool confirmation (default: false)
1176
- * @param config.hitl.dangerousActions - Keywords that trigger confirmation (default: ['delete', 'remove', 'drop'])
1189
+ * @param config.hitl.dangerousActions - Keywords that trigger confirmation; required when HITL is enabled
1177
1190
  * @param config.hitl.timeout - Confirmation timeout in milliseconds (default: 30000)
1178
- * @param config.hitl.allowArgumentModification - Allow users to modify tool parameters (default: true)
1191
+ * @param config.hitl.allowArgumentModification - Advertised to the approval UI as `allowModification` (default: false); not enforced, a response's `modifiedArguments` is applied either way
1179
1192
  * @param config.toolRegistry - Optional tool registry instance for advanced use cases (default: new MCPToolRegistry())
1180
1193
  *
1181
1194
  * @example
@@ -6,15 +6,29 @@
6
6
  "inferenceKinds": ["decide"],
7
7
  "wire": {},
8
8
  "models": {
9
- "default": "xor-1.1",
10
- "topModels": ["xor-1.1"],
9
+ "default": "xor-latest",
10
+ "topModels": ["xor-latest", "xor-omni"],
11
11
  "catalog": {
12
- "xor-1.1": {
12
+ "xor-latest": {
13
13
  "contextWindow": 250000,
14
14
  "maxOutputTokens": 256,
15
15
  "vision": false,
16
16
  "status": "production",
17
- "description": "Recommended - XOR 1.1, decision model that also reads images and video"
17
+ "description": "Recommended - XOR text alias; boolean, choice and score questions, 2 to 64 options each"
18
+ },
19
+ "xor-omni": {
20
+ "contextWindow": 250000,
21
+ "maxOutputTokens": 256,
22
+ "vision": true,
23
+ "status": "production",
24
+ "description": "XOR multimodal alias; reads images and video alongside the state, for boolean, choice and score questions"
25
+ },
26
+ "xor-1.1": {
27
+ "contextWindow": 250000,
28
+ "maxOutputTokens": 256,
29
+ "vision": false,
30
+ "status": "retired",
31
+ "description": "Name served by the deprecated /v1/systemone route; superseded by xor-latest and xor-omni. Still sent as given when you name it - the endpoint decides whether it accepts it"
18
32
  }
19
33
  }
20
34
  },
@@ -30,7 +44,7 @@
30
44
  "baseURLRequired": true,
31
45
  "baseURLNormalize": ["strip-trailing-slash", "strip-v1-suffix"],
32
46
  "baseURLShape": "origin",
33
- "endpoint": "{baseURL}/v1/systemone",
47
+ "endpoint": "{baseURL}/v1/decisions",
34
48
  "model": { "placement": "body" },
35
49
  "media": { "imagesKey": "images", "videoKey": "video" },
36
50
  "requestIdHeaders": [
@@ -71,14 +85,14 @@
71
85
  "description": "API key for your XOR endpoint",
72
86
  "instructions": [
73
87
  "1. Reach an XOR deployment, or use a LiteLLM proxy with a pass-through route to one",
74
- "2. Set XOR_BASE_URL to its origin (NeuroLink calls <XOR_BASE_URL>/v1/systemone)",
75
- "3. Set {apiKeyEnvVar} to the key it accepts (on LiteLLM, a virtual key whose team allows xor-1.1)"
88
+ "2. Set XOR_BASE_URL to its origin (NeuroLink calls <XOR_BASE_URL>/v1/decisions)",
89
+ "3. Set {apiKeyEnvVar} to the key it accepts (on LiteLLM, a virtual key whose team allows xor-latest, and xor-omni for media)"
76
90
  ]
77
91
  },
78
92
  "evidence": {
79
93
  "rosterVerified": {
80
- "date": "2026-09-29",
81
- "method": "The single model id xor-1.1 is the roster the hand-written XOR descriptor shipped; 2026-09-29 is the date it was added, not a date it was checked. The roster was never verified against a live XOR endpoint, and no live probe was run in this change"
94
+ "date": "2026-10-18",
95
+ "method": "POST <origin>/v1/decisions with model xor-latest and a 3-option choice question returned HTTP 200 with served model xor-text-2, through NeuroLink's decide(); a 65-option choice question returned HTTP 422 reading 2..64 options, got 65. A 64-option question returned 200 and 77 options returned 422 on both aliases when probed by hand the same day. A successful xor-omni answer, and any image, audio or video request, were not exercised. The figures contextWindow 250000, maxOutputTokens 256, the 200000-token state window and the media limits are carried over from xor-1.1, not re-measured for the aliases; xor-1.1 is kept only as a retired name"
82
96
  },
83
97
  "liveMatrix": null,
84
98
  "addedInPR": "https://github.com/juspay/neurolink/pull/1984"
@@ -18,7 +18,7 @@ export type HITLConfig = {
18
18
  timeout?: number;
19
19
  /** Communication method - currently only "event" is supported (default: "event") */
20
20
  confirmationMethod?: "event";
21
- /** Whether users can modify tool arguments during approval (default: true) */
21
+ /** Advertised to the approval UI as allowModification (default: false); not enforced, a response's modifiedArguments is applied either way */
22
22
  allowArgumentModification?: boolean;
23
23
  /** Auto-approve requests when they timeout (default: false - rejects on timeout) */
24
24
  autoApproveOnTimeout?: boolean;
@@ -72,7 +72,7 @@ export type ConfirmationResult = {
72
72
  approved: boolean;
73
73
  /** Optional reason for rejection (if approved is false) */
74
74
  reason?: string;
75
- /** User-modified arguments (if allowArgumentModification is enabled) */
75
+ /** User-modified arguments; applied whether or not allowArgumentModification is enabled */
76
76
  modifiedArguments?: unknown;
77
77
  /** Time taken for user to respond in milliseconds */
78
78
  responseTime: number;
@@ -107,7 +107,7 @@ export type ConfirmationRequestEvent = {
107
107
  };
108
108
  /** Confirmation timeout in milliseconds */
109
109
  timeoutMs: number;
110
- /** Whether user can modify arguments */
110
+ /** Hint for the approval UI, copied from allowArgumentModification; not enforced */
111
111
  allowModification: boolean;
112
112
  };
113
113
  };