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

Method runScriptWithSettings

src/engine/MacroChoiceEngine.ts:396–427  ·  view source on GitHub ↗
(
		userScript:
			| ((
					params: typeof this.params,
					settings: Record<string, unknown>
			  ) => Promise<unknown>)
			| {
					entry: (
						params: typeof this.params,
						settings: Record<string, unknown>
					) => Promise<unknown>;
			  },
		command: IUserScript
	)

Source from the content-addressed store, hash-verified

394 }
395
396 private async runScriptWithSettings(
397 userScript:
398 | ((
399 params: typeof this.params,
400 settings: Record<string, unknown>
401 ) => Promise<unknown>)
402 | {
403 entry: (
404 params: typeof this.params,
405 settings: Record<string, unknown>
406 ) => Promise<unknown>;
407 },
408 command: IUserScript
409 ) {
410 if (
411 typeof userScript !== "function" &&
412 userScript.entry &&
413 typeof userScript.entry === "function"
414 ) {
415 return await this.onExportIsFunction(
416 userScript.entry,
417 await this.getResolvedUserScriptSettings(command),
418 );
419 }
420
421 if (typeof userScript === "function") {
422 return await this.onExportIsFunction(
423 userScript,
424 await this.getResolvedUserScriptSettings(command),
425 );
426 }
427 }
428
429
430 protected async userScriptDelegator(userScript: unknown) {

Callers 2

userScriptDelegatorMethod · 0.95
onExportIsObjectMethod · 0.95

Calls 2

onExportIsFunctionMethod · 0.95

Tested by

no test coverage detected