arc-builder-kit 0.2.0__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (58) hide show
  1. arc_builder_kit/__init__.py +4 -0
  2. arc_builder_kit/__main__.py +6 -0
  3. arc_builder_kit/_paths.py +47 -0
  4. arc_builder_kit/cli.py +277 -0
  5. arc_builder_kit/config/arc_testnet.facts.json +31 -0
  6. arc_builder_kit/doctor.py +936 -0
  7. arc_builder_kit/examples/agent-commerce-components/components.js +200 -0
  8. arc_builder_kit/examples/agent-commerce-components/index.html +120 -0
  9. arc_builder_kit/examples/agent-commerce-flows/flows.js +271 -0
  10. arc_builder_kit/examples/agent-commerce-flows/index.html +114 -0
  11. arc_builder_kit/examples/agent-commerce-live/commerce-live.js +190 -0
  12. arc_builder_kit/examples/agent-commerce-live/index.html +105 -0
  13. arc_builder_kit/examples/agent-commerce-review-packet/index.html +96 -0
  14. arc_builder_kit/examples/agent-commerce-review-packet/packet.js +125 -0
  15. arc_builder_kit/examples/agent-identity-profile-preview/identity.js +126 -0
  16. arc_builder_kit/examples/agent-identity-profile-preview/index.html +104 -0
  17. arc_builder_kit/examples/arc-agent-treasury-lab/index.html +152 -0
  18. arc_builder_kit/examples/arc-agent-treasury-lab/treasury.js +532 -0
  19. arc_builder_kit/examples/arc-testnet-operator-evidence/evidence.example.json +47 -0
  20. arc_builder_kit/examples/arc-testnet-wallet-send-gate/index.html +233 -0
  21. arc_builder_kit/examples/arc-testnet-wallet-send-gate/live-infrastructure-policy.example.json +59 -0
  22. arc_builder_kit/examples/arc-testnet-wallet-send-gate/wallet-send-gate.js +472 -0
  23. arc_builder_kit/examples/circle-wallet-integration/index.html +155 -0
  24. arc_builder_kit/examples/circle-wallet-integration/wallet-lab.js +91 -0
  25. arc_builder_kit/examples/job-escrow-simulator/index.html +121 -0
  26. arc_builder_kit/examples/job-escrow-simulator/simulator.js +162 -0
  27. arc_builder_kit/examples/payment-intent-demo/index.html +132 -0
  28. arc_builder_kit/examples/payment-intent-playground/index.html +301 -0
  29. arc_builder_kit/examples/payment-intent-playground/playground.js +835 -0
  30. arc_builder_kit/examples/payment-intent-receipt-matcher/index.html +157 -0
  31. arc_builder_kit/examples/payment-intent-receipt-matcher/matcher.js +877 -0
  32. arc_builder_kit/examples/receipt-verifier-playground/index.html +120 -0
  33. arc_builder_kit/examples/receipt-verifier-playground/verifier.js +226 -0
  34. arc_builder_kit/examples/receipt-viewer/index.html +138 -0
  35. arc_builder_kit/examples/receipt-viewer/receipt-viewer.js +472 -0
  36. arc_builder_kit/examples/transaction-status-playground/index.html +135 -0
  37. arc_builder_kit/examples/transaction-status-playground/status.js +518 -0
  38. arc_builder_kit/examples/x402-local-challenge-server/.env.example +25 -0
  39. arc_builder_kit/examples/x402-local-challenge-server/README.md +111 -0
  40. arc_builder_kit/examples/x402-local-challenge-server/server.py +711 -0
  41. arc_builder_kit/mcp_server.py +463 -0
  42. arc_builder_kit/release_packet.py +469 -0
  43. arc_builder_kit/templates/README.md +25 -0
  44. arc_builder_kit/templates/job-escrow-starter/README.md +25 -0
  45. arc_builder_kit/templates/job-escrow-starter/index.html +41 -0
  46. arc_builder_kit/templates/job-escrow-starter/index.js +14 -0
  47. arc_builder_kit/templates/payment-intent-starter/README.md +25 -0
  48. arc_builder_kit/templates/payment-intent-starter/index.html +42 -0
  49. arc_builder_kit/templates/payment-intent-starter/index.js +7 -0
  50. arc_builder_kit/templates/x402-agent-starter/README.md +29 -0
  51. arc_builder_kit/templates/x402-agent-starter/server.py +201 -0
  52. arc_builder_kit/validate_repo.py +2212 -0
  53. arc_builder_kit-0.2.0.dist-info/METADATA +543 -0
  54. arc_builder_kit-0.2.0.dist-info/RECORD +58 -0
  55. arc_builder_kit-0.2.0.dist-info/WHEEL +5 -0
  56. arc_builder_kit-0.2.0.dist-info/entry_points.txt +3 -0
  57. arc_builder_kit-0.2.0.dist-info/licenses/LICENSE +21 -0
  58. arc_builder_kit-0.2.0.dist-info/top_level.txt +1 -0
@@ -0,0 +1,126 @@
1
+ const ARC_IDENTITY_PREVIEW = Object.freeze({
2
+ network: {
3
+ name: 'arc-testnet',
4
+ chainId: 5042002,
5
+ chainIdHex: '0x4cef52',
6
+ },
7
+ registries: {
8
+ identityRegistry: '0x8004A818BFB912233c491871b3d84c89A494BD9e',
9
+ reputationRegistry: '0x8004B663056A597Dffe9eCcC1965A193B7388713',
10
+ validationRegistry: '0x8004Cb1BF31DAf7788923b405b754f57acEB4272',
11
+ },
12
+ });
13
+
14
+ const fields = {
15
+ name: document.querySelector('#agent-name'),
16
+ type: document.querySelector('#agent-type'),
17
+ capabilities: document.querySelector('#capabilities'),
18
+ controller: document.querySelector('#controller-note'),
19
+ reputation: document.querySelector('#reputation-note'),
20
+ validation: document.querySelector('#validation-note'),
21
+ };
22
+ const nodes = {
23
+ status: document.querySelector('#status-badge'),
24
+ registries: document.querySelector('#registry-json'),
25
+ safety: document.querySelector('#safety-json'),
26
+ profile: document.querySelector('#profile-json'),
27
+ };
28
+ const buttons = {
29
+ freeze: document.querySelector('#freeze-profile'),
30
+ reset: document.querySelector('#reset-profile'),
31
+ };
32
+
33
+ let state = 'draft_profile';
34
+ let frozenAt = null;
35
+
36
+ function capabilitiesList() {
37
+ return fields.capabilities.value
38
+ .split(',')
39
+ .map((item) => item.trim())
40
+ .filter(Boolean);
41
+ }
42
+
43
+ function safetyFlags() {
44
+ return {
45
+ localOnly: true,
46
+ statusImpliesRegistration: false,
47
+ walletConnected: false,
48
+ walletActionEnabled: false,
49
+ metadataUploaded: false,
50
+ registrationTransactionPrepared: false,
51
+ reputationTransactionPrepared: false,
52
+ validationTransactionPrepared: false,
53
+ signingEnabled: false,
54
+ transactionBroadcast: false,
55
+ backendCalls: false,
56
+ remoteRpcCalls: false,
57
+ humanApprovalRequired: true,
58
+ mainnetEnabled: false,
59
+ };
60
+ }
61
+
62
+ function profileObject() {
63
+ return {
64
+ schema: 'arc-mcp-builder-assistant.agentIdentity.preview.v1',
65
+ state,
66
+ status: 'unregistered_local_preview',
67
+ frozenAt,
68
+ sourceGrounding: [
69
+ 'https://docs.arc.network/arc/tutorials/register-your-first-ai-agent',
70
+ 'https://docs.arc.network/build/agentic-economy',
71
+ ],
72
+ network: ARC_IDENTITY_PREVIEW.network,
73
+ registries: ARC_IDENTITY_PREVIEW.registries,
74
+ profile: {
75
+ name: fields.name.value.trim(),
76
+ agentType: fields.type.value.trim(),
77
+ capabilities: capabilitiesList(),
78
+ metadataUri: 'not_uploaded',
79
+ agentId: 'unknown_until_registered',
80
+ ownerAddress: 'unknown_until_wallet_confirmed',
81
+ validatorAddress: 'unknown_until_validator_selected',
82
+ },
83
+ review: {
84
+ controllerNote: fields.controller.value.trim(),
85
+ reputationNote: fields.reputation.value.trim(),
86
+ validationRequirement: fields.validation.value.trim(),
87
+ ownerCannotSelfValidate: true,
88
+ futureRegistrationRequiresSeparatePr: true,
89
+ },
90
+ safety: safetyFlags(),
91
+ };
92
+ }
93
+
94
+ function render() {
95
+ const profile = profileObject();
96
+ const profileFrozen = state === 'profile_frozen_for_review';
97
+ nodes.status.textContent = state;
98
+ nodes.registries.textContent = JSON.stringify(ARC_IDENTITY_PREVIEW.registries, null, 2);
99
+ nodes.safety.textContent = JSON.stringify(safetyFlags(), null, 2);
100
+ nodes.profile.textContent = JSON.stringify(profile, null, 2);
101
+ for (const field of Object.values(fields)) {
102
+ field.disabled = profileFrozen;
103
+ }
104
+ buttons.freeze.disabled = profileFrozen;
105
+ }
106
+
107
+ buttons.freeze.addEventListener('click', () => {
108
+ state = 'profile_frozen_for_review';
109
+ frozenAt = new Date().toISOString();
110
+ render();
111
+ });
112
+ buttons.reset.addEventListener('click', () => {
113
+ state = 'draft_profile';
114
+ frozenAt = null;
115
+ fields.name.value = 'Research Buyer Agent';
116
+ fields.type.value = 'research';
117
+ fields.capabilities.value = 'quote-paid-data, prepare-payment-intent, explain-source-cost';
118
+ fields.controller.value = 'Controller address is unknown until a reviewed wallet integration exists.';
119
+ fields.reputation.value = 'External validators should record feedback only after observable outcomes.';
120
+ fields.validation.value = 'Validation status remains unknown until an external validator responds on Arc Testnet.';
121
+ render();
122
+ });
123
+ for (const field of Object.values(fields)) {
124
+ field.addEventListener('input', render);
125
+ }
126
+ render();
@@ -0,0 +1,104 @@
1
+ <!doctype html>
2
+ <html lang="en">
3
+ <head>
4
+ <meta charset="utf-8" />
5
+ <meta name="viewport" content="width=device-width, initial-scale=1" />
6
+ <meta name="description" content="Local-only ERC-8004 agent identity profile preview for Arc Testnet." />
7
+ <title>Agent Identity Profile Preview · Arc MCP Builder Assistant</title>
8
+ <meta http-equiv="Content-Security-Policy" content="default-src 'self'; script-src 'self'; style-src 'self' 'unsafe-inline'; img-src 'self' data:; font-src 'self'; object-src 'none'; base-uri 'none'; form-action 'none'; upgrade-insecure-requests" />
9
+ <link rel="icon" type="image/svg+xml" href="data:image/svg+xml;utf8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 64 64'%3E%3Cdefs%3E%3ClinearGradient id='g' x1='0' y1='0' x2='1' y2='1'%3E%3Cstop offset='0' stop-color='%232563eb'/%3E%3Cstop offset='1' stop-color='%2306b6d4'/%3E%3C/linearGradient%3E%3C/defs%3E%3Crect width='64' height='64' rx='16' fill='url(%23g)'/%3E%3Ctext x='50%25' y='55%25' text-anchor='middle' font-family='Inter,Arial,sans-serif' font-size='38' font-weight='900' fill='white'%3EA%3C/text%3E%3C/svg%3E" />
10
+ <style>
11
+ :root { color-scheme: dark; --bg: #070814; --panel: rgba(255,255,255,.08); --line: rgba(255,255,255,.16); --text: #fbfbff; --muted: #c9c4dc; --accent: #7cf7d4; --violet: #b697ff; --warn: #ffd166; --good: #8dffbd; }
12
+ * { box-sizing: border-box; }
13
+ html { scroll-behavior: smooth; }
14
+ body { margin: 0; min-height: 100vh; color: var(--text); font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; line-height: 1.62; background: radial-gradient(circle at 0% 0%, rgba(124,247,212,.2), transparent 36rem), radial-gradient(circle at 100% 4%, rgba(182,151,255,.22), transparent 38rem), linear-gradient(180deg, #070814 0%, #111832 72%, #070814 100%); }
15
+ a { color: var(--accent); text-decoration: none; }
16
+ a:hover { text-decoration: underline; }
17
+ a:focus-visible, button:focus-visible, input:focus-visible, textarea:focus-visible { outline: 3px solid var(--accent); outline-offset: 3px; }
18
+ .skip-link { position: absolute; left: -9999px; top: 12px; z-index: 10; padding: 10px 14px; border-radius: 999px; background: var(--accent); color: #06110f; font-weight: 950; }
19
+ .skip-link:focus { left: 12px; }
20
+ .wrap { width: min(1160px, calc(100% - 32px)); margin: 0 auto; }
21
+ header { padding: 26px 0 12px; }
22
+ .topbar, nav, .actions { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
23
+ .topbar { justify-content: space-between; }
24
+ .brand { color: var(--text); font-weight: 950; letter-spacing: -.02em; }
25
+ nav a, button, .badge { border: 1px solid var(--line); border-radius: 999px; padding: 10px 14px; background: rgba(255,255,255,.055); color: var(--text); font-weight: 850; }
26
+ button { cursor: pointer; }
27
+ button.primary { background: var(--accent); border-color: transparent; color: #06110f; }
28
+ button:disabled { opacity: .5; cursor: not-allowed; }
29
+ .hero { display: grid; grid-template-columns: 1.04fr .96fr; gap: 18px; padding: 34px 0 22px; }
30
+ .panel, .card { border: 1px solid var(--line); border-radius: 28px; background: linear-gradient(180deg, rgba(255,255,255,.1), var(--panel)); box-shadow: 0 22px 80px rgba(0,0,0,.34); padding: clamp(20px, 4vw, 32px); }
31
+ .eyebrow { color: var(--accent); font-size: .78rem; letter-spacing: .16em; text-transform: uppercase; font-weight: 950; }
32
+ h1, h2, h3 { letter-spacing: -.035em; line-height: 1.08; }
33
+ h1 { margin: 12px 0 14px; font-size: clamp(2.15rem, 7vw, 4.5rem); }
34
+ h2 { margin-top: 0; font-size: clamp(1.35rem, 3vw, 2rem); }
35
+ p, li, label { color: var(--muted); }
36
+ .layout { display: grid; grid-template-columns: .9fr 1.1fr; gap: 18px; align-items: start; padding-bottom: 72px; }
37
+ .grid { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 14px; }
38
+ .field { display: grid; gap: 8px; margin-bottom: 14px; }
39
+ input, textarea { width: 100%; border: 1px solid var(--line); border-radius: 16px; background: rgba(0,0,0,.25); color: var(--text); padding: 12px 14px; font: inherit; }
40
+ textarea { min-height: 86px; resize: vertical; }
41
+ pre { white-space: pre-wrap; word-break: break-word; overflow-x: auto; padding: 18px; border-radius: 18px; border: 1px solid var(--line); background: rgba(0,0,0,.42); color: #eafff8; }
42
+ code { font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace; }
43
+ .badge { display: inline-flex; width: fit-content; color: var(--accent); border-color: rgba(124,247,212,.36); background: rgba(124,247,212,.08); }
44
+ .warning { border-color: rgba(255,209,102,.36); background: rgba(255,209,102,.08); }
45
+ @media (max-width: 920px) { .hero, .layout, .grid { grid-template-columns: 1fr; } nav { display: none; } }
46
+ @media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } *, *::before, *::after { animation: none !important; transition: none !important; } }
47
+ </style>
48
+ </head>
49
+ <body>
50
+ <a class="skip-link" href="#content">Skip to content</a>
51
+ <header class="wrap">
52
+ <div class="topbar">
53
+ <a class="brand" href="../../">Arc MCP Builder Assistant</a>
54
+ <nav aria-label="Identity navigation">
55
+ <a href="../../">Home</a>
56
+ <a href="../../docs/view.html#agent-identity-profile-preview.md">Preview docs</a>
57
+ <a href="../../docs/view.html#agent-identity-erc8004.md">ERC-8004 notes</a>
58
+ <a href="../agent-commerce-flows/">Commerce flows</a>
59
+ </nav>
60
+ </div>
61
+ </header>
62
+ <main id="content" class="wrap">
63
+ <section class="hero">
64
+ <div>
65
+ <p class="eyebrow">ERC-8004 · identity metadata only</p>
66
+ <h1>Draft an agent identity before registration exists.</h1>
67
+ <p>Build a local profile object for Arc Testnet agent-commerce demos. Freeze the profile for review, but do not create wallets, upload metadata, sign, or broadcast.</p>
68
+ <p class="badge" id="status-badge">draft_profile</p>
69
+ </div>
70
+ <div class="panel warning">
71
+ <h2>Safety boundary</h2>
72
+ <ul>
73
+ <li>This preview is unregistered and local-only.</li>
74
+ <li>Owner and validator roles are notes, not wallet authority.</li>
75
+ <li>Future live registration requires a separate PR with explicit human approval and Arc Testnet chain gating.</li>
76
+ </ul>
77
+ </div>
78
+ </section>
79
+ <section class="layout">
80
+ <div class="panel">
81
+ <h2>Profile editor</h2>
82
+ <div class="field"><label for="agent-name">Agent display name</label><input id="agent-name" value="Research Buyer Agent" /></div>
83
+ <div class="field"><label for="agent-type">Agent type</label><input id="agent-type" value="research" /></div>
84
+ <div class="field"><label for="capabilities">Capabilities, comma-separated</label><textarea id="capabilities">quote-paid-data, prepare-payment-intent, explain-source-cost</textarea></div>
85
+ <div class="field"><label for="controller-note">Controller note</label><textarea id="controller-note">Controller address is unknown until a reviewed wallet integration exists.</textarea></div>
86
+ <div class="field"><label for="reputation-note">Reputation note</label><textarea id="reputation-note">External validators should record feedback only after observable outcomes.</textarea></div>
87
+ <div class="field"><label for="validation-note">Validation requirement</label><textarea id="validation-note">Validation status remains unknown until an external validator responds on Arc Testnet.</textarea></div>
88
+ <div class="actions">
89
+ <button class="primary" id="freeze-profile">Freeze profile draft</button>
90
+ <button id="reset-profile">Reset</button>
91
+ </div>
92
+ </div>
93
+ <div>
94
+ <div class="grid">
95
+ <article class="card"><h2>Registries</h2><pre id="registry-json"></pre></article>
96
+ <article class="card"><h2>Safety flags</h2><pre id="safety-json"></pre></article>
97
+ </div>
98
+ <article class="panel" style="margin-top:16px"><h2>Agent identity preview JSON</h2><pre id="profile-json"></pre></article>
99
+ </div>
100
+ </section>
101
+ </main>
102
+ <script src="./identity.js" defer></script>
103
+ </body>
104
+ </html>
@@ -0,0 +1,152 @@
1
+ <!doctype html>
2
+ <html lang="en">
3
+ <head>
4
+ <meta charset="utf-8" />
5
+ <meta name="viewport" content="width=device-width, initial-scale=1" />
6
+ <meta name="description" content="Local Arc Agent Treasury lab for testing x402 earnings, compute budgets, replay protection, and verified agentic loops." />
7
+ <title>Arc Agent Treasury Lab · Arc MCP Builder Assistant</title>
8
+ <meta http-equiv="Content-Security-Policy" content="default-src 'self'; script-src 'self'; style-src 'self' 'unsafe-inline'; img-src 'self' data:; font-src 'self'; object-src 'none'; base-uri 'none'; form-action 'none'; upgrade-insecure-requests" />
9
+ <style>
10
+ :root { color-scheme: dark; --bg: #090b10; --surface: #11151d; --surface-2: #171d27; --line: #293241; --text: #f6f7f9; --muted: #aeb8c7; --green: #5ee6a8; --cyan: #5dc8e8; --amber: #f2c66d; --red: #ff8c8c; --focus: #ffffff; }
11
+ * { box-sizing: border-box; }
12
+ body { margin: 0; min-height: 100vh; background: var(--bg); color: var(--text); font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; line-height: 1.5; }
13
+ a { color: var(--cyan); text-decoration: none; }
14
+ a:hover { text-decoration: underline; }
15
+ button, input, select { font: inherit; }
16
+ button:focus-visible, input:focus-visible, select:focus-visible, a:focus-visible { outline: 3px solid var(--focus); outline-offset: 3px; }
17
+ .skip { position: absolute; left: -9999px; top: 8px; padding: 8px 12px; background: var(--text); color: var(--bg); }
18
+ .skip:focus { left: 8px; }
19
+ .wrap { width: min(1380px, calc(100% - 28px)); margin: 0 auto; }
20
+ header { border-bottom: 1px solid var(--line); background: #0c1016; }
21
+ .topbar { min-height: 62px; display: flex; align-items: center; justify-content: space-between; gap: 16px; }
22
+ .brand { color: var(--text); font-weight: 850; }
23
+ nav { display: flex; gap: 16px; flex-wrap: wrap; font-size: 14px; }
24
+ main { padding: 22px 0 60px; }
25
+ .page-head { display: flex; align-items: end; justify-content: space-between; gap: 24px; margin-bottom: 18px; }
26
+ h1 { margin: 0; font-size: clamp(28px, 4vw, 48px); letter-spacing: 0; }
27
+ h2 { margin: 0 0 14px; font-size: 18px; letter-spacing: 0; }
28
+ p { color: var(--muted); }
29
+ .boundary { max-width: 620px; margin: 0; text-align: right; font-size: 14px; }
30
+ .metrics { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; margin-bottom: 12px; }
31
+ .metric, .panel { border: 1px solid var(--line); background: var(--surface); border-radius: 8px; }
32
+ .metric { padding: 15px; }
33
+ .metric span { display: block; color: var(--muted); font-size: 12px; text-transform: uppercase; font-weight: 800; }
34
+ .metric strong { display: block; margin-top: 7px; font-size: 22px; overflow-wrap: anywhere; }
35
+ .layout { display: grid; grid-template-columns: minmax(320px, .78fr) minmax(420px, 1.22fr); gap: 12px; align-items: start; }
36
+ .stack { display: grid; gap: 12px; min-width: 0; }
37
+ .panel { padding: 17px; min-width: 0; }
38
+ .fields { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 11px; }
39
+ .field { display: grid; gap: 6px; min-width: 0; }
40
+ .field.wide { grid-column: 1 / -1; }
41
+ label { color: var(--muted); font-size: 12px; font-weight: 750; }
42
+ input, select { width: 100%; min-width: 0; border: 1px solid var(--line); border-radius: 6px; background: var(--surface-2); color: var(--text); padding: 10px 11px; }
43
+ input:disabled, select:disabled { opacity: .55; }
44
+ .actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 14px; }
45
+ button { border: 1px solid var(--line); border-radius: 6px; background: var(--surface-2); color: var(--text); padding: 10px 13px; font-weight: 800; cursor: pointer; }
46
+ button.primary { background: var(--green); color: #07130e; border-color: var(--green); }
47
+ button.run { background: var(--cyan); color: #061116; border-color: var(--cyan); }
48
+ button:disabled { opacity: .42; cursor: not-allowed; }
49
+ .status-line { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
50
+ .pill { display: inline-flex; align-items: center; border: 1px solid var(--line); border-radius: 999px; padding: 5px 9px; color: var(--green); font-size: 12px; font-weight: 850; text-transform: uppercase; }
51
+ .decision { margin: 0; padding: 11px; border-left: 3px solid var(--amber); background: var(--surface-2); color: var(--muted); overflow-wrap: anywhere; }
52
+ .decision[data-verdict="approved"] { border-color: var(--green); color: var(--green); }
53
+ .decision[data-verdict="denied"], .decision[data-verdict="error"] { border-color: var(--red); color: var(--red); }
54
+ .ledger { list-style: none; padding: 0; margin: 0; display: grid; gap: 8px; max-height: 330px; overflow: auto; }
55
+ .ledger li { display: grid; grid-template-columns: 160px 1fr; gap: 12px; padding: 9px 0; border-bottom: 1px solid var(--line); }
56
+ .ledger strong { color: var(--cyan); font-size: 12px; text-transform: uppercase; }
57
+ .ledger span { color: var(--muted); overflow-wrap: anywhere; }
58
+ pre { margin: 0; max-height: 620px; overflow: auto; white-space: pre-wrap; word-break: break-word; border: 1px solid var(--line); border-radius: 6px; background: #080b0f; color: #dbe7ef; padding: 13px; font-size: 12px; }
59
+ .safety { margin: 14px 0 0; padding-left: 18px; color: var(--muted); font-size: 13px; }
60
+ @media (max-width: 980px) { .layout { grid-template-columns: 1fr; } .boundary { text-align: left; } .page-head { align-items: start; flex-direction: column; } }
61
+ @media (max-width: 680px) { .metrics, .fields { grid-template-columns: 1fr; } .field.wide { grid-column: auto; } nav { display: none; } .ledger li { grid-template-columns: 1fr; gap: 3px; } }
62
+ @media (prefers-reduced-motion: reduce) { * { scroll-behavior: auto !important; transition: none !important; animation: none !important; } }
63
+ </style>
64
+ </head>
65
+ <body>
66
+ <a class="skip" href="#content">Skip to content</a>
67
+ <header>
68
+ <div class="wrap topbar">
69
+ <a class="brand" href="../../">Arc MCP Builder Assistant</a>
70
+ <nav aria-label="Treasury lab navigation">
71
+ <a href="../../">Home</a>
72
+ <a href="../../docs/view.html#arc-agent-treasury-lab.md">Runbook</a>
73
+ <a href="../../docs/view.html#x402-mcp-manifest.md">x402 boundary</a>
74
+ <a href="../job-escrow-simulator/">Job escrow</a>
75
+ </nav>
76
+ </div>
77
+ </header>
78
+ <main id="content" class="wrap">
79
+ <div class="page-head">
80
+ <div>
81
+ <p class="pill" id="status" data-state="ready">ready</p>
82
+ <h1>Arc Agent Treasury Lab</h1>
83
+ </div>
84
+ <p class="boundary">Local simulation of x402 revenue, bounded compute spending, replay protection, and verify/repair loops. No wallet, custody, mainnet, backend, signing, settlement, or transaction broadcast.</p>
85
+ </div>
86
+
87
+ <section class="metrics" aria-label="Treasury metrics">
88
+ <div class="metric"><span>Balance</span><strong id="metric-balance">0 USDC</strong></div>
89
+ <div class="metric"><span>Earned</span><strong id="metric-earned">0 USDC</strong></div>
90
+ <div class="metric"><span>Compute spent</span><strong id="metric-spent">0 USDC</strong></div>
91
+ <div class="metric"><span>Net change</span><strong id="metric-net">0 USDC</strong></div>
92
+ </section>
93
+
94
+ <div class="layout">
95
+ <div class="stack">
96
+ <section class="panel">
97
+ <h2>Treasury policy</h2>
98
+ <div class="fields">
99
+ <div class="field"><label for="opening-balance">Opening balance, USDC</label><input id="opening-balance" value="5" inputmode="decimal" /></div>
100
+ <div class="field"><label for="reserve">Protected reserve, USDC</label><input id="reserve" value="2" inputmode="decimal" /></div>
101
+ <div class="field"><label for="daily-cap">Daily compute cap, USDC</label><input id="daily-cap" value="2" inputmode="decimal" /></div>
102
+ <div class="field"><label for="single-task-cap">Single-task cap, USDC</label><input id="single-task-cap" value="1" inputmode="decimal" /></div>
103
+ <div class="field"><label for="min-profit">Minimum worst-case profit, USDC</label><input id="min-profit" value="0.10" inputmode="decimal" /></div>
104
+ <div class="field"><label for="policy-attempts">Maximum attempts</label><input id="policy-attempts" type="number" min="1" max="5" value="5" /></div>
105
+ </div>
106
+ </section>
107
+
108
+ <section class="panel">
109
+ <h2>Paid request</h2>
110
+ <div class="fields">
111
+ <div class="field"><label for="request-id">Request ID</label><input id="request-id" value="req-1" /></div>
112
+ <div class="field"><label for="receipt-id">Local x402 receipt ID</label><input id="receipt-id" value="receipt-1" /></div>
113
+ <div class="field wide"><label for="service">Service</label><input id="service" value="Arc documentation research report" /></div>
114
+ <div class="field"><label for="quoted-revenue">Quoted revenue, USDC</label><input id="quoted-revenue" value="1.00" inputmode="decimal" /></div>
115
+ <div class="field"><label for="compute-cost">Compute per attempt, USDC</label><input id="compute-cost" value="0.15" inputmode="decimal" /></div>
116
+ <div class="field"><label for="task-attempts">Task attempt limit</label><input id="task-attempts" type="number" min="1" max="5" value="3" /></div>
117
+ <div class="field"><label for="scenario">Verification scenario</label><select id="scenario"><option value="pass_first">Pass first attempt</option><option value="fail_then_pass" selected>Repair then pass</option><option value="exhaust_retries">Exhaust retries</option></select></div>
118
+ </div>
119
+ <div class="actions">
120
+ <button class="primary" id="review-task">Review paid task</button>
121
+ <button class="run" id="run-loop" disabled>Run verified loop</button>
122
+ <button id="next-task" disabled>Next task</button>
123
+ <button id="reset-lab">Reset lab</button>
124
+ </div>
125
+ </section>
126
+
127
+ <section class="panel">
128
+ <h2>Policy decision</h2>
129
+ <p class="decision" id="decision" data-verdict="idle">No task reviewed yet.</p>
130
+ <ul class="safety">
131
+ <li>Revenue receipt and settlement are local simulation facts only.</li>
132
+ <li>Worst-case compute cost must preserve reserve, daily cap, single-task cap, and minimum profit.</li>
133
+ <li>Failed verification never emits a success claim and requires manual refund review.</li>
134
+ </ul>
135
+ </section>
136
+ </div>
137
+
138
+ <div class="stack">
139
+ <section class="panel">
140
+ <div class="status-line"><h2>Agentic loop ledger</h2><span class="pill">reproduce → execute → verify → repair</span></div>
141
+ <ol class="ledger" id="ledger"></ol>
142
+ </section>
143
+ <section class="panel">
144
+ <h2>Machine-readable treasury snapshot</h2>
145
+ <pre id="snapshot"></pre>
146
+ </section>
147
+ </div>
148
+ </div>
149
+ </main>
150
+ <script src="./treasury.js" defer></script>
151
+ </body>
152
+ </html>