@hmharness/agent 0.14.19 → 0.14.21
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 +4 -0
- package/dist/index.d.ts +12 -12
- package/dist/index.js +1 -1
- package/dist/runner.d.ts +9 -1
- package/dist/runner.js +10 -2
- package/package.json +7 -7
package/dist/i18n.d.ts
CHANGED
|
@@ -139,6 +139,10 @@ export interface Strings {
|
|
|
139
139
|
tuiPassRate: (pct: string) => string;
|
|
140
140
|
tuiStatus: (locale: string, skills: number, model: string) => string;
|
|
141
141
|
tuiSkills: string;
|
|
142
|
+
/** persistent header badge for the current approval mode (2026-09-25:
|
|
143
|
+
* users must SEE which mode is running, not guess) */
|
|
144
|
+
modeAsk: string;
|
|
145
|
+
modePlan: string;
|
|
142
146
|
cmdHelp: string;
|
|
143
147
|
/** REPL feedback for a slash command that does not exist */
|
|
144
148
|
unknownCommand: (line: string) => string;
|
package/dist/i18n.js
CHANGED
|
@@ -118,6 +118,8 @@ const zh = {
|
|
|
118
118
|
tuiPassRate: (pct) => `pass rate: ${pct}`,
|
|
119
119
|
tuiStatus: (locale, skills, model) => `${locale} · ${skills} 技能 · ${model}`,
|
|
120
120
|
tuiSkills: '技能',
|
|
121
|
+
modeAsk: '逐条审批',
|
|
122
|
+
modePlan: '先计划',
|
|
121
123
|
cmdHelp: '命令帮助',
|
|
122
124
|
unknownCommand: (l) => `未知命令: ${l} (/help 查看全部)`,
|
|
123
125
|
cmdClearDone: '✓ 对话已清空,下一条任务从全新上下文开始',
|
|
@@ -268,6 +270,8 @@ const en = {
|
|
|
268
270
|
tuiPassRate: (pct) => `pass rate: ${pct}`,
|
|
269
271
|
tuiStatus: (locale, skills, model) => `${locale} · ${skills} skills · ${model}`,
|
|
270
272
|
tuiSkills: 'skills',
|
|
273
|
+
modeAsk: 'ask',
|
|
274
|
+
modePlan: 'plan',
|
|
271
275
|
cmdHelp: 'command help',
|
|
272
276
|
unknownCommand: (l) => `unknown command: ${l} (/help lists all)`,
|
|
273
277
|
cmdClearDone: '✓ conversation cleared; the next task starts a fresh context',
|
package/dist/index.d.ts
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
export { baseTools, readFileTool, writeFileTool, listDirTool, runCommandTool, rememberTool, seeImageTool } from './tools.
|
|
2
|
-
export { manifestFor, capabilityReport, authorize, type CapabilityManifest, type CapabilityRisk, type PolicyMode } from './capability.
|
|
3
|
-
export { checkpointProject, createProject, findProject, interruptProject, listProjects, loadProject, projectFor, releaseProject, restoreCheckpoint, resumeBundle, transitionProject, attachRun, newProjectId, type CheckpointRef, type DecisionEntry, type ProjectRecord, type ProjectState, } from './project.
|
|
4
|
-
export { mechanicalGate, parseVerdict, runPipeline, type PipelineOptions, type PipelineReport, type StageRecord, type StageRole, } from './pipeline.
|
|
5
|
-
export { buildSystemPrompt } from './prompt.
|
|
6
|
-
export { strings, type Locale, type Strings } from './i18n.
|
|
7
|
-
export { makeSpawnTool, MAX_SPAWN_DEPTH, type SpawnBase } from './spawn.
|
|
8
|
-
export { buildRegistry, contextPack, makeApproval, nativeRegistry, runAgentTask, spawnBase, toServerConfig, type AgentTaskOptions, type RunnerEvents, } from './runner.
|
|
9
|
-
export * from './skills-conformance.
|
|
10
|
-
export * from './acp.
|
|
11
|
-
export * from './topology.
|
|
12
|
-
export * from './meta-harness.
|
|
1
|
+
export { baseTools, readFileTool, writeFileTool, listDirTool, runCommandTool, rememberTool, seeImageTool } from './tools.js';
|
|
2
|
+
export { manifestFor, capabilityReport, authorize, type CapabilityManifest, type CapabilityRisk, type PolicyMode } from './capability.js';
|
|
3
|
+
export { checkpointProject, createProject, findProject, interruptProject, listProjects, loadProject, projectFor, releaseProject, restoreCheckpoint, resumeBundle, transitionProject, attachRun, newProjectId, type CheckpointRef, type DecisionEntry, type ProjectRecord, type ProjectState, } from './project.js';
|
|
4
|
+
export { mechanicalGate, parseVerdict, runPipeline, type PipelineOptions, type PipelineReport, type StageRecord, type StageRole, } from './pipeline.js';
|
|
5
|
+
export { buildSystemPrompt } from './prompt.js';
|
|
6
|
+
export { strings, type Locale, type Strings } from './i18n.js';
|
|
7
|
+
export { makeSpawnTool, MAX_SPAWN_DEPTH, type SpawnBase } from './spawn.js';
|
|
8
|
+
export { buildRegistry, contextPack, makeApproval, liveYolo, nativeRegistry, runAgentTask, spawnBase, toServerConfig, type AgentTaskOptions, type RunnerEvents, } from './runner.js';
|
|
9
|
+
export * from './skills-conformance.js';
|
|
10
|
+
export * from './acp.js';
|
|
11
|
+
export * from './topology.js';
|
|
12
|
+
export * from './meta-harness.js';
|
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
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
import { Registry, type ChatMessage, type DeltaKind, type HmhConfig, type LoopApproval, type LoopResult, type McpClient, type McpServerConfig, type McpServerImport, type ToolContext } from '@hmharness/kernel';
|
|
9
9
|
import { type EmbeddingProvider } from '@hmharness/evolution';
|
|
10
10
|
import * as readline from 'node:readline/promises';
|
|
11
|
-
import { type SpawnBase } from './spawn.
|
|
11
|
+
import { type SpawnBase } from './spawn.js';
|
|
12
12
|
/** Flatten the config.json shape into the runtime discriminated union. */
|
|
13
13
|
export declare function toServerConfig(c: McpServerImport): McpServerConfig;
|
|
14
14
|
/**
|
|
@@ -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.21",
|
|
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,12 +15,12 @@
|
|
|
15
15
|
"build": "tsc -p tsconfig.build.json"
|
|
16
16
|
},
|
|
17
17
|
"dependencies": {
|
|
18
|
-
"@hmharness/domain-harmony": "
|
|
19
|
-
"@hmharness/domain-ops": "
|
|
20
|
-
"@hmharness/evolution": "
|
|
21
|
-
"@hmharness/kernel": "
|
|
22
|
-
"@hmharness/observability": "
|
|
23
|
-
"@hmharness/sandbox": "
|
|
18
|
+
"@hmharness/domain-harmony": "*",
|
|
19
|
+
"@hmharness/domain-ops": "*",
|
|
20
|
+
"@hmharness/evolution": "*",
|
|
21
|
+
"@hmharness/kernel": "*",
|
|
22
|
+
"@hmharness/observability": "*",
|
|
23
|
+
"@hmharness/sandbox": "*"
|
|
24
24
|
},
|
|
25
25
|
"files": [
|
|
26
26
|
"dist"
|