0agent 1.0.93 → 1.0.95
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 +28 -17
- package/package.json +1 -1
package/dist/daemon.mjs
CHANGED
|
@@ -8422,7 +8422,7 @@ var SessionManager = class {
|
|
|
8422
8422
|
}
|
|
8423
8423
|
const activeLLM = this.getFreshLLM();
|
|
8424
8424
|
if (activeLLM?.isConfigured) {
|
|
8425
|
-
const userEntityId = enrichedReq.entity_id ?? this.identity?.entity_node_id;
|
|
8425
|
+
const userEntityId = enrichedReq.entity_id ?? this.identity?.entity_node_id ?? "default_user";
|
|
8426
8426
|
const routing = routeMessage(enrichedReq.task);
|
|
8427
8427
|
if (routing.decision === "skip") {
|
|
8428
8428
|
this.completeSession(sessionId, { output: "", files_written: [], commands_run: [], tokens_used: 0, model: "skip" });
|
|
@@ -8447,6 +8447,12 @@ var SessionManager = class {
|
|
|
8447
8447
|
tokens_used: resp.tokens_used,
|
|
8448
8448
|
model: resp.model
|
|
8449
8449
|
});
|
|
8450
|
+
if (this.conversationStore && userEntityId) {
|
|
8451
|
+
const now = Date.now();
|
|
8452
|
+
this.conversationStore.append({ id: crypto.randomUUID(), session_id: sessionId, user_entity_id: userEntityId, role: "user", content: enrichedReq.task, created_at: now });
|
|
8453
|
+
this.conversationStore.append({ id: crypto.randomUUID(), session_id: sessionId, user_entity_id: userEntityId, role: "assistant", content: output.slice(0, 1e3), created_at: now + 1 });
|
|
8454
|
+
}
|
|
8455
|
+
this.heartbeat.afterSession(enrichedReq.task, output, resp.model);
|
|
8450
8456
|
return this.sessions.get(sessionId);
|
|
8451
8457
|
} catch {
|
|
8452
8458
|
}
|
|
@@ -12588,37 +12594,42 @@ var ZeroAgentDaemon = class {
|
|
|
12588
12594
|
this.schedulerManager.start();
|
|
12589
12595
|
if (this.sessionManager && this.eventBus && this.graph) {
|
|
12590
12596
|
this.surfaceRouter = new SurfaceRouter(this.sessionManager, this.eventBus, this.graph);
|
|
12591
|
-
const
|
|
12592
|
-
const
|
|
12593
|
-
|
|
12594
|
-
if (TelegramAdapter.isConfigured(tgCfg)) {
|
|
12597
|
+
const surfaces = this.config.surfaces;
|
|
12598
|
+
const tgCfg = surfaces?.telegram;
|
|
12599
|
+
if (tgCfg?.token && typeof tgCfg.token === "string" && tgCfg.token.length > 10) {
|
|
12595
12600
|
this.surfaceRouter.register(new TelegramAdapter(tgCfg));
|
|
12596
|
-
console.log("[0agent] Surface: Telegram");
|
|
12597
|
-
} else
|
|
12598
|
-
|
|
12599
|
-
|
|
12600
|
-
|
|
12601
|
+
console.log("[0agent] Surface: Telegram \u2713");
|
|
12602
|
+
} else {
|
|
12603
|
+
const legacyTgCfg = this.config["telegram"];
|
|
12604
|
+
if (TelegramAdapter.isConfigured(legacyTgCfg)) {
|
|
12605
|
+
this.surfaceRouter.register(new TelegramAdapter(legacyTgCfg));
|
|
12606
|
+
console.log("[0agent] Surface: Telegram \u2713 (legacy)");
|
|
12607
|
+
} else if (TelegramBridge.isConfigured(legacyTgCfg)) {
|
|
12608
|
+
this.telegramBridge = new TelegramBridge(legacyTgCfg, this.sessionManager, this.eventBus);
|
|
12609
|
+
this.telegramBridge.start();
|
|
12610
|
+
console.log("[0agent] Surface: Telegram (legacy bridge)");
|
|
12611
|
+
}
|
|
12601
12612
|
}
|
|
12602
|
-
const slackCfg =
|
|
12613
|
+
const slackCfg = surfaces?.slack;
|
|
12603
12614
|
if (SlackAdapter.isConfigured(slackCfg)) {
|
|
12604
12615
|
this.surfaceRouter.register(new SlackAdapter(slackCfg));
|
|
12605
12616
|
console.log("[0agent] Surface: Slack");
|
|
12606
12617
|
}
|
|
12607
|
-
const waCfg =
|
|
12618
|
+
const waCfg = surfaces?.whatsapp;
|
|
12608
12619
|
if (WhatsAppAdapter.isConfigured(waCfg)) {
|
|
12609
12620
|
const waAdapter2 = new WhatsAppAdapter(waCfg);
|
|
12610
12621
|
this.surfaceRouter.register(waAdapter2);
|
|
12611
|
-
console.log("[0agent] Surface: WhatsApp");
|
|
12622
|
+
console.log("[0agent] Surface: WhatsApp \u2713");
|
|
12612
12623
|
}
|
|
12613
|
-
const voiceCfg =
|
|
12624
|
+
const voiceCfg = surfaces?.voice;
|
|
12614
12625
|
if (voiceCfg?.["enabled"] === true) {
|
|
12615
12626
|
this.surfaceRouter.register(new VoiceAdapter(voiceCfg));
|
|
12616
|
-
console.log("[0agent] Surface: Voice");
|
|
12627
|
+
console.log("[0agent] Surface: Voice \u2713");
|
|
12617
12628
|
}
|
|
12618
|
-
const meetingCfg =
|
|
12629
|
+
const meetingCfg = surfaces?.meeting;
|
|
12619
12630
|
if (meetingCfg?.["enabled"] === true) {
|
|
12620
12631
|
this.surfaceRouter.register(new MeetingAdapter(meetingCfg));
|
|
12621
|
-
console.log("[0agent] Surface: Meeting
|
|
12632
|
+
console.log("[0agent] Surface: Meeting \u2713");
|
|
12622
12633
|
}
|
|
12623
12634
|
if (this.surfaceRouter.registeredSurfaces().length > 0) {
|
|
12624
12635
|
await this.surfaceRouter.start();
|