* Full identity signature for an un-named token. Builds on the scope signature * and adds `mode`, `label`, `optional`, and `custom` so two prompts that differ * only by mode/label/flags are distinct identities — sharing one pick is the * explicit job of `|name:`.
(parsed: {
folderPath: string;
mode: FileMode;
label?: string;
optional: boolean;
allowCustomInput: boolean;
multiSelect: boolean;
filter: FieldFilter;
})
| 93 | * explicit job of `|name:`. |
| 94 | */ |
| 95 | function buildFileSignature(parsed: { |
| 96 | folderPath: string; |
| 97 | mode: FileMode; |
| 98 | label?: string; |
| 99 | optional: boolean; |
| 100 | allowCustomInput: boolean; |
| 101 | multiSelect: boolean; |
| 102 | filter: FieldFilter; |
| 103 | }): string { |
| 104 | const { folderPath, mode, label, optional, allowCustomInput, multiSelect, filter } = |
| 105 | parsed; |
| 106 | const parts = [ |
| 107 | buildFileScopeSignature(folderPath, filter), |
| 108 | `mode=${mode}`, |
| 109 | ]; |
| 110 | if (label) parts.push(`label=${label}`); |
| 111 | if (optional) parts.push("optional"); |
| 112 | if (allowCustomInput) parts.push("custom"); |
| 113 | if (multiSelect) parts.push("multi"); |
| 114 | return parts.join("|"); |
| 115 | } |
| 116 | |
| 117 | /** |
| 118 | * Parse the interior of a `{{FILE:<folder>|...}}` token. |
no test coverage detected