Macro is a unified workspace for teams: email, chat, docs, tasks, agents, calls, and CRM — @-linked together with shared AI memory.
TypeScript agentaiai-agentsall-in-onecrmcrm-systememaillinearmcpmessagingnotesnotionofficerustslackslack-alternativestartupstartup-toolstypescriptworkspace
jev
What it is
Belongs to automations: yes/no classification of arbitrary JSON against a list of questions, backed by a System One decision model (TypeSafe's Jev or Cloudflare Workers AI's Clef Flash), with usage metering built in — used to gate scheduled-action triggers, to serve authenticated named decisions through cognition, and to pick Chat or Code for the agent composer's Auto mode.
Start here
src/domain/service.rs:JevClassifier— the metered classification use case; wraps aJevProviderand records token usage on every call.src/domain/decisions.rs: named decision admission, capacity, deadline and cancellation-safe metering (decisionsfeature).src/domain/ports.rs:JevProvider/YesNoClassifierport traits.src/domain/batches.rs(batchesfeature):decide_in_batches, the one way to ask more than 32 questions: parallel requests of at most 32 under one deadline, answers typed and in question order, a late or failed request losing only its own questions. Skill and SDK entity routing use it throughcognition; never chunk questions in a caller.src/outbound/system_one.rs:SystemOneJev, the HTTP adapter for TypeSafe and Cloudflare Workers AI (featureoutbound).
Scope
- Owns: the question/probability value objects, the
MAX_QUESTIONSguard, and metering every classification call throughai_usage::UsageRecorder. - Not here: the providers' API contracts themselves, or deciding what questions to ask — that belongs to the caller (trigger logic or an API request).
Boundaries
- Depends on:
ai_usage(usage metering);outboundfeature addsmacro_env_var,reqwest,tokio. - Used by:
scheduled_action(trigger conditions),document_cognition_service(the/decisionsendpoint),agent_harness(Auto mode choice, Clef Flash),agent_session(whether to retitle a session after a turn, TypeSafe),agent_trigger(routing unmentioned thread replies to agent sessions).
Checks
cargo test -p jev --all-features(SQLX_OFFLINEunset).
Gotchas
classifyrecords usage even when the provider's answer count doesn't match the question count — the call was billed regardless of whether the response is usable; don't skip metering on a validation failure path.- System One models have no prompt cache, so every input token reports as uncached.
- Cloudflare wraps answers in
{"result": ...}; TypeSafe returns them bare.
Related
- Rules:
.agents/rules/rust/architecture.md(CS-51/CS-52 hexagonal layering)