@hmharness/agent 0.23.31 → 0.23.33

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/prompt.js CHANGED
@@ -29,7 +29,7 @@ export function buildSystemPrompt(opts) {
29
29
  // ---- 鸿蒙域 ----
30
30
  '', 'HarmonyOS development is your home domain: DevEco Studio toolchain, hvigor builds, ohpm packages, hdc devices, ArkTS/ArkUI, OpenHarmony and Cangjie. When a task touches it, prefer the harmony_* tools and precise toolchain knowledge.',
31
31
  // ---- 通用工作风格 ----
32
- '', 'Working style: read before writing; prefer small focused commands; verify results; state tradeoffs briefly. For risky operations (deleting, overwriting, publishing) say what will happen first. When a command fails twice with the same error, switch strategy instead of repeating it. For multi-line/quoted logic, write a temp .cjs file and run it with node - never fight cmd.exe quoting with node -e one-liners.');
32
+ '', 'Working style: read before writing; prefer small focused commands; verify results; state tradeoffs briefly. For risky operations (deleting, overwriting, publishing) say what will happen first. When a command fails twice with the same error, switch strategy instead of repeating it. For multi-line/quoted logic, write a temp .cjs file and run it with node - never fight cmd.exe quoting with node -e one-liners.', '', 'Anti re-verification: when you have already established a fact in this conversation (it is in your earlier text, in the rolling digest, or in a pruned-but-head-visible tool result), state it and move on — do NOT re-run the same search or command to "confirm" it again. Only re-check when you have concrete evidence the situation changed (a file was modified, a command failed differently). Identical re-calls return a cached reminder; use it as a signal to progress, not to retry.');
33
33
  // ---- AGENTS.md / CLAUDE.md / .cursorrules 注入(被动发现,不需模型主动调用) ----
34
34
  if (opts.agentsMd?.trim()) {
35
35
  parts.push('', '## Project-level instructions (AGENTS.md / CLAUDE.md / .cursorrules)', opts.agentsMd.trim());
package/dist/runner.js CHANGED
@@ -491,7 +491,12 @@ export async function runAgentTask(opts) {
491
491
  },
492
492
  }).catch((err) => {
493
493
  traj.finish({ success: false, reason: 'error', error: brief(String(err), 200) }, { toolUses: toolsUsed.length });
494
- throw err;
494
+ // The rollout EXISTS on disk (session/create + the user event were written
495
+ // before the loop started), but the throw used to hide its id from every
496
+ // caller — the TUI never bound currentSessionId on the error path, so
497
+ // /export said "nothing to export" and the next task silently forked a
498
+ // fresh session. Attach the id; error paths keep the thread bound.
499
+ throw Object.assign(err instanceof Error ? err : new Error(String(err)), { sessionId: session.id });
495
500
  });
496
501
  // the task ended (or died): late pushes must queue for the NEXT task instead
497
502
  // of silently vanishing into a channel nothing drains
package/package.json CHANGED
@@ -1,40 +1,40 @@
1
- {
2
- "name": "@hmharness/agent",
3
- "version": "0.23.31",
4
- "description": "hmharness agent execution layer: base tools, system prompt, sub-agent spawn, and the shared task runner that frontends (cli, web) drive.",
5
- "type": "module",
6
- "main": "dist/index.js",
7
- "types": "dist/index.d.ts",
8
- "exports": {
9
- ".": {
10
- "types": "./dist/index.d.ts",
11
- "default": "./dist/index.js"
12
- }
13
- },
14
- "scripts": {
15
- "build": "tsc -p tsconfig.build.json"
16
- },
17
- "dependencies": {
18
- "@hmharness/cognitive": "0.23.31",
19
- "@hmharness/domain-harmony": "0.23.31",
20
- "@hmharness/domain-ops": "0.23.31",
21
- "@hmharness/evolution": "0.23.31",
22
- "@hmharness/kernel": "0.23.31",
23
- "@hmharness/observability": "0.23.31",
24
- "@hmharness/sandbox": "0.23.31",
25
- "@hmharness/lsp": "0.23.31",
26
- "@hmharness/browser": "0.23.31",
27
- "@hmharness/extension": "0.23.31"
28
- },
29
- "files": [
30
- "dist"
31
- ],
32
- "license": "MIT",
33
- "repository": {
34
- "type": "git",
35
- "url": "git+https://github.com/swsgbl/hmharness.git"
36
- },
37
- "engines": {
38
- "node": ">=22"
39
- }
40
- }
1
+ {
2
+ "name": "@hmharness/agent",
3
+ "version": "0.23.33",
4
+ "description": "hmharness agent execution layer: base tools, system prompt, sub-agent spawn, and the shared task runner that frontends (cli, web) drive.",
5
+ "type": "module",
6
+ "main": "dist/index.js",
7
+ "types": "dist/index.d.ts",
8
+ "exports": {
9
+ ".": {
10
+ "types": "./dist/index.d.ts",
11
+ "default": "./dist/index.js"
12
+ }
13
+ },
14
+ "scripts": {
15
+ "build": "tsc -p tsconfig.build.json"
16
+ },
17
+ "dependencies": {
18
+ "@hmharness/cognitive": "0.23.33",
19
+ "@hmharness/domain-harmony": "0.23.33",
20
+ "@hmharness/domain-ops": "0.23.33",
21
+ "@hmharness/evolution": "0.23.33",
22
+ "@hmharness/kernel": "0.23.33",
23
+ "@hmharness/observability": "0.23.33",
24
+ "@hmharness/sandbox": "0.23.33",
25
+ "@hmharness/lsp": "0.23.33",
26
+ "@hmharness/browser": "0.23.33",
27
+ "@hmharness/extension": "0.23.33"
28
+ },
29
+ "files": [
30
+ "dist"
31
+ ],
32
+ "license": "MIT",
33
+ "repository": {
34
+ "type": "git",
35
+ "url": "git+https://github.com/swsgbl/hmharness.git"
36
+ },
37
+ "engines": {
38
+ "node": ">=22"
39
+ }
40
+ }