@brokkai/brokk-town-linux-x64 0.1.0-rc.1

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/BUILD.json ADDED
@@ -0,0 +1 @@
1
+ {"commit": "cfa1a68754e565b61894bb5de33558ee05b169f7", "tag": "v0.1.0-rc.1", "target": "linux-amd64"}
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 [yyyy] [name of copyright owner]
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,12 @@
1
+ Brokk Town
2
+ Copyright 2026 Brokk.ai and contributors
3
+
4
+ This project is licensed under the Apache License, Version 2.0.
5
+ See LICENSE for the full terms. Third-party terms and attribution are
6
+ provided in licenses/THIRD_PARTY_NOTICES.txt.
7
+
8
+ Process execution, terminal key decoding, and license checking foundations
9
+ are adapted from BrokkAi/review-bot, BrokkAi/bug-bot, and BrokkAi/issue-bot,
10
+ also licensed under Apache-2.0. Modified for the local multi-repository service.
11
+
12
+ Town artwork was generated for this project; see docs/ARTWORK.md.
package/README.md ADDED
@@ -0,0 +1,203 @@
1
+ # Brokk Town
2
+
3
+ One repository, one little town. Brokk Town runs several repository towns from a
4
+ local Go service, with an animated browser village and a compact terminal control
5
+ panel. Each town owns its houses, queues, review loops, releases, and history.
6
+ Branches and private worktrees belong to their repository's town. Your machine
7
+ hosts the towns and shares four agent worker slots between them.
8
+
9
+ The browser shows worker houses, wheelbarrows carrying completed handoffs, trucks
10
+ bringing external issues and PRs, and shipments leaving the release depot. Visit
11
+ a house to inspect its queue, activity, errors, and controls. Town hall holds
12
+ repo-bot's reports. The all-towns overview shows activity and attention counts
13
+ without visiting each repository.
14
+
15
+ [![CI](https://github.com/BrokkAi/brokk-town/actions/workflows/ci.yml/badge.svg)](https://github.com/BrokkAi/brokk-town/actions/workflows/ci.yml)
16
+
17
+ This is the first local implementation. The browser UI is embedded in the Go
18
+ binary; Node.js is only needed for UI development checks and agents that use it.
19
+ Linux and macOS are supported. No hosted service is required.
20
+
21
+ ## Try the town
22
+
23
+ Build with the Go version in `go.mod`:
24
+
25
+ ```sh
26
+ make build
27
+ ./bin/bt serve --demo
28
+ ```
29
+
30
+ Open the browser address printed by the service. In another terminal:
31
+
32
+ ```sh
33
+ ./bin/bt tui --demo
34
+ ```
35
+
36
+ Demo mode uses an isolated state directory and simulated activity in two towns.
37
+ It never calls GitHub or launches agents. Orchard cycles through bug discovery,
38
+ implementation, review, repair, merge, release, and external arrivals. Paper-trail
39
+ illustrates a quiet neighboring repository. Pause a house to hold its next step.
40
+
41
+ The browser and TUI attach to the same service. Closing either leaves workers
42
+ running. Stop the foreground service with Ctrl+C; it cancels and waits for workers
43
+ before releasing the state lock. `bt` without a command opens the TUI of an
44
+ already-running service. Use `bt web` to print its browser address again.
45
+
46
+ ## Installation and releases
47
+
48
+ Source is published at [BrokkAi/brokk-town](https://github.com/BrokkAi/brokk-town).
49
+ Until the first release, build from source as above, or install the current branch:
50
+
51
+ ```sh
52
+ go install github.com/BrokkAi/brokk-town/cmd/bt@master
53
+ ```
54
+
55
+ The release pipeline builds checksum-verified Linux/macOS archives for amd64 and
56
+ arm64, plus `@brokkai/brokk-town` and four native npm packages. All packages carry
57
+ the project license, attribution, and complete third-party notices. No release
58
+ has been cut yet. After the first release, the supported installer commands are:
59
+
60
+ ```sh
61
+ sh install.sh # From a checkout; defaults to ~/.local/bin
62
+ npm install -g @brokkai/brokk-town # Installs the bt launcher and native package
63
+ ```
64
+
65
+ The GitHub release workflow and npm OIDC workflow follow the bot repositories.
66
+ The `packages-publish` environment accepts `v*` tags only. npm trust must be
67
+ configured for all five package names after their initial bootstrap publication;
68
+ a workflow file alone does not establish npm trust. See [RELEASING.md](RELEASING.md)
69
+ for first-release setup, access checks, publishing, and recovery.
70
+
71
+ ## Connect real repositories
72
+
73
+ Install and authenticate `git`, GitHub CLI (`gh`), and an ACP coding agent. The
74
+ agent defaults to `codex-acp` on PATH, with `npx --yes
75
+ @agentclientprotocol/codex-acp` as its fallback. Git must already be able to clone
76
+ and push your GitHub repositories; Town uses the current Git/gh credentials.
77
+
78
+ ```sh
79
+ ./bin/bt serve --repo BrokkAi/my-project
80
+ # In another terminal:
81
+ ./bin/bt add --repo BrokkAi/another-project
82
+ ./bin/bt tui
83
+ ```
84
+
85
+ New towns start with the four automation workers **paused**. Repo-bot starts its
86
+ read-only inventory. Inspect the town, then start individual workers or choose
87
+ **Wake the town**. Starting workers authorizes their real work: filing issues,
88
+ creating and repairing PRs, posting reviews, merging under the configured policy,
89
+ and publishing releases. Agents and verification commands run with your local
90
+ permissions. Use an isolated account or machine for repositories you don't trust.
91
+
92
+ ```sh
93
+ ./bin/bt start --repo BrokkAi/my-project --role bug
94
+ ./bin/bt pause --repo BrokkAi/my-project --role all
95
+ ./bin/bt stop --repo BrokkAi/my-project --role issue
96
+ ./bin/bt status
97
+ ```
98
+
99
+ Pause finishes active work and stops scheduling more. Stop also cancels active
100
+ work. Enabled/paused settings survive restarts. A restart resumes enabled workers;
101
+ uncertain external writes retain their saved intent and are reconciled first.
102
+
103
+ ## How work moves
104
+
105
+ | House | Work and handoff |
106
+ | --- | --- |
107
+ | Bug greenhouse | Runs bug-bot's investigation and verification; observed filed issues travel to issue-bot. |
108
+ | Issue workshop | Runs issue-bot on eligible issues, opens implementation-ready PRs, and repairs Town-owned PR branches from review feedback. |
109
+ | Review observatory | Runs review-bot, independently checks the full change and every retained finding, then returns fixes or waits for merge requirements. |
110
+ | Release depot | Runs release-bot's batching and publishing policy. Confirmed merged/direct commits accumulate here; a published stable release ships only commits proven to be its ancestors. |
111
+ | Repo watchtower | Polls GitHub, reconciles arrivals and revisions, summarizes new commit titles, reports queue growth and blocked work. |
112
+ | Town hall | Stores periodic and event-triggered repo-bot reports. |
113
+
114
+ The first complete inventory establishes existing work without a burst of arrival
115
+ animations. Subsequent deliveries follow durable, sequenced state changes.
116
+ Animation never initiates a GitHub write. Reconnecting does not replay previously
117
+ seen deliveries. External PRs receive reviews but their branches are left to their
118
+ authors; only locally recorded Town-created branches enter automatic repair.
119
+
120
+ A review is bound to the exact base, head, PR description, and discussion snapshot. A suppressed
121
+ duplicate comment is still a finding to check. Complete coverage, explicit
122
+ resolution of every concern, and validation evidence are required for a clean
123
+ result. New commits invalidate review readiness. Uncertain reviews and exhausted
124
+ repair cycles become visible tasks needing attention.
125
+
126
+ The default merge policy is `bot`: auto-merge eligible Town-created PRs. `manual`
127
+ leaves merging to the operator; `all` also permits eligible external PRs. Town-managed merges require current clean Town evidence, GitHub mergeability, required checks
128
+ and approvals. Town uses an expected-head squash merge, without admin bypass.
129
+ Repositories that require a merge queue or prohibit squash merging need manual
130
+ merges for now. GitHub is the final authority at write time.
131
+
132
+ ## Configuration and recovery
133
+
134
+ Copy [docs/config.example.json](docs/config.example.json), edit the repository,
135
+ agent command, verification command, and policy, then run:
136
+
137
+ ```sh
138
+ ./bin/bt serve --config /path/to/towns.json
139
+ ```
140
+
141
+ Configuration is a JSON array. Each entry supplies `repo`, optional `branch`,
142
+ `agent`, optional `verify` argument vector, `merge_policy`, `poll_seconds`,
143
+ `report_seconds`, and `max_cycles`. The example lists all required values. Town
144
+ uses the repository's default branch when omitted; an initialized town's branch
145
+ cannot be changed in place. Omitted towns are retained when loading a config.
146
+ Agent configuration uses acp-go's `command`, `environment`, `auth_method`, `mode`, `model`, and `effort` fields.
147
+
148
+ Repo-bot and issue/review scheduling use `poll_seconds` (default 60). Quiet reports
149
+ use `report_seconds` (1800). Bug-bot runs at most every 30 minutes; release-bot
150
+ checks every five minutes and retains its own quiet window, minimum gap, and
151
+ batching decisions. Each worker attempt has a two-hour deadline. Repair cycles
152
+ default to five; failed PR attempts back off and block after three failures.
153
+
154
+ Private state defaults to `$XDG_STATE_HOME/brokk-town` or
155
+ `~/.local/state/brokk-town`. `--state-dir` selects another directory; `--demo`
156
+ appends `demo`. A single writer lock, atomic snapshots, per-role bot state, and
157
+ private worktrees keep towns separate. Events, logs, and reports have bounded
158
+ recent histories; task/intent history persists. Browser access uses a per-service
159
+ local key in a URL fragment. `connection.json` and state snapshots are mode 0600.
160
+ Agent commands/environment values are omitted from public configuration snapshots.
161
+ Local logs and worktrees can contain repository content; keep this directory private.
162
+
163
+ If a push or merge response is lost, Town checks GitHub rather than assuming
164
+ success. Inspect the task and its saved intent, then use **Reconcile and retry** or:
165
+
166
+ ```sh
167
+ ./bin/bt retry --repo BrokkAi/my-project --task pr:123
168
+ ```
169
+
170
+ Retry explicitly permits another attempt after fresh checks. For an uncertain
171
+ repair push, it reuses and verifies the saved commit; it does not rerun the agent.
172
+ If the PR moved, the saved worktree is retained for inspection. A retry also resets
173
+ an exhausted repair budget. Never delete an uncertain intent to force progress.
174
+ Use `bt status` to inspect saved details and GitHub to resolve conflicts.
175
+
176
+ The HTTP listener accepts loopback IPs only (default `127.0.0.1:8099`). Host,
177
+ origin, and bearer key checks protect the local API. A browser supporting WebMCP
178
+ can list towns and navigate to a house through optional page tools. Unsupported
179
+ browsers use the ordinary interface.
180
+
181
+ ## Keyboard and development
182
+
183
+ Browser: `0` overview, `1`–`5` agent houses, `6` town hall, `?` help, Escape closes
184
+ the inspector. Motion follows reduced-motion preferences and can be switched off.
185
+ Terminal: `0` overview, Tab next town, `1`–`5` or `j`/`k` select a house, `s` start,
186
+ `p` pause, `x` stop, `a` wake the selected town, `q` detach. Bracketed paste is
187
+ ignored as commands. Network and agent work stay off the input/render loops.
188
+
189
+ ```sh
190
+ make check
191
+ make smoke
192
+ ```
193
+
194
+ Tests use fake GitHub and agents, temporary local Git remotes, authenticated HTTP
195
+ fixtures, and the isolated simulation. Do not use live repository automation as a
196
+ development test. See [CONTRIBUTING.md](CONTRIBUTING.md),
197
+ [docs/ARCHITECTURE.md](docs/ARCHITECTURE.md), and
198
+ [licenses/README.md](licenses/README.md).
199
+
200
+ Licensed under [Apache-2.0](LICENSE). Attribution is in [NOTICE](NOTICE) and
201
+ [third-party notices](licenses/THIRD_PARTY_NOTICES.txt). Artwork provenance is in
202
+ [docs/ARTWORK.md](docs/ARTWORK.md). Native and npm packaging is configured; the first publication still requires
203
+ the documented package bootstrap and trusted-publisher setup.
package/bin/bt ADDED
Binary file