hanoman 0.9.22 → 0.9.23
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/build-info.json +3 -3
- package/dist/cli.js +9 -6
- package/dist/server.js +19 -15
- package/package.json +1 -1
package/dist/build-info.json
CHANGED
package/dist/cli.js
CHANGED
|
@@ -15518,7 +15518,7 @@ function repairSpawnHelper(resolve6, notify) {
|
|
|
15518
15518
|
mode: (p3) => statSync(p3).mode,
|
|
15519
15519
|
chmod: (p3, m) => chmodSync(p3, m)
|
|
15520
15520
|
});
|
|
15521
|
-
if (fixed.length) notify?.("hanoman \xB7 memperbaiki izin `spawn-helper` node-pty (
|
|
15521
|
+
if (fixed.length) notify?.("hanoman \xB7 memperbaiki izin `spawn-helper` node-pty (hilang setelah pemasangan/pembaruan paket)\n");
|
|
15522
15522
|
return fixed;
|
|
15523
15523
|
}
|
|
15524
15524
|
var init_spawn_helper = __esm({
|
|
@@ -15781,6 +15781,7 @@ __export(update_exports, {
|
|
|
15781
15781
|
planUpdate: () => planUpdate
|
|
15782
15782
|
});
|
|
15783
15783
|
import { execFileSync as execFileSync2 } from "node:child_process";
|
|
15784
|
+
import { createRequire } from "node:module";
|
|
15784
15785
|
function planUpdate(current, latest) {
|
|
15785
15786
|
if (!latest) return { action: "unknown", current, latest: null };
|
|
15786
15787
|
return compareSemver(latest, current) > 0 ? { action: "install", current, latest } : { action: "up-to-date", current, latest };
|
|
@@ -15823,6 +15824,7 @@ async function update(argv, ctx) {
|
|
|
15823
15824
|
ctx.stderr("npm i -g gagal \u2014 jalankan manual (mungkin butuh sudo)\n");
|
|
15824
15825
|
return 1;
|
|
15825
15826
|
}
|
|
15827
|
+
repairSpawnHelper(createRequire(import.meta.url).resolve, ctx.stdout);
|
|
15826
15828
|
ctx.stdout(`terpasang hanoman ${plan.latest} \xB7 restart instance yang berjalan
|
|
15827
15829
|
`);
|
|
15828
15830
|
return 0;
|
|
@@ -15832,6 +15834,7 @@ var init_update = __esm({
|
|
|
15832
15834
|
"src/commands/update.ts"() {
|
|
15833
15835
|
"use strict";
|
|
15834
15836
|
init_src();
|
|
15837
|
+
init_src2();
|
|
15835
15838
|
init_router();
|
|
15836
15839
|
PKG = "hanoman";
|
|
15837
15840
|
INSTALL_ARGS = ["i", "-g", `${PKG}@latest`, "--prefer-online"];
|
|
@@ -15857,7 +15860,7 @@ __export(start_exports, {
|
|
|
15857
15860
|
spawnEnv: () => spawnEnv
|
|
15858
15861
|
});
|
|
15859
15862
|
import { spawn, execFileSync as execFileSync3 } from "node:child_process";
|
|
15860
|
-
import { createRequire } from "node:module";
|
|
15863
|
+
import { createRequire as createRequire2 } from "node:module";
|
|
15861
15864
|
import { existsSync as existsSync3, mkdirSync as mkdirSync2, chmodSync as chmodSync3 } from "node:fs";
|
|
15862
15865
|
import { dirname as dirname4, resolve as resolvePath } from "node:path";
|
|
15863
15866
|
import { fileURLToPath } from "node:url";
|
|
@@ -15903,7 +15906,7 @@ function distDir() {
|
|
|
15903
15906
|
return dirname4(fileURLToPath(import.meta.url));
|
|
15904
15907
|
}
|
|
15905
15908
|
function runPrisma(args, dbUrl) {
|
|
15906
|
-
const prismaCli = prismaCliPath(
|
|
15909
|
+
const prismaCli = prismaCliPath(createRequire2(import.meta.url).resolve);
|
|
15907
15910
|
try {
|
|
15908
15911
|
const out = execFileSync3(process.execPath, [prismaCli, ...args], {
|
|
15909
15912
|
env: { ...process.env, DATABASE_URL: dbUrl },
|
|
@@ -15952,7 +15955,7 @@ async function ensurePrismaClient(schema, dbUrl, ctx) {
|
|
|
15952
15955
|
}
|
|
15953
15956
|
}
|
|
15954
15957
|
function repairSpawnHelperEarly(ctx) {
|
|
15955
|
-
repairSpawnHelper(
|
|
15958
|
+
repairSpawnHelper(createRequire2(import.meta.url).resolve, ctx.stdout);
|
|
15956
15959
|
}
|
|
15957
15960
|
function planSupervisorStep(code, restartsUsed, configRestartsUsed = 0) {
|
|
15958
15961
|
if (code === MANUAL_RESTART_EXIT) return { action: "restart" };
|
|
@@ -38289,10 +38292,10 @@ var init_verify_packed = __esm({
|
|
|
38289
38292
|
});
|
|
38290
38293
|
|
|
38291
38294
|
// src/router.ts
|
|
38292
|
-
import { createRequire as
|
|
38295
|
+
import { createRequire as createRequire3 } from "node:module";
|
|
38293
38296
|
function currentVersion() {
|
|
38294
38297
|
try {
|
|
38295
|
-
return
|
|
38298
|
+
return createRequire3(import.meta.url)("../package.json").version ?? "0.0.0";
|
|
38296
38299
|
} catch {
|
|
38297
38300
|
return "0.0.0";
|
|
38298
38301
|
}
|
package/dist/server.js
CHANGED
|
@@ -19528,22 +19528,25 @@ function repairSpawnHelper(resolve24, notify) {
|
|
|
19528
19528
|
mode: (p3) => statSync(p3).mode,
|
|
19529
19529
|
chmod: (p3, m) => chmodSync3(p3, m)
|
|
19530
19530
|
});
|
|
19531
|
-
if (fixed.length) notify?.("hanoman \xB7 memperbaiki izin `spawn-helper` node-pty (
|
|
19531
|
+
if (fixed.length) notify?.("hanoman \xB7 memperbaiki izin `spawn-helper` node-pty (hilang setelah pemasangan/pembaruan paket)\n");
|
|
19532
19532
|
return fixed;
|
|
19533
19533
|
}
|
|
19534
|
-
function
|
|
19535
|
-
if (repaired) return [];
|
|
19536
|
-
repaired = true;
|
|
19534
|
+
function ensureSpawnHelper(resolve24, notify) {
|
|
19537
19535
|
return repairSpawnHelper(resolve24, notify);
|
|
19538
19536
|
}
|
|
19539
|
-
function
|
|
19540
|
-
|
|
19537
|
+
function spawnWithHelperRecovery(doSpawn, repair) {
|
|
19538
|
+
repair();
|
|
19539
|
+
try {
|
|
19540
|
+
return doSpawn();
|
|
19541
|
+
} catch (e) {
|
|
19542
|
+
if (!String(e?.message ?? e).includes("posix_spawnp")) throw e;
|
|
19543
|
+
if (repair().length === 0) throw e;
|
|
19544
|
+
return doSpawn();
|
|
19545
|
+
}
|
|
19541
19546
|
}
|
|
19542
|
-
var repaired;
|
|
19543
19547
|
var init_spawn_helper = __esm({
|
|
19544
19548
|
"../runner/src/spawn-helper.ts"() {
|
|
19545
19549
|
"use strict";
|
|
19546
|
-
repaired = false;
|
|
19547
19550
|
}
|
|
19548
19551
|
});
|
|
19549
19552
|
|
|
@@ -20055,7 +20058,7 @@ __export(src_exports, {
|
|
|
20055
20058
|
defaultGoalCondition: () => defaultGoalCondition,
|
|
20056
20059
|
deleteSkillDir: () => deleteSkillDir,
|
|
20057
20060
|
deleteSkillEntry: () => deleteSkillEntry,
|
|
20058
|
-
|
|
20061
|
+
ensureSpawnHelper: () => ensureSpawnHelper,
|
|
20059
20062
|
ensureSpawnHelpersExecutable: () => ensureSpawnHelpersExecutable,
|
|
20060
20063
|
executeAgentEvaluation: () => executeAgentEvaluation,
|
|
20061
20064
|
formatConfigEnv: () => formatConfigEnv,
|
|
@@ -20093,7 +20096,6 @@ __export(src_exports, {
|
|
|
20093
20096
|
renderAgentsJson: () => renderAgentsJson,
|
|
20094
20097
|
renderCodexAgentToml: () => renderCodexAgentToml,
|
|
20095
20098
|
repairSpawnHelper: () => repairSpawnHelper,
|
|
20096
|
-
resetSpawnHelperMemo: () => resetSpawnHelperMemo,
|
|
20097
20099
|
resolveDataDirs: () => resolveDataDirs,
|
|
20098
20100
|
resolveDbUrl: () => resolveDbUrl,
|
|
20099
20101
|
resolveDeployment: () => resolveDeployment,
|
|
@@ -20112,6 +20114,7 @@ __export(src_exports, {
|
|
|
20112
20114
|
skillTree: () => skillTree,
|
|
20113
20115
|
skillsUnder: () => skillsUnder,
|
|
20114
20116
|
spawnHelperPaths: () => spawnHelperPaths,
|
|
20117
|
+
spawnWithHelperRecovery: () => spawnWithHelperRecovery,
|
|
20115
20118
|
specContext: () => specContext,
|
|
20116
20119
|
startBreakdownPrompt: () => startBreakdownPrompt,
|
|
20117
20120
|
startGoalPrompt: () => startGoalPrompt,
|
|
@@ -48439,14 +48442,15 @@ function detachAll() {
|
|
|
48439
48442
|
for (const id2 of [...attached.keys()]) drop(id2);
|
|
48440
48443
|
}
|
|
48441
48444
|
function spawnPty(...args) {
|
|
48442
|
-
|
|
48445
|
+
const resolve24 = createRequire(import.meta.url).resolve;
|
|
48446
|
+
const repair = () => ensureSpawnHelper(resolve24, (m) => process.stdout.write(m));
|
|
48443
48447
|
try {
|
|
48444
|
-
return spawn("tmux", ["-L", socket(), "-f", "/dev/null", ...args], {
|
|
48448
|
+
return spawnWithHelperRecovery(() => spawn("tmux", ["-L", socket(), "-f", "/dev/null", ...args], {
|
|
48445
48449
|
name: "xterm-256color",
|
|
48446
48450
|
cols: 80,
|
|
48447
48451
|
rows: 24,
|
|
48448
48452
|
env: process.env
|
|
48449
|
-
});
|
|
48453
|
+
}), repair);
|
|
48450
48454
|
} catch (e) {
|
|
48451
48455
|
const msg = e.message;
|
|
48452
48456
|
if (!msg.includes("posix_spawnp")) throw e;
|
|
@@ -81808,12 +81812,12 @@ async function escalateTask(task, opts2) {
|
|
|
81808
81812
|
const spec2 = await prisma.spec.findUnique({ where: { id: task.specId } });
|
|
81809
81813
|
if (spec2) {
|
|
81810
81814
|
if (task.projectId === spec2.projectId) return { spec: spec2, task, created: false };
|
|
81811
|
-
const
|
|
81815
|
+
const repaired = await prisma.task.update({
|
|
81812
81816
|
where: { id: task.id },
|
|
81813
81817
|
data: { projectId: spec2.projectId }
|
|
81814
81818
|
});
|
|
81815
81819
|
await notifySynced("task", task.id);
|
|
81816
|
-
return { spec: spec2, task:
|
|
81820
|
+
return { spec: spec2, task: repaired, created: false };
|
|
81817
81821
|
}
|
|
81818
81822
|
}
|
|
81819
81823
|
const member = task.memberId ? await prisma.member.findUnique({ where: { id: task.memberId } }) : null;
|