@zhin.js/adapter-github 1.1.3 → 1.1.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/CHANGELOG.md +10 -0
- package/agents/github/skills/github-account/handlers.js +10 -10
- package/agents/github/skills/github-account/handlers.ts +10 -10
- package/agents/github/skills/github-subscriptions/handlers.js +18 -18
- package/agents/github/skills/github-subscriptions/handlers.ts +18 -18
- package/lib/github-channel-context.js +1 -1
- package/package.json +8 -8
- package/src/github-channel-context.ts +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,15 @@
|
|
|
1
1
|
# @zhin.js/adapter-github
|
|
2
2
|
|
|
3
|
+
## 1.1.4
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- 0de4836: Expose the canonical Plugin Runtime `Message` contract from `@zhin.js/core`, `@zhin.js/core/runtime`, and the `zhin.js` root entries, and migrate Agent, permission, and GitHub integrations to the fields middleware actually receives. Document and lock the `EndpointEvent<Notice | Request>` handler boundary so side-event payload fields match editor inference.
|
|
8
|
+
- Updated dependencies [43eda99]
|
|
9
|
+
- Updated dependencies [0de4836]
|
|
10
|
+
- @zhin.js/core@1.1.39
|
|
11
|
+
- @zhin.js/adapter@1.1.15
|
|
12
|
+
|
|
3
13
|
## 1.1.3
|
|
4
14
|
|
|
5
15
|
### Patch Changes
|
|
@@ -16,7 +16,7 @@ function depsLogger() {
|
|
|
16
16
|
export async function executeGithubBind(_args, client, commMessage) {
|
|
17
17
|
const log = depsLogger();
|
|
18
18
|
const msg = commMessage ?? getCurrentCommMessage();
|
|
19
|
-
if (!msg
|
|
19
|
+
if (!msg?.clientAdapter || !msg?.sender?.id)
|
|
20
20
|
return '❌ 无法获取当前用户信息';
|
|
21
21
|
const clientId = client.clientId;
|
|
22
22
|
if (!clientId)
|
|
@@ -24,7 +24,7 @@ export async function executeGithubBind(_args, client, commMessage) {
|
|
|
24
24
|
const model = oauthModel(client);
|
|
25
25
|
if (!model)
|
|
26
26
|
return '❌ 数据库未就绪';
|
|
27
|
-
const [existing] = await model.select().where({ platform: msg
|
|
27
|
+
const [existing] = await model.select().where({ platform: msg.clientAdapter, platform_uid: msg.sender.id });
|
|
28
28
|
if (existing) {
|
|
29
29
|
return `⚠️ 你已绑定 GitHub 账号: ${existing.github_login}\n如需重新绑定,请先执行 github_unbind`;
|
|
30
30
|
}
|
|
@@ -42,7 +42,7 @@ export async function executeGithubBind(_args, client, commMessage) {
|
|
|
42
42
|
].join('\n');
|
|
43
43
|
tokenPromise.then(async (tokenData) => {
|
|
44
44
|
if (!tokenData) {
|
|
45
|
-
log.warn(formatCompact({ op: 'device_flow', ok: false, platform: msg
|
|
45
|
+
log.warn(formatCompact({ op: 'device_flow', ok: false, platform: msg.clientAdapter, sender: msg.sender.id }));
|
|
46
46
|
return;
|
|
47
47
|
}
|
|
48
48
|
const userGh = new GhClient({ host, token: tokenData.access_token });
|
|
@@ -50,13 +50,13 @@ export async function executeGithubBind(_args, client, commMessage) {
|
|
|
50
50
|
const login = authResult.ok ? authResult.user : 'unknown';
|
|
51
51
|
await model.insert({
|
|
52
52
|
id: Date.now(),
|
|
53
|
-
platform: msg
|
|
54
|
-
platform_uid: msg
|
|
53
|
+
platform: msg.clientAdapter,
|
|
54
|
+
platform_uid: msg.sender.id,
|
|
55
55
|
github_login: login,
|
|
56
56
|
access_token: tokenData.access_token,
|
|
57
57
|
created_at: Date.now(),
|
|
58
58
|
});
|
|
59
|
-
log.debug(formatCompact({ op: 'bind', platform: msg
|
|
59
|
+
log.debug(formatCompact({ op: 'bind', platform: msg.clientAdapter, sender: msg.sender.id, login }));
|
|
60
60
|
if (msg?.$reply) {
|
|
61
61
|
await msg.$reply(`✅ GitHub 账号绑定成功!\n👤 ${login}`);
|
|
62
62
|
}
|
|
@@ -71,12 +71,12 @@ export async function executeGithubBind(_args, client, commMessage) {
|
|
|
71
71
|
}
|
|
72
72
|
export async function executeGithubUnbind(_args, client, commMessage) {
|
|
73
73
|
const msg = commMessage ?? getCurrentCommMessage();
|
|
74
|
-
if (!msg
|
|
74
|
+
if (!msg?.clientAdapter || !msg?.sender?.id)
|
|
75
75
|
return '❌ 无法获取当前用户信息';
|
|
76
76
|
const model = oauthModel(client);
|
|
77
77
|
if (!model)
|
|
78
78
|
return '❌ 数据库未就绪';
|
|
79
|
-
const [existing] = await model.select().where({ platform: msg
|
|
79
|
+
const [existing] = await model.select().where({ platform: msg.clientAdapter, platform_uid: msg.sender.id });
|
|
80
80
|
if (!existing)
|
|
81
81
|
return '📭 你尚未绑定 GitHub 账号';
|
|
82
82
|
await model.delete().where({ id: existing.id });
|
|
@@ -84,12 +84,12 @@ export async function executeGithubUnbind(_args, client, commMessage) {
|
|
|
84
84
|
}
|
|
85
85
|
export async function executeGithubWhoami(_args, client, commMessage) {
|
|
86
86
|
const msg = commMessage ?? getCurrentCommMessage();
|
|
87
|
-
if (!msg
|
|
87
|
+
if (!msg?.clientAdapter || !msg?.sender?.id)
|
|
88
88
|
return '❌ 无法获取当前用户信息';
|
|
89
89
|
const model = oauthModel(client);
|
|
90
90
|
if (!model)
|
|
91
91
|
return '❌ 数据库未就绪';
|
|
92
|
-
const [existing] = await model.select().where({ platform: msg
|
|
92
|
+
const [existing] = await model.select().where({ platform: msg.clientAdapter, platform_uid: msg.sender.id });
|
|
93
93
|
if (!existing)
|
|
94
94
|
return '📭 你尚未绑定 GitHub 账号\n🔗 使用 github_bind 绑定你的账号';
|
|
95
95
|
const userGh = new GhClient({ host: client.host, token: existing.access_token });
|
|
@@ -26,7 +26,7 @@ function depsLogger() {
|
|
|
26
26
|
export async function executeGithubBind(_args: Record<string, never>, client: GithubClient, commMessage?: Message) {
|
|
27
27
|
const log = depsLogger();
|
|
28
28
|
const msg = commMessage ?? getCurrentCommMessage();
|
|
29
|
-
if (!msg
|
|
29
|
+
if (!msg?.clientAdapter || !msg?.sender?.id) return '❌ 无法获取当前用户信息';
|
|
30
30
|
|
|
31
31
|
const clientId = client.clientId;
|
|
32
32
|
if (!clientId) return '❌ Endpoint 未配置 GitHub App 或 App 无 client_id,无法进行账号绑定';
|
|
@@ -34,7 +34,7 @@ export async function executeGithubBind(_args: Record<string, never>, client: Gi
|
|
|
34
34
|
const model = oauthModel(client);
|
|
35
35
|
if (!model) return '❌ 数据库未就绪';
|
|
36
36
|
|
|
37
|
-
const [existing] = await model.select().where({ platform: msg
|
|
37
|
+
const [existing] = await model.select().where({ platform: msg.clientAdapter, platform_uid: msg.sender.id });
|
|
38
38
|
if (existing) {
|
|
39
39
|
return `⚠️ 你已绑定 GitHub 账号: ${existing.github_login}\n如需重新绑定,请先执行 github_unbind`;
|
|
40
40
|
}
|
|
@@ -57,7 +57,7 @@ export async function executeGithubBind(_args: Record<string, never>, client: Gi
|
|
|
57
57
|
|
|
58
58
|
tokenPromise.then(async (tokenData) => {
|
|
59
59
|
if (!tokenData) {
|
|
60
|
-
log.warn(formatCompact({ op: 'device_flow', ok: false, platform: msg
|
|
60
|
+
log.warn(formatCompact({ op: 'device_flow', ok: false, platform: msg.clientAdapter, sender: msg.sender!.id }));
|
|
61
61
|
return;
|
|
62
62
|
}
|
|
63
63
|
|
|
@@ -67,13 +67,13 @@ export async function executeGithubBind(_args: Record<string, never>, client: Gi
|
|
|
67
67
|
|
|
68
68
|
await model.insert({
|
|
69
69
|
id: Date.now(),
|
|
70
|
-
platform: msg
|
|
71
|
-
platform_uid: msg
|
|
70
|
+
platform: msg.clientAdapter,
|
|
71
|
+
platform_uid: msg.sender!.id,
|
|
72
72
|
github_login: login,
|
|
73
73
|
access_token: tokenData.access_token,
|
|
74
74
|
created_at: Date.now(),
|
|
75
75
|
});
|
|
76
|
-
log.debug(formatCompact({ op: 'bind', platform: msg
|
|
76
|
+
log.debug(formatCompact({ op: 'bind', platform: msg.clientAdapter, sender: msg.sender!.id, login }));
|
|
77
77
|
|
|
78
78
|
if (msg?.$reply) {
|
|
79
79
|
await msg.$reply(`✅ GitHub 账号绑定成功!\n👤 ${login}`);
|
|
@@ -90,12 +90,12 @@ export async function executeGithubBind(_args: Record<string, never>, client: Gi
|
|
|
90
90
|
|
|
91
91
|
export async function executeGithubUnbind(_args: Record<string, never>, client: GithubClient, commMessage?: Message) {
|
|
92
92
|
const msg = commMessage ?? getCurrentCommMessage();
|
|
93
|
-
if (!msg
|
|
93
|
+
if (!msg?.clientAdapter || !msg?.sender?.id) return '❌ 无法获取当前用户信息';
|
|
94
94
|
|
|
95
95
|
const model = oauthModel(client);
|
|
96
96
|
if (!model) return '❌ 数据库未就绪';
|
|
97
97
|
|
|
98
|
-
const [existing] = await model.select().where({ platform: msg
|
|
98
|
+
const [existing] = await model.select().where({ platform: msg.clientAdapter, platform_uid: msg.sender.id });
|
|
99
99
|
if (!existing) return '📭 你尚未绑定 GitHub 账号';
|
|
100
100
|
|
|
101
101
|
await model.delete().where({ id: existing.id });
|
|
@@ -104,12 +104,12 @@ export async function executeGithubUnbind(_args: Record<string, never>, client:
|
|
|
104
104
|
|
|
105
105
|
export async function executeGithubWhoami(_args: Record<string, never>, client: GithubClient, commMessage?: Message) {
|
|
106
106
|
const msg = commMessage ?? getCurrentCommMessage();
|
|
107
|
-
if (!msg
|
|
107
|
+
if (!msg?.clientAdapter || !msg?.sender?.id) return '❌ 无法获取当前用户信息';
|
|
108
108
|
|
|
109
109
|
const model = oauthModel(client);
|
|
110
110
|
if (!model) return '❌ 数据库未就绪';
|
|
111
111
|
|
|
112
|
-
const [existing] = await model.select().where({ platform: msg
|
|
112
|
+
const [existing] = await model.select().where({ platform: msg.clientAdapter, platform_uid: msg.sender.id });
|
|
113
113
|
if (!existing) return '📭 你尚未绑定 GitHub 账号\n🔗 使用 github_bind 绑定你的账号';
|
|
114
114
|
|
|
115
115
|
const userGh = new GhClient({ host: client.host, token: existing.access_token });
|
|
@@ -6,7 +6,7 @@ function subscriptionsModel(client) {
|
|
|
6
6
|
}
|
|
7
7
|
export async function executeGithubStar(args, client, commMessage) {
|
|
8
8
|
const msg = commMessage ?? getCurrentCommMessage();
|
|
9
|
-
const gh = await client.getUserOrDefaultApi(msg
|
|
9
|
+
const gh = await client.getUserOrDefaultApi(msg?.clientAdapter, msg?.sender?.id);
|
|
10
10
|
switch (args.action) {
|
|
11
11
|
case 'star': {
|
|
12
12
|
const r = await gh.starRepo(args.repo);
|
|
@@ -26,7 +26,7 @@ export async function executeGithubStar(args, client, commMessage) {
|
|
|
26
26
|
}
|
|
27
27
|
export async function executeGithubSubscribe(args, client, commMessage) {
|
|
28
28
|
const msg = commMessage ?? getCurrentCommMessage();
|
|
29
|
-
if (!msg
|
|
29
|
+
if (!msg?.clientAdapter || !msg?.sender?.id || !msg?.conversation.id || !msg?.endpointId) {
|
|
30
30
|
return '❌ 无法获取当前聊天通道信息';
|
|
31
31
|
}
|
|
32
32
|
const model = subscriptionsModel(client);
|
|
@@ -40,28 +40,28 @@ export async function executeGithubSubscribe(args, client, commMessage) {
|
|
|
40
40
|
return `❌ 无效的事件类型,可选: ${validEvents.join(', ')}`;
|
|
41
41
|
const [existing] = await model.select().where({
|
|
42
42
|
repo: args.repo,
|
|
43
|
-
target_id: msg
|
|
44
|
-
adapter: msg
|
|
45
|
-
endpoint: msg
|
|
43
|
+
target_id: msg.conversation.id,
|
|
44
|
+
adapter: msg.clientAdapter,
|
|
45
|
+
endpoint: msg.endpointId,
|
|
46
46
|
});
|
|
47
47
|
if (existing) {
|
|
48
|
-
await model.update({ events, target_type: msg
|
|
48
|
+
await model.update({ events, target_type: msg.conversation.kind || 'private' }).where({ id: existing.id });
|
|
49
49
|
return `✅ 已更新订阅 ${args.repo}\n📡 事件: ${events.join(', ')}`;
|
|
50
50
|
}
|
|
51
51
|
await model.insert({
|
|
52
52
|
id: Date.now(),
|
|
53
53
|
repo: args.repo,
|
|
54
54
|
events,
|
|
55
|
-
target_id: msg
|
|
56
|
-
target_type: msg
|
|
57
|
-
adapter: msg
|
|
58
|
-
endpoint: msg
|
|
55
|
+
target_id: msg.conversation.id,
|
|
56
|
+
target_type: msg.conversation.kind || 'private',
|
|
57
|
+
adapter: msg.clientAdapter,
|
|
58
|
+
endpoint: msg.endpointId,
|
|
59
59
|
});
|
|
60
60
|
return `✅ 已订阅 ${args.repo}\n📡 事件: ${events.join(', ')}\n📌 通知将推送到当前通道`;
|
|
61
61
|
}
|
|
62
62
|
export async function executeGithubUnsubscribe(args, client, commMessage) {
|
|
63
63
|
const msg = commMessage ?? getCurrentCommMessage();
|
|
64
|
-
if (!msg
|
|
64
|
+
if (!msg?.clientAdapter || !msg?.conversation.id || !msg?.endpointId) {
|
|
65
65
|
return '❌ 无法获取当前聊天通道信息';
|
|
66
66
|
}
|
|
67
67
|
const model = subscriptionsModel(client);
|
|
@@ -69,9 +69,9 @@ export async function executeGithubUnsubscribe(args, client, commMessage) {
|
|
|
69
69
|
return '❌ 数据库未就绪';
|
|
70
70
|
const [existing] = await model.select().where({
|
|
71
71
|
repo: args.repo,
|
|
72
|
-
target_id: msg
|
|
73
|
-
adapter: msg
|
|
74
|
-
endpoint: msg
|
|
72
|
+
target_id: msg.conversation.id,
|
|
73
|
+
adapter: msg.clientAdapter,
|
|
74
|
+
endpoint: msg.endpointId,
|
|
75
75
|
});
|
|
76
76
|
if (!existing)
|
|
77
77
|
return `📭 当前通道未订阅 ${args.repo}`;
|
|
@@ -80,16 +80,16 @@ export async function executeGithubUnsubscribe(args, client, commMessage) {
|
|
|
80
80
|
}
|
|
81
81
|
export async function executeGithubSubscriptions(_args, client, commMessage) {
|
|
82
82
|
const msg = commMessage ?? getCurrentCommMessage();
|
|
83
|
-
if (!msg
|
|
83
|
+
if (!msg?.clientAdapter || !msg?.conversation.id || !msg?.endpointId) {
|
|
84
84
|
return '❌ 无法获取当前聊天通道信息';
|
|
85
85
|
}
|
|
86
86
|
const model = subscriptionsModel(client);
|
|
87
87
|
if (!model)
|
|
88
88
|
return '❌ 数据库未就绪';
|
|
89
89
|
const subs = await model.select().where({
|
|
90
|
-
target_id: msg
|
|
91
|
-
adapter: msg
|
|
92
|
-
endpoint: msg
|
|
90
|
+
target_id: msg.conversation.id,
|
|
91
|
+
adapter: msg.clientAdapter,
|
|
92
|
+
endpoint: msg.endpointId,
|
|
93
93
|
});
|
|
94
94
|
if (!subs?.length)
|
|
95
95
|
return '📭 当前通道没有任何 GitHub 订阅';
|
|
@@ -17,7 +17,7 @@ function subscriptionsModel(client: GithubClient) {
|
|
|
17
17
|
|
|
18
18
|
export async function executeGithubStar(args: { action: 'star' | 'unstar' | 'check'; repo: string }, client: GithubClient, commMessage?: Message) {
|
|
19
19
|
const msg = commMessage ?? getCurrentCommMessage();
|
|
20
|
-
const gh = await client.getUserOrDefaultApi(msg
|
|
20
|
+
const gh = await client.getUserOrDefaultApi(msg?.clientAdapter, msg?.sender?.id);
|
|
21
21
|
switch (args.action) {
|
|
22
22
|
case 'star': {
|
|
23
23
|
const r = await gh.starRepo(args.repo);
|
|
@@ -38,7 +38,7 @@ export async function executeGithubStar(args: { action: 'star' | 'unstar' | 'che
|
|
|
38
38
|
|
|
39
39
|
export async function executeGithubSubscribe(args: { repo: string; events?: string }, client: GithubClient, commMessage?: Message) {
|
|
40
40
|
const msg = commMessage ?? getCurrentCommMessage();
|
|
41
|
-
if (!msg
|
|
41
|
+
if (!msg?.clientAdapter || !msg?.sender?.id || !msg?.conversation.id || !msg?.endpointId) {
|
|
42
42
|
return '❌ 无法获取当前聊天通道信息';
|
|
43
43
|
}
|
|
44
44
|
|
|
@@ -53,12 +53,12 @@ export async function executeGithubSubscribe(args: { repo: string; events?: stri
|
|
|
53
53
|
|
|
54
54
|
const [existing] = await model.select().where({
|
|
55
55
|
repo: args.repo,
|
|
56
|
-
target_id: msg
|
|
57
|
-
adapter: msg
|
|
58
|
-
endpoint: msg
|
|
56
|
+
target_id: msg.conversation.id,
|
|
57
|
+
adapter: msg.clientAdapter,
|
|
58
|
+
endpoint: msg.endpointId,
|
|
59
59
|
});
|
|
60
60
|
if (existing) {
|
|
61
|
-
await model.update({ events, target_type: msg
|
|
61
|
+
await model.update({ events, target_type: msg.conversation.kind || 'private' }).where({ id: existing.id });
|
|
62
62
|
return `✅ 已更新订阅 ${args.repo}\n📡 事件: ${events.join(', ')}`;
|
|
63
63
|
}
|
|
64
64
|
|
|
@@ -66,17 +66,17 @@ export async function executeGithubSubscribe(args: { repo: string; events?: stri
|
|
|
66
66
|
id: Date.now(),
|
|
67
67
|
repo: args.repo,
|
|
68
68
|
events,
|
|
69
|
-
target_id: msg
|
|
70
|
-
target_type: msg
|
|
71
|
-
adapter: msg
|
|
72
|
-
endpoint: msg
|
|
69
|
+
target_id: msg.conversation.id,
|
|
70
|
+
target_type: msg.conversation.kind || 'private',
|
|
71
|
+
adapter: msg.clientAdapter,
|
|
72
|
+
endpoint: msg.endpointId,
|
|
73
73
|
});
|
|
74
74
|
return `✅ 已订阅 ${args.repo}\n📡 事件: ${events.join(', ')}\n📌 通知将推送到当前通道`;
|
|
75
75
|
}
|
|
76
76
|
|
|
77
77
|
export async function executeGithubUnsubscribe(args: { repo: string }, client: GithubClient, commMessage?: Message) {
|
|
78
78
|
const msg = commMessage ?? getCurrentCommMessage();
|
|
79
|
-
if (!msg
|
|
79
|
+
if (!msg?.clientAdapter || !msg?.conversation.id || !msg?.endpointId) {
|
|
80
80
|
return '❌ 无法获取当前聊天通道信息';
|
|
81
81
|
}
|
|
82
82
|
|
|
@@ -85,9 +85,9 @@ export async function executeGithubUnsubscribe(args: { repo: string }, client: G
|
|
|
85
85
|
|
|
86
86
|
const [existing] = await model.select().where({
|
|
87
87
|
repo: args.repo,
|
|
88
|
-
target_id: msg
|
|
89
|
-
adapter: msg
|
|
90
|
-
endpoint: msg
|
|
88
|
+
target_id: msg.conversation.id,
|
|
89
|
+
adapter: msg.clientAdapter,
|
|
90
|
+
endpoint: msg.endpointId,
|
|
91
91
|
});
|
|
92
92
|
if (!existing) return `📭 当前通道未订阅 ${args.repo}`;
|
|
93
93
|
|
|
@@ -97,7 +97,7 @@ export async function executeGithubUnsubscribe(args: { repo: string }, client: G
|
|
|
97
97
|
|
|
98
98
|
export async function executeGithubSubscriptions(_args: Record<string, never>, client: GithubClient, commMessage?: Message) {
|
|
99
99
|
const msg = commMessage ?? getCurrentCommMessage();
|
|
100
|
-
if (!msg
|
|
100
|
+
if (!msg?.clientAdapter || !msg?.conversation.id || !msg?.endpointId) {
|
|
101
101
|
return '❌ 无法获取当前聊天通道信息';
|
|
102
102
|
}
|
|
103
103
|
|
|
@@ -105,9 +105,9 @@ export async function executeGithubSubscriptions(_args: Record<string, never>, c
|
|
|
105
105
|
if (!model) return '❌ 数据库未就绪';
|
|
106
106
|
|
|
107
107
|
const subs = await model.select().where({
|
|
108
|
-
target_id: msg
|
|
109
|
-
adapter: msg
|
|
110
|
-
endpoint: msg
|
|
108
|
+
target_id: msg.conversation.id,
|
|
109
|
+
adapter: msg.clientAdapter,
|
|
110
|
+
endpoint: msg.endpointId,
|
|
111
111
|
});
|
|
112
112
|
if (!subs?.length) return '📭 当前通道没有任何 GitHub 订阅';
|
|
113
113
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { buildChannelId, parseChannelId } from './types.js';
|
|
2
2
|
export function parseMessageChannel(message) {
|
|
3
|
-
const channelId = message
|
|
3
|
+
const channelId = message.conversation.id;
|
|
4
4
|
if (!channelId)
|
|
5
5
|
return null;
|
|
6
6
|
const parsed = parseChannelId(channelId);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@zhin.js/adapter-github",
|
|
3
|
-
"version": "1.1.
|
|
3
|
+
"version": "1.1.4",
|
|
4
4
|
"description": "Zhin.js GitHub adapter for Plugin Runtime (App auth + webhook)",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./lib/index.js",
|
|
@@ -43,7 +43,7 @@
|
|
|
43
43
|
"dependencies": {
|
|
44
44
|
"@zhin.js/adapter": "1.1.15",
|
|
45
45
|
"@zhin.js/agent-feature": "1.1.2",
|
|
46
|
-
"@zhin.js/core": "1.1.
|
|
46
|
+
"@zhin.js/core": "1.1.39",
|
|
47
47
|
"@zhin.js/feature-kit": "1.1.2",
|
|
48
48
|
"@zhin.js/host-http": "1.1.2",
|
|
49
49
|
"@zhin.js/im-contract": "1.1.2",
|
|
@@ -54,12 +54,12 @@
|
|
|
54
54
|
"peerDependencies": {
|
|
55
55
|
"zod": "^4.0.0",
|
|
56
56
|
"@zhin.js/adapter": "^1.1.15",
|
|
57
|
-
"@zhin.js/agent": "^1.1.
|
|
58
|
-
"@zhin.js/command": "^1.1.
|
|
59
|
-
"@zhin.js/core": "^1.1.
|
|
57
|
+
"@zhin.js/agent": "^1.1.28",
|
|
58
|
+
"@zhin.js/command": "^1.1.3",
|
|
59
|
+
"@zhin.js/core": "^1.1.39",
|
|
60
60
|
"@zhin.js/host-http": "^1.1.2",
|
|
61
61
|
"@zhin.js/prompt-section": "^1.1.2",
|
|
62
|
-
"zhin.js": "^1.1.
|
|
62
|
+
"zhin.js": "^1.1.4"
|
|
63
63
|
},
|
|
64
64
|
"peerDependenciesMeta": {
|
|
65
65
|
"@zhin.js/agent": {
|
|
@@ -83,9 +83,9 @@
|
|
|
83
83
|
"typescript": "^6.0.3",
|
|
84
84
|
"vitest": "^4.1.10",
|
|
85
85
|
"zod": "^4.4.3",
|
|
86
|
-
"@zhin.js/agent": "1.1.
|
|
86
|
+
"@zhin.js/agent": "1.1.28",
|
|
87
87
|
"@zhin.js/prompt-section": "1.1.2",
|
|
88
|
-
"zhin.js": "1.1.
|
|
88
|
+
"zhin.js": "1.1.4"
|
|
89
89
|
},
|
|
90
90
|
"files": [
|
|
91
91
|
"adapters",
|
|
@@ -10,7 +10,7 @@ export interface GitHubChannelContext extends ParsedChannel {
|
|
|
10
10
|
}
|
|
11
11
|
|
|
12
12
|
export function parseMessageChannel(message: Message): GitHubChannelContext | null {
|
|
13
|
-
const channelId = message
|
|
13
|
+
const channelId = message.conversation.id;
|
|
14
14
|
if (!channelId) return null;
|
|
15
15
|
const parsed = parseChannelId(channelId);
|
|
16
16
|
if (!parsed) return null;
|