sandstream-kit 1.1.0 → 1.2.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.
@@ -113,12 +113,43 @@ export async function checkWebSearch(config) {
113
113
  };
114
114
  }
115
115
  case "google":
116
- return {
117
- provider,
118
- configured: true,
119
- healthy: true,
120
- error: "Google Search not yet implemented in kit",
121
- };
116
+ if (!config.apiKey || !config.cx) {
117
+ return {
118
+ provider,
119
+ configured: false,
120
+ healthy: false,
121
+ error: "Google Custom Search needs web.search.apiKey + web.search.cx (Programmable Search engine id)",
122
+ };
123
+ }
124
+ try {
125
+ // Custom Search JSON API — key + cx are query params by design.
126
+ const response = await fetchWithTimeout(`https://www.googleapis.com/customsearch/v1?key=${encodeURIComponent(config.apiKey)}&cx=${encodeURIComponent(config.cx)}&q=test&num=1`);
127
+ if (response.ok) {
128
+ return { provider, configured: true, healthy: true };
129
+ }
130
+ if (response.status === 400 || response.status === 401 || response.status === 403) {
131
+ return {
132
+ provider,
133
+ configured: true,
134
+ healthy: false,
135
+ error: "Invalid Google API key or cx (request rejected)",
136
+ };
137
+ }
138
+ return {
139
+ provider,
140
+ configured: true,
141
+ healthy: false,
142
+ error: `API returned status ${response.status}`,
143
+ };
144
+ }
145
+ catch (err) {
146
+ return {
147
+ provider,
148
+ configured: true,
149
+ healthy: false,
150
+ error: err instanceof Error ? err.message : "API check failed",
151
+ };
152
+ }
122
153
  case "custom":
123
154
  if (!url) {
124
155
  return {
@@ -1 +1 @@
1
- {"version":3,"file":"check-web-search.js","sourceRoot":"","sources":["../src/check-web-search.ts"],"names":[],"mappings":"AAEA;;GAEG;AACH,KAAK,UAAU,gBAAgB,CAC7B,GAAW,EACX,IAAyC;IAEzC,MAAM,EAAE,OAAO,EAAE,SAAS,GAAG,IAAI,EAAE,GAAG,SAAS,EAAE,GAAG,IAAI,IAAI,EAAE,CAAC;IAC/D,MAAM,UAAU,GAAG,IAAI,eAAe,EAAE,CAAC;IACzC,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KAAK;oBACd,GAAG;oBACH,KAAK,EAAE,uBAAuB,QAAQ,CAAC,MAAM,EAAE;iBAChD,CAAC;YACJ,CAAC;YAAC,OAAO,GAAG,EAAE,CAAC;gBACb,OAAO;oBACL,QAAQ;oBACR,UAAU,EAAE,IAAI;oBAChB,OAAO,EAAE,KAAK;oBACd,GAAG;oBACH,KAAK,EAAE,GAAG,YAAY,KAAK,CAAC,CAAC,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC,CAAC,kBAAkB;iBAC/D,CAAC;YACJ,CAAC;QAEH;YACE,OAAO;gBACL,QAAQ;gBACR,UAAU,EAAE,KAAK;gBACjB,OAAO,EAAE,KAAK;gBACd,KAAK,EAAE,qBAAqB,QAAQ,EAAE;aACvC,CAAC;IACN,CAAC;AACH,CAAC"}
package/dist/cli.js CHANGED
@@ -56,6 +56,7 @@ import { cmdFix } from "./fix.js";
56
56
  import { promptConfirm } from "./utils/prompt.js";
57
57
  import { startMcpServer } from "./mcp-server.js";
58
58
  import { c } from "./utils/colors.js";
59
+ import { gatherStatus } from "./status.js";
59
60
  import { runDoctor } from "./doctor.js";
60
61
  import { inspectEnv } from "./env-inspect.js";
61
62
  import { detectStack } from "./stack-detector.js";
@@ -69,12 +70,13 @@ import { gatherProjectContext } from "./context.js";
69
70
  import { runTriage, listTriageTools } from "./triage.js";
70
71
  import { parsePkgSpec, installPkg } from "./pkg.js";
71
72
  import { openMemoryDb, getStats, getMemoryDbPath, searchMessages } from "./memory/db.js";
72
- import { indexClaudeTranscripts, getClaudeProjectsDir } from "./memory/parser.js";
73
+ import { indexAllHarnesses } from "./memory/parser.js";
74
+ import { mergeDb } from "./memory/merge.js";
73
75
  import { getCurrentProjectRoot } from "./memory/project.js";
74
76
  import { scanDbForSecrets } from "./memory/scan.js";
75
77
  import { backupEncrypted, restoreEncrypted } from "./memory/backup.js";
76
78
  import { shareEntry, listAreas, queryArea, getSharedPath, } from "./memory/shared.js";
77
- import { userPromptSubmitReminder, runSessionEndIndex } from "./memory/hook.js";
79
+ import { userPromptSubmitReminder, runSessionEndIndex, sessionStartRecovery } from "./memory/hook.js";
78
80
  import { installMemoryHooks, uninstallMemoryHooks, getClaudeSettingsPath, } from "./memory/install.js";
79
81
  import { palAdd, palList, palDone, palSnooze, palAutoVerify, importLegacyLedger, } from "./memory/pal.js";
80
82
  import { saveThread, listThreads, removeThread, latestSessionId, resolveThread, } from "./memory/threads.js";
@@ -3329,6 +3331,21 @@ async function cmdContext() {
3329
3331
  return false;
3330
3332
  }
3331
3333
  }
3334
+ async function cmdStatus() {
3335
+ const items = await gatherStatus();
3336
+ if (hasFlag(process.argv, "--json")) {
3337
+ console.log(JSON.stringify(items, null, 2));
3338
+ return true;
3339
+ }
3340
+ const done = items.filter((i) => i.ok).length;
3341
+ console.log(`${c.bold}kit status${c.reset} ${c.dim}${done}/${items.length} set up${c.reset}`);
3342
+ for (const item of items) {
3343
+ const mark = item.ok ? `${c.green}✓${c.reset}` : `${c.yellow}○${c.reset}`;
3344
+ const hint = !item.ok && item.hint ? ` ${c.dim}→ ${item.hint}${c.reset}` : "";
3345
+ console.log(` ${mark} ${item.label} ${c.dim}${item.detail}${c.reset}${hint}`);
3346
+ }
3347
+ return true;
3348
+ }
3332
3349
  async function cmdWhoami() {
3333
3350
  const jsonMode = hasFlag(process.argv, "--json");
3334
3351
  let config = {};
@@ -3400,12 +3417,14 @@ function cmdVersion() {
3400
3417
  return true;
3401
3418
  }
3402
3419
  const COMMAND_HELP = {
3420
+ status: "Adoption checklist — what's set up across kit + the next step for each gap",
3403
3421
  check: "Check status of all tools, services, secrets, and lock files",
3404
3422
  memory: "Local conversation memory — index transcripts + show stats",
3405
3423
  "memory index": "Index ~/.claude transcripts into the SQLite memory store",
3406
3424
  "memory search": "Full-text search memory (current project; --global for all)",
3407
3425
  "memory stats": "Show what the local memory store contains",
3408
- "memory install": "Wire UserPromptSubmit + SessionEnd hooks into ~/.claude/settings.json",
3426
+ "memory merge": "Merge another machine's memory.db into this one (dedup by uuid)",
3427
+ "memory install": "Wire UserPromptSubmit + SessionEnd + SessionStart (recovery) hooks into ~/.claude/settings.json",
3409
3428
  "memory scan": "Scan the memory store for stored secrets (exit 1 if any found)",
3410
3429
  "memory backup": "Encrypted backup of the memory store (AES-256-GCM; KIT_MEMORY_PASSPHRASE)",
3411
3430
  "memory restore": "Restore an encrypted memory backup (e.g. on a new machine)",
@@ -3896,6 +3915,7 @@ async function cmdMemory() {
3896
3915
  console.log(" kit memory index Index ~/.claude transcripts into the memory store");
3897
3916
  console.log(" kit memory search <query> Search memory (current project; --global for all)");
3898
3917
  console.log(" kit memory stats Show what the memory store contains");
3918
+ console.log(" kit memory merge <file> Merge another machine's memory.db into this one");
3899
3919
  console.log(" kit memory install Wire the 2 hooks into ~/.claude/settings.json");
3900
3920
  console.log(" kit memory uninstall Remove the hooks");
3901
3921
  console.log(" kit memory pal [list|add|done|snooze|verify|import] Pending action ledger");
@@ -3914,15 +3934,48 @@ async function cmdMemory() {
3914
3934
  if (subcommand === "index") {
3915
3935
  const db = openMemoryDb();
3916
3936
  const t0 = Date.now();
3917
- const res = indexClaudeTranscripts(db);
3937
+ const byHarness = indexAllHarnesses(db);
3918
3938
  const ms = Date.now() - t0;
3919
3939
  db.close();
3920
3940
  if (jsonMode) {
3921
- console.log(JSON.stringify({ ...res, ms }));
3941
+ console.log(JSON.stringify({ byHarness, ms }));
3922
3942
  return true;
3923
3943
  }
3924
- console.log(`${c.green}✓${c.reset} indexed ${c.bold}${res.messages}${c.reset} messages + ${res.toolUses} tool-uses from ${res.files} sessions ${c.dim}(${ms}ms)${c.reset}`);
3925
- console.log(`${c.dim}source: ${getClaudeProjectsDir()}${c.reset}`);
3944
+ let messages = 0;
3945
+ let toolUses = 0;
3946
+ let files = 0;
3947
+ let skipped = 0;
3948
+ for (const r of Object.values(byHarness)) {
3949
+ messages += r.messages;
3950
+ toolUses += r.toolUses;
3951
+ files += r.files;
3952
+ skipped += r.filesSkipped;
3953
+ }
3954
+ console.log(`${c.green}✓${c.reset} indexed ${c.bold}${messages}${c.reset} messages + ${toolUses} tool-uses from ${files} sessions${skipped ? `, ${skipped} unchanged` : ""} ${c.dim}(${ms}ms)${c.reset}`);
3955
+ for (const [harness, r] of Object.entries(byHarness)) {
3956
+ if (r.files || r.messages) {
3957
+ console.log(` ${c.dim}${harness}: ${r.messages} msg · ${r.files} sessions${r.filesSkipped ? ` · ${r.filesSkipped} unchanged` : ""}${c.reset}`);
3958
+ }
3959
+ }
3960
+ return true;
3961
+ }
3962
+ if (subcommand === "merge") {
3963
+ const sourcePath = process.argv[4];
3964
+ if (!sourcePath) {
3965
+ console.error(`${c.red}usage: kit memory merge <other-machine-memory.db>${c.reset}`);
3966
+ return false;
3967
+ }
3968
+ const db = openMemoryDb();
3969
+ try {
3970
+ const r = mergeDb(db, sourcePath);
3971
+ console.log(`${c.green}✓${c.reset} merged ${c.bold}${r.messages}${c.reset} messages + ${r.toolUses} tool-uses · ${r.sessions} sessions · ${r.pending} pending · ${r.threads} copilots ${c.dim}from ${sourcePath}${c.reset}`);
3972
+ }
3973
+ catch (err) {
3974
+ db.close();
3975
+ console.error(`${c.red}${err.message}${c.reset}`);
3976
+ return false;
3977
+ }
3978
+ db.close();
3926
3979
  return true;
3927
3980
  }
3928
3981
  if (subcommand === "stats") {
@@ -3984,6 +4037,12 @@ async function cmdMemory() {
3984
4037
  runSessionEndIndex();
3985
4038
  return true;
3986
4039
  }
4040
+ if (event === "session-start") {
4041
+ const text = sessionStartRecovery();
4042
+ if (text)
4043
+ console.log(text);
4044
+ return true;
4045
+ }
3987
4046
  console.error(`${c.red}Unknown hook event: ${event ?? "(none)"}${c.reset}`);
3988
4047
  return false;
3989
4048
  }
@@ -4379,6 +4438,9 @@ async function main() {
4379
4438
  ok = true;
4380
4439
  break;
4381
4440
  }
4441
+ case "status":
4442
+ ok = await cmdStatus();
4443
+ break;
4382
4444
  case "whoami":
4383
4445
  ok = await cmdWhoami();
4384
4446
  break;