@hmharness/agent 0.23.51 → 0.23.53

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.
@@ -161,7 +161,7 @@ export class CognitiveRunRecorder {
161
161
  tags: ['run', success ? 'ok' : 'fail', traj.environment.id],
162
162
  });
163
163
  }
164
- const primary = [...written].sort((a, b) => b.traj.metrics.actions - a.traj.metrics.actions)[0];
164
+ const primary = written.toSorted((a, b) => b.traj.metrics.actions - a.traj.metrics.actions)[0];
165
165
  return { trajectoryId: primary.traj.id };
166
166
  }
167
167
  catch {
package/dist/gate.js CHANGED
@@ -49,7 +49,7 @@ export async function buildConditionedGate(home, tau) {
49
49
  const usable = all.filter((t) => t.steps.length > 0 && t.environment.id === 'terminal');
50
50
  // deterministic split (seed 1) — analysis-only, no decision leakage
51
51
  const rng = mulberry32(hashSeed('p2a-intervention-1'));
52
- const shuffled = [...usable].sort(() => rng() - 0.5);
52
+ const shuffled = usable.toSorted(() => rng() - 0.5);
53
53
  const train = shuffled.slice(0, Math.floor(shuffled.length * 0.7));
54
54
  const bump = (m, k, ok) => {
55
55
  const e = m.get(k) ?? { s: 0, f: 0 };
package/dist/project.js CHANGED
@@ -18,7 +18,7 @@
18
18
  import { appendFile, cp, mkdir, mkdtemp, readFile, readdir, rm, writeFile } from 'node:fs/promises';
19
19
  import { execFile as execCb } from 'node:child_process';
20
20
  import { tmpdir } from 'node:os';
21
- import { join, resolve } from 'node:path';
21
+ import { join, resolve, basename, relative } from 'node:path';
22
22
  import { sandbox } from '@hmharness/sandbox';
23
23
  /** blueprint lifecycle: created→active→paused(=resumable)→completed→archived */
24
24
  const TRANSITIONS = {
@@ -233,7 +233,10 @@ export async function restoreCheckpoint(home, rec, checkpointId) {
233
233
  const tarFile = join(dir, '..', `cp-${Date.now()}.tar`);
234
234
  await git(['archive', '--format=tar', `--output=${tarFile}`, cpRef.tree], { cwd: rec.workspace, timeoutMs: 120_000 });
235
235
  await new Promise((res, rej) => {
236
- execCb('tar', ['-xf', tarFile, '-C', dir], { timeout: 120_000, windowsHide: true }, (err) => err ? rej(err) : res());
236
+ // relative paths from the temp dir: an absolute `C:\…` argument makes GNU tar
237
+ // (first on PATH under Git Bash/MSYS) read the drive letter as a remote host
238
+ // ("tar: Cannot connect to C: resolve failed"); Windows' own bsdtar takes both
239
+ execCb('tar', ['-xf', basename(tarFile), '-C', relative(tmpdir(), dir)], { cwd: tmpdir(), timeout: 120_000, windowsHide: true }, (err) => err ? rej(err) : res());
237
240
  });
238
241
  await rm(tarFile, { force: true });
239
242
  }
package/dist/prompt.js CHANGED
@@ -1,4 +1,5 @@
1
1
  import { homedir } from 'node:os';
2
+ import { join } from 'node:path';
2
3
  export function buildSystemPrompt(opts) {
3
4
  const parts = [];
4
5
  const isWin = process.platform === 'win32';
@@ -43,7 +44,12 @@ export function buildSystemPrompt(opts) {
43
44
  parts.push('', '## Long-term memory', opts.memory.trim());
44
45
  }
45
46
  if (opts.skills.trim()) {
46
- parts.push('', '## Skill library', 'Read a skill file with read_file before applying it the first time.', opts.skills.trim());
47
+ // Where to read a skill body: the list lines carry only a sub-folder tag
48
+ // ([active] / [canary]); spell out tag → path under THIS home (an isolated
49
+ // HMH_HOME cannot be guessed). 2026-11-25: without this the model read a
50
+ // skill body in 1.9% of the sessions that had skills injected.
51
+ const skillsRoot = join(opts.home, 'skills');
52
+ parts.push('', '## Skill library', `Each skill is a SKILL.md file. Untagged entry: ${join(skillsRoot, '<name>', 'SKILL.md')}. Tagged entry [tag]: ${join(skillsRoot, '<tag>', '<name>', 'SKILL.md')}.`, 'Read the skill file with read_file before applying it the first time.', opts.skills.trim());
47
53
  }
48
54
  if (opts.insights.trim()) {
49
55
  parts.push('', '## Recent session outcomes (what worked / what failed)', opts.insights.trim());
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@hmharness/agent",
3
- "version": "0.23.51",
3
+ "version": "0.23.53",
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.51",
19
- "@hmharness/domain-harmony": "0.23.51",
20
- "@hmharness/domain-ops": "0.23.51",
21
- "@hmharness/evolution": "0.23.51",
22
- "@hmharness/kernel": "0.23.51",
23
- "@hmharness/observability": "0.23.51",
24
- "@hmharness/sandbox": "0.23.51",
25
- "@hmharness/lsp": "0.23.51",
26
- "@hmharness/browser": "0.23.51",
27
- "@hmharness/extension": "0.23.51"
18
+ "@hmharness/cognitive": "0.23.53",
19
+ "@hmharness/domain-harmony": "0.23.53",
20
+ "@hmharness/domain-ops": "0.23.53",
21
+ "@hmharness/evolution": "0.23.53",
22
+ "@hmharness/kernel": "0.23.53",
23
+ "@hmharness/observability": "0.23.53",
24
+ "@hmharness/sandbox": "0.23.53",
25
+ "@hmharness/lsp": "0.23.53",
26
+ "@hmharness/browser": "0.23.53",
27
+ "@hmharness/extension": "0.23.53"
28
28
  },
29
29
  "files": [
30
30
  "dist"