clearclaw 0.2.0 → 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/dist/types.d.ts CHANGED
@@ -7,8 +7,13 @@ export interface Channel {
7
7
  connect(): Promise<void>;
8
8
  disconnect(): Promise<void>;
9
9
  ownsId(chatId: string): boolean;
10
- sendMessage(chatId: string, text: string, opts?: SendMessageOpts): Promise<void>;
11
- sendInteractive(chatId: string, text: string, buttons: Button[]): Promise<ButtonResponse>;
10
+ sendMessage(chatId: string, text: string, opts?: SendMessageOpts): Promise<string[]>;
11
+ sendInteractive(chatId: string, text: string, buttons: Button[][]): Promise<ButtonResponse>;
12
+ editMessage(chatId: string, handle: string, text: string): Promise<void>;
13
+ deleteMessage(chatId: string, handle: string): Promise<void>;
14
+ pinMessage(chatId: string, handle: string): Promise<void>;
15
+ unpinAllMessages(chatId: string): Promise<void>;
16
+ updateStatus(chatId: string, text: string): Promise<void>;
12
17
  setTyping(chatId: string, isTyping: boolean): Promise<void>;
13
18
  on<K extends keyof ChannelEvents>(event: K, listener: (...args: ChannelEvents[K]) => void): this;
14
19
  off<K extends keyof ChannelEvents>(event: K, listener: (...args: ChannelEvents[K]) => void): this;
@@ -25,15 +30,25 @@ export interface ButtonResponse {
25
30
  }
26
31
  export interface SendMessageOpts {
27
32
  parseMode?: "MarkdownV2" | "HTML";
33
+ /** When false, skip consuming the typing placeholder (e.g. for tool status messages). */
34
+ consumeTyping?: boolean;
35
+ }
36
+ export interface SessionInfo {
37
+ sessionId: string;
38
+ summary: string;
39
+ lastModified: number;
40
+ gitBranch?: string;
28
41
  }
29
42
  export interface Engine {
30
43
  name: string;
31
44
  runTurn(opts: RunTurnOpts): AsyncIterable<EngineEvent>;
45
+ listSessions(cwd: string): Promise<SessionInfo[]>;
32
46
  }
33
47
  export interface RunTurnOpts {
34
48
  sessionId: string | null;
35
49
  cwd: string;
36
50
  prompt: string;
51
+ attachments?: Attachment[];
37
52
  permissionMode: PermissionMode;
38
53
  onPermissionRequest: (req: PermissionRequest) => Promise<PermissionResponse>;
39
54
  appendSystemPrompt?: string;
@@ -44,11 +59,18 @@ export interface PermissionRequest {
44
59
  input: Record<string, unknown>;
45
60
  description: string;
46
61
  reason?: string;
62
+ toolUseId: string;
47
63
  }
48
64
  export interface PermissionResponse {
49
65
  decision: "allow" | "deny";
50
66
  message?: string;
51
67
  }
68
+ export interface TurnStats {
69
+ model: string;
70
+ contextUsed: number;
71
+ contextWindow: number;
72
+ toolCalls: Record<string, number>;
73
+ }
52
74
  export type EngineEvent = {
53
75
  type: "text";
54
76
  text: string;
@@ -56,6 +78,7 @@ export type EngineEvent = {
56
78
  type: "tool_use";
57
79
  toolName: string;
58
80
  input: Record<string, unknown>;
81
+ toolUseId: string;
59
82
  } | {
60
83
  type: "tool_result";
61
84
  toolName: string;
@@ -67,6 +90,7 @@ export type EngineEvent = {
67
90
  } | {
68
91
  type: "done";
69
92
  sessionId: string;
93
+ stats?: TurnStats;
70
94
  } | {
71
95
  type: "error";
72
96
  message: string;
@@ -82,9 +106,16 @@ export interface UserInfo {
82
106
  name: string;
83
107
  handle?: string;
84
108
  }
109
+ /** File data from a channel, kept in memory for engine consumption. */
110
+ export interface Attachment {
111
+ buffer: Buffer;
112
+ mimeType: string;
113
+ filename?: string;
114
+ }
85
115
  export interface InboundMessage {
86
116
  chatId: string;
87
117
  user: UserInfo;
88
118
  text: string;
119
+ attachments?: Attachment[];
89
120
  }
90
121
  export type { PermissionMode };
package/package.json CHANGED
@@ -1,7 +1,26 @@
1
1
  {
2
2
  "name": "clearclaw",
3
- "version": "0.2.0",
3
+ "version": "0.4.0",
4
+ "description": "Your coding agent, from your phone — personal assistant + project workspaces on your machine, built on the CLI's permissions, config, and memory instead of replacing them.",
4
5
  "type": "module",
6
+ "license": "MIT",
7
+ "repository": {
8
+ "type": "git",
9
+ "url": "git+https://github.com/alleriasun/clearclaw.git"
10
+ },
11
+ "homepage": "https://github.com/alleriasun/clearclaw",
12
+ "keywords": [
13
+ "claude-code",
14
+ "telegram",
15
+ "relay",
16
+ "agent-sdk",
17
+ "cli",
18
+ "remote",
19
+ "mobile",
20
+ "openclaw",
21
+ "nanoclaw",
22
+ "remotecode"
23
+ ],
5
24
  "bin": {
6
25
  "clearclaw": "dist/index.js"
7
26
  },
@@ -18,6 +37,7 @@
18
37
  },
19
38
  "dependencies": {
20
39
  "@anthropic-ai/claude-agent-sdk": "^0.2.50",
40
+ "@slack/bolt": "^4.6.0",
21
41
  "diff": "^8.0.3",
22
42
  "grammy": "^1.30.0",
23
43
  "pino": "^10.3.1",
@@ -25,6 +45,7 @@
25
45
  "pino-roll": "^4.0.0"
26
46
  },
27
47
  "devDependencies": {
48
+ "@anthropic-ai/sdk": "^0.78.0",
28
49
  "@types/diff": "^7.0.2",
29
50
  "@types/node": "^22.0.0",
30
51
  "nodemon": "^3.1.14",