@securecoms/agent-bridge 0.28.2 → 0.30.0
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/README.md +288 -81
- package/dist/bin.d.ts +1 -1
- package/dist/bin.js +5112 -508
- package/dist/bridge-agent.d.ts +393 -3
- package/dist/config.d.ts +9 -0
- package/dist/consumer-grants.d.ts +19 -0
- package/dist/grants/binding.d.ts +58 -0
- package/dist/grants/effective.d.ts +47 -0
- package/dist/grants/manifest.d.ts +68 -0
- package/dist/grants/owner-turn.d.ts +52 -0
- package/dist/grants/persona-render.d.ts +30 -0
- package/dist/grants/pin-command.d.ts +31 -0
- package/dist/grants/pin.d.ts +35 -0
- package/dist/grants/room-search-cap.d.ts +15 -0
- package/dist/grants/voice-fence.d.ts +53 -0
- package/dist/http-server.d.ts +1 -0
- package/dist/index.js +4658 -248
- package/dist/memory/note-frames.d.ts +1 -1
- package/dist/memory/unified/chunk.d.ts +12 -0
- package/dist/memory/unified/config.d.ts +7 -0
- package/dist/memory/unified/consumer-unified.d.ts +21 -0
- package/dist/memory/unified/escape.d.ts +23 -0
- package/dist/memory/unified/index-key.d.ts +8 -0
- package/dist/memory/unified/item-book.d.ts +73 -0
- package/dist/memory/unified/item-reembed.d.ts +20 -0
- package/dist/memory/unified/migrate.d.ts +79 -0
- package/dist/memory/unified/owner-scope.d.ts +48 -0
- package/dist/memory/unified/pin-rules.d.ts +18 -0
- package/dist/memory/unified/ranking-client.d.ts +48 -0
- package/dist/memory/unified/ranking-core-constants.d.ts +8 -0
- package/dist/memory/unified/ranking-core.d.ts +117 -0
- package/dist/memory/unified/ranking-inprocess.d.ts +3 -0
- package/dist/memory/unified/ranking-worker.d.ts +1 -0
- package/dist/memory/unified/read-book.d.ts +81 -0
- package/dist/memory/unified/switch.d.ts +8 -0
- package/dist/memory/unified/text.d.ts +15 -0
- package/dist/memory/unified/worker-protocol.d.ts +106 -0
- package/dist/memory-taps.d.ts +1 -1
- package/dist/memory-worker.js +598 -0
- package/dist/service/runtime-config-dir.d.ts +15 -0
- package/dist/version.d.ts +1 -1
- package/dist/ws-server.d.ts +3 -1
- package/package.json +1 -1
|
@@ -0,0 +1,106 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Unified memory (spec section 8.5, H-7, T-33): the messages between the bridge and its ranking worker. Only ids, scores and
|
|
3
|
+
* the opened texts of the items selected for a turn cross back. No message type FROM the worker carries a vector or a
|
|
4
|
+
* raw sealed buffer (worker-protocol.arch.test.ts, Task 14). The query vector goes TO the worker.
|
|
5
|
+
*/
|
|
6
|
+
import type { ItemKind, ItemSource, ItemTrust, ScopeKind } from "@agentvault/connect-mls-store/memory-items";
|
|
7
|
+
export interface WorkerInit {
|
|
8
|
+
dbPath: string;
|
|
9
|
+
identityId: string;
|
|
10
|
+
storeKey: Uint8Array;
|
|
11
|
+
modelId: string;
|
|
12
|
+
threshold: number;
|
|
13
|
+
warm: boolean;
|
|
14
|
+
/** Plan Task 35, the recall eval only: replaces OWNER_SCOPE_PRIOR / RECENCY_SLOPE (0.05 since U1-G). Production never sets them (worker-protocol.arch.test.ts). */
|
|
15
|
+
priorOverride?: number;
|
|
16
|
+
recencySlopeOverride?: number;
|
|
17
|
+
}
|
|
18
|
+
export interface RankQuery {
|
|
19
|
+
scopes: string[];
|
|
20
|
+
ownerScope: string | null;
|
|
21
|
+
vec: Float32Array | null;
|
|
22
|
+
macs: Uint8Array[];
|
|
23
|
+
historyConversation: string;
|
|
24
|
+
currentMessageId: string;
|
|
25
|
+
maxItems: number;
|
|
26
|
+
maxChars: number;
|
|
27
|
+
nowMs: number;
|
|
28
|
+
excludeOriginIds: string[];
|
|
29
|
+
}
|
|
30
|
+
export interface OpenedItem {
|
|
31
|
+
itemId: number;
|
|
32
|
+
scopeKind: ScopeKind;
|
|
33
|
+
scopeId: string;
|
|
34
|
+
channelId: string;
|
|
35
|
+
kind: ItemKind;
|
|
36
|
+
originId: string;
|
|
37
|
+
originAt: number;
|
|
38
|
+
source: ItemSource;
|
|
39
|
+
trust: ItemTrust;
|
|
40
|
+
text: string;
|
|
41
|
+
/** Owner grants plan 4 Task 16 (voice fence, OQ-9): text only, from the sealed record and the row's clear source_ref. */
|
|
42
|
+
role?: "peer" | "agent";
|
|
43
|
+
origin?: "fast_path" | "reply" | "untrusted";
|
|
44
|
+
sourceRef?: string;
|
|
45
|
+
}
|
|
46
|
+
export type ToWorker = {
|
|
47
|
+
type: "query";
|
|
48
|
+
id: number;
|
|
49
|
+
q: RankQuery;
|
|
50
|
+
} | {
|
|
51
|
+
type: "pins";
|
|
52
|
+
id: number;
|
|
53
|
+
scopeId: string;
|
|
54
|
+
maxChars: number;
|
|
55
|
+
} | {
|
|
56
|
+
type: "pending";
|
|
57
|
+
id: number;
|
|
58
|
+
limit: number;
|
|
59
|
+
} | {
|
|
60
|
+
type: "added";
|
|
61
|
+
itemIds: number[];
|
|
62
|
+
} | {
|
|
63
|
+
type: "removed";
|
|
64
|
+
itemIds: number[];
|
|
65
|
+
} | {
|
|
66
|
+
type: "reset";
|
|
67
|
+
};
|
|
68
|
+
export type FromWorker = {
|
|
69
|
+
type: "ready";
|
|
70
|
+
hot: number;
|
|
71
|
+
hotBytes: number;
|
|
72
|
+
} | {
|
|
73
|
+
type: "result";
|
|
74
|
+
id: number;
|
|
75
|
+
items: OpenedItem[];
|
|
76
|
+
openFailed: number;
|
|
77
|
+
} | {
|
|
78
|
+
type: "pins";
|
|
79
|
+
id: number;
|
|
80
|
+
pins: OpenedItem[];
|
|
81
|
+
more: number;
|
|
82
|
+
openFailed: number;
|
|
83
|
+
} | {
|
|
84
|
+
type: "pending";
|
|
85
|
+
id: number;
|
|
86
|
+
rows: Array<{
|
|
87
|
+
itemId: number;
|
|
88
|
+
channelId: string;
|
|
89
|
+
scopeKind: ScopeKind;
|
|
90
|
+
scopeId: string;
|
|
91
|
+
originId: string;
|
|
92
|
+
chunkIndex: number;
|
|
93
|
+
text: string;
|
|
94
|
+
}>;
|
|
95
|
+
} | {
|
|
96
|
+
type: "stats";
|
|
97
|
+
hot: number;
|
|
98
|
+
hotBytes: number;
|
|
99
|
+
}
|
|
100
|
+
/** Final review bridge M-4: a request whose handler threw; the client answers it `failed` (a miss), the worker lives on. */
|
|
101
|
+
| {
|
|
102
|
+
type: "failed";
|
|
103
|
+
id: number;
|
|
104
|
+
} | {
|
|
105
|
+
type: "fatal";
|
|
106
|
+
};
|
package/dist/memory-taps.d.ts
CHANGED
|
@@ -15,5 +15,5 @@ interface MemorySink {
|
|
|
15
15
|
export declare function recordInboundMemory(sink: MemorySink, channelId: string, senderId: string, text: string, messageId: string, modality?: "text" | "voice", expectPurgeEpoch?: number): Promise<void>;
|
|
16
16
|
/** Record the agent's own outbound reply. Best-effort. `modality` is "voice"
|
|
17
17
|
* for a line the voice fast path spoke (H1), else "text". */
|
|
18
|
-
export declare function recordOutboundMemory(sink: MemorySink, channelId: string, text: string, messageId: string, modality?: "text" | "voice", expectPurgeEpoch?: number): Promise<void>;
|
|
18
|
+
export declare function recordOutboundMemory(sink: MemorySink, channelId: string, text: string, messageId: string, modality?: "text" | "voice", expectPurgeEpoch?: number, origin?: "fast_path" | "reply" | "untrusted"): Promise<void>;
|
|
19
19
|
export {};
|