gsd-pi 2.35.0-dev.55dcc60 → 2.35.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.
@@ -3,9 +3,6 @@
3
3
  *
4
4
  * Contains: InspectData type, formatInspectOutput, handleInspect
5
5
  */
6
- import { existsSync } from "node:fs";
7
- import { join } from "node:path";
8
- import { gsdRoot } from "./paths.js";
9
6
  import { getErrorMessage } from "./error-utils.js";
10
7
  export function formatInspectOutput(data) {
11
8
  const lines = [];
@@ -33,14 +30,10 @@ export function formatInspectOutput(data) {
33
30
  }
34
31
  export async function handleInspect(ctx) {
35
32
  try {
36
- const { isDbAvailable, _getAdapter, openDatabase } = await import("./gsd-db.js");
33
+ const { isDbAvailable, _getAdapter } = await import("./gsd-db.js");
37
34
  if (!isDbAvailable()) {
38
- const gsdDir = gsdRoot(process.cwd());
39
- const dbPath = join(gsdDir, "gsd.db");
40
- if (!existsSync(gsdDir) || !existsSync(dbPath) || !openDatabase(dbPath)) {
41
- ctx.ui.notify("No GSD database available. Run /gsd auto to create one.", "info");
42
- return;
43
- }
35
+ ctx.ui.notify("No GSD database available. Run /gsd auto to create one.", "info");
36
+ return;
44
37
  }
45
38
  const adapter = _getAdapter();
46
39
  if (!adapter) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "gsd-pi",
3
- "version": "2.35.0-dev.55dcc60",
3
+ "version": "2.35.0",
4
4
  "description": "GSD — Get Shit Done coding agent",
5
5
  "license": "MIT",
6
6
  "repository": {
@@ -5,9 +5,6 @@
5
5
  */
6
6
 
7
7
  import type { ExtensionCommandContext } from "@gsd/pi-coding-agent";
8
- import { existsSync } from "node:fs";
9
- import { join } from "node:path";
10
- import { gsdRoot } from "./paths.js";
11
8
  import { getErrorMessage } from "./error-utils.js";
12
9
 
13
10
  export interface InspectData {
@@ -47,15 +44,11 @@ export function formatInspectOutput(data: InspectData): string {
47
44
 
48
45
  export async function handleInspect(ctx: ExtensionCommandContext): Promise<void> {
49
46
  try {
50
- const { isDbAvailable, _getAdapter, openDatabase } = await import("./gsd-db.js");
47
+ const { isDbAvailable, _getAdapter } = await import("./gsd-db.js");
51
48
 
52
49
  if (!isDbAvailable()) {
53
- const gsdDir = gsdRoot(process.cwd());
54
- const dbPath = join(gsdDir, "gsd.db");
55
- if (!existsSync(gsdDir) || !existsSync(dbPath) || !openDatabase(dbPath)) {
56
- ctx.ui.notify("No GSD database available. Run /gsd auto to create one.", "info");
57
- return;
58
- }
50
+ ctx.ui.notify("No GSD database available. Run /gsd auto to create one.", "info");
51
+ return;
59
52
  }
60
53
 
61
54
  const adapter = _getAdapter();
@@ -1,46 +0,0 @@
1
- import test from "node:test";
2
- import assert from "node:assert/strict";
3
- import os from "node:os";
4
- import path from "node:path";
5
- import fs from "node:fs";
6
-
7
- import { handleInspect } from "../commands-inspect.ts";
8
- import { closeDatabase, openDatabase } from "../gsd-db.ts";
9
-
10
- test("/gsd inspect opens existing database when it was not yet opened in session", async () => {
11
- closeDatabase();
12
-
13
- const tmp = fs.mkdtempSync(path.join(os.tmpdir(), "gsd-inspect-db-"));
14
- const prevCwd = process.cwd();
15
-
16
- try {
17
- const gsdDir = path.join(tmp, ".gsd");
18
- fs.mkdirSync(gsdDir, { recursive: true });
19
- const dbPath = path.join(gsdDir, "gsd.db");
20
-
21
- assert.equal(openDatabase(dbPath), true);
22
- closeDatabase();
23
-
24
- process.chdir(tmp);
25
-
26
- const notifications: Array<{ message: string; level: string }> = [];
27
- const ctx = {
28
- ui: {
29
- notify(message: string, level: string) {
30
- notifications.push({ message, level });
31
- },
32
- },
33
- } as any;
34
-
35
- await handleInspect(ctx);
36
-
37
- assert.equal(notifications.length, 1);
38
- assert.equal(notifications[0].level, "info");
39
- assert.match(notifications[0].message, /=== GSD Database Inspect ===/);
40
- assert.doesNotMatch(notifications[0].message, /No GSD database available/);
41
- } finally {
42
- process.chdir(prevCwd);
43
- closeDatabase();
44
- fs.rmSync(tmp, { recursive: true, force: true });
45
- }
46
- });