@appchy/jarvis 0.1.54 → 0.1.56
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/bin.js +46 -7
- package/dist/bin.js.map +1 -1
- package/dist/ui/app.js +30 -30
- package/dist/ui/favicon.svg +10 -0
- package/dist/ui/index.html +3 -0
- package/harness/harness/safety.py +58 -0
- package/package.json +4 -4
package/dist/bin.js
CHANGED
|
@@ -2667,6 +2667,9 @@ function findBoardOrigin(workspacePath2) {
|
|
|
2667
2667
|
if (!branch) return null;
|
|
2668
2668
|
return { repo, branch };
|
|
2669
2669
|
}
|
|
2670
|
+
function currentBranch(workspacePath2) {
|
|
2671
|
+
return git(workspacePath2, ["branch", "--show-current"]) || null;
|
|
2672
|
+
}
|
|
2670
2673
|
function toRepoName(url) {
|
|
2671
2674
|
const match = /github\.com[:/]([^/]+)\/(.+?)(?:\.git)?\/?$/.exec(url.trim());
|
|
2672
2675
|
return match?.[1] && match[2] ? `${match[1]}/${match[2]}` : null;
|
|
@@ -9891,7 +9894,7 @@ import { createRequire as createRequire2 } from "module";
|
|
|
9891
9894
|
var _require = createRequire2(import.meta.url);
|
|
9892
9895
|
var VERSION2 = _require("../package.json").version ?? "0.0.0";
|
|
9893
9896
|
var IS_DEV = String(_require("../package.json").name ?? "").endsWith("-dev");
|
|
9894
|
-
var SHA = "
|
|
9897
|
+
var SHA = "6a59e47";
|
|
9895
9898
|
var BUILT = "2026-09-09";
|
|
9896
9899
|
var BUILD = SHA ?? "source";
|
|
9897
9900
|
var BUILD_LABEL = `${SHA ? `${VERSION2} (${SHA}${BUILT ? ` ${BUILT}` : ""})` : `${VERSION2} (source)`}${IS_DEV ? " \u2014 development build" : ""}`;
|
|
@@ -11975,22 +11978,48 @@ function register20(program) {
|
|
|
11975
11978
|
}
|
|
11976
11979
|
|
|
11977
11980
|
// src/commands/ui.ts
|
|
11978
|
-
import { basename as
|
|
11981
|
+
import { basename as basename3 } from "path";
|
|
11979
11982
|
|
|
11980
11983
|
// src/ui/server.ts
|
|
11981
11984
|
import { createServer as createServer2 } from "http";
|
|
11982
11985
|
import { readFile as readFile7 } from "fs/promises";
|
|
11983
|
-
import { basename, dirname as dirname7, extname, join as join9, resolve as resolve9 } from "path";
|
|
11986
|
+
import { basename as basename2, dirname as dirname7, extname, join as join9, resolve as resolve9 } from "path";
|
|
11984
11987
|
import { fileURLToPath as fileURLToPath4 } from "url";
|
|
11988
|
+
|
|
11989
|
+
// src/ui/machine.ts
|
|
11990
|
+
import { basename } from "path";
|
|
11991
|
+
async function readMachine(req) {
|
|
11992
|
+
const config2 = loadConfig();
|
|
11993
|
+
const health = await getHealth();
|
|
11994
|
+
return {
|
|
11995
|
+
version: BUILD_LABEL,
|
|
11996
|
+
configDir: getConfigDir(),
|
|
11997
|
+
repo: {
|
|
11998
|
+
name: basename(req.root),
|
|
11999
|
+
path: req.root,
|
|
12000
|
+
branch: currentBranch(req.root)
|
|
12001
|
+
},
|
|
12002
|
+
instance: health.app ? { url: health.app.url, envId: config2?.envId ?? null, reachable: health.app.reachable } : null,
|
|
12003
|
+
daemon: health.daemon,
|
|
12004
|
+
hooks: claudeCodeHooksState().map((hook) => ({
|
|
12005
|
+
type: hook.type,
|
|
12006
|
+
wired: hook.command !== void 0 && hook.command === hook.bin,
|
|
12007
|
+
...hook.command && hook.command !== hook.bin ? { command: hook.command } : {}
|
|
12008
|
+
}))
|
|
12009
|
+
};
|
|
12010
|
+
}
|
|
12011
|
+
|
|
12012
|
+
// src/ui/server.ts
|
|
11985
12013
|
var ASSETS = resolve9(dirname7(fileURLToPath4(import.meta.url)), "ui");
|
|
11986
12014
|
var TYPES = {
|
|
11987
12015
|
".html": "text/html; charset=utf-8",
|
|
11988
12016
|
".js": "text/javascript; charset=utf-8",
|
|
11989
12017
|
".css": "text/css; charset=utf-8",
|
|
11990
|
-
".map": "application/json; charset=utf-8"
|
|
12018
|
+
".map": "application/json; charset=utf-8",
|
|
12019
|
+
".svg": "image/svg+xml"
|
|
11991
12020
|
};
|
|
11992
12021
|
function named(html, repo) {
|
|
11993
|
-
return html.replace("<title>Jarvis</title>", `<title>${
|
|
12022
|
+
return html.replace("<title>Jarvis</title>", `<title>${basename2(repo).replace(/[<>]/g, "")} \xB7 Jarvis</title>`);
|
|
11994
12023
|
}
|
|
11995
12024
|
function context() {
|
|
11996
12025
|
return { requestId: `ui-${Date.now().toString(36)}`, userId: "local" };
|
|
@@ -12033,7 +12062,13 @@ async function asset(repo, url, res) {
|
|
|
12033
12062
|
const body = extname(path22) === ".html" ? Buffer.from(named(raw.toString("utf-8"), repo)) : raw;
|
|
12034
12063
|
res.writeHead(200, {
|
|
12035
12064
|
"content-type": TYPES[extname(path22)] ?? "application/octet-stream",
|
|
12036
|
-
"content-length": body.byteLength
|
|
12065
|
+
"content-length": body.byteLength,
|
|
12066
|
+
// The bundle's name never changes, so a cached copy is indistinguishable from the current
|
|
12067
|
+
// one and a browser will happily keep running the build you just replaced. That is the
|
|
12068
|
+
// shape of bug this repo has paid for twice — the half you look at is right — and here it
|
|
12069
|
+
// would mean upgrading the CLI and seeing no change, with nothing to say why. Re-reading a
|
|
12070
|
+
// local file costs nothing worth having.
|
|
12071
|
+
"cache-control": "no-store"
|
|
12037
12072
|
});
|
|
12038
12073
|
res.end(body);
|
|
12039
12074
|
} catch {
|
|
@@ -12060,6 +12095,10 @@ function serveUi(repo, port) {
|
|
|
12060
12095
|
else await board(repo, url, res);
|
|
12061
12096
|
return;
|
|
12062
12097
|
}
|
|
12098
|
+
if (url.pathname === "/api/v1/machine") {
|
|
12099
|
+
json(res, 200, await readMachine({ root: repo }));
|
|
12100
|
+
return;
|
|
12101
|
+
}
|
|
12063
12102
|
await asset(repo, url, res);
|
|
12064
12103
|
} catch (err) {
|
|
12065
12104
|
const status2 = err instanceof ServiceError ? err.statusCode : 500;
|
|
@@ -12094,7 +12133,7 @@ function register21(program) {
|
|
|
12094
12133
|
process.exitCode = 1;
|
|
12095
12134
|
return;
|
|
12096
12135
|
}
|
|
12097
|
-
console.log(`${
|
|
12136
|
+
console.log(`${basename3(repo)} \u2192 ${server.url}`);
|
|
12098
12137
|
console.log("Reading the board from this checkout. Ctrl-C to stop.");
|
|
12099
12138
|
if (opts.open !== false) openBrowser({ url: server.url });
|
|
12100
12139
|
await new Promise((done) => {
|