@juspay/neurolink 12.13.0 → 12.14.1
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 +376 -376
- package/dist/cli/commands/proxy.d.ts +1 -0
- package/dist/cli/commands/proxy.js +52 -29
- package/dist/cli/proxy-clients/grok.d.ts +45 -0
- package/dist/cli/proxy-clients/grok.js +342 -0
- package/dist/cli/proxy-clients/registry.d.ts +2 -2
- package/dist/cli/proxy-clients/registry.js +4 -2
- package/dist/constants/proxyModels.d.ts +7 -1
- package/dist/constants/proxyModels.js +7 -1
- package/dist/proxy/bodyCaptureProcessing.d.ts +1 -1
- package/dist/proxy/bodyCaptureProcessing.js +10 -0
- package/dist/proxy/bodyCaptureWorker.d.ts +1 -1
- package/dist/proxy/clientAttribution.js +3 -0
- package/dist/proxy/logCleanupScheduler.js +4 -0
- package/dist/proxy/otelLogSink.d.ts +34 -0
- package/dist/proxy/otelLogSink.js +254 -0
- package/dist/proxy/proxyConfig.d.ts +4 -0
- package/dist/proxy/proxyConfig.js +13 -1
- package/dist/proxy/proxyLifecycle.js +31 -1
- package/dist/proxy/requestLogger.js +45 -10
- package/dist/proxy/workerLog.js +4 -0
- package/dist/types/proxy.d.ts +4 -0
- package/dist/types/proxyClient.d.ts +34 -1
- package/docs-site/static/search-index.json +1 -1
- package/package.json +1 -1
package/dist/proxy/workerLog.js
CHANGED
|
@@ -1,8 +1,12 @@
|
|
|
1
|
+
import { isProxyOtelOnly } from "./otelLogSink.js";
|
|
1
2
|
import { chmodSync, closeSync, existsSync, mkdirSync, openSync, statSync, } from "node:fs";
|
|
2
3
|
import { homedir } from "node:os";
|
|
3
4
|
import { basename, join } from "node:path";
|
|
4
5
|
/** Open a restrictive worker log without making proxy startup depend on it. */
|
|
5
6
|
export function openProxyWorkerLog(filename, logDir = join(homedir(), ".neurolink", "logs")) {
|
|
7
|
+
if (isProxyOtelOnly()) {
|
|
8
|
+
return { stdio: "ignore", close: () => undefined };
|
|
9
|
+
}
|
|
6
10
|
let fd;
|
|
7
11
|
try {
|
|
8
12
|
if (basename(filename) !== filename) {
|
package/dist/types/proxy.d.ts
CHANGED
|
@@ -644,6 +644,8 @@ export type ProxyBodyCaptureWorkerSnapshot = {
|
|
|
644
644
|
lastError?: string;
|
|
645
645
|
};
|
|
646
646
|
export type ProxyRequestLoggerSnapshot = {
|
|
647
|
+
diskEnabled?: boolean;
|
|
648
|
+
otel?: ReturnType<typeof import("../proxy/otelLogSink.js").getProxyOtelLogSnapshot>;
|
|
647
649
|
bodyCapture?: ProxyBodyCaptureWorkerSnapshot;
|
|
648
650
|
enabled: boolean;
|
|
649
651
|
requests: ProxyRequestLogSinkSnapshot;
|
|
@@ -1685,6 +1687,8 @@ export type ProxyRuntimeSample = {
|
|
|
1685
1687
|
};
|
|
1686
1688
|
/** Data-quality counters for the bounded lifecycle metadata sink. */
|
|
1687
1689
|
export type ProxyLifecycleLoggerSnapshot = {
|
|
1690
|
+
sink?: "otel" | "file";
|
|
1691
|
+
admissionPolicy?: "best-effort" | "durable-file";
|
|
1688
1692
|
enabled: boolean;
|
|
1689
1693
|
schemaVersion: number;
|
|
1690
1694
|
processInstanceId: string;
|
|
@@ -1,4 +1,14 @@
|
|
|
1
1
|
import type { JsonObject } from "./common.js";
|
|
2
|
+
/** Options forwarded through `applyAllClients` into a configurator's `apply`. */
|
|
3
|
+
export type CliProxyClientApplyOptions = {
|
|
4
|
+
/**
|
|
5
|
+
* Absolute path of the proxy routing config this process loaded.
|
|
6
|
+
* The Grok writer reads `routing.model-mappings` from this file so a
|
|
7
|
+
* `proxy start --config` catalog matches `/v1/models`. Omit to use
|
|
8
|
+
* `~/.neurolink/proxy-config.yaml`.
|
|
9
|
+
*/
|
|
10
|
+
configPath?: string;
|
|
11
|
+
};
|
|
2
12
|
/**
|
|
3
13
|
* One AI coding CLI the proxy can point at itself.
|
|
4
14
|
*
|
|
@@ -22,7 +32,7 @@ export type CliProxyClientConfigurator = {
|
|
|
22
32
|
* suffix its CLI needs. Returns false when nothing was written, so callers
|
|
23
33
|
* never print a success message for work that did not happen.
|
|
24
34
|
*/
|
|
25
|
-
apply: (proxyBaseUrl: string) => Promise<boolean>;
|
|
35
|
+
apply: (proxyBaseUrl: string, options?: CliProxyClientApplyOptions) => Promise<boolean>;
|
|
26
36
|
/**
|
|
27
37
|
* Restore the user's previous configuration. `proxyBaseUrl` is the same bare
|
|
28
38
|
* origin; a configurator that finds a different URL configured must leave it
|
|
@@ -77,6 +87,29 @@ export type CliOpenCodeSnapshot = {
|
|
|
77
87
|
/** What the writer last wrote, so apply() can recognise its own block. */
|
|
78
88
|
written?: unknown;
|
|
79
89
|
};
|
|
90
|
+
/**
|
|
91
|
+
* One Grok Build picker entry the proxy writer emits under `[model.<id>]`.
|
|
92
|
+
*
|
|
93
|
+
* `contextWindow` is Grok's compaction limit and must be <= the upstream
|
|
94
|
+
* model's window. `supportsReasoningEffort` is false when Grok's `xhigh`
|
|
95
|
+
* would become Anthropic adaptive thinking that the model rejects.
|
|
96
|
+
*/
|
|
97
|
+
export type CliGrokProxyModelSpec = {
|
|
98
|
+
id: string;
|
|
99
|
+
name: string;
|
|
100
|
+
apiBackend: "messages" | "chat_completions";
|
|
101
|
+
contextWindow: number;
|
|
102
|
+
maxCompletionTokens: number;
|
|
103
|
+
supportsReasoningEffort: boolean;
|
|
104
|
+
};
|
|
105
|
+
/**
|
|
106
|
+
* Snapshot of whether `~/.grok/config.toml` existed before the proxy wrote
|
|
107
|
+
* its managed block. Persisted to `~/.neurolink/grok-proxy-snapshot.json`.
|
|
108
|
+
*/
|
|
109
|
+
export type CliGrokSnapshot = {
|
|
110
|
+
originalExisted: boolean;
|
|
111
|
+
writtenBaseUrl: string;
|
|
112
|
+
};
|
|
80
113
|
/**
|
|
81
114
|
* Snapshot of the user's pre-existing Gemini CLI `~/.gemini/.env`.
|
|
82
115
|
*
|