@supercorks/krnl 0.1.0

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 ADDED
@@ -0,0 +1,124 @@
1
+ # Kernel CLI
2
+
3
+ Connect [Kernel](https://app.krnl.work) to Codex on your Mac. Start a task from Kernel in Plan or
4
+ Work mode, then open the same task in Codex. Conversations and approvals stay in Codex; Kernel
5
+ shows execution status and a direct link.
6
+
7
+ ## Install and connect
8
+
9
+ Requires **macOS, Node 22–24, pnpm, and a signed-in Codex desktop installation**.
10
+
11
+ ```bash
12
+ pnpm add -g @supercorks/krnl
13
+ krnl login
14
+ krnl connect codex
15
+ ```
16
+
17
+ `krnl login` opens Kernel in your default browser. Sign in with your invited Kernel account and
18
+ choose **Connect CLI**. Return to Terminal when the browser says the login is finishing.
19
+
20
+ `krnl connect codex` asks once for access to **all current and future compatible saved Codex
21
+ projects** for that Kernel account. It registers this Mac, installs status hooks, and starts a
22
+ background companion that runs at login. It prints the exact Codex command and `/hooks`
23
+ instructions if the new hooks need review. Review the eight Kernel hooks and restart open Codex
24
+ tasks afterward. The companion detects completed review automatically.
25
+
26
+ Open **Settings → Integrations → Codex** in Kernel to map an organization or project to a saved
27
+ Codex project. Your Mac and saved projects appear automatically. Launches stay disabled until setup
28
+ is ready; one unavailable project does not disable healthy projects.
29
+
30
+ No repository checkout, build tools, copied IDs, or per-folder authorization commands are needed.
31
+ Installing the npm package alone does not start a service or change Codex configuration.
32
+
33
+ ## Commands
34
+
35
+ | Command | Purpose |
36
+ | ----------------------- | ---------------------------------------------------------------------------- |
37
+ | `krnl login` | Sign in through Kernel in the browser. |
38
+ | `krnl connect codex` | Connect, resume interrupted setup, or repair/update this Mac’s installation. |
39
+ | `krnl status` | Check the account, connection, saved project count, and remaining setup. |
40
+ | `krnl disconnect codex` | Revoke this connection and remove its login service; keep your CLI login. |
41
+ | `krnl logout` | Disconnect and remove the local CLI login. |
42
+
43
+ For another Kernel deployment, use `krnl login --origin https://your-kernel.example`. HTTP is
44
+ accepted only for loopback development. Log out before switching deployments.
45
+
46
+ To update:
47
+
48
+ ```bash
49
+ pnpm add -g @supercorks/krnl@latest
50
+ krnl connect codex
51
+ ```
52
+
53
+ Repeated connection reuses the machine identity. Review changed hook commands in `/hooks` if Node
54
+ moved. After updating Node, run `krnl connect codex` to refresh the service’s executable path.
55
+
56
+ ## Projects and compatibility
57
+
58
+ The companion uses saved project identities from Codex’s app-server. Initial support covers
59
+ projects with one accessible local folder. Git mappings default to a new worktree from
60
+ `refs/remotes/origin/HEAD`; choose **Existing folder** under the mapping’s **Advanced** settings if
61
+ needed. Non-Git projects use their saved folder. Missing folders, multi-root projects, and disabled
62
+ project hooks are explained beside that project in Kernel.
63
+
64
+ Tested Codex capabilities: desktop **26.901.51231** with bundled CLI **0.153.4**. The companion prefers
65
+ `/Applications/ChatGPT.app/Contents/Resources/codex`, falling back to `codex` on PATH. The app-server
66
+ capabilities are experimental, so other Codex versions require verification.
67
+
68
+ The companion releases its first-turn app-server after completion or a request for input. Continue
69
+ in desktop after that release; an interrupted structured question may be asked again. Kernel
70
+ observes Running/Done across later desktop turns through hooks. It does not answer questions or
71
+ approve commands.
72
+
73
+ Existing companion installations keep their allowlist until you explicitly upgrade through
74
+ `krnl login` and `krnl connect codex`. The upgrade retains their machine identity, mappings, and
75
+ handoff history when the existing connection is still authorized.
76
+
77
+ ## Local data and troubleshooting
78
+
79
+ The executable is copied to a stable location under
80
+ `~/Library/Application Support/Kernel/Codex/bin/`. Hook and service paths do not depend on global
81
+ package folders or temporary installer caches. launchd services live under `~/Library/LaunchAgents`.
82
+ Closing Terminal does not stop the service.
83
+
84
+ CLI credentials use macOS Keychain service **Kernel CLI**; machine credentials use **Kernel Codex
85
+ companion**. Codex credentials stay local. Browser URLs never contain these credentials. The
86
+ browser returns a short-lived authorization code to a temporary `127.0.0.1` callback, protected
87
+ with state and PKCE. CLI sessions last 90 days; run `krnl login` again after expiry.
88
+
89
+ Run `krnl status` first when disconnected, then `krnl connect codex` to repair setup. If Kernel
90
+ revoked the Mac remotely, sign in again with `krnl login` before reconnecting. If revocation cannot
91
+ reach Kernel, the disconnect command stops the local service and asks you to retry online.
92
+
93
+ Disconnect and logout preserve Codex tasks, local creation receipts, and worktrees. Hooks retain
94
+ only lifecycle metadata for tasks created by this connection. Neither transcripts nor attachment
95
+ contents are uploaded. Keep receipts intact when investigating an uncertain launch; the companion
96
+ will reconcile creation before retrying an acknowledgement and will not repeat an uncertain turn.
97
+
98
+ Homebrew, a native setup app, and a one-command `npx` setup flow are not included in this release.
99
+
100
+ ## Bundled third-party software
101
+
102
+ This executable includes Zod under the following license:
103
+
104
+ MIT License
105
+
106
+ Copyright (c) 2025 Colin McDonnell
107
+
108
+ Permission is hereby granted, free of charge, to any person obtaining a copy
109
+ of this software and associated documentation files (the "Software"), to deal
110
+ in the Software without restriction, including without limitation the rights
111
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
112
+ copies of the Software, and to permit persons to whom the Software is
113
+ furnished to do so, subject to the following conditions:
114
+
115
+ The above copyright notice and this permission notice shall be included in all
116
+ copies or substantial portions of the Software.
117
+
118
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
119
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
120
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
121
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
122
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
123
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
124
+ SOFTWARE.