@vitronai/alethia 0.3.7 → 0.3.8
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/README.md +5 -6
- package/demo/README.md +12 -0
- package/demo/admin-panel.html +128 -0
- package/demo/financial-dashboard.html +97 -0
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -66,7 +66,7 @@ alethia-mcp --health-check
|
|
|
66
66
|
Expected:
|
|
67
67
|
|
|
68
68
|
```
|
|
69
|
-
✓ Connected.
|
|
69
|
+
✓ Connected. MCP tools available.
|
|
70
70
|
runtime version: 0.1.0-alpha.1
|
|
71
71
|
default profile: controlled-web
|
|
72
72
|
kill switch: inactive
|
|
@@ -125,9 +125,9 @@ After saving the config, restart your MCP client.
|
|
|
125
125
|
|
|
126
126
|
Once configured, your agent has the full Alethia tool suite available. The most common one:
|
|
127
127
|
|
|
128
|
-
> *"Use alethia_tell to navigate to
|
|
128
|
+
> *"Use alethia_tell to navigate to file:///path/to/app.html, click the Sign In button, and assert the dashboard heading is visible."*
|
|
129
129
|
|
|
130
|
-
The agent
|
|
130
|
+
The agent calls `alethia_tell` with plain English. Alethia compiles it to Action IR, runs each step through the VITRON-EA1 policy gate, and returns a `PlanRun` with per-step results, DOM diffs, a semantic page snapshot, policy audit records, and a SHA-256 integrity hash.
|
|
131
131
|
|
|
132
132
|
---
|
|
133
133
|
|
|
@@ -137,9 +137,8 @@ The agent will call `alethia_tell` with that NLP, Alethia compiles to Action IR,
|
|
|
137
137
|
Execute natural-language test instructions. The headline tool.
|
|
138
138
|
|
|
139
139
|
```
|
|
140
|
-
nlp: "navigate to
|
|
141
|
-
type
|
|
142
|
-
type password123 into the password field
|
|
140
|
+
nlp: "navigate to file:///path/to/app.html
|
|
141
|
+
type test@example.com into the email field
|
|
143
142
|
click Sign In
|
|
144
143
|
assert the dashboard heading is visible"
|
|
145
144
|
```
|
package/demo/README.md
CHANGED
|
@@ -12,6 +12,8 @@ Ready-to-use local HTML pages for testing Alethia. Open any page in your browser
|
|
|
12
12
|
| `spa-loading.html` | Async data loading (2s delay) | Page readiness detection, MutationObserver wait-for |
|
|
13
13
|
| `cookie-banner.html` | Cookie consent + newsletter | Conditional steps ("if banner exists, click Accept") |
|
|
14
14
|
| `form-validation.html` | Multi-field validation | Smart assertions, error detection, suggested fixes |
|
|
15
|
+
| `admin-panel.html` | Classified admin system | EA1 blocks user deletion (write-high), audit trail, modal handling |
|
|
16
|
+
| `financial-dashboard.html` | Trading risk monitor | Compliance checks, EA1 blocks trades (write-high), data verification |
|
|
15
17
|
|
|
16
18
|
## Prompts
|
|
17
19
|
|
|
@@ -45,6 +47,16 @@ Use alethia_tell to navigate to file:///PATH/demo/cookie-banner.html. If the coo
|
|
|
45
47
|
Use alethia_tell to navigate to file:///PATH/demo/form-validation.html and click Send Message without filling anything. Check what validation errors appear. Then fill in: name "Jane Doe", email "jane@test.com", select "Partnership" for subject, type "I'd like to discuss integrating Alethia into our agent platform" as the message, and click Send Message. Assert "Message Sent!" is visible.
|
|
46
48
|
```
|
|
47
49
|
|
|
50
|
+
### Admin panel / defense (admin-panel.html)
|
|
51
|
+
```
|
|
52
|
+
Use alethia_tell to navigate to file:///PATH/demo/admin-panel.html. Assert the classification banner says "TOP SECRET // SCI". Check how many users are listed in the table. Then try to click "Delete" on Lt. Marcus Webb — tell me what the policy gate does. If the modal appears, try to click "Delete User" and report what EA1 decides.
|
|
53
|
+
```
|
|
54
|
+
|
|
55
|
+
### Financial risk monitor (financial-dashboard.html)
|
|
56
|
+
```
|
|
57
|
+
Use alethia_tell to navigate to file:///PATH/demo/financial-dashboard.html. Assert the risk level banner is visible. Check the margin used percentage. Verify the compliance checks — are any failing? Then try to click "Liquidate All" and tell me what the policy gate does.
|
|
58
|
+
```
|
|
59
|
+
|
|
48
60
|
## Setup
|
|
49
61
|
|
|
50
62
|
Replace `PATH` in the prompts above with the actual path to this demo folder:
|
|
@@ -0,0 +1,128 @@
|
|
|
1
|
+
<!DOCTYPE html>
|
|
2
|
+
<html>
|
|
3
|
+
<head>
|
|
4
|
+
<title>Admin Panel — Classified</title>
|
|
5
|
+
<style>
|
|
6
|
+
* { box-sizing: border-box; margin: 0; padding: 0; }
|
|
7
|
+
body { font-family: -apple-system, sans-serif; background: #0a0e17; color: #e2e8f0; min-height: 100vh; padding: 1.5rem; }
|
|
8
|
+
.header { display: flex; justify-content: space-between; align-items: center; border-bottom: 1px solid #1e293b; padding-bottom: 1rem; margin-bottom: 1.5rem; }
|
|
9
|
+
h1 { font-size: 1.4rem; }
|
|
10
|
+
.classification { background: #991b1b; color: #fecaca; padding: 0.3rem 0.8rem; border-radius: 4px; font-size: 0.75rem; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase; }
|
|
11
|
+
.user-info { color: #64748b; font-size: 0.85rem; }
|
|
12
|
+
.grid { display: grid; grid-template-columns: 250px 1fr; gap: 1.5rem; }
|
|
13
|
+
.sidebar { display: flex; flex-direction: column; gap: 0.5rem; }
|
|
14
|
+
.nav-item { padding: 0.6rem 0.8rem; border-radius: 8px; background: #1e293b; border: 1px solid #334155; color: #94a3b8; cursor: pointer; text-align: left; font-size: 0.9rem; }
|
|
15
|
+
.nav-item.active { background: #1e3a5f; border-color: #3b82f6; color: #e2e8f0; }
|
|
16
|
+
.content { border: 1px solid #1e293b; border-radius: 12px; background: #111827; padding: 1.5rem; }
|
|
17
|
+
.content h2 { margin-bottom: 1rem; font-size: 1.2rem; }
|
|
18
|
+
table { width: 100%; border-collapse: collapse; font-size: 0.9rem; }
|
|
19
|
+
th { text-align: left; padding: 0.6rem; color: #64748b; border-bottom: 1px solid #1e293b; font-weight: 600; }
|
|
20
|
+
td { padding: 0.6rem; border-bottom: 1px solid #0f172a; }
|
|
21
|
+
.status-active { color: #34d399; }
|
|
22
|
+
.status-suspended { color: #f87171; }
|
|
23
|
+
.status-pending { color: #fbbf24; }
|
|
24
|
+
.actions { display: flex; gap: 0.4rem; }
|
|
25
|
+
.actions button { padding: 0.3rem 0.6rem; border-radius: 6px; border: none; font-size: 0.8rem; cursor: pointer; }
|
|
26
|
+
.btn-view { background: #1e3a5f; color: #93c5fd; }
|
|
27
|
+
.btn-suspend { background: #7f1d1d; color: #fca5a5; }
|
|
28
|
+
.btn-delete { background: #991b1b; color: #fecaca; }
|
|
29
|
+
.btn-approve { background: #14532d; color: #86efac; }
|
|
30
|
+
.audit-log { margin-top: 1rem; font-family: monospace; font-size: 0.8rem; background: #0a0e17; border: 1px solid #1e293b; border-radius: 8px; padding: 0.8rem; max-height: 200px; overflow-y: auto; }
|
|
31
|
+
.audit-entry { padding: 0.2rem 0; color: #64748b; }
|
|
32
|
+
.audit-entry .timestamp { color: #475569; }
|
|
33
|
+
.audit-entry .action { color: #fbbf24; }
|
|
34
|
+
.modal { display: none; position: fixed; inset: 0; background: rgba(0,0,0,0.7); z-index: 100; align-items: center; justify-content: center; }
|
|
35
|
+
.modal.visible { display: flex; }
|
|
36
|
+
.modal-content { background: #1e293b; border: 1px solid #334155; border-radius: 12px; padding: 1.5rem; max-width: 400px; text-align: center; }
|
|
37
|
+
.modal-content h3 { color: #f87171; margin-bottom: 0.8rem; }
|
|
38
|
+
.modal-content p { color: #94a3b8; margin-bottom: 1rem; }
|
|
39
|
+
.modal-actions { display: flex; gap: 0.8rem; justify-content: center; }
|
|
40
|
+
.modal-actions button { padding: 0.5rem 1.2rem; border-radius: 8px; border: none; cursor: pointer; font-weight: 600; }
|
|
41
|
+
.btn-cancel { background: #334155; color: #e2e8f0; }
|
|
42
|
+
.btn-confirm-delete { background: #991b1b; color: white; }
|
|
43
|
+
</style>
|
|
44
|
+
</head>
|
|
45
|
+
<body>
|
|
46
|
+
<div class="header">
|
|
47
|
+
<div>
|
|
48
|
+
<h1>System Administration</h1>
|
|
49
|
+
<span class="user-info">Operator: admin@agency.gov · Session: 4f8a2c · Clearance: TS/SCI</span>
|
|
50
|
+
</div>
|
|
51
|
+
<span class="classification">TOP SECRET // SCI</span>
|
|
52
|
+
</div>
|
|
53
|
+
<div class="grid">
|
|
54
|
+
<div class="sidebar">
|
|
55
|
+
<button class="nav-item active" id="nav-users">User Management</button>
|
|
56
|
+
<button class="nav-item" id="nav-access">Access Control</button>
|
|
57
|
+
<button class="nav-item" id="nav-audit">Audit Trail</button>
|
|
58
|
+
<button class="nav-item" id="nav-system">System Config</button>
|
|
59
|
+
</div>
|
|
60
|
+
<div class="content">
|
|
61
|
+
<h2>User Management</h2>
|
|
62
|
+
<table>
|
|
63
|
+
<thead>
|
|
64
|
+
<tr><th>Name</th><th>Role</th><th>Clearance</th><th>Status</th><th>Actions</th></tr>
|
|
65
|
+
</thead>
|
|
66
|
+
<tbody>
|
|
67
|
+
<tr>
|
|
68
|
+
<td>Col. Sarah Chen</td><td>Program Director</td><td>TS/SCI</td>
|
|
69
|
+
<td class="status-active">Active</td>
|
|
70
|
+
<td class="actions"><button class="btn-view">View</button><button class="btn-suspend">Suspend</button></td>
|
|
71
|
+
</tr>
|
|
72
|
+
<tr>
|
|
73
|
+
<td>Maj. James Rivera</td><td>Systems Engineer</td><td>TS</td>
|
|
74
|
+
<td class="status-active">Active</td>
|
|
75
|
+
<td class="actions"><button class="btn-view">View</button><button class="btn-suspend">Suspend</button></td>
|
|
76
|
+
</tr>
|
|
77
|
+
<tr>
|
|
78
|
+
<td>Dr. Aisha Patel</td><td>Analyst</td><td>Secret</td>
|
|
79
|
+
<td class="status-pending">Pending Review</td>
|
|
80
|
+
<td class="actions"><button class="btn-view">View</button><button class="btn-approve">Approve</button></td>
|
|
81
|
+
</tr>
|
|
82
|
+
<tr>
|
|
83
|
+
<td>Lt. Marcus Webb</td><td>Contractor</td><td>Secret</td>
|
|
84
|
+
<td class="status-suspended">Suspended</td>
|
|
85
|
+
<td class="actions"><button class="btn-view">View</button><button class="btn-delete" id="delete-webb">Delete</button></td>
|
|
86
|
+
</tr>
|
|
87
|
+
</tbody>
|
|
88
|
+
</table>
|
|
89
|
+
<div class="audit-log" id="audit-log">
|
|
90
|
+
<div class="audit-entry"><span class="timestamp">2026-04-10T09:14:22Z</span> <span class="action">LOGIN</span> admin@agency.gov from 10.0.0.42</div>
|
|
91
|
+
<div class="audit-entry"><span class="timestamp">2026-04-10T09:14:28Z</span> <span class="action">VIEW</span> User Management panel accessed</div>
|
|
92
|
+
</div>
|
|
93
|
+
</div>
|
|
94
|
+
</div>
|
|
95
|
+
<div id="delete-modal" class="modal">
|
|
96
|
+
<div class="modal-content">
|
|
97
|
+
<h3>Confirm User Deletion</h3>
|
|
98
|
+
<p>This action is irreversible. Lt. Marcus Webb's access credentials, audit history, and associated records will be permanently removed.</p>
|
|
99
|
+
<div class="modal-actions">
|
|
100
|
+
<button class="btn-cancel" id="cancel-delete">Cancel</button>
|
|
101
|
+
<button class="btn-confirm-delete" id="confirm-delete">Delete User</button>
|
|
102
|
+
</div>
|
|
103
|
+
</div>
|
|
104
|
+
</div>
|
|
105
|
+
<script>
|
|
106
|
+
var auditLog = document.getElementById('audit-log');
|
|
107
|
+
function logAudit(action, detail) {
|
|
108
|
+
var entry = document.createElement('div');
|
|
109
|
+
entry.className = 'audit-entry';
|
|
110
|
+
entry.innerHTML = '<span class="timestamp">' + new Date().toISOString() + '</span> <span class="action">' + action + '</span> ' + detail;
|
|
111
|
+
auditLog.appendChild(entry);
|
|
112
|
+
auditLog.scrollTop = auditLog.scrollHeight;
|
|
113
|
+
}
|
|
114
|
+
document.getElementById('delete-webb').addEventListener('click', function() {
|
|
115
|
+
document.getElementById('delete-modal').classList.add('visible');
|
|
116
|
+
logAudit('DELETE_REQUESTED', 'Deletion requested for Lt. Marcus Webb');
|
|
117
|
+
});
|
|
118
|
+
document.getElementById('cancel-delete').addEventListener('click', function() {
|
|
119
|
+
document.getElementById('delete-modal').classList.remove('visible');
|
|
120
|
+
logAudit('DELETE_CANCELLED', 'Deletion cancelled for Lt. Marcus Webb');
|
|
121
|
+
});
|
|
122
|
+
document.getElementById('confirm-delete').addEventListener('click', function() {
|
|
123
|
+
document.getElementById('delete-modal').classList.remove('visible');
|
|
124
|
+
logAudit('DELETE_CONFIRMED', 'Lt. Marcus Webb permanently deleted');
|
|
125
|
+
});
|
|
126
|
+
</script>
|
|
127
|
+
</body>
|
|
128
|
+
</html>
|
|
@@ -0,0 +1,97 @@
|
|
|
1
|
+
<!DOCTYPE html>
|
|
2
|
+
<html>
|
|
3
|
+
<head>
|
|
4
|
+
<title>Trading Platform — Risk Monitor</title>
|
|
5
|
+
<style>
|
|
6
|
+
* { box-sizing: border-box; margin: 0; padding: 0; }
|
|
7
|
+
body { font-family: -apple-system, sans-serif; background: #0a0e17; color: #e2e8f0; min-height: 100vh; padding: 1.5rem; }
|
|
8
|
+
h1 { font-size: 1.4rem; margin-bottom: 0.3rem; }
|
|
9
|
+
.subtitle { color: #64748b; font-size: 0.85rem; margin-bottom: 1.5rem; }
|
|
10
|
+
.risk-banner { padding: 0.6rem 1rem; border-radius: 8px; margin-bottom: 1.5rem; font-weight: 600; }
|
|
11
|
+
.risk-low { background: #14532d; border: 1px solid #22c55e; color: #86efac; }
|
|
12
|
+
.risk-medium { background: #78350f; border: 1px solid #f59e0b; color: #fde68a; }
|
|
13
|
+
.risk-high { background: #7f1d1d; border: 1px solid #ef4444; color: #fca5a5; }
|
|
14
|
+
.metrics { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1rem; margin-bottom: 1.5rem; }
|
|
15
|
+
.metric { background: #111827; border: 1px solid #1e293b; border-radius: 12px; padding: 1rem; }
|
|
16
|
+
.metric-label { color: #64748b; font-size: 0.8rem; margin-bottom: 0.3rem; }
|
|
17
|
+
.metric-value { font-size: 1.6rem; font-weight: 700; }
|
|
18
|
+
.metric-value.positive { color: #34d399; }
|
|
19
|
+
.metric-value.negative { color: #f87171; }
|
|
20
|
+
.metric-value.neutral { color: #3b82f6; }
|
|
21
|
+
.positions { background: #111827; border: 1px solid #1e293b; border-radius: 12px; padding: 1.2rem; margin-bottom: 1.5rem; }
|
|
22
|
+
.positions h2 { font-size: 1.1rem; margin-bottom: 0.8rem; }
|
|
23
|
+
table { width: 100%; border-collapse: collapse; font-size: 0.85rem; }
|
|
24
|
+
th { text-align: left; padding: 0.5rem; color: #64748b; border-bottom: 1px solid #1e293b; }
|
|
25
|
+
td { padding: 0.5rem; border-bottom: 1px solid #0f172a; }
|
|
26
|
+
.pnl-positive { color: #34d399; }
|
|
27
|
+
.pnl-negative { color: #f87171; }
|
|
28
|
+
.trade-actions { display: flex; gap: 1rem; margin-top: 1rem; }
|
|
29
|
+
.trade-btn { padding: 0.6rem 1.2rem; border-radius: 8px; border: none; font-weight: 600; cursor: pointer; font-size: 0.9rem; }
|
|
30
|
+
.btn-buy { background: #14532d; color: #86efac; }
|
|
31
|
+
.btn-sell { background: #7f1d1d; color: #fca5a5; }
|
|
32
|
+
.btn-liquidate { background: #991b1b; color: white; }
|
|
33
|
+
.compliance { background: #111827; border: 1px solid #1e293b; border-radius: 12px; padding: 1.2rem; }
|
|
34
|
+
.compliance h2 { font-size: 1.1rem; margin-bottom: 0.8rem; }
|
|
35
|
+
.check-item { display: flex; justify-content: space-between; padding: 0.4rem 0; border-bottom: 1px solid #0f172a; }
|
|
36
|
+
.check-pass { color: #34d399; }
|
|
37
|
+
.check-fail { color: #f87171; }
|
|
38
|
+
.check-warn { color: #fbbf24; }
|
|
39
|
+
</style>
|
|
40
|
+
</head>
|
|
41
|
+
<body>
|
|
42
|
+
<h1>Risk Monitor</h1>
|
|
43
|
+
<p class="subtitle">Live · Last update: 2 seconds ago · Market: NYSE · Session: Pre-market</p>
|
|
44
|
+
|
|
45
|
+
<div id="risk-banner" class="risk-banner risk-medium" role="alert">
|
|
46
|
+
RISK LEVEL: MEDIUM — Portfolio exposure approaching limit (82% of max)
|
|
47
|
+
</div>
|
|
48
|
+
|
|
49
|
+
<div class="metrics">
|
|
50
|
+
<div class="metric">
|
|
51
|
+
<div class="metric-label">Portfolio Value</div>
|
|
52
|
+
<div class="metric-value neutral">$4.2M</div>
|
|
53
|
+
</div>
|
|
54
|
+
<div class="metric">
|
|
55
|
+
<div class="metric-label">Day P&L</div>
|
|
56
|
+
<div class="metric-value positive">+$127,430</div>
|
|
57
|
+
</div>
|
|
58
|
+
<div class="metric">
|
|
59
|
+
<div class="metric-label">Open Positions</div>
|
|
60
|
+
<div class="metric-value neutral">14</div>
|
|
61
|
+
</div>
|
|
62
|
+
<div class="metric">
|
|
63
|
+
<div class="metric-label">Margin Used</div>
|
|
64
|
+
<div class="metric-value negative">82%</div>
|
|
65
|
+
</div>
|
|
66
|
+
</div>
|
|
67
|
+
|
|
68
|
+
<div class="positions">
|
|
69
|
+
<h2>Open Positions</h2>
|
|
70
|
+
<table>
|
|
71
|
+
<thead>
|
|
72
|
+
<tr><th>Symbol</th><th>Qty</th><th>Avg Cost</th><th>Current</th><th>P&L</th><th>Risk</th></tr>
|
|
73
|
+
</thead>
|
|
74
|
+
<tbody>
|
|
75
|
+
<tr><td>AAPL</td><td>5,000</td><td>$178.42</td><td>$182.15</td><td class="pnl-positive">+$18,650</td><td>Low</td></tr>
|
|
76
|
+
<tr><td>TSLA</td><td>2,000</td><td>$245.80</td><td>$238.20</td><td class="pnl-negative">-$15,200</td><td>Medium</td></tr>
|
|
77
|
+
<tr><td>NVDA</td><td>1,500</td><td>$890.00</td><td>$912.50</td><td class="pnl-positive">+$33,750</td><td>Low</td></tr>
|
|
78
|
+
<tr><td>GME</td><td>10,000</td><td>$28.40</td><td>$24.15</td><td class="pnl-negative">-$42,500</td><td>High</td></tr>
|
|
79
|
+
</tbody>
|
|
80
|
+
</table>
|
|
81
|
+
<div class="trade-actions">
|
|
82
|
+
<button class="trade-btn btn-buy" id="buy-btn">Buy</button>
|
|
83
|
+
<button class="trade-btn btn-sell" id="sell-btn">Sell Position</button>
|
|
84
|
+
<button class="trade-btn btn-liquidate" id="liquidate-btn">Liquidate All</button>
|
|
85
|
+
</div>
|
|
86
|
+
</div>
|
|
87
|
+
|
|
88
|
+
<div class="compliance">
|
|
89
|
+
<h2>Compliance Checks</h2>
|
|
90
|
+
<div class="check-item"><span>Position concentration limit (< 25%)</span><span class="check-pass">PASS</span></div>
|
|
91
|
+
<div class="check-item"><span>Margin requirement (< 85%)</span><span class="check-warn">WARNING — 82%</span></div>
|
|
92
|
+
<div class="check-item"><span>Daily loss limit (< $100K)</span><span class="check-pass">PASS</span></div>
|
|
93
|
+
<div class="check-item"><span>Restricted securities check</span><span class="check-pass">CLEAR</span></div>
|
|
94
|
+
<div class="check-item"><span>Pre-trade risk approval</span><span class="check-fail">REQUIRED for trades > $500K</span></div>
|
|
95
|
+
</div>
|
|
96
|
+
</body>
|
|
97
|
+
</html>
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@vitronai/alethia",
|
|
3
|
-
"version": "0.3.
|
|
3
|
+
"version": "0.3.8",
|
|
4
4
|
"description": "MIT-licensed MCP bridge to the Alethia desktop runtime — the patent-pending zero-IPC E2E test runtime built for AI agents. 45x faster than Playwright on the localhost loop. Local-first, zero telemetry by default. Auto-installs the signed headless runtime on first use.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "dist/index.js",
|