Expert guide for automated and manual Web Accessibility (a11y) testing — axe-core, Pa11y, Playwright a11y, screen reader testing, and WCAG 2.2 Level AA/AAA compliance / Panduan ahli pengujian aksesibilitas web.
中文简介正在准备中。当前显示原文说明。
Master guide for designing Machine-to-Machine (M2M) micro-economies, autonomous agent wallets, swarm budget envelopes, and HTTP 402 payment flows / Panduan utama merancang ekonomi mikro antar-agen (M2M), dompet agen otonom, pagu anggaran swarm, dan alur pembayaran HTTP 402.
中文简介正在准备中。当前显示原文说明。
查看安装方法安装前可以查看交给 AI 代理的指令内容。
<a name="english"></a>
When autonomous AI agents interact with external paid APIs, execute web scraping, consume fine-tuned SLM inferences, or hire specialized peer agents, unconstrained execution leads to catastrophic cloud bill runaway. In the era of autonomous software swarms, agents can no longer operate with static, blind access to unrestricted corporate cards.
The Agentic Micro-Economy Architecture transforms multi-agent swarms into financially self-regulating micro-economies. Every agent is assigned an autonomous cryptographic wallet, operates within strict budget envelopes, participates in reverse-auction bidding for tasks, and interacts with external paid infrastructure via the native HTTP 402 (Payment Required) protocol.
agentic-m2m-settlement, blockchain-web3-expert, formal-spec-z3-verifier.doku-payment-gateway, doku-mcp-server, saas-billing, payment-gateway-expert.llm-finops-router, adaptive-model-cascade, thinking-budget-orchestrator.multi-agent-orchestration, quality-guardian, autonomous-tdd-debugger.brainstorming, zero-to-prod-orchestrator, session-memory-manager, anti-slop.┌────────────────────────────────────────────────────────────────────────┐
│ AGENTIC MICRO-ECONOMY PIPELINE │
├────────────────────────────────────────────────────────────────────────┤
│ 1. SWARM TREASURY (Root Envelope: $10.00 Max Cap) │
│ Director decomposes user request into priced subtasks │
│ │ │
│ ▼ │
│ 2. REVERSE-AUCTION BIDDING PROTOCOL │
│ Worker A (Flash / $0.02) vs Worker B (Pro / $0.15) │
│ Director awards task to optimal Cost-Quality bid │
│ │ │
│ ▼ │
│ 3. HTTP 402 PAYMENT REQUIRED INTERACTION │
│ Worker requests paid API ──► Gateway returns 402 with Invoice │
│ Worker pays via Escrow Envelope Token ──► Gateway yields data │
│ │ │
│ ▼ │
│ 4. CRITIC MILESTONE ESCROW RELEASE │
│ Quality Gate Passes (Score >= 0.85) ──► Funds Released to Worker │
│ Quality Gate Fails ──► Full Refund to Root Treasury│
└────────────────────────────────────────────────────────────────────────┘
$5.00 per task). If this ceiling is reached, the entire swarm halts immediately and prompts for user authorization.$0.50/hr for scraping, $2.00/hr for frontier reasoning).APIs consumed by agents return standard HTTP 402 with structured payment challenge headers (L402, X-Agent-Payment-Challenge). The agent inspects the cost, validates against its allocated envelope, generates a signed micro-payment authorization token, and retries the request with Authorization: AgentToken <signature>.
When a task can be solved by multiple model tiers (e.g., Code Review can be attempted by lightweight AST scanners or heavyweight frontier models), workers submit bids detailing:
server/http402-middleware.ts)import { NextRequest, NextResponse } from 'next/server';
import crypto from 'node:crypto';
export interface PaymentChallenge {
invoiceId: string;
amountCents: number;
recipientWallet: string;
expiresAt: string;
currency: 'USD' | 'IDR';
}
export function createHttp402Challenge(
amountCents: number,
recipientWallet: string,
secretKey: string
): { response: NextResponse; challenge: PaymentChallenge } {
const invoiceId = `inv_${crypto.randomUUID()}`;
const expiresAt = new Date(Date.now() + 60000).toISOString(); // 60s TTL
const challenge: PaymentChallenge = {
invoiceId,
amountCents,
recipientWallet,
expiresAt,
currency: 'USD',
};
const signature = crypto
.createHmac('sha256', secretKey)
.update(`${invoiceId}|${amountCents}|${recipientWallet}|${expiresAt}`)
.digest('hex');
const response = new NextResponse(
JSON.stringify({
error: 'Payment Required',
message: 'Autonomous agent micropayment required to access this endpoint.',
challenge,
}),
{
status: 402,
headers: {
'Content-Type': 'application/json',
'WWW-Authenticate': `AgentMicropay invoice="${invoiceId}", amount="${amountCents}", currency="USD"`,
'X-Agent-Signature': signature,
},
}
);
return { response, challenge };
}
export function verifyPaymentAuthorization(
req: NextRequest,
secretKey: string
): { authorized: boolean; invoiceId?: string; error?: string } {
const authHeader = req.headers.get('Authorization');
if (!authHeader || !authHeader.startsWith('AgentToken ')) {
return { authorized: false, error: 'Missing AgentToken authorization header.' };
}
const token = authHeader.replace('AgentToken ', '').trim();
const [invoiceId, timestamp, signature] = token.split(':');
if (!invoiceId || !timestamp || !signature) {
return { authorized: false, error: 'Malformed payment authorization token.' };
}
const expectedSignature = crypto
.createHmac('sha256', secretKey)
.update(`${invoiceId}|${timestamp}`)
.digest('hex');
if (signature !== expectedSignature) {
return { authorized: false, error: 'Cryptographic payment signature mismatch.' };
}
// Check timestamp freshness (30s window)
const tokenTime = parseInt(timestamp, 10);
if (Math.abs(Date.now() - tokenTime) > 30000) {
return { authorized: false, error: 'Micropayment token expired.' };
}
return { authorized: true, invoiceId };
}
engine/agent-treasury-engine.ts)import crypto from 'node:crypto';
export interface EscrowHold {
id: string;
taskId: string;
workerAgentId: string;
amountCents: number;
status: 'PENDING' | 'RELEASED' | 'REFUNDED';
expiresAt: number;
criticAgentId: string;
}
export interface TaskBid {
workerAgentId: string;
bidAmountCents: number;
estimatedDurationMs: number;
confidenceScore: number;
signature: string;
}
export class AgentTreasuryEngine {
private balanceCents: number;
private readonly maxRootBudgetCents: number;
private readonly escrows: Map<string, EscrowHold> = new Map();
private readonly agentSpending: Map<string, number> = new Map();
constructor(maxRootBudgetUsd: number) {
this.maxRootBudgetCents = Math.round(maxRootBudgetUsd * 100);
this.balanceCents = this.maxRootBudgetCents;
}
// Evaluate Bids and Lock Funds into Escrow
public awardTaskAndEscrow(
taskId: string,
bids: TaskBid[],
criticAgentId: string,
ttlSeconds: number = 60
): { awardedBid: TaskBid; escrow: EscrowHold } {
if (bids.length === 0) {
throw new Error(`[Treasury] No candidate bids submitted for task ${taskId}.`);
}
// Sort by best cost-confidence ratio: lowest (cost / confidence)
const sortedBids = [...bids].sort((a, b) => {
const scoreA = a.bidAmountCents / Math.max(a.confidenceScore, 0.1);
const scoreB = b.bidAmountCents / Math.max(b.confidenceScore, 0.1);
return scoreA - scoreB;
});
const winningBid = sortedBids[0];
if (this.balanceCents < winningBid.bidAmountCents) {
throw new Error(
`[Treasury: FinOps Killswitch] Root budget exhausted! Available: ${this.balanceCents}¢, Bid: ${winningBid.bidAmountCents}¢.`
);
}
// Atomic Balance Deduction
this.balanceCents -= winningBid.bidAmountCents;
const escrow: EscrowHold = {
id: `escrow_${crypto.randomUUID()}`,
taskId,
workerAgentId: winningBid.workerAgentId,
amountCents: winningBid.bidAmountCents,
status: 'PENDING',
expiresAt: Date.now() + ttlSeconds * 1000,
criticAgentId,
};
this.escrows.set(escrow.id, escrow);
return { awardedBid: winningBid, escrow };
}
// Milestone Gated Settlement
public settleEscrow(
escrowId: string,
criticApproval: boolean,
criticScore: number
): { status: 'RELEASED' | 'REFUNDED'; amountCents: number } {
const escrow = this.escrows.get(escrowId);
if (!escrow) {
throw new Error(`[Treasury] Escrow contract ${escrowId} not found.`);
}
if (escrow.status !== 'PENDING') {
throw new Error(`[Treasury] Escrow ${escrowId} already concluded with status ${escrow.status}.`);
}
const isExpired = Date.now() > escrow.expiresAt;
if (criticApproval && criticScore >= 0.85 && !isExpired) {
escrow.status = 'RELEASED';
const currentSpent = this.agentSpending.get(escrow.workerAgentId) || 0;
this.agentSpending.set(escrow.workerAgentId, currentSpent + escrow.amountCents);
return { status: 'RELEASED', amountCents: escrow.amountCents };
}
// Refund back to root treasury
escrow.status = 'REFUNDED';
this.balanceCents += escrow.amountCents;
return { status: 'REFUNDED', amountCents: escrow.amountCents };
}
public getTelemetry() {
return {
availableBalanceUsd: (this.balanceCents / 100).toFixed(2),
totalBudgetUsd: (this.maxRootBudgetCents / 100).toFixed(2),
burnRatePercent: (((this.maxRootBudgetCents - this.balanceCents) / this.maxRootBudgetCents) * 100).toFixed(1),
activeEscrowCount: Array.from(this.escrows.values()).filter((e) => e.status === 'PENDING').length,
};
}
}
components/economy/agent-budget-dashboard.tsx)'use client';
import React from 'react';
interface BudgetTelemetryProps {
telemetry: {
availableBalanceUsd: string;
totalBudgetUsd: string;
burnRatePercent: string;
activeEscrowCount: number;
};
agentSpendBreakdown: Array<{
agentId: string;
role: string;
spentUsd: string;
activeTasks: number;
}>;
}
export function AgentBudgetDashboard({ telemetry, agentSpendBreakdown }: BudgetTelemetryProps) {
const burnPercentNumber = parseFloat(telemetry.burnRatePercent);
return (
<div className="w-full my-4 border border-neutral-200/80 dark:border-neutral-800 rounded-xl bg-white dark:bg-neutral-900 shadow-xs overflow-hidden">
{/* Header */}
<div className="p-4 border-b border-neutral-100 dark:border-neutral-800 flex items-center justify-between">
<div>
<span className="text-[11px] font-semibold uppercase tracking-wider text-neutral-500 dark:text-neutral-400">
Swarm Treasury & FinOps
</span>
<h3 className="text-base font-semibold tracking-tight text-neutral-900 dark:text-neutral-50">
Autonomous Micro-Economy
</h3>
</div>
<div className="flex items-center gap-2">
<span className="inline-flex items-center px-2.5 py-0.5 rounded-full text-xs font-mono font-medium bg-neutral-100 dark:bg-neutral-800 text-neutral-700 dark:text-neutral-300">
{telemetry.activeEscrowCount} Active Escrows
</span>
</div>
</div>
{/* Primary KPI Grid */}
<div className="p-4 grid grid-cols-1 sm:grid-cols-3 gap-3 border-b border-neutral-100 dark:border-neutral-800">
<div className="p-3 bg-neutral-50 dark:bg-neutral-800/40 rounded-lg border border-neutral-200/60 dark:border-neutral-800">
<span className="text-xs text-neutral-500 dark:text-neutral-400 block mb-1">Available Liquidity</span>
<div className="text-xl font-bold font-mono tracking-tight text-neutral-900 dark:text-neutral-50 tabular-nums">
${telemetry.availableBalanceUsd}
</div>
<span className="text-[11px] text-neutral-400 dark:text-neutral-500 mt-1 block">
Limit: ${telemetry.totalBudgetUsd}
</span>
</div>
<div className="p-3 bg-neutral-50 dark:bg-neutral-800/40 rounded-lg border border-neutral-200/60 dark:border-neutral-800">
<span className="text-xs text-neutral-500 dark:text-neutral-400 block mb-1">Budget Burn Rate</span>
<div className="text-xl font-bold font-mono tracking-tight text-neutral-900 dark:text-neutral-50 tabular-nums">
{telemetry.burnRatePercent}%
</div>
<div className="w-full bg-neutral-200 dark:bg-neutral-700 h-1.5 rounded-full mt-2 overflow-hidden">
<div
className={`h-full rounded-full transition-all duration-300 ${
burnPercentNumber > 80 ? 'bg-rose-500' : burnPercentNumber > 50 ? 'bg-amber-500' : 'bg-emerald-500'
}`}
style={{ width: `${Math.min(burnPercentNumber, 100)}%` }}
/>
</div>
</div>
<div className="p-3 bg-neutral-50 dark:bg-neutral-800/40 rounded-lg border border-neutral-200/60 dark:border-neutral-800">
<span className="text-xs text-neutral-500 dark:text-neutral-400 block mb-1">Safety Killswitch</span>
<div className="text-sm font-semibold text-emerald-600 dark:text-emerald-400 flex items-center gap-1.5 mt-1">
<div className="w-2 h-2 rounded-full bg-emerald-500 animate-pulse" />
Active & Armed
</div>
<span className="text-[11px] text-neutral-400 dark:text-neutral-500 mt-1 block">
Auto-halts on 100% budget breach
</span>
</div>
</div>
{/* Itemized Agent Spend */}
<div className="p-4">
<span className="text-xs font-semibold text-neutral-700 dark:text-neutral-300 block mb-2">
Subagent Cost Allocation:
</span>
<div className="space-y-2">
{agentSpendBreakdown.map((agent) => (
<div
key={agent.agentId}
className="flex items-center justify-between p-2.5 rounded-lg border border-neutral-100 dark:border-neutral-800/80 bg-neutral-50/50 dark:bg-neutral-800/20 text-xs"
>
<div>
<span className="font-medium text-neutral-900 dark:text-neutral-100">{agent.agentId}</span>
<span className="text-neutral-400 dark:text-neutral-500 ml-2">({agent.role})</span>
</div>
<div className="flex items-center gap-3">
<span className="text-neutral-500 dark:text-neutral-400">{agent.activeTasks} in flight</span>
<span className="font-mono font-semibold text-neutral-900 dark:text-neutral-100 tabular-nums">
${agent.spentUsd}
</span>
</div>
</div>
))}
</div>
</div>
</div>
);
}
<a name="bahasa-indonesia"></a>
Ketika agen AI otonom memanggil API berbayar, menjalankan web scraping skala besar, mengonsumsi inferensi model LLM, atau menugaskan agen lain, eksekusi tanpa kendali keuangan akan memicu kebocoran biaya komputasi yang fatal. Di era swarm software otonom, agen tidak lagi boleh beroperasi dengan akses kartu kredit perusahaan tanpa pagu ketat.
Arsitektur Ekonomi Mikro Agen mengubah swarm multi-agen menjadi sistem ekonomi mikro yang mampu meregulasi keuangannya sendiri. Setiap agen dibekali dompet kriptografis otonom, beroperasi dalam pagu anggaran (budget envelope) ketat, berpartisipasi dalam lelang tugas (reverse-auction bidding), dan bertransaksi dengan infrastruktur eksternal melalui protokol native HTTP 402 (Payment Required).
agentic-m2m-settlement, blockchain-web3-expert, formal-spec-z3-verifier.doku-payment-gateway, doku-mcp-server, saas-billing, payment-gateway-expert.llm-finops-router, adaptive-model-cascade, thinking-budget-orchestrator.multi-agent-orchestration, quality-guardian, autonomous-tdd-debugger.brainstorming, zero-to-prod-orchestrator, session-memory-manager, anti-slop.// TODO.node scripts/check-anti-slop.js.还没有评价。欢迎分享你的使用感受。
无需登录即可发表。欢迎分享使用感受、提问,或说明在哪些环境下无法运行。
还没有评论。来写第一条吧。
Expert guide for automated and manual Web Accessibility (a11y) testing — axe-core, Pa11y, Playwright a11y, screen reader testing, and WCAG 2.2 Level AA/AAA compliance / Panduan ahli pengujian aksesibilitas web.
中文简介正在准备中。当前显示原文说明。
Expert guide for intelligent model cascading and routing — complexity-scored task routing from Fast (Composer 2.5, Grok 4.7/4.6) to Medium (Gemini 4 Argon, GPT-5.6 Sol, Claude Opus 5.5) and High (Claude Sonnet 5.5, Claude Fable 5.1, Muse Wonder) / Panduan ahli untuk kaskade dan routing model cerdas.
中文简介正在准备中。当前显示原文说明。
Expert guide for intelligent model cascading and routing — complexity-scored task routing from Flash/Haiku to Sonnet/Opus/Astra, dynamic escalation with quality gates, 40-60% token cost reduction while maintaining output quality / Panduan ahli untuk kaskade dan routing model cerdas — routing tugas berbasis skor kompleksitas dari Flash/Haiku ke Sonnet/Opus/Astra, eskalasi dinamis dengan gerbang kualitas, pengurangan biaya token 40-60% dengan kualitas output terjaga.
中文简介正在准备中。当前显示原文说明。
Master guide for Affective Computing, emotional AI, and real-time sentiment analysis through native multimodal tokens (voice intonation and facial micro-expressions) / Panduan utama komputasi afektif, AI emosional, dan analisis sentimen real-time melalui token multimodal native.
中文简介正在准备中。当前显示原文说明。
Expert guide for Affective Computing, emotional AI, and real-time sentiment analysis through native multimodal tokens (voice intonation and facial micro-expressions) / Panduan ahli komputasi afektif, AI emosional, dan analisis sentimen real-time melalui token multimodal native.
中文简介正在准备中。当前显示原文说明。
Expert guide for AI-assisted coding workflows — agentic code generation, multi-agent code swarms, self-healing CI/CD, automated PR review, spec-to-code pipelines, codebase knowledge graphs, and human-in-the-loop approval gates / Panduan ahli untuk workflow pengkodean berbasis AI — generasi kode agentic, code swarm multi-agen, CI/CD self-healing, review PR otomatis, pipeline spec-to-code, knowledge graph codebase, dan gate persetujuan human-in-the-loop.
中文简介正在准备中。当前显示原文说明。