@nm156/opencode-notifier 0.3.1 → 0.4.0
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.
- package/README.md +49 -22
- package/dist/bell.d.ts +2 -0
- package/dist/command.d.ts +2 -0
- package/dist/config.d.ts +109 -0
- package/dist/delivery.d.ts +4 -0
- package/dist/focus.d.ts +34 -0
- package/dist/index.d.ts +13 -0
- package/dist/index.js +1705 -1783
- package/dist/notifier.d.ts +24 -0
- package/dist/notify.d.ts +19 -0
- package/dist/permission-dedupe.d.ts +3 -0
- package/dist/sound.d.ts +4 -0
- package/dist/tui.d.ts +7 -0
- package/dist/tui.js +2229 -0
- package/dist/v2.d.ts +14 -0
- package/package.json +23 -7
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import type { EventType } from "./config";
|
|
2
|
+
export declare const PERMISSION_PENDING_GRACE_MS = 300;
|
|
3
|
+
export interface SessionInfo {
|
|
4
|
+
isChild: boolean | null;
|
|
5
|
+
title: string | null;
|
|
6
|
+
agentName?: string | null;
|
|
7
|
+
}
|
|
8
|
+
export interface SessionAccess {
|
|
9
|
+
info(sessionID: string): Promise<SessionInfo>;
|
|
10
|
+
elapsed(sessionID: string, now: number): Promise<number | null>;
|
|
11
|
+
permissionPending(sessionID: string | null, permissionID: string): Promise<boolean>;
|
|
12
|
+
}
|
|
13
|
+
export type Delivery = "all" | "terminal" | "command";
|
|
14
|
+
export declare function createNotifier(access: SessionAccess, directory: string, delivery?: Delivery): {
|
|
15
|
+
notify: (event: EventType, sessionID?: string | null, title?: string | null, now?: number) => Promise<void>;
|
|
16
|
+
track: (sessionID: string, parentID?: string | null) => void;
|
|
17
|
+
created(id: string | null, parentID: string | null, title: string | null): Promise<void>;
|
|
18
|
+
busy(id: string): void;
|
|
19
|
+
idle(id: string | null, immediate?: boolean): Promise<void>;
|
|
20
|
+
failed(id: string | null, event: "error" | "user_cancelled"): Promise<void>;
|
|
21
|
+
permission(id: string | null, requestID: string | null, legacyHook?: boolean): Promise<void>;
|
|
22
|
+
userMessage(id: string | null, verifyParent?: boolean): Promise<void>;
|
|
23
|
+
dispose(): void;
|
|
24
|
+
};
|
package/dist/notify.d.ts
ADDED
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
export type NotificationAction = "focus" | "close";
|
|
2
|
+
export declare function formatGhosttyNotificationSequence(title: string, message: string, env?: NodeJS.ProcessEnv): string;
|
|
3
|
+
export declare function parseNotifySendOutputLine(line: string): {
|
|
4
|
+
type: "id";
|
|
5
|
+
id: number;
|
|
6
|
+
} | {
|
|
7
|
+
type: "action";
|
|
8
|
+
action: NotificationAction;
|
|
9
|
+
} | null;
|
|
10
|
+
export interface WindowsNotificationOptions {
|
|
11
|
+
title: string;
|
|
12
|
+
message: string;
|
|
13
|
+
timeout: number;
|
|
14
|
+
icon: string | undefined;
|
|
15
|
+
appName: string;
|
|
16
|
+
}
|
|
17
|
+
export declare function buildWindowsNotificationOptions(title: string, message: string, timeout: number, iconPath?: string, windowsAppID?: string): WindowsNotificationOptions;
|
|
18
|
+
export declare function buildOsascriptNotificationArgs(title: string, message: string): string[];
|
|
19
|
+
export declare function sendNotification(title: string, message: string, timeout: number, iconPath?: string, notificationSystem?: "osascript" | "node-notifier" | "ghostty", linuxGrouping?: boolean, onClick?: () => void, windowsAppID?: string): Promise<void>;
|
package/dist/sound.d.ts
ADDED
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import type { EventType } from "./config";
|
|
2
|
+
export declare function claimSoundSlot(event: EventType, now?: number): boolean;
|
|
3
|
+
export declare function resetSoundState(): void;
|
|
4
|
+
export declare function playSound(event: EventType, customPath: string | null, volume: number): Promise<void>;
|
package/dist/tui.d.ts
ADDED