cyclecad 1.0.3 → 1.0.4

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/index.html CHANGED
@@ -1419,7 +1419,7 @@
1419
1419
  <span class="splash-logo-cycle">cycle</span><span class="splash-logo-cad">CAD</span>
1420
1420
  </div>
1421
1421
  <p class="splash-subtitle">Parametric 3D CAD Modeler for the Mechanical Designer</p>
1422
- <p style="display:inline-block; color:#0066cc; font-size:1rem; margin:12px 0 0 0; letter-spacing:2px; font-family:monospace; font-weight:700; background:rgba(0,102,204,0.08); border:1.5px solid rgba(0,102,204,0.25); border-radius:8px; padding:5px 20px;">v1.0.3</p>
1422
+ <p style="display:inline-block; color:#0066cc; font-size:1rem; margin:12px 0 0 0; letter-spacing:2px; font-family:monospace; font-weight:700; background:rgba(0,102,204,0.08); border:1.5px solid rgba(0,102,204,0.25); border-radius:8px; padding:5px 20px;">v1.0.4</p>
1423
1423
  </div>
1424
1424
  <div class="splash-options">
1425
1425
  <button class="splash-button splash-button-primary" id="btn-empty-project" style="grid-column: 1 / -1;">
@@ -2885,6 +2885,9 @@
2885
2885
  }
2886
2886
  }
2887
2887
 
2888
+ // Expose globally so Copilot + Agent API + tutorials can create geometry
2889
+ window._executeParsedPrompt = function(prompt) { executeParsedPrompt(prompt); };
2890
+
2888
2891
  function executeParsedPrompt(prompt) {
2889
2892
  try {
2890
2893
  const splash = document.getElementById('welcome-splash');
@@ -5240,6 +5243,6 @@
5240
5243
  </div>
5241
5244
  </div>
5242
5245
 
5243
- <span id="version-badge" style="position:fixed;bottom:42px;left:50%;transform:translateX(-50%);z-index:999;font-size:0.9rem;color:rgba(255,255,255,0.9);letter-spacing:0.1em;white-space:nowrap;padding:6px 16px;user-select:all;pointer-events:auto;font-family:monospace;font-weight:700;background:rgba(0,0,0,0.7);border:1px solid rgba(88,166,255,0.4);border-radius:6px;text-shadow:0 1px 3px rgba(0,0,0,0.5);" title="cycleCAD version">cycleCAD v1.0.3</span>
5246
+ <span id="version-badge" style="position:fixed;bottom:42px;left:50%;transform:translateX(-50%);z-index:999;font-size:0.9rem;color:rgba(255,255,255,0.9);letter-spacing:0.1em;white-space:nowrap;padding:6px 16px;user-select:all;pointer-events:auto;font-family:monospace;font-weight:700;background:rgba(0,0,0,0.7);border:1px solid rgba(88,166,255,0.4);border-radius:6px;text-shadow:0 1px 3px rgba(0,0,0,0.5);" title="cycleCAD version">cycleCAD v1.0.4</span>
5244
5247
  </body>
5245
5248
  </html>
@@ -938,20 +938,29 @@ export async function executeTextCommand(prompt) {
938
938
  return { ok: false };
939
939
  }
940
940
 
941
- // Execute via Agent API
942
- if (window.cycleCAD && window.cycleCAD.execute) {
943
- const results = [];
944
- for (const cmd of commands) {
945
- const result = await window.cycleCAD.execute(cmd);
946
- results.push(result);
941
+ addMessage('ai', `Got it! ${preview}. Creating now...`);
942
+
943
+ // Execute: try direct geometry creation first (fastest path)
944
+ const results = [];
945
+ for (const cmd of commands) {
946
+ try {
947
+ // Convert Agent API format {method: 'shape.cylinder', params: {}} to executeParsedPrompt format {type: 'cylinder', params: {}}
948
+ if (window._executeParsedPrompt) {
949
+ const method = cmd.method || '';
950
+ const type = method.replace('shape.', '').replace('feature.', '');
951
+ window._executeParsedPrompt({ type, params: cmd.params || {} });
952
+ results.push({ ok: true, method });
953
+ } else if (window.cycleCAD && window.cycleCAD.execute) {
954
+ const result = await window.cycleCAD.execute(cmd);
955
+ results.push(result);
956
+ }
957
+ } catch (e) {
958
+ console.warn('[Copilot] Command failed:', cmd, e);
959
+ results.push({ ok: false, error: e.message });
947
960
  }
948
-
949
- addMessage('ai', `Got it! ${preview}. Creating now...`);
950
- return { ok: true, results, commands };
951
- } else {
952
- addMessage('ai', 'Agent API not available. Try initializing Agent API first.');
953
- return { ok: false };
954
961
  }
962
+
963
+ return { ok: true, results, commands };
955
964
  } catch (error) {
956
965
  console.error('[Copilot] Execute error:', error);
957
966
  addMessage('ai', `Error: ${error.message || 'Something went wrong'}`);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "cyclecad",
3
- "version": "1.0.3",
3
+ "version": "1.0.4",
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
  "bin": {