sweet-search 2.5.4 → 2.5.6

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "sweet-search",
3
- "version": "2.5.4",
3
+ "version": "2.5.6",
4
4
  "description": "Sweet Search - SOTA Hybrid Code Search Engine with WASM CatBoost Query Router, Semantic/Lexical/Structural Search, and Multilingual Support",
5
5
  "type": "module",
6
6
  "main": "core/search/sweet-search.js",
@@ -13,12 +13,12 @@
13
13
  "author": "Marko Sladojevic <marko@panonit.com> (https://panonit.com)",
14
14
  "repository": {
15
15
  "type": "git",
16
- "url": "git+https://github.com/panonitorg/sweet-search.git"
16
+ "url": "git+https://github.com/mrsladoje/sweet-search.git"
17
17
  },
18
18
  "bugs": {
19
- "url": "https://github.com/panonitorg/sweet-search/issues"
19
+ "url": "https://github.com/mrsladoje/sweet-search/issues"
20
20
  },
21
- "homepage": "https://github.com/panonitorg/sweet-search#readme",
21
+ "homepage": "https://github.com/mrsladoje/sweet-search#readme",
22
22
  "keywords": [
23
23
  "sweet-search",
24
24
  "code-search",
@@ -50,8 +50,11 @@
50
50
  "core/vector-store/",
51
51
  "core/query/",
52
52
  "core/skills/",
53
+ "core/banner/",
54
+ "assets/banner/",
53
55
  "mcp/",
54
56
  "scripts/benchmark-harness.js",
57
+ "scripts/postinstall-banner.js",
55
58
  "scripts/init.js",
56
59
  "scripts/uninstall.js",
57
60
  "scripts/verify-runtime.js",
@@ -78,6 +81,8 @@
78
81
  ],
79
82
  "scripts": {
80
83
  "init": "node scripts/init.js",
84
+ "postinstall": "node scripts/postinstall-banner.js",
85
+ "bake:banner": "node scripts/bake-banner.mjs",
81
86
  "build:assets": "node scripts/generate-asset-manifest.js",
82
87
  "lint": "eslint core/",
83
88
  "build": "node -e \"import('./core/search/sweet-search.js')\" && echo 'Build OK'",
@@ -143,7 +148,6 @@
143
148
  "sharp": "^0.34.5",
144
149
  "tree-sitter-wasms": "^0.1.13",
145
150
  "undici": "^6.23.0",
146
- "usearch": "^2.21.4",
147
151
  "web-tree-sitter": "^0.25.10",
148
152
  "zod": "^4.3.6"
149
153
  },
@@ -153,16 +157,18 @@
153
157
  "eslint": "^9.39.4",
154
158
  "fast-check": "^4.5.3",
155
159
  "p-map": "^7.0.4",
160
+ "puppeteer-core": "^25.1.0",
156
161
  "typescript": "^5.9.3",
157
162
  "vitest": "^4.0.16"
158
163
  },
159
164
  "optionalDependencies": {
160
- "@sweet-search/native-darwin-arm64": "2.5.4",
161
- "@sweet-search/native-darwin-x64": "2.5.4",
162
- "@sweet-search/native-linux-arm64-gnu": "2.5.4",
163
- "@sweet-search/native-linux-arm64-gnu-cuda": "2.5.4",
164
- "@sweet-search/native-linux-x64-gnu": "2.5.4",
165
- "@sweet-search/native-linux-x64-gnu-cuda": "2.5.4"
165
+ "usearch": "^2.21.4",
166
+ "@sweet-search/native-darwin-arm64": "2.5.6",
167
+ "@sweet-search/native-darwin-x64": "2.5.6",
168
+ "@sweet-search/native-linux-arm64-gnu": "2.5.6",
169
+ "@sweet-search/native-linux-arm64-gnu-cuda": "2.5.6",
170
+ "@sweet-search/native-linux-x64-gnu": "2.5.6",
171
+ "@sweet-search/native-linux-x64-gnu-cuda": "2.5.6"
166
172
  },
167
173
  "engines": {
168
174
  "node": ">=18.0.0"
package/scripts/init.js CHANGED
@@ -1450,6 +1450,12 @@ export async function runInit(args) {
1450
1450
  return;
1451
1451
  }
1452
1452
 
1453
+ // 0. Animated banner (best-effort; only on an interactive TTY, never in CI/pipes).
1454
+ if (process.stdout.isTTY && !process.env.CI && !process.env.NO_BANNER && !process.env.SWEET_SEARCH_NO_BANNER) {
1455
+ // query:false — init is interactive (readline); avoid any stdin contention with the terminal capability probe.
1456
+ try { const { showBanner } = await import('../core/banner/render-banner.js'); await showBanner({ query: false }); } catch { /* non-fatal */ }
1457
+ }
1458
+
1453
1459
  // 1. Node.js version check
1454
1460
  checkNodeVersion();
1455
1461
 
@@ -2016,7 +2022,7 @@ function runCoremlCascadeBuild(options = {}) {
2016
2022
  ` The CoreML cascade build path currently requires a local clone\n` +
2017
2023
  ` of the sweet-search repository — it is not yet shipped via npm.\n` +
2018
2024
  ` To build the cascade:\n` +
2019
- ` git clone https://github.com/panonitorg/sweet-search\n` +
2025
+ ` git clone https://github.com/mrsladoje/sweet-search\n` +
2020
2026
  ` cd sweet-search\n` +
2021
2027
  ` node scripts/build-coreml-cascade.js\n` +
2022
2028
  ` Then point your install at the managed cache (init detects it).`,
@@ -0,0 +1,46 @@
1
+ #!/usr/bin/env node
2
+ /**
3
+ * postinstall — play the animated banner once after install.
4
+ *
5
+ * npm pipes lifecycle-script stdout (it's not a TTY), so we render to the
6
+ * controlling terminal directly via /dev/tty when possible. This is Unix-only;
7
+ * on Windows (no /dev/tty) or when there is no controlling terminal (CI, detached,
8
+ * sandboxed installs) we simply skip.
9
+ *
10
+ * Defensive by design: renders only to a real terminal, honours CI / NO_BANNER /
11
+ * SWEET_SEARCH_NO_BANNER, swallows every error, and always exits 0 so it can never
12
+ * fail `npm install`.
13
+ */
14
+ import process from 'node:process';
15
+ import tty from 'node:tty';
16
+ import { openSync, closeSync } from 'node:fs';
17
+ import { dirname, join } from 'node:path';
18
+ import { fileURLToPath } from 'node:url';
19
+
20
+ async function run() {
21
+ const env = process.env;
22
+ if (env.CI || env.NO_BANNER || env.SWEET_SEARCH_NO_BANNER) return;
23
+
24
+ // Pick an output stream that is a real terminal.
25
+ let stream = process.stdout.isTTY ? process.stdout : null;
26
+ let ownedFd = -1;
27
+ if (!stream && process.platform !== 'win32') {
28
+ try {
29
+ ownedFd = openSync('/dev/tty', 'r+'); // throws if no controlling terminal
30
+ const s = new tty.WriteStream(ownedFd);
31
+ if (s.isTTY) stream = s;
32
+ } catch { /* no controlling terminal — skip */ }
33
+ }
34
+ if (!stream) return;
35
+
36
+ try {
37
+ const here = dirname(fileURLToPath(import.meta.url));
38
+ const { showBanner } = await import(join(here, '..', 'core', 'banner', 'render-banner.js'));
39
+ // query:false — we have no matching stdin for this tty stream; rely on env-based detection.
40
+ const shown = await showBanner({ stream, env, query: false, maxMs: 2200 });
41
+ if (shown) stream.write(' sweet-search installed — run `sweet-search init` to get started.\n');
42
+ } catch { /* never break an install */ }
43
+ finally { if (ownedFd >= 0) { try { closeSync(ownedFd); } catch { /* noop */ } } }
44
+ }
45
+
46
+ run().finally(() => process.exit(0));