Macro is a unified workspace for teams: email, chat, docs, tasks, agents, calls, and CRM — @-linked together with shared AI memory.
Code-mode SDK bundle
Scope
Packages the public Macro SDK and Handlebars for restricted Deno execution and
builds the agent documentation catalog. Canonical TypeDoc rendering and the
HTML worker belong to packages/sdk-docs.
Start here
scripts/generate.ts: builds the Deno bundles and backend documentation into the directory it is given;crates/code_mode_assetsruns it at build time.scripts/typedoc.ts: index each entity and split linked Markdown into per-symbol references (classes, methods, types). A discriminated union over the 16 KiB reference size, such asEditOp, lists its members, each read asEditOp.<discriminator>.scripts/catalog.ts: the entity directories agents discover, one entity each. Never fold an area into another to save room: Jev routes the catalog in parallel 32-question calls, so its size is not capped.- Each entity's description is its one
@routingsentence ("Use when …; not …") and itsguideevery@agentblock, both from the SDK's TSDoc and collected bypackages/sdk-docs/src/render.ts. Generation fails for an entity without exactly one@routingsentence, or a tag outside every entity. Agents route on the sentence; the guide is how that area works, inlined into unrouted prompts and loaded with the entity on routed turns. src/index.ts: public SDK exports used by programs.
Tool contracts
- External chat sends/uploads use only the credential owner's connection and accept their session or own API token (including signed agent attribution); bots never send. Pairing and account/access controls require the person's session.
Checks
Run root
just checkfor formatting; CodeMode usesapps/web/biome.jsonc, while the standalone SDK has its own formatter.bun run type-checkandbun run test(generates into ignoreddist/first).cargo test -p code_execution -- --include-ignoredruns the bundle in Deno.
Run from this directory after installing the root workspace and the standalone
packages/sdk dependencies with bun install --frozen-lockfile, as CI does;
the generator refuses to run without packages/sdk/node_modules.
Gotchas
- The outputs are never committed. A new file the generator reads must be added
to
GENERATOR_INPUTSincrates/code_mode_assets/build.rsand tocodeModeAssetsSrcinnix/cloud-storage.nix.