@qvac/core 1.0.0-rc.8 → 1.0.1
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/CHANGELOG.md +243 -3
- package/README.md +1 -0
- package/dist-lib/lib/api/attachments.d.ts +1 -1
- package/dist-lib/lib/api/attachments.js +11 -0
- package/dist-lib/lib/api/chunks.d.ts +4 -2
- package/dist-lib/lib/api/chunks.js +6 -3
- package/dist-lib/lib/api/devices.js +6 -18
- package/dist-lib/lib/api/execution.d.ts +6 -2
- package/dist-lib/lib/api/execution.js +29 -3
- package/dist-lib/lib/api/host-run-log.d.ts +7 -1
- package/dist-lib/lib/api/host-run-log.js +3 -1
- package/dist-lib/lib/api/index.d.ts +3 -1
- package/dist-lib/lib/api/index.js +17 -6
- package/dist-lib/lib/api/members.js +13 -29
- package/dist-lib/lib/api/mesh.d.ts +2 -1
- package/dist-lib/lib/api/projects.d.ts +1 -1
- package/dist-lib/lib/api/projects.js +9 -5
- package/dist-lib/lib/api/rag-label.d.ts +4 -0
- package/dist-lib/lib/api/rag-label.js +21 -0
- package/dist-lib/lib/api/rag-lexical.d.ts +22 -0
- package/dist-lib/lib/api/rag-lexical.js +1058 -0
- package/dist-lib/lib/api/rag-manifest.d.ts +13 -0
- package/dist-lib/lib/api/rag-manifest.js +46 -0
- package/dist-lib/lib/api/rag-outline.d.ts +36 -0
- package/dist-lib/lib/api/rag-outline.js +426 -0
- package/dist-lib/lib/api/rag-plugin.d.ts +20 -0
- package/dist-lib/lib/api/rag-plugin.js +70 -0
- package/dist-lib/lib/api/rag-synthesis.d.ts +7 -0
- package/dist-lib/lib/api/rag-synthesis.js +102 -0
- package/dist-lib/lib/api/rag-targets.d.ts +23 -0
- package/dist-lib/lib/api/rag-targets.js +215 -0
- package/dist-lib/lib/api/rag-window.d.ts +5 -0
- package/dist-lib/lib/api/rag-window.js +46 -0
- package/dist-lib/lib/api/rag.d.ts +3 -2
- package/dist-lib/lib/api/rag.js +421 -181
- package/dist-lib/lib/api/served.js +8 -14
- package/dist-lib/lib/api/workspace.d.ts +8 -1
- package/dist-lib/lib/api/workspace.js +27 -13
- package/dist-lib/lib/assistant/harness.d.ts +9 -1
- package/dist-lib/lib/assistant/history.d.ts +11 -2
- package/dist-lib/lib/assistant/history.js +74 -4
- package/dist-lib/lib/assistant/media-round.d.ts +61 -0
- package/dist-lib/lib/assistant/media-round.js +111 -0
- package/dist-lib/lib/assistant/message.d.ts +7 -0
- package/dist-lib/lib/assistant/model-round.d.ts +12 -0
- package/dist-lib/lib/assistant/model-round.js +130 -17
- package/dist-lib/lib/assistant/pdf-pages.d.ts +16 -1
- package/dist-lib/lib/assistant/pdf-pages.js +67 -3
- package/dist-lib/lib/assistant/round-host.d.ts +22 -0
- package/dist-lib/lib/assistant/round-host.js +142 -8
- package/dist-lib/lib/assistant/upload.d.ts +12 -0
- package/dist-lib/lib/assistant/upload.js +36 -0
- package/dist-lib/lib/assistant-client.d.ts +1 -0
- package/dist-lib/lib/assistant-client.js +40 -19
- package/dist-lib/lib/assistant-tree.d.ts +2 -0
- package/dist-lib/lib/assistant-tree.js +41 -1
- package/dist-lib/lib/assistant.d.ts +15 -0
- package/dist-lib/lib/assistant.js +474 -89
- package/dist-lib/lib/client.d.ts +1 -0
- package/dist-lib/lib/client.js +4 -1
- package/dist-lib/lib/compaction.js +2 -2
- package/dist-lib/lib/core/agent.js +12 -45
- package/dist-lib/lib/core/approval-rules.js +1 -8
- package/dist-lib/lib/core/archived-mesh.d.ts +2 -1
- package/dist-lib/lib/core/archived-mesh.js +12 -8
- package/dist-lib/lib/core/chat-copy.d.ts +18 -3
- package/dist-lib/lib/core/chat-copy.js +74 -25
- package/dist-lib/lib/core/chat-fork.js +15 -6
- package/dist-lib/lib/core/chat-group.js +16 -24
- package/dist-lib/lib/core/chat-move.d.ts +9 -0
- package/dist-lib/lib/core/chat-move.js +94 -3
- package/dist-lib/lib/core/chat-order.js +12 -18
- package/dist-lib/lib/core/chat.js +38 -31
- package/dist-lib/lib/core/chunk.d.ts +2 -2
- package/dist-lib/lib/core/chunk.js +18 -25
- package/dist-lib/lib/core/collections.d.ts +2 -0
- package/dist-lib/lib/core/collections.js +2 -0
- package/dist-lib/lib/core/contract/activity.d.ts +4 -0
- package/dist-lib/lib/core/contract/activity.js +34 -4
- package/dist-lib/lib/core/contract/chat-group.d.ts +1 -0
- package/dist-lib/lib/core/contract/chat-group.js +21 -1
- package/dist-lib/lib/core/contract/chat.d.ts +9 -0
- package/dist-lib/lib/core/contract/chat.js +127 -5
- package/dist-lib/lib/core/contract/chunks.d.ts +1 -0
- package/dist-lib/lib/core/contract/chunks.js +37 -6
- package/dist-lib/lib/core/contract/features.d.ts +21 -0
- package/dist-lib/lib/core/contract/features.js +22 -0
- package/dist-lib/lib/core/contract/index.js +2 -0
- package/dist-lib/lib/core/contract/indexing.js +4 -2
- package/dist-lib/lib/core/contract/knowledge.js +5 -4
- package/dist-lib/lib/core/contract/members.js +16 -10
- package/dist-lib/lib/core/contract/mesh-kind.d.ts +1 -0
- package/dist-lib/lib/core/contract/mesh-kind.js +3 -1
- package/dist-lib/lib/core/contract/projects.d.ts +5 -0
- package/dist-lib/lib/core/contract/projects.js +13 -5
- package/dist-lib/lib/core/contract/roles.js +32 -4
- package/dist-lib/lib/core/contract/run-requests.d.ts +1 -0
- package/dist-lib/lib/core/contract/run-requests.js +35 -2
- package/dist-lib/lib/core/contract/seed-defaults.js +2 -2
- package/dist-lib/lib/core/contract/tool-configs.js +3 -2
- package/dist-lib/lib/core/contract/workspace.d.ts +2 -0
- package/dist-lib/lib/core/contract/workspace.js +40 -7
- package/dist-lib/lib/core/contract/writers.js +2 -2
- package/dist-lib/lib/core/departures.d.ts +3 -1
- package/dist-lib/lib/core/departures.js +3 -0
- package/dist-lib/lib/core/devices.js +1 -8
- package/dist-lib/lib/core/files/attachments.d.ts +2 -0
- package/dist-lib/lib/core/files/attachments.js +19 -1
- package/dist-lib/lib/core/files/index.d.ts +20 -4
- package/dist-lib/lib/core/files/index.js +132 -21
- package/dist-lib/lib/core/files/processing/document.d.ts +4 -0
- package/dist-lib/lib/core/files/processing/document.js +7 -0
- package/dist-lib/lib/core/files/processing/index.d.ts +13 -0
- package/dist-lib/lib/core/files/processing/index.js +144 -12
- package/dist-lib/lib/core/files/processing/protocol.js +13 -34
- package/dist-lib/lib/core/files/processing/state.d.ts +2 -0
- package/dist-lib/lib/core/files/rag/build.d.ts +19 -2
- package/dist-lib/lib/core/files/rag/build.js +123 -19
- package/dist-lib/lib/core/files/rag/failure.js +2 -1
- package/dist-lib/lib/core/files/rag/index.d.ts +11 -3
- package/dist-lib/lib/core/files/rag/index.js +13 -1
- package/dist-lib/lib/core/files/rag/load.d.ts +6 -3
- package/dist-lib/lib/core/files/rag/load.js +27 -6
- package/dist-lib/lib/core/files/rag/plugin-index.d.ts +32 -0
- package/dist-lib/lib/core/files/rag/plugin-index.js +127 -0
- package/dist-lib/lib/core/files/rag/produce.d.ts +5 -3
- package/dist-lib/lib/core/files/rag/produce.js +104 -16
- package/dist-lib/lib/core/files/rag/retrieval/full-text.d.ts +3 -1
- package/dist-lib/lib/core/files/rag/retrieval/full-text.js +62 -13
- package/dist-lib/lib/core/files/rag/text-cache.d.ts +28 -0
- package/dist-lib/lib/core/files/rag/text-cache.js +141 -0
- package/dist-lib/lib/core/files/records/knowledge.d.ts +1 -3
- package/dist-lib/lib/core/files/records/knowledge.js +7 -40
- package/dist-lib/lib/core/files/records/reclaim.js +5 -10
- package/dist-lib/lib/core/files/upload.js +68 -41
- package/dist-lib/lib/core/fs-drives.js +14 -26
- package/dist-lib/lib/core/invite.d.ts +1 -0
- package/dist-lib/lib/core/invite.js +4 -2
- package/dist-lib/lib/core/local/files.d.ts +1 -1
- package/dist-lib/lib/core/local/files.js +5 -5
- package/dist-lib/lib/core/local/index.d.ts +13 -6
- package/dist-lib/lib/core/local/index.js +103 -69
- package/dist-lib/lib/core/local/run-logs.d.ts +1 -1
- package/dist-lib/lib/core/local/run-logs.js +5 -5
- package/dist-lib/lib/core/mesh-processor.d.ts +19 -0
- package/dist-lib/lib/core/mesh-processor.js +87 -0
- package/dist-lib/lib/core/mesh.d.ts +48 -5
- package/dist-lib/lib/core/mesh.js +318 -129
- package/dist-lib/lib/core/migrations/agent-catalog.js +2 -8
- package/dist-lib/lib/core/migrations/agent-tools-scope.js +5 -11
- package/dist-lib/lib/core/migrations/workspace-from-0-21/index.d.ts +88 -0
- package/dist-lib/lib/core/migrations/workspace-from-0-21/index.js +731 -0
- package/dist-lib/lib/core/migrations/writer-links.d.ts +2 -0
- package/dist-lib/lib/core/migrations/writer-links.js +32 -0
- package/dist-lib/lib/core/project-keys.d.ts +6 -0
- package/dist-lib/lib/core/project-keys.js +11 -0
- package/dist-lib/lib/core/public-mesh.d.ts +3 -0
- package/dist-lib/lib/core/public-mesh.js +10 -8
- package/dist-lib/lib/core/run-requests.d.ts +3 -0
- package/dist-lib/lib/core/run-requests.js +21 -1
- package/dist-lib/lib/core/skill-availability.d.ts +33 -0
- package/dist-lib/lib/core/skill-availability.js +67 -0
- package/dist-lib/lib/core/sync/background.d.ts +0 -1
- package/dist-lib/lib/core/sync/background.js +2 -1
- package/dist-lib/lib/core/sync/changed.d.ts +4 -2
- package/dist-lib/lib/core/sync/changed.js +1 -1
- package/dist-lib/lib/core/sync/index.js +52 -10
- package/dist-lib/lib/core/sync/view-updates.d.ts +18 -12
- package/dist-lib/lib/core/sync/view-updates.js +82 -91
- package/dist-lib/lib/core/sync-status.js +97 -41
- package/dist-lib/lib/core/tool-activity.js +6 -12
- package/dist-lib/lib/core/tool-configs.js +17 -29
- package/dist-lib/lib/core/upgrade-summary.d.ts +19 -0
- package/dist-lib/lib/core/upgrade-summary.js +67 -0
- package/dist-lib/lib/core/view-read.d.ts +4 -0
- package/dist-lib/lib/core/view-read.js +23 -0
- package/dist-lib/lib/core/workspace-upgrade.d.ts +7 -0
- package/dist-lib/lib/core/workspace-upgrade.js +27 -16
- package/dist-lib/lib/core.d.ts +39 -42
- package/dist-lib/lib/core.js +661 -639
- package/dist-lib/lib/errors.d.ts +20 -0
- package/dist-lib/lib/errors.js +20 -0
- package/dist-lib/lib/llm-model-names.d.ts +1 -1
- package/dist-lib/lib/llm-model-names.js +1 -1
- package/dist-lib/lib/mesh-scoped-engine.js +4 -0
- package/dist-lib/lib/model-context.js +1 -2
- package/dist-lib/lib/probe-rounds.d.ts +7 -2
- package/dist-lib/lib/probe-rounds.js +6 -1
- package/dist-lib/lib/run-transcript.d.ts +4 -1
- package/dist-lib/lib/run-transcript.js +15 -6
- package/dist-lib/schema/engine.js +83 -6
- package/dist-lib/schema/indexes.d.ts +3 -0
- package/dist-lib/schema/indexes.js +5 -0
- package/dist-lib/schema/local.js +11 -2
- package/dist-lib/schema/qvac.js +49 -5
- package/dist-lib/spec/bind.js +34 -0
- package/dist-lib/spec/calls.js +5 -0
- package/dist-lib/spec/capabilities.d.ts +17 -0
- package/dist-lib/spec/hrpc/hrpc.json +65 -0
- package/dist-lib/spec/hrpc/index.js +68 -5
- package/dist-lib/spec/hrpc/messages.js +260 -23
- package/dist-lib/spec/hyperschema/index.js +260 -23
- package/dist-lib/spec/hyperschema/schema.json +181 -0
- package/dist-lib/spec/hyperschema/types.d.ts +48 -0
- package/dist-lib/spec/local/hyperdb/messages.js +270 -224
- package/dist-lib/spec/local/hyperschema/index.js +73 -38
- package/dist-lib/spec/local/hyperschema/schema.json +31 -0
- package/dist-lib/spec/local/hyperschema/types.d.ts +8 -0
- package/dist-lib/spec/mesh/hyperdb/db.json +39 -2
- package/dist-lib/spec/mesh/hyperdb/index.js +120 -3
- package/dist-lib/spec/mesh/hyperdb/messages.js +1328 -838
- package/dist-lib/spec/mesh/hyperdispatch/dispatch.json +30 -0
- package/dist-lib/spec/mesh/hyperdispatch/index.js +86 -1
- package/dist-lib/spec/mesh/hyperdispatch/messages.js +682 -287
- package/dist-lib/spec/mesh/hyperschema/index.js +682 -287
- package/dist-lib/spec/mesh/hyperschema/schema.json +201 -0
- package/dist-lib/spec/mesh/hyperschema/types.d.ts +52 -0
- package/package.json +75 -70
- package/tui/README.md +2 -1
- package/tui/app.mjs +28 -7
- package/tui/boot.mjs +5 -1
- package/tui/lib/attachment-files.mjs +82 -0
- package/tui/lib/reopen-meshes.mjs +15 -0
- package/tui/main.mjs +4 -43
- package/worker/assistant-sidecar.mjs +10 -3
- package/worker/stow-entry.mjs +3 -52
package/dist-lib/lib/client.d.ts
CHANGED
package/dist-lib/lib/client.js
CHANGED
|
@@ -51,11 +51,14 @@ export class Client extends ReadyResource {
|
|
|
51
51
|
return watch;
|
|
52
52
|
};
|
|
53
53
|
}
|
|
54
|
-
|
|
54
|
+
_closeWatches() {
|
|
55
55
|
for (const watch of this._watches) {
|
|
56
56
|
watch.destroy();
|
|
57
57
|
}
|
|
58
58
|
this._watches.clear();
|
|
59
|
+
}
|
|
60
|
+
async _close() {
|
|
61
|
+
this._closeWatches();
|
|
59
62
|
const stream = this._stream;
|
|
60
63
|
if (stream && !stream.destroyed) {
|
|
61
64
|
const closed = new Promise((resolve) => stream.on('close', resolve));
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { HarnessError } from '@qvac/harness/errors';
|
|
2
2
|
import { COMPACTION_MIN_CTX_SIZE } from './model-context.js';
|
|
3
3
|
export const COMPACTION_KEEP_TURNS = 1;
|
|
4
4
|
export const COMPACTION_TURN_PREFIX = '[Summary of the earlier conversation in this chat, written by another model. Treat it as established context, not as a new request.]';
|
|
@@ -114,5 +114,5 @@ export function nearContextLimit(cacheTokens, ctxSize) {
|
|
|
114
114
|
return cacheTokens >= ctxSize * compactionTriggerRatio(ctxSize);
|
|
115
115
|
}
|
|
116
116
|
export function isContextOverflowFailure(message) {
|
|
117
|
-
return message === CONTEXT_OVERFLOW_MESSAGE;
|
|
117
|
+
return message === HarnessError.CONTEXT_OVERFLOW_MESSAGE;
|
|
118
118
|
}
|
|
@@ -16,66 +16,33 @@ function patch(next, current) {
|
|
|
16
16
|
return next === null || next === undefined ? current : next;
|
|
17
17
|
}
|
|
18
18
|
export async function listAgents(store, providerDeviceId) {
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
if (providerDeviceId) {
|
|
22
|
-
return await snap
|
|
23
|
-
.find(AGENTS_BY_PROVIDER, providerRange(providerDeviceId))
|
|
24
|
-
.toArray();
|
|
25
|
-
}
|
|
26
|
-
return await snap.find(ACTIVE_AGENTS).toArray();
|
|
27
|
-
}
|
|
28
|
-
finally {
|
|
29
|
-
await snap.close();
|
|
19
|
+
if (providerDeviceId) {
|
|
20
|
+
return store.view.find(AGENTS_BY_PROVIDER, providerRange(providerDeviceId)).toArray();
|
|
30
21
|
}
|
|
22
|
+
return store.view.find(ACTIVE_AGENTS).toArray();
|
|
31
23
|
}
|
|
32
24
|
export async function getDefaultAgent(store, providerDeviceId) {
|
|
33
|
-
const
|
|
34
|
-
|
|
35
|
-
const range = providerDeviceId ? providerRange(providerDeviceId) : {};
|
|
36
|
-
return await snap.findOne(DEFAULT_AGENTS, range);
|
|
37
|
-
}
|
|
38
|
-
finally {
|
|
39
|
-
await snap.close();
|
|
40
|
-
}
|
|
25
|
+
const range = providerDeviceId ? providerRange(providerDeviceId) : {};
|
|
26
|
+
return store.view.findOne(DEFAULT_AGENTS, range);
|
|
41
27
|
}
|
|
42
28
|
function providerRange(providerDeviceId) {
|
|
43
29
|
return { gte: { providerDeviceId }, lte: { providerDeviceId } };
|
|
44
30
|
}
|
|
45
31
|
export async function getAgent(store, id) {
|
|
46
|
-
|
|
47
|
-
try {
|
|
48
|
-
const agent = await snap.get(AGENTS, { id });
|
|
49
|
-
return agent;
|
|
50
|
-
}
|
|
51
|
-
finally {
|
|
52
|
-
await snap.close();
|
|
53
|
-
}
|
|
32
|
+
return store.view.get(AGENTS, { id });
|
|
54
33
|
}
|
|
55
34
|
export async function isOrphaned(store, agent) {
|
|
56
|
-
const
|
|
57
|
-
|
|
58
|
-
const device = await snap.get(DEVICES, { id: agent.providerDeviceId });
|
|
59
|
-
return !device || device.revoked === true;
|
|
60
|
-
}
|
|
61
|
-
finally {
|
|
62
|
-
await snap.close();
|
|
63
|
-
}
|
|
35
|
+
const device = await store.view.get(DEVICES, { id: agent.providerDeviceId });
|
|
36
|
+
return !device || device.revoked === true;
|
|
64
37
|
}
|
|
65
38
|
export async function liveProviderIds(store) {
|
|
66
39
|
const live = new Set();
|
|
67
|
-
const
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
if (!device.revoked) {
|
|
71
|
-
live.add(b4a.toHex(device.id));
|
|
72
|
-
}
|
|
40
|
+
for await (const device of store.view.find(DEVICES)) {
|
|
41
|
+
if (!device.revoked) {
|
|
42
|
+
live.add(b4a.toHex(device.id));
|
|
73
43
|
}
|
|
74
|
-
return live;
|
|
75
|
-
}
|
|
76
|
-
finally {
|
|
77
|
-
await snap.close();
|
|
78
44
|
}
|
|
45
|
+
return live;
|
|
79
46
|
}
|
|
80
47
|
export async function mustGetAgent(store, id) {
|
|
81
48
|
const agent = await getAgent(store, id);
|
|
@@ -3,14 +3,7 @@ import b4a from 'b4a';
|
|
|
3
3
|
import { APPROVAL_RULES } from './collections.js';
|
|
4
4
|
import { CoreError } from '../errors.js';
|
|
5
5
|
export async function listApprovalRules(store) {
|
|
6
|
-
|
|
7
|
-
try {
|
|
8
|
-
const rules = await snap.find(APPROVAL_RULES).toArray();
|
|
9
|
-
return rules;
|
|
10
|
-
}
|
|
11
|
-
finally {
|
|
12
|
-
await snap.close();
|
|
13
|
-
}
|
|
6
|
+
return store.view.find(APPROVAL_RULES).toArray();
|
|
14
7
|
}
|
|
15
8
|
export async function putApprovalRule(store, input) {
|
|
16
9
|
const now = Date.now();
|
|
@@ -3,7 +3,7 @@ import type CorestoreStorage from 'hypercore-storage';
|
|
|
3
3
|
import type { LoggerInterface } from '@qvac/logging';
|
|
4
4
|
import type { LocalMeshMembership } from '../../spec/local/hyperschema/types.d.ts';
|
|
5
5
|
import { type PublicRecord } from './public-mesh.ts';
|
|
6
|
-
import { Mesh } from './mesh.ts';
|
|
6
|
+
import { Mesh, type ErrorSink } from './mesh.ts';
|
|
7
7
|
export interface ArchivedMeshCounts {
|
|
8
8
|
readonly chats: number;
|
|
9
9
|
readonly agents: number;
|
|
@@ -22,6 +22,7 @@ export interface ArchivedMeshOptions {
|
|
|
22
22
|
readonly storage: CorestoreStorage;
|
|
23
23
|
readonly deviceId: Buffer;
|
|
24
24
|
readonly logger: LoggerInterface | null;
|
|
25
|
+
readonly onerror?: ErrorSink;
|
|
25
26
|
readonly publicRecord?: (workspaceKey: Buffer) => Promise<PublicRecord | null>;
|
|
26
27
|
}
|
|
27
28
|
export declare function withArchivedMesh<T>(row: LocalMeshMembership, opts: ArchivedMeshOptions, fn: (mesh: Mesh, account: Mesh) => Promise<T>): Promise<T>;
|
|
@@ -4,7 +4,7 @@ import { copyBlob, copyChunks, stripped } from './chat-copy.js';
|
|
|
4
4
|
import { publicMeshKey, publicSeed } from './public-mesh.js';
|
|
5
5
|
import { Mesh } from './mesh.js';
|
|
6
6
|
import { recordedRole } from './local/index.js';
|
|
7
|
-
import { ACTIVE_AGENTS, ACTIVE_CHATS, ACTIVE_CHAT_GROUPS, ACTIVE_TOOL_CONFIGS_BY_AGENT, AGENTS, KNOWLEDGE, MESH_SEEDS } from './collections.js';
|
|
7
|
+
import { ACTIVE_AGENTS, ACTIVE_CHATS, ACTIVE_CHAT_GROUPS, ACTIVE_TOOL_CONFIGS_BY_AGENT, AGENTS, CHATS, CHAT_GROUPS, KNOWLEDGE, MESH_SEEDS } from './collections.js';
|
|
8
8
|
import { CoreError } from '../errors.js';
|
|
9
9
|
const MIGRATED_SUFFIX = ' (migrated)';
|
|
10
10
|
export async function withArchivedMesh(row, opts, fn) {
|
|
@@ -17,7 +17,8 @@ export async function withArchivedMesh(row, opts, fn) {
|
|
|
17
17
|
role: recordedRole(row),
|
|
18
18
|
deviceId: opts.deviceId,
|
|
19
19
|
writerSeed: row.writerSeed ?? undefined,
|
|
20
|
-
logger: opts.logger
|
|
20
|
+
logger: opts.logger,
|
|
21
|
+
onerror: opts.onerror
|
|
21
22
|
});
|
|
22
23
|
await mesh.ready();
|
|
23
24
|
try {
|
|
@@ -62,7 +63,8 @@ async function openArchivedPublic(account, opts) {
|
|
|
62
63
|
role: 'public',
|
|
63
64
|
deviceId: opts.deviceId,
|
|
64
65
|
writerSeed: record.writerSeed,
|
|
65
|
-
logger: opts.logger
|
|
66
|
+
logger: opts.logger,
|
|
67
|
+
onerror: opts.onerror
|
|
66
68
|
});
|
|
67
69
|
await mesh.ready();
|
|
68
70
|
if (mesh.localLength === 0) {
|
|
@@ -74,17 +76,15 @@ async function openArchivedPublic(account, opts) {
|
|
|
74
76
|
}
|
|
75
77
|
export async function countContents(mesh, into, agents = mesh) {
|
|
76
78
|
const snap = mesh.view.snapshot();
|
|
77
|
-
const defined = agents.view.snapshot();
|
|
78
79
|
try {
|
|
79
80
|
return {
|
|
80
81
|
chats: await count(snap.find(ACTIVE_CHATS)),
|
|
81
|
-
agents: await countAgents(
|
|
82
|
+
agents: await countAgents(agents === mesh ? snap : agents.view, into),
|
|
82
83
|
knowledge: (await liveKnowledge(snap)).length
|
|
83
84
|
};
|
|
84
85
|
}
|
|
85
86
|
finally {
|
|
86
87
|
await snap.close();
|
|
87
|
-
await defined.close();
|
|
88
88
|
}
|
|
89
89
|
}
|
|
90
90
|
async function countAgents(snap, into) {
|
|
@@ -109,10 +109,14 @@ export async function migrateContents(from, into, configs = {}) {
|
|
|
109
109
|
const targets = { into, configsFrom: configs.from ?? from, configsInto: configs.into ?? into };
|
|
110
110
|
const agents = await migrateAgents(targets, new Set(chats.map((chat) => chat.agentId)));
|
|
111
111
|
for (const group of groups) {
|
|
112
|
-
|
|
112
|
+
if (!(await into.view.get(CHAT_GROUPS, { id: group.id }))) {
|
|
113
|
+
batch.dispatch('put-chat-group', { group: stripped(group) });
|
|
114
|
+
}
|
|
113
115
|
}
|
|
114
116
|
for (const chat of chats) {
|
|
115
|
-
|
|
117
|
+
if (!(await into.view.get(CHATS, { id: chat.id }))) {
|
|
118
|
+
batch.dispatch('put-chat', { chat: stripped(chat) });
|
|
119
|
+
}
|
|
116
120
|
}
|
|
117
121
|
await batch.flush();
|
|
118
122
|
for (const chat of chats) {
|
|
@@ -1,14 +1,17 @@
|
|
|
1
1
|
import type HyperDB from 'hyperdb';
|
|
2
2
|
import type { QvacChunk } from '../../spec/mesh/hyperschema/types.d.ts';
|
|
3
3
|
import type { Mesh } from './mesh.ts';
|
|
4
|
+
export declare const UNCOPIED: ReadonlySet<string>;
|
|
4
5
|
export interface MeshCopy {
|
|
5
6
|
readonly from: Mesh;
|
|
6
7
|
readonly into: Mesh;
|
|
7
8
|
}
|
|
8
|
-
export interface
|
|
9
|
+
export interface BlobCopy extends MeshCopy {
|
|
10
|
+
readonly references: Map<string, string>;
|
|
11
|
+
}
|
|
12
|
+
export interface ChatMoveCopy extends BlobCopy {
|
|
9
13
|
readonly chatId: string;
|
|
10
14
|
readonly originDeviceId: Buffer;
|
|
11
|
-
readonly references: Map<string, string>;
|
|
12
15
|
}
|
|
13
16
|
export declare function copyChunks(snap: HyperDB, chatId: string, { from, into }: MeshCopy): Promise<void>;
|
|
14
17
|
export interface MovedChunks {
|
|
@@ -19,7 +22,7 @@ export interface MovedChunks {
|
|
|
19
22
|
export declare function copyMovedChunks(snap: HyperDB, chatId: string, copy: ChatMoveCopy): Promise<MovedChunks>;
|
|
20
23
|
export declare function sentBy(chunk: QvacChunk): Buffer | undefined;
|
|
21
24
|
export declare function copyMovedKnowledge(snap: HyperDB, chatId: string, copy: ChatMoveCopy): Promise<void>;
|
|
22
|
-
export declare function movedBlob({ from, into, references }:
|
|
25
|
+
export declare function movedBlob({ from, into, references }: BlobCopy, { blobId }: BlobHolder): Promise<string>;
|
|
23
26
|
export declare function removedReference({ mimeType }: TypedFile): string;
|
|
24
27
|
interface TypedFile {
|
|
25
28
|
readonly mimeType: string;
|
|
@@ -36,6 +39,18 @@ export interface ContentCopy extends MeshCopy {
|
|
|
36
39
|
readonly deviceId: Buffer;
|
|
37
40
|
readonly chats?: ReadonlySet<string>;
|
|
38
41
|
readonly endsOpenRuns?: boolean;
|
|
42
|
+
readonly baseline?: CopyBaseline;
|
|
43
|
+
readonly historyOnly?: boolean;
|
|
44
|
+
}
|
|
45
|
+
export interface CopyBaseline {
|
|
46
|
+
get(key: string): Promise<CopiedFields | null>;
|
|
47
|
+
set(rows: ReadonlyArray<CopiedRow>): Promise<void>;
|
|
48
|
+
}
|
|
49
|
+
export type CopiedFields = Readonly<Record<string, string>>;
|
|
50
|
+
export declare function isCopiedFields(value: unknown): value is CopiedFields;
|
|
51
|
+
export interface CopiedRow {
|
|
52
|
+
readonly key: string;
|
|
53
|
+
readonly fields: CopiedFields;
|
|
39
54
|
}
|
|
40
55
|
export declare function copyContent(copy: ContentCopy): Promise<void>;
|
|
41
56
|
export declare const UPGRADED_RUN_REASON = "the app was updated before this was answered, send it again";
|
|
@@ -1,12 +1,15 @@
|
|
|
1
1
|
import b4a from 'b4a';
|
|
2
2
|
import { PENDING_BLOB_REFERENCE, isPendingBlobReference, parseBlobReference } from './files/store/index.js';
|
|
3
3
|
import { CoreError } from '../errors.js';
|
|
4
|
+
import { isRecord } from '../guards.js';
|
|
4
5
|
import { inlineReference } from './files/store/inline.js';
|
|
5
6
|
import { TERMINAL_RUN_STATES } from './contract/run-requests.js';
|
|
6
7
|
import { appendChunk, ownedByUs, updateOp } from './chunk.js';
|
|
7
|
-
import { runRequestOf } from './contract/chunks.js';
|
|
8
|
+
import { mayEditChunk, runRequestOf } from './contract/chunks.js';
|
|
9
|
+
import { PATCHABLE_CHAT } from './contract/chat.js';
|
|
10
|
+
import { PATCHABLE_GROUP } from './contract/chat-group.js';
|
|
8
11
|
import { ACTIVE_AGENTS, AGENTS, CHATS, CHAT_GROUPS, CHUNKS, CHUNKS_BY_CHAT, DEVICES, KNOWLEDGE, KNOWLEDGE_ARTIFACTS, KNOWLEDGE_BY_CHAT, PURGED_CHATS, TOOL_ACTIVITY } from './collections.js';
|
|
9
|
-
const UNCOPIED = new Set(['context', 'model-request']);
|
|
12
|
+
export const UNCOPIED = new Set(['context', 'model-request']);
|
|
10
13
|
export async function copyChunks(snap, chatId, { from, into }) {
|
|
11
14
|
const batch = into.batch();
|
|
12
15
|
for (const chunk of await chunksOf(snap, chatId)) {
|
|
@@ -175,16 +178,20 @@ export function stripped(row) {
|
|
|
175
178
|
const { version: _version, ...rest } = row;
|
|
176
179
|
return rest;
|
|
177
180
|
}
|
|
181
|
+
export function isCopiedFields(value) {
|
|
182
|
+
return isRecord(value) && Object.values(value).every((field) => typeof field === 'string');
|
|
183
|
+
}
|
|
178
184
|
export async function copyContent(copy) {
|
|
179
185
|
await copy.into.autobee.update();
|
|
180
186
|
await copy.from.autobee.update();
|
|
181
187
|
const snap = copy.from.view.snapshot();
|
|
182
188
|
try {
|
|
183
|
-
const
|
|
184
|
-
|
|
189
|
+
const chats = copy.historyOnly
|
|
190
|
+
? [...(copy.chats ?? [])]
|
|
191
|
+
: (await copyRows(snap, copy, await defaultAgentRemap(snap, copy.into))).map(({ id }) => id);
|
|
185
192
|
const references = new Map();
|
|
186
|
-
for (const
|
|
187
|
-
await copyChatChunks(snap,
|
|
193
|
+
for (const chatId of chats) {
|
|
194
|
+
await copyChatChunks(snap, chatId, { ...copy, references });
|
|
188
195
|
}
|
|
189
196
|
await copyFiles(snap, { ...copy, references });
|
|
190
197
|
await copyToolActivity(snap, copy);
|
|
@@ -207,10 +214,12 @@ async function defaultAgentRemap(snap, into) {
|
|
|
207
214
|
return remap;
|
|
208
215
|
}
|
|
209
216
|
async function copyRows(snap, copy, remap) {
|
|
210
|
-
const { into } = copy;
|
|
217
|
+
const { into, baseline } = copy;
|
|
211
218
|
const batch = into.batch();
|
|
212
219
|
const chats = await copiedChats(snap, copy);
|
|
213
|
-
|
|
220
|
+
const copied = [];
|
|
221
|
+
const catalog = { into, batch, remap, chats, ungroup: !!copy.chats, baseline, copied };
|
|
222
|
+
await copyAgentsAndGroups(snap, catalog);
|
|
214
223
|
const live = [];
|
|
215
224
|
for (const chat of chats) {
|
|
216
225
|
const agent = remap.get(chat.agentId);
|
|
@@ -220,12 +229,10 @@ async function copyRows(snap, copy, remap) {
|
|
|
220
229
|
if (!chat.deletedAt) {
|
|
221
230
|
live.push(chat);
|
|
222
231
|
}
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
});
|
|
228
|
-
}
|
|
232
|
+
const groupId = copy.chats ? undefined : chat.groupId;
|
|
233
|
+
const sent = { ...stripped(chat), agentId: agent?.id ?? chat.agentId, groupId };
|
|
234
|
+
const edit = await editOf(into, { collection: CHATS, row: sent, patchable: PATCHABLE_CHAT, baseline }, copied);
|
|
235
|
+
dispatchEdit(batch, edit, { put: 'put-chat', patch: 'patch-chat', payload: { chat: sent } });
|
|
229
236
|
}
|
|
230
237
|
const purged = copy.chats ? [] : await snap.find(PURGED_CHATS).toArray();
|
|
231
238
|
for (const row of purged) {
|
|
@@ -234,13 +241,14 @@ async function copyRows(snap, copy, remap) {
|
|
|
234
241
|
}
|
|
235
242
|
}
|
|
236
243
|
await batch.flush();
|
|
244
|
+
await baseline?.set(copied);
|
|
237
245
|
return live;
|
|
238
246
|
}
|
|
239
247
|
async function copiedChats(snap, { chats }) {
|
|
240
248
|
const all = await snap.find(CHATS).toArray();
|
|
241
249
|
return chats ? all.filter((chat) => chats.has(chat.id) && !chat.deletedAt) : all;
|
|
242
250
|
}
|
|
243
|
-
async function copyAgentsAndGroups(snap, { into, batch, remap, chats, ungroup }) {
|
|
251
|
+
async function copyAgentsAndGroups(snap, { into, batch, remap, chats, ungroup, baseline, copied }) {
|
|
244
252
|
const used = new Set(chats.map((chat) => chat.agentId));
|
|
245
253
|
for (const agent of await snap.find(AGENTS).toArray()) {
|
|
246
254
|
if (used.has(agent.id) && !remap.has(agent.id) && (await newer(into, AGENTS, agent))) {
|
|
@@ -248,10 +256,37 @@ async function copyAgentsAndGroups(snap, { into, batch, remap, chats, ungroup })
|
|
|
248
256
|
}
|
|
249
257
|
}
|
|
250
258
|
const groups = ungroup ? [] : await snap.find(CHAT_GROUPS).toArray();
|
|
251
|
-
for (const
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
259
|
+
for (const row of groups) {
|
|
260
|
+
const group = stripped(row);
|
|
261
|
+
const copy = { collection: CHAT_GROUPS, row: group, patchable: PATCHABLE_GROUP, baseline };
|
|
262
|
+
const edit = await editOf(into, copy, copied);
|
|
263
|
+
dispatchEdit(batch, edit, {
|
|
264
|
+
put: 'put-chat-group',
|
|
265
|
+
patch: 'patch-chat-group',
|
|
266
|
+
payload: { group }
|
|
267
|
+
});
|
|
268
|
+
}
|
|
269
|
+
}
|
|
270
|
+
async function editOf(into, { collection, row, patchable, baseline }, copied) {
|
|
271
|
+
const held = await into.view.get(collection, { id: row.id });
|
|
272
|
+
if (!baseline) {
|
|
273
|
+
return !held || (held.updatedAt ?? 0) < (row.updatedAt ?? 0) ? 'put' : [];
|
|
274
|
+
}
|
|
275
|
+
const key = `${collection}/${row.id}`;
|
|
276
|
+
const fields = Object.fromEntries(patchable.map((f) => [f, JSON.stringify(row[f] ?? null)]));
|
|
277
|
+
const last = await baseline.get(key);
|
|
278
|
+
const changed = last ? patchable.filter((field) => fields[field] !== last[field]) : [];
|
|
279
|
+
if (!last || changed.length > 0) {
|
|
280
|
+
copied.push({ key, fields });
|
|
281
|
+
}
|
|
282
|
+
return !held || (row.deletedAt && !held.deletedAt) ? 'put' : changed;
|
|
283
|
+
}
|
|
284
|
+
function dispatchEdit(batch, edit, { put, patch, payload }) {
|
|
285
|
+
if (edit === 'put') {
|
|
286
|
+
batch.dispatch(put, payload);
|
|
287
|
+
}
|
|
288
|
+
else if (edit.length > 0) {
|
|
289
|
+
batch.dispatch(patch, { ...payload, fields: edit });
|
|
255
290
|
}
|
|
256
291
|
}
|
|
257
292
|
async function seededChat(snap, chat, agent) {
|
|
@@ -323,16 +358,27 @@ async function senderOf(snap, chunk) {
|
|
|
323
358
|
return sentBy(chunk) ?? device?.memberId ?? undefined;
|
|
324
359
|
}
|
|
325
360
|
async function updateHeldChunk(chunk, held, copy) {
|
|
326
|
-
if (!b4a.equals(chunk.originDeviceId, copy.deviceId))
|
|
327
|
-
return;
|
|
328
361
|
const { into } = copy;
|
|
362
|
+
const decided = chunk.approvalRequest?.status;
|
|
363
|
+
if (held.approvalRequest?.status === 'pending' && decided && decided !== 'pending') {
|
|
364
|
+
const resolvedAt = chunk.updatedAt ?? chunk.createdAt;
|
|
365
|
+
await into.dispatch('resolve-approval', {
|
|
366
|
+
id: chunk.id,
|
|
367
|
+
approved: decided === 'approved',
|
|
368
|
+
resolvedAt
|
|
369
|
+
});
|
|
370
|
+
return;
|
|
371
|
+
}
|
|
329
372
|
if (chunk.runStatus) {
|
|
330
|
-
if (newerEdit(chunk, held)) {
|
|
373
|
+
if (b4a.equals(chunk.originDeviceId, copy.deviceId) && newerEdit(chunk, held)) {
|
|
331
374
|
const op = updateOp(chunk, { id: chunk.id, runStatus: chunk.runStatus });
|
|
332
375
|
await into.dispatch('update-chunk', op);
|
|
333
376
|
}
|
|
334
377
|
return;
|
|
335
378
|
}
|
|
379
|
+
if (!(await mayEditChunk(into.view, held, into.localWriterKey))) {
|
|
380
|
+
return;
|
|
381
|
+
}
|
|
336
382
|
const attachment = await repointed(chunk, held, copy);
|
|
337
383
|
if (attachment) {
|
|
338
384
|
await into.dispatch('update-chunk', updateOp(chunk, { id: chunk.id, attachment }));
|
|
@@ -366,7 +412,11 @@ async function copyFiles(snap, copy) {
|
|
|
366
412
|
const copied = chats ? rows.filter((row) => !!row.chatId && chats.has(row.chatId)) : rows;
|
|
367
413
|
const ids = new Set(copied.map((row) => row.id));
|
|
368
414
|
for (const row of copied) {
|
|
369
|
-
|
|
415
|
+
const held = await into.view.get(KNOWLEDGE, { id: row.id });
|
|
416
|
+
if (held && row.deletedAt && !held.deletedAt) {
|
|
417
|
+
batch.dispatch('remove-knowledge', { knowledgeId: row.id, at: row.deletedAt });
|
|
418
|
+
}
|
|
419
|
+
if (held) {
|
|
370
420
|
continue;
|
|
371
421
|
}
|
|
372
422
|
const blobId = row.deletedAt ? removedReference(row) : await movedBlob(moveOf(copy), row);
|
|
@@ -398,8 +448,7 @@ async function copyToolActivity(snap, { into, chats }) {
|
|
|
398
448
|
if (await into.view.get(TOOL_ACTIVITY, { id: row.id })) {
|
|
399
449
|
continue;
|
|
400
450
|
}
|
|
401
|
-
|
|
402
|
-
batch.dispatch('append-tool-activity', { activity });
|
|
451
|
+
batch.dispatch('append-tool-activity', { activity: { ...stripped(row), seq: 0 } });
|
|
403
452
|
}
|
|
404
453
|
await batch.flush();
|
|
405
454
|
}
|
|
@@ -157,6 +157,9 @@ async function forkedChunks(ctx, chunks) {
|
|
|
157
157
|
if (through && !ctx.kept.has(through)) {
|
|
158
158
|
continue;
|
|
159
159
|
}
|
|
160
|
+
if (chunk.sourceId && chunk.attachment && !(await heldReference(ctx, chunk.attachment))) {
|
|
161
|
+
continue;
|
|
162
|
+
}
|
|
160
163
|
forked.push(await forkedChunk(ctx, chunk));
|
|
161
164
|
}
|
|
162
165
|
return forked;
|
|
@@ -200,21 +203,27 @@ async function forkedDocuments(ctx, rows) {
|
|
|
200
203
|
return forked;
|
|
201
204
|
}
|
|
202
205
|
async function forkedReference(ctx, file) {
|
|
206
|
+
if (!file.deletedAt && isPendingBlobReference(file.blobId)) {
|
|
207
|
+
throw new CoreError('CHAT_FORK_FILE_ARRIVING');
|
|
208
|
+
}
|
|
209
|
+
const held = await heldReference(ctx, file);
|
|
210
|
+
if (!held) {
|
|
211
|
+
throw new CoreError('CHAT_FORK_FILE_NOT_HERE');
|
|
212
|
+
}
|
|
213
|
+
return held;
|
|
214
|
+
}
|
|
215
|
+
async function heldReference(ctx, file) {
|
|
203
216
|
if (file.deletedAt) {
|
|
204
217
|
return removedReference(file);
|
|
205
218
|
}
|
|
206
|
-
if (isPendingBlobReference(file.blobId)) {
|
|
207
|
-
throw new CoreError('CHAT_FORK_FILE_ARRIVING');
|
|
208
|
-
}
|
|
209
219
|
const known = ctx.references.get(file.blobId);
|
|
210
220
|
if (known) {
|
|
211
221
|
return known;
|
|
212
222
|
}
|
|
213
223
|
const copied = await copyBlob(ctx.from, ctx.into, file.blobId);
|
|
214
|
-
if (
|
|
215
|
-
|
|
224
|
+
if (copied) {
|
|
225
|
+
ctx.references.set(file.blobId, copied);
|
|
216
226
|
}
|
|
217
|
-
ctx.references.set(file.blobId, copied);
|
|
218
227
|
return copied;
|
|
219
228
|
}
|
|
220
229
|
async function forkedChat(ctx, input) {
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { CoreError } from '../errors.js';
|
|
2
|
+
import { nextUpdatedAt } from './contract/chat.js';
|
|
2
3
|
import { randomId } from './id.js';
|
|
3
4
|
import { place } from './rank.js';
|
|
4
5
|
import { ACTIVE_CHAT_GROUPS, CHAT_GROUPS } from './collections.js';
|
|
@@ -23,23 +24,10 @@ export async function listChatGroupsIn(snap) {
|
|
|
23
24
|
return groups.sort(byGroupOrder);
|
|
24
25
|
}
|
|
25
26
|
export async function listChatGroups(store) {
|
|
26
|
-
|
|
27
|
-
try {
|
|
28
|
-
return await listChatGroupsIn(snap);
|
|
29
|
-
}
|
|
30
|
-
finally {
|
|
31
|
-
await snap.close();
|
|
32
|
-
}
|
|
27
|
+
return listChatGroupsIn(store.view);
|
|
33
28
|
}
|
|
34
29
|
export async function getChatGroup(store, id) {
|
|
35
|
-
|
|
36
|
-
try {
|
|
37
|
-
const group = await snap.get(CHAT_GROUPS, { id });
|
|
38
|
-
return group;
|
|
39
|
-
}
|
|
40
|
-
finally {
|
|
41
|
-
await snap.close();
|
|
42
|
-
}
|
|
30
|
+
return store.view.get(CHAT_GROUPS, { id });
|
|
43
31
|
}
|
|
44
32
|
export async function mustGetChatGroup(store, id) {
|
|
45
33
|
const group = await getChatGroup(store, id);
|
|
@@ -79,8 +67,12 @@ export async function createChatGroup(store, input) {
|
|
|
79
67
|
}
|
|
80
68
|
async function patchChatGroup(store, id, patch) {
|
|
81
69
|
const current = await mustGetActiveChatGroup(store, id);
|
|
82
|
-
const updated = {
|
|
83
|
-
|
|
70
|
+
const updated = {
|
|
71
|
+
...current,
|
|
72
|
+
...patch,
|
|
73
|
+
updatedAt: nextUpdatedAt(current.updatedAt, Date.now())
|
|
74
|
+
};
|
|
75
|
+
await store.dispatch('patch-chat-group', { group: updated, fields: Object.keys(patch) });
|
|
84
76
|
return updated;
|
|
85
77
|
}
|
|
86
78
|
export async function renameChatGroup(store, id, name) {
|
|
@@ -115,15 +107,14 @@ export async function moveChatGroup(store, id, { afterId }) {
|
|
|
115
107
|
await snap.close();
|
|
116
108
|
}
|
|
117
109
|
const stamp = (row, rank) => ({
|
|
118
|
-
...row,
|
|
119
|
-
rank
|
|
120
|
-
updatedAt: Math.max(now, row.updatedAt)
|
|
110
|
+
group: { ...row, rank, updatedAt: nextUpdatedAt(row.updatedAt, now) },
|
|
111
|
+
fields: ['rank']
|
|
121
112
|
});
|
|
122
113
|
const batch = store.batch();
|
|
123
114
|
for (const { row, rank } of placement.respaced) {
|
|
124
|
-
batch.dispatch('
|
|
115
|
+
batch.dispatch('patch-chat-group', stamp(row, rank));
|
|
125
116
|
}
|
|
126
|
-
batch.dispatch('
|
|
117
|
+
batch.dispatch('patch-chat-group', stamp(current, placement.rank));
|
|
127
118
|
await batch.flush();
|
|
128
119
|
return mustGetActiveChatGroup(store, id);
|
|
129
120
|
}
|
|
@@ -133,8 +124,9 @@ export async function sortChatGroupsByName(store) {
|
|
|
133
124
|
for (const group of await listChatGroups(store)) {
|
|
134
125
|
if (!group.rank)
|
|
135
126
|
continue;
|
|
136
|
-
batch.dispatch('
|
|
137
|
-
group: { ...group, rank: 0, updatedAt:
|
|
127
|
+
batch.dispatch('patch-chat-group', {
|
|
128
|
+
group: { ...group, rank: 0, updatedAt: nextUpdatedAt(group.updatedAt, now) },
|
|
129
|
+
fields: ['rank']
|
|
138
130
|
});
|
|
139
131
|
}
|
|
140
132
|
await batch.flush();
|
|
@@ -28,6 +28,9 @@ export declare class ChatMoves {
|
|
|
28
28
|
private readonly _listeners;
|
|
29
29
|
private readonly _settling;
|
|
30
30
|
private readonly _moving;
|
|
31
|
+
private readonly _followed;
|
|
32
|
+
private readonly _forwards;
|
|
33
|
+
private readonly _forwarding;
|
|
31
34
|
private readonly _abort;
|
|
32
35
|
private readonly _onChange;
|
|
33
36
|
private _patching;
|
|
@@ -49,6 +52,12 @@ export declare class ChatMoves {
|
|
|
49
52
|
private _settle;
|
|
50
53
|
private _land;
|
|
51
54
|
private _leave;
|
|
55
|
+
followSource(source: Mesh): Promise<void>;
|
|
56
|
+
private _follow;
|
|
57
|
+
private _forward;
|
|
58
|
+
private _forwardMoved;
|
|
59
|
+
private _unreachable;
|
|
60
|
+
private _carryLate;
|
|
52
61
|
private _cancel;
|
|
53
62
|
private _stopped;
|
|
54
63
|
private _copy;
|