feat(intercom): added additional params to intercom tools (#2523)

This commit is contained in:
Waleed
2025-12-22 10:24:49 -08:00
committed by GitHub
parent e981b1dc1b
commit 2d4a660246
20 changed files with 522 additions and 87 deletions

View File

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