@hopgoldy/agent-bridge 0.1.1 → 0.2.2
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/README.md +24 -5
- package/dist/agent-bridge.js +1801 -133
- package/dist/cli.js +1801 -133
- package/dist/index.d.ts +51 -11
- package/package.json +9 -4
package/dist/index.d.ts
CHANGED
|
@@ -24,6 +24,13 @@ interface OutboundAttachment {
|
|
|
24
24
|
fileName?: string;
|
|
25
25
|
caption?: string;
|
|
26
26
|
}
|
|
27
|
+
type ToolProgressPayload = {
|
|
28
|
+
toolName: string;
|
|
29
|
+
toolCallId?: string;
|
|
30
|
+
toolInput?: unknown;
|
|
31
|
+
toolLabel?: string;
|
|
32
|
+
text?: string;
|
|
33
|
+
};
|
|
27
34
|
type AgentOutputPayload = {
|
|
28
35
|
type: "assistant.message";
|
|
29
36
|
text: string;
|
|
@@ -31,19 +38,18 @@ type AgentOutputPayload = {
|
|
|
31
38
|
} | {
|
|
32
39
|
type: "assistant.thinking";
|
|
33
40
|
text?: string;
|
|
34
|
-
} | {
|
|
41
|
+
} | ({
|
|
35
42
|
type: "assistant.tool.running";
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
43
|
+
} & ToolProgressPayload) | ({
|
|
44
|
+
type: "assistant.tool.update";
|
|
45
|
+
partialResult?: unknown;
|
|
46
|
+
} & ToolProgressPayload) | ({
|
|
39
47
|
type: "assistant.tool.done";
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
} | {
|
|
48
|
+
result?: unknown;
|
|
49
|
+
} & ToolProgressPayload) | ({
|
|
43
50
|
type: "assistant.tool.error";
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
} | {
|
|
51
|
+
result?: unknown;
|
|
52
|
+
} & ToolProgressPayload) | {
|
|
47
53
|
type: "session.compacting";
|
|
48
54
|
text?: string;
|
|
49
55
|
};
|
|
@@ -115,6 +121,18 @@ interface FeishuClientConfig {
|
|
|
115
121
|
verificationToken?: string;
|
|
116
122
|
requireMentionInGroup?: boolean;
|
|
117
123
|
}
|
|
124
|
+
interface WecomClientConfig {
|
|
125
|
+
botId: string;
|
|
126
|
+
secret: string;
|
|
127
|
+
websocketUrl?: string;
|
|
128
|
+
requireMentionInGroup?: boolean;
|
|
129
|
+
}
|
|
130
|
+
interface WeixinClientConfig {
|
|
131
|
+
accountId: string;
|
|
132
|
+
token: string;
|
|
133
|
+
baseUrl?: string;
|
|
134
|
+
cdnBaseUrl?: string;
|
|
135
|
+
}
|
|
118
136
|
interface PiCodingAgentConfig {
|
|
119
137
|
bin?: string;
|
|
120
138
|
sessionDir?: string;
|
|
@@ -124,6 +142,12 @@ interface PiCodingAgentConfig {
|
|
|
124
142
|
type ClientConfig = {
|
|
125
143
|
type: "feishu";
|
|
126
144
|
config: FeishuClientConfig;
|
|
145
|
+
} | {
|
|
146
|
+
type: "wecom";
|
|
147
|
+
config: WecomClientConfig;
|
|
148
|
+
} | {
|
|
149
|
+
type: "weixin";
|
|
150
|
+
config: WeixinClientConfig;
|
|
127
151
|
};
|
|
128
152
|
type AgentConfig = {
|
|
129
153
|
type: "pi-coding-agent";
|
|
@@ -167,5 +191,21 @@ interface FeishuInboundMessage {
|
|
|
167
191
|
mentionedBot?: boolean;
|
|
168
192
|
raw?: unknown;
|
|
169
193
|
}
|
|
194
|
+
interface WecomInboundMessage {
|
|
195
|
+
chatId: string;
|
|
196
|
+
chatType: "dm" | "group";
|
|
197
|
+
messageId: string;
|
|
198
|
+
text: string;
|
|
199
|
+
mentionedBot?: boolean;
|
|
200
|
+
raw?: unknown;
|
|
201
|
+
}
|
|
202
|
+
interface WeixinInboundMessage {
|
|
203
|
+
chatId: string;
|
|
204
|
+
chatType: "dm" | "group";
|
|
205
|
+
messageId: string;
|
|
206
|
+
text: string;
|
|
207
|
+
mentionedBot?: boolean;
|
|
208
|
+
raw?: unknown;
|
|
209
|
+
}
|
|
170
210
|
|
|
171
|
-
export type { AgentAdapter, AgentConfig, AgentInputEvent, AgentModule, AgentOutputEvent, AppConfig, AppDefaults, ChannelConfig, ChannelRunner, ClientConfig, ClientInputEvent, ClientModule, ClientOutputEvent, ConfigAdapter, ConfigCollectContext, ConfigInputOptions, ConfigSelectOption, FeishuClientConfig, FeishuInboundMessage, GatewayCoreOptions, IMAdapter, LegacyAgentInputEvent, OutboundAttachment, PiCodingAgentConfig, RunChannelOptions, SessionBindingStore };
|
|
211
|
+
export type { AgentAdapter, AgentConfig, AgentInputEvent, AgentModule, AgentOutputEvent, AppConfig, AppDefaults, ChannelConfig, ChannelRunner, ClientConfig, ClientInputEvent, ClientModule, ClientOutputEvent, ConfigAdapter, ConfigCollectContext, ConfigInputOptions, ConfigSelectOption, FeishuClientConfig, FeishuInboundMessage, GatewayCoreOptions, IMAdapter, LegacyAgentInputEvent, OutboundAttachment, PiCodingAgentConfig, RunChannelOptions, SessionBindingStore, WecomClientConfig, WecomInboundMessage, WeixinClientConfig, WeixinInboundMessage };
|
package/package.json
CHANGED
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@hopgoldy/agent-bridge",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.2.2",
|
|
4
4
|
"private": false,
|
|
5
|
-
"description": "IM to
|
|
5
|
+
"description": "IM to Agent bridge with dual-adapter architecture",
|
|
6
|
+
"packageManager": "pnpm@10.33.0",
|
|
6
7
|
"keywords": [
|
|
7
8
|
"im",
|
|
8
9
|
"bridge",
|
|
@@ -40,10 +41,14 @@
|
|
|
40
41
|
"dependencies": {
|
|
41
42
|
"@clack/prompts": "^1.7.0",
|
|
42
43
|
"@larksuiteoapi/node-sdk": "^1.64.0",
|
|
43
|
-
"
|
|
44
|
+
"@openilink/openilink-sdk-node": "^0.6.0",
|
|
45
|
+
"@wecom/aibot-node-sdk": "^1.0.7",
|
|
46
|
+
"commander": "^12.1.0",
|
|
47
|
+
"qrcode-terminal": "^0.12.0"
|
|
44
48
|
},
|
|
45
49
|
"devDependencies": {
|
|
46
50
|
"@types/node": "^24.3.0",
|
|
51
|
+
"@types/qrcode-terminal": "^0.12.2",
|
|
47
52
|
"@vitest/coverage-v8": "^3.2.7",
|
|
48
53
|
"commit-and-tag-version": "^12.7.3",
|
|
49
54
|
"cross-env": "^10.0.0",
|
|
@@ -61,4 +66,4 @@
|
|
|
61
66
|
"start": "node ./dist/agent-bridge.js",
|
|
62
67
|
"release": "commit-and-tag-version && git push --follow-tags origin main"
|
|
63
68
|
}
|
|
64
|
-
}
|
|
69
|
+
}
|