mirror of
https://github.com/simstudioai/sim.git
synced 2026-04-06 03:00:16 -04:00
Lint
This commit is contained in:
@@ -3,9 +3,9 @@ import { type NextRequest, NextResponse } from 'next/server'
|
||||
import { createLogger } from '@/lib/logs/console-logger'
|
||||
import { loadWorkflowFromNormalizedTables } from '@/lib/workflows/db-helpers'
|
||||
import { generateWorkflowYaml } from '@/lib/workflows/yaml-generator'
|
||||
import { getBlock } from '@/blocks'
|
||||
import { db } from '@/db'
|
||||
import { workflow as workflowTable } from '@/db/schema'
|
||||
import { getBlock } from '@/blocks'
|
||||
|
||||
const logger = createLogger('GetUserWorkflowAPI')
|
||||
|
||||
@@ -95,7 +95,7 @@ export async function POST(request: NextRequest) {
|
||||
Object.entries(workflowState.blocks).forEach(([blockId, blockState]) => {
|
||||
const block = blockState as any
|
||||
const blockConfig = getBlock(block.type)
|
||||
|
||||
|
||||
if (blockConfig) {
|
||||
blockSchemas[blockId] = {
|
||||
type: block.type,
|
||||
@@ -142,17 +142,23 @@ export async function POST(request: NextRequest) {
|
||||
})
|
||||
|
||||
// Generate workflow summary
|
||||
const blockTypes = Object.values(workflowState.blocks).reduce((acc: Record<string, number>, block: any) => {
|
||||
acc[block.type] = (acc[block.type] || 0) + 1
|
||||
return acc
|
||||
}, {})
|
||||
const blockTypes = Object.values(workflowState.blocks).reduce(
|
||||
(acc: Record<string, number>, block: any) => {
|
||||
acc[block.type] = (acc[block.type] || 0) + 1
|
||||
return acc
|
||||
},
|
||||
{}
|
||||
)
|
||||
|
||||
const categories = Object.values(blockSchemas).reduce((acc: Record<string, number>, schema: any) => {
|
||||
if (schema.category) {
|
||||
acc[schema.category] = (acc[schema.category] || 0) + 1
|
||||
}
|
||||
return acc
|
||||
}, {})
|
||||
const categories = Object.values(blockSchemas).reduce(
|
||||
(acc: Record<string, number>, schema: any) => {
|
||||
if (schema.category) {
|
||||
acc[schema.category] = (acc[schema.category] || 0) + 1
|
||||
}
|
||||
return acc
|
||||
},
|
||||
{}
|
||||
)
|
||||
|
||||
// Prepare response with clear context markers
|
||||
const response: any = {
|
||||
|
||||
@@ -432,7 +432,7 @@ export async function generateChatResponse(
|
||||
},
|
||||
{
|
||||
id: 'get_user_workflow',
|
||||
name: 'Get User\'s Specific Workflow',
|
||||
name: "Get User's Specific Workflow",
|
||||
description:
|
||||
'Get the user\'s current workflow - this shows ONLY the blocks they have actually built and configured in their specific workflow, not general Sim Studio capabilities. Use this when the user asks about "my workflow", "this workflow", wants to know what blocks they currently have, OR when they ask "How do I..." questions about their workflow so you can give specific, actionable advice based on their actual setup.',
|
||||
params: {},
|
||||
|
||||
@@ -4,7 +4,7 @@ export const getUserWorkflowTool: ToolConfig = {
|
||||
id: 'get_user_workflow',
|
||||
name: 'Get User Workflow',
|
||||
description:
|
||||
'Get the current user\'s specific workflow (not general Sim Studio documentation). Returns YAML format showing only the blocks that the user has actually built in their workflow, with their specific configurations, inputs, and connections.',
|
||||
"Get the current user's specific workflow (not general Sim Studio documentation). Returns YAML format showing only the blocks that the user has actually built in their workflow, with their specific configurations, inputs, and connections.",
|
||||
version: '1.0.0',
|
||||
|
||||
params: {
|
||||
|
||||
Reference in New Issue
Block a user