tina4-nodejs 3.13.66 → 3.13.67

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/CLAUDE.md CHANGED
@@ -1,10 +1,10 @@
1
- # CLAUDE.md - AI Developer Guide for tina4-nodejs (v3.13.66)
1
+ # CLAUDE.md - AI Developer Guide for tina4-nodejs (v3.13.67)
2
2
 
3
3
  > This file helps AI assistants (Claude, Copilot, Cursor, etc.) understand and work on this codebase effectively.
4
4
 
5
5
  ## What This Project Is
6
6
 
7
- Tina4 for Node.js/TypeScript v3.13.66 — The Intelligent Native Application 4ramework. A convention-over-configuration structural paradigm. The developer writes TypeScript; Tina4 is invisible infrastructure.
7
+ Tina4 for Node.js/TypeScript v3.13.67 — The Intelligent Native Application 4ramework. A convention-over-configuration structural paradigm. The developer writes TypeScript; Tina4 is invisible infrastructure.
8
8
 
9
9
  The philosophy: zero ceremony, batteries included, file system as source of truth.
10
10
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "tina4-nodejs",
3
- "version": "3.13.66",
3
+ "version": "3.13.67",
4
4
  "type": "module",
5
5
  "description": "Tina4 for Node.js/TypeScript - 54 built-in features, zero dependencies",
6
6
  "keywords": [
@@ -691,6 +691,44 @@ async function callTool(server: McpServer, name: string, args: Record<string, un
691
691
  }
692
692
  }
693
693
 
694
+ // ── Database Tables Tool (regression #164) ───────────────────
695
+
696
+ console.log("\nDatabase Tables Tool (#164)");
697
+
698
+ {
699
+ // Regression (#164): the database_tables dev-tool must LIST tables. Node
700
+ // (db.getTables()) is already correct; this locks the contract so a future
701
+ // drift — like the PHP getDatabase() fatal that broke the tool from 3.13.14
702
+ // through 3.13.66 — is caught. Uses a REAL in-memory SQLite database via
703
+ // initDatabase (which sets globalThis.__tina4_db, exactly what the handler
704
+ // reads). No mock.
705
+ McpServer._instances = [];
706
+ const orm = await import("../../orm/src/index.js");
707
+ await orm.initDatabase({ url: "sqlite:///:memory:" });
708
+ const db = (globalThis as { __tina4_db?: { execute: (sql: string) => unknown } }).__tina4_db!;
709
+ await db.execute("CREATE TABLE mcp_probe_widget (id INTEGER PRIMARY KEY, name TEXT)");
710
+
711
+ const server = new McpServer("/db-tables", "DB Tables Test");
712
+ registerDevTools(server);
713
+ const { rpc, result } = await callTool(server, "database_tables", {});
714
+
715
+ assert(
716
+ "database_tables — no JSON-RPC error (handler did not fatal)",
717
+ rpc.error === undefined,
718
+ `Got: ${JSON.stringify(rpc)}`,
719
+ );
720
+ assert(
721
+ "database_tables — returns a table list",
722
+ Array.isArray(result),
723
+ `Got: ${JSON.stringify(result)}`,
724
+ );
725
+ assert(
726
+ "database_tables — lists the created table",
727
+ Array.isArray(result) && (result as unknown[]).includes("mcp_probe_widget"),
728
+ `Got: ${JSON.stringify(result)}`,
729
+ );
730
+ }
731
+
694
732
  // ── Summary ──────────────────────────────────────────────────
695
733
 
696
734
  console.log(`\nMCP Tests: ${pass} passed, ${fail} failed`);