MCPcopy Create free account
hub / github.com/getsentry/XcodeBuildMCP / invoke

Function invoke

src/snapshot-tests/harness.ts:131–157  ·  view source on GitHub ↗
(
    workflow: string,
    cliToolName: string,
    args: Record<string, unknown>,
    invokeOptions: SnapshotInvokeOptions = {},
  )

Source from the content-addressed store, hash-verified

129 options: CreateSnapshotHarnessOptions = {},
130): Promise<SnapshotHarness> {
131 async function invoke(
132 workflow: string,
133 cliToolName: string,
134 args: Record<string, unknown>,
135 invokeOptions: SnapshotInvokeOptions = {},
136 ): Promise<SnapshotResult> {
137 const resolved = resolveSnapshotToolManifest(workflow, cliToolName);
138
139 if (!resolved) {
140 throw new Error(`Tool '${cliToolName}' not found in workflow '${workflow}'`);
141 }
142
143 if (resolved.isMcpOnly) {
144 throw new Error(`Tool '${cliToolName}' in workflow '${workflow}' is not CLI-available`);
145 }
146
147 const label = `${workflow}/${cliToolName}`;
148 const result = runSnapshotCli(workflow, cliToolName, args, 'text', options, invokeOptions);
149 assertCliSnapshotProcessResult(result, label);
150 const stdout = readProcessOutput(result.stdout);
151
152 return {
153 text: normalizeSnapshotOutput(stdout),
154 rawText: stdout,
155 isError: result.status !== 0,
156 };
157 }
158
159 async function cleanup(): Promise<void> {}
160

Callers 1

invokeViaDaemonMethod · 0.50

Calls 8

normalizeSnapshotOutputFunction · 0.90
runSnapshotCliFunction · 0.85
readProcessOutputFunction · 0.85
parseStructuredEnvelopeFunction · 0.85

Tested by

no test coverage detected