0agent 1.0.87 → 1.0.88
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/daemon.mjs +14 -9
- package/package.json +1 -1
package/dist/daemon.mjs
CHANGED
|
@@ -7905,9 +7905,7 @@ var COMPLEX_PATTERNS = [
|
|
|
7905
7905
|
var SIMPLE_PATTERNS = [
|
|
7906
7906
|
/^(hey|hi|hello|sup|yo|hola|namaste|what'?s?\s*up|how\s+are\s+you)[!?.\s,]*$/i,
|
|
7907
7907
|
/^(thanks|thank\s+you|thx|ok|okay|cool|great|nice|perfect|got\s+it|sure|yep|yeah|yes|no|nah)[!?.\s,]*$/i,
|
|
7908
|
-
/^(bye|goodbye|see\s+ya|later|good\s*(morning|evening|afternoon|night))[!?.\s,]*$/i
|
|
7909
|
-
/^(what\s+is|who\s+is|when\s+was|where\s+is|how\s+do\s+you|what\s+does|can\s+you)\b.{0,80}$/i,
|
|
7910
|
-
/^(tell\s+me\s+about|summarize|summarise|tldr|tl;dr)\b.{0,80}$/i
|
|
7908
|
+
/^(bye|goodbye|see\s+ya|later|good\s*(morning|evening|afternoon|night))[!?.\s,]*$/i
|
|
7911
7909
|
];
|
|
7912
7910
|
function routeMessage(task) {
|
|
7913
7911
|
const trimmed = task.trim();
|
|
@@ -7931,7 +7929,7 @@ function routeMessage(task) {
|
|
|
7931
7929
|
if (sentences.length > 2) {
|
|
7932
7930
|
return { decision: "primary", reason: "multi-sentence request" };
|
|
7933
7931
|
}
|
|
7934
|
-
return { decision: "
|
|
7932
|
+
return { decision: "primary", reason: "unrecognized message \u2014 using full agent" };
|
|
7935
7933
|
}
|
|
7936
7934
|
function getFastModelId(provider, _currentModel) {
|
|
7937
7935
|
switch (provider) {
|
|
@@ -11143,10 +11141,12 @@ var TelegramAdapter = class {
|
|
|
11143
11141
|
try {
|
|
11144
11142
|
const updates = await this._getUpdates();
|
|
11145
11143
|
for (const u of updates) {
|
|
11146
|
-
await this._handleUpdate(u).catch(() => {
|
|
11144
|
+
await this._handleUpdate(u).catch((err) => {
|
|
11145
|
+
console.error("[telegram] Error handling update:", err instanceof Error ? err.message : err);
|
|
11147
11146
|
});
|
|
11148
11147
|
}
|
|
11149
|
-
} catch {
|
|
11148
|
+
} catch (err) {
|
|
11149
|
+
console.error("[telegram] Poll error:", err instanceof Error ? err.message : err);
|
|
11150
11150
|
}
|
|
11151
11151
|
if (this.running) {
|
|
11152
11152
|
this.pollTimer = setTimeout(() => this._poll(), 1e3);
|
|
@@ -11213,8 +11213,8 @@ Sessions: ${h.active_sessions} active`
|
|
|
11213
11213
|
const sessionId = this.activeSessions.get(chatId);
|
|
11214
11214
|
if (sessionId) {
|
|
11215
11215
|
try {
|
|
11216
|
-
await fetch(`${this.daemonUrl}/api/sessions/${sessionId}
|
|
11217
|
-
method: "
|
|
11216
|
+
await fetch(`${this.daemonUrl}/api/sessions/${sessionId}`, {
|
|
11217
|
+
method: "DELETE",
|
|
11218
11218
|
signal: AbortSignal.timeout(3e3)
|
|
11219
11219
|
});
|
|
11220
11220
|
await this._sendMessage(chatId, "\u{1F6D1} Task cancelled.");
|
|
@@ -11254,7 +11254,12 @@ Sessions: ${h.active_sessions} active`
|
|
|
11254
11254
|
await this._dispatchTask(chatId, userId, userName, text, msg);
|
|
11255
11255
|
}
|
|
11256
11256
|
async _dispatchTask(chatId, userId, userName, text, msg) {
|
|
11257
|
-
if (!this.messageHandler)
|
|
11257
|
+
if (!this.messageHandler) {
|
|
11258
|
+
console.error("[telegram] No messageHandler set \u2014 SurfaceRouter may not have registered this adapter");
|
|
11259
|
+
await this._sendMessage(chatId, "\u26A0\uFE0F Agent not ready. Try again in a few seconds.");
|
|
11260
|
+
return;
|
|
11261
|
+
}
|
|
11262
|
+
console.log(`[telegram] Dispatching: "${text.slice(0, 60)}" from ${userName} (chat ${chatId})`);
|
|
11258
11263
|
const inbound = {
|
|
11259
11264
|
surface: "telegram",
|
|
11260
11265
|
surface_user_id: String(userId),
|