@nitsan-ai/ragsuite-test 0.1.5 → 0.1.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/README.md CHANGED
@@ -9,11 +9,12 @@ npm install -g @nitsan-ai/ragsuite-test
9
9
  ragsuite-test init
10
10
  # clones → ~/ragsuite-test
11
11
 
12
- # Needs Postgres :5436 (db ragsuite_v3) and Redis :6382 on the host
12
+ # Needs Postgres :5436 + Redis :6382 (auto-started via data-only compose if Docker is available)
13
13
  ragsuite-test start
14
14
  # API http://localhost:9090 · Web http://localhost:9191
15
15
 
16
16
  ragsuite-test stop
17
+ # stops host app + leftover Docker app containers; keeps DB volumes
17
18
  ```
18
19
 
19
20
  Same under the hood as:
@@ -26,6 +27,8 @@ npm run stop # scripts/native-stop.sh
26
27
 
27
28
  Active install is remembered in `~/.ragsuite-test/config.json`.
28
29
 
30
+ **Data safety:** `start` may run `docker compose up -d postgres redis` only (existing volumes). It never runs `down -v`. App code always runs natively.
31
+
29
32
  ---
30
33
 
31
34
  ## Upgrade (keeps data & `.env`)
@@ -50,10 +53,10 @@ If you already installed and run `init` again → **Already installed** (exit OK
50
53
  | Python 3 + venv | backend |
51
54
  | Yarn | Expo frontend |
52
55
  | Git | `init` clone |
53
- | Postgres | `localhost:5436`, database `ragsuite_v3` |
54
- | Redis | `localhost:6382` |
56
+ | Postgres + Redis | Host brew **or** data-only compose (`postgres`/`redis` services) on :5436 / :6382 |
57
+ | Docker (optional) | Only to auto-start/reuse existing postgres/redis volumes |
55
58
 
56
- Docker is **not** required for this CLI.
59
+ Docker is **not** required to run the API/UI (those are native).
57
60
 
58
61
  ---
59
62
 
@@ -61,9 +64,9 @@ Docker is **not** required for this CLI.
61
64
 
62
65
  | Command | Purpose |
63
66
  |---------|---------|
64
- | `init` | First-time git install |
65
- | `start` | `scripts/native-start.sh` |
66
- | `stop` | `scripts/native-stop.sh` (host PIDs only) |
67
+ | `init` | First-time git install (no port checks) |
68
+ | `start` | `scripts/native-start.sh` (+ data services if needed) |
69
+ | `stop` | Native PIDs + leftover app containers (DB kept) |
67
70
  | `update` | `git pull` in place |
68
71
  | `doctor` | Native prereq checks |
69
72
  | `logs` | Tail `.ragsuite/native/*.log` |
package/package.json CHANGED
@@ -1,8 +1,8 @@
1
1
  {
2
2
  "name": "@nitsan-ai/ragsuite-test",
3
- "version": "0.1.5",
3
+ "version": "0.1.6",
4
4
  "private": false,
5
- "description": "RAGSuite testing CLI — init once, then start/update/stop via native npm scripts (no Docker).",
5
+ "description": "RAGSuite testing CLI — init once, then start/update/stop via native npm scripts.",
6
6
  "main": "src/index.js",
7
7
  "bin": {
8
8
  "ragsuite-test": "./bin/ragsuite-test.js"
@@ -17,13 +17,12 @@ const {
17
17
  } = require('../utils/git-install');
18
18
  const { detectOs } = require('../utils/os-detect');
19
19
  const { printPrereqs, resolvePreferredMode } = require('../utils/prereqs');
20
+ const { info, warn, error } = require('../utils/log');
20
21
  const {
21
22
  generateJwtSecret,
22
23
  isPlaceholderSecret,
23
24
  writeInstallEnv,
24
25
  } = require('../utils/env-file');
25
- const { assertPortsFree } = require('../utils/port');
26
- const { info, warn, error } = require('../utils/log');
27
26
 
28
27
  const name = 'init';
29
28
  const summary = 'First-time install (git + native npm scripts). Safe if already installed.';
@@ -217,14 +216,8 @@ async function run(ctx) {
217
216
  const llmKey = resolveLlmOverride(g, ctx.env);
218
217
  const smtp = optionalSmtpOverrides(g, ctx.env);
219
218
 
220
- if (ctx.env.RAGSUITE_TEST_SKIP_PORT_CHECK !== '1') {
221
- try {
222
- await assertPortsFree();
223
- } catch (err) {
224
- error(err.message);
225
- return 1;
226
- }
227
- }
219
+ // Init only installs files — do not require ports free.
220
+ // (Postgres/Redis being "in use" is good; API busy is a start-time concern.)
228
221
 
229
222
  let repoRoot;
230
223
  let source = 'checkout';
@@ -5,16 +5,19 @@ const { resolveMode } = require('../utils/config');
5
5
  const { resolveRepoRoot, assertNativeDeploy } = require('../utils/paths');
6
6
  const { runScript } = require('../utils/spawn');
7
7
  const { assertApiPortFree } = require('../utils/port');
8
- const { error } = require('../utils/log');
8
+ const { error, info } = require('../utils/log');
9
9
 
10
10
  const name = 'start';
11
- const summary = 'Start app via npm scripts (native no Docker)';
11
+ const summary = 'Start app via npm scripts (native); auto-starts DB containers if needed';
12
12
 
13
13
  function help() {
14
14
  return `Usage: ragsuite-test start [options]
15
15
 
16
16
  Runs scripts/native-start.sh (same as \`npm start\` in the install dir).
17
- Does not use Docker — no containers, no volume risk.
17
+
18
+ App runs on the host. If Postgres/Redis are down, start may bring up
19
+ data-only compose services (postgres + redis) using existing volumes —
20
+ never \`down -v\`. Backend/frontend Docker containers are not started.
18
21
 
19
22
  Options:
20
23
  --repo-root <path> Override active install
@@ -42,6 +45,8 @@ async function run(ctx) {
42
45
  error(err.message);
43
46
  return 1;
44
47
  }
48
+ } else {
49
+ info('[dry-run] would run scripts/native-start.sh');
45
50
  }
46
51
 
47
52
  return runScript(repoRoot, path.join('scripts', 'native-start.sh'), [], {
@@ -7,13 +7,15 @@ const { runScript } = require('../utils/spawn');
7
7
  const { error } = require('../utils/log');
8
8
 
9
9
  const name = 'stop';
10
- const summary = 'Stop native app processes (does not touch Docker volumes)';
10
+ const summary = 'Stop native app + leftover Docker app containers (keeps DB volumes)';
11
11
 
12
12
  function help() {
13
13
  return `Usage: ragsuite-test stop [options]
14
14
 
15
- Runs scripts/native-stop.sh (same as \`npm run stop\` in the install dir).
16
- Stops host processes only never runs docker compose down.
15
+ Runs scripts/native-stop.sh:
16
+ Stops host API / Expo / chroma PIDs
17
+ • Stops leftover Docker backend/frontend/worker if present
18
+ • Leaves postgres/redis running (and never uses down -v)
17
19
 
18
20
  Options:
19
21
  --repo-root <path> Override active install
package/src/utils/port.js CHANGED
@@ -35,7 +35,17 @@ async function assertApiPortFree(env = process.env) {
35
35
  const busy = await isPortInUse(port);
36
36
  if (busy) {
37
37
  const err = new Error(
38
- `API port ${port} is already in use. Stop the other process (e.g. npm run down or npm run stop:native) and retry. This CLI will not kill foreign processes.`,
38
+ [
39
+ `API port ${port} is already in use.`,
40
+ 'This CLI will not kill foreign processes.',
41
+ '',
42
+ 'If a previous RAGSuite install is running:',
43
+ ' ragsuite-test stop',
44
+ ' # frees native PIDs + leftover Docker app containers (keeps DB volumes)',
45
+ '',
46
+ 'See what owns the port:',
47
+ ` lsof -nP -iTCP:${port} -sTCP:LISTEN`,
48
+ ].join('\n'),
39
49
  );
40
50
  err.code = 'PORT_IN_USE';
41
51
  throw err;
@@ -43,11 +53,10 @@ async function assertApiPortFree(env = process.env) {
43
53
  return port;
44
54
  }
45
55
 
56
+ /** @deprecated Prefer start-time API checks; init must not require free DB ports. */
46
57
  const DEFAULT_INSTALL_PORTS = [
47
58
  { port: 9090, label: 'API' },
48
- { port: 9091, label: 'Web UI' },
49
- { port: 5436, label: 'Postgres' },
50
- { port: 6382, label: 'Redis' },
59
+ { port: 9191, label: 'Expo web' },
51
60
  ];
52
61
 
53
62
  async function assertPortsFree(ports = DEFAULT_INSTALL_PORTS) {
@@ -63,17 +72,8 @@ async function assertPortsFree(ports = DEFAULT_INSTALL_PORTS) {
63
72
  const err = new Error(
64
73
  [
65
74
  `Port(s) already in use: ${busy.join(', ')}.`,
66
- 'Free them, then retry. This CLI will not kill foreign processes.',
67
- '',
68
- 'If a previous RAGSuite install is running:',
69
- ' ragsuite-test stop',
70
- ' # or: npm run stop',
71
- '',
72
- 'See what owns the ports (macOS/Linux):',
73
- ' lsof -nP -iTCP:9090 -sTCP:LISTEN',
74
- ' lsof -nP -iTCP:9191 -sTCP:LISTEN',
75
- ' lsof -nP -iTCP:5436 -sTCP:LISTEN',
76
- ' lsof -nP -iTCP:6382 -sTCP:LISTEN',
75
+ 'Run: ragsuite-test stop',
76
+ 'Then retry. Postgres/Redis being up is expected for native mode.',
77
77
  ].join('\n'),
78
78
  );
79
79
  err.code = 'PORT_IN_USE';