@cli-remote/local 0.3.0 → 0.3.1

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.
Files changed (2) hide show
  1. package/dist/index.cjs +20 -3
  2. package/package.json +2 -2
package/dist/index.cjs CHANGED
@@ -1,4 +1,4 @@
1
- #!/usr/bin/env node
1
+ '#!/usr/bin/env node'
2
2
  "use strict";
3
3
  var __create = Object.create;
4
4
  var __defProp = Object.defineProperty;
@@ -11558,11 +11558,28 @@ function resolveHere() {
11558
11558
  })();
11559
11559
  var argUrl = process.argv[2];
11560
11560
  var argMatch = argUrl && (argUrl.startsWith("ws://") || argUrl.startsWith("wss://"));
11561
+ function readVersion() {
11562
+ if (true) return "0.3.1";
11563
+ try {
11564
+ const pkg = JSON.parse(
11565
+ (0, import_node_fs5.readFileSync)(new URL("../package.json", import_meta.url), "utf-8")
11566
+ );
11567
+ return pkg.version ?? "unknown";
11568
+ } catch {
11569
+ return "unknown";
11570
+ }
11571
+ }
11572
+ if (argUrl === "-v" || argUrl === "--version" || argUrl === "version") {
11573
+ console.log(`cli-local ${readVersion()}`);
11574
+ console.log(`node ${process.version} (${process.platform} ${process.arch})`);
11575
+ process.exit(0);
11576
+ }
11561
11577
  if (argUrl && !argMatch && (argUrl === "-h" || argUrl === "--help" || argUrl === "help")) {
11562
11578
  console.log(`cli-local \u2014 local PTY agent for cli-remote (gateway \u5E38\u9A7B\u670D\u52A1)
11563
11579
 
11564
11580
  usage:
11565
11581
  cli-local \u65E0 gateway \u4E14\u5DF2\u914D\u7F6E\u65F6\u524D\u53F0\u8FD0\u884C\uFF1B\u5426\u5219\u663E\u793A\u72B6\u6001
11582
+ cli-local -v | --version \u67E5\u770B\u7248\u672C
11566
11583
  cli-local pair \u91CD\u65B0\u6388\u6743\uFF08\u540A\u9500/\u8FC7\u671F\u540E\u91CD\u914D\u5BF9\uFF1Bgateway \u70ED\u52A0\u8F7D\uFF09
11567
11584
  cli-local gateway start \u540E\u53F0\u542F\u52A8\u5E38\u9A7B gateway\uFF08\u63A8\u8350\uFF09
11568
11585
  cli-local gateway stop|restart|status|logs [-f] [-n N]
@@ -11881,7 +11898,7 @@ if (argUrl === "gateway") {
11881
11898
  const up = Math.floor(st.uptimeMs / 1e3);
11882
11899
  const upStr = up > 3600 ? `${Math.floor(up / 3600)}h${Math.floor(up % 3600 / 60)}m` : up > 60 ? `${Math.floor(up / 60)}m${up % 60}s` : `${up}s`;
11883
11900
  const exp = st.accessTokenExpiresAt ? new Date(st.accessTokenExpiresAt).toLocaleTimeString() : "\u2014";
11884
- console.log(`[gateway] running (pid ${gatewayPid() ?? "?"}, api :${port})`);
11901
+ console.log(`[gateway] running (pid ${gatewayPid() ?? "?"}, api :${port}) \u2014 cli-local ${readVersion()}`);
11885
11902
  console.log(`[gateway] \u72B6\u6001: ${phaseLabel[st.phase] ?? st.phase}${st.reason ? ` (${st.reason})` : ""}`);
11886
11903
  console.log(`[gateway] hub: ${st.hubUrl}`);
11887
11904
  console.log(`[gateway] deviceId: ${st.deviceId ?? "\u2014"}`);
@@ -11903,7 +11920,7 @@ if (argUrl === "gateway") {
11903
11920
  hub = cfg.relayUrl ?? hub;
11904
11921
  } catch {
11905
11922
  }
11906
- console.log(`[gateway] running (pid ${pid}) \u2014 \u63A7\u5236API\u672A\u54CD\u5E94\uFF08\u65E7\u7248\u672C\uFF1F\uFF09`);
11923
+ console.log(`[gateway] running (pid ${pid}) \u2014 cli-local ${readVersion()}\uFF08\u63A7\u5236API\u672A\u54CD\u5E94\uFF0C\u65E7\u7248\u672C\uFF1F\uFF09`);
11907
11924
  console.log(`[gateway] hub: ${hub}`);
11908
11925
  console.log(`[gateway] \u65E5\u5FD7: ${gatewayLogFile()}`);
11909
11926
  process.exit(0);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cli-remote/local",
3
- "version": "0.3.0",
3
+ "version": "0.3.1",
4
4
  "description": "Local PTY agent for cli-remote — exposes your local CLI tools (claude/codex/kimi-cli/shell) to the mobile web client via a self-hosted hub.",
5
5
  "license": "MIT",
6
6
  "repository": {
@@ -26,7 +26,7 @@
26
26
  ],
27
27
  "scripts": {
28
28
  "dev": "tsx watch src/index.ts",
29
- "build": "esbuild src/index.ts --bundle --platform=node --format=cjs --outfile=dist/index.cjs --external:node-pty --banner:js='#!/usr/bin/env node'",
29
+ "build": "node scripts/build.mjs",
30
30
  "typecheck": "tsc --noEmit",
31
31
  "prepublishOnly": "pnpm build"
32
32
  },