linkshell-cli 0.8.1 → 0.9.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cli/src/commands/host.d.ts +2 -0
- package/dist/cli/src/commands/host.js.map +1 -1
- package/dist/cli/src/commands/screen.d.ts +10 -0
- package/dist/cli/src/commands/screen.js +82 -74
- package/dist/cli/src/commands/screen.js.map +1 -1
- package/dist/cli/src/commands/setup.d.ts +11 -1
- package/dist/cli/src/commands/setup.js +100 -38
- package/dist/cli/src/commands/setup.js.map +1 -1
- package/dist/cli/src/index.js +17 -5
- package/dist/cli/src/index.js.map +1 -1
- package/dist/cli/tsconfig.tsbuildinfo +1 -1
- package/dist/host/src/input.d.ts +114 -29
- package/dist/host/src/input.js +214 -144
- package/dist/host/src/input.js.map +1 -1
- package/dist/host/src/rpc/server.js +1 -1
- package/dist/host/src/rpc/server.js.map +1 -1
- package/dist/host/src/screen-pacer.d.ts +76 -0
- package/dist/host/src/screen-pacer.js +165 -0
- package/dist/host/src/screen-pacer.js.map +1 -0
- package/dist/host/src/screen-viewer.d.ts +5 -0
- package/dist/host/src/screen-viewer.js +1263 -57
- package/dist/host/src/screen-viewer.js.map +1 -1
- package/dist/host/src/screen.d.ts +29 -32
- package/dist/host/src/screen.js +418 -138
- package/dist/host/src/screen.js.map +1 -1
- package/dist/host/src/terminals.d.ts +2 -2
- package/dist/host/src/terminals.js +1 -0
- package/dist/host/src/terminals.js.map +1 -1
- package/package.json +3 -3
- package/src/commands/host.ts +2 -0
- package/src/commands/screen.ts +78 -72
- package/src/commands/setup.ts +100 -60
- package/src/index.ts +16 -5
package/src/index.ts
CHANGED
|
@@ -51,7 +51,7 @@ const program = new Command();
|
|
|
51
51
|
program
|
|
52
52
|
.name("linkshell")
|
|
53
53
|
.description(
|
|
54
|
-
"Your coding agents and terminals, on your phone.
|
|
54
|
+
"Your coding agents and terminals, on your phone. Start with `linkshell setup`.",
|
|
55
55
|
)
|
|
56
56
|
.version(pkg.version);
|
|
57
57
|
|
|
@@ -93,7 +93,9 @@ const hostCmd = program
|
|
|
93
93
|
process.stderr.write(` Log: ${daemon.getLogFile("host")}\n`);
|
|
94
94
|
process.stderr.write(` Status: linkshell host status\n`);
|
|
95
95
|
process.stderr.write(` Stop: linkshell host stop\n`);
|
|
96
|
-
// The
|
|
96
|
+
// The first start here: the rest of the setup happens now, while someone is at the computer.
|
|
97
|
+
const { offerSetup } = await import("./commands/setup.js");
|
|
98
|
+
if (await offerSetup(pkg.version)) process.exit(process.exitCode ?? 0);
|
|
97
99
|
const { screenAccess, describeScreen, screenReady } = await import("./commands/screen.js");
|
|
98
100
|
const screen = await screenAccess().catch(() => undefined);
|
|
99
101
|
if (screen && (screen === "old" || !screenReady(screen))) process.stderr.write(` Screen: ${describeScreen(screen)}\n`);
|
|
@@ -551,7 +553,7 @@ gatewayCmd
|
|
|
551
553
|
|
|
552
554
|
program
|
|
553
555
|
.command("screen")
|
|
554
|
-
.description("Set this computer up for watching and controlling its screen from the phone (permissions, ffmpeg)")
|
|
556
|
+
.description("Set this computer up for watching and controlling its screen from the phone (the two macOS permissions; on Linux, ffmpeg)")
|
|
555
557
|
.option("--check", "Only say what is and isn't ready")
|
|
556
558
|
.action(async (options) => {
|
|
557
559
|
const { runScreenSetup } = await import("./commands/screen.js");
|
|
@@ -611,9 +613,10 @@ program
|
|
|
611
613
|
|
|
612
614
|
program
|
|
613
615
|
.command("setup")
|
|
614
|
-
.description("
|
|
616
|
+
.description("Set this computer up, once: the host, the screen's permissions, and your phone")
|
|
615
617
|
.action(async () => {
|
|
616
|
-
await runSetup();
|
|
618
|
+
await runSetup(pkg.version);
|
|
619
|
+
process.exit(process.exitCode ?? 0);
|
|
617
620
|
});
|
|
618
621
|
|
|
619
622
|
program
|
|
@@ -730,6 +733,14 @@ program
|
|
|
730
733
|
);
|
|
731
734
|
});
|
|
732
735
|
|
|
736
|
+
// `linkshell` by itself, on a computer where nothing has been set up yet: the setup, rather than a page of help.
|
|
737
|
+
program.action(async () => {
|
|
738
|
+
const { setupDone } = await import("./commands/setup.js");
|
|
739
|
+
if (process.stdin.isTTY !== true || process.stdout.isTTY !== true || (await setupDone())) return program.help();
|
|
740
|
+
await runSetup(pkg.version);
|
|
741
|
+
process.exit(process.exitCode ?? 0);
|
|
742
|
+
});
|
|
743
|
+
|
|
733
744
|
program.parseAsync(process.argv).catch((error: unknown) => {
|
|
734
745
|
const message = error instanceof Error ? error.message : String(error);
|
|
735
746
|
process.stderr.write(`${message}\n`);
|