-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathagent-api.html
More file actions
821 lines (751 loc) · 30.9 KB
/
agent-api.html
File metadata and controls
821 lines (751 loc) · 30.9 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta name="robots" content="index, follow">
<title>Clavis Agent API — Document Analysis for AI Agents</title>
<!-- Open Graph -->
<meta property="og:type" content="website">
<meta property="og:title" content="Clavis Agent API — Document Analysis for AI Agents">
<meta property="og:description" content="Free, agent-native API for contract risk analysis, text summarization, document diff, and structured data extraction. No auth required.">
<meta property="og:url" content="https://citriac.github.io/agent-api/">
<meta property="og:site_name" content="Clavis Tools">
<meta name="description" content="Free, agent-native API for contract risk analysis, text summarization, document diff, and structured data extraction. No auth required.">
<style>
:root {
--bg: #0d1117;
--surface: #161b22;
--border: #30363d;
--text: #e6edf3;
--muted: #8b949e;
--accent: #58a6ff;
--green: #3fb950;
--red: #f85149;
--yellow: #d29922;
--purple: #bc8cff;
--code-bg: #1f2937;
}
* { box-sizing: border-box; margin: 0; padding: 0; }
body {
font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif;
background: var(--bg);
color: var(--text);
line-height: 1.6;
}
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
/* NAV */
nav {
border-bottom: 1px solid var(--border);
padding: 0 2rem;
display: flex;
align-items: center;
gap: 2rem;
height: 56px;
position: sticky;
top: 0;
background: rgba(13,17,23,0.9);
backdrop-filter: blur(8px);
z-index: 100;
}
.nav-brand { font-weight: 700; font-size: 1rem; color: var(--text); }
.nav-brand span { color: var(--accent); }
nav a { font-size: 0.875rem; color: var(--muted); }
nav a:hover { color: var(--text); text-decoration: none; }
.nav-cta {
margin-left: auto;
background: var(--accent);
color: #0d1117 !important;
padding: 6px 16px;
border-radius: 6px;
font-weight: 600;
font-size: 0.85rem;
}
.nav-cta:hover { opacity: 0.85; text-decoration: none !important; }
/* HERO */
.hero {
max-width: 860px;
margin: 0 auto;
padding: 80px 2rem 60px;
text-align: center;
}
.badge {
display: inline-block;
background: rgba(88,166,255,0.1);
border: 1px solid rgba(88,166,255,0.3);
color: var(--accent);
font-size: 0.75rem;
font-weight: 600;
padding: 4px 12px;
border-radius: 20px;
margin-bottom: 20px;
letter-spacing: 0.05em;
text-transform: uppercase;
}
.hero h1 {
font-size: clamp(2rem, 5vw, 3rem);
font-weight: 800;
line-height: 1.2;
margin-bottom: 20px;
}
.hero h1 em { color: var(--accent); font-style: normal; }
.hero p {
font-size: 1.1rem;
color: var(--muted);
max-width: 600px;
margin: 0 auto 32px;
}
.hero-actions { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }
.btn-primary {
background: var(--accent);
color: #0d1117;
font-weight: 700;
padding: 10px 24px;
border-radius: 8px;
font-size: 0.95rem;
cursor: pointer;
border: none;
transition: opacity 0.15s;
}
.btn-primary:hover { opacity: 0.85; text-decoration: none; }
.btn-outline {
background: transparent;
color: var(--text);
font-weight: 600;
padding: 10px 24px;
border-radius: 8px;
font-size: 0.95rem;
border: 1px solid var(--border);
cursor: pointer;
transition: border-color 0.15s;
text-decoration: none;
display: inline-block;
}
.btn-outline:hover { border-color: var(--accent); color: var(--accent); text-decoration: none; }
/* STATS */
.stats {
display: flex;
justify-content: center;
gap: 48px;
padding: 32px 2rem;
border-top: 1px solid var(--border);
border-bottom: 1px solid var(--border);
max-width: 860px;
margin: 0 auto;
flex-wrap: wrap;
}
.stat-item { text-align: center; }
.stat-number { font-size: 1.8rem; font-weight: 800; color: var(--text); }
.stat-label { font-size: 0.8rem; color: var(--muted); margin-top: 2px; text-transform: uppercase; letter-spacing: 0.05em; }
/* ENDPOINTS */
.section { max-width: 900px; margin: 0 auto; padding: 60px 2rem; }
.section-title {
font-size: 1.5rem;
font-weight: 700;
margin-bottom: 8px;
}
.section-sub { color: var(--muted); margin-bottom: 36px; font-size: 0.95rem; }
.endpoint-grid { display: grid; gap: 16px; }
.endpoint-card {
background: var(--surface);
border: 1px solid var(--border);
border-radius: 12px;
padding: 20px 24px;
display: grid;
grid-template-columns: auto 1fr auto;
gap: 12px;
align-items: start;
transition: border-color 0.2s;
cursor: pointer;
}
.endpoint-card:hover { border-color: var(--accent); }
.method-badge {
font-family: 'SF Mono', 'Fira Code', monospace;
font-size: 0.7rem;
font-weight: 700;
padding: 3px 8px;
border-radius: 4px;
margin-top: 2px;
}
.method-get { background: rgba(63,185,80,0.2); color: var(--green); }
.method-post { background: rgba(88,166,255,0.2); color: var(--accent); }
.endpoint-path {
font-family: 'SF Mono', 'Fira Code', monospace;
font-size: 0.95rem;
font-weight: 600;
color: var(--text);
}
.endpoint-desc { font-size: 0.85rem; color: var(--muted); margin-top: 4px; }
.endpoint-arrow { color: var(--muted); font-size: 1.2rem; margin-top: 4px; }
.severity-high { color: var(--red); }
.severity-medium { color: var(--yellow); }
.severity-low { color: var(--green); }
/* PLAYGROUND */
.playground {
background: var(--surface);
border: 1px solid var(--border);
border-radius: 16px;
overflow: hidden;
max-width: 900px;
margin: 0 auto;
}
.playground-tabs {
display: flex;
border-bottom: 1px solid var(--border);
background: var(--bg);
overflow-x: auto;
}
.tab {
padding: 12px 20px;
font-size: 0.85rem;
font-weight: 500;
color: var(--muted);
cursor: pointer;
border-bottom: 2px solid transparent;
white-space: nowrap;
background: none;
border-top: none;
border-left: none;
border-right: none;
transition: color 0.15s;
}
.tab:hover { color: var(--text); }
.tab.active { color: var(--accent); border-bottom-color: var(--accent); }
.playground-body { padding: 24px; }
.panel { display: none; }
.panel.active { display: block; }
.panel-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
@media(max-width: 600px) { .panel-grid { grid-template-columns: 1fr; } }
label { font-size: 0.8rem; font-weight: 600; color: var(--muted); display: block; margin-bottom: 6px; text-transform: uppercase; letter-spacing: 0.05em; }
textarea {
width: 100%;
background: var(--code-bg);
border: 1px solid var(--border);
border-radius: 8px;
color: var(--text);
font-family: 'SF Mono', 'Fira Code', monospace;
font-size: 0.8rem;
padding: 12px;
resize: vertical;
min-height: 160px;
transition: border-color 0.15s;
}
textarea:focus { outline: none; border-color: var(--accent); }
.run-row { display: flex; align-items: center; gap: 12px; margin-top: 16px; flex-wrap: wrap; }
.btn-run {
background: var(--accent);
color: #0d1117;
font-weight: 700;
padding: 9px 20px;
border-radius: 7px;
font-size: 0.875rem;
border: none;
cursor: pointer;
transition: opacity 0.15s;
}
.btn-run:hover { opacity: 0.85; }
.btn-run:disabled { opacity: 0.4; cursor: not-allowed; }
.btn-sample {
background: transparent;
color: var(--muted);
padding: 9px 16px;
border-radius: 7px;
font-size: 0.875rem;
border: 1px solid var(--border);
cursor: pointer;
transition: color 0.15s, border-color 0.15s;
}
.btn-sample:hover { color: var(--text); border-color: var(--muted); }
.spinner { display: none; width: 18px; height: 18px; border: 2px solid var(--border); border-top-color: var(--accent); border-radius: 50%; animation: spin 0.7s linear infinite; }
.spinner.visible { display: inline-block; }
@keyframes spin { to { transform: rotate(360deg); } }
.result-box {
margin-top: 16px;
background: var(--code-bg);
border: 1px solid var(--border);
border-radius: 8px;
padding: 16px;
font-family: 'SF Mono', 'Fira Code', monospace;
font-size: 0.78rem;
color: var(--text);
max-height: 360px;
overflow-y: auto;
white-space: pre-wrap;
word-break: break-word;
display: none;
}
.result-box.visible { display: block; }
.result-meta { font-size: 0.75rem; color: var(--muted); margin-bottom: 8px; }
.risk-high { color: var(--red); }
.risk-medium { color: var(--yellow); }
.risk-low { color: var(--green); }
/* CODE BLOCK */
.code-block {
background: var(--code-bg);
border: 1px solid var(--border);
border-radius: 10px;
padding: 20px;
font-family: 'SF Mono', 'Fira Code', monospace;
font-size: 0.8rem;
overflow-x: auto;
position: relative;
}
.copy-btn {
position: absolute;
top: 12px;
right: 12px;
background: var(--surface);
border: 1px solid var(--border);
color: var(--muted);
font-size: 0.75rem;
padding: 4px 10px;
border-radius: 4px;
cursor: pointer;
transition: color 0.15s;
}
.copy-btn:hover { color: var(--text); }
.kw { color: var(--purple); }
.str { color: var(--green); }
.comment { color: var(--muted); }
.num { color: var(--yellow); }
/* FEATURE CARDS */
.feature-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 20px; }
.feature-card {
background: var(--surface);
border: 1px solid var(--border);
border-radius: 12px;
padding: 20px;
}
.feature-icon { font-size: 1.5rem; margin-bottom: 10px; }
.feature-title { font-size: 0.95rem; font-weight: 700; margin-bottom: 6px; }
.feature-desc { font-size: 0.85rem; color: var(--muted); }
/* FOOTER */
footer {
border-top: 1px solid var(--border);
padding: 32px 2rem;
text-align: center;
font-size: 0.85rem;
color: var(--muted);
}
footer a { color: var(--muted); }
footer a:hover { color: var(--text); }
</style>
<link rel="canonical" href="https://citriac.github.io/agent-api/">
<script type="application/ld+json">
{
"@context": "https://schema.org",
"@type": "WebApplication",
"name": "Clavis Agent API — Document Analysis for AI Agents",
"url": "https://citriac.github.io/agent-api/",
"description": "Free, agent-native API for contract risk analysis, text summarization, document diff, and structured data extraction. No auth required.",
"applicationCategory": "DeveloperApplication",
"operatingSystem": "Any (browser-based)",
"offers": {"@type": "Offer", "price": "0", "priceCurrency": "USD"},
"author": {"@type": "Person", "name": "Clavis", "url": "https://citriac.github.io"}
}
</script>
</head>
<body>
<nav>
<span class="nav-brand"><span>Clavis</span> Agent API</span>
<a href="index.html">Home</a>
<a href="contract-diff.html">Contract Diff</a>
<a href="daily.html">Daily</a>
<a href="https://github.com/citriac" target="_blank">GitHub</a>
<a class="nav-cta" href="https://github.com/sponsors/citriac" target="_blank">Sponsor</a>
</nav>
<div class="hero">
<div class="badge">Free & Open</div>
<h1>Document Analysis API<br>for <em>AI Agents</em></h1>
<p>Contract risk analysis, text summarization, document diff, and structured extraction — all in one REST API. No auth, no setup, just POST your text.</p>
<div class="hero-actions">
<a class="btn-primary" href="#playground">Try it live</a>
<a class="btn-outline" href="https://github.com/citriac/clavis-proxy" target="_blank">View Source</a>
</div>
</div>
<div class="stats">
<div class="stat-item">
<div class="stat-number">4</div>
<div class="stat-label">Endpoints</div>
</div>
<div class="stat-item">
<div class="stat-number">16</div>
<div class="stat-label">Risk Patterns</div>
</div>
<div class="stat-item">
<div class="stat-number">0</div>
<div class="stat-label">Auth Required</div>
</div>
<div class="stat-item">
<div class="stat-number">Free</div>
<div class="stat-label">Forever</div>
</div>
</div>
<!-- ENDPOINTS -->
<div class="section">
<div class="section-title">Endpoints</div>
<div class="section-sub">All <code>/analyze/*</code> endpoints are open. No API key needed.</div>
<div class="endpoint-grid">
<div class="endpoint-card" onclick="activateTab('contract')">
<span class="method-badge method-post">POST</span>
<div>
<div class="endpoint-path">/analyze/contract</div>
<div class="endpoint-desc">Detect 16 risk clause types — unlimited liability, IP assignment, non-compete, data sharing, and more. Returns risk score + detailed findings.</div>
</div>
<span class="endpoint-arrow">→</span>
</div>
<div class="endpoint-card" onclick="activateTab('summarize')">
<span class="method-badge method-post">POST</span>
<div>
<div class="endpoint-path">/analyze/summarize</div>
<div class="endpoint-desc">Extractive summarization. No AI API needed — runs entirely on the server with sentence scoring. Fast and deterministic.</div>
</div>
<span class="endpoint-arrow">→</span>
</div>
<div class="endpoint-card" onclick="activateTab('diff')">
<span class="method-badge method-post">POST</span>
<div>
<div class="endpoint-path">/analyze/diff</div>
<div class="endpoint-desc">LCS-based line diff between two documents. Returns added/removed/same lines plus similarity score. Great for contract version comparison.</div>
</div>
<span class="endpoint-arrow">→</span>
</div>
<div class="endpoint-card" onclick="activateTab('extract')">
<span class="method-badge method-post">POST</span>
<div>
<div class="endpoint-path">/analyze/extract</div>
<div class="endpoint-desc">Extract dates, emails, monetary amounts, and party names from unstructured text. Useful for preprocessing before further analysis.</div>
</div>
<span class="endpoint-arrow">→</span>
</div>
</div>
</div>
<!-- PLAYGROUND -->
<div class="section" id="playground" style="padding-top: 0;">
<div class="section-title">Live Playground</div>
<div class="section-sub">Send real requests to the API right from your browser.</div>
<div class="playground">
<div class="playground-tabs">
<button class="tab active" onclick="activateTab('contract')">Contract Analysis</button>
<button class="tab" onclick="activateTab('summarize')">Summarize</button>
<button class="tab" onclick="activateTab('diff')">Diff</button>
<button class="tab" onclick="activateTab('extract')">Extract</button>
</div>
<!-- Contract -->
<div class="panel active" id="panel-contract">
<div class="playground-body">
<label>Contract Text</label>
<textarea id="contract-input" placeholder="Paste contract text here..."></textarea>
<div class="run-row">
<button class="btn-run" onclick="runContract()">Analyze Risk</button>
<button class="btn-sample" onclick="loadContractSample()">Load Sample</button>
<span class="spinner" id="contract-spinner"></span>
</div>
<div class="result-box" id="contract-result"></div>
</div>
</div>
<!-- Summarize -->
<div class="panel" id="panel-summarize">
<div class="playground-body">
<label>Text to Summarize</label>
<textarea id="summarize-input" placeholder="Paste any long text here..."></textarea>
<div class="run-row">
<button class="btn-run" onclick="runSummarize()">Summarize</button>
<button class="btn-sample" onclick="loadSummarizeSample()">Load Sample</button>
<span class="spinner" id="summarize-spinner"></span>
</div>
<div class="result-box" id="summarize-result"></div>
</div>
</div>
<!-- Diff -->
<div class="panel" id="panel-diff">
<div class="playground-body">
<div class="panel-grid">
<div>
<label>Document A (Original)</label>
<textarea id="diff-a" placeholder="Original text..."></textarea>
</div>
<div>
<label>Document B (Revised)</label>
<textarea id="diff-b" placeholder="Revised text..."></textarea>
</div>
</div>
<div class="run-row">
<button class="btn-run" onclick="runDiff()">Compare Documents</button>
<button class="btn-sample" onclick="loadDiffSample()">Load Sample</button>
<span class="spinner" id="diff-spinner"></span>
</div>
<div class="result-box" id="diff-result"></div>
</div>
</div>
<!-- Extract -->
<div class="panel" id="panel-extract">
<div class="playground-body">
<label>Text for Extraction</label>
<textarea id="extract-input" placeholder="Paste text with dates, emails, amounts, party names..."></textarea>
<div class="run-row">
<button class="btn-run" onclick="runExtract()">Extract Entities</button>
<button class="btn-sample" onclick="loadExtractSample()">Load Sample</button>
<span class="spinner" id="extract-spinner"></span>
</div>
<div class="result-box" id="extract-result"></div>
</div>
</div>
</div>
</div>
<!-- CODE EXAMPLES -->
<div class="section">
<div class="section-title">Quick Start</div>
<div class="section-sub">Drop these into your AI agent's tool calls or your own code.</div>
<div class="code-block" style="margin-bottom: 16px;">
<button class="copy-btn" onclick="copyCode(this)">Copy</button>
<span class="comment"># Contract risk analysis</span><br>
curl <span class="str">https://clavis-proxy.citriac.deno.net/analyze/contract</span> \<br>
-H <span class="str">"Content-Type: application/json"</span> \<br>
-d <span class="str">'{"text": "This agreement... shall not compete... unlimited liability..."}'</span>
</div>
<div class="code-block" style="margin-bottom: 16px;">
<button class="copy-btn" onclick="copyCode(this)">Copy</button>
<span class="comment">// JavaScript / Fetch API</span><br>
<span class="kw">const</span> res = <span class="kw">await</span> fetch(<span class="str">'https://clavis-proxy.citriac.deno.net/analyze/contract'</span>, {<br>
method: <span class="str">'POST'</span>,<br>
headers: { <span class="str">'Content-Type'</span>: <span class="str">'application/json'</span> },<br>
body: JSON.stringify({ text: contractText })<br>
});<br>
<span class="kw">const</span> { risk_level, findings } = <span class="kw">await</span> res.json();
</div>
<div class="code-block">
<button class="copy-btn" onclick="copyCode(this)">Copy</button>
<span class="comment"># Python</span><br>
<span class="kw">import</span> requests<br>
r = requests.post(<br>
<span class="str">"https://clavis-proxy.citriac.deno.net/analyze/contract"</span>,<br>
json={<span class="str">"text"</span>: contract_text}<br>
)<br>
data = r.json()<br>
<span class="kw">print</span>(data[<span class="str">"risk_level"</span>], data[<span class="str">"findings_count"</span>])
</div>
</div>
<!-- FEATURES -->
<div class="section">
<div class="section-title">Why Agents Love This</div>
<div class="section-sub">Designed from the ground up for programmatic access.</div>
<div class="feature-grid">
<div class="feature-card">
<div class="feature-icon">⚡</div>
<div class="feature-title">No Auth, No Setup</div>
<div class="feature-desc">Just POST text and get JSON back. No API keys, no registration, no rate limit headers to parse.</div>
</div>
<div class="feature-card">
<div class="feature-icon">🔒</div>
<div class="feature-title">Privacy by Design</div>
<div class="feature-desc">No data storage. Your documents are processed in memory and discarded immediately. Nothing is logged or retained.</div>
</div>
<div class="feature-card">
<div class="feature-icon">🌍</div>
<div class="feature-title">Global Edge Deployment</div>
<div class="feature-desc">Deployed on Deno Deploy's global edge network. Low latency from any region.</div>
</div>
<div class="feature-card">
<div class="feature-icon">📄</div>
<div class="feature-title">Structured JSON Output</div>
<div class="feature-desc">Every endpoint returns clean, predictable JSON with consistent field names. Easy to parse in any language.</div>
</div>
<div class="feature-card">
<div class="feature-icon">🧠</div>
<div class="feature-title">No External AI Dependency</div>
<div class="feature-desc">All analysis runs on deterministic algorithms — no OpenAI API calls, no unpredictable outputs, no extra latency.</div>
</div>
<div class="feature-card">
<div class="feature-icon">🔗</div>
<div class="feature-title">MCP-Ready</div>
<div class="feature-desc">Simple enough to wrap as an MCP tool. Agents can call contract analysis directly without any scaffolding.</div>
</div>
</div>
</div>
<footer>
<p>Built by <a href="index.html">Clavis</a> · <a href="https://github.com/citriac/clavis-proxy" target="_blank">Source on GitHub</a> · <a href="contract-diff.html">Contract Diff Tool</a> · <a href="https://github.com/sponsors/citriac" target="_blank">Sponsor</a></p>
<p style="margin-top: 8px; font-size: 0.78rem;">Base URL: <code>https://clavis-proxy.citriac.deno.net</code></p>
</footer>
<script>
const API = 'https://clavis-proxy.citriac.deno.net';
function activateTab(name) {
document.querySelectorAll('.tab').forEach(t => t.classList.remove('active'));
document.querySelectorAll('.panel').forEach(p => p.classList.remove('active'));
const tabs = document.querySelectorAll('.tab');
const names = ['contract','summarize','diff','extract'];
const idx = names.indexOf(name);
if (idx >= 0) tabs[idx].classList.add('active');
const panel = document.getElementById('panel-' + name);
if (panel) panel.classList.add('active');
}
function showResult(id, data) {
const el = document.getElementById(id + '-result');
el.classList.add('visible');
if (typeof data === 'object') {
el.textContent = JSON.stringify(data, null, 2);
} else {
el.textContent = data;
}
}
function setLoading(id, loading) {
const btn = document.querySelector(`#panel-${id} .btn-run`);
const spinner = document.getElementById(id + '-spinner');
if (btn) btn.disabled = loading;
if (spinner) spinner.classList.toggle('visible', loading);
}
// ── Contract ──
async function runContract() {
const text = document.getElementById('contract-input').value.trim();
if (!text) return;
setLoading('contract', true);
try {
const r = await fetch(API + '/analyze/contract', {
method: 'POST',
headers: { 'Content-Type': 'application/json' },
body: JSON.stringify({ text })
});
showResult('contract', await r.json());
} catch(e) { showResult('contract', { error: e.message }); }
setLoading('contract', false);
}
function loadContractSample() {
document.getElementById('contract-input').value = `SERVICE AGREEMENT
This Agreement is entered into as of January 1, 2026 between Acme Corp ("Company") and John Doe ("Contractor").
1. SERVICES. Contractor shall provide software development services as directed by Company.
2. INTELLECTUAL PROPERTY. Contractor agrees that all work product created under this Agreement shall be considered work for hire and Company shall own all intellectual property rights, perpetual and irrevocable, in any work created hereunder.
3. NON-COMPETE. During the term and for two (2) years thereafter, Contractor shall not work for or engage with any competitor of Company within the United States.
4. CONFIDENTIALITY. All information disclosed by Company shall be treated as confidential indefinitely. Any and all information learned during the engagement is confidential.
5. LIABILITY. Contractor shall be fully liable for any damages arising from their work, with no cap on liability.
6. TERMINATION. Company may terminate this Agreement at any time, at its sole discretion, without cause or notice.
7. AUTO-RENEWAL. This Agreement shall automatically renew for successive one-year terms unless either party provides 90 days notice.
8. GOVERNING LAW. This Agreement shall be governed by the laws of Delaware.`;
}
// ── Summarize ──
async function runSummarize() {
const text = document.getElementById('summarize-input').value.trim();
if (!text) return;
setLoading('summarize', true);
try {
const r = await fetch(API + '/analyze/summarize', {
method: 'POST',
headers: { 'Content-Type': 'application/json' },
body: JSON.stringify({ text, sentences: 4 })
});
showResult('summarize', await r.json());
} catch(e) { showResult('summarize', { error: e.message }); }
setLoading('summarize', false);
}
function loadSummarizeSample() {
document.getElementById('summarize-input').value = `TERMS OF SERVICE
Welcome to our platform. By accessing or using our services, you agree to be bound by these Terms of Service. Please read them carefully.
Our platform provides cloud-based document management tools. Users must be at least 18 years of age to create an account. By registering, you warrant that all information you provide is accurate and complete.
We reserve the right to modify these Terms at any time. We will provide notice of significant changes via email or a prominent notice on our website. Your continued use of the service after such modifications constitutes acceptance of the updated Terms.
Users are responsible for maintaining the confidentiality of their account credentials. You must notify us immediately of any unauthorized use of your account. We shall not be liable for any loss arising from unauthorized access caused by your failure to safeguard your credentials.
Payment terms: Subscription fees are billed monthly in advance. Refunds are issued at our discretion for unused portions of a subscription term. All fees are exclusive of taxes.
We may suspend or terminate your account if you violate these Terms. Upon termination, your right to use the service ceases immediately. You may request deletion of your data within 30 days of termination.
Our liability is limited to the amount paid by you in the 12 months preceding the claim. We are not liable for indirect, incidental, or consequential damages.`;
}
// ── Diff ──
async function runDiff() {
const text_a = document.getElementById('diff-a').value.trim();
const text_b = document.getElementById('diff-b').value.trim();
if (!text_a || !text_b) return;
setLoading('diff', true);
try {
const r = await fetch(API + '/analyze/diff', {
method: 'POST',
headers: { 'Content-Type': 'application/json' },
body: JSON.stringify({ text_a, text_b })
});
const data = await r.json();
// Render diff nicely
if (data.diff) {
const resultEl = document.getElementById('diff-result');
resultEl.classList.add('visible');
const stats = data.stats;
let html = `<div class="result-meta">Similarity: ${Math.round(stats.similarity * 100)}% · +${stats.added} added · -${stats.removed} removed</div>`;
html += data.diff.slice(0, 80).map(d => {
if (d.type === 'added') return `<span style="color:var(--green)">+ ${escHtml(d.line)}</span>`;
if (d.type === 'removed') return `<span style="color:var(--red)">- ${escHtml(d.line)}</span>`;
return `<span style="color:var(--muted)"> ${escHtml(d.line)}</span>`;
}).join('\n');
resultEl.innerHTML = html;
return;
}
showResult('diff', data);
} catch(e) { showResult('diff', { error: e.message }); }
setLoading('diff', false);
}
function loadDiffSample() {
document.getElementById('diff-a').value = `This Agreement is effective January 1, 2026.
Payment shall be made within 30 days of invoice.
Either party may terminate with 30 days written notice.
The contractor shall maintain confidentiality of all information.`;
document.getElementById('diff-b').value = `This Agreement is effective March 1, 2026.
Payment shall be made within 15 days of invoice.
Company may terminate at any time without notice.
The contractor shall maintain confidentiality of all information indefinitely.
All disputes shall be resolved by binding arbitration.`;
}
// ── Extract ──
async function runExtract() {
const text = document.getElementById('extract-input').value.trim();
if (!text) return;
setLoading('extract', true);
try {
const r = await fetch(API + '/analyze/extract', {
method: 'POST',
headers: { 'Content-Type': 'application/json' },
body: JSON.stringify({ text })
});
showResult('extract', await r.json());
} catch(e) { showResult('extract', { error: e.message }); }
setLoading('extract', false);
}
function loadExtractSample() {
document.getElementById('extract-input').value = `CONTRACT SUMMARY
This agreement between Acme Corporation and Globex LLC is effective as of March 15, 2026.
Contact information:
- Legal: contracts@acme.com
- Finance: billing@globex.com
Payment schedule:
- Initial payment: $12,500 due on April 1, 2026
- Monthly retainer: $3,000 USD per month starting May 2026
- Final payment: $8,750 upon project completion on December 31, 2026
Total contract value: $52,250 USD`;
}
function escHtml(s) {
return s.replace(/&/g,'&').replace(/</g,'<').replace(/>/g,'>');
}
function copyCode(btn) {
const block = btn.parentElement;
const text = block.innerText.replace('Copy\n','').replace('Copied!\n','');
navigator.clipboard.writeText(text).then(() => {
btn.textContent = 'Copied!';
setTimeout(() => btn.textContent = 'Copy', 2000);
});
}
</script>
<script>
(function(){
try {
var p = location.pathname.replace(/\/index\.html$/, '/') || '/';
fetch('https://clavis-proxy.citriac.deno.net/track', {
method: 'POST',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({ page: p, ref: document.referrer.slice(0, 200) }),
keepalive: true
});
} catch(e) {}
})();
</script>
<!-- Gumroad CTA -->
<div style="max-width:720px;margin:32px auto 0;padding:20px 24px;background:linear-gradient(135deg,#161b22 0%,#21262d 100%);border:1px solid #30363d;border-radius:12px;text-align:center;">
<p style="color:#8b949e;font-size:13px;margin-bottom:8px;">🔧 Like these tools? Get the complete automation kit.</p>
<a href="https://citriac.gumroad.com/l/freelancer-automation-kit" style="display:inline-block;padding:8px 20px;background:#58a6ff;color:#0d1117;border-radius:6px;font-size:13px;font-weight:600;text-decoration:none;">Freelancer Automation Kit — $19</a>
<a href="https://citriac.gumroad.com/l/daily-tech-digest-automation-kit" style="display:inline-block;margin-left:8px;padding:8px 20px;background:transparent;color:#58a6ff;border:1px solid #30363d;border-radius:6px;font-size:13px;text-decoration:none;">Daily Digest Kit — $15</a>
</div>
</body>
</html>