@agentvault/grok-bridge 0.4.39 → 0.4.43
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 +21 -1
- package/dist/bridge.d.ts +63 -1
- package/dist/channel-config.d.ts +32 -0
- package/dist/file-refs.d.ts +115 -0
- package/dist/file-turn.d.ts +90 -0
- package/dist/grok-driver.d.ts +23 -2
- package/dist/grok-room-http.d.ts +3 -0
- package/dist/grok-room-mcp.d.ts +14 -1
- package/dist/grok-room-plugin.d.ts +2 -0
- package/dist/grok-session.d.ts +61 -0
- package/dist/grok-spawn.d.ts +21 -0
- package/dist/identity-prompt.d.ts +7 -1
- package/dist/index.js +17134 -49188
- package/dist/lane.d.ts +109 -0
- package/dist/owner-grant.d.ts +131 -0
- package/dist/profile-router.d.ts +71 -0
- package/dist/room-context.d.ts +26 -1
- package/dist/sender-binding.d.ts +77 -0
- package/dist/service/doctor-cli.d.ts +6 -0
- package/dist/service/doctor-cli.d.ts.map +1 -1
- package/dist/service/doctor.d.ts +29 -0
- package/dist/service/doctor.d.ts.map +1 -1
- package/dist/session-taint.d.ts +48 -0
- package/dist/tool-profile.d.ts +303 -0
- package/package.json +5 -2
package/README.md
CHANGED
|
@@ -83,6 +83,20 @@ The log holds one line per event, with codes and exit numbers only. It never hol
|
|
|
83
83
|
|
|
84
84
|
The Grok CLI's own error output can repeat the provider's error text, so the log records only its size and level (`grok: stderr lines=<n> bytes=<n> level=ERROR`). A failed start is logged the same way, by cause only: `fatal: grok did not start: code=<code> exit=<n or none> ...`. To see the CLI's own words, run `grok` by hand.
|
|
85
85
|
|
|
86
|
+
## Sending files (#1762)
|
|
87
|
+
|
|
88
|
+
The agent can send one file at a time with the `send_file` tool (the model sees `room__send_file`), beside `say`. The file goes to the conversation the agent is answering; the model cannot pick a different one.
|
|
89
|
+
|
|
90
|
+
- **Where files are staged.** Each chat has its own staging folder inside the workspace (default `~/.agentvault/grok-room-bridge/workspaces/<agent>`):
|
|
91
|
+
- for the 1:1 chat: `agentvault-outbox/<agent>-<8 hex>/dm/`;
|
|
92
|
+
- for each room: `agentvault-outbox/<agent>-<8 hex>/rooms/<room id>/`.
|
|
93
|
+
|
|
94
|
+
Every turn starts with one line naming that turn's folder, relative to the workspace, for example `[AgentVault: Files for this chat: stage them in your outbox at agentvault-outbox/ohtani-1a2b3c4d/dm/.]`. The fenced grok agent cannot write files itself, so it sends what is already there (for example a file you put in the folder, or one you sent it).
|
|
95
|
+
- **Rooms: not yet.** A room file needs your own ask in that room, on a turn that carries no other member's words, from a grok session that has never seen anyone else's words. grok keeps a memory across sessions that the bridge cannot verify is off, so **no grok session counts as clean today and grok does not send files into rooms**. It says "Files cannot be shared in this room on this turn." The 1:1 works.
|
|
96
|
+
- **Never a false "sent".** `send_file` answers `File sent: …` only when the file actually left. Anything else is `File NOT sent: <reason>`, and the chat gets a one-line notice. If a reply says "I've attached …" when nothing was sent, the chat gets `(This reply has no attachment.)`.
|
|
97
|
+
- **Retention.** The bridge never deletes anything in `dm/` or `rooms/<id>/`: those files stay until you remove them. When the agent leaves a room, that room's folder moves to `agentvault-outbox/<agent>-<8 hex>/left/`, where nothing can be sent again. `left/` and the `.stale-*` entries keep only their newest three.
|
|
98
|
+
- **The session record.** `<data dir>/session-taint.json` records whether the grok session has seen anyone else's words. Deleting it changes nothing: until a grok version is verified to start sessions clean, every grok session is treated as having seen them.
|
|
99
|
+
|
|
86
100
|
## Copied-from ledger — REVIEW PERIODICALLY
|
|
87
101
|
|
|
88
102
|
These files were copied once from the Claude bridge and are now owned here. A fix
|
|
@@ -94,7 +108,10 @@ there does NOT reach us.
|
|
|
94
108
|
| `src/log.ts` | `9b28a272e87600e78627dbd0f53fcbd192e01e73` | `9b28a272e87600e78627dbd0f53fcbd192e01e73` |
|
|
95
109
|
| `src/bridge.ts` | `f3a7d53f67246e59c471891aee667e002a23b701` | `f3a7d53f67246e59c471891aee667e002a23b701` |
|
|
96
110
|
| `src/service/` | `16c95f46c654a34613aeb2a4ff94eeede9e671ef` | `16c95f46c654a34613aeb2a4ff94eeede9e671ef` |
|
|
97
|
-
| `src/room-context.ts` | PR #1458 (created there, 2026-10-26)
|
|
111
|
+
| `src/room-context.ts` | PR #1458 (created there, 2026-10-26); #1762 PR-C park/take/onDrop at `e4de3c0d` | `e4de3c0d` |
|
|
112
|
+
| `src/file-turn.ts` | `e4de3c0d` (PR-C) — kept byte-identical (a test pins it) | `e4de3c0d` |
|
|
113
|
+
| `src/channel-config.ts` | `e4de3c0d` (PR-C); taint helper differs | `e4de3c0d` |
|
|
114
|
+
| `src/session-taint.ts` | `src/listener-taint.ts` at `e4de3c0d` (PR-C); grok version gate | `e4de3c0d` |
|
|
98
115
|
|
|
99
116
|
To review one:
|
|
100
117
|
|
|
@@ -119,6 +136,9 @@ the DM→room leak. It has no production callers on the Claude side either.
|
|
|
119
136
|
| **CI runs this suite** | ✅ **CLOSED 2026-08-15.** `.github/workflows/grok-bridge-test.yml` runs `vitest` on every PR touching this package. First real run: 172 passed / 3 skipped. The 3 skips are the live + Landlock + macOS gates, all of which need a real grok and are opt-in by env var |
|
|
120
137
|
| **Fenced fail-closed** | ✅ **CLOSED 2026-08-15.** Verified against the real `grok` 1.0.3, fenced, with a seeded `auth.json`: the agent raised `session/request_permission` twice, `Bash` was refused (`stopReason: "cancelled"`, `FENCED_BASH_REACHED` never ran) and `room__say` was allowed. The gate is a real control, not an untested branch. ⚠️ That same run found the gate was **too** closed — see below |
|
|
121
138
|
|
|
139
|
+
| **Room and non-owner turns get no read, exec or network tools** (#1814) | ✅ **CLOSED 2026-11-21.** The "fenced fail-closed" row above no longer holds on grok 1.0.46: read-only tools (`read_file`, `cat`, `ls`, `grep`) run without a permission request. The bridge now runs two grok children (`src/lane.ts`): the owner's attested 1:1 in the owner child, every other turn in a restricted child started with an `--agent-profile` tool allowlist and `Read`/`Bash`/`Edit`/`Write`/`Grep`/`WebFetch`/`WebSearch` deny rules (`src/tool-profile.ts`, which also lists the controls that do NOT work). `npm run gate:tool-profile` (`src/__tests__/tool-profile-1814.gate.test.ts`) drives the real binary with a scripted model; re-run it after any grok update. Fail closed (PR #1824 review): on a grok version not in `VERIFIED_GROK_TOOL_PROFILE_VERSIONS` and `VERIFIED_GROK_FILE_REF_VERSIONS`, or a grok config (the fence's or machine-wide `/etc/grok`, judged on the parsed TOML/JSON) that auto-approves MCP tools or adds an MCP server or plugin, or a trusted restricted working directory (the restricted child gets its own emptied one), room, A2A and non-owner turns are refused (re-checked on a timer and when `managed_config.toml` changes) and the owner gets one notice; the owner 1:1 keeps working. `doctor` reports both versions as FAIL when unverified. |
|
|
140
|
+
| **macOS `ai.x.grok` preferences, every source** (#1827, grok-bridge 0.4.43) | ✅ **CLOSED 2026-11-22.** Restricted turns are also refused, and `doctor` FAILs, when `ai.x.grok` is in `/Library/Preferences`, in a ByHost plist (`~/Library/Preferences/ByHost/ai.x.grok.*.plist`), or only in cfprefsd for the current user (`defaults read ai.x.grok` / `defaults -currentHost read ai.x.grok`, 2 s timeout each, one retry on a timeout only). This adds to the managed and per-user plists that were already checked. The probes do not see the any-user layer. An unflushed `/Library/Preferences` value is caught by the file check at the first re-check after it reaches disk. Only "domain not found" passes. A second timeout, a spawn failure or any other error refuses too, and `doctor` says the check could not run. `~` is the real user's home (`userInfo()`), never `$HOME`, because CFPreferences ignores `$HOME`. grok 1.0.46 itself only honours a FORCED (MDM) value: it calls `CFPreferencesAppValueIsForced` before `CFPreferencesCopyAppValue`. The wider check is deliberate. No test runs the real `defaults` (`src/__tests__/helpers/no-real-defaults.ts`). The log tightening's symlink skip is now tested too. It also no longer follows a symlinked `logs/` directory: it uses `O_NOFOLLOW` opens and `fchmod`, and checks that `logs/` is unchanged after the file is open. |
|
|
141
|
+
|
|
122
142
|
## The fenced-mute bug (2026-08-15)
|
|
123
143
|
|
|
124
144
|
A blanket `cancelled` on every agent-initiated request made a **fenced agent permanently mute**.
|
package/dist/bridge.d.ts
CHANGED
|
@@ -15,6 +15,7 @@
|
|
|
15
15
|
import { type ToolSpanSink } from "@agentvault/agentvault";
|
|
16
16
|
import type { ReplySink, RoomSession } from "./grok-session.js";
|
|
17
17
|
import { type RoomContextLimits } from "./room-context.js";
|
|
18
|
+
import type { MessageMetadata } from "@agentvault/agentvault";
|
|
18
19
|
import { type TerminalVerdict } from "./service/self-uninstall.js";
|
|
19
20
|
export interface RoomMessage {
|
|
20
21
|
roomId: string;
|
|
@@ -28,7 +29,9 @@ export interface RoomMessage {
|
|
|
28
29
|
* room always expects a reply; agent-authored traffic does not (the agent may
|
|
29
30
|
* stay silent, and it prevents agent↔agent reply loops). Absent on older
|
|
30
31
|
* payloads / tests → treated as "not an agent" is NOT assumed: replyExpected is
|
|
31
|
-
* set only when we affirmatively know the sender is a human (=== false).
|
|
32
|
+
* set only when we affirmatively know the sender is a human (=== false).
|
|
33
|
+
* #1800 PR D: `true` for a sender that is not BOUND (`roomSenderView`), so
|
|
34
|
+
* the room protocol never treats an unverified sender as a known human. */
|
|
32
35
|
senderIsAgent?: boolean;
|
|
33
36
|
/** #1574 — SecureChannel: the room's audience, "private_pair" or "group".
|
|
34
37
|
* Passed through to owesRoomReply untyped; anything but "private_pair"
|
|
@@ -37,6 +40,14 @@ export interface RoomMessage {
|
|
|
37
40
|
/** ISO send time from the emit (`data.created_at`). Used to stamp a message
|
|
38
41
|
* held as room context; receipt time stands in when absent. */
|
|
39
42
|
timestamp?: string;
|
|
43
|
+
/** #1459 (#1762 PR-G reads it): the sender is a human in this agent's own account. */
|
|
44
|
+
senderIsOwner?: boolean;
|
|
45
|
+
/** #1459 (#1762 PR-G reads it): the message carries a file another member shared. */
|
|
46
|
+
foreignContent?: boolean;
|
|
47
|
+
/** #1762 PR-G: the sender's device id (a neutral label for another account's member). #1800 PR D: bound only. */
|
|
48
|
+
senderDeviceId?: string;
|
|
49
|
+
/** #1800 PR D: the sender is not BOUND to its MLS sender (a missing verdict included). */
|
|
50
|
+
unverifiedSender?: boolean;
|
|
40
51
|
}
|
|
41
52
|
/** Metadata SecureChannel attaches to a 1:1 `message` event. `roomId` is set only
|
|
42
53
|
* when the `message` actually originated in a room (handled by room_message), so
|
|
@@ -52,6 +63,10 @@ export interface MessageMeta {
|
|
|
52
63
|
/** #621 — set by SecureChannel when the message decrypted under the owner's
|
|
53
64
|
* 1:1 material. Gates the plain-text reply fallback; see the `message` handler. */
|
|
54
65
|
ownerDm1to1?: boolean;
|
|
66
|
+
/** #1820 part 2 — the sending device, from the server's delivery row. */
|
|
67
|
+
senderDeviceId?: string;
|
|
68
|
+
/** #1820 part 2 — SecureChannel's owner-list generation when `ownerDm1to1` was decided. */
|
|
69
|
+
ownerDevicesGen?: number;
|
|
55
70
|
}
|
|
56
71
|
/** #392 room hush (advisory) — emitted by SecureChannel from the backend's
|
|
57
72
|
* `room_hushed` event. ``hushedUntil`` is an ISO string, or null when cleared. */
|
|
@@ -86,6 +101,9 @@ export interface RoomChannel {
|
|
|
86
101
|
on(ev: "state", cb: (s: string) => void): unknown;
|
|
87
102
|
sendToRoom(roomId: string, text: string): Promise<void>;
|
|
88
103
|
send(text: string): Promise<void>;
|
|
104
|
+
/** #1762 PR-P1c-1: the agent's Full permissions state as ONE boolean — the
|
|
105
|
+
* only way a family reads it. Optional: absent reads as off. */
|
|
106
|
+
effective?(): boolean;
|
|
89
107
|
}
|
|
90
108
|
/**
|
|
91
109
|
* #392 cooperative quiet: tracks per-room hush windows so the native agent holds
|
|
@@ -219,6 +237,23 @@ export declare function heldText(e: {
|
|
|
219
237
|
}): string;
|
|
220
238
|
/** The room as the model sees it: its name when known, else a short id. */
|
|
221
239
|
export declare function roomLabel(roomId: string, roomName?: string): string;
|
|
240
|
+
/**
|
|
241
|
+
* #1762 PR-G — how an ATTESTED turn names its sender. An attested turn may
|
|
242
|
+
* send a file into the room, so nothing another account wrote may frame it.
|
|
243
|
+
* Its sender is this agent's own owner (SecureChannel attests only an
|
|
244
|
+
* eligible sender), whose own display name is kept. Anyone else — reachable
|
|
245
|
+
* only if that invariant ever broke — gets a neutral label plus a short id,
|
|
246
|
+
* never the name they chose.
|
|
247
|
+
*
|
|
248
|
+
* #1800 PR D (sink 7): a sender that is not BOUND is "Unverified sender",
|
|
249
|
+
* checked first — never its name, and never a device id from the wire.
|
|
250
|
+
*/
|
|
251
|
+
export declare function attestedSenderLabel(e: {
|
|
252
|
+
senderName: string;
|
|
253
|
+
senderIsOwner?: boolean;
|
|
254
|
+
senderDeviceId?: string;
|
|
255
|
+
unverifiedSender?: boolean;
|
|
256
|
+
}): string;
|
|
222
257
|
/**
|
|
223
258
|
* Does this agent owe a reply to this room message? (#1107)
|
|
224
259
|
*
|
|
@@ -237,6 +272,15 @@ export declare function roomLabel(roomId: string, roomName?: string): string;
|
|
|
237
272
|
export declare function _makeOwesReply(agentName: string | undefined, channel: {
|
|
238
273
|
ownDisplayName?: string;
|
|
239
274
|
}, log: (msg: string) => void): (e: RoomMessage) => boolean;
|
|
275
|
+
/**
|
|
276
|
+
* #1800 PR D — the room message this bridge acts on, built from
|
|
277
|
+
* SecureChannel's `onMessage` metadata with every sender field taken through
|
|
278
|
+
* the binding (`roomSenderView`): a sender that is not BOUND (a missing
|
|
279
|
+
* verdict included) is "Unverified sender", never the owner, carries no
|
|
280
|
+
* device id, and is not a known human to the room protocol. Exported so the
|
|
281
|
+
* wiring itself is under test (#1848 review L1).
|
|
282
|
+
*/
|
|
283
|
+
export declare function roomMessageFrom(metadata: MessageMetadata): RoomMessage;
|
|
240
284
|
export declare function wireBridge(channel: RoomChannel, session: RoomSession, target: ActiveTarget, opts?: {
|
|
241
285
|
/**
|
|
242
286
|
* #1107: this agent's own name, used to recognise its own @mention. Threaded
|
|
@@ -248,5 +292,23 @@ export declare function wireBridge(channel: RoomChannel, session: RoomSession, t
|
|
|
248
292
|
log?: (msg: string) => void;
|
|
249
293
|
/** Test-only: override the room-context bounds (see room-context.ts). */
|
|
250
294
|
roomContextLimits?: Partial<RoomContextLimits>;
|
|
295
|
+
/**
|
|
296
|
+
* #1762 PR-G — where the ONE turn consumer is attached: production passes
|
|
297
|
+
* the `TurnInbox` whose `onMessage` SecureChannel calls. Turns run ONLY
|
|
298
|
+
* from it; the `room_message` / `message` events are observation only.
|
|
299
|
+
*/
|
|
300
|
+
inbox?: {
|
|
301
|
+
attach(consumer: (text: string, metadata: MessageMetadata) => void): void;
|
|
302
|
+
};
|
|
303
|
+
/**
|
|
304
|
+
* #1762 PR-G — the grok session's taint (session-taint.ts). The session is
|
|
305
|
+
* ONE transcript for every room and the 1:1, so foreign content in any of
|
|
306
|
+
* them taints file authority for all. Absent: no room turn is attested
|
|
307
|
+
* (fail closed).
|
|
308
|
+
*/
|
|
309
|
+
sessionTaint?: {
|
|
310
|
+
isTainted(): boolean;
|
|
311
|
+
taint(reason: string): void;
|
|
312
|
+
};
|
|
251
313
|
}): void;
|
|
252
314
|
//# sourceMappingURL=bridge.d.ts.map
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* #1762 PR-G — the SecureChannel configuration this bridge runs with, in one
|
|
3
|
+
* place, so a test can build the REAL channel exactly as production does and
|
|
4
|
+
* prove the production wiring hands each turn a lease (design §11 R3-4 a′).
|
|
5
|
+
*
|
|
6
|
+
* COPIED from packages/claude-room-bridge/src/channel-config.ts at e4de3c0d
|
|
7
|
+
* (PR-C). Only the taint helper differs: grok's session taint, not Claude's
|
|
8
|
+
* listener taint.
|
|
9
|
+
*
|
|
10
|
+
* Two lines here are load-bearing for file sends:
|
|
11
|
+
* - `fileSend` opts in. Without it SecureChannel creates no staging folder and
|
|
12
|
+
* ends every token at mint (`turn_no_consumer`);
|
|
13
|
+
* - `onMessage` is the TurnInbox, the single turn consumer. Without it every
|
|
14
|
+
* token is dropped at mint and `send_file` answers `turn_no_consumer`.
|
|
15
|
+
*/
|
|
16
|
+
import type { SecureChannelConfig } from "@agentvault/agentvault";
|
|
17
|
+
import type { TurnInbox } from "./file-turn.js";
|
|
18
|
+
import { SessionTaint } from "./session-taint.js";
|
|
19
|
+
/** #1762 PR-G: the grok session's durable taint record, in the data dir. */
|
|
20
|
+
export declare function bridgeSessionTaint(dataDir: string, log?: (m: string) => void): SessionTaint;
|
|
21
|
+
export interface BridgeChannelInputs {
|
|
22
|
+
inviteToken: string;
|
|
23
|
+
dataDir: string;
|
|
24
|
+
apiUrl: string;
|
|
25
|
+
agentName: string;
|
|
26
|
+
/** The agent's workspace: a 1:1 root that holds the outbox. */
|
|
27
|
+
workspaceDir: string;
|
|
28
|
+
/** `@agentvault/grok-bridge@<version>` (#836). */
|
|
29
|
+
clientVersion: string;
|
|
30
|
+
}
|
|
31
|
+
export declare function bridgeChannelConfig(cfg: BridgeChannelInputs, inbox: TurnInbox): SecureChannelConfig;
|
|
32
|
+
//# sourceMappingURL=channel-config.d.ts.map
|
|
@@ -0,0 +1,115 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* #1807: room text and non-owner text cannot make the grok CLI inline host
|
|
3
|
+
* files through `@`-paths.
|
|
4
|
+
*
|
|
5
|
+
* Before the model runs, the grok CLI reads every `@<path>` in the prompt
|
|
6
|
+
* text and inlines the file into the model request (an `<attached_files>`
|
|
7
|
+
* block). It is not a tool call, so no permission request is raised for it,
|
|
8
|
+
* and `GROK_SANDBOX=workspace` does not stop it. The binary has no switch that
|
|
9
|
+
* turns it off.
|
|
10
|
+
*
|
|
11
|
+
* ⚠️ This closes the `@`-path route ONLY. The bridge's permission handler
|
|
12
|
+
* (grok-driver.ts `onAgentRequest`) does NOT gate every other tool: on 1.0.46
|
|
13
|
+
* grok runs `read_file` and read-only shell commands (`cat`, `ls`) without
|
|
14
|
+
* asking (PR #1812 review). Room, A2A and non-owner 1:1 turns are kept from
|
|
15
|
+
* those tools by the restricted grok child they run in (#1814,
|
|
16
|
+
* tool-profile.ts), not by that handler.
|
|
17
|
+
*
|
|
18
|
+
* MEASURED on grok 1.0.46 (`grok agent --no-leader stdio`, throwaway HOME,
|
|
19
|
+
* fake endpoint recording requests; the gate is
|
|
20
|
+
* `src/__tests__/file-refs-1807.gate.test.ts`). Grok expands:
|
|
21
|
+
* - absolute paths, outside the workspace too; relative paths, `./` and
|
|
22
|
+
* `../`; hidden files (`@.env`); symlinks (followed); non-ASCII names;
|
|
23
|
+
* - a `:start-end` line range;
|
|
24
|
+
* - an `@` followed by ANY run of whitespace before the path: spaces, tabs,
|
|
25
|
+
* newlines, NBSP, U+3000, U+2028, U+0085 and the other Unicode spaces.
|
|
26
|
+
* "@ followed by a non-space" is therefore NOT a safe rule;
|
|
27
|
+
* - an `@` after `=`, `,`, `/`, `-`, `'`, `:`, `>` or an em dash, and a
|
|
28
|
+
* doubled `@@`;
|
|
29
|
+
* - an ACP `resource_link` content block (the bridge sends text only).
|
|
30
|
+
* It does not expand `~`, `@!`, quoted paths, directories, URLs, `file://`,
|
|
31
|
+
* globs, `$VARS`, `@`, or a fullwidth / small `@`. It does not expand an
|
|
32
|
+
* `@` followed by U+2060, U+200B, U+200C, U+00AD or U+FEFF.
|
|
33
|
+
*
|
|
34
|
+
* So the rule is the widest one: a WORD JOINER (U+2060, invisible) goes after
|
|
35
|
+
* EVERY `@` — and after the fullwidth (U+FF20) and small (U+FE6B) at-signs, in case a later
|
|
36
|
+
* grok normalizes them (NFKC). The model still reads the text as written. An
|
|
37
|
+
* `@` already followed by a word joiner is left alone, so the function is
|
|
38
|
+
* idempotent (measured: `@` + U+2060 + whitespace + path does not expand).
|
|
39
|
+
*
|
|
40
|
+
* Mirrors packages/plugin-hermes/src/agentvault_hermes/channel/context_refs.py
|
|
41
|
+
* (#1801), which needs a narrower pattern because Hermes core's references
|
|
42
|
+
* are named (`@file:`); grok's are bare paths.
|
|
43
|
+
*/
|
|
44
|
+
/** Invisible, not whitespace, and grok treats it as part of the path, which then does not exist. */
|
|
45
|
+
export declare const WORD_JOINER = "\u2060";
|
|
46
|
+
/** `text` with no `@` the grok CLI could read as a file reference. */
|
|
47
|
+
export declare function neutralizeGrokFileRefs(text: string): string;
|
|
48
|
+
/**
|
|
49
|
+
* The owner's attested 1:1 text with references kept ONLY in what the owner
|
|
50
|
+
* typed (PR #1812 review). SecureChannel folds an attachment's contents in
|
|
51
|
+
* FRONT of the typed text and passes the typed text as `caption`; a forwarded
|
|
52
|
+
* document is not text the owner wrote, so everything before the caption is
|
|
53
|
+
* neutralized. No caption, or a text that does not end with it: all of it is
|
|
54
|
+
* neutralized (fail closed).
|
|
55
|
+
*/
|
|
56
|
+
export declare function keepTypedFileRefsOnly(text: string, caption: unknown): string;
|
|
57
|
+
/**
|
|
58
|
+
* The reverse, for text LEAVING the device (`say`, the prose fallback,
|
|
59
|
+
* `send_file`'s path and caption; PR #1812 review). The model may copy a
|
|
60
|
+
* joiner from a neutralized room message into what it says; left in, an
|
|
61
|
+
* invisible character would break a mention it passes along (the plugin's
|
|
62
|
+
* `/@([\w-]+)/` does not match `@` + U+2060), a package scope, `HEAD@{1}` or
|
|
63
|
+
* a mail address. Outbound text never goes back into grok as a prompt.
|
|
64
|
+
*/
|
|
65
|
+
export declare function restoreGrokAtSigns(text: string): string;
|
|
66
|
+
/**
|
|
67
|
+
* Grok runs a slash command (`/always-approve on` turns every later
|
|
68
|
+
* permission prompt off) when the WHOLE prompt starts with one, after leading
|
|
69
|
+
* whitespace — measured on 1.0.46; a slash later in the prompt does not run,
|
|
70
|
+
* and a leading word joiner stops it. GrokSession prefixes a word joiner to
|
|
71
|
+
* any prompt that would start with `/`, so no text — whatever the identity in
|
|
72
|
+
* front of it — can be read as a command.
|
|
73
|
+
*/
|
|
74
|
+
export declare function guardSlashCommand(prompt: string): string;
|
|
75
|
+
/**
|
|
76
|
+
* May the grok CLI expand `@` file references in this turn's text? THE ONE
|
|
77
|
+
* DECISION — every push site asks this, nothing else decides it.
|
|
78
|
+
*
|
|
79
|
+
* Only text the owner wrote in their own 1:1, attested the way the bridge
|
|
80
|
+
* already decides owner-ness: `ownerDm1to1 === true` from SecureChannel,
|
|
81
|
+
* which is set only when the message decrypted under the owner's 1:1 material
|
|
82
|
+
* (#621). Absent or false reads as not the owner (fail closed). Every room
|
|
83
|
+
* turn — the owner's own room message included — and every unattested 1:1 is
|
|
84
|
+
* neutralized, together with everything that rides in its text: held room
|
|
85
|
+
* context, sender and room names, folded attachments and captions.
|
|
86
|
+
*
|
|
87
|
+
* PR-PG (design §13, docs/plans/2026-11-17-1762-agent-file-send-design.md)
|
|
88
|
+
* relaxes this here, and only here, from the per-agent Full permissions
|
|
89
|
+
* `effective` boolean once that is built. Until then every agent counts as
|
|
90
|
+
* OFF, and the answer depends on the owner 1:1 alone.
|
|
91
|
+
*/
|
|
92
|
+
export declare function grokMayExpandFileRefs(turn: {
|
|
93
|
+
ownerOneToOne: boolean;
|
|
94
|
+
}): boolean;
|
|
95
|
+
/**
|
|
96
|
+
* grok CLI versions on which `neutralizeGrokFileRefs` was verified against the
|
|
97
|
+
* real binary (the gate in `src/__tests__/file-refs-1807.gate.test.ts`).
|
|
98
|
+
* Grok updates itself, and a new version may expand a form the neutralizer
|
|
99
|
+
* lets through. Add a version ONLY after that gate passes on it; the gate
|
|
100
|
+
* fails until you do.
|
|
101
|
+
*
|
|
102
|
+
* 1.0.46 (2765805b9442), macOS arm64 — 2026-11-18, #1807.
|
|
103
|
+
*/
|
|
104
|
+
export declare const VERIFIED_GROK_FILE_REF_VERSIONS: ReadonlySet<string>;
|
|
105
|
+
/**
|
|
106
|
+
* The startup line about the running grok version. `warn` is true when the
|
|
107
|
+
* version is not one the neutralizer was verified on, or grok reported none —
|
|
108
|
+
* and then restricted turns are refused (tool-profile.ts
|
|
109
|
+
* `restrictedTurnReadiness`). The owner's 1:1 still runs, neutralizer and all.
|
|
110
|
+
*/
|
|
111
|
+
export declare function grokFileRefVersionLine(version: string | null | undefined, verified?: ReadonlySet<string>): {
|
|
112
|
+
warn: boolean;
|
|
113
|
+
line: string;
|
|
114
|
+
};
|
|
115
|
+
//# sourceMappingURL=file-refs.d.ts.map
|
|
@@ -0,0 +1,90 @@
|
|
|
1
|
+
import type { FileSendResult, FileSendTarget, MessageMetadata, TurnToken } from "@agentvault/agentvault";
|
|
2
|
+
/** The capability SecureChannel hands only to `onMessage`. */
|
|
3
|
+
export type TurnLease = NonNullable<MessageMetadata["turnLease"]>;
|
|
4
|
+
/** The SecureChannel surface a file turn uses. */
|
|
5
|
+
export interface FileTurnChannel {
|
|
6
|
+
sendFile(target: FileSendTarget, path: string, caption: string, turn: TurnToken | null): Promise<FileSendResult>;
|
|
7
|
+
stagingPathFor(target: FileSendTarget): string | null;
|
|
8
|
+
attestCleanTurn(lease: TurnLease): boolean;
|
|
9
|
+
parkTurn(lease: TurnLease): boolean;
|
|
10
|
+
foldTurn(folded: TurnLease, into: TurnLease): boolean;
|
|
11
|
+
endTurn(lease: TurnLease, opts?: {
|
|
12
|
+
replies?: readonly string[];
|
|
13
|
+
}): Promise<void>;
|
|
14
|
+
}
|
|
15
|
+
/** Does `ch` implement the file-turn surface (a SecureChannel with file send)? */
|
|
16
|
+
export declare function isFileTurnChannel(ch: unknown): ch is FileTurnChannel;
|
|
17
|
+
/** What a `send_file` call returns to the model. */
|
|
18
|
+
export interface SendFileOutcome {
|
|
19
|
+
ok: boolean;
|
|
20
|
+
/** "File sent: …" or "File NOT sent: …" (never a host path, R3-9). */
|
|
21
|
+
text: string;
|
|
22
|
+
}
|
|
23
|
+
export declare class FileTurn {
|
|
24
|
+
private readonly channel;
|
|
25
|
+
readonly lease: TurnLease;
|
|
26
|
+
readonly target: FileSendTarget;
|
|
27
|
+
private state;
|
|
28
|
+
private attested;
|
|
29
|
+
/** A held message's content entered this turn without a fold the registry accepted. */
|
|
30
|
+
private foreignInput;
|
|
31
|
+
private readonly replies;
|
|
32
|
+
private ending?;
|
|
33
|
+
private constructor();
|
|
34
|
+
/**
|
|
35
|
+
* Take the lease from `onMessage` metadata. Call it FIRST, synchronously,
|
|
36
|
+
* before anything that can throw or await. `null` when there is no lease
|
|
37
|
+
* (file send not opted into) or the channel has no file surface.
|
|
38
|
+
*/
|
|
39
|
+
static take(channel: unknown, metadata: MessageMetadata | undefined, target: FileSendTarget): FileTurn | null;
|
|
40
|
+
/** The router's lane decision attested this room turn (and nothing has since cost it that). */
|
|
41
|
+
get isAttested(): boolean;
|
|
42
|
+
/** Not yet ended, dropped or folded. */
|
|
43
|
+
get open(): boolean;
|
|
44
|
+
/**
|
|
45
|
+
* The lane decision attests a clean room turn (§1.4, R3-5): call it ONLY
|
|
46
|
+
* when the lane that will run this turn receives no held context, and
|
|
47
|
+
* before the turn can run a tool. 1:1 turns need no attestation.
|
|
48
|
+
*/
|
|
49
|
+
attest(): boolean;
|
|
50
|
+
/** The content is HELD (room context), in no turn's input yet. Later: absorb() or drop(). */
|
|
51
|
+
park(): void;
|
|
52
|
+
/**
|
|
53
|
+
* `held`'s content is delivered into THIS turn (§11 R3-4: content enters a
|
|
54
|
+
* turn only through `foldTurn`). `held` then ends with this turn, and a
|
|
55
|
+
* foreign one downgrades it. A fold the registry refuses still marks this
|
|
56
|
+
* turn as carrying foreign input, so it can never send a room file.
|
|
57
|
+
*/
|
|
58
|
+
absorb(held: FileTurn | null | undefined): void;
|
|
59
|
+
/** Something the agent said in this turn (say, or the #416 fallback): read by the §4.4 prose check. */
|
|
60
|
+
noteReply(text: string): void;
|
|
61
|
+
/** The turn is over. Once; never throws. Ends whatever was folded into it. */
|
|
62
|
+
end(): Promise<void>;
|
|
63
|
+
/** A TRUE drop: this message's content never enters any turn. */
|
|
64
|
+
drop(): Promise<void>;
|
|
65
|
+
private endNow;
|
|
66
|
+
/** The `[AgentVault: …]` line that tells the model where this conversation's files go (§2, R3-9). */
|
|
67
|
+
stagingNote(): string;
|
|
68
|
+
/** `send_file`: the turn's own conversation, the turn's own token. Never throws. */
|
|
69
|
+
send(path: unknown, caption: unknown): Promise<SendFileOutcome>;
|
|
70
|
+
}
|
|
71
|
+
/**
|
|
72
|
+
* What `SecureChannelConfig.onMessage` points at. SecureChannel is built
|
|
73
|
+
* before `wireBridge` runs, so the consumer is attached late; until it is, a
|
|
74
|
+
* message is a true drop and its lease is ended (never leaked).
|
|
75
|
+
*/
|
|
76
|
+
export declare class TurnInbox {
|
|
77
|
+
private consumer?;
|
|
78
|
+
private channel?;
|
|
79
|
+
/** Pass as `onMessage`. Reads the lease synchronously; never queues. */
|
|
80
|
+
readonly onMessage: (text: string, metadata: MessageMetadata) => void;
|
|
81
|
+
/** The channel, so an unconsumed message's lease can be ended. */
|
|
82
|
+
bindChannel(channel: {
|
|
83
|
+
endTurn(lease: TurnLease, opts?: {
|
|
84
|
+
replies?: readonly string[];
|
|
85
|
+
}): Promise<void>;
|
|
86
|
+
}): void;
|
|
87
|
+
/** wireBridge's one consumer. A second attach replaces the first (there is one claimant). */
|
|
88
|
+
attach(consumer: (text: string, metadata: MessageMetadata) => void): void;
|
|
89
|
+
}
|
|
90
|
+
//# sourceMappingURL=file-turn.d.ts.map
|
package/dist/grok-driver.d.ts
CHANGED
|
@@ -19,12 +19,16 @@ export declare class GrokDriver implements AgentDriver {
|
|
|
19
19
|
private readonly opts;
|
|
20
20
|
private readonly acp;
|
|
21
21
|
private session;
|
|
22
|
+
/** #1762 PR-G: the grok version from ACP `initialize` (`agentInfo.version`, else `_meta.agentVersion`), when it reports one. */
|
|
23
|
+
private version;
|
|
22
24
|
private invalidated;
|
|
23
25
|
/** State for the turn currently in flight. Null between turns, so a late
|
|
24
26
|
* update frame after a turn ends cannot bleed into the next one. */
|
|
25
27
|
private current;
|
|
26
28
|
constructor(child: AcpChildLike, opts: GrokDriverOpts);
|
|
27
29
|
sessionId(): string | null;
|
|
30
|
+
/** #1762 PR-G: the grok version serving this session (session-taint.ts reads it). Null when unreported. */
|
|
31
|
+
agentVersion(): string | null;
|
|
28
32
|
start(): Promise<void>;
|
|
29
33
|
deliver(text: string): Promise<TurnResult>;
|
|
30
34
|
abort(): void;
|
|
@@ -57,8 +61,25 @@ export declare class GrokDriver implements AgentDriver {
|
|
|
57
61
|
* Allowing exactly one tool is not a weakening of the gate. `room__say` is
|
|
58
62
|
* the agent's only channel to the conversation, it is the capability this
|
|
59
63
|
* bridge exists to provide, and it is delivered solely through our own
|
|
60
|
-
* `--plugin-dir` MCP server.
|
|
61
|
-
*
|
|
64
|
+
* `--plugin-dir` MCP server. Every tool that RAISES a permission request,
|
|
65
|
+
* other than those two, is refused here.
|
|
66
|
+
*
|
|
67
|
+
* ⚠️ NOT EVERY TOOL RAISES ONE, SO THIS IS NOT A READ GATE. The 1.0.3
|
|
68
|
+
* measurement above ("everything asks") no longer holds: on grok 1.0.46,
|
|
69
|
+
* `read_file` (outside the workspace too), `list_dir`, `grep` and read-only
|
|
70
|
+
* shell commands (`cat`, `ls`) run WITHOUT a `session/request_permission`,
|
|
71
|
+
* so this handler never sees them (PR #1812 review). Network commands,
|
|
72
|
+
* `ln -s`, `write`, `scheduler_create` and `spawn_subagent` still ask, and
|
|
73
|
+
* are refused here. What keeps reads away from room, A2A and non-owner 1:1
|
|
74
|
+
* turns is the restricted grok child they run in (#1814, tool-profile.ts:
|
|
75
|
+
* those tools are removed and denied there). The owner's attested 1:1 runs
|
|
76
|
+
* in the owner child, where grok's read-only tools still run unasked.
|
|
77
|
+
*
|
|
78
|
+
* A `use_tool` call whose arguments grok LOADED FROM A FILE
|
|
79
|
+
* (`tool_input_file` / `file`) is refused too, on either child. Its
|
|
80
|
+
* permission request carries the file's contents as ordinary arguments; only
|
|
81
|
+
* the title says "source file". A say or a send never needs a file for its
|
|
82
|
+
* arguments, and allowing one would post that file to the conversation.
|
|
62
83
|
*/
|
|
63
84
|
private onAgentRequest;
|
|
64
85
|
private onNotification;
|
package/dist/grok-room-http.d.ts
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { type SendFileHandler } from "./grok-room-mcp.js";
|
|
1
2
|
/** Strip a credential from a log line. Empty secret is a no-op — `split("")`
|
|
2
3
|
* would insert the replacement between every character. */
|
|
3
4
|
export declare function redactCredential(text: string, secret: string): string;
|
|
@@ -29,6 +30,8 @@ export interface RoomMcpServer {
|
|
|
29
30
|
*/
|
|
30
31
|
export declare function startRoomMcpServer(opts: {
|
|
31
32
|
onSay: (text: string) => void;
|
|
33
|
+
/** #1762 PR-G: the `send_file` route. Its response is sent only once the send settles. */
|
|
34
|
+
onSendFile?: SendFileHandler;
|
|
32
35
|
log?: (m: string) => void;
|
|
33
36
|
}): Promise<RoomMcpServer>;
|
|
34
37
|
//# sourceMappingURL=grok-room-http.d.ts.map
|
package/dist/grok-room-mcp.d.ts
CHANGED
|
@@ -1,2 +1,15 @@
|
|
|
1
|
-
|
|
1
|
+
/**
|
|
2
|
+
* MCP request handling for the room plugin's tools: `say`, and (#1762 PR-G)
|
|
3
|
+
* `send_file` when the bridge wires a handler for it.
|
|
4
|
+
*
|
|
5
|
+
* Kept pure so the say path is testable without a process: `handleMcpFrame` maps
|
|
6
|
+
* one request frame to one response frame (or null for notifications). A
|
|
7
|
+
* `send_file` call answers with a PROMISE: the HTTP listener awaits the real
|
|
8
|
+
* send before it responds, so the model is never told a file went when it did
|
|
9
|
+
* not (unlike `say`, #1765).
|
|
10
|
+
*/
|
|
11
|
+
import type { SendFileOutcome } from "./file-turn.js";
|
|
12
|
+
/** #1762 PR-G: the bridge's `send_file` route (GrokSession.sendFile). Never throws. */
|
|
13
|
+
export type SendFileHandler = (path: unknown, caption: unknown) => Promise<SendFileOutcome>;
|
|
14
|
+
export declare function handleMcpFrame(frame: any, onSay: (text: string) => void, onSendFile?: SendFileHandler): object | Promise<object> | null;
|
|
2
15
|
//# sourceMappingURL=grok-room-mcp.d.ts.map
|
|
@@ -4,6 +4,8 @@
|
|
|
4
4
|
* convention and would silently match nothing here.
|
|
5
5
|
*/
|
|
6
6
|
export declare const GROK_ROOM_SAY_TOOL_NAME = "room__say";
|
|
7
|
+
/** #1762 PR-G: `send_file` as the MODEL sees it (same derivation as say). */
|
|
8
|
+
export declare const GROK_ROOM_SEND_FILE_TOOL_NAME = "room__send_file";
|
|
7
9
|
/**
|
|
8
10
|
* Write a Grok plugin directory exposing exactly one capability.
|
|
9
11
|
*
|
package/dist/grok-session.d.ts
CHANGED
|
@@ -1,5 +1,8 @@
|
|
|
1
1
|
import { type ToolConversation, type ToolSpanSink } from "@agentvault/agentvault";
|
|
2
2
|
import type { TurnResult } from "./agent-driver.js";
|
|
3
|
+
import type { FileTurn, SendFileOutcome } from "./file-turn.js";
|
|
4
|
+
import { type OwnerStatus } from "./owner-grant.js";
|
|
5
|
+
import type { GrokToolProfile } from "./tool-profile.js";
|
|
3
6
|
/** A reply sink. `{ notice: true }` marks the #1560 failure notice: delivered
|
|
4
7
|
* to the same chat, but not recorded as the agent's own `say`. A notice sink
|
|
5
8
|
* that logs its own send failure resolves `false` (#1583: so the session can
|
|
@@ -18,6 +21,43 @@ export interface PushOpts {
|
|
|
18
21
|
/** #1560: the chat this turn answers. It names the failure span and picks the
|
|
19
22
|
* notice wording: only a 1:1 hears the cause, anything else the bare line. */
|
|
20
23
|
conversation?: ToolConversation;
|
|
24
|
+
/**
|
|
25
|
+
* #1762 PR-G: the message's turn authority (lease + conversation), when file
|
|
26
|
+
* send is on. Attested — or not — by the bridge BEFORE this push. `send_file`
|
|
27
|
+
* uses only the RUNNING turn's; it is ended when the turn is (result,
|
|
28
|
+
* failure, stop), and on a push the session will never run.
|
|
29
|
+
*/
|
|
30
|
+
fileTurn?: FileTurn;
|
|
31
|
+
/** #1762 PR-G: true once this message's room is hushed (#392) — `send_file` refuses. */
|
|
32
|
+
hushed?: () => boolean;
|
|
33
|
+
/**
|
|
34
|
+
* #1807: the grok CLI may expand `@` file references in this text. Only
|
|
35
|
+
* `true` keeps them, and the bridge sets it only from
|
|
36
|
+
* `grokMayExpandFileRefs` (the owner's attested 1:1). Anything else —
|
|
37
|
+
* absent included — neutralizes the text before it reaches the CLI.
|
|
38
|
+
*/
|
|
39
|
+
keepGrokFileRefs?: boolean;
|
|
40
|
+
/**
|
|
41
|
+
* #1820 part 2: an owner 1:1's grant, re-decided when the turn is RELEASED
|
|
42
|
+
* (it reaches the head of the queue). Not `"owner"` — the sending device is
|
|
43
|
+
* no longer an owner device, or the owner list cannot be read — and the turn
|
|
44
|
+
* runs as an unattested 1:1: no plain-text fallback, no file authority, its
|
|
45
|
+
* `@` references neutralized, and `onOwnerWithdrawn(status)`.
|
|
46
|
+
*
|
|
47
|
+
* #1826 review: `onOwnerWithdrawn` returns `"rerouted"` when the bridge has
|
|
48
|
+
* re-pushed the turn to the RESTRICTED grok child (#1824): this session (the
|
|
49
|
+
* owner child, with grok's tools) must then NOT run it. The bridge taints the
|
|
50
|
+
* shared session only for `"not_owner"`, never for `"unknown"` (M3).
|
|
51
|
+
*/
|
|
52
|
+
confirmOwner?: () => "owner" | Promise<OwnerStatus>;
|
|
53
|
+
onOwnerWithdrawn?: (status: Exclude<OwnerStatus, "owner">) => "rerouted" | void;
|
|
54
|
+
/**
|
|
55
|
+
* #1814: which grok child runs this turn. Read by the ToolProfileRouter
|
|
56
|
+
* (profile-router.ts), never by a GrokSession. Only `"owner"` reaches the
|
|
57
|
+
* owner child, and the bridge sets it only from `grokToolProfileFor` (the
|
|
58
|
+
* owner's attested 1:1). Anything else — absent included — runs restricted.
|
|
59
|
+
*/
|
|
60
|
+
toolProfile?: GrokToolProfile;
|
|
21
61
|
}
|
|
22
62
|
/** Grok's OWN copy of the room-session contract. The Claude bridge has its own;
|
|
23
63
|
* the two are deliberately unrelated and must not be unified. */
|
|
@@ -90,11 +130,25 @@ export declare class GrokSession implements RoomSession {
|
|
|
90
130
|
});
|
|
91
131
|
push(text: string, reply?: ReplySink, opts?: PushOpts): void;
|
|
92
132
|
private inbound;
|
|
133
|
+
/**
|
|
134
|
+
* #1762 PR-G — the `send_file` tool. Only the RUNNING turn's authority is
|
|
135
|
+
* used (never the last one's, between turns), under the same gates as say:
|
|
136
|
+
* #1180 (a turn not owed sends nothing) and #392 (a hushed room). It AWAITS
|
|
137
|
+
* the real send and reports "File sent" only when a frame was written.
|
|
138
|
+
* Never throws.
|
|
139
|
+
*/
|
|
140
|
+
sendFile(path: unknown, caption: unknown): Promise<SendFileOutcome>;
|
|
93
141
|
/** Hand this to startRoomMcpServer({ onSay }). The behaviour is stable for
|
|
94
142
|
* the life of the session — the per-message routing happens HERE, not in
|
|
95
143
|
* the listener — but each call returns a NEW closure; do not rely on
|
|
96
144
|
* identity (e.g. for `===` comparisons or `removeListener`-style APIs). */
|
|
97
145
|
sayHandler(): (text: string) => void;
|
|
146
|
+
/**
|
|
147
|
+
* PR #1824 review r3: drop every turn queued behind the running one (the
|
|
148
|
+
* running turn is untouched). Each dropped turn's file token ends now; the
|
|
149
|
+
* session stays usable. Returns how many were dropped.
|
|
150
|
+
*/
|
|
151
|
+
dropQueued(): number;
|
|
98
152
|
/** Revoke output and future work BEFORE asynchronous process cleanup. */
|
|
99
153
|
invalidate(): void;
|
|
100
154
|
/**
|
|
@@ -126,6 +180,13 @@ export declare class GrokSession implements RoomSession {
|
|
|
126
180
|
/** Resolves when the queue is empty. For tests and shutdown. */
|
|
127
181
|
idle(): Promise<void>;
|
|
128
182
|
private log;
|
|
183
|
+
/**
|
|
184
|
+
* #1820 part 2: the queued 1:1's sender is no longer an owner device, or
|
|
185
|
+
* (#1826 M3) could not be confirmed. Returns true when this session must
|
|
186
|
+
* not run it: the bridge re-pushed it elsewhere (the restricted child), or
|
|
187
|
+
* the hook threw (round 2, L4: dropped rather than run here).
|
|
188
|
+
*/
|
|
189
|
+
private withdrawOwner;
|
|
129
190
|
private run;
|
|
130
191
|
/**
|
|
131
192
|
* #1560: a failed turn is never silent. In this order:
|
package/dist/grok-spawn.d.ts
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { type RestrictedProfilePaths } from "./tool-profile.js";
|
|
1
2
|
export interface GrokSpawnOpts {
|
|
2
3
|
/** Defaults to "grok" — resolved from PATH at spawn time, like the launcher
|
|
3
4
|
* script already does for node, so a version-manager switch cannot strand it. */
|
|
@@ -12,7 +13,27 @@ export interface GrokSpawnOpts {
|
|
|
12
13
|
/** Preferred auth for a daemon: no login state to provision inside the fence
|
|
13
14
|
* and no expiry to re-authenticate. */
|
|
14
15
|
apiKey?: string;
|
|
16
|
+
/**
|
|
17
|
+
* #1814: set for the RESTRICTED child (room, A2A and non-owner 1:1 turns).
|
|
18
|
+
* Adds `--agent-profile` (the tool allowlist), and the child gets an
|
|
19
|
+
* ALLOWLISTED environment (`RESTRICTED_ENV_PASSTHROUGH` plus ours, nothing
|
|
20
|
+
* else): `HOME` is the profile's own emptied home (its only file is the
|
|
21
|
+
* deny rules), `GROK_HOME` its own emptied grok home (PR #1824 review r3).
|
|
22
|
+
* Credentials come in by environment: `authPath` (the fence's ONE
|
|
23
|
+
* `auth.json`, via grok's `GROK_AUTH_PATH`; measured on 1.0.46) and/or
|
|
24
|
+
* `apiKey`. Absent: the owner child, exactly as before. See tool-profile.ts.
|
|
25
|
+
*/
|
|
26
|
+
restricted?: RestrictedProfilePaths & {
|
|
27
|
+
grokHome: string;
|
|
28
|
+
authPath?: string;
|
|
29
|
+
};
|
|
15
30
|
}
|
|
31
|
+
/**
|
|
32
|
+
* The only variables the restricted child inherits from the bridge (PR #1824
|
|
33
|
+
* review r3): locale, temp dir and proxy/CA settings a network client may
|
|
34
|
+
* need. Nothing named GROK_*, CLAUDE_*, CURSOR_* or CODEX_* ever passes.
|
|
35
|
+
*/
|
|
36
|
+
export declare const RESTRICTED_ENV_PASSTHROUGH: readonly string[];
|
|
16
37
|
export interface GrokSpawn {
|
|
17
38
|
command: string;
|
|
18
39
|
args: string[];
|
|
@@ -1,4 +1,10 @@
|
|
|
1
|
-
/**
|
|
1
|
+
/**
|
|
2
|
+
* #1762 PR-G (§4.3) — the file rule, appended to whatever identity the model
|
|
3
|
+
* runs with (the bridge's own or the owner's custom `systemPrompt`), so the
|
|
4
|
+
* model actually receives it: GrokSession prepends this to EVERY prompt.
|
|
5
|
+
* `sendFileTool` is the name the MODEL sees (`room__send_file`). Idempotent.
|
|
6
|
+
*/
|
|
7
|
+
export declare function withFileSendRule(identity: string, sendFileTool: string): string;
|
|
2
8
|
/**
|
|
3
9
|
* How a room works, as this bridge now delivers it (PR #1458). The old line —
|
|
4
10
|
* "In a room you see every message" — stopped being true when unaddressed room
|