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 はどちらも決定的なモックレスポンスにフォールバックするため、create → run → violate → heal → verify → semantic-diff ループを追加設定なしでエンドツーエンドに実行できます。実際のAPIにアクセスするには、.env に BRIGHTDATA_API_KEY / PARALLEL_API_KEY を設定してください。

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 DB を視覚的に閲覧

試してみる

# 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