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

Function printExecutionOutcome

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

Source from the content-addressed store, hash-verified

999 : `--base-url ${shellQuoteArg(target.baseUrl ?? connection.origin)}`;
1000
1001const printExecutionOutcome = (input: {
1002 target: ServerTarget;
1003 connection: ExecutorServerConnection;
1004 outcome: ExecuteCodeOutcome;
1005}) =>
1006 Effect.sync(() => {
1007 if (input.outcome.status === "paused") {
1008 console.log(input.outcome.text);
1009 if (input.outcome.executionId) {
1010 if (input.outcome.approvalUrl) {
1011 console.log("\nApprove in browser:");
1012 console.log(` ${input.outcome.approvalUrl}`);
1013 }
1014 const commandPrefix = `${cliPrefix} resume --execution-id ${input.outcome.executionId} ${serverTargetResumeFlag(input.target, input.connection)}`;
1015 if (input.outcome.interaction?.kind === "form") {
1016 const requestedSchema = input.outcome.interaction.requestedSchema;
1017 if (requestedSchema && Object.keys(requestedSchema).length > 0) {
1018 console.log(`\nRequested schema:\n${JSON.stringify(requestedSchema, null, 2)}`);
1019 }
1020 const template = buildResumeContentTemplate(requestedSchema);
1021 const contentArg = shellQuoteArg(JSON.stringify(template));
1022 console.log("\nCLI fallback:");
1023 console.log(` ${commandPrefix} --action accept --content ${contentArg}`);
1024 console.log(` ${commandPrefix} --action decline`);
1025 console.log(` ${commandPrefix} --action cancel`);
1026 } else {
1027 console.log("\nCLI fallback:");
1028 console.log(` ${commandPrefix} --action accept`);
1029 }
1030 }
1031 return;
1032 }
1033
1034 if (typeof input.outcome.result === "string") {
1035 console.log(input.outcome.result);
1036 return;
1037 }
1038
1039 console.log(JSON.stringify(input.outcome.result, null, 2));
1040 });
1041
1042// ---------------------------------------------------------------------------
1043// Typed API client

Callers 1

main.tsFile · 0.85

Calls 5

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

Tested by

no test coverage detected