@hopgoldy/agent-bridge 0.3.1 → 0.3.4
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 +2 -0
- package/dist/agent-bridge.js +203 -60
- package/dist/cli.js +203 -60
- package/dist/index.d.ts +16 -2
- package/package.json +2 -1
package/dist/index.d.ts
CHANGED
|
@@ -94,22 +94,34 @@ interface ConfigAdapter<TConfig = unknown> {
|
|
|
94
94
|
validate(config: TConfig): Promise<void> | void;
|
|
95
95
|
summarize?(config: TConfig): string;
|
|
96
96
|
}
|
|
97
|
+
type LocaleCode = "zh-CN" | "en-US";
|
|
98
|
+
interface ChannelCommonConfig {
|
|
99
|
+
language: LocaleCode;
|
|
100
|
+
}
|
|
101
|
+
interface ChannelCommonContext extends ChannelCommonConfig {
|
|
102
|
+
channelName: string;
|
|
103
|
+
}
|
|
97
104
|
interface ClientModule<TConfig = unknown> {
|
|
98
105
|
readonly type: string;
|
|
99
106
|
createConfigCollector?: () => ConfigAdapter<TConfig>;
|
|
100
|
-
createClientAdapter(
|
|
107
|
+
createClientAdapter(args: {
|
|
108
|
+
config: TConfig;
|
|
109
|
+
common: ChannelCommonContext;
|
|
110
|
+
}): IMAdapter;
|
|
101
111
|
}
|
|
102
112
|
interface AgentModule<TConfig = unknown> {
|
|
103
113
|
readonly type: string;
|
|
104
114
|
createConfigCollector?: () => ConfigAdapter<TConfig>;
|
|
105
115
|
createAgentSession(args: {
|
|
106
116
|
config: TConfig;
|
|
117
|
+
common: ChannelCommonContext;
|
|
107
118
|
}): Promise<{
|
|
108
119
|
agentSessionId: string;
|
|
109
120
|
agentAdapter: AgentAdapter;
|
|
110
121
|
}>;
|
|
111
122
|
resumeAgentSession?(args: {
|
|
112
123
|
config: TConfig;
|
|
124
|
+
common: ChannelCommonContext;
|
|
113
125
|
agentSessionId: string;
|
|
114
126
|
}): Promise<AgentAdapter>;
|
|
115
127
|
}
|
|
@@ -154,6 +166,7 @@ type AgentConfig = {
|
|
|
154
166
|
config: PiCodingAgentConfig;
|
|
155
167
|
};
|
|
156
168
|
interface ChannelConfig {
|
|
169
|
+
common: ChannelCommonConfig;
|
|
157
170
|
client: ClientConfig;
|
|
158
171
|
agent: AgentConfig;
|
|
159
172
|
}
|
|
@@ -173,6 +186,7 @@ interface GatewayCoreOptions {
|
|
|
173
186
|
agentConfig: AgentConfig["config"];
|
|
174
187
|
agentIdleTimeoutMs: number;
|
|
175
188
|
bindingStore?: SessionBindingStore;
|
|
189
|
+
common?: ChannelCommonContext;
|
|
176
190
|
}
|
|
177
191
|
interface SessionBindingStore {
|
|
178
192
|
load(): Promise<Record<string, string>>;
|
|
@@ -208,4 +222,4 @@ interface WeixinInboundMessage {
|
|
|
208
222
|
raw?: unknown;
|
|
209
223
|
}
|
|
210
224
|
|
|
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 };
|
|
225
|
+
export type { AgentAdapter, AgentConfig, AgentInputEvent, AgentModule, AgentOutputEvent, AppConfig, AppDefaults, ChannelCommonConfig, ChannelCommonContext, ChannelConfig, ChannelRunner, ClientConfig, ClientInputEvent, ClientModule, ClientOutputEvent, ConfigAdapter, ConfigCollectContext, ConfigInputOptions, ConfigSelectOption, FeishuClientConfig, FeishuInboundMessage, GatewayCoreOptions, IMAdapter, LegacyAgentInputEvent, LocaleCode, OutboundAttachment, PiCodingAgentConfig, RunChannelOptions, SessionBindingStore, WecomClientConfig, WecomInboundMessage, WeixinClientConfig, WeixinInboundMessage };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@hopgoldy/agent-bridge",
|
|
3
|
-
"version": "0.3.
|
|
3
|
+
"version": "0.3.4",
|
|
4
4
|
"private": false,
|
|
5
5
|
"description": "IM to Agent bridge with dual-adapter architecture",
|
|
6
6
|
"packageManager": "pnpm@10.33.0",
|
|
@@ -44,6 +44,7 @@
|
|
|
44
44
|
"@openilink/openilink-sdk-node": "^0.6.0",
|
|
45
45
|
"@wecom/aibot-node-sdk": "^1.0.7",
|
|
46
46
|
"commander": "^12.1.0",
|
|
47
|
+
"i18next": "^26.3.6",
|
|
47
48
|
"qrcode-terminal": "^0.12.0"
|
|
48
49
|
},
|
|
49
50
|
"devDependencies": {
|