linkshell-cli 0.1.15 → 0.2.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.
@@ -17,9 +17,9 @@ export declare const envelopeSchema: z.ZodObject<{
17
17
  ack: z.ZodOptional<z.ZodNumber>;
18
18
  payload: z.ZodUnknown;
19
19
  }, "strip", z.ZodTypeAny, {
20
+ sessionId: string;
20
21
  id: string;
21
22
  type: string;
22
- sessionId: string;
23
23
  timestamp: string;
24
24
  deviceId?: string | undefined;
25
25
  traceId?: string | undefined;
@@ -27,9 +27,9 @@ export declare const envelopeSchema: z.ZodObject<{
27
27
  ack?: number | undefined;
28
28
  payload?: unknown;
29
29
  }, {
30
+ sessionId: string;
30
31
  id: string;
31
32
  type: string;
32
- sessionId: string;
33
33
  timestamp: string;
34
34
  deviceId?: string | undefined;
35
35
  traceId?: string | undefined;
@@ -84,14 +84,14 @@ export declare const sessionConnectPayloadSchema: z.ZodObject<{
84
84
  }, "strip", z.ZodTypeAny, {
85
85
  role: "host" | "client";
86
86
  clientName: string;
87
- provider?: "custom" | "claude" | "codex" | undefined;
87
+ provider?: "claude" | "codex" | "custom" | undefined;
88
88
  protocolVersion?: number | undefined;
89
89
  hostname?: string | undefined;
90
90
  platform?: string | undefined;
91
91
  }, {
92
92
  role: "host" | "client";
93
93
  clientName: string;
94
- provider?: "custom" | "claude" | "codex" | undefined;
94
+ provider?: "claude" | "codex" | "custom" | undefined;
95
95
  protocolVersion?: number | undefined;
96
96
  hostname?: string | undefined;
97
97
  platform?: string | undefined;
@@ -193,15 +193,91 @@ export declare const sessionHostDisconnectedPayloadSchema: z.ZodObject<{
193
193
  reason?: string | undefined;
194
194
  }>;
195
195
  export declare const sessionHostReconnectedPayloadSchema: z.ZodObject<{}, "strip", z.ZodTypeAny, {}, {}>;
196
+ export declare const screenStartPayloadSchema: z.ZodObject<{
197
+ fps: z.ZodDefault<z.ZodNumber>;
198
+ quality: z.ZodDefault<z.ZodNumber>;
199
+ scale: z.ZodDefault<z.ZodNumber>;
200
+ }, "strip", z.ZodTypeAny, {
201
+ fps: number;
202
+ quality: number;
203
+ scale: number;
204
+ }, {
205
+ fps?: number | undefined;
206
+ quality?: number | undefined;
207
+ scale?: number | undefined;
208
+ }>;
209
+ export declare const screenStopPayloadSchema: z.ZodObject<{}, "strip", z.ZodTypeAny, {}, {}>;
210
+ export declare const screenFramePayloadSchema: z.ZodObject<{
211
+ data: z.ZodString;
212
+ width: z.ZodNumber;
213
+ height: z.ZodNumber;
214
+ frameId: z.ZodNumber;
215
+ chunkIndex: z.ZodDefault<z.ZodNumber>;
216
+ chunkTotal: z.ZodDefault<z.ZodNumber>;
217
+ }, "strip", z.ZodTypeAny, {
218
+ data: string;
219
+ width: number;
220
+ height: number;
221
+ frameId: number;
222
+ chunkIndex: number;
223
+ chunkTotal: number;
224
+ }, {
225
+ data: string;
226
+ width: number;
227
+ height: number;
228
+ frameId: number;
229
+ chunkIndex?: number | undefined;
230
+ chunkTotal?: number | undefined;
231
+ }>;
232
+ export declare const screenStatusPayloadSchema: z.ZodObject<{
233
+ active: z.ZodBoolean;
234
+ mode: z.ZodDefault<z.ZodEnum<["webrtc", "fallback", "off"]>>;
235
+ error: z.ZodOptional<z.ZodString>;
236
+ }, "strip", z.ZodTypeAny, {
237
+ active: boolean;
238
+ mode: "webrtc" | "fallback" | "off";
239
+ error?: string | undefined;
240
+ }, {
241
+ active: boolean;
242
+ error?: string | undefined;
243
+ mode?: "webrtc" | "fallback" | "off" | undefined;
244
+ }>;
245
+ export declare const screenOfferPayloadSchema: z.ZodObject<{
246
+ sdp: z.ZodString;
247
+ }, "strip", z.ZodTypeAny, {
248
+ sdp: string;
249
+ }, {
250
+ sdp: string;
251
+ }>;
252
+ export declare const screenAnswerPayloadSchema: z.ZodObject<{
253
+ sdp: z.ZodString;
254
+ }, "strip", z.ZodTypeAny, {
255
+ sdp: string;
256
+ }, {
257
+ sdp: string;
258
+ }>;
259
+ export declare const screenIcePayloadSchema: z.ZodObject<{
260
+ candidate: z.ZodString;
261
+ sdpMid: z.ZodOptional<z.ZodNullable<z.ZodString>>;
262
+ sdpMLineIndex: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
263
+ }, "strip", z.ZodTypeAny, {
264
+ candidate: string;
265
+ sdpMid?: string | null | undefined;
266
+ sdpMLineIndex?: number | null | undefined;
267
+ }, {
268
+ candidate: string;
269
+ sdpMid?: string | null | undefined;
270
+ sdpMLineIndex?: number | null | undefined;
271
+ }>;
196
272
  export declare const errorPayloadSchema: z.ZodObject<{
197
273
  code: z.ZodString;
198
274
  message: z.ZodString;
199
275
  }, "strip", z.ZodTypeAny, {
200
- code: string;
201
276
  message: string;
202
- }, {
203
277
  code: string;
278
+ }, {
204
279
  message: string;
280
+ code: string;
205
281
  }>;
206
282
  export declare const protocolMessageSchemas: {
207
283
  readonly "session.connect": z.ZodObject<{
@@ -214,14 +290,14 @@ export declare const protocolMessageSchemas: {
214
290
  }, "strip", z.ZodTypeAny, {
215
291
  role: "host" | "client";
216
292
  clientName: string;
217
- provider?: "custom" | "claude" | "codex" | undefined;
293
+ provider?: "claude" | "codex" | "custom" | undefined;
218
294
  protocolVersion?: number | undefined;
219
295
  hostname?: string | undefined;
220
296
  platform?: string | undefined;
221
297
  }, {
222
298
  role: "host" | "client";
223
299
  clientName: string;
224
- provider?: "custom" | "claude" | "codex" | undefined;
300
+ provider?: "claude" | "codex" | "custom" | undefined;
225
301
  protocolVersion?: number | undefined;
226
302
  hostname?: string | undefined;
227
303
  platform?: string | undefined;
@@ -251,11 +327,11 @@ export declare const protocolMessageSchemas: {
251
327
  code: z.ZodString;
252
328
  message: z.ZodString;
253
329
  }, "strip", z.ZodTypeAny, {
254
- code: string;
255
330
  message: string;
256
- }, {
257
331
  code: string;
332
+ }, {
258
333
  message: string;
334
+ code: string;
259
335
  }>;
260
336
  readonly "terminal.output": z.ZodObject<{
261
337
  stream: z.ZodEnum<["stdout", "stderr"]>;
@@ -369,6 +445,82 @@ export declare const protocolMessageSchemas: {
369
445
  reason?: string | undefined;
370
446
  }>;
371
447
  readonly "session.host_reconnected": z.ZodObject<{}, "strip", z.ZodTypeAny, {}, {}>;
448
+ readonly "screen.start": z.ZodObject<{
449
+ fps: z.ZodDefault<z.ZodNumber>;
450
+ quality: z.ZodDefault<z.ZodNumber>;
451
+ scale: z.ZodDefault<z.ZodNumber>;
452
+ }, "strip", z.ZodTypeAny, {
453
+ fps: number;
454
+ quality: number;
455
+ scale: number;
456
+ }, {
457
+ fps?: number | undefined;
458
+ quality?: number | undefined;
459
+ scale?: number | undefined;
460
+ }>;
461
+ readonly "screen.stop": z.ZodObject<{}, "strip", z.ZodTypeAny, {}, {}>;
462
+ readonly "screen.frame": z.ZodObject<{
463
+ data: z.ZodString;
464
+ width: z.ZodNumber;
465
+ height: z.ZodNumber;
466
+ frameId: z.ZodNumber;
467
+ chunkIndex: z.ZodDefault<z.ZodNumber>;
468
+ chunkTotal: z.ZodDefault<z.ZodNumber>;
469
+ }, "strip", z.ZodTypeAny, {
470
+ data: string;
471
+ width: number;
472
+ height: number;
473
+ frameId: number;
474
+ chunkIndex: number;
475
+ chunkTotal: number;
476
+ }, {
477
+ data: string;
478
+ width: number;
479
+ height: number;
480
+ frameId: number;
481
+ chunkIndex?: number | undefined;
482
+ chunkTotal?: number | undefined;
483
+ }>;
484
+ readonly "screen.status": z.ZodObject<{
485
+ active: z.ZodBoolean;
486
+ mode: z.ZodDefault<z.ZodEnum<["webrtc", "fallback", "off"]>>;
487
+ error: z.ZodOptional<z.ZodString>;
488
+ }, "strip", z.ZodTypeAny, {
489
+ active: boolean;
490
+ mode: "webrtc" | "fallback" | "off";
491
+ error?: string | undefined;
492
+ }, {
493
+ active: boolean;
494
+ error?: string | undefined;
495
+ mode?: "webrtc" | "fallback" | "off" | undefined;
496
+ }>;
497
+ readonly "screen.offer": z.ZodObject<{
498
+ sdp: z.ZodString;
499
+ }, "strip", z.ZodTypeAny, {
500
+ sdp: string;
501
+ }, {
502
+ sdp: string;
503
+ }>;
504
+ readonly "screen.answer": z.ZodObject<{
505
+ sdp: z.ZodString;
506
+ }, "strip", z.ZodTypeAny, {
507
+ sdp: string;
508
+ }, {
509
+ sdp: string;
510
+ }>;
511
+ readonly "screen.ice": z.ZodObject<{
512
+ candidate: z.ZodString;
513
+ sdpMid: z.ZodOptional<z.ZodNullable<z.ZodString>>;
514
+ sdpMLineIndex: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
515
+ }, "strip", z.ZodTypeAny, {
516
+ candidate: string;
517
+ sdpMid?: string | null | undefined;
518
+ sdpMLineIndex?: number | null | undefined;
519
+ }, {
520
+ candidate: string;
521
+ sdpMid?: string | null | undefined;
522
+ sdpMLineIndex?: number | null | undefined;
523
+ }>;
372
524
  };
373
525
  export type ProtocolMessageType = keyof typeof protocolMessageSchemas;
374
526
  export declare function createEnvelope<T>(input: {
@@ -97,6 +97,37 @@ export const sessionHostDisconnectedPayloadSchema = z.object({
97
97
  reason: z.string().optional(),
98
98
  });
99
99
  export const sessionHostReconnectedPayloadSchema = z.object({});
100
+ // ── Screen sharing payloads ─────────────────────────────────────────
101
+ export const screenStartPayloadSchema = z.object({
102
+ fps: z.number().int().min(1).max(30).default(5),
103
+ quality: z.number().int().min(10).max(100).default(60),
104
+ scale: z.number().min(0.1).max(1).default(0.5),
105
+ });
106
+ export const screenStopPayloadSchema = z.object({});
107
+ export const screenFramePayloadSchema = z.object({
108
+ data: z.string(), // base64 JPEG
109
+ width: z.number().int(),
110
+ height: z.number().int(),
111
+ frameId: z.number().int(),
112
+ chunkIndex: z.number().int().default(0),
113
+ chunkTotal: z.number().int().default(1),
114
+ });
115
+ export const screenStatusPayloadSchema = z.object({
116
+ active: z.boolean(),
117
+ mode: z.enum(["webrtc", "fallback", "off"]).default("off"),
118
+ error: z.string().optional(),
119
+ });
120
+ export const screenOfferPayloadSchema = z.object({
121
+ sdp: z.string(),
122
+ });
123
+ export const screenAnswerPayloadSchema = z.object({
124
+ sdp: z.string(),
125
+ });
126
+ export const screenIcePayloadSchema = z.object({
127
+ candidate: z.string(),
128
+ sdpMid: z.string().nullable().optional(),
129
+ sdpMLineIndex: z.number().nullable().optional(),
130
+ });
100
131
  export const errorPayloadSchema = z.object({
101
132
  code: z.string().min(1),
102
133
  message: z.string().min(1),
@@ -121,6 +152,13 @@ export const protocolMessageSchemas = {
121
152
  "control.release": controlReleasePayloadSchema,
122
153
  "session.host_disconnected": sessionHostDisconnectedPayloadSchema,
123
154
  "session.host_reconnected": sessionHostReconnectedPayloadSchema,
155
+ "screen.start": screenStartPayloadSchema,
156
+ "screen.stop": screenStopPayloadSchema,
157
+ "screen.frame": screenFramePayloadSchema,
158
+ "screen.status": screenStatusPayloadSchema,
159
+ "screen.offer": screenOfferPayloadSchema,
160
+ "screen.answer": screenAnswerPayloadSchema,
161
+ "screen.ice": screenIcePayloadSchema,
124
162
  };
125
163
  // ── UUID helper (works in Node, Web, and Expo) ─────────────────────
126
164
  function generateId() {
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../shared-protocol/src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,uEAAuE;AAEvE,MAAM,CAAC,MAAM,gBAAgB,GAAG,CAAC,CAAC;AAElC,uEAAuE;AAEvE,MAAM,CAAC,MAAM,gBAAgB,GAAG,CAAC,CAAC,IAAI,CAAC,CAAC,MAAM,EAAE,QAAQ,CAAC,CAAC,CAAC;AAG3D,MAAM,CAAC,MAAM,kBAAkB,GAAG,CAAC,CAAC,IAAI,CAAC;IACvC,iBAAiB;IACjB,YAAY;IACZ,QAAQ;IACR,cAAc;IACd,MAAM;IACN,YAAY;CACb,CAAC,CAAC;AAGH,MAAM,CAAC,MAAM,eAAe,GAAG,CAAC,CAAC,IAAI,CAAC;IACpC,mBAAmB;IACnB,iBAAiB;IACjB,mBAAmB;IACnB,kBAAkB;IAClB,oBAAoB;IACpB,kBAAk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
3
+ "version": "0.2.0",
4
4
  "description": "Remote terminal bridge for Claude Code / Codex — control from your phone",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",
@@ -44,6 +44,9 @@
44
44
  "ws": "^8.18.1",
45
45
  "zod": "^3.24.3"
46
46
  },
47
+ "optionalDependencies": {
48
+ "werift": "^0.22.9"
49
+ },
47
50
  "devDependencies": {
48
51
  "@types/ws": "^8.5.14",
49
52
  "tsx": "^4.19.3"
@@ -3,7 +3,11 @@ import { hostname } from "node:os";
3
3
  import { loadConfig, saveConfig, getConfigPath } from "../config.js";
4
4
  import type { LinkShellConfig } from "../config.js";
5
5
 
6
- function ask(rl: readline.Interface, question: string, defaultValue?: string): Promise<string> {
6
+ function ask(
7
+ rl: readline.Interface,
8
+ question: string,
9
+ defaultValue?: string,
10
+ ): Promise<string> {
7
11
  const suffix = defaultValue ? ` (${defaultValue})` : "";
8
12
  return new Promise((resolve) => {
9
13
  rl.question(` ${question}${suffix}: `, (answer) => {
@@ -12,7 +16,12 @@ function ask(rl: readline.Interface, question: string, defaultValue?: string): P
12
16
  });
13
17
  }
14
18
 
15
- function choose(rl: readline.Interface, question: string, options: string[], defaultIdx = 0): Promise<string> {
19
+ function choose(
20
+ rl: readline.Interface,
21
+ question: string,
22
+ options: string[],
23
+ defaultIdx = 0,
24
+ ): Promise<string> {
16
25
  return new Promise((resolve) => {
17
26
  process.stdout.write(` ${question}\n`);
18
27
  for (let i = 0; i < options.length; i++) {
@@ -28,26 +37,40 @@ function choose(rl: readline.Interface, question: string, options: string[], def
28
37
 
29
38
  export async function runSetup(): Promise<void> {
30
39
  const existing = loadConfig();
31
- const rl = readline.createInterface({ input: process.stdin, output: process.stdout });
40
+ const rl = readline.createInterface({
41
+ input: process.stdin,
42
+ output: process.stdout,
43
+ });
32
44
 
33
45
  process.stdout.write("\n LinkShell Setup\n\n");
34
- process.stdout.write(" Tip: leave Gateway URL empty to use the built-in gateway (recommended for LAN use).\n\n");
46
+ process.stdout.write(
47
+ " Tip: leave Gateway URL empty to use the built-in gateway (recommended for LAN use).\n\n",
48
+ );
35
49
 
36
50
  const gateway = await ask(rl, "Gateway URL (leave empty for built-in)", "");
37
51
 
38
- const provider = await choose(
52
+ const provider = (await choose(
39
53
  rl,
40
54
  "Default provider:",
41
55
  ["claude", "codex", "custom"],
42
56
  ["claude", "codex", "custom"].indexOf(existing.provider ?? "claude"),
43
- ) as LinkShellConfig["provider"];
57
+ )) as LinkShellConfig["provider"];
44
58
 
45
59
  let command: string | undefined;
46
60
  if (provider === "custom") {
47
61
  command = await ask(rl, "Custom command", existing.command ?? "bash");
48
62
  }
49
63
 
50
- const clientName = await ask(rl, "Client name", existing.clientName ?? hostname());
64
+ const clientName = await ask(
65
+ rl,
66
+ "Client name",
67
+ existing.clientName ?? hostname(),
68
+ );
69
+ const hostnameName = await ask(
70
+ rl,
71
+ "Hostname (display name for your machine)",
72
+ existing.hostname ?? hostname(),
73
+ );
51
74
 
52
75
  rl.close();
53
76
 
@@ -56,11 +79,14 @@ export async function runSetup(): Promise<void> {
56
79
  provider,
57
80
  command,
58
81
  clientName,
82
+ hostname: hostnameName || undefined,
59
83
  };
60
84
 
61
85
  saveConfig(config);
62
86
 
63
- process.stdout.write(`\n \x1b[32mConfig saved to ${getConfigPath()}\x1b[0m\n\n`);
87
+ process.stdout.write(
88
+ `\n \x1b[32mConfig saved to ${getConfigPath()}\x1b[0m\n\n`,
89
+ );
64
90
  process.stdout.write(" Next steps:\n");
65
91
  process.stdout.write(" linkshell doctor — verify your setup\n");
66
92
  process.stdout.write(" linkshell start — start a bridge session\n\n");
package/src/config.ts CHANGED
@@ -8,6 +8,7 @@ export interface LinkShellConfig {
8
8
  provider?: "claude" | "codex" | "custom";
9
9
  command?: string;
10
10
  clientName?: string;
11
+ hostname?: string;
11
12
  cols?: number;
12
13
  rows?: number;
13
14
  }
package/src/index.ts CHANGED
@@ -15,22 +15,48 @@ program
15
15
  .description(
16
16
  "Bridge a local Claude/Codex terminal session to a remote gateway",
17
17
  )
18
- .version("0.1.9");
18
+ .version("0.2.0");
19
19
 
20
20
  // ── start ───────────────────────────────────────────────────────────
21
21
 
22
22
  program
23
23
  .command("start")
24
24
  .description("Start a bridge session (with built-in or remote gateway)")
25
- .option("--gateway <url>", "Gateway websocket URL (omit to start built-in gateway)", config.gateway ?? undefined)
26
- .option("--pairing-gateway <url-or-host>", "Public HTTP gateway used in QR/deep link output", config.pairingGateway)
25
+ .option(
26
+ "--gateway <url>",
27
+ "Gateway websocket URL (omit to start built-in gateway)",
28
+ config.gateway ?? undefined,
29
+ )
30
+ .option(
31
+ "--pairing-gateway <url-or-host>",
32
+ "Public HTTP gateway used in QR/deep link output",
33
+ config.pairingGateway,
34
+ )
27
35
  .option("--port <port>", "Port for built-in gateway", "8787")
28
36
  .option("--session-id <id>", "Session identifier (auto-created if omitted)")
29
- .option("--provider <provider>", "claude | codex | custom", config.provider ?? "claude")
37
+ .option(
38
+ "--provider <provider>",
39
+ "claude | codex | custom",
40
+ config.provider ?? "claude",
41
+ )
30
42
  .option("--command <command>", "Override provider executable", config.command)
31
- .option("--client-name <name>", "Display name for this CLI", config.clientName ?? "local-cli")
32
- .option("--cols <cols>", "Initial terminal columns", String(config.cols ?? 120))
43
+ .option(
44
+ "--client-name <name>",
45
+ "Display name for this CLI",
46
+ config.clientName ?? "local-cli",
47
+ )
48
+ .option(
49
+ "--hostname <name>",
50
+ "Override hostname sent to gateway",
51
+ config.hostname,
52
+ )
53
+ .option(
54
+ "--cols <cols>",
55
+ "Initial terminal columns",
56
+ String(config.cols ?? 120),
57
+ )
33
58
  .option("--rows <rows>", "Initial terminal rows", String(config.rows ?? 36))
59
+ .option("--screen", "Enable screen sharing capability")
34
60
  .option("--daemon", "Run in background (detached)")
35
61
  .option("--verbose", "Enable verbose logging")
36
62
  .option("--_foreground-bridge", undefined) // internal
@@ -50,14 +76,17 @@ program
50
76
  // Rebuild args for the child, replacing --daemon with --_foreground-bridge
51
77
  const childArgs = ["start", "--_foreground-bridge"];
52
78
  if (options.gateway) childArgs.push("--gateway", options.gateway);
53
- if (options.pairingGateway) childArgs.push("--pairing-gateway", options.pairingGateway);
79
+ if (options.pairingGateway)
80
+ childArgs.push("--pairing-gateway", options.pairingGateway);
54
81
  childArgs.push("--port", String(options.port));
55
82
  childArgs.push("--provider", options.provider);
56
83
  if (options.command) childArgs.push("--command", options.command);
57
84
  childArgs.push("--client-name", options.clientName);
85
+ if (options.hostname) childArgs.push("--hostname", options.hostname);
58
86
  childArgs.push("--cols", String(options.cols));
59
87
  childArgs.push("--rows", String(options.rows));
60
88
  if (options.verbose) childArgs.push("--verbose");
89
+ if (options.screen) childArgs.push("--screen");
61
90
  if (options.sessionId) childArgs.push("--session-id", options.sessionId);
62
91
  // Pass through extra args
63
92
  const extra = command.args.filter((v: string) => v !== "--");
@@ -70,12 +99,16 @@ program
70
99
  process.stderr.write(` Log: ${daemon.getLogFile("bridge")}\n\n`);
71
100
  process.stderr.write(` Stop: linkshell stop\n`);
72
101
  process.stderr.write(` Status: linkshell status\n`);
73
- process.stderr.write(` Logs: tail -f ${daemon.getLogFile("bridge")}\n\n`);
102
+ process.stderr.write(
103
+ ` Logs: tail -f ${daemon.getLogFile("bridge")}\n\n`,
104
+ );
74
105
  return;
75
106
  }
76
107
 
77
108
  // Foreground mode
78
- const passthroughArgs = command.args.filter((value: string) => value !== "--");
109
+ const passthroughArgs = command.args.filter(
110
+ (value: string) => value !== "--",
111
+ );
79
112
  const providerConfig = resolveProviderConfig({
80
113
  provider: options.provider,
81
114
  command: options.command,
@@ -88,7 +121,8 @@ program
88
121
  let embeddedGatewayHandle: { close: () => Promise<void> } | undefined;
89
122
 
90
123
  if (!gatewayUrl) {
91
- const { startEmbeddedGateway } = await import("@linkshell/gateway/embedded");
124
+ const { startEmbeddedGateway } =
125
+ await import("@linkshell/gateway/embedded");
92
126
  const port = Number(options.port);
93
127
  const gw = await startEmbeddedGateway({
94
128
  port,
@@ -127,7 +161,9 @@ program
127
161
  cols: Number(options.cols),
128
162
  rows: Number(options.rows),
129
163
  clientName: options.clientName,
164
+ hostname: options.hostname,
130
165
  verbose: Boolean(options.verbose),
166
+ screen: Boolean(options.screen),
131
167
  providerConfig,
132
168
  });
133
169
 
@@ -135,8 +171,12 @@ program
135
171
  daemon.removePid("bridge");
136
172
  if (embeddedGatewayHandle) await embeddedGatewayHandle.close();
137
173
  };
138
- process.on("SIGINT", () => { cleanup().then(() => process.exit(0)); });
139
- process.on("SIGTERM", () => { cleanup().then(() => process.exit(0)); });
174
+ process.on("SIGINT", () => {
175
+ cleanup().then(() => process.exit(0));
176
+ });
177
+ process.on("SIGTERM", () => {
178
+ cleanup().then(() => process.exit(0));
179
+ });
140
180
 
141
181
  await session.start();
142
182
  });
@@ -147,7 +187,11 @@ const gatewayCmd = program
147
187
  .command("gateway")
148
188
  .description("Manage the standalone gateway server")
149
189
  .option("--port <port>", "Listen port", "8787")
150
- .option("--log-level <level>", "Log level: debug | info | warn | error", "info")
190
+ .option(
191
+ "--log-level <level>",
192
+ "Log level: debug | info | warn | error",
193
+ "info",
194
+ )
151
195
  .option("--daemon", "Run in background (detached)")
152
196
  .option("--_foreground-gw", undefined) // internal
153
197
  .action(async (options) => {
@@ -156,14 +200,19 @@ const gatewayCmd = program
156
200
  if (options.daemon && !options._foregroundGw) {
157
201
  const existingPid = daemon.readPid("gateway");
158
202
  if (existingPid) {
159
- process.stderr.write(` Gateway already running (PID ${existingPid})\n`);
203
+ process.stderr.write(
204
+ ` Gateway already running (PID ${existingPid})\n`,
205
+ );
160
206
  process.stderr.write(` Run: linkshell gateway stop\n\n`);
161
207
  return;
162
208
  }
163
209
  const pid = daemon.spawnDaemon("gateway", [
164
- "gateway", "--_foreground-gw",
165
- "--port", String(options.port),
166
- "--log-level", options.logLevel,
210
+ "gateway",
211
+ "--_foreground-gw",
212
+ "--port",
213
+ String(options.port),
214
+ "--log-level",
215
+ options.logLevel,
167
216
  ]);
168
217
  process.stderr.write(`\n LinkShell Gateway started in background\n`);
169
218
  process.stderr.write(` PID: ${pid}\n`);
@@ -171,12 +220,15 @@ const gatewayCmd = program
171
220
  process.stderr.write(` Log: ${daemon.getLogFile("gateway")}\n\n`);
172
221
  process.stderr.write(` Stop: linkshell gateway stop\n`);
173
222
  process.stderr.write(` Status: linkshell gateway status\n`);
174
- process.stderr.write(` Logs: tail -f ${daemon.getLogFile("gateway")}\n\n`);
223
+ process.stderr.write(
224
+ ` Logs: tail -f ${daemon.getLogFile("gateway")}\n\n`,
225
+ );
175
226
  return;
176
227
  }
177
228
 
178
229
  // Foreground mode
179
- const { startEmbeddedGateway } = await import("@linkshell/gateway/embedded");
230
+ const { startEmbeddedGateway } =
231
+ await import("@linkshell/gateway/embedded");
180
232
  const port = Number(options.port);
181
233
  const gw = await startEmbeddedGateway({
182
234
  port,
@@ -190,8 +242,12 @@ const gatewayCmd = program
190
242
  process.stderr.write(` Listening on http://0.0.0.0:${gw.port}\n`);
191
243
  process.stderr.write(` PID: ${process.pid}\n`);
192
244
  process.stderr.write(` Log level: ${options.logLevel}\n\n`);
193
- process.stderr.write(` Clients connect via: ws://your-server:${gw.port}/ws\n`);
194
- process.stderr.write(` Health check: curl http://your-server:${gw.port}/healthz\n\n`);
245
+ process.stderr.write(
246
+ ` Clients connect via: ws://your-server:${gw.port}/ws\n`,
247
+ );
248
+ process.stderr.write(
249
+ ` Health check: curl http://your-server:${gw.port}/healthz\n\n`,
250
+ );
195
251
 
196
252
  const shutdown = async () => {
197
253
  process.stderr.write("[gateway] shutting down...\n");