claudeboard 2.15.4 → 3.1.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.
@@ -1,74 +0,0 @@
1
- import { createClient } from "@supabase/supabase-js";
2
-
3
- let client = null;
4
-
5
- export function initSupabaseReader(url, key) {
6
- client = createClient(url, key);
7
- }
8
-
9
- /**
10
- * Read recent logs from a logs table
11
- * Returns array of log entries
12
- */
13
- export async function readRecentLogs(table = "logs", limit = 50) {
14
- if (!client) return [];
15
- try {
16
- const { data, error } = await client
17
- .from(table)
18
- .select("*")
19
- .order("created_at", { ascending: false })
20
- .limit(limit);
21
- if (error) return [{ error: error.message }];
22
- return data || [];
23
- } catch (err) {
24
- return [{ error: err.message }];
25
- }
26
- }
27
-
28
- /**
29
- * Read error logs specifically
30
- */
31
- export async function readErrorLogs(table = "logs", limit = 20) {
32
- if (!client) return [];
33
- try {
34
- const { data } = await client
35
- .from(table)
36
- .select("*")
37
- .or("level.eq.error,level.eq.Error,type.eq.error")
38
- .order("created_at", { ascending: false })
39
- .limit(limit);
40
- return data || [];
41
- } catch {
42
- return [];
43
- }
44
- }
45
-
46
- /**
47
- * List all tables in the project's Supabase
48
- */
49
- export async function listTables() {
50
- if (!client) return [];
51
- try {
52
- const { data } = await client
53
- .from("information_schema.tables")
54
- .select("table_name")
55
- .eq("table_schema", "public");
56
- return data?.map((r) => r.table_name) || [];
57
- } catch {
58
- return [];
59
- }
60
- }
61
-
62
- /**
63
- * Sample data from a table (for QA context)
64
- */
65
- export async function sampleTable(tableName, limit = 5) {
66
- if (!client) return [];
67
- try {
68
- const { data, error } = await client.from(tableName).select("*").limit(limit);
69
- if (error) return [{ error: error.message }];
70
- return data || [];
71
- } catch (err) {
72
- return [{ error: err.message }];
73
- }
74
- }
package/tools/terminal.js DELETED
@@ -1,63 +0,0 @@
1
- import { exec, spawn } from "child_process";
2
- import { promisify } from "util";
3
- import { createConnection } from "net";
4
-
5
- const execAsync = promisify(exec);
6
- const isWin = process.platform === "win32";
7
-
8
- /**
9
- * Run a shell command in a given directory, return { stdout, stderr, exitCode }
10
- */
11
- export async function runCommand(cmd, cwd, timeoutMs = 60000) {
12
- try {
13
- const { stdout, stderr } = await execAsync(cmd, {
14
- cwd,
15
- timeout: timeoutMs,
16
- env: { ...process.env, CI: "true", FORCE_COLOR: "0" },
17
- shell: isWin ? "cmd.exe" : "/bin/sh",
18
- });
19
- return { stdout: stdout.trim(), stderr: stderr.trim(), exitCode: 0 };
20
- } catch (err) {
21
- return {
22
- stdout: err.stdout?.trim() || "",
23
- stderr: err.stderr?.trim() || err.message,
24
- exitCode: err.code || 1,
25
- };
26
- }
27
- }
28
-
29
- /**
30
- * Start a long-running process (e.g. expo start) and return kill function + log stream
31
- */
32
- export function startProcess(cmd, args, cwd, onLog) {
33
- const proc = spawn(cmd, args, {
34
- cwd,
35
- env: { ...process.env, FORCE_COLOR: "0" },
36
- stdio: ["ignore", "pipe", "pipe"],
37
- });
38
-
39
- proc.stdout.on("data", (d) => onLog(d.toString()));
40
- proc.stderr.on("data", (d) => onLog(d.toString()));
41
-
42
- return {
43
- kill: () => proc.kill("SIGTERM"),
44
- pid: proc.pid,
45
- };
46
- }
47
-
48
- /**
49
- * Check if a port is in use — uses a TCP connection probe (cross-platform, no curl needed)
50
- */
51
- export async function waitForPort(port, timeoutMs = 30000) {
52
- const start = Date.now();
53
- while (Date.now() - start < timeoutMs) {
54
- const open = await new Promise((resolve) => {
55
- const sock = createConnection({ port, host: "127.0.0.1" });
56
- sock.once("connect", () => { sock.destroy(); resolve(true); });
57
- sock.once("error", () => { sock.destroy(); resolve(false); });
58
- });
59
- if (open) return true;
60
- await new Promise((r) => setTimeout(r, 1000));
61
- }
62
- return false;
63
- }