@appchy/jarvis 0.1.50 → 0.1.51

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
@@ -2694,13 +2694,35 @@ function publish(ctx, channel, payload2) {
2694
2694
  publisher(ctx, channel, payload2);
2695
2695
  }
2696
2696
 
2697
+ // src/graph/repo.ts
2698
+ import { homedir } from "os";
2699
+ import { dirname, resolve } from "path";
2700
+ import { fileURLToPath } from "url";
2701
+ function resolveVendor() {
2702
+ process.env["JARVIS_DATA_VENDOR"] ??= resolve(dirname(fileURLToPath(import.meta.url)), "data");
2703
+ return process.env["JARVIS_DATA_VENDOR"];
2704
+ }
2705
+ function resolveRepo(repo) {
2706
+ const cwd = repo ? resolve(process.cwd(), repo) : process.cwd();
2707
+ resolveVendor();
2708
+ loadEnvFile(resolve(cwd, ".env"));
2709
+ loadEnvFile(resolve(homedir(), ".jarvis", "data.env"));
2710
+ return cwd;
2711
+ }
2712
+ function loadEnvFile(path22) {
2713
+ try {
2714
+ process.loadEnvFile(path22);
2715
+ } catch {
2716
+ }
2717
+ }
2718
+
2697
2719
  // ../../providers/anthropic/src/anthropic.agent.provider.ts
2698
2720
  import { execFile as execFile2 } from "child_process";
2699
2721
  import { chmodSync, existsSync as existsSync3, readFileSync as readFileSync2, readdirSync as readdirSync2, statSync } from "fs";
2700
2722
  import { createRequire } from "module";
2701
2723
  import { randomUUID } from "crypto";
2702
- import { homedir } from "os";
2703
- import { dirname, join } from "path";
2724
+ import { homedir as homedir2 } from "os";
2725
+ import { dirname as dirname2, join } from "path";
2704
2726
  import { promisify as promisify2 } from "util";
2705
2727
  var run2 = promisify2(execFile2);
2706
2728
  var require2 = createRequire(import.meta.url);
@@ -2749,7 +2771,7 @@ function ensureSpawnHelperIsExecutable() {
2749
2771
  try {
2750
2772
  const entry = require2.resolve("node-pty");
2751
2773
  const helper = join(
2752
- dirname(entry),
2774
+ dirname2(entry),
2753
2775
  "..",
2754
2776
  "prebuilds",
2755
2777
  `${process.platform}-${process.arch}`,
@@ -2763,7 +2785,7 @@ function ensureSpawnHelperIsExecutable() {
2763
2785
  }
2764
2786
  }
2765
2787
  async function idOf(term) {
2766
- const entry = join(homedir(), ".claude", "sessions", `${term.pid}.json`);
2788
+ const entry = join(homedir2(), ".claude", "sessions", `${term.pid}.json`);
2767
2789
  for (let attempt = 0; attempt < 60; attempt++) {
2768
2790
  if (existsSync3(entry)) {
2769
2791
  try {
@@ -2777,7 +2799,7 @@ async function idOf(term) {
2777
2799
  throw new Error("Claude Code started but never registered a session id");
2778
2800
  }
2779
2801
  function candidatePaths2() {
2780
- const home = homedir();
2802
+ const home = homedir2();
2781
2803
  return [
2782
2804
  join(home, ".local", "bin", "claude"),
2783
2805
  join(home, ".claude", "local", "claude"),
@@ -2859,10 +2881,10 @@ function endedAs(exitCode, signal) {
2859
2881
  // ../../providers/anthropic/src/anthropic.session.provider.ts
2860
2882
  import { stat as fsStat } from "fs/promises";
2861
2883
  import { createReadStream, readdirSync as readdirSync3, readFileSync as readFileSync3 } from "fs";
2862
- import { homedir as homedir2 } from "os";
2884
+ import { homedir as homedir3 } from "os";
2863
2885
  import { join as join2 } from "path";
2864
2886
  import readline from "readline";
2865
- var LIVE = join2(homedir2(), ".claude", "sessions");
2887
+ var LIVE = join2(homedir3(), ".claude", "sessions");
2866
2888
  var LIVE_TTL_MS = 1e3;
2867
2889
  var live2 = null;
2868
2890
  function listLiveSessions() {
@@ -4781,17 +4803,17 @@ async function createWorkItem2(ctx, req, options) {
4781
4803
  // src/harness.ts
4782
4804
  import { spawnSync } from "child_process";
4783
4805
  import { existsSync as existsSync4 } from "fs";
4784
- import { dirname as dirname2, join as join4 } from "path";
4785
- import { fileURLToPath } from "url";
4806
+ import { dirname as dirname3, join as join4 } from "path";
4807
+ import { fileURLToPath as fileURLToPath2 } from "url";
4786
4808
  var ENTRY = join4("harness", "work.py");
4787
4809
  var INTERPRETERS = ["python3", "python"];
4788
4810
  var OLDEST = [3, 9];
4789
4811
  var INSTALLED = ["jarvis", "work"];
4790
4812
  function payload() {
4791
- let dir = dirname2(fileURLToPath(import.meta.url));
4813
+ let dir = dirname3(fileURLToPath2(import.meta.url));
4792
4814
  for (let up = 0; up < 6; up++) {
4793
4815
  if (existsSync4(join4(dir, ENTRY))) return join4(dir, ENTRY);
4794
- const parent = dirname2(dir);
4816
+ const parent = dirname3(dir);
4795
4817
  if (parent === dir) break;
4796
4818
  dir = parent;
4797
4819
  }
@@ -4950,7 +4972,7 @@ router.method("board.create", parseCreate, create);
4950
4972
 
4951
4973
  // ../../packages/data/src/finders/files.ts
4952
4974
  import { readFile as readFile2 } from "fs/promises";
4953
- import { relative as relative3, resolve } from "path";
4975
+ import { relative as relative3, resolve as resolve2 } from "path";
4954
4976
  import fg2 from "fast-glob";
4955
4977
 
4956
4978
  // ../../packages/data/src/frontmatter.ts
@@ -5883,13 +5905,13 @@ function edgeMatchesConfidence(edge, backendName, confidence) {
5883
5905
  // ../../packages/data/src/config.ts
5884
5906
  import { existsSync as existsSync5, readFileSync as readFileSync4 } from "fs";
5885
5907
  import { readFile as readFile4 } from "fs/promises";
5886
- import { dirname as dirname4, resolve as resolve3 } from "path";
5887
- import { fileURLToPath as fileURLToPath2 } from "url";
5908
+ import { dirname as dirname5, resolve as resolve4 } from "path";
5909
+ import { fileURLToPath as fileURLToPath3 } from "url";
5888
5910
  import { createJiti } from "jiti";
5889
5911
 
5890
5912
  // ../../packages/data/src/persistences/local.ts
5891
5913
  import { mkdir, readFile as readFile3, writeFile } from "fs/promises";
5892
- import { dirname as dirname3, join as join6, resolve as resolve2 } from "path";
5914
+ import { dirname as dirname4, join as join6, resolve as resolve3 } from "path";
5893
5915
  function localFiles(options = {}) {
5894
5916
  const root = options.root ?? ".data";
5895
5917
  const rel = {
@@ -5899,7 +5921,7 @@ function localFiles(options = {}) {
5899
5921
  state: options.state ?? "state.json",
5900
5922
  memory: options.memory ?? "memory.json"
5901
5923
  };
5902
- const pathOf = (ctx, key) => resolve2(
5924
+ const pathOf = (ctx, key) => resolve3(
5903
5925
  ctx.repoRoot,
5904
5926
  root,
5905
5927
  key.startsWith("plugin:") ? join6("plugins", `${key.slice(7)}.json`) : rel[key]
@@ -5915,7 +5937,7 @@ function localFiles(options = {}) {
5915
5937
  },
5916
5938
  save: async (ctx, key, bytes) => {
5917
5939
  const path22 = pathOf(ctx, key);
5918
- await mkdir(dirname3(path22), { recursive: true });
5940
+ await mkdir(dirname4(path22), { recursive: true });
5919
5941
  await writeFile(path22, bytes, "utf8");
5920
5942
  },
5921
5943
  locate: (ctx, key) => pathOf(ctx, key)
@@ -5931,10 +5953,10 @@ var CONFIG_NAMES = [
5931
5953
  "jarvis.config.cjs"
5932
5954
  ];
5933
5955
  async function loadConfig2(cwd) {
5934
- let dir = resolve3(cwd);
5956
+ let dir = resolve4(cwd);
5935
5957
  for (; ; ) {
5936
5958
  for (const name of CONFIG_NAMES) {
5937
- const path22 = resolve3(dir, name);
5959
+ const path22 = resolve4(dir, name);
5938
5960
  if (existsSync5(path22)) {
5939
5961
  const config2 = await importConfig(path22);
5940
5962
  validateConfig(config2, path22);
@@ -5945,7 +5967,7 @@ async function loadConfig2(cwd) {
5945
5967
  };
5946
5968
  }
5947
5969
  }
5948
- const parent = dirname4(dir);
5970
+ const parent = dirname5(dir);
5949
5971
  if (parent === dir) break;
5950
5972
  dir = parent;
5951
5973
  }
@@ -5961,17 +5983,17 @@ async function importConfig(path22) {
5961
5983
  }
5962
5984
  var PACKAGE_NAME = "@jarvis/data";
5963
5985
  function packageRoot() {
5964
- let dir = dirname4(fileURLToPath2(import.meta.url));
5986
+ let dir = dirname5(fileURLToPath3(import.meta.url));
5965
5987
  for (; ; ) {
5966
- if (existsSync5(resolve3(dir, "package.json"))) return dir;
5967
- const parent = dirname4(dir);
5988
+ if (existsSync5(resolve4(dir, "package.json"))) return dir;
5989
+ const parent = dirname5(dir);
5968
5990
  if (parent === dir) return dir;
5969
5991
  dir = parent;
5970
5992
  }
5971
5993
  }
5972
5994
  function selfAlias() {
5973
5995
  const root = packageRoot();
5974
- const pkg = JSON.parse(readFileSync4(resolve3(root, "package.json"), "utf8"));
5996
+ const pkg = JSON.parse(readFileSync4(resolve4(root, "package.json"), "utf8"));
5975
5997
  if (pkg.name !== PACKAGE_NAME) {
5976
5998
  const vendored = process.env[VENDOR_ENV];
5977
5999
  if (!vendored) {
@@ -5985,7 +6007,7 @@ function selfAlias() {
5985
6007
  for (const [subpath, entry] of Object.entries(pkg.exports ?? {})) {
5986
6008
  const target = typeof entry === "string" ? entry : entry.default;
5987
6009
  if (!target) continue;
5988
- alias[toSpecifier(subpath)] = resolve3(root, target);
6010
+ alias[toSpecifier(subpath)] = resolve4(root, target);
5989
6011
  }
5990
6012
  return alias;
5991
6013
  }
@@ -6001,8 +6023,8 @@ var VENDOR_SUBPATHS = [
6001
6023
  "stores"
6002
6024
  ];
6003
6025
  function toVendorAlias(dir) {
6004
- const alias = { [PACKAGE_NAME]: resolve3(dir, "index.mjs") };
6005
- for (const sub of VENDOR_SUBPATHS) alias[`${PACKAGE_NAME}/${sub}`] = resolve3(dir, `${sub}.mjs`);
6026
+ const alias = { [PACKAGE_NAME]: resolve4(dir, "index.mjs") };
6027
+ for (const sub of VENDOR_SUBPATHS) alias[`${PACKAGE_NAME}/${sub}`] = resolve4(dir, `${sub}.mjs`);
6006
6028
  return alias;
6007
6029
  }
6008
6030
  function toSpecifier(subpath) {
@@ -6614,7 +6636,7 @@ import { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js";
6614
6636
  // ../../packages/data/src/mcp/freshness.ts
6615
6637
  import { execFile as execFile6 } from "child_process";
6616
6638
  import { stat as stat2 } from "fs/promises";
6617
- import { resolve as resolve4 } from "path";
6639
+ import { resolve as resolve5 } from "path";
6618
6640
  import { promisify as promisify6 } from "util";
6619
6641
 
6620
6642
  // ../../packages/data/src/context.ts
@@ -6750,7 +6772,7 @@ async function fetchHeadIso(root) {
6750
6772
  const path22 = await git3(root, ["rev-parse", "--git-path", "FETCH_HEAD"]);
6751
6773
  if (!path22) return void 0;
6752
6774
  try {
6753
- return (await stat2(resolve4(root, path22))).mtime.toISOString();
6775
+ return (await stat2(resolve5(root, path22))).mtime.toISOString();
6754
6776
  } catch {
6755
6777
  return void 0;
6756
6778
  }
@@ -6784,7 +6806,7 @@ function nativeGraphJson(ctx) {
6784
6806
  async function freshness(ctx) {
6785
6807
  const root = ctx.config.repoRoot;
6786
6808
  const graphRel = nativeGraphJson(ctx) ?? ".data/graphify/graph.json";
6787
- const graphPath = resolve4(root, graphRel);
6809
+ const graphPath = resolve5(root, graphRel);
6788
6810
  let mtimeIso;
6789
6811
  let mtimeMs;
6790
6812
  try {
@@ -7235,7 +7257,7 @@ function leavesOf(ladder) {
7235
7257
 
7236
7258
  // ../../packages/data/src/mcp/tools/cache.ts
7237
7259
  import { statSync as statSync2 } from "fs";
7238
- import { resolve as resolve5 } from "path";
7260
+ import { resolve as resolve6 } from "path";
7239
7261
  var cache = /* @__PURE__ */ new WeakMap();
7240
7262
  async function cachedEnforcerDiags(ctx, freshPaths) {
7241
7263
  const hit = cache.get(ctx);
@@ -7255,7 +7277,7 @@ function isFresh(snapshot, repoRoot, freshPaths) {
7255
7277
  for (const path22 of freshPaths) {
7256
7278
  let mtimeMs;
7257
7279
  try {
7258
- mtimeMs = statSync2(resolve5(repoRoot, path22)).mtimeMs;
7280
+ mtimeMs = statSync2(resolve6(repoRoot, path22)).mtimeMs;
7259
7281
  } catch {
7260
7282
  return false;
7261
7283
  }
@@ -7905,7 +7927,7 @@ function hashText2(text) {
7905
7927
 
7906
7928
  // ../../packages/data/src/mcp/tools/read.ts
7907
7929
  import { readFile as readFile5 } from "fs/promises";
7908
- import { resolve as resolve6 } from "path";
7930
+ import { resolve as resolve7 } from "path";
7909
7931
 
7910
7932
  // ../../packages/data/src/meta.ts
7911
7933
  function stringMeta(metadata, path22) {
@@ -7969,7 +7991,7 @@ async function read2(ctx, req) {
7969
7991
  };
7970
7992
  }
7971
7993
  try {
7972
- const full = await readFile5(resolve6(ctx.config.repoRoot, rel), "utf8");
7994
+ const full = await readFile5(resolve7(ctx.config.repoRoot, rel), "utf8");
7973
7995
  const span = sectionSpan(node);
7974
7996
  const stripped = span ? parseFrontmatter2(full).body : full;
7975
7997
  const text = span ? reanchorSection(stripped, node.id) ?? stripped.slice(span[0], span[1]) : full;
@@ -9869,7 +9891,7 @@ import { createRequire as createRequire2 } from "module";
9869
9891
  var _require = createRequire2(import.meta.url);
9870
9892
  var VERSION2 = _require("../package.json").version ?? "0.0.0";
9871
9893
  var IS_DEV = String(_require("../package.json").name ?? "").endsWith("-dev");
9872
- var SHA = "de4a370";
9894
+ var SHA = "debf214";
9873
9895
  var BUILT = "2026-09-09";
9874
9896
  var BUILD = SHA ?? "source";
9875
9897
  var BUILD_LABEL = `${SHA ? `${VERSION2} (${SHA}${BUILT ? ` ${BUILT}` : ""})` : `${VERSION2} (source)`}${IS_DEV ? " \u2014 development build" : ""}`;
@@ -10183,6 +10205,7 @@ async function startAgent(options) {
10183
10205
  stack: err.stack
10184
10206
  });
10185
10207
  });
10208
+ resolveVendor();
10186
10209
  setWorkspacePath(options.workspacePath);
10187
10210
  const upstream = createUpstreamClient(options.upstream);
10188
10211
  const SILENT_CHANNELS = /* @__PURE__ */ new Set(["env.heartbeat", "session.upserted"]);
@@ -10898,15 +10921,15 @@ function register17(program) {
10898
10921
 
10899
10922
  // src/graph/build.ts
10900
10923
  import { mkdirSync as mkdirSync2, readFileSync as readFileSync6, rmSync, statSync as statSync3, writeFileSync as writeFileSync3 } from "fs";
10901
- import { dirname as dirname5, resolve as resolve7 } from "path";
10924
+ import { dirname as dirname6, resolve as resolve8 } from "path";
10902
10925
 
10903
10926
  // src/graph/graphify.ts
10904
10927
  import { spawnSync as spawnSync2 } from "child_process";
10905
- import { homedir as homedir3 } from "os";
10928
+ import { homedir as homedir4 } from "os";
10906
10929
  import { delimiter, join as join7 } from "path";
10907
10930
  var BIN = "graphify";
10908
10931
  var PACKAGE = "graphifyy";
10909
- var UV_BIN_DIR = join7(homedir3(), ".local", "bin");
10932
+ var UV_BIN_DIR = join7(homedir4(), ".local", "bin");
10910
10933
  function runnable(bin) {
10911
10934
  const probe = spawnSync2(bin, ["--help"], { stdio: "ignore" });
10912
10935
  return probe.error?.code !== "ENOENT";
@@ -11125,8 +11148,8 @@ ${formatLedger(ledger)}
11125
11148
  var DEFAULT_STALE_MS = 10 * 60 * 1e3;
11126
11149
  function acquireBuildLock(repoRoot, options = {}) {
11127
11150
  const staleMs = options.staleMs ?? DEFAULT_STALE_MS;
11128
- const lockPath = options.lockPath ?? resolve7(repoRoot, ".data", "build.lock");
11129
- mkdirSync2(dirname5(lockPath), { recursive: true });
11151
+ const lockPath = options.lockPath ?? resolve8(repoRoot, ".data", "build.lock");
11152
+ mkdirSync2(dirname6(lockPath), { recursive: true });
11130
11153
  const stamp = () => writeFileSync3(lockPath, `${process.pid}
11131
11154
  `, { flag: "wx" });
11132
11155
  try {
@@ -11163,24 +11186,6 @@ function isStale(lockPath, staleMs) {
11163
11186
  }
11164
11187
  }
11165
11188
 
11166
- // src/graph/repo.ts
11167
- import { homedir as homedir4 } from "os";
11168
- import { dirname as dirname6, resolve as resolve8 } from "path";
11169
- import { fileURLToPath as fileURLToPath3 } from "url";
11170
- function resolveRepo(repo) {
11171
- const cwd = repo ? resolve8(process.cwd(), repo) : process.cwd();
11172
- process.env["JARVIS_DATA_VENDOR"] ??= resolve8(dirname6(fileURLToPath3(import.meta.url)), "data");
11173
- loadEnvFile(resolve8(cwd, ".env"));
11174
- loadEnvFile(resolve8(homedir4(), ".jarvis", "data.env"));
11175
- return cwd;
11176
- }
11177
- function loadEnvFile(path22) {
11178
- try {
11179
- process.loadEnvFile(path22);
11180
- } catch {
11181
- }
11182
- }
11183
-
11184
11189
  // src/commands/build.ts
11185
11190
  function register18(program) {
11186
11191
  const build2 = program.command("build").description("Build an artifact from this repo");