MCPcopy Create free account
hub / github.com/QodeXcli/QodeX / execute

Method execute

src/tools/cloud/cloud-tools.ts:33–46  ·  view source on GitHub ↗
(a: z.infer<typeof S3Args>)

Source from the content-addressed store, hash-verified

31 isReadOnly = false; isDestructive = true; argsSchema = S3Args;
32
33 async execute(a: z.infer<typeof S3Args>): Promise<ToolResult> {
34 const mode = a.mode ?? 'sync';
35 const args = ['s3', mode, a.source, a.dest];
36 if (a.dryrun) args.push('--dryrun');
37 if (mode === 'sync' && a.delete) args.push('--delete');
38 if (mode === 'cp' && a.recursive) args.push('--recursive');
39
40 const r = await runProcess('aws', args, { timeoutMs: (a.timeout_seconds ?? 600) * 1000 });
41 if (r.notFound) return { content: notInstalledMessage('aws', 'Install the AWS CLI v2 from https://aws.amazon.com/cli/ and run `aws configure`.'), isError: true };
42 if (r.timedOut) return { content: 'aws s3 timed out — for large transfers use background_job_start with a shell aws command.', isError: true };
43 const out = [r.stdout.trim(), r.stderr.trim()].filter(Boolean).join('\n');
44 if (!r.ok) return { content: out || 'aws s3 failed', isError: true };
45 return { content: `${a.dryrun ? '(dry run) ' : ''}✓ ${mode} ${a.source} → ${a.dest}\n${out}`.trim() };
46 }
47}
48
49// ---- ci_status ----

Callers

nothing calls this directly

Calls 3

runProcessFunction · 0.85
notInstalledMessageFunction · 0.85
pushMethod · 0.45

Tested by

no test coverage detected