ai_co_discuss 0.2.94 → 0.2.96
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/backend/room_import.py +1 -5
- package/package.json +2 -1
- package/runner/discussion_launch.mjs +2 -0
- package/runner/free_runner.mjs +4 -3
- package/web/app.js +3706 -3704
- package/web/markdown.js +5 -5
- package/web/modern.css +1 -1
- package/web/modern.js +829 -760
package/backend/room_import.py
CHANGED
|
@@ -63,7 +63,7 @@ def remap_until(value, messages):
|
|
|
63
63
|
|
|
64
64
|
|
|
65
65
|
def room_statements(tables, room, maps, control_hash):
|
|
66
|
-
"""Room, directory
|
|
66
|
+
"""Room, directory and a temporary free mode so history needs no speaking floor; the room arrives unfiled."""
|
|
67
67
|
messages, room_id = maps["messages"], room["id"]
|
|
68
68
|
directory = (tables.get("room_directory") or [{}])[0]
|
|
69
69
|
statements = [("INSERT INTO rooms (id,title,goal,state_text,state_until,created_at) VALUES (?,?,?,?,?,?)",
|
|
@@ -71,10 +71,6 @@ def room_statements(tables, room, maps, control_hash):
|
|
|
71
71
|
remap_until(room.get("state_until"), messages), room["created_at"])),
|
|
72
72
|
("UPDATE room_directory SET archived=? WHERE room_id=?", (int(bool(directory.get("archived"))), room_id)),
|
|
73
73
|
("INSERT INTO room_modes (room_id,mode,control_hash) VALUES (?,'free',?)", (room_id, control_hash))]
|
|
74
|
-
for folder in tables.get("topic_folders", [])[:1]:
|
|
75
|
-
statements += [("""INSERT INTO topic_folders (id,name,position) SELECT ?,?,COALESCE(MAX(position),0)+1 FROM topic_folders
|
|
76
|
-
WHERE NOT EXISTS (SELECT 1 FROM topic_folders WHERE id=?)""", (folder["id"], folder["name"], folder["id"])),
|
|
77
|
-
("UPDATE room_folder_assignments SET folder_id=? WHERE room_id=?", (folder["id"], room_id))]
|
|
78
74
|
return statements
|
|
79
75
|
|
|
80
76
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "ai_co_discuss",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.96",
|
|
4
4
|
"bin": {
|
|
5
5
|
"codiscuss": "runner/codiscuss.mjs"
|
|
6
6
|
},
|
|
@@ -31,6 +31,7 @@
|
|
|
31
31
|
"fflate": "0.8.3",
|
|
32
32
|
"katex": "0.18.10",
|
|
33
33
|
"markdown-it": "15.0.3",
|
|
34
|
+
"markdown-it-cjk-friendly": "3.0.0",
|
|
34
35
|
"motion-v": "2.7.0",
|
|
35
36
|
"pdfjs-dist": "6.4.299",
|
|
36
37
|
"vite": "8.3.4",
|
|
@@ -757,6 +757,8 @@ export async function restore_room(home, raw) {
|
|
|
757
757
|
for (const [name, exported] of Object.entries(local.participants)) {
|
|
758
758
|
try {
|
|
759
759
|
const profile = participant_profile(name, {}, { cwd: local.cwd, adopt: true, participants: { [name]: exported } }, false);
|
|
760
|
+
// An API member's binding lives in the old runtime directory, not in any software's session store, so it starts fresh.
|
|
761
|
+
if (profile.adapter === 'api') delete profile.session_id;
|
|
760
762
|
const resumed = profile.session_id ? borrowed_session(name, profile, local.cwd) : profile;
|
|
761
763
|
if (profile.adapter === 'claude') {
|
|
762
764
|
keep_manual.push(name);
|
package/runner/free_runner.mjs
CHANGED
|
@@ -245,7 +245,8 @@ export class FreeRoomRunner {
|
|
|
245
245
|
}
|
|
246
246
|
/** Ask the scheduler how everyone answers; a failed call still has them answer at once. */
|
|
247
247
|
async order_group(request, room, everyone) {
|
|
248
|
-
|
|
248
|
+
// A page holds at most 20 messages, so the window must end at the message itself or the message falls off the page.
|
|
249
|
+
const page = await api(this.config, `/messages?after=${Math.max(0, request.message_id - ROUTE_CONTEXT_MESSAGES)}`);
|
|
249
250
|
const message = page.messages.find(item => item.id === request.message_id);
|
|
250
251
|
const members = (room.speaking_order?.items || []).map(item => item.name).filter(name => everyone.some(member => member.name === name));
|
|
251
252
|
const decision = await decide_group_order(this.config.api_home, this.config.scheduler,
|
|
@@ -282,9 +283,9 @@ export class FreeRoomRunner {
|
|
|
282
283
|
}
|
|
283
284
|
/** Decide one message and apply a confident pick: one member, everyone, or no one; otherwise the host keeps it. */
|
|
284
285
|
async recommend(request, room, everyone) {
|
|
285
|
-
const page = await api(this.config, `/messages?after=${Math.max(0, request.message_id - ROUTE_CONTEXT_MESSAGES
|
|
286
|
+
const page = await api(this.config, `/messages?after=${Math.max(0, request.message_id - ROUTE_CONTEXT_MESSAGES)}`);
|
|
286
287
|
const message = page.messages.find(item => item.id === request.message_id);
|
|
287
|
-
if (!message)
|
|
288
|
+
if (!message) throw new Error('读取不到这条消息');
|
|
288
289
|
const described = this.route_members(everyone, room, message.id);
|
|
289
290
|
const host = described.find(member => member.role === 'host');
|
|
290
291
|
const members = described.filter(member => member !== host);
|