bazel start + mcp start

This commit is contained in:
ari committed 2026-11-01 14:55:33 -05:00
1 parent a90653260a
commit 4c082aca7c
33 files changed
+1728 -79

No files matched your search

+4
View File
@@ -0,0 +1,4 @@
common --enable_bzlmod
build --workspace_status_command=tools/workspace_status.sh
build:release --stamp
test --test_output=errors
+1
View File
@@ -0,0 +1 @@
8.7.0
+1
View File
@@ -3,5 +3,6 @@
/slackerbot/slackerbot
result
result-*
/bazel-*
.commandcode/
.direnv/
+6 -2
View File
@@ -31,6 +31,8 @@ flowchart LR
**Lifecycle threads:** `manager.EnsureProgress` reports `StartEvent`s (placing, booting, registered) only when it really starts a container. The bot (`bot/lifecycle.go`) turns them into replies in a dedicated top-level message for that container, pins it, and unpins the previous run's message. The message's channel and timestamp are kept on the owner (`lifecycle_channel`, `lifecycle_ts`). The user's thread only gets a link. Stops (`stop`, the button, the idle reaper) post to the same thread, and `manager.WaitStopped` confirms when the machine is gone.
**Files:** attachments on a message (`file_share`, or `files` on an `app_mention`) are downloaded by the bot and written into the home with the node's `write_file` call, then their paths are added to the prompt. The other way, goose gets the `slackerbot` MCP server (`slackerbot tools`, run inside the container as `slackerbot-tools`) through `mcpServers` in `session/new` and `session/load`. Its `send_file` tool only checks the path and size and answers "queued". The bot watches the ACP `tool_call` / `tool_call_update` messages, and when a `send_file` call completes it reads the file with `read_file` and uploads it to the thread with `files.uploadV2`. Bytes go node → master → Slack, so slaves never need a Slack token. Both calls work in 4 MB chunks, open files with `os.Root` so symlinks and `..` can't leave the home, and are capped by `max_send_file_mb`. An older slave answers "unknown call", which surfaces as `node.ErrTooOld` and a polite reply.
**Containers** are `systemd-nspawn` machines started through `systemd-run`, each in its own `slackerbot-<machine>.service` unit, with CPU and memory limits. They boot the NixOS system built by `nix build .#agent` (`nix/container.nix`), which runs `goose serve` on port 1984. `/nix/store` is shared read-only. `/root` is bind-mounted from a btrfs subvolume on one of the node's drives, and is the only thing that persists. The agent's env file (API keys, the per-container goose secret) is written by the host and bind-mounted in read-only.
**State** lives only on the master, in `state_dir/state.json`: owners (container, size, node, drive, storage limits, idle limit, lifecycle message), sessions (Slack thread → ACP session id, plus the thread's listen mode), each channel's default listen mode, and permissions. Nodes report what's running and how much disk each home uses. Nothing else is stored.
@@ -59,8 +61,9 @@ All Go lives in `slackerbot/` (module `slackerbot`). Packages under `internal/`
```mermaid
flowchart TD
main[main] --> bot & manager & local & state & config
bot --> manager & acp & commands & balance
main[main] --> bot & manager & local & state & config & tools
bot --> manager & acp & commands & balance & tools
tools --> acp
manager --> balance & state & config & storage
local --> config & storage
acp --> node
@@ -94,6 +97,7 @@ flowchart TD
| `local` | The `Node` on this machine: nspawn via `systemd-run`, machined and systemd over D-Bus, capacity detection, btrfs send/receive |
| `balance` | Builds a view of each node and picks where a container goes |
| `manager` | `Manager` (owners, placement, start/stop/resize/storage), the cluster link (`Remote`, `ServeCluster`, `RunSlave`) and migration. These three share a package because they're tightly coupled |
| `tools` | The in-container MCP server (`send_file`), how goose starts it, and spotting its calls in ACP updates |
| `acp` | JSON-RPC client for goose's ACP endpoint. Tool permission requests are auto-approved |
| `bot` | Slack events and buttons, replies, permission checks, `grant`/`revoke`, move announcements, idle reaper, streaming replies, thread listen modes, stop reactions, the assistant pane |
| `util` | `KeyedMutex`, `RandomHex` |
+7
View File
@@ -0,0 +1,7 @@
load("@gazelle//:def.bzl", "gazelle")
exports_files(["config.example.toml"])
# gazelle:exclude nix
# gazelle:exclude plan
gazelle(name = "gazelle")
+21 -20
View File
@@ -27,24 +27,25 @@ nix build git+https://gitea.skyg.ca/ari/slacker-bot.git#agent -o /var/lib/slacke
nix build .#agent -o /var/lib/slackerbot/agent-system
```
Rebuild the same way after changing `nix/container.nix`. Each container picks up the new build on its next start. `nix/container.nix` runs `goose serve`, which needs a recent goose. If nixpkgs' `goose-cli` is too old, override it there.
Rebuild the same way after changing `nix/container.nix`, and after upgrading the bot: the container includes `slackerbot-tools` (the agent's `send_file` tool) from the same checkout. Each container picks up the new build on its next start. `nix/container.nix` runs `goose serve`, which needs a recent goose. If nixpkgs' `goose-cli` is too old, override it there.
## 3. Config
Copy `config.example.toml` and edit it. The important parts:
| Setting | What |
|---|---|
| `system` | The build from step 2, e.g. `/var/lib/slackerbot/agent-system` |
| `state_dir` | Where `state.json`, env files and cluster certificates live |
| `[agent_env]` | Environment for goose (provider, model, API key). `$VARS` are expanded from the bot's environment |
| `[container]`, `[max_container]` | Default and largest container size |
| `[host_reserve]` | RAM/CPU kept free for the host |
| `idle_timeout`, `max_idle_timeout`, `allow_indefinite` | Idle shutdown rules |
| `[storage]` | Default guaranteed (`min`) and cap (`max`) home size, and the largest cap anyone may set (`limit`) |
| `[[drives]]` | btrfs folders for home folders, each with a `reserve` kept free |
| `[permissions]` | Starting permissions, copied in on first start only (see USERGUIDE.md) |
| `[cluster]` | Only for more than one node (see step 6) |
| Setting | What |
| ------------------------------------------------------ | -------------------------------------------------------------------------------------------------- |
| `system` | The build from step 2, e.g. `/var/lib/slackerbot/agent-system` |
| `state_dir` | Where `state.json`, env files and cluster certificates live |
| `[agent_env]` | Environment for goose (provider, model, API key). `$VARS` are expanded from the bot's environment |
| `[container]`, `[max_container]` | Default and largest container size |
| `[host_reserve]` | RAM/CPU kept free for the host |
| `idle_timeout`, `max_idle_timeout`, `allow_indefinite` | Idle shutdown rules |
| `max_send_file_mb` | Largest file the agent may send, and the largest attachment copied in (default 100, at most 1024) |
| `[storage]` | Default guaranteed (`min`) and cap (`max`) home size, and the largest cap anyone may set (`limit`) |
| `[[drives]]` | btrfs folders for home folders, each with a `reserve` kept free |
| `[permissions]` | Starting permissions, copied in on first start only (see USERGUIDE.md) |
| `[cluster]` | Only for more than one node (see step 6) |
## 4. Secrets
@@ -65,14 +66,14 @@ CLUSTER_SECRET=…
One `NAME=value` per line, with no quotes needed and no comments after a value (systemd would read the comment as part of the value). `CLUSTER_SECRET` is only needed with more than one node.
| Variable | Overrides | Needed on |
|---|---|---|
| `SLACK_APP_TOKEN` | `[slack] app_token` | master |
| `SLACK_BOT_TOKEN` | `[slack] bot_token` | master |
| `CLUSTER_SECRET` | `[cluster] secret` | every node, if clustered |
| anything named in `[agent_env]` (e.g. `$ANTHROPIC_API_KEY`) | expanded into the container's env | master |
| Variable | Overrides | Needed on |
| ----------------------------------------------------------- | --------------------------------- | ------------------------ |
| `SLACK_APP_TOKEN` | `[slack] app_token` | master |
| `SLACK_BOT_TOKEN` | `[slack] bot_token` | master |
| `CLUSTER_SECRET` | `[cluster] secret` | every node, if clustered |
| anything named in `[agent_env]` (e.g. `$ANTHROPIC_API_KEY`) | expanded into the container's env | master |
The master refuses to start without both Slack tokens. You *can* write them into `[slack]` in the config instead, but then the config holds secrets. With NixOS, the config file is copied into the world-readable Nix store, so use the env file there.
The master refuses to start without both Slack tokens. You _can_ write them into `[slack]` in the config instead, but then the config holds secrets. With NixOS, the config file is copied into the world-readable Nix store, so use the env file there.
The bot writes the `[agent_env]` values, with `$VARS` expanded, to a root-only file under `state_dir/env/`, and bind-mounts it read-only into the container at `/var/lib/slackerbot/agent.env`, where goose reads it at start. To give goose another key, add it to the secrets file and reference it in `[agent_env]`:
+18
View File
@@ -0,0 +1,18 @@
module(name = "slackspawn")
bazel_dep(name = "rules_go", version = "0.65.0")
bazel_dep(name = "gazelle", version = "0.54.0")
bazel_dep(name = "rules_pkg", version = "1.3.0")
go_sdk = use_extension("@rules_go//go:extensions.bzl", "go_sdk")
go_sdk.from_file(go_mod = "//slackerbot:go.mod")
go_deps = use_extension("@gazelle//:extensions.bzl", "go_deps")
go_deps.from_file(go_mod = "//slackerbot:go.mod")
use_repo(
go_deps,
"com_github_burntsushi_toml",
"com_github_coder_websocket",
"com_github_godbus_dbus_v5",
"com_github_slack_go_slack",
)
+842
View File
@@ -0,0 +1,842 @@
{
"lockFileVersion": 24,
"registryFileHashes": {
"https://bcr.bazel.build/bazel_registry.json": "8a28e4aff06ee60aed2a8c281907fb8bcbf3b753c91fb5a5c57da3215d5b3497",
"https://bcr.bazel.build/modules/abseil-cpp/20210324.2/MODULE.bazel": "7cd0312e064fde87c8d1cd79ba06c876bd23630c83466e9500321be55c96ace2",
"https://bcr.bazel.build/modules/abseil-cpp/20211102.0/MODULE.bazel": "70390338f7a5106231d20620712f7cccb659cd0e9d073d1991c038eb9fc57589",
"https://bcr.bazel.build/modules/abseil-cpp/20230125.1/MODULE.bazel": "89047429cb0207707b2dface14ba7f8df85273d484c2572755be4bab7ce9c3a0",
"https://bcr.bazel.build/modules/abseil-cpp/20230802.0.bcr.1/MODULE.bazel": "1c8cec495288dccd14fdae6e3f95f772c1c91857047a098fad772034264cc8cb",
"https://bcr.bazel.build/modules/abseil-cpp/20230802.0/MODULE.bazel": "d253ae36a8bd9ee3c5955384096ccb6baf16a1b1e93e858370da0a3b94f77c16",
"https://bcr.bazel.build/modules/abseil-cpp/20230802.1/MODULE.bazel": "fa92e2eb41a04df73cdabeec37107316f7e5272650f81d6cc096418fe647b915",
"https://bcr.bazel.build/modules/abseil-cpp/20240116.1/MODULE.bazel": "37bcdb4440fbb61df6a1c296ae01b327f19e9bb521f9b8e26ec854b6f97309ed",
"https://bcr.bazel.build/modules/abseil-cpp/20240116.1/source.json": "9be551b8d4e3ef76875c0d744b5d6a504a27e3ae67bc6b28f46415fd2d2957da",
"https://bcr.bazel.build/modules/bazel_features/1.1.0/MODULE.bazel": "cfd42ff3b815a5f39554d97182657f8c4b9719568eb7fded2b9135f084bf760b",
"https://bcr.bazel.build/modules/bazel_features/1.1.1/MODULE.bazel": "27b8c79ef57efe08efccbd9dd6ef70d61b4798320b8d3c134fd571f78963dbcd",
"https://bcr.bazel.build/modules/bazel_features/1.11.0/MODULE.bazel": "f9382337dd5a474c3b7d334c2f83e50b6eaedc284253334cf823044a26de03e8",
"https://bcr.bazel.build/modules/bazel_features/1.15.0/MODULE.bazel": "d38ff6e517149dc509406aca0db3ad1efdd890a85e049585b7234d04238e2a4d",
"https://bcr.bazel.build/modules/bazel_features/1.17.0/MODULE.bazel": "039de32d21b816b47bd42c778e0454217e9c9caac4a3cf8e15c7231ee3ddee4d",
"https://bcr.bazel.build/modules/bazel_features/1.18.0/MODULE.bazel": "1be0ae2557ab3a72a57aeb31b29be347bcdc5d2b1eb1e70f39e3851a7e97041a",
"https://bcr.bazel.build/modules/bazel_features/1.19.0/MODULE.bazel": "59adcdf28230d220f0067b1f435b8537dd033bfff8db21335ef9217919c7fb58",
"https://bcr.bazel.build/modules/bazel_features/1.21.0/MODULE.bazel": "675642261665d8eea09989aa3b8afb5c37627f1be178382c320d1b46afba5e3b",
"https://bcr.bazel.build/modules/bazel_features/1.28.0/MODULE.bazel": "4b4200e6cbf8fa335b2c3f43e1d6ef3e240319c33d43d60cc0fbd4b87ece299d",
"https://bcr.bazel.build/modules/bazel_features/1.30.0/MODULE.bazel": "a14b62d05969a293b80257e72e597c2da7f717e1e69fa8b339703ed6731bec87",
"https://bcr.bazel.build/modules/bazel_features/1.36.0/MODULE.bazel": "596cb62090b039caf1cad1d52a8bc35cf188ca9a4e279a828005e7ee49a1bec3",
"https://bcr.bazel.build/modules/bazel_features/1.36.0/source.json": "279625cafa5b63cc0a8ee8448d93bc5ac1431f6000c50414051173fd22a6df3c",
"https://bcr.bazel.build/modules/bazel_features/1.4.1/MODULE.bazel": "e45b6bb2350aff3e442ae1111c555e27eac1d915e77775f6fdc4b351b758b5d7",
"https://bcr.bazel.build/modules/bazel_features/1.9.1/MODULE.bazel": "8f679097876a9b609ad1f60249c49d68bfab783dd9be012faf9d82547b14815a",
"https://bcr.bazel.build/modules/bazel_skylib/1.0.3/MODULE.bazel": "bcb0fd896384802d1ad283b4e4eb4d718eebd8cb820b0a2c3a347fb971afd9d8",
"https://bcr.bazel.build/modules/bazel_skylib/1.1.1/MODULE.bazel": "1add3e7d93ff2e6998f9e118022c84d163917d912f5afafb3058e3d2f1545b5e",
"https://bcr.bazel.build/modules/bazel_skylib/1.2.0/MODULE.bazel": "44fe84260e454ed94ad326352a698422dbe372b21a1ac9f3eab76eb531223686",
"https://bcr.bazel.build/modules/bazel_skylib/1.2.1/MODULE.bazel": "f35baf9da0efe45fa3da1696ae906eea3d615ad41e2e3def4aeb4e8bc0ef9a7a",
"https://bcr.bazel.build/modules/bazel_skylib/1.3.0/MODULE.bazel": "20228b92868bf5cfc41bda7afc8a8ba2a543201851de39d990ec957b513579c5",
"https://bcr.bazel.build/modules/bazel_skylib/1.4.1/MODULE.bazel": "a0dcb779424be33100dcae821e9e27e4f2901d9dfd5333efe5ac6a8d7ab75e1d",
"https://bcr.bazel.build/modules/bazel_skylib/1.4.2/MODULE.bazel": "3bd40978e7a1fac911d5989e6b09d8f64921865a45822d8b09e815eaa726a651",
"https://bcr.bazel.build/modules/bazel_skylib/1.5.0/MODULE.bazel": "32880f5e2945ce6a03d1fbd588e9198c0a959bb42297b2cfaf1685b7bc32e138",
"https://bcr.bazel.build/modules/bazel_skylib/1.6.1/MODULE.bazel": "8fdee2dbaace6c252131c00e1de4b165dc65af02ea278476187765e1a617b917",
"https://bcr.bazel.build/modules/bazel_skylib/1.7.0/MODULE.bazel": "0db596f4563de7938de764cc8deeabec291f55e8ec15299718b93c4423e9796d",
"https://bcr.bazel.build/modules/bazel_skylib/1.7.1/MODULE.bazel": "3120d80c5861aa616222ec015332e5f8d3171e062e3e804a2a0253e1be26e59b",
"https://bcr.bazel.build/modules/bazel_skylib/1.8.1/MODULE.bazel": "88ade7293becda963e0e3ea33e7d54d3425127e0a326e0d17da085a5f1f03ff6",
"https://bcr.bazel.build/modules/bazel_skylib/1.8.2/MODULE.bazel": "69ad6927098316848b34a9142bcc975e018ba27f08c4ff403f50c1b6e646ca67",
"https://bcr.bazel.build/modules/bazel_skylib/1.9.0/MODULE.bazel": "72997b29dfd95c3fa0d0c48322d05590418edef451f8db8db5509c57875fb4b7",
"https://bcr.bazel.build/modules/bazel_skylib/1.9.0/source.json": "7ad77c1e8c1b84222d9b3f3cae016a76639435744c19330b0b37c0a3c9da7dc0",
"https://bcr.bazel.build/modules/buildozer/7.1.2/MODULE.bazel": "2e8dd40ede9c454042645fd8d8d0cd1527966aa5c919de86661e62953cd73d84",
"https://bcr.bazel.build/modules/buildozer/7.1.2/source.json": "c9028a501d2db85793a6996205c8de120944f50a0d570438fcae0457a5f9d1f8",
"https://bcr.bazel.build/modules/gazelle/0.32.0/MODULE.bazel": "b499f58a5d0d3537f3cf5b76d8ada18242f64ec474d8391247438bf04f58c7b8",
"https://bcr.bazel.build/modules/gazelle/0.33.0/MODULE.bazel": "a13a0f279b462b784fb8dd52a4074526c4a2afe70e114c7d09066097a46b3350",
"https://bcr.bazel.build/modules/gazelle/0.34.0/MODULE.bazel": "abdd8ce4d70978933209db92e436deb3a8b737859e9354fb5fd11fb5c2004c8a",
"https://bcr.bazel.build/modules/gazelle/0.36.0/MODULE.bazel": "e375d5d6e9a6ca59b0cb38b0540bc9a05b6aa926d322f2de268ad267a2ee74c0",
"https://bcr.bazel.build/modules/gazelle/0.51.3/MODULE.bazel": "618a729142f66de1e2cb776d026413763be5b80d5e3d29ffb9d3d90c5defde90",
"https://bcr.bazel.build/modules/gazelle/0.54.0/MODULE.bazel": "10620287bdf57c55c2321ed5a387ade11c7187aba444fdec583c9f21c3263f45",
"https://bcr.bazel.build/modules/gazelle/0.54.0/source.json": "6c9639ac87508c7edea37bd9d5380581c96defde056ca26518d201a8816805e4",
"https://bcr.bazel.build/modules/google_benchmark/1.8.2/MODULE.bazel": "a70cf1bba851000ba93b58ae2f6d76490a9feb74192e57ab8e8ff13c34ec50cb",
"https://bcr.bazel.build/modules/googletest/1.11.0/MODULE.bazel": "3a83f095183f66345ca86aa13c58b59f9f94a2f81999c093d4eeaa2d262d12f4",
"https://bcr.bazel.build/modules/googletest/1.14.0.bcr.1/MODULE.bazel": "22c31a561553727960057361aa33bf20fb2e98584bc4fec007906e27053f80c6",
"https://bcr.bazel.build/modules/googletest/1.14.0.bcr.1/source.json": "41e9e129f80d8c8bf103a7acc337b76e54fad1214ac0a7084bf24f4cd924b8b4",
"https://bcr.bazel.build/modules/googletest/1.14.0/MODULE.bazel": "cfbcbf3e6eac06ef9d85900f64424708cc08687d1b527f0ef65aa7517af8118f",
"https://bcr.bazel.build/modules/jsoncpp/1.9.5/MODULE.bazel": "31271aedc59e815656f5736f282bb7509a97c7ecb43e927ac1a37966e0578075",
"https://bcr.bazel.build/modules/jsoncpp/1.9.5/source.json": "4108ee5085dd2885a341c7fab149429db457b3169b86eb081fa245eadf69169d",
"https://bcr.bazel.build/modules/libpfm/4.11.0/MODULE.bazel": "45061ff025b301940f1e30d2c16bea596c25b176c8b6b3087e92615adbd52902",
"https://bcr.bazel.build/modules/package_metadata/0.0.3/MODULE.bazel": "77890552ecea9e284b5424c9de827a58099348763a4359e975c359a83d4faa83",
"https://bcr.bazel.build/modules/package_metadata/0.0.5/MODULE.bazel": "ef4f9439e3270fdd6b9fd4dbc3d2f29d13888e44c529a1b243f7a31dfbc2e8e4",
"https://bcr.bazel.build/modules/package_metadata/0.0.5/source.json": "2326db2f6592578177751c3e1f74786b79382cd6008834c9d01ec865b9126a85",
"https://bcr.bazel.build/modules/platforms/0.0.10/MODULE.bazel": "8cb8efaf200bdeb2150d93e162c40f388529a25852b332cec879373771e48ed5",
"https://bcr.bazel.build/modules/platforms/0.0.11/MODULE.bazel": "0daefc49732e227caa8bfa834d65dc52e8cc18a2faf80df25e8caea151a9413f",
"https://bcr.bazel.build/modules/platforms/0.0.4/MODULE.bazel": "9b328e31ee156f53f3c416a64f8491f7eb731742655a47c9eec4703a71644aee",
"https://bcr.bazel.build/modules/platforms/0.0.5/MODULE.bazel": "5733b54ea419d5eaf7997054bb55f6a1d0b5ff8aedf0176fef9eea44f3acda37",
"https://bcr.bazel.build/modules/platforms/0.0.6/MODULE.bazel": "ad6eeef431dc52aefd2d77ed20a4b353f8ebf0f4ecdd26a807d2da5aa8cd0615",
"https://bcr.bazel.build/modules/platforms/0.0.7/MODULE.bazel": "72fd4a0ede9ee5c021f6a8dd92b503e089f46c227ba2813ff183b71616034814",
"https://bcr.bazel.build/modules/platforms/0.0.8/MODULE.bazel": "9f142c03e348f6d263719f5074b21ef3adf0b139ee4c5133e2aa35664da9eb2d",
"https://bcr.bazel.build/modules/platforms/1.0.0/MODULE.bazel": "f05feb42b48f1b3c225e4ccf351f367be0371411a803198ec34a389fb22aa580",
"https://bcr.bazel.build/modules/platforms/1.1.0/MODULE.bazel": "1c0c09f5bdcf4b3f924720d2478a3711cb39f4977019ca5988685e5b7e18b3d2",
"https://bcr.bazel.build/modules/platforms/1.1.0/source.json": "fcf351c47596c939140ab0d333dfdd08ed1ea6ce33c2fe70c12493a301cf1344",
"https://bcr.bazel.build/modules/protobuf/21.7/MODULE.bazel": "a5a29bb89544f9b97edce05642fac225a808b5b7be74038ea3640fae2f8e66a7",
"https://bcr.bazel.build/modules/protobuf/27.0/MODULE.bazel": "7873b60be88844a0a1d8f80b9d5d20cfbd8495a689b8763e76c6372998d3f64c",
"https://bcr.bazel.build/modules/protobuf/27.1/MODULE.bazel": "703a7b614728bb06647f965264967a8ef1c39e09e8f167b3ca0bb1fd80449c0d",
"https://bcr.bazel.build/modules/protobuf/29.0-rc2.bcr.1/MODULE.bazel": "52f4126f63a2f0bbf36b99c2a87648f08467a4eaf92ba726bc7d6a500bbf770c",
"https://bcr.bazel.build/modules/protobuf/29.0-rc2/MODULE.bazel": "6241d35983510143049943fc0d57937937122baf1b287862f9dc8590fc4c37df",
"https://bcr.bazel.build/modules/protobuf/29.0-rc3/MODULE.bazel": "33c2dfa286578573afc55a7acaea3cada4122b9631007c594bf0729f41c8de92",
"https://bcr.bazel.build/modules/protobuf/29.0/MODULE.bazel": "319dc8bf4c679ff87e71b1ccfb5a6e90a6dbc4693501d471f48662ac46d04e4e",
"https://bcr.bazel.build/modules/protobuf/29.0/source.json": "b857f93c796750eef95f0d61ee378f3420d00ee1dd38627b27193aa482f4f981",
"https://bcr.bazel.build/modules/protobuf/3.19.0/MODULE.bazel": "6b5fbb433f760a99a22b18b6850ed5784ef0e9928a72668b66e4d7ccd47db9b0",
"https://bcr.bazel.build/modules/protobuf/3.19.2/MODULE.bazel": "532ffe5f2186b69fdde039efe6df13ba726ff338c6bc82275ad433013fa10573",
"https://bcr.bazel.build/modules/protobuf/3.19.6/MODULE.bazel": "9233edc5e1f2ee276a60de3eaa47ac4132302ef9643238f23128fea53ea12858",
"https://bcr.bazel.build/modules/pybind11_bazel/2.11.1/MODULE.bazel": "88af1c246226d87e65be78ed49ecd1e6f5e98648558c14ce99176da041dc378e",
"https://bcr.bazel.build/modules/pybind11_bazel/2.11.1/source.json": "be4789e951dd5301282729fe3d4938995dc4c1a81c2ff150afc9f1b0504c6022",
"https://bcr.bazel.build/modules/re2/2023-09-01/MODULE.bazel": "cb3d511531b16cfc78a225a9e2136007a48cf8a677e4264baeab57fe78a80206",
"https://bcr.bazel.build/modules/re2/2023-09-01/source.json": "e044ce89c2883cd957a2969a43e79f7752f9656f6b20050b62f90ede21ec6eb4",
"https://bcr.bazel.build/modules/rules_android/0.1.1/MODULE.bazel": "48809ab0091b07ad0182defb787c4c5328bd3a278938415c00a7b69b50c4d3a8",
"https://bcr.bazel.build/modules/rules_android/0.1.1/source.json": "e6986b41626ee10bdc864937ffb6d6bf275bb5b9c65120e6137d56e6331f089e",
"https://bcr.bazel.build/modules/rules_cc/0.0.1/MODULE.bazel": "cb2aa0747f84c6c3a78dad4e2049c154f08ab9d166b1273835a8174940365647",
"https://bcr.bazel.build/modules/rules_cc/0.0.10/MODULE.bazel": "ec1705118f7eaedd6e118508d3d26deba2a4e76476ada7e0e3965211be012002",
"https://bcr.bazel.build/modules/rules_cc/0.0.13/MODULE.bazel": "0e8529ed7b323dad0775ff924d2ae5af7640b23553dfcd4d34344c7e7a867191",
"https://bcr.bazel.build/modules/rules_cc/0.0.14/MODULE.bazel": "5e343a3aac88b8d7af3b1b6d2093b55c347b8eefc2e7d1442f7a02dc8fea48ac",
"https://bcr.bazel.build/modules/rules_cc/0.0.15/MODULE.bazel": "6704c35f7b4a72502ee81f61bf88706b54f06b3cbe5558ac17e2e14666cd5dcc",
"https://bcr.bazel.build/modules/rules_cc/0.0.16/MODULE.bazel": "7661303b8fc1b4d7f532e54e9d6565771fea666fbdf839e0a86affcd02defe87",
"https://bcr.bazel.build/modules/rules_cc/0.0.17/MODULE.bazel": "2ae1d8f4238ec67d7185d8861cb0a2cdf4bc608697c331b95bf990e69b62e64a",
"https://bcr.bazel.build/modules/rules_cc/0.0.2/MODULE.bazel": "6915987c90970493ab97393024c156ea8fb9f3bea953b2f3ec05c34f19b5695c",
"https://bcr.bazel.build/modules/rules_cc/0.0.6/MODULE.bazel": "abf360251023dfe3efcef65ab9d56beefa8394d4176dd29529750e1c57eaa33f",
"https://bcr.bazel.build/modules/rules_cc/0.0.8/MODULE.bazel": "964c85c82cfeb6f3855e6a07054fdb159aced38e99a5eecf7bce9d53990afa3e",
"https://bcr.bazel.build/modules/rules_cc/0.0.9/MODULE.bazel": "836e76439f354b89afe6a911a7adf59a6b2518fafb174483ad78a2a2fde7b1c5",
"https://bcr.bazel.build/modules/rules_cc/0.1.1/MODULE.bazel": "2f0222a6f229f0bf44cd711dc13c858dad98c62d52bd51d8fc3a764a83125513",
"https://bcr.bazel.build/modules/rules_cc/0.1.5/MODULE.bazel": "88dfc9361e8b5ae1008ac38f7cdfd45ad738e4fa676a3ad67d19204f045a1fd8",
"https://bcr.bazel.build/modules/rules_cc/0.1.5/source.json": "4bb4fed7f5499775d495739f785a5494a1f854645fa1bac5de131264f5acdf01",
"https://bcr.bazel.build/modules/rules_foreign_cc/0.9.0/MODULE.bazel": "c9e8c682bf75b0e7c704166d79b599f93b72cfca5ad7477df596947891feeef6",
"https://bcr.bazel.build/modules/rules_fuzzing/0.5.2/MODULE.bazel": "40c97d1144356f52905566c55811f13b299453a14ac7769dfba2ac38192337a8",
"https://bcr.bazel.build/modules/rules_fuzzing/0.5.2/source.json": "c8b1e2c717646f1702290959a3302a178fb639d987ab61d548105019f11e527e",
"https://bcr.bazel.build/modules/rules_go/0.41.0/MODULE.bazel": "55861d8e8bb0e62cbd2896f60ff303f62ffcb0eddb74ecb0e5c0cbe36fc292c8",
"https://bcr.bazel.build/modules/rules_go/0.42.0/MODULE.bazel": "8cfa875b9aa8c6fce2b2e5925e73c1388173ea3c32a0db4d2b4804b453c14270",
"https://bcr.bazel.build/modules/rules_go/0.46.0/MODULE.bazel": "3477df8bdcc49e698b9d25f734c4f3a9f5931ff34ee48a2c662be168f5f2d3fd",
"https://bcr.bazel.build/modules/rules_go/0.59.0/MODULE.bazel": "b7e43e7414a3139a7547d1b4909b29085fbe5182b6c58cbe1ed4c6272815aeae",
"https://bcr.bazel.build/modules/rules_go/0.65.0/MODULE.bazel": "9aedb8cc7186d99881b438b545334e6c8ea38619a43b79b4240d1181d5e88abe",
"https://bcr.bazel.build/modules/rules_go/0.65.0/source.json": "36eb4ae1387d5f910968c277de3f8d91627c7b3a321f3b3de166ea7014fd00f3",
"https://bcr.bazel.build/modules/rules_java/4.0.0/MODULE.bazel": "5a78a7ae82cd1a33cef56dc578c7d2a46ed0dca12643ee45edbb8417899e6f74",
"https://bcr.bazel.build/modules/rules_java/5.3.5/MODULE.bazel": "a4ec4f2db570171e3e5eb753276ee4b389bae16b96207e9d3230895c99644b86",
"https://bcr.bazel.build/modules/rules_java/6.0.0/MODULE.bazel": "8a43b7df601a7ec1af61d79345c17b31ea1fedc6711fd4abfd013ea612978e39",
"https://bcr.bazel.build/modules/rules_java/6.4.0/MODULE.bazel": "e986a9fe25aeaa84ac17ca093ef13a4637f6107375f64667a15999f77db6c8f6",
"https://bcr.bazel.build/modules/rules_java/6.5.2/MODULE.bazel": "1d440d262d0e08453fa0c4d8f699ba81609ed0e9a9a0f02cd10b3e7942e61e31",
"https://bcr.bazel.build/modules/rules_java/7.10.0/MODULE.bazel": "530c3beb3067e870561739f1144329a21c851ff771cd752a49e06e3dc9c2e71a",
"https://bcr.bazel.build/modules/rules_java/7.12.2/MODULE.bazel": "579c505165ee757a4280ef83cda0150eea193eed3bef50b1004ba88b99da6de6",
"https://bcr.bazel.build/modules/rules_java/7.2.0/MODULE.bazel": "06c0334c9be61e6cef2c8c84a7800cef502063269a5af25ceb100b192453d4ab",
"https://bcr.bazel.build/modules/rules_java/7.3.2/MODULE.bazel": "50dece891cfdf1741ea230d001aa9c14398062f2b7c066470accace78e412bc2",
"https://bcr.bazel.build/modules/rules_java/7.6.1/MODULE.bazel": "2f14b7e8a1aa2f67ae92bc69d1ec0fa8d9f827c4e17ff5e5f02e91caa3b2d0fe",
"https://bcr.bazel.build/modules/rules_java/8.14.0/MODULE.bazel": "717717ed40cc69994596a45aec6ea78135ea434b8402fb91b009b9151dd65615",
"https://bcr.bazel.build/modules/rules_java/8.14.0/source.json": "8a88c4ca9e8759da53cddc88123880565c520503321e2566b4e33d0287a3d4bc",
"https://bcr.bazel.build/modules/rules_java/8.3.2/MODULE.bazel": "7336d5511ad5af0b8615fdc7477535a2e4e723a357b6713af439fe8cf0195017",
"https://bcr.bazel.build/modules/rules_java/8.5.1/MODULE.bazel": "d8a9e38cc5228881f7055a6079f6f7821a073df3744d441978e7a43e20226939",
"https://bcr.bazel.build/modules/rules_jvm_external/4.4.2/MODULE.bazel": "a56b85e418c83eb1839819f0b515c431010160383306d13ec21959ac412d2fe7",
"https://bcr.bazel.build/modules/rules_jvm_external/5.1/MODULE.bazel": "33f6f999e03183f7d088c9be518a63467dfd0be94a11d0055fe2d210f89aa909",
"https://bcr.bazel.build/modules/rules_jvm_external/5.2/MODULE.bazel": "d9351ba35217ad0de03816ef3ed63f89d411349353077348a45348b096615036",
"https://bcr.bazel.build/modules/rules_jvm_external/5.3/MODULE.bazel": "bf93870767689637164657731849fb887ad086739bd5d360d90007a581d5527d",
"https://bcr.bazel.build/modules/rules_jvm_external/6.1/MODULE.bazel": "75b5fec090dbd46cf9b7d8ea08cf84a0472d92ba3585b476f44c326eda8059c4",
"https://bcr.bazel.build/modules/rules_jvm_external/6.3/MODULE.bazel": "c998e060b85f71e00de5ec552019347c8bca255062c990ac02d051bb80a38df0",
"https://bcr.bazel.build/modules/rules_jvm_external/6.3/source.json": "6f5f5a5a4419ae4e37c35a5bb0a6ae657ed40b7abc5a5189111b47fcebe43197",
"https://bcr.bazel.build/modules/rules_kotlin/1.9.0/MODULE.bazel": "ef85697305025e5a61f395d4eaede272a5393cee479ace6686dba707de804d59",
"https://bcr.bazel.build/modules/rules_kotlin/1.9.6/MODULE.bazel": "d269a01a18ee74d0335450b10f62c9ed81f2321d7958a2934e44272fe82dcef3",
"https://bcr.bazel.build/modules/rules_kotlin/1.9.6/source.json": "2faa4794364282db7c06600b7e5e34867a564ae91bda7cae7c29c64e9466b7d5",
"https://bcr.bazel.build/modules/rules_license/0.0.3/MODULE.bazel": "627e9ab0247f7d1e05736b59dbb1b6871373de5ad31c3011880b4133cafd4bd0",
"https://bcr.bazel.build/modules/rules_license/0.0.7/MODULE.bazel": "088fbeb0b6a419005b89cf93fe62d9517c0a2b8bb56af3244af65ecfe37e7d5d",
"https://bcr.bazel.build/modules/rules_license/1.0.0/MODULE.bazel": "a7fda60eefdf3d8c827262ba499957e4df06f659330bbe6cdbdb975b768bb65c",
"https://bcr.bazel.build/modules/rules_license/1.0.0/source.json": "a52c89e54cc311196e478f8382df91c15f7a2bfdf4c6cd0e2675cc2ff0b56efb",
"https://bcr.bazel.build/modules/rules_pkg/0.7.0/MODULE.bazel": "df99f03fc7934a4737122518bb87e667e62d780b610910f0447665a7e2be62dc",
"https://bcr.bazel.build/modules/rules_pkg/1.0.1/MODULE.bazel": "5b1df97dbc29623bccdf2b0dcd0f5cb08e2f2c9050aab1092fd39a41e82686ff",
"https://bcr.bazel.build/modules/rules_pkg/1.3.0/MODULE.bazel": "ae0bdefbacc990c91f843206c90cf0f4be620639a5bf22119043599ba86d51a3",
"https://bcr.bazel.build/modules/rules_pkg/1.3.0/source.json": "58ae84c545141762f7c434c0ce78bfb55ef0be08d84863e7f0503fff135fe4e2",
"https://bcr.bazel.build/modules/rules_proto/4.0.0/MODULE.bazel": "a7a7b6ce9bee418c1a760b3d84f83a299ad6952f9903c67f19e4edd964894e06",
"https://bcr.bazel.build/modules/rules_proto/5.3.0-21.7/MODULE.bazel": "e8dff86b0971688790ae75528fe1813f71809b5afd57facb44dad9e8eca631b7",
"https://bcr.bazel.build/modules/rules_proto/6.0.2/MODULE.bazel": "ce916b775a62b90b61888052a416ccdda405212b6aaeb39522f7dc53431a5e73",
"https://bcr.bazel.build/modules/rules_proto/7.0.2/MODULE.bazel": "bf81793bd6d2ad89a37a40693e56c61b0ee30f7a7fdbaf3eabbf5f39de47dea2",
"https://bcr.bazel.build/modules/rules_proto/7.0.2/source.json": "1e5e7260ae32ef4f2b52fd1d0de8d03b606a44c91b694d2f1afb1d3b28a48ce1",
"https://bcr.bazel.build/modules/rules_python/0.10.2/MODULE.bazel": "cc82bc96f2997baa545ab3ce73f196d040ffb8756fd2d66125a530031cd90e5f",
"https://bcr.bazel.build/modules/rules_python/0.23.1/MODULE.bazel": "49ffccf0511cb8414de28321f5fcf2a31312b47c40cc21577144b7447f2bf300",
"https://bcr.bazel.build/modules/rules_python/0.25.0/MODULE.bazel": "72f1506841c920a1afec76975b35312410eea3aa7b63267436bfb1dd91d2d382",
"https://bcr.bazel.build/modules/rules_python/0.28.0/MODULE.bazel": "cba2573d870babc976664a912539b320cbaa7114cd3e8f053c720171cde331ed",
"https://bcr.bazel.build/modules/rules_python/0.31.0/MODULE.bazel": "93a43dc47ee570e6ec9f5779b2e64c1476a6ce921c48cc9a1678a91dd5f8fd58",
"https://bcr.bazel.build/modules/rules_python/0.4.0/MODULE.bazel": "9208ee05fd48bf09ac60ed269791cf17fb343db56c8226a720fbb1cdf467166c",
"https://bcr.bazel.build/modules/rules_python/0.40.0/MODULE.bazel": "9d1a3cd88ed7d8e39583d9ffe56ae8a244f67783ae89b60caafc9f5cf318ada7",
"https://bcr.bazel.build/modules/rules_python/1.7.0/MODULE.bazel": "d01f995ecd137abf30238ad9ce97f8fc3ac57289c8b24bd0bf53324d937a14f8",
"https://bcr.bazel.build/modules/rules_python/1.7.0/source.json": "028a084b65dcf8f4dc4f82f8778dbe65df133f234b316828a82e060d81bdce32",
"https://bcr.bazel.build/modules/rules_shell/0.2.0/MODULE.bazel": "fda8a652ab3c7d8fee214de05e7a9916d8b28082234e8d2c0094505c5268ed3c",
"https://bcr.bazel.build/modules/rules_shell/0.3.0/MODULE.bazel": "de4402cd12f4cc8fda2354fce179fdb068c0b9ca1ec2d2b17b3e21b24c1a937b",
"https://bcr.bazel.build/modules/rules_shell/0.3.0/source.json": "c55ed591aa5009401ddf80ded9762ac32c358d2517ee7820be981e2de9756cf3",
"https://bcr.bazel.build/modules/stardoc/0.5.1/MODULE.bazel": "1a05d92974d0c122f5ccf09291442580317cdd859f07a8655f1db9a60374f9f8",
"https://bcr.bazel.build/modules/stardoc/0.5.3/MODULE.bazel": "c7f6948dae6999bf0db32c1858ae345f112cacf98f174c7a8bb707e41b974f1c",
"https://bcr.bazel.build/modules/stardoc/0.5.6/MODULE.bazel": "c43dabc564990eeab55e25ed61c07a1aadafe9ece96a4efabb3f8bf9063b71ef",
"https://bcr.bazel.build/modules/stardoc/0.7.0/MODULE.bazel": "05e3d6d30c099b6770e97da986c53bd31844d7f13d41412480ea265ac9e8079c",
"https://bcr.bazel.build/modules/stardoc/0.7.1/MODULE.bazel": "3548faea4ee5dda5580f9af150e79d0f6aea934fc60c1cc50f4efdd9420759e7",
"https://bcr.bazel.build/modules/stardoc/0.7.2/MODULE.bazel": "fc152419aa2ea0f51c29583fab1e8c99ddefd5b3778421845606ee628629e0e5",
"https://bcr.bazel.build/modules/stardoc/0.7.2/source.json": "58b029e5e901d6802967754adf0a9056747e8176f017cfe3607c0851f4d42216",
"https://bcr.bazel.build/modules/upb/0.0.0-20220923-a547704/MODULE.bazel": "7298990c00040a0e2f121f6c32544bab27d4452f80d9ce51349b1a28f3005c43",
"https://bcr.bazel.build/modules/zlib/1.2.11/MODULE.bazel": "07b389abc85fdbca459b69e2ec656ae5622873af3f845e1c9d80fe179f3effa0",
"https://bcr.bazel.build/modules/zlib/1.2.12/MODULE.bazel": "3b1a8834ada2a883674be8cbd36ede1b6ec481477ada359cd2d3ddc562340b27",
"https://bcr.bazel.build/modules/zlib/1.3.1.bcr.5/MODULE.bazel": "eec517b5bbe5492629466e11dae908d043364302283de25581e3eb944326c4ca",
"https://bcr.bazel.build/modules/zlib/1.3.1.bcr.5/source.json": "22bc55c47af97246cfc093d0acf683a7869377de362b5d1c552c2c2e16b7a806",
"https://bcr.bazel.build/modules/zlib/1.3.1/MODULE.bazel": "751c9940dcfe869f5f7274e1295422a34623555916eb98c174c1e945594bf198"
},
"selectedYankedVersions": {},
"moduleExtensions": {
"@@rules_kotlin+//src/main/starlark/core/repositories:bzlmod_setup.bzl%rules_kotlin_extensions": {
"general": {
"bzlTransitiveDigest": "03Qju4tW0vE+0RBuZGuV2A4Hx6AiSkdNahYvworx2aM=",
"usagesDigest": "QI2z8ZUR+mqtbwsf2fLqYdJAkPOHdOV+tF2yVAUgRzw=",
"recordedFileInputs": {},
"recordedDirentsInputs": {},
"envVariables": {},
"generatedRepoSpecs": {
"com_github_jetbrains_kotlin_git": {
"repoRuleId": "@@rules_kotlin+//src/main/starlark/core/repositories:compiler.bzl%kotlin_compiler_git_repository",
"attributes": {
"urls": [
"https://github.com/JetBrains/kotlin/releases/download/v1.9.23/kotlin-compiler-1.9.23.zip"
],
"sha256": "93137d3aab9afa9b27cb06a824c2324195c6b6f6179d8a8653f440f5bd58be88"
}
},
"com_github_jetbrains_kotlin": {
"repoRuleId": "@@rules_kotlin+//src/main/starlark/core/repositories:compiler.bzl%kotlin_capabilities_repository",
"attributes": {
"git_repository_name": "com_github_jetbrains_kotlin_git",
"compiler_version": "1.9.23"
}
},
"com_github_google_ksp": {
"repoRuleId": "@@rules_kotlin+//src/main/starlark/core/repositories:ksp.bzl%ksp_compiler_plugin_repository",
"attributes": {
"urls": [
"https://github.com/google/ksp/releases/download/1.9.23-1.0.20/artifacts.zip"
],
"sha256": "ee0618755913ef7fd6511288a232e8fad24838b9af6ea73972a76e81053c8c2d",
"strip_version": "1.9.23-1.0.20"
}
},
"com_github_pinterest_ktlint": {
"repoRuleId": "@@bazel_tools//tools/build_defs/repo:http.bzl%http_file",
"attributes": {
"sha256": "01b2e0ef893383a50dbeb13970fe7fa3be36ca3e83259e01649945b09d736985",
"urls": [
"https://github.com/pinterest/ktlint/releases/download/1.3.0/ktlint"
],
"executable": true
}
},
"rules_android": {
"repoRuleId": "@@bazel_tools//tools/build_defs/repo:http.bzl%http_archive",
"attributes": {
"sha256": "cd06d15dd8bb59926e4d65f9003bfc20f9da4b2519985c27e190cddc8b7a7806",
"strip_prefix": "rules_android-0.1.1",
"urls": [
"https://github.com/bazelbuild/rules_android/archive/v0.1.1.zip"
]
}
}
},
"recordedRepoMappingEntries": [
[
"rules_kotlin+",
"bazel_tools",
"bazel_tools"
]
]
}
},
"@@rules_python+//python/extensions:config.bzl%config": {
"general": {
"bzlTransitiveDigest": "1eE/aNv0So57EZMzcxgDSCFkzlydiaC4TpHowQfrcBk=",
"usagesDigest": "ZVSXMAGpD+xzVNPuvF1IoLBkty7TROO0+akMapt1pAg=",
"recordedFileInputs": {},
"recordedDirentsInputs": {},
"envVariables": {},
"generatedRepoSpecs": {
"rules_python_internal": {
"repoRuleId": "@@rules_python+//python/private:internal_config_repo.bzl%internal_config_repo",
"attributes": {
"transition_setting_generators": {},
"transition_settings": []
}
},
"pypi__build": {
"repoRuleId": "@@bazel_tools//tools/build_defs/repo:http.bzl%http_archive",
"attributes": {
"url": "https://files.pythonhosted.org/packages/e2/03/f3c8ba0a6b6e30d7d18c40faab90807c9bb5e9a1e3b2fe2008af624a9c97/build-1.2.1-py3-none-any.whl",
"sha256": "75e10f767a433d9a86e50d83f418e83efc18ede923ee5ff7df93b6cb0306c5d4",
"type": "zip",
"build_file_content": "package(default_visibility = [\"//visibility:public\"])\n\nload(\"@rules_python//python:py_library.bzl\", \"py_library\")\n\npy_library(\n name = \"lib\",\n srcs = glob([\"**/*.py\"]),\n data = glob([\"**/*\"], exclude=[\n # These entries include those put into user-installed dependencies by\n # data_exclude to avoid non-determinism.\n \"**/*.py\",\n \"**/*.pyc\",\n \"**/*.pyc.*\", # During pyc creation, temp files named *.pyc.NNN are created\n \"**/*.dist-info/RECORD\",\n \"BUILD\",\n \"WORKSPACE\",\n ]),\n # This makes this directory a top-level in the python import\n # search path for anything that depends on this.\n imports = [\".\"],\n)\n"
}
},
"pypi__click": {
"repoRuleId": "@@bazel_tools//tools/build_defs/repo:http.bzl%http_archive",
"attributes": {
"url": "https://files.pythonhosted.org/packages/00/2e/d53fa4befbf2cfa713304affc7ca780ce4fc1fd8710527771b58311a3229/click-8.1.7-py3-none-any.whl",
"sha256": "ae74fb96c20a0277a1d615f1e4d73c8414f5a98db8b799a7931d1582f3390c28",
"type": "zip",
"build_file_content": "package(default_visibility = [\"//visibility:public\"])\n\nload(\"@rules_python//python:py_library.bzl\", \"py_library\")\n\npy_library(\n name = \"lib\",\n srcs = glob([\"**/*.py\"]),\n data = glob([\"**/*\"], exclude=[\n # These entries include those put into user-installed dependencies by\n # data_exclude to avoid non-determinism.\n \"**/*.py\",\n \"**/*.pyc\",\n \"**/*.pyc.*\", # During pyc creation, temp files named *.pyc.NNN are created\n \"**/*.dist-info/RECORD\",\n \"BUILD\",\n \"WORKSPACE\",\n ]),\n # This makes this directory a top-level in the python import\n # search path for anything that depends on this.\n imports = [\".\"],\n)\n"
}
},
"pypi__colorama": {
"repoRuleId": "@@bazel_tools//tools/build_defs/repo:http.bzl%http_archive",
"attributes": {
"url": "https://files.pythonhosted.org/packages/d1/d6/3965ed04c63042e047cb6a3e6ed1a63a35087b6a609aa3a15ed8ac56c221/colorama-0.4.6-py2.py3-none-any.whl",
"sha256": "4f1d9991f5acc0ca119f9d443620b77f9d6b33703e51011c16baf57afb285fc6",
"type": "zip",
"build_file_content": "package(default_visibility = [\"//visibility:public\"])\n\nload(\"@rules_python//python:py_library.bzl\", \"py_library\")\n\npy_library(\n name = \"lib\",\n srcs = glob([\"**/*.py\"]),\n data = glob([\"**/*\"], exclude=[\n # These entries include those put into user-installed dependencies by\n # data_exclude to avoid non-determinism.\n \"**/*.py\",\n \"**/*.pyc\",\n \"**/*.pyc.*\", # During pyc creation, temp files named *.pyc.NNN are created\n \"**/*.dist-info/RECORD\",\n \"BUILD\",\n \"WORKSPACE\",\n ]),\n # This makes this directory a top-level in the python import\n # search path for anything that depends on this.\n imports = [\".\"],\n)\n"
}
},
"pypi__importlib_metadata": {
"repoRuleId": "@@bazel_tools//tools/build_defs/repo:http.bzl%http_archive",
"attributes": {
"url": "https://files.pythonhosted.org/packages/2d/0a/679461c511447ffaf176567d5c496d1de27cbe34a87df6677d7171b2fbd4/importlib_metadata-7.1.0-py3-none-any.whl",
"sha256": "30962b96c0c223483ed6cc7280e7f0199feb01a0e40cfae4d4450fc6fab1f570",
"type": "zip",
"build_file_content": "package(default_visibility = [\"//visibility:public\"])\n\nload(\"@rules_python//python:py_library.bzl\", \"py_library\")\n\npy_library(\n name = \"lib\",\n srcs = glob([\"**/*.py\"]),\n data = glob([\"**/*\"], exclude=[\n # These entries include those put into user-installed dependencies by\n # data_exclude to avoid non-determinism.\n \"**/*.py\",\n \"**/*.pyc\",\n \"**/*.pyc.*\", # During pyc creation, temp files named *.pyc.NNN are created\n \"**/*.dist-info/RECORD\",\n \"BUILD\",\n \"WORKSPACE\",\n ]),\n # This makes this directory a top-level in the python import\n # search path for anything that depends on this.\n imports = [\".\"],\n)\n"
}
},
"pypi__installer": {
"repoRuleId": "@@bazel_tools//tools/build_defs/repo:http.bzl%http_archive",
"attributes": {
"url": "https://files.pythonhosted.org/packages/e5/ca/1172b6638d52f2d6caa2dd262ec4c811ba59eee96d54a7701930726bce18/installer-0.7.0-py3-none-any.whl",
"sha256": "05d1933f0a5ba7d8d6296bb6d5018e7c94fa473ceb10cf198a92ccea19c27b53",
"type": "zip",
"build_file_content": "package(default_visibility = [\"//visibility:public\"])\n\nload(\"@rules_python//python:py_library.bzl\", \"py_library\")\n\npy_library(\n name = \"lib\",\n srcs = glob([\"**/*.py\"]),\n data = glob([\"**/*\"], exclude=[\n # These entries include those put into user-installed dependencies by\n # data_exclude to avoid non-determinism.\n \"**/*.py\",\n \"**/*.pyc\",\n \"**/*.pyc.*\", # During pyc creation, temp files named *.pyc.NNN are created\n \"**/*.dist-info/RECORD\",\n \"BUILD\",\n \"WORKSPACE\",\n ]),\n # This makes this directory a top-level in the python import\n # search path for anything that depends on this.\n imports = [\".\"],\n)\n"
}
},
"pypi__more_itertools": {
"repoRuleId": "@@bazel_tools//tools/build_defs/repo:http.bzl%http_archive",
"attributes": {
"url": "https://files.pythonhosted.org/packages/50/e2/8e10e465ee3987bb7c9ab69efb91d867d93959095f4807db102d07995d94/more_itertools-10.2.0-py3-none-any.whl",
"sha256": "686b06abe565edfab151cb8fd385a05651e1fdf8f0a14191e4439283421f8684",
"type": "zip",
"build_file_content": "package(default_visibility = [\"//visibility:public\"])\n\nload(\"@rules_python//python:py_library.bzl\", \"py_library\")\n\npy_library(\n name = \"lib\",\n srcs = glob([\"**/*.py\"]),\n data = glob([\"**/*\"], exclude=[\n # These entries include those put into user-installed dependencies by\n # data_exclude to avoid non-determinism.\n \"**/*.py\",\n \"**/*.pyc\",\n \"**/*.pyc.*\", # During pyc creation, temp files named *.pyc.NNN are created\n \"**/*.dist-info/RECORD\",\n \"BUILD\",\n \"WORKSPACE\",\n ]),\n # This makes this directory a top-level in the python import\n # search path for anything that depends on this.\n imports = [\".\"],\n)\n"
}
},
"pypi__packaging": {
"repoRuleId": "@@bazel_tools//tools/build_defs/repo:http.bzl%http_archive",
"attributes": {
"url": "https://files.pythonhosted.org/packages/49/df/1fceb2f8900f8639e278b056416d49134fb8d84c5942ffaa01ad34782422/packaging-24.0-py3-none-any.whl",
"sha256": "2ddfb553fdf02fb784c234c7ba6ccc288296ceabec964ad2eae3777778130bc5",
"type": "zip",
"build_file_content": "package(default_visibility = [\"//visibility:public\"])\n\nload(\"@rules_python//python:py_library.bzl\", \"py_library\")\n\npy_library(\n name = \"lib\",\n srcs = glob([\"**/*.py\"]),\n data = glob([\"**/*\"], exclude=[\n # These entries include those put into user-installed dependencies by\n # data_exclude to avoid non-determinism.\n \"**/*.py\",\n \"**/*.pyc\",\n \"**/*.pyc.*\", # During pyc creation, temp files named *.pyc.NNN are created\n \"**/*.dist-info/RECORD\",\n \"BUILD\",\n \"WORKSPACE\",\n ]),\n # This makes this directory a top-level in the python import\n # search path for anything that depends on this.\n imports = [\".\"],\n)\n"
}
},
"pypi__pep517": {
"repoRuleId": "@@bazel_tools//tools/build_defs/repo:http.bzl%http_archive",
"attributes": {
"url": "https://files.pythonhosted.org/packages/25/6e/ca4a5434eb0e502210f591b97537d322546e4833dcb4d470a48c375c5540/pep517-0.13.1-py3-none-any.whl",
"sha256": "31b206f67165b3536dd577c5c3f1518e8fbaf38cbc57efff8369a392feff1721",
"type": "zip",
"build_file_content": "package(default_visibility = [\"//visibility:public\"])\n\nload(\"@rules_python//python:py_library.bzl\", \"py_library\")\n\npy_library(\n name = \"lib\",\n srcs = glob([\"**/*.py\"]),\n data = glob([\"**/*\"], exclude=[\n # These entries include those put into user-installed dependencies by\n # data_exclude to avoid non-determinism.\n \"**/*.py\",\n \"**/*.pyc\",\n \"**/*.pyc.*\", # During pyc creation, temp files named *.pyc.NNN are created\n \"**/*.dist-info/RECORD\",\n \"BUILD\",\n \"WORKSPACE\",\n ]),\n # This makes this directory a top-level in the python import\n # search path for anything that depends on this.\n imports = [\".\"],\n)\n"
}
},
"pypi__pip": {
"repoRuleId": "@@bazel_tools//tools/build_defs/repo:http.bzl%http_archive",
"attributes": {
"url": "https://files.pythonhosted.org/packages/8a/6a/19e9fe04fca059ccf770861c7d5721ab4c2aebc539889e97c7977528a53b/pip-24.0-py3-none-any.whl",
"sha256": "ba0d021a166865d2265246961bec0152ff124de910c5cc39f1156ce3fa7c69dc",
"type": "zip",
"build_file_content": "package(default_visibility = [\"//visibility:public\"])\n\nload(\"@rules_python//python:py_library.bzl\", \"py_library\")\n\npy_library(\n name = \"lib\",\n srcs = glob([\"**/*.py\"]),\n data = glob([\"**/*\"], exclude=[\n # These entries include those put into user-installed dependencies by\n # data_exclude to avoid non-determinism.\n \"**/*.py\",\n \"**/*.pyc\",\n \"**/*.pyc.*\", # During pyc creation, temp files named *.pyc.NNN are created\n \"**/*.dist-info/RECORD\",\n \"BUILD\",\n \"WORKSPACE\",\n ]),\n # This makes this directory a top-level in the python import\n # search path for anything that depends on this.\n imports = [\".\"],\n)\n"
}
},
"pypi__pip_tools": {
"repoRuleId": "@@bazel_tools//tools/build_defs/repo:http.bzl%http_archive",
"attributes": {
"url": "https://files.pythonhosted.org/packages/0d/dc/38f4ce065e92c66f058ea7a368a9c5de4e702272b479c0992059f7693941/pip_tools-7.4.1-py3-none-any.whl",
"sha256": "4c690e5fbae2f21e87843e89c26191f0d9454f362d8acdbd695716493ec8b3a9",
"type": "zip",
"build_file_content": "package(default_visibility = [\"//visibility:public\"])\n\nload(\"@rules_python//python:py_library.bzl\", \"py_library\")\n\npy_library(\n name = \"lib\",\n srcs = glob([\"**/*.py\"]),\n data = glob([\"**/*\"], exclude=[\n # These entries include those put into user-installed dependencies by\n # data_exclude to avoid non-determinism.\n \"**/*.py\",\n \"**/*.pyc\",\n \"**/*.pyc.*\", # During pyc creation, temp files named *.pyc.NNN are created\n \"**/*.dist-info/RECORD\",\n \"BUILD\",\n \"WORKSPACE\",\n ]),\n # This makes this directory a top-level in the python import\n # search path for anything that depends on this.\n imports = [\".\"],\n)\n"
}
},
"pypi__pyproject_hooks": {
"repoRuleId": "@@bazel_tools//tools/build_defs/repo:http.bzl%http_archive",
"attributes": {
"url": "https://files.pythonhosted.org/packages/ae/f3/431b9d5fe7d14af7a32340792ef43b8a714e7726f1d7b69cc4e8e7a3f1d7/pyproject_hooks-1.1.0-py3-none-any.whl",
"sha256": "7ceeefe9aec63a1064c18d939bdc3adf2d8aa1988a510afec15151578b232aa2",
"type": "zip",
"build_file_content": "package(default_visibility = [\"//visibility:public\"])\n\nload(\"@rules_python//python:py_library.bzl\", \"py_library\")\n\npy_library(\n name = \"lib\",\n srcs = glob([\"**/*.py\"]),\n data = glob([\"**/*\"], exclude=[\n # These entries include those put into user-installed dependencies by\n # data_exclude to avoid non-determinism.\n \"**/*.py\",\n \"**/*.pyc\",\n \"**/*.pyc.*\", # During pyc creation, temp files named *.pyc.NNN are created\n \"**/*.dist-info/RECORD\",\n \"BUILD\",\n \"WORKSPACE\",\n ]),\n # This makes this directory a top-level in the python import\n # search path for anything that depends on this.\n imports = [\".\"],\n)\n"
}
},
"pypi__setuptools": {
"repoRuleId": "@@bazel_tools//tools/build_defs/repo:http.bzl%http_archive",
"attributes": {
"url": "https://files.pythonhosted.org/packages/90/99/158ad0609729111163fc1f674a5a42f2605371a4cf036d0441070e2f7455/setuptools-78.1.1-py3-none-any.whl",
"sha256": "c3a9c4211ff4c309edb8b8c4f1cbfa7ae324c4ba9f91ff254e3d305b9fd54561",
"type": "zip",
"build_file_content": "package(default_visibility = [\"//visibility:public\"])\n\nload(\"@rules_python//python:py_library.bzl\", \"py_library\")\n\npy_library(\n name = \"lib\",\n srcs = glob([\"**/*.py\"]),\n data = glob([\"**/*\"], exclude=[\n # These entries include those put into user-installed dependencies by\n # data_exclude to avoid non-determinism.\n \"**/*.py\",\n \"**/*.pyc\",\n \"**/*.pyc.*\", # During pyc creation, temp files named *.pyc.NNN are created\n \"**/*.dist-info/RECORD\",\n \"BUILD\",\n \"WORKSPACE\",\n ]),\n # This makes this directory a top-level in the python import\n # search path for anything that depends on this.\n imports = [\".\"],\n)\n"
}
},
"pypi__tomli": {
"repoRuleId": "@@bazel_tools//tools/build_defs/repo:http.bzl%http_archive",
"attributes": {
"url": "https://files.pythonhosted.org/packages/97/75/10a9ebee3fd790d20926a90a2547f0bf78f371b2f13aa822c759680ca7b9/tomli-2.0.1-py3-none-any.whl",
"sha256": "939de3e7a6161af0c887ef91b7d41a53e7c5a1ca976325f429cb46ea9bc30ecc",
"type": "zip",
"build_file_content": "package(default_visibility = [\"//visibility:public\"])\n\nload(\"@rules_python//python:py_library.bzl\", \"py_library\")\n\npy_library(\n name = \"lib\",\n srcs = glob([\"**/*.py\"]),\n data = glob([\"**/*\"], exclude=[\n # These entries include those put into user-installed dependencies by\n # data_exclude to avoid non-determinism.\n \"**/*.py\",\n \"**/*.pyc\",\n \"**/*.pyc.*\", # During pyc creation, temp files named *.pyc.NNN are created\n \"**/*.dist-info/RECORD\",\n \"BUILD\",\n \"WORKSPACE\",\n ]),\n # This makes this directory a top-level in the python import\n # search path for anything that depends on this.\n imports = [\".\"],\n)\n"
}
},
"pypi__wheel": {
"repoRuleId": "@@bazel_tools//tools/build_defs/repo:http.bzl%http_archive",
"attributes": {
"url": "https://files.pythonhosted.org/packages/7d/cd/d7460c9a869b16c3dd4e1e403cce337df165368c71d6af229a74699622ce/wheel-0.43.0-py3-none-any.whl",
"sha256": "55c570405f142630c6b9f72fe09d9b67cf1477fcf543ae5b8dcb1f5b7377da81",
"type": "zip",
"build_file_content": "package(default_visibility = [\"//visibility:public\"])\n\nload(\"@rules_python//python:py_library.bzl\", \"py_library\")\n\npy_library(\n name = \"lib\",\n srcs = glob([\"**/*.py\"]),\n data = glob([\"**/*\"], exclude=[\n # These entries include those put into user-installed dependencies by\n # data_exclude to avoid non-determinism.\n \"**/*.py\",\n \"**/*.pyc\",\n \"**/*.pyc.*\", # During pyc creation, temp files named *.pyc.NNN are created\n \"**/*.dist-info/RECORD\",\n \"BUILD\",\n \"WORKSPACE\",\n ]),\n # This makes this directory a top-level in the python import\n # search path for anything that depends on this.\n imports = [\".\"],\n)\n"
}
},
"pypi__zipp": {
"repoRuleId": "@@bazel_tools//tools/build_defs/repo:http.bzl%http_archive",
"attributes": {
"url": "https://files.pythonhosted.org/packages/da/55/a03fd7240714916507e1fcf7ae355bd9d9ed2e6db492595f1a67f61681be/zipp-3.18.2-py3-none-any.whl",
"sha256": "dce197b859eb796242b0622af1b8beb0a722d52aa2f57133ead08edd5bf5374e",
"type": "zip",
"build_file_content": "package(default_visibility = [\"//visibility:public\"])\n\nload(\"@rules_python//python:py_library.bzl\", \"py_library\")\n\npy_library(\n name = \"lib\",\n srcs = glob([\"**/*.py\"]),\n data = glob([\"**/*\"], exclude=[\n # These entries include those put into user-installed dependencies by\n # data_exclude to avoid non-determinism.\n \"**/*.py\",\n \"**/*.pyc\",\n \"**/*.pyc.*\", # During pyc creation, temp files named *.pyc.NNN are created\n \"**/*.dist-info/RECORD\",\n \"BUILD\",\n \"WORKSPACE\",\n ]),\n # This makes this directory a top-level in the python import\n # search path for anything that depends on this.\n imports = [\".\"],\n)\n"
}
}
},
"recordedRepoMappingEntries": [
[
"rules_python+",
"bazel_tools",
"bazel_tools"
],
[
"rules_python+",
"pypi__build",
"rules_python++config+pypi__build"
],
[
"rules_python+",
"pypi__click",
"rules_python++config+pypi__click"
],
[
"rules_python+",
"pypi__colorama",
"rules_python++config+pypi__colorama"
],
[
"rules_python+",
"pypi__importlib_metadata",
"rules_python++config+pypi__importlib_metadata"
],
[
"rules_python+",
"pypi__installer",
"rules_python++config+pypi__installer"
],
[
"rules_python+",
"pypi__more_itertools",
"rules_python++config+pypi__more_itertools"
],
[
"rules_python+",
"pypi__packaging",
"rules_python++config+pypi__packaging"
],
[
"rules_python+",
"pypi__pep517",
"rules_python++config+pypi__pep517"
],
[
"rules_python+",
"pypi__pip",
"rules_python++config+pypi__pip"
],
[
"rules_python+",
"pypi__pip_tools",
"rules_python++config+pypi__pip_tools"
],
[
"rules_python+",
"pypi__pyproject_hooks",
"rules_python++config+pypi__pyproject_hooks"
],
[
"rules_python+",
"pypi__setuptools",
"rules_python++config+pypi__setuptools"
],
[
"rules_python+",
"pypi__tomli",
"rules_python++config+pypi__tomli"
],
[
"rules_python+",
"pypi__wheel",
"rules_python++config+pypi__wheel"
],
[
"rules_python+",
"pypi__zipp",
"rules_python++config+pypi__zipp"
]
]
}
},
"@@rules_python+//python/uv:uv.bzl%uv": {
"general": {
"bzlTransitiveDigest": "ijW9KS7qsIY+yBVvJ+Nr1mzwQox09j13DnE3iIwaeTM=",
"usagesDigest": "H8dQoNZcoqP+Mu0tHZTi4KHATzvNkM5ePuEqoQdklIU=",
"recordedFileInputs": {},
"recordedDirentsInputs": {},
"envVariables": {},
"generatedRepoSpecs": {
"uv": {
"repoRuleId": "@@rules_python+//python/uv/private:uv_toolchains_repo.bzl%uv_toolchains_repo",
"attributes": {
"toolchain_type": "'@@rules_python+//python/uv:uv_toolchain_type'",
"toolchain_names": [
"none"
],
"toolchain_implementations": {
"none": "'@@rules_python+//python:none'"
},
"toolchain_compatible_with": {
"none": [
"@platforms//:incompatible"
]
},
"toolchain_target_settings": {}
}
}
},
"recordedRepoMappingEntries": [
[
"rules_python+",
"bazel_tools",
"bazel_tools"
],
[
"rules_python+",
"platforms",
"platforms"
]
]
}
}
},
"facts": {
"@@rules_go+//go:extensions.bzl%go_sdk": {
"1.24.7": {
"aix_ppc64": [
"go1.24.7.aix-ppc64.tar.gz",
"6fa3c4bd59d43bb5583b53dd9461a89f5a50df2d923ac481f69399c389677b1d"
],
"darwin_amd64": [
"go1.24.7.darwin-amd64.tar.gz",
"138b6be2138e83d2c90c23d3a2cc94fcb11864d8db0706bb1d1e0dde744dc46a"
],
"darwin_arm64": [
"go1.24.7.darwin-arm64.tar.gz",
"d06bad763f8820d3e29ee11f2c0c71438903c007e772a159c5760a300298302e"
],
"dragonfly_amd64": [
"go1.24.7.dragonfly-amd64.tar.gz",
"0d3963a4e6234b2256b7b9f03b31a287edd36dd4840071389ce806df92a7d376"
],
"freebsd_386": [
"go1.24.7.freebsd-386.tar.gz",
"46e3202334630b2a9f42bd4b5dad6889d62cbcbad00439eeed95f39718726a2e"
],
"freebsd_amd64": [
"go1.24.7.freebsd-amd64.tar.gz",
"c12d93ec106560dfbcbedd07a68d7fb5b82675921dcf6496fb992e93034c925f"
],
"freebsd_arm": [
"go1.24.7.freebsd-arm.tar.gz",
"9d33d95dbe17b6e963061bad95cbd1c45a51917c391726626fc3f264938f74d5"
],
"freebsd_arm64": [
"go1.24.7.freebsd-arm64.tar.gz",
"2f07f6c3c4cc6df1cbfaedf9aed7e32ed9ff65a4ee79e85d38ec96621c8e8202"
],
"freebsd_riscv64": [
"go1.24.7.freebsd-riscv64.tar.gz",
"d93b875d06126196ef05ad6b09ada589a210f3789bc126658aa1ef5c880a5469"
],
"illumos_amd64": [
"go1.24.7.illumos-amd64.tar.gz",
"e284d44b44c085d25b8f4a0bd6c6df33507c50d73afa9195a3e6003097989c7a"
],
"linux_386": [
"go1.24.7.linux-386.tar.gz",
"1bdf0441ff9c50cceef289a72efecbb6bd60aea545aa9412ef85d8b12199c741"
],
"linux_amd64": [
"go1.24.7.linux-amd64.tar.gz",
"da18191ddb7db8a9339816f3e2b54bdded8047cdc2a5d67059478f8d1595c43f"
],
"linux_arm64": [
"go1.24.7.linux-arm64.tar.gz",
"fd2bccce882e29369f56c86487663bb78ba7ea9e02188a5b0269303a0c3d33ab"
],
"linux_armv6l": [
"go1.24.7.linux-armv6l.tar.gz",
"eaff4aace921075da371b91a5911f0c0fbcb6f712a527a25113f971944b78c36"
],
"linux_loong64": [
"go1.24.7.linux-loong64.tar.gz",
"a0a9c51e81667c5afb43aacf244c5c0fffb8dc554e47406aa66644010ece1373"
],
"linux_mips": [
"go1.24.7.linux-mips.tar.gz",
"7500c9ef7e94596aa55993c33b587ea1626593c11656efbfef031718c817f0e5"
],
"linux_mips64": [
"go1.24.7.linux-mips64.tar.gz",
"679b9c0b7f5e4c0e3f20abdef5fc9feabbb21339f886889bfa50842167fe7168"
],
"linux_mips64le": [
"go1.24.7.linux-mips64le.tar.gz",
"9adeb547af5367961bc10c4fc96058afb6756e1662ec47703b91085c4c118683"
],
"linux_mipsle": [
"go1.24.7.linux-mipsle.tar.gz",
"f2af25297499728f7e33b3200117f1cf5f378a230dac37a0bb14fa1e44cc3485"
],
"linux_ppc64": [
"go1.24.7.linux-ppc64.tar.gz",
"f98091791539e2f5d0b4ceef3f39db945e17d26437b13bc5cf2e3075d2f58c70"
],
"linux_ppc64le": [
"go1.24.7.linux-ppc64le.tar.gz",
"e50462c5ad6ae7600eed24414729d0e0ab63d166ff6e5da550afc3010dfa084c"
],
"linux_riscv64": [
"go1.24.7.linux-riscv64.tar.gz",
"520dfb39e01d32d37aed711603d0b3d4bd0f0e0969ac1a309061c1625b9268fd"
],
"linux_s390x": [
"go1.24.7.linux-s390x.tar.gz",
"48caa1c5011f625bada49adea12a9693ffe9813196451e2d2b9120b3add50784"
],
"netbsd_386": [
"go1.24.7.netbsd-386.tar.gz",
"8321f2a38a58d51ea09a3d9e5db0cb3bc6d8ea4f89ed29e2c51c2afeab42aee1"
],
"netbsd_amd64": [
"go1.24.7.netbsd-amd64.tar.gz",
"f3c6f0c7bd3e431d03245d7193c4c6c3c9cc2225feb157d3f461ad1d7c8be70e"
],
"netbsd_arm": [
"go1.24.7.netbsd-arm.tar.gz",
"e7ba35209a279e2b266da58d96bf779efd3df0e750129d9ab653b7cf1bd7e9b1"
],
"netbsd_arm64": [
"go1.24.7.netbsd-arm64.tar.gz",
"fdce5e5d64970f6525446882f18135b71be4e395d4060b57d83b4ef553ff0563"
],
"openbsd_386": [
"go1.24.7.openbsd-386.tar.gz",
"b4da8cdefd2feb6ddcaca4799d6205371ed1be80e532ac38fe30d458c437a685"
],
"openbsd_amd64": [
"go1.24.7.openbsd-amd64.tar.gz",
"215e433d5bfc6000b710dec9766719e8bd6073bf24fc9cda85cbcfaa75d7b66d"
],
"openbsd_arm": [
"go1.24.7.openbsd-arm.tar.gz",
"b6203695b36aeb5843f1db5c94e5797ab177f7be54138b9f3a329442ae1268f9"
],
"openbsd_arm64": [
"go1.24.7.openbsd-arm64.tar.gz",
"ffd4253b59ebf71a16f8dbf7b81dae8649ebc68a350119d2d843d23f9f1492c3"
],
"openbsd_ppc64": [
"go1.24.7.openbsd-ppc64.tar.gz",
"e73192976944ccfb62f068308cff190bc18ef122b99182cc206bdef9a3644242"
],
"openbsd_riscv64": [
"go1.24.7.openbsd-riscv64.tar.gz",
"e6ccc915da85e6cd16ce9bf6394a8e480c778aada19ff2d0afc2f72c472c2e51"
],
"plan9_386": [
"go1.24.7.plan9-386.tar.gz",
"ada3d4ca2fb46feec4c927e39d5bab3a4de297a1e05a87c7d015c133661def22"
],
"plan9_amd64": [
"go1.24.7.plan9-amd64.tar.gz",
"9d9a7cb0e0d3d97df7b17e2e62eac587014a6e5dc40894489c3d6021cc501a23"
],
"plan9_arm": [
"go1.24.7.plan9-arm.tar.gz",
"bf4170b85c4018fa2d96090f8e79479dc6561d6ffba3b8b886b384beef0928fc"
],
"solaris_amd64": [
"go1.24.7.solaris-amd64.tar.gz",
"0df731b6a3fedf0722830dc2d341bd68d6b68e0a64d46840f0b0b9344bc01a08"
],
"windows_386": [
"go1.24.7.windows-386.zip",
"c4a1e3cb7278c298e582900588ded758139a6fad1cebb0782a4242f0ffc981d1"
],
"windows_amd64": [
"go1.24.7.windows-amd64.zip",
"453873081af26fc7fb09710b1187dbc940b8179a4dd59b30e67b4ffa6fb57237"
],
"windows_arm64": [
"go1.24.7.windows-arm64.zip",
"879513669d41df98d9237afbf603767632f5b5f6732a61f43f964a3286635d9d"
]
},
"1.26.7": {
"aix_ppc64": [
"go1.26.7.aix-ppc64.tar.gz",
"e5aed98bc83f569a374dbfd79d632b058e5130192fbd4c4ee0d4f6e3d9c101bb"
],
"darwin_amd64": [
"go1.26.7.darwin-amd64.tar.gz",
"92e8b34bff3c89ab16404c595669ac8cb004cc2f676dcbd1f5b87a6b8def3b47"
],
"darwin_arm64": [
"go1.26.7.darwin-arm64.tar.gz",
"020a1e8224811be75163e920bc77e0926a1390a6aeea19bdcf23f74b9d749f6d"
],
"dragonfly_amd64": [
"go1.26.7.dragonfly-amd64.tar.gz",
"d980dc9ecc48de09b2fa1765886abb8c7b0ad738bf8cc483b76019facc2df4d1"
],
"freebsd_386": [
"go1.26.7.freebsd-386.tar.gz",
"7eecfa4d6c126bcdedb8e16583ec672857e607659c672c60a9d645f8957da117"
],
"freebsd_amd64": [
"go1.26.7.freebsd-amd64.tar.gz",
"2ad37146fa8449907716b494dd268aeae6f79592b875915525c28c8c337ad32a"
],
"freebsd_arm": [
"go1.26.7.freebsd-arm.tar.gz",
"bc56379ed419cd93cf7002dcb95f554b3e3a2bd58d804182f8873e313a870b70"
],
"freebsd_arm64": [
"go1.26.7.freebsd-arm64.tar.gz",
"23d425a3a51876df8bf050f080b1ae50340048def689fbcc44c939fa23485ce0"
],
"illumos_amd64": [
"go1.26.7.illumos-amd64.tar.gz",
"be51df2411786e1fa6325461e509224a94c5e8d001da8e4548d9e028a53a3c22"
],
"linux_386": [
"go1.26.7.linux-386.tar.gz",
"5b6fad4a7fe8fa230c935625b67450305be95e2f4f976b731623f76b88fc4821"
],
"linux_amd64": [
"go1.26.7.linux-amd64.tar.gz",
"ffb5f8de10c62550dfddab66b36b57030721e0a44a3218e9e1181d7b59f121ca"
],
"linux_arm64": [
"go1.26.7.linux-arm64.tar.gz",
"5a4ec883379d51ee9ce1040d5e87f8d35e20387574dd8c947feb01eabc3c1b37"
],
"linux_armv6l": [
"go1.26.7.linux-armv6l.tar.gz",
"6a41557335d1d9fa9bfc7439cedcfd0e4df2fc83d916175b5f3eae4685f5fe3f"
],
"linux_loong64": [
"go1.26.7.linux-loong64.tar.gz",
"89b5e92446e719719e23db447a41860d7d573252bab0704c9acb09ad97e9eca1"
],
"linux_mips": [
"go1.26.7.linux-mips.tar.gz",
"fbdbf78b04494843fde47b15150e12adb7e2c0e2289eacbc18e6629a99604620"
],
"linux_mips64": [
"go1.26.7.linux-mips64.tar.gz",
"93b1360a29f4a71dbb6995f149b9312f67f5ce52197fea0042e9c9423809a496"
],
"linux_mips64le": [
"go1.26.7.linux-mips64le.tar.gz",
"402dd2bd57fb4c982ef0eccbb4f7209ae98a753856e99baf962f1ac54493d65d"
],
"linux_mipsle": [
"go1.26.7.linux-mipsle.tar.gz",
"967da58e88c45c401593a8552be9beedaa989a3484a3105850d2beb6ca9ed698"
],
"linux_ppc64": [
"go1.26.7.linux-ppc64.tar.gz",
"8feee58b3fa8d270343519d10d66736150e627d39aee937e6e889ba5445c8be9"
],
"linux_ppc64le": [
"go1.26.7.linux-ppc64le.tar.gz",
"22d3b362d557175fd16b79651cab0cad64f8aaaedca745f66d16f44d56bc5de1"
],
"linux_riscv64": [
"go1.26.7.linux-riscv64.tar.gz",
"21e1dc0e2f7dd9f80e0e94613fc324f1f99403b99997f9d8c5f80f8132fc642b"
],
"linux_s390x": [
"go1.26.7.linux-s390x.tar.gz",
"bc3308e05e9397958ad4aac453e3dc4565ba6d548e9ace0a9b4b165feb6382f2"
],
"netbsd_386": [
"go1.26.7.netbsd-386.tar.gz",
"c0a28bd30d8c07966cf7bc43fc6936866fb1a0e84ab4e983d4e8ca15edc1a4d1"
],
"netbsd_amd64": [
"go1.26.7.netbsd-amd64.tar.gz",
"dff0b16d129f5e70f3bb38ed98d467404b5b130c7c8b3fe6b074601855f2bcd5"
],
"netbsd_arm": [
"go1.26.7.netbsd-arm.tar.gz",
"36d15f8c5c5a5a048251b39ce67ed5a7ae2d072f1aa5c301cbde110670e824b2"
],
"netbsd_arm64": [
"go1.26.7.netbsd-arm64.tar.gz",
"b75802b366e5b60aa6cfded871f0a72abadf297c5a68c523c5857822a5b92d34"
],
"openbsd_386": [
"go1.26.7.openbsd-386.tar.gz",
"c26201688339b2a10bf980be2d64adfd3a383b31a164377b0123ad78bde6979c"
],
"openbsd_amd64": [
"go1.26.7.openbsd-amd64.tar.gz",
"562de088b844764029f59ff52e82218711a4b585ab7ae175b88eff53e051a8df"
],
"openbsd_arm": [
"go1.26.7.openbsd-arm.tar.gz",
"646e19cd3449aec767bf75622d368b02c73d529a5478a25f2a7e21148b1a4cb6"
],
"openbsd_arm64": [
"go1.26.7.openbsd-arm64.tar.gz",
"2045303632e112290e939dfd4678401109f612f7913f459e2d7d079e750723f5"
],
"openbsd_ppc64": [
"go1.26.7.openbsd-ppc64.tar.gz",
"23e89de68225dc41dd981601602e67fab0c4ca87af8f70a25131c06a301f9000"
],
"openbsd_riscv64": [
"go1.26.7.openbsd-riscv64.tar.gz",
"c0de2c6c353a582ca7682ed5a550056a8b5d59649260da4d1e327cf96684c822"
],
"plan9_386": [
"go1.26.7.plan9-386.tar.gz",
"14ae7414a2ea05d26e1fc499d9b372c7f8f17726c49a5222fa9063b0f752a22c"
],
"plan9_amd64": [
"go1.26.7.plan9-amd64.tar.gz",
"f9459b8137bdb81621d4e0cdba4c849a617c89c11a3088083ad3a8c97467c6a5"
],
"plan9_arm": [
"go1.26.7.plan9-arm.tar.gz",
"4f444bd2e0f8a08ba8799131dd3531bea8723bf96b8ffa0e0948936a3c4aa8f0"
],
"solaris_amd64": [
"go1.26.7.solaris-amd64.tar.gz",
"04b5b280e0e0de1b91d7da5e34801dbf75e5621615f80cfd9935091d673f1238"
],
"windows_386": [
"go1.26.7.windows-386.zip",
"59cf0b9814c41c960d70df3cd5360fda0793e5d2230737d58e009392181fb636"
],
"windows_amd64": [
"go1.26.7.windows-amd64.zip",
"f4f534a486e4bc3387fa18f08208f2f854b7aaea8a08f2a2d829a914a05abb11"
],
"windows_arm64": [
"go1.26.7.windows-arm64.zip",
"6f1b08de9e2dd94f69c52e524ab6834737275253291e8fd7f1c12ed4eceeda89"
]
}
}
}
}
+3
View File
@@ -24,6 +24,9 @@ In DMs the bot reads every message. You can also chat with it in Slack's assista
7. Containers unused for longer than their idle limit are stopped (default 6 hours, see `keep`). Files are kept, and the bot posts to say it stopped the container.
8. **Container updates have their own thread.** Each time a container starts, the bot posts a top-level "Starting container" message in the channel (or your DM) and pins it. Every step goes in that message's thread as its own reply, saying what the bot is waiting for: placing it on a node, creating the home folder and launching it, and waiting for the agent. A last reply says the container is up. Your own thread only gets one message with a link to it. Stopping a container (`stop`, the **Stop** button or the idle limit) is reported in the same thread, ending with a reply that it's down. The pin is replaced the next time the container starts.
9. **Attach files** to your message (images, logs, zips) and they're copied into the container at `/root/slack-uploads/<message time>/<name>`, and the agent is told where. A message with files always goes to the agent, never to a command. Files over the server's size limit (default 100 MB) are left out, and the home folder's max size still applies.
10. **The agent can send you files.** It has a `send_file` tool, and the files land in the thread when its reply ends, where Slack previews images, video and PDFs. At most 5 files per reply, each under the server's size limit.
Other replies you may get:
- **"maxed out":** no node has room right now. Try again later.
+3
View File
@@ -8,6 +8,9 @@ max_idle_timeout = "0s" # 0s = no cap. Go durations only, e.g. "168h" for a we
allow_indefinite = true
boot_timeout = "2m"
# Largest file the agent may send to Slack, and the largest attachment copied into a container.
max_send_file_mb = 100
# "{machine}" becomes the container name, e.g. c-c07abc123.
ro_binds = []
rw_binds = []
+1
View File
@@ -30,6 +30,7 @@
nixosConfigurations.agent = nixpkgs.lib.nixosSystem {
inherit system;
specialArgs.slackerbot = self.packages.${system}.slackerbot;
modules = [ ./nix/container.nix ];
};
+9 -2
View File
@@ -1,4 +1,4 @@
{ pkgs, ... }:
{ pkgs, slackerbot, ... }:
{
boot.isContainer = true;
networking.hostName = "agent";
@@ -8,7 +8,14 @@
systemd.network.enable = true;
networking.firewall.allowedTCPPorts = [ 1984 ];
environment.systemPackages = with pkgs; [ goose-cli git curl ripgrep ];
environment.systemPackages = with pkgs; [
goose-cli
git
curl
ripgrep
# The bot passes this to goose as an MCP server (the send_file tool).
(writeShellScriptBin "slackerbot-tools" ''exec ${slackerbot}/bin/slackerbot "$@"'')
];
systemd.services.goose = {
wantedBy = [ "multi-user.target" ];
+3 -5
View File
@@ -2,10 +2,8 @@
Designs that aren't built yet. Each file says what it needs, which Slack scopes it uses, and what it must not break.
| Plan | Uses | Depends on |
|---|---|---|
| [send-files-to-user.md](send-files-to-user.md) | `files:write` | node file reads |
| [attachments-into-container.md](attachments-into-container.md) | `files:read` | node file writes |
| [agent-slack-tools.md](agent-slack-tools.md) | `canvases:*`, `lists:*`, `bookmarks:*`, `pins:*`, `channels:write.topic`, `emoji:read`, `team:read`, `users:read.email`, `chat:write.public` | the MCP bridge in send-files-to-user.md |
| Plan | Uses | Depends on |
| -------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------- |
| [agent-slack-tools.md](agent-slack-tools.md) | `canvases:*`, `lists:*`, `bookmarks:*`, `pins:*`, `channels:write.topic`, `emoji:read`, `team:read`, `users:read.email`, `chat:write.public` | the `tools` MCP server (see ARCHITECTURE.md) |
Until these are built, the scopes above are requested in `slack-manifest.yaml` but unused.
+1 -1
View File
@@ -8,7 +8,7 @@ With `channels:history` and the other read scopes, a container holding the bot t
## Shape
- The bot exposes the tools through the same in-container MCP server as `send_file` ([send-files-to-user.md](send-files-to-user.md)). The container side stays a thin relay: it forwards each call to the bot, and the bot answers.
- The bot exposes the tools through the same in-container MCP server as `send_file` (`internal/tools`). The container side stays a thin relay: it forwards each call to the bot, and the bot answers.
- **Getting calls to the bot:** the relay talks back over the agent connection the bot already has open (a new ACP extension method such as `_slackerbot/call`, which goose would pass through from the MCP server, if it can), or over a new stream from container → node → master. The second option is a new direction on the cluster link (slave → master) and has to be additive, because masters and slaves may run different versions for a while.
- **Every call is scoped to the session's owner:** the channel (or the user's DM) and its threads. The bot checks this, not the container.
-9
View File
@@ -1,9 +0,0 @@
# Attachments into the container
Files attached to a message to the bot (images, logs, zips) end up in the container, so the agent can use them.
- Message events with `subtype: file_share` are dropped today (`bot.onEvent` only takes messages with no subtype). Accept `file_share` too.
- For each entry in `files[]`, download `url_private_download` with the bot token (`files:read`), and write it to `/root/slack-uploads/<message ts>/<name>`.
- Add the paths to the prompt text: `(Attached: /root/slack-uploads/…/report.pdf)`.
- Writing needs a node operation, `write_file(machine, path)`, that streams chunks like `import_home` / `write_import`. It's the mirror of `read_file` in [send-files-to-user.md](send-files-to-user.md), so build the two together. It's an additive call name in `manager/cluster.go`, and old slaves get a polite "this node can't take attachments yet".
- Size cap: reuse `max_send_file_mb`. The home's btrfs quota still applies, so an upload that doesn't fit fails with a clear message.
-24
View File
@@ -1,24 +0,0 @@
# Agent sends files to the user
Give the agent a `send_file` tool, so it can hand back images, videos, PDFs, archives or any other file it made. The bot uploads the file into the session's thread, where Slack previews images, video and PDFs inline.
## Shape
1. **The tool runs inside the container.** It's a tiny stdio MCP server added to `nix/container.nix` (for example `slackerbot-tools`). The bot passes it to goose in `session/new` and `session/load` through `mcpServers` (now `[]` in `acp.go`), so every session gets it without a goose config change.
- `send_file(path, comment?)`: checks that the path is a regular file under `/root` and below the size cap, then returns `"queued"`. It doesn't move any bytes itself, so file contents never land in the model's context.
- Check first that the `goose serve` version we ship honours `mcpServers` from ACP. If it doesn't, register the extension in goose's config in `container.nix` instead.
2. **The bot does the upload.** The streamer already sees ACP `tool_call` / `tool_call_update` messages. When a `send_file` call completes, the bot reads `rawInput.path`, fetches the file from the container's home, and calls `files.uploadV2` (`files:write`) into the thread, with `comment` as the initial message.
3. **Getting the bytes from the home** needs a new node operation, `read_file(machine, path)`, that streams the file in chunks the same way `export_home` / `read_export` do.
- `local` opens the file with `os.OpenInRoot(home, rel)` (Go 1.24), so symlinks and `..` can't escape the home.
- It's a new call name in `manager/cluster.go`. Old slaves answer "unknown call", and the bot replies "This node is too old to send files" instead of failing the turn.
- Files go node → master → Slack, so slaves still need no Slack token.
## Limits and config
- `max_send_file_mb` in `config.toml` (default 100). Slack's own limit is 1 GB.
- At most a few files per turn, so a looping agent can't flood a thread.
- The tool's description tells the agent to use it for anything the user should see or download, rather than pasting long output.
## Docs to update when built
USERGUIDE (agent can send files), ARCHITECTURE (`read_file` call, MCP tool), INSTALLATION and `config.example.toml` (`max_send_file_mb`).
+1
View File
@@ -0,0 +1 @@
# gazelle:prefix slackerbot
+36 -7
View File
@@ -12,10 +12,21 @@ import (
)
type Update struct {
Kind string
Text string
Title string
Status string
Kind string
Text string
Title string
Status string
ToolID string
ToolName string
RawInput json.RawMessage
}
// MCP servers started inside the container for every session.
type MCPServer struct {
Name string `json:"name"`
Command string `json:"command"`
Args []string `json:"args"`
Env []any `json:"env"`
}
type rpcError struct {
@@ -46,6 +57,7 @@ type ACP struct {
loaded map[string]bool
CanLoad bool
Servers []MCPServer
done chan struct{}
err error
@@ -96,7 +108,7 @@ func (a *ACP) NewSession(ctx context.Context, cwd string) (string, error) {
var res struct {
SessionID string `json:"sessionId"`
}
if err := a.call(ctx, "session/new", map[string]any{"cwd": cwd, "mcpServers": []any{}}, &res); err != nil {
if err := a.call(ctx, "session/new", map[string]any{"cwd": cwd, "mcpServers": a.servers()}, &res); err != nil {
return "", err
}
a.mu.Lock()
@@ -116,7 +128,7 @@ func (a *ACP) LoadSession(ctx context.Context, id, cwd string) error {
if !a.CanLoad {
return errors.New("this agent can't reopen old sessions")
}
if err := a.call(ctx, "session/load", map[string]any{"sessionId": id, "cwd": cwd, "mcpServers": []any{}}, nil); err != nil {
if err := a.call(ctx, "session/load", map[string]any{"sessionId": id, "cwd": cwd, "mcpServers": a.servers()}, nil); err != nil {
return err
}
a.mu.Lock()
@@ -125,6 +137,13 @@ func (a *ACP) LoadSession(ctx context.Context, id, cwd string) error {
return nil
}
func (a *ACP) servers() []MCPServer {
if a.Servers == nil {
return []MCPServer{}
}
return a.Servers
}
func (a *ACP) Prompt(ctx context.Context, id, text string, onUpdate func(Update)) (stopReason string, err error) {
a.mu.Lock()
a.handlers[id] = onUpdate
@@ -236,12 +255,22 @@ func (a *ACP) handleUpdate(params json.RawMessage) {
Content json.RawMessage `json:"content"`
Title string `json:"title"`
Status string `json:"status"`
ToolID string `json:"toolCallId"`
Input json.RawMessage `json:"rawInput"`
Meta struct {
Goose struct {
ToolCall struct {
ToolName string `json:"toolName"`
} `json:"toolCall"`
} `json:"goose"`
} `json:"_meta"`
} `json:"update"`
}
if json.Unmarshal(params, &p) != nil {
return
}
u := Update{Kind: p.Update.Kind, Title: p.Update.Title, Status: p.Update.Status}
u := Update{Kind: p.Update.Kind, Title: p.Update.Title, Status: p.Update.Status,
ToolID: p.Update.ToolID, ToolName: p.Update.Meta.Goose.ToolCall.ToolName, RawInput: p.Update.Input}
// Message chunks carry one content block; tool updates carry a list.
var block struct {
Type string `json:"type"`
+28 -8
View File
@@ -27,6 +27,7 @@ import (
"slackerbot/internal/node"
"slackerbot/internal/state"
"slackerbot/internal/storage"
"slackerbot/internal/tools"
"slackerbot/internal/units"
"slackerbot/internal/util"
)
@@ -84,6 +85,7 @@ type incoming struct {
user, channel, ts, threadTS, text string
dm bool
heard bool
files []slack.File
}
func (m incoming) owner() (string, model.OwnerKind) {
@@ -152,17 +154,17 @@ func (b *Bot) onEvent(ctx context.Context, ev slackevents.EventsAPIEvent) {
if e.BotID != "" {
return
}
b.onMessage(ctx, incoming{e.User, e.Channel, e.TimeStamp, e.ThreadTimeStamp, b.stripMention(e.Text), false, false})
b.onMessage(ctx, incoming{e.User, e.Channel, e.TimeStamp, e.ThreadTimeStamp, b.stripMention(e.Text), false, false, eventFiles(ev)})
case *slackevents.MessageEvent:
if e.BotID != "" || e.SubType != "" || e.User == "" || e.User == b.botID {
if e.BotID != "" || (e.SubType != "" && e.SubType != "file_share") || e.User == "" || e.User == b.botID {
return
}
text := b.stripMention(e.Text)
switch {
case e.ChannelType == "im":
b.onMessage(ctx, incoming{e.User, e.Channel, e.TimeStamp, e.ThreadTimeStamp, text, true, false})
b.onMessage(ctx, incoming{e.User, e.Channel, e.TimeStamp, e.ThreadTimeStamp, text, true, false, eventFiles(ev)})
case b.listening(e.Channel, e.ThreadTimeStamp, e.Text):
b.onMessage(ctx, incoming{e.User, e.Channel, e.TimeStamp, e.ThreadTimeStamp, text, false, true})
b.onMessage(ctx, incoming{e.User, e.Channel, e.TimeStamp, e.ThreadTimeStamp, text, false, true, eventFiles(ev)})
}
case *slackevents.ReactionAddedEvent:
b.onReaction(e)
@@ -178,15 +180,17 @@ func (b *Bot) stripMention(text string) string {
}
func (b *Bot) onMessage(ctx context.Context, m incoming) {
if b.listenCommand(ctx, m) {
// A message with files always goes to the agent, so a file with no text isn't read as `help`.
commandable := len(m.files) == 0
if commandable && b.listenCommand(ctx, m) {
return
}
// Every assistant-pane chat is a DM thread, so its first message counts as new.
fresh := m.threadTS == "" || m.dm && b.store.Session(m.channel, m.threadTS) == nil
if fresh && b.command(ctx, m) {
if commandable && fresh && b.command(ctx, m) {
return
}
if m.threadTS != "" && !m.heard && b.moveCommand(ctx, m, m.threadTS) {
if commandable && m.threadTS != "" && !m.heard && b.moveCommand(ctx, m, m.threadTS) {
return
}
root := m.threadTS
@@ -297,6 +301,16 @@ func (b *Bot) onMessage(ctx context.Context, m incoming) {
if m.dm {
text = b.viewingNote(ctx, m.channel, root) + text
}
if len(m.files) > 0 {
edit(":paperclip: Copying the attachments into the container…")
note, problems := b.attach(ctx, u, m)
if note != "" {
text += "\n" + note
}
if len(problems) > 0 {
b.say(ctx, m.channel, root, ":warning: "+strings.Join(problems, "\n"))
}
}
edit("_working…_")
pctx, cancel := context.WithCancel(ctx)
@@ -311,11 +325,16 @@ func (b *Bot) onMessage(ctx context.Context, m incoming) {
defer b.setAssistantStatus(ctx, m.channel, root, "")
}
st := NewStreamer(b.api, m.channel, root, ph)
stop, err := acp.Prompt(pctx, id, text, st.Update)
var sends tools.Calls
stop, err := acp.Prompt(pctx, id, text, func(up acpUpdate) {
sends.Update(up)
st.Update(up)
})
if pctx.Err() != nil && ctx.Err() == nil {
stop, err = "cancelled", nil
}
st.Finish(stop, err)
b.upload(ctx, u, m.channel, root, sends.Files())
_ = b.store.Touch(u.ID)
switch {
case stop == "cancelled":
@@ -1043,6 +1062,7 @@ func (b *Bot) client(ctx context.Context, u *model.Owner) (*acp.ACP, error) {
if c, err = acp.New(initCtx, conn); err != nil {
return nil, err
}
c.Servers = b.mcpServers()
b.acpMu.Lock()
b.acps[key] = c
b.acpMu.Unlock()
+145
View File
@@ -0,0 +1,145 @@
package bot
import (
"bytes"
"context"
"encoding/json"
"errors"
"fmt"
"io"
"log"
"path"
"strconv"
"strings"
"github.com/slack-go/slack"
"github.com/slack-go/slack/slackevents"
"slackerbot/internal/acp"
"slackerbot/internal/manager"
"slackerbot/internal/model"
"slackerbot/internal/node"
"slackerbot/internal/tools"
)
const (
maxFilesPerTurn = 5
uploadsDir = "slack-uploads"
)
// onMessage's local `acp` client shadows the package name.
type acpUpdate = acp.Update
func (b *Bot) mcpServers() []acp.MCPServer {
return []acp.MCPServer{tools.Spec(b.cfg.AgentCwd, b.cfg.MaxSendFileMB)}
}
// slack-go's app_mention event has no files field, so they're read from the raw event.
func eventFiles(ev slackevents.EventsAPIEvent) []slack.File {
cb, ok := ev.Data.(*slackevents.EventsAPICallbackEvent)
if !ok || cb.InnerEvent == nil {
return nil
}
var inner struct {
Files []slack.File `json:"files"`
}
_ = json.Unmarshal(*cb.InnerEvent, &inner)
return inner.Files
}
func uploadName(f slack.File, i int, seen map[string]bool) string {
name := strings.NewReplacer("/", "_", "\x00", "").Replace(path.Base(f.Name))
if name == "" || name == "." || name == ".." {
name = "file-" + strconv.Itoa(i+1)
}
if seen[name] {
name = strconv.Itoa(i+1) + "-" + name
}
seen[name] = true
return name
}
// attach copies the message's files into the container and says where they went.
func (b *Bot) attach(ctx context.Context, u *model.Owner, m incoming) (note string, problems []string) {
maxBytes := b.cfg.MaxSendFileMB << 20
dir := path.Join(b.cfg.AgentCwd, uploadsDir, m.ts)
seen := map[string]bool{}
var paths []string
for i, f := range m.files {
name := uploadName(f, i, seen)
if f.Mode == "external" || f.Mode == "tombstone" || f.URLPrivateDownload == "" {
problems = append(problems, fmt.Sprintf("%s isn't a file I can download.", name))
continue
}
if int64(f.Size) > maxBytes {
problems = append(problems, fmt.Sprintf("%s is bigger than the %d MB limit, so I left it out.", name, b.cfg.MaxSendFileMB))
continue
}
dst := path.Join(dir, name)
if err := b.copyIn(ctx, u, f, dst, maxBytes); err != nil {
if errors.Is(err, node.ErrTooOld) {
return "", []string{"This container's node can't take attachments yet, so I left them out. It needs a newer slackerbot."}
}
problems = append(problems, fmt.Sprintf("Couldn't copy %s into the container: %v.", name, err))
continue
}
paths = append(paths, dst)
}
if len(paths) > 0 {
note = "(Attached: " + strings.Join(paths, ", ") + ")"
}
return note, problems
}
func (b *Bot) copyIn(ctx context.Context, u *model.Owner, f slack.File, dst string, maxBytes int64) error {
ctx, cancel := context.WithCancel(ctx)
defer cancel()
pr, pw := io.Pipe()
go func() { pw.CloseWithError(b.api.GetFileContext(ctx, f.URLPrivateDownload, pw)) }()
err := b.mgr.WriteFile(ctx, u, dst, maxBytes, pr)
pr.CloseWithError(err)
if errors.Is(err, manager.ErrFileTooBig) {
return fmt.Errorf("it's bigger than the %d MB limit", b.cfg.MaxSendFileMB)
}
return err
}
func (b *Bot) upload(ctx context.Context, u *model.Owner, channel, thread string, reqs []tools.FileRequest) {
if len(reqs) > maxFilesPerTurn {
b.say(ctx, channel, thread, fmt.Sprintf(":warning: The agent tried to send %d files. I only send %d per reply, so the rest were skipped.", len(reqs), maxFilesPerTurn))
reqs = reqs[:maxFilesPerTurn]
}
for _, r := range reqs {
if err := b.uploadOne(ctx, u, channel, thread, r); err != nil {
name := path.Base(r.Path)
switch {
case errors.Is(err, node.ErrTooOld):
b.say(ctx, channel, thread, "This container's node is too old to send files. It needs a newer slackerbot.")
return
case errors.Is(err, manager.ErrFileTooBig):
b.say(ctx, channel, thread, fmt.Sprintf(":warning: Couldn't send %s: it's bigger than the %d MB limit.", name, b.cfg.MaxSendFileMB))
default:
log.Printf("send file %s from %s: %v", r.Path, u.Machine, err)
b.say(ctx, channel, thread, fmt.Sprintf(":warning: Couldn't send %s: %v", name, err))
}
}
}
}
// The file is buffered on the master, because files.uploadV2 needs the size up front.
func (b *Bot) uploadOne(ctx context.Context, u *model.Owner, channel, thread string, r tools.FileRequest) error {
var buf bytes.Buffer
n, err := b.mgr.ReadFile(ctx, u, r.Path, b.cfg.MaxSendFileMB<<20, &buf)
if err != nil {
return err
}
if n == 0 {
return errors.New("the file is empty")
}
name := path.Base(r.Path)
_, err = b.api.UploadFileV2Context(ctx, slack.UploadFileV2Parameters{
Reader: &buf, FileSize: int(n), Filename: name, Title: name,
Channel: channel, ThreadTimestamp: thread, InitialComment: r.Comment,
})
return err
}
+5
View File
@@ -49,6 +49,8 @@ type Config struct {
AgentCwd string `toml:"agent_cwd"`
AgentEnv map[string]string `toml:"agent_env"`
MaxSendFileMB int64 `toml:"max_send_file_mb"`
ROBinds []string `toml:"ro_binds"`
RWBinds []string `toml:"rw_binds"`
@@ -85,6 +87,7 @@ func LoadConfig(path, mode string) (*Config, error) {
AllowIndefinite: true,
BootTimeout: 2 * time.Minute,
AgentCwd: "/root",
MaxSendFileMB: 100,
Container: model.Size{MemoryMB: 2048, CPUs: 1},
MaxContainer: model.Size{MemoryMB: 8192, CPUs: 4},
HostReserve: model.Size{MemoryMB: 2048, CPUs: 1},
@@ -133,6 +136,8 @@ func LoadConfig(path, mode string) (*Config, error) {
return nil, fmt.Errorf("system (the NixOS build) is required")
case c.Container.MemoryMB <= 0 || c.Container.CPUs <= 0:
return nil, fmt.Errorf("container memory_mb and cpus must be above zero")
case c.MaxSendFileMB <= 0 || c.MaxSendFileMB > 1024:
return nil, fmt.Errorf("max_send_file_mb must be between 1 and 1024 (Slack's limit)")
case c.IdleTimeout <= 0:
return nil, fmt.Errorf("idle_timeout must be above zero")
case !c.Container.Fits(c.MaxContainer):
+98
View File
@@ -0,0 +1,98 @@
package local
import (
"context"
"errors"
"fmt"
"io"
"os"
"path/filepath"
"strings"
"syscall"
)
// os.Root keeps symlinks and ".." from escaping the home folder.
func (l *Local) ReadFile(ctx context.Context, drive, machine, path string, offset int64, limit int) ([]byte, int64, error) {
home, err := l.home(drive, machine)
if err != nil {
return nil, 0, err
}
f, err := os.OpenInRoot(home, path)
if err != nil {
return nil, 0, fileErr(path, err)
}
defer f.Close()
st, err := f.Stat()
if err != nil {
return nil, 0, err
}
if !st.Mode().IsRegular() {
return nil, 0, fmt.Errorf("%s isn't a regular file", path)
}
buf := make([]byte, min(int64(limit), max(0, st.Size()-offset)))
n, err := f.ReadAt(buf, offset)
if errors.Is(err, io.EOF) {
err = nil
}
return buf[:n], st.Size(), err
}
// Writing at offset 0 creates or truncates the file; later chunks follow on.
func (l *Local) WriteFile(ctx context.Context, drive, machine, path string, offset int64, data []byte) error {
home, err := l.home(drive, machine)
if err != nil {
return err
}
root, err := os.OpenRoot(home)
if err != nil {
return err
}
defer root.Close()
flags := os.O_WRONLY | os.O_CREATE
if offset == 0 {
flags |= os.O_TRUNC
if err := mkdirAll(root, filepath.Dir(path)); err != nil {
return fileErr(path, err)
}
}
f, err := root.OpenFile(path, flags, 0o644)
if err != nil {
return fileErr(path, err)
}
_, err = f.WriteAt(data, offset)
if cerr := f.Close(); err == nil {
err = cerr
}
return fileErr(path, err)
}
func mkdirAll(root *os.Root, dir string) error {
cur := ""
for _, part := range strings.Split(filepath.Clean(dir), "/") {
if part == "" || part == "." {
continue
}
cur = filepath.Join(cur, part)
if err := root.Mkdir(cur, 0o755); err != nil && !errors.Is(err, os.ErrExist) {
return err
}
}
return nil
}
// Errors go back to Slack, so they shouldn't name host paths.
func fileErr(path string, err error) error {
switch {
case err == nil:
return nil
case errors.Is(err, syscall.EDQUOT), errors.Is(err, syscall.ENOSPC):
return errors.New("the home folder is full")
case errors.Is(err, os.ErrNotExist):
return fmt.Errorf("there's no file %s", path)
}
var pe *os.PathError
if errors.As(err, &pe) {
return fmt.Errorf("%s: %s %v", path, pe.Op, pe.Err)
}
return err
}
+26
View File
@@ -468,6 +468,23 @@ func (r *Remote) DeleteHome(ctx context.Context, drive, machine string) error {
return r.callNode(ctx, "delete_home", callParams{Drive: drive, Machine: machine}, nil)
}
func (r *Remote) ReadFile(ctx context.Context, drive, machine, path string, offset int64, limit int) ([]byte, int64, error) {
var res callParams
err := r.callNode(ctx, "read_file", callParams{Drive: drive, Machine: machine, Path: path, Offset: offset, Max: limit}, &res)
return res.Data, res.FileSize, tooOld(err)
}
func (r *Remote) WriteFile(ctx context.Context, drive, machine, path string, offset int64, data []byte) error {
return tooOld(r.callNode(ctx, "write_file", callParams{Drive: drive, Machine: machine, Path: path, Offset: offset, Data: data}, nil))
}
func tooOld(err error) error {
if err != nil && strings.HasPrefix(err.Error(), "unknown call ") {
return node.ErrTooOld
}
return err
}
func (r *Remote) DialAgent(ctx context.Context, machine, secret string) (node.MsgConn, error) {
l, err := r.currentLink()
if err != nil {
@@ -708,6 +725,10 @@ type callParams struct {
Max int `json:"max,omitempty"`
Data []byte `json:"data,omitempty"`
EOF bool `json:"eof,omitempty"`
Path string `json:"path,omitempty"`
Offset int64 `json:"offset,omitempty"`
FileSize int64 `json:"file_size,omitempty"`
}
func serveCall(ctx context.Context, l *link, local node.Node, f frame) {
@@ -751,6 +772,11 @@ func serveCall(ctx context.Context, l *link, local node.Node, f frame) {
l.reply(f.ID, nil, local.AbortImport(ctx, p.ID))
case "delete_home":
l.reply(f.ID, nil, local.DeleteHome(ctx, p.Drive, p.Machine))
case "read_file":
data, size, err := local.ReadFile(ctx, p.Drive, p.Machine, p.Path, p.Offset, min(p.Max, transferChunk))
l.reply(f.ID, callParams{Data: data, FileSize: size}, err)
case "write_file":
l.reply(f.ID, nil, local.WriteFile(ctx, p.Drive, p.Machine, p.Path, p.Offset, p.Data))
case "open_agent":
agent, err := local.DialAgent(ctx, p.Machine, p.Secret)
if err != nil {
+89
View File
@@ -0,0 +1,89 @@
package manager
import (
"context"
"errors"
"fmt"
"io"
"path"
"strings"
"slackerbot/internal/model"
)
var ErrFileTooBig = errors.New("the file is bigger than allowed")
// homeRel turns a path inside the container (/root/…) into one relative to the home folder.
func (m *Manager) homeRel(p string) (string, error) {
home := path.Clean(m.cfg.AgentCwd)
if !path.IsAbs(p) {
p = path.Join(home, p)
}
p = path.Clean(p)
rel := strings.TrimPrefix(p, home+"/")
if rel == p || rel == "" {
return "", fmt.Errorf("%s isn't inside %s", p, home)
}
return rel, nil
}
// ReadFile streams a file from the owner's home into w, at most maxBytes.
func (m *Manager) ReadFile(ctx context.Context, u *model.Owner, p string, maxBytes int64, w io.Writer) (int64, error) {
rel, err := m.homeRel(p)
if err != nil {
return 0, err
}
n, err := m.nodeByName(u.Node)
if err != nil {
return 0, err
}
var off int64
for {
data, size, err := n.ReadFile(ctx, u.Drive, u.Machine, rel, off, transferChunk)
if err != nil {
return off, err
}
if size > maxBytes {
return off, ErrFileTooBig
}
if _, err := w.Write(data); err != nil {
return off, err
}
off += int64(len(data))
if len(data) == 0 || off >= size {
return off, nil
}
}
}
// WriteFile streams r into a file in the owner's home, giving up past maxBytes.
func (m *Manager) WriteFile(ctx context.Context, u *model.Owner, p string, maxBytes int64, r io.Reader) error {
rel, err := m.homeRel(p)
if err != nil {
return err
}
n, err := m.nodeByName(u.Node)
if err != nil {
return err
}
buf := make([]byte, transferChunk)
var off int64
for {
k, rerr := io.ReadFull(r, buf)
if k > 0 || off == 0 {
if off+int64(k) > maxBytes {
return ErrFileTooBig
}
if err := n.WriteFile(ctx, u.Drive, u.Machine, rel, off, buf[:k]); err != nil {
return err
}
off += int64(k)
}
if errors.Is(rerr, io.EOF) || errors.Is(rerr, io.ErrUnexpectedEOF) {
return nil
}
if rerr != nil {
return rerr
}
}
}
+37
View File
@@ -0,0 +1,37 @@
package manager_test
import (
"bytes"
"errors"
"testing"
"slackerbot/internal/manager"
"slackerbot/internal/model"
"slackerbot/internal/testutil"
"slackerbot/internal/testutil/clustertest"
)
func TestFilesThroughSlave(t *testing.T) {
c := clustertest.New(t)
c.Cfg.AgentCwd = "/root"
u := &model.Owner{ID: "C1", Machine: "c-c1", Node: "slave-1", Drive: "/d"}
data := testutil.HomeData()
if err := c.Mgr.WriteFile(c.Ctx, u, "/root/slack-uploads/1.0/big.bin", 100<<20, bytes.NewReader(data)); err != nil {
t.Fatal(err)
}
if got := c.Slave.Files["/d/c-c1/slack-uploads/1.0/big.bin"]; !bytes.Equal(got, data) {
t.Fatalf("slave got %d bytes, want %d", len(got), len(data))
}
var out bytes.Buffer
if n, err := c.Mgr.ReadFile(c.Ctx, u, "/root/slack-uploads/1.0/big.bin", 100<<20, &out); err != nil || n != int64(len(data)) || !bytes.Equal(out.Bytes(), data) {
t.Fatalf("read back %d bytes: %v", n, err)
}
if _, err := c.Mgr.ReadFile(c.Ctx, u, "/root/slack-uploads/1.0/big.bin", 1<<20, &out); !errors.Is(err, manager.ErrFileTooBig) {
t.Fatalf("over the cap: %v", err)
}
if _, err := c.Mgr.ReadFile(c.Ctx, u, "/etc/passwd", 100<<20, &out); err == nil {
t.Fatal("paths outside the home must be refused")
}
}
+8
View File
@@ -2,6 +2,7 @@ package node
import (
"context"
"errors"
"fmt"
"net/http"
"time"
@@ -32,8 +33,15 @@ type Node interface {
FinishImport(ctx context.Context, id string, quotaMB int64) error
AbortImport(ctx context.Context, id string) error
DeleteHome(ctx context.Context, drive, machine string) error
// Paths are relative to the home folder.
ReadFile(ctx context.Context, drive, machine, path string, offset int64, limit int) (data []byte, size int64, err error)
WriteFile(ctx context.Context, drive, machine, path string, offset int64, data []byte) error
}
// Returned when a node runs an older version that doesn't know a call.
var ErrTooOld = errors.New("this node runs an older version")
type NodeInfo struct {
Name string `json:"name"`
Version string `json:"version,omitempty"`
+24 -1
View File
@@ -21,6 +21,7 @@ type FakeNode struct {
Runs map[string]bool
Last node.StartSpec
Homes map[string][]byte
Files map[string][]byte
Exports map[string]*fakeExport
Imports map[string]*fakeImport
Passes int
@@ -30,7 +31,7 @@ type FakeNode struct {
}
func NewFakeNode(name string) *FakeNode {
return &FakeNode{name: name, Runs: map[string]bool{}, Homes: map[string][]byte{},
return &FakeNode{name: name, Runs: map[string]bool{}, Homes: map[string][]byte{}, Files: map[string][]byte{},
Exports: map[string]*fakeExport{}, Imports: map[string]*fakeImport{}, Usable: model.Size{MemoryMB: 8192, CPUs: 4}}
}
@@ -188,6 +189,28 @@ func (f *FakeNode) DeleteHome(_ context.Context, drive, machine string) error {
return nil
}
func (f *FakeNode) ReadFile(_ context.Context, drive, machine, path string, offset int64, limit int) ([]byte, int64, error) {
f.Mu.Lock()
defer f.Mu.Unlock()
data, ok := f.Files[drive+"/"+machine+"/"+path]
if !ok {
return nil, 0, errors.New("there's no file " + path)
}
end := min(int64(len(data)), offset+int64(limit))
return data[offset:end], int64(len(data)), nil
}
func (f *FakeNode) WriteFile(_ context.Context, drive, machine, path string, offset int64, data []byte) error {
f.Mu.Lock()
defer f.Mu.Unlock()
key := drive + "/" + machine + "/" + path
if offset == 0 {
f.Files[key] = nil
}
f.Files[key] = append(f.Files[key], data...)
return nil
}
type fakeExport struct {
data []byte
pos int
+137
View File
@@ -0,0 +1,137 @@
// Package tools is the stdio MCP server that runs inside each container.
// Its tools only check their input; the bot sees the calls over ACP and does the work.
package tools
import (
"bufio"
"encoding/json"
"fmt"
"io"
"os"
"path/filepath"
"strings"
)
const (
ServerName = "slackerbot"
SendFile = "send_file"
)
const sendFileHelp = "Send a file to the user in Slack: images, videos, PDFs, archives, reports or anything else " +
"they should see or download. Prefer it to pasting long output. The file must be under %s and at most %d MB. " +
"It's uploaded into the conversation when your turn ends, so mention it in your reply. " +
"At most a few files per turn."
type Server struct {
Home string
MaxMB int64
}
type msg struct {
JSONRPC string `json:"jsonrpc"`
ID json.RawMessage `json:"id,omitempty"`
Method string `json:"method,omitempty"`
Params json.RawMessage `json:"params,omitempty"`
Result any `json:"result,omitempty"`
Error *rpcError `json:"error,omitempty"`
}
type rpcError struct {
Code int `json:"code"`
Message string `json:"message"`
}
func (s *Server) Serve(in io.Reader, out io.Writer) error {
sc := bufio.NewScanner(in)
sc.Buffer(make([]byte, 1<<20), 16<<20)
enc := json.NewEncoder(out)
for sc.Scan() {
var m msg
if json.Unmarshal(sc.Bytes(), &m) != nil || len(m.ID) == 0 {
continue
}
reply := msg{JSONRPC: "2.0", ID: m.ID}
reply.Result, reply.Error = s.handle(m)
if err := enc.Encode(reply); err != nil {
return err
}
}
return sc.Err()
}
func (s *Server) handle(m msg) (any, *rpcError) {
switch m.Method {
case "initialize":
var p struct {
ProtocolVersion string `json:"protocolVersion"`
}
_ = json.Unmarshal(m.Params, &p)
return map[string]any{
"protocolVersion": p.ProtocolVersion,
"capabilities": map[string]any{"tools": map[string]any{}},
"serverInfo": map[string]string{"name": ServerName, "version": "1"},
}, nil
case "ping":
return map[string]any{}, nil
case "tools/list":
return map[string]any{"tools": []any{map[string]any{
"name": SendFile,
"description": fmt.Sprintf(sendFileHelp, s.Home, s.MaxMB),
"inputSchema": map[string]any{
"type": "object",
"properties": map[string]any{
"path": map[string]string{"type": "string", "description": "Path of the file, e.g. " + s.Home + "/out/chart.png"},
"comment": map[string]string{"type": "string", "description": "Optional message posted with the file"},
},
"required": []string{"path"},
},
}}}, nil
case "tools/call":
var p struct {
Name string `json:"name"`
Arguments struct {
Path string `json:"path"`
} `json:"arguments"`
}
_ = json.Unmarshal(m.Params, &p)
if p.Name != SendFile {
return nil, &rpcError{-32602, "unknown tool " + p.Name}
}
text, isErr := "queued", false
if err := s.Check(p.Arguments.Path); err != nil {
text, isErr = err.Error(), true
}
return map[string]any{"content": []any{map[string]string{"type": "text", "text": text}}, "isError": isErr}, nil
}
return nil, &rpcError{-32601, "method not found: " + m.Method}
}
func (s *Server) Check(path string) error {
if path == "" {
return fmt.Errorf("path is required")
}
if !filepath.IsAbs(path) {
path = filepath.Join(s.Home, path)
}
real, err := filepath.EvalSymlinks(path)
if err != nil {
return fmt.Errorf("can't find %s", path)
}
if !strings.HasPrefix(real, filepath.Clean(s.Home)+"/") {
return fmt.Errorf("%s isn't under %s; copy it there first", path, s.Home)
}
st, err := os.Stat(real)
if err != nil {
return err
}
if !st.Mode().IsRegular() {
return fmt.Errorf("%s isn't a regular file (zip a folder first)", path)
}
if st.Size() == 0 {
return fmt.Errorf("%s is empty", path)
}
if st.Size() > s.MaxMB<<20 {
return fmt.Errorf("%s is %d MB, over the %d MB limit", path, st.Size()>>20, s.MaxMB)
}
return nil
}
+51
View File
@@ -0,0 +1,51 @@
package tools
import (
"bytes"
"encoding/json"
"os"
"path/filepath"
"strings"
"testing"
)
func TestSendFileTool(t *testing.T) {
home := t.TempDir()
os.WriteFile(filepath.Join(home, "chart.png"), []byte("png"), 0o644)
os.Mkdir(filepath.Join(home, "dir"), 0o755)
os.Symlink("/etc/passwd", filepath.Join(home, "escape"))
s := &Server{Home: home, MaxMB: 1}
call := func(path string) string {
return `{"jsonrpc":"2.0","id":2,"method":"tools/call","params":{"name":"send_file","arguments":{"path":"` + path + `"}}}`
}
in := strings.Join([]string{
`{"jsonrpc":"2.0","id":1,"method":"initialize","params":{"protocolVersion":"2025-06-18"}}`,
`{"jsonrpc":"2.0","method":"notifications/initialized"}`,
call("chart.png"), call(home + "/dir"), call(home + "/escape"), call("missing"),
}, "\n")
var out bytes.Buffer
if err := s.Serve(strings.NewReader(in), &out); err != nil {
t.Fatal(err)
}
lines := strings.Split(strings.TrimSpace(out.String()), "\n")
if len(lines) != 5 || !strings.Contains(lines[0], `"protocolVersion":"2025-06-18"`) {
t.Fatalf("replies: %v", lines)
}
want := []struct {
text string
isErr bool
}{{"queued", false}, {"regular file", true}, {"isn't under", true}, {"can't find", true}}
for i, w := range want {
var r struct {
Result struct {
Content []struct{ Text string }
IsError bool
}
}
_ = json.Unmarshal([]byte(lines[i+1]), &r)
if r.Result.IsError != w.isErr || !strings.Contains(r.Result.Content[0].Text, w.text) {
t.Fatalf("call %d: %s", i, lines[i+1])
}
}
}
+83
View File
@@ -0,0 +1,83 @@
package tools
import (
"encoding/json"
"flag"
"os"
"strconv"
"strings"
"sync"
"slackerbot/internal/acp"
)
// Installed by nix/container.nix.
const Command = "/run/current-system/sw/bin/slackerbot-tools"
// Main runs the server, for `slackerbot tools`.
func Main(args []string) error {
fs := flag.NewFlagSet("tools", flag.ExitOnError)
home := fs.String("home", "/root", "the folder files may be sent from")
maxMB := fs.Int64("max-file-mb", 100, "the largest file send_file accepts")
_ = fs.Parse(args)
s := &Server{Home: *home, MaxMB: *maxMB}
return s.Serve(os.Stdin, os.Stdout)
}
// Spec is how goose starts the server, passed in session/new and session/load.
func Spec(home string, maxMB int64) acp.MCPServer {
return acp.MCPServer{
Name: ServerName,
Command: Command,
Args: []string{"tools", "-home", home, "-max-file-mb", strconv.FormatInt(maxMB, 10)},
Env: []any{},
}
}
type FileRequest struct {
Path string `json:"path"`
Comment string `json:"comment"`
}
// Calls watches a turn's ACP updates and collects send_file calls that completed.
type Calls struct {
mu sync.Mutex
pending map[string]FileRequest
done []FileRequest
}
func isSendFile(u acp.Update) bool {
return u.ToolName == ServerName+"__"+SendFile ||
strings.HasPrefix(u.Title, ServerName+": "+strings.ReplaceAll(SendFile, "_", " "))
}
func (c *Calls) Update(u acp.Update) {
c.mu.Lock()
defer c.mu.Unlock()
switch u.Kind {
case "tool_call":
var req FileRequest
if u.ToolID == "" || !isSendFile(u) || json.Unmarshal(u.RawInput, &req) != nil || req.Path == "" {
return
}
if c.pending == nil {
c.pending = map[string]FileRequest{}
}
c.pending[u.ToolID] = req
case "tool_call_update":
req, ok := c.pending[u.ToolID]
if !ok || u.Status != "completed" && u.Status != "failed" {
return
}
delete(c.pending, u.ToolID)
if u.Status == "completed" {
c.done = append(c.done, req)
}
}
}
func (c *Calls) Files() []FileRequest {
c.mu.Lock()
defer c.mu.Unlock()
return c.done
}
+24
View File
@@ -0,0 +1,24 @@
package tools
import (
"encoding/json"
"testing"
"slackerbot/internal/acp"
)
func TestCallsCollectsCompletedSends(t *testing.T) {
var c Calls
in := json.RawMessage(`{"path":"/root/a.png","comment":"here"}`)
c.Update(acp.Update{Kind: "tool_call", ToolID: "1", ToolName: "slackerbot__send_file", RawInput: in})
c.Update(acp.Update{Kind: "tool_call", ToolID: "2", Title: "slackerbot: send file · /root/b.zip", RawInput: json.RawMessage(`{"path":"/root/b.zip"}`)})
c.Update(acp.Update{Kind: "tool_call", ToolID: "3", ToolName: "developer__shell", RawInput: json.RawMessage(`{"path":"/root/x"}`)})
c.Update(acp.Update{Kind: "tool_call_update", ToolID: "1", Status: "completed"})
c.Update(acp.Update{Kind: "tool_call_update", ToolID: "2", Status: "failed"})
c.Update(acp.Update{Kind: "tool_call_update", ToolID: "3", Status: "completed"})
got := c.Files()
if len(got) != 1 || got[0].Path != "/root/a.png" || got[0].Comment != "here" {
t.Fatalf("got %+v", got)
}
}
+7
View File
@@ -15,6 +15,7 @@ import (
"slackerbot/internal/local"
"slackerbot/internal/manager"
"slackerbot/internal/state"
"slackerbot/internal/tools"
)
var version = "dev"
@@ -23,6 +24,12 @@ func main() {
cfgPath := flag.String("config", "/etc/slackerbot/config.toml", "path to the config file")
mode := flag.String("mode", config.ModeMaster, "master (runs the Slack bot) or slave (runs containers for a master)")
showVersion := flag.Bool("version", false, "print the version and exit")
if len(os.Args) > 1 && os.Args[1] == "tools" {
if err := tools.Main(os.Args[2:]); err != nil {
log.Fatal(err)
}
return
}
flag.Parse()
if *showVersion {
+9
View File
@@ -0,0 +1,9 @@
#!/usr/bin/env bash
set -euo pipefail
date=$(git log -1 --format=%cd --date=format:%Y.%m.%d)
rev=$(git rev-parse --short=7 HEAD)
if [[ -n $(git status --porcelain) ]]; then
rev="$rev-dirty"
fi
echo "STABLE_VERSION $date-$rev"