Skip to content

Node-based terminal manager for AI coding agents — tmux-backed terminals and parallel agent sessions as draggable nodes on an infinite pan/zoom canvas. macOS, Linux, and a browser Server Edition.

feat(remote): shell-access consent copy + describeGrant + minimal notice

enes6b8e34a5df48
diff --git a/src/renderer/remote/ConsentNotice.tsx b/src/renderer/remote/ConsentNotice.tsx
new file mode 100644
index 000000000..58662b132
--- /dev/null
+++ b/src/renderer/remote/ConsentNotice.tsx
@@ -0,0 +1,12 @@
+// Minimal consent notice for the invite/approve flow. Presentational only — the load-bearing logic
+// is the pure describeGrant (src/shared/remote/consent.ts, unit-tested). 4c places this in the actual
+// invite/approve dialog. Kept tiny + prop-driven so it needs no store wiring.
+import { describeGrant } from '@shared/remote/consent'
+
+export function ConsentNotice({ peerLabel }: { peerLabel: string }): JSX.Element {
+ return (
+ <p className="remote-consent" role="note">
+ {describeGrant(peerLabel)}
+ </p>
+ )
+}
diff --git a/src/shared/remote/consent.test.ts b/src/shared/remote/consent.test.ts
new file mode 100644
index 000000000..43142a8b5
--- /dev/null
+++ b/src/shared/remote/consent.test.ts
@@ -0,0 +1,24 @@
+import { describe, it, expect } from 'vitest'
+import { SHELL_ACCESS_CONSENT, describeGrant } from './consent'
+
+describe('consent copy', () => {
+ it('states shell access = SSH-equivalent, in plain words', () => {
+ // The user must understand the grant BEFORE accepting — this is the whole point of the copy.
+ expect(SHELL_ACCESS_CONSENT).toContain('run commands on this Mac')
+ expect(SHELL_ACCESS_CONSENT).toContain('the same as giving them SSH access')
+ })
+
+ it('names the peer', () => {
+ expect(describeGrant('Ayşe')).toBe(
+ 'Ayşe will be able to run commands on this Mac — the same as giving them SSH access.'
+ )
+ })
+
+ it('falls back to a generic subject when the label is empty/blank', () => {
+ expect(describeGrant('')).toBe(SHELL_ACCESS_CONSENT)
+ expect(describeGrant(' ')).toBe(SHELL_ACCESS_CONSENT)
+ expect(describeGrant(' Bora ')).toBe(
+ 'Bora will be able to run commands on this Mac — the same as giving them SSH access.'
+ )
+ })
+})
diff --git a/src/shared/remote/consent.ts b/src/shared/remote/consent.ts
new file mode 100644
index 000000000..d301fdc77
--- /dev/null
+++ b/src/shared/remote/consent.ts
@@ -0,0 +1,20 @@
+// Consent copy for inviting/approving a remote peer.
+//
+// Inviting a peer grants SHELL ACCESS — the invite/approve UI must say so in plain words. Per the
+// spec's "Full trust, explicitly granted" decision, there is no per-action approval and no directory
+// jail: the boundary is WHO you invite. So the copy is honest about the size of the grant. Lives in
+// src/shared (not src/main) because the renderer invite/approve UI shows it and cannot import main.
+//
+// Wording is the DESKTOP invite copy verbatim from docs/remote-sessions.md ("run commands on this
+// Mac — the same as giving them SSH access").
+
+const GRANT_TAIL = ' will be able to run commands on this Mac — the same as giving them SSH access.'
+
+/** No-name fallback sentence (also returned by describeGrant for a blank label). */
+export const SHELL_ACCESS_CONSENT = `This device${GRANT_TAIL}`
+
+/** The consent sentence naming the peer; blank labels fall back to SHELL_ACCESS_CONSENT. */
+export function describeGrant(peerLabel: string): string {
+ const who = peerLabel.trim()
+ return who ? `${who}${GRANT_TAIL}` : SHELL_ACCESS_CONSENT
+}