@prajwolkc/stk 0.7.1 → 0.8.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.
@@ -2,17 +2,16 @@ import { loadBrainStore, getAllEntries, saveBrainStore } from "./brain-store.js"
2
2
  // ──────────────────────────────────────────
3
3
  // Cloud sync (Supabase-backed)
4
4
  // ──────────────────────────────────────────
5
+ // Public cloud brain — shared by all stk users (read + insert via RLS)
6
+ const STK_CLOUD_URL = "https://ohysrbupgwvvqmhmpnwm.supabase.co";
7
+ const STK_CLOUD_ANON_KEY = "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJzdXBhYmFzZSIsInJlZiI6Im9oeXNyYnVwZ3d2dnFtaG1wbndtIiwicm9sZSI6ImFub24iLCJpYXQiOjE3NzQ0NTQ5MTIsImV4cCI6MjA5MDAzMDkxMn0.cd0PzH-tKtWj_nOTfvEMIR5GWejOhApqciKu18tPxE4";
5
8
  function getCloudConfig() {
6
- const url = process.env.SUPABASE_URL;
7
- const key = process.env.SUPABASE_SERVICE_KEY;
8
- if (!url || !key)
9
- return null;
9
+ const url = process.env.SUPABASE_URL || STK_CLOUD_URL;
10
+ const key = process.env.SUPABASE_ANON_KEY || process.env.SUPABASE_SERVICE_KEY || STK_CLOUD_ANON_KEY;
10
11
  return { url, key };
11
12
  }
12
13
  export async function cloudInsert(entry) {
13
14
  const cloud = getCloudConfig();
14
- if (!cloud)
15
- return false;
16
15
  const res = await fetch(`${cloud.url}/rest/v1/knowledge`, {
17
16
  method: "POST",
18
17
  headers: {
@@ -37,8 +36,7 @@ export async function cloudInsert(entry) {
37
36
  /** Push all local entries to cloud */
38
37
  export async function pushToCloud() {
39
38
  const cloud = getCloudConfig();
40
- if (!cloud)
41
- return { pushed: 0, pulled: 0, errors: ["SUPABASE_URL or SUPABASE_SERVICE_KEY not set"] };
39
+ // Cloud config always available via built-in defaults
42
40
  const store = loadBrainStore();
43
41
  const allLocal = getAllEntries(store);
44
42
  let pushed = 0;
@@ -76,8 +74,7 @@ export async function pushToCloud() {
76
74
  /** Pull cloud entries to local */
77
75
  export async function pullFromCloud() {
78
76
  const cloud = getCloudConfig();
79
- if (!cloud)
80
- return { pushed: 0, pulled: 0, errors: ["SUPABASE_URL or SUPABASE_SERVICE_KEY not set"] };
77
+ // Cloud config always available via built-in defaults
81
78
  const store = loadBrainStore();
82
79
  const localIds = new Set(getAllEntries(store).map(e => e.id));
83
80
  let pulled = 0;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@prajwolkc/stk",
3
- "version": "0.7.1",
3
+ "version": "0.8.0",
4
4
  "description": "One CLI to deploy, monitor, debug, and learn about your entire stack. Infrastructure monitoring, knowledge base brain, deploy watching, and GitHub issues — all from one command.",
5
5
  "type": "module",
6
6
  "license": "MIT",