mirror of
https://github.com/getpaseo/paseo.git
synced 2026-07-29 12:01:31 +00:00
* Extract client SDK package * Polish SDK client identity defaults * Build client before dependent CI jobs * Restore daemon client server export * Extract protocol and client SDK packages * Fix provider override schema validation * Fix app test daemon client imports * Simplify workspace build targets * Fix CLI test server build bootstrap * Run SDK package tests in CI * Fix rebase package split drift * Restore lockfile registry metadata * Update SDK config test for prompt default * Move terminal stream router test to client package * Fix rebase drift for protocol imports * Fix SDK agent capability fixture * Restore legacy server client exports * Fix server export compatibility test * Advertise custom mode icon client capability * Remove server daemon-client exports * Format rebased mode control import * Fix rebase drift for protocol imports Files added by upstream PRs (#893, #1147, #1154) referenced the pre-split shared/ paths that this branch moves into @getpaseo/protocol. Redirect those imports to the protocol package so typecheck stays green after the rebase.
37 lines
1.3 KiB
TypeScript
37 lines
1.3 KiB
TypeScript
import { describe, expect, it } from "vitest";
|
|
|
|
import * as terminalBinaryFrames from "./binary-frames/index.js";
|
|
import * as legacyTerminalStreamProtocol from "./terminal-stream-protocol.js";
|
|
|
|
describe("terminal stream protocol", () => {
|
|
it("keeps the old import path compatible with terminal binary frames", () => {
|
|
expect(legacyTerminalStreamProtocol.TerminalStreamOpcode).toBe(
|
|
terminalBinaryFrames.TerminalStreamOpcode,
|
|
);
|
|
expect(legacyTerminalStreamProtocol.encodeTerminalStreamFrame).toBe(
|
|
terminalBinaryFrames.encodeTerminalStreamFrame,
|
|
);
|
|
expect(legacyTerminalStreamProtocol.decodeTerminalStreamFrame).toBe(
|
|
terminalBinaryFrames.decodeTerminalStreamFrame,
|
|
);
|
|
|
|
const payload = new TextEncoder().encode("hello");
|
|
const encoded = legacyTerminalStreamProtocol.encodeTerminalStreamFrame({
|
|
opcode: legacyTerminalStreamProtocol.TerminalStreamOpcode.Output,
|
|
slot: 7,
|
|
payload,
|
|
});
|
|
|
|
expect(encoded[0]).toBe(terminalBinaryFrames.TerminalStreamOpcode.Output);
|
|
expect(encoded[1]).toBe(7);
|
|
expect(Array.from(encoded.subarray(2))).toEqual(Array.from(payload));
|
|
|
|
const decoded = terminalBinaryFrames.decodeTerminalStreamFrame(encoded);
|
|
expect(decoded).toEqual({
|
|
opcode: legacyTerminalStreamProtocol.TerminalStreamOpcode.Output,
|
|
slot: 7,
|
|
payload,
|
|
});
|
|
});
|
|
});
|