blink 0.1.94 → 0.1.96
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/browser/control/index.d.cts +16 -16
- package/dist/browser/control/index.d.ts +16 -16
- package/dist/cli/{chat-DOA1hSTm.js → chat-DhLpNFHK.js} +1 -1
- package/dist/cli/chat-manager-PrBCvqS6.js +21 -0
- package/dist/cli/{connect-CkXADCME.js → connect-Cmwhnvok.js} +1 -1
- package/dist/cli/connect-DXaWCjUL.js +1 -0
- package/dist/cli/{dev-zx8HDBZT.js → dev-D14ZFqDd.js} +4 -43
- package/dist/cli/index.js +2 -2
- package/dist/cli/run-CzO7B7Wf.js +1 -0
- package/dist/cli/{server-BOROpzEt-CEGQkvjr.js → server-DyzkvVFu-D6nxD1-6.js} +7 -7
- package/dist/node/react/index.node.cjs +131 -164
- package/dist/node/react/index.node.d.cts +2 -36
- package/dist/node/react/index.node.d.ts +2 -36
- package/dist/node/react/index.node.js +32 -65
- package/package.json +1 -1
- package/dist/cli/connect-Qsug6N0M.js +0 -1
- package/dist/cli/disk-store-Cbn2SJoD.js +0 -21
- package/dist/cli/run-DPPy_-IS.js +0 -1
|
@@ -70,39 +70,6 @@ interface StoreEntry {
|
|
|
70
70
|
* It works with filesystem locks - so multiple processes can
|
|
71
71
|
* read and write to the store concurrently.
|
|
72
72
|
*/
|
|
73
|
-
interface Store<T extends object> {
|
|
74
|
-
get: (key: string) => Promise<T | undefined>;
|
|
75
|
-
list: () => Promise<StoreEntry[]>;
|
|
76
|
-
lock: (key: string, opts?: {
|
|
77
|
-
force?: boolean;
|
|
78
|
-
}) => Promise<LockedStoreEntry<T>>;
|
|
79
|
-
dispose: () => void;
|
|
80
|
-
}
|
|
81
|
-
/**
|
|
82
|
-
* createFileStore creates a simple file-based store with atomic read/write.
|
|
83
|
-
* All operations are protected by filesystem locks for multi-process safety.
|
|
84
|
-
*/
|
|
85
|
-
|
|
86
|
-
interface DiskStoreWatcher<T = any> {
|
|
87
|
-
onChange: (callback: (event: {
|
|
88
|
-
key: string;
|
|
89
|
-
value: T | undefined;
|
|
90
|
-
locked: boolean;
|
|
91
|
-
pid?: number;
|
|
92
|
-
}) => void) => () => void;
|
|
93
|
-
dispose: () => void;
|
|
94
|
-
}
|
|
95
|
-
/**
|
|
96
|
-
* createDiskStoreWatcher creates a watcher for the disk store.
|
|
97
|
-
* It watches the disk store for changes and emits events when the
|
|
98
|
-
* store changes.
|
|
99
|
-
*
|
|
100
|
-
* It also polls the store for changes in case the watcher misses
|
|
101
|
-
* any changes.
|
|
102
|
-
*
|
|
103
|
-
* It also debounces the changes to prevent too many events from
|
|
104
|
-
* being emitted.
|
|
105
|
-
*/
|
|
106
73
|
//#endregion
|
|
107
74
|
//#region src/local/types.d.ts
|
|
108
75
|
interface StoredChat {
|
|
@@ -144,8 +111,7 @@ interface ChatState {
|
|
|
144
111
|
}
|
|
145
112
|
interface ChatManagerOptions {
|
|
146
113
|
readonly chatId: string;
|
|
147
|
-
readonly
|
|
148
|
-
readonly watcher: DiskStoreWatcher<StoredChat>;
|
|
114
|
+
readonly chatsDirectory: string;
|
|
149
115
|
/**
|
|
150
116
|
* Optional function to filter messages before persisting them.
|
|
151
117
|
* Return undefined to skip persisting the message.
|
|
@@ -176,7 +142,7 @@ declare class ChatManager {
|
|
|
176
142
|
private abortController;
|
|
177
143
|
private isProcessingQueue;
|
|
178
144
|
private listeners;
|
|
179
|
-
private
|
|
145
|
+
private watcher;
|
|
180
146
|
private disposed;
|
|
181
147
|
constructor(options: ChatManagerOptions);
|
|
182
148
|
/**
|
|
@@ -70,39 +70,6 @@ interface StoreEntry {
|
|
|
70
70
|
* It works with filesystem locks - so multiple processes can
|
|
71
71
|
* read and write to the store concurrently.
|
|
72
72
|
*/
|
|
73
|
-
interface Store<T extends object> {
|
|
74
|
-
get: (key: string) => Promise<T | undefined>;
|
|
75
|
-
list: () => Promise<StoreEntry[]>;
|
|
76
|
-
lock: (key: string, opts?: {
|
|
77
|
-
force?: boolean;
|
|
78
|
-
}) => Promise<LockedStoreEntry<T>>;
|
|
79
|
-
dispose: () => void;
|
|
80
|
-
}
|
|
81
|
-
/**
|
|
82
|
-
* createFileStore creates a simple file-based store with atomic read/write.
|
|
83
|
-
* All operations are protected by filesystem locks for multi-process safety.
|
|
84
|
-
*/
|
|
85
|
-
|
|
86
|
-
interface DiskStoreWatcher<T = any> {
|
|
87
|
-
onChange: (callback: (event: {
|
|
88
|
-
key: string;
|
|
89
|
-
value: T | undefined;
|
|
90
|
-
locked: boolean;
|
|
91
|
-
pid?: number;
|
|
92
|
-
}) => void) => () => void;
|
|
93
|
-
dispose: () => void;
|
|
94
|
-
}
|
|
95
|
-
/**
|
|
96
|
-
* createDiskStoreWatcher creates a watcher for the disk store.
|
|
97
|
-
* It watches the disk store for changes and emits events when the
|
|
98
|
-
* store changes.
|
|
99
|
-
*
|
|
100
|
-
* It also polls the store for changes in case the watcher misses
|
|
101
|
-
* any changes.
|
|
102
|
-
*
|
|
103
|
-
* It also debounces the changes to prevent too many events from
|
|
104
|
-
* being emitted.
|
|
105
|
-
*/
|
|
106
73
|
//#endregion
|
|
107
74
|
//#region src/local/types.d.ts
|
|
108
75
|
interface StoredChat {
|
|
@@ -144,8 +111,7 @@ interface ChatState {
|
|
|
144
111
|
}
|
|
145
112
|
interface ChatManagerOptions {
|
|
146
113
|
readonly chatId: string;
|
|
147
|
-
readonly
|
|
148
|
-
readonly watcher: DiskStoreWatcher<StoredChat>;
|
|
114
|
+
readonly chatsDirectory: string;
|
|
149
115
|
/**
|
|
150
116
|
* Optional function to filter messages before persisting them.
|
|
151
117
|
* Return undefined to skip persisting the message.
|
|
@@ -176,7 +142,7 @@ declare class ChatManager {
|
|
|
176
142
|
private abortController;
|
|
177
143
|
private isProcessingQueue;
|
|
178
144
|
private listeners;
|
|
179
|
-
private
|
|
145
|
+
private watcher;
|
|
180
146
|
private disposed;
|
|
181
147
|
constructor(options: ChatManagerOptions);
|
|
182
148
|
/**
|