Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 1 addition & 20 deletions shared/protocol.ts
Original file line number Diff line number Diff line change
Expand Up @@ -439,10 +439,7 @@ export interface TailscaleAccess {

export type { PortalStatus } from "./portal.ts";

/** GET /api/push: base64url VAPID public key, the `applicationServerKey` a browser subscribes with. */
export interface PushKey {
readonly public_key: string;
}
export type { PushKey, PushPayload } from "./push.ts";

/** One turn of a structured agent conversation (the chat lens source). */
export interface ConversationTurn {
Expand Down Expand Up @@ -1019,22 +1016,6 @@ export interface PromptAnswer {
draft?: { option_indices: number[]; custom_text: string };
}

/**
* The JSON inside every web push, decrypted by the device's service worker (public/sw.js)
* and shown as a notification. `pane_id` is null for the enable-confirmation push; `tag`
* is shared with the in-tab notification of the same pane, so one replaces the other.
*/
export interface PushPayload {
/** Absent in legacy payloads means local. */
machine_id?: string;
pane_id: string | null;
/** The workspace the pane was last seen in, so the tap of an ended pane opens that workspace. Absent when not known. */
workspace_id?: string;
title: string;
body: string;
tag: string;
}

/** WebSocket at /ws
*
* Client -> server frames: attach {pane_id, cols, rows} | detach {pane_id} | input {pane_id, text}
Expand Down
20 changes: 20 additions & 0 deletions shared/push.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
/** GET /api/push: base64url VAPID public key, the `applicationServerKey` a browser subscribes with. */
export interface PushKey {
readonly public_key: string;
}

/**
* The JSON inside every web push, decrypted by the device's service worker (public/sw.js)
* and shown as a notification. `pane_id` is null for the enable-confirmation push; `tag`
* is shared with the in-tab notification of the same pane, so one replaces the other.
*/
export interface PushPayload {
/** Absent in legacy payloads means local. */
machine_id?: string;
pane_id: string | null;
/** The workspace the pane was last seen in, so the tap of an ended pane opens that workspace. Absent when not known. */
workspace_id?: string;
title: string;
body: string;
tag: string;
}
Loading