mirror of
https://github.com/simstudioai/sim.git
synced 2026-04-06 03:00:16 -04:00
improvement(deployed-mcp): added the ability to make the visibility for deployed mcp tools public, updated UX (#2853)
* improvement(deployed-mcp): added the ability to make the visibility for deployed mcp tools public, updated UX * use reactquery * migrated chats to use reactquery, upgraded entire deploymodal to use reactquery instead of manual state management * added hooks for chat chats and updated callers to all use reactquery * fix * updated comments * consolidated utils
This commit is contained in:
18
apps/sim/lib/workflows/triggers/trigger-utils.server.ts
Normal file
18
apps/sim/lib/workflows/triggers/trigger-utils.server.ts
Normal file
@@ -0,0 +1,18 @@
|
||||
import { createLogger } from '@sim/logger'
|
||||
import { loadWorkflowFromNormalizedTables } from '@/lib/workflows/persistence/utils'
|
||||
import { hasValidStartBlockInState } from '@/lib/workflows/triggers/trigger-utils'
|
||||
|
||||
const logger = createLogger('TriggerUtils')
|
||||
|
||||
/**
|
||||
* Check if a workflow has a valid start block by loading from database
|
||||
*/
|
||||
export async function hasValidStartBlock(workflowId: string): Promise<boolean> {
|
||||
try {
|
||||
const normalizedData = await loadWorkflowFromNormalizedTables(workflowId)
|
||||
return hasValidStartBlockInState(normalizedData)
|
||||
} catch (error) {
|
||||
logger.warn('Error checking for start block:', error)
|
||||
return false
|
||||
}
|
||||
}
|
||||
@@ -90,7 +90,6 @@ function generateMockValue(type: string, _description?: string, fieldName?: stri
|
||||
* Recursively processes nested output structures
|
||||
*/
|
||||
function processOutputField(key: string, field: unknown, depth = 0, maxDepth = 10): unknown {
|
||||
// Prevent infinite recursion
|
||||
if (depth > maxDepth) {
|
||||
return null
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user