Agents · Intermediate · runnable fixture source
Draft freely. Send with approval.
Follow one contract boundary through a workflow and an in-memory MCP transport.
@lssm-tech/example.draft-and-send-agent · MCP and workflow source inspected · evidence as of 2026-10-27
Source context
MCP and workflow source inspected · b67c376f
Pinned source links require repository access; publication and anonymous package availability were not checked for this example.
A reference agent drafts a message, waits for approval, and invokes sendMessage. The MCP smoke test uses a real MCP server and client over an in-memory transport. The actual handlers remain deterministic fixture logic.
What you will learn
- Separate an automation-safe draft from an approval-required action.
- Expose an existing operation registry through MCP.
- Check valid, absent, and tampered receipt cases without a live messaging provider.
AN INTERACTIVE READING MAP
Walk through this example.
Step through the maintained source review, inspect its evidence boundaries, or assemble an adaptation packet.
SOURCE WALKTHROUGH
Read the operation in its authored order
01 / IN FOCUS
Separate the two operations
The source defines draftAndSend.draftMessage and draftAndSend.sendMessage. Drafting is automation-safe; sending declares its approval requirement.
1 / 4
0 points in your packet
Walk through the source
- Separate the two operations. The source defines draftAndSend.draftMessage and draftAndSend.sendMessage. Drafting is automation-safe; sending declares its approval requirement.
- Inspect the workflow. The example connects draft, approval wait, send, and receipt stages through the WorkflowDevkit adapter. This is a composed reference flow, not an invitation feature in the minimal starter.
- Inspect the MCP boundary. The smoke test registers the operation registry as MCP tools, then calls sendMessage with valid, absent, and tampered receipt evidence. It expects success only for the valid case.
- Read what send actually does. The bound handler derives a message ID and returns status sent in memory. To send through a real provider, supply your own port and preserve the same execution boundary.
What this review establishes
- The source smoke fixture drives a real MCP server/client over linked in-memory transports.
- The fixture asserts APPROVAL_REQUIRED for missing and tampered receipts.
- The same registry gate is used by the MCP adapter rather than a second hand-written approval path.
Not established
- Delivery of a Slack message, email, invitation, or other network request.
- A fresh successful run or production human approval system.
- That the minimal example includes MCP; this is a separate source package.
Before adapting
- Access to the inspected source repository and a checkout at the cited revision.
- The repository's Bun workspace dependencies and required generated package exports. These instructions were inspected; the examples were not executed in this review.
Adapt the pattern
- Bind the side-effecting operation to your own provider port.
- Issue approval evidence through a trusted application flow.
- Test changed input, absent evidence, and rejected evidence before real delivery.
- declaredStability
- beta in package manifest
- registry
- Source package exists; absent from inspected generated registry
- inlinePreview
- Not registered
- execution
- Not rerun
- production
- Not assessed