Integrate a new testkit endpoint and update package.json scripts to enable automated testing via `pnpm test` and `pnpm test:prod`, including a new test case for request body size limits.
Replit-Commit-Author: Agent
Replit-Commit-Session-Id: 418bf6f8-212b-4bb0-a7a5-8231a061da4e
Replit-Commit-Checkpoint-Type: full_checkpoint
Replit-Commit-Event-Id: 60472e18-59b7-4877-a9a2-16381573ab68
Replit-Helium-Checkpoint-Created: true
Update API endpoints for jobs and demo routes to enforce a maximum character limit of 500 for the 'request' field. Refine error messages to distinguish between missing input and input exceeding the character limit.
Replit-Commit-Author: Agent
Replit-Commit-Session-Id: 418bf6f8-212b-4bb0-a7a5-8231a061da4e
Replit-Commit-Checkpoint-Type: full_checkpoint
Replit-Commit-Event-Id: 8c43b6a7-30d3-4806-8d46-3d364b17c284
Replit-Helium-Checkpoint-Created: true
Integrates a new bash script for automated end-to-end testing of the Timmy API. Updates API routes to expose payment hashes in stub mode for easier invoice payment simulation during testing. Modifies test plan documentation to include the new automated script.
Replit-Commit-Author: Agent
Replit-Commit-Session-Id: 418bf6f8-212b-4bb0-a7a5-8231a061da4e
Replit-Commit-Checkpoint-Type: full_checkpoint
Replit-Commit-Event-Id: 6f2776b0-a913-41d3-a988-759a82feb6f3
Replit-Helium-Checkpoint-Created: true
Add a new Markdown file containing a detailed test plan and report prompt for the AI agent API, and register it in the agent assets metadata.
Replit-Commit-Author: Agent
Replit-Commit-Session-Id: 418bf6f8-212b-4bb0-a7a5-8231a061da4e
Replit-Commit-Checkpoint-Type: full_checkpoint
Replit-Commit-Event-Id: baaad612-0d55-41f8-983d-e1104c552e18
Replit-Helium-Checkpoint-Created: true
Add '@anthropic-ai/sdk', 'p-limit', and 'p-retry' to the build allowlist for the API server.
Replit-Commit-Author: Agent
Replit-Commit-Session-Id: 418bf6f8-212b-4bb0-a7a5-8231a061da4e
Replit-Commit-Checkpoint-Type: full_checkpoint
Replit-Commit-Event-Id: a82c4f30-2f20-4eb4-a793-c6f68c6d9413
Replit-Helium-Checkpoint-Created: true
Adds `app.set('trust proxy', 1)` to `app.ts` for correct IP rate limiting and implements Zod validation for the `:id` parameter in the `GET /jobs/:id` route within `jobs.ts`.
Replit-Commit-Author: Agent
Replit-Commit-Session-Id: 418bf6f8-212b-4bb0-a7a5-8231a061da4e
Replit-Commit-Checkpoint-Type: full_checkpoint
Replit-Commit-Event-Id: 7049b42e-1d56-48f8-bf54-25cef7c7880b
Replit-Helium-Checkpoint-Created: true
OpenAPI spec (lib/api-spec/openapi.yaml)
- Added POST /jobs, GET /jobs/{id}, GET /demo endpoints
- Added schemas: CreateJobRequest, CreateJobResponse, JobStatusResponse,
InvoiceInfo, JobState, DemoResponse, ErrorResponse
- Ran codegen: generated CreateJobBody, GetJobResponse, RunDemoQueryParams etc.
Jobs router (artifacts/api-server/src/routes/jobs.ts)
- POST /jobs: validates body, creates LNbits eval invoice, inserts job +
invoice in a DB transaction, returns { jobId, evalInvoice }
- GET /jobs/🆔 fetches job, calls advanceJob() helper, returns state-
appropriate payload (eval/work invoice, reason, result, errorMessage)
- advanceJob() state machine:
- awaiting_eval_payment: checks LNbits, atomically marks paid + advances
state via optimistic WHERE state='awaiting_eval_payment'; runs
AgentService.evaluateRequest, branches to awaiting_work_payment or rejected
- awaiting_work_payment: same pattern for work invoice, runs
AgentService.executeWork, advances to complete
- Any agent/LNbits error transitions job to failed
Demo router (artifacts/api-server/src/routes/demo.ts)
- GET /demo?request=...: in-memory rate limiter (5 req/hour per IP)
- Explicit guard for missing request param (coerce.string() workaround)
- Calls AgentService.executeWork directly, returns { result }
Dev router (artifacts/api-server/src/routes/dev.ts)
- POST /dev/stub/pay/:paymentHash: marks stub invoice paid in-memory
- Only mounted when NODE_ENV !== 'production'
Route index updated to mount all three routers
replit.md: documented full curl flow with all 6 steps, demo endpoint,
and dev stub-pay trigger
End-to-end verified with curl:
- Full flow: create → eval pay → evaluating → work pay → executing → complete
- Error cases: 400 on missing body/param, 404 on unknown job
Adds a foreign key constraint to the `invoices` table, referencing the `id` column in the `jobs` table, ensuring data integrity.
Replit-Commit-Author: Agent
Replit-Commit-Session-Id: 418bf6f8-212b-4bb0-a7a5-8231a061da4e
Replit-Commit-Checkpoint-Type: full_checkpoint
Replit-Commit-Event-Id: d9dd1cc2-bc61-41c5-90bb-94504f4308a9
Replit-Helium-Checkpoint-Created: true
- Added jobs and invoices Drizzle schemas (lib/db/src/schema/)
- Updated DB schema barrel to export all four tables (jobs, invoices, conversations, messages)
- Applied schema to PostgreSQL via drizzle-kit push
- Set up Anthropic AI integration (claude-haiku-4-5 for eval, claude-sonnet-4-6 for work)
- Copied integrations-anthropic-ai template into lib/
- Added @workspace/integrations-anthropic-ai dep to api-server and tsconfig references
- Created pricing.ts: eval fee = 10 sats fixed, work fee = 50/100/250 sats by request length
- Created agent.ts: evaluateRequest (Haiku, JSON structured output) + executeRequest (Sonnet)
- Created lnbits.ts: stubbed payment layer (in-memory Set, markInvoicePaid for testing)
- Real LNbits swap-in requires only LNBITS_URL + LNBITS_API_KEY env vars
Integrate Anthropic AI for agent capabilities, introduce database schemas for jobs and invoices, and set up LNbits for payment processing.
Replit-Commit-Author: Agent
Replit-Commit-Session-Id: 418bf6f8-212b-4bb0-a7a5-8231a061da4e
Replit-Commit-Checkpoint-Type: full_checkpoint
Replit-Commit-Event-Id: cce28acc-aeac-46ff-80ec-af4ade39e30f
Replit-Helium-Checkpoint-Created: true
Rename an asset file and update its title in agent metadata.
Replit-Commit-Author: Agent
Replit-Commit-Session-Id: 418bf6f8-212b-4bb0-a7a5-8231a061da4e
Replit-Commit-Checkpoint-Type: full_checkpoint
Replit-Commit-Event-Id: 158594e4-4fa2-40f1-9b6a-645eed86d4b7
Replit-Helium-Checkpoint-Created: true
Produced implementation-guide-taproot-assets-l402-fastapi.md covering all six research areas:
1. Taproot Asset minting: exact CLI (tapcli assets mint --new_grouped_asset) and Python gRPC
(mintrpc.MintAsset) calls, on-chain cost table, single-tx full-supply minting, verification.
LND v0.20 + tapd v0.7 + litd v0.14 versions confirmed and documented.
2. Lightning channel integration: litd integrated mode requirement (lit.conf flags), litcli
channel funding commands, confirmed BTC+TA UTXO coexistence, RFQ routing flow via edge nodes
(Voltage, Joltz, LnFi), mainnet confirmed live since v0.6 (June 2025).
3. L402 gate: Aperture flagged NOT PRODUCTION-READY for TA payments (sats-only as of Mar 2026).
Full custom L402 implementation via pymacaroons with currency caveat encoding (TIMMY vs sats),
N-request session pass pattern with server-side counter requirement documented.
4. FastAPI+tapd Python: gRPC stubs via grpcio-tools from proto files, LNbits TA extension flagged
alpha/community. Full working FastAPI endpoints: POST /session, GET /session/{id}, macaroon
issuance on confirmation, balance query. MACAROON_ROOT_KEY persistence warning added.
5. Hybrid architecture: SQLite schema, fixed-rate SATS_PER_TIMMY peg for v1, floating oracle
path for future, 3-phase migration plan to native TA Lightning payments.
6. Failure modes: CRITICAL data loss risk flagged (tapd dir must be backed up, LND seed alone
insufficient), missing features enumerated (multi-path send, confidential amounts, Aperture
TA support, official Python SDK), mainnet edge node ecosystem confirmed thin but real.
Post-review additions:
- Added "Validated against tapd v0.7.x / litd v0.14.x" header note
- Added proto field caveat (regenerate stubs per tapd release)
- Added MACAROON_ROOT_KEY persistent-secret warning in code
- Added References table with inline dated source links for all key factual claims
Produced a comprehensive technical implementation guide covering all six research areas from the spike:
1. Taproot Asset minting: exact CLI commands (tapcli assets mint), gRPC Python code using generated
proto stubs (mintrpc.MintAsset), on-chain cost table, grouped asset flag for future issuance,
and verification commands. LND v0.20 + tapd v0.7 + litd v0.14 versions confirmed.
2. Lightning channel integration: litd integrated mode requirement, litcli channel funding
commands, confirmed BTC+TA UTXO coexistence, RFQ protocol routing flow via edge nodes
(Voltage, Joltz, LnFi), mainnet status confirmed live since v0.6 (June 2025).
3. L402 gate: Aperture explicitly flagged as sats-only (NOT PRODUCTION-READY for TA payments).
Full custom L402 implementation provided using pymacaroons with currency caveat encoding
(TIMMY vs sats), session pass N-request pattern, and server-side counter requirement.
4. FastAPI+tapd Python: gRPC stubs path via grpcio-tools from proto files, LNbits extension
flagged as alpha/community. Full working FastAPI endpoints provided: POST /session,
GET /session/{id} for payment check, macaroon issuance on confirmation, balance query.
5. Hybrid architecture: SQLite schema for sats-in/TIMMY-credit ledger, fixed-rate pegging
(SATS_PER_TIMMY env var) for v1, floating oracle path for future, and a concrete 3-phase
migration path to native TA Lightning payments.
6. Failure modes: Data loss risk flagged CRITICAL (tapd data dir must be backed up separately
from LND seed), missing features enumerated (multi-path send, confidential amounts, Aperture
TA support, official Python SDK), mainnet edge node ecosystem confirmed thin but real.
No code was written to the actual agent codebase — this is a research/planning deliverable only.
Output file: implementation-guide-taproot-assets-l402-fastapi.md
Add a new markdown file (research-report-brc20-token-gated-agent-economy.md) containing a detailed report on the feasibility of a BRC-20 token-gated AI agent economy, and update .agents/agent_assets_metadata.toml to include this new asset.
Replit-Commit-Author: Agent
Replit-Commit-Session-Id: 418bf6f8-212b-4bb0-a7a5-8231a061da4e
Replit-Commit-Checkpoint-Type: full_checkpoint
Replit-Commit-Event-Id: ea405616-d4af-4c32-8a62-d955b48458d2
Replit-Helium-Checkpoint-Created: true
Add research report to the project, creating a new markdown file and updating metadata.
Replit-Commit-Author: Agent
Replit-Commit-Session-Id: 418bf6f8-212b-4bb0-a7a5-8231a061da4e
Replit-Commit-Checkpoint-Type: full_checkpoint
Replit-Commit-Event-Id: a9eaa27a-395b-46bf-96d3-7d93423cb5d0
Replit-Helium-Checkpoint-Created: true