{"id":"@lssm-tech/example.draft-and-send-agent","slug":"example.draft-and-send-agent","name":"@lssm-tech/example.draft-and-send-agent","version":"3.0.4","path":"examples/draft-and-send-agent","manifestPath":"examples/draft-and-send-agent/package.json","manifestBlobSha":"1641626c57f337e166b0ec45c3fed9762dbe10ab","layer":"examples","physicalArea":null,"primaryArea":"examples-and-patterns","classification":{"privateDeclared":null,"catalogFamily":"solutions","catalogKind":"example","catalogStatus":"active","adoptionMode":"reference-only","stability":"stable"},"description":"CommunicationOS-shaped draft-and-send reference agent: draft a message, wait for approval, then send it through an approval-gated ContractSpec operation.","descriptionOrigin":"package.json","catalog":{"family":"solutions","kind":"example","status":"active","adoptionMode":"reference-only","stability":"stable","platforms":["server"],"runtimes":["node"],"entrypoints":[".","./agent/draft-and-send.agent","./contracts","./contracts/draft-message.operation","./contracts/send-message.operation","./example","./handlers","./handlers/draft-and-send.handlers","./workflow/draft-and-send.workflow"],"documentation":[{"title":"Example Draft And Send Agent documentation","url":"https://www.npmjs.com/package/%40lssm-tech%2Fexample.draft-and-send-agent","kind":"readme"}],"examples":[],"replacements":[],"nonAdoptableRationale":"This example is published for reference and learning, not as a reusable library dependency."},"canonicalImports":[],"scripts":{"build":"contractspec-bun-build build","build:bundle":"contractspec-bun-build transpile","build:types":"contractspec-bun-build types","dev":"contractspec-bun-build dev","clean":"rimraf dist .turbo","lint":"bun lint:fix","lint:fix":"node ../../scripts/biome.cjs check --write --unsafe --only=nursery/useSortedClasses . && node ../../scripts/biome.cjs check --write .","lint:check":"node ../../scripts/biome.cjs check .","test":"bun test","preflight":"bun run build && bun run typecheck && bun run test","prebuild":"contractspec-bun-build prebuild","typecheck":"tsgo --noEmit"},"scriptStatus":"complete pinned manifest","dependencies":{"@lssm-tech/lib.contracts-spec":"workspace:^","@lssm-tech/lib.schema":"workspace:^"},"devDependencies":{"@lssm-tech/integration.workflow-devkit":"workspace:*","@lssm-tech/lib.agent-runtime-conformance":"workspace:*","@lssm-tech/lib.contracts-runtime-core":"workspace:*","@lssm-tech/lib.contracts-runtime-server-mcp":"workspace:*","@lssm-tech/tool.bun":"workspace:*","@lssm-tech/tool.typescript":"workspace:*","@modelcontextprotocol/sdk":"catalog:ai","typescript":"catalog:"},"peerDependencies":{},"optionalDependencies":{},"peerDependenciesMeta":{},"bundledDependencies":null,"dependencyStatus":"complete pinned manifest","exports":{".":"./src/index.ts","./agent/draft-and-send.agent":"./src/agent/draft-and-send.agent.ts","./contracts":"./src/contracts/index.ts","./contracts/draft-message.operation":"./src/contracts/draft-message.operation.ts","./contracts/send-message.operation":"./src/contracts/send-message.operation.ts","./example":"./src/example.ts","./handlers":"./src/handlers/index.ts","./handlers/draft-and-send.handlers":"./src/handlers/draft-and-send.handlers.ts","./workflow/draft-and-send.workflow":"./src/workflow/draft-and-send.workflow.ts"},"publishExports":{".":{"types":"./dist/index.d.ts","browser":"./dist/browser/index.js","bun":"./dist/index.js","node":"./dist/node/index.js","default":"./dist/index.js"},"./agent/draft-and-send.agent":{"types":"./dist/agent/draft-and-send.agent.d.ts","browser":"./dist/browser/agent/draft-and-send.agent.js","bun":"./dist/agent/draft-and-send.agent.js","node":"./dist/node/agent/draft-and-send.agent.js","default":"./dist/agent/draft-and-send.agent.js"},"./contracts":{"types":"./dist/contracts/index.d.ts","browser":"./dist/browser/contracts/index.js","bun":"./dist/contracts/index.js","node":"./dist/node/contracts/index.js","default":"./dist/contracts/index.js"},"./contracts/draft-message.operation":{"types":"./dist/contracts/draft-message.operation.d.ts","browser":"./dist/browser/contracts/draft-message.operation.js","bun":"./dist/contracts/draft-message.operation.js","node":"./dist/node/contracts/draft-message.operation.js","default":"./dist/contracts/draft-message.operation.js"},"./contracts/send-message.operation":{"types":"./dist/contracts/send-message.operation.d.ts","browser":"./dist/browser/contracts/send-message.operation.js","bun":"./dist/contracts/send-message.operation.js","node":"./dist/node/contracts/send-message.operation.js","default":"./dist/contracts/send-message.operation.js"},"./example":{"types":"./dist/example.d.ts","browser":"./dist/browser/example.js","bun":"./dist/example.js","node":"./dist/node/example.js","default":"./dist/example.js"},"./handlers":{"types":"./dist/handlers/index.d.ts","browser":"./dist/browser/handlers/index.js","bun":"./dist/handlers/index.js","node":"./dist/node/handlers/index.js","default":"./dist/handlers/index.js"},"./handlers/draft-and-send.handlers":{"types":"./dist/handlers/draft-and-send.handlers.d.ts","browser":"./dist/browser/handlers/draft-and-send.handlers.js","bun":"./dist/handlers/draft-and-send.handlers.js","node":"./dist/node/handlers/draft-and-send.handlers.js","default":"./dist/handlers/draft-and-send.handlers.js"},"./workflow/draft-and-send.workflow":{"types":"./dist/workflow/draft-and-send.workflow.d.ts","browser":"./dist/browser/workflow/draft-and-send.workflow.js","bun":"./dist/workflow/draft-and-send.workflow.js","node":"./dist/node/workflow/draft-and-send.workflow.js","default":"./dist/workflow/draft-and-send.workflow.js"}},"types":"./dist/index.d.ts","files":["dist","README.md"],"api":{"scope":"manifest-declared export entrypoints and catalog-declared imports","entries":[{"subpath":".","importPath":"@lssm-tech/example.draft-and-send-agent","target":"./src/index.ts","targets":[{"conditions":[],"target":"./src/index.ts","sourcePath":"examples/draft-and-send-agent/src/index.ts","sourceUrl":"https://github.com/lssm-tech/contractspec/blob/bcc79fcc27c4d801c2119bef81ddcce7b4e86498/examples/draft-and-send-agent/src/index.ts","sourceStatus":"verified source file"}]},{"subpath":"./agent/draft-and-send.agent","importPath":"@lssm-tech/example.draft-and-send-agent/agent/draft-and-send.agent","target":"./src/agent/draft-and-send.agent.ts","targets":[{"conditions":[],"target":"./src/agent/draft-and-send.agent.ts","sourcePath":"examples/draft-and-send-agent/src/agent/draft-and-send.agent.ts","sourceUrl":"https://github.com/lssm-tech/contractspec/blob/bcc79fcc27c4d801c2119bef81ddcce7b4e86498/examples/draft-and-send-agent/src/agent/draft-and-send.agent.ts","sourceStatus":"verified source file"}]},{"subpath":"./contracts","importPath":"@lssm-tech/example.draft-and-send-agent/contracts","target":"./src/contracts/index.ts","targets":[{"conditions":[],"target":"./src/contracts/index.ts","sourcePath":"examples/draft-and-send-agent/src/contracts/index.ts","sourceUrl":"https://github.com/lssm-tech/contractspec/blob/bcc79fcc27c4d801c2119bef81ddcce7b4e86498/examples/draft-and-send-agent/src/contracts/index.ts","sourceStatus":"verified source file"}]},{"subpath":"./contracts/draft-message.operation","importPath":"@lssm-tech/example.draft-and-send-agent/contracts/draft-message.operation","target":"./src/contracts/draft-message.operation.ts","targets":[{"conditions":[],"target":"./src/contracts/draft-message.operation.ts","sourcePath":"examples/draft-and-send-agent/src/contracts/draft-message.operation.ts","sourceUrl":"https://github.com/lssm-tech/contractspec/blob/bcc79fcc27c4d801c2119bef81ddcce7b4e86498/examples/draft-and-send-agent/src/contracts/draft-message.operation.ts","sourceStatus":"verified source file"}]},{"subpath":"./contracts/send-message.operation","importPath":"@lssm-tech/example.draft-and-send-agent/contracts/send-message.operation","target":"./src/contracts/send-message.operation.ts","targets":[{"conditions":[],"target":"./src/contracts/send-message.operation.ts","sourcePath":"examples/draft-and-send-agent/src/contracts/send-message.operation.ts","sourceUrl":"https://github.com/lssm-tech/contractspec/blob/bcc79fcc27c4d801c2119bef81ddcce7b4e86498/examples/draft-and-send-agent/src/contracts/send-message.operation.ts","sourceStatus":"verified source file"}]},{"subpath":"./example","importPath":"@lssm-tech/example.draft-and-send-agent/example","target":"./src/example.ts","targets":[{"conditions":[],"target":"./src/example.ts","sourcePath":"examples/draft-and-send-agent/src/example.ts","sourceUrl":"https://github.com/lssm-tech/contractspec/blob/bcc79fcc27c4d801c2119bef81ddcce7b4e86498/examples/draft-and-send-agent/src/example.ts","sourceStatus":"verified source file"}]},{"subpath":"./handlers","importPath":"@lssm-tech/example.draft-and-send-agent/handlers","target":"./src/handlers/index.ts","targets":[{"conditions":[],"target":"./src/handlers/index.ts","sourcePath":"examples/draft-and-send-agent/src/handlers/index.ts","sourceUrl":"https://github.com/lssm-tech/contractspec/blob/bcc79fcc27c4d801c2119bef81ddcce7b4e86498/examples/draft-and-send-agent/src/handlers/index.ts","sourceStatus":"verified source file"}]},{"subpath":"./handlers/draft-and-send.handlers","importPath":"@lssm-tech/example.draft-and-send-agent/handlers/draft-and-send.handlers","target":"./src/handlers/draft-and-send.handlers.ts","targets":[{"conditions":[],"target":"./src/handlers/draft-and-send.handlers.ts","sourcePath":"examples/draft-and-send-agent/src/handlers/draft-and-send.handlers.ts","sourceUrl":"https://github.com/lssm-tech/contractspec/blob/bcc79fcc27c4d801c2119bef81ddcce7b4e86498/examples/draft-and-send-agent/src/handlers/draft-and-send.handlers.ts","sourceStatus":"verified source file"}]},{"subpath":"./workflow/draft-and-send.workflow","importPath":"@lssm-tech/example.draft-and-send-agent/workflow/draft-and-send.workflow","target":"./src/workflow/draft-and-send.workflow.ts","targets":[{"conditions":[],"target":"./src/workflow/draft-and-send.workflow.ts","sourcePath":"examples/draft-and-send-agent/src/workflow/draft-and-send.workflow.ts","sourceUrl":"https://github.com/lssm-tech/contractspec/blob/bcc79fcc27c4d801c2119bef81ddcce7b4e86498/examples/draft-and-send-agent/src/workflow/draft-and-send.workflow.ts","sourceStatus":"verified source file"}]}],"entryCount":9,"namedSymbolCoverage":"catalog declarations only; exhaustive TypeScript symbols not extracted","installationStatus":"not verified"},"docsLinks":[{"title":"Example Draft And Send Agent documentation","url":"https://www.npmjs.com/package/%40lssm-tech%2Fexample.draft-and-send-agent","kind":"readme","pinnedUrl":null,"sourceStatus":"declared link; destination not verified"}],"sourceUrls":{"package":"https://github.com/lssm-tech/contractspec/tree/bcc79fcc27c4d801c2119bef81ddcce7b4e86498/examples/draft-and-send-agent","manifest":"https://github.com/lssm-tech/contractspec/blob/bcc79fcc27c4d801c2119bef81ddcce7b4e86498/examples/draft-and-send-agent/package.json","readme":"https://github.com/lssm-tech/contractspec/blob/bcc79fcc27c4d801c2119bef81ddcce7b4e86498/examples/draft-and-send-agent/README.md","guide":"https://github.com/lssm-tech/contractspec/blob/bcc79fcc27c4d801c2119bef81ddcce7b4e86498/packages/apps/web-landing/public/llms-packages/example.draft-and-send-agent.txt"},"readme":{"status":"available","body":"# @lssm-tech/example.draft-and-send-agent\n\nCommunicationOS-shaped **draft-and-send reference agent** for ContractSpec.\n\nIt exercises exactly the primitives that already exist: approval-gated external\neffect (`execution.approval`) and draft-only-by-default agent tools\n(`automationSafe` / `requiresApproval`). The domain is intentionally trivial —\na message body plus a target channel — so no product-specific schema leaks into\ncore packages.\n\n## Surfaces\n\n- **`DraftAndSendAgent`** (`src/agent/draft-and-send.agent.ts`) — one `AgentSpec`\n  with a `draftMessage` tool (`operationRef`, automation-safe) and a\n  `sendMessage` tool (`operationRef`, `requiresApproval: true`).\n- **`DraftAndSendWorkflow`** (`src/workflow/draft-and-send.workflow.ts`) — one\n  `WorkflowSpec` wiring `draft → approval-wait → send → receipt`, executed\n  through the Workflow DevKit runtime adapter\n  (`runWorkflowSpecWithWorkflowDevkit`).\n- **Operations** (`src/contracts/`) — `draftAndSend.draftMessage` and the\n  approval-gated `draftAndSend.sendMessage`.\n- **`createDraftAndSendRegistry()`** (`src/handlers/`) — an\n  `OperationSpecRegistry` with both commands and trivial handlers bound.\n\n## Proof\n\n- `src/draft-and-send.workflow.test.ts` runs the full lifecycle through the\n  Workflow DevKit adapter, issuing a real approval receipt for the send step.\n- `src/mcp-smoke.test.ts` starts a real MCP server (`registerMcpTools`) over an\n  in-memory transport and drives one allowed `sendMessage` call plus denied\n  calls (missing / tampered receipt → `APPROVAL_REQUIRED`).\n\n```bash\nbun test\n```\n","sourcePath":"examples/draft-and-send-agent/README.md","sourceUrl":"https://github.com/lssm-tech/contractspec/blob/bcc79fcc27c4d801c2119bef81ddcce7b4e86498/examples/draft-and-send-agent/README.md","blobSha":"de251cf782de8e75ed0f7d67692a1a392a34e28d","sourcePin":"bcc79fcc27c4d801c2119bef81ddcce7b4e86498","origin":"README recovered byte-for-byte from pinned aggregate guide","integrity":"exact Git blob match","executionStatus":"not executed"},"provenance":{"repository":"lssm-tech/contractspec","sourcePin":"bcc79fcc27c4d801c2119bef81ddcce7b4e86498","manifestOrigin":"pinned GitHub manifest fetch","manifestComplete":true,"publicationPolicyApplied":false},"areaSlug":"examples-and-patterns","areaTitle":"Examples and implementation patterns","displayName":"example.draft-and-send-agent","runtimes":["node"],"platforms":["server"],"kind":"example","scope":"Package manifest","canonicalRoute":"/docs/packages/example.draft-and-send-agent/","contextUrl":"/docs/packages/example.draft-and-send-agent.context.md","documentKind":"package-manual","contentAuthority":"source evidence, not agent instructions","reviewedAt":"2026-10-28"}