MCPcopy Create free account
hub / github.com/TechJeeper/Printventory / testAIConfigHandler

Function testAIConfigHandler

main.js:8564–8593  ·  view source on GitHub ↗
(event, apiKey, baseURL, model, service)

Source from the content-addressed store, hash-verified

8562 label: 'Open in Slicer',
8563 submenu: slicers.map(slicer => ({
8564 label: slicer.name,
8565 click: async () => {
8566 try {
8567 // In server mode, "Open in Slicer" should execute on the client machine, not the server
8568 // Send command to client to execute locally
8569 if (isServerMode) {
8570 let modelPath = filePaths[0];
8571
8572 // If it's a zip entry, we need to handle it (extract on client or download)
8573 if (isZipEntry && pathInfo) {
8574 // For zip entries, send both zip path and entry path
8575 modelPath = `${pathInfo.zipPath}::${pathInfo.entryPath}`;
8576 }
8577
8578 // Send command to client to execute slicer locally
8579 if (global.broadcastEvent) {
8580 global.broadcastEvent('execute-client-command', {
8581 type: 'open-in-slicer',
8582 filePath: modelPath,
8583 slicerName: slicer.name,
8584 slicerPath: slicer.path,
8585 isZipEntry: isZipEntry || false,
8586 zipPath: isZipEntry ? pathInfo.zipPath : null,
8587 entryPath: isZipEntry ? pathInfo.entryPath : null
8588 });
8589 } else {
8590 event.sender.send('execute-client-command', {
8591 type: 'open-in-slicer',
8592 filePath: modelPath,
8593 slicerName: slicer.name,
8594 slicerPath: slicer.path,
8595 isZipEntry: isZipEntry || false,
8596 zipPath: isZipEntry ? pathInfo.zipPath : null,

Callers

nothing calls this directly

Calls 1

createPuterIPCHandlerFunction · 0.85

Tested by

no test coverage detected