@hmharness/agent 0.14.18 → 0.14.20
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 +1 -0
- package/dist/i18n.js +2 -0
- package/dist/index.d.ts +1 -1
- package/dist/index.js +1 -1
- package/dist/runner.d.ts +8 -0
- package/dist/runner.js +10 -2
- package/package.json +2 -2
package/dist/i18n.d.ts
CHANGED
package/dist/i18n.js
CHANGED
|
@@ -58,6 +58,7 @@ const zh = {
|
|
|
58
58
|
cmdNewDone: '✓ 新会话开始(旧转录可用 Ctrl+T 回看)',
|
|
59
59
|
cmdFork: 'fork 当前会话为新线程(继承全部上下文)',
|
|
60
60
|
cmdCopy: '复制最后一条 AI 输出到剪贴板',
|
|
61
|
+
cmdExport: '一键导出整个会话为 Markdown 文件(~/.hmharness/exports/)',
|
|
61
62
|
cmdMouse: '切换全时鼠标捕获(仅无滚轮翻译的终端需要;默认 ?1007 已覆盖大多数终端)',
|
|
62
63
|
cmdMouseOn: '🖱 全时鼠标捕获已开启(滚轮直读;原生划选复制请按住 Shift 再拖动)',
|
|
63
64
|
cmdMouseOff: '🖱 全时鼠标捕获已关闭(滚轮走终端方向键翻译;划选复制恢复原生)',
|
|
@@ -207,6 +208,7 @@ const en = {
|
|
|
207
208
|
cmdNewDone: '✓ new session (old transcript: Ctrl+T to replay)',
|
|
208
209
|
cmdFork: 'fork this session to a new thread (inherits full context)',
|
|
209
210
|
cmdCopy: 'copy the last AI output to the clipboard',
|
|
211
|
+
cmdExport: 'export the whole session to a Markdown file (~/.hmharness/exports/)',
|
|
210
212
|
cmdMouse: 'toggle full-time mouse capture (only for terminals without wheel translation; ?1007 covers most)',
|
|
211
213
|
cmdMouseOn: '🖱 full-time mouse capture ON (direct wheel; hold Shift to select natively)',
|
|
212
214
|
cmdMouseOff: '🖱 full-time mouse capture OFF (wheel via terminal translation; native selection restored)',
|
package/dist/index.d.ts
CHANGED
|
@@ -5,7 +5,7 @@ export { mechanicalGate, parseVerdict, runPipeline, type PipelineOptions, type P
|
|
|
5
5
|
export { buildSystemPrompt } from './prompt.ts';
|
|
6
6
|
export { strings, type Locale, type Strings } from './i18n.ts';
|
|
7
7
|
export { makeSpawnTool, MAX_SPAWN_DEPTH, type SpawnBase } from './spawn.ts';
|
|
8
|
-
export { buildRegistry, contextPack, makeApproval, nativeRegistry, runAgentTask, spawnBase, toServerConfig, type AgentTaskOptions, type RunnerEvents, } from './runner.ts';
|
|
8
|
+
export { buildRegistry, contextPack, makeApproval, liveYolo, nativeRegistry, runAgentTask, spawnBase, toServerConfig, type AgentTaskOptions, type RunnerEvents, } from './runner.ts';
|
|
9
9
|
export * from './skills-conformance.ts';
|
|
10
10
|
export * from './acp.ts';
|
|
11
11
|
export * from './topology.ts';
|
package/dist/index.js
CHANGED
|
@@ -5,7 +5,7 @@ export { mechanicalGate, parseVerdict, runPipeline, } from "./pipeline.js";
|
|
|
5
5
|
export { buildSystemPrompt } from "./prompt.js";
|
|
6
6
|
export { strings } from "./i18n.js";
|
|
7
7
|
export { makeSpawnTool, MAX_SPAWN_DEPTH } from "./spawn.js";
|
|
8
|
-
export { buildRegistry, contextPack, makeApproval, nativeRegistry, runAgentTask, spawnBase, toServerConfig, } from "./runner.js";
|
|
8
|
+
export { buildRegistry, contextPack, makeApproval, liveYolo, nativeRegistry, runAgentTask, spawnBase, toServerConfig, } from "./runner.js";
|
|
9
9
|
export * from "./skills-conformance.js";
|
|
10
10
|
export * from "./acp.js";
|
|
11
11
|
export * from "./topology.js";
|
package/dist/runner.d.ts
CHANGED
|
@@ -66,6 +66,14 @@ export declare function loadApprovedRules(home: string): ApprovedRule[];
|
|
|
66
66
|
* path SEGMENT of the extension may be `..` (a boundary-only check missed
|
|
67
67
|
* `node scripts/sub/../../evil.js`, whose first differing segment is `sub`). */
|
|
68
68
|
export declare function matchesRule(rules: ApprovedRule[], toolName: string, args: Record<string, unknown>): boolean;
|
|
69
|
+
/** Live unattended-mode override (2026-09-25 user request: "YOLO 需要即时
|
|
70
|
+
* 生效"). Flipping this applies at the VERY NEXT approval ask of any running
|
|
71
|
+
* task - not only from the next session. The web /yolo command and the TUI
|
|
72
|
+
* /yolo toggle both write it AND persist via patchConfig, so it survives
|
|
73
|
+
* restarts (one selection = the standing default). */
|
|
74
|
+
export declare const liveYolo: {
|
|
75
|
+
on: boolean;
|
|
76
|
+
};
|
|
69
77
|
export declare function makeApproval(cfg: HmhConfig, yes: boolean, sharedRl?: readline.Interface): LoopApproval;
|
|
70
78
|
export interface RunnerEvents {
|
|
71
79
|
onLine?(line: string): void;
|
package/dist/runner.js
CHANGED
|
@@ -187,12 +187,18 @@ export function matchesRule(rules, toolName, args) {
|
|
|
187
187
|
}
|
|
188
188
|
});
|
|
189
189
|
}
|
|
190
|
+
/** Live unattended-mode override (2026-09-25 user request: "YOLO 需要即时
|
|
191
|
+
* 生效"). Flipping this applies at the VERY NEXT approval ask of any running
|
|
192
|
+
* task - not only from the next session. The web /yolo command and the TUI
|
|
193
|
+
* /yolo toggle both write it AND persist via patchConfig, so it survives
|
|
194
|
+
* restarts (one selection = the standing default). */
|
|
195
|
+
export const liveYolo = { on: false };
|
|
190
196
|
export function makeApproval(cfg, yes, sharedRl) {
|
|
191
197
|
const t = strings(cfg.locale ?? 'zh');
|
|
192
198
|
const home = homeDir();
|
|
193
199
|
return {
|
|
194
200
|
async ask(toolName, args) {
|
|
195
|
-
if (yes || cfg.approval === 'auto')
|
|
201
|
+
if (yes || cfg.approval === 'auto' || liveYolo.on)
|
|
196
202
|
return true;
|
|
197
203
|
// Persistent rules: patterns the user previously approved are auto-passed
|
|
198
204
|
if (matchesRule(loadApprovedRules(home), toolName, args))
|
|
@@ -307,8 +313,10 @@ export async function runAgentTask(opts) {
|
|
|
307
313
|
// YOLO fix: when yes=true the caller's approvalAsk (TUI dialog, web remote
|
|
308
314
|
// gate) must NOT override the auto-approve gate - it used to take
|
|
309
315
|
// precedence unconditionally, so /yolo was cosmetic (user-reported).
|
|
316
|
+
// 2026-09-25: the live toggle also gates a caller-supplied approvalAsk -
|
|
317
|
+
// the web remote gate is bypassed the moment /yolo goes on, mid-run too.
|
|
310
318
|
const approval = (opts.approvalAsk && !opts.yes)
|
|
311
|
-
? { ask: opts.approvalAsk }
|
|
319
|
+
? { ask: async (name, args) => (liveYolo.on ? true : opts.approvalAsk(name, args)) }
|
|
312
320
|
: makeApproval(cfg, opts.yes === true);
|
|
313
321
|
spawnBase.current = {
|
|
314
322
|
provider: resolveProvider(cfg, 'chat'),
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@hmharness/agent",
|
|
3
|
-
"version": "0.14.
|
|
3
|
+
"version": "0.14.20",
|
|
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",
|
|
@@ -18,7 +18,7 @@
|
|
|
18
18
|
"@hmharness/domain-harmony": "0.13.5",
|
|
19
19
|
"@hmharness/domain-ops": "0.8.0",
|
|
20
20
|
"@hmharness/evolution": "0.14.9",
|
|
21
|
-
"@hmharness/kernel": "0.9.
|
|
21
|
+
"@hmharness/kernel": "0.9.7",
|
|
22
22
|
"@hmharness/observability": "0.7.0",
|
|
23
23
|
"@hmharness/sandbox": "0.8.0"
|
|
24
24
|
},
|