@kdonev/termscape 0.1.5 → 0.1.7
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 +17 -7
- package/dist/agents/profiles.d.ts +23 -0
- package/dist/agents/profiles.d.ts.map +1 -1
- package/dist/agents/profiles.js +48 -5
- package/dist/agents/profiles.js.map +1 -1
- package/dist/agents/templates.d.ts +18 -0
- package/dist/agents/templates.d.ts.map +1 -1
- package/dist/agents/templates.js +19 -0
- package/dist/agents/templates.js.map +1 -1
- package/dist/agents/visibility.d.ts +22 -0
- package/dist/agents/visibility.d.ts.map +1 -0
- package/dist/agents/visibility.js +20 -0
- package/dist/agents/visibility.js.map +1 -0
- package/dist/agents/wiring.d.ts +1 -1
- package/dist/agents/wiring.d.ts.map +1 -1
- package/dist/agents/wiring.js +12 -3
- package/dist/agents/wiring.js.map +1 -1
- package/dist/cli-args.d.ts +4 -0
- package/dist/cli-args.d.ts.map +1 -1
- package/dist/cli-args.js +2 -0
- package/dist/cli-args.js.map +1 -1
- package/dist/cli.js +63 -23
- package/dist/cli.js.map +1 -1
- package/dist/db/migrations.d.ts.map +1 -1
- package/dist/db/migrations.js +29 -0
- package/dist/db/migrations.js.map +1 -1
- package/dist/db/store.d.ts +8 -0
- package/dist/db/store.d.ts.map +1 -1
- package/dist/db/store.js +25 -4
- package/dist/db/store.js.map +1 -1
- package/dist/hub.d.ts +129 -26
- package/dist/hub.d.ts.map +1 -1
- package/dist/hub.js +331 -51
- package/dist/hub.js.map +1 -1
- package/dist/hub.tgz +0 -0
- package/dist/mcp/server.d.ts.map +1 -1
- package/dist/mcp/server.js +6 -1
- package/dist/mcp/server.js.map +1 -1
- package/dist/protocol/domain.d.ts +1 -0
- package/dist/protocol/domain.d.ts.map +1 -1
- package/dist/protocol/domain.js +12 -0
- package/dist/protocol/domain.js.map +1 -1
- package/dist/protocol/mcp-tools.js +1 -1
- package/dist/protocol/mcp-tools.js.map +1 -1
- package/dist/protocol/peer.d.ts +58 -1
- package/dist/protocol/peer.d.ts.map +1 -1
- package/dist/protocol/peer.js +72 -1
- package/dist/protocol/peer.js.map +1 -1
- package/dist/protocol/ws.d.ts +6 -0
- package/dist/protocol/ws.d.ts.map +1 -1
- package/dist/protocol/ws.js +2 -0
- package/dist/protocol/ws.js.map +1 -1
- package/dist/remote/peer-serve.d.ts.map +1 -1
- package/dist/remote/peer-serve.js +16 -3
- package/dist/remote/peer-serve.js.map +1 -1
- package/dist/remote/registry.d.ts +8 -0
- package/dist/remote/registry.d.ts.map +1 -1
- package/dist/remote/registry.js +15 -0
- package/dist/remote/registry.js.map +1 -1
- package/dist/server.d.ts.map +1 -1
- package/dist/server.js +13 -2
- package/dist/server.js.map +1 -1
- package/dist/session/manager.d.ts +22 -2
- package/dist/session/manager.d.ts.map +1 -1
- package/dist/session/manager.js +52 -9
- package/dist/session/manager.js.map +1 -1
- package/dist/session/pty.d.ts +30 -1
- package/dist/session/pty.d.ts.map +1 -1
- package/dist/session/pty.js +77 -1
- package/dist/session/pty.js.map +1 -1
- package/dist/window/app-window.d.ts +2 -0
- package/dist/window/app-window.d.ts.map +1 -0
- package/dist/window/app-window.js +137 -0
- package/dist/window/app-window.js.map +1 -0
- package/dist/window/open-window.d.ts +38 -0
- package/dist/window/open-window.d.ts.map +1 -0
- package/dist/window/open-window.js +76 -0
- package/dist/window/open-window.js.map +1 -0
- package/package.json +5 -2
- package/web/assets/index-gfbbNQK4.css +1 -0
- package/web/assets/index-i7fXLKF0.js +111 -0
- package/web/icon.png +0 -0
- package/web/icon.svg +22 -0
- package/web/index.html +4 -2
- package/web/assets/index-Z03Ta4g3.js +0 -111
- package/web/assets/index-u_uCiaPD.css +0 -1
package/README.md
CHANGED
|
@@ -8,7 +8,8 @@ hub exposes. Agents can look each other up, send each other messages, spawn
|
|
|
8
8
|
helpers into their workspace, and check on each other's terminals. A message
|
|
9
9
|
from one agent is delivered by typing it into the other's terminal, immediately.
|
|
10
10
|
|
|
11
|
-
Local-first: the hub runs on your machine and the UI
|
|
11
|
+
Local-first: the hub runs on your machine and the UI opens in a window of its
|
|
12
|
+
own — the same web page a browser would show. It binds
|
|
12
13
|
every interface, so the canvas opens on your phone or a second screen as well —
|
|
13
14
|
with its token — and another machine can attach itself from the join page.
|
|
14
15
|
`--listen loopback` keeps the whole thing to this machine. Other machines run
|
|
@@ -20,10 +21,18 @@ the same hub as a daemon and appear on the same canvas.
|
|
|
20
21
|
npx @kdonev/termscape
|
|
21
22
|
```
|
|
22
23
|
|
|
23
|
-
That starts the hub and opens the canvas in
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
24
|
+
That starts the hub and opens the canvas in a window of its own. The window is
|
|
25
|
+
the app: closing it stops the hub, saving state first, just as Ctrl+C in the
|
|
26
|
+
terminal would. `--browser` opens the canvas in a browser tab instead, which
|
|
27
|
+
the hub outlives, and `--no-open` opens nothing; the URL is printed either
|
|
28
|
+
way. Nothing is installed system-wide: state lives in `~/.termscape`, and
|
|
29
|
+
deleting that directory is the uninstall.
|
|
30
|
+
|
|
31
|
+
The window is the operating system's own webview — WebView2 on Windows,
|
|
32
|
+
WebKit on macOS, WebKitGTK on Linux — so there is no browser bundled with it.
|
|
33
|
+
Linux needs WebKitGTK 4.1 and libxdo (`sudo apt install libwebkit2gtk-4.1-0
|
|
34
|
+
libxdo3` on Debian and Ubuntu). Where no webview can be loaded, the hub says
|
|
35
|
+
why and opens the browser instead.
|
|
27
36
|
|
|
28
37
|
The hub is reachable from your network, so the same URL — token and all — opens
|
|
29
38
|
the canvas on a phone or a second screen, and the **+ machine** dialog already
|
|
@@ -60,7 +69,8 @@ the field, with what you typed still in it.
|
|
|
60
69
|
|
|
61
70
|
## Requirements
|
|
62
71
|
|
|
63
|
-
- Node
|
|
72
|
+
- Node 24 or newer (a machine that only joins another canvas runs headless and
|
|
73
|
+
needs 22)
|
|
64
74
|
- An agent CLI on your `PATH` — [Claude Code](https://claude.com/claude-code)
|
|
65
75
|
is the profile that ships configured
|
|
66
76
|
- macOS, Windows, or Linux
|
|
@@ -71,7 +81,7 @@ needed.
|
|
|
71
81
|
## How it fits together
|
|
72
82
|
|
|
73
83
|
```
|
|
74
|
-
|
|
84
|
+
Window or browser (canvas, xterm.js)
|
|
75
85
|
│ WebSocket: JSON control + binary PTY frames
|
|
76
86
|
Hub (Node)
|
|
77
87
|
│ node-pty ── agent CLI processes
|
|
@@ -15,6 +15,13 @@ export interface AgentProfile {
|
|
|
15
15
|
status: 'hooks' | 'heuristic';
|
|
16
16
|
/** Regex matched against the last non-empty line when status = heuristic. */
|
|
17
17
|
readyHint?: string;
|
|
18
|
+
/**
|
|
19
|
+
* Regex over the screen meaning the CLI is putting a question to the human
|
|
20
|
+
* before it will take a prompt at all - a folder it has never been trusted
|
|
21
|
+
* in. The opening instruction waits for an answer rather than being typed
|
|
22
|
+
* into the question, where it was lost. See Hub.typeWhenReady.
|
|
23
|
+
*/
|
|
24
|
+
askingHint?: string;
|
|
18
25
|
inject: InjectMode;
|
|
19
26
|
/**
|
|
20
27
|
* How the brief reaches the agent.
|
|
@@ -102,6 +109,22 @@ export interface AgentProfile {
|
|
|
102
109
|
/** The effort levels this agent documents, for the dialog to offer. */
|
|
103
110
|
efforts?: string[];
|
|
104
111
|
}
|
|
112
|
+
/**
|
|
113
|
+
* Which PowerShell the `powershell` profile runs.
|
|
114
|
+
*
|
|
115
|
+
* On Windows there are two: `powershell.exe`, the 5.1 that ships with the OS
|
|
116
|
+
* and will never change again, and `pwsh`, PowerShell 7, which is the one
|
|
117
|
+
* anybody who bothered to install it actually wants. So `pwsh` wins wherever
|
|
118
|
+
* it can be found, and 5.1 is the answer only when it cannot.
|
|
119
|
+
*
|
|
120
|
+
* PATH first, because that is where the installer puts it. The default install
|
|
121
|
+
* directory second, for a hub started from a process whose PATH predates the
|
|
122
|
+
* install - a daemon, or a terminal that was open at the time - which would
|
|
123
|
+
* otherwise go on starting 5.1 until something restarted it with a fresh PATH.
|
|
124
|
+
*
|
|
125
|
+
* Elsewhere `pwsh` is the only PowerShell there is.
|
|
126
|
+
*/
|
|
127
|
+
export declare function powershellCommand(): string;
|
|
105
128
|
/**
|
|
106
129
|
* Built-in profiles. All Claude Code flags here are verified against the CLI:
|
|
107
130
|
* --mcp-config, --session-id, --settings, --append-system-prompt-file,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"profiles.d.ts","sourceRoot":"","sources":["../../src/agents/profiles.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"profiles.d.ts","sourceRoot":"","sources":["../../src/agents/profiles.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,qBAAqB,CAAC;AAItD;;;GAGG;AACH,MAAM,WAAW,YAAY;IAC3B,EAAE,EAAE,MAAM,CAAC;IACX,WAAW,EAAE,MAAM,CAAC;IACpB,OAAO,EAAE,MAAM,CAAC;IAChB,IAAI,EAAE,MAAM,EAAE,CAAC;IACf,GAAG,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IAC5B,0EAA0E;IAC1E,GAAG,EAAE,OAAO,CAAC;IACb,mCAAmC;IACnC,MAAM,EAAE,OAAO,GAAG,WAAW,CAAC;IAC9B,6EAA6E;IAC7E,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB;;;;;OAKG;IACH,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,MAAM,EAAE,UAAU,CAAC;IACnB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;OA+BG;IACH,KAAK,CAAC,EAAE,MAAM,GAAG,OAAO,GAAG,MAAM,CAAC;IAClC;;;;OAIG;IACH,UAAU,CAAC,EAAE,MAAM,EAAE,CAAC;IAItB;;;;;;;;OAQG;IACH,QAAQ,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IAClC;;;;OAIG;IACH,WAAW,CAAC,EAAE,MAAM,EAAE,CAAC;IACvB;;;;OAIG;IACH,UAAU,CAAC,E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
CHANGED
|
@@ -1,7 +1,43 @@
|
|
|
1
|
-
import { readFileSync, existsSync } from 'node:fs';
|
|
1
|
+
import { readFileSync, existsSync, statSync } from 'node:fs';
|
|
2
|
+
import { join } from 'node:path';
|
|
2
3
|
import { platform } from 'node:process';
|
|
3
4
|
import { parse as parseToml } from 'smol-toml';
|
|
4
5
|
import { paths } from '../paths.js';
|
|
6
|
+
import { which } from './resolve.js';
|
|
7
|
+
/**
|
|
8
|
+
* Which PowerShell the `powershell` profile runs.
|
|
9
|
+
*
|
|
10
|
+
* On Windows there are two: `powershell.exe`, the 5.1 that ships with the OS
|
|
11
|
+
* and will never change again, and `pwsh`, PowerShell 7, which is the one
|
|
12
|
+
* anybody who bothered to install it actually wants. So `pwsh` wins wherever
|
|
13
|
+
* it can be found, and 5.1 is the answer only when it cannot.
|
|
14
|
+
*
|
|
15
|
+
* PATH first, because that is where the installer puts it. The default install
|
|
16
|
+
* directory second, for a hub started from a process whose PATH predates the
|
|
17
|
+
* install - a daemon, or a terminal that was open at the time - which would
|
|
18
|
+
* otherwise go on starting 5.1 until something restarted it with a fresh PATH.
|
|
19
|
+
*
|
|
20
|
+
* Elsewhere `pwsh` is the only PowerShell there is.
|
|
21
|
+
*/
|
|
22
|
+
export function powershellCommand() {
|
|
23
|
+
if (platform !== 'win32')
|
|
24
|
+
return 'pwsh';
|
|
25
|
+
if (which('pwsh'))
|
|
26
|
+
return 'pwsh';
|
|
27
|
+
for (const root of [process.env.ProgramFiles, process.env.ProgramW6432]) {
|
|
28
|
+
if (!root)
|
|
29
|
+
continue;
|
|
30
|
+
const installed = join(root, 'PowerShell', '7', 'pwsh.exe');
|
|
31
|
+
try {
|
|
32
|
+
if (statSync(installed).isFile())
|
|
33
|
+
return installed;
|
|
34
|
+
}
|
|
35
|
+
catch {
|
|
36
|
+
// Not installed there; try the next one.
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
return 'powershell.exe';
|
|
40
|
+
}
|
|
5
41
|
function defaultShell() {
|
|
6
42
|
if (platform === 'win32')
|
|
7
43
|
return process.env.COMSPEC ?? 'powershell.exe';
|
|
@@ -76,6 +112,10 @@ export const BUILTIN_PROFILES = {
|
|
|
76
112
|
mcp: true,
|
|
77
113
|
status: 'hooks',
|
|
78
114
|
inject: 'bracketed',
|
|
115
|
+
// The first start in a folder asks whether to trust it. On a machine
|
|
116
|
+
// attached to the canvas every workspace is a folder Claude Code has
|
|
117
|
+
// likely never opened there.
|
|
118
|
+
askingHint: 'I trust this folder',
|
|
79
119
|
versionArgs: ['--version'],
|
|
80
120
|
/*
|
|
81
121
|
* Claude Code has no listing command, so this is the declared half of
|
|
@@ -328,9 +368,11 @@ export const BUILTIN_PROFILES = {
|
|
|
328
368
|
*
|
|
329
369
|
* On Windows `shell` follows COMSPEC, which is cmd.exe - so the shell most
|
|
330
370
|
* Windows work actually happens in was the one thing the picker could not
|
|
331
|
-
* offer.
|
|
332
|
-
*
|
|
333
|
-
*
|
|
371
|
+
* offer. There it is PowerShell 7 when that is installed and the built-in
|
|
372
|
+
* 5.1 otherwise; see powershellCommand. Elsewhere `pwsh` is the
|
|
373
|
+
* cross-platform build, and it stays in the list when it is not installed
|
|
374
|
+
* with "not found on PATH" against it, which is the honest answer for a
|
|
375
|
+
* shell you have to install.
|
|
334
376
|
*
|
|
335
377
|
* Unwired for the same reason `shell` is, and it is not a gap a flag could
|
|
336
378
|
* close: a shell executes what is typed at it, so a brief there is a series
|
|
@@ -339,7 +381,7 @@ export const BUILTIN_PROFILES = {
|
|
|
339
381
|
powershell: {
|
|
340
382
|
id: 'powershell',
|
|
341
383
|
description: 'PowerShell, no agent wiring',
|
|
342
|
-
command:
|
|
384
|
+
command: powershellCommand(),
|
|
343
385
|
// -NoLogo: the banner is three lines of nothing in a window this small.
|
|
344
386
|
args: ['-NoLogo'],
|
|
345
387
|
env: {},
|
|
@@ -414,6 +456,7 @@ export class ProfileRegistry {
|
|
|
414
456
|
mcp: v.mcp ?? base?.mcp ?? true,
|
|
415
457
|
status: v.status ?? base?.status ?? 'heuristic',
|
|
416
458
|
readyHint: v.ready_hint ?? v.readyHint ?? base?.readyHint,
|
|
459
|
+
askingHint: v.asking_hint ?? v.askingHint ?? base?.askingHint,
|
|
417
460
|
inject: v.inject ?? base?.inject ?? 'bracketed',
|
|
418
461
|
brief: v.brief ?? base?.brief,
|
|
419
462
|
resumeArgs: v.resume_args ?? v.resumeArgs ?? base?.resumeArgs,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"profiles.js","sourceRoot":"","sources":["../../src/agents/profiles.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC;
|
|
1
|
+
{"version":3,"file":"profiles.js","sourceRoot":"","sources":["../../src/agents/profiles.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,UAAU,EAAE,QAAQ,EAAE,MAAM,SAAS,CAAC;AAC7D,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AACjC,OAAO,EAAE,QAAQ,EAAE,MAAM,cAAc,CAAC;AACxC,OAAO,EAAE,KAAK,IAAI,SAAS,EAAE,MAAM,WAAW,CAAC;AAE/C,OAAO,EAAE,KAAK,EAAE,MAAM,aAAa,CAAC;AACpC,OAAO,EAAE,KAAK,EAAE,MAAM,cAAc,CAAC;AAuHrC;;;;;;;;;;;;;;GAcG;AACH,MAAM,UAAU,iBAAiB;IAC/B,IAAI,QAAQ,KAAK,OAAO;QAAE,OAAO,MAAM,CAAC;IACxC,IAAI,KAAK,CAAC,MAAM,CAAC;QAAE,OAAO,MAAM,CAAC;IACjC,KAAK,MAAM,IAAI,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,YAAY,EAAE,OAAO,CAAC,GAAG,CAAC,YAAY,CAAC,EAAE,CAAC;QACxE,IAAI,CAAC,IAAI;YAAE,SAAS;QACpB,MAAM,SAAS,GAAG,IAAI,CAAC,IAAI,EAAE,YAAY,EAAE,GAAG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AAC"}
|
|
@@ -97,4 +97,22 @@ export declare class TemplateRegistry {
|
|
|
97
97
|
/** What the browser is given to build the picker from. */
|
|
98
98
|
info(): AgentTemplateInfo[];
|
|
99
99
|
}
|
|
100
|
+
/**
|
|
101
|
+
* An attached hub's template list: the canvas's, plus the bare agents this
|
|
102
|
+
* machine has.
|
|
103
|
+
*
|
|
104
|
+
* Templates are central (issue 22): only the canvas has a human to make,
|
|
105
|
+
* edit or accept one, so a template stored or declared on an attached hub is
|
|
106
|
+
* one nobody on the canvas can see, and it is left out rather than listed as
|
|
107
|
+
* if it were usable. What crosses from the canvas is only what it *made* - a
|
|
108
|
+
* derived one only says the canvas machine has that agent, which is not
|
|
109
|
+
* something this machine can start. What stays from here is only derived:
|
|
110
|
+
* the agents this machine actually has. Where the canvas made a template with
|
|
111
|
+
* the same id as one of those, the canvas's wins: it is the one spawn_agent
|
|
112
|
+
* resolves (see Hub.pickTemplateFor).
|
|
113
|
+
*/
|
|
114
|
+
export declare function overlayCanvasTemplates<T extends {
|
|
115
|
+
id: string;
|
|
116
|
+
source: TemplateSource;
|
|
117
|
+
}>(canvas: readonly T[], local: readonly T[]): T[];
|
|
100
118
|
//# sourceMappingURL=templates.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"templates.d.ts","sourceRoot":"","sources":["../../src/agents/templates.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,iBAAiB,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC;AAE7E,OAAO,KAAK,EAAE,KAAK,EAAkB,MAAM,gBAAgB,CAAC;AAC5D,OAAO,KAAK,EAAgB,eAAe,EAAE,MAAM,eAAe,CAAC;AAEnE;;;;;;;;;;;;;;;;;;GAkBG;AACH,MAAM,WAAW,aAAa;IAC5B,EAAE,EAAE,MAAM,CAAC;IACX,WAAW,EAAE,MAAM,CAAC;IACpB,kBAAkB;IAClB,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,CAAC,EAAE,MAA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4 +162,23 @@ export class TemplateRegistry {
|
|
|
162
162
|
}));
|
|
163
163
|
}
|
|
164
164
|
}
|
|
165
|
+
/**
|
|
166
|
+
* An attached hub's template list: the canvas's, plus the bare agents this
|
|
167
|
+
* machine has.
|
|
168
|
+
*
|
|
169
|
+
* Templates are central (issue 22): only the canvas has a human to make,
|
|
170
|
+
* edit or accept one, so a template stored or declared on an attached hub is
|
|
171
|
+
* one nobody on the canvas can see, and it is left out rather than listed as
|
|
172
|
+
* if it were usable. What crosses from the canvas is only what it *made* - a
|
|
173
|
+
* derived one only says the canvas machine has that agent, which is not
|
|
174
|
+
* something this machine can start. What stays from here is only derived:
|
|
175
|
+
* the agents this machine actually has. Where the canvas made a template with
|
|
176
|
+
* the same id as one of those, the canvas's wins: it is the one spawn_agent
|
|
177
|
+
* resolves (see Hub.pickTemplateFor).
|
|
178
|
+
*/
|
|
179
|
+
export function overlayCanvasTemplates(canvas, local) {
|
|
180
|
+
const made = canvas.filter((t) => t.source !== 'derived');
|
|
181
|
+
const ids = new Set(made.map((t) => t.id));
|
|
182
|
+
return [...local.filter((t) => t.source === 'derived' && !ids.has(t.id)), ...made];
|
|
183
|
+
}
|
|
165
184
|
//# sourceMappingURL=templates.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"templates.js","sourceRoot":"","sources":["../../src/agents/templates.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC;AACnD,OAAO,EAAE,KAAK,IAAI,SAAS,EAAE,MAAM,WAAW,CAAC;AAE/C,OAAO,EAAE,KAAK,EAAE,MAAM,aAAa,CAAC;AAkEpC,8EAA8E;AAC9E,SAAS,IAAI,CAAC,OAAqB;IACjC,OAAO;QACL,EAAE,EAAE,OAAO,CAAC,EAAE;QACd,WAAW,EAAE,OAAO,CAAC,WAAW;QAChC,KAAK,EAAE,OAAO,CAAC,EAAE;QACjB,GAAG,EAAE,EAAE;QACP,MAAM,EA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human started - a root - sees every other root, wherever it runs. An agent
|
|
6
|
+
* spawned by another sees only its parent, so siblings working on pieces of
|
|
7
|
+
* one task do not find each other and start coordinating behind the agent
|
|
8
|
+
* that split it. And every agent sees its own direct children, but not
|
|
9
|
+
* theirs: a grandchild is its parent's business.
|
|
10
|
+
*
|
|
11
|
+
* "Sees" is both the listing and the access. Every place that answers who
|
|
12
|
+
* exists or acts on an address asks this, so the rule lives in exactly one
|
|
13
|
+
* place. Whether the viewer is the other agent is the caller's question.
|
|
14
|
+
*/
|
|
15
|
+
/** The only two things the rule needs to know about an agent. */
|
|
16
|
+
export interface Lineage {
|
|
17
|
+
address: string;
|
|
18
|
+
/** Who spawned it, by address; null or absent for one the human started. */
|
|
19
|
+
parentAddress?: string | null;
|
|
20
|
+
}
|
|
21
|
+
export declare function canSee(viewer: Lineage, other: Lineage): boolean;
|
|
22
|
+
//# sourceMappingURL=visibility.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"visibility.d.ts","sourceRoot":"","sources":["../../src/agents/visibility.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AAEH,iEAAiE;AACjE,MAAM,WAAW,OAAO;IACtB,OAAO,EAAE,MAAM,CAAC;IAChB,4EAA4E;IAC5E,aAAa,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;CAC/B;AAED,wBAAgB,MAAM,CAAC,MAAM,EAAE,OAAO,EAAE,KAAK,EAAE,OAAO,GAAG,OAAO,CAM/D"}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Who may see whom on the canvas (issue 22).
|
|
3
|
+
*
|
|
4
|
+
* Visibility follows lineage, never the machine or the workspace. An agent the
|
|
5
|
+
* human started - a root - sees every other root, wherever it runs. An agent
|
|
6
|
+
* spawned by another sees only its parent, so siblings working on pieces of
|
|
7
|
+
* one task do not find each other and start coordinating behind the agent
|
|
8
|
+
* that split it. And every agent sees its own direct children, but not
|
|
9
|
+
* theirs: a grandchild is its parent's business.
|
|
10
|
+
*
|
|
11
|
+
* "Sees" is both the listing and the access. Every place that answers who
|
|
12
|
+
* exists or acts on an address asks this, so the rule lives in exactly one
|
|
13
|
+
* place. Whether the viewer is the other agent is the caller's question.
|
|
14
|
+
*/
|
|
15
|
+
export function canSee(viewer, other) {
|
|
16
|
+
return (other.parentAddress === viewer.address ||
|
|
17
|
+
viewer.parentAddress === other.address ||
|
|
18
|
+
(viewer.parentAddress == null && other.parentAddress == null));
|
|
19
|
+
}
|
|
20
|
+
//# sourceMappingURL=visibility.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"visibility.js","sourceRoot":"","sources":["../../src/agents/visibility.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AASH,MAAM,UAAU,MAAM,CAAC,MAAe,EAAE,KAAc;IACpD,OAAO,CACL,KAAK,CAAC,aAAa,KAAK,MAAM,CAAC,OAAO;QACtC,MAAM,CAAC,aAAa,KAAK,KAAK,CAAC,OAAO;QACtC,CAAC,MAAM,CAAC,aAAa,IAAI,IAAI,IAAI,KAAK,CAAC,aAAa,IAAI,IAAI,CAAC,CAC9D,CAAC;AACJ,CAAC"}
|
package/dist/agents/wiring.d.ts
CHANGED
|
@@ -12,7 +12,7 @@ export interface WiringInput {
|
|
|
12
12
|
profile: AgentProfile;
|
|
13
13
|
token: string;
|
|
14
14
|
hubOrigin: string;
|
|
15
|
-
/** Addresses of the other agents
|
|
15
|
+
/** Addresses of the other agents this one can see right now, on any machine. */
|
|
16
16
|
peers: string[];
|
|
17
17
|
}
|
|
18
18
|
export interface WiringOutput {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"wiring.d.ts","sourceRoot":"","sources":["../../src/agents/wiring.ts"],"names":[],"mappings":"AAGA,OAAO,EAAa,KAAK,YAAY,EAAE,MAAM,eAAe,CAAC;AAE7D;;;;GAIG;AAEH,MAAM,WAAW,WAAW;IAC1B,SAAS,EAAE,MAAM,CAAC;IAClB,OAAO,EAAE,MAAM,CAAC;IAChB,SAAS,EAAE,MAAM,CAAC;IAClB,GAAG,EAAE,MAAM,CAAC;IACZ,OAAO,EAAE,YAAY,CAAC;IACtB,KAAK,EAAE,MAAM,CAAC;IACd,SAAS,EAAE,MAAM,CAAC;IAClB,
|
|
1
|
+
{"version":3,"file":"wiring.d.ts","sourceRoot":"","sources":["../../src/agents/wiring.ts"],"names":[],"mappings":"AAGA,OAAO,EAAa,KAAK,YAAY,EAAE,MAAM,eAAe,CAAC;AAE7D;;;;GAIG;AAEH,MAAM,WAAW,WAAW;IAC1B,SAAS,EAAE,MAAM,CAAC;IAClB,OAAO,EAAE,MAAM,CAAC;IAChB,SAAS,EAAE,MAAM,CAAC;IAClB,GAAG,EAAE,MAAM,CAAC;IACZ,OAAO,EAAE,YAAY,CAAC;IACtB,KAAK,EAAE,MAAM,CAAC;IACd,SAAS,EAAE,MAAM,CAAC;IAClB,gFAAgF;IAChF,KAAK,EAAE,MAAM,EAAE,CAAC;CACjB;AAED,MAAM,WAAW,YAAY;IAC3B,GAAG,EAAE,MAAM,CAAC;IACZ,aAAa,EAAE,MAAM,CAAC;IACtB,YAAY,EAAE,MAAM,CAAC;IACrB,SAAS,EAAE,MAAM,CAAC;IAClB;;;;;;OAMG;IACH,kBAAkB,EAAE,MAAM,CAAC;IAC3B;;;;;;;OAOG;IACH,cAAc,EAAE,MAAM,CAAC;IACvB;;;;;;OAMG;IACH,kBAAkB,EAAE,MAAM,CAAC;CAC5B;AAED;;;;GAIG;AACH,wBAAgB,YAAY,CAAC,SAAS,EAAE,MAAM,GAAG,MAAM,CAEtD;AAOD,wBAAgB,WAAW,CAAC,KAAK,EAAE,WAAW,GAAG,YAAY,CAyD5D;AAsMD;;;;;;;;;GASG;AACH,wBAAgB,WAAW,CAAC,KAAK,EAAE,WAAW,GAAG,MAAM,CA8GtD"}
|
package/dist/agents/wiring.js
CHANGED
|
@@ -141,9 +141,11 @@ function writeWiredFiles(input, paths) {
|
|
|
141
141
|
{ matcher: '*', hooks: [{ type: 'command', command: hookCmd('busy') }] },
|
|
142
142
|
],
|
|
143
143
|
// Waiting on a permission prompt is waiting on the human, which
|
|
144
|
-
// is the same thing to whoever is looking at the dot
|
|
144
|
+
// is the same thing to whoever is looking at the dot - but not
|
|
145
|
+
// to the hub, which must not take it for a finished turn and
|
|
146
|
+
// press Enter into a question. See PtySession.awaitSubmit.
|
|
145
147
|
Notification: [
|
|
146
|
-
{ hooks: [{ type: 'command', command: hookCmd('
|
|
148
|
+
{ hooks: [{ type: 'command', command: hookCmd('waiting') }] },
|
|
147
149
|
],
|
|
148
150
|
Stop: [{ hooks: [{ type: 'command', command: hookCmd('idle') }] }],
|
|
149
151
|
},
|
|
@@ -239,10 +241,17 @@ you can talk to the others.
|
|
|
239
241
|
- **Your address:** \`${input.address}\`
|
|
240
242
|
- **Your workspace:** \`${input.workspace}\` (rooted at \`${input.cwd}\`)
|
|
241
243
|
|
|
242
|
-
##
|
|
244
|
+
## Agents you can see right now
|
|
243
245
|
|
|
244
246
|
${peerList}
|
|
245
247
|
|
|
248
|
+
Who you can see follows who started whom, not which machine or workspace an
|
|
249
|
+
agent is in. An agent the human started sees every other agent the human
|
|
250
|
+
started, on any machine. An agent spawned by another agent sees only the one
|
|
251
|
+
that spawned it, not its siblings. Every agent also sees the agents it spawned
|
|
252
|
+
itself, but not theirs. An agent you cannot see is not listed and cannot be
|
|
253
|
+
messaged or read, so one missing from \`list_agents\` is not an error.
|
|
254
|
+
|
|
246
255
|
## Talking to other agents
|
|
247
256
|
|
|
248
257
|
The \`termscape\` MCP server gives you these tools. Your CLI probably shows
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"wiring.js","sourceRoot":"","sources":["../../src/agents/wiring.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,aAAa,EAAE,MAAM,SAAS,CAAC;AACnD,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AAC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J,CAAC;AAED;;;;;;;;;GASG;AACH,MAAM,UAAU,WAAW,CAAC,KAAkB;IAC5C,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,GAAG;QAAE,OAAO,kBAAkB,CAAC,KAAK,CAAC,CAAC;IAEzD,MAAM,QAAQ,GACZ,KAAK,CAAC,KAAK,CAAC,MAAM,GAAG,CAAC;QACpB,CAAC,CAAC,KAAK,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC;QACjD,CAAC,CAAC,cAAc,CAAC;IAErB,OAAO;;;;;wBAKe,KAAK,CAAC,OAAO;0BACX,KAAK,CAAC,SAAS,mBAAmB,KAAK,CAAC,GAAG;;;;EAInE,QAAQ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA2FT,CAAC;AACF,CAAC;AAED;;;;;;;;;GASG;AACH,SAAS,kBAAkB,CAAC,KAAkB;IAC5C,OAAO;;;;;wBAKe,KAAK,CAAC,OAAO;0BACX,KAAK,CAAC,SAAS,mBAAmB,KAAK,CAAC,GAAG;;;;;;;;;;;;;;;;;;;;CAoBpE,CAAC;AACF,CAAC"}
|
package/dist/cli-args.d.ts
CHANGED
|
@@ -49,6 +49,10 @@ export declare const CLI_OPTIONS: {
|
|
|
49
49
|
readonly type: "boolean";
|
|
50
50
|
readonly default: false;
|
|
51
51
|
};
|
|
52
|
+
readonly browser: {
|
|
53
|
+
readonly type: "boolean";
|
|
54
|
+
readonly default: false;
|
|
55
|
+
};
|
|
52
56
|
readonly version: {
|
|
53
57
|
readonly type: "boolean";
|
|
54
58
|
readonly default: false;
|
package/dist/cli-args.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cli-args.d.ts","sourceRoot":"","sources":["../src/cli-args.ts"],"names":[],"mappings":"AAEA;;;;;;;;;;;;;;;;;;;GAmBG;AACH,eAAO,MAAM,WAAW
|
|
1
|
+
{"version":3,"file":"cli-args.d.ts","sourceRoot":"","sources":["../src/cli-args.ts"],"names":[],"mappings":"AAEA;;;;;;;;;;;;;;;;;;;GAmBG;AACH,eAAO,MAAM,WAAW;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAeoD,CAAC"}
|
package/dist/cli-args.js
CHANGED
|
@@ -29,6 +29,8 @@ export const CLI_OPTIONS = {
|
|
|
29
29
|
open: { type: 'boolean', default: false },
|
|
30
30
|
// parseArgs has no --no-x negation, so the opt-out is its own flag.
|
|
31
31
|
'no-open': { type: 'boolean', default: false },
|
|
32
|
+
// The canvas opens in a window of its own unless this asks for a tab.
|
|
33
|
+
browser: { type: 'boolean', default: false },
|
|
32
34
|
version: { type: 'boolean', default: false },
|
|
33
35
|
help: { type: 'boolean', default: false },
|
|
34
36
|
};
|
package/dist/cli-args.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cli-args.js","sourceRoot":"","sources":["../src/cli-args.ts"],"names":[],"mappings":"AAEA;;;;;;;;;;;;;;;;;;;GAmBG;AACH,MAAM,CAAC,MAAM,WAAW,GAAG;IACzB,IAAI,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE;IACxB,QAAQ,EAAE,EAAE,IAAI,EAAE,SAAS,EAAE,OAAO,EAAE,KAAK,EAAE;IAC7C,KAAK,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE;IACzB,MAAM,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE;IAC1B,IAAI,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE;IACxB,YAAY,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE;IAChC,KAAK,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE;IACzB,IAAI,EAAE,EAAE,IAAI,EAAE,SAAS,EAAE,OAAO,EAAE,KAAK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paths.js';
|
|
|
8
8
|
import { listenPlan } from './remote/lan.js';
|
|
9
9
|
import { joinCanvas } from './remote/join.js';
|
|
10
10
|
import { openInBrowser } from './browser.js';
|
|
11
|
+
import { openAppWindow } from './window/open-window.js';
|
|
11
12
|
import { ProfileRegistry } from './agents/profiles.js';
|
|
12
13
|
import { which } from './agents/resolve.js';
|
|
13
14
|
import { debugTopics } from './debug.js';
|
|
14
15
|
import { CLI_OPTIONS } from './cli-args.js';
|
|
16
|
+
/** How long shutdown waits for open connections to close. See `shutdown`. */
|
|
17
|
+
const SERVER_CLOSE_DEADLINE_MS = 2000;
|
|
15
18
|
/**
|
|
16
19
|
* Warn when no agent CLI is installed.
|
|
17
20
|
*
|
|
@@ -53,8 +56,11 @@ async function main() {
|
|
|
53
56
|
this machine, and turns that page off with it
|
|
54
57
|
--headless serve no web UI; used when running as a remote hub
|
|
55
58
|
--token <t> client token to use instead of generating one
|
|
56
|
-
--open open the
|
|
57
|
-
--no-open do not open the
|
|
59
|
+
--open open the canvas even when not on a terminal
|
|
60
|
+
--no-open do not open the canvas; just print the url
|
|
61
|
+
--browser open the canvas in the browser instead of its own
|
|
62
|
+
window. Closing that window stops the hub; closing a
|
|
63
|
+
browser tab does not
|
|
58
64
|
|
|
59
65
|
Joining another machine's canvas:
|
|
60
66
|
|
|
@@ -147,20 +153,6 @@ Joining another machine's canvas:
|
|
|
147
153
|
}
|
|
148
154
|
if (!values.headless)
|
|
149
155
|
console.log('');
|
|
150
|
-
/*
|
|
151
|
-
* Opening the canvas is the default, not a flag.
|
|
152
|
-
*
|
|
153
|
-
* The URL carries a token, so it is long and cannot be retyped - leaving
|
|
154
|
-
* the user to copy it out of scrollback is most of the friction in a
|
|
155
|
-
* one-command install. A headless hub has no UI to open, and a hub started
|
|
156
|
-
* by a script or a supervisor has nobody watching, which is what the TTY
|
|
157
|
-
* check stands in for. --open overrides that check; --no-open beats both.
|
|
158
|
-
*/
|
|
159
|
-
const wantsBrowser = !values.headless &&
|
|
160
|
-
!values['no-open'] &&
|
|
161
|
-
(values.open || process.stdout.isTTY === true);
|
|
162
|
-
if (wantsBrowser)
|
|
163
|
-
openInBrowser(url);
|
|
164
156
|
// The canvas hub asks us to stop when the user drops this host, so the
|
|
165
157
|
// machine does not keep a hub running that belongs to nobody.
|
|
166
158
|
// A join that was refused cannot be retried into working, and this hub was
|
|
@@ -191,20 +183,36 @@ Joining another machine's canvas:
|
|
|
191
183
|
console.log(`\n[${signal}] saving state...`);
|
|
192
184
|
// Snapshots are forced here: this is the write that makes a clean restart
|
|
193
185
|
// come back with the right screens.
|
|
194
|
-
link?.stop();
|
|
195
|
-
hub.shutdown();
|
|
196
186
|
try {
|
|
197
|
-
|
|
187
|
+
link?.stop();
|
|
188
|
+
hub.shutdown();
|
|
198
189
|
}
|
|
199
|
-
catch {
|
|
200
|
-
//
|
|
190
|
+
catch (err) {
|
|
191
|
+
// Stopping is the one thing this must not fail at. A throw here used to
|
|
192
|
+
// skip the exit below and leave the hub up with nothing to stop it.
|
|
193
|
+
console.error('[shutdown]', err instanceof Error ? err.message : err);
|
|
201
194
|
}
|
|
202
195
|
try {
|
|
203
|
-
|
|
196
|
+
rmSync(paths.pidFile(), { force: true });
|
|
204
197
|
}
|
|
205
198
|
catch {
|
|
206
|
-
//
|
|
199
|
+
// Best effort; a stale pid file is handled by whoever reads it.
|
|
207
200
|
}
|
|
201
|
+
/*
|
|
202
|
+
* Closing the server is given a deadline rather than waited out. It waits
|
|
203
|
+
* for every websocket to finish its close handshake, and a client that
|
|
204
|
+
* never answers - a tab on a laptop that went to sleep, a machine on the
|
|
205
|
+
* other end of a dead link, anything that opened a socket and went quiet -
|
|
206
|
+
* held it open indefinitely. The canvas window had gone, the terminal was
|
|
207
|
+
* still held, and only Ctrl+C gave it back. State is already saved by now;
|
|
208
|
+
* all that is left to lose is a goodbye nobody is listening for.
|
|
209
|
+
*/
|
|
210
|
+
await Promise.race([
|
|
211
|
+
app.close().catch(() => {
|
|
212
|
+
// Server already down.
|
|
213
|
+
}),
|
|
214
|
+
new Promise((resolve) => setTimeout(resolve, SERVER_CLOSE_DEADLINE_MS).unref()),
|
|
215
|
+
]);
|
|
208
216
|
// node-pty on ConPTY keeps handles that can hold the loop open past close.
|
|
209
217
|
process.exit(0);
|
|
210
218
|
};
|
|
@@ -222,6 +230,38 @@ Joining another machine's canvas:
|
|
|
222
230
|
process.on('unhandledRejection', (reason) => {
|
|
223
231
|
console.error('[unhandled]', reason instanceof Error ? reason.message : reason);
|
|
224
232
|
});
|
|
233
|
+
/*
|
|
234
|
+
* Opening the canvas is the default, not a flag.
|
|
235
|
+
*
|
|
236
|
+
* The URL carries a token, so it is long and cannot be retyped - leaving
|
|
237
|
+
* the user to copy it out of scrollback is most of the friction in a
|
|
238
|
+
* one-command install. A headless hub has no UI to open, and a hub started
|
|
239
|
+
* by a script or a supervisor has nobody watching, which is what the TTY
|
|
240
|
+
* check stands in for. --open overrides that check; --no-open beats both.
|
|
241
|
+
*
|
|
242
|
+
* What opens is a window of the canvas's own, which is the app: closing it
|
|
243
|
+
* stops the hub, as Ctrl+C would. --browser asks for a tab instead, and a
|
|
244
|
+
* machine with no webview to show gets one anyway rather than nothing.
|
|
245
|
+
* Opened after `shutdown` exists, since closing the window calls it.
|
|
246
|
+
*/
|
|
247
|
+
const wantsCanvas = !values.headless &&
|
|
248
|
+
!values['no-open'] &&
|
|
249
|
+
(values.open || process.stdout.isTTY === true);
|
|
250
|
+
if (wantsCanvas && values.browser) {
|
|
251
|
+
openInBrowser(url);
|
|
252
|
+
}
|
|
253
|
+
else if (wantsCanvas) {
|
|
254
|
+
openAppWindow(url, {
|
|
255
|
+
onClosed: () => void shutdown('window closed'),
|
|
256
|
+
onUnavailable: () => {
|
|
257
|
+
console.error('[app] no native window here; opening the browser instead');
|
|
258
|
+
openInBrowser(url);
|
|
259
|
+
},
|
|
260
|
+
onCrashed: (why) => {
|
|
261
|
+
console.error(`[app] the window exited (${why}); the hub is still running at ${url}`);
|
|
262
|
+
},
|
|
263
|
+
});
|
|
264
|
+
}
|
|
225
265
|
}
|
|
226
266
|
main().catch((err) => {
|
|
227
267
|
console.error(err);
|