metaharness 0.2.2 → 0.2.4
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/writer.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"writer.d.ts","sourceRoot":"","sources":["../src/writer.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"writer.d.ts","sourceRoot":"","sources":["../src/writer.ts"],"names":[],"mappings":"AAWA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAEhD,MAAM,WAAW,YAAY;IAC3B,gFAAgF;IAChF,KAAK,CAAC,EAAE,OAAO,CAAC;CACjB;AAED;;;;;GAKG;AACH,wBAAsB,WAAW,CAC/B,SAAS,EAAE,MAAM,EACjB,KAAK,EAAE,YAAY,EAAE,EACrB,IAAI,GAAE,YAAiB,GACtB,OAAO,CAAC,MAAM,EAAE,CAAC,CA4CnB"}
|
package/dist/writer.js
CHANGED
|
@@ -4,10 +4,9 @@
|
|
|
4
4
|
// target directory. "Atomic" here means: stage everything in a temp dir,
|
|
5
5
|
// then rename to the target on success. A failure mid-stream leaves the
|
|
6
6
|
// target untouched.
|
|
7
|
-
import { mkdir, rename, rm, writeFile } from 'node:fs/promises';
|
|
7
|
+
import { cp, mkdir, rename, rm, writeFile } from 'node:fs/promises';
|
|
8
8
|
import { existsSync } from 'node:fs';
|
|
9
|
-
import { dirname, join } from 'node:path';
|
|
10
|
-
import { tmpdir } from 'node:os';
|
|
9
|
+
import { dirname, join, resolve } from 'node:path';
|
|
11
10
|
import { randomBytes } from 'node:crypto';
|
|
12
11
|
/**
|
|
13
12
|
* Write a RenderedFile[] to `targetDir`. Stages in a temp dir first; only
|
|
@@ -19,7 +18,13 @@ export async function writeAtomic(targetDir, files, opts = {}) {
|
|
|
19
18
|
if (existsSync(targetDir) && !opts.force) {
|
|
20
19
|
throw new Error(`${targetDir} already exists. Pass --force to overwrite.`);
|
|
21
20
|
}
|
|
22
|
-
|
|
21
|
+
// GH #42: stage ADJACENT to the target (same parent dir), not in os.tmpdir().
|
|
22
|
+
// On Windows the temp dir is often on a different drive (C:) than the target
|
|
23
|
+
// (D:), and `rename` across devices throws EXDEV. Staging next to the target
|
|
24
|
+
// keeps the rename on one filesystem, so it stays atomic AND cross-drive-safe.
|
|
25
|
+
const parent = dirname(resolve(targetDir));
|
|
26
|
+
await mkdir(parent, { recursive: true });
|
|
27
|
+
const staging = join(parent, `.create-agent-harness-${randomBytes(6).toString('hex')}`);
|
|
23
28
|
await mkdir(staging, { recursive: true });
|
|
24
29
|
try {
|
|
25
30
|
for (const f of files) {
|
|
@@ -30,8 +35,21 @@ export async function writeAtomic(targetDir, files, opts = {}) {
|
|
|
30
35
|
if (existsSync(targetDir) && opts.force) {
|
|
31
36
|
await rm(targetDir, { recursive: true, force: true });
|
|
32
37
|
}
|
|
33
|
-
|
|
34
|
-
|
|
38
|
+
try {
|
|
39
|
+
await rename(staging, targetDir);
|
|
40
|
+
}
|
|
41
|
+
catch (err) {
|
|
42
|
+
// Belt-and-suspenders: if the parent is itself a mount boundary (rename
|
|
43
|
+
// still EXDEV), fall back to a recursive copy + remove. Loses the atomic
|
|
44
|
+
// guarantee but completes the scaffold.
|
|
45
|
+
if (err?.code === 'EXDEV') {
|
|
46
|
+
await cp(staging, targetDir, { recursive: true });
|
|
47
|
+
await rm(staging, { recursive: true, force: true }).catch(() => { });
|
|
48
|
+
}
|
|
49
|
+
else {
|
|
50
|
+
throw err;
|
|
51
|
+
}
|
|
52
|
+
}
|
|
35
53
|
}
|
|
36
54
|
catch (err) {
|
|
37
55
|
// Best-effort cleanup; ignore failures in the cleanup itself.
|
package/dist/writer.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"writer.js","sourceRoot":"","sources":["../src/writer.ts"],"names":[],"mappings":"AAAA,+BAA+B;AAC/B,EAAE;AACF,wEAAwE;AACxE,yEAAyE;AACzE,wEAAwE;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,GAAE,CAAC,CAAC,CAAC;QACpE,MAAM,GAAG,CAAC;IACZ,CAAC;IAED,OAAO,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC;AAChC,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "metaharness",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.4",
|
|
4
4
|
"description": "MetaHarness — mint a custom AI agent harness from any repo. Browser Studio + `npx metaharness` CLI. Runs on Claude Code, Codex, pi.dev, Hermes, OpenClaw, RVM.",
|
|
5
5
|
"homepage": "https://github.com/ruvnet/agent-harness-generator",
|
|
6
6
|
"repository": {
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
{{description}}
|
|
4
4
|
|
|
5
|
-
> Generated with [`create-agent-harness`](https://github.com/ruvnet/agent-harness-generator) using the `vertical:devops` template.
|
|
5
|
+
> Generated with [`create-agent-harness`](https://github.com/ruvnet/agent-harness-generator) using the `vertical:devops` template. Multi-host scaffolding with a kernel that resolves native → wasm → js (js backend in the published beta; see `harness doctor`).
|
|
6
6
|
|
|
7
7
|
## Install
|
|
8
8
|
|