Skip to content

Repository files navigation

bb-plugin-attach-folder

Adds an Attach folder row to the Tendo composer's + menu. Picking a folder drops a single pill into the draft; when the message is sent, the plugin resolves that pill into agent-only context holding the folder's file manifest and the text of every file that fits the budget.

Why a pill and not project attachments

bb.sdk.projects.attachments.upload can move bytes into a project, but a plugin cannot add the resulting attachment to the draft the user is about to send: PluginComposerApi has no attachment writer and attachmentCount is read-only. An uploaded-but-unreferenced attachment is a silent no-op.

bb.ui.registerMentionProvider + composer.insertMention is the one plugin channel that survives to send time — and it resolves fresh when the message is actually sent, so edits made between attaching and sending are picked up.

The provider answers the ~ trigger, not @, and returns no typed search results. Tendo's native @ file/folder menu is untouched.

Menu position

The row sits directly under the native Attach files. Tendo's plugin API has no ordering control — ComposerPlusMenuItem carries no group or position field and the host renders plugin rows in a trailing group — so reposition.ts moves the row in the DOM once the menu opens, via the supported content-script surface.

It matches by visible label. If Tendo's menu markup changes and either anchor stops matching, nothing moves and the row stays where the host put it.

Limits

Configurable in Settings → Plugins → Attach Folder (Tendo plugin config attach-folder set <key> <value>, then Tendo plugin reload attach-folder):

Setting Default Meaning
maxFiles 200 Files considered per folder, alphabetically
maxFileBytes 200000 Largest single file inlined
maxTotalBytes 2000000 Total inlined content per folder

Fixed limits: the recursive listing is capped at 5000 entries by the host; .git, node_modules, dist, build, and similar vendor/build directories are never walked; known binary extensions and any file the host returns as base64 are listed but never inlined.

Nothing is dropped silently. Every excluded file appears in a Not included section of the context with its reason (binary, file too large, budget exhausted, over file cap, unreadable), the + menu shows a toast summarising counts and reasons, and a truncated host listing is called out in both places.

Not implemented

Drag-and-drop of a folder from Finder into the composer. Only the + menu path exists.

Inspect what would be sent

bb attach-folder show /absolute/path/to/folder [--host <hostId>]

Prints the exact context text the pill resolves to.

Development

npm install
npm run typecheck
npm test
bb plugin install .
bb plugin dev

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages