@kinlab/kin 0.5.49 → 0.5.51
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 +28 -8
- package/lib/provision.mjs +40 -0
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -3,17 +3,33 @@
|
|
|
3
3
|
The canonical npm install surface for [Kin](https://github.com/firelock-ai/kin), the
|
|
4
4
|
system of record for AI-written software.
|
|
5
5
|
|
|
6
|
+
Install it without root, without `sudo`, and without a writable global npm prefix. This
|
|
7
|
+
is the default path because it is the one that works everywhere, including the container
|
|
8
|
+
and locked-down developer box where the global install below is refused outright:
|
|
9
|
+
|
|
6
10
|
```sh
|
|
7
|
-
|
|
11
|
+
npx -y @kinlab/kin --version
|
|
12
|
+
export PATH="$HOME/.kin/bin:$PATH"
|
|
8
13
|
kin --version
|
|
14
|
+
```
|
|
15
|
+
|
|
16
|
+
The first line downloads the native `kin` and `kin-daemon` for your platform into
|
|
17
|
+
`~/.kin/bin`, verified against their published SHA-256. That install is persistent: `npx`
|
|
18
|
+
provisions the same managed binaries the global install does, so the second and third
|
|
19
|
+
lines are reading a real binary on disk, not re-downloading anything. `kin setup` writes
|
|
20
|
+
the `PATH` line into your shell profile, so you type the `export` once:
|
|
21
|
+
|
|
22
|
+
```sh
|
|
9
23
|
kin setup --intent agent
|
|
10
24
|
```
|
|
11
25
|
|
|
12
|
-
or
|
|
26
|
+
If your global npm prefix is writable, or you are root, `npm install -g` puts the
|
|
27
|
+
launcher on `PATH` for you and is the shorter route:
|
|
13
28
|
|
|
14
29
|
```sh
|
|
15
|
-
|
|
16
|
-
|
|
30
|
+
npm install -g @kinlab/kin
|
|
31
|
+
kin --version
|
|
32
|
+
kin setup --intent agent
|
|
17
33
|
```
|
|
18
34
|
|
|
19
35
|
Native Windows x86_64 support is early. Repository admission works: `kin init` imports a Git repository and publishes graph authority, and graph, lexical, and daemon-backed queries answer natively. Transparent filesystem projection is not shipped on Windows, and the end-to-end install proof does not yet cover MCP or review workflows there, so WSL2 remains the recommended path for the full Kin experience.
|
|
@@ -24,7 +40,8 @@ documented below.
|
|
|
24
40
|
## If the global install is refused
|
|
25
41
|
|
|
26
42
|
On a machine whose global npm prefix is root-owned, and where you are not root and have no
|
|
27
|
-
`sudo`,
|
|
43
|
+
`sudo`, `npm install -g` fails before Kin runs. This is why the install at the top of this
|
|
44
|
+
page leads with `npx`, which never touches that prefix:
|
|
28
45
|
|
|
29
46
|
```
|
|
30
47
|
npm error code EACCES
|
|
@@ -33,9 +50,12 @@ npm error path /usr/local/lib/node_modules/@kinlab
|
|
|
33
50
|
npm error Error: EACCES: permission denied, mkdir '/usr/local/lib/node_modules/@kinlab'
|
|
34
51
|
```
|
|
35
52
|
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
53
|
+
npm fails here before it unpacks anything, so no Kin code has run and nothing in this
|
|
54
|
+
package can catch it or print a fix. Containers whose default user is not root are the
|
|
55
|
+
common case. Two ways out. The `npx` path at the top of this page needs no writable prefix
|
|
56
|
+
and installs the same native binaries under `~/.kin/bin`, which is why it is the default
|
|
57
|
+
rather than a fallback. Or move the npm prefix somewhere you own, and put it on your
|
|
58
|
+
`PATH`:
|
|
39
59
|
|
|
40
60
|
```sh
|
|
41
61
|
npm config set prefix ~/.npm-global
|
package/lib/provision.mjs
CHANGED
|
@@ -410,6 +410,43 @@ function archiveExtraction(platform, env, file) {
|
|
|
410
410
|
* managed `kin` path. Mirrors scripts/install.sh: kin + kin-daemon are
|
|
411
411
|
* mandatory, kin-vfs and the projection shim library are optional extras.
|
|
412
412
|
*/
|
|
413
|
+
/**
|
|
414
|
+
* What to tell someone whose managed binaries landed where PATH does not look.
|
|
415
|
+
*
|
|
416
|
+
* `npm install -g` fails with EACCES on any machine whose global prefix is
|
|
417
|
+
* root-owned, and the failure happens inside npm before a single byte of this
|
|
418
|
+
* package is unpacked, so no postinstall and no launcher code can catch it
|
|
419
|
+
* (FIR-2628). The recovery Kin CAN offer is the one that needs neither root nor
|
|
420
|
+
* a writable prefix: `npx` provisions the same native binaries into <KIN_HOME>/bin,
|
|
421
|
+
* and that install is persistent. The npm0549 stranger dismissed npx as "not a
|
|
422
|
+
* persistent install" and went looking for root instead, which is the gap this
|
|
423
|
+
* closes at the one moment Kin's own code is running.
|
|
424
|
+
*
|
|
425
|
+
* Returns no lines when the directory is already on PATH, because a healthy
|
|
426
|
+
* global install does not need advice about a wall it did not hit.
|
|
427
|
+
*/
|
|
428
|
+
export function persistentPathAdvice(binDir, env = process.env, delimiter = path.delimiter) {
|
|
429
|
+
const wanted = path.resolve(binDir);
|
|
430
|
+
const onPath = String(env.PATH ?? '')
|
|
431
|
+
.split(delimiter)
|
|
432
|
+
.filter(Boolean)
|
|
433
|
+
.some((entry) => {
|
|
434
|
+
try {
|
|
435
|
+
return path.resolve(entry) === wanted;
|
|
436
|
+
} catch {
|
|
437
|
+
return false;
|
|
438
|
+
}
|
|
439
|
+
});
|
|
440
|
+
if (onPath) return [];
|
|
441
|
+
return [
|
|
442
|
+
`kin: ${binDir} is not on your PATH.`,
|
|
443
|
+
'kin: that directory needs no root and no writable npm prefix, so putting it on PATH is a',
|
|
444
|
+
'kin: persistent install on a machine where `npm install -g` is refused:',
|
|
445
|
+
`kin: export PATH="${binDir}:$PATH"`,
|
|
446
|
+
'kin: or run `kin setup`, which writes that line into your shell profile.',
|
|
447
|
+
];
|
|
448
|
+
}
|
|
449
|
+
|
|
413
450
|
export async function provision(version, opts = {}) {
|
|
414
451
|
const {
|
|
415
452
|
env = process.env,
|
|
@@ -511,6 +548,9 @@ export async function provision(version, opts = {}) {
|
|
|
511
548
|
|
|
512
549
|
writeLauncherStamp(version, env);
|
|
513
550
|
log(`kin: managed kin ${version} installed at ${binDir}`);
|
|
551
|
+
for (const line of persistentPathAdvice(binDir, mergeEnvironment(process.env, env))) {
|
|
552
|
+
log(line);
|
|
553
|
+
}
|
|
514
554
|
return path.join(binDir, binaryName('kin', platform));
|
|
515
555
|
} finally {
|
|
516
556
|
fs.rmSync(tmp, { recursive: true, force: true });
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@kinlab/kin",
|
|
3
|
-
"version": "0.5.
|
|
3
|
+
"version": "0.5.51",
|
|
4
4
|
"description": "Canonical installer and launcher for Kin, the system of record for AI-written software. Provisions and runs the managed kin + kin-daemon release. MCP is one included mode (kin mcp start).",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"type": "module",
|