hermesdesk-agent 0.1.0-alpha.10 → 0.1.0-alpha.13
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 +9 -4
- package/bin/hermesdesk.js +2 -1
- package/npm-shrinkwrap.json +2 -2
- package/package.json +1 -1
- package/src/agent.js +30 -6
- package/src/config.js +1 -1
- package/src/permissions.js +23 -6
- package/src/transport.js +43 -5
- package/src/ui/chrome.js +3 -1
- package/src/ui/extension.js +11 -1
- package/src/ui/format.js +2 -2
- package/src/ui/interactive.js +3 -0
package/README.md
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
[](https://github.com/NKocur/hermesdesk-agent/actions/workflows/ci.yml)
|
|
4
4
|
|
|
5
|
-
**Windows alpha: 0.1.0-alpha.
|
|
5
|
+
**Windows alpha: 0.1.0-alpha.13.** Community client built on Pi; not affiliated with or endorsed by Earendil Works or Nous Research.
|
|
6
6
|
|
|
7
7
|
A running HermesDesk inference gateway is required. This client does not include a hosted model service, server access, or API keys.
|
|
8
8
|
|
|
@@ -18,7 +18,7 @@ hermesdesk.cmd connect
|
|
|
18
18
|
hermesdesk.cmd doctor
|
|
19
19
|
```
|
|
20
20
|
|
|
21
|
-
Alternatively, download and extract a Windows alpha bundle from [Releases](https://github.com/NKocur/hermesdesk-agent/releases) and run `Install Agent.cmd`. A tarball can also be installed directly with `npm.cmd install -g --ignore-scripts ./hermesdesk-agent-0.1.0-alpha.
|
|
21
|
+
Alternatively, download and extract a Windows alpha bundle from [Releases](https://github.com/NKocur/hermesdesk-agent/releases) and run `Install Agent.cmd`. A tarball can also be installed directly with `npm.cmd install -g --ignore-scripts ./hermesdesk-agent-0.1.0-alpha.13.tgz`.
|
|
22
22
|
|
|
23
23
|
There is no default server address. `connect` asks for your HTTPS model endpoint ending in `/v1`. When the server supports browser sign-in, it opens your browser: sign in to HermesDesk and approve the computer. The CLI receives a short-lived, single-use authorization code on a loopback listener and redeems it with PKCE over HTTPS, then discovers the model and saves the credentials encrypted. You do not copy passwords, API keys, or connection codes. The browser and CLI must be on the same computer. Use `--no-browser` to open the printed browser link yourself. On legacy servers without browser sign-in, the API-key setup remains available; `--manual` explicitly selects it. No server credentials are included in this package.
|
|
24
24
|
|
|
@@ -49,10 +49,12 @@ Colors follow the terminal background automatically, using the HermesDesk light
|
|
|
49
49
|
|
|
50
50
|
Escape interrupts work. `/quit` exits; `/new` starts a new conversation and `/resume` opens Pi's session selector. The first interactive startup may download Pi's `fd` helper to this client's own Pi cache. Windows Terminal is recommended. Pi's inherited help and exit hints may still mention `pi`; resume this client with `hermesdesk chat --continue` or `--session ID`.
|
|
51
51
|
|
|
52
|
-
File tools are restricted to the chosen project and reject outside links and protected paths such as `.env`, `.git`, credential files and agent configurations.
|
|
52
|
+
File tools are restricted to the chosen project and reject outside links and protected paths such as `.env`, `.git`, credential files and agent configurations. Edits and shell commands ask for approval by default. Shell commands execute as your user and are **not OS-sandboxed**; after approval they can access anything your account can access. Direct `!` shell shortcuts are disabled so commands use the managed approval path. Project JavaScript extensions, MCP servers and packages are not automatically loaded.
|
|
53
53
|
|
|
54
54
|
The root project's `AGENTS.md` is included as instructions when it is an ordinary allowed file under 64 KiB. Existing global Pi/Claude settings are not imported. This first version does not synchronize HermesDesk chats, workspace memory or Hermes's skill-learning loop.
|
|
55
55
|
|
|
56
|
+
HermesDesk pins Pi as an SDK dependency. Automatic Pi update banners and startup changelog notices are suppressed; update this client with `npm.cmd install -g --ignore-scripts hermesdesk-agent@alpha`. The dependency is updated through a tested HermesDesk release.
|
|
57
|
+
|
|
56
58
|
## Headless jobs and automation
|
|
57
59
|
|
|
58
60
|
No terminal window is required. Sign in once with `hermesdesk connect` under the account that runs the job, or provide the existing session-only authentication environment variables. Authentication setup is never prompted during a job. Models still run on your configured HermesDesk/Strata server; tools work on the computer running the CLI.
|
|
@@ -115,11 +117,12 @@ Use `--continue` or `--session ID` when starting the process to restore an earli
|
|
|
115
117
|
```text
|
|
116
118
|
/permissions ask
|
|
117
119
|
/permissions edits
|
|
120
|
+
/permissions fuck-it
|
|
118
121
|
/permissions read-only
|
|
119
122
|
/permissions show
|
|
120
123
|
```
|
|
121
124
|
|
|
122
|
-
`ask` requests approval for edits and shell commands. `edits` auto-approves workspace file edits while shell commands still ask. `read-only` enables reading and searching and blocks file changes/commands; switch back with `/permissions ask` or `edits`. The header, footer and `/status` follow the current mode. Changes are local to the running CLI process, consume no model calls and add no messages to model history. They are blocked during an active run; finish it or press Ctrl+C first. Menu cancellation leaves the mode unchanged. Launching with `--read-only` locks that restriction until you restart without the flag. Headless permissions stay fixed by launch options, and protected file paths remain blocked.
|
|
125
|
+
`ask` requests approval for edits and shell commands. `edits` auto-approves workspace file edits while shell commands still ask. **Fuck it Mode** (`/permissions fuck-it`) auto-approves both file edits and shell commands. Commands run with your account access, including access outside the workspace. The header/footer name the active mode; switch back with `/permissions ask`. `read-only` enables reading and searching and blocks file changes/commands; switch back with `/permissions ask` or `edits`. The header, footer and `/status` follow the current mode. Changes are local to the running CLI process, consume no model calls and add no messages to model history. They are blocked during an active run; finish it or press Ctrl+C first. Menu cancellation leaves the mode unchanged. Launching with `--read-only` locks that restriction until you restart without the flag. Headless permissions stay fixed by launch options, and protected file paths remain blocked.
|
|
123
126
|
|
|
124
127
|
|
|
125
128
|
Use these inside interactive chat. Commands run locally, consume no model tokens, and change the next request without restarting the conversation:
|
|
@@ -173,6 +176,8 @@ Windows uses its built-in `curl.exe` for model HTTP requests because the retaine
|
|
|
173
176
|
|
|
174
177
|
Press **Ctrl+C** during a run to cancel generation or a running tool and return to the prompt. Pending file/command approvals are dismissed without granting permission. Cancellation does not undo completed actions. Escape also interrupts from the chat editor. When idle, Ctrl+C clears the input; pressing it twice quickly exits. Ctrl+D exits with an empty input.
|
|
175
178
|
|
|
179
|
+
Brief connection failures and transient HTTP errors get up to two retries before the response stream opens. Authentication, validation and request-size errors fail immediately. Once a response is streaming, an interrupted response stops the run; the client does not automatically replay it. Previously completed tool results stay in the conversation, so recovery before a later model response does not repeat those actions. Ctrl+C and job timeouts also cancel retry backoff. Retries can add HTTP attempts within a model-call round. Windows limits connection setup to 20 seconds and reports bounded curl diagnostics with credentials redacted if retries are exhausted. Whole-agent retries remain disabled.
|
|
180
|
+
|
|
176
181
|
## Optional private Worker gateway
|
|
177
182
|
|
|
178
183
|
The generic Worker source and deployment notes are in [worker/](worker/README.md). It requires Cloudflare Access authentication for its configured application and proxies only model discovery and chat completions to a single private VPC Service. It exposes no desktop tools, file APIs, application sessions, or arbitrary destinations. Website Bot Fight Mode can remain enabled when the agent uses a separate `workers.dev` endpoint. Workers VPC is beta; check Cloudflare's current availability, pricing and limits before adopting it.
|
package/bin/hermesdesk.js
CHANGED
|
@@ -85,7 +85,8 @@ const help = `HermesDesk Agent ${VERSION} (Pi-based, Windows first)
|
|
|
85
85
|
hermesdesk config [set KEY VALUE | preset fast|balanced|extended]
|
|
86
86
|
hermesdesk logout
|
|
87
87
|
|
|
88
|
-
|
|
88
|
+
Interactive chat asks before edits and commands by default.
|
|
89
|
+
/permissions fuck-it enables Fuck it Mode; /permissions ask restores approval prompts.
|
|
89
90
|
One-shot runs deny changes by default; --approve-writes permits workspace file edits.
|
|
90
91
|
Headless commands are denied unless --approve-commands explicitly permits them.
|
|
91
92
|
--read-only overrides both pre-approvals. Shell commands are not OS-sandboxed.
|
package/npm-shrinkwrap.json
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "hermesdesk-agent",
|
|
3
|
-
"version": "0.1.0-alpha.
|
|
3
|
+
"version": "0.1.0-alpha.13",
|
|
4
4
|
"lockfileVersion": 3,
|
|
5
5
|
"requires": true,
|
|
6
6
|
"packages": {
|
|
7
7
|
"": {
|
|
8
8
|
"name": "hermesdesk-agent",
|
|
9
|
-
"version": "0.1.0-alpha.
|
|
9
|
+
"version": "0.1.0-alpha.13",
|
|
10
10
|
"license": "MIT",
|
|
11
11
|
"dependencies": {
|
|
12
12
|
"@earendil-works/pi-coding-agent": "1.5.0",
|
package/package.json
CHANGED
package/src/agent.js
CHANGED
|
@@ -73,6 +73,7 @@ export async function createRuntime({
|
|
|
73
73
|
process.env.PI_CODING_AGENT_DIR = agentDir;
|
|
74
74
|
const {
|
|
75
75
|
ModelRuntime,
|
|
76
|
+
VERSION: piVersion,
|
|
76
77
|
SettingsManager,
|
|
77
78
|
SessionManager,
|
|
78
79
|
createAgentSessionServices,
|
|
@@ -93,7 +94,19 @@ export async function createRuntime({
|
|
|
93
94
|
allowModelNetwork: false,
|
|
94
95
|
refreshOnCreate: false,
|
|
95
96
|
});
|
|
96
|
-
const
|
|
97
|
+
const rawFetch = modelFetch(config.baseUrl, access);
|
|
98
|
+
let transportFailure,
|
|
99
|
+
transportAttempts = 0;
|
|
100
|
+
const safeFetch = async (input, init) => {
|
|
101
|
+
transportFailure = undefined;
|
|
102
|
+
transportAttempts++;
|
|
103
|
+
try {
|
|
104
|
+
return await rawFetch(input, init);
|
|
105
|
+
} catch (error) {
|
|
106
|
+
transportFailure = error.message;
|
|
107
|
+
throw error;
|
|
108
|
+
}
|
|
109
|
+
};
|
|
97
110
|
let requestCount = 0;
|
|
98
111
|
modelRuntime.registerProvider("hermesdesk", {
|
|
99
112
|
name: "HermesDesk / Strata",
|
|
@@ -119,6 +132,8 @@ export async function createRuntime({
|
|
|
119
132
|
},
|
|
120
133
|
],
|
|
121
134
|
streamSimple: (model, context, options) => {
|
|
135
|
+
transportFailure = undefined;
|
|
136
|
+
transportAttempts = 0;
|
|
122
137
|
syncThinking();
|
|
123
138
|
if (++requestCount > config.maxRequests)
|
|
124
139
|
throw Error(
|
|
@@ -127,7 +142,9 @@ export async function createRuntime({
|
|
|
127
142
|
return streamSimple(model, context, {
|
|
128
143
|
...options,
|
|
129
144
|
fetch: safeFetch,
|
|
130
|
-
|
|
145
|
+
// The SDK retries only before the response stream is opened.
|
|
146
|
+
// Keep whole-agent retries disabled so partial replies/tools are not replayed.
|
|
147
|
+
maxRetries: 2,
|
|
131
148
|
timeoutMs: 1800000,
|
|
132
149
|
maxTokens: config.maxTokens,
|
|
133
150
|
onPayload: async (payload, m) => {
|
|
@@ -150,13 +167,15 @@ export async function createRuntime({
|
|
|
150
167
|
const settingsManager = SettingsManager.inMemory({
|
|
151
168
|
enableAnalytics: false,
|
|
152
169
|
enableInstallTelemetry: false,
|
|
170
|
+
// SDK release notes are not HermesDesk release notes; keep them out of startup.
|
|
171
|
+
lastChangelogVersion: piVersion,
|
|
153
172
|
packages: [],
|
|
154
173
|
cacheWarming: "off",
|
|
155
174
|
// HermesDesk draws its own header; skip Pi's resource listing at startup.
|
|
156
175
|
quietStartup: "header",
|
|
157
176
|
theme: themeSetting(),
|
|
158
177
|
retry: { enabled: false },
|
|
159
|
-
providerRetry: { maxRetries:
|
|
178
|
+
providerRetry: { maxRetries: 2, timeoutMs: 1800000 },
|
|
160
179
|
compaction: {
|
|
161
180
|
enabled: true,
|
|
162
181
|
reserveTokens: Math.min(
|
|
@@ -232,9 +251,10 @@ export async function createRuntime({
|
|
|
232
251
|
apply: (mode) => {
|
|
233
252
|
if (!activeSession)
|
|
234
253
|
throw Error("The session is not ready to change permissions.");
|
|
235
|
-
permissions.change(mode, (next) =>
|
|
236
|
-
|
|
237
|
-
|
|
254
|
+
permissions.change(mode, (next) => {
|
|
255
|
+
if (next.readOnly !== permissions.read().readOnly)
|
|
256
|
+
activeSession.setActiveToolsByName(toolsFor(next));
|
|
257
|
+
});
|
|
238
258
|
},
|
|
239
259
|
}),
|
|
240
260
|
policyExtension({
|
|
@@ -256,6 +276,10 @@ export async function createRuntime({
|
|
|
256
276
|
permissionMode: permissions.display,
|
|
257
277
|
read: syncThinking,
|
|
258
278
|
discover: () => discover(config, token, access),
|
|
279
|
+
transportError: () =>
|
|
280
|
+
transportFailure
|
|
281
|
+
? { message: transportFailure, attempts: transportAttempts }
|
|
282
|
+
: undefined,
|
|
259
283
|
}),
|
|
260
284
|
],
|
|
261
285
|
},
|
package/src/config.js
CHANGED
package/src/permissions.js
CHANGED
|
@@ -5,11 +5,14 @@ import { chooseItem } from "./ui/menu.js";
|
|
|
5
5
|
export const PERMISSION_MODES = {
|
|
6
6
|
ask: { readOnly: false, approveWrites: false, approveCommands: false },
|
|
7
7
|
edits: { readOnly: false, approveWrites: true, approveCommands: false },
|
|
8
|
+
"fuck-it": { readOnly: false, approveWrites: true, approveCommands: true },
|
|
8
9
|
"read-only": { readOnly: true, approveWrites: false, approveCommands: false },
|
|
9
10
|
};
|
|
10
11
|
const NOTES = {
|
|
11
12
|
ask: "Edits and shell commands ask first.",
|
|
12
13
|
edits: "File edits apply automatically; shell commands ask first.",
|
|
14
|
+
"fuck-it":
|
|
15
|
+
"Auto-approve edits and shell commands; commands run with your account access.",
|
|
13
16
|
"read-only":
|
|
14
17
|
"Read and search only; file edits and shell commands are blocked.",
|
|
15
18
|
};
|
|
@@ -30,12 +33,19 @@ export function createPermissions({
|
|
|
30
33
|
lockedReadOnly,
|
|
31
34
|
read: () => ({ ...current }),
|
|
32
35
|
mode: () =>
|
|
33
|
-
current.readOnly
|
|
36
|
+
current.readOnly
|
|
37
|
+
? "read-only"
|
|
38
|
+
: current.approveWrites && current.approveCommands
|
|
39
|
+
? "fuck-it"
|
|
40
|
+
: current.approveWrites
|
|
41
|
+
? "edits"
|
|
42
|
+
: "ask",
|
|
34
43
|
change(mode, beforeChange = () => {}) {
|
|
35
44
|
const next = Object.hasOwn(PERMISSION_MODES, mode)
|
|
36
45
|
? PERMISSION_MODES[mode]
|
|
37
46
|
: undefined;
|
|
38
|
-
if (!next)
|
|
47
|
+
if (!next)
|
|
48
|
+
throw Error("Usage: /permissions ask|edits|fuck-it|read-only|show");
|
|
39
49
|
if (lockedReadOnly && mode !== "read-only")
|
|
40
50
|
throw Error(
|
|
41
51
|
"This CLI was launched with --read-only. Restart without that flag to permit edits or commands.",
|
|
@@ -63,14 +73,19 @@ export function permissionsCommands({ permissions, apply }) {
|
|
|
63
73
|
);
|
|
64
74
|
};
|
|
65
75
|
pi.registerCommand("permissions", {
|
|
66
|
-
description:
|
|
76
|
+
description:
|
|
77
|
+
"Approval mode: ask, auto-approve edits, Fuck it Mode, or read-only",
|
|
67
78
|
getArgumentCompletions: (prefix) =>
|
|
68
79
|
[...Object.keys(PERMISSION_MODES), "show"]
|
|
69
80
|
.filter((value) => value.startsWith(prefix.trim().toLowerCase()))
|
|
70
|
-
.map((value) => ({
|
|
81
|
+
.map((value) => ({
|
|
82
|
+
value,
|
|
83
|
+
label: value === "fuck-it" ? "Fuck it Mode" : value,
|
|
84
|
+
})),
|
|
71
85
|
handler: async (args, ctx) => {
|
|
72
86
|
try {
|
|
73
87
|
let mode = args.trim().toLowerCase();
|
|
88
|
+
if (/^fuck[ -]+it(?:[ -]+mode)?$/.test(mode)) mode = "fuck-it";
|
|
74
89
|
if (mode === "show") return show(ctx);
|
|
75
90
|
if (!ctx.hasUI || ctx.mode !== "tui")
|
|
76
91
|
throw Error(
|
|
@@ -82,7 +97,7 @@ export function permissionsCommands({ permissions, apply }) {
|
|
|
82
97
|
title: "Permissions",
|
|
83
98
|
subtitle: permissions.lockedReadOnly
|
|
84
99
|
? "This launch is restricted by --read-only."
|
|
85
|
-
: "Applies immediately to this CLI process.
|
|
100
|
+
: "Applies immediately to this CLI process. Fuck it Mode also auto-approves shell commands.",
|
|
86
101
|
items: Object.keys(PERMISSION_MODES)
|
|
87
102
|
.filter(
|
|
88
103
|
(value) =>
|
|
@@ -95,7 +110,9 @@ export function permissionsCommands({ permissions, apply }) {
|
|
|
95
110
|
? "Ask first"
|
|
96
111
|
: value === "edits"
|
|
97
112
|
? "Auto-approve edits"
|
|
98
|
-
: "
|
|
113
|
+
: value === "fuck-it"
|
|
114
|
+
? "Fuck it Mode"
|
|
115
|
+
: "Read-only",
|
|
99
116
|
description: NOTES[value],
|
|
100
117
|
current: permissions.mode() === value,
|
|
101
118
|
})),
|
package/src/transport.js
CHANGED
|
@@ -133,6 +133,29 @@ function curlQuote(value) {
|
|
|
133
133
|
'"'
|
|
134
134
|
);
|
|
135
135
|
}
|
|
136
|
+
// Curl diagnostics can include configuration fragments: redact credentials before
|
|
137
|
+
// they reach persisted assistant errors or terminal output.
|
|
138
|
+
export function curlFailureDetail(stderr, request) {
|
|
139
|
+
let text = String(stderr || "");
|
|
140
|
+
for (const name of [
|
|
141
|
+
"authorization",
|
|
142
|
+
"cf-access-client-id",
|
|
143
|
+
"cf-access-client-secret",
|
|
144
|
+
]) {
|
|
145
|
+
const value = request.headers.get(name);
|
|
146
|
+
if (value) {
|
|
147
|
+
text = text.split(value).join("[redacted]");
|
|
148
|
+
if (name === "authorization") {
|
|
149
|
+
const token = value.replace(/^Bearer\s+/i, "");
|
|
150
|
+
if (token) text = text.split(token).join("[redacted]");
|
|
151
|
+
}
|
|
152
|
+
}
|
|
153
|
+
}
|
|
154
|
+
return text
|
|
155
|
+
.replace(/[\r\n\t]+/g, " ")
|
|
156
|
+
.trim()
|
|
157
|
+
.slice(0, 600);
|
|
158
|
+
}
|
|
136
159
|
export async function curlFetch(input, init) {
|
|
137
160
|
const r = new Request(input, init);
|
|
138
161
|
r.signal.throwIfAborted();
|
|
@@ -167,6 +190,10 @@ export async function curlFetch(input, init) {
|
|
|
167
190
|
"--http1.1",
|
|
168
191
|
"--include",
|
|
169
192
|
"--compressed",
|
|
193
|
+
"--connect-timeout",
|
|
194
|
+
"20",
|
|
195
|
+
"--keepalive-time",
|
|
196
|
+
"30",
|
|
170
197
|
"--max-time",
|
|
171
198
|
"1800",
|
|
172
199
|
"--config",
|
|
@@ -205,12 +232,20 @@ export async function curlFetch(input, init) {
|
|
|
205
232
|
reject(error);
|
|
206
233
|
}
|
|
207
234
|
};
|
|
208
|
-
|
|
235
|
+
let stderr = "";
|
|
236
|
+
const fail = (event) => {
|
|
209
237
|
if (bodyClosed) return;
|
|
238
|
+
const code = typeof event === "number" ? event : child.exitCode;
|
|
239
|
+
const detail = curlFailureDetail(
|
|
240
|
+
stderr || (event instanceof Error ? event.message : ""),
|
|
241
|
+
r,
|
|
242
|
+
);
|
|
210
243
|
const error = new Error(
|
|
211
244
|
"Windows HTTP transport failed" +
|
|
212
|
-
(
|
|
213
|
-
|
|
245
|
+
(code ? " (curl " + code + ")" : "") +
|
|
246
|
+
(detail
|
|
247
|
+
? ". " + detail
|
|
248
|
+
: ". Check the server address and connection."),
|
|
214
249
|
);
|
|
215
250
|
finishBody(error);
|
|
216
251
|
if (!settled) {
|
|
@@ -219,7 +254,10 @@ export async function curlFetch(input, init) {
|
|
|
219
254
|
}
|
|
220
255
|
};
|
|
221
256
|
r.signal.addEventListener("abort", abort, { once: true });
|
|
222
|
-
child.stderr.
|
|
257
|
+
child.stderr.on("data", (chunk) => {
|
|
258
|
+
if (stderr.length < 4096)
|
|
259
|
+
stderr += chunk.toString("utf8").slice(0, 4096 - stderr.length);
|
|
260
|
+
});
|
|
223
261
|
child.on("error", fail);
|
|
224
262
|
child.stdin.on("error", () => {});
|
|
225
263
|
child.stdout.on("data", (chunk) => {
|
|
@@ -285,7 +323,7 @@ export async function curlFetch(input, init) {
|
|
|
285
323
|
r.signal.removeEventListener("abort", abort);
|
|
286
324
|
if (bodyClosed) return;
|
|
287
325
|
if (code === 0 && headersDone) finishBody();
|
|
288
|
-
else fail();
|
|
326
|
+
else fail(code);
|
|
289
327
|
});
|
|
290
328
|
if (r.signal.aborted) {
|
|
291
329
|
abort();
|
package/src/ui/chrome.js
CHANGED
|
@@ -58,7 +58,9 @@ export function headerFactory({ version, mode, keyText, read }) {
|
|
|
58
58
|
: "File tools stay inside this workspace. " +
|
|
59
59
|
(mode.short === "asks first"
|
|
60
60
|
? "Edits and commands ask first."
|
|
61
|
-
:
|
|
61
|
+
: mode.short === "Fuck it Mode"
|
|
62
|
+
? "Edits and shell commands run without asking."
|
|
63
|
+
: "Edits apply without asking; commands ask first.");
|
|
62
64
|
const hints = [
|
|
63
65
|
theme.fg("accent", "/limits") + theme.fg("dim", " settings"),
|
|
64
66
|
theme.fg("accent", "/permissions"),
|
package/src/ui/extension.js
CHANGED
|
@@ -78,6 +78,7 @@ export function interfaceExtension({
|
|
|
78
78
|
permissionMode,
|
|
79
79
|
read,
|
|
80
80
|
discover,
|
|
81
|
+
transportError,
|
|
81
82
|
activity = createActivity(),
|
|
82
83
|
bell = process.env.HERMESDESK_BELL?.trim().toLowerCase() === "on"
|
|
83
84
|
? () => process.stdout.write("\x07")
|
|
@@ -186,7 +187,16 @@ export function interfaceExtension({
|
|
|
186
187
|
if (message.stopReason === "length" && tui(ctx))
|
|
187
188
|
ctx.ui.notify(truncationNotice(message, read()), "warning");
|
|
188
189
|
if (message.stopReason === "error" && message.errorMessage) {
|
|
189
|
-
const
|
|
190
|
+
const diagnostic = /^Connection error\.?$/i.test(
|
|
191
|
+
message.errorMessage.trim(),
|
|
192
|
+
)
|
|
193
|
+
? transportError?.()
|
|
194
|
+
: undefined;
|
|
195
|
+
const errorMessage = friendlyError(
|
|
196
|
+
diagnostic
|
|
197
|
+
? `${message.errorMessage} ${diagnostic.message} (${diagnostic.attempts} connection ${diagnostic.attempts === 1 ? "attempt" : "attempts"}).`
|
|
198
|
+
: message.errorMessage,
|
|
199
|
+
);
|
|
190
200
|
if (errorMessage !== message.errorMessage)
|
|
191
201
|
return { message: { ...message, errorMessage } };
|
|
192
202
|
}
|
package/src/ui/format.js
CHANGED
|
@@ -32,9 +32,9 @@ export function approvalMode({ readOnly, approveWrites, approveCommands }) {
|
|
|
32
32
|
if (approveCommands)
|
|
33
33
|
return {
|
|
34
34
|
tone: "warning",
|
|
35
|
-
short: approveWrites ? "
|
|
35
|
+
short: approveWrites ? "Fuck it Mode" : "commands auto-approved",
|
|
36
36
|
long: approveWrites
|
|
37
|
-
? "
|
|
37
|
+
? "Fuck it Mode (edits and commands auto-approved)"
|
|
38
38
|
: "Commands auto-approved, edits ask",
|
|
39
39
|
};
|
|
40
40
|
if (approveWrites)
|
package/src/ui/interactive.js
CHANGED
|
@@ -5,6 +5,9 @@ export async function createInteractiveMode(
|
|
|
5
5
|
runtime,
|
|
6
6
|
{ initialMessage, terminal } = {},
|
|
7
7
|
) {
|
|
8
|
+
// Pi is a pinned SDK dependency. Its standalone update command cannot update
|
|
9
|
+
// HermesDesk, so suppress the SDK's automatic release banner and changelog link.
|
|
10
|
+
process.env.PI_SKIP_VERSION_CHECK = "1";
|
|
8
11
|
const { InteractiveMode } = await loadPi();
|
|
9
12
|
return new InteractiveMode(runtime, {
|
|
10
13
|
verbose: false,
|