MCPcopy Create free account
hub / github.com/UsefulSoftwareCo/executor / printExecutionOutcome

Function printExecutionOutcome

apps/cli/src/main.ts:1028–1067  ·  view source on GitHub ↗
(input: {
  target: ServerTarget;
  connection: ExecutorServerConnection;
  outcome: ExecuteCodeOutcome;
})

Source from the content-addressed store, hash-verified

1026 : `--base-url ${shellQuoteArg(target.baseUrl ?? connection.origin)}`;
1027
1028const printExecutionOutcome = (input: {
1029 target: ServerTarget;
1030 connection: ExecutorServerConnection;
1031 outcome: ExecuteCodeOutcome;
1032}) =>
1033 Effect.sync(() => {
1034 if (input.outcome.status === "paused") {
1035 console.log(input.outcome.text);
1036 if (input.outcome.executionId) {
1037 if (input.outcome.approvalUrl) {
1038 console.log("\nApprove in browser:");
1039 console.log(` ${input.outcome.approvalUrl}`);
1040 }
1041 const commandPrefix = `${cliPrefix} resume --execution-id ${input.outcome.executionId} ${serverTargetResumeFlag(input.target, input.connection)}`;
1042 if (input.outcome.interaction?.kind === "form") {
1043 const requestedSchema = input.outcome.interaction.requestedSchema;
1044 if (requestedSchema && Object.keys(requestedSchema).length > 0) {
1045 console.log(`\nRequested schema:\n${JSON.stringify(requestedSchema, null, 2)}`);
1046 }
1047 const template = buildResumeContentTemplate(requestedSchema);
1048 const contentArg = shellQuoteArg(JSON.stringify(template));
1049 console.log("\nCLI fallback:");
1050 console.log(` ${commandPrefix} --action accept --content ${contentArg}`);
1051 console.log(` ${commandPrefix} --action decline`);
1052 console.log(` ${commandPrefix} --action cancel`);
1053 } else {
1054 console.log("\nCLI fallback:");
1055 console.log(` ${commandPrefix} --action accept`);
1056 }
1057 }
1058 return;
1059 }
1060
1061 if (typeof input.outcome.result === "string") {
1062 console.log(input.outcome.result);
1063 return;
1064 }
1065
1066 console.log(JSON.stringify(input.outcome.result, null, 2));
1067 });
1068
1069// ---------------------------------------------------------------------------
1070// Typed API client

Callers 1

main.tsFile · 0.85

Calls 5

shellQuoteArgFunction · 0.90
serverTargetResumeFlagFunction · 0.85
logMethod · 0.80
syncMethod · 0.65

Tested by

no test coverage detected