@agentvault/muse-bridge 0.1.28 → 0.1.30
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 +18 -0
- package/dist/bridge.d.ts +36 -2
- package/dist/identity-prompt.d.ts +11 -0
- package/dist/index.js +655 -100
- package/dist/room-context.d.ts +103 -0
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -67,3 +67,21 @@ the bridge attempts one generic failure notice on that turn's captured reply
|
|
|
67
67
|
channel. The notice waits at most ten seconds before the next queued turn advances.
|
|
68
68
|
Echo exec/provider behavior remains unchanged; eligible terminal failure notices
|
|
69
69
|
apply to both providers.
|
|
70
|
+
|
|
71
|
+
## Copied-from ledger — REVIEW PERIODICALLY
|
|
72
|
+
|
|
73
|
+
These files were copied once from the Claude bridge and are now owned here. A fix
|
|
74
|
+
there does NOT reach us.
|
|
75
|
+
|
|
76
|
+
| File | Copied from `packages/claude-room-bridge` at | Last reviewed |
|
|
77
|
+
|---|---|---|
|
|
78
|
+
| `src/room-context.ts` | PR #1458 (created there, 2026-10-26) | PR #1458 |
|
|
79
|
+
|
|
80
|
+
To review one:
|
|
81
|
+
|
|
82
|
+
```bash
|
|
83
|
+
git log <last-reviewed>..HEAD -- packages/claude-room-bridge/src/<file>
|
|
84
|
+
```
|
|
85
|
+
|
|
86
|
+
Port anything that applies, then move "Last reviewed" forward whether or not you
|
|
87
|
+
ported anything. An unmoved entry then honestly means nobody looked.
|
package/dist/bridge.d.ts
CHANGED
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
/** Muse-owned room/DM wiring. Owner power is two raw booleans from
|
|
2
2
|
* `arming_snapshot` (`=== true` only). Do not copy grok grant-trim.
|
|
3
3
|
* Do not call decideArming, host-trust, or osIsolated. */
|
|
4
|
+
import { type ToolSpanSink } from "@agentvault/agentvault";
|
|
4
5
|
import type { RoomSession } from "./muse-session.js";
|
|
6
|
+
import { type RoomContextLimits } from "./room-context.js";
|
|
5
7
|
export declare function workAllowed(): boolean;
|
|
6
8
|
export declare function gatesRemoved(): boolean;
|
|
7
9
|
export declare function resetOwnerPower(): void;
|
|
@@ -13,6 +15,9 @@ export interface RoomMessage {
|
|
|
13
15
|
* `plaintext`. The @ gate reads this; absent on emitters < 0.23.42. */
|
|
14
16
|
caption?: string;
|
|
15
17
|
senderIsAgent?: boolean;
|
|
18
|
+
/** ISO send time from the emit (`data.created_at`). Used to stamp a message
|
|
19
|
+
* held as room context; receipt time stands in when absent. */
|
|
20
|
+
timestamp?: string;
|
|
16
21
|
}
|
|
17
22
|
export interface MessageMeta {
|
|
18
23
|
roomId?: string;
|
|
@@ -38,6 +43,15 @@ export interface RoomChannel {
|
|
|
38
43
|
roomId: string;
|
|
39
44
|
name?: string;
|
|
40
45
|
}) => void): unknown;
|
|
46
|
+
/** This agent left the room itself (SecureChannel.leaveRoom). Drops its held context. */
|
|
47
|
+
on(ev: "room_left", cb: (e: {
|
|
48
|
+
roomId: string;
|
|
49
|
+
}) => void): unknown;
|
|
50
|
+
/** Rooms the server no longer lists for this agent (removed or disbanded),
|
|
51
|
+
* pruned on reconnect. Drops their held context. */
|
|
52
|
+
on(ev: "rooms_reconciled", cb: (e: {
|
|
53
|
+
pruned?: string[];
|
|
54
|
+
}) => void): unknown;
|
|
41
55
|
on(ev: "message", cb: (text: string, metadata: MessageMeta) => void): unknown;
|
|
42
56
|
on(ev: "room_hushed", cb: (e: RoomHushed) => void): unknown;
|
|
43
57
|
on(ev: "arming_snapshot", cb: (e: ArmingSnapshot) => void): unknown;
|
|
@@ -63,6 +77,9 @@ export type BridgeTarget = {
|
|
|
63
77
|
export interface ReplyChannel {
|
|
64
78
|
sendToRoom(roomId: string, text: string): Promise<void>;
|
|
65
79
|
send(text: string): Promise<void>;
|
|
80
|
+
/** SecureChannel's TelemetryReporter (device JWT, buffered). Optional so
|
|
81
|
+
* fixtures and a channel without telemetry keep working. */
|
|
82
|
+
readonly telemetry?: ToolSpanSink | null;
|
|
66
83
|
/** #1418 — SecureChannel: run `fn` as `conversationId`'s turn, so an
|
|
67
84
|
* untargeted send inside it reaches that conversation's person only. */
|
|
68
85
|
runForConversation?<T>(conversationId: string | undefined, fn: () => Promise<T>, opts?: {
|
|
@@ -92,6 +109,20 @@ export declare function attachLifecycle(channel: LifecycleChannel, opts?: {
|
|
|
92
109
|
}) => void;
|
|
93
110
|
}): void;
|
|
94
111
|
export declare function roomTurnPrefix(roomId: string, senderName: string, roomName?: string): string;
|
|
112
|
+
/**
|
|
113
|
+
* What a held (unaddressed) room message contributes as context: the CAPTION
|
|
114
|
+
* the sender typed, never the folded file. SecureChannel folds an attachment's
|
|
115
|
+
* contents in FRONT of the caption, so holding `plaintext` and cutting it to
|
|
116
|
+
* the per-message limit kept the file and dropped what was actually said — and
|
|
117
|
+
* carried a file nobody asked this agent about into its next turn (PR #1458).
|
|
118
|
+
* Emitters older than #1223 send no caption; their plaintext is all there is.
|
|
119
|
+
*/
|
|
120
|
+
export declare function heldText(e: {
|
|
121
|
+
plaintext: string;
|
|
122
|
+
caption?: string;
|
|
123
|
+
}): string;
|
|
124
|
+
/** The room as the model sees it: its name when known, else a short id. */
|
|
125
|
+
export declare function roomLabel(roomId: string, roomName?: string): string;
|
|
95
126
|
/**
|
|
96
127
|
* Does this agent owe a reply to this room message? (#1107)
|
|
97
128
|
*
|
|
@@ -103,8 +134,9 @@ export declare function roomTurnPrefix(roomId: string, senderName: string, roomN
|
|
|
103
134
|
* in the half most likely to be read as "the protocol doesn't work".
|
|
104
135
|
*
|
|
105
136
|
* Now it defers to the ONE shared implementation exported by
|
|
106
|
-
* `@agentvault/agentvault`.
|
|
107
|
-
*
|
|
137
|
+
* `@agentvault/agentvault`. A message this returns false for is NOT pushed into
|
|
138
|
+
* the session (2026-10-26): it is held as room context and delivered with the
|
|
139
|
+
* next message in that room that this agent does owe — see room-context.ts.
|
|
108
140
|
*/
|
|
109
141
|
export declare function _makeOwesReply(agentName: string | undefined, channel: {
|
|
110
142
|
ownDisplayName?: string;
|
|
@@ -118,5 +150,7 @@ export declare function wireBridge(channel: RoomChannel, session: RoomSession, t
|
|
|
118
150
|
agentName?: string;
|
|
119
151
|
roomFilter?: string;
|
|
120
152
|
log?: (msg: string) => void;
|
|
153
|
+
/** Test-only: override the room-context bounds (see room-context.ts). */
|
|
154
|
+
roomContextLimits?: Partial<RoomContextLimits>;
|
|
121
155
|
}): void;
|
|
122
156
|
//# sourceMappingURL=bridge.d.ts.map
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/** The bridge-controlled agent identity prompt (no workspace file may supply it). */
|
|
2
|
+
/**
|
|
3
|
+
* How a room works, as this bridge now delivers it (PR #1458). The old line —
|
|
4
|
+
* "In a room you see every message" — stopped being true when unaddressed room
|
|
5
|
+
* messages stopped running turns: the agent is shown only what @-mentions it,
|
|
6
|
+
* with what it missed arriving as a quoted context block. Telling the model it
|
|
7
|
+
* sees everything would have it treat that block as live conversation.
|
|
8
|
+
*/
|
|
9
|
+
export declare function roomRules(sayTool: string): string;
|
|
10
|
+
export declare function identityPrompt(agentName: string, sayTool: string): string;
|
|
11
|
+
//# sourceMappingURL=identity-prompt.d.ts.map
|