@wherever-dev/client 0.2.1

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/src/index.ts ADDED
@@ -0,0 +1,2 @@
1
+ export * from "./types.js";
2
+ export * from "./client.js";
package/src/types.ts ADDED
@@ -0,0 +1,46 @@
1
+ export interface ChatMessage {
2
+ id: string;
3
+ role: 'user' | 'assistant' | 'thinking' | 'tool';
4
+ content: string;
5
+ timestamp: number;
6
+ isStreaming?: boolean;
7
+ sessionId?: string;
8
+ toolName?: string;
9
+ toolArgs?: string;
10
+ toolOutput?: string;
11
+ isError?: boolean;
12
+ }
13
+
14
+ export interface ConflictInfo {
15
+ targetSessionId: string;
16
+ conflictingSessionId: string;
17
+ conflictingCwd: string;
18
+ }
19
+
20
+ export interface WhereverState {
21
+ connected: boolean;
22
+ connecting: boolean;
23
+ creatingSession: boolean;
24
+ error: string | null;
25
+ session: string | null;
26
+ sessionId: string | null;
27
+ isStreaming: boolean;
28
+ messages: ChatMessage[];
29
+ clientId: string | null;
30
+ conflict: ConflictInfo | null;
31
+ isInterrupted: boolean;
32
+ sessionError: string | null;
33
+ readOnly: boolean;
34
+ activeSessionFile: string | null;
35
+ activeCwd: string | null;
36
+ activeModel: string | null;
37
+ hideThinking: boolean;
38
+ hideTools: boolean;
39
+ // Tail-first history pagination. `historyTotalCount` is the total number of
40
+ // history messages on the server; `historyOffset` is the index of the first
41
+ // message currently loaded in `messages`. When `historyOffset > 0`, older
42
+ // history can be fetched via `loadMoreHistory()`.
43
+ historyTotalCount: number;
44
+ historyOffset: number;
45
+ loadingMoreHistory: boolean;
46
+ }
package/tsconfig.json ADDED
@@ -0,0 +1,16 @@
1
+ {
2
+ "compilerOptions": {
3
+ "module": "NodeNext",
4
+ "target": "ES2022",
5
+ "moduleResolution": "NodeNext",
6
+ "lib": ["ES2022", "DOM"],
7
+ "strict": true,
8
+ "declaration": true,
9
+ "sourceMap": true,
10
+ "rootDir": "src",
11
+ "outDir": "dist",
12
+ "skipLibCheck": true,
13
+ "forceConsistentCasingInFileNames": true
14
+ },
15
+ "include": ["src/**/*"]
16
+ }