cyclecad 0.1.10 → 0.2.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/app/agent-demo.html +719 -174
- package/app/index.html +58 -11
- package/architecture.html +372 -0
- package/package.json +1 -1
package/app/index.html
CHANGED
|
@@ -2704,20 +2704,67 @@
|
|
|
2704
2704
|
|
|
2705
2705
|
window.cycleCAD = { version: '1.0.0', APP, init };
|
|
2706
2706
|
|
|
2707
|
-
// ========== Hard Reset ==========
|
|
2707
|
+
// ========== Hard Reset (with browser detection) ==========
|
|
2708
2708
|
const hardResetBtn = document.getElementById('btn-hard-reset');
|
|
2709
2709
|
if (hardResetBtn) {
|
|
2710
|
-
|
|
2711
|
-
|
|
2712
|
-
if ('
|
|
2713
|
-
|
|
2714
|
-
|
|
2715
|
-
if ('
|
|
2716
|
-
|
|
2717
|
-
|
|
2710
|
+
function detectBrowserCC() {
|
|
2711
|
+
const ua = navigator.userAgent;
|
|
2712
|
+
if (/Edg\//i.test(ua)) return 'Edge';
|
|
2713
|
+
if (/Chrome\//i.test(ua) && !/Edg\//i.test(ua)) return 'Chrome';
|
|
2714
|
+
if (/Safari\//i.test(ua) && !/Chrome\//i.test(ua)) return 'Safari';
|
|
2715
|
+
if (/Firefox\//i.test(ua)) return 'Firefox';
|
|
2716
|
+
return 'Unknown';
|
|
2717
|
+
}
|
|
2718
|
+
hardResetBtn.addEventListener('click', async () => {
|
|
2719
|
+
const browser = detectBrowserCC();
|
|
2720
|
+
const msg = `Clear ALL cached data and reload?\n\nDetected browser: ${browser}\n\nThis will clear:\n• Service Workers\n• Cache API storage\n• IndexedDB databases\n• OPFS storage\n• localStorage & sessionStorage`;
|
|
2721
|
+
if (!confirm(msg)) return;
|
|
2722
|
+
const log = [];
|
|
2723
|
+
// 1. Unregister service workers
|
|
2724
|
+
try {
|
|
2725
|
+
if ('serviceWorker' in navigator) {
|
|
2726
|
+
const regs = await navigator.serviceWorker.getRegistrations();
|
|
2727
|
+
for (const r of regs) await r.unregister();
|
|
2728
|
+
log.push('SW: ' + regs.length);
|
|
2729
|
+
}
|
|
2730
|
+
} catch(e) {}
|
|
2731
|
+
// 2. Cache API
|
|
2732
|
+
try {
|
|
2733
|
+
if ('caches' in window) {
|
|
2734
|
+
const names = await caches.keys();
|
|
2735
|
+
for (const n of names) await caches.delete(n);
|
|
2736
|
+
log.push('Caches: ' + names.length);
|
|
2737
|
+
}
|
|
2738
|
+
} catch(e) {}
|
|
2739
|
+
// 3. IndexedDB — clear all
|
|
2740
|
+
try {
|
|
2741
|
+
if (indexedDB.databases) {
|
|
2742
|
+
const allDBs = await indexedDB.databases();
|
|
2743
|
+
for (const db of allDBs) { if (db.name) indexedDB.deleteDatabase(db.name); }
|
|
2744
|
+
log.push('IDB: ' + allDBs.length);
|
|
2745
|
+
}
|
|
2746
|
+
} catch(e) {}
|
|
2747
|
+
// 4. OPFS
|
|
2748
|
+
try {
|
|
2749
|
+
if (navigator.storage && navigator.storage.getDirectory) {
|
|
2750
|
+
const root = await navigator.storage.getDirectory();
|
|
2751
|
+
for await (const [name] of root.entries()) {
|
|
2752
|
+
try { await root.removeEntry(name, { recursive: true }); } catch(e) {}
|
|
2753
|
+
}
|
|
2754
|
+
log.push('OPFS: cleared');
|
|
2755
|
+
}
|
|
2756
|
+
} catch(e) {}
|
|
2757
|
+
// 5. Storage
|
|
2718
2758
|
try { localStorage.clear(); } catch(e) {}
|
|
2719
2759
|
try { sessionStorage.clear(); } catch(e) {}
|
|
2720
|
-
|
|
2760
|
+
log.push('Storage: cleared');
|
|
2761
|
+
console.log('[Hard Reset]', browser, log.join(' | '));
|
|
2762
|
+
// 6. Browser-specific reload
|
|
2763
|
+
if (browser === 'Safari') {
|
|
2764
|
+
window.location.href = window.location.pathname + '?cachebust=' + Date.now();
|
|
2765
|
+
} else {
|
|
2766
|
+
setTimeout(() => { window.location.reload(true); }, 300);
|
|
2767
|
+
}
|
|
2721
2768
|
});
|
|
2722
2769
|
}
|
|
2723
2770
|
|
|
@@ -3421,6 +3468,6 @@
|
|
|
3421
3468
|
</div>
|
|
3422
3469
|
</div>
|
|
3423
3470
|
|
|
3424
|
-
<span id="version-badge" style="position:fixed;bottom:
|
|
3471
|
+
<span id="version-badge" style="position:fixed;bottom:10px;left:50%;transform:translateX(-50%);z-index:70;font-size:0.85rem;color:rgba(255,255,255,0.7);letter-spacing:0.1em;white-space:nowrap;padding:5px 14px;user-select:all;pointer-events:auto;font-family:monospace;font-weight:600;background:rgba(0,0,0,0.5);border:1px solid rgba(255,255,255,0.15);border-radius:6px;text-shadow:0 1px 3px rgba(0,0,0,0.5);" title="cycleCAD version">cycleCAD v0.2.0</span>
|
|
3425
3472
|
</body>
|
|
3426
3473
|
</html>
|
|
@@ -0,0 +1,372 @@
|
|
|
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>cycleCAD System Architecture</title>
|
|
7
|
+
<style>
|
|
8
|
+
* { margin: 0; padding: 0; box-sizing: border-box; }
|
|
9
|
+
body { font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif; background: #0a0c14; color: #e0e4ec; min-height: 100vh; padding: 40px 20px; }
|
|
10
|
+
|
|
11
|
+
.container { max-width: 1200px; margin: 0 auto; }
|
|
12
|
+
|
|
13
|
+
h1 { text-align: center; font-size: 28px; margin-bottom: 8px; background: linear-gradient(135deg, #00d4ff, #7b61ff); -webkit-background-clip: text; -webkit-text-fill-color: transparent; }
|
|
14
|
+
.subtitle { text-align: center; font-size: 14px; color: #6b7b8f; margin-bottom: 40px; }
|
|
15
|
+
|
|
16
|
+
/* Architecture layers */
|
|
17
|
+
.layer { position: relative; margin-bottom: 24px; }
|
|
18
|
+
.layer-label { position: absolute; left: -10px; top: 50%; transform: translateY(-50%) rotate(-90deg); font-size: 10px; letter-spacing: 2px; text-transform: uppercase; color: #4a5568; font-weight: 600; white-space: nowrap; }
|
|
19
|
+
|
|
20
|
+
.row { display: flex; gap: 16px; justify-content: center; flex-wrap: wrap; }
|
|
21
|
+
|
|
22
|
+
/* Boxes */
|
|
23
|
+
.box { border-radius: 10px; padding: 16px 20px; text-align: center; position: relative; transition: all 0.3s; min-width: 160px; }
|
|
24
|
+
.box:hover { transform: translateY(-2px); box-shadow: 0 8px 30px rgba(0,0,0,0.3); }
|
|
25
|
+
.box h3 { font-size: 14px; margin-bottom: 4px; }
|
|
26
|
+
.box p { font-size: 11px; color: #8892a4; line-height: 1.4; }
|
|
27
|
+
.box .icon { font-size: 24px; margin-bottom: 8px; display: block; }
|
|
28
|
+
|
|
29
|
+
/* Interface layer (top) */
|
|
30
|
+
.interface { background: linear-gradient(135deg, rgba(0,212,255,0.12), rgba(0,100,200,0.08)); border: 1px solid rgba(0,212,255,0.3); }
|
|
31
|
+
.interface h3 { color: #00d4ff; }
|
|
32
|
+
.interface.agent { background: linear-gradient(135deg, rgba(123,97,255,0.12), rgba(80,50,200,0.08)); border: 1px solid rgba(123,97,255,0.3); }
|
|
33
|
+
.interface.agent h3 { color: #7b61ff; }
|
|
34
|
+
|
|
35
|
+
/* Core engine */
|
|
36
|
+
.core { background: linear-gradient(135deg, rgba(255,165,0,0.1), rgba(200,100,0,0.06)); border: 1px solid rgba(255,165,0,0.25); }
|
|
37
|
+
.core h3 { color: #ffaa33; }
|
|
38
|
+
|
|
39
|
+
/* Module layer */
|
|
40
|
+
.module { background: rgba(255,255,255,0.04); border: 1px solid rgba(255,255,255,0.1); min-width: 120px; padding: 12px 14px; }
|
|
41
|
+
.module h3 { color: #a8b8cc; font-size: 12px; }
|
|
42
|
+
.module p { font-size: 10px; }
|
|
43
|
+
|
|
44
|
+
/* Storage layer */
|
|
45
|
+
.storage { background: linear-gradient(135deg, rgba(76,175,80,0.1), rgba(40,120,40,0.06)); border: 1px solid rgba(76,175,80,0.25); }
|
|
46
|
+
.storage h3 { color: #66bb6a; }
|
|
47
|
+
|
|
48
|
+
/* External */
|
|
49
|
+
.external { background: rgba(255,255,255,0.02); border: 1px dashed rgba(255,255,255,0.12); }
|
|
50
|
+
.external h3 { color: #6b7b8f; font-size: 12px; }
|
|
51
|
+
|
|
52
|
+
/* Arrows */
|
|
53
|
+
.arrow-row { display: flex; justify-content: center; gap: 200px; padding: 8px 0; }
|
|
54
|
+
.arrow { text-align: center; color: #4a5568; font-size: 20px; line-height: 1; }
|
|
55
|
+
.arrow span { display: block; font-size: 9px; letter-spacing: 1px; text-transform: uppercase; margin-top: 2px; }
|
|
56
|
+
|
|
57
|
+
.arrow-down { text-align: center; color: #4a5568; font-size: 20px; padding: 6px 0; }
|
|
58
|
+
.arrow-down span { font-size: 9px; letter-spacing: 1px; text-transform: uppercase; }
|
|
59
|
+
|
|
60
|
+
/* Bidirectional connector */
|
|
61
|
+
.connector { display: flex; align-items: center; justify-content: center; gap: 8px; padding: 10px 0; }
|
|
62
|
+
.connector-line { flex: 1; max-width: 200px; height: 1px; background: linear-gradient(90deg, transparent, rgba(255,165,0,0.4), transparent); }
|
|
63
|
+
.connector-label { font-size: 10px; color: #6b7b8f; text-transform: uppercase; letter-spacing: 1px; white-space: nowrap; }
|
|
64
|
+
|
|
65
|
+
/* Section divider */
|
|
66
|
+
.divider { border: none; border-top: 1px dashed rgba(255,255,255,0.06); margin: 16px 0; }
|
|
67
|
+
|
|
68
|
+
/* Big interface boxes */
|
|
69
|
+
.interface-group { flex: 1; min-width: 300px; max-width: 500px; border-radius: 12px; padding: 20px; }
|
|
70
|
+
.interface-group.human { background: linear-gradient(135deg, rgba(0,212,255,0.06), rgba(0,100,200,0.03)); border: 1px solid rgba(0,212,255,0.2); }
|
|
71
|
+
.interface-group.ai { background: linear-gradient(135deg, rgba(123,97,255,0.06), rgba(80,50,200,0.03)); border: 1px solid rgba(123,97,255,0.2); }
|
|
72
|
+
.interface-group h2 { font-size: 16px; margin-bottom: 12px; display: flex; align-items: center; gap: 8px; }
|
|
73
|
+
.interface-group.human h2 { color: #00d4ff; }
|
|
74
|
+
.interface-group.ai h2 { color: #7b61ff; }
|
|
75
|
+
|
|
76
|
+
.feature-list { list-style: none; display: flex; flex-wrap: wrap; gap: 6px; }
|
|
77
|
+
.feature-list li { background: rgba(255,255,255,0.05); border: 1px solid rgba(255,255,255,0.08); border-radius: 6px; padding: 6px 10px; font-size: 11px; color: #a8b8cc; }
|
|
78
|
+
|
|
79
|
+
.badge { display: inline-block; padding: 2px 8px; border-radius: 10px; font-size: 9px; font-weight: 600; letter-spacing: 0.5px; text-transform: uppercase; margin-left: 6px; }
|
|
80
|
+
.badge-human { background: rgba(0,212,255,0.15); color: #00d4ff; border: 1px solid rgba(0,212,255,0.3); }
|
|
81
|
+
.badge-agent { background: rgba(123,97,255,0.15); color: #7b61ff; border: 1px solid rgba(123,97,255,0.3); }
|
|
82
|
+
.badge-both { background: rgba(255,165,0,0.15); color: #ffaa33; border: 1px solid rgba(255,165,0,0.3); }
|
|
83
|
+
|
|
84
|
+
/* Legend */
|
|
85
|
+
.legend { display: flex; gap: 20px; justify-content: center; margin-top: 30px; flex-wrap: wrap; }
|
|
86
|
+
.legend-item { display: flex; align-items: center; gap: 6px; font-size: 11px; color: #6b7b8f; }
|
|
87
|
+
.legend-dot { width: 10px; height: 10px; border-radius: 50%; }
|
|
88
|
+
|
|
89
|
+
/* Stats */
|
|
90
|
+
.stats { display: flex; gap: 24px; justify-content: center; margin: 24px 0; flex-wrap: wrap; }
|
|
91
|
+
.stat { text-align: center; }
|
|
92
|
+
.stat .num { font-size: 28px; font-weight: 700; background: linear-gradient(135deg, #00d4ff, #7b61ff); -webkit-background-clip: text; -webkit-text-fill-color: transparent; }
|
|
93
|
+
.stat .label { font-size: 10px; color: #6b7b8f; text-transform: uppercase; letter-spacing: 1px; }
|
|
94
|
+
</style>
|
|
95
|
+
</head>
|
|
96
|
+
<body>
|
|
97
|
+
<div class="container">
|
|
98
|
+
|
|
99
|
+
<h1>cycleCAD System Architecture</h1>
|
|
100
|
+
<p class="subtitle">Dual-Interface CAD Platform — Humans + AI Agents share the same core engine</p>
|
|
101
|
+
|
|
102
|
+
<div class="stats">
|
|
103
|
+
<div class="stat"><div class="num">2</div><div class="label">Interfaces</div></div>
|
|
104
|
+
<div class="stat"><div class="num">19</div><div class="label">Modules</div></div>
|
|
105
|
+
<div class="stat"><div class="num">55+</div><div class="label">API Commands</div></div>
|
|
106
|
+
<div class="stat"><div class="num">12</div><div class="label">Shape Types</div></div>
|
|
107
|
+
<div class="stat"><div class="num">20+</div><div class="label">Operations</div></div>
|
|
108
|
+
<div class="stat"><div class="num">0</div><div class="label">Dependencies</div></div>
|
|
109
|
+
</div>
|
|
110
|
+
|
|
111
|
+
<hr class="divider">
|
|
112
|
+
|
|
113
|
+
<!-- INTERFACE LAYER -->
|
|
114
|
+
<div style="margin-bottom:8px;text-align:center;font-size:10px;letter-spacing:2px;text-transform:uppercase;color:#4a5568;font-weight:600;">Interface Layer</div>
|
|
115
|
+
|
|
116
|
+
<div class="row" style="gap:24px;">
|
|
117
|
+
<!-- HUMAN UI -->
|
|
118
|
+
<div class="interface-group human">
|
|
119
|
+
<h2>
|
|
120
|
+
<span style="font-size:20px;">🖥️</span> Human Interface (UI)
|
|
121
|
+
<span class="badge badge-human">Browser GUI</span>
|
|
122
|
+
</h2>
|
|
123
|
+
<p style="font-size:12px;color:#8892a4;margin-bottom:12px;">Traditional CAD interface — click, drag, type. Toolbar, panels, viewport, keyboard shortcuts.</p>
|
|
124
|
+
<ul class="feature-list">
|
|
125
|
+
<li>3D Viewport (Three.js r170)</li>
|
|
126
|
+
<li>2D Sketch Canvas</li>
|
|
127
|
+
<li>Feature Tree Panel</li>
|
|
128
|
+
<li>Property Editor</li>
|
|
129
|
+
<li>Tabbed Toolbar (6 tabs)</li>
|
|
130
|
+
<li>Context Menus</li>
|
|
131
|
+
<li>25+ Keyboard Shortcuts</li>
|
|
132
|
+
<li>Drag-and-Drop Import</li>
|
|
133
|
+
<li>Multi-language (6 langs)</li>
|
|
134
|
+
<li>Mobile Touch Controls</li>
|
|
135
|
+
<li>Dark Theme (VS Code-style)</li>
|
|
136
|
+
<li>Project Browser</li>
|
|
137
|
+
</ul>
|
|
138
|
+
<div style="margin-top:12px;padding:10px;background:rgba(0,212,255,0.05);border-radius:6px;border:1px solid rgba(0,212,255,0.1);">
|
|
139
|
+
<strong style="font-size:11px;color:#00d4ff;">Entry Points:</strong>
|
|
140
|
+
<p style="font-size:10px;color:#6b7b8f;margin-top:4px;">
|
|
141
|
+
<code>app/index.html</code> — Main app (3,156 lines)<br>
|
|
142
|
+
<code>app/mobile.html</code> — Phone edition (1,277 lines)<br>
|
|
143
|
+
<code>index.html</code> — Landing page (14K lines)
|
|
144
|
+
</p>
|
|
145
|
+
</div>
|
|
146
|
+
</div>
|
|
147
|
+
|
|
148
|
+
<!-- AGENT API -->
|
|
149
|
+
<div class="interface-group ai">
|
|
150
|
+
<h2>
|
|
151
|
+
<span style="font-size:20px;">🤖</span> Agent Interface (API)
|
|
152
|
+
<span class="badge badge-agent">JSON-RPC 2.0</span>
|
|
153
|
+
</h2>
|
|
154
|
+
<p style="font-size:12px;color:#8892a4;margin-bottom:12px;">AI-first interface — any LLM sends JSON commands. No GUI needed. Agents are the only interface.</p>
|
|
155
|
+
<ul class="feature-list">
|
|
156
|
+
<li>55+ Commands</li>
|
|
157
|
+
<li>10 Namespaces</li>
|
|
158
|
+
<li>Self-Describing Schema</li>
|
|
159
|
+
<li>Voice + NLP Parser</li>
|
|
160
|
+
<li>12 Shape Types</li>
|
|
161
|
+
<li>20+ Operations</li>
|
|
162
|
+
<li>Batch Execution</li>
|
|
163
|
+
<li>Transaction Support</li>
|
|
164
|
+
<li>Undo/Redo History</li>
|
|
165
|
+
<li>Event System (on/off)</li>
|
|
166
|
+
<li>Design Review Agent</li>
|
|
167
|
+
<li>Manufacturing Agent</li>
|
|
168
|
+
</ul>
|
|
169
|
+
<div style="margin-top:12px;padding:10px;background:rgba(123,97,255,0.05);border-radius:6px;border:1px solid rgba(123,97,255,0.1);">
|
|
170
|
+
<strong style="font-size:11px;color:#7b61ff;">Entry Points:</strong>
|
|
171
|
+
<p style="font-size:10px;color:#6b7b8f;margin-top:4px;">
|
|
172
|
+
<code>app/js/agent-api.js</code> — Core API (1,903 lines)<br>
|
|
173
|
+
<code>app/agent-demo.html</code> — Interactive demo (1,500+ lines)<br>
|
|
174
|
+
<code>window.cycleCAD.execute({ method, params })</code>
|
|
175
|
+
</p>
|
|
176
|
+
</div>
|
|
177
|
+
</div>
|
|
178
|
+
</div>
|
|
179
|
+
|
|
180
|
+
<!-- ARROWS DOWN -->
|
|
181
|
+
<div class="arrow-row">
|
|
182
|
+
<div class="arrow">↓<span>DOM Events, Clicks, Keys</span></div>
|
|
183
|
+
<div class="arrow">↓<span>JSON Commands</span></div>
|
|
184
|
+
</div>
|
|
185
|
+
|
|
186
|
+
<!-- SHARED CORE -->
|
|
187
|
+
<div style="margin-bottom:8px;text-align:center;font-size:10px;letter-spacing:2px;text-transform:uppercase;color:#4a5568;font-weight:600;">Shared Core Engine</div>
|
|
188
|
+
|
|
189
|
+
<div class="row" style="justify-content:center;">
|
|
190
|
+
<div class="box core" style="min-width:500px;">
|
|
191
|
+
<span class="icon">⚙️</span>
|
|
192
|
+
<h3>cycleCAD Core — Shared Geometry & State</h3>
|
|
193
|
+
<p>Both interfaces call the SAME functions. Same Three.js scene, same feature tree, same undo history.</p>
|
|
194
|
+
<div style="margin-top:12px;display:flex;gap:8px;flex-wrap:wrap;justify-content:center;">
|
|
195
|
+
<span class="badge badge-both">Shared Scene</span>
|
|
196
|
+
<span class="badge badge-both">Shared State</span>
|
|
197
|
+
<span class="badge badge-both">Shared History</span>
|
|
198
|
+
</div>
|
|
199
|
+
</div>
|
|
200
|
+
</div>
|
|
201
|
+
|
|
202
|
+
<div class="arrow-down" style="text-align:center;">↓ <span>dispatches to modules</span></div>
|
|
203
|
+
|
|
204
|
+
<!-- MODULE LAYER -->
|
|
205
|
+
<div style="margin-bottom:8px;text-align:center;font-size:10px;letter-spacing:2px;text-transform:uppercase;color:#4a5568;font-weight:600;">Module Layer — 19 ES Modules (Zero Dependencies, CDN Only)</div>
|
|
206
|
+
|
|
207
|
+
<div class="row" style="gap:8px;">
|
|
208
|
+
<div class="box module"><h3>viewport.js</h3><p>Three.js scene, camera, lights, OrbitControls</p></div>
|
|
209
|
+
<div class="box module"><h3>sketch.js</h3><p>2D canvas, line/rect/circle/arc, grid snap</p></div>
|
|
210
|
+
<div class="box module"><h3>operations.js</h3><p>Extrude, revolve, fillet, chamfer, boolean, shell</p></div>
|
|
211
|
+
<div class="box module"><h3>advanced-ops.js</h3><p>Sweep, loft, sheet metal, spring, thread</p></div>
|
|
212
|
+
<div class="box module"><h3>constraint-solver.js</h3><p>12 constraint types, iterative relaxation</p></div>
|
|
213
|
+
</div>
|
|
214
|
+
|
|
215
|
+
<div class="row" style="gap:8px;margin-top:8px;">
|
|
216
|
+
<div class="box module"><h3>assembly.js</h3><p>Components, mates, joints, explode</p></div>
|
|
217
|
+
<div class="box module"><h3>tree.js</h3><p>Feature tree, rename, suppress, context menu</p></div>
|
|
218
|
+
<div class="box module"><h3>params.js</h3><p>Parameter editor, 6 materials</p></div>
|
|
219
|
+
<div class="box module"><h3>app.js</h3><p>State, modes, undo/redo history</p></div>
|
|
220
|
+
<div class="box module"><h3>shortcuts.js</h3><p>25+ keyboard shortcuts</p></div>
|
|
221
|
+
</div>
|
|
222
|
+
|
|
223
|
+
<div class="row" style="gap:8px;margin-top:8px;">
|
|
224
|
+
<div class="box module"><h3>inventor-parser.js</h3><p>OLE2/CFB binary parser, 26 features</p></div>
|
|
225
|
+
<div class="box module"><h3>assembly-resolver.js</h3><p>Parse .iam, resolve paths, BOM</p></div>
|
|
226
|
+
<div class="box module"><h3>project-loader.js</h3><p>Parse .ipj, index folders</p></div>
|
|
227
|
+
<div class="box module"><h3>project-browser.js</h3><p>Folder tree UI, search, stats</p></div>
|
|
228
|
+
<div class="box module"><h3>rebuild-guide.js</h3><p>Step-by-step recreation guides</p></div>
|
|
229
|
+
</div>
|
|
230
|
+
|
|
231
|
+
<div class="row" style="gap:8px;margin-top:8px;">
|
|
232
|
+
<div class="box module"><h3>reverse-engineer.js</h3><p>STL import, geometry analysis</p></div>
|
|
233
|
+
<div class="box module"><h3>ai-chat.js</h3><p>Gemini + Groq + offline NLP</p></div>
|
|
234
|
+
<div class="box module"><h3>export.js</h3><p>STL, OBJ, glTF, DXF, JSON</p></div>
|
|
235
|
+
<div class="box module"><h3>dxf-export.js</h3><p>2D/3D DXF engineering drawings</p></div>
|
|
236
|
+
</div>
|
|
237
|
+
|
|
238
|
+
<div class="arrow-down" style="text-align:center;">↓</div>
|
|
239
|
+
|
|
240
|
+
<!-- VIEWER MODE (EXPLODEVIEW MERGE) -->
|
|
241
|
+
<div style="margin-bottom:8px;text-align:center;font-size:10px;letter-spacing:2px;text-transform:uppercase;color:#4a5568;font-weight:600;">Viewer Mode (ExplodeView Merge — Shared Three.js Scene)</div>
|
|
242
|
+
|
|
243
|
+
<div class="row">
|
|
244
|
+
<div class="box" style="background:linear-gradient(135deg,rgba(0,255,136,0.08),rgba(0,180,80,0.04));border:1px solid rgba(0,255,136,0.2);min-width:400px;">
|
|
245
|
+
<span class="icon">🔍</span>
|
|
246
|
+
<h3 style="color:#00ff88;">viewer-mode.js — ExplodeView as Viewer Tab</h3>
|
|
247
|
+
<p>40+ analysis tools from ExplodeView. Explode/collapse, section cut, annotations, measurement, BOM, AI identification, maintenance heatmap, service mode, technical report.</p>
|
|
248
|
+
<div style="margin-top:8px;display:flex;gap:6px;flex-wrap:wrap;justify-content:center;">
|
|
249
|
+
<span style="font-size:10px;color:#6b7b8f;background:rgba(0,255,136,0.06);border:1px solid rgba(0,255,136,0.15);padding:3px 8px;border-radius:4px;">Explode View</span>
|
|
250
|
+
<span style="font-size:10px;color:#6b7b8f;background:rgba(0,255,136,0.06);border:1px solid rgba(0,255,136,0.15);padding:3px 8px;border-radius:4px;">Section Cut</span>
|
|
251
|
+
<span style="font-size:10px;color:#6b7b8f;background:rgba(0,255,136,0.06);border:1px solid rgba(0,255,136,0.15);padding:3px 8px;border-radius:4px;">AI Part ID</span>
|
|
252
|
+
<span style="font-size:10px;color:#6b7b8f;background:rgba(0,255,136,0.06);border:1px solid rgba(0,255,136,0.15);padding:3px 8px;border-radius:4px;">Maintenance</span>
|
|
253
|
+
<span style="font-size:10px;color:#6b7b8f;background:rgba(0,255,136,0.06);border:1px solid rgba(0,255,136,0.15);padding:3px 8px;border-radius:4px;">Service Mode</span>
|
|
254
|
+
<span style="font-size:10px;color:#6b7b8f;background:rgba(0,255,136,0.06);border:1px solid rgba(0,255,136,0.15);padding:3px 8px;border-radius:4px;">40+ Tools</span>
|
|
255
|
+
</div>
|
|
256
|
+
</div>
|
|
257
|
+
</div>
|
|
258
|
+
|
|
259
|
+
<div class="arrow-down" style="text-align:center;">↓</div>
|
|
260
|
+
|
|
261
|
+
<!-- STORAGE & EXTERNAL -->
|
|
262
|
+
<div style="margin-bottom:8px;text-align:center;font-size:10px;letter-spacing:2px;text-transform:uppercase;color:#4a5568;font-weight:600;">Storage & External Services</div>
|
|
263
|
+
|
|
264
|
+
<div class="row" style="gap:12px;">
|
|
265
|
+
<div class="box storage"><h3>IndexedDB</h3><p>GLB cache, model library, settings</p></div>
|
|
266
|
+
<div class="box storage"><h3>localStorage</h3><p>API keys, preferences, last model</p></div>
|
|
267
|
+
<div class="box storage"><h3>File System</h3><p>STEP/STL/OBJ import, export downloads</p></div>
|
|
268
|
+
<div class="box external"><h3>Gemini Flash API</h3><p>AI part identification, chatbot</p></div>
|
|
269
|
+
<div class="box external"><h3>Groq API</h3><p>Llama 3.1 8B fallback LLM</p></div>
|
|
270
|
+
<div class="box external"><h3>OpenCascade.js</h3><p>STEP import WASM (planned)</p></div>
|
|
271
|
+
</div>
|
|
272
|
+
|
|
273
|
+
<hr class="divider" style="margin-top:30px;">
|
|
274
|
+
|
|
275
|
+
<!-- DATA FLOW -->
|
|
276
|
+
<div style="text-align:center;margin:24px 0;">
|
|
277
|
+
<h2 style="font-size:18px;color:#ffaa33;margin-bottom:16px;">Data Flow: Human vs Agent</h2>
|
|
278
|
+
<div style="display:flex;gap:40px;justify-content:center;flex-wrap:wrap;">
|
|
279
|
+
<!-- Human flow -->
|
|
280
|
+
<div style="text-align:left;max-width:420px;">
|
|
281
|
+
<h3 style="color:#00d4ff;font-size:13px;margin-bottom:10px;">🖥️ Human Interface Flow</h3>
|
|
282
|
+
<div style="font-family:monospace;font-size:11px;line-height:2;color:#8892a4;">
|
|
283
|
+
<div style="color:#00d4ff;">User clicks "Extrude" button in toolbar</div>
|
|
284
|
+
<div>→ DOM event listener fires</div>
|
|
285
|
+
<div>→ <code style="color:#ffaa33;">operations.extrude(params)</code></div>
|
|
286
|
+
<div>→ Three.js geometry updated in scene</div>
|
|
287
|
+
<div>→ Feature tree panel re-rendered</div>
|
|
288
|
+
<div>→ Undo history snapshot saved</div>
|
|
289
|
+
<div style="color:#66bb6a;">→ User sees result in 3D viewport</div>
|
|
290
|
+
</div>
|
|
291
|
+
</div>
|
|
292
|
+
<!-- Agent flow -->
|
|
293
|
+
<div style="text-align:left;max-width:420px;">
|
|
294
|
+
<h3 style="color:#7b61ff;font-size:13px;margin-bottom:10px;">🤖 Agent Interface Flow</h3>
|
|
295
|
+
<div style="font-family:monospace;font-size:11px;line-height:2;color:#8892a4;">
|
|
296
|
+
<div style="color:#7b61ff;">Agent sends: { method: "feature.extrude", params: { depth: 50 } }</div>
|
|
297
|
+
<div>→ <code style="color:#ffaa33;">agent-api.js</code> dispatches command</div>
|
|
298
|
+
<div>→ <code style="color:#ffaa33;">operations.extrude(params)</code></div>
|
|
299
|
+
<div>→ Three.js geometry updated in scene</div>
|
|
300
|
+
<div>→ Feature tree panel re-rendered</div>
|
|
301
|
+
<div>→ Undo history snapshot saved</div>
|
|
302
|
+
<div style="color:#66bb6a;">→ Agent receives: { ok: true, result: { entityId: "extrude_1" } }</div>
|
|
303
|
+
</div>
|
|
304
|
+
</div>
|
|
305
|
+
</div>
|
|
306
|
+
<p style="margin-top:16px;font-size:12px;color:#ffaa33;font-weight:600;">Both paths call the SAME <code>operations.extrude()</code> — one codebase, two interfaces.</p>
|
|
307
|
+
</div>
|
|
308
|
+
|
|
309
|
+
<hr class="divider">
|
|
310
|
+
|
|
311
|
+
<!-- API NAMESPACES -->
|
|
312
|
+
<div style="text-align:center;margin:24px 0;">
|
|
313
|
+
<h2 style="font-size:18px;color:#7b61ff;margin-bottom:16px;">Agent API — 10 Namespaces</h2>
|
|
314
|
+
<div style="display:grid;grid-template-columns:repeat(auto-fit,minmax(200px,1fr));gap:10px;text-align:left;">
|
|
315
|
+
<div style="padding:12px;background:rgba(123,97,255,0.05);border:1px solid rgba(123,97,255,0.15);border-radius:8px;">
|
|
316
|
+
<strong style="color:#7b61ff;font-size:12px;">sketch.*</strong>
|
|
317
|
+
<p style="font-size:10px;color:#6b7b8f;margin-top:4px;">start, line, rect, circle, arc, close, constrain</p>
|
|
318
|
+
</div>
|
|
319
|
+
<div style="padding:12px;background:rgba(123,97,255,0.05);border:1px solid rgba(123,97,255,0.15);border-radius:8px;">
|
|
320
|
+
<strong style="color:#7b61ff;font-size:12px;">shape.*</strong>
|
|
321
|
+
<p style="font-size:10px;color:#6b7b8f;margin-top:4px;">cylinder, box, sphere, cone, torus, plate, gear + 5 more</p>
|
|
322
|
+
</div>
|
|
323
|
+
<div style="padding:12px;background:rgba(123,97,255,0.05);border:1px solid rgba(123,97,255,0.15);border-radius:8px;">
|
|
324
|
+
<strong style="color:#7b61ff;font-size:12px;">feature.*</strong>
|
|
325
|
+
<p style="font-size:10px;color:#6b7b8f;margin-top:4px;">extrude, revolve, fillet, chamfer, shell, pattern, mirror, thread</p>
|
|
326
|
+
</div>
|
|
327
|
+
<div style="padding:12px;background:rgba(123,97,255,0.05);border:1px solid rgba(123,97,255,0.15);border-radius:8px;">
|
|
328
|
+
<strong style="color:#7b61ff;font-size:12px;">boolean.*</strong>
|
|
329
|
+
<p style="font-size:10px;color:#6b7b8f;margin-top:4px;">union, subtract, intersect</p>
|
|
330
|
+
</div>
|
|
331
|
+
<div style="padding:12px;background:rgba(123,97,255,0.05);border:1px solid rgba(123,97,255,0.15);border-radius:8px;">
|
|
332
|
+
<strong style="color:#7b61ff;font-size:12px;">assembly.*</strong>
|
|
333
|
+
<p style="font-size:10px;color:#6b7b8f;margin-top:4px;">addComponent, mate, explode, collapse, getBOM</p>
|
|
334
|
+
</div>
|
|
335
|
+
<div style="padding:12px;background:rgba(123,97,255,0.05);border:1px solid rgba(123,97,255,0.15);border-radius:8px;">
|
|
336
|
+
<strong style="color:#7b61ff;font-size:12px;">render.*</strong>
|
|
337
|
+
<p style="font-size:10px;color:#6b7b8f;margin-top:4px;">snapshot, multiview, fitToSelection, setView</p>
|
|
338
|
+
</div>
|
|
339
|
+
<div style="padding:12px;background:rgba(123,97,255,0.05);border:1px solid rgba(123,97,255,0.15);border-radius:8px;">
|
|
340
|
+
<strong style="color:#7b61ff;font-size:12px;">validate.*</strong>
|
|
341
|
+
<p style="font-size:10px;color:#6b7b8f;margin-top:4px;">designReview, dfmCheck, costEstimate, weightCalc</p>
|
|
342
|
+
</div>
|
|
343
|
+
<div style="padding:12px;background:rgba(123,97,255,0.05);border:1px solid rgba(123,97,255,0.15);border-radius:8px;">
|
|
344
|
+
<strong style="color:#7b61ff;font-size:12px;">export.*</strong>
|
|
345
|
+
<p style="font-size:10px;color:#6b7b8f;margin-top:4px;">stl, obj, gltf, step, dxf, json</p>
|
|
346
|
+
</div>
|
|
347
|
+
<div style="padding:12px;background:rgba(123,97,255,0.05);border:1px solid rgba(123,97,255,0.15);border-radius:8px;">
|
|
348
|
+
<strong style="color:#7b61ff;font-size:12px;">ai.*</strong>
|
|
349
|
+
<p style="font-size:10px;color:#6b7b8f;margin-top:4px;">identifyPart, chatQuery, generateGuide, nlCommand</p>
|
|
350
|
+
</div>
|
|
351
|
+
<div style="padding:12px;background:rgba(123,97,255,0.05);border:1px solid rgba(123,97,255,0.15);border-radius:8px;">
|
|
352
|
+
<strong style="color:#7b61ff;font-size:12px;">session.*</strong>
|
|
353
|
+
<p style="font-size:10px;color:#6b7b8f;margin-top:4px;">getState, getSchema, ping, undo, redo, clear</p>
|
|
354
|
+
</div>
|
|
355
|
+
</div>
|
|
356
|
+
</div>
|
|
357
|
+
|
|
358
|
+
<!-- Legend -->
|
|
359
|
+
<div class="legend">
|
|
360
|
+
<div class="legend-item"><div class="legend-dot" style="background:#00d4ff;"></div> Human Interface</div>
|
|
361
|
+
<div class="legend-item"><div class="legend-dot" style="background:#7b61ff;"></div> Agent Interface</div>
|
|
362
|
+
<div class="legend-item"><div class="legend-dot" style="background:#ffaa33;"></div> Shared Core</div>
|
|
363
|
+
<div class="legend-item"><div class="legend-dot" style="background:#00ff88;"></div> Viewer Mode (ExplodeView)</div>
|
|
364
|
+
<div class="legend-item"><div class="legend-dot" style="background:#66bb6a;"></div> Storage</div>
|
|
365
|
+
<div class="legend-item"><div class="legend-dot" style="background:#6b7b8f;"></div> External Services</div>
|
|
366
|
+
</div>
|
|
367
|
+
|
|
368
|
+
<p style="text-align:center;margin-top:24px;font-size:11px;color:#4a5568;">cycleCAD — Agent-First OS for Manufacturing | cyclecad.com | v0.1.9</p>
|
|
369
|
+
|
|
370
|
+
</div>
|
|
371
|
+
</body>
|
|
372
|
+
</html>
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "cyclecad",
|
|
3
|
-
"version": "0.1
|
|
3
|
+
"version": "0.2.1",
|
|
4
4
|
"description": "Browser-based parametric 3D CAD modeler with AI-powered tools, native Inventor file parsing, and smart assembly management. No install required.",
|
|
5
5
|
"main": "index.html",
|
|
6
6
|
"scripts": {
|