arisa 2.3.34 → 2.3.35
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/package.json +1 -1
- package/src/daemon/index.ts +1 -30
package/package.json
CHANGED
package/src/daemon/index.ts
CHANGED
|
@@ -33,9 +33,7 @@ const { serveWithRetry, claimProcess, releaseProcess, cleanupSocket } = await im
|
|
|
33
33
|
const { TelegramChannel } = await import("./channels/telegram");
|
|
34
34
|
const { sendToCore } = await import("./bridge");
|
|
35
35
|
// lifecycle/autofix removed — Core runs in-process, --watch handles restarts
|
|
36
|
-
const {
|
|
37
|
-
const { maybeStartClaudeSetupToken, maybeFeedClaudeCode, setClaudeLoginNotify, isClaudeLoginPending } = await import("./claude-login");
|
|
38
|
-
const { autoInstallMissingClis, setAutoInstallNotify, setAuthProbeCallback } = await import("./auto-install");
|
|
36
|
+
const { autoInstallMissingClis, setAutoInstallNotify } = await import("./auto-install");
|
|
39
37
|
const { chunkMessage, markdownToTelegramHtml } = await import("../core/format");
|
|
40
38
|
// Message records are saved via Core's /record endpoint to avoid dual-writer
|
|
41
39
|
// conflicts (Daemon and Core sharing the same arisa.json through separate
|
|
@@ -95,35 +93,10 @@ const sendToAllChats = async (text: string) => {
|
|
|
95
93
|
};
|
|
96
94
|
|
|
97
95
|
setAutoInstallNotify(sendToAllChats);
|
|
98
|
-
setAuthProbeCallback((cli, errorText) => {
|
|
99
|
-
if (cli === "claude") {
|
|
100
|
-
// Start Claude setup-token for all known chats
|
|
101
|
-
for (const chatId of knownChatIds) {
|
|
102
|
-
maybeStartClaudeSetupToken(errorText, chatId);
|
|
103
|
-
}
|
|
104
|
-
} else if (cli === "codex") {
|
|
105
|
-
// Start Codex device-auth for all known chats
|
|
106
|
-
for (const chatId of knownChatIds) {
|
|
107
|
-
maybeStartCodexDeviceAuth(errorText, chatId);
|
|
108
|
-
}
|
|
109
|
-
}
|
|
110
|
-
});
|
|
111
|
-
setCodexLoginNotify(async (chatId, text) => {
|
|
112
|
-
await telegram.send(chatId, text);
|
|
113
|
-
});
|
|
114
|
-
setClaudeLoginNotify(async (chatId, text) => {
|
|
115
|
-
await telegram.send(chatId, text);
|
|
116
|
-
});
|
|
117
96
|
|
|
118
97
|
telegram.onMessage(async (msg) => {
|
|
119
98
|
knownChatIds.add(msg.chatId);
|
|
120
99
|
|
|
121
|
-
// If Claude login is pending and user sends what looks like an OAuth code, feed it
|
|
122
|
-
if (isClaudeLoginPending() && msg.text && maybeFeedClaudeCode(msg.chatId, msg.text)) {
|
|
123
|
-
await telegram.send(msg.chatId, "Code received, authenticating...");
|
|
124
|
-
return;
|
|
125
|
-
}
|
|
126
|
-
|
|
127
100
|
// Keep typing indicator alive while Core processes (expires every ~5s)
|
|
128
101
|
const typingInterval = setInterval(() => telegram.sendTyping(msg.chatId), 4000);
|
|
129
102
|
|
|
@@ -138,8 +111,6 @@ telegram.onMessage(async (msg) => {
|
|
|
138
111
|
clearInterval(typingInterval);
|
|
139
112
|
|
|
140
113
|
const raw = response.text || "";
|
|
141
|
-
maybeStartCodexDeviceAuth(raw, msg.chatId);
|
|
142
|
-
maybeStartClaudeSetupToken(raw, msg.chatId);
|
|
143
114
|
const messageParts = raw.split(/\n---CHUNK---\n/g);
|
|
144
115
|
let sentText = false;
|
|
145
116
|
|