@lsamien/yaovi 0.1.4 → 0.1.5
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/build-info.json +12 -4
- package/dist/assets/{AboutDialog-CDpS-zAu.js → AboutDialog-2Zq3b7ma.js} +2 -2
- package/dist/assets/{AboutDialog-CDpS-zAu.js.map → AboutDialog-2Zq3b7ma.js.map} +1 -1
- package/dist/assets/{BotAutomationsView-RXBQzdfc.js → BotAutomationsView-C4EwHtYy.js} +2 -2
- package/dist/assets/{BotAutomationsView-RXBQzdfc.js.map → BotAutomationsView-C4EwHtYy.js.map} +1 -1
- package/dist/assets/{BotControlSettingsPanel-GQEVHXbw.js → BotControlSettingsPanel-DJ71O3Kh.js} +2 -2
- package/dist/assets/{BotControlSettingsPanel-GQEVHXbw.js.map → BotControlSettingsPanel-DJ71O3Kh.js.map} +1 -1
- package/dist/assets/{BotPluginsDialog-HIhXqyGn.js → BotPluginsDialog-Cgqn4RlP.js} +2 -2
- package/dist/assets/{BotPluginsDialog-HIhXqyGn.js.map → BotPluginsDialog-Cgqn4RlP.js.map} +1 -1
- package/dist/assets/{BotSettingsPanel-Bkqal3lR.js → BotSettingsPanel-C_1zAGWJ.js} +3 -3
- package/dist/assets/{BotSettingsPanel-Bkqal3lR.js.map → BotSettingsPanel-C_1zAGWJ.js.map} +1 -1
- package/dist/assets/{ComputerPanel-Dt73pgTG.js → ComputerPanel-CuVl9oX7.js} +2 -2
- package/dist/assets/{ComputerPanel-Dt73pgTG.js.map → ComputerPanel-CuVl9oX7.js.map} +1 -1
- package/dist/assets/{ComputerViewerView-ChYgaS9q.js → ComputerViewerView-BoI_aqLr.js} +2 -2
- package/dist/assets/{ComputerViewerView-ChYgaS9q.js.map → ComputerViewerView-BoI_aqLr.js.map} +1 -1
- package/dist/assets/{ConversationsView-EdF5AM1T.css → ConversationsView-aPMgqa0O.css} +1 -1
- package/dist/assets/{ConversationsView-DzcDJZh3.js → ConversationsView-kztie5lF.js} +16 -16
- package/dist/assets/ConversationsView-kztie5lF.js.map +1 -0
- package/dist/assets/{LocalVmSettingsPanel-DLbDb5Tq.js → LocalVmSettingsPanel-BZ1Jeqqk.js} +2 -2
- package/dist/assets/{LocalVmSettingsPanel-DLbDb5Tq.js.map → LocalVmSettingsPanel-BZ1Jeqqk.js.map} +1 -1
- package/dist/assets/{ModelNetworkChoice-Cfyt4Unl.js → ModelNetworkChoice-BQ8m2N3V.js} +2 -2
- package/dist/assets/{ModelNetworkChoice-Cfyt4Unl.js.map → ModelNetworkChoice-BQ8m2N3V.js.map} +1 -1
- package/dist/assets/{StandaloneDialog-Cte829Ai.js → StandaloneDialog-hF3z7bfi.js} +2 -2
- package/dist/assets/{StandaloneDialog-Cte829Ai.js.map → StandaloneDialog-hF3z7bfi.js.map} +1 -1
- package/dist/assets/{UpdateCheckDialog-BaMo_M4n.js → UpdateCheckDialog-Bz8JhRh4.js} +2 -2
- package/dist/assets/{UpdateCheckDialog-BaMo_M4n.js.map → UpdateCheckDialog-Bz8JhRh4.js.map} +1 -1
- package/dist/assets/{UsageView-CklMPG4n.js → UsageView-ZsSbQzIY.js} +2 -2
- package/dist/assets/{UsageView-CklMPG4n.js.map → UsageView-ZsSbQzIY.js.map} +1 -1
- package/dist/assets/WorkspaceKnowledgePanel-E549Ct1E.js +3 -0
- package/dist/assets/{WorkspaceKnowledgePanel-BdbhD3rO.js.map → WorkspaceKnowledgePanel-E549Ct1E.js.map} +1 -1
- package/dist/assets/{WorkspaceRoutinesPanel-VpRoMe1x.js → WorkspaceRoutinesPanel-NFWzy1R-.js} +2 -2
- package/dist/assets/{WorkspaceRoutinesPanel-VpRoMe1x.js.map → WorkspaceRoutinesPanel-NFWzy1R-.js.map} +1 -1
- package/dist/assets/{WorkstreamsView-BwZpuuhs.js → WorkstreamsView-CxZ8YUvP.js} +2 -2
- package/dist/assets/{WorkstreamsView-BwZpuuhs.js.map → WorkstreamsView-CxZ8YUvP.js.map} +1 -1
- package/dist/assets/{index-Cx1SdzRY.js → index-P_kZCZ2-.js} +3 -3
- package/dist/assets/{index-Cx1SdzRY.js.map → index-P_kZCZ2-.js.map} +1 -1
- package/dist/assets/{pdf-CoNh_Rmj.js → pdf-CNS_Rszb.js} +2 -2
- package/dist/assets/{pdf-CoNh_Rmj.js.map → pdf-CNS_Rszb.js.map} +1 -1
- package/dist/index.html +1 -1
- package/dist-server/server/workspaceCollaboration.js +9 -12
- package/dist-server/server/workspaceStore.js +3 -1
- package/dist-server/shared/peerExchange.js +26 -0
- package/package.json +1 -1
- package/release.json +3 -3
- package/dist/assets/ConversationsView-DzcDJZh3.js.map +0 -1
- package/dist/assets/WorkspaceKnowledgePanel-BdbhD3rO.js +0 -3
package/dist/index.html
CHANGED
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
<link rel="apple-touch-icon" sizes="180x180" href="/icons/apple-touch-icon.png" />
|
|
10
10
|
<link rel="manifest" href="/manifest.webmanifest" />
|
|
11
11
|
<title>Yaovi</title>
|
|
12
|
-
<script type="module" crossorigin src="/assets/index-
|
|
12
|
+
<script type="module" crossorigin src="/assets/index-P_kZCZ2-.js"></script>
|
|
13
13
|
<link rel="modulepreload" crossorigin href="/assets/rolldown-runtime-Dd_uD5pT.js">
|
|
14
14
|
<link rel="modulepreload" crossorigin href="/assets/_plugin-vue_export-helper-CD0r-vVb.js">
|
|
15
15
|
<link rel="stylesheet" crossorigin href="/assets/index-C-5Gq82f.css">
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { peerExchange } from '../shared/peerExchange.js';
|
|
1
2
|
import { createHash, randomUUID } from 'node:crypto';
|
|
2
3
|
import { toolStatus } from '../shared/chatTools.js';
|
|
3
4
|
import { normalizeUploadName } from '../shared/uploadNames.js';
|
|
@@ -88,20 +89,11 @@ export class WorkspaceCollaboration {
|
|
|
88
89
|
throw missing();
|
|
89
90
|
}
|
|
90
91
|
const chainPeers = this.store.db.prepare("SELECT data FROM workspace_entities WHERE owner=? AND kind='peer-message' AND json_extract(data,'$.chainId')=?").all(owner, focus.chainId).map(row => JSON.parse(String(row.data)));
|
|
91
|
-
const
|
|
92
|
+
const replies = new Map();
|
|
92
93
|
for (const peer of chainPeers)
|
|
93
94
|
if (peer.replyTo)
|
|
94
95
|
replies.set(peer.replyTo, [...replies.get(peer.replyTo) ?? [], peer]);
|
|
95
|
-
const
|
|
96
|
-
for (let up = focus.replyTo ? byId.get(focus.replyTo) : undefined; up && !related.has(up.id); up = up.replyTo ? byId.get(up.replyTo) : undefined)
|
|
97
|
-
related.set(up.id, up);
|
|
98
|
-
for (const queue = [focus.id]; queue.length;)
|
|
99
|
-
for (const reply of replies.get(queue.shift()) ?? [])
|
|
100
|
-
if (!related.has(reply.id)) {
|
|
101
|
-
related.set(reply.id, reply);
|
|
102
|
-
queue.push(reply.id);
|
|
103
|
-
}
|
|
104
|
-
const ordered = [...related.values()].sort((a, b) => a.createdAt - b.createdAt || a.id.localeCompare(b.id)), shown = ordered.slice(-32);
|
|
96
|
+
const ordered = peerExchange(focus, chainPeers).sort((a, b) => a.createdAt - b.createdAt || a.id.localeCompare(b.id)), shown = ordered.slice(-32);
|
|
105
97
|
const chain = this.store.get(owner, 'collaboration-chain', focus.chainId);
|
|
106
98
|
const progressRun = focus.runId ? this.store.get(owner, 'run', focus.runId) : focus.replyTo ? this.store.get(owner, 'run', focus.sourceRunId) : undefined;
|
|
107
99
|
const privateRun = (runId) => {
|
|
@@ -306,7 +298,12 @@ export class WorkspaceCollaboration {
|
|
|
306
298
|
replying.status = 'complete';
|
|
307
299
|
replying.updatedAt = now;
|
|
308
300
|
this.store.put(owner, 'peer-message', replying.id, replying);
|
|
309
|
-
this.
|
|
301
|
+
// Every ancestor caption counts this new reply. Refresh existing records only.
|
|
302
|
+
const seen = new Set();
|
|
303
|
+
for (let ancestor = replying; ancestor && ancestor.chainId === chainId && !seen.has(ancestor.id); ancestor = ancestor.replyTo ? this.store.get(owner, 'peer-message', ancestor.replyTo) : undefined) {
|
|
304
|
+
seen.add(ancestor.id);
|
|
305
|
+
this.changed(owner, ancestor);
|
|
306
|
+
}
|
|
310
307
|
}
|
|
311
308
|
const peerName = target ? target.name : destination.name;
|
|
312
309
|
this.notice(owner, peer, workspaceDialoguePolicy().style
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { peerExchange } from '../shared/peerExchange.js';
|
|
1
2
|
import { recordOperationCommand } from './remoteAccess/operationScope.js';
|
|
2
3
|
import { chmodSync, mkdirSync } from 'node:fs';
|
|
3
4
|
import { join } from 'node:path';
|
|
@@ -1391,8 +1392,9 @@ export class WorkspaceStore {
|
|
|
1391
1392
|
const file = this.get(owner, 'file', id) ?? message.attachments.find(file => file.id === id);
|
|
1392
1393
|
return file ? [{ id: file.id, name: file.sender === 'user' ? normalizeUploadName(file.name) : file.name, mimeType: file.mimeType, size: file.size, sender: file.sender, createdAt: file.createdAt }] : [];
|
|
1393
1394
|
});
|
|
1395
|
+
const peers = this.db.prepare("SELECT data FROM workspace_entities WHERE owner=? AND kind='peer-message' AND json_extract(data,'$.chainId')=?").all(owner, peer.chainId).map(row => JSON.parse(String(row.data)));
|
|
1394
1396
|
return { ...message, reasoning: '', tools: [], attachments: message.visible === false ? [] : files,
|
|
1395
|
-
communication: { direction: incoming ? 'incoming' : 'outgoing', peerId, peerName, peerAvatar, peerKind, content: peer.content,
|
|
1397
|
+
communication: { messageCount: peerExchange(peer, peers).length, direction: incoming ? 'incoming' : 'outgoing', peerId, peerName, peerAvatar, peerKind, content: peer.content,
|
|
1396
1398
|
peerMessageId: peer.id, chainId: peer.chainId, replyTo: peer.replyTo, fromName: peer.fromName, toName: peer.targetName,
|
|
1397
1399
|
status: peer.status, hasReply: !!this.db.prepare("SELECT 1 FROM workspace_entities WHERE owner=? AND kind='peer-message' AND json_extract(data,'$.replyTo')=? AND (json_extract(data,'$.runId') IS NOT NULL OR json_extract(data,'$.status')='complete') LIMIT 1").get(owner, peer.id) } };
|
|
1398
1400
|
}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
/** The same ancestor/descendant slice used by the record page, not all Bot-pair history. */
|
|
2
|
+
export function peerExchange(focus, peers) {
|
|
3
|
+
const byId = new Map(peers.map(peer => [peer.id, peer]));
|
|
4
|
+
const replies = new Map();
|
|
5
|
+
for (const peer of peers)
|
|
6
|
+
if (peer.replyTo)
|
|
7
|
+
replies.set(peer.replyTo, [...replies.get(peer.replyTo) ?? [], peer]);
|
|
8
|
+
const related = new Map([[focus.id, focus]]);
|
|
9
|
+
for (let up = focus.replyTo ? byId.get(focus.replyTo) : undefined; up && !related.has(up.id); up = up.replyTo ? byId.get(up.replyTo) : undefined)
|
|
10
|
+
related.set(up.id, up);
|
|
11
|
+
for (const queue = [focus.id]; queue.length;)
|
|
12
|
+
for (const reply of replies.get(queue.shift()) ?? []) {
|
|
13
|
+
if (!related.has(reply.id)) {
|
|
14
|
+
related.set(reply.id, reply);
|
|
15
|
+
queue.push(reply.id);
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
return [...related.values()];
|
|
19
|
+
}
|
|
20
|
+
export function peerExchangeCaption(value) {
|
|
21
|
+
if (value.direction === 'incoming')
|
|
22
|
+
return '消息来自';
|
|
23
|
+
const count = Number.isInteger(value.messageCount) && value.messageCount > 0
|
|
24
|
+
? value.messageCount : value.hasReply || value.replyTo ? 2 : 1;
|
|
25
|
+
return `${count}条往来消息:`;
|
|
26
|
+
}
|
package/package.json
CHANGED
package/release.json
CHANGED