MCPcopy Create free account
hub / github.com/CreminiAI/skillpack / start

Method start

src/runtime/adapters/feishu.ts:129–173  ·  view source on GitHub ↗
(ctx: AdapterContext)

Source from the content-addressed store, hash-verified

127 }
128
129 async start(ctx: AdapterContext): Promise<void> {
130 this.agent = ctx.agent;
131 this.ipcBroadcaster = ctx.ipcBroadcaster ?? null;
132 this.rootDir = ctx.rootDir;
133 const domain = normalizeFeishuDomain(this.options.domain);
134
135 this.channel = createResilientLarkChannel({
136 appId: this.options.appId,
137 appSecret: this.options.appSecret,
138 domain: resolveFeishuSdkDomain(domain),
139 loggerLevel: Lark.LoggerLevel.info,
140 transport: "websocket",
141 source: "skillpack",
142 policy: {
143 dmMode: "open",
144 requireMention: false,
145 },
146 });
147
148 this.channel.on("message", (message) => {
149 void this.handleIncomingMessage(message).catch((error) => {
150 console.error("[Feishu] Error handling message:", error);
151 });
152 });
153
154 this.channel.on("error", (error) => {
155 console.error("[Feishu] Channel error:", error);
156 });
157
158 this.channel.on("reconnecting", () => {
159 console.warn("[Feishu] Channel reconnecting");
160 });
161
162 this.channel.on("reconnected", () => {
163 console.log("[Feishu] Channel reconnected");
164 });
165
166 await this.channel.connect();
167 const botName = this.channel.botIdentity?.name;
168 console.log(
169 botName
170 ? `[FeishuAdapter] Started as ${botName} (domain=${domain})`
171 : `[FeishuAdapter] Started (domain=${domain})`,
172 );
173 }
174
175 async stop(): Promise<void> {
176 if (this.channel) {

Callers 1

startServerFunction · 0.95

Calls 6

handleIncomingMessageMethod · 0.95
resolveFeishuSdkDomainFunction · 0.85
normalizeFeishuDomainFunction · 0.70
onMethod · 0.65
connectMethod · 0.45

Tested by

no test coverage detected