(component: ComponentDefinition)
| 100 | * Secret parameters are always excluded. |
| 101 | */ |
| 102 | export function getExposedParameterIds(component: ComponentDefinition): string[] { |
| 103 | if (!component.parameters) { |
| 104 | return []; |
| 105 | } |
| 106 | |
| 107 | const shape = getObjectShape(component.parameters); |
| 108 | if (!shape) { |
| 109 | return []; |
| 110 | } |
| 111 | |
| 112 | return Object.entries(shape) |
| 113 | .filter(([id, schema]) => { |
| 114 | if (id.startsWith('__')) { |
| 115 | return false; |
| 116 | } |
| 117 | const meta = getParamMeta(schema as any); |
| 118 | if (!meta?.exposeToTool) { |
| 119 | return false; |
| 120 | } |
| 121 | if (meta.editor === 'secret') { |
| 122 | return false; |
| 123 | } |
| 124 | return true; |
| 125 | }) |
| 126 | .map(([id]) => id); |
| 127 | } |
| 128 | |
| 129 | // ============================================================================ |
| 130 | // Schema Generation Helpers |
no test coverage detected