@hyperdrive.bot/paseo-server 0.3.3 → 0.3.5

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.
@@ -111,7 +111,7 @@ function getProviderClientFactory(provider) {
111
111
  return factory;
112
112
  }
113
113
  function toRuntimeSettings(override) {
114
- if (!override?.command && !override?.env && !override?.disallowedTools) {
114
+ if (!override?.command && !override?.env && !override?.disallowedTools && !override?.transport) {
115
115
  return undefined;
116
116
  }
117
117
  return {
@@ -123,7 +123,14 @@ function toRuntimeSettings(override) {
123
123
  : undefined,
124
124
  env: override.env,
125
125
  disallowedTools: override.disallowedTools,
126
- transport: "sdk",
126
+ // Carry the configured transport through, and leave it undefined when the
127
+ // override does not set one. This field is the `override` side of
128
+ // mergeRuntimeSettings' `override?.transport ?? base?.transport ?? "auto"`,
129
+ // so hardcoding a value here silently wins over both the inherited base and
130
+ // the documented "auto" default: any provider that merely set `env` (every
131
+ // proxy-backed provider that extends claude) was pinned to "sdk" and could
132
+ // neither inherit a base opt-in nor honour its own configured transport.
133
+ transport: override.transport,
127
134
  };
128
135
  }
129
136
  function mergeEnv(baseEnv, overrideEnv) {
@@ -81,7 +81,9 @@ function extractAgentProviderSettings(providerOverrides) {
81
81
  }
82
82
  const runtimeSettings = Object.entries(providerOverrides).flatMap(([providerId, provider]) => {
83
83
  const parsedProviderId = AgentProviderSchema.safeParse(providerId);
84
- if (!parsedProviderId.success || (!provider.command && !provider.env)) {
84
+ // transport counts as a reason to keep the entry: an override that only sets
85
+ // transport (no command, no env) is the normal way to opt a provider into PTY.
86
+ if (!parsedProviderId.success || (!provider.command && !provider.env && !provider.transport)) {
85
87
  return [];
86
88
  }
87
89
  return [
@@ -95,6 +97,7 @@ function extractAgentProviderSettings(providerOverrides) {
95
97
  }
96
98
  : undefined,
97
99
  env: provider.env,
100
+ transport: provider.transport,
98
101
  },
99
102
  ],
100
103
  ];
@@ -236,6 +236,11 @@ export declare const PersistedConfigSchema: z.ZodObject<{
236
236
  disallowedTools: z.ZodOptional<z.ZodArray<z.ZodString>>;
237
237
  enabled: z.ZodOptional<z.ZodBoolean>;
238
238
  order: z.ZodOptional<z.ZodNumber>;
239
+ transport: z.ZodOptional<z.ZodEnum<{
240
+ auto: "auto";
241
+ sdk: "sdk";
242
+ pty: "pty";
243
+ }>>;
239
244
  }, z.core.$strip>>>>;
240
245
  metadataGeneration: z.ZodOptional<z.ZodObject<{
241
246
  providers: z.ZodOptional<z.ZodArray<z.ZodObject<{
@@ -1635,6 +1635,20 @@ export class Session {
1635
1635
  return this.handleFileUploadBeginRequest(msg);
1636
1636
  case "files.upload.complete.request":
1637
1637
  return this.handleFileUploadCompleteRequest(msg);
1638
+ case "files.upload.chunk": {
1639
+ // Text transport for chunk bytes (base64 in a JSON message) instead of a binary
1640
+ // FileChunk frame: binary WS frames are dropped by some proxies (the hyperdrive proxy
1641
+ // path), which stalls the client's windowed sender with zero acks. Decode and feed the
1642
+ // decoded bytes through the EXACT SAME queue as the binary path, so write ordering,
1643
+ // backpressure, the per-chunk ack, and the over-cap abort are all identical. The daemon
1644
+ // assigns its own chunkIndex in the ack (msg.payload.chunkIndex is informational only).
1645
+ this.handleFileUploadFrame({
1646
+ opcode: FileTransferOpcode.FileChunk,
1647
+ requestId: msg.payload.requestId,
1648
+ payload: Buffer.from(msg.payload.data, "base64"),
1649
+ });
1650
+ return undefined;
1651
+ }
1638
1652
  case "files.upload.error":
1639
1653
  // Client already knows about its own abort — clean up without echoing an error back.
1640
1654
  void this.abortFileUpload(msg.payload.requestId, null);