@juspay/neurolink 11.29.1 → 11.30.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 +5 -1
- package/dist/adapters/video/vertexVideoHandler.d.ts +1 -0
- package/dist/adapters/video/vertexVideoHandler.js +97 -14
- package/dist/auth/anthropicOAuth.d.ts +50 -0
- package/dist/auth/anthropicOAuth.js +78 -0
- package/dist/browser/neurolink.min.js +393 -393
- package/dist/cli/commands/proxy.d.ts +2 -0
- package/dist/cli/commands/proxy.js +284 -4
- package/dist/cli/commands/proxyExpose.d.ts +35 -0
- package/dist/cli/commands/proxyExpose.js +252 -0
- package/dist/cli/commands/proxyPeer.d.ts +29 -0
- package/dist/cli/commands/proxyPeer.js +738 -0
- package/dist/cli/commands/proxyShare.d.ts +37 -0
- package/dist/cli/commands/proxyShare.js +1080 -0
- package/dist/cli/parser.js +7 -1
- package/dist/core/baseProvider.js +5 -0
- package/dist/proxy/peerStore.d.ts +52 -0
- package/dist/proxy/peerStore.js +324 -0
- package/dist/proxy/peerTransport.d.ts +38 -0
- package/dist/proxy/peerTransport.js +242 -0
- package/dist/proxy/proxyPaths.d.ts +8 -0
- package/dist/proxy/proxyPaths.js +55 -17
- package/dist/proxy/requestLogger.js +8 -0
- package/dist/proxy/residentGrants.d.ts +57 -0
- package/dist/proxy/residentGrants.js +393 -0
- package/dist/proxy/shareAudit.d.ts +81 -0
- package/dist/proxy/shareAudit.js +280 -0
- package/dist/proxy/shareContext.d.ts +38 -0
- package/dist/proxy/shareContext.js +92 -0
- package/dist/proxy/shareGate.d.ts +64 -0
- package/dist/proxy/shareGate.js +216 -0
- package/dist/proxy/shareGrants.d.ts +115 -0
- package/dist/proxy/shareGrants.js +590 -0
- package/dist/proxy/shareLease.d.ts +101 -0
- package/dist/proxy/shareLease.js +192 -0
- package/dist/proxy/shareLedger.d.ts +105 -0
- package/dist/proxy/shareLedger.js +406 -0
- package/dist/proxy/shareListener.d.ts +60 -0
- package/dist/proxy/shareListener.js +143 -0
- package/dist/proxy/shareNotes.d.ts +97 -0
- package/dist/proxy/shareNotes.js +234 -0
- package/dist/proxy/sharePolicy.d.ts +110 -0
- package/dist/proxy/sharePolicy.js +366 -0
- package/dist/proxy/shareProvisioning.d.ts +110 -0
- package/dist/proxy/shareProvisioning.js +237 -0
- package/dist/proxy/shareReceipts.d.ts +99 -0
- package/dist/proxy/shareReceipts.js +303 -0
- package/dist/proxy/shareSigning.d.ts +40 -0
- package/dist/proxy/shareSigning.js +78 -0
- package/dist/server/routes/claudeProxyRoutes.js +1066 -3
- package/dist/types/cli.d.ts +61 -0
- package/dist/types/proxy.d.ts +781 -0
- package/dist/types/video.d.ts +5 -0
- package/dist/utils/videoProcessor.js +27 -2
- package/package.json +3 -1
package/dist/types/video.d.ts
CHANGED
|
@@ -34,6 +34,11 @@ export type VideoGenerateOptions = VideoOutputOptions & {
|
|
|
34
34
|
* `generateTransition` method on `VideoHandler`.
|
|
35
35
|
*/
|
|
36
36
|
export type VideoTransitionOptions = {
|
|
37
|
+
/**
|
|
38
|
+
* Per-call cancellation signal forwarded to provider requests and polling
|
|
39
|
+
* loops — same contract as `VideoOutputOptions.abortSignal`.
|
|
40
|
+
*/
|
|
41
|
+
abortSignal?: AbortSignal;
|
|
37
42
|
aspectRatio?: "9:16" | "16:9" | "1:1" | string;
|
|
38
43
|
resolution?: "720p" | "1080p";
|
|
39
44
|
audio?: boolean;
|
|
@@ -84,6 +84,16 @@ export class VideoProcessor {
|
|
|
84
84
|
}
|
|
85
85
|
: optionsOrImage;
|
|
86
86
|
const { image, prompt, region, ...videoOptions } = bag;
|
|
87
|
+
// A fired timeout must also cancel the handler's own request/polling
|
|
88
|
+
// loop — otherwise the caller sees the rejection while a ghost
|
|
89
|
+
// generation keeps polling (and possibly billing) for the rest of the
|
|
90
|
+
// render. Chain the internal controller onto any caller-supplied
|
|
91
|
+
// signal so both cancellation sources reach the handler.
|
|
92
|
+
const timeoutAbort = new AbortController();
|
|
93
|
+
const abortSignal = videoOptions.abortSignal
|
|
94
|
+
? AbortSignal.any([videoOptions.abortSignal, timeoutAbort.signal])
|
|
95
|
+
: timeoutAbort.signal;
|
|
96
|
+
const handlerOptions = { ...videoOptions, abortSignal };
|
|
87
97
|
const span = SpanSerializer.createSpan(SpanType.MEDIA_GENERATION, "video.generate", this.buildSpanAttributes(provider, videoOptions));
|
|
88
98
|
try {
|
|
89
99
|
const handler = this.getHandler(provider);
|
|
@@ -111,13 +121,17 @@ export class VideoProcessor {
|
|
|
111
121
|
// Bounded per repo guideline (async provider calls wrap withTimeout):
|
|
112
122
|
// video generation is legitimately slow, so the deadline is generous —
|
|
113
123
|
// but a wedged handler must error, never hang the caller forever.
|
|
114
|
-
const result = await withTimeout(handler.generate(image, prompt,
|
|
124
|
+
const result = await withTimeout(handler.generate(image, prompt, handlerOptions, region), VIDEO_GENERATION_TIMEOUT_MS, `Video generation via "${provider}" timed out after ${VIDEO_GENERATION_TIMEOUT_MS}ms`);
|
|
115
125
|
const ended = SpanSerializer.endSpan(span, SpanStatus.OK);
|
|
116
126
|
getMetricsAggregator().recordSpan(ended);
|
|
117
127
|
logger.info(`[VideoProcessor] Generated ${result.data.length} bytes (${provider})`);
|
|
118
128
|
return result;
|
|
119
129
|
}
|
|
120
130
|
catch (err) {
|
|
131
|
+
// Cancel the ghost: on timeout the handler promise is still pending;
|
|
132
|
+
// aborting here stops its polling loop. On handler-originated errors
|
|
133
|
+
// the promise has already settled, so the abort is a no-op.
|
|
134
|
+
timeoutAbort.abort();
|
|
121
135
|
const ended = SpanSerializer.endSpan(span, SpanStatus.ERROR, err instanceof Error ? err.message : String(err));
|
|
122
136
|
getMetricsAggregator().recordSpan(ended);
|
|
123
137
|
if (err instanceof VideoError) {
|
|
@@ -174,11 +188,22 @@ export class VideoProcessor {
|
|
|
174
188
|
context: { provider },
|
|
175
189
|
});
|
|
176
190
|
}
|
|
191
|
+
// Same ghost-cancellation contract as generate(): a fired timeout
|
|
192
|
+
// aborts the handler's polling loop, chained onto any caller signal.
|
|
193
|
+
const timeoutAbort = new AbortController();
|
|
194
|
+
const abortSignal = options?.abortSignal
|
|
195
|
+
? AbortSignal.any([options.abortSignal, timeoutAbort.signal])
|
|
196
|
+
: timeoutAbort.signal;
|
|
197
|
+
const handlerOptions = {
|
|
198
|
+
...(options ?? {}),
|
|
199
|
+
abortSignal,
|
|
200
|
+
};
|
|
177
201
|
try {
|
|
178
202
|
// Same bound as generate(): a wedged transition must error, not hang.
|
|
179
|
-
return await withTimeout(handler.generateTransition(firstFrame, lastFrame, prompt,
|
|
203
|
+
return await withTimeout(handler.generateTransition(firstFrame, lastFrame, prompt, handlerOptions, region), VIDEO_GENERATION_TIMEOUT_MS, `Video transition via "${provider}" timed out after ${VIDEO_GENERATION_TIMEOUT_MS}ms`);
|
|
180
204
|
}
|
|
181
205
|
catch (err) {
|
|
206
|
+
timeoutAbort.abort();
|
|
182
207
|
if (err instanceof VideoError) {
|
|
183
208
|
throw err;
|
|
184
209
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@juspay/neurolink",
|
|
3
|
-
"version": "11.
|
|
3
|
+
"version": "11.30.0",
|
|
4
4
|
"packageManager": "pnpm@10.15.1",
|
|
5
5
|
"description": "TypeScript AI SDK with 24+ LLM providers behind one consistent API. MCP-native (connect any MCP server), voice TTS/STT/realtime, RAG, agents, memory, context compaction. OpenAI · Anthropic · Gemini · Bedrock · Azure · Ollama · DeepSeek · NVIDIA NIM and more.",
|
|
6
6
|
"author": {
|
|
@@ -83,6 +83,7 @@
|
|
|
83
83
|
"test:media": "pnpm exec tsx test/continuous-test-suite-media-gen.ts",
|
|
84
84
|
"test:media-registry-collisions": "pnpm exec tsx test/continuous-test-suite-media-registry-collisions.ts",
|
|
85
85
|
"test:memory": "pnpm exec tsx test/continuous-test-suite-memory.ts",
|
|
86
|
+
"test:proxy-sharing": "pnpm run build && pnpm exec tsx test/continuous-test-suite-proxy-sharing.ts",
|
|
86
87
|
"test:openai-compat-streaming-retry": "pnpm exec tsx test/continuous-test-suite-openai-compat-streaming-retry.ts",
|
|
87
88
|
"test:anthropic-streaming-retry": "pnpm exec tsx test/continuous-test-suite-anthropic-streaming-retry.ts",
|
|
88
89
|
"test:adjust-body-after-400": "pnpm exec tsx test/continuous-test-suite-adjust-body-after-400.ts",
|
|
@@ -114,6 +115,7 @@
|
|
|
114
115
|
"test:skills": "pnpm exec tsx test/continuous-test-suite-skills.ts",
|
|
115
116
|
"test:servers": "pnpm exec tsx test/continuous-test-suite-servers.ts",
|
|
116
117
|
"test:tool-reliability": "pnpm exec tsx test/continuous-test-suite-tool-reliability.ts",
|
|
118
|
+
"test:video-abort": "pnpm exec tsx test/continuous-test-suite-video-abort.ts",
|
|
117
119
|
"test:tts": "pnpm exec tsx test/continuous-test-suite-tts.ts",
|
|
118
120
|
"test:tts:unit": "pnpm exec tsx test/continuous-test-suite-tts-unit.ts",
|
|
119
121
|
"test:stt:unit": "pnpm exec tsx test/continuous-test-suite-stt-unit.ts",
|