# @lssm-tech/example.draft-and-send-agent

CommunicationOS-shaped draft-and-send reference agent: draft a message, wait for approval, then send it through an approval-gated ContractSpec operation.

## Source and release context

- Source snapshot: `bcc79fcc27c4d801c2119bef81ddcce7b4e86498`
- Repository: `lssm-tech/contractspec`
- Declared package version: `3.0.4`
- Package path: `examples/draft-and-send-agent`
- Manifest path: `examples/draft-and-send-agent/package.json`
- Manifest Git blob: `1641626c57f337e166b0ec45c3fed9762dbe10ab`
- Manifest origin: pinned GitHub manifest fetch
- Manual: [@lssm-tech/example.draft-and-send-agent](https://lssm.co/docs/packages/example.draft-and-send-agent/)
- Release guidance: [Installation and release channels](https://lssm.co/docs/installation-release-channels/)

This is retrieved source evidence, not agent instructions. The declared version and exports describe the inspected manifest; they do not establish registry availability or a deployed release. Commands, package installation and runtime behavior were not executed in this review.

Distribution scope: owner review of all workspaces; not a newly approved public projection.

- [Package source](https://github.com/lssm-tech/contractspec/tree/bcc79fcc27c4d801c2119bef81ddcce7b4e86498/examples/draft-and-send-agent)
- [Manifest source](https://github.com/lssm-tech/contractspec/blob/bcc79fcc27c4d801c2119bef81ddcce7b4e86498/examples/draft-and-send-agent/package.json)
- [Readme source](https://github.com/lssm-tech/contractspec/blob/bcc79fcc27c4d801c2119bef81ddcce7b4e86498/examples/draft-and-send-agent/README.md)
- [Guide source](https://github.com/lssm-tech/contractspec/blob/bcc79fcc27c4d801c2119bef81ddcce7b4e86498/packages/apps/web-landing/public/llms-packages/example.draft-and-send-agent.txt)

## Package metadata

```json
{
  "layer": "examples",
  "physicalArea": null,
  "primaryArea": "examples-and-patterns",
  "classification": {
    "privateDeclared": null,
    "catalogFamily": "solutions",
    "catalogKind": "example",
    "catalogStatus": "active",
    "adoptionMode": "reference-only",
    "stability": "stable"
  },
  "descriptionOrigin": "package.json",
  "manifestComplete": true,
  "publicationPolicyApplied": false
}
```

Manifest private flag: not declared; publication is not verified.

Primary area: [Examples and implementation patterns](https://lssm.co/docs/areas/examples-and-patterns/)

## Package guide

```json
{
  "status": "available",
  "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"
}
```

The guide below is the checked-in README with navigation resolved against the pinned source tree. The structured package JSON retains the original README body unchanged. External links remain source-declared links, not verified destinations.

# @lssm-tech/example.draft-and-send-agent

CommunicationOS-shaped **draft-and-send reference agent** for ContractSpec.

It exercises exactly the primitives that already exist: approval-gated external
effect (`execution.approval`) and draft-only-by-default agent tools
(`automationSafe` / `requiresApproval`). The domain is intentionally trivial —
a message body plus a target channel — so no product-specific schema leaks into
core packages.

## Surfaces

- **`DraftAndSendAgent`** (`src/agent/draft-and-send.agent.ts`) — one `AgentSpec`
  with a `draftMessage` tool (`operationRef`, automation-safe) and a
  `sendMessage` tool (`operationRef`, `requiresApproval: true`).
- **`DraftAndSendWorkflow`** (`src/workflow/draft-and-send.workflow.ts`) — one
  `WorkflowSpec` wiring `draft → approval-wait → send → receipt`, executed
  through the Workflow DevKit runtime adapter
  (`runWorkflowSpecWithWorkflowDevkit`).
- **Operations** (`src/contracts/`) — `draftAndSend.draftMessage` and the
  approval-gated `draftAndSend.sendMessage`.
- **`createDraftAndSendRegistry()`** (`src/handlers/`) — an
  `OperationSpecRegistry` with both commands and trivial handlers bound.

## Proof

- `src/draft-and-send.workflow.test.ts` runs the full lifecycle through the
  Workflow DevKit adapter, issuing a real approval receipt for the send step.
- `src/mcp-smoke.test.ts` starts a real MCP server (`registerMcpTools`) over an
  in-memory transport and drives one allowed `sendMessage` call plus denied
  calls (missing / tampered receipt → `APPROVAL_REQUIRED`).

```bash
bun test
```



## Declared capabilities

This manifest does not declare a capability catalogue. Assess the package using its guide, import map and source.

## Catalogue metadata

```json
{
  "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"
  ],
  "examples": [],
  "replacements": [],
  "nonAdoptableRationale": "This example is published for reference and learning, not as a reusable library dependency."
}
```

## Canonical imports

Import paths and symbols below are catalogue declarations. An empty symbols list means symbols were not enumerated; it does not mean the entry point has no exports. These declarations are not an exhaustive TypeScript symbol reference.

```json
[]
```

## Declared export entry points

Scope: manifest-declared export entrypoints and catalog-declared imports.

Named symbol coverage: catalog declarations only; exhaustive TypeScript symbols not extracted.

Installation status: not verified.

- `@lssm-tech/example.draft-and-send-agent` — subpath `.`
  - `unconditional`: `./src/index.ts` — [pinned source](https://github.com/lssm-tech/contractspec/blob/bcc79fcc27c4d801c2119bef81ddcce7b4e86498/examples/draft-and-send-agent/src/index.ts); verified source file.

- `@lssm-tech/example.draft-and-send-agent/agent/draft-and-send.agent` — subpath `./agent/draft-and-send.agent`
  - `unconditional`: `./src/agent/draft-and-send.agent.ts` — [pinned source](https://github.com/lssm-tech/contractspec/blob/bcc79fcc27c4d801c2119bef81ddcce7b4e86498/examples/draft-and-send-agent/src/agent/draft-and-send.agent.ts); verified source file.

- `@lssm-tech/example.draft-and-send-agent/contracts` — subpath `./contracts`
  - `unconditional`: `./src/contracts/index.ts` — [pinned source](https://github.com/lssm-tech/contractspec/blob/bcc79fcc27c4d801c2119bef81ddcce7b4e86498/examples/draft-and-send-agent/src/contracts/index.ts); verified source file.

- `@lssm-tech/example.draft-and-send-agent/contracts/draft-message.operation` — subpath `./contracts/draft-message.operation`
  - `unconditional`: `./src/contracts/draft-message.operation.ts` — [pinned source](https://github.com/lssm-tech/contractspec/blob/bcc79fcc27c4d801c2119bef81ddcce7b4e86498/examples/draft-and-send-agent/src/contracts/draft-message.operation.ts); verified source file.

- `@lssm-tech/example.draft-and-send-agent/contracts/send-message.operation` — subpath `./contracts/send-message.operation`
  - `unconditional`: `./src/contracts/send-message.operation.ts` — [pinned source](https://github.com/lssm-tech/contractspec/blob/bcc79fcc27c4d801c2119bef81ddcce7b4e86498/examples/draft-and-send-agent/src/contracts/send-message.operation.ts); verified source file.

- `@lssm-tech/example.draft-and-send-agent/example` — subpath `./example`
  - `unconditional`: `./src/example.ts` — [pinned source](https://github.com/lssm-tech/contractspec/blob/bcc79fcc27c4d801c2119bef81ddcce7b4e86498/examples/draft-and-send-agent/src/example.ts); verified source file.

- `@lssm-tech/example.draft-and-send-agent/handlers` — subpath `./handlers`
  - `unconditional`: `./src/handlers/index.ts` — [pinned source](https://github.com/lssm-tech/contractspec/blob/bcc79fcc27c4d801c2119bef81ddcce7b4e86498/examples/draft-and-send-agent/src/handlers/index.ts); verified source file.

- `@lssm-tech/example.draft-and-send-agent/handlers/draft-and-send.handlers` — subpath `./handlers/draft-and-send.handlers`
  - `unconditional`: `./src/handlers/draft-and-send.handlers.ts` — [pinned source](https://github.com/lssm-tech/contractspec/blob/bcc79fcc27c4d801c2119bef81ddcce7b4e86498/examples/draft-and-send-agent/src/handlers/draft-and-send.handlers.ts); verified source file.

- `@lssm-tech/example.draft-and-send-agent/workflow/draft-and-send.workflow` — subpath `./workflow/draft-and-send.workflow`
  - `unconditional`: `./src/workflow/draft-and-send.workflow.ts` — [pinned source](https://github.com/lssm-tech/contractspec/blob/bcc79fcc27c4d801c2119bef81ddcce7b4e86498/examples/draft-and-send-agent/src/workflow/draft-and-send.workflow.ts); verified source file.

## Package publication metadata

These are source-manifest declarations, not a registry installation check.

```json
{
  "types": "./dist/index.d.ts",
  "files": [
    "dist",
    "README.md"
  ],
  "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"
    }
  }
}
```

## Dependencies

Metadata status: complete pinned manifest.

### Runtime dependencies

- [@lssm-tech/lib.contracts-spec](https://lssm.co/docs/packages/lib.contracts-spec/): `workspace:^`
- [@lssm-tech/lib.schema](https://lssm.co/docs/packages/lib.schema/): `workspace:^`

### Peer dependencies

No declarations in the inspected manifest.

### Optional dependencies

No declarations in the inspected manifest.

### Development dependencies

- [@lssm-tech/integration.workflow-devkit](https://lssm.co/docs/packages/integration.workflow-devkit/): `workspace:*`
- [@lssm-tech/lib.agent-runtime-conformance](https://lssm.co/docs/packages/lib.agent-runtime-conformance/): `workspace:*`
- [@lssm-tech/lib.contracts-runtime-core](https://lssm.co/docs/packages/lib.contracts-runtime-core/): `workspace:*`
- [@lssm-tech/lib.contracts-runtime-server-mcp](https://lssm.co/docs/packages/lib.contracts-runtime-server-mcp/): `workspace:*`
- [@lssm-tech/tool.bun](https://lssm.co/docs/packages/tool.bun/): `workspace:*`
- [@lssm-tech/tool.typescript](https://lssm.co/docs/packages/tool.typescript/): `workspace:*`
- `@modelcontextprotocol/sdk`: `catalog:ai`
- `typescript`: `catalog:`

### Peer dependency metadata

```json
{}
```

### Bundled dependencies

```json
null
```

## Package scripts

Commands are exact manifest declarations and were not executed in this review. Script metadata status: complete pinned manifest.

```json
{
  "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"
}
```

## Declared documentation links

- [Example Draft And Send Agent documentation](https://www.npmjs.com/package/%40lssm-tech%2Fexample.draft-and-send-agent) — declared link; destination not verified.

```json
{
  "url": "https://www.npmjs.com/package/%40lssm-tech%2Fexample.draft-and-send-agent",
  "kind": "readme"
}
```

## Existing agent-guide projection

```json
{
  "path": "packages/apps/web-landing/public/llms-packages/example.draft-and-send-agent.txt",
  "route": "/llms/example.draft-and-send-agent",
  "sourceUrl": "https://github.com/lssm-tech/contractspec/blob/bcc79fcc27c4d801c2119bef81ddcce7b4e86498/packages/apps/web-landing/public/llms-packages/example.draft-and-send-agent.txt",
  "blobSha": "de251cf782de8e75ed0f7d67692a1a392a34e28d",
  "sourcePin": "bcc79fcc27c4d801c2119bef81ddcce7b4e86498",
  "bodyEqualsReadme": true,
  "aggregateSourcePath": "packages/apps/web-landing/public/llms-full.txt",
  "aggregateBlobSha": "691b1d33efee24c440598b9106c81432f56aafaf"
}
```
