dev-prism 0.2.0 → 0.4.0

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 (63) hide show
  1. package/README.md +37 -11
  2. package/bin/dev-prism.js +23 -235
  3. package/dist/chunk-3ATDGV4Y.js +22 -0
  4. package/dist/chunk-3MSC3CGG.js +78 -0
  5. package/dist/chunk-3NW2OWIU.js +78 -0
  6. package/dist/chunk-3TRRZEFR.js +38 -0
  7. package/dist/chunk-4UNCSJRM.js +70 -0
  8. package/dist/chunk-63II3EL4.js +98 -0
  9. package/dist/chunk-6YMQTISJ.js +84 -0
  10. package/dist/chunk-7YGOMAJG.js +106 -0
  11. package/dist/chunk-AOM6BONB.js +98 -0
  12. package/dist/chunk-AW2FJGXA.js +38 -0
  13. package/dist/chunk-C4WLIOBR.js +67 -0
  14. package/dist/chunk-D6QWWXZD.js +49 -0
  15. package/dist/chunk-FKTFCSU7.js +78 -0
  16. package/dist/chunk-GKXXK2ZH.js +203 -0
  17. package/dist/chunk-H4HPDIY3.js +95 -0
  18. package/dist/chunk-HCCZKLC4.js +64 -0
  19. package/dist/chunk-HZUN6NRB.js +70 -0
  20. package/dist/chunk-J36LRUXM.js +60 -0
  21. package/dist/chunk-JHR4WADC.js +200 -0
  22. package/dist/chunk-JIU574KX.js +41 -0
  23. package/dist/chunk-KZJE62TK.js +203 -0
  24. package/dist/chunk-LNIOSGC4.js +78 -0
  25. package/dist/chunk-LOVO4P3Y.js +41 -0
  26. package/dist/chunk-NNVP5F6I.js +77 -0
  27. package/dist/chunk-OL25TBYX.js +67 -0
  28. package/dist/chunk-P3ETW2KK.js +166 -0
  29. package/dist/chunk-QUMZI5KK.js +98 -0
  30. package/dist/chunk-RC2AUYZ7.js +49 -0
  31. package/dist/chunk-SSQ7XBY2.js +30 -0
  32. package/dist/chunk-SUMJLXT7.js +30 -0
  33. package/dist/chunk-UHI2QJFI.js +200 -0
  34. package/dist/chunk-X5A6H4Q7.js +70 -0
  35. package/dist/chunk-X6FHBEAS.js +200 -0
  36. package/dist/chunk-Y3GR6XK7.js +71 -0
  37. package/dist/commands/claude.js +3 -102
  38. package/dist/commands/create.js +6 -5
  39. package/dist/commands/destroy.js +4 -3
  40. package/dist/commands/info.d.ts +3 -0
  41. package/dist/commands/info.js +7 -0
  42. package/dist/commands/list.d.ts +3 -1
  43. package/dist/commands/list.js +4 -4
  44. package/dist/commands/logs.d.ts +8 -0
  45. package/dist/commands/logs.js +8 -0
  46. package/dist/commands/prune.d.ts +6 -0
  47. package/dist/commands/prune.js +10 -0
  48. package/dist/commands/start.d.ts +7 -0
  49. package/dist/commands/start.js +9 -0
  50. package/dist/commands/stop-all.d.ts +3 -0
  51. package/dist/commands/stop-all.js +9 -0
  52. package/dist/commands/stop.d.ts +3 -0
  53. package/dist/commands/stop.js +7 -0
  54. package/dist/index.d.ts +11 -1
  55. package/dist/index.js +60 -10
  56. package/dist/lib/env.d.ts +2 -1
  57. package/dist/lib/env.js +3 -1
  58. package/dist/lib/ports.js +1 -1
  59. package/dist/lib/store.d.ts +46 -0
  60. package/dist/lib/store.js +6 -0
  61. package/dist/lib/worktree.d.ts +2 -12
  62. package/dist/lib/worktree.js +1 -5
  63. package/package.json +14 -4
@@ -0,0 +1,71 @@
1
+ // src/lib/worktree.ts
2
+ import { existsSync, rmSync } from "fs";
3
+ import { execa } from "execa";
4
+ async function branchExists(projectRoot, branchName) {
5
+ try {
6
+ await execa("git", ["rev-parse", "--verify", branchName], {
7
+ cwd: projectRoot,
8
+ stdio: "pipe"
9
+ });
10
+ return true;
11
+ } catch {
12
+ return false;
13
+ }
14
+ }
15
+ function findNextSessionId(usedIds) {
16
+ for (let i = 1; i <= 999; i++) {
17
+ const sessionId = String(i).padStart(3, "0");
18
+ if (!usedIds.has(sessionId)) {
19
+ return sessionId;
20
+ }
21
+ }
22
+ throw new Error("No available session IDs (001-999 all in use)");
23
+ }
24
+ function generateDefaultBranchName(sessionId) {
25
+ const today = (/* @__PURE__ */ new Date()).toISOString().split("T")[0];
26
+ return `session/${today}/${sessionId}`;
27
+ }
28
+ async function createWorktree(projectRoot, sessionDir, branchName) {
29
+ if (existsSync(sessionDir)) {
30
+ throw new Error(`Session directory already exists: ${sessionDir}`);
31
+ }
32
+ const exists = await branchExists(projectRoot, branchName);
33
+ if (exists) {
34
+ await execa("git", ["worktree", "add", sessionDir, branchName], {
35
+ cwd: projectRoot,
36
+ stdio: "inherit"
37
+ });
38
+ } else {
39
+ await execa("git", ["worktree", "add", sessionDir, "-b", branchName, "HEAD"], {
40
+ cwd: projectRoot,
41
+ stdio: "inherit"
42
+ });
43
+ }
44
+ }
45
+ async function removeWorktree(projectRoot, sessionDir, branchName) {
46
+ if (existsSync(sessionDir)) {
47
+ try {
48
+ await execa("git", ["worktree", "remove", "--force", sessionDir], {
49
+ cwd: projectRoot,
50
+ stdio: "inherit"
51
+ });
52
+ } catch {
53
+ rmSync(sessionDir, { recursive: true, force: true });
54
+ }
55
+ }
56
+ try {
57
+ await execa("git", ["branch", "-D", branchName], {
58
+ cwd: projectRoot,
59
+ stdio: "pipe"
60
+ // Don't show output, branch might not exist
61
+ });
62
+ } catch {
63
+ }
64
+ }
65
+
66
+ export {
67
+ findNextSessionId,
68
+ generateDefaultBranchName,
69
+ createWorktree,
70
+ removeWorktree
71
+ };
@@ -1,105 +1,6 @@
1
- // src/commands/claude.ts
2
- import { existsSync, mkdirSync, writeFileSync, readFileSync, appendFileSync } from "fs";
3
- import { join } from "path";
4
- import chalk from "chalk";
5
- var SKILL_CONTENT = `---
6
- allowed-tools: Bash(dev-prism *)
7
- description: Manage isolated development sessions (create, list, start, stop, destroy)
8
- ---
9
-
10
- # Dev Session Manager
11
-
12
- Manage isolated parallel development sessions using git worktrees and Docker.
13
-
14
- ## Parse Intent from: $ARGUMENTS
15
-
16
- - "create" / "new" -> dev-prism create
17
- - "list" / "status" -> dev-prism list
18
- - "start <id>" -> dev-prism start <id>
19
- - "stop <id>" -> dev-prism stop <id>
20
- - "destroy <id>" -> dev-prism destroy <id>
21
- - "logs <id>" -> dev-prism logs <id>
22
- - "stop all" -> dev-prism stop-all
23
- - "prune" -> dev-prism prune
24
-
25
- ## Commands
26
-
27
- Run from the project root (where session.config.mjs exists).
28
-
29
- After running commands, explain:
30
- 1. What happened
31
- 2. Relevant ports/paths
32
- 3. Next steps
33
-
34
- Warn before destructive operations (destroy, prune).
35
- `;
36
- var CLAUDE_MD_SECTION = `
37
- ## Dev Sessions
38
-
39
- Isolated parallel development sessions using git worktrees and Docker.
40
-
41
- ### Commands
42
- \`\`\`bash
43
- dev-prism create [id] # Create session (auto-assigns ID)
44
- dev-prism list # Show all sessions with status
45
- dev-prism start <id> # Start stopped session
46
- dev-prism stop <id> # Stop session (preserves data)
47
- dev-prism stop-all # Stop all running sessions
48
- dev-prism destroy <id> # Remove session completely
49
- dev-prism logs <id> # Stream Docker logs
50
- dev-prism prune # Remove stopped sessions
51
- \`\`\`
52
-
53
- ### Port Allocation
54
- Port = 47000 + (sessionId \xD7 100) + offset
55
-
56
- | Service | Offset | Session 001 |
57
- |---------|--------|-------------|
58
- | APP | 0 | 47100 |
59
- | WEB | 1 | 47101 |
60
- | POSTGRES| 10 | 47110 |
61
-
62
- ### AI Notes
63
- - In sessions, use DATABASE_URL from \`.env.session\`
64
- - Run \`dev-prism list\` to discover ports
65
- - Commands run from project root, not session worktrees
66
- `;
67
- async function installClaude(projectRoot, options) {
68
- const skillDir = join(projectRoot, ".claude", "commands");
69
- const skillPath = join(skillDir, "session.md");
70
- const claudeMdPath = join(projectRoot, "CLAUDE.md");
71
- if (existsSync(skillPath) && !options.force) {
72
- console.log(chalk.yellow(`Skill already exists: ${skillPath}`));
73
- console.log(chalk.gray("Use --force to overwrite"));
74
- } else {
75
- mkdirSync(skillDir, { recursive: true });
76
- writeFileSync(skillPath, SKILL_CONTENT);
77
- console.log(chalk.green(`Created: ${skillPath}`));
78
- }
79
- const marker = "## Dev Sessions";
80
- if (existsSync(claudeMdPath)) {
81
- const content = readFileSync(claudeMdPath, "utf-8");
82
- if (content.includes(marker)) {
83
- if (options.force) {
84
- const beforeSection = content.split(marker)[0];
85
- writeFileSync(claudeMdPath, beforeSection.trimEnd() + CLAUDE_MD_SECTION);
86
- console.log(chalk.green(`Updated: ${claudeMdPath}`));
87
- } else {
88
- console.log(chalk.yellow("CLAUDE.md already has Dev Sessions section"));
89
- console.log(chalk.gray("Use --force to overwrite"));
90
- }
91
- } else {
92
- appendFileSync(claudeMdPath, CLAUDE_MD_SECTION);
93
- console.log(chalk.green(`Updated: ${claudeMdPath}`));
94
- }
95
- } else {
96
- writeFileSync(claudeMdPath, `# Project
97
- ${CLAUDE_MD_SECTION}`);
98
- console.log(chalk.green(`Created: ${claudeMdPath}`));
99
- }
100
- console.log(chalk.blue("\nClaude Code integration installed!"));
101
- console.log(chalk.gray("Use /session in Claude Code to manage sessions."));
102
- }
1
+ import {
2
+ installClaude
3
+ } from "../chunk-7YGOMAJG.js";
103
4
  export {
104
5
  installClaude
105
6
  };
@@ -1,11 +1,12 @@
1
1
  import {
2
2
  createSession
3
- } from "../chunk-PS76Q3HD.js";
4
- import "../chunk-PJKUD2N2.js";
5
- import "../chunk-GWDGC2OE.js";
6
- import "../chunk-25WQHUYW.js";
3
+ } from "../chunk-KZJE62TK.js";
4
+ import "../chunk-J36LRUXM.js";
5
+ import "../chunk-3ATDGV4Y.js";
6
+ import "../chunk-Y3GR6XK7.js";
7
7
  import "../chunk-GBN67HYD.js";
8
- import "../chunk-LEHA65A7.js";
8
+ import "../chunk-25WQHUYW.js";
9
+ import "../chunk-H4HPDIY3.js";
9
10
  export {
10
11
  createSession
11
12
  };
@@ -1,9 +1,10 @@
1
1
  import {
2
2
  destroySession
3
- } from "../chunk-LDK6QMR6.js";
4
- import "../chunk-GWDGC2OE.js";
5
- import "../chunk-25WQHUYW.js";
3
+ } from "../chunk-3NW2OWIU.js";
4
+ import "../chunk-Y3GR6XK7.js";
6
5
  import "../chunk-GBN67HYD.js";
6
+ import "../chunk-25WQHUYW.js";
7
+ import "../chunk-H4HPDIY3.js";
7
8
  export {
8
9
  destroySession
9
10
  };
@@ -0,0 +1,3 @@
1
+ declare function showInfo(cwd: string): Promise<void>;
2
+
3
+ export { showInfo };
@@ -0,0 +1,7 @@
1
+ import {
2
+ showInfo
3
+ } from "../chunk-JIU574KX.js";
4
+ import "../chunk-GBN67HYD.js";
5
+ export {
6
+ showInfo
7
+ };
@@ -1,3 +1,5 @@
1
- declare function listSessions(projectRoot: string): Promise<void>;
1
+ declare function listSessions(projectRoot: string, options?: {
2
+ all?: boolean;
3
+ }): Promise<void>;
2
4
 
3
5
  export { listSessions };
@@ -1,10 +1,10 @@
1
1
  import {
2
2
  listSessions
3
- } from "../chunk-35SHBLIZ.js";
4
- import "../chunk-PJKUD2N2.js";
5
- import "../chunk-GWDGC2OE.js";
6
- import "../chunk-25WQHUYW.js";
3
+ } from "../chunk-NNVP5F6I.js";
4
+ import "../chunk-3ATDGV4Y.js";
7
5
  import "../chunk-GBN67HYD.js";
6
+ import "../chunk-25WQHUYW.js";
7
+ import "../chunk-H4HPDIY3.js";
8
8
  export {
9
9
  listSessions
10
10
  };
@@ -0,0 +1,8 @@
1
+ interface LogsOptions {
2
+ mode?: string;
3
+ without?: string[];
4
+ tail?: string;
5
+ }
6
+ declare function streamLogs(projectRoot: string, sessionId: string, options: LogsOptions): Promise<void>;
7
+
8
+ export { type LogsOptions, streamLogs };
@@ -0,0 +1,8 @@
1
+ import {
2
+ streamLogs
3
+ } from "../chunk-RC2AUYZ7.js";
4
+ import "../chunk-25WQHUYW.js";
5
+ import "../chunk-H4HPDIY3.js";
6
+ export {
7
+ streamLogs
8
+ };
@@ -0,0 +1,6 @@
1
+ interface PruneOptions {
2
+ yes?: boolean;
3
+ }
4
+ declare function pruneSessions(projectRoot: string, options: PruneOptions): Promise<void>;
5
+
6
+ export { type PruneOptions, pruneSessions };
@@ -0,0 +1,10 @@
1
+ import {
2
+ pruneSessions
3
+ } from "../chunk-63II3EL4.js";
4
+ import "../chunk-Y3GR6XK7.js";
5
+ import "../chunk-GBN67HYD.js";
6
+ import "../chunk-25WQHUYW.js";
7
+ import "../chunk-H4HPDIY3.js";
8
+ export {
9
+ pruneSessions
10
+ };
@@ -0,0 +1,7 @@
1
+ interface StartOptions {
2
+ mode?: string;
3
+ without?: string[];
4
+ }
5
+ declare function startSession(projectRoot: string, sessionId: string, options: StartOptions): Promise<void>;
6
+
7
+ export { type StartOptions, startSession };
@@ -0,0 +1,9 @@
1
+ import {
2
+ startSession
3
+ } from "../chunk-3TRRZEFR.js";
4
+ import "../chunk-GBN67HYD.js";
5
+ import "../chunk-25WQHUYW.js";
6
+ import "../chunk-H4HPDIY3.js";
7
+ export {
8
+ startSession
9
+ };
@@ -0,0 +1,3 @@
1
+ declare function stopAllSessions(projectRoot: string): Promise<void>;
2
+
3
+ export { stopAllSessions };
@@ -0,0 +1,9 @@
1
+ import {
2
+ stopAllSessions
3
+ } from "../chunk-OL25TBYX.js";
4
+ import "../chunk-GBN67HYD.js";
5
+ import "../chunk-25WQHUYW.js";
6
+ import "../chunk-H4HPDIY3.js";
7
+ export {
8
+ stopAllSessions
9
+ };
@@ -0,0 +1,3 @@
1
+ declare function stopSession(projectRoot: string, sessionId: string): Promise<void>;
2
+
3
+ export { stopSession };
@@ -0,0 +1,7 @@
1
+ import {
2
+ stopSession
3
+ } from "../chunk-SUMJLXT7.js";
4
+ import "../chunk-H4HPDIY3.js";
5
+ export {
6
+ stopSession
7
+ };
package/dist/index.d.ts CHANGED
@@ -1,6 +1,16 @@
1
1
  export { createSession } from './commands/create.js';
2
2
  export { destroySession } from './commands/destroy.js';
3
3
  export { listSessions } from './commands/list.js';
4
+ export { showInfo } from './commands/info.js';
5
+ export { startSession } from './commands/start.js';
6
+ export { stopSession } from './commands/stop.js';
7
+ export { stopAllSessions } from './commands/stop-all.js';
8
+ export { pruneSessions } from './commands/prune.js';
9
+ export { streamLogs } from './commands/logs.js';
10
+ export { ClaudeOptions, installClaude } from './commands/claude.js';
4
11
  export { SessionConfig, loadConfig } from './lib/config.js';
5
12
  export { calculatePorts } from './lib/ports.js';
6
- export { findNextSessionId, generateDefaultBranchName } from './lib/worktree.js';
13
+ export { generateDefaultBranchName } from './lib/worktree.js';
14
+ export { SessionRow, SessionStore } from './lib/store.js';
15
+ export { generateEnvContent, renderAppEnv, writeAppEnvFiles, writeEnvFile } from './lib/env.js';
16
+ export { DockerComposeOptions, logs as dockerLogs, down, isRunning, ps, up } from './lib/docker.js';
package/dist/index.js CHANGED
@@ -1,30 +1,80 @@
1
+ import {
2
+ startSession
3
+ } from "./chunk-3TRRZEFR.js";
4
+ import {
5
+ stopAllSessions
6
+ } from "./chunk-OL25TBYX.js";
7
+ import {
8
+ stopSession
9
+ } from "./chunk-SUMJLXT7.js";
10
+ import {
11
+ installClaude
12
+ } from "./chunk-7YGOMAJG.js";
1
13
  import {
2
14
  createSession
3
- } from "./chunk-PS76Q3HD.js";
15
+ } from "./chunk-KZJE62TK.js";
16
+ import {
17
+ generateEnvContent,
18
+ renderAppEnv,
19
+ writeAppEnvFiles,
20
+ writeEnvFile
21
+ } from "./chunk-J36LRUXM.js";
4
22
  import {
5
23
  destroySession
6
- } from "./chunk-LDK6QMR6.js";
24
+ } from "./chunk-3NW2OWIU.js";
25
+ import {
26
+ showInfo
27
+ } from "./chunk-JIU574KX.js";
7
28
  import {
8
29
  listSessions
9
- } from "./chunk-35SHBLIZ.js";
30
+ } from "./chunk-NNVP5F6I.js";
10
31
  import {
11
32
  calculatePorts
12
- } from "./chunk-PJKUD2N2.js";
33
+ } from "./chunk-3ATDGV4Y.js";
34
+ import {
35
+ streamLogs
36
+ } from "./chunk-RC2AUYZ7.js";
37
+ import {
38
+ pruneSessions
39
+ } from "./chunk-63II3EL4.js";
13
40
  import {
14
- findNextSessionId,
15
41
  generateDefaultBranchName
16
- } from "./chunk-GWDGC2OE.js";
42
+ } from "./chunk-Y3GR6XK7.js";
43
+ import {
44
+ down,
45
+ isRunning,
46
+ logs,
47
+ ps,
48
+ up
49
+ } from "./chunk-GBN67HYD.js";
17
50
  import {
18
51
  loadConfig
19
52
  } from "./chunk-25WQHUYW.js";
20
- import "./chunk-GBN67HYD.js";
21
- import "./chunk-LEHA65A7.js";
53
+ import {
54
+ SessionStore
55
+ } from "./chunk-H4HPDIY3.js";
22
56
  export {
57
+ SessionStore,
23
58
  calculatePorts,
24
59
  createSession,
25
60
  destroySession,
26
- findNextSessionId,
61
+ logs as dockerLogs,
62
+ down,
27
63
  generateDefaultBranchName,
64
+ generateEnvContent,
65
+ installClaude,
66
+ isRunning,
28
67
  listSessions,
29
- loadConfig
68
+ loadConfig,
69
+ pruneSessions,
70
+ ps,
71
+ renderAppEnv,
72
+ showInfo,
73
+ startSession,
74
+ stopAllSessions,
75
+ stopSession,
76
+ streamLogs,
77
+ up,
78
+ writeAppEnvFiles,
79
+ writeEnvFile
30
80
  };
package/dist/lib/env.d.ts CHANGED
@@ -2,6 +2,7 @@ import { SessionConfig } from './config.js';
2
2
 
3
3
  declare function generateEnvContent(sessionId: string, ports: Record<string, number>, projectName: string): string;
4
4
  declare function writeEnvFile(sessionDir: string, sessionId: string, ports: Record<string, number>, projectName: string): string;
5
+ declare function renderAppEnv(template: Record<string, string>, ports: Record<string, number>): Record<string, string>;
5
6
  declare function writeAppEnvFiles(config: SessionConfig, sessionDir: string, sessionId: string, ports: Record<string, number>): string[];
6
7
 
7
- export { generateEnvContent, writeAppEnvFiles, writeEnvFile };
8
+ export { generateEnvContent, renderAppEnv, writeAppEnvFiles, writeEnvFile };
package/dist/lib/env.js CHANGED
@@ -1,10 +1,12 @@
1
1
  import {
2
2
  generateEnvContent,
3
+ renderAppEnv,
3
4
  writeAppEnvFiles,
4
5
  writeEnvFile
5
- } from "../chunk-LEHA65A7.js";
6
+ } from "../chunk-J36LRUXM.js";
6
7
  export {
7
8
  generateEnvContent,
9
+ renderAppEnv,
8
10
  writeAppEnvFiles,
9
11
  writeEnvFile
10
12
  };
package/dist/lib/ports.js CHANGED
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  calculatePorts,
3
3
  formatPortsTable
4
- } from "../chunk-PJKUD2N2.js";
4
+ } from "../chunk-3ATDGV4Y.js";
5
5
  export {
6
6
  calculatePorts,
7
7
  formatPortsTable
@@ -0,0 +1,46 @@
1
+ interface SessionRow {
2
+ id: number;
3
+ session_id: string;
4
+ project_root: string;
5
+ session_dir: string;
6
+ branch: string;
7
+ mode: string;
8
+ in_place: number;
9
+ created_at: string;
10
+ destroyed_at: string | null;
11
+ }
12
+ declare class SessionStore {
13
+ private db;
14
+ constructor(dbPath?: string);
15
+ insert(row: {
16
+ sessionId: string;
17
+ projectRoot: string;
18
+ sessionDir: string;
19
+ branch?: string;
20
+ mode?: string;
21
+ inPlace?: boolean;
22
+ }): SessionRow;
23
+ /**
24
+ * Atomically remove any old destroyed row and insert a new one.
25
+ * Uses a transaction so the UNIQUE constraint prevents concurrent creates
26
+ * from claiming the same session ID.
27
+ */
28
+ reserve(row: {
29
+ sessionId: string;
30
+ projectRoot: string;
31
+ sessionDir: string;
32
+ branch?: string;
33
+ mode?: string;
34
+ inPlace?: boolean;
35
+ }): SessionRow;
36
+ listByProject(projectRoot: string): SessionRow[];
37
+ listAll(): SessionRow[];
38
+ findSession(projectRoot: string, sessionId: string): SessionRow | undefined;
39
+ findByDir(sessionDir: string): SessionRow | undefined;
40
+ getUsedSessionIds(projectRoot: string): Set<string>;
41
+ markDestroyed(projectRoot: string, sessionId: string): boolean;
42
+ remove(projectRoot: string, sessionId: string): boolean;
43
+ close(): void;
44
+ }
45
+
46
+ export { type SessionRow, SessionStore };
@@ -0,0 +1,6 @@
1
+ import {
2
+ SessionStore
3
+ } from "../chunk-H4HPDIY3.js";
4
+ export {
5
+ SessionStore
6
+ };
@@ -1,16 +1,6 @@
1
- declare function findNextSessionId(projectRoot: string, sessionsDir?: string): Promise<string>;
1
+ declare function findNextSessionId(usedIds: Set<string>): string;
2
2
  declare function generateDefaultBranchName(sessionId: string): string;
3
3
  declare function createWorktree(projectRoot: string, sessionDir: string, branchName: string): Promise<void>;
4
4
  declare function removeWorktree(projectRoot: string, sessionDir: string, branchName: string): Promise<void>;
5
- declare function listWorktrees(projectRoot: string): Promise<Array<{
6
- path: string;
7
- branch: string;
8
- commit: string;
9
- }>>;
10
- declare function getSessionWorktrees(projectRoot: string): Promise<Array<{
11
- sessionId: string;
12
- path: string;
13
- branch: string;
14
- }>>;
15
5
 
16
- export { createWorktree, findNextSessionId, generateDefaultBranchName, getSessionWorktrees, listWorktrees, removeWorktree };
6
+ export { createWorktree, findNextSessionId, generateDefaultBranchName, removeWorktree };
@@ -2,15 +2,11 @@ import {
2
2
  createWorktree,
3
3
  findNextSessionId,
4
4
  generateDefaultBranchName,
5
- getSessionWorktrees,
6
- listWorktrees,
7
5
  removeWorktree
8
- } from "../chunk-GWDGC2OE.js";
6
+ } from "../chunk-Y3GR6XK7.js";
9
7
  export {
10
8
  createWorktree,
11
9
  findNextSessionId,
12
10
  generateDefaultBranchName,
13
- getSessionWorktrees,
14
- listWorktrees,
15
11
  removeWorktree
16
12
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "dev-prism",
3
- "version": "0.2.0",
3
+ "version": "0.4.0",
4
4
  "description": "Minimal CLI for isolated parallel development sessions using git worktrees and Docker Compose",
5
5
  "type": "module",
6
6
  "license": "MIT",
@@ -31,19 +31,29 @@
31
31
  "main": "./dist/index.js",
32
32
  "types": "./dist/index.d.ts",
33
33
  "scripts": {
34
- "build": "tsup src/index.ts src/commands/create.ts src/commands/destroy.ts src/commands/list.ts src/commands/claude.ts src/lib/config.ts src/lib/docker.ts src/lib/env.ts src/lib/ports.ts src/lib/worktree.ts --format esm --dts",
34
+ "build": "tsup src/index.ts src/commands/create.ts src/commands/destroy.ts src/commands/list.ts src/commands/claude.ts src/commands/info.ts src/commands/start.ts src/commands/stop.ts src/commands/stop-all.ts src/commands/prune.ts src/commands/logs.ts src/lib/config.ts src/lib/docker.ts src/lib/env.ts src/lib/ports.ts src/lib/worktree.ts src/lib/store.ts --format esm --dts",
35
35
  "dev": "tsup src/index.ts --format esm --dts --watch",
36
- "typecheck": "tsc --noEmit"
36
+ "typecheck": "tsc --noEmit",
37
+ "test": "vitest run"
37
38
  },
38
39
  "dependencies": {
40
+ "better-sqlite3": "^11.7.0",
39
41
  "chalk": "^5.3.0",
40
42
  "commander": "^11.1.0",
41
43
  "execa": "^8.0.1"
42
44
  },
43
45
  "devDependencies": {
46
+ "@types/better-sqlite3": "^7.6.12",
44
47
  "@types/node": "^20.10.0",
45
48
  "tsup": "^8.0.1",
46
- "typescript": "^5.3.2"
49
+ "typescript": "^5.3.2",
50
+ "vitest": "^3.0.0"
51
+ },
52
+ "pnpm": {
53
+ "onlyBuiltDependencies": [
54
+ "better-sqlite3",
55
+ "esbuild"
56
+ ]
47
57
  },
48
58
  "engines": {
49
59
  "node": ">=18"