cueloop 0.1.0-alpha.75 → 0.1.0-alpha.77

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "cueloop",
3
- "version": "0.1.0-alpha.75",
3
+ "version": "0.1.0-alpha.77",
4
4
  "description": "Terminal review surface for coding agents: annotate plans and diffs, return a verdict, send structured feedback back",
5
5
  "homepage": "https://github.com/mmurakaru/cueloop#readme",
6
6
  "bugs": {
@@ -30,10 +30,10 @@
30
30
  "build:binary": "bun build --compile --external cpu-features ./src/main.ts --outfile dist/cueloop"
31
31
  },
32
32
  "dependencies": {
33
- "@cueloop/adapters": "0.1.0-alpha.75",
34
- "@cueloop/client": "0.1.0-alpha.75",
35
- "@cueloop/daemon": "0.1.0-alpha.75",
36
- "@cueloop/schema": "0.1.0-alpha.75",
33
+ "@cueloop/adapters": "0.1.0-alpha.77",
34
+ "@cueloop/client": "0.1.0-alpha.77",
35
+ "@cueloop/daemon": "0.1.0-alpha.77",
36
+ "@cueloop/schema": "0.1.0-alpha.77",
37
37
  "valibot": "^1.4.2"
38
38
  },
39
39
  "engines": {
@@ -5,11 +5,21 @@
5
5
  * live agent. It never touches the real ~/.cueloop home.
6
6
  */
7
7
 
8
+ import { existsSync, mkdirSync, readFileSync, writeFileSync } from "node:fs";
8
9
  import { homedir, tmpdir } from "node:os";
9
- import { join } from "node:path";
10
+ import { dirname, join } from "node:path";
10
11
  import { DaemonClient } from "@cueloop/daemon/client";
11
12
  import { resolveWorkspace } from "@cueloop/daemon/review";
12
13
 
14
+ /** Bump whenever the seed content below changes, so a long-lived dev home refreshes instead of keeping
15
+ * stale threads (an old seed's diff had no files, which showed as "No changes"). */
16
+ const SEED_VERSION = 2;
17
+ const SEED_TITLES = new Set([
18
+ "Read the repository",
19
+ "Review the accent change",
20
+ "A standalone thought",
21
+ ]);
22
+
13
23
  const SEED_PLAN = `# Read the repository
14
24
 
15
25
  A seeded plan so \`cueloop dev\` always has a thread to open.
@@ -67,14 +77,31 @@ async function seedDevSessions(client: DaemonClient): Promise<void> {
67
77
  });
68
78
  }
69
79
 
70
- /** `cueloop dev`: seed an isolated dev home once, then open the TUI on it. */
80
+ /** Seed the dev home, refreshing the seed threads when SEED_VERSION moved on so a stale home never
81
+ * keeps an old seed (which is why an aged home showed "No changes" - its diff thread had no files). */
82
+ async function refreshDevSeed(client: DaemonClient, home: string): Promise<void> {
83
+ const versionFile = join(home, ".seed-version");
84
+ const stored = existsSync(versionFile) ? Number(readFileSync(versionFile, "utf8").trim()) : 0;
85
+ const existing = await client.sessionList();
86
+ if (existing.length > 0 && stored === SEED_VERSION) return;
87
+
88
+ await Promise.all(
89
+ existing
90
+ .filter((thread) => SEED_TITLES.has(thread.artifact.meta.title ?? ""))
91
+ .map((thread) => client.sessionDelete(thread.id)),
92
+ );
93
+ await seedDevSessions(client);
94
+ mkdirSync(dirname(versionFile), { recursive: true });
95
+ writeFileSync(versionFile, String(SEED_VERSION));
96
+ }
97
+
98
+ /** `cueloop dev`: seed an isolated dev home (refreshing a stale seed), then open the TUI on it. */
71
99
  export async function devCommand(): Promise<number> {
72
- process.env.CUELOOP_HOME ??= join(homedir(), ".cueloop-dev");
100
+ const home = (process.env.CUELOOP_HOME ??= join(homedir(), ".cueloop-dev"));
73
101
 
74
102
  const client = await DaemonClient.connect({ autostart: true });
75
103
  try {
76
- const existing = await client.sessionList();
77
- if (existing.length === 0) await seedDevSessions(client);
104
+ await refreshDevSeed(client, home);
78
105
  } finally {
79
106
  client.close();
80
107
  }
@@ -53,6 +53,7 @@ function fakeClient(sessions: Thread[]): SessionClient {
53
53
  sessionCutBlock: unimplemented("sessionCutBlock"),
54
54
  sessionRestoreBlock: unimplemented("sessionRestoreBlock"),
55
55
  sessionCurate: unimplemented("sessionCurate"),
56
+ sessionSetAccess: unimplemented("sessionSetAccess"),
56
57
  sessionNavigate: unimplemented("sessionNavigate"),
57
58
  sessionBranch: unimplemented("sessionBranch"),
58
59
  sessionSwitch: unimplemented("sessionSwitch"),