Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,9 @@ jobs:

- name: Install frontend dependencies
working-directory: frontend
run: npm install
run: |
rm -f package-lock.json
npm install

- name: TypeScript check
working-directory: frontend
Expand Down
12 changes: 6 additions & 6 deletions backend/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion backend/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
"dependencies": {
"@anthropic-ai/sdk": "^0.65.0",
"@google/generative-ai": "^0.24.1",
"@prompd/cli": "^0.4.11",
"@prompd/cli": "^0.5.0-beta.2",
"adm-zip": "^0.5.10",
"archiver": "^6.0.1",
"axios": "^1.6.2",
Expand Down
50 changes: 50 additions & 0 deletions frontend/electron/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -5653,8 +5653,11 @@ ipcMain.handle('workflow:execute', async (event, workflow, params, options) => {
}

// Build options with event-emitting callbacks
// Convert breakpoints array back to Set (IPC serializes Sets as arrays)
const breakpointsSet = options.breakpoints ? new Set(options.breakpoints) : undefined
const executorOptions = {
...options,
breakpoints: breakpointsSet,
onNodeStart: (nodeId) => {
// Check cancellation before starting each node
const execution = runningExecutions.get(executionId)
Expand Down Expand Up @@ -5832,6 +5835,39 @@ ipcMain.handle('workflow:execute', async (event, workflow, params, options) => {
}, 300000)
})
},
// Bidirectional: Pause execution in debug/step mode and wait for user to continue or stop
onDebugPause: async (debugState, trace) => {
const requestId = `debug-pause-${Date.now()}-${Math.random().toString(36).substring(7)}`

console.log(`[Workflow Executor] Debug/step pause at node '${debugState.currentNodeId}' (${requestId})`)

// Send pause event to renderer
sender.send('workflow:event', {
type: 'debug-pause-request',
executionId,
requestId,
data: {
isPaused: debugState.isPaused,
currentNodeId: debugState.currentNodeId,
breakpoints: debugState.breakpoints ? Array.from(debugState.breakpoints) : [],
watchedVariables: debugState.watchedVariables || [],
},
timestamp: Date.now()
})

// Wait for renderer to respond (continue or stop)
return new Promise((resolve, reject) => {
pendingUserInputs.set(requestId, { resolve, reject })

// Timeout after 10 minutes
setTimeout(() => {
if (pendingUserInputs.has(requestId)) {
pendingUserInputs.delete(requestId)
resolve(false) // Stop execution on timeout
}
}, 600000)
})
},
// Centralized .prmd execution — single path for all workflow prompt execution
executePrompt: async (source, promptParams, provider, model) => {
// Merge workflow-level params (includes defaults) into node-level prompt params
Expand Down Expand Up @@ -7029,6 +7065,20 @@ ipcMain.handle('workflow:checkpoint-response', async (_event, requestId, shouldC
}
})

/**
* Respond to debug/step pause request (bidirectional IPC)
*/
ipcMain.handle('workflow:debug-pause-response', async (_event, requestId, shouldContinue) => {
const pending = pendingUserInputs.get(requestId)
if (pending) {
pendingUserInputs.delete(requestId)
pending.resolve(shouldContinue)
console.log(`[Workflow Executor] Debug pause response received: ${requestId}, continue: ${shouldContinue}`)
} else {
console.warn(`[Workflow Executor] No pending debug pause request for: ${requestId}`)
}
})

/**
* Popup window IPC handlers (for automated workflow user input)
*/
Expand Down
5 changes: 5 additions & 0 deletions frontend/electron/preload.js
Original file line number Diff line number Diff line change
Expand Up @@ -719,6 +719,11 @@ contextBridge.exposeInMainWorld('electronAPI', {
// shouldContinue: boolean - whether to continue execution
respondToCheckpoint: (requestId, shouldContinue) => ipcRenderer.invoke('workflow:checkpoint-response', requestId, shouldContinue),

// Respond to debug/step pause request (bidirectional IPC)
// requestId: ID from debug-pause-request event
// shouldContinue: boolean - whether to continue execution
respondToDebugPause: (requestId, shouldContinue) => ipcRenderer.invoke('workflow:debug-pause-response', requestId, shouldContinue),

// Listen for scheduled/deployed workflow execution requests from main process
// callback: (data: { workflowPath, parameters, trigger, deploymentId?, triggerId? }) => void
// Returns: cleanup function to remove listener
Expand Down
Loading