fix(docs): fixed docs script to reflect the new output format for all blocks (#653)

* fix(docs): fixed tool docs generator script to match new output structure from blocks

* updated outdated docs
This commit is contained in:
Waleed Latif
2025-07-10 12:03:37 -07:00
committed by GitHub
parent 31d9e2a4a8
commit 30538d9380
55 changed files with 210 additions and 226 deletions

View File

@@ -356,7 +356,30 @@ function extractOutputs(content: string): Record<string, any> {
const outputsContent = outputsMatch[1].trim()
const outputs: Record<string, any> = {}
// Try to extract fields from the outputs object
// First try to handle the new flat format: fieldName: 'type'
const flatFieldMatches = outputsContent.match(/(\w+)\s*:\s*['"]([^'"]+)['"]/g)
if (flatFieldMatches && flatFieldMatches.length > 0) {
flatFieldMatches.forEach((fieldMatch) => {
const fieldParts = fieldMatch.match(/(\w+)\s*:\s*['"]([^'"]+)['"]/)
if (fieldParts) {
const fieldName = fieldParts[1]
const fieldType = fieldParts[2]
outputs[fieldName] = {
type: fieldType,
description: `${fieldName} output from the block`,
}
}
})
// If we found flat fields, return them
if (Object.keys(outputs).length > 0) {
return outputs
}
}
// Fallback: Try to extract fields from the old nested format
const fieldMatches = outputsContent.match(/(\w+)\s*:\s*{([^}]+)}/g)
if (fieldMatches && fieldMatches.length > 0) {