Bonded-escrow marketplace for prompt → response between buyers and
local-LLM suppliers, settling on Vector (UTxO) via Aiken Plutus V3
validators. Lifecycle PostEscrow → Claim → Submit → Accept proven on
Vector testnet 2026-05-06; AcceptEscrow tx 125e3cfe…7dc100d distributes
payment + bonds per the validator's distribution rule.
Workspace layout (pnpm + TypeScript):
contracts/marketplace/ Aiken validators (advert + escrow) + plutus.json
packages/shared/ Tx-builders (lucid-evolution), CBOR codecs,
chain providers (mock / read-only / live Ogmios)
supplier/ OpenAI-compatible HTTP node (Ollama by default;
vLLM / llama.cpp / OpenRouter / OpenClaw all
swap-in via OLLAMA_URL); 202+poll chat handler
buyer/ Express + React SPA; server-side runs the full
chain lifecycle via /v1/submit-prompt and
/v1/accept; SPA never holds the buyer key
indexer/ Chain-follower (extends apex-dashboard pattern),
SSE event stream + REST queries
indexer-ui/ Operator dashboard (events + suppliers + escrow
lookup)
tests/ 1098 vitest unit + integration tests (10 skipped
under M1-F-D-defer for UPLC test plumbing)
deploy/testnet/ Per-service docker-compose for the Hetzner stack
docs/EXECUTIVE_SUMMARY.* Marp deck (PDF + PPTX) — 11 slides, mermaid
diagrams pre-rendered for portable export
docs/CLOUDFLARE_WAF_BYPASS.md CF Skip-rule runbook for /v1/* paths
docs/ARCHITECTURE.md canonical spec
Live demo (testnet, 2026-05-06):
https://mp-buyers.vector.testnet.apexfusion.org (buyer SPA)
https://mp-suppliers.vector.testnet.apexfusion.org (supplier API)
https://mp-indexer.vector.testnet.apexfusion.org (indexer + UI)
47 lines
1.6 KiB
TypeScript
47 lines
1.6 KiB
TypeScript
/**
|
|
* indexer-ui/src/components/CapabilitiesPanel.tsx — capability counts.
|
|
*
|
|
* Polls /capabilities every 30 s via usePolling. Renders one card per entry.
|
|
*
|
|
* data-testid hooks (test contract):
|
|
* - capability-card — one card per CapabilityCount entry
|
|
*/
|
|
|
|
import { useCallback } from "react";
|
|
import { usePolling } from "../hooks/usePolling.js";
|
|
import { fetchCapabilities, type CapabilityCount } from "../api/client.js";
|
|
|
|
const POLL_INTERVAL_MS = 30_000;
|
|
|
|
export default function CapabilitiesPanel() {
|
|
const fetchFn = useCallback(() => fetchCapabilities(""), []);
|
|
const { data, error } = usePolling<CapabilityCount[]>(fetchFn, POLL_INTERVAL_MS);
|
|
|
|
const caps = data ?? [];
|
|
|
|
return (
|
|
<div className="rounded-md bg-white p-4 shadow-sm">
|
|
{error && !data && (
|
|
<div className="mb-2 rounded bg-red-50 p-2 text-sm text-red-800">
|
|
Failed to load capabilities: {error.message}
|
|
</div>
|
|
)}
|
|
<div className="grid grid-cols-1 gap-3 sm:grid-cols-2 lg:grid-cols-3">
|
|
{caps.map((cap) => (
|
|
<div
|
|
key={cap.capability_id}
|
|
data-testid="capability-card"
|
|
className="rounded border border-gray-200 p-3"
|
|
>
|
|
<div className="font-mono text-xs text-gray-700">{cap.capability_id}</div>
|
|
<div className="mt-1 text-sm text-gray-600">
|
|
<span className="font-semibold text-gray-900">{cap.supplier_count}</span>
|
|
<span className="ml-1">supplier{cap.supplier_count === 1 ? "" : "s"}</span>
|
|
</div>
|
|
</div>
|
|
))}
|
|
</div>
|
|
</div>
|
|
);
|
|
}
|