@genobank/biofs 2.6.0 → 2.6.1
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.
- package/dist/commands/admin/register-lab.d.ts.map +1 -1
- package/dist/commands/admin/register-lab.js +27 -3
- package/dist/commands/admin/register-lab.js.map +1 -1
- package/dist/commands/link-clara.d.ts.map +1 -1
- package/dist/commands/link-clara.js +21 -7
- package/dist/commands/link-clara.js.map +1 -1
- package/dist/index.js +1 -1
- package/dist/index.js.map +1 -1
- package/package.json +20 -1
- package/docs/AI_AGENT_MCP_MANUAL.md +0 -1029
- package/docs/USER_MANUAL.md +0 -603
- package/docs/technical-details.html +0 -555
- package/lib/bionfs-client.js +0 -127
- package/lib/consent-manager.js +0 -90
- package/lib/consent-prompt.js +0 -120
- package/presentation/biofs-x402-kite-presentation.html +0 -813
- package/scripts/build_annotator_dictionary.py +0 -353
- package/scripts/deploy-clara-nft.js +0 -37
|
@@ -1,555 +0,0 @@
|
|
|
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.0">
|
|
6
|
-
<title>BioFS x402 + Kite AI - Technical Details</title>
|
|
7
|
-
<style>
|
|
8
|
-
:root {
|
|
9
|
-
--primary: #6366f1;
|
|
10
|
-
--primary-dark: #4f46e5;
|
|
11
|
-
--secondary: #10b981;
|
|
12
|
-
--accent: #f59e0b;
|
|
13
|
-
--bg-dark: #0f172a;
|
|
14
|
-
--bg-card: #1e293b;
|
|
15
|
-
--text: #e2e8f0;
|
|
16
|
-
--text-muted: #94a3b8;
|
|
17
|
-
--border: #334155;
|
|
18
|
-
}
|
|
19
|
-
|
|
20
|
-
* {
|
|
21
|
-
margin: 0;
|
|
22
|
-
padding: 0;
|
|
23
|
-
box-sizing: border-box;
|
|
24
|
-
}
|
|
25
|
-
|
|
26
|
-
body {
|
|
27
|
-
font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
|
|
28
|
-
background: var(--bg-dark);
|
|
29
|
-
color: var(--text);
|
|
30
|
-
line-height: 1.6;
|
|
31
|
-
}
|
|
32
|
-
|
|
33
|
-
.container {
|
|
34
|
-
max-width: 1200px;
|
|
35
|
-
margin: 0 auto;
|
|
36
|
-
padding: 2rem;
|
|
37
|
-
}
|
|
38
|
-
|
|
39
|
-
header {
|
|
40
|
-
text-align: center;
|
|
41
|
-
padding: 3rem 0;
|
|
42
|
-
border-bottom: 1px solid var(--border);
|
|
43
|
-
margin-bottom: 3rem;
|
|
44
|
-
}
|
|
45
|
-
|
|
46
|
-
h1 {
|
|
47
|
-
font-size: 2.5rem;
|
|
48
|
-
background: linear-gradient(135deg, var(--primary), var(--secondary));
|
|
49
|
-
-webkit-background-clip: text;
|
|
50
|
-
-webkit-text-fill-color: transparent;
|
|
51
|
-
background-clip: text;
|
|
52
|
-
margin-bottom: 1rem;
|
|
53
|
-
}
|
|
54
|
-
|
|
55
|
-
.subtitle {
|
|
56
|
-
color: var(--text-muted);
|
|
57
|
-
font-size: 1.2rem;
|
|
58
|
-
}
|
|
59
|
-
|
|
60
|
-
.badge-row {
|
|
61
|
-
display: flex;
|
|
62
|
-
gap: 1rem;
|
|
63
|
-
justify-content: center;
|
|
64
|
-
margin-top: 1.5rem;
|
|
65
|
-
flex-wrap: wrap;
|
|
66
|
-
}
|
|
67
|
-
|
|
68
|
-
.badge {
|
|
69
|
-
background: var(--bg-card);
|
|
70
|
-
border: 1px solid var(--border);
|
|
71
|
-
padding: 0.5rem 1rem;
|
|
72
|
-
border-radius: 9999px;
|
|
73
|
-
font-size: 0.875rem;
|
|
74
|
-
display: flex;
|
|
75
|
-
align-items: center;
|
|
76
|
-
gap: 0.5rem;
|
|
77
|
-
}
|
|
78
|
-
|
|
79
|
-
.badge-primary { border-color: var(--primary); }
|
|
80
|
-
.badge-secondary { border-color: var(--secondary); }
|
|
81
|
-
.badge-accent { border-color: var(--accent); }
|
|
82
|
-
|
|
83
|
-
section {
|
|
84
|
-
margin-bottom: 3rem;
|
|
85
|
-
}
|
|
86
|
-
|
|
87
|
-
h2 {
|
|
88
|
-
font-size: 1.75rem;
|
|
89
|
-
margin-bottom: 1.5rem;
|
|
90
|
-
display: flex;
|
|
91
|
-
align-items: center;
|
|
92
|
-
gap: 0.75rem;
|
|
93
|
-
}
|
|
94
|
-
|
|
95
|
-
h2::before {
|
|
96
|
-
content: '';
|
|
97
|
-
width: 4px;
|
|
98
|
-
height: 1.5rem;
|
|
99
|
-
background: var(--primary);
|
|
100
|
-
border-radius: 2px;
|
|
101
|
-
}
|
|
102
|
-
|
|
103
|
-
.card {
|
|
104
|
-
background: var(--bg-card);
|
|
105
|
-
border: 1px solid var(--border);
|
|
106
|
-
border-radius: 12px;
|
|
107
|
-
padding: 1.5rem;
|
|
108
|
-
margin-bottom: 1.5rem;
|
|
109
|
-
}
|
|
110
|
-
|
|
111
|
-
.card h3 {
|
|
112
|
-
color: var(--primary);
|
|
113
|
-
margin-bottom: 1rem;
|
|
114
|
-
font-size: 1.25rem;
|
|
115
|
-
}
|
|
116
|
-
|
|
117
|
-
.tech-stack {
|
|
118
|
-
display: grid;
|
|
119
|
-
grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
|
|
120
|
-
gap: 1rem;
|
|
121
|
-
}
|
|
122
|
-
|
|
123
|
-
.tech-item {
|
|
124
|
-
background: var(--bg-card);
|
|
125
|
-
border: 1px solid var(--border);
|
|
126
|
-
border-radius: 8px;
|
|
127
|
-
padding: 1rem;
|
|
128
|
-
}
|
|
129
|
-
|
|
130
|
-
.tech-item .layer {
|
|
131
|
-
color: var(--text-muted);
|
|
132
|
-
font-size: 0.75rem;
|
|
133
|
-
text-transform: uppercase;
|
|
134
|
-
letter-spacing: 0.05em;
|
|
135
|
-
margin-bottom: 0.5rem;
|
|
136
|
-
}
|
|
137
|
-
|
|
138
|
-
.tech-item .tech {
|
|
139
|
-
font-weight: 600;
|
|
140
|
-
}
|
|
141
|
-
|
|
142
|
-
pre {
|
|
143
|
-
background: #0d1117;
|
|
144
|
-
border: 1px solid var(--border);
|
|
145
|
-
border-radius: 8px;
|
|
146
|
-
padding: 1rem;
|
|
147
|
-
overflow-x: auto;
|
|
148
|
-
font-family: 'JetBrains Mono', 'Fira Code', monospace;
|
|
149
|
-
font-size: 0.875rem;
|
|
150
|
-
line-height: 1.5;
|
|
151
|
-
}
|
|
152
|
-
|
|
153
|
-
code {
|
|
154
|
-
color: #e6edf3;
|
|
155
|
-
}
|
|
156
|
-
|
|
157
|
-
.comment { color: #8b949e; }
|
|
158
|
-
.keyword { color: #ff7b72; }
|
|
159
|
-
.string { color: #a5d6ff; }
|
|
160
|
-
.function { color: #d2a8ff; }
|
|
161
|
-
.number { color: #79c0ff; }
|
|
162
|
-
.type { color: #7ee787; }
|
|
163
|
-
|
|
164
|
-
.architecture {
|
|
165
|
-
background: #0d1117;
|
|
166
|
-
border: 1px solid var(--border);
|
|
167
|
-
border-radius: 12px;
|
|
168
|
-
padding: 2rem;
|
|
169
|
-
font-family: 'JetBrains Mono', monospace;
|
|
170
|
-
font-size: 0.8rem;
|
|
171
|
-
white-space: pre;
|
|
172
|
-
overflow-x: auto;
|
|
173
|
-
line-height: 1.4;
|
|
174
|
-
}
|
|
175
|
-
|
|
176
|
-
.flow-diagram {
|
|
177
|
-
display: flex;
|
|
178
|
-
flex-direction: column;
|
|
179
|
-
gap: 1rem;
|
|
180
|
-
align-items: center;
|
|
181
|
-
}
|
|
182
|
-
|
|
183
|
-
.flow-box {
|
|
184
|
-
background: var(--bg-card);
|
|
185
|
-
border: 2px solid var(--primary);
|
|
186
|
-
border-radius: 12px;
|
|
187
|
-
padding: 1rem 2rem;
|
|
188
|
-
text-align: center;
|
|
189
|
-
min-width: 300px;
|
|
190
|
-
}
|
|
191
|
-
|
|
192
|
-
.flow-arrow {
|
|
193
|
-
color: var(--primary);
|
|
194
|
-
font-size: 1.5rem;
|
|
195
|
-
}
|
|
196
|
-
|
|
197
|
-
.integration-grid {
|
|
198
|
-
display: grid;
|
|
199
|
-
grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
|
|
200
|
-
gap: 1.5rem;
|
|
201
|
-
}
|
|
202
|
-
|
|
203
|
-
table {
|
|
204
|
-
width: 100%;
|
|
205
|
-
border-collapse: collapse;
|
|
206
|
-
margin: 1rem 0;
|
|
207
|
-
}
|
|
208
|
-
|
|
209
|
-
th, td {
|
|
210
|
-
padding: 0.75rem 1rem;
|
|
211
|
-
text-align: left;
|
|
212
|
-
border-bottom: 1px solid var(--border);
|
|
213
|
-
}
|
|
214
|
-
|
|
215
|
-
th {
|
|
216
|
-
background: var(--bg-card);
|
|
217
|
-
color: var(--text-muted);
|
|
218
|
-
font-size: 0.875rem;
|
|
219
|
-
text-transform: uppercase;
|
|
220
|
-
letter-spacing: 0.05em;
|
|
221
|
-
}
|
|
222
|
-
|
|
223
|
-
td code {
|
|
224
|
-
background: #0d1117;
|
|
225
|
-
padding: 0.25rem 0.5rem;
|
|
226
|
-
border-radius: 4px;
|
|
227
|
-
font-size: 0.8rem;
|
|
228
|
-
}
|
|
229
|
-
|
|
230
|
-
.highlight-box {
|
|
231
|
-
background: linear-gradient(135deg, rgba(99, 102, 241, 0.1), rgba(16, 185, 129, 0.1));
|
|
232
|
-
border: 1px solid var(--primary);
|
|
233
|
-
border-radius: 12px;
|
|
234
|
-
padding: 1.5rem;
|
|
235
|
-
margin: 1.5rem 0;
|
|
236
|
-
}
|
|
237
|
-
|
|
238
|
-
.highlight-box h4 {
|
|
239
|
-
color: var(--secondary);
|
|
240
|
-
margin-bottom: 0.75rem;
|
|
241
|
-
}
|
|
242
|
-
|
|
243
|
-
.npm-install {
|
|
244
|
-
background: linear-gradient(135deg, var(--bg-card), #1a1a2e);
|
|
245
|
-
border: 2px solid var(--secondary);
|
|
246
|
-
border-radius: 12px;
|
|
247
|
-
padding: 2rem;
|
|
248
|
-
text-align: center;
|
|
249
|
-
margin: 2rem 0;
|
|
250
|
-
}
|
|
251
|
-
|
|
252
|
-
.npm-install code {
|
|
253
|
-
background: #0d1117;
|
|
254
|
-
padding: 0.75rem 1.5rem;
|
|
255
|
-
border-radius: 8px;
|
|
256
|
-
font-size: 1.1rem;
|
|
257
|
-
display: inline-block;
|
|
258
|
-
}
|
|
259
|
-
|
|
260
|
-
.innovation-list {
|
|
261
|
-
list-style: none;
|
|
262
|
-
}
|
|
263
|
-
|
|
264
|
-
.innovation-list li {
|
|
265
|
-
padding: 1rem;
|
|
266
|
-
margin-bottom: 1rem;
|
|
267
|
-
background: var(--bg-card);
|
|
268
|
-
border-left: 3px solid var(--accent);
|
|
269
|
-
border-radius: 0 8px 8px 0;
|
|
270
|
-
}
|
|
271
|
-
|
|
272
|
-
.innovation-list li strong {
|
|
273
|
-
color: var(--accent);
|
|
274
|
-
display: block;
|
|
275
|
-
margin-bottom: 0.5rem;
|
|
276
|
-
}
|
|
277
|
-
|
|
278
|
-
footer {
|
|
279
|
-
text-align: center;
|
|
280
|
-
padding: 2rem;
|
|
281
|
-
border-top: 1px solid var(--border);
|
|
282
|
-
margin-top: 3rem;
|
|
283
|
-
color: var(--text-muted);
|
|
284
|
-
}
|
|
285
|
-
|
|
286
|
-
footer a {
|
|
287
|
-
color: var(--primary);
|
|
288
|
-
text-decoration: none;
|
|
289
|
-
}
|
|
290
|
-
|
|
291
|
-
footer a:hover {
|
|
292
|
-
text-decoration: underline;
|
|
293
|
-
}
|
|
294
|
-
|
|
295
|
-
@media (max-width: 768px) {
|
|
296
|
-
.container { padding: 1rem; }
|
|
297
|
-
h1 { font-size: 1.75rem; }
|
|
298
|
-
.architecture { font-size: 0.65rem; }
|
|
299
|
-
}
|
|
300
|
-
</style>
|
|
301
|
-
</head>
|
|
302
|
-
<body>
|
|
303
|
-
<div class="container">
|
|
304
|
-
<header>
|
|
305
|
-
<h1>BioFS x402 + Kite AI</h1>
|
|
306
|
-
<p class="subtitle">Autonomous AI Agents for Genomic Data with HTTP 402 Micropayments</p>
|
|
307
|
-
<div class="badge-row">
|
|
308
|
-
<span class="badge badge-primary">x402 Protocol</span>
|
|
309
|
-
<span class="badge badge-secondary">Kite AI Passports</span>
|
|
310
|
-
<span class="badge badge-accent">Sequentia Protocol</span>
|
|
311
|
-
<span class="badge">Hack2Build 2025</span>
|
|
312
|
-
</div>
|
|
313
|
-
</header>
|
|
314
|
-
|
|
315
|
-
<section>
|
|
316
|
-
<h2>Tech Stack</h2>
|
|
317
|
-
<div class="tech-stack">
|
|
318
|
-
<div class="tech-item">
|
|
319
|
-
<div class="layer">CLI Framework</div>
|
|
320
|
-
<div class="tech">TypeScript + Commander.js</div>
|
|
321
|
-
</div>
|
|
322
|
-
<div class="tech-item">
|
|
323
|
-
<div class="layer">Blockchain</div>
|
|
324
|
-
<div class="tech">ethers.js v6, Sequentia L1, Avalanche</div>
|
|
325
|
-
</div>
|
|
326
|
-
<div class="tech-item">
|
|
327
|
-
<div class="layer">Smart Contracts</div>
|
|
328
|
-
<div class="tech">Solidity 0.8.19, OpenZeppelin, Hardhat</div>
|
|
329
|
-
</div>
|
|
330
|
-
<div class="tech-item">
|
|
331
|
-
<div class="layer">Storage</div>
|
|
332
|
-
<div class="tech">AWS S3, MongoDB</div>
|
|
333
|
-
</div>
|
|
334
|
-
<div class="tech-item">
|
|
335
|
-
<div class="layer">AI Integration</div>
|
|
336
|
-
<div class="tech">Anthropic Claude (Haiku/Sonnet/Opus)</div>
|
|
337
|
-
</div>
|
|
338
|
-
<div class="tech-item">
|
|
339
|
-
<div class="layer">Payment Protocol</div>
|
|
340
|
-
<div class="tech">x402 HTTP 402, EIP-712 Signatures</div>
|
|
341
|
-
</div>
|
|
342
|
-
</div>
|
|
343
|
-
</section>
|
|
344
|
-
|
|
345
|
-
<section>
|
|
346
|
-
<h2>Architecture</h2>
|
|
347
|
-
<div class="architecture">
|
|
348
|
-
┌─────────────────────────────────────────────────────────────────────────┐
|
|
349
|
-
│ BioFS CLI (Orchestrator) │
|
|
350
|
-
│ npm i -g @genobank/biofs@2.5.0 • biofs --help │
|
|
351
|
-
└───────────────────────────────────┬─────────────────────────────────────┘
|
|
352
|
-
│
|
|
353
|
-
┌───────────────────────────┼───────────────────────────┐
|
|
354
|
-
│ │ │
|
|
355
|
-
▼ ▼ ▼
|
|
356
|
-
┌──────────────────┐ ┌──────────────────────┐ ┌──────────────────────┐
|
|
357
|
-
│ Kite AI Agent │ │ x402 PaymentRouter │ │ Sequentia Protocol │
|
|
358
|
-
│ Passports │ │ (Atomic USDC) │ │ (BioCID + Consent) │
|
|
359
|
-
│ │ │ │ │ │
|
|
360
|
-
│ • DID identity │ │ • HTTP 402 flow │ │ • BioCIDRegistry │
|
|
361
|
-
│ • BIP-32 wallets │ │ • Multi-recipient │ │ • ConsentManager │
|
|
362
|
-
│ • SLA contracts │ │ • Revenue sharing │ │ • PaymentRouter │
|
|
363
|
-
│ • Delegation │ │ • Escrow + refund │ │ • ClaraJobNFT │
|
|
364
|
-
└──────────────────┘ └──────────────────────┘ └──────────────────────┘
|
|
365
|
-
</div>
|
|
366
|
-
</section>
|
|
367
|
-
|
|
368
|
-
<section>
|
|
369
|
-
<h2>Key Integrations</h2>
|
|
370
|
-
<div class="integration-grid">
|
|
371
|
-
<div class="card">
|
|
372
|
-
<h3>1. x402 Protocol (HTTP 402 Payment Required)</h3>
|
|
373
|
-
<pre><code><span class="comment">// Client requests service</span>
|
|
374
|
-
<span class="keyword">const</span> response = <span class="keyword">await</span> axios.<span class="function">post</span>(url, data);
|
|
375
|
-
|
|
376
|
-
<span class="comment">// Server returns 402 with payment requirements</span>
|
|
377
|
-
<span class="keyword">if</span> (response.status === <span class="number">402</span>) {
|
|
378
|
-
<span class="keyword">const</span> { amount, receiver, network } = response.data;
|
|
379
|
-
|
|
380
|
-
<span class="comment">// Client signs EIP-712 payment</span>
|
|
381
|
-
<span class="keyword">const</span> signature = <span class="keyword">await</span> wallet.<span class="function">signTypedData</span>(
|
|
382
|
-
domain, types, paymentData
|
|
383
|
-
);
|
|
384
|
-
|
|
385
|
-
<span class="comment">// Retry with X-PAYMENT header</span>
|
|
386
|
-
<span class="keyword">await</span> axios.<span class="function">post</span>(url, data, {
|
|
387
|
-
headers: { <span class="string">'X-PAYMENT'</span>: paymentHeader }
|
|
388
|
-
});
|
|
389
|
-
}</code></pre>
|
|
390
|
-
</div>
|
|
391
|
-
|
|
392
|
-
<div class="card">
|
|
393
|
-
<h3>2. Kite AI Agent Passports</h3>
|
|
394
|
-
<pre><code><span class="keyword">interface</span> <span class="type">KitePassport</span> {
|
|
395
|
-
<span class="comment">// DID format: did:kite:namespace/agent-version</span>
|
|
396
|
-
did: <span class="string">"did:kite:genobank.eth/augenomics-clara-v1"</span>;
|
|
397
|
-
|
|
398
|
-
<span class="comment">// BIP-32 derived wallet</span>
|
|
399
|
-
walletAddress: <span class="string">"0x..."</span>;
|
|
400
|
-
derivationPath: <span class="string">"m/44'/60'/0'/0/1"</span>;
|
|
401
|
-
|
|
402
|
-
<span class="comment">// Capabilities & spending limits</span>
|
|
403
|
-
capabilities: [<span class="string">'fastq-to-vcf'</span>, <span class="string">'variant-calling'</span>];
|
|
404
|
-
spendingCaps: {
|
|
405
|
-
maxPerTransaction: <span class="string">'$100'</span>,
|
|
406
|
-
maxDaily: <span class="string">'$1000'</span>
|
|
407
|
-
};
|
|
408
|
-
}</code></pre>
|
|
409
|
-
</div>
|
|
410
|
-
|
|
411
|
-
<div class="card">
|
|
412
|
-
<h3>3. BioCID Universal Identifier</h3>
|
|
413
|
-
<pre><code><span class="comment">// Format: biocid://wallet/type/identifier</span>
|
|
414
|
-
<span class="keyword">static</span> <span class="function">generate</span>(wallet: <span class="type">string</span>, filename: <span class="type">string</span>) {
|
|
415
|
-
<span class="keyword">const</span> type = <span class="keyword">this</span>.<span class="function">detectFileType</span>(filename);
|
|
416
|
-
<span class="keyword">return</span> <span class="string">`biocid://</span>${wallet}<span class="string">/</span>${type}<span class="string">/</span>${filename}<span class="string">`</span>;
|
|
417
|
-
}
|
|
418
|
-
|
|
419
|
-
<span class="comment">// Examples:</span>
|
|
420
|
-
<span class="comment">// biocid://0x5f5a.../vcf/sample.vcf.gz</span>
|
|
421
|
-
<span class="comment">// biocid://0x5f5a.../fastq/reads_R1.fastq.gz</span>
|
|
422
|
-
<span class="comment">// biocid://0x5f5a.../bam/aligned.bam</span></code></pre>
|
|
423
|
-
</div>
|
|
424
|
-
|
|
425
|
-
<div class="card">
|
|
426
|
-
<h3>4. Atomic Multi-Recipient Payments</h3>
|
|
427
|
-
<pre><code><span class="comment">// $1000 genomic analysis payment split</span>
|
|
428
|
-
<span class="keyword">const</span> recipients = [
|
|
429
|
-
{ recipient: labWallet, amount: <span class="string">"700"</span> }, <span class="comment">// 70%</span>
|
|
430
|
-
{ recipient: cravatWallet, amount: <span class="string">"200"</span> }, <span class="comment">// 20%</span>
|
|
431
|
-
{ recipient: platformWallet, amount: <span class="string">"100"</span> } <span class="comment">// 10%</span>
|
|
432
|
-
];
|
|
433
|
-
|
|
434
|
-
<span class="comment">// ATOMIC: All succeed or all fail</span>
|
|
435
|
-
<span class="keyword">await</span> router.<span class="function">createRoute</span>(jobId, <span class="number">1000</span>, recipients);
|
|
436
|
-
<span class="keyword">await</span> router.<span class="function">executeRoute</span>(jobId);</code></pre>
|
|
437
|
-
</div>
|
|
438
|
-
</div>
|
|
439
|
-
</section>
|
|
440
|
-
|
|
441
|
-
<section>
|
|
442
|
-
<h2>Innovative Solutions</h2>
|
|
443
|
-
<ul class="innovation-list">
|
|
444
|
-
<li>
|
|
445
|
-
<strong>BIP-32 Agent Derivation Hierarchy</strong>
|
|
446
|
-
Single master seed derives all agent wallets deterministically. One backup secures entire agent fleet. Path convention: <code>m/44'/60'/0'/0/{agent_index}</code>
|
|
447
|
-
</li>
|
|
448
|
-
<li>
|
|
449
|
-
<strong>HTTP 402 → Blockchain Atomic Bridge</strong>
|
|
450
|
-
Extended standard x402 single-recipient to multi-recipient via on-chain PaymentRouter. Payments execute atomically (all-or-nothing) with automatic refund on failure.
|
|
451
|
-
</li>
|
|
452
|
-
<li>
|
|
453
|
-
<strong>Data Minimization Pattern</strong>
|
|
454
|
-
Raw FASTQ files (100GB+) processed in secure enclave, only VCF derivatives returned. Original deleted, hash remains on-chain for provenance. GDPR Article 17 compliant.
|
|
455
|
-
</li>
|
|
456
|
-
<li>
|
|
457
|
-
<strong>Standing Intent + Delegation Tokens</strong>
|
|
458
|
-
User signs once (30-day Standing Intent with spending caps). Agents create short-lived Delegation Tokens (60s TTL) per operation. Zero user interaction for micropayments within approved caps.
|
|
459
|
-
</li>
|
|
460
|
-
</ul>
|
|
461
|
-
</section>
|
|
462
|
-
|
|
463
|
-
<section>
|
|
464
|
-
<h2>Pre-configured AI Agents</h2>
|
|
465
|
-
<table>
|
|
466
|
-
<thead>
|
|
467
|
-
<tr>
|
|
468
|
-
<th>Agent</th>
|
|
469
|
-
<th>Service</th>
|
|
470
|
-
<th>Price</th>
|
|
471
|
-
<th>SLA</th>
|
|
472
|
-
</tr>
|
|
473
|
-
</thead>
|
|
474
|
-
<tbody>
|
|
475
|
-
<tr>
|
|
476
|
-
<td><code>biofs-orchestrator</code></td>
|
|
477
|
-
<td>CLI Orchestration</td>
|
|
478
|
-
<td>Free</td>
|
|
479
|
-
<td>5s response, 99.9% uptime</td>
|
|
480
|
-
</tr>
|
|
481
|
-
<tr>
|
|
482
|
-
<td><code>augenomics-clara</code></td>
|
|
483
|
-
<td>GPU Variant Calling</td>
|
|
484
|
-
<td>$0.25</td>
|
|
485
|
-
<td>2hr max, 50% penalty on timeout</td>
|
|
486
|
-
</tr>
|
|
487
|
-
<tr>
|
|
488
|
-
<td><code>opencravat-annotator</code></td>
|
|
489
|
-
<td>VCF Annotation</td>
|
|
490
|
-
<td>$0.05</td>
|
|
491
|
-
<td>30min max, 25% penalty on timeout</td>
|
|
492
|
-
</tr>
|
|
493
|
-
<tr>
|
|
494
|
-
<td><code>claude-ai</code></td>
|
|
495
|
-
<td>Genomic Analysis</td>
|
|
496
|
-
<td>$0.01</td>
|
|
497
|
-
<td>60s response, 99.9% accuracy</td>
|
|
498
|
-
</tr>
|
|
499
|
-
</tbody>
|
|
500
|
-
</table>
|
|
501
|
-
</section>
|
|
502
|
-
|
|
503
|
-
<section>
|
|
504
|
-
<h2>Deployed Infrastructure</h2>
|
|
505
|
-
<table>
|
|
506
|
-
<thead>
|
|
507
|
-
<tr>
|
|
508
|
-
<th>Component</th>
|
|
509
|
-
<th>Network</th>
|
|
510
|
-
<th>Address</th>
|
|
511
|
-
</tr>
|
|
512
|
-
</thead>
|
|
513
|
-
<tbody>
|
|
514
|
-
<tr>
|
|
515
|
-
<td>ClaraJobNFT V2</td>
|
|
516
|
-
<td>Sequentia L1</td>
|
|
517
|
-
<td><code>0x8B0a66A840364c7D5956E72f9c6fB363E0341AEF</code></td>
|
|
518
|
-
</tr>
|
|
519
|
-
<tr>
|
|
520
|
-
<td>PaymentRouter</td>
|
|
521
|
-
<td>Sequentia L1</td>
|
|
522
|
-
<td><code>0x4b46D8A0533bc17503349F86a909C2FEcFD04489</code></td>
|
|
523
|
-
</tr>
|
|
524
|
-
<tr>
|
|
525
|
-
<td>SeqUSDC</td>
|
|
526
|
-
<td>Sequentia L1</td>
|
|
527
|
-
<td><code>0xD837B344e931cc265ec54879A0B388DE6F0015c9</code></td>
|
|
528
|
-
</tr>
|
|
529
|
-
<tr>
|
|
530
|
-
<td>BioFS Node</td>
|
|
531
|
-
<td>P2P Network</td>
|
|
532
|
-
<td>NFS + QUIC protocol</td>
|
|
533
|
-
</tr>
|
|
534
|
-
</tbody>
|
|
535
|
-
</table>
|
|
536
|
-
</section>
|
|
537
|
-
|
|
538
|
-
<div class="npm-install">
|
|
539
|
-
<h3 style="margin-bottom: 1rem; color: var(--secondary);">Get Started</h3>
|
|
540
|
-
<code>npm install -g @genobank/biofs@2.5.0 && biofs --help</code>
|
|
541
|
-
</div>
|
|
542
|
-
|
|
543
|
-
<footer>
|
|
544
|
-
<p>
|
|
545
|
-
Built by <a href="https://genobank.io">GenoBank.io</a> |
|
|
546
|
-
<a href="https://github.com/Genobank/biofs-cli">GitHub</a> |
|
|
547
|
-
<a href="https://www.npmjs.com/package/@genobank/biofs">npm</a>
|
|
548
|
-
</p>
|
|
549
|
-
<p style="margin-top: 0.5rem;">Hack2Build 2025</p>
|
|
550
|
-
</footer>
|
|
551
|
-
</div>
|
|
552
|
-
</body>
|
|
553
|
-
</html>
|
|
554
|
-
|
|
555
|
-
|
package/lib/bionfs-client.js
DELETED
|
@@ -1,127 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* BioNFS Client - Blockchain-Authenticated File Streaming
|
|
3
|
-
* Handles authentication and file streaming via BioNFS protocol
|
|
4
|
-
*/
|
|
5
|
-
|
|
6
|
-
const axios = require('axios');
|
|
7
|
-
const fs = require('fs');
|
|
8
|
-
const path = require('path');
|
|
9
|
-
const chalk = require('chalk');
|
|
10
|
-
|
|
11
|
-
const API_BASE = process.env.GENOBANK_API_URL || 'https://genobank.app';
|
|
12
|
-
|
|
13
|
-
class BioNFSClient {
|
|
14
|
-
constructor() {
|
|
15
|
-
this.sessionId = null;
|
|
16
|
-
this.permissions = null;
|
|
17
|
-
}
|
|
18
|
-
|
|
19
|
-
/**
|
|
20
|
-
* Authenticate with BioNFS server using Web3 signature
|
|
21
|
-
*/
|
|
22
|
-
async authenticate(wallet, signature) {
|
|
23
|
-
try {
|
|
24
|
-
const response = await axios.post(`${API_BASE}/bionfs/v1/auth`, {
|
|
25
|
-
wallet: wallet,
|
|
26
|
-
signature: signature,
|
|
27
|
-
message: 'I want to access BioNFS'
|
|
28
|
-
});
|
|
29
|
-
|
|
30
|
-
this.sessionId = response.data.session_id;
|
|
31
|
-
this.permissions = response.data.permissions;
|
|
32
|
-
|
|
33
|
-
return this.sessionId;
|
|
34
|
-
} catch (error) {
|
|
35
|
-
// If BioNFS endpoint doesn't exist, use fallback
|
|
36
|
-
console.log(chalk.gray('BioNFS server not available, using direct API access'));
|
|
37
|
-
return null;
|
|
38
|
-
}
|
|
39
|
-
}
|
|
40
|
-
|
|
41
|
-
/**
|
|
42
|
-
* Stream file by IP Asset ID or BioCID
|
|
43
|
-
*/
|
|
44
|
-
async streamFile(identifier, outputPath, userSignature) {
|
|
45
|
-
// Parse identifier
|
|
46
|
-
const ipAssetId = this.parseIdentifier(identifier);
|
|
47
|
-
|
|
48
|
-
if (this.sessionId) {
|
|
49
|
-
// Use BioNFS streaming endpoint
|
|
50
|
-
return await this.streamViaBioNFS(ipAssetId, outputPath);
|
|
51
|
-
} else {
|
|
52
|
-
// Fallback to direct API download
|
|
53
|
-
return await this.downloadViaAPI(ipAssetId, outputPath, userSignature);
|
|
54
|
-
}
|
|
55
|
-
}
|
|
56
|
-
|
|
57
|
-
/**
|
|
58
|
-
* Stream via BioNFS server (if available)
|
|
59
|
-
*/
|
|
60
|
-
async streamViaBioNFS(ipAssetId, outputPath) {
|
|
61
|
-
const response = await axios.get(
|
|
62
|
-
`${API_BASE}/bionfs/v1/stream/${ipAssetId}`,
|
|
63
|
-
{
|
|
64
|
-
headers: { 'X-Session-ID': this.sessionId },
|
|
65
|
-
responseType: 'stream'
|
|
66
|
-
}
|
|
67
|
-
);
|
|
68
|
-
|
|
69
|
-
const writer = fs.createWriteStream(outputPath);
|
|
70
|
-
response.data.pipe(writer);
|
|
71
|
-
|
|
72
|
-
return new Promise((resolve, reject) => {
|
|
73
|
-
writer.on('finish', () => resolve(outputPath));
|
|
74
|
-
writer.on('error', reject);
|
|
75
|
-
});
|
|
76
|
-
}
|
|
77
|
-
|
|
78
|
-
/**
|
|
79
|
-
* Fallback: Download via existing API
|
|
80
|
-
*/
|
|
81
|
-
async downloadViaAPI(ipAssetId, outputPath, userSignature) {
|
|
82
|
-
// Use existing /api_bioip/download_granted_file endpoint
|
|
83
|
-
const response = await axios.get(
|
|
84
|
-
`${API_BASE}/api_bioip/download_granted_file`,
|
|
85
|
-
{
|
|
86
|
-
params: {
|
|
87
|
-
user_signature: userSignature,
|
|
88
|
-
ip_id: ipAssetId
|
|
89
|
-
},
|
|
90
|
-
responseType: 'stream'
|
|
91
|
-
}
|
|
92
|
-
);
|
|
93
|
-
|
|
94
|
-
const writer = fs.createWriteStream(outputPath);
|
|
95
|
-
response.data.pipe(writer);
|
|
96
|
-
|
|
97
|
-
return new Promise((resolve, reject) => {
|
|
98
|
-
writer.on('finish', () => resolve(outputPath));
|
|
99
|
-
writer.on('error', reject);
|
|
100
|
-
});
|
|
101
|
-
}
|
|
102
|
-
|
|
103
|
-
/**
|
|
104
|
-
* Parse BioCID or IP Asset ID
|
|
105
|
-
* Formats:
|
|
106
|
-
* - biocid://OWNER/bioip/IP_ASSET_ID
|
|
107
|
-
* - 0xIP_ASSET_ID
|
|
108
|
-
*/
|
|
109
|
-
parseIdentifier(identifier) {
|
|
110
|
-
// If it's a BioCID, extract IP asset ID
|
|
111
|
-
const biocidMatch = identifier.match(/biocid:\/\/0x[a-fA-F0-9]{40}\/bioip\/(0x[a-fA-F0-9]{40})/);
|
|
112
|
-
if (biocidMatch) {
|
|
113
|
-
return biocidMatch[1];
|
|
114
|
-
}
|
|
115
|
-
|
|
116
|
-
// If it's already an address, return it
|
|
117
|
-
if (identifier.startsWith('0x') && identifier.length === 42) {
|
|
118
|
-
return identifier;
|
|
119
|
-
}
|
|
120
|
-
|
|
121
|
-
throw new Error('Invalid identifier format. Use BioCID or IP Asset ID (0x...)');
|
|
122
|
-
}
|
|
123
|
-
}
|
|
124
|
-
|
|
125
|
-
module.exports = BioNFSClient;
|
|
126
|
-
|
|
127
|
-
|