@yoooclaw/phone-notifications 1.8.0 → 1.9.0-beta.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/index.d.ts CHANGED
@@ -1,67 +1,9 @@
1
- import { IncomingMessage, ServerResponse } from 'node:http';
1
+ import { OpenClawPluginApi } from 'openclaw/plugin-sdk';
2
2
 
3
- interface PluginApi {
4
- logger: {
5
- info: (msg: string) => void;
6
- warn: (msg: string) => void;
7
- error: (msg: string) => void;
8
- };
9
- pluginConfig?: Record<string, unknown>;
10
- runtime: {
11
- state: {
12
- resolveStateDir: () => string;
13
- };
14
- };
15
- registerService: (service: {
16
- id: string;
17
- start: (ctx: {
18
- stateDir: string;
19
- workspaceDir?: string;
20
- }) => void | Promise<void>;
21
- stop?: () => void | Promise<void>;
22
- }) => void;
23
- registerGatewayMethod: (method: string, handler: (opts: {
24
- params: Record<string, unknown>;
25
- /** 发起本次请求的 WSS 客户端(operator 节点为 null) */
26
- client: {
27
- connId?: string;
28
- } | null;
29
- context: {
30
- /** 向所有已连接的 operator 客户端广播 event 帧 */
31
- broadcast: (event: string, payload: unknown) => void;
32
- /** 向指定 connId 集合广播 event 帧 */
33
- broadcastToConnIds: (event: string, payload: unknown, connIds: ReadonlySet<string>) => void;
34
- };
35
- respond: (ok: boolean, payload?: unknown, error?: {
36
- code: string;
37
- message: string;
38
- }) => void;
39
- }) => void | Promise<void>) => void;
40
- /** 注册供 AI Agent 调用的 tool,声明即实现 */
41
- registerTool: (tool: {
42
- name: string;
43
- description: string;
44
- parameters: Record<string, unknown>;
45
- execute: (toolCallId: string, params: unknown) => unknown | Promise<unknown>;
46
- }) => void;
47
- registerHttpRoute: (params: {
48
- path: string;
49
- handler: (req: IncomingMessage, res: ServerResponse) => void | Promise<void>;
50
- auth?: "gateway" | "plugin";
51
- }) => void;
52
- registerCli: (registrar: (ctx: {
53
- program: any;
54
- stateDir?: string;
55
- workspaceDir?: string;
56
- logger: PluginApi["logger"];
57
- }) => void | Promise<void>, opts?: {
58
- commands?: string[];
59
- }) => void;
60
- }
61
3
  declare const _default: {
62
4
  id: string;
63
5
  name: string;
64
- register(api: PluginApi): void;
6
+ register(api: OpenClawPluginApi): void;
65
7
  };
66
8
 
67
9
  export { _default as default };