This commit is contained in:
Siddharth Ganesan
2025-07-08 21:47:37 -07:00
parent aa343fb62f
commit f6b25bf727
7 changed files with 17 additions and 16 deletions

View File

@@ -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 }
)
}
}
}

View File

@@ -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 }
)
}
}
}

View File

@@ -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,
},
},

View File

@@ -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,

View File

@@ -32,4 +32,4 @@ export const docsSearchTool: ToolConfig = {
}),
isInternalRoute: true,
},
}
}

View File

@@ -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')

View File

@@ -26,4 +26,4 @@ export const getUserWorkflowTool: ToolConfig = {
}),
isInternalRoute: true,
},
}
}