@agentvault/claude-bridge 0.8.34 → 0.8.36
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 +29 -0
- package/dist/bridge.d.ts +8 -1
- package/dist/identity-prompt.d.ts +5 -0
- package/dist/index.js +539 -56
- package/dist/router.d.ts +3 -0
- package/dist/session.d.ts +39 -1
- package/dist/turn-failure.d.ts +128 -0
- package/dist/worker-queue.d.ts +18 -4
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -51,6 +51,35 @@ The bridge replies to all messages received in the room. The `room_say`
|
|
|
51
51
|
speak/observe tool (which lets Claude choose when to speak vs. just observe)
|
|
52
52
|
is planned for v0.2.
|
|
53
53
|
|
|
54
|
+
## When a reply fails
|
|
55
|
+
|
|
56
|
+
When a turn fails, the bridge records it first and then tells the chat. It does not drop a failed turn without a trace, and it never posts Claude Code's own error text into a chat.
|
|
57
|
+
|
|
58
|
+
- **In a 1:1**, the owner sees one plain sentence that names the cause when the bridge can tell what it is. For example: "Loopita couldn't answer this message: its Anthropic sign-in expired. Sign in again on the agent's computer." This bridge can tell when:
|
|
59
|
+
- the Claude sign-in expired or is not allowed (this includes "Your organization has disabled Claude subscription access"),
|
|
60
|
+
- the Anthropic account has a billing problem,
|
|
61
|
+
- Anthropic is rate-limiting the agent,
|
|
62
|
+
- the Claude plan's usage limit is reached,
|
|
63
|
+
- the chosen model is not available,
|
|
64
|
+
- Anthropic can't be reached, or
|
|
65
|
+
- Claude Code is missing on the agent's computer or will not start.
|
|
66
|
+
|
|
67
|
+
When the cause is unclear, the sentence simply says the agent couldn't answer this message.
|
|
68
|
+
- **In a room**, the sentence does not name the cause, because other people and agents can read it. The room just sees that the agent couldn't answer this message. A room message nobody addressed to this agent gets no notice at all.
|
|
69
|
+
- **In both cases**, the exact cause appears privately to the owner in the app under **Health, Recent problems**.
|
|
70
|
+
|
|
71
|
+
The bridge log (`agentvault-claude-bridge logs`) writes one line per event:
|
|
72
|
+
|
|
73
|
+
| Log line | What it means |
|
|
74
|
+
|----------|---------------|
|
|
75
|
+
| `turn_failed code=<code> exit=<n or none>` | Claude Code did not produce a reply. The code is the cause the bridge assigned. `exit` is the Claude Code exit status, or `none` when there is none to report. A turn that ran out of time also says `reason=timeout`. |
|
|
76
|
+
| `notice_failed code=<code>` | The turn failed, and the failure notice could not be delivered either. The failure is still recorded under Health. |
|
|
77
|
+
| `fatal: listener stopped code=<code> exit=<n or none>` | The always-on Claude session stopped. The bridge first tells any chat still waiting for an answer, then exits so its service restarts it. |
|
|
78
|
+
|
|
79
|
+
The local `logs/worker-incidents.jsonl` file records the same code for each failed tool turn. The log and that file hold only codes and exit numbers. They never hold message text or provider error text.
|
|
80
|
+
|
|
81
|
+
**Saved sessions.** This bridge does not save or resume a Claude Code session between runs, so there is no saved session to lose. Each tool turn runs in a fresh session, and the always-on session starts fresh when the bridge restarts.
|
|
82
|
+
|
|
54
83
|
## Security model
|
|
55
84
|
|
|
56
85
|
- Sessions run with `permissionMode: "default"` and `allowedTools: []` — no
|
package/dist/bridge.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { type ToolSpanSink } from "@agentvault/agentvault";
|
|
1
|
+
import { type ToolConversation, type ToolSpanSink } from "@agentvault/agentvault";
|
|
2
2
|
import { ArmingState } from "./arming.js";
|
|
3
3
|
import { type TerminalVerdict } from "./service/self-uninstall.js";
|
|
4
4
|
import { type RoomContextLimits } from "./room-context.js";
|
|
@@ -12,6 +12,10 @@ export interface RoomMessage {
|
|
|
12
12
|
/** SecureChannel's sender classification. Only an explicit false authorizes
|
|
13
13
|
* room tools; reply eligibility is independently decided by the @ protocol. */
|
|
14
14
|
senderIsAgent?: boolean;
|
|
15
|
+
/** #1574 — SecureChannel: the room's audience, "private_pair" or "group".
|
|
16
|
+
* Passed through to owesRoomReply untyped; anything but "private_pair"
|
|
17
|
+
* (absent on emitters before #1574) reads as a group room. */
|
|
18
|
+
roomAudience?: unknown;
|
|
15
19
|
/** #1459 — SecureChannel: a human in THIS agent's own account. Only this
|
|
16
20
|
* authorizes room tools; `senderIsAgent === false` says only "a human", and
|
|
17
21
|
* a room can hold another account's people. Absent (emitters < 0.23.55)
|
|
@@ -138,6 +142,9 @@ export interface RoomSession {
|
|
|
138
142
|
toolEligibleSender?: boolean;
|
|
139
143
|
armed?: () => boolean;
|
|
140
144
|
roomContext?: string;
|
|
145
|
+
/** #1560: the conversation this message came from. A failed turn's span
|
|
146
|
+
* names it, and only a "direct" one gets a notice that names the cause. */
|
|
147
|
+
conversation?: ToolConversation;
|
|
141
148
|
}): unknown;
|
|
142
149
|
}
|
|
143
150
|
/** Where a reply should go: a room (sendToRoom) or a 1:1 DM (send). */
|
|
@@ -5,6 +5,11 @@
|
|
|
5
5
|
* messages stopped running turns: the agent is shown only what @-mentions it,
|
|
6
6
|
* with what it missed arriving as a quoted context block. Telling the model it
|
|
7
7
|
* sees everything would have it treat that block as live conversation.
|
|
8
|
+
*
|
|
9
|
+
* #1574: a private room (one person + this agent) is the exception — every
|
|
10
|
+
* person's message there owes a reply with no name, and the turn itself carries
|
|
11
|
+
* the plugin's PRIVATE_ROOM_TURN_NOTE. Without this sentence the rules above
|
|
12
|
+
* would tell the model it was only shown a message because it was mentioned.
|
|
8
13
|
*/
|
|
9
14
|
export declare function roomRules(sayTool: string): string;
|
|
10
15
|
export declare function identityPrompt(agentName: string): string;
|