@dev-anywhere/proxy 0.9.6 → 0.9.8

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 (77) hide show
  1. package/README.md +8 -1
  2. package/dist/autostart-6DMQS43N.js +864 -0
  3. package/dist/autostart-6DMQS43N.js.map +1 -0
  4. package/dist/chunk-3NUN2VYO.js +46 -0
  5. package/dist/chunk-3NUN2VYO.js.map +1 -0
  6. package/dist/{chunk-C2VZS676.js → chunk-3ZDUDCEI.js} +2 -2
  7. package/dist/{chunk-7FPUPHTZ.js → chunk-5KXGIGKU.js} +9 -2
  8. package/dist/chunk-5KXGIGKU.js.map +1 -0
  9. package/dist/{chunk-LAFXAGDU.js → chunk-5RESCDN4.js} +2 -2
  10. package/dist/{chunk-DEMLXEB5.js → chunk-7EOSTWVO.js} +3 -3
  11. package/dist/{chunk-PCF2R2TG.js → chunk-AS7W2D2X.js} +2 -2
  12. package/dist/{chunk-PCF2R2TG.js.map → chunk-AS7W2D2X.js.map} +1 -1
  13. package/dist/{chunk-724Y2CKO.js → chunk-CFO5GU5U.js} +2 -43
  14. package/dist/chunk-CFO5GU5U.js.map +1 -0
  15. package/dist/{chunk-5COVSNQZ.js → chunk-CFPY2A6Q.js} +2 -2
  16. package/dist/chunk-DEL6NNYV.js +161 -0
  17. package/dist/chunk-DEL6NNYV.js.map +1 -0
  18. package/dist/{chunk-TLY6IMDY.js → chunk-DSZJSFEG.js} +42 -8
  19. package/dist/chunk-DSZJSFEG.js.map +1 -0
  20. package/dist/{chunk-SSTYQQSR.js → chunk-EWIHC4BK.js} +2 -2
  21. package/dist/{chunk-IEBAPWH3.js → chunk-HEXGO236.js} +6 -6
  22. package/dist/{chunk-TQP3COOV.js → chunk-HJOYOYGB.js} +2 -1
  23. package/dist/{chunk-EEXWF5SA.js → chunk-JRSPTWQB.js} +2 -2
  24. package/dist/{chunk-LIGQMX7K.js → chunk-MPW6H537.js} +85 -7
  25. package/dist/chunk-MPW6H537.js.map +1 -0
  26. package/dist/{chunk-UBWS5JVM.js → chunk-QZJBIFGW.js} +16 -9
  27. package/dist/chunk-QZJBIFGW.js.map +1 -0
  28. package/dist/{chunk-BUUAXCBP.js → chunk-QZNAESON.js} +2 -2
  29. package/dist/{chunk-WEATMI5J.js → chunk-SKKPJULC.js} +10 -1
  30. package/dist/chunk-SKKPJULC.js.map +1 -0
  31. package/dist/{chunk-TIXHLU3Q.js → chunk-ZE73PMOL.js} +6 -4
  32. package/dist/chunk-ZE73PMOL.js.map +1 -0
  33. package/dist/{chunk-ZRABX7EM.js → chunk-ZHG3MO4C.js} +2 -2
  34. package/dist/chunk-ZRCMGVGT.js +33 -0
  35. package/dist/chunk-ZRCMGVGT.js.map +1 -0
  36. package/dist/index.js +35 -21
  37. package/dist/index.js.map +1 -1
  38. package/dist/{logger-XEIQC6K6.js → logger-2EQWS3V2.js} +3 -3
  39. package/dist/preview-worker.js +10 -8
  40. package/dist/preview-worker.js.map +1 -1
  41. package/dist/{quick-tunnel-ZIFTYUUD.js → quick-tunnel-HA5NE7K6.js} +2 -2
  42. package/dist/{relay-token-Y3IFNUMX.js → relay-token-SK3OOH2H.js} +4 -4
  43. package/dist/serve.js +78 -20
  44. package/dist/serve.js.map +1 -1
  45. package/dist/service-host-YEX4IBZO.js +139 -0
  46. package/dist/service-host-YEX4IBZO.js.map +1 -0
  47. package/dist/session-worker.js +8 -8
  48. package/dist/{terminal-FNVKGTTL.js → terminal-H6DLED7O.js} +26 -15
  49. package/dist/terminal-H6DLED7O.js.map +1 -0
  50. package/dist/terminal-worker.js +17 -14
  51. package/dist/terminal-worker.js.map +1 -1
  52. package/dist/update-runner.js +7 -33
  53. package/dist/update-runner.js.map +1 -1
  54. package/package.json +3 -3
  55. package/dist/autostart-TMACAYHZ.js +0 -370
  56. package/dist/autostart-TMACAYHZ.js.map +0 -1
  57. package/dist/chunk-724Y2CKO.js.map +0 -1
  58. package/dist/chunk-7FPUPHTZ.js.map +0 -1
  59. package/dist/chunk-LIGQMX7K.js.map +0 -1
  60. package/dist/chunk-TIXHLU3Q.js.map +0 -1
  61. package/dist/chunk-TLY6IMDY.js.map +0 -1
  62. package/dist/chunk-UBWS5JVM.js.map +0 -1
  63. package/dist/chunk-WEATMI5J.js.map +0 -1
  64. package/dist/terminal-FNVKGTTL.js.map +0 -1
  65. /package/dist/{chunk-C2VZS676.js.map → chunk-3ZDUDCEI.js.map} +0 -0
  66. /package/dist/{chunk-LAFXAGDU.js.map → chunk-5RESCDN4.js.map} +0 -0
  67. /package/dist/{chunk-DEMLXEB5.js.map → chunk-7EOSTWVO.js.map} +0 -0
  68. /package/dist/{chunk-5COVSNQZ.js.map → chunk-CFPY2A6Q.js.map} +0 -0
  69. /package/dist/{chunk-SSTYQQSR.js.map → chunk-EWIHC4BK.js.map} +0 -0
  70. /package/dist/{chunk-IEBAPWH3.js.map → chunk-HEXGO236.js.map} +0 -0
  71. /package/dist/{chunk-TQP3COOV.js.map → chunk-HJOYOYGB.js.map} +0 -0
  72. /package/dist/{chunk-EEXWF5SA.js.map → chunk-JRSPTWQB.js.map} +0 -0
  73. /package/dist/{chunk-BUUAXCBP.js.map → chunk-QZNAESON.js.map} +0 -0
  74. /package/dist/{chunk-ZRABX7EM.js.map → chunk-ZHG3MO4C.js.map} +0 -0
  75. /package/dist/{logger-XEIQC6K6.js.map → logger-2EQWS3V2.js.map} +0 -0
  76. /package/dist/{quick-tunnel-ZIFTYUUD.js.map → quick-tunnel-HA5NE7K6.js.map} +0 -0
  77. /package/dist/{relay-token-Y3IFNUMX.js.map → relay-token-SK3OOH2H.js.map} +0 -0
@@ -7,7 +7,7 @@ import {
7
7
  } from "./chunk-C5RUR5MY.js";
8
8
  import {
9
9
  spawnScript
10
- } from "./chunk-PCF2R2TG.js";
10
+ } from "./chunk-AS7W2D2X.js";
11
11
  import {
12
12
  createLogger,
13
13
  flushLogger
@@ -243,4 +243,4 @@ export {
243
243
  extractTryCloudflareUrl,
244
244
  runQuickTunnel
245
245
  };
246
- //# sourceMappingURL=quick-tunnel-ZIFTYUUD.js.map
246
+ //# sourceMappingURL=quick-tunnel-HA5NE7K6.js.map
@@ -1,10 +1,10 @@
1
1
  #!/usr/bin/env node
2
2
  import {
3
3
  loadConfig
4
- } from "./chunk-DEMLXEB5.js";
4
+ } from "./chunk-7EOSTWVO.js";
5
5
  import "./chunk-NQDJ6QAM.js";
6
- import "./chunk-EEXWF5SA.js";
7
- import "./chunk-WEATMI5J.js";
6
+ import "./chunk-JRSPTWQB.js";
7
+ import "./chunk-SKKPJULC.js";
8
8
  import "./chunk-ICSO3ZIS.js";
9
9
 
10
10
  // src/relay-token.ts
@@ -81,4 +81,4 @@ function printResult(relayName, relayUrl, result) {
81
81
  export {
82
82
  runRelayTokenCommand
83
83
  };
84
- //# sourceMappingURL=relay-token-Y3IFNUMX.js.map
84
+ //# sourceMappingURL=relay-token-SK3OOH2H.js.map
package/dist/serve.js CHANGED
@@ -3,7 +3,7 @@ import {
3
3
  buildProviderEnv,
4
4
  loadConfig,
5
5
  saveAgentCliPath
6
- } from "./chunk-DEMLXEB5.js";
6
+ } from "./chunk-7EOSTWVO.js";
7
7
  import {
8
8
  PersistedSessionRecordSchema,
9
9
  extractAgentInvocation,
@@ -12,7 +12,7 @@ import {
12
12
  sessionRuntimeIpcVersionMatches,
13
13
  stripProxyProfileArgs,
14
14
  writeSessionRuntimeIpcVersions
15
- } from "./chunk-ZRABX7EM.js";
15
+ } from "./chunk-ZHG3MO4C.js";
16
16
  import {
17
17
  processExistsOrIsInaccessible
18
18
  } from "./chunk-5OARBB2B.js";
@@ -21,7 +21,7 @@ import {
21
21
  isPreviewControlRequest,
22
22
  readPreviewWorkerMessages,
23
23
  writePreviewWorkerMessage
24
- } from "./chunk-BUUAXCBP.js";
24
+ } from "./chunk-QZNAESON.js";
25
25
  import {
26
26
  ContentBlockDeltaSchema,
27
27
  IGNORED_EVENT_TYPES,
@@ -30,7 +30,7 @@ import {
30
30
  createScopedApprovalRequestIdFactory,
31
31
  disposeSeqCounter,
32
32
  getSeqCounterFor
33
- } from "./chunk-5COVSNQZ.js";
33
+ } from "./chunk-CFPY2A6Q.js";
34
34
  import {
35
35
  readWorkerConnection
36
36
  } from "./chunk-WG3KLJFJ.js";
@@ -40,7 +40,7 @@ import {
40
40
  import {
41
41
  buildHostedPtyArgs,
42
42
  parseTerminalWorkerCliArgs
43
- } from "./chunk-UBWS5JVM.js";
43
+ } from "./chunk-QZJBIFGW.js";
44
44
  import {
45
45
  ReconnectSupervisor,
46
46
  TERMINAL_ADMISSION_FRAME_MAX_BYTES,
@@ -48,18 +48,20 @@ import {
48
48
  isTerminalAdmissionRequestCandidate,
49
49
  parseTerminalAdmissionRequest,
50
50
  serializeTerminalAdmissionMessage
51
- } from "./chunk-TLY6IMDY.js";
51
+ } from "./chunk-DSZJSFEG.js";
52
52
  import {
53
53
  startServiceControl
54
54
  } from "./chunk-AZ5MTPUR.js";
55
55
  import {
56
56
  IS_DEV,
57
57
  spawnScript
58
- } from "./chunk-PCF2R2TG.js";
58
+ } from "./chunk-AS7W2D2X.js";
59
59
  import {
60
- tryAcquireFileLock,
61
60
  tryConnectSocket
62
- } from "./chunk-724Y2CKO.js";
61
+ } from "./chunk-3NUN2VYO.js";
62
+ import {
63
+ tryAcquireFileLock
64
+ } from "./chunk-CFO5GU5U.js";
63
65
  import {
64
66
  CodexApprovalPolicyUnsupportedError,
65
67
  KimiPermissionModeUnsupportedError,
@@ -67,7 +69,7 @@ import {
67
69
  detectAgentCliStatus,
68
70
  resolveCodexPermissionPolicy,
69
71
  resolveKimiAcpMode
70
- } from "./chunk-TIXHLU3Q.js";
72
+ } from "./chunk-ZE73PMOL.js";
71
73
  import {
72
74
  TERMINAL_IPC_PROTOCOL_VERSION,
73
75
  WORKER_IPC_PROTOCOL_VERSION,
@@ -75,8 +77,8 @@ import {
75
77
  createWorkerReader,
76
78
  serializeIpc,
77
79
  serializeWorkerMsg
78
- } from "./chunk-C2VZS676.js";
79
- import "./chunk-LAFXAGDU.js";
80
+ } from "./chunk-3ZDUDCEI.js";
81
+ import "./chunk-5RESCDN4.js";
80
82
  import {
81
83
  ControlErrorCode,
82
84
  MessageEnvelopeSchema,
@@ -103,7 +105,7 @@ import {
103
105
  isProxyProtocolRejectDirection,
104
106
  serializeControl,
105
107
  summarizeToolActivity
106
- } from "./chunk-7FPUPHTZ.js";
108
+ } from "./chunk-5KXGIGKU.js";
107
109
  import {
108
110
  localIpcEndpointMayExist,
109
111
  removeLocalIpcEndpoint,
@@ -121,11 +123,16 @@ import {
121
123
  codexActiveWriterMessage,
122
124
  sanitizeProviderErrorTail
123
125
  } from "./chunk-J5V2TKSV.js";
124
- import "./chunk-SSTYQQSR.js";
125
- import "./chunk-TQP3COOV.js";
126
+ import "./chunk-EWIHC4BK.js";
127
+ import {
128
+ defaultShell,
129
+ environmentValue,
130
+ findExecutableCandidates,
131
+ isExecutableFile
132
+ } from "./chunk-HJOYOYGB.js";
126
133
  import {
127
134
  serviceLogger
128
- } from "./chunk-EEXWF5SA.js";
135
+ } from "./chunk-JRSPTWQB.js";
129
136
  import {
130
137
  DATA_DIR,
131
138
  DEFAULT_PROXY_PROFILE,
@@ -144,7 +151,7 @@ import {
144
151
  ensureProfileWorkspace,
145
152
  sessionPaths,
146
153
  tildify
147
- } from "./chunk-WEATMI5J.js";
154
+ } from "./chunk-SKKPJULC.js";
148
155
  import {
149
156
  flushLogger
150
157
  } from "./chunk-ICSO3ZIS.js";
@@ -5554,6 +5561,51 @@ var RelayPermissionHandlers = class {
5554
5561
  import { homedir as homedir4 } from "os";
5555
5562
  import { accessSync, constants, statSync } from "fs";
5556
5563
  import { isAbsolute as isAbsolute7 } from "path";
5564
+
5565
+ // src/common/terminal-shell.ts
5566
+ import { win32 } from "path";
5567
+ function windowsTerminalShells(env, options) {
5568
+ const probe = options.isExecutableFile ?? ((file) => isExecutableFile(file, "win32"));
5569
+ const systemRoot = environmentValue(env, "SystemRoot", "win32") || "C:\\Windows";
5570
+ const programFiles = environmentValue(env, "ProgramFiles", "win32");
5571
+ const powerShell7 = findExecutableCandidates("pwsh.exe", env, { ...options, platform: "win32" })[0] ?? (programFiles ? [win32.join(programFiles, "PowerShell", "7", "pwsh.exe")].find(probe) : void 0);
5572
+ const windowsPowerShell = win32.join(
5573
+ systemRoot,
5574
+ "System32",
5575
+ "WindowsPowerShell",
5576
+ "v1.0",
5577
+ "powershell.exe"
5578
+ );
5579
+ const commandPrompt = win32.join(systemRoot, "System32", "cmd.exe");
5580
+ const shells = [];
5581
+ if (powerShell7) {
5582
+ shells.push({ id: "powershell", label: "PowerShell 7", command: powerShell7 });
5583
+ } else if (probe(windowsPowerShell)) {
5584
+ shells.push({ id: "powershell", label: "Windows PowerShell", command: windowsPowerShell });
5585
+ }
5586
+ if (probe(commandPrompt)) shells.push({ id: "cmd", label: "CMD", command: commandPrompt });
5587
+ return shells;
5588
+ }
5589
+ function listTerminalShells(env = process.env, options = {}) {
5590
+ if ((options.platform ?? process.platform) !== "win32") return void 0;
5591
+ return windowsTerminalShells(env, options).map(({ id, label }) => ({ id, label }));
5592
+ }
5593
+ function resolveTerminalShell(shell, env = process.env, options = {}) {
5594
+ const platform = options.platform ?? process.platform;
5595
+ if (platform !== "win32") {
5596
+ if (shell !== void 0) throw new Error("CMD \u548C PowerShell \u9009\u9879\u4EC5\u652F\u6301 Windows \u5F00\u53D1\u673A");
5597
+ return { command: defaultShell(env, platform) };
5598
+ }
5599
+ const available = windowsTerminalShells(env, options);
5600
+ const resolved = shell === void 0 ? available[0] : available.find(({ id }) => id === shell);
5601
+ if (!resolved) {
5602
+ const label = shell === "powershell" ? "PowerShell" : shell === "cmd" ? "CMD" : "Shell";
5603
+ throw new Error(label + " \u4E0D\u53EF\u7528\uFF0C\u8BF7\u68C0\u67E5\u5F00\u53D1\u673A\u4E0A\u7684 Shell \u5B89\u88C5\u540E\u91CD\u8BD5");
5604
+ }
5605
+ return { command: resolved.command, label: resolved.label };
5606
+ }
5607
+
5608
+ // src/serve/relay-resource-handlers.ts
5557
5609
  function errorMessage(err) {
5558
5610
  return err instanceof Error ? err.message : String(err);
5559
5611
  }
@@ -5571,12 +5623,15 @@ var RelayResourceHandlers = class {
5571
5623
  }
5572
5624
  deps;
5573
5625
  async onProxyInfoRequest(msg) {
5626
+ const env = this.deps.getProviderEnv();
5627
+ const terminalShells = listTerminalShells(env);
5574
5628
  this.deps.relaySend(
5575
5629
  serializeControl({
5576
5630
  type: "proxy_info",
5577
5631
  requestId: msg.requestId,
5578
5632
  homePath: homedir4() || "/",
5579
- agentCli: detectAgentCliStatus(this.deps.getProviderEnv(), {
5633
+ ...terminalShells !== void 0 ? { terminalShells } : {},
5634
+ agentCli: detectAgentCliStatus(env, {
5580
5635
  suggestions: this.deps.getAgentCliSuggestions()
5581
5636
  })
5582
5637
  })
@@ -6333,15 +6388,17 @@ var RelaySessionCreateHandler = class {
6333
6388
  const pendingId = nanoid3();
6334
6389
  const cwd = resolveTerminalCwd();
6335
6390
  const requestedName = normalizeSessionName(msg.name);
6336
- const name = requestedName ?? tildify(cwd);
6337
6391
  const nameLocked = requestedName !== void 0;
6338
6392
  const { cols, rows } = msg;
6339
6393
  const geometry = resolveInitialPtyGeometry({ cols, rows });
6340
6394
  let startup;
6341
6395
  try {
6396
+ const shell = resolveTerminalShell(msg.shell, this.deps.getProviderEnv());
6397
+ const name = requestedName ?? shell.label ?? tildify(cwd);
6342
6398
  startup = this.deps.terminalWorkerSpawner.start({
6343
6399
  sessionId: pendingId,
6344
6400
  kind: "terminal",
6401
+ shell: shell.command,
6345
6402
  provider: "claude",
6346
6403
  cwd,
6347
6404
  name,
@@ -8852,7 +8909,8 @@ function guessMimeType(filePath) {
8852
8909
  return EXT_MIME_MAP[ext] ?? "application/octet-stream";
8853
8910
  }
8854
8911
  function resolveRemoteFilePath(rawPath, cwd) {
8855
- const expandedPath = rawPath === "~" || rawPath.startsWith("~/") ? resolve4(homedir7(), rawPath.slice(2)) : rawPath;
8912
+ const isHomePath = rawPath === "~" || rawPath.startsWith("~/") || process.platform === "win32" && rawPath.startsWith("~\\");
8913
+ const expandedPath = isHomePath ? resolve4(homedir7(), rawPath.slice(2)) : rawPath;
8856
8914
  const candidate = isAbsolute10(expandedPath) ? resolve4(expandedPath) : resolve4(cwd, expandedPath);
8857
8915
  return realpathSync2(candidate);
8858
8916
  }