@skylandnpm/octopus-proxy 0.1.46 → 0.1.48

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.
@@ -14,7 +14,7 @@ import {
14
14
  probeRemote,
15
15
  verifyHostPassword,
16
16
  z
17
- } from "./chunk-GD6G4K6E.js";
17
+ } from "./chunk-KRNEKDBF.js";
18
18
 
19
19
  // ../../node_modules/.pnpm/ajv@8.17.1/node_modules/ajv/dist/compile/codegen/code.js
20
20
  var require_code = __commonJS({
@@ -4086,7 +4086,7 @@ var z = /* @__PURE__ */ Object.freeze({
4086
4086
  });
4087
4087
 
4088
4088
  // src/remote-protocol.ts
4089
- var REMOTE_DEFAULTS = Object.freeze({ totalBitrate: 2e6, videoMaxBitrate: 16e5, clipboardBitrate: 5e4, maxWidth: 2560, maxHeight: 1440, maxFps: 30 });
4089
+ var REMOTE_DEFAULTS = Object.freeze({ totalBitrate: 5e6, videoMaxBitrate: 4e6, clipboardBitrate: 5e4, maxWidth: 2560, maxHeight: 1440, maxFps: 30 });
4090
4090
  var stunUrl = z.string().max(256).regex(/^stun:(?:\[[0-9a-fA-F:]+\]|[a-zA-Z0-9.-]+)(?::[0-9]{1,5})?$/, "\u4EC5\u5141\u8BB8 stun: \u4E3B\u673A[:\u7AEF\u53E3]\uFF0C\u7981\u6B62 TURN").refine((url) => {
4091
4091
  const port = /:(\d+)$/.exec(url);
4092
4092
  return !port || Number(port[1]) >= 1 && Number(port[1]) <= 65535;
@@ -4094,8 +4094,8 @@ var stunUrl = z.string().max(256).regex(/^stun:(?:\[[0-9a-fA-F:]+\]|[a-zA-Z0-9.-
4094
4094
  var RemoteConfigSchema = z.object({
4095
4095
  enabled: z.boolean().default(true),
4096
4096
  stunUrls: z.array(stunUrl).min(1).max(4).optional(),
4097
- totalBitrate: z.number().int().min(1e5).max(2e6).default(REMOTE_DEFAULTS.totalBitrate),
4098
- videoMaxBitrate: z.number().int().min(5e4).max(16e5).default(REMOTE_DEFAULTS.videoMaxBitrate),
4097
+ totalBitrate: z.number().int().min(1e5).max(5e6).default(REMOTE_DEFAULTS.totalBitrate),
4098
+ videoMaxBitrate: z.number().int().min(5e4).max(4e6).default(REMOTE_DEFAULTS.videoMaxBitrate),
4099
4099
  ffmpeg: z.string().min(1).default("ffmpeg")
4100
4100
  }).strict().refine((c) => c.videoMaxBitrate <= c.totalBitrate * 0.8, "\u89C6\u9891\u989D\u5EA6\u4E0D\u5F97\u8D85\u8FC7\u603B\u9884\u7B97\u7684 80%");
4101
4101
  var SignalSchema = z.discriminatedUnion("kind", [
@@ -4120,7 +4120,7 @@ var InputSchema = z.discriminatedUnion("kind", [
4120
4120
  z.object({ ...envelope, kind: z.literal("ping") }).strict()
4121
4121
  ]);
4122
4122
  function capVideoSdp(sdp, bitrate) {
4123
- const limit = Math.max(5e4, Math.min(16e5, Math.floor(bitrate)));
4123
+ const limit = Math.max(5e4, Math.min(4e6, Math.floor(bitrate)));
4124
4124
  const lines = sdp.split(/\r?\n/), result = [];
4125
4125
  let video = false;
4126
4126
  for (const line of lines) {
package/dist/cli.js CHANGED
@@ -29,7 +29,7 @@ import {
29
29
  supportedPlatform,
30
30
  systemdUnitPath,
31
31
  toolSearchDirs
32
- } from "./chunk-3QQWM23K.js";
32
+ } from "./chunk-DSAJ4SAH.js";
33
33
  import {
34
34
  DESKTOP_PERMISSION_GUIDANCE,
35
35
  PlatformDesktop,
@@ -37,7 +37,7 @@ import {
37
37
  checkDesktop,
38
38
  ensureHostAuth,
39
39
  requestDesktopPermission
40
- } from "./chunk-GD6G4K6E.js";
40
+ } from "./chunk-KRNEKDBF.js";
41
41
 
42
42
  // src/cli.ts
43
43
  import { spawn as spawn2 } from "node:child_process";
package/dist/main.js CHANGED
@@ -2,8 +2,8 @@
2
2
  import {
3
3
  ConfigError,
4
4
  runDaemon
5
- } from "./chunk-3QQWM23K.js";
6
- import "./chunk-GD6G4K6E.js";
5
+ } from "./chunk-DSAJ4SAH.js";
6
+ import "./chunk-KRNEKDBF.js";
7
7
 
8
8
  // src/main.ts
9
9
  runDaemon(process.env.OCTOPUS_PROXY_CONFIG ?? "proxy.json").catch((error) => {
@@ -10,7 +10,7 @@ import {
10
10
  nativeProcess,
11
11
  parseXrandr,
12
12
  terminateNative
13
- } from "./chunk-GD6G4K6E.js";
13
+ } from "./chunk-KRNEKDBF.js";
14
14
 
15
15
  // src/remote-worker.ts
16
16
  import rtc from "@roamhq/wrtc";
@@ -19,6 +19,7 @@ import { promisify } from "node:util";
19
19
  import { timingSafeEqual } from "node:crypto";
20
20
 
21
21
  // src/remote-budget.ts
22
+ var FRAME_RATES = [30, 20, 15, 12];
22
23
  function transportBytes(stats) {
23
24
  let bytes = 0, packets = 0, available, rtt = 0;
24
25
  for (const row of stats) {
@@ -56,7 +57,7 @@ var RemoteBudget = class {
56
57
  this.clipboardPaused = true;
57
58
  this.quiet = 0;
58
59
  this.videoBitrate = Math.max(5e4, Math.floor(Math.min(this.videoBitrate * 0.8, (available ?? this.total) * 0.7)));
59
- if (this.fpsIndex < 4) this.fpsIndex++;
60
+ if (this.fpsIndex < FRAME_RATES.length - 1) this.fpsIndex++;
60
61
  else if (this.tier < 2) this.tier++;
61
62
  } else {
62
63
  if (this.bitrate < this.total * 0.75 && rtt < 0.2) this.clipboardPaused = false;
@@ -72,7 +73,7 @@ var RemoteBudget = class {
72
73
  return before !== `${this.tier}:${this.fpsIndex}:${this.videoBitrate}`;
73
74
  }
74
75
  video(width, height) {
75
- return { ...fitVideo(width, height, this.tier), fps: [30, 20, 15, 10, 5][this.fpsIndex], videoBitrate: this.videoBitrate };
76
+ return { ...fitVideo(width, height, this.tier), fps: FRAME_RATES[this.fpsIndex], videoBitrate: this.videoBitrate };
76
77
  }
77
78
  };
78
79
  var TokenBucket = class {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@skylandnpm/octopus-proxy",
3
- "version": "0.1.46",
3
+ "version": "0.1.48",
4
4
  "type": "module",
5
5
  "description": "Octopus host proxy: OpenCode, Codex, ZCode and Pi adapters with service installer CLI",
6
6
  "bin": {
@@ -8,7 +8,7 @@
8
8
  "desktopRemote": {
9
9
  "enabled": true,
10
10
  "stunUrls": ["stun:hub.example.com:3478"],
11
- "totalBitrate": 2000000,
12
- "videoMaxBitrate": 1600000
11
+ "totalBitrate": 5000000,
12
+ "videoMaxBitrate": 4000000
13
13
  }
14
14
  }