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

Function buildSecretOptionNamesByPath

src/services/packageExportService.ts:189–218  ·  view source on GitHub ↗
(
	assets: QuickAddPackageAsset[],
)

Source from the content-addressed store, hash-verified

187}
188
189function buildSecretOptionNamesByPath(
190 assets: QuickAddPackageAsset[],
191): Map<string, ReadonlySet<string> | null> {
192 const secretOptionNamesByPath = new Map<string, ReadonlySet<string> | null>();
193
194 for (const asset of assets) {
195 if (asset.kind !== "user-script") continue;
196
197 try {
198 const detection = detectUserScriptSecretOptions(
199 decodeFromBase64(asset.content),
200 asset.originalPath,
201 );
202 secretOptionNamesByPath.set(
203 asset.originalPath,
204 detection.foundSecretOptions && detection.names.size === 0
205 ? null
206 : detection.names,
207 );
208 } catch (error) {
209 log.logWarning(
210 `QuickAdd export could not inspect user-script settings '${asset.originalPath}': ${
211 (error as Error)?.message ?? error
212 }`,
213 );
214 }
215 }
216
217 return secretOptionNamesByPath;
218}
219
220function pruneChoiceTree(
221 choice: IChoice,

Callers 1

buildPackageFunction · 0.70

Calls 4

decodeFromBase64Function · 0.90
logWarningMethod · 0.65
setMethod · 0.45

Tested by

no test coverage detected