@codesona/runner 0.0.0-stage → 0.2.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/LICENSE ADDED
@@ -0,0 +1,19 @@
1
+ Codesona Runner
2
+ Copyright (c) 2026 Azteron. All rights reserved.
3
+
4
+ You may install and run this software on machines you connect to a Codesona
5
+ workspace, for use with the Codesona service. You may not copy, modify,
6
+ distribute, sublicense or sell it, except as the terms you accepted for the
7
+ Codesona service or applicable law allow.
8
+
9
+ This package also contains third-party components that are licensed under
10
+ their own terms. THIRD-PARTY-NOTICES.txt lists them and says where each
11
+ licence is. Those terms, not this licence, govern those components.
12
+
13
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
14
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
15
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
16
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
17
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
18
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
19
+ SOFTWARE.
package/README.md CHANGED
@@ -1,3 +1,110 @@
1
- # Temporary Holding Version
1
+ # Codesona Runner
2
2
 
3
- This version is a temporary placeholder for this package. An operational version to replace this has been submitted for review and is awaiting a staged release.
3
+ Codesona Runner runs your Codesona agents' sessions on a machine you own. The agent's turn, its
4
+ tools and its verdicts stay in Codesona; the coding agent CLI that does the work runs on your
5
+ machine, with your own account and your own model choice.
6
+
7
+ ## Requirements
8
+
9
+ - macOS
10
+ - Node.js 20.9 or later
11
+ - Claude Code 2.1.306 or later, installed and logged in. Codex and Cursor are detected, and will be
12
+ supported later.
13
+ - For a Developer agent: git, with a credential helper that can reach your repositories over https,
14
+ and the toolchain your product builds with (.NET SDK, Node.js), installed by you. See
15
+ [Developer agents](#developer-agents).
16
+
17
+ ## Getting started
18
+
19
+ Copy the command Factory shows under Agents → Machines → Connect a machine and run it in a terminal:
20
+
21
+ ```sh
22
+ codesona-runner start --machine-key csp_…
23
+ ```
24
+
25
+ It pairs the machine, checks it (`doctor`), sets up the background service and waits until the
26
+ machine is connected. The service is a LaunchAgent (`~/Library/LaunchAgents/ai.codesona.runner.plist`):
27
+ it runs as you, starts at every login, and is started again if it stops unexpectedly.
28
+
29
+ After updating Codesona Runner, run `codesona-runner restart` once no session runs
30
+ (`codesona-runner status` shows them): the service starts again with the new version and connects
31
+ anew. While the service runs a session, `restart` leaves it alone, since a restart would end that
32
+ session, says how many it runs and to run it again once the service is idle; `restart --force`
33
+ restarts it all the same (it reports the sessions it ends to Codesona first). `codesona-runner doctor
34
+ --fix` restarts the service the same way, with the same care, when it finds it running an older
35
+ version. A service set up from another install (another Node.js or npm prefix) starts that install
36
+ again, and `restart` says so; `codesona-runner doctor --fix` sets the service up for the one you run.
37
+
38
+ ## Commands
39
+
40
+ | Command | What it does |
41
+ |---|---|
42
+ | `codesona-runner start --machine-key <key>` | Pairs this machine with your workspace and sets up the background service. Options: `--url <url>` (an `https://` address), `--name <name>` (defaults to the machine's host name), `--no-service` (pair only; take sessions with `codesona-runner run`) |
43
+ | `codesona-runner run` | Keeps the machine connected and runs the sessions Codesona hands it, until you stop it (Ctrl-C). One per machine: not while the background service runs |
44
+ | `codesona-runner doctor` | Checks what this machine needs to run sessions: Node.js, the coding agent CLIs and Claude Code's login, Claude Code settings that would switch off Codesona's checks, git (its credential helper, commit signing, SSH remotes the background service cannot use), the connection to Codesona, the clock, sleep settings and the background service. `--fix` puts right what needs no administrator (the background service only while it runs no session) and prints the exact `sudo` command for the rest |
45
+ | `codesona-runner status` | Shows whether this machine is connected, its agents and its sessions |
46
+ | `codesona-runner prune` | Removes the Developer agents' repository worktrees and local task branches nobody touched for 14 days whose branch your repository's origin already has (at the same commit or a later one). It never removes work that was not pushed: a worktree with uncommitted changes, or a branch with commits origin lacks, is kept and listed. Not while the Runner runs sessions |
47
+ | `codesona-runner restart` | Restarts the background service (`launchctl kickstart -k`), so it runs the Codesona Runner installed now and connects anew, and waits until it is connected. Not while it runs sessions: it says how many and leaves it alone; `--force` restarts it all the same, ending them. With no background service set up, it says so: stop `codesona-runner run` (Ctrl-C) and run it again |
48
+ | `codesona-runner logout` | Disconnects this machine from Codesona, removes the background service and the Runner's files. If Codesona cannot be told, nothing is removed; `--local` removes this machine's side anyway (then disconnect it in Factory) |
49
+ | `codesona-runner --version` | Shows the version |
50
+
51
+ When it stops (logout, an update, the Mac shutting down), the Runner ends its sessions and reports
52
+ them to Codesona first. While a session runs it keeps the Mac awake; an idle Mac sleeps as you set it,
53
+ and its agents' runs wait for it. `codesona-runner doctor` says which power settings would let it
54
+ sleep or stay off, and the command that changes them.
55
+
56
+ ## Developer agents
57
+
58
+ A Developer agent's sessions work in your product's repositories on this machine (Codesona Runner
59
+ 0.2.0 or later). Before such a session starts, the Runner checks that this machine's git can reach
60
+ each repository (`git ls-remote`); if it cannot, the run is not taken and Factory shows why. Then it
61
+ checks the repositories out: one bare clone per repository under `~/.codesona-runner/repos/`, and one
62
+ worktree per agent at `~/.codesona-runner/agents/<agent>/repos/<repository>`, on the task's branch.
63
+ The agent builds and tests there with the tools you installed, commits, and pushes with your git.
64
+
65
+ - **Git and your credentials.** git runs as you, with your `~/.gitconfig` and your credential helper;
66
+ Codesona sends no token to this machine, and the repositories' URLs carry none. Set up a credential
67
+ helper and sign in once in a terminal: Git Credential Manager
68
+ (`brew install --cask git-credential-manager`), or `gh auth setup-git` for GitHub. The background
69
+ service has no SSH agent, so use https remotes; `codesona-runner doctor` warns of an SSH remote,
70
+ including one an `insteadOf` rule in your git config makes.
71
+ - **Commit signing.** Sessions run with `commit.gpgsign` and `tag.gpgsign` off, so a signing setup
72
+ never waits for a PIN in the background and the agent's commits are not signed with your key.
73
+ `codesona-runner doctor` says when your git config signs commits.
74
+ - **Your work and the agent's.** A worktree is the agent's: when it moves to another task its
75
+ uncommitted changes are cleared (build caches such as `node_modules`, `bin`, `obj`, `.nuget`,
76
+ `.gradle`, `target` and `dist` are kept), and its commits stay on their own branch. The Runner never
77
+ deletes a branch with commits origin lacks. `codesona-runner prune` clears worktrees and branches
78
+ that are done with.
79
+ - **Toolchain.** The Runner does not install SDKs. It reports git, the .NET SDKs and Node.js it finds
80
+ to Codesona; a session that needs one you do not have says so.
81
+
82
+ ## What it keeps on the machine
83
+
84
+ Everything is under `~/.codesona-runner/` (only you can read it):
85
+
86
+ - `config.json`: the machine's key, which changes every time the Runner connects (and at least once
87
+ a day). The keys for the connection, for each agent and for each session live only in the running
88
+ Runner's memory.
89
+ - `agents/<agent>/`: each agent's working directory, with the instructions, skills and settings of
90
+ its sessions, and a Developer's worktrees under `repos/`. Your coding agent CLI keeps its transcripts
91
+ where it always does (`~/.claude`).
92
+ - `repos/`: a bare clone of each repository a Developer agent works in, shared by its worktrees.
93
+ - `outbox/`, `spool/`, `state/`: results and activity not yet delivered to Codesona, and what
94
+ `codesona-runner status` shows. The background service's log is `state/runner.log`.
95
+
96
+ Sessions run with your own account, settings and model: the CLI gets your environment, without
97
+ any of Codesona's keys in it. The background service runs with the PATH it was set up with (node's
98
+ own directory, `/opt/homebrew/bin`, `~/.local/bin`, `/usr/local/bin` and the system's) and none of
99
+ your shell's variables: a `CLAUDE_CODE_OAUTH_TOKEN`, `ANTHROPIC_API_KEY` or `CLAUDE_CONFIG_DIR`
100
+ exported in your shell profile does not reach its sessions. Log Claude Code in with
101
+ `claude auth login` (the login is kept in your keychain) and keep its settings in `~/.claude`;
102
+ `codesona-runner doctor` checks the login as the service's sessions will have it, and says which of
103
+ those variables your shell sets. With no background service set up (`start --no-service`, then
104
+ `codesona-runner run` in a terminal), it checks your terminal's own login as well, and the settings
105
+ in the `CLAUDE_CONFIG_DIR` your terminal names.
106
+
107
+ ## Licence
108
+
109
+ Codesona Runner is licensed under the terms in `LICENSE`. It contains third-party components under
110
+ their own licences; `THIRD-PARTY-NOTICES.txt` lists them.
@@ -0,0 +1,40 @@
1
+ Third-party software in Codesona Runner
2
+
3
+ Codesona Runner (the @codesona/runner package) contains the third-party
4
+ components listed below. Each one is licensed under its own terms, and those
5
+ terms govern that component.
6
+
7
+ --------------------------------------------------------------------------------
8
+
9
+ Agent session driver
10
+
11
+ Where: portions of dist/cli.js
12
+ Licence: Apache License 2.0. The full text and the original copyright
13
+ notice are in licenses/agent-session-driver/LICENSE.
14
+ Changes: modified by Azteron; see
15
+ licenses/agent-session-driver/MODIFICATIONS.txt. The modification
16
+ notices carried by its source files are collected in
17
+ dist/cli.js.LEGAL.txt.
18
+
19
+ --------------------------------------------------------------------------------
20
+
21
+ ASP.NET Core SignalR client (@microsoft/signalr 10.0.11)
22
+
23
+ Where: portions of dist/cli.js (the hub connection)
24
+ Licence: MIT License. Copyright (c) .NET Foundation and Contributors. The
25
+ full text is in licenses/signalr/LICENSE.
26
+ Changes: none to its code. The bundle's build turns off one run-time load
27
+ of its optional Node.js dependencies, which the Runner supplies
28
+ itself (scripts/build.mjs).
29
+
30
+ --------------------------------------------------------------------------------
31
+
32
+ ws (ws 8.22.0), a WebSocket client for Node.js
33
+
34
+ Where: portions of dist/cli.js (the hub connection's socket)
35
+ Licence: MIT License. Copyright (c) 2011 Einar Otto Stangvik, (c) 2013
36
+ Arnout Kazemier and contributors, (c) 2016 Luigi Pinca and
37
+ contributors. The full text is in licenses/ws/LICENSE.
38
+ Changes: none.
39
+
40
+ --------------------------------------------------------------------------------