You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: package.json
+1-1Lines changed: 1 addition & 1 deletion
Original file line number
Diff line number
Diff line change
@@ -1,7 +1,7 @@
1
1
{
2
2
"name": "1helm",
3
3
"productName": "1Helm",
4
-
"version": "0.0.1",
4
+
"version": "0.0.2",
5
5
"private": true,
6
6
"type": "module",
7
7
"description": "1Helm is the self-hosted home for durable AI employees: one resident, one private computer, compounding memory and skills, and Skipper for every boundary.",
run("UPDATE photon_conversations SET active=0,space_id=?,updated=?,closed=? WHERE id=? AND active=1",spaceId,timestamp,timestamp,conversation.id);
181
+
run("UPDATE threads SET status='resolved',updated_at=? WHERE id=?",timestamp,conversation.thread_id);
182
+
constnoteId=createMessage({ channelId,parentId: Number(conversation.root_message_id),botId: null,body: "Photon conversation closed with /new. The next text starts a new thread."});
183
+
run("UPDATE messages SET system_message=1 WHERE id=?",noteId);
184
+
run("INSERT INTO channel_activity (channel_id,thread_id,kind,summary,actor_type,created) VALUES (?,?,'connector',?,'system',?)",
185
+
channelId,conversation.thread_id,`Photon closed the active conversation for ${sender}; the next text will start a new thread.`,timestamp);
conversation=q1("SELECT * FROM photon_conversations WHERE id=?",conversationId);
247
+
}else{
248
+
run("UPDATE photon_conversations SET space_id=?,updated=? WHERE id=? AND active=1",event.space_id,timestamp,conversation!.id);
249
+
}
250
+
constthreadId=Number(conversation!.thread_id);
251
+
run("UPDATE threads SET status='open',updated_at=? WHERE id=?",timestamp,threadId);
205
252
run("INSERT INTO photon_messages (channel_id,external_id,space_id,sender,direction,body,received_at,message_id) VALUES (?,?,?,?, 'inbound',?,?,?)",channelId,event.id,event.space_id,event.sender,event.text.slice(0,50_000),Date.parse(event.timestamp)||now(),messageId);
206
253
run("INSERT INTO channel_activity (channel_id,thread_id,kind,summary,actor_type,created) VALUES (?,?,'connector',?,'system',?)",channelId,threadId,`Photon delivered an iMessage from ${event.sender}.`,now());
constbot=q1("SELECT * FROM bots WHERE id=?",resident.bot_id);
210
257
if(bot&&dispatchInbound){
211
258
try{
212
259
constoutboundBefore=Number(q1("SELECT COALESCE(MAX(id),0) id FROM photon_messages WHERE channel_id=? AND space_id=? AND direction='outbound'",channelId,event.space_id)?.id||0);
constreply=q1(`SELECT id,body FROM messages WHERE channel_id=? AND parent_id=? AND bot_id=?
215
-
AND trim(body)<>'' AND body<>'_Working…_' ORDER BY id DESC LIMIT 1`,channelId,messageId,bot.id);
263
+
AND id>? AND trim(body)<>'' AND body<>'_Working…_' ORDER BY id DESC LIMIT 1`,channelId,rootMessageId,bot.id,replyBefore);
216
264
constalreadyReturned=q1("SELECT 1 FROM photon_messages WHERE channel_id=? AND space_id=? AND direction='outbound' AND id>? LIMIT 1",channelId,event.space_id,outboundBefore);
217
265
constalreadyQueued=reply?.id ? q1("SELECT 1 FROM connector_deliveries WHERE connector='photon' AND source_message_id=? LIMIT 1",reply.id) : undefined;
0 commit comments