@qwen-code/channel-github 0.26.7 → 0.26.8-nightly.20261105.7bd78683e6
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/dist/GithubAdapter.d.ts +235 -3
- package/dist/GithubAdapter.d.ts.map +1 -1
- package/dist/GithubAdapter.js +1291 -159
- package/dist/GithubAdapter.js.map +1 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +68 -25
- package/dist/index.js.map +1 -1
- package/dist/web-origin.d.ts +14 -0
- package/dist/web-origin.d.ts.map +1 -0
- package/dist/web-origin.js +28 -0
- package/dist/web-origin.js.map +1 -0
- package/package.json +6 -2
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,yBAAyB,CAAC;AAC7D,OAAO,EACL,aAAa,EAId,MAAM,oBAAoB,CAAC;AA4D5B,OAAO,EAAE,aAAa,EAAE,CAAC;AAEzB,eAAO,MAAM,MAAM,EAAE,aA2GpB,CAAC"}
|
package/dist/index.js
CHANGED
|
@@ -1,5 +1,58 @@
|
|
|
1
|
-
import { MAX_POLL_INTERVAL_MS } from '@qwen-code/channel-base';
|
|
2
|
-
import { GithubChannel, validateBoundSessionConfig, PR_WATCH_EVENTS, } from './GithubAdapter.js';
|
|
1
|
+
import { MAX_POLL_INTERVAL_MS, PR_BINDING_ROLES, } from '@qwen-code/channel-base';
|
|
2
|
+
import { GithubChannel, validateBoundSessionConfig, PR_NOTIFICATION_REASONS, PR_WATCH_EVENTS, } from './GithubAdapter.js';
|
|
3
|
+
/**
|
|
4
|
+
* One-line meaning of each unqualified boundSessionActions key, shown by
|
|
5
|
+
* management UIs next to the key and in the add picker. Role-qualified
|
|
6
|
+
* keys reuse their base event's description; the role's job is named by
|
|
7
|
+
* the picker group header instead.
|
|
8
|
+
*/
|
|
9
|
+
const BOUND_ACTION_DESCRIPTIONS = {
|
|
10
|
+
default: 'Fallback template for any event without a more specific key',
|
|
11
|
+
'watch:ci_failure': 'CI checks turn red on a head commit',
|
|
12
|
+
'watch:merge_conflict': 'The PR develops a merge conflict',
|
|
13
|
+
'watch:head_change': 'The PR’s head commit changes',
|
|
14
|
+
'watch:state_change': 'The PR is merged or closed',
|
|
15
|
+
mention: 'You are @mentioned in a comment',
|
|
16
|
+
review_requested: 'A review is requested from you',
|
|
17
|
+
assign: 'You are assigned to the PR',
|
|
18
|
+
author: 'Activity on a PR you authored',
|
|
19
|
+
comment: 'A new comment on a subscribed PR',
|
|
20
|
+
ci_activity: 'CI activity on a subscribed PR',
|
|
21
|
+
manual: 'You subscribed to the PR manually',
|
|
22
|
+
state_change: 'The PR is closed or merged',
|
|
23
|
+
subscribed: 'Activity on a PR you subscribed to',
|
|
24
|
+
team_mention: 'A team you belong to is @mentioned',
|
|
25
|
+
security_alert: 'A security alert on the repository',
|
|
26
|
+
approval_requested: 'Approval is requested from you',
|
|
27
|
+
invitation: 'You are invited to collaborate',
|
|
28
|
+
member_feature_requested: 'A member feature request notification',
|
|
29
|
+
security_advisory_credit: 'You are credited in a security advisory',
|
|
30
|
+
};
|
|
31
|
+
/**
|
|
32
|
+
* The boundSessionActions key options offered by management UIs: the
|
|
33
|
+
* fallback, every event class, and each role-qualified spelling — built
|
|
34
|
+
* from the same constants the validator enforces so the three cannot
|
|
35
|
+
* drift (the PR_WATCH_EVENTS pattern, R2-18). `group` buckets the picker
|
|
36
|
+
* by binding role; `description` explains each key.
|
|
37
|
+
*/
|
|
38
|
+
const BOUND_ACTION_BASE_OPTIONS = [
|
|
39
|
+
'default',
|
|
40
|
+
...PR_WATCH_EVENTS.map((event) => `watch:${event}`),
|
|
41
|
+
...PR_NOTIFICATION_REASONS,
|
|
42
|
+
].map((value) => ({
|
|
43
|
+
value,
|
|
44
|
+
label: value,
|
|
45
|
+
description: BOUND_ACTION_DESCRIPTIONS[value],
|
|
46
|
+
}));
|
|
47
|
+
const BOUND_ACTION_KEY_OPTIONS = [
|
|
48
|
+
...BOUND_ACTION_BASE_OPTIONS.map((option) => ({ ...option, group: 'any' })),
|
|
49
|
+
...PR_BINDING_ROLES.flatMap((role) => BOUND_ACTION_BASE_OPTIONS.map((option) => ({
|
|
50
|
+
value: `${role}:${option.value}`,
|
|
51
|
+
label: `${role}:${option.value}`,
|
|
52
|
+
description: option.description,
|
|
53
|
+
group: role,
|
|
54
|
+
}))),
|
|
55
|
+
];
|
|
3
56
|
export { GithubChannel };
|
|
4
57
|
export const plugin = {
|
|
5
58
|
channelType: 'github',
|
|
@@ -57,29 +110,12 @@ export const plugin = {
|
|
|
57
110
|
kind: 'string-list',
|
|
58
111
|
description: 'Optional. Only notifications with a selected reason are processed. ' +
|
|
59
112
|
'Leave every reason unselected to process all of them.',
|
|
60
|
-
options
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
{ value: 'ci_activity', label: 'ci_activity' },
|
|
67
|
-
{ value: 'manual', label: 'manual' },
|
|
68
|
-
{ value: 'state_change', label: 'state_change' },
|
|
69
|
-
{ value: 'subscribed', label: 'subscribed' },
|
|
70
|
-
{ value: 'team_mention', label: 'team_mention' },
|
|
71
|
-
{ value: 'security_alert', label: 'security_alert' },
|
|
72
|
-
{ value: 'approval_requested', label: 'approval_requested' },
|
|
73
|
-
{ value: 'invitation', label: 'invitation' },
|
|
74
|
-
{
|
|
75
|
-
value: 'member_feature_requested',
|
|
76
|
-
label: 'member_feature_requested',
|
|
77
|
-
},
|
|
78
|
-
{
|
|
79
|
-
value: 'security_advisory_credit',
|
|
80
|
-
label: 'security_advisory_credit',
|
|
81
|
-
},
|
|
82
|
-
],
|
|
113
|
+
// Built from the adapter's exported vocabulary so the UI options
|
|
114
|
+
// can never drift from the boundSessionActions key validator.
|
|
115
|
+
options: PR_NOTIFICATION_REASONS.map((value) => ({
|
|
116
|
+
value,
|
|
117
|
+
label: value,
|
|
118
|
+
})),
|
|
83
119
|
},
|
|
84
120
|
{
|
|
85
121
|
key: 'deliverToBoundSessions',
|
|
@@ -97,6 +133,13 @@ export const plugin = {
|
|
|
97
133
|
// never drift from the validator/emit path (R2-18).
|
|
98
134
|
options: PR_WATCH_EVENTS.map((value) => ({ value, label: value })),
|
|
99
135
|
},
|
|
136
|
+
{
|
|
137
|
+
key: 'boundSessionActions',
|
|
138
|
+
label: 'Bound Session Actions',
|
|
139
|
+
kind: 'record',
|
|
140
|
+
description: 'Optional. Instruction templates delivered to PR-bound sessions. Pick an event key below; a role prefix (review:, verify:, fix:) targets that binding role only. Requires Deliver To PR-Bound Sessions. Each role with a matching key gets its own delivery; roles without one skip the event. Variables: %repo%, %pr%, %url%, %title%, %event%, %sender%, %role%; %% for a literal %. Leave empty for the default generic prompt.',
|
|
141
|
+
options: BOUND_ACTION_KEY_OPTIONS,
|
|
142
|
+
},
|
|
100
143
|
],
|
|
101
144
|
validateConfig: (config) => {
|
|
102
145
|
const token = typeof config['token'] === 'string' ? config['token'].trim() : '';
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,oBAAoB,EACpB,gBAAgB,GACjB,MAAM,yBAAyB,CAAC;AAEjC,OAAO,EACL,aAAa,EACb,0BAA0B,EAC1B,uBAAuB,EACvB,eAAe,GAChB,MAAM,oBAAoB,CAAC;AAE5B;;;;;GAKG;AACH,MAAM,yBAAyB,GAA2B;IACxD,OAAO,EAAE,6DAA6D;IACtE,kBAAkB,EAAE,qCAAqC;IACzD,sBAAsB,EAAE,kCAA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AAC,KAAK,IAAI,EAAE,CAAC;gBAC5C,OAAO,2EAA2E,CAAC;YACrF,CAAC;YACD,OAAO,0BAA0B,CAAC,MAAM,EAAE,QAAQ,CAAC,CAAC;QACtD,CAAC;KACF;IACD,aAAa,EAAE,CAAC,IAAI,EAAE,MAAM,EAAE,MAAM,EAAE,OAAO,EAAE,EAAE,CAC/C,IAAI,aAAa,CAAC,IAAI,EAAE,MAAM,EAAE,MAAM,EAAE,OAAO,CAAC;CACnD,CAAC"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
* Copyright 2026 Qwen Team
|
|
4
|
+
* SPDX-License-Identifier: Apache-2.0
|
|
5
|
+
*/
|
|
6
|
+
/**
|
|
7
|
+
* Single owner of the GitHub API-root → web-origin mapping. The adapter
|
|
8
|
+
* resolves prompt-metadata URLs with it, and the daemon's channel-events
|
|
9
|
+
* route emits the resolved origin as link metadata, so browser clients
|
|
10
|
+
* concatenate a ready origin instead of re-deriving it (the browser bundle
|
|
11
|
+
* cannot import this Node-only package).
|
|
12
|
+
*/
|
|
13
|
+
export declare function resolveGithubWebOrigin(baseUrl: unknown): string;
|
|
14
|
+
//# sourceMappingURL=web-origin.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"web-origin.d.ts","sourceRoot":"","sources":["../src/web-origin.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH;;;;;;GAMG;AACH,wBAAgB,sBAAsB,CAAC,OAAO,EAAE,OAAO,GAAG,MAAM,CAiB/D"}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
* Copyright 2026 Qwen Team
|
|
4
|
+
* SPDX-License-Identifier: Apache-2.0
|
|
5
|
+
*/
|
|
6
|
+
/**
|
|
7
|
+
* Single owner of the GitHub API-root → web-origin mapping. The adapter
|
|
8
|
+
* resolves prompt-metadata URLs with it, and the daemon's channel-events
|
|
9
|
+
* route emits the resolved origin as link metadata, so browser clients
|
|
10
|
+
* concatenate a ready origin instead of re-deriving it (the browser bundle
|
|
11
|
+
* cannot import this Node-only package).
|
|
12
|
+
*/
|
|
13
|
+
export function resolveGithubWebOrigin(baseUrl) {
|
|
14
|
+
const raw = typeof baseUrl === 'string' && baseUrl.trim()
|
|
15
|
+
? baseUrl.trim()
|
|
16
|
+
: 'https://api.github.com';
|
|
17
|
+
return (raw
|
|
18
|
+
.replace(/\/api\/v3\/?$/, '')
|
|
19
|
+
.replace(/^https:\/\/api\.github\.com/, 'https://github.com')
|
|
20
|
+
// GitHub Enterprise Cloud data-residency tenants serve the web UI at
|
|
21
|
+
// <tenant>.ghe.com and the REST API at api.<tenant>.ghe.com. Binding
|
|
22
|
+
// URLs carry the web host, so map the API host to it. Scoped to a
|
|
23
|
+
// single .ghe.com label on purpose: a self-hosted GHE Server may
|
|
24
|
+
// legitimately serve web and API from an `api.`-prefixed host.
|
|
25
|
+
.replace(/^https:\/\/api\.([^./]+\.ghe\.com)/i, 'https://$1')
|
|
26
|
+
.replace(/\/+$/, ''));
|
|
27
|
+
}
|
|
28
|
+
//# sourceMappingURL=web-origin.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"web-origin.js","sourceRoot":"","sources":["../src/web-origin.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH;;;;;;GAMG;AACH,MAAM,UAAU,sBAAsB,CAAC,OAAgB;IACrD,MAAM,GAAG,GACP,OAAO,OAAO,KAAK,QAAQ,IAAI,OAAO,CAAC,IAAI,EAAE;QAC3C,CAAC,CAAC,OAAO,CAAC,IAAI,EAAE;QAChB,CAAC,CAAC,wBAAwB,CAAC;IAC/B,OAAO,CACL,GAAG;SACA,OAAO,CAAC,eAAe,EAAE,EAAE,CAAC;SAC5B,OAAO,CAAC,6BAA6B,EAAE,oBAAoB,CAAC;QAC7D,qEAAqE;QACrE,qEAAqE;QACrE,kEAAkE;QAClE,iEAAiE;QACjE,+DAA+D;SAC9D,OAAO,CAAC,qCAAqC,EAAE,YAAY,CAAC;SAC5D,OAAO,CAAC,MAAM,EAAE,EAAE,CAAC,CACvB,CAAC;AACJ,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@qwen-code/channel-github",
|
|
3
|
-
"version": "0.26.
|
|
3
|
+
"version": "0.26.8-nightly.20261105.7bd78683e6",
|
|
4
4
|
"description": "GitHub polling channel adapter for Qwen Code",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -14,6 +14,10 @@
|
|
|
14
14
|
".": {
|
|
15
15
|
"types": "./dist/index.d.ts",
|
|
16
16
|
"default": "./dist/index.js"
|
|
17
|
+
},
|
|
18
|
+
"./web-origin": {
|
|
19
|
+
"types": "./dist/web-origin.d.ts",
|
|
20
|
+
"default": "./dist/web-origin.js"
|
|
17
21
|
}
|
|
18
22
|
},
|
|
19
23
|
"files": [
|
|
@@ -21,7 +25,7 @@
|
|
|
21
25
|
],
|
|
22
26
|
"dependencies": {
|
|
23
27
|
"@octokit/rest": "^21.1.1",
|
|
24
|
-
"@qwen-code/channel-base": "0.26.
|
|
28
|
+
"@qwen-code/channel-base": "0.26.8-nightly.20261105.7bd78683e6",
|
|
25
29
|
"https-proxy-agent": "^7.0.6"
|
|
26
30
|
},
|
|
27
31
|
"devDependencies": {
|