@limno/core 0.1.11 → 0.1.12

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/index.cjs CHANGED
@@ -297,6 +297,11 @@ async function uncommitted(root, files) {
297
297
  const top = (await git(root, ["rev-parse", "--show-toplevel"])).out.trim();
298
298
  return files.filter((f) => dirty.has(top ? import_node_path2.default.relative(top, import_node_path2.default.join(root, f)) : f) || dirty.has(f));
299
299
  }
300
+ async function committedSince(root, files, since) {
301
+ if (!files.length) return false;
302
+ const r = await git(root, ["log", `--since=${Math.floor(since / 1e3)}`, "--format=%h", "--", ...files]);
303
+ return r.code === 0 && r.out.trim().length > 0;
304
+ }
300
305
  async function commitFiles(root, files, message) {
301
306
  if (!await isGitRepo(root)) return { ok: false, error: "This project isn\u2019t a git repository." };
302
307
  for (const marker of ["MERGE_HEAD", "rebase-merge", "rebase-apply", "CHERRY_PICK_HEAD"]) {
@@ -708,7 +713,9 @@ function createRunner(root, folder, onState) {
708
713
  return {
709
714
  async info(force) {
710
715
  if (state.commit && !state.commit.committed && state.commit.uncommitted.length && !child) {
711
- state.commit = { ...state.commit, uncommitted: await uncommitted(root, state.files) };
716
+ const left = await uncommitted(root, state.files);
717
+ const undone = !left.length && !await committedSince(root, state.files, state.startedAt ?? 0);
718
+ state.commit = { ...state.commit, uncommitted: left, undone };
712
719
  }
713
720
  return { agents: await detectAgents(force), allowed: allowed(), autoCommit: autoCommitOn(), state };
714
721
  },
package/dist/index.d.cts CHANGED
@@ -117,6 +117,8 @@ interface RunCommit {
117
117
  };
118
118
  /** Why an auto-commit didn't happen. */
119
119
  note?: string;
120
+ /** No longer changed and never committed: the edits were undone (reverted or discarded). */
121
+ undone?: boolean;
120
122
  }
121
123
  interface RunnerInfo {
122
124
  agents: RunnerAgent[];
package/dist/index.d.ts CHANGED
@@ -117,6 +117,8 @@ interface RunCommit {
117
117
  };
118
118
  /** Why an auto-commit didn't happen. */
119
119
  note?: string;
120
+ /** No longer changed and never committed: the edits were undone (reverted or discarded). */
121
+ undone?: boolean;
120
122
  }
121
123
  interface RunnerInfo {
122
124
  agents: RunnerAgent[];
package/dist/index.js CHANGED
@@ -248,6 +248,11 @@ async function uncommitted(root, files) {
248
248
  const top = (await git(root, ["rev-parse", "--show-toplevel"])).out.trim();
249
249
  return files.filter((f) => dirty.has(top ? path2.relative(top, path2.join(root, f)) : f) || dirty.has(f));
250
250
  }
251
+ async function committedSince(root, files, since) {
252
+ if (!files.length) return false;
253
+ const r = await git(root, ["log", `--since=${Math.floor(since / 1e3)}`, "--format=%h", "--", ...files]);
254
+ return r.code === 0 && r.out.trim().length > 0;
255
+ }
251
256
  async function commitFiles(root, files, message) {
252
257
  if (!await isGitRepo(root)) return { ok: false, error: "This project isn\u2019t a git repository." };
253
258
  for (const marker of ["MERGE_HEAD", "rebase-merge", "rebase-apply", "CHERRY_PICK_HEAD"]) {
@@ -659,7 +664,9 @@ function createRunner(root, folder, onState) {
659
664
  return {
660
665
  async info(force) {
661
666
  if (state.commit && !state.commit.committed && state.commit.uncommitted.length && !child) {
662
- state.commit = { ...state.commit, uncommitted: await uncommitted(root, state.files) };
667
+ const left = await uncommitted(root, state.files);
668
+ const undone = !left.length && !await committedSince(root, state.files, state.startedAt ?? 0);
669
+ state.commit = { ...state.commit, uncommitted: left, undone };
663
670
  }
664
671
  return { agents: await detectAgents(force), allowed: allowed(), autoCommit: autoCommitOn(), state };
665
672
  },
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@limno/core",
3
- "version": "0.1.11",
3
+ "version": "0.1.12",
4
4
  "description": "Limno's framework-neutral dev tooling: JSX source stamping, the change-set store and the endpoints the editor talks to.",
5
5
  "license": "FSL-1.1-MIT",
6
6
  "type": "module",
@@ -17,12 +17,7 @@
17
17
  "files": [
18
18
  "dist"
19
19
  ],
20
- "repository": {
21
- "type": "git",
22
- "url": "git+https://github.com/armie3/limno.git",
23
- "directory": "packages/core"
24
- },
25
- "homepage": "https://github.com/armie3/limno#readme",
20
+ "homepage": "https://limno.dev",
26
21
  "keywords": [
27
22
  "limno",
28
23
  "design",
@@ -42,9 +37,9 @@
42
37
  "dependencies": {
43
38
  "@babel/parser": "^7.29.0",
44
39
  "@babel/traverse": "^7.29.0",
45
- "@limno/mcp": "0.1.5",
46
- "@limno/overlay": "0.1.11",
47
- "@limno/spec": "0.1.5",
40
+ "@limno/mcp": "0.1.6",
41
+ "@limno/overlay": "0.1.12",
42
+ "@limno/spec": "0.1.6",
48
43
  "launch-editor": "^2.14.1",
49
44
  "magic-string": "^0.30.17"
50
45
  },