
bundlebox
io.github.blackswanalpha由 GitHub 帳號 blackswanalpha 發布v0.8.0更新於 Oct 24, 2026
Where the work is, packed before the agent reads: brief, symbol tables, findings, token bill.
概覽
本機 MCP 伺服器,為編碼代理提供預先產生的任務簡報、符號查詢、掃描發現與權杖用量統計。
- 可以做什麼
- 為任務或未解決的發現產生定位、引用並受預算限制的簡報,並可將其中一份設為守衛回應所用的作用中簡報,另提供範圍或工作區的上下文與監督摘要,以及工作階段開始前的權杖成本估算。在編譯好的符號表中查詢宣告,並用偵測器掃描程式樹,再讀取產生的發現與解釋。報告某次工作階段實際使用和節省的權杖,依工作階段紀錄測量。掃描、打包和路由預設以試執行方式進行,只有 run 和 bridge send 會實際花費。
- 適用情境
- 當你用 AI 編碼代理處理較大的程式庫,希望減少其在定位和熟悉程式碼上消耗的權杖時適用:查找符號位置、確認變更內容、把工作打包成適合上下文視窗的單元。也適合需要對代理工作階段做權杖計量和驗收檢查的情境。
- 執行需求
- 以 npm 套件 bundlebox 透過 stdio 在本機執行(npx bundlebox mcp)。需要 Node 20 或更新版本以及 git;支援 Linux、macOS 和 Windows。可選的 Rust 核心與索引元件以及 Python 3.9+ 專家系統可提升速度,但並非必要。未宣告任何 API 金鑰或環境變數。
安裝
在 SourceWeft 中
- 開啟 儀表板中的 bundlebox,將其新增到工作區。
- 為需要使用其工具的對話啟用該服務。
Desktop only,透過 STDIO。 STDIO 服務會啟動本機處理程序,因此需要 SourceWeft 桌面主機。
其他 MCP 客戶端
參照 儲存庫 中的啟動說明。
README
bundlebox
The zero-token software factory for AI coding agents.
Scan, pack, route and run work across Claude Code, Codex, Gemini CLI, Cursor, Copilot, OpenCode, Aider and any custom agent, and measure every token a session used and was spared.
An AI coding agent is billed for what it reads, and most of what it reads is orientation, not judgement: where a symbol lives, whether two tables agree, which command proves a change, what changed since last week. bundlebox answers every question a parse, a count, a path check or a set difference can answer before the agent opens, packs the answers into a brief sized to the agent's window, opens the agent under a measured-minimal flag stack, and measures afterwards what the session used and what it was spared. It never calls a model itself.
Measured on the reference workspace (regenerate with bb session, bb tokens profile --probe, bb buckmaster episodes):
Install
Needs Node ≥ 20 and git. Linux, macOS and Windows are supported: CI runs the full suite on all three against Node 20, 22 and 24. Two known gaps remain on Windows — a piped acceptance gate reports the last command's exit code rather than the first failure, because cmd.exe has no set -o pipefail (unpiped gates are exact), and bb session may not find transcripts, because the name Claude Code gives its projects directory there has not been verified. Three optional Rust and Python components make it faster and smarter, and
everything degrades cleanly without them:
- Rust kernel (
bbk): tree walks, fingerprints, token estimates, duplicate windows, symbol indexes, acceptance gates with real timeouts, worktrees.bb kernel installfetches a release binary;bb kernel buildcompiles it with cargo. Without it the JS implementations run, and a selftest pins both to identical answers. - Rust index compiler (
arc): compiles the derived symbol tables into one binary index the read and search guards answer from, 13x faster than scanning the tables in a cold hook process.bb arc build, recompiled bybb snapgen buildwhen the tables move. Every reader falls back to scanning the tables when the index is absent, truncated or not an index, because "there is no index" and "nothing is declared" are different answers. - Python expert system (
bundlebox_expert, stdlib only): the rule engine with explainable derivations, confidence shrinkage, transcript signals, the process model and memory.bb buckmasterneeds python3 ≥ 3.9; nothing in the zero-token path does.
There are no npm dependencies. A cron worker at 03:00 runs what is on disk or it does not run.
Start here
From a document instead of from the code:
Every verb is a dry run until --apply. Only run and bridge send can spend.
Wiring into agents
bb wire --apply installs four things per agent detected on the box: an
instruction block between markers, hooks where the agent supports them, skills
where it loads them, and an MCP server entry. bb unwire removes only its own
blocks, entries, hook rows and skills.
Two skills ship and cost nothing until they trigger, which is the property an
instruction block does not have: it arrives in every system prompt and is billed
whether the session was about it or not. bb-finish is completion discipline
backed by runnable gates; antislop is the prose ruleset with what each rule
costs and what to write instead.
bb mcp serves bb_pinpoint, bb_context, bb_snapgen, bb_findings,
bb_scan, bb_oversight_brief, bb_explain, bb_tokens_estimate and
bb_session over stdio as JSON-RPC 2.0, with no dependency.
bb wire --apply writes the entry for every agent in the table above. For an
agent it does not manage:
Claude Code takes it as one line, or as a plugin, which carries the two skills and the hooks with it:
Full guide, including the agents not in this table, how to wire one bundlebox
does not know about, and how to drive agents as lanes:
docs/agents.md. bb uptake then reports which of the
installed surfaces the sessions reached for.
Advisory lost; enforcement is the fix
bb uptake measured the gap. Over 15 sessions on this workspace the MCP tools
fired in 0, pinpoint in 3 of the 13 sessions that opened five or more distinct
files, and the reference tables in 5 of the 15 that ran a search. Those 13
sessions opened between 30 and 598 files each. Everything wired in front of the
agent was a recommendation, and a recommendation loses to the model's own habit
about three times in four.
So the wiring changed kind.
Run it, do not recommend it. UserPromptSubmit builds the brief itself on a
task-shaped prompt — 0.47s against a 15s budget, because every input pinpoint
reads is a stored artefact and it computes none of them. What enters the window
is the map, about 300 tokens.
Serve what it found. PreToolUse denies a read whose region the brief already quotes and hands the quote back in the denial reason; denies an exact duplicate read; denies a declaration search the symbol tables already answer and hands back the rows; and asks before opening a file that was cut for budget. A file in scope is never fully blocked — Claude Code needs one successful read before it will edit, so the denial names the range and that read is allowed. Grep is the declared tool and Bash is where the measured transcripts search, so both are guarded.
Rank on specificity and path. Enforcing a brief raises the cost of a bad
locate. Inverse document frequency over the candidate set stops an exact match on
a name the tree uses everywhere from outscoring a loose match on a rare one, and
a directory named wire now counts as evidence about what a file is for. An
explicitly named file is pinned first rather than scored.
The verbs
The budget model
Overhead is probed, not assumed. Payload is the located region plus a widening
allowance when a symbol is named, not the file. Churn is the term everyone
forgets and it measures near 2.4. Reserve is per kind of unit. The verdict is
FITS, TIGHT, SPLIT or HEAVY, and a split respects directory locality.
Five levers act on those terms, in measured order: the lean flag stack, region
not file, say it once, a cache-stable prefix, and optionally a local compression
proxy on the wire reported on its own row. See EXPLANATION.md.
Measured vs estimated
Two kinds of number appear in every report and are never added: used and
cache-saved are measured off the transcript; automation-saved is an estimate
printed as a range. A model with no price is reported with tokens and no cost.
A verb that could not look says unknown. A unit with no acceptance is
unproven, not passed.
There is a third number and it is measured on both sides. bb bench runs the
same task twice — once with the factory in front of it and once without — and
reports the difference:
BARE greps the tree for the task's terms, reads the search output and opens a
range around the first hit in each of the top files, which is what a session
does on a box where nothing is installed. PACKED is the
one bb pinpoint prompt for the same task. Both arms are counted by the same
estimator over text on disk, so neither calls a model and a second run on the
same tree returns the same number. A task that costs more packed than bare is
printed in the table, not dropped.
Every bb pinpoint brief carries one more section, and it is the one worth
reading first: what this brief does not settle. No gate detected, nothing in
the symbol tables matched, no region located, no evidence on file, a scope that
had to be cut to fit — each is stated with its reason rather than filled in by
guessing, and scored so two briefs can be compared. A question costs one turn;
a wrong assumption costs the review that catches it.
The console
bb console serves one read-only page for the workspace on
127.0.0.1:7788, and bb console build writes the same page as a single
file with the state embedded. It binds to loopback, has no write route, and
nothing on it calls a model.
It pushes rather than polls. The store is files, so the filesystem already
knows when something changed: /api/stream watches it, recomputes the state
once per change however many tabs are open, and sends it. A 10s timer was wrong
in both directions — a run that finished was invisible for nine seconds, and an
idle workspace recomputed everything six times a minute per open tab. The header
always says which state the connection is in (live, polling,
reconnecting, static), because a dashboard that cannot tell you it has lost
the server is worse than one that is plainly offline: the stale numbers still
look like numbers.
Architecture
The kernel runs a corpus on threads with one connection per worker and a shared
pacer; a 130-step corpus that takes two minutes paced against a real limiter
takes under a second against a local mirror. It speaks http only, because TLS
would be a dependency it must build without — the JavaScript engine runs when
the base is https, when the kernel is absent, or when a corpus uses a pattern
outside the kernel's documented subset, and the board names which engine ran and
why. test/scenario.test.js pins the two to identical answers.
The three runtimes agree by test: test/kernel.test.js and
test/expert.test.js pin the kernel and the expert system to the JS answers.
One implementation per fact where only one runtime has it; parity where two do.
Configuration
One file, .bundlebox/config.json, holding only the keys you changed. Every
default lives in src/core/config.js with its reason. Measured values live in
.bundlebox/var/calibration.json and are written by read-merge.
Documentation
- docs/agents.md: integrating bundlebox into every agent, and running work through them
- docs/index.html: the reference site
- EXPLANATION.md: the thesis, the flow, what changed from the original
- whitepaper/bundlebox-whitepaper.md
- docs/review-of-the-original.md: the defects found in the reference implementation
- docs/prices.md: price table provenance
- docs/prior-art.md: seven projects read, what came back and what did not
- CHANGELOG.md and changelogs/
- CONVENTIONS.md: how the code is organised, for contributors
Releases
Tags vX.Y.Z on main build the kernel for five targets, publish to npm with
provenance, and create a GitHub release with the binaries and the changelog.
bb update checks the registry at most once a day; bb update --apply installs.
License
MIT. src/finish/vendor/ is vendored from
Leonxlnx/unlazy 2.1.0 (MIT, commit
1667149), renamed and otherwise untouched;
src/finish/vendor/PROVENANCE.md records every
rename and why nothing else moved. bundlebox began as a stdlib-Python factory wired into one workspace; this
package is its portable core, rebuilt and corrected. The optional wire
integration talks to headroom
over the process boundary and never imports it.
來源:README.md,提交 80415c2
工具
0版本歷史
2- v0.8.0最新Sep 23, 2026
- v0.7.1Sep 22, 2026
評分
已滿足適用檢查項的 50%
該評分衡量此收錄條目的完整程度,依據註冊中心條目、端點與公開來源計算得出。它不是對伺服器本身的評價,也不表示伺服器安全或目前可用:可連通性是帶日期的檢查結果,評分也不包含安裝量或使用者評價。
- 近 30 天內可連通25 分
請保持端點能夠回應 MCP 握手;SourceWeft 每 30 天探測一次。
- 已宣告認證方式10 分
請在註冊中心條目中宣告憑證請求標頭,或保持端點能夠回應探測,以便判定其認證方式。
- 已列出工具15 分
請讓伺服器在無憑證時回應 tools/list,或發布可在沙箱中無憑證啟動的軟體包。
- 描述必需15 分
- 圖示10 分
- 文件15 分
- 授權條款10 分