tryassay 0.22.0 → 0.22.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/demo/css/style.css +495 -836
- package/demo/index.html +40 -184
- package/demo/js/chat.js +385 -142
- package/demo/js/preview.js +456 -0
- package/demo/js/sse-client.js +262 -135
- package/demo/js/state.js +11 -1
- package/demo/js/timeline.js +57 -371
- package/dist/api/server.d.ts +2 -0
- package/dist/api/server.js +63 -19
- package/dist/api/server.js.map +1 -1
- package/dist/cli.js +2 -0
- package/dist/cli.js.map +1 -1
- package/dist/commands/assess.d.ts +2 -0
- package/dist/commands/assess.js +132 -164
- package/dist/commands/assess.js.map +1 -1
- package/dist/commands/demo.js +259 -9
- package/dist/commands/demo.js.map +1 -1
- package/dist/lib/__tests__/arithmetic-quick-test.d.ts +6 -0
- package/dist/lib/__tests__/arithmetic-quick-test.js +197 -0
- package/dist/lib/__tests__/arithmetic-quick-test.js.map +1 -0
- package/dist/lib/__tests__/arithmetic-real-llm-test.d.ts +13 -0
- package/dist/lib/__tests__/arithmetic-real-llm-test.js +284 -0
- package/dist/lib/__tests__/arithmetic-real-llm-test.js.map +1 -0
- package/dist/lib/__tests__/arithmetic-value-demo.d.ts +10 -0
- package/dist/lib/__tests__/arithmetic-value-demo.js +193 -0
- package/dist/lib/__tests__/arithmetic-value-demo.js.map +1 -0
- package/dist/lib/__tests__/flow-to-claims.test.d.ts +1 -0
- package/dist/lib/__tests__/flow-to-claims.test.js +91 -0
- package/dist/lib/__tests__/flow-to-claims.test.js.map +1 -0
- package/dist/lib/__tests__/formal-verifier-api-misuse.test.d.ts +9 -0
- package/dist/lib/__tests__/formal-verifier-api-misuse.test.js +391 -0
- package/dist/lib/__tests__/formal-verifier-api-misuse.test.js.map +1 -0
- package/dist/lib/__tests__/formal-verifier-arithmetic.test.d.ts +7 -0
- package/dist/lib/__tests__/formal-verifier-arithmetic.test.js +318 -0
- package/dist/lib/__tests__/formal-verifier-arithmetic.test.js.map +1 -0
- package/dist/lib/__tests__/intent-extractor.test.d.ts +1 -0
- package/dist/lib/__tests__/intent-extractor.test.js +97 -0
- package/dist/lib/__tests__/intent-extractor.test.js.map +1 -0
- package/dist/lib/__tests__/intent-reviewer.test.d.ts +1 -0
- package/dist/lib/__tests__/intent-reviewer.test.js +55 -0
- package/dist/lib/__tests__/intent-reviewer.test.js.map +1 -0
- package/dist/lib/__tests__/mr-gsm8k-benchmark.d.ts +11 -0
- package/dist/lib/__tests__/mr-gsm8k-benchmark.js +224 -0
- package/dist/lib/__tests__/mr-gsm8k-benchmark.js.map +1 -0
- package/dist/lib/anthropic.js +25 -33
- package/dist/lib/anthropic.js.map +1 -1
- package/dist/lib/assessment-reporter.js +9 -13
- package/dist/lib/assessment-reporter.js.map +1 -1
- package/dist/lib/claim-extractor.js +10 -19
- package/dist/lib/claim-extractor.js.map +1 -1
- package/dist/lib/code-verifier.js +16 -36
- package/dist/lib/code-verifier.js.map +1 -1
- package/dist/lib/constraint-engine.js +10 -19
- package/dist/lib/constraint-engine.js.map +1 -1
- package/dist/lib/formal-verifier.d.ts +1 -1
- package/dist/lib/formal-verifier.js +454 -0
- package/dist/lib/formal-verifier.js.map +1 -1
- package/dist/lib/guided-generator.js +19 -37
- package/dist/lib/guided-generator.js.map +1 -1
- package/dist/lib/intent-extractor.d.ts +47 -0
- package/dist/lib/intent-extractor.js +427 -0
- package/dist/lib/intent-extractor.js.map +1 -0
- package/dist/lib/intent-reviewer.d.ts +14 -0
- package/dist/lib/intent-reviewer.js +148 -0
- package/dist/lib/intent-reviewer.js.map +1 -0
- package/dist/lib/intent-types.d.ts +89 -0
- package/dist/lib/intent-types.js +5 -0
- package/dist/lib/intent-types.js.map +1 -0
- package/dist/lib/inventory-extractor.js +9 -22
- package/dist/lib/inventory-extractor.js.map +1 -1
- package/dist/lib/llm-provider.d.ts +23 -0
- package/dist/lib/llm-provider.js +130 -0
- package/dist/lib/llm-provider.js.map +1 -0
- package/dist/lib/remediator.js +20 -28
- package/dist/lib/remediator.js.map +1 -1
- package/dist/lib/requirements-generator.js +14 -19
- package/dist/lib/requirements-generator.js.map +1 -1
- package/dist/lib/spec-synthesizer.js +10 -19
- package/dist/lib/spec-synthesizer.js.map +1 -1
- package/dist/runtime/app-create-orchestrator.d.ts +5 -1
- package/dist/runtime/app-create-orchestrator.js +114 -39
- package/dist/runtime/app-create-orchestrator.js.map +1 -1
- package/dist/runtime/check-catalog.js +5 -3
- package/dist/runtime/check-catalog.js.map +1 -1
- package/dist/runtime/check-definitions.d.ts +10 -0
- package/dist/runtime/check-definitions.js +52 -2
- package/dist/runtime/check-definitions.js.map +1 -1
- package/dist/runtime/composition-verifier.js +8 -12
- package/dist/runtime/composition-verifier.js.map +1 -1
- package/dist/runtime/gap-detector.js +8 -10
- package/dist/runtime/gap-detector.js.map +1 -1
- package/dist/runtime/input-validator.d.ts +7 -0
- package/dist/runtime/input-validator.js +162 -0
- package/dist/runtime/input-validator.js.map +1 -0
- package/dist/runtime/model-router.d.ts +10 -0
- package/dist/runtime/model-router.js +42 -0
- package/dist/runtime/model-router.js.map +1 -0
- package/dist/runtime/pattern-extractor.js +8 -10
- package/dist/runtime/pattern-extractor.js.map +1 -1
- package/dist/runtime/planner.js +11 -16
- package/dist/runtime/planner.js.map +1 -1
- package/dist/runtime/prompt-guard.d.ts +2 -0
- package/dist/runtime/prompt-guard.js +180 -0
- package/dist/runtime/prompt-guard.js.map +1 -0
- package/dist/runtime/prompt-safety-analyzer.js +8 -13
- package/dist/runtime/prompt-safety-analyzer.js.map +1 -1
- package/dist/runtime/reasoner.js +19 -33
- package/dist/runtime/reasoner.js.map +1 -1
- package/dist/runtime/rule-meta-verifier.js +9 -11
- package/dist/runtime/rule-meta-verifier.js.map +1 -1
- package/dist/runtime/safe-executor.d.ts +23 -0
- package/dist/runtime/safe-executor.js +151 -0
- package/dist/runtime/safe-executor.js.map +1 -0
- package/dist/runtime/specialized-agent.js +10 -14
- package/dist/runtime/specialized-agent.js.map +1 -1
- package/dist/runtime/strategy-library.js +8 -10
- package/dist/runtime/strategy-library.js.map +1 -1
- package/dist/runtime/supabase-experience-store.js.map +1 -1
- package/dist/runtime/supabase-provisioner.d.ts +35 -0
- package/dist/runtime/supabase-provisioner.js +192 -0
- package/dist/runtime/supabase-provisioner.js.map +1 -0
- package/dist/runtime/types.d.ts +88 -0
- package/dist/sdk/forward-verify.js +16 -33
- package/dist/sdk/forward-verify.js.map +1 -1
- package/package.json +1 -1
- package/demo/data/demo-events.json +0 -103
- package/demo/js/demo-mode.js +0 -107
- package/demo/js/orb.js +0 -634
- package/demo/js/question-cards.js +0 -207
- package/demo/js/voice.js +0 -154
package/demo/index.html
CHANGED
|
@@ -5,218 +5,74 @@
|
|
|
5
5
|
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
|
6
6
|
<title>Assay Verified Agent Runtime</title>
|
|
7
7
|
<link rel="stylesheet" href="css/style.css">
|
|
8
|
+
<meta http-equiv="Cross-Origin-Embedder-Policy" content="credentialless">
|
|
9
|
+
<meta http-equiv="Cross-Origin-Opener-Policy" content="same-origin">
|
|
8
10
|
</head>
|
|
9
11
|
<body>
|
|
10
12
|
<div id="app">
|
|
11
|
-
<!-- Header with input bar -->
|
|
12
13
|
<header id="header">
|
|
13
|
-
<div id="
|
|
14
|
-
<
|
|
15
|
-
type="text"
|
|
16
|
-
id="prompt-input"
|
|
17
|
-
placeholder="Describe an application to build..."
|
|
18
|
-
autocomplete="off"
|
|
19
|
-
>
|
|
20
|
-
<button id="submit-btn">Build</button>
|
|
14
|
+
<div id="header-left">
|
|
15
|
+
<span class="header-title">assay</span>
|
|
21
16
|
</div>
|
|
22
|
-
<div id="
|
|
23
|
-
<
|
|
24
|
-
|
|
17
|
+
<div id="header-right">
|
|
18
|
+
<div id="file-badge" class="hidden">
|
|
19
|
+
<span>files:</span>
|
|
20
|
+
<span id="file-count">0</span>
|
|
21
|
+
</div>
|
|
22
|
+
<div id="global-clock" class="global-clock hidden">
|
|
23
|
+
<span class="clock-value" id="clock-value">00:00</span>
|
|
24
|
+
</div>
|
|
25
25
|
</div>
|
|
26
|
-
<button id="mute-toggle" title="Toggle voice narration">🔊</button>
|
|
27
26
|
</header>
|
|
28
27
|
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
28
|
+
<div id="chat-panel">
|
|
29
|
+
<div id="chat-messages"></div>
|
|
30
|
+
<div id="attachment-preview" class="hidden"></div>
|
|
31
|
+
<div id="chat-input-area">
|
|
32
|
+
<input type="file" id="file-input" hidden accept=".txt,.md,.markdown,.csv,.json">
|
|
33
|
+
<button id="attach-btn" title="Attach specification document">📎</button>
|
|
34
|
+
<input type="text" id="chat-input" placeholder="Describe an application to build..." autocomplete="off">
|
|
35
|
+
<button id="chat-send-btn">Send</button>
|
|
36
|
+
</div>
|
|
37
|
+
</div>
|
|
37
38
|
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
<div class="metric">
|
|
42
|
-
<span class="metric-value" id="metric-tasks">0/0</span>
|
|
43
|
-
<span class="metric-label">Tasks</span>
|
|
44
|
-
</div>
|
|
45
|
-
<div class="metric">
|
|
46
|
-
<span class="metric-value" id="metric-claims">0</span>
|
|
47
|
-
<span class="metric-label">Claims</span>
|
|
48
|
-
</div>
|
|
49
|
-
<div class="metric">
|
|
50
|
-
<span class="metric-value" id="metric-failed">0</span>
|
|
51
|
-
<span class="metric-label">Caught</span>
|
|
52
|
-
</div>
|
|
53
|
-
<div class="metric">
|
|
54
|
-
<span class="metric-value" id="metric-files">0</span>
|
|
55
|
-
<span class="metric-label">Files</span>
|
|
56
|
-
</div>
|
|
39
|
+
<div id="preview-panel">
|
|
40
|
+
<div id="preview-overlay">
|
|
41
|
+
<div id="preview-status" data-state="cold">Setting up environment...</div>
|
|
57
42
|
</div>
|
|
58
|
-
<
|
|
43
|
+
<iframe id="preview-iframe"></iframe>
|
|
59
44
|
</div>
|
|
60
45
|
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
<
|
|
46
|
+
<div id="completion-overlay"></div>
|
|
47
|
+
|
|
48
|
+
<div id="status-bar">
|
|
49
|
+
<span id="status-phase">phase: idle</span>
|
|
50
|
+
<span id="status-elapsed">elapsed: 00:00</span>
|
|
51
|
+
<span id="status-tasks">tasks: 0/0</span>
|
|
65
52
|
</div>
|
|
66
53
|
</div>
|
|
67
54
|
|
|
68
|
-
<!-- CDN imports — no build step -->
|
|
69
|
-
<script type="importmap">
|
|
70
|
-
{
|
|
71
|
-
"imports": {
|
|
72
|
-
"three": "https://cdn.jsdelivr.net/npm/three@0.162.0/build/three.module.js",
|
|
73
|
-
"three/addons/": "https://cdn.jsdelivr.net/npm/three@0.162.0/examples/jsm/"
|
|
74
|
-
}
|
|
75
|
-
}
|
|
76
|
-
</script>
|
|
77
|
-
|
|
78
|
-
<!-- Load modules -->
|
|
79
55
|
<script type="module" src="js/state.js"></script>
|
|
80
|
-
<script type="module" src="js/orb.js"></script>
|
|
81
|
-
<script type="module" src="js/timeline.js"></script>
|
|
82
|
-
<script type="module" src="js/code-panel.js"></script>
|
|
83
|
-
<script type="module" src="js/voice.js"></script>
|
|
84
|
-
<script type="module" src="js/question-cards.js"></script>
|
|
85
56
|
<script type="module" src="js/chat.js"></script>
|
|
86
57
|
<script type="module" src="js/sse-client.js"></script>
|
|
87
|
-
<script type="module" src="js/
|
|
58
|
+
<script type="module" src="js/preview.js"></script>
|
|
59
|
+
<script type="module" src="js/timeline.js"></script>
|
|
88
60
|
|
|
89
|
-
<!-- Bootstrap -->
|
|
90
61
|
<script type="module">
|
|
91
62
|
import './js/state.js';
|
|
92
|
-
import { initOrb } from './js/orb.js';
|
|
93
|
-
import { initTimeline } from './js/timeline.js';
|
|
94
|
-
import { initCodePanel } from './js/code-panel.js';
|
|
95
|
-
import { initVoice } from './js/voice.js';
|
|
96
63
|
import { initSSEClient } from './js/sse-client.js';
|
|
97
|
-
import {
|
|
64
|
+
import { initChat } from './js/chat.js';
|
|
65
|
+
import { initPreview } from './js/preview.js';
|
|
66
|
+
import { initTimeline } from './js/timeline.js';
|
|
98
67
|
|
|
99
|
-
// ── Config ──
|
|
100
|
-
// API server URL — override with ?api=http://host:port
|
|
101
|
-
// API key — override with ?key=xxx or server auto-generates one on startup
|
|
102
68
|
const params = new URLSearchParams(window.location.search);
|
|
103
69
|
const API_BASE = params.get('api') || 'http://localhost:3800';
|
|
104
70
|
const API_KEY = params.get('key') || '';
|
|
105
71
|
|
|
106
|
-
// Initialize all modules
|
|
107
|
-
try { initOrb(); } catch (e) { console.warn('[Boot] Orb init failed (no WebGL?):', e.message); }
|
|
108
|
-
initTimeline();
|
|
109
|
-
initCodePanel();
|
|
110
|
-
initVoice();
|
|
111
72
|
initSSEClient(API_BASE, API_KEY);
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
const input = document.getElementById('prompt-input');
|
|
116
|
-
const btn = document.getElementById('submit-btn');
|
|
117
|
-
|
|
118
|
-
// Derive a sensible AppDescription from a natural-language prompt
|
|
119
|
-
function buildAppDescription(prompt) {
|
|
120
|
-
// Extract a short name from the prompt
|
|
121
|
-
const name = prompt
|
|
122
|
-
.replace(/^(build|create|make|generate)\s+(a|an|me|my)?\s*/i, '')
|
|
123
|
-
.split(/[.,!?\n]/)[0]
|
|
124
|
-
.trim()
|
|
125
|
-
.slice(0, 50)
|
|
126
|
-
.replace(/\s+/g, '-')
|
|
127
|
-
.toLowerCase() || 'my-app';
|
|
128
|
-
|
|
129
|
-
// Detect features from the prompt
|
|
130
|
-
const features = [];
|
|
131
|
-
const lower = prompt.toLowerCase();
|
|
132
|
-
if (/auth|login|signup|sign.?up|register|password/.test(lower)) features.push('User authentication with email/password');
|
|
133
|
-
if (/todo|task|checklist/.test(lower)) features.push('Todo/task CRUD with completion tracking');
|
|
134
|
-
if (/blog|post|article|cms/.test(lower)) features.push('Blog post management with markdown');
|
|
135
|
-
if (/chat|message|real.?time/.test(lower)) features.push('Real-time chat messaging');
|
|
136
|
-
if (/e.?commerce|shop|cart|product|payment/.test(lower)) features.push('Product catalog with shopping cart');
|
|
137
|
-
if (/dashboard|admin|analytics/.test(lower)) features.push('Admin dashboard with analytics');
|
|
138
|
-
if (/api|rest|endpoint/.test(lower)) features.push('REST API endpoints');
|
|
139
|
-
if (/search|filter/.test(lower)) features.push('Search and filtering');
|
|
140
|
-
if (/upload|file|image/.test(lower)) features.push('File upload handling');
|
|
141
|
-
if (/notification|email|alert/.test(lower)) features.push('Notification system');
|
|
142
|
-
// If nothing matched, add the whole prompt as a feature
|
|
143
|
-
if (features.length === 0) features.push(prompt);
|
|
144
|
-
|
|
145
|
-
// Detect tech preferences or default
|
|
146
|
-
let framework = 'next.js';
|
|
147
|
-
let database = 'supabase';
|
|
148
|
-
if (/express|node/.test(lower)) framework = 'express';
|
|
149
|
-
if (/svelte/.test(lower)) framework = 'sveltekit';
|
|
150
|
-
if (/electron|desktop/.test(lower)) framework = 'electron';
|
|
151
|
-
if (/postgres(?!.*supa)/.test(lower)) database = 'postgresql';
|
|
152
|
-
if (/sqlite/.test(lower)) database = 'sqlite';
|
|
153
|
-
|
|
154
|
-
return {
|
|
155
|
-
name,
|
|
156
|
-
description: prompt,
|
|
157
|
-
techStack: {
|
|
158
|
-
language: 'typescript',
|
|
159
|
-
framework,
|
|
160
|
-
database,
|
|
161
|
-
styling: 'tailwind',
|
|
162
|
-
},
|
|
163
|
-
features,
|
|
164
|
-
};
|
|
165
|
-
}
|
|
166
|
-
|
|
167
|
-
btn.addEventListener('click', async () => {
|
|
168
|
-
const prompt = input.value.trim();
|
|
169
|
-
if (!prompt) return;
|
|
170
|
-
|
|
171
|
-
// Reset state for new run
|
|
172
|
-
AppState.reset();
|
|
173
|
-
input.disabled = true;
|
|
174
|
-
btn.disabled = true;
|
|
175
|
-
|
|
176
|
-
// Force demo mode
|
|
177
|
-
if (params.get('demo') === 'true') {
|
|
178
|
-
startDemo(prompt);
|
|
179
|
-
return;
|
|
180
|
-
}
|
|
181
|
-
|
|
182
|
-
// Try live API
|
|
183
|
-
const appDesc = buildAppDescription(prompt);
|
|
184
|
-
const headers = { 'Content-Type': 'application/json' };
|
|
185
|
-
if (API_KEY) headers['Authorization'] = `Bearer ${API_KEY}`;
|
|
186
|
-
|
|
187
|
-
try {
|
|
188
|
-
const res = await fetch(`${API_BASE}/api/v1/app/create`, {
|
|
189
|
-
method: 'POST',
|
|
190
|
-
headers,
|
|
191
|
-
body: JSON.stringify({ ...appDesc, autoApprove: false }),
|
|
192
|
-
});
|
|
193
|
-
|
|
194
|
-
if (!res.ok) {
|
|
195
|
-
const err = await res.text();
|
|
196
|
-
throw new Error(`API ${res.status}: ${err}`);
|
|
197
|
-
}
|
|
198
|
-
|
|
199
|
-
const data = await res.json();
|
|
200
|
-
window.__appId = data.id || data.sessionId;
|
|
201
|
-
// Connect SSE BEFORE updating phase to avoid missing early events
|
|
202
|
-
window.__connectSSE(window.__appId);
|
|
203
|
-
AppState.update({ phase: 'initializing' });
|
|
204
|
-
AppState.addLog({ type: 'system', message: `Session started: ${window.__appId}` });
|
|
205
|
-
} catch (err) {
|
|
206
|
-
console.warn('[Boot] API unavailable, falling back to demo mode:', err.message);
|
|
207
|
-
startDemo(prompt);
|
|
208
|
-
}
|
|
209
|
-
});
|
|
210
|
-
|
|
211
|
-
input.addEventListener('keydown', (e) => {
|
|
212
|
-
if (e.key === 'Enter') btn.click();
|
|
213
|
-
});
|
|
214
|
-
|
|
215
|
-
// Auto-start demo mode if ?demo=true
|
|
216
|
-
if (params.get('demo') === 'true' && !input.value) {
|
|
217
|
-
input.value = 'Build a todo app with authentication';
|
|
218
|
-
setTimeout(() => btn.click(), 1000);
|
|
219
|
-
}
|
|
73
|
+
initChat(API_BASE, API_KEY);
|
|
74
|
+
initTimeline();
|
|
75
|
+
initPreview();
|
|
220
76
|
</script>
|
|
221
77
|
</body>
|
|
222
78
|
</html>
|