@aitty/protocol
v0.6.5
Published
Shared protocol types and helpers for aitty.
Maintainers
Readme
@aitty/protocol
Shared protocol types and helpers for aitty browser-terminal sessions.
This package has no Node runtime dependency. Use it when a host, browser adapter, or integration needs to share status, control-frame, theme, or portless session-path semantics without depending on the full server or browser runtime.
Install
npm i @aitty/protocolUsage
import {
createAittyPortlessIdentity,
createHelloControlFrame,
parseAittyControlFrame
} from "@aitty/protocol";
const identity = createAittyPortlessIdentity({
project: "my-app",
label: "codex",
token: "local-session-token"
});
console.log(identity.path);
const frame = parseAittyControlFrame(createHelloControlFrame({
cols: 120,
rows: 32,
replay: ""
}));Main Exports
- Portless helpers:
createAittyPortlessIdentity(),normalizePortlessSegment(),normalizeAittyPortlessPathname(). - Control frames:
createHelloControlFrame(),createResizeControlFrame(),createExitControlFrame(),createThemeControlFrame(),parseAittyControlFrame(). - Status types:
AittyTerminalStatusSnapshot, connection states, output states, and session presentation states. - Theme helpers:
normalizeTheme(),readThemeSource(),subscribeThemeSource(). - Session metadata helpers:
createSessionInfoBody()andAittySessionInfo.
More Documentation
License
Apache-2.0
