mirror of
https://github.com/simstudioai/sim.git
synced 2026-01-09 06:58:07 -05:00
feat(discord): added discord block/tools (#347)
* feat(tools): added discord oauth, block, and tools * added docs * remove extraneous comments/logs * added tooltips for disabled subblocks, acknowledged PR comments * added tools and blocks for new repo structure * added docs * added more type safety, fixed some styling * updated docs * fixed style of dropdown in tool-input * acknowledged PR comments
This commit is contained in:
@@ -261,7 +261,7 @@ function extractInputs(content: string): Record<string, any> {
|
||||
const inputs: Record<string, any> = {}
|
||||
|
||||
// Find all input property definitions
|
||||
const propMatches = inputsContent.match(/(\w+)\s*:\s*{[^}]*}/g)
|
||||
const propMatches = inputsContent.match(/(\w+)\s*:\s*{[\s\S]*?}/g)
|
||||
if (!propMatches) {
|
||||
// Try an alternative approach for the whole inputs section
|
||||
const inputLines = inputsContent.split('\n')
|
||||
@@ -287,8 +287,9 @@ function extractInputs(content: string): Record<string, any> {
|
||||
if (!propMatch) return
|
||||
|
||||
const propName = propMatch[1]
|
||||
const typeMatch = propText.match(/type\s*:\s*['"]?([^'"}, ]+)['"]?/)
|
||||
const requiredMatch = propText.match(/required\s*:\s*(true|false)/)
|
||||
const typeMatch = propText.match(/type\s*:\s*['"]?([^'"}, ]+)['"]?/s)
|
||||
const requiredMatch = propText.match(/required\s*:\s*(true|false)/s)
|
||||
const descriptionMatch = propText.match(/description\s*:\s*['"]([^'"]+)['"]/s)
|
||||
|
||||
inputs[propName] = {
|
||||
type: typeMatch ? typeMatch[1] : 'any',
|
||||
|
||||
Reference in New Issue
Block a user