@t0ken.ai/memoryx-openclaw-plugin 2.2.72 → 2.2.73
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/dist/constants.d.ts +1 -1
- package/dist/constants.js +1 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +4 -0
- package/dist/sidecar.d.ts +1 -0
- package/dist/sidecar.d.ts.map +1 -1
- package/dist/sidecar.js +6 -4
- package/package.json +1 -1
package/dist/constants.d.ts
CHANGED
package/dist/constants.js
CHANGED
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
import * as path from "path";
|
|
5
5
|
import * as os from "os";
|
|
6
6
|
// Plugin version - synced from package.json by prebuild script
|
|
7
|
-
export const PLUGIN_VERSION = "2.2.
|
|
7
|
+
export const PLUGIN_VERSION = "2.2.73";
|
|
8
8
|
export const DEFAULT_API_BASE = "https://t0ken.ai/api";
|
|
9
9
|
export const PLUGIN_DIR = path.join(os.homedir(), ".openclaw", "extensions", "memoryx-openclaw-plugin");
|
|
10
10
|
/** 真实上游 baseUrl 缓存文件:重启后若配置已被改成 localhost,从此文件恢复各厂商真实地址。 */
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAEH,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,YAAY,CAAC;AAG/C,OAAO,EAAE,aAAa,EAAU,MAAM,kBAAkB,CAAC;;;;;;kBAwBvC,GAAG,iBAAiB,YAAY,GAAG,IAAI;;AARzD,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAEH,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,YAAY,CAAC;AAG/C,OAAO,EAAE,aAAa,EAAU,MAAM,kBAAkB,CAAC;;;;;;kBAwBvC,GAAG,iBAAiB,YAAY,GAAG,IAAI;;AARzD,wBA6IE;AAEF,OAAO,EAAE,aAAa,EAAE,CAAC"}
|
package/dist/index.js
CHANGED
|
@@ -101,11 +101,15 @@ export default {
|
|
|
101
101
|
const credentials = extractProviderCredentials(api.config);
|
|
102
102
|
const defaults = getDefaultModelAndProvider(credentials, api.config);
|
|
103
103
|
const realUpstreamCredentials = realUpstreamCredentialsForSidecar(credentials, savedRealUpstreamUrls);
|
|
104
|
+
const agentTimeoutSeconds = runtimeSnapshot?.agents?.defaults?.timeoutSeconds ||
|
|
105
|
+
api.config?.agents?.defaults?.timeoutSeconds ||
|
|
106
|
+
600;
|
|
104
107
|
sidecar = new SidecarServer(realUpstreamCredentials, { model: defaults.model, provider: defaults.provider }, defaults.availableProviders, {
|
|
105
108
|
proxyUrl,
|
|
106
109
|
getSDK,
|
|
107
110
|
pluginConfig,
|
|
108
111
|
onStarted: (logFile) => api.logger.info(`[MemoryX] Plugin log file: ${logFile}`),
|
|
112
|
+
agentTimeoutSeconds,
|
|
109
113
|
});
|
|
110
114
|
await sidecar.start();
|
|
111
115
|
api.logger.info(`[MemoryX] Sidecar started on port ${sidecar.getPort()}`);
|
package/dist/sidecar.d.ts
CHANGED
package/dist/sidecar.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sidecar.d.ts","sourceRoot":"","sources":["../src/sidecar.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAGH,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,YAAY,CAAC;AACtD,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,YAAY,CAAC;AAK/C,MAAM,MAAM,MAAM,GAAG,CAAC,MAAM,CAAC,EAAE,YAAY,KAAK,OAAO,CAAC,GAAG,CAAC,CAAC;AAE7D,MAAM,WAAW,cAAc;IAC3B,QAAQ,EAAE,MAAM,CAAC;IACjB,MAAM,EAAE,MAAM,CAAC;IACf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,KAAK,IAAI,OAAO,CAAC,IAAI,CAAC;IA2BtB,IAAI,IAAI,OAAO,CAAC,IAAI,CAAC;IAa3B,OAAO,IAAI,MAAM;YAMH,UAAU;IAuBxB,OAAO,CAAC,aAAa;IAIrB;;;;OAIG;YACW,kBAAkB;YA8GlB,aAAa;IA+M3B,OAAO,CAAC,QAAQ;CAQnB"}
|
package/dist/sidecar.js
CHANGED
|
@@ -125,7 +125,8 @@ export class SidecarServer {
|
|
|
125
125
|
}
|
|
126
126
|
log(`[Sidecar] ${reqId} fallback → ${provider} ${upstreamUrl} model=${fallbackBody.model} fmt=${requestFormat}`, { console: true });
|
|
127
127
|
const stream = !!fallbackBody.stream;
|
|
128
|
-
const
|
|
128
|
+
const fallbackAgentMs = (this.options.agentTimeoutSeconds || 600) * 1_000;
|
|
129
|
+
const timeout = stream ? Math.round(fallbackAgentMs * 1.2) : 90_000;
|
|
129
130
|
const abort = new AbortController();
|
|
130
131
|
const timer = setTimeout(() => abort.abort(), timeout);
|
|
131
132
|
let resp;
|
|
@@ -159,7 +160,7 @@ export class SidecarServer {
|
|
|
159
160
|
res.writeHead(resp.status, {
|
|
160
161
|
"Content-Type": resp.headers.get("content-type") || "text/event-stream",
|
|
161
162
|
});
|
|
162
|
-
const FIRST_CHUNK_TIMEOUT =
|
|
163
|
+
const FIRST_CHUNK_TIMEOUT = Math.round(fallbackAgentMs * 1.2);
|
|
163
164
|
const CHUNK_TIMEOUT = 30_000;
|
|
164
165
|
let isFirst = true;
|
|
165
166
|
try {
|
|
@@ -273,8 +274,9 @@ export class SidecarServer {
|
|
|
273
274
|
};
|
|
274
275
|
const pathLog = url.split("?")[0] || "/";
|
|
275
276
|
log(`[Sidecar] ${reqId} ${method} ${pathLog} fmt=${requestFormat} provider=${realProvider} model=${parsedBody.model ?? "-"} stream=${stream}`, { console: true });
|
|
276
|
-
const
|
|
277
|
-
const
|
|
277
|
+
const agentTimeoutMs = (this.options.agentTimeoutSeconds || 600) * 1_000;
|
|
278
|
+
const FETCH_TIMEOUT = stream ? Math.round(agentTimeoutMs * 1.2) : 90_000;
|
|
279
|
+
const REASONING_CHUNK_TIMEOUT = Math.round(agentTimeoutMs * 1.2);
|
|
278
280
|
const CHUNK_TIMEOUT = 30_000;
|
|
279
281
|
const fetchAbort = new AbortController();
|
|
280
282
|
const fetchTimer = setTimeout(() => fetchAbort.abort(), FETCH_TIMEOUT);
|
package/package.json
CHANGED