@mifune/agro 0.9.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.
Files changed (6) hide show
  1. package/LICENSE +202 -0
  2. package/NOTICE +27 -0
  3. package/README.md +182 -0
  4. package/dist/agro.js +5578 -0
  5. package/dist/oh.js +5578 -0
  6. package/package.json +41 -0
package/LICENSE ADDED
@@ -0,0 +1,202 @@
1
+
2
+ Apache License
3
+ Version 2.0, January 2004
4
+ http://www.apache.org/licenses/
5
+
6
+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
7
+
8
+ 1. Definitions.
9
+
10
+ "License" shall mean the terms and conditions for use, reproduction,
11
+ and distribution as defined by Sections 1 through 9 of this document.
12
+
13
+ "Licensor" shall mean the copyright owner or entity authorized by
14
+ the copyright owner that is granting the License.
15
+
16
+ "Legal Entity" shall mean the union of the acting entity and all
17
+ other entities that control, are controlled by, or are under common
18
+ control with that entity. For the purposes of this definition,
19
+ "control" means (i) the power, direct or indirect, to cause the
20
+ direction or management of such entity, whether by contract or
21
+ otherwise, or (ii) ownership of fifty percent (50%) or more of the
22
+ outstanding shares, or (iii) beneficial ownership of such entity.
23
+
24
+ "You" (or "Your") shall mean an individual or Legal Entity
25
+ exercising permissions granted by this License.
26
+
27
+ "Source" form shall mean the preferred form for making modifications,
28
+ including but not limited to software source code, documentation
29
+ source, and configuration files.
30
+
31
+ "Object" form shall mean any form resulting from mechanical
32
+ transformation or translation of a Source form, including but
33
+ not limited to compiled object code, generated documentation,
34
+ and conversions to other media types.
35
+
36
+ "Work" shall mean the work of authorship, whether in Source or
37
+ Object form, made available under the License, as indicated by a
38
+ copyright notice that is included in or attached to the work
39
+ (an example is provided in the Appendix below).
40
+
41
+ "Derivative Works" shall mean any work, whether in Source or Object
42
+ form, that is based on (or derived from) the Work and for which the
43
+ editorial revisions, annotations, elaborations, or other modifications
44
+ represent, as a whole, an original work of authorship. For the purposes
45
+ of this License, Derivative Works shall not include works that remain
46
+ separable from, or merely link (or bind by name) to the interfaces of,
47
+ the Work and Derivative Works thereof.
48
+
49
+ "Contribution" shall mean any work of authorship, including
50
+ the original version of the Work and any modifications or additions
51
+ to that Work or Derivative Works thereof, that is intentionally
52
+ submitted to Licensor for inclusion in the Work by the copyright owner
53
+ or by an individual or Legal Entity authorized to submit on behalf of
54
+ the copyright owner. For the purposes of this definition, "submitted"
55
+ means any form of electronic, verbal, or written communication sent
56
+ to the Licensor or its representatives, including but not limited to
57
+ communication on electronic mailing lists, source code control systems,
58
+ and issue tracking systems that are managed by, or on behalf of, the
59
+ Licensor for the purpose of discussing and improving the Work, but
60
+ excluding communication that is conspicuously marked or otherwise
61
+ designated in writing by the copyright owner as "Not a Contribution."
62
+
63
+ "Contributor" shall mean Licensor and any individual or Legal Entity
64
+ on behalf of whom a Contribution has been received by Licensor and
65
+ subsequently incorporated within the Work.
66
+
67
+ 2. Grant of Copyright License. Subject to the terms and conditions of
68
+ this License, each Contributor hereby grants to You a perpetual,
69
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
70
+ copyright license to reproduce, prepare Derivative Works of,
71
+ publicly display, publicly perform, sublicense, and distribute the
72
+ Work and such Derivative Works in Source or Object form.
73
+
74
+ 3. Grant of Patent License. Subject to the terms and conditions of
75
+ this License, each Contributor hereby grants to You a perpetual,
76
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
77
+ (except as stated in this section) patent license to make, have made,
78
+ use, offer to sell, sell, import, and otherwise transfer the Work,
79
+ where such license applies only to those patent claims licensable
80
+ by such Contributor that are necessarily infringed by their
81
+ Contribution(s) alone or by combination of their Contribution(s)
82
+ with the Work to which such Contribution(s) was submitted. If You
83
+ institute patent litigation against any entity (including a
84
+ cross-claim or counterclaim in a lawsuit) alleging that the Work
85
+ or a Contribution incorporated within the Work constitutes direct
86
+ or contributory patent infringement, then any patent licenses
87
+ granted to You under this License for that Work shall terminate
88
+ as of the date such litigation is filed.
89
+
90
+ 4. Redistribution. You may reproduce and distribute copies of the
91
+ Work or Derivative Works thereof in any medium, with or without
92
+ modifications, and in Source or Object form, provided that You
93
+ meet the following conditions:
94
+
95
+ (a) You must give any other recipients of the Work or
96
+ Derivative Works a copy of this License; and
97
+
98
+ (b) You must cause any modified files to carry prominent notices
99
+ stating that You changed the files; and
100
+
101
+ (c) You must retain, in the Source form of any Derivative Works
102
+ that You distribute, all copyright, patent, trademark, and
103
+ attribution notices from the Source form of the Work,
104
+ excluding those notices that do not pertain to any part of
105
+ the Derivative Works; and
106
+
107
+ (d) If the Work includes a "NOTICE" text file as part of its
108
+ distribution, then any Derivative Works that You distribute must
109
+ include a readable copy of the attribution notices contained
110
+ within such NOTICE file, excluding those notices that do not
111
+ pertain to any part of the Derivative Works, in at least one
112
+ of the following places: within a NOTICE text file distributed
113
+ as part of the Derivative Works; within the Source form or
114
+ documentation, if provided along with the Derivative Works; or,
115
+ within a display generated by the Derivative Works, if and
116
+ wherever such third-party notices normally appear. The contents
117
+ of the NOTICE file are for informational purposes only and
118
+ do not modify the License. You may add Your own attribution
119
+ notices within Derivative Works that You distribute, alongside
120
+ or as an addendum to the NOTICE text from the Work, provided
121
+ that such additional attribution notices cannot be construed
122
+ as modifying the License.
123
+
124
+ You may add Your own copyright statement to Your modifications and
125
+ may provide additional or different license terms and conditions
126
+ for use, reproduction, or distribution of Your modifications, or
127
+ for any such Derivative Works as a whole, provided Your use,
128
+ reproduction, and distribution of the Work otherwise complies with
129
+ the conditions stated in this License.
130
+
131
+ 5. Submission of Contributions. Unless You explicitly state otherwise,
132
+ any Contribution intentionally submitted for inclusion in the Work
133
+ by You to the Licensor shall be under the terms and conditions of
134
+ this License, without any additional terms or conditions.
135
+ Notwithstanding the above, nothing herein shall supersede or modify
136
+ the terms of any separate license agreement you may have executed
137
+ with Licensor regarding such Contributions.
138
+
139
+ 6. Trademarks. This License does not grant permission to use the trade
140
+ names, trademarks, service marks, or product names of the Licensor,
141
+ except as required for reasonable and customary use in describing the
142
+ origin of the Work and reproducing the content of the NOTICE file.
143
+
144
+ 7. Disclaimer of Warranty. Unless required by applicable law or
145
+ agreed to in writing, Licensor provides the Work (and each
146
+ Contributor provides its Contributions) on an "AS IS" BASIS,
147
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
148
+ implied, including, without limitation, any warranties or conditions
149
+ of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
150
+ PARTICULAR PURPOSE. You are solely responsible for determining the
151
+ appropriateness of using or redistributing the Work and assume any
152
+ risks associated with Your exercise of permissions under this License.
153
+
154
+ 8. Limitation of Liability. In no event and under no legal theory,
155
+ whether in tort (including negligence), contract, or otherwise,
156
+ unless required by applicable law (such as deliberate and grossly
157
+ negligent acts) or agreed to in writing, shall any Contributor be
158
+ liable to You for damages, including any direct, indirect, special,
159
+ incidental, or consequential damages of any character arising as a
160
+ result of this License or out of the use or inability to use the
161
+ Work (including but not limited to damages for loss of goodwill,
162
+ work stoppage, computer failure or malfunction, or any and all
163
+ other commercial damages or losses), even if such Contributor
164
+ has been advised of the possibility of such damages.
165
+
166
+ 9. Accepting Warranty or Additional Liability. While redistributing
167
+ the Work or Derivative Works thereof, You may choose to offer,
168
+ and charge a fee for, acceptance of support, warranty, indemnity,
169
+ or other liability obligations and/or rights consistent with this
170
+ License. However, in accepting such obligations, You may act only
171
+ on Your own behalf and on Your sole responsibility, not on behalf
172
+ of any other Contributor, and only if You agree to indemnify,
173
+ defend, and hold each Contributor harmless for any liability
174
+ incurred by, or claims asserted against, such Contributor by reason
175
+ of your accepting any such warranty or additional liability.
176
+
177
+ END OF TERMS AND CONDITIONS
178
+
179
+ APPENDIX: How to apply the Apache License to your work.
180
+
181
+ To apply the Apache License to your work, attach the following
182
+ boilerplate notice, with the fields enclosed by brackets "[]"
183
+ replaced with your own identifying information. (Don't include
184
+ the brackets!) The text should be enclosed in the appropriate
185
+ comment syntax for the file format. We also recommend that a
186
+ file or class name and description of purpose be included on the
187
+ same "printed page" as the copyright notice for easier
188
+ identification within third-party archives.
189
+
190
+ Copyright 2026 Ryan Eggleston, d/b/a Mifune Dev (mifune.dev)
191
+
192
+ Licensed under the Apache License, Version 2.0 (the "License");
193
+ you may not use this file except in compliance with the License.
194
+ You may obtain a copy of the License at
195
+
196
+ http://www.apache.org/licenses/LICENSE-2.0
197
+
198
+ Unless required by applicable law or agreed to in writing, software
199
+ distributed under the License is distributed on an "AS IS" BASIS,
200
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
201
+ See the License for the specific language governing permissions and
202
+ limitations under the License.
package/NOTICE ADDED
@@ -0,0 +1,27 @@
1
+ Open Harness
2
+ Copyright 2026 Ryan Eggleston, d/b/a Mifune Dev (mifune.dev)
3
+
4
+ This product includes software developed at Mifune Dev (https://mifune.dev).
5
+
6
+ This distribution is licensed under the Apache License, Version 2.0. A copy
7
+ of the License is included in the LICENSE file.
8
+
9
+ Third-Party Attributions
10
+ =========================
11
+
12
+ typescript (referenced in .oh/cli/package-lock.json) is the sole dependency
13
+ in this repository declaring "license": "Apache-2.0". It is a devDependency
14
+ (.oh/cli/package.json, "devDependencies") used only for type-checking and is
15
+ excluded from the published package, whose "files" array is limited to
16
+ "dist" (bundled output produced by esbuild, not the typescript package
17
+ itself). It therefore carries no NOTICE obligation for consumers of this
18
+ distribution.
19
+
20
+ Trademarks
21
+ ==========
22
+
23
+ Apache License, Version 2.0, Section 6 grants no permission to use the
24
+ trade names, trademarks, service marks, or product names of the Licensor
25
+ -- including "Mifune" and "Open Harness", their logos, or associated trade
26
+ dress -- beyond the reasonable and customary use in describing the origin
27
+ of the Work that Section 6 itself allows.
package/README.md ADDED
@@ -0,0 +1,182 @@
1
+ # @mifune/agro
2
+
3
+ The **AGRO CLI** (`agro`) — create an [Open Harness](https://oh.mifune.dev)
4
+ Docker sandbox for coding agents and drive its lifecycle from the command line.
5
+
6
+ Open Harness is a portable harness for running coding agents (Claude Code, Codex, Pi,
7
+ and others) in an isolated Docker sandbox, with the agent's identity, skills, and crons
8
+ versioned in git. This package is the standalone `agro` CLI that creates sandboxes and
9
+ manages their lifecycle.
10
+
11
+ ## Install
12
+
13
+ ```bash
14
+ npm install -g @mifune/agro
15
+ ```
16
+
17
+ Then run it as `agro`:
18
+
19
+ ```bash
20
+ agro --help
21
+ ```
22
+
23
+ Or run it once without installing:
24
+
25
+ ```bash
26
+ npx @mifune/agro sandbox install docker
27
+ ```
28
+
29
+ Prefer a `curl | bash` bootstrap (also installs Node when missing)? `get-agro.sh`
30
+ installs the prebuilt `agro` artifact from the latest GitHub release — it never
31
+ clones or builds on your machine:
32
+
33
+ ```bash
34
+ curl -fsSL https://github.com/mifunedev/openharness/releases/latest/download/get-agro.sh | bash
35
+ ```
36
+
37
+ ### Requirements
38
+
39
+ - **Node.js ≥ 20** (22 recommended) on your `PATH`. Unlike the `get-agro.sh` bootstrap,
40
+ npm will not install Node for you.
41
+ - **Docker** and **git** for the sandbox lifecycle commands (`agro sandbox install`, `agro shell`).
42
+
43
+ ## Compatibility: `oh`
44
+
45
+ `oh` is the compatibility entry point for `agro`. It ships as the npm package
46
+ [`@mifune/openharness`](https://www.npmjs.com/package/@mifune/openharness), which
47
+ contains no CLI code of its own: its only file imports the `agro` bundle from an
48
+ exact-pinned `@mifune/agro` dependency. The two packages expose disjoint executables
49
+ (`agro` and `oh`), can be installed together, and removing either never removes the
50
+ other's executable. `oh --help` ends with a line that names `agro` as the canonical
51
+ CLI; everything else about `oh` — the `.oh/` control plane, `oh.json`, `OH_*`
52
+ variables, `~/.oh/sandboxes` — is unchanged, and `agro` reads and writes exactly the
53
+ same files.
54
+
55
+ ## Quick start
56
+
57
+ Create a sandbox from any directory — no project checkout needed:
58
+
59
+ ```bash
60
+ agro sandbox install docker # wizard, then boot; writes ~/.oh/sandboxes/<name>/
61
+ agro sandbox list # name, runtime, status, repo
62
+ agro shell <name> # open a zsh shell in the running container
63
+ ```
64
+
65
+ To bind one of your own checkouts into the sandbox, equip it and pass `--repo`:
66
+
67
+ ```bash
68
+ cd your-project
69
+ oh update # vendor .oh/ + crons/ — and nothing else (compatibility window)
70
+ agro sandbox install docker --repo "$PWD" --name your-project
71
+ ```
72
+
73
+ Add an agent harness or a tool at any point — this needs no rebuild. The verb is
74
+ the only door; nothing installs at boot:
75
+
76
+ ```bash
77
+ agro harness list # what exists, and what is installed
78
+ agro harness install opencode # install into the running sandbox
79
+ agro tool install herdr # a fresh sandbox has no herdr
80
+ ```
81
+
82
+ Everything else the sandbox ships — a headless browser, the GitHub CLI:
83
+
84
+ ```bash
85
+ agro tool list # what is present, and what is installable
86
+ agro tool install agent-browser # asks before the ~1 GB Chromium download
87
+ ```
88
+
89
+ `agro harness` and `agro tool` also run **inside** the sandbox, where they install
90
+ into the current environment instead of driving the container over Docker
91
+ Compose. Detection is automatic (`/.dockerenv` plus `SANDBOX_NAME`); override it
92
+ with `OH_EXECUTION_TARGET=local` or `OH_EXECUTION_TARGET=docker-compose`.
93
+ `agro sandbox install` remains host-only and says so.
94
+
95
+ ## Commands
96
+
97
+ | Command | What it does |
98
+ |---|---|
99
+ | `agro sandbox install <runtime>` | Create a sandbox: run the wizard, write the registry entry under `${OH_HOME:-~/.oh}/sandboxes/<name>/`, materialise the compose files and wrapper into it, and boot the container. Flags: `--name`, `--repo <dir>`, `--yes`, `--image[=<ref>]`, `--no-build`, `--print-argv`. `docker` is provisionable; `microsandbox` is planned and refuses with a pointer at the runtime RFC. |
100
+ | `agro sandbox list [--json]` | List the registry entries with name, runtime, container status, and bound repo. |
101
+ | `agro shell [name]` | Open a `zsh` shell in the running sandbox container. |
102
+ | `agro stop [name]` | Stop the sandbox, preserving volumes. |
103
+ | `agro restart [name]` | Restart the sandbox service. |
104
+ | `agro logs [name]` | Tail the sandbox compose logs. |
105
+ | `agro ps [name]` | Show sandbox service status. |
106
+ | `agro destroy [name] [--yes]` | Remove the sandbox, wipe its named volumes (`docker compose down -v`), then delete the registry entry. Names the volumes, then requires you to type the sandbox name; refuses without a TTY unless `--yes` is passed. |
107
+ | `agro update [--dry-run]` | Upgrade the installed `agro` executable and nothing else, through the mechanism that installed it: npm-managed (`npm view` + `npm install -g --prefix <owning prefix> @mifune/agro@<version>`) or standalone (download `AGRO_JS_URL`, falling back to `OH_JS_URL` and defaulting to the latest `agro.js` release asset; verify its shebang and `--version`; rename it over the file; keep `<path>.prev` until the new file verifies). Refuses image-shipped, source-checkout, legacy-package, unresolvable, read-only, PATH-shadowed, and downgrade cases with the supported procedure; never uses `sudo`; a no-op when current. Project payload vendoring is `oh update` — see the compatibility note below. |
108
+ | `agro config show [--sandbox <name>]` | Print the resolved `oh.json` — every non-secret setting. |
109
+ | `agro config set <field> <value> [--sandbox <name>]` | Set one dotted `oh.json` field (`access.sshPort 2200`), validated against the schema. A secret key is refused with a pointer at `agro secret set`. |
110
+ | `agro config repo` | Create a repo on your GitHub account, keep the cloned-from upstream as the `openharness` remote, point `origin` at yours, and push. Asks first and defaults to no; never runs without an interactive yes. |
111
+ | `agro config <integration>` | Configure an integration via an interactive wizard. |
112
+ | `agro secret set <KEY> [--sandbox <name>]` | Prompt for the value with the input hidden and write it to the gitignored `.env` (mode `0600`). The value is never taken from the command line, where shell history would keep it. |
113
+ | `agro secret list [--sandbox <name>]` | List the allow-listed keys that hold a value, with the values redacted. |
114
+ | `agro compose config` | Print the resolved compose configuration. |
115
+ | `agro harness <list\|install\|status>` | Install and inspect agent CLI harnesses. `install` is the only door: it probes the running sandbox, installs into the persistent home volume, and reports. It reads and writes no `oh.json` field, and needs no rebuild. |
116
+ | `agro tool <list\|install\|status>` | Install and inspect sandbox tooling that is not an agent CLI. `herdr`, `cloudflared`, `agent-browser`, `microsandbox`, and `tailscale` are `installable`; `gh` and the Docker CLI are `baked-in` and cannot be installed. Nothing installs at boot. A large download is confirmed first, and `--yes` accepts it. |
117
+ | `agro gateway <args…>` | Manage a messaging client session (Slack bridge for `pi`/`hermes`). |
118
+ | `agro cloud <args…>` | Configure credentials and manage OpenHarness Cloud SSH keys and nodes. |
119
+ | `agro --version` | Print the CLI version. |
120
+ | `agro --help` | Show help; every subcommand also accepts `--help`. |
121
+
122
+ `oh.json` and the `.env` beside it are the only two configuration surfaces: `oh.json`
123
+ holds every non-secret setting, `.env` holds only the allow-listed secrets. Each has
124
+ two homes — a sandbox's registry entry (`--sandbox <name>`) and the project root
125
+ (no flag). See
126
+ [configuration](https://github.com/mifunedev/openharness/blob/main/docs/configuration.md)
127
+ for the field reference.
128
+
129
+ `agro` (or `oh`) is the only lifecycle door, on the host and in the sandbox, and every verb
130
+ runs `.oh/scripts/docker-compose.sh` — see
131
+ [lifecycle commands](https://github.com/mifunedev/openharness/blob/main/docs/lifecycle-commands.md), which also
132
+ states the confirmation policy `agro destroy` carries.
133
+
134
+ `agro update` never touches a project. During the compatibility window `oh update` vendors
135
+ `.oh/` + `crons/` into the current directory, equipping an empty checkout and upgrading an
136
+ equipped one (`--from <dir>` / `--from-remote [--ref <ref>]`, `--dry-run`, `--force`); it
137
+ writes nothing else and never prompts. `agro update` rejects those flags and points at
138
+ `oh update`. `oh update` prefers the payload bundled into the CLI itself; with `--from-remote`
139
+ (or no payload at all) it shallow-clones the public OpenHarness repo into a temp dir and
140
+ removes it after the run (`--ref <ref>` pins it). Root `docs/` remains project-owned and is
141
+ not part of that payload. Catalog and help output therefore links to the Open Harness source
142
+ documentation instead of a path inside the equipped project.
143
+
144
+ The CLI writes no scaffold. It creates no `AGENTS.md`, no provider configuration, and no
145
+ `.gitignore` line beyond the `.env` line `agro secret set` adds inside a git checkout.
146
+
147
+ ## OpenHarness Cloud
148
+
149
+ `agro cloud` is an Apache-2.0 licensed client that talks to a proprietary hosted service.
150
+ Configure the Cloud API once, then use `agro cloud` instead of hand-writing authenticated HTTP
151
+ requests:
152
+
153
+ ```bash
154
+ agro cloud config # securely prompts for the current provisioner key
155
+ agro cloud ssh-keys create --name laptop --public-key-file ~/.ssh/openharness_node.pub
156
+ agro cloud nodes create --name demo --ssh-key-id <ssh-key-id>
157
+ agro cloud nodes watch <node-id>
158
+ ```
159
+
160
+ Both settings are repository-local. `agro cloud config` writes the API base URL to `cloud.apiUrl`
161
+ in the tracked `oh.json` and, until OpenHarness Cloud issues user API tokens, stores the
162
+ user-provided provisioner key as `OH_CLOUD_PROVISION_KEY` in the gitignored root `.env`
163
+ (mode `0600`). The key is never printed; `agro cloud config show` redacts it. Nothing is written
164
+ under `$HOME`.
165
+
166
+ `OH_CLOUD_API_URL` and `OH_CLOUD_PROVISION_KEY` (`OH_PROVISION_KEY` and `PROVISION_KEY` are
167
+ still accepted) provide non-persistent overrides for automation. Because the settings live in
168
+ the repository, `agro cloud` runs inside an OpenHarness-equipped repo; outside one, pass
169
+ `--api-url` and `--provision-key`. On the first `agro cloud` run in a repo, a legacy
170
+ `~/.config/openharness/cloud.json` is migrated into these two homes and then reported as no
171
+ longer read — it is left on disk for you to delete. Run `agro cloud --help` for the complete
172
+ SSH-key and node lifecycle command set.
173
+
174
+ ## Documentation
175
+
176
+ - **Docs:** https://oh.mifune.dev
177
+ - **Installation guide:** https://oh.mifune.dev/docs/installation
178
+ - **Source & issues:** https://github.com/mifunedev/openharness
179
+
180
+ ## License
181
+
182
+ [Apache-2.0](./LICENSE)