MCPcopy Create free account
hub / github.com/NativeScript/SimDeck / connect

Function connect

scripts/studio-host-provider.mjs:43–58  ·  view source on GitHub ↗
(args)

Source from the content-addressed store, hash-verified

41}
42
43async function connect(args) {
44 const studioUrl = requiredArg(args, "studio-url").replace(/\/$/, "");
45 const hostId = requiredArg(args, "host-id");
46 const hostToken = requiredArg(args, "host-token");
47 const configPath = args["config"] || defaultConfigPath;
48 const config = {
49 createdAt: new Date().toISOString(),
50 hostId,
51 hostToken,
52 studioUrl,
53 workRoot: args["work-root"] || defaultWorkRoot,
54 };
55 await writeJsonFile(configPath, config, 0o600);
56 console.log(`Saved SimDeck Studio provider config to ${configPath}`);
57 console.log("Run `simdeck provider run` to start the provider.");
58}
59
60async function status(args) {
61 const config = await loadConfig(args);

Callers 1

Calls 4

requiredArgFunction · 0.85
writeJsonFileFunction · 0.85
logMethod · 0.80
replaceMethod · 0.65

Tested by

no test coverage detected