@hmharness/agent 0.23.53 → 0.23.55
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/dist/i18n.d.ts +4 -0
- package/dist/i18n.js +6 -0
- package/dist/tools.js +11 -3
- package/package.json +11 -11
package/dist/i18n.d.ts
CHANGED
|
@@ -197,5 +197,9 @@ export interface Strings {
|
|
|
197
197
|
webNotRunning: string;
|
|
198
198
|
webRunning: (pid: number, port: number) => string;
|
|
199
199
|
tuiWebLinked: (port: number) => string;
|
|
200
|
+
/** the evolution daemon rides with the web one: `web stop` stops it, `web status` reports it */
|
|
201
|
+
evoStopped: string;
|
|
202
|
+
evoRunning: (pid: number) => string;
|
|
203
|
+
evoNotRunning: string;
|
|
200
204
|
}
|
|
201
205
|
export declare function strings(locale?: Locale): Strings;
|
package/dist/i18n.js
CHANGED
|
@@ -167,6 +167,9 @@ const zh = {
|
|
|
167
167
|
webNotRunning: 'hmh web 未在运行',
|
|
168
168
|
webRunning: (pid, port) => `hmh web 运行中 (pid ${pid}) → http://127.0.0.1:${port}`,
|
|
169
169
|
tuiWebLinked: (port) => `网页端已就绪 → http://127.0.0.1:${port}(本对话可在浏览器继续;hmh web stop 停止)`,
|
|
170
|
+
evoStopped: '后台进化守护已停止(hmh web start 会重新拉起)',
|
|
171
|
+
evoRunning: (pid) => `后台进化守护运行中 (pid ${pid}) · hmh web stop 一并停止`,
|
|
172
|
+
evoNotRunning: '后台进化守护未在运行',
|
|
170
173
|
};
|
|
171
174
|
const en = {
|
|
172
175
|
replHint: 'type a task, or /exit to quit',
|
|
@@ -337,6 +340,9 @@ const en = {
|
|
|
337
340
|
webNotRunning: 'hmh web is not running',
|
|
338
341
|
webRunning: (pid, port) => `hmh web running (pid ${pid}) -> http://127.0.0.1:${port}`,
|
|
339
342
|
tuiWebLinked: (port) => `web UI ready -> http://127.0.0.1:${port} (this conversation continues in the browser; hmh web stop to stop)`,
|
|
343
|
+
evoStopped: 'evolution daemon stopped (hmh web start brings it back)',
|
|
344
|
+
evoRunning: (pid) => `evolution daemon running (pid ${pid}) · hmh web stop stops it too`,
|
|
345
|
+
evoNotRunning: 'evolution daemon is not running',
|
|
340
346
|
};
|
|
341
347
|
export function strings(locale = 'zh') {
|
|
342
348
|
return locale === 'en' ? en : zh;
|
package/dist/tools.js
CHANGED
|
@@ -5,8 +5,9 @@
|
|
|
5
5
|
* guard on obviously destructive one-liners; approvals live in the kernel.
|
|
6
6
|
*/
|
|
7
7
|
import { exec } from 'node:child_process';
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
8
|
+
import { existsSync } from 'node:fs';
|
|
9
|
+
import { copyFile, mkdir, readFile, readdir, writeFile } from 'node:fs/promises';
|
|
10
|
+
import { dirname, isAbsolute, join, resolve } from 'node:path';
|
|
10
11
|
import { promisify } from 'node:util';
|
|
11
12
|
import { chatVision, homeDir, isBareProbe, isVisionRefusal, loadConfig, visionProviderChain } from '@hmharness/kernel';
|
|
12
13
|
import { cognitiveQueryTool } from "./cognitive-tools.js";
|
|
@@ -70,8 +71,15 @@ export const writeFileTool = {
|
|
|
70
71
|
const bak = p + '.bak-' + new Date().toISOString().replace(/[:.]/g, '-');
|
|
71
72
|
await copyFile(p, bak).then(() => { backupNote = ` (backup: ${bak})`; }).catch(() => { });
|
|
72
73
|
}
|
|
74
|
+
// a new file in a folder that does not exist yet is the normal shape of new
|
|
75
|
+
// work (a first module under a new directory). Until 0.23.55 it failed with
|
|
76
|
+
// ENOENT and cost a round trip through a shell mkdir - a dead end without one
|
|
77
|
+
const parent = dirname(p);
|
|
78
|
+
const newDir = !existsSync(parent);
|
|
79
|
+
if (newDir)
|
|
80
|
+
await mkdir(parent, { recursive: true });
|
|
73
81
|
await writeFile(p, String(args.content ?? ''), 'utf8');
|
|
74
|
-
return { output: `wrote ${String(args.content ?? '').length} chars to ${p}${backupNote}` };
|
|
82
|
+
return { output: `wrote ${String(args.content ?? '').length} chars to ${p}${newDir ? ' (created directory ' + parent + ')' : ''}${backupNote}` };
|
|
75
83
|
}
|
|
76
84
|
catch (err) {
|
|
77
85
|
return { output: String(err), isError: true };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@hmharness/agent",
|
|
3
|
-
"version": "0.23.
|
|
3
|
+
"version": "0.23.55",
|
|
4
4
|
"description": "hmharness agent execution layer: base tools, system prompt, sub-agent spawn, and the shared task runner that frontends (cli, web) drive.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "dist/index.js",
|
|
@@ -15,16 +15,16 @@
|
|
|
15
15
|
"build": "tsc -p tsconfig.build.json"
|
|
16
16
|
},
|
|
17
17
|
"dependencies": {
|
|
18
|
-
"@hmharness/cognitive": "0.23.
|
|
19
|
-
"@hmharness/domain-harmony": "0.23.
|
|
20
|
-
"@hmharness/domain-ops": "0.23.
|
|
21
|
-
"@hmharness/evolution": "0.23.
|
|
22
|
-
"@hmharness/kernel": "0.23.
|
|
23
|
-
"@hmharness/observability": "0.23.
|
|
24
|
-
"@hmharness/sandbox": "0.23.
|
|
25
|
-
"@hmharness/lsp": "0.23.
|
|
26
|
-
"@hmharness/browser": "0.23.
|
|
27
|
-
"@hmharness/extension": "0.23.
|
|
18
|
+
"@hmharness/cognitive": "0.23.55",
|
|
19
|
+
"@hmharness/domain-harmony": "0.23.55",
|
|
20
|
+
"@hmharness/domain-ops": "0.23.55",
|
|
21
|
+
"@hmharness/evolution": "0.23.55",
|
|
22
|
+
"@hmharness/kernel": "0.23.55",
|
|
23
|
+
"@hmharness/observability": "0.23.55",
|
|
24
|
+
"@hmharness/sandbox": "0.23.55",
|
|
25
|
+
"@hmharness/lsp": "0.23.55",
|
|
26
|
+
"@hmharness/browser": "0.23.55",
|
|
27
|
+
"@hmharness/extension": "0.23.55"
|
|
28
28
|
},
|
|
29
29
|
"files": [
|
|
30
30
|
"dist"
|