entropy-machines 0.1.3 → 0.1.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/bin/entropy-machines-init +41 -3
- package/package.json +1 -1
|
@@ -21,9 +21,15 @@
|
|
|
21
21
|
// against a clone does).
|
|
22
22
|
//
|
|
23
23
|
// Deliberately NOT here, because the owner deleted a 1072-line installer to
|
|
24
|
-
// get rid of them: managed blocks, hash fences, install receipts,
|
|
25
|
-
//
|
|
26
|
-
//
|
|
24
|
+
// get rid of them: managed blocks, hash fences, install receipts, an
|
|
25
|
+
// uninstall path, and any write into the user's .claude/ or CLAUDE.md.
|
|
26
|
+
// Undoing this is `rm -rf` of one directory.
|
|
27
|
+
//
|
|
28
|
+
// VERSION STAMPING is the one piece that came back: a .version file in the
|
|
29
|
+
// vendored directory lets `start` detect a stale copy and auto-update the
|
|
30
|
+
// harness code (bin/, lib/, etc.) without re-running bin/init or touching
|
|
31
|
+
// config.json. Without it, `npx entropy-machines start` after a version bump
|
|
32
|
+
// silently ran the old code and the user had to know to delete and re-vendor.
|
|
27
33
|
|
|
28
34
|
const fs = require('node:fs');
|
|
29
35
|
const path = require('node:path');
|
|
@@ -204,6 +210,9 @@ function init(argv) {
|
|
|
204
210
|
fs.copyFileSync(path.join(PKG_ROOT, 'LICENSE'), licenseDst);
|
|
205
211
|
}
|
|
206
212
|
|
|
213
|
+
// Stamp the version so `start` can detect a stale vendored copy.
|
|
214
|
+
fs.writeFileSync(path.join(dest, '.version'), PKG.version + '\n');
|
|
215
|
+
|
|
207
216
|
const shown = path.relative(root, dest) || '.';
|
|
208
217
|
console.log(`${GREEN}entropy-machines ${PKG.version}: vendored into ${dest}${RESET}`);
|
|
209
218
|
for (const d of HARNESS_DIRS) console.log(` ${DIM}${path.join(shown, d)}/${RESET}`);
|
|
@@ -257,6 +266,22 @@ function findHarness(root) {
|
|
|
257
266
|
return null;
|
|
258
267
|
}
|
|
259
268
|
|
|
269
|
+
// Re-copy harness code (bin/, lib/, etc.) without re-running bin/init or
|
|
270
|
+
// touching config.json. Called by start() when the vendored .version is older
|
|
271
|
+
// than the running package.
|
|
272
|
+
function updateHarness(loc) {
|
|
273
|
+
const dest = loc.dir;
|
|
274
|
+
for (const d of HARNESS_DIRS) {
|
|
275
|
+
fs.cpSync(path.join(PKG_ROOT, d), path.join(dest, d), {
|
|
276
|
+
recursive: true,
|
|
277
|
+
filter: copyFilter,
|
|
278
|
+
});
|
|
279
|
+
}
|
|
280
|
+
// LICENSE: overwrite — it's ours, not user-edited.
|
|
281
|
+
fs.copyFileSync(path.join(PKG_ROOT, 'LICENSE'), path.join(dest, 'LICENSE'));
|
|
282
|
+
fs.writeFileSync(path.join(dest, '.version'), PKG.version + '\n');
|
|
283
|
+
}
|
|
284
|
+
|
|
260
285
|
function start(argv) {
|
|
261
286
|
const root = repoRoot();
|
|
262
287
|
if (!root) die(['entropy-machines: not inside a git repository.']);
|
|
@@ -270,6 +295,19 @@ function start(argv) {
|
|
|
270
295
|
if (!loc) {
|
|
271
296
|
die(['entropy-machines: config.json not found at root or in ' + DEFAULT_DIR + '/.']);
|
|
272
297
|
}
|
|
298
|
+
|
|
299
|
+
// AUTO-UPDATE: if the vendored copy is older than this package, re-copy
|
|
300
|
+
// the harness code. config.json and the docs directory are untouched.
|
|
301
|
+
const versionFile = path.join(loc.dir, '.version');
|
|
302
|
+
let vendored = '';
|
|
303
|
+
try { vendored = fs.readFileSync(versionFile, 'utf8').trim(); } catch {}
|
|
304
|
+
if (vendored !== PKG.version) {
|
|
305
|
+
const from = vendored || 'unknown';
|
|
306
|
+
console.log(`${GREEN}entropy-machines: updating ${loc.shown}/ from ${from} → ${PKG.version}${RESET}`);
|
|
307
|
+
updateHarness(loc);
|
|
308
|
+
console.log(`${DIM} (config.json and docs left alone)${RESET}\n`);
|
|
309
|
+
}
|
|
310
|
+
|
|
273
311
|
const serve = path.join(loc.dir, 'bin', 'serve');
|
|
274
312
|
if (!fs.existsSync(serve)) {
|
|
275
313
|
die([`entropy-machines: ${path.join(loc.shown, 'bin', 'serve')} not found.`]);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "entropy-machines",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.4",
|
|
4
4
|
"description": "Vendors the entropy-machines agent-orchestration harness into your git repository as plain tracked files. A delivery mechanism, not a runtime — the harness is POSIX shell and Python 3 and needs no Node once the files have landed.",
|
|
5
5
|
"license": "Elastic-2.0",
|
|
6
6
|
"repository": {
|