attraverso 0.1.1 → 0.1.3

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.
Files changed (3) hide show
  1. package/README.txt +5 -4
  2. package/package.json +1 -1
  3. package/server.js +40 -14
package/README.txt CHANGED
@@ -1,9 +1,10 @@
1
- ai-project-manager, standalone build.
1
+ attraverso, standalone build.
2
2
 
3
3
  Needs nothing installed but Node 22 or newer. Run it as an MCP stdio server:
4
- node server.js [--store /path/to/plan.apm.yaml]
4
+ node server.js [--store /path/to/attraverso.yaml]
5
5
 
6
- With no --store it uses APM_STORE_PATH, else the nearest *.apm.yaml above the working
7
- directory, else ~/.ai-project-manager/project.apm.yaml (created empty on first run).
6
+ With no --store it uses APM_STORE_PATH, else the nearest attraverso.yaml (or older
7
+ *.apm.yaml) above the working directory, else attraverso.yaml at the git repo's root,
8
+ else ~/.ai-project-manager/attraverso.yaml. A missing file is created empty on first run.
8
9
 
9
10
  Generated by `yarn build:standalone` - do not edit by hand.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "attraverso",
3
- "version": "0.1.1",
3
+ "version": "0.1.3",
4
4
  "description": "Durable, structured project memory that Claude reads and writes over MCP, stored as version-controlled YAML.",
5
5
  "license": "Apache-2.0",
6
6
  "repository": {
package/server.js CHANGED
@@ -4,7 +4,7 @@ import o__default from "path";
4
4
  import require$$2 from "os";
5
5
  import require$$3$1 from "crypto";
6
6
  import { fileURLToPath } from "node:url";
7
- import { join, dirname, delimiter, isAbsolute, resolve as resolve$3, sep, extname } from "node:path";
7
+ import { join, dirname, basename, delimiter, isAbsolute, resolve as resolve$3, sep, extname } from "node:path";
8
8
  import process$1 from "node:process";
9
9
  import crypto$2, { createHash, randomBytes } from "node:crypto";
10
10
  import fs$1, { existsSync, readdirSync } from "node:fs";
@@ -20180,7 +20180,7 @@ class StdioServerTransport {
20180
20180
  }
20181
20181
  }
20182
20182
  const name = "attraverso";
20183
- const version = "0.1.1";
20183
+ const version = "0.1.3";
20184
20184
  const pkg = {
20185
20185
  name,
20186
20186
  version
@@ -37933,6 +37933,11 @@ async function requireCurrentSchema(db) {
37933
37933
  }
37934
37934
  return null;
37935
37935
  }
37936
+ const STORE_FILE = "attraverso.yaml";
37937
+ const LEGACY_STORE_SUFFIX = ".apm.yaml";
37938
+ const isStoreFile = (name2) => name2 === STORE_FILE || name2.endsWith(LEGACY_STORE_SUFFIX);
37939
+ const isLegacyStore = (storePath) => basename(storePath).endsWith(LEGACY_STORE_SUFFIX);
37940
+ const dataDirFor = (storePath) => join(storePath, "..", isLegacyStore(storePath) ? ".apm" : ".attraverso");
37936
37941
  var composer$1 = {};
37937
37942
  var directives$2 = {};
37938
37943
  var identity$x = {};
@@ -44941,7 +44946,7 @@ async function summariseInSql(db, projectId) {
44941
44946
  })).sort(bySubject);
44942
44947
  }
44943
44948
  const YAML_FORMAT = { lineWidth: 0 };
44944
- const measurementsDirFor = (storePath) => join(storePath, "..", ".apm", "measurements");
44949
+ const measurementsDirFor = (storePath) => join(dataDirFor(storePath), "measurements");
44945
44950
  const recordSchema = objectType({
44946
44951
  id: stringType(),
44947
44952
  project: stringType(),
@@ -45453,14 +45458,27 @@ const stringifyStore = (store) => stringify(store, YAML_FORMAT);
45453
45458
  function parseStore(text2) {
45454
45459
  return storeSchema.parse(parse(text2));
45455
45460
  }
45456
- const STORE_SUFFIX = ".apm.yaml";
45457
- const DEFAULT_STORE_FILE = `project${STORE_SUFFIX}`;
45458
45461
  function resolveStorePaths(explicit) {
45459
45462
  const listed = pathList(explicit) ?? pathList([process.env.APM_STORE_PATH]);
45460
45463
  if (listed !== void 0) return listed;
45461
- const [first, ...rest] = findStoreUp(process.cwd());
45464
+ const repo = repoRootAbove(process.cwd());
45465
+ const [first, ...rest] = findStoreUp(process.cwd(), repo);
45462
45466
  if (first !== void 0) return [first, ...rest];
45463
- return [join(homedir(), ".ai-project-manager", DEFAULT_STORE_FILE)];
45467
+ return [repo === void 0 ? homeStorePath() : join(repo, STORE_FILE)];
45468
+ }
45469
+ function repoRootAbove(start2) {
45470
+ for (let dir = start2; ; ) {
45471
+ if (existsSync(join(dir, ".git"))) return dir;
45472
+ const parent = dirname(dir);
45473
+ if (parent === dir) return void 0;
45474
+ dir = parent;
45475
+ }
45476
+ }
45477
+ function homeStorePath() {
45478
+ const dir = join(homedir(), ".ai-project-manager");
45479
+ const current = join(dir, STORE_FILE);
45480
+ const legacy = join(dir, `project${LEGACY_STORE_SUFFIX}`);
45481
+ return !existsSync(current) && existsSync(legacy) ? legacy : current;
45464
45482
  }
45465
45483
  function storePathsIn(argv) {
45466
45484
  const found = argv.flatMap((arg, index2) => {
@@ -45479,7 +45497,7 @@ function usable(path2) {
45479
45497
  if (!trimmed || trimmed.includes("${")) return void 0;
45480
45498
  return trimmed;
45481
45499
  }
45482
- function findStoreUp(start2) {
45500
+ function findStoreUp(start2, ceiling) {
45483
45501
  for (let dir = start2; ; ) {
45484
45502
  let names2 = [];
45485
45503
  try {
@@ -45487,10 +45505,10 @@ function findStoreUp(start2) {
45487
45505
  } catch {
45488
45506
  names2 = [];
45489
45507
  }
45490
- const matches = names2.filter((name2) => name2.endsWith(STORE_SUFFIX)).sort();
45508
+ const matches = names2.filter(isStoreFile).sort((a2, b2) => Number(b2 === STORE_FILE) - Number(a2 === STORE_FILE) || a2.localeCompare(b2));
45491
45509
  if (matches.length > 0) return matches.map((name2) => join(dir, name2));
45492
45510
  const parent = dirname(dir);
45493
- if (parent === dir) return [];
45511
+ if (dir === ceiling || parent === dir) return [];
45494
45512
  dir = parent;
45495
45513
  }
45496
45514
  }
@@ -45726,7 +45744,7 @@ function createFileMediaStore(dir) {
45726
45744
  }
45727
45745
  };
45728
45746
  }
45729
- const mediaDirFor = (storePath) => join(storePath, "..", ".apm", "media");
45747
+ const mediaDirFor = (storePath) => join(dataDirFor(storePath), "media");
45730
45748
  function createUnavailableMediaStore(reason) {
45731
45749
  return {
45732
45750
  unavailable: reason,
@@ -46437,9 +46455,14 @@ async function fileBacked() {
46437
46455
  access: accessTo(store, db),
46438
46456
  // Media resolves against the primary store, which is also where a project created at runtime lands.
46439
46457
  sources: fileSources(store.path),
46440
- describe: `store: ${store.paths.join(", ")}${created ? ", created" : ""}`
46458
+ describe: `store: ${store.paths.join(", ")}${created ? ", created" : ""}${legacyNote(store.paths)}`
46441
46459
  };
46442
46460
  }
46461
+ function legacyNote(paths) {
46462
+ const legacy = paths.filter(isLegacyStore).map((path2) => basename(path2));
46463
+ if (legacy.length === 0) return "";
46464
+ return `; ${legacy.join(", ")} ${legacy.length === 1 ? "has" : "have"} the old naming, which still works - to move a plan over, git mv it to attraverso.yaml and its .apm/ folder to .attraverso/`;
46465
+ }
46443
46466
  async function databaseBacked(url) {
46444
46467
  const { createPostgresDb } = await import("./assets/postgres-X5RxLyOz.js");
46445
46468
  const { db } = await createPostgresDb(url);
@@ -47195,8 +47218,11 @@ ${buildStamp()}`);
47195
47218
  const p2 = await resolveProject(db, caller, project);
47196
47219
  const { hits, relaxed } = await search(db, p2.id, query, limit2);
47197
47220
  if (hits.length === 0) {
47198
- return text(`no matches for "${query}".
47199
- If that is surprising, try fewer or more distinctive words - every word has to appear in the same document.`);
47221
+ return {
47222
+ ...text(`no matches for "${query}".
47223
+ If that is surprising, try fewer or more distinctive words - every word has to appear in the same document.`),
47224
+ structuredContent: { query, relaxed, hits: [] }
47225
+ };
47200
47226
  }
47201
47227
  const how = relaxed ? `no document contains all of "${query}", so these match some of it, best first` : `${hits.length} hit${hits.length === 1 ? "" : "s"} for "${query}", best first`;
47202
47228
  return {