import { x as SoundId } from "./sounds-X-Wf5v3V.mjs"; import { z } from "zod"; //#region src/terminal-control.d.ts type TerminalProgressState = 'clear' | 'set' | 'error' | 'indeterminate' | 'warning'; type TerminalPromptState = 'prompt-start' | 'prompt-end' | 'command-start' | 'command-output' | 'command-end'; type TerminalNotificationProtocol = 'osc9' | 'osc777'; type TerminalTitleTarget = 'icon' | 'window' | 'both'; type TerminalControlEvent = { type: 'bell'; } | { type: 'notification'; protocol: TerminalNotificationProtocol; title?: string; body: string; } | { type: 'title'; title: string; target: TerminalTitleTarget; } | { type: 'cwd'; cwd: string; } | { type: 'progress'; state: TerminalProgressState; value: number | null; } | { type: 'prompt-state'; state: TerminalPromptState; exitCode?: number; }; interface TerminalControlParseResult { output: string; events: TerminalControlEvent[]; } /** * Stateful parser for terminal control escape sequences. * * It extracts terminal-local control metadata separately from notification * intents so progress, title, cwd, and prompt-state protocols cannot leak into * the web notification platform. */ declare class TerminalControlParser { private pending; push(chunk: string): TerminalControlParseResult; } declare function terminalNotificationEventToPublishInput(input: { event: Extract; sessionId: string; terminalTitle?: string; }): NotificationPublishInput; //#endregion //#region src/notifications.d.ts declare const NOTIFICATION_SOUND_VALUES: readonly ["silent", "soft", "clear", "pulse"]; declare const NotificationSoundSchema: z.ZodEffects, z.ZodEnum<["builtin:Basso", "builtin:Blow", "builtin:Bottle", "builtin:Frog", "builtin:Funk", "builtin:Glass", "builtin:Hero", "builtin:Morse", "builtin:Ping", "builtin:Pop", "builtin:Purr", "builtin:Sosumi", "builtin:Submarine", "builtin:Tink"]>, z.ZodType<`custom:${string}`, z.ZodTypeDef, `custom:${string}`>]>, "silent" | "builtin:Basso" | "builtin:Blow" | "builtin:Bottle" | "builtin:Frog" | "builtin:Funk" | "builtin:Glass" | "builtin:Hero" | "builtin:Morse" | "builtin:Ping" | "builtin:Pop" | "builtin:Purr" | "builtin:Sosumi" | "builtin:Submarine" | "builtin:Tink" | `custom:${string}`, unknown>; type NotificationSound = SoundId; declare const NOTIFICATION_SOUND_OPTIONS: readonly { id: NotificationSound; label: string; }[]; declare const NotificationSettingsSchema: z.ZodObject<{ sound: z.ZodDefault, z.ZodEnum<["builtin:Basso", "builtin:Blow", "builtin:Bottle", "builtin:Frog", "builtin:Funk", "builtin:Glass", "builtin:Hero", "builtin:Morse", "builtin:Ping", "builtin:Pop", "builtin:Purr", "builtin:Sosumi", "builtin:Submarine", "builtin:Tink"]>, z.ZodType<`custom:${string}`, z.ZodTypeDef, `custom:${string}`>]>, "silent" | "builtin:Basso" | "builtin:Blow" | "builtin:Bottle" | "builtin:Frog" | "builtin:Funk" | "builtin:Glass" | "builtin:Hero" | "builtin:Morse" | "builtin:Ping" | "builtin:Pop" | "builtin:Purr" | "builtin:Sosumi" | "builtin:Submarine" | "builtin:Tink" | `custom:${string}`, unknown>>; volume: z.ZodDefault; systemNotificationsEnabled: z.ZodDefault; }, "strip", z.ZodTypeAny, { sound: "silent" | "builtin:Basso" | "builtin:Blow" | "builtin:Bottle" | "builtin:Frog" | "builtin:Funk" | "builtin:Glass" | "builtin:Hero" | "builtin:Morse" | "builtin:Ping" | "builtin:Pop" | "builtin:Purr" | "builtin:Sosumi" | "builtin:Submarine" | "builtin:Tink" | `custom:${string}`; volume: number; systemNotificationsEnabled: boolean; }, { sound?: unknown; volume?: number | undefined; systemNotificationsEnabled?: boolean | undefined; }>; type NotificationSettings = z.infer; declare const NotificationSourceSchema: z.ZodDiscriminatedUnion<"type", [z.ZodObject<{ type: z.ZodLiteral<"terminal">; sessionId: z.ZodString; title: z.ZodOptional; }, "strip", z.ZodTypeAny, { type: "terminal"; sessionId: string; title?: string | undefined; }, { type: "terminal"; sessionId: string; title?: string | undefined; }>, z.ZodObject<{ type: z.ZodLiteral<"openspec-change">; changeId: z.ZodString; title: z.ZodOptional; }, "strip", z.ZodTypeAny, { type: "openspec-change"; changeId: string; title?: string | undefined; }, { type: "openspec-change"; changeId: string; title?: string | undefined; }>, z.ZodObject<{ type: z.ZodLiteral<"hooks-plugin">; pluginId: z.ZodString; title: z.ZodOptional; }, "strip", z.ZodTypeAny, { type: "hooks-plugin"; pluginId: string; title?: string | undefined; }, { type: "hooks-plugin"; pluginId: string; title?: string | undefined; }>, z.ZodObject<{ type: z.ZodLiteral<"root-context">; }, "strip", z.ZodTypeAny, { type: "root-context"; }, { type: "root-context"; }>, z.ZodObject<{ type: z.ZodLiteral<"custom">; groupId: z.ZodString; title: z.ZodOptional; }, "strip", z.ZodTypeAny, { type: "custom"; groupId: string; title?: string | undefined; }, { type: "custom"; groupId: string; title?: string | undefined; }>]>; type NotificationSource = z.infer; declare const NotificationActionSchema: z.ZodDiscriminatedUnion<"type", [z.ZodObject<{ type: z.ZodLiteral<"terminal.focus">; label: z.ZodDefault; target: z.ZodObject<{ sessionId: z.ZodString; }, "strip", z.ZodTypeAny, { sessionId: string; }, { sessionId: string; }>; }, "strip", z.ZodTypeAny, { type: "terminal.focus"; target: { sessionId: string; }; label: string; }, { type: "terminal.focus"; target: { sessionId: string; }; label?: string | undefined; }>, z.ZodObject<{ type: z.ZodLiteral<"href.open">; label: z.ZodDefault; target: z.ZodObject<{ href: z.ZodString; }, "strip", z.ZodTypeAny, { href: string; }, { href: string; }>; }, "strip", z.ZodTypeAny, { type: "href.open"; target: { href: string; }; label: string; }, { type: "href.open"; target: { href: string; }; label?: string | undefined; }>]>; type NotificationAction = z.infer; declare const NotificationGroupKeySchema: z.ZodString; type NotificationGroupKey = z.infer; declare const NotificationPublishInputSchema: z.ZodObject<{ title: z.ZodString; body: z.ZodDefault; source: z.ZodDiscriminatedUnion<"type", [z.ZodObject<{ type: z.ZodLiteral<"terminal">; sessionId: z.ZodString; title: z.ZodOptional; }, "strip", z.ZodTypeAny, { type: "terminal"; sessionId: string; title?: string | undefined; }, { type: "terminal"; sessionId: string; title?: string | undefined; }>, z.ZodObject<{ type: z.ZodLiteral<"openspec-change">; changeId: z.ZodString; title: z.ZodOptional; }, "strip", z.ZodTypeAny, { type: "openspec-change"; changeId: string; title?: string | undefined; }, { type: "openspec-change"; changeId: string; title?: string | undefined; }>, z.ZodObject<{ type: z.ZodLiteral<"hooks-plugin">; pluginId: z.ZodString; title: z.ZodOptional; }, "strip", z.ZodTypeAny, { type: "hooks-plugin"; pluginId: string; title?: string | undefined; }, { type: "hooks-plugin"; pluginId: string; title?: string | undefined; }>, z.ZodObject<{ type: z.ZodLiteral<"root-context">; }, "strip", z.ZodTypeAny, { type: "root-context"; }, { type: "root-context"; }>, z.ZodObject<{ type: z.ZodLiteral<"custom">; groupId: z.ZodString; title: z.ZodOptional; }, "strip", z.ZodTypeAny, { type: "custom"; groupId: string; title?: string | undefined; }, { type: "custom"; groupId: string; title?: string | undefined; }>]>; actions: z.ZodDefault; label: z.ZodDefault; target: z.ZodObject<{ sessionId: z.ZodString; }, "strip", z.ZodTypeAny, { sessionId: string; }, { sessionId: string; }>; }, "strip", z.ZodTypeAny, { type: "terminal.focus"; target: { sessionId: string; }; label: string; }, { type: "terminal.focus"; target: { sessionId: string; }; label?: string | undefined; }>, z.ZodObject<{ type: z.ZodLiteral<"href.open">; label: z.ZodDefault; target: z.ZodObject<{ href: z.ZodString; }, "strip", z.ZodTypeAny, { href: string; }, { href: string; }>; }, "strip", z.ZodTypeAny, { type: "href.open"; target: { href: string; }; label: string; }, { type: "href.open"; target: { href: string; }; label?: string | undefined; }>]>, "many">>; level: z.ZodDefault>; createdAt: z.ZodOptional; }, "strip", z.ZodTypeAny, { source: { type: "terminal"; sessionId: string; title?: string | undefined; } | { type: "openspec-change"; changeId: string; title?: string | undefined; } | { type: "hooks-plugin"; pluginId: string; title?: string | undefined; } | { type: "root-context"; } | { type: "custom"; groupId: string; title?: string | undefined; }; title: string; body: string; actions: ({ type: "terminal.focus"; target: { sessionId: string; }; label: string; } | { type: "href.open"; target: { href: string; }; label: string; })[]; level: "error" | "success" | "warning" | "info"; createdAt?: number | undefined; }, { source: { type: "terminal"; sessionId: string; title?: string | undefined; } | { type: "openspec-change"; changeId: string; title?: string | undefined; } | { type: "hooks-plugin"; pluginId: string; title?: string | undefined; } | { type: "root-context"; } | { type: "custom"; groupId: string; title?: string | undefined; }; title: string; createdAt?: number | undefined; body?: string | undefined; actions?: ({ type: "terminal.focus"; target: { sessionId: string; }; label?: string | undefined; } | { type: "href.open"; target: { href: string; }; label?: string | undefined; })[] | undefined; level?: "error" | "success" | "warning" | "info" | undefined; }>; type NotificationPublishInput = z.infer; declare const NotificationRecordSchema: z.ZodObject<{ title: z.ZodString; body: z.ZodDefault; source: z.ZodDiscriminatedUnion<"type", [z.ZodObject<{ type: z.ZodLiteral<"terminal">; sessionId: z.ZodString; title: z.ZodOptional; }, "strip", z.ZodTypeAny, { type: "terminal"; sessionId: string; title?: string | undefined; }, { type: "terminal"; sessionId: string; title?: string | undefined; }>, z.ZodObject<{ type: z.ZodLiteral<"openspec-change">; changeId: z.ZodString; title: z.ZodOptional; }, "strip", z.ZodTypeAny, { type: "openspec-change"; changeId: string; title?: string | undefined; }, { type: "openspec-change"; changeId: string; title?: string | undefined; }>, z.ZodObject<{ type: z.ZodLiteral<"hooks-plugin">; pluginId: z.ZodString; title: z.ZodOptional; }, "strip", z.ZodTypeAny, { type: "hooks-plugin"; pluginId: string; title?: string | undefined; }, { type: "hooks-plugin"; pluginId: string; title?: string | undefined; }>, z.ZodObject<{ type: z.ZodLiteral<"root-context">; }, "strip", z.ZodTypeAny, { type: "root-context"; }, { type: "root-context"; }>, z.ZodObject<{ type: z.ZodLiteral<"custom">; groupId: z.ZodString; title: z.ZodOptional; }, "strip", z.ZodTypeAny, { type: "custom"; groupId: string; title?: string | undefined; }, { type: "custom"; groupId: string; title?: string | undefined; }>]>; actions: z.ZodDefault; label: z.ZodDefault; target: z.ZodObject<{ sessionId: z.ZodString; }, "strip", z.ZodTypeAny, { sessionId: string; }, { sessionId: string; }>; }, "strip", z.ZodTypeAny, { type: "terminal.focus"; target: { sessionId: string; }; label: string; }, { type: "terminal.focus"; target: { sessionId: string; }; label?: string | undefined; }>, z.ZodObject<{ type: z.ZodLiteral<"href.open">; label: z.ZodDefault; target: z.ZodObject<{ href: z.ZodString; }, "strip", z.ZodTypeAny, { href: string; }, { href: string; }>; }, "strip", z.ZodTypeAny, { type: "href.open"; target: { href: string; }; label: string; }, { type: "href.open"; target: { href: string; }; label?: string | undefined; }>]>, "many">>; level: z.ZodDefault>; } & { id: z.ZodString; createdAt: z.ZodNumber; groupKey: z.ZodString; }, "strip", z.ZodTypeAny, { id: string; createdAt: number; source: { type: "terminal"; sessionId: string; title?: string | undefined; } | { type: "openspec-change"; changeId: string; title?: string | undefined; } | { type: "hooks-plugin"; pluginId: string; title?: string | undefined; } | { type: "root-context"; } | { type: "custom"; groupId: string; title?: string | undefined; }; title: string; body: string; actions: ({ type: "terminal.focus"; target: { sessionId: string; }; label: string; } | { type: "href.open"; target: { href: string; }; label: string; })[]; level: "error" | "success" | "warning" | "info"; groupKey: string; }, { id: string; createdAt: number; source: { type: "terminal"; sessionId: string; title?: string | undefined; } | { type: "openspec-change"; changeId: string; title?: string | undefined; } | { type: "hooks-plugin"; pluginId: string; title?: string | undefined; } | { type: "root-context"; } | { type: "custom"; groupId: string; title?: string | undefined; }; title: string; groupKey: string; body?: string | undefined; actions?: ({ type: "terminal.focus"; target: { sessionId: string; }; label?: string | undefined; } | { type: "href.open"; target: { href: string; }; label?: string | undefined; })[] | undefined; level?: "error" | "success" | "warning" | "info" | undefined; }>; type NotificationRecord = z.infer; interface NotificationAggregate { key: string; notifications: NotificationRecord[]; latest: NotificationRecord; count: number; } interface NotificationGroup { key: NotificationGroupKey; label: string; source: NotificationSource; notifications: NotificationRecord[]; aggregates: NotificationAggregate[]; latest: NotificationRecord; unreadCount: number; } declare function getNotificationGroupKey(notification: { source: NotificationSource; }): NotificationGroupKey; declare function getNotificationGroupLabel(source: NotificationSource): string; declare function getNotificationAggregateKey(notification: NotificationRecord): string; declare function aggregateNotifications(notifications: readonly NotificationRecord[]): NotificationAggregate[]; declare function groupNotifications(notifications: readonly NotificationRecord[]): NotificationGroup[]; type TerminalNotificationEvent = TerminalControlEvent; type TerminalNotificationParseResult = TerminalControlParseResult; declare const TerminalNotificationParser: typeof TerminalControlParser; //#endregion export { TerminalNotificationProtocol as A, getNotificationAggregateKey as C, TerminalControlEvent as D, groupNotifications as E, TerminalPromptState as M, TerminalTitleTarget as N, TerminalControlParseResult as O, terminalNotificationEventToPublishInput as P, aggregateNotifications as S, getNotificationGroupLabel as T, NotificationSource as _, NotificationAggregate as a, TerminalNotificationParseResult as b, NotificationGroupKeySchema as c, NotificationRecord as d, NotificationRecordSchema as f, NotificationSoundSchema as g, NotificationSound as h, NotificationActionSchema as i, TerminalProgressState as j, TerminalControlParser as k, NotificationPublishInput as l, NotificationSettingsSchema as m, NOTIFICATION_SOUND_VALUES as n, NotificationGroup as o, NotificationSettings as p, NotificationAction as r, NotificationGroupKey as s, NOTIFICATION_SOUND_OPTIONS as t, NotificationPublishInputSchema as u, NotificationSourceSchema as v, getNotificationGroupKey as w, TerminalNotificationParser as x, TerminalNotificationEvent as y };