@getpaseo/protocol 0.1.91-beta.2 → 0.1.92

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.
@@ -0,0 +1,11 @@
1
+ import { type FileTransferFrame } from "./file-transfer.js";
2
+ import { type TerminalStreamFrame } from "./terminal.js";
3
+ export type BinaryFrame = {
4
+ kind: "terminal";
5
+ frame: TerminalStreamFrame;
6
+ } | {
7
+ kind: "file_transfer";
8
+ frame: FileTransferFrame;
9
+ };
10
+ export declare function decodeBinaryFrame(bytes: Uint8Array): BinaryFrame | null;
11
+ //# sourceMappingURL=demux.d.ts.map
@@ -0,0 +1,23 @@
1
+ import { decodeFileTransferFrame, FileTransferOpcode, } from "./file-transfer.js";
2
+ import { decodeTerminalStreamFrame, TerminalStreamOpcode, } from "./terminal.js";
3
+ export function decodeBinaryFrame(bytes) {
4
+ switch (bytes[0]) {
5
+ case TerminalStreamOpcode.Output:
6
+ case TerminalStreamOpcode.Input:
7
+ case TerminalStreamOpcode.Resize:
8
+ case TerminalStreamOpcode.Snapshot:
9
+ case TerminalStreamOpcode.Restore: {
10
+ const frame = decodeTerminalStreamFrame(bytes);
11
+ return frame ? { kind: "terminal", frame } : null;
12
+ }
13
+ case FileTransferOpcode.FileBegin:
14
+ case FileTransferOpcode.FileChunk:
15
+ case FileTransferOpcode.FileEnd: {
16
+ const frame = decodeFileTransferFrame(bytes);
17
+ return frame ? { kind: "file_transfer", frame } : null;
18
+ }
19
+ default:
20
+ return null;
21
+ }
22
+ }
23
+ //# sourceMappingURL=demux.js.map
@@ -10,16 +10,19 @@ export declare const FileBeginMetadataSchema: z.ZodObject<{
10
10
  size: z.ZodNumber;
11
11
  encoding: z.ZodEnum<["utf-8", "binary"]>;
12
12
  modifiedAt: z.ZodString;
13
+ fileName: z.ZodOptional<z.ZodString>;
13
14
  }, "strip", z.ZodTypeAny, {
14
15
  size: number;
15
16
  modifiedAt: string;
16
17
  encoding: "binary" | "utf-8";
17
18
  mime: string;
19
+ fileName?: string | undefined;
18
20
  }, {
19
21
  size: number;
20
22
  modifiedAt: string;
21
23
  encoding: "binary" | "utf-8";
22
24
  mime: string;
25
+ fileName?: string | undefined;
23
26
  }>;
24
27
  export interface FileBegin {
25
28
  opcode: typeof FileTransferOpcode.FileBegin;
@@ -10,6 +10,7 @@ export const FileBeginMetadataSchema = z.object({
10
10
  size: z.number().int().nonnegative(),
11
11
  encoding: z.enum(["utf-8", "binary"]),
12
12
  modifiedAt: z.string(),
13
+ fileName: z.string().optional(),
13
14
  });
14
15
  export function encodeFileTransferFrame(input) {
15
16
  const requestId = encodeRequestId(input.requestId);
@@ -1,3 +1,4 @@
1
+ export * from "./demux.js";
1
2
  export * from "./file-transfer.js";
2
3
  export * from "./terminal.js";
3
4
  //# sourceMappingURL=index.d.ts.map
@@ -1,3 +1,4 @@
1
+ export * from "./demux.js";
1
2
  export * from "./file-transfer.js";
2
3
  export * from "./terminal.js";
3
4
  //# sourceMappingURL=index.js.map