mirror of
https://github.com/simstudioai/sim.git
synced 2026-04-06 03:00:16 -04:00
Lint
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
import { NextRequest, NextResponse } from 'next/server'
|
||||
import { createLogger } from '@/lib/logs/console-logger'
|
||||
import { type NextRequest, NextResponse } from 'next/server'
|
||||
import { searchDocumentation } from '@/lib/copilot/service'
|
||||
import { createLogger } from '@/lib/logs/console-logger'
|
||||
|
||||
const logger = createLogger('DocsSearchAPI')
|
||||
|
||||
@@ -34,4 +34,4 @@ export async function POST(request: NextRequest) {
|
||||
{ status: 500 }
|
||||
)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { NextRequest, NextResponse } from 'next/server'
|
||||
import { type NextRequest, NextResponse } from 'next/server'
|
||||
import { createLogger } from '@/lib/logs/console-logger'
|
||||
import { useWorkflowYamlStore } from '@/stores/workflows/yaml/store'
|
||||
|
||||
@@ -21,7 +21,7 @@ export async function POST(request: NextRequest) {
|
||||
)
|
||||
}
|
||||
|
||||
let metadata = undefined
|
||||
let metadata
|
||||
if (includeMetadata) {
|
||||
// Get additional workflow metadata if requested
|
||||
const workflowStore = yamlStore as any // Access internal state
|
||||
@@ -33,9 +33,9 @@ export async function POST(request: NextRequest) {
|
||||
}
|
||||
}
|
||||
|
||||
logger.info('Successfully generated workflow YAML', {
|
||||
includeMetadata,
|
||||
yamlLength: yamlContent.length
|
||||
logger.info('Successfully generated workflow YAML', {
|
||||
includeMetadata,
|
||||
yamlLength: yamlContent.length,
|
||||
})
|
||||
|
||||
return NextResponse.json({
|
||||
@@ -53,4 +53,4 @@ export async function POST(request: NextRequest) {
|
||||
{ status: 500 }
|
||||
)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -441,7 +441,8 @@ export async function generateChatResponse(
|
||||
properties: {
|
||||
includeMetadata: {
|
||||
type: 'boolean',
|
||||
description: 'Whether to include additional metadata about the workflow (default: false)',
|
||||
description:
|
||||
'Whether to include additional metadata about the workflow (default: false)',
|
||||
default: false,
|
||||
},
|
||||
},
|
||||
|
||||
@@ -98,17 +98,17 @@ const getUserWorkflowTool: CopilotTool = {
|
||||
// Import the workflow YAML store dynamically to avoid import issues
|
||||
const { useWorkflowYamlStore } = await import('@/stores/workflows/yaml/store')
|
||||
const { useWorkflowRegistry } = await import('@/stores/workflows/registry/store')
|
||||
|
||||
|
||||
// Get the current workflow YAML
|
||||
const yamlContent = useWorkflowYamlStore.getState().getYaml()
|
||||
|
||||
|
||||
// Get additional metadata if requested
|
||||
let metadata = {}
|
||||
if (includeMetadata) {
|
||||
const registry = useWorkflowRegistry.getState()
|
||||
const activeWorkflowId = registry.activeWorkflowId
|
||||
const activeWorkflow = activeWorkflowId ? registry.workflows[activeWorkflowId] : null
|
||||
|
||||
|
||||
if (activeWorkflow) {
|
||||
metadata = {
|
||||
workflowId: activeWorkflowId,
|
||||
|
||||
@@ -32,4 +32,4 @@ export const docsSearchTool: ToolConfig = {
|
||||
}),
|
||||
isInternalRoute: true,
|
||||
},
|
||||
}
|
||||
}
|
||||
|
||||
@@ -4,8 +4,8 @@ import { useCustomToolsStore } from '@/stores/custom-tools/store'
|
||||
import { useEnvironmentStore } from '@/stores/settings/environment/store'
|
||||
import { docsSearchTool } from './docs/search'
|
||||
import { tools } from './registry'
|
||||
import { getUserWorkflowTool } from './workflow/get-yaml'
|
||||
import type { TableRow, ToolConfig, ToolResponse } from './types'
|
||||
import { getUserWorkflowTool } from './workflow/get-yaml'
|
||||
|
||||
const logger = createLogger('ToolsUtils')
|
||||
|
||||
|
||||
@@ -26,4 +26,4 @@ export const getUserWorkflowTool: ToolConfig = {
|
||||
}),
|
||||
isInternalRoute: true,
|
||||
},
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user