@workit-dev/pi 1.13.0 → 1.14.2

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/worker.js CHANGED
@@ -7954,11 +7954,13 @@ function fastGit(root) {
7954
7954
  }
7955
7955
  function resolveStore(root) {
7956
7956
  root = path7.resolve(root);
7957
- let directory = false;
7957
+ let stat = null;
7958
7958
  try {
7959
- directory = fs4.statSync(root).isDirectory();
7959
+ stat = fs4.statSync(root);
7960
7960
  } catch {}
7961
- if (!directory)
7961
+ if (!stat)
7962
+ return new Error(`cannot locate the workit store: ${root} does not exist (removed while workit ran?); nothing is recorded under a missing directory`);
7963
+ if (!stat.isDirectory())
7962
7964
  return { dir: path7.join(root, ".workit"), shared: false, top: null };
7963
7965
  const fast = fastGit(root);
7964
7966
  if (fast?.kind === "none")
@@ -8355,7 +8357,7 @@ var safeRef = (value) => value.length > 0 && !value.startsWith("-");
8355
8357
  function storeRoot(cwd) {
8356
8358
  const location = resolveStore(path10.resolve(cwd));
8357
8359
  if (location instanceof Error)
8358
- return err("unavailable", location.message.replace(/; fix the repository.*$/u, ""), "fix the repository (git status should work here) or run from a non-git directory");
8360
+ return err("unavailable", location.message.replace(/; fix the repository.*$/u, ""), / does not exist /u.test(location.message) ? "run workit from a directory that exists" : "fix the repository (git status should work here) or run from a non-git directory");
8359
8361
  return { ok: true, value: { root: location.dir, shared: location.shared } };
8360
8362
  }
8361
8363
  function ledgerPath(cwd) {
package/dist/workit.js CHANGED
@@ -10837,11 +10837,13 @@ function fastGit(root) {
10837
10837
  }
10838
10838
  function resolveStore(root) {
10839
10839
  root = path9.resolve(root);
10840
- let directory = false;
10840
+ let stat = null;
10841
10841
  try {
10842
- directory = fs5.statSync(root).isDirectory();
10842
+ stat = fs5.statSync(root);
10843
10843
  } catch {}
10844
- if (!directory)
10844
+ if (!stat)
10845
+ return new Error(`cannot locate the workit store: ${root} does not exist (removed while workit ran?); nothing is recorded under a missing directory`);
10846
+ if (!stat.isDirectory())
10845
10847
  return { dir: path9.join(root, ".workit"), shared: false, top: null };
10846
10848
  const fast = fastGit(root);
10847
10849
  if (fast?.kind === "none")
@@ -15787,7 +15789,7 @@ function cleanRebase(cwd, range) {
15787
15789
  function storeRoot(cwd) {
15788
15790
  const location = resolveStore(path20.resolve(cwd));
15789
15791
  if (location instanceof Error)
15790
- return err("unavailable", location.message.replace(/; fix the repository.*$/u, ""), "fix the repository (git status should work here) or run from a non-git directory");
15792
+ return err("unavailable", location.message.replace(/; fix the repository.*$/u, ""), / does not exist /u.test(location.message) ? "run workit from a directory that exists" : "fix the repository (git status should work here) or run from a non-git directory");
15791
15793
  return { ok: true, value: { root: location.dir, shared: location.shared } };
15792
15794
  }
15793
15795
  function ledgerPath(cwd) {
@@ -15988,7 +15990,7 @@ var sealed = (row, id, at, previous) => {
15988
15990
  ` };
15989
15991
  };
15990
15992
  function appendRaw(cwd, row, options) {
15991
- const file = ledgerPath(cwd);
15993
+ const file = options.store ? { ok: true, value: path20.join(options.store.root, "ledger", "ledger.jsonl") } : ledgerPath(cwd);
15992
15994
  if (!file.ok)
15993
15995
  return file;
15994
15996
  const id = newId2();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@workit-dev/pi",
3
- "version": "1.13.0",
3
+ "version": "1.14.2",
4
4
  "description": "Workit native extension for Pi — tools, method skills, and session continuity",
5
5
  "keywords": [
6
6
  "agentic-coding",