Skip to main content
Glama
EncHawk
by EncHawk

Lippy Agent

网站会变。你的 API 不应改变。请参阅 SPEC.md 了解完整架构、评判标准映射和演示脚本。

设置

npm install
cp .env.example .env      # works out of the box in mock mode, no keys needed
npm run db:generate
npm run db:migrate
npm run dev

完全在 模拟模式 下运行,无需任何 API 密钥 — BrightDataClient 和 ParallelClient 都会回退到确定性的模拟响应,因此 创建 → 运行 → 违反 → 修复 → 验证 → 语义差异 循环可以 开箱即用地端到端运行。在 .env 中设置 BRIGHTDATA_API_KEY / PARALLEL_API_KEY 以调用真实 API。

Related MCP server: diffgrab

项目结构

src/
  app/                    Next.js App Router — routes are thin adapters only
    api/contracts/        REST surface (create, get, run, live event stream)
    api/mcp/              MCP server over Streamable HTTP
  lib/
    contracts/            schema (Zod), validator, service layer
    brightdata/           typed client (create/run/heal/approve), mock-capable
    parallel/              semantic-diff client, mock-capable
    selfheal/              the orchestrator state machine
    events/                typed event union + pub/sub bus
    env.ts errors.ts logger.ts db.ts
  mcp/server.ts            tool definitions (create_contract, watch_contract, get_data)
  tests/                   vitest unit tests
prisma/schema.prisma       Contract / Run / ContractEvent models

命令

命令

作用

npm run dev

启动开发服务器

npm test

运行 vitest 测试套件

npm run typecheck

tsc --noEmit

npm run db:studio

可视化浏览 SQLite 数据库

试用

# create a contract
curl -X POST localhost:3000/api/contracts -H 'content-type: application/json' -d '{
  "url": "https://example.com/product",
  "fields": [
    { "key": "product", "type": "string", "required": true },
    { "key": "price", "type": "number", "required": true },
    { "key": "stock", "type": "boolean", "required": false }
  ]
}'

# trigger a run (mock mode breaks the extraction every 3rd call, so re-run
# a few times to see contract.violated -> contract.healing -> contract.healed)
curl -X POST localhost:3000/api/contracts/<id>/run

Maintenance

ActivitySlowing
ResponsivenessNo issues

Related MCP Connectors

Related MCP Servers