(value: unknown, key: string)
| 154 | } |
| 155 | |
| 156 | function readStringArray(value: unknown, key: string): Array<string> { |
| 157 | if (!isRecord(value)) return [] |
| 158 | const field = value[key] |
| 159 | if (!Array.isArray(field)) return [] |
| 160 | return field.filter((item): item is string => typeof item === 'string') |
| 161 | } |
| 162 | |
| 163 | const getPantrySnapshot = toolDefinition({ |
| 164 | name: 'getPantrySnapshot', |