agentsdock 1.0.11-beta.1 → 1.0.11-beta.2
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/NOTICE +7 -0
- package/README.md +84 -28
- package/cli.cjs +7 -7
- package/package.json +2 -2
- package/postinstall.cjs +61 -9
package/NOTICE
CHANGED
|
@@ -14,6 +14,13 @@ licenses, and attribution notices. In particular:
|
|
|
14
14
|
their package metadata.
|
|
15
15
|
- SwiftTerm retains its MIT license in
|
|
16
16
|
mobile-react/modules/agentsdock-native-terminal/ios/Vendor/SwiftTerm/LICENSE.
|
|
17
|
+
- The Gemini product icon in electron/src/renderer/public/backend-gemini.svg
|
|
18
|
+
is an unmodified Google asset, not covered by AgentsDock's Apache license.
|
|
19
|
+
Gemini and its icon are trademarks of Google LLC. Used only to identify the
|
|
20
|
+
supported provider; no Google endorsement or affiliation is implied.
|
|
21
|
+
Source: https://www.gstatic.com/lamda/images/gemini_sparkle_aurora_33f86dc0c0257da337c63.svg
|
|
22
|
+
Referenced by https://gemini.google.com/ (retrieved 2026-10-15).
|
|
23
|
+
Brand guidance: https://about.google/brand-resource-center/guidance/apis/
|
|
17
24
|
|
|
18
25
|
Dependencies and other bundled third-party materials remain subject to their
|
|
19
26
|
respective license terms. This notice does not replace those licenses.
|
package/README.md
CHANGED
|
@@ -8,9 +8,20 @@ supported.
|
|
|
8
8
|
|
|
9
9
|
## Install the command
|
|
10
10
|
|
|
11
|
+
Run these commands on the **server machine**, which can be the same computer as
|
|
12
|
+
your desktop app. Use Apple silicon macOS with a desktop login, or Linux with a
|
|
13
|
+
working user systemd session. Install [Node.js 22.14 or later with npm](https://nodejs.org/en/download)
|
|
14
|
+
and [uv](https://docs.astral.sh/uv/getting-started/installation/) for the Python
|
|
15
|
+
environment. Install **tmux** for persistent terminals and in-app managed
|
|
16
|
+
updates; basic chats work without it. On macOS with Homebrew, use
|
|
17
|
+
`brew install node uv tmux`. Run npm as the server owner without `sudo`.
|
|
18
|
+
Client-only devices do not need these prerequisites. The npm server installer
|
|
19
|
+
does not run natively on Windows.
|
|
20
|
+
|
|
11
21
|
```sh
|
|
12
22
|
npm install -g agentsdock@beta
|
|
13
23
|
agentsdock list
|
|
24
|
+
agentsdock token default
|
|
14
25
|
```
|
|
15
26
|
|
|
16
27
|
On a fresh machine, the global install automatically sets up and starts the
|
|
@@ -20,11 +31,19 @@ state, including named instances; repeat installs leave these unchanged and do
|
|
|
20
31
|
not restart, overwrite or upgrade a running service. The runtime lives in its
|
|
21
32
|
managed installation directory, independently of the npm package/cache.
|
|
22
33
|
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
34
|
+
Wait for installation to finish, then confirm `default` is `running` in
|
|
35
|
+
`agentsdock list`. No npm account is needed to install the public package.
|
|
36
|
+
Add its URL and the token from `agentsdock token default` in the separately
|
|
37
|
+
downloaded [AgentsDock app](https://agentsdock.net/#downloads). Keep the token
|
|
38
|
+
private. Use the listed local URL on the same computer, a LAN URL on the same
|
|
39
|
+
network, or a Tailscale URL on your private tailnet. `127.0.0.1` cannot reach
|
|
40
|
+
the server from another device.
|
|
41
|
+
|
|
42
|
+
Install and sign in to your preferred provider CLI on the server before
|
|
43
|
+
starting a chat. npm setup does not install provider CLIs or authenticate them.
|
|
44
|
+
|
|
45
|
+
For a beta, select `npm install -g agentsdock@beta`. Stable and beta packages are
|
|
46
|
+
published on npm; this README describes the matched 1.0.11-beta.2 CLI/runtime.
|
|
28
47
|
|
|
29
48
|
`-g` makes the command available outside the current project when npm's global
|
|
30
49
|
bin directory is on your PATH. A local `npm install agentsdock` is also supported;
|
|
@@ -33,17 +52,25 @@ installs, linked source checkouts, CI installs and npx do not automatically star
|
|
|
33
52
|
a service. Use `npx agentsdock setup` when you deliberately want a server from a
|
|
34
53
|
local install. No installation changes shell configuration or logs into a provider.
|
|
35
54
|
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
setup
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
55
|
+
`setup` (also `install`) refuses to overwrite an existing default installation
|
|
56
|
+
or history. Global auto setup uses the same prerequisites; it does not install
|
|
57
|
+
uv, Homebrew, provider CLIs or Tailscale automatically. If a prerequisite is
|
|
58
|
+
missing, install it and check it in the same terminal before retrying
|
|
59
|
+
`agentsdock setup`; if the CLI was not installed, rerun the npm install command.
|
|
60
|
+
|
|
61
|
+
The connection-output improvements below are included starting in
|
|
62
|
+
1.0.11-beta.2. With 1.0.10 or 1.0.11-beta.1, use `agentsdock list` and
|
|
63
|
+
`agentsdock token default` even if npm's installation output does not show
|
|
64
|
+
connection details.
|
|
65
|
+
|
|
66
|
+
With the improved output, a successful first setup shows the default server URL and
|
|
67
|
+
access token together directly in your terminal, even when npm hides successful
|
|
68
|
+
lifecycle output. Keep the token private. Raw installer output and access tokens
|
|
69
|
+
are not copied into npm's captured output/debug logs. Headless installations
|
|
70
|
+
without a controlling terminal show only a non-secret summary; use
|
|
71
|
+
`agentsdock token default` explicitly to retrieve a token later. Reinstalling
|
|
72
|
+
over existing server state remains a no-op, not a setup or restart.
|
|
73
|
+
`--foreground-scripts` can still help display non-secret lifecycle diagnostics.
|
|
47
74
|
A failed auto setup makes npm report failure instead of claiming the server is
|
|
48
75
|
ready. To obtain interactive diagnostics or choose a custom port/bind:
|
|
49
76
|
|
|
@@ -70,6 +97,7 @@ agentsdock list
|
|
|
70
97
|
agentsdock status
|
|
71
98
|
agentsdock new work --port 7854 --bind 127.0.0.1
|
|
72
99
|
agentsdock status work
|
|
100
|
+
agentsdock logs work
|
|
73
101
|
agentsdock token
|
|
74
102
|
agentsdock token work
|
|
75
103
|
agentsdock pair work
|
|
@@ -90,7 +118,9 @@ Without a name, `agentsdock token` lists this OS user's existing servers on the
|
|
|
90
118
|
machine (including stopped instances). Use Up/Down arrows to highlight a server
|
|
91
119
|
and Enter to select it; Esc, Ctrl+C or Ctrl+D cancels without showing a token.
|
|
92
120
|
The menu scrolls when needed and restores terminal input before showing a token.
|
|
93
|
-
It displays
|
|
121
|
+
It displays the selected server's connection URLs alongside its token, retaining
|
|
122
|
+
the optional clipboard prompt. Verified Tailscale addresses appear first;
|
|
123
|
+
local-only bindings are never advertised as reachable from another device.
|
|
94
124
|
Basic terminals without cursor control retain the numbered/name prompt, where
|
|
95
125
|
empty input cancels. Even a single server requires confirmation. In a script or with
|
|
96
126
|
redirected output, select explicitly: `agentsdock token default` or
|
|
@@ -98,7 +128,12 @@ redirected output, select explicitly: `agentsdock token default` or
|
|
|
98
128
|
explicitly if another device needs access.
|
|
99
129
|
|
|
100
130
|
`agentsdock status` prints a separate readable block for every instance: status,
|
|
101
|
-
addresses, installed version and port.
|
|
131
|
+
addresses, installed version and port. In an interactive terminal it then asks
|
|
132
|
+
whether to view a token. Answer `y`, use Up/Down and Enter to select a server,
|
|
133
|
+
and its URL/token appear together. Declining or cancelling shows no token.
|
|
134
|
+
`agentsdock status work` limits both the summary and picker to that instance.
|
|
135
|
+
Redirected/non-interactive status never prompts or prints tokens; explicitly
|
|
136
|
+
named `agentsdock token work` still outputs only the token when redirected.
|
|
102
137
|
The status is the native service-manager state, not an authenticated health probe;
|
|
103
138
|
the version comes from that instance's installed runtime, not the npm CLI package.
|
|
104
139
|
`agentsdock info work` retains JSON output. If `setup` finds an existing default
|
|
@@ -114,16 +149,34 @@ Busy work, pending updates, changed native registrations or uncertain ownership
|
|
|
114
149
|
prevent a forced stop. Interrupted operations retain an owned retry journal;
|
|
115
150
|
follow the command's retry guidance rather than deleting it manually.
|
|
116
151
|
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
152
|
+
See the repository's [release validation record](../../../docs/NPM_CLI_RELEASES.md)
|
|
153
|
+
for exact-package native setup, lifecycle and removal acceptance. Source tests
|
|
154
|
+
alone do not establish native service operation.
|
|
155
|
+
|
|
156
|
+
## Read service logs
|
|
157
|
+
|
|
158
|
+
Service logs are available starting in 1.0.11-beta.2, not in 1.0.10 or
|
|
159
|
+
1.0.11-beta.1.
|
|
160
|
+
|
|
161
|
+
```sh
|
|
162
|
+
agentsdock logs # Default server: recent entries, then exit
|
|
163
|
+
agentsdock logs work # One named server; find names with agentsdock list
|
|
164
|
+
agentsdock logs work --lines 20 # -n 20 also works
|
|
165
|
+
agentsdock logs work --follow # -f also works; Ctrl+C stops only this viewer
|
|
166
|
+
agentsdock logs work -n 0 -f # Only entries arriving after viewing starts
|
|
167
|
+
```
|
|
120
168
|
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
169
|
+
Run on the server machine as its OS user; this is not a remote log-download API.
|
|
170
|
+
The default is 100 lines, with a range of 0–10,000. macOS shows separate stdout
|
|
171
|
+
and stderr sections (the last N lines per file, with a 1 MiB initial-read cap).
|
|
172
|
+
Split default installations include both gateway and worker logs. Linux uses
|
|
173
|
+
the current user's journal and shows the last N entries across the selected
|
|
174
|
+
instance's units, without a pager. Log sources follow the installed layout,
|
|
175
|
+
not the CLI's version. Missing/empty Mac log files are reported and watched if
|
|
176
|
+
following; unsafe paths fail rather than being followed. Nothing is restarted
|
|
177
|
+
or installed, and no token/configuration file is printed. Service log entries
|
|
178
|
+
can still contain private data; review them before sharing. macOS control
|
|
179
|
+
characters are escaped for terminal safety, not credential redaction.
|
|
127
180
|
|
|
128
181
|
## Connect a phone by QR
|
|
129
182
|
|
|
@@ -169,6 +222,7 @@ mailbox/jobs/team tools supplied to agents inside an authorized chat.
|
|
|
169
222
|
| All instance statuses, addresses, versions and ports | `./instances.sh status` | `agentsdock status` (separate blocks) |
|
|
170
223
|
| One instance's readable status | `./instances.sh status work` | `agentsdock status work` |
|
|
171
224
|
| One instance's details as JSON | `./instances.sh info work` | `agentsdock info work` |
|
|
225
|
+
| Recent service logs | Platform-specific `tail` / `journalctl` | `agentsdock logs [NAME]` |
|
|
172
226
|
| New automatic name/free port | `./instances.sh new` | `agentsdock new` |
|
|
173
227
|
| New named instance | `./instances.sh new --name work --port 7854` | `agentsdock new work --port 7854` |
|
|
174
228
|
| Start one | `./instances.sh start work` | `agentsdock start work` |
|
|
@@ -197,6 +251,8 @@ Supported options retain their native meanings:
|
|
|
197
251
|
- `remove`/`uninstall`: also `--yes` and `--purge-state`. Purge retains the native
|
|
198
252
|
interactive confirmation and cannot be made unattended with `--yes`.
|
|
199
253
|
- `token`/`status`: positional name or `--instance NAME`, never both.
|
|
254
|
+
- `logs`: optional name or `--instance NAME` (default: `default`), `-n`/`--lines`
|
|
255
|
+
and `-f`/`--follow`. No bulk selector or arbitrary log path.
|
|
200
256
|
- `update`: the six required arguments in the example below. Bare `update` or
|
|
201
257
|
`update work` does not select a registry tag or silently restart a server.
|
|
202
258
|
|
|
@@ -213,7 +269,7 @@ Differences from the old source scripts:
|
|
|
213
269
|
changing the port of an existing installation; manifest-based bulk creation
|
|
214
270
|
(`./instances.sh install --manifest ...`); Team Hub configuration/reactivation;
|
|
215
271
|
foreground development `python agent_server.py serve`. There are no implemented
|
|
216
|
-
`agentsdock configure`, `agentsdock
|
|
272
|
+
`agentsdock configure`, `agentsdock login`, or `agentsdock serve`
|
|
217
273
|
commands in this package.
|
|
218
274
|
- Direct checkout reinstalls (`./instances.sh update`, installer's version or
|
|
219
275
|
custom-root overrides) are not aliases for the signed `update` command. Split
|
package/cli.cjs
CHANGED
|
@@ -15,6 +15,7 @@ const HELP = `Usage: agentsdock setup [--port PORT] [--bind IP] [--non-interacti
|
|
|
15
15
|
agentsdock token [NAME]
|
|
16
16
|
agentsdock pair [NAME] [--network auto|tailscale|lan|local] [--url URL] [--output FILE.png] [--link]
|
|
17
17
|
agentsdock status [NAME]
|
|
18
|
+
agentsdock logs [NAME] [--lines N] [--follow]
|
|
18
19
|
agentsdock update --server-url URL --server-identity ID --server-instance-id ID
|
|
19
20
|
--token-file PATH --manifest PATH --signature PATH
|
|
20
21
|
agentsdock recover
|
|
@@ -22,9 +23,10 @@ const HELP = `Usage: agentsdock setup [--port PORT] [--bind IP] [--non-interacti
|
|
|
22
23
|
|
|
23
24
|
setup/install creates a fresh default server. Use new for another instance.
|
|
24
25
|
remove (also uninstall) asks for confirmation and preserves history by default.
|
|
25
|
-
token lists existing servers; use Up/Down and Enter to
|
|
26
|
+
token lists existing servers; use Up/Down and Enter to see its URL and token, or token NAME for direct access. Keep tokens private.
|
|
26
27
|
pair displays a connection QR for mobile (default instance if NAME is omitted); qrcode is an alias.
|
|
27
|
-
status shows each instance's status, addresses, installed version and port; add NAME for one instance.
|
|
28
|
+
status shows each instance's status, addresses, installed version and port; add NAME for one instance. In a terminal, it offers a token picker afterward.
|
|
29
|
+
logs shows recent local service logs (default instance when NAME is omitted); -n sets the line count and -f follows. Review logs before sharing.
|
|
28
30
|
update uses the signed managed updater; npm installation alone never upgrades a running server.
|
|
29
31
|
start/stop/restart/remove also accept --all [--exclude NAME]; an omitted target never selects all.
|
|
30
32
|
new --name NAME, token/status --instance NAME, and servers/instances ACTION remain supported.
|
|
@@ -44,10 +46,10 @@ function selector(args, fallback) {
|
|
|
44
46
|
return name
|
|
45
47
|
}
|
|
46
48
|
|
|
47
|
-
const INSTANCE_ACTIONS = ['list', 'info', 'new', 'start', 'stop', 'restart', 'remove']
|
|
49
|
+
const INSTANCE_ACTIONS = ['list', 'info', 'new', 'start', 'stop', 'restart', 'remove', 'logs']
|
|
48
50
|
function instanceRequest(action, args) {
|
|
49
51
|
if (!INSTANCE_ACTIONS.includes(action)) {
|
|
50
|
-
throw new Error('Use list, info, new, start, stop, restart, or
|
|
52
|
+
throw new Error('Use list, info, new, start, stop, restart, remove, or logs. Use agentsdock update for signed updates.')
|
|
51
53
|
}
|
|
52
54
|
if (action === 'new' && args[0] && !args[0].startsWith('-')) {
|
|
53
55
|
const name = selector([args[0]])
|
|
@@ -71,9 +73,7 @@ function parse(argv) {
|
|
|
71
73
|
}
|
|
72
74
|
if (command === 'token') {
|
|
73
75
|
const name = selector(args)
|
|
74
|
-
return name
|
|
75
|
-
? { kind: 'local', script: 'install.sh', args: ['--instance', name, '--show-token'] }
|
|
76
|
-
: { kind: 'local', script: 'instances.sh', args: ['token'] }
|
|
76
|
+
return { kind: 'local', script: 'instances.sh', args: name ? ['token', name] : ['token'] }
|
|
77
77
|
}
|
|
78
78
|
if (['pair', 'qrcode'].includes(command)) return require('./pair.cjs').parsePair(args)
|
|
79
79
|
if (command === 'status') {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "agentsdock",
|
|
3
|
-
"version": "1.0.11-beta.
|
|
3
|
+
"version": "1.0.11-beta.2",
|
|
4
4
|
"description": "Install and manage your AgentsDock server from the command line",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"repository": {
|
|
@@ -32,7 +32,7 @@
|
|
|
32
32
|
"postinstall": "node postinstall.cjs"
|
|
33
33
|
},
|
|
34
34
|
"dependencies": {
|
|
35
|
-
"@agentsdock/server": "1.0.11-beta.
|
|
35
|
+
"@agentsdock/server": "1.0.11-beta.2"
|
|
36
36
|
},
|
|
37
37
|
"publishConfig": {
|
|
38
38
|
"access": "public",
|
package/postinstall.cjs
CHANGED
|
@@ -4,6 +4,7 @@ const path = require('node:path')
|
|
|
4
4
|
const fs = require('node:fs')
|
|
5
5
|
const os = require('node:os')
|
|
6
6
|
const { isIP } = require('node:net')
|
|
7
|
+
const { isatty } = require('node:tty')
|
|
7
8
|
const { spawn, spawnSync } = require('node:child_process')
|
|
8
9
|
const { loadRuntime, localEnvironment } = require('./cli.cjs')
|
|
9
10
|
|
|
@@ -47,10 +48,31 @@ function lines(accept) {
|
|
|
47
48
|
}
|
|
48
49
|
}
|
|
49
50
|
|
|
51
|
+
function terminalPrint(text, io = { ...fs, isatty }) {
|
|
52
|
+
// npm captures lifecycle stdout/stderr, including --foreground-scripts in
|
|
53
|
+
// its debug logs. Only the controlling terminal may receive credentials.
|
|
54
|
+
// No terminal (CI/headless installs): fail closed, never fall back to a log.
|
|
55
|
+
let fd
|
|
56
|
+
try {
|
|
57
|
+
fd = io.openSync('/dev/tty', fs.constants.O_WRONLY | fs.constants.O_NOCTTY | fs.constants.O_NONBLOCK)
|
|
58
|
+
if (!io.isatty(fd)) return false
|
|
59
|
+
const bytes = Buffer.from(text)
|
|
60
|
+
let offset = 0
|
|
61
|
+
while (offset < bytes.length) {
|
|
62
|
+
const written = io.writeSync(fd, bytes, offset, bytes.length - offset)
|
|
63
|
+
if (!written) return false
|
|
64
|
+
offset += written
|
|
65
|
+
}
|
|
66
|
+
return true
|
|
67
|
+
} catch { return false }
|
|
68
|
+
finally { if (fd !== undefined) { try { io.closeSync(fd) } catch { /* best effort */ } } }
|
|
69
|
+
}
|
|
70
|
+
|
|
50
71
|
async function postinstall(overrides = {}) {
|
|
51
72
|
const context = { env: process.env, home: os.homedir(), uid: process.getuid?.(),
|
|
52
73
|
platform: process.platform, packageRoot: __dirname, spawn: spawnSync,
|
|
53
|
-
launch: spawn, load: loadRuntime,
|
|
74
|
+
launch: spawn, load: loadRuntime, terminalPrint,
|
|
75
|
+
print: text => process.stdout.write(`agentsdock: ${text}\n`), ...overrides }
|
|
54
76
|
const skipped = skipReason(context)
|
|
55
77
|
if (skipped) { context.print(skipped); return 0 }
|
|
56
78
|
const environment = localEnvironment(context)
|
|
@@ -70,11 +92,13 @@ async function postinstall(overrides = {}) {
|
|
|
70
92
|
context.print('Existing server installation or state found; left unchanged. Use agentsdock list to inspect it.')
|
|
71
93
|
return 0
|
|
72
94
|
}
|
|
73
|
-
|
|
95
|
+
const starting = 'Setting up your first AgentsDock server. This may take a few minutes.'
|
|
96
|
+
if (!context.terminalPrint(`agentsdock: ${starting}\n`)) context.print(starting)
|
|
74
97
|
let receipt, missingUv = false, racedInstallation = false
|
|
75
98
|
// Do not forward installer output into npm's captured logs: the setup JSON
|
|
76
|
-
// contains an access token.
|
|
77
|
-
//
|
|
99
|
+
// contains an access token. Only a validated success receipt may go directly
|
|
100
|
+
// to the terminal; stdout/stderr receive a non-secret summary. Never forward
|
|
101
|
+
// raw output (even when the installer fails).
|
|
78
102
|
const stdout = lines(line => {
|
|
79
103
|
if (!line.startsWith('AGENTSDOCK_SETUP_RESULT=')) return
|
|
80
104
|
try {
|
|
@@ -84,7 +108,9 @@ async function postinstall(overrides = {}) {
|
|
|
84
108
|
if (result.server_version === runtime.version && url.protocol === 'http:' &&
|
|
85
109
|
(host === 'localhost' || isIP(host)) &&
|
|
86
110
|
!url.username && !url.password && !url.search && !url.hash && url.pathname === '/') {
|
|
87
|
-
|
|
111
|
+
const token = typeof result.access_token === 'string' && /^[\x21-\x7e]{1,4096}$/.test(result.access_token)
|
|
112
|
+
? result.access_token : ''
|
|
113
|
+
receipt = { url: url.origin, version: runtime.version, token }
|
|
88
114
|
}
|
|
89
115
|
} catch { /* A malformed/missing success receipt must not become success. */ }
|
|
90
116
|
})
|
|
@@ -106,11 +132,37 @@ async function postinstall(overrides = {}) {
|
|
|
106
132
|
return 0
|
|
107
133
|
}
|
|
108
134
|
if (status !== 0 || !receipt) {
|
|
109
|
-
|
|
110
|
-
|
|
135
|
+
if (missingUv) {
|
|
136
|
+
// Fixed guidance only: never echo the installer's potentially private
|
|
137
|
+
// diagnostics. Preserve the selected version, including a beta.
|
|
138
|
+
const install = `npm install -g agentsdock@${runtime.version}`
|
|
139
|
+
throw new Error([
|
|
140
|
+
'Automatic setup did not complete: uv is missing from PATH or cannot run.',
|
|
141
|
+
'AgentsDock Server needs uv to prepare its Python environment.',
|
|
142
|
+
...(context.platform === 'darwin'
|
|
143
|
+
? ['On macOS with Homebrew, install uv:', ' brew install uv'] : []),
|
|
144
|
+
'Installation guide: https://docs.astral.sh/uv/getting-started/installation/',
|
|
145
|
+
'Then verify and retry the same AgentsDock version:',
|
|
146
|
+
' uv --version',
|
|
147
|
+
` ${install} --foreground-scripts`,
|
|
148
|
+
'If uv works but setup still fails, run these for interactive diagnostics:',
|
|
149
|
+
` AGENTSDOCK_SKIP_SETUP=1 ${install}`,
|
|
150
|
+
' agentsdock setup',
|
|
151
|
+
'Existing state is never deleted automatically.',
|
|
152
|
+
].join('\n'))
|
|
153
|
+
}
|
|
154
|
+
throw new Error('Automatic setup did not complete successfully.' +
|
|
111
155
|
' For interactive diagnostics, install the CLI with AGENTSDOCK_SKIP_SETUP=1 npm install -g agentsdock, then run agentsdock setup. Existing state is never deleted automatically.')
|
|
112
156
|
}
|
|
113
|
-
|
|
157
|
+
const summary = `Server ${receipt.version} is ready at ${receipt.url}. Open AgentsDock to connect. Use agentsdock token to view/copy its private token.`
|
|
158
|
+
const shown = context.terminalPrint([
|
|
159
|
+
'', 'Your new service is up!', '', 'Server (default):',
|
|
160
|
+
` Version: ${receipt.version}`, ` URL: ${receipt.url}`, '',
|
|
161
|
+
...(receipt.token ? ['Access token (default):', receipt.token, '', 'Keep this token private.'] : []),
|
|
162
|
+
'Open AgentsDock and add this server using its URL and token.',
|
|
163
|
+
'To view or copy the token again: agentsdock token default', '',
|
|
164
|
+
].join('\n'))
|
|
165
|
+
if (!shown) context.print(summary)
|
|
114
166
|
return 0
|
|
115
167
|
}
|
|
116
168
|
|
|
@@ -118,4 +170,4 @@ if (require.main === module) postinstall().then(code => { process.exitCode = cod
|
|
|
118
170
|
process.stderr.write(`agentsdock: ${error.message}\n`)
|
|
119
171
|
process.exitCode = 1
|
|
120
172
|
})
|
|
121
|
-
module.exports = { skipReason, lines, postinstall }
|
|
173
|
+
module.exports = { skipReason, lines, terminalPrint, postinstall }
|