@appchy/jarvis 0.1.107 → 0.1.109

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 CHANGED
@@ -2233,7 +2233,7 @@ Open Claude Code in a repo that has a work/ tree to see them.`);
2233
2233
  }
2234
2234
 
2235
2235
  // src/graph/hook.ts
2236
- import { existsSync as existsSync2, mkdirSync as mkdirSync2, readFileSync as readFileSync2, writeFileSync as writeFileSync2, chmodSync } from "fs";
2236
+ import { existsSync as existsSync2, mkdirSync as mkdirSync2, readFileSync as readFileSync2, statSync, writeFileSync as writeFileSync2, chmodSync } from "fs";
2237
2237
  import path10 from "path";
2238
2238
  var SIGNATURE = "# managed by jarvis";
2239
2239
  var SCRIPT = `#!/bin/sh
@@ -2262,11 +2262,12 @@ function findRepoRoot(from) {
2262
2262
  }
2263
2263
  }
2264
2264
  function installCommitHook(repoRoot) {
2265
- const dir = path10.join(repoRoot, ".git", "hooks");
2265
+ const git4 = path10.join(repoRoot, ".git");
2266
+ const dir = path10.join(git4, "hooks");
2266
2267
  const file = path10.join(dir, "post-commit");
2267
- if (!existsSync2(path10.join(repoRoot, ".git")) || !existsSync2(path10.join(repoRoot, ".git", "HEAD"))) {
2268
- return { installed: false, reason: "not-a-repo" };
2269
- }
2268
+ if (!existsSync2(git4)) return { installed: false, reason: "not-a-repo" };
2269
+ if (!statSync(git4).isDirectory()) return { installed: false, reason: "worktree" };
2270
+ if (!existsSync2(path10.join(git4, "HEAD"))) return { installed: false, reason: "not-a-repo" };
2270
2271
  if (existsSync2(file)) {
2271
2272
  try {
2272
2273
  if (!readFileSync2(file, "utf8").includes(SIGNATURE))
@@ -2290,6 +2291,9 @@ function describeCommitHook(outcome, repoRoot) {
2290
2291
  if (outcome.reason === "not-a-repo")
2291
2292
  return ` not a git repo, so there is no commit to rebuild on.
2292
2293
  Run this inside one, or rebuild by hand with 'jarvis build graph'.`;
2294
+ if (outcome.reason === "worktree")
2295
+ return ` this is a worktree or a submodule, and it shares the hooks of the checkout it
2296
+ was made from. Wire that one instead, or rebuild by hand with 'jarvis build graph'.`;
2293
2297
  if (outcome.reason === "foreign-hook")
2294
2298
  return ` a post-commit hook is already here and it is not ours \u2014 left untouched.
2295
2299
  Add this line to it to keep the map current: jarvis build graph >/dev/null 2>&1 &`;
@@ -2325,14 +2329,14 @@ function register4(program) {
2325
2329
  });
2326
2330
  }
2327
2331
  async function runInit(options = {}) {
2328
- const url = options.url ?? loadConfig()?.url;
2332
+ const url = options.url;
2329
2333
  const prompts = options.prompts ?? defaultPrompts();
2330
2334
  try {
2331
2335
  console.log("\n Jarvis setup");
2332
2336
  console.log(" \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\n");
2333
2337
  await setUpThisMachine(prompts);
2334
2338
  if (!url) {
2335
- reportLocalOnly();
2339
+ reportSetUp(loadConfig()?.url);
2336
2340
  return true;
2337
2341
  }
2338
2342
  console.log(` \u25B8 Pairing this machine [${url}]`);
@@ -2468,13 +2472,19 @@ function putItOnPath(dir) {
2468
2472
  export PATH="${dir}:$PATH"
2469
2473
  `;
2470
2474
  }
2471
- function reportLocalOnly() {
2475
+ function reportSetUp(joined) {
2472
2476
  console.log(" \u2714 Done. This machine works in any repo that has a work/ tree:");
2473
2477
  console.log(" the board, the map, the session block, the rules that arrive on edit,");
2474
2478
  console.log(" and 'jarvis serve' for any agent that speaks MCP.\n");
2475
2479
  console.log(" In a repo you have cloned: jarvis repo init");
2476
2480
  console.log(" jarvis build graph");
2477
2481
  console.log(" jarvis work list\n");
2482
+ if (joined) {
2483
+ console.log(` It joined ${joined} before, and still has it \u2014 setup does not`);
2484
+ console.log(" renew that standing, so nothing here went near it:");
2485
+ console.log(" jarvis pair renew this machine when a token expires\n");
2486
+ return;
2487
+ }
2478
2488
  console.log(" It has joined no jarvis instance, so it has no web surface and cannot");
2479
2489
  console.log(" start sessions on other machines. Both need one:");
2480
2490
  console.log(" jarvis init --url <address>\n");
@@ -3027,7 +3037,7 @@ function loadEnvFile(path23) {
3027
3037
 
3028
3038
  // ../../providers/anthropic/src/anthropic.agent.provider.ts
3029
3039
  import { execFile as execFile2 } from "child_process";
3030
- import { chmodSync as chmodSync2, existsSync as existsSync4, readFileSync as readFileSync3, readdirSync as readdirSync2, statSync } from "fs";
3040
+ import { chmodSync as chmodSync2, existsSync as existsSync4, readFileSync as readFileSync3, readdirSync as readdirSync2, statSync as statSync2 } from "fs";
3031
3041
  import { createRequire } from "module";
3032
3042
  import { randomUUID } from "crypto";
3033
3043
  import { homedir as homedir3 } from "os";
@@ -3087,7 +3097,7 @@ function ensureSpawnHelperIsExecutable() {
3087
3097
  "spawn-helper"
3088
3098
  );
3089
3099
  if (!existsSync4(helper)) return;
3090
- const mode = statSync(helper).mode;
3100
+ const mode = statSync2(helper).mode;
3091
3101
  if (mode & 73) return;
3092
3102
  chmodSync2(helper, mode | 493);
3093
3103
  } catch {
@@ -7590,7 +7600,7 @@ function leavesOf(ladder) {
7590
7600
  }
7591
7601
 
7592
7602
  // ../../packages/data/src/mcp/tools/cache.ts
7593
- import { statSync as statSync2 } from "fs";
7603
+ import { statSync as statSync3 } from "fs";
7594
7604
  import { resolve as resolve6 } from "path";
7595
7605
  var cache = /* @__PURE__ */ new WeakMap();
7596
7606
  async function cachedEnforcerDiags(ctx, freshPaths) {
@@ -7611,7 +7621,7 @@ function isFresh(snapshot, repoRoot, freshPaths) {
7611
7621
  for (const path23 of freshPaths) {
7612
7622
  let mtimeMs;
7613
7623
  try {
7614
- mtimeMs = statSync2(resolve6(repoRoot, path23)).mtimeMs;
7624
+ mtimeMs = statSync3(resolve6(repoRoot, path23)).mtimeMs;
7615
7625
  } catch {
7616
7626
  return false;
7617
7627
  }
@@ -10281,8 +10291,8 @@ import { createRequire as createRequire2 } from "module";
10281
10291
  var _require = createRequire2(import.meta.url);
10282
10292
  var VERSION2 = _require("../package.json").version ?? "0.0.0";
10283
10293
  var IS_DEV = String(_require("../package.json").name ?? "").endsWith("-dev");
10284
- var SHA = "3992b72";
10285
- var BUILT = "2026-09-11";
10294
+ var SHA = "fd09a8d";
10295
+ var BUILT = "2026-09-12";
10286
10296
  var BUILD = SHA ?? "source";
10287
10297
  var BUILD_LABEL = `${SHA ? `${VERSION2} (${SHA}${BUILT ? ` ${BUILT}` : ""})` : `${VERSION2} (source)`}${IS_DEV ? " \u2014 development build" : ""}`;
10288
10298
 
@@ -11310,7 +11320,7 @@ function register18(program) {
11310
11320
  }
11311
11321
 
11312
11322
  // src/graph/build.ts
11313
- import { mkdirSync as mkdirSync3, readFileSync as readFileSync7, rmSync, statSync as statSync3, writeFileSync as writeFileSync4 } from "fs";
11323
+ import { mkdirSync as mkdirSync3, readFileSync as readFileSync7, rmSync, statSync as statSync4, writeFileSync as writeFileSync4 } from "fs";
11314
11324
  import { dirname as dirname6, resolve as resolve8 } from "path";
11315
11325
 
11316
11326
  // src/graph/ratchet.ts
@@ -11535,7 +11545,7 @@ function acquireBuildLock(repoRoot, options = {}) {
11535
11545
  }
11536
11546
  function isStale(lockPath, staleMs) {
11537
11547
  try {
11538
- return Math.max(0, Date.now() - statSync3(lockPath).mtimeMs) >= staleMs;
11548
+ return Math.max(0, Date.now() - statSync4(lockPath).mtimeMs) >= staleMs;
11539
11549
  } catch {
11540
11550
  return true;
11541
11551
  }