mirror of
https://github.com/simstudioai/sim.git
synced 2026-01-09 06:58:07 -05:00
feat(intercom): added additional params to intercom tools (#2523)
This commit is contained in:
@@ -473,7 +473,6 @@ function extractToolInfo(
|
||||
if (outputsFieldMatch) {
|
||||
const outputsContent = outputsFieldMatch[1]
|
||||
outputs = parseToolOutputsField(outputsContent)
|
||||
console.log(`Found tool outputs field for ${toolName}:`, Object.keys(outputs))
|
||||
}
|
||||
|
||||
return {
|
||||
@@ -838,7 +837,6 @@ function extractManualContent(existingContent: string): Record<string, string> {
|
||||
const sectionName = match[1]
|
||||
const content = match[2].trim()
|
||||
manualSections[sectionName] = content
|
||||
console.log(`Found manual content for section: ${sectionName}`)
|
||||
}
|
||||
|
||||
return manualSections
|
||||
@@ -853,13 +851,6 @@ function mergeWithManualContent(
|
||||
return generatedMarkdown
|
||||
}
|
||||
|
||||
console.log('Merging manual content with generated markdown')
|
||||
|
||||
console.log(`Found ${Object.keys(manualSections).length} manual sections`)
|
||||
Object.keys(manualSections).forEach((section) => {
|
||||
console.log(` - ${section}: ${manualSections[section].substring(0, 20)}...`)
|
||||
})
|
||||
|
||||
let mergedContent = generatedMarkdown
|
||||
|
||||
Object.entries(manualSections).forEach(([sectionName, content]) => {
|
||||
@@ -885,7 +876,6 @@ function mergeWithManualContent(
|
||||
|
||||
if (match && match.index !== undefined) {
|
||||
const insertPosition = match.index + match[0].length
|
||||
console.log(`Inserting ${sectionName} content after position ${insertPosition}`)
|
||||
mergedContent = `${mergedContent.slice(0, insertPosition)}\n\n{/* MANUAL-CONTENT-START:${sectionName} */}\n${content}\n{/* MANUAL-CONTENT-END */}\n${mergedContent.slice(insertPosition)}`
|
||||
} else {
|
||||
console.log(
|
||||
@@ -945,7 +935,6 @@ async function generateBlockDoc(blockPath: string) {
|
||||
let existingContent: string | null = null
|
||||
if (fs.existsSync(outputFilePath)) {
|
||||
existingContent = fs.readFileSync(outputFilePath, 'utf-8')
|
||||
console.log(`Existing file found for ${blockConfig.type}.mdx, checking for manual content...`)
|
||||
}
|
||||
|
||||
const manualSections = existingContent ? extractManualContent(existingContent) : {}
|
||||
@@ -954,14 +943,10 @@ async function generateBlockDoc(blockPath: string) {
|
||||
|
||||
let finalContent = markdown
|
||||
if (Object.keys(manualSections).length > 0) {
|
||||
console.log(`Found manual content in ${blockConfig.type}.mdx, merging...`)
|
||||
finalContent = mergeWithManualContent(markdown, existingContent, manualSections)
|
||||
} else {
|
||||
console.log(`No manual content found in ${blockConfig.type}.mdx`)
|
||||
}
|
||||
|
||||
fs.writeFileSync(outputFilePath, finalContent)
|
||||
console.log(`Generated documentation for ${blockConfig.type}`)
|
||||
} catch (error) {
|
||||
console.error(`Error processing ${blockPath}:`, error)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user