stacks-ai 0.2.4 → 0.2.5

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/LICENSE ADDED
@@ -0,0 +1,49 @@
1
+ Stacks Community License v1.0
2
+
3
+ Copyright (c) 2025 Jason Kneen
4
+
5
+ TERMS AND CONDITIONS
6
+
7
+ 1. DEFINITIONS
8
+
9
+ "Software" refers to Stacks and all associated source code, documentation, and assets.
10
+ "Personal Use" means use by an individual for non-commercial purposes.
11
+ "Commercial Use" means any use within a business, for-profit organization, or any activity that generates revenue directly or indirectly.
12
+ "Open Source Distribution" means distribution of modified or unmodified versions of the Software under this same license.
13
+
14
+ 2. PERSONAL USE
15
+
16
+ Permission is hereby granted, free of charge, to any person obtaining a copy of this Software, to use, copy, modify, and distribute the Software for Personal Use, subject to the following conditions:
17
+
18
+ - The above copyright notice and this license shall be included in all copies or substantial portions of the Software.
19
+ - The Software is provided "as is", without warranty of any kind.
20
+
21
+ 3. OPEN SOURCE DISTRIBUTION
22
+
23
+ You may fork, modify, rebrand, and redistribute this Software under a different name, provided that:
24
+
25
+ - The redistributed software remains open source under this same license
26
+ - The original copyright notice is retained
27
+ - A link to the original repository is included in documentation
28
+ - The redistributed software includes this license file
29
+
30
+ 4. COMMERCIAL USE
31
+
32
+ Commercial Use of this Software requires a paid license. A one-time license fee of $49 USD grants:
33
+
34
+ - Unlimited commercial use
35
+ - Right to modify and incorporate into commercial products
36
+ - No attribution requirement in commercial products
37
+ - Perpetual license with no recurring fees
38
+
39
+ To purchase a commercial license, visit: http://bit.ly/4aNe23d
40
+
41
+ Using this Software for Commercial Use without a valid license is a violation of these terms.
42
+
43
+ 5. DISCLAIMER
44
+
45
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
46
+
47
+ 6. TERMINATION
48
+
49
+ This license automatically terminates if you violate any of these terms. Upon termination, you must destroy all copies of the Software in your possession.
package/README.md CHANGED
@@ -86,7 +86,15 @@ When you run `npx stacks-ai` or `stacks-ai`:
86
86
 
87
87
  ## License
88
88
 
89
- MIT
89
+ **Stacks Community License v1.0**
90
+
91
+ - **Personal Use**: Free to use, modify, and distribute for personal, non-commercial purposes
92
+ - **Open Source Distribution**: Free to fork, rebrand, and publish under a different name, provided it remains open source under this same license
93
+ - **Commercial Use**: Requires a one-time license fee of $49 USD. Commercial use includes any use within a business, for-profit organization, or any revenue-generating activity. Purchase at [bit.ly/4aNe23d](http://bit.ly/4aNe23d)
94
+
95
+ Commercial license grants unrestricted use of the code for your business.
96
+
97
+ See [LICENSE](LICENSE) for full terms.
90
98
 
91
99
  ## Author
92
100
 
package/bin/stacks.cjs CHANGED
@@ -9,15 +9,31 @@ const https = require('https')
9
9
  const APP_NAME = 'stacks-ai'
10
10
  const APP_DIR = path.join(__dirname, '..')
11
11
  const CACHE_DIR = path.join(os.homedir(), '.stacks')
12
+ const LEGACY_CACHE_DIR = path.join(os.homedir(), '.spatial')
12
13
  const ELECTRON_CACHE = path.join(CACHE_DIR, 'electron')
13
14
  const UPDATE_CHECK_FILE = path.join(CACHE_DIR, 'last-update-check')
14
15
  const PID_FILE = path.join(CACHE_DIR, 'stacks.pid')
15
16
  const UPDATE_CHECK_INTERVAL = 24 * 60 * 60 * 1000
16
17
 
18
+ function migrateLegacyData() {
19
+ if (!fs.existsSync(LEGACY_CACHE_DIR)) return
20
+
21
+ const filesToMigrate = ['canvas.db', 'mcp-proxy-config.json']
22
+ filesToMigrate.forEach(file => {
23
+ const legacyPath = path.join(LEGACY_CACHE_DIR, file)
24
+ const newPath = path.join(CACHE_DIR, file)
25
+ if (fs.existsSync(legacyPath) && !fs.existsSync(newPath)) {
26
+ fs.copyFileSync(legacyPath, newPath)
27
+ console.log(`Migrated ${file} from ~/.spatial to ~/.stacks`)
28
+ }
29
+ })
30
+ }
31
+
17
32
  function ensureCacheDir() {
18
33
  if (!fs.existsSync(CACHE_DIR)) {
19
34
  fs.mkdirSync(CACHE_DIR, { recursive: true })
20
35
  }
36
+ migrateLegacyData()
21
37
  if (!fs.existsSync(ELECTRON_CACHE)) {
22
38
  fs.mkdirSync(ELECTRON_CACHE, { recursive: true })
23
39
  }
package/dist/mcp/proxy.js CHANGED
@@ -7,22 +7,26 @@
7
7
  */
8
8
  import { WebSocketServer } from "ws";
9
9
  import { spawn } from "child_process";
10
- import { existsSync, readFileSync, writeFileSync, mkdirSync } from "fs";
10
+ import { existsSync, readFileSync, writeFileSync, mkdirSync, copyFileSync } from "fs";
11
11
  import { homedir } from "os";
12
12
  import { join } from "path";
13
- // Config paths
14
13
  const configDir = join(homedir(), ".stacks");
14
+ const legacyConfigDir = join(homedir(), ".spatial");
15
15
  const configPath = join(configDir, "mcp-proxy-config.json");
16
+ const legacyConfigPath = join(legacyConfigDir, "mcp-proxy-config.json");
16
17
  // Default config
17
18
  const DEFAULT_CONFIG = {
18
19
  port: 3099,
19
20
  servers: {}
20
21
  };
21
- // Load/save config
22
22
  function loadConfig() {
23
23
  if (!existsSync(configDir)) {
24
24
  mkdirSync(configDir, { recursive: true });
25
25
  }
26
+ if (existsSync(legacyConfigPath) && !existsSync(configPath)) {
27
+ copyFileSync(legacyConfigPath, configPath);
28
+ console.log("Migrated MCP config from ~/.spatial to ~/.stacks");
29
+ }
26
30
  if (!existsSync(configPath)) {
27
31
  writeFileSync(configPath, JSON.stringify(DEFAULT_CONFIG, null, 2));
28
32
  return DEFAULT_CONFIG;
@@ -3,15 +3,22 @@ import { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js";
3
3
  import { StdioServerTransport } from "@modelcontextprotocol/sdk/server/stdio.js";
4
4
  import { z } from "zod";
5
5
  import Database from "better-sqlite3";
6
- import { existsSync, mkdirSync } from "fs";
6
+ import { existsSync, mkdirSync, copyFileSync } from "fs";
7
7
  import { homedir } from "os";
8
8
  import { join } from "path";
9
- // Database setup
10
- const dataDir = join(homedir(), ".stacks");
11
- if (!existsSync(dataDir)) {
12
- mkdirSync(dataDir, { recursive: true });
9
+ const newDataDir = join(homedir(), ".stacks");
10
+ const legacyDataDir = join(homedir(), ".spatial");
11
+ const legacyDbPath = join(legacyDataDir, "canvas.db");
12
+ const newDbPath = join(newDataDir, "canvas.db");
13
+ if (!existsSync(newDataDir)) {
14
+ mkdirSync(newDataDir, { recursive: true });
13
15
  }
14
- const db = new Database(join(dataDir, "canvas.db"));
16
+ if (existsSync(legacyDbPath) && !existsSync(newDbPath)) {
17
+ copyFileSync(legacyDbPath, newDbPath);
18
+ console.error("Migrated database from ~/.spatial to ~/.stacks");
19
+ }
20
+ const dataDir = newDataDir;
21
+ const db = new Database(newDbPath);
15
22
  // Initialize schema
16
23
  db.exec(`
17
24
  CREATE TABLE IF NOT EXISTS spaces (
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "stacks-ai",
3
- "version": "0.2.4",
3
+ "version": "0.2.5",
4
4
  "description": "Stacks - AI-powered infinite canvas for notes, images, and creative organization",
5
5
  "author": "Jason Kneen",
6
6
  "license": "MIT",