opencode-zellij 0.0.9 → 0.0.11

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/dist/index.d.mts CHANGED
@@ -1,3 +1,4 @@
1
+ import { z } from "zod";
1
2
  import { Plugin } from "@opencode-ai/plugin";
2
3
 
3
4
  //#region src/auto-update.d.ts
@@ -31,6 +32,110 @@ type UpdateResult = {
31
32
  };
32
33
  declare function checkAndUpdate(options: CheckOptions): Promise<UpdateResult>;
33
34
  //#endregion
35
+ //#region src/config.d.ts
36
+ declare const completionNotificationModeSchema: z.ZodEnum<{
37
+ off: "off";
38
+ queue: "queue";
39
+ toast: "toast";
40
+ "queue+toast": "queue+toast";
41
+ prompt: "prompt";
42
+ }>;
43
+ interface CompletionNotificationPromptConfig {
44
+ requireIdle: boolean;
45
+ cooldownMs: number;
46
+ maxAttempts: number;
47
+ }
48
+ interface CompletionNotificationConfig {
49
+ mode: CompletionNotificationMode;
50
+ prompt: CompletionNotificationPromptConfig;
51
+ }
52
+ type CompletionNotificationMode = z.infer<typeof completionNotificationModeSchema>;
53
+ //#endregion
54
+ //#region src/pty/session.d.ts
55
+ type SessionStatus = 'running' | 'exited' | 'killed' | 'unknown' | 'terminal';
56
+ type SessionTerminalReason = 'pane_closed' | 'exit_marker' | 'read_cleanup' | 'subscriber_exit' | 'subscriber_error' | 'session_deleted';
57
+ interface SessionTombstone {
58
+ reason: SessionTerminalReason;
59
+ terminalAt: string;
60
+ tail: string[];
61
+ paneClosedAt: string | null;
62
+ notificationSentAt: string | null;
63
+ }
64
+ interface PtySession {
65
+ id: string;
66
+ openCodeSessionId: string | null;
67
+ paneId: string;
68
+ title: string;
69
+ command: string;
70
+ args: string[];
71
+ cwd: string;
72
+ status: SessionStatus;
73
+ lineCount: number;
74
+ createdAt: string;
75
+ updatedAt: string;
76
+ allowAgentInput: boolean;
77
+ humanInputOnly: boolean;
78
+ exitCode: number | null;
79
+ exitedAt: string | null;
80
+ exitCodeToken: string | null;
81
+ tombstone?: SessionTombstone | null;
82
+ }
83
+ //#endregion
84
+ //#region src/zellij/completion-notifications.d.ts
85
+ interface CompletionNotificationToastClient {
86
+ tui?: {
87
+ showToast?: (options: {
88
+ body: {
89
+ title: string;
90
+ message: string;
91
+ variant: 'success' | 'error';
92
+ duration: number;
93
+ };
94
+ }) => Promise<unknown>;
95
+ };
96
+ }
97
+ interface CompletionNotificationPromptClient {
98
+ session?: {
99
+ status?: (options: {
100
+ query: {
101
+ directory: string;
102
+ };
103
+ }) => Promise<unknown>;
104
+ prompt?: (request: CompletionPromptRequest) => Promise<unknown>;
105
+ promptAsync?: (request: CompletionPromptRequest) => Promise<unknown>;
106
+ };
107
+ }
108
+ interface CompletionNotificationClient extends CompletionNotificationToastClient, CompletionNotificationPromptClient {}
109
+ interface CompletionNotificationContext {
110
+ client: CompletionNotificationClient;
111
+ workspaceRoot: string;
112
+ config: CompletionNotificationConfig;
113
+ markSent: (sessionId: string) => void;
114
+ }
115
+ interface CompletionNotificationManager {
116
+ handleSessionTerminal: (event: SubscriberTerminalEvent) => Promise<void>;
117
+ injectQueuedChatMessage: (input: unknown) => unknown;
118
+ clearSession: (sessionId: string) => void;
119
+ clearAll: () => void;
120
+ dispose: () => void;
121
+ }
122
+ interface SubscriberTerminalEvent {
123
+ sessionId: string;
124
+ reason: SessionTerminalReason;
125
+ session: PtySession;
126
+ }
127
+ interface CompletionPromptRequest {
128
+ path: {
129
+ id: string;
130
+ };
131
+ body: {
132
+ parts: Array<{
133
+ type: 'text';
134
+ text: string;
135
+ }>;
136
+ };
137
+ }
138
+ //#endregion
34
139
  //#region src/plugin.d.ts
35
140
  interface ToastClient {
36
141
  tui: {
@@ -49,6 +154,7 @@ declare function startAutoUpdateCheck(client: ToastClient, importMetaUrl: string
49
154
  interface ZellijPtyPluginDependencies {
50
155
  importMetaUrl?: string | undefined;
51
156
  startAutoUpdateCheck?: typeof startAutoUpdateCheck | undefined;
157
+ createCompletionNotifications?: (context: CompletionNotificationContext) => CompletionNotificationManager | undefined;
52
158
  }
53
159
  declare function createZellijPtyPlugin(dependencies?: ZellijPtyPluginDependencies): Plugin;
54
160
  declare const ZellijPtyPlugin: Plugin;