MCPcopy Create free account
hub / github.com/msgbyte/tailchat / createTailchatContextWithConfig

Function createTailchatContextWithConfig

apps/github-app/src/app.ts:180–198  ·  view source on GitHub ↗

* 从配置文件中创建上下文 * * 因为考虑serverless服务因此不能全局管理

(githubRaw: string)

Source from the content-addressed store, hash-verified

178 * 因为考虑serverless服务因此不能全局管理
179 */
180function createTailchatContextWithConfig(githubRaw: string) {
181 const content = Buffer.from(githubRaw, 'base64').toString();
182 const json = JSON.parse(content);
183 const tailchatHost = json['tailchatHost'] ?? defaultTailchatApiUrl;
184 const groupId = json['groupId'];
185 const panelId = json['panelId'];
186
187 if (!groupId || !panelId) {
188 throw new Error('config format error');
189 }
190
191 const tailchatClient = createTailchatClient(tailchatHost);
192
193 return {
194 tailchatClient,
195 groupId,
196 panelId,
197 };
198}
199
200function createTailchatClient(tailchatHost = defaultTailchatApiUrl) {
201 const tailchatClient = new TailchatClient(

Callers 1

appFnFunction · 0.85

Calls 3

createTailchatClientFunction · 0.85
toStringMethod · 0.80
parseMethod · 0.80

Tested by

no test coverage detected