eve-hub 0.16.76 → 0.16.78
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/hub/migrate/migrate.mjs
CHANGED
|
@@ -7032,7 +7032,7 @@ var require_signal_exit = __commonJS({
|
|
|
7032
7032
|
emitter.count -= 1;
|
|
7033
7033
|
};
|
|
7034
7034
|
module.exports.unload = unload;
|
|
7035
|
-
|
|
7035
|
+
emit2 = function emit3(event, code, signal) {
|
|
7036
7036
|
if (emitter.emitted[event]) {
|
|
7037
7037
|
return;
|
|
7038
7038
|
}
|
|
@@ -7048,8 +7048,8 @@ var require_signal_exit = __commonJS({
|
|
|
7048
7048
|
var listeners = process2.listeners(sig);
|
|
7049
7049
|
if (listeners.length === emitter.count) {
|
|
7050
7050
|
unload();
|
|
7051
|
-
|
|
7052
|
-
|
|
7051
|
+
emit2("exit", null, sig);
|
|
7052
|
+
emit2("afterexit", null, sig);
|
|
7053
7053
|
if (isWin && sig === "SIGHUP") {
|
|
7054
7054
|
sig = "SIGINT";
|
|
7055
7055
|
}
|
|
@@ -7086,8 +7086,8 @@ var require_signal_exit = __commonJS({
|
|
|
7086
7086
|
}
|
|
7087
7087
|
process2.exitCode = code || /* istanbul ignore next */
|
|
7088
7088
|
0;
|
|
7089
|
-
|
|
7090
|
-
|
|
7089
|
+
emit2("exit", process2.exitCode, null);
|
|
7090
|
+
emit2("afterexit", process2.exitCode, null);
|
|
7091
7091
|
originalProcessReallyExit.call(process2, process2.exitCode);
|
|
7092
7092
|
};
|
|
7093
7093
|
originalProcessEmit = process2.emit;
|
|
@@ -7097,8 +7097,8 @@ var require_signal_exit = __commonJS({
|
|
|
7097
7097
|
process2.exitCode = arg;
|
|
7098
7098
|
}
|
|
7099
7099
|
var ret = originalProcessEmit.apply(this, arguments);
|
|
7100
|
-
|
|
7101
|
-
|
|
7100
|
+
emit2("exit", process2.exitCode, null);
|
|
7101
|
+
emit2("afterexit", process2.exitCode, null);
|
|
7102
7102
|
return ret;
|
|
7103
7103
|
} else {
|
|
7104
7104
|
return originalProcessEmit.apply(this, arguments);
|
|
@@ -7111,7 +7111,7 @@ var require_signal_exit = __commonJS({
|
|
|
7111
7111
|
var EE;
|
|
7112
7112
|
var emitter;
|
|
7113
7113
|
var unload;
|
|
7114
|
-
var
|
|
7114
|
+
var emit2;
|
|
7115
7115
|
var sigListeners;
|
|
7116
7116
|
var loaded;
|
|
7117
7117
|
var load;
|
|
@@ -45666,6 +45666,13 @@ var require_built3 = __commonJS({
|
|
|
45666
45666
|
}
|
|
45667
45667
|
});
|
|
45668
45668
|
|
|
45669
|
+
// src/telemetry.ts
|
|
45670
|
+
function emit(event, fields = {}, level = "info") {
|
|
45671
|
+
const line = JSON.stringify({ event, level, at: Date.now(), ...fields });
|
|
45672
|
+
if (level === "error") console.error(line);
|
|
45673
|
+
else console.log(line);
|
|
45674
|
+
}
|
|
45675
|
+
|
|
45669
45676
|
// node_modules/pg/esm/index.mjs
|
|
45670
45677
|
var import_lib = __toESM(require_lib2(), 1);
|
|
45671
45678
|
var Client = import_lib.default.Client;
|
|
@@ -51736,7 +51743,7 @@ var Bell = class {
|
|
|
51736
51743
|
const quiet = (error) => {
|
|
51737
51744
|
if (Date.now() - this.lastError > 3e4) {
|
|
51738
51745
|
this.lastError = Date.now();
|
|
51739
|
-
|
|
51746
|
+
emit("hub.bell_redis_error", { error: error.message }, "error");
|
|
51740
51747
|
}
|
|
51741
51748
|
};
|
|
51742
51749
|
const watch = (which) => (redis) => {
|
|
@@ -51750,7 +51757,7 @@ var Bell = class {
|
|
|
51750
51757
|
const id = `${client}:${state2}`, now = Date.now();
|
|
51751
51758
|
if (now - (this.noted.get(id) ?? 0) < 3e4) return;
|
|
51752
51759
|
this.noted.set(id, now);
|
|
51753
|
-
|
|
51760
|
+
emit("bell.redis", { client, state: state2, listeners: this.listeners.size });
|
|
51754
51761
|
}
|
|
51755
51762
|
attach(pub, sub) {
|
|
51756
51763
|
this.pub = pub;
|
|
@@ -51886,7 +51893,7 @@ async function connect(url, budgetMs = CONNECT_BUDGET_MS) {
|
|
|
51886
51893
|
});
|
|
51887
51894
|
const waitMs = backoffMs(tried, CONNECT_FIRST_MS, CONNECT_MAX_MS);
|
|
51888
51895
|
if (!loginTransient(error) || Date.now() + waitMs > deadline) throw error;
|
|
51889
|
-
|
|
51896
|
+
emit("migrate.login_retry", { code: error.code, message: error.message, wait_ms: Math.round(waitMs) }, "error");
|
|
51890
51897
|
await sleep2(waitMs);
|
|
51891
51898
|
}
|
|
51892
51899
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "eve-hub",
|
|
3
|
-
"version": "0.16.
|
|
3
|
+
"version": "0.16.78",
|
|
4
4
|
"license": "Apache-2.0",
|
|
5
5
|
"description": "Bot-side code shared by every hub agent: registry tools, the roster hook, the eve channel, the host sandbox and browser, and model helpers.",
|
|
6
6
|
"type": "module",
|
package/tools/post_message.js
CHANGED
|
@@ -109,7 +109,7 @@ export default defineTool({
|
|
|
109
109
|
const res = await registryFetch(`/api/threads/${encodeURIComponent(target)}/messages`, {
|
|
110
110
|
method: "POST",
|
|
111
111
|
headers: { "content-type": "application/json" },
|
|
112
|
-
body: JSON.stringify({ text: posted, sessionId: ctx.session.id, ...(attachments.length ? { attachments: attachments.map(({ id, name }) => ({ id, name })) } : {}), ...(policy ? { policy } : {}) }),
|
|
112
|
+
body: JSON.stringify({ text: posted, sessionId: ctx.session.id, clientId: crypto.randomUUID(), clientSentAt: Date.now(), ...(attachments.length ? { attachments: attachments.map(({ id, name }) => ({ id, name })) } : {}), ...(policy ? { policy } : {}) }),
|
|
113
113
|
});
|
|
114
114
|
if (!res.ok)
|
|
115
115
|
throw new Error(`post_message failed: ${res.status} ${await res.text()}`);
|