@juspay/neurolink 12.49.20 → 12.51.0
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/CHANGELOG.md +3 -3
- package/dist/browser/neurolink.min.js +671 -671
- package/dist/cli/commands/setup.d.ts +7 -5
- package/dist/cli/commands/setup.js +10 -8
- package/dist/constants/enums.d.ts +7 -15
- package/dist/constants/enums.js +8 -16
- package/dist/core/conversationMemoryManager.js +10 -4
- package/dist/core/redisConversationMemoryManager.js +6 -5
- package/dist/factories/providerDescriptors.d.ts +17 -3
- package/dist/factories/providerDescriptors.js +81 -56
- package/dist/factories/providerRegistry.d.ts +9 -1
- package/dist/factories/providerRegistry.js +19 -9
- package/dist/models/manifestRegistry.js +40 -3
- package/dist/neurolink.d.ts +52 -1
- package/dist/neurolink.js +195 -0
- package/dist/providers/catalog/index.generated.d.ts +3 -1
- package/dist/providers/catalog/index.generated.js +11 -0
- package/dist/providers/catalog/laya.json +107 -0
- package/dist/providers/catalog/loader.d.ts +7 -4
- package/dist/providers/catalog/loader.js +10 -3
- package/dist/providers/catalog/provider-catalog.schema.json +218 -11
- package/dist/providers/catalog/schema.d.ts +11 -9
- package/dist/providers/catalog/schema.js +333 -59
- package/dist/providers/configuredDecision.d.ts +23 -0
- package/dist/providers/configuredDecision.js +111 -0
- package/dist/providers/decide/baseUrl.d.ts +2 -0
- package/dist/providers/decide/baseUrl.js +14 -0
- package/dist/providers/decide/errors.d.ts +8 -0
- package/dist/providers/decide/errors.js +57 -0
- package/dist/providers/decide/formatters.d.ts +2 -0
- package/dist/providers/decide/formatters.js +4 -0
- package/dist/providers/decide/paths.d.ts +1 -0
- package/dist/providers/decide/paths.js +21 -0
- package/dist/providers/decide/template.d.ts +3 -0
- package/dist/providers/decide/template.js +13 -0
- package/dist/types/conversation.d.ts +109 -0
- package/dist/types/livekit.d.ts +246 -3
- package/dist/types/providerCatalog.d.ts +74 -1
- package/dist/types/providerCatalog.generated.d.ts +2 -2
- package/dist/types/providers.d.ts +12 -9
- package/dist/types/sdk.d.ts +1 -1
- package/dist/types/stream.d.ts +8 -1
- package/dist/utils/conversationTurnIdentity.d.ts +24 -0
- package/dist/utils/conversationTurnIdentity.js +81 -0
- package/dist/utils/modelChoices.js +11 -25
- package/dist/utils/providerConfig.d.ts +0 -5
- package/dist/utils/providerConfig.js +0 -17
- package/dist/voice/livekit/brain.js +10 -7
- package/dist/voice/livekit/index.d.ts +2 -0
- package/dist/voice/livekit/index.js +2 -0
- package/dist/voice/livekit/memoryBinding.d.ts +47 -0
- package/dist/voice/livekit/memoryBinding.js +152 -0
- package/dist/voice/livekit/realtimeMcpTools.js +20 -1
- package/dist/voice/livekit/realtimeMemory.d.ts +22 -0
- package/dist/voice/livekit/realtimeMemory.js +111 -0
- package/dist/voice/livekit/realtimeVoiceAgent.js +40 -1
- package/dist/voice/livekit/turnRecorder.d.ts +38 -0
- package/dist/voice/livekit/turnRecorder.js +362 -0
- package/dist/voice/livekit/voiceAgent.js +43 -5
- package/docs-site/static/search-index.json +8 -7
- package/package.json +7 -2
- package/dist/models/manifests/laya.d.ts +0 -12
- package/dist/models/manifests/laya.js +0 -54
- package/dist/providers/laya.d.ts +0 -40
- package/dist/providers/laya.js +0 -152
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"$schema": "http://json-schema.org/draft-07/schema#",
|
|
3
|
-
"$comment": "Documentation-grade mirror of src/lib/providers/catalog/schema.ts for editor red-squiggle validation. The zod schema is authoritative \u2014 keep this file in sync by hand when that one changes. This mirror cannot express the zod schema's cross-field refinements (e.g. models.default must be a key of models.catalog, wire's baseURL-XOR-baseURLTemplate rule, errorRules requiring status or pattern); those are enforced only at parse time by parseProviderCatalogJson.",
|
|
3
|
+
"$comment": "Documentation-grade mirror of src/lib/providers/catalog/schema.ts for editor red-squiggle validation. The zod schema is authoritative \u2014 keep this file in sync by hand when that one changes. This mirror cannot express the zod schema's cross-field refinements (e.g. models.default must be a key of models.catalog, wire's baseURL-XOR-baseURLTemplate rule, errorRules requiring status or pattern); those are enforced only at parse time by parseProviderCatalogJson (chat entries) or parseCatalogEntry (entries that set inferenceKinds). The if/then/else near the end lists which keys each kind requires and forbids.",
|
|
4
4
|
"title": "NeuroLink Provider Catalog",
|
|
5
5
|
"type": "object",
|
|
6
6
|
"additionalProperties": false,
|
|
@@ -8,11 +8,8 @@
|
|
|
8
8
|
"id",
|
|
9
9
|
"displayName",
|
|
10
10
|
"aliases",
|
|
11
|
-
"tier",
|
|
12
11
|
"wire",
|
|
13
12
|
"models",
|
|
14
|
-
"capabilities",
|
|
15
|
-
"errorRules",
|
|
16
13
|
"setup",
|
|
17
14
|
"evidence"
|
|
18
15
|
],
|
|
@@ -43,9 +40,147 @@
|
|
|
43
40
|
"type": "string"
|
|
44
41
|
}
|
|
45
42
|
},
|
|
43
|
+
"inferenceKinds": {
|
|
44
|
+
"const": ["decide"],
|
|
45
|
+
"description": "Present on decide entries only; its absence makes the file a chat entry."
|
|
46
|
+
},
|
|
46
47
|
"tier": {
|
|
47
48
|
"const": 2
|
|
48
49
|
},
|
|
50
|
+
"decisionLimits": {
|
|
51
|
+
"type": "object",
|
|
52
|
+
"additionalProperties": false,
|
|
53
|
+
"required": ["maxStateTokens"],
|
|
54
|
+
"description": "Decide entries only. Input the provider can read; a request over a limit is refused before any network call.",
|
|
55
|
+
"properties": {
|
|
56
|
+
"maxStateTokens": { "type": "integer", "minimum": 1 },
|
|
57
|
+
"maxQuestions": { "type": "integer", "minimum": 1 },
|
|
58
|
+
"nonAsciiTokensPerChar": { "type": "number", "exclusiveMinimum": 0 },
|
|
59
|
+
"digitTokensPerChar": { "type": "number", "exclusiveMinimum": 0 },
|
|
60
|
+
"symbolTokensPerChar": { "type": "number", "exclusiveMinimum": 0 },
|
|
61
|
+
"astralTokensPerChar": { "type": "number", "exclusiveMinimum": 0 },
|
|
62
|
+
"advisory": { "type": "boolean" },
|
|
63
|
+
"models": {
|
|
64
|
+
"type": "object",
|
|
65
|
+
"description": "Per-model limits keyed by a models.catalog key (enforced by the zod schema).",
|
|
66
|
+
"additionalProperties": {
|
|
67
|
+
"type": "object",
|
|
68
|
+
"additionalProperties": false,
|
|
69
|
+
"required": ["maxStateTokens"],
|
|
70
|
+
"properties": {
|
|
71
|
+
"maxStateTokens": { "type": "integer", "minimum": 1 },
|
|
72
|
+
"nonAsciiTokensPerChar": {
|
|
73
|
+
"type": "number",
|
|
74
|
+
"exclusiveMinimum": 0
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
}
|
|
80
|
+
},
|
|
81
|
+
"decide": {
|
|
82
|
+
"type": "object",
|
|
83
|
+
"additionalProperties": false,
|
|
84
|
+
"required": ["dialect", "order", "endpoint", "model", "errors"],
|
|
85
|
+
"description": "Decide entries only: how a decision provider is called and how its errors are classified.",
|
|
86
|
+
"properties": {
|
|
87
|
+
"dialect": { "enum": ["system-one"] },
|
|
88
|
+
"order": {
|
|
89
|
+
"type": "integer",
|
|
90
|
+
"minimum": 1,
|
|
91
|
+
"description": "Decision order; lower runs first and every decide provider's order is unique."
|
|
92
|
+
},
|
|
93
|
+
"baseURLRequired": {
|
|
94
|
+
"type": "boolean",
|
|
95
|
+
"description": "True when the provider has no built-in endpoint. wire must then set neither baseURL nor baseURLTemplate, and endpoint must contain {baseURL}."
|
|
96
|
+
},
|
|
97
|
+
"baseURLNormalize": {
|
|
98
|
+
"type": "array",
|
|
99
|
+
"items": { "enum": ["strip-trailing-slash"] }
|
|
100
|
+
},
|
|
101
|
+
"endpoint": {
|
|
102
|
+
"type": "string",
|
|
103
|
+
"minLength": 1,
|
|
104
|
+
"description": "Request URL. {baseURL} is the only placeholder."
|
|
105
|
+
},
|
|
106
|
+
"model": {
|
|
107
|
+
"type": "object",
|
|
108
|
+
"additionalProperties": false,
|
|
109
|
+
"required": ["placement"],
|
|
110
|
+
"properties": {
|
|
111
|
+
"placement": { "enum": ["body", "body-unless-alias"] },
|
|
112
|
+
"alias": {
|
|
113
|
+
"type": "string",
|
|
114
|
+
"minLength": 1,
|
|
115
|
+
"description": "A models.catalog key that means send no model. Only with placement body-unless-alias."
|
|
116
|
+
}
|
|
117
|
+
}
|
|
118
|
+
},
|
|
119
|
+
"requestIdHeaders": {
|
|
120
|
+
"type": "array",
|
|
121
|
+
"items": {
|
|
122
|
+
"type": "string",
|
|
123
|
+
"pattern": "^[!#$%&'*+.^_`|~0-9A-Za-z-]+$"
|
|
124
|
+
}
|
|
125
|
+
},
|
|
126
|
+
"response": {
|
|
127
|
+
"type": "object",
|
|
128
|
+
"additionalProperties": false,
|
|
129
|
+
"properties": {
|
|
130
|
+
"modelPaths": {
|
|
131
|
+
"type": "array",
|
|
132
|
+
"items": { "$ref": "#/definitions/decidePath" }
|
|
133
|
+
}
|
|
134
|
+
}
|
|
135
|
+
},
|
|
136
|
+
"errors": {
|
|
137
|
+
"type": "object",
|
|
138
|
+
"additionalProperties": false,
|
|
139
|
+
"required": ["rules", "default", "bodyShapes"],
|
|
140
|
+
"properties": {
|
|
141
|
+
"rules": {
|
|
142
|
+
"type": "array",
|
|
143
|
+
"items": {
|
|
144
|
+
"type": "object",
|
|
145
|
+
"additionalProperties": false,
|
|
146
|
+
"required": ["kind"],
|
|
147
|
+
"properties": {
|
|
148
|
+
"status": {
|
|
149
|
+
"anyOf": [
|
|
150
|
+
{ "$ref": "#/definitions/httpStatus" },
|
|
151
|
+
{
|
|
152
|
+
"type": "array",
|
|
153
|
+
"minItems": 1,
|
|
154
|
+
"items": { "$ref": "#/definitions/httpStatus" }
|
|
155
|
+
}
|
|
156
|
+
]
|
|
157
|
+
},
|
|
158
|
+
"statusMin": { "$ref": "#/definitions/httpStatus" },
|
|
159
|
+
"kind": { "$ref": "#/definitions/decisionErrorKind" },
|
|
160
|
+
"retryable": { "type": "boolean" }
|
|
161
|
+
}
|
|
162
|
+
}
|
|
163
|
+
},
|
|
164
|
+
"default": { "$ref": "#/definitions/decisionErrorKind" },
|
|
165
|
+
"bodyShapes": {
|
|
166
|
+
"type": "array",
|
|
167
|
+
"items": {
|
|
168
|
+
"type": "object",
|
|
169
|
+
"additionalProperties": false,
|
|
170
|
+
"required": ["path"],
|
|
171
|
+
"properties": {
|
|
172
|
+
"path": { "$ref": "#/definitions/decidePath" },
|
|
173
|
+
"isArray": { "type": "boolean" },
|
|
174
|
+
"formatter": { "enum": ["fastapi-validation"] },
|
|
175
|
+
"kind": { "$ref": "#/definitions/decisionErrorKind" },
|
|
176
|
+
"retryable": { "type": "boolean" }
|
|
177
|
+
}
|
|
178
|
+
}
|
|
179
|
+
}
|
|
180
|
+
}
|
|
181
|
+
}
|
|
182
|
+
}
|
|
183
|
+
},
|
|
49
184
|
"wire": {
|
|
50
185
|
"type": "object",
|
|
51
186
|
"additionalProperties": false,
|
|
@@ -94,13 +229,7 @@
|
|
|
94
229
|
"models": {
|
|
95
230
|
"type": "object",
|
|
96
231
|
"additionalProperties": false,
|
|
97
|
-
"required": [
|
|
98
|
-
"default",
|
|
99
|
-
"fallbacks",
|
|
100
|
-
"defaultContextWindow",
|
|
101
|
-
"defaultMaxOutputTokens",
|
|
102
|
-
"catalog"
|
|
103
|
-
],
|
|
232
|
+
"required": ["default", "catalog"],
|
|
104
233
|
"properties": {
|
|
105
234
|
"default": {
|
|
106
235
|
"type": "string"
|
|
@@ -261,6 +390,12 @@
|
|
|
261
390
|
"pattern": {
|
|
262
391
|
"type": "string"
|
|
263
392
|
},
|
|
393
|
+
"patternStatuses": {
|
|
394
|
+
"type": "array",
|
|
395
|
+
"items": { "type": "integer" },
|
|
396
|
+
"minItems": 1,
|
|
397
|
+
"description": "Restrict pattern to these HTTP statuses; status matching stays independent."
|
|
398
|
+
},
|
|
264
399
|
"class": {
|
|
265
400
|
"type": "string",
|
|
266
401
|
"enum": [
|
|
@@ -322,6 +457,11 @@
|
|
|
322
457
|
},
|
|
323
458
|
"streamMs": {
|
|
324
459
|
"type": "number"
|
|
460
|
+
},
|
|
461
|
+
"decideMs": {
|
|
462
|
+
"type": "integer",
|
|
463
|
+
"minimum": 1,
|
|
464
|
+
"description": "Decide entries only: the per-call budget for decide(), in milliseconds. When omitted, the base provider's default timeout applies."
|
|
325
465
|
}
|
|
326
466
|
}
|
|
327
467
|
},
|
|
@@ -396,7 +536,74 @@
|
|
|
396
536
|
}
|
|
397
537
|
}
|
|
398
538
|
},
|
|
539
|
+
"if": { "required": ["inferenceKinds"] },
|
|
540
|
+
"then": {
|
|
541
|
+
"required": ["decide"],
|
|
542
|
+
"not": {
|
|
543
|
+
"anyOf": [
|
|
544
|
+
{ "required": ["capabilities"] },
|
|
545
|
+
{ "required": ["quirks"] },
|
|
546
|
+
{ "required": ["errorRules"] },
|
|
547
|
+
{ "required": ["autoSelectPriority"] }
|
|
548
|
+
]
|
|
549
|
+
},
|
|
550
|
+
"properties": {
|
|
551
|
+
"models": {
|
|
552
|
+
"properties": {
|
|
553
|
+
"fallbacks": false,
|
|
554
|
+
"fallbackModelName": false,
|
|
555
|
+
"registryDefaultModel": false,
|
|
556
|
+
"defaultContextWindow": false,
|
|
557
|
+
"defaultMaxOutputTokens": false,
|
|
558
|
+
"visionModel": false
|
|
559
|
+
}
|
|
560
|
+
},
|
|
561
|
+
"timeouts": { "properties": { "generateMs": false, "streamMs": false } },
|
|
562
|
+
"wire": {
|
|
563
|
+
"properties": {
|
|
564
|
+
"baseURLTemplate": false,
|
|
565
|
+
"extraCredentials": false,
|
|
566
|
+
"missingCredentialMessage": false,
|
|
567
|
+
"apiKeyFallbackEnvVars": false
|
|
568
|
+
}
|
|
569
|
+
}
|
|
570
|
+
}
|
|
571
|
+
},
|
|
572
|
+
"else": {
|
|
573
|
+
"required": ["capabilities", "errorRules"],
|
|
574
|
+
"not": {
|
|
575
|
+
"anyOf": [{ "required": ["decide"] }, { "required": ["decisionLimits"] }]
|
|
576
|
+
},
|
|
577
|
+
"properties": {
|
|
578
|
+
"models": {
|
|
579
|
+
"required": [
|
|
580
|
+
"fallbacks",
|
|
581
|
+
"defaultContextWindow",
|
|
582
|
+
"defaultMaxOutputTokens"
|
|
583
|
+
]
|
|
584
|
+
},
|
|
585
|
+
"timeouts": { "properties": { "decideMs": false } }
|
|
586
|
+
}
|
|
587
|
+
},
|
|
399
588
|
"definitions": {
|
|
589
|
+
"httpStatus": { "type": "integer", "minimum": 100, "maximum": 599 },
|
|
590
|
+
"decisionErrorKind": {
|
|
591
|
+
"enum": [
|
|
592
|
+
"authentication",
|
|
593
|
+
"invalid_request",
|
|
594
|
+
"max_tokens_exceeded",
|
|
595
|
+
"rate_limit",
|
|
596
|
+
"overloaded",
|
|
597
|
+
"server",
|
|
598
|
+
"timeout",
|
|
599
|
+
"network"
|
|
600
|
+
]
|
|
601
|
+
},
|
|
602
|
+
"decidePath": {
|
|
603
|
+
"type": "string",
|
|
604
|
+
"minLength": 1,
|
|
605
|
+
"description": "Dot-separated segments without whitespace; never __proto__, constructor or prototype."
|
|
606
|
+
},
|
|
400
607
|
"probeEvidence": {
|
|
401
608
|
"type": "object",
|
|
402
609
|
"additionalProperties": false,
|
|
@@ -9,15 +9,9 @@
|
|
|
9
9
|
* editor validation only — this file is the authoritative validator.
|
|
10
10
|
*/
|
|
11
11
|
import { z } from "zod";
|
|
12
|
-
import type { ProviderCatalogJson } from "../../types/index.js";
|
|
12
|
+
import type { CatalogEntry, DecideCatalogJson, ProviderCatalogJson } from "../../types/index.js";
|
|
13
13
|
export declare const providerCatalogJsonSchema: z.ZodObject<{
|
|
14
|
-
|
|
15
|
-
id: z.ZodString;
|
|
16
|
-
displayName: z.ZodString;
|
|
17
|
-
enumTypeName: z.ZodOptional<z.ZodString>;
|
|
18
|
-
credentialsKey: z.ZodOptional<z.ZodString>;
|
|
19
|
-
aliases: z.ZodArray<z.ZodString>;
|
|
20
|
-
tier: z.ZodLiteral<2>;
|
|
14
|
+
tier: z.ZodOptional<z.ZodLiteral<2>>;
|
|
21
15
|
wire: z.ZodObject<{
|
|
22
16
|
baseURL: z.ZodOptional<z.ZodString>;
|
|
23
17
|
baseURLTemplate: z.ZodOptional<z.ZodString>;
|
|
@@ -100,9 +94,9 @@ export declare const providerCatalogJsonSchema: z.ZodObject<{
|
|
|
100
94
|
url: z.ZodString;
|
|
101
95
|
apiKeyFormat: z.ZodNullable<z.ZodString>;
|
|
102
96
|
billingPolicy: z.ZodEnum<{
|
|
103
|
-
"no-free-tier": "no-free-tier";
|
|
104
97
|
"free-tier": "free-tier";
|
|
105
98
|
"free-with-card": "free-with-card";
|
|
99
|
+
"no-free-tier": "no-free-tier";
|
|
106
100
|
"promotional-credit": "promotional-credit";
|
|
107
101
|
}>;
|
|
108
102
|
instructions: z.ZodArray<z.ZodString>;
|
|
@@ -133,5 +127,13 @@ export declare const providerCatalogJsonSchema: z.ZodObject<{
|
|
|
133
127
|
}, z.core.$strict>>;
|
|
134
128
|
addedInPR: z.ZodString;
|
|
135
129
|
}, z.core.$strict>;
|
|
130
|
+
$schema: z.ZodOptional<z.ZodString>;
|
|
131
|
+
id: z.ZodString;
|
|
132
|
+
displayName: z.ZodString;
|
|
133
|
+
enumTypeName: z.ZodOptional<z.ZodString>;
|
|
134
|
+
credentialsKey: z.ZodOptional<z.ZodString>;
|
|
135
|
+
aliases: z.ZodArray<z.ZodString>;
|
|
136
136
|
}, z.core.$strict>;
|
|
137
|
+
export declare function parseCatalogEntry(raw: unknown, sourcePath?: string): CatalogEntry;
|
|
138
|
+
export declare function isDecideCatalogEntry(entry: CatalogEntry): entry is DecideCatalogJson;
|
|
137
139
|
export declare function parseProviderCatalogJson(raw: unknown, sourcePath: string): ProviderCatalogJson;
|