hermesdesk-agent 0.1.0-alpha.3 → 0.1.0-alpha.4
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 +19 -5
- package/bin/hermesdesk.js +29 -4
- package/npm-shrinkwrap.json +2 -2
- package/package.json +1 -1
- package/src/agent.js +11 -8
- package/src/config.js +14 -5
- package/src/generation.js +48 -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.4.** 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.4.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
|
|
|
@@ -59,16 +59,30 @@ One-shot operation denies writes unless `--approve-writes` is explicitly provide
|
|
|
59
59
|
|
|
60
60
|
```powershell
|
|
61
61
|
hermesdesk.cmd config
|
|
62
|
+
hermesdesk.cmd config preset extended
|
|
62
63
|
hermesdesk.cmd config set thinking true
|
|
63
|
-
hermesdesk.cmd config set
|
|
64
|
-
hermesdesk.cmd config set
|
|
64
|
+
hermesdesk.cmd config set reasoningEffort xhigh
|
|
65
|
+
hermesdesk.cmd config set thinkingBudget 16384
|
|
66
|
+
hermesdesk.cmd config set context 262144
|
|
67
|
+
hermesdesk.cmd config set maxTokens 131072
|
|
65
68
|
hermesdesk.cmd config set temperature 0.7
|
|
66
69
|
hermesdesk.cmd config set topP 0.95
|
|
67
70
|
hermesdesk.cmd config set topK 20
|
|
68
71
|
hermesdesk.cmd config set maxRequests 64
|
|
69
72
|
```
|
|
70
73
|
|
|
71
|
-
|
|
74
|
+
Profiles: `fast` uses 32K with thinking off; `balanced` uses 64K with xhigh thinking; `extended` uses 131K with xhigh thinking. Thinking profiles use Qwen's recommended sampling (temperature 1, top-p .95, top-k 20). `thinkingBudget 0` is automatic. A positive budget is a ceiling, must be below `maxTokens`, and Strata may reduce it to preserve answer space. `maxTokens` includes **thinking plus the final answer**; the model can stop earlier.
|
|
75
|
+
|
|
76
|
+
For a single launch, without changing saved settings:
|
|
77
|
+
|
|
78
|
+
```powershell
|
|
79
|
+
hermesdesk.cmd chat --profile extended
|
|
80
|
+
hermesdesk.cmd run "Review this repository" --read-only --max-tokens 65536 --thinking on --reasoning-effort medium --thinking-budget 8192
|
|
81
|
+
```
|
|
82
|
+
|
|
83
|
+
Fresh installations default to a 131K total cap with thinking off. Existing saved values are retained: use `config preset extended` to switch to the tested thinking profile. The server must support these limits; older gateways capped output at 8K. Pi's compaction reserves space for the configured output budget.
|
|
84
|
+
|
|
85
|
+
Changes apply to the next launch. Context is client metadata, not a request to allocate more server context: keep it at or below the server's configured capacity. The updated gateway allows up to 131072 combined output tokens. Input, thinking and answer share the server context; the full 262K-thinking plus 131K-answer allowance in Qwen documentation assumes an extended 1M context. The default request budget is 64 per message and can be set from 1 to 512. Pi's in-chat settings are session-only in this version. Change the server using `hermesdesk connect --url https://your-server/v1`. HTTP is accepted only on loopback addresses.
|
|
72
86
|
|
|
73
87
|
Windows uses its built-in `curl.exe` for model HTTP requests because the retained Cloudflare bot filter challenged Node fetch and a native Node follow-up request during testing. TLS verification stays enabled, redirects are not followed, credentials are sent through stdin rather than command-line arguments, and disconnects cancel the request. `doctor` checks the connection without loading the model. A browser challenge from zone-wide Bot Fight Mode cannot be solved by an API client; the server owner must configure API-compatible protection. Transport compatibility alone does not guarantee that every computer will be accepted. Cold Strata startup can still take minutes; the client cannot remove server warm-up costs. A Cloudflare 403 is a connection failure, not a model error.
|
|
74
88
|
|
package/bin/hermesdesk.js
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import fs from "node:fs";
|
|
3
|
+
import { profile } from "../src/generation.js";
|
|
3
4
|
import path from "node:path";
|
|
4
5
|
import readline from "node:readline/promises";
|
|
5
6
|
import { parseArgs } from "node:util";
|
|
@@ -42,18 +43,26 @@ const help = `HermesDesk Agent ${VERSION} (Pi-based, Windows first)
|
|
|
42
43
|
hermesdesk chat [--cwd PATH] [--continue | --session ID] [--read-only]
|
|
43
44
|
hermesdesk run "REQUEST" [--cwd PATH] [--json] [--read-only]
|
|
44
45
|
hermesdesk sessions [--cwd PATH]
|
|
45
|
-
hermesdesk config [set KEY VALUE]
|
|
46
|
+
hermesdesk config [set KEY VALUE | preset fast|balanced|extended]
|
|
46
47
|
hermesdesk logout
|
|
47
48
|
|
|
48
49
|
Edits and shell commands ask for approval in interactive chat.
|
|
49
50
|
One-shot runs deny changes by default; --approve-writes permits workspace file edits.
|
|
50
51
|
Shell commands always require interactive approval. This is not an OS sandbox.
|
|
51
|
-
Settings: model, context, maxTokens
|
|
52
|
+
Settings: model, context, maxTokens (total thinking + answer), thinking,
|
|
53
|
+
reasoningEffort (low|medium|xhigh), thinkingBudget (0=automatic), temperature, topP, topK, maxRequests.
|
|
54
|
+
Run overrides: --profile fast|balanced|extended --max-tokens N --thinking on|off
|
|
55
|
+
--reasoning-effort low|medium|xhigh --thinking-budget N
|
|
52
56
|
`;
|
|
53
57
|
async function main() {
|
|
54
58
|
const { values: v, positionals: p } = parseArgs({
|
|
55
59
|
allowPositionals: true,
|
|
56
60
|
options: {
|
|
61
|
+
profile: { type: "string" },
|
|
62
|
+
"max-tokens": { type: "string" },
|
|
63
|
+
thinking: { type: "string" },
|
|
64
|
+
"reasoning-effort": { type: "string" },
|
|
65
|
+
"thinking-budget": { type: "string" },
|
|
57
66
|
url: { type: "string" },
|
|
58
67
|
code: { type: "boolean" },
|
|
59
68
|
manual: { type: "boolean" },
|
|
@@ -178,7 +187,9 @@ async function main() {
|
|
|
178
187
|
return;
|
|
179
188
|
}
|
|
180
189
|
if (command === "config") {
|
|
181
|
-
if (p[0] === "
|
|
190
|
+
if (p[0] === "preset") {
|
|
191
|
+
config = saveConfig({ ...config, ...profile(p[1]) }, home);
|
|
192
|
+
} else if (p[0] === "set") {
|
|
182
193
|
const key = p[1];
|
|
183
194
|
if (!Object.hasOwn(config, key) || key === "baseUrl")
|
|
184
195
|
throw Error(
|
|
@@ -187,7 +198,7 @@ async function main() {
|
|
|
187
198
|
const raw = p.slice(2).join(" ");
|
|
188
199
|
if (!raw) throw Error("Provide a setting value.");
|
|
189
200
|
let value = raw;
|
|
190
|
-
if (
|
|
201
|
+
if (!["model", "reasoningEffort"].includes(key)) {
|
|
191
202
|
try {
|
|
192
203
|
value = JSON.parse(raw);
|
|
193
204
|
} catch {
|
|
@@ -251,6 +262,20 @@ async function main() {
|
|
|
251
262
|
if (!models.includes(config.model)) process.exitCode = 1;
|
|
252
263
|
return;
|
|
253
264
|
}
|
|
265
|
+
const overrides = {};
|
|
266
|
+
if (v.profile) Object.assign(overrides, profile(v.profile));
|
|
267
|
+
if (v["max-tokens"] !== undefined)
|
|
268
|
+
overrides.maxTokens = Number(v["max-tokens"]);
|
|
269
|
+
if (v["thinking-budget"] !== undefined)
|
|
270
|
+
overrides.thinkingBudget = Number(v["thinking-budget"]);
|
|
271
|
+
if (v["reasoning-effort"] !== undefined)
|
|
272
|
+
overrides.reasoningEffort = v["reasoning-effort"];
|
|
273
|
+
if (v.thinking !== undefined) {
|
|
274
|
+
if (!["on", "off"].includes(v.thinking))
|
|
275
|
+
throw Error("Use --thinking on or --thinking off.");
|
|
276
|
+
overrides.thinking = v.thinking === "on";
|
|
277
|
+
}
|
|
278
|
+
config = validateConfig({ ...config, ...overrides });
|
|
254
279
|
const cwd = fs.realpathSync.native(v.cwd || process.cwd());
|
|
255
280
|
if (command === "chat" && (!process.stdin.isTTY || !process.stdout.isTTY))
|
|
256
281
|
throw Error(
|
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.4",
|
|
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.4",
|
|
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
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import fs from "node:fs";
|
|
2
|
+
import { generationPayload } from "./generation.js";
|
|
2
3
|
import path from "node:path";
|
|
3
4
|
import { projectSessionDir } from "./config.js";
|
|
4
5
|
import { searchTool } from "./search.js";
|
|
@@ -79,12 +80,7 @@ export async function createRuntime({
|
|
|
79
80
|
onPayload: async (payload, m) => {
|
|
80
81
|
const p = (await options?.onPayload?.(payload, m)) ?? payload;
|
|
81
82
|
delete p.store;
|
|
82
|
-
|
|
83
|
-
p.max_tokens = config.maxTokens;
|
|
84
|
-
p.temperature = config.temperature;
|
|
85
|
-
p.top_p = config.topP;
|
|
86
|
-
p.top_k = config.topK;
|
|
87
|
-
p.chat_template_kwargs = { enable_thinking: config.thinking };
|
|
83
|
+
Object.assign(p, generationPayload(config));
|
|
88
84
|
return p;
|
|
89
85
|
},
|
|
90
86
|
});
|
|
@@ -107,7 +103,10 @@ export async function createRuntime({
|
|
|
107
103
|
providerRetry: { maxRetries: 0, timeoutMs: 1800000 },
|
|
108
104
|
compaction: {
|
|
109
105
|
enabled: true,
|
|
110
|
-
reserveTokens: Math.min(
|
|
106
|
+
reserveTokens: Math.min(
|
|
107
|
+
config.context - 1024,
|
|
108
|
+
Math.max(config.maxTokens + 2048, 16384),
|
|
109
|
+
),
|
|
111
110
|
keepRecentTokens: Math.min(12000, Math.floor(config.context / 4)),
|
|
112
111
|
},
|
|
113
112
|
});
|
|
@@ -152,7 +151,11 @@ export async function createRuntime({
|
|
|
152
151
|
sessionManager,
|
|
153
152
|
sessionStartEvent,
|
|
154
153
|
model,
|
|
155
|
-
thinkingLevel: config.thinking
|
|
154
|
+
thinkingLevel: config.thinking
|
|
155
|
+
? config.reasoningEffort === "xhigh"
|
|
156
|
+
? "high"
|
|
157
|
+
: config.reasoningEffort
|
|
158
|
+
: "off",
|
|
156
159
|
customTools: [searchTool(target)],
|
|
157
160
|
tools: readOnly
|
|
158
161
|
? ["read", "ls", "search"]
|
package/src/config.js
CHANGED
|
@@ -2,12 +2,14 @@ import fs from "node:fs";
|
|
|
2
2
|
import os from "node:os";
|
|
3
3
|
import path from "node:path";
|
|
4
4
|
import crypto from "node:crypto";
|
|
5
|
-
export const VERSION = "0.1.0-alpha.
|
|
5
|
+
export const VERSION = "0.1.0-alpha.4";
|
|
6
6
|
export const DEFAULTS = {
|
|
7
7
|
baseUrl: null,
|
|
8
8
|
model: null,
|
|
9
9
|
context: 262144,
|
|
10
|
-
maxTokens:
|
|
10
|
+
maxTokens: 131072,
|
|
11
|
+
reasoningEffort: "xhigh",
|
|
12
|
+
thinkingBudget: 0,
|
|
11
13
|
thinking: false,
|
|
12
14
|
temperature: 0.7,
|
|
13
15
|
topP: 0.95,
|
|
@@ -53,14 +55,21 @@ export function validateConfig(input) {
|
|
|
53
55
|
throw Error("Invalid model ID.");
|
|
54
56
|
for (const [k, min, max] of [
|
|
55
57
|
["context", 8192, 1048576],
|
|
56
|
-
["maxTokens", 1,
|
|
58
|
+
["maxTokens", 1, 131072],
|
|
59
|
+
["thinkingBudget", 0, 131071],
|
|
57
60
|
["topK", 0, 1000],
|
|
58
61
|
["maxRequests", 1, 512],
|
|
59
62
|
])
|
|
60
63
|
if (!Number.isInteger(c[k]) || c[k] < min || c[k] > max)
|
|
61
64
|
throw Error(k + " must be an integer from " + min + " to " + max + ".");
|
|
62
|
-
if (
|
|
63
|
-
throw Error("
|
|
65
|
+
if (!["low", "medium", "xhigh"].includes(c.reasoningEffort))
|
|
66
|
+
throw Error("reasoningEffort must be low, medium or xhigh.");
|
|
67
|
+
if (c.thinkingBudget && c.thinkingBudget >= c.maxTokens)
|
|
68
|
+
throw Error("Thinking budget must be below the total output limit.");
|
|
69
|
+
if (c.maxTokens + 1024 >= c.context)
|
|
70
|
+
throw Error(
|
|
71
|
+
"Total output must leave at least 1024 context tokens for input.",
|
|
72
|
+
);
|
|
64
73
|
if (typeof c.thinking !== "boolean")
|
|
65
74
|
throw Error("thinking must be true or false.");
|
|
66
75
|
for (const [k, max] of [
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
export const PROFILES = Object.freeze({
|
|
2
|
+
fast: {
|
|
3
|
+
maxTokens: 32768,
|
|
4
|
+
thinking: false,
|
|
5
|
+
reasoningEffort: "xhigh",
|
|
6
|
+
thinkingBudget: 0,
|
|
7
|
+
temperature: 0.7,
|
|
8
|
+
topP: 0.8,
|
|
9
|
+
topK: 20,
|
|
10
|
+
},
|
|
11
|
+
balanced: {
|
|
12
|
+
maxTokens: 65536,
|
|
13
|
+
thinking: true,
|
|
14
|
+
reasoningEffort: "xhigh",
|
|
15
|
+
thinkingBudget: 0,
|
|
16
|
+
temperature: 1,
|
|
17
|
+
topP: 0.95,
|
|
18
|
+
topK: 20,
|
|
19
|
+
},
|
|
20
|
+
extended: {
|
|
21
|
+
maxTokens: 131072,
|
|
22
|
+
thinking: true,
|
|
23
|
+
reasoningEffort: "xhigh",
|
|
24
|
+
thinkingBudget: 0,
|
|
25
|
+
temperature: 1,
|
|
26
|
+
topP: 0.95,
|
|
27
|
+
topK: 20,
|
|
28
|
+
},
|
|
29
|
+
});
|
|
30
|
+
export function profile(name) {
|
|
31
|
+
if (!Object.hasOwn(PROFILES, name))
|
|
32
|
+
throw Error("Choose profile fast, balanced or extended.");
|
|
33
|
+
return PROFILES[name];
|
|
34
|
+
}
|
|
35
|
+
export function generationPayload(config) {
|
|
36
|
+
return {
|
|
37
|
+
max_tokens: config.maxTokens,
|
|
38
|
+
temperature: config.temperature,
|
|
39
|
+
top_p: config.topP,
|
|
40
|
+
top_k: config.topK,
|
|
41
|
+
reasoning_effort: config.thinking ? config.reasoningEffort : "none",
|
|
42
|
+
reasoning_budget_tokens: config.thinking ? config.thinkingBudget : 0,
|
|
43
|
+
min_p: 0,
|
|
44
|
+
presence_penalty: config.thinking ? 0 : 1.5,
|
|
45
|
+
repetition_penalty: 1,
|
|
46
|
+
chat_template_kwargs: { enable_thinking: config.thinking },
|
|
47
|
+
};
|
|
48
|
+
}
|