MCPcopy Create free account
hub / github.com/chhoumann/quickadd / buildFileSignature

Function buildFileSignature

src/utils/fileSyntax.ts:95–115  ·  view source on GitHub ↗

* 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;
})

Source from the content-addressed store, hash-verified

93 * explicit job of `|name:`.
94 */
95function 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.

Callers 1

parseFileTokenFunction · 0.85

Calls 2

buildFileScopeSignatureFunction · 0.85
pushMethod · 0.80

Tested by

no test coverage detected