rsrs-cli 1.0.20-dev.7 → 1.0.20-dev.9

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.
Files changed (3) hide show
  1. package/README.md +127 -5
  2. package/bin/cli.js +79 -1
  3. package/package.json +10 -4
package/README.md CHANGED
@@ -1,9 +1,131 @@
1
1
  # rsrs-cli
2
2
 
3
- Install Respire with `npm install -g rsrs-cli`.
3
+ The launcher selects the platform binary package and forwards arguments to `rsrs`. Packages include the executable, runtime libraries and notices.
4
4
 
5
- This entry uses the same version of `@rsrsai/cli` and its native platform packages.
6
- Run `rsrs --help` after installation.
5
+ ```sh
6
+ npm i -g rsrs-cli
7
+ # Or: pnpm add -g rsrs-cli
8
+ # DEV: npm i -g rsrs-cli@dev
9
+ rsrs doctor
10
+ rsrs --help
11
+ ```
7
12
 
8
- If `@rsrsai/cli` is already installed globally, uninstall that package first to avoid a command conflict.
9
- Uninstalling the npm package does not delete your Respire data.
13
+ `rsrs-cli` is the primary install entry. For releases built from a manifest whose
14
+ `npmScope` is `rsrs-cli`, it contains the launcher and declares every supported
15
+ `@rsrsai/` platform package as an optional dependency at the exact same version.
16
+ It does not depend on `@rsrsai/cli`. Stable releases use `latest`; development
17
+ releases use `dev`.
18
+
19
+ This is a source-layout change for future publications. For example, published `1.0.19` and
20
+ `1.0.20-dev.8` still use `rsrs-cli` → `@rsrsai/cli` → platform package. Historical
21
+ source manifests with `npmScope: "@rsrsai/cli"` and their receipts retain that
22
+ layout; the split is determined by the source manifest, not a version threshold.
23
+ The historical packer under `npm/alias` stays unchanged for exact-byte recovery.
24
+
25
+ ## Migrating a global install
26
+
27
+ Check `npm prefix -g`, `npm ls -g --depth=0`, and the executable selected by
28
+ `command -v rsrs` (PowerShell: `Get-Command rsrs -All`; cmd: `where rsrs`). Use the
29
+ same package manager, user and global prefix that own that entry. Resolve
30
+ multiple prefixes or uncertain ownership before changing anything.
31
+
32
+ - If the top-level package is already `rsrs-cli` (including its historical alias
33
+ layout), upgrade that same package to the exact reviewed release. npm replaces
34
+ its own entry; do not separately uninstall its nested `@rsrsai/cli` dependency.
35
+ - If only top-level `@rsrsai/cli` was installed, both package names claim the
36
+ `rsrs` command. Installing `rsrs-cli` alongside it can fail with `EEXIST` while
37
+ retaining the old entry. Do not use `--force` or manually delete an unknown
38
+ executable/shim. Switching this installation requires an explicit user choice;
39
+ the launcher never uninstalls another package automatically.
40
+
41
+ Before switching, record the old package's exact version and prefix. In a
42
+ separate disposable prefix, install and run `--version` for both the exact new
43
+ `rsrs-cli` release and the recorded old `@rsrsai/cli` release using the same npm
44
+ cache. Confirm the selected platform dependency exists at its exact matching
45
+ version; an optional-dependency warning alone is not a successful CLI install.
46
+ Keep the old package and its platform dependencies available for offline rollback
47
+ before removing the working global entry. Do not start a switch during a network
48
+ outage without a tested local recovery path.
49
+
50
+ For a scoped-only install, the user can then uninstall just the old **npm
51
+ launcher package** and install the new exact package in that same prefix. In the
52
+ commands below, replace `EXACT_NEW_VERSION` and `EXACT_OLD_VERSION` with the
53
+ recorded exact release versions before executing; these are placeholders, not tags.
54
+ `@dev` is useful for discovery but is not an exact migration/rollback pin.
55
+
56
+ ```sh
57
+ npm uninstall -g @rsrsai/cli
58
+ npm install -g "rsrs-cli@EXACT_NEW_VERSION"
59
+ rsrs --version
60
+ ```
61
+
62
+ If uninstall fails, stop and inspect the existing package/entry. If installation
63
+ fails after uninstall, do not force a link or retry an unverified package: restore
64
+ the recorded old launcher from the tested cache, for example
65
+ `npm install --offline -g "@rsrsai/cli@EXACT_OLD_VERSION"`, then verify its version
66
+ and executable path. If a partial new `rsrs-cli` package owns the entry, inspect
67
+ it and explicitly remove only that failed npm package before restoring the old
68
+ one. Keep the failure diagnostic; if rollback also fails, report the exact state
69
+ and stop rather than deleting unrelated files.
70
+
71
+ The built-in runtime registration normally points to the materialized executable
72
+ under the profile’s stable `bin` directory, rather than the npm dependency tree.
73
+ Still inspect custom `RSRS_BIN_DIR` settings and third-party service definitions
74
+ before removing a package: a custom service pointing into the old npm tree is
75
+ not covered by that default path and needs its operator’s migration plan.
76
+
77
+ These package-manager commands do not authorize deleting Respire profiles,
78
+ credentials, model files, runtime registrations or databases, or restarting
79
+ services. Preserve those separately managed resources. pnpm users must use the
80
+ same pnpm prefix/cache and equivalent reviewed operations; do not mix managers
81
+ or assume npm's offline flags apply to pnpm. Existing binaries and old releases
82
+ retain their original layout and behavior.
83
+
84
+ | Platform | Package |
85
+ | --- | --- |
86
+ | Linux x64, musl (default) | `@rsrsai/linux-x64` |
87
+ | Linux x64, glibc | `@rsrsai/linux-x64-gnu` |
88
+ | Linux ARM64, musl (default) | `@rsrsai/linux-arm64` |
89
+ | Linux ARM64, glibc | `@rsrsai/linux-arm64-gnu` |
90
+ | Apple Silicon | `@rsrsai/macos-arm64` |
91
+ | Windows x64 | `@rsrsai/win-x64` |
92
+ | Windows ARM64 | `@rsrsai/win-arm64` |
93
+
94
+ Linux ARM64 returns in the DEV channel first. Use `rsrs-cli@dev` for a release
95
+ whose manifest includes ARM64; stable versions 1.0.15 and 1.0.16 have no ARM64
96
+ packages. A newer stable install becomes applicable only when its release
97
+ actually includes those platform packages.
98
+
99
+ Windows ARM64 is a DEV-first release candidate and requires a version that
100
+ actually includes its complete package. Stable 1.0.15 and 1.0.16 omit it.
101
+ See the [support matrix](../docs/platform-support.md) for validation status and blockers.
102
+
103
+ `artifact-manifest.json` defines targets and names. Intel Mac is unsupported.
104
+ Linux keeps the static musl package as its default. On a glibc distribution,
105
+ select the GNU build explicitly; the same choice applies to npm and pnpm:
106
+
107
+ ```sh
108
+ RSRS_LIBC=glibc rsrs doctor
109
+ RSRS_LIBC=musl rsrs doctor
110
+ # Persist the selection for this shell:
111
+ export RSRS_LIBC=glibc
112
+ ```
113
+
114
+ The glibc packages require a compatible glibc host; they do not run on Alpine.
115
+ If optional packages were omitted during installation, install the selected
116
+ platform package at the same version as the installed launcher.
117
+ See [CLI source](https://github.com/risense-ai/respire-cli) for builds and runtime guides.
118
+
119
+ | Boundary | Behavior |
120
+ | --- | --- |
121
+ | Models | Separately installed with upstream licenses and source records |
122
+ | Runtime | Host manages lifecycle; sandbox uses authenticated client requests |
123
+ | Sync | Host-side login; encrypted server storage |
124
+ | Core binary | Separately licensed proprietary binary and public binding |
125
+
126
+ ## License
127
+
128
+ First-party material uses the [Respire Noncommercial License 1.0](https://github.com/risense-ai/respire-cli/blob/main/LICENSE).
129
+ Personal noncommercial use and self-hosting are permitted. Commercial use,
130
+ including internal business deployment, requires prior written authorization.
131
+ See [commercial licensing](https://github.com/risense-ai/respire-cli/blob/main/COMMERCIAL-LICENSE.md).
package/bin/cli.js CHANGED
@@ -1,4 +1,82 @@
1
1
  #!/usr/bin/env node
2
2
  'use strict';
3
+ // Locate the platform package binary and forward CLI arguments.
4
+ const { spawnSync } = require('child_process');
5
+ const path = require('path');
6
+ const { existsSync, readFileSync } = require('fs');
7
+ const version = require('../package.json').version;
3
8
 
4
- require('@rsrsai/cli/bin/cli.js');
9
+ const PKGS = {
10
+ 'linux-x64': '@rsrsai/linux-x64',
11
+ 'linux-arm64': '@rsrsai/linux-arm64',
12
+ 'darwin-arm64': '@rsrsai/macos-arm64',
13
+ 'win32-x64': '@rsrsai/win-x64',
14
+ 'win32-arm64': '@rsrsai/win-arm64',
15
+ };
16
+
17
+ const key = `${process.platform}-${process.arch}`;
18
+ let pkg = PKGS[key];
19
+ if (process.platform === 'linux') {
20
+ const libc = process.env.RSRS_LIBC ?? process.env.ONEMEMORY_LIBC ?? process.env.RESPIRE_LIBC ?? 'musl';
21
+ if (libc !== 'musl' && libc !== 'glibc') {
22
+ console.error('rsrs: RSRS_LIBC must be musl or glibc.');
23
+ process.exit(1);
24
+ }
25
+ if (pkg && libc === 'glibc') pkg += '-gnu';
26
+ }
27
+ if (!pkg) {
28
+ if (key === 'darwin-x64') {
29
+ console.error(
30
+ 'rsrs: Intel Mac is unsupported.\n' +
31
+ ' Use Apple Silicon (arm64), Linux or Windows.\n' +
32
+ ' See https://github.com/risense-ai/respire-cli#use-and-distribution'
33
+ );
34
+ } else {
35
+ console.error(`rsrs: unsupported platform ${key} (supported: ${Object.keys(PKGS).join(' ')})`);
36
+ }
37
+ process.exit(1);
38
+ }
39
+
40
+ const exe = process.platform === 'win32' ? 'rsrs.exe' : 'rsrs';
41
+ function resolveBin(pkgName, exeName) {
42
+ try {
43
+ return require.resolve(`${pkgName}/bin/${exeName}`);
44
+ } catch {
45
+ /* optional dep missing or installed as a global sibling */
46
+ }
47
+ const rel = path.join(...pkgName.split('/'), 'bin', exeName);
48
+ let dir = __dirname;
49
+ for (let i = 0; i < 12; i++) {
50
+ const hits = [path.join(dir, 'node_modules', rel), path.join(dir, rel)];
51
+ for (const p of hits) {
52
+ if (existsSync(p)) return p;
53
+ }
54
+ const parent = path.dirname(dir);
55
+ if (parent === dir) break;
56
+ dir = parent;
57
+ }
58
+ return null;
59
+ }
60
+ const bin = resolveBin(pkg, exe);
61
+ if (!bin) {
62
+ console.error(`rsrs: platform package ${pkg} is missing. Install: npm i -g ${pkg}@${version}`);
63
+ process.exit(1);
64
+ }
65
+
66
+ try {
67
+ const platform = JSON.parse(readFileSync(path.join(path.dirname(path.dirname(bin)), 'package.json'), 'utf8'));
68
+ if (platform.name !== pkg || platform.version !== version) {
69
+ throw new Error(`expected ${pkg}@${version}, found ${platform.name}@${platform.version}`);
70
+ }
71
+ } catch (error) {
72
+ console.error(`rsrs: incompatible platform package: ${error.message}. Install: npm i -g ${pkg}@${version}`);
73
+ process.exit(1);
74
+ }
75
+
76
+ // The CLI opens the hosted dashboard; no UI assets are bundled.
77
+ const r = spawnSync(bin, process.argv.slice(2), { stdio: 'inherit', env: process.env });
78
+ if (r.error) {
79
+ console.error(`rsrs: ${r.error.message}`);
80
+ process.exit(1);
81
+ }
82
+ process.exit(r.status ?? 1);
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "rsrs-cli",
3
- "version": "1.0.20-dev.7",
4
- "description": "Short install entry for the Respire CLI",
3
+ "version": "1.0.20-dev.9",
4
+ "description": "rsrs CLI — encrypted cross-device AI memory",
5
5
  "license": "SEE LICENSE IN LICENSE",
6
6
  "repository": {
7
7
  "type": "git",
@@ -19,7 +19,13 @@
19
19
  "engines": {
20
20
  "node": ">=16"
21
21
  },
22
- "dependencies": {
23
- "@rsrsai/cli": "1.0.20-dev.7"
22
+ "optionalDependencies": {
23
+ "@rsrsai/linux-x64-gnu": "1.0.20-dev.9",
24
+ "@rsrsai/linux-x64": "1.0.20-dev.9",
25
+ "@rsrsai/linux-arm64-gnu": "1.0.20-dev.9",
26
+ "@rsrsai/linux-arm64": "1.0.20-dev.9",
27
+ "@rsrsai/macos-arm64": "1.0.20-dev.9",
28
+ "@rsrsai/win-x64": "1.0.20-dev.9",
29
+ "@rsrsai/win-arm64": "1.0.20-dev.9"
24
30
  }
25
31
  }