lobstah 0.2.0 → 0.2.1
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/main.js +28 -17
- package/package.json +1 -1
package/dist/main.js
CHANGED
|
@@ -937,31 +937,42 @@ function onPath(bin, pathVar = process.env.PATH) {
|
|
|
937
937
|
}
|
|
938
938
|
return false;
|
|
939
939
|
}
|
|
940
|
-
function
|
|
940
|
+
function packagePresent(specifier, fromFile = import.meta.url) {
|
|
941
|
+
const require_2 = createRequire(fromFile);
|
|
941
942
|
try {
|
|
942
|
-
|
|
943
|
+
require_2.resolve(specifier);
|
|
943
944
|
return true;
|
|
944
945
|
} catch {
|
|
945
|
-
return false;
|
|
946
946
|
}
|
|
947
|
+
for (const dir of require_2.resolve.paths(specifier) ?? []) {
|
|
948
|
+
if (fs9.existsSync(path5.join(dir, specifier, "package.json")))
|
|
949
|
+
return true;
|
|
950
|
+
}
|
|
951
|
+
return false;
|
|
947
952
|
}
|
|
948
953
|
function detectHarnesses() {
|
|
949
954
|
const out = [];
|
|
950
|
-
if (onPath("claude") ||
|
|
955
|
+
if (onPath("claude") || packagePresent("@anthropic-ai/claude-agent-sdk"))
|
|
951
956
|
out.push("claude");
|
|
952
|
-
if (onPath("codex") ||
|
|
957
|
+
if (onPath("codex") || packagePresent("@openai/codex-sdk"))
|
|
953
958
|
out.push("codex");
|
|
954
959
|
return out;
|
|
955
960
|
}
|
|
956
961
|
function codexInvocation(argv) {
|
|
957
962
|
if (onPath("codex"))
|
|
958
963
|
return { file: "codex", argv };
|
|
964
|
+
const require_2 = createRequire(import.meta.url);
|
|
959
965
|
try {
|
|
960
|
-
const cli =
|
|
966
|
+
const cli = require_2.resolve("@openai/codex/bin/codex.js");
|
|
961
967
|
return { file: process.execPath, argv: [cli, ...argv] };
|
|
962
968
|
} catch {
|
|
963
|
-
return void 0;
|
|
964
969
|
}
|
|
970
|
+
for (const dir of require_2.resolve.paths("@openai/codex") ?? []) {
|
|
971
|
+
const cli = path5.join(dir, "@openai", "codex", "bin", "codex.js");
|
|
972
|
+
if (fs9.existsSync(cli))
|
|
973
|
+
return { file: process.execPath, argv: [cli, ...argv] };
|
|
974
|
+
}
|
|
975
|
+
return void 0;
|
|
965
976
|
}
|
|
966
977
|
|
|
967
978
|
// packages/core/dist/watch.js
|
|
@@ -2966,7 +2977,6 @@ full pattern and trade-offs: docs/lobsterman.md \xB7 config: docs/configuration.
|
|
|
2966
2977
|
|
|
2967
2978
|
// apps/cli/src/doctor.ts
|
|
2968
2979
|
import * as fs22 from "node:fs";
|
|
2969
|
-
import { createRequire as createRequire3 } from "node:module";
|
|
2970
2980
|
import { spawnSync as spawnSync2 } from "node:child_process";
|
|
2971
2981
|
var HEARTBEAT_STALE_MS2 = 9e4;
|
|
2972
2982
|
function git(repoPath, ...args) {
|
|
@@ -2982,12 +2992,7 @@ function runDoctor(now = Date.now()) {
|
|
|
2982
2992
|
const claude = onPath("claude");
|
|
2983
2993
|
push("harness claude", claude ? "ok" : "warn", claude ? "on PATH" : "claude not on PATH \u2014 claude dispatches will fail");
|
|
2984
2994
|
const codexPath = onPath("codex");
|
|
2985
|
-
|
|
2986
|
-
try {
|
|
2987
|
-
createRequire3(import.meta.url).resolve("@openai/codex-sdk");
|
|
2988
|
-
codexSdk = true;
|
|
2989
|
-
} catch {
|
|
2990
|
-
}
|
|
2995
|
+
const codexSdk = packagePresent("@openai/codex-sdk");
|
|
2991
2996
|
push(
|
|
2992
2997
|
"harness codex",
|
|
2993
2998
|
codexPath || codexSdk ? "ok" : "warn",
|
|
@@ -3233,6 +3238,14 @@ function appendRepoBlock(repo, opts = {}, file = configPath()) {
|
|
|
3233
3238
|
`);
|
|
3234
3239
|
}
|
|
3235
3240
|
|
|
3241
|
+
// apps/cli/src/report-args.ts
|
|
3242
|
+
function parseReportArgs(rest) {
|
|
3243
|
+
const prIndex = rest.indexOf("--pr");
|
|
3244
|
+
const prUrl = prIndex >= 0 ? rest[prIndex + 1] : void 0;
|
|
3245
|
+
const note = rest.filter((_, i) => prIndex < 0 || i !== prIndex && i !== prIndex + 1).join(" ") || void 0;
|
|
3246
|
+
return { note, prUrl };
|
|
3247
|
+
}
|
|
3248
|
+
|
|
3236
3249
|
// apps/cli/src/main.ts
|
|
3237
3250
|
var HELP = `lobstah \u2014 supervision framework for coding agents
|
|
3238
3251
|
|
|
@@ -3452,9 +3465,7 @@ async function mainCli() {
|
|
|
3452
3465
|
const [id, verb, ...rest] = args;
|
|
3453
3466
|
if (!id || !verb) throw new Error(`report requires an id and a verb (${VERBS.join("|")})`);
|
|
3454
3467
|
const lane = findLane(id);
|
|
3455
|
-
const
|
|
3456
|
-
const prUrl = prIndex >= 0 ? rest[prIndex + 1] : void 0;
|
|
3457
|
-
const note = rest.filter((_, i) => i !== prIndex && i !== prIndex + 1).join(" ") || void 0;
|
|
3468
|
+
const { note, prUrl } = parseReportArgs(rest);
|
|
3458
3469
|
const entry = appendStatus(id, lane, verb, note);
|
|
3459
3470
|
if (prUrl) mergeEvidence(id, lane, { prUrl });
|
|
3460
3471
|
console.log(toonKV({ id, verb: entry.verb, at: entry.at, ...prUrl ? { prUrl } : {} }));
|