usekairn 0.1.2

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/LICENSE ADDED
@@ -0,0 +1,5 @@
1
+ UNLICENSED
2
+
3
+ Copyright (c) 2026 Kevin Dotel.
4
+
5
+ All rights reserved.
package/README.md ADDED
@@ -0,0 +1,22 @@
1
+ # Kairn
2
+
3
+ This is the public beta npm launcher for Kairn.
4
+
5
+ Install:
6
+
7
+ ```bash
8
+ npm install -g usekairn@beta
9
+ ```
10
+
11
+ The launcher does not download arbitrary code during install. It resolves the platform-specific optional npm package installed by npm, then runs that package's Kairn binary.
12
+
13
+ The first npm beta supports macOS arm64 and Linux arm64/x64. Intel Mac and native Windows npm support are deferred until their binary smokes are stable; use WSL or the private beta fallback for now.
14
+
15
+ Telemetry is opt-in during Kairn setup. Installing the package does not enable telemetry, mutate shell profiles, or configure agent clients.
16
+
17
+ Uninstall:
18
+
19
+ ```bash
20
+ kairn setup remove --root /path/to/repo
21
+ npm uninstall -g usekairn
22
+ ```
package/bin/kairn.cjs ADDED
@@ -0,0 +1,95 @@
1
+ #!/usr/bin/env node
2
+ "use strict";
3
+
4
+ const { spawnSync } = require("node:child_process");
5
+ const fs = require("node:fs");
6
+ const { createRequire } = require("node:module");
7
+ const path = require("node:path");
8
+
9
+ const launcherRequire = createRequire(__filename);
10
+ const launcherPackage = "usekairn@0.1.2";
11
+
12
+ const platformPackages = {
13
+ "darwin-arm64": "usekairn-darwin-arm64",
14
+ "linux-arm64": "usekairn-linux-arm64",
15
+ "linux-x64": "usekairn-linux-x64"
16
+ };
17
+
18
+ function main() {
19
+ const target = `${process.platform}-${process.arch}`;
20
+ const binary = resolveBinary(target);
21
+ const result = spawnSync(binary.path, process.argv.slice(2), {
22
+ stdio: "inherit",
23
+ env: {
24
+ ...process.env,
25
+ KAIRN_INSTALL_CHANNEL: process.env.KAIRN_INSTALL_CHANNEL || "npm-beta",
26
+ KAIRN_BUILD_TARGET: process.env.KAIRN_BUILD_TARGET || target,
27
+ KAIRN_PLATFORM_PACKAGE: process.env.KAIRN_PLATFORM_PACKAGE || binary.packageName,
28
+ KAIRN_LAUNCHER_PACKAGE: process.env.KAIRN_LAUNCHER_PACKAGE || launcherPackage
29
+ }
30
+ });
31
+
32
+ if (result.error) {
33
+ console.error(`kairn: failed to launch ${binary.path}: ${result.error.message}`);
34
+ process.exit(1);
35
+ }
36
+ if (result.signal) {
37
+ process.kill(process.pid, result.signal);
38
+ return;
39
+ }
40
+ process.exit(result.status ?? 1);
41
+ }
42
+
43
+ function resolveBinary(target) {
44
+ if (process.env.KAIRN_BINARY_PATH) {
45
+ const override = path.resolve(process.env.KAIRN_BINARY_PATH);
46
+ if (!fs.existsSync(override)) {
47
+ fail(`KAIRN_BINARY_PATH does not exist: ${override}`);
48
+ }
49
+ return { path: override, packageName: "KAIRN_BINARY_PATH" };
50
+ }
51
+
52
+ const packageName = platformPackages[target];
53
+ if (!packageName) {
54
+ fail(
55
+ [
56
+ `Unsupported npm beta platform: ${target}.`,
57
+ "",
58
+ "This beta currently supports macOS arm64 and Linux arm64/x64.",
59
+ "On Intel Macs or Windows, use the private beta fallback until those native binaries are ready.",
60
+ "On Windows, WSL can use the Linux package.",
61
+ "",
62
+ "Docs: https://usekairn.com/docs/install-and-update"
63
+ ].join("\n")
64
+ );
65
+ }
66
+
67
+ const binaryName = process.platform === "win32" ? "kairn.exe" : "kairn";
68
+ try {
69
+ return {
70
+ path: launcherRequire.resolve(`${packageName}/bin/${binaryName}`),
71
+ packageName
72
+ };
73
+ } catch {
74
+ fail(
75
+ [
76
+ `The platform package ${packageName} is missing for ${target}.`,
77
+ "",
78
+ "Try reinstalling:",
79
+ " npm install -g usekairn@beta",
80
+ "",
81
+ "If npm omitted optional dependencies, install the platform package explicitly:",
82
+ ` npm install -g usekairn@beta ${packageName}@0.1.2`,
83
+ "",
84
+ "Docs: https://usekairn.com/docs/install-and-update"
85
+ ].join("\n")
86
+ );
87
+ }
88
+ }
89
+
90
+ function fail(message) {
91
+ console.error(`kairn: ${message}`);
92
+ process.exit(1);
93
+ }
94
+
95
+ main();
package/package.json ADDED
@@ -0,0 +1,22 @@
1
+ {
2
+ "name": "usekairn",
3
+ "version": "0.1.2",
4
+ "description": "Public beta launcher for Kairn, a local-first context runtime for coding agents.",
5
+ "license": "UNLICENSED",
6
+ "bin": {
7
+ "kairn": "./bin/kairn.cjs"
8
+ },
9
+ "files": [
10
+ "bin",
11
+ "README.md",
12
+ "LICENSE"
13
+ ],
14
+ "engines": {
15
+ "node": ">=20.19 <26"
16
+ },
17
+ "optionalDependencies": {
18
+ "usekairn-darwin-arm64": "0.1.2",
19
+ "usekairn-linux-arm64": "0.1.2",
20
+ "usekairn-linux-x64": "0.1.2"
21
+ }
22
+ }