mirror of
https://github.com/simstudioai/sim.git
synced 2026-04-28 03:00:29 -04:00
Fix dev
This commit is contained in:
@@ -1296,7 +1296,6 @@ export function useChat(
|
||||
const tc = blocks[parentIdx].toolCall!
|
||||
tc.status = 'executing'
|
||||
tc.result = undefined
|
||||
tc.error = undefined
|
||||
flush()
|
||||
break
|
||||
}
|
||||
|
||||
@@ -276,12 +276,14 @@ export async function runStreamLoop(
|
||||
newOperation: operation,
|
||||
}
|
||||
)
|
||||
const cleared = clearIntentsForWorkspace(execContext.workspaceId)
|
||||
if (cleared > 0) {
|
||||
logger.warn('Cleared orphaned execution intents from store', {
|
||||
cleared,
|
||||
workspaceId: execContext.workspaceId,
|
||||
})
|
||||
if (execContext.workspaceId) {
|
||||
const cleared = clearIntentsForWorkspace(execContext.workspaceId)
|
||||
if (cleared > 0) {
|
||||
logger.warn('Cleared orphaned execution intents from store', {
|
||||
cleared,
|
||||
workspaceId: execContext.workspaceId,
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -24,7 +24,7 @@ export type StreamHandler = (
|
||||
options: OrchestratorOptions
|
||||
) => void | Promise<void>
|
||||
|
||||
export type ToolScope = MothershipStreamV1StreamScope['lane']
|
||||
export type ToolScope = 'main' | MothershipStreamV1StreamScope['lane']
|
||||
|
||||
const logger = createLogger('CopilotHandlerHelpers')
|
||||
|
||||
|
||||
@@ -21,8 +21,12 @@ function isOversizedReadPlaceholder(content: string): boolean {
|
||||
)
|
||||
}
|
||||
|
||||
function hasImageAttachment(result: { attachment?: { type?: string } }): boolean {
|
||||
return result.attachment?.type === 'image'
|
||||
function hasImageAttachment(result: unknown): boolean {
|
||||
if (!result || typeof result !== 'object') {
|
||||
return false
|
||||
}
|
||||
const attachment = (result as { attachment?: { type?: string } }).attachment
|
||||
return attachment?.type === 'image'
|
||||
}
|
||||
|
||||
export async function executeVfsGrep(
|
||||
|
||||
@@ -40,11 +40,9 @@ export const createFileServerTool: BaseServerTool<CreateFileArgs, CreateFileResu
|
||||
return { success: false, message: 'Workspace ID is required' }
|
||||
}
|
||||
|
||||
const raw = params as Record<string, unknown>
|
||||
const nested = raw.args as Record<string, unknown> | undefined
|
||||
const fileName = (params.fileName as string) ?? (nested?.fileName as string) ?? ''
|
||||
const explicitType =
|
||||
(params.contentType as string) ?? (nested?.contentType as string) ?? undefined
|
||||
const nested = params.args
|
||||
const fileName = params.fileName || (nested?.fileName as string) || ''
|
||||
const explicitType = params.contentType || (nested?.contentType as string) || undefined
|
||||
|
||||
const nameError = validateFlatWorkspaceFileName(fileName)
|
||||
if (nameError) return { success: false, message: nameError }
|
||||
|
||||
@@ -33,9 +33,8 @@ export const deleteFileServerTool: BaseServerTool<DeleteFileArgs, DeleteFileResu
|
||||
return { success: false, message: 'Workspace ID is required' }
|
||||
}
|
||||
|
||||
const raw = params as Record<string, unknown>
|
||||
const nested = raw.args as Record<string, unknown> | undefined
|
||||
const fileId = (params.fileId as string) ?? (nested?.fileId as string) ?? ''
|
||||
const nested = params.args
|
||||
const fileId = params.fileId || (nested?.fileId as string) || ''
|
||||
|
||||
if (!fileId) return { success: false, message: 'fileId is required' }
|
||||
|
||||
|
||||
@@ -1,11 +1,11 @@
|
||||
import type { UserFile } from '@/lib/uploads/contexts/workspace/workspace-file-manager'
|
||||
import type { WorkspaceFileRecord } from '@/lib/uploads/contexts/workspace/workspace-file-manager'
|
||||
|
||||
export type PendingFileIntent = {
|
||||
operation: 'append' | 'update' | 'patch'
|
||||
fileId: string
|
||||
workspaceId: string
|
||||
userId: string
|
||||
fileRecord: UserFile
|
||||
fileRecord: WorkspaceFileRecord
|
||||
existingContent?: string
|
||||
edit?: {
|
||||
strategy: string
|
||||
|
||||
@@ -39,10 +39,9 @@ export const renameFileServerTool: BaseServerTool<RenameFileArgs, RenameFileResu
|
||||
return { success: false, message: 'Workspace ID is required' }
|
||||
}
|
||||
|
||||
const raw = params as Record<string, unknown>
|
||||
const nested = raw.args as Record<string, unknown> | undefined
|
||||
const fileId = (params.fileId as string) ?? (nested?.fileId as string) ?? ''
|
||||
const newName = (params.newName as string) ?? (nested?.newName as string) ?? ''
|
||||
const nested = params.args
|
||||
const fileId = params.fileId || (nested?.fileId as string) || ''
|
||||
const newName = params.newName || (nested?.newName as string) || ''
|
||||
|
||||
if (!fileId) return { success: false, message: 'fileId is required' }
|
||||
|
||||
|
||||
Reference in New Issue
Block a user