@brain-toolkit/issue-forge 0.0.0-stage → 0.1.0
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 +5 -0
- package/README.md +43 -2
- package/dist/GithubAppClient-CPCXnpDO.d.ts +103 -0
- package/dist/chunk-RQKDVDLH.js +471 -0
- package/dist/chunk-RQKDVDLH.js.map +1 -0
- package/dist/feedback/index.cjs +911 -0
- package/dist/feedback/index.cjs.map +1 -0
- package/dist/feedback/index.d.ts +236 -0
- package/dist/feedback/index.js +567 -0
- package/dist/feedback/index.js.map +1 -0
- package/dist/index.cjs +515 -0
- package/dist/index.cjs.map +1 -0
- package/dist/index.d.ts +148 -0
- package/dist/index.js +23 -0
- package/dist/index.js.map +1 -0
- package/package.json +74 -4
|
@@ -0,0 +1,911 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __create = Object.create;
|
|
3
|
+
var __defProp = Object.defineProperty;
|
|
4
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
5
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
6
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
7
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
8
|
+
var __export = (target, all) => {
|
|
9
|
+
for (var name in all)
|
|
10
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
11
|
+
};
|
|
12
|
+
var __copyProps = (to, from, except, desc) => {
|
|
13
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
14
|
+
for (let key of __getOwnPropNames(from))
|
|
15
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
16
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
17
|
+
}
|
|
18
|
+
return to;
|
|
19
|
+
};
|
|
20
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
21
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
22
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
23
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
24
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
25
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
26
|
+
mod
|
|
27
|
+
));
|
|
28
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
29
|
+
|
|
30
|
+
// src/feedback/index.ts
|
|
31
|
+
var feedback_exports = {};
|
|
32
|
+
__export(feedback_exports, {
|
|
33
|
+
FEEDBACK_ISSUE_ASSETS_BRANCH: () => FEEDBACK_ISSUE_ASSETS_BRANCH,
|
|
34
|
+
FEEDBACK_ISSUE_ASSETS_DIR: () => FEEDBACK_ISSUE_ASSETS_DIR,
|
|
35
|
+
FEEDBACK_ISSUE_ASSETS_README: () => FEEDBACK_ISSUE_ASSETS_README,
|
|
36
|
+
FEEDBACK_ISSUE_DEFAULT_TEMPLATE: () => FEEDBACK_ISSUE_DEFAULT_TEMPLATE,
|
|
37
|
+
FEEDBACK_ISSUE_DEFAULT_TITLE: () => FEEDBACK_ISSUE_DEFAULT_TITLE,
|
|
38
|
+
FEEDBACK_ISSUE_TEMPLATE_PATH: () => FEEDBACK_ISSUE_TEMPLATE_PATH,
|
|
39
|
+
FeedbackIssueScreenshotSyncEngine: () => FeedbackIssueScreenshotSyncEngine,
|
|
40
|
+
FeedbackIssueStatus: () => FeedbackIssueStatus,
|
|
41
|
+
FeedbackIssueStatusResolver: () => FeedbackIssueStatusResolver,
|
|
42
|
+
FeedbackIssueStatusSyncEngine: () => FeedbackIssueStatusSyncEngine,
|
|
43
|
+
FeedbackIssueSyncEngine: () => FeedbackIssueSyncEngine,
|
|
44
|
+
FeedbackIssueSyncStatus: () => FeedbackIssueSyncStatus,
|
|
45
|
+
FeedbackIssueTemplateRenderer: () => FeedbackIssueTemplateRenderer,
|
|
46
|
+
FeedbackIssueTemplateResolver: () => FeedbackIssueTemplateResolver,
|
|
47
|
+
FeedbackIssueTemplateSource: () => FeedbackIssueTemplateSource,
|
|
48
|
+
createGithubFeedbackIssueBundle: () => createGithubFeedbackIssueBundle
|
|
49
|
+
});
|
|
50
|
+
module.exports = __toCommonJS(feedback_exports);
|
|
51
|
+
|
|
52
|
+
// src/feedback/types.ts
|
|
53
|
+
var FeedbackIssueSyncStatus = {
|
|
54
|
+
pending: "pending",
|
|
55
|
+
synced: "synced",
|
|
56
|
+
failed: "failed",
|
|
57
|
+
skipped: "skipped"
|
|
58
|
+
};
|
|
59
|
+
var FeedbackIssueStatus = {
|
|
60
|
+
open: "open",
|
|
61
|
+
reviewing: "reviewing",
|
|
62
|
+
resolved: "resolved",
|
|
63
|
+
closed: "closed"
|
|
64
|
+
};
|
|
65
|
+
|
|
66
|
+
// src/feedback/FeedbackIssueTemplateConfig.ts
|
|
67
|
+
var FeedbackIssueTemplateSource = Object.freeze({
|
|
68
|
+
repo: "repo",
|
|
69
|
+
builtin: "builtin"
|
|
70
|
+
});
|
|
71
|
+
var FEEDBACK_ISSUE_TEMPLATE_PATH = ".github/ISSUE_TEMPLATE/feedback.md";
|
|
72
|
+
var FEEDBACK_ISSUE_TEMPLATE_CACHE_TTL_MS = 10 * 60 * 1e3;
|
|
73
|
+
var FEEDBACK_ISSUE_TEMPLATE_FAILURE_TTL_MS = 60 * 1e3;
|
|
74
|
+
var FEEDBACK_ISSUE_DEFAULT_TITLE = "[Feedback][{{category}}] {{summary}}";
|
|
75
|
+
var FEEDBACK_ISSUE_ASSETS_BRANCH = "feedback-assets";
|
|
76
|
+
var FEEDBACK_ISSUE_ASSETS_DIR = "feedback";
|
|
77
|
+
var FEEDBACK_ISSUE_ASSETS_README = `# feedback-assets
|
|
78
|
+
|
|
79
|
+
Feedback screenshots uploaded by the app backend for Issue references.
|
|
80
|
+
|
|
81
|
+
- Do not merge into main
|
|
82
|
+
- May contain user screenshots; keep the branch private if needed
|
|
83
|
+
`;
|
|
84
|
+
var FEEDBACK_ISSUE_DEFAULT_TEMPLATE = `---
|
|
85
|
+
name: User feedback
|
|
86
|
+
about: App user feedback (server also uses this template; placeholders replaced server-side)
|
|
87
|
+
title: "[Feedback][{{category}}] {{summary}}"
|
|
88
|
+
labels: feedback
|
|
89
|
+
---
|
|
90
|
+
|
|
91
|
+
> App feedback \xB7 ID: \`{{feedback_id}}\` \xB7 [Admin]({{admin_url}})
|
|
92
|
+
|
|
93
|
+
### Reporter
|
|
94
|
+
|
|
95
|
+
| Field | Value |
|
|
96
|
+
| --- | --- |
|
|
97
|
+
| Name | {{display_name}} |
|
|
98
|
+
| Email | {{email}} |
|
|
99
|
+
| Phone | {{phone}} |
|
|
100
|
+
| Submitted at | {{created_at}} |
|
|
101
|
+
|
|
102
|
+
### Description
|
|
103
|
+
|
|
104
|
+
{{body}}
|
|
105
|
+
|
|
106
|
+
### Environment
|
|
107
|
+
|
|
108
|
+
{{environment}}
|
|
109
|
+
|
|
110
|
+
### Page
|
|
111
|
+
|
|
112
|
+
{{page_url}}
|
|
113
|
+
|
|
114
|
+
### Screenshots
|
|
115
|
+
|
|
116
|
+
{{screenshots}}
|
|
117
|
+
|
|
118
|
+
{{user_agent}}
|
|
119
|
+
`;
|
|
120
|
+
|
|
121
|
+
// src/feedback/FeedbackIssueTemplateRenderer.ts
|
|
122
|
+
var TITLE_MAX = 256;
|
|
123
|
+
var PLACEHOLDER_PATTERN = /\{\{\s*([a-z_]+)\s*\}\}/g;
|
|
124
|
+
var FeedbackIssueTemplateRenderer = class {
|
|
125
|
+
render(template, variables) {
|
|
126
|
+
return template.replace(PLACEHOLDER_PATTERN, (_m, key) => {
|
|
127
|
+
return Object.prototype.hasOwnProperty.call(variables, key) ? variables[key] ?? "" : `{{${key}}}`;
|
|
128
|
+
});
|
|
129
|
+
}
|
|
130
|
+
buildIssue(template, variables, extraLabels = []) {
|
|
131
|
+
const titleTemplate = template.title.trim() || FEEDBACK_ISSUE_DEFAULT_TITLE;
|
|
132
|
+
const title = Array.from(
|
|
133
|
+
this.render(titleTemplate, variables).replace(/\s+/g, " ").trim()
|
|
134
|
+
).slice(0, TITLE_MAX).join("");
|
|
135
|
+
return {
|
|
136
|
+
title,
|
|
137
|
+
body: this.render(template.body, variables).trim(),
|
|
138
|
+
labels: [.../* @__PURE__ */ new Set([...template.labels, ...extraLabels])]
|
|
139
|
+
};
|
|
140
|
+
}
|
|
141
|
+
};
|
|
142
|
+
|
|
143
|
+
// src/github/GithubAppClient.ts
|
|
144
|
+
var import_jsonwebtoken = __toESM(require("jsonwebtoken"), 1);
|
|
145
|
+
|
|
146
|
+
// src/errors/IssueForgeError.ts
|
|
147
|
+
var IssueForgeError = class extends Error {
|
|
148
|
+
code = "ISSUE_FORGE_FAILED";
|
|
149
|
+
/** HTTP 状态码;网络错误等无响应时为 null */
|
|
150
|
+
status;
|
|
151
|
+
constructor(message, status) {
|
|
152
|
+
super(message);
|
|
153
|
+
this.name = "IssueForgeError";
|
|
154
|
+
this.status = status;
|
|
155
|
+
}
|
|
156
|
+
};
|
|
157
|
+
|
|
158
|
+
// src/github/GithubAppClient.ts
|
|
159
|
+
var APP_JWT_TTL_SEC = 9 * 60;
|
|
160
|
+
var TOKEN_REFRESH_MARGIN_MS = 2 * 60 * 1e3;
|
|
161
|
+
|
|
162
|
+
// src/github/GithubAppRepoContentGateway.ts
|
|
163
|
+
var ACCEPT_RAW = "application/vnd.github.raw+json";
|
|
164
|
+
var GithubAppRepoContentGateway = class {
|
|
165
|
+
constructor(client, config) {
|
|
166
|
+
this.client = client;
|
|
167
|
+
this.config = config;
|
|
168
|
+
}
|
|
169
|
+
/**
|
|
170
|
+
* @override
|
|
171
|
+
*/
|
|
172
|
+
async readTextFile(path) {
|
|
173
|
+
const response = await this.client.request(
|
|
174
|
+
this.config,
|
|
175
|
+
this.contentsPath(path),
|
|
176
|
+
{ method: "GET", accept: ACCEPT_RAW }
|
|
177
|
+
);
|
|
178
|
+
if (response.status === 404) {
|
|
179
|
+
return null;
|
|
180
|
+
}
|
|
181
|
+
if (!response.ok) {
|
|
182
|
+
throw await this.client.toError("read file", response);
|
|
183
|
+
}
|
|
184
|
+
return response.text();
|
|
185
|
+
}
|
|
186
|
+
/**
|
|
187
|
+
* @override
|
|
188
|
+
*/
|
|
189
|
+
async hasFile(path, branch) {
|
|
190
|
+
const response = await this.client.request(
|
|
191
|
+
this.config,
|
|
192
|
+
`${this.contentsPath(path)}?ref=${encodeURIComponent(branch)}`,
|
|
193
|
+
{ method: "GET" }
|
|
194
|
+
);
|
|
195
|
+
if (response.status === 404) {
|
|
196
|
+
return false;
|
|
197
|
+
}
|
|
198
|
+
if (!response.ok) {
|
|
199
|
+
throw await this.client.toError("has file", response);
|
|
200
|
+
}
|
|
201
|
+
return true;
|
|
202
|
+
}
|
|
203
|
+
/**
|
|
204
|
+
* @override
|
|
205
|
+
*/
|
|
206
|
+
async ensureBranch(branch, initialFile) {
|
|
207
|
+
const found = await this.client.request(
|
|
208
|
+
this.config,
|
|
209
|
+
`${this.repoPath()}/git/ref/heads/${this.encodePath(branch)}`,
|
|
210
|
+
{ method: "GET" }
|
|
211
|
+
);
|
|
212
|
+
if (found.ok) {
|
|
213
|
+
return;
|
|
214
|
+
}
|
|
215
|
+
if (found.status !== 404) {
|
|
216
|
+
throw await this.client.toError("get branch", found);
|
|
217
|
+
}
|
|
218
|
+
const treeSha = await this.postForSha("create tree", "/git/trees", {
|
|
219
|
+
tree: [
|
|
220
|
+
{
|
|
221
|
+
path: initialFile.path,
|
|
222
|
+
mode: "100644",
|
|
223
|
+
type: "blob",
|
|
224
|
+
content: initialFile.content
|
|
225
|
+
}
|
|
226
|
+
]
|
|
227
|
+
});
|
|
228
|
+
const commitSha = await this.postForSha("create commit", "/git/commits", {
|
|
229
|
+
message: `chore: \u521D\u59CB\u5316 ${branch} \u5206\u652F`,
|
|
230
|
+
tree: treeSha,
|
|
231
|
+
parents: []
|
|
232
|
+
});
|
|
233
|
+
const created = await this.client.request(
|
|
234
|
+
this.config,
|
|
235
|
+
`${this.repoPath()}/git/refs`,
|
|
236
|
+
{
|
|
237
|
+
method: "POST",
|
|
238
|
+
body: { ref: `refs/heads/${branch}`, sha: commitSha }
|
|
239
|
+
}
|
|
240
|
+
);
|
|
241
|
+
if (!created.ok && created.status !== 422) {
|
|
242
|
+
throw await this.client.toError("create branch", created);
|
|
243
|
+
}
|
|
244
|
+
}
|
|
245
|
+
/**
|
|
246
|
+
* @override
|
|
247
|
+
*/
|
|
248
|
+
async uploadFile(input) {
|
|
249
|
+
const response = await this.client.request(
|
|
250
|
+
this.config,
|
|
251
|
+
this.contentsPath(input.path),
|
|
252
|
+
{
|
|
253
|
+
method: "PUT",
|
|
254
|
+
body: {
|
|
255
|
+
message: input.message,
|
|
256
|
+
content: input.contentBase64,
|
|
257
|
+
branch: input.branch
|
|
258
|
+
}
|
|
259
|
+
}
|
|
260
|
+
);
|
|
261
|
+
if (response.ok) {
|
|
262
|
+
const json = await response.json();
|
|
263
|
+
return { url: this.requireHtmlUrl(json.content?.html_url, response) };
|
|
264
|
+
}
|
|
265
|
+
if (response.status === 422) {
|
|
266
|
+
return this.readExisting(input);
|
|
267
|
+
}
|
|
268
|
+
throw await this.client.toError("upload file", response);
|
|
269
|
+
}
|
|
270
|
+
async readExisting(input) {
|
|
271
|
+
const response = await this.client.request(
|
|
272
|
+
this.config,
|
|
273
|
+
`${this.contentsPath(input.path)}?ref=${encodeURIComponent(input.branch)}`,
|
|
274
|
+
{ method: "GET" }
|
|
275
|
+
);
|
|
276
|
+
if (!response.ok) {
|
|
277
|
+
throw await this.client.toError("upload file", response);
|
|
278
|
+
}
|
|
279
|
+
const json = await response.json();
|
|
280
|
+
return { url: this.requireHtmlUrl(json.html_url, response) };
|
|
281
|
+
}
|
|
282
|
+
async postForSha(stage, path, body) {
|
|
283
|
+
const response = await this.client.request(
|
|
284
|
+
this.config,
|
|
285
|
+
`${this.repoPath()}${path}`,
|
|
286
|
+
{ method: "POST", body }
|
|
287
|
+
);
|
|
288
|
+
if (!response.ok) {
|
|
289
|
+
throw await this.client.toError(stage, response);
|
|
290
|
+
}
|
|
291
|
+
const json = await response.json();
|
|
292
|
+
if (typeof json.sha !== "string" || !json.sha) {
|
|
293
|
+
throw new IssueForgeError(
|
|
294
|
+
`${stage}: unexpected response`,
|
|
295
|
+
response.status
|
|
296
|
+
);
|
|
297
|
+
}
|
|
298
|
+
return json.sha;
|
|
299
|
+
}
|
|
300
|
+
requireHtmlUrl(value, response) {
|
|
301
|
+
if (typeof value !== "string" || !value) {
|
|
302
|
+
throw new IssueForgeError(
|
|
303
|
+
"upload file: unexpected response",
|
|
304
|
+
response.status
|
|
305
|
+
);
|
|
306
|
+
}
|
|
307
|
+
return value;
|
|
308
|
+
}
|
|
309
|
+
contentsPath(path) {
|
|
310
|
+
return `${this.repoPath()}/contents/${this.encodePath(path)}`;
|
|
311
|
+
}
|
|
312
|
+
encodePath(path) {
|
|
313
|
+
return path.split("/").filter((segment) => segment.length > 0).map((segment) => encodeURIComponent(segment)).join("/");
|
|
314
|
+
}
|
|
315
|
+
repoPath() {
|
|
316
|
+
return `/repos/${encodeURIComponent(this.config.owner)}/${encodeURIComponent(this.config.repo)}`;
|
|
317
|
+
}
|
|
318
|
+
};
|
|
319
|
+
|
|
320
|
+
// src/github/GithubAppIssueForgeGateway.ts
|
|
321
|
+
var COMMENTS_PAGE_SIZE = 100;
|
|
322
|
+
var GithubAppIssueForgeGateway = class {
|
|
323
|
+
constructor(client, config) {
|
|
324
|
+
this.client = client;
|
|
325
|
+
this.config = config;
|
|
326
|
+
this.assets = new GithubAppRepoContentGateway(client, config);
|
|
327
|
+
}
|
|
328
|
+
assets;
|
|
329
|
+
/**
|
|
330
|
+
* @override
|
|
331
|
+
*/
|
|
332
|
+
async createIssue(input) {
|
|
333
|
+
const first = await this.postIssue(input, input.labels);
|
|
334
|
+
if (first.ok) {
|
|
335
|
+
return this.readCreated(first);
|
|
336
|
+
}
|
|
337
|
+
if (first.status === 422 && input.labels.length > 0) {
|
|
338
|
+
const retry = await this.postIssue(input, []);
|
|
339
|
+
if (retry.ok) {
|
|
340
|
+
return this.readCreated(retry);
|
|
341
|
+
}
|
|
342
|
+
throw await this.client.toError("create issue", retry);
|
|
343
|
+
}
|
|
344
|
+
throw await this.client.toError("create issue", first);
|
|
345
|
+
}
|
|
346
|
+
/**
|
|
347
|
+
* @override
|
|
348
|
+
*/
|
|
349
|
+
async createComment(issue, body) {
|
|
350
|
+
const response = await this.client.request(
|
|
351
|
+
this.config,
|
|
352
|
+
`${this.repoPath()}/issues/${String(issue.issueNumber)}/comments`,
|
|
353
|
+
{ method: "POST", body: { body } }
|
|
354
|
+
);
|
|
355
|
+
if (!response.ok) {
|
|
356
|
+
throw await this.client.toError("create comment", response);
|
|
357
|
+
}
|
|
358
|
+
}
|
|
359
|
+
/**
|
|
360
|
+
* @override
|
|
361
|
+
*/
|
|
362
|
+
async listComments(issue) {
|
|
363
|
+
const comments = [];
|
|
364
|
+
let page = 1;
|
|
365
|
+
for (; ; ) {
|
|
366
|
+
const response = await this.client.request(
|
|
367
|
+
this.config,
|
|
368
|
+
`${this.repoPath()}/issues/${String(issue.issueNumber)}/comments?per_page=${String(COMMENTS_PAGE_SIZE)}&page=${String(page)}`,
|
|
369
|
+
{ method: "GET" }
|
|
370
|
+
);
|
|
371
|
+
if (!response.ok) {
|
|
372
|
+
throw await this.client.toError("list comments", response);
|
|
373
|
+
}
|
|
374
|
+
const json = await response.json();
|
|
375
|
+
for (const item of json) {
|
|
376
|
+
if (typeof item.body === "string") {
|
|
377
|
+
comments.push({ body: item.body });
|
|
378
|
+
}
|
|
379
|
+
}
|
|
380
|
+
if (json.length < COMMENTS_PAGE_SIZE) {
|
|
381
|
+
break;
|
|
382
|
+
}
|
|
383
|
+
page += 1;
|
|
384
|
+
}
|
|
385
|
+
return comments;
|
|
386
|
+
}
|
|
387
|
+
/**
|
|
388
|
+
* @override
|
|
389
|
+
*/
|
|
390
|
+
async uploadAsset(input) {
|
|
391
|
+
const branch = input.branch?.trim() || "feedback-assets";
|
|
392
|
+
await this.assets.uploadFile({
|
|
393
|
+
path: input.path,
|
|
394
|
+
contentBase64: input.contentBase64,
|
|
395
|
+
branch,
|
|
396
|
+
message: input.message?.trim() || `chore(feedback): upload ${input.path}`
|
|
397
|
+
});
|
|
398
|
+
const encodedPath = input.path.split("/").filter((segment) => segment.length > 0).map((segment) => encodeURIComponent(segment)).join("/");
|
|
399
|
+
return {
|
|
400
|
+
url: `https://github.com/${encodeURIComponent(this.config.owner)}/${encodeURIComponent(this.config.repo)}/raw/${encodeURIComponent(branch)}/${encodedPath}`
|
|
401
|
+
};
|
|
402
|
+
}
|
|
403
|
+
postIssue(input, labels) {
|
|
404
|
+
return this.client.request(this.config, `${this.repoPath()}/issues`, {
|
|
405
|
+
method: "POST",
|
|
406
|
+
body: {
|
|
407
|
+
title: input.title,
|
|
408
|
+
body: input.body,
|
|
409
|
+
...labels.length > 0 ? { labels: [...labels] } : {}
|
|
410
|
+
}
|
|
411
|
+
});
|
|
412
|
+
}
|
|
413
|
+
async readCreated(response) {
|
|
414
|
+
const json = await response.json();
|
|
415
|
+
if (typeof json.number !== "number" || typeof json.html_url !== "string") {
|
|
416
|
+
throw new IssueForgeError(
|
|
417
|
+
"create issue: unexpected response",
|
|
418
|
+
response.status
|
|
419
|
+
);
|
|
420
|
+
}
|
|
421
|
+
return {
|
|
422
|
+
issueNumber: json.number,
|
|
423
|
+
issueUrl: json.html_url,
|
|
424
|
+
...typeof json.node_id === "string" ? { resourceKey: json.node_id } : {}
|
|
425
|
+
};
|
|
426
|
+
}
|
|
427
|
+
repoPath() {
|
|
428
|
+
return `/repos/${encodeURIComponent(this.config.owner)}/${encodeURIComponent(this.config.repo)}`;
|
|
429
|
+
}
|
|
430
|
+
};
|
|
431
|
+
|
|
432
|
+
// src/github/createGithubAppForge.ts
|
|
433
|
+
function createGithubAppIssueForge(client, config) {
|
|
434
|
+
return new GithubAppIssueForgeGateway(client, config);
|
|
435
|
+
}
|
|
436
|
+
function createGithubAppRepoContent(client, config) {
|
|
437
|
+
return new GithubAppRepoContentGateway(client, config);
|
|
438
|
+
}
|
|
439
|
+
|
|
440
|
+
// src/feedback/FeedbackIssueTemplateResolver.ts
|
|
441
|
+
var FeedbackIssueTemplateResolver = class {
|
|
442
|
+
client;
|
|
443
|
+
cache;
|
|
444
|
+
logger;
|
|
445
|
+
defaultTemplate;
|
|
446
|
+
constructor(options) {
|
|
447
|
+
this.client = options.client;
|
|
448
|
+
this.cache = options.cache;
|
|
449
|
+
this.logger = options.logger;
|
|
450
|
+
this.defaultTemplate = options.defaultTemplate ?? FEEDBACK_ISSUE_DEFAULT_TEMPLATE;
|
|
451
|
+
}
|
|
452
|
+
async resolve(config) {
|
|
453
|
+
const raw = await this.loadRaw(config);
|
|
454
|
+
if (raw) {
|
|
455
|
+
const template = this.parse(raw, FeedbackIssueTemplateSource.repo);
|
|
456
|
+
if (template.body) {
|
|
457
|
+
return template;
|
|
458
|
+
}
|
|
459
|
+
}
|
|
460
|
+
return this.parse(
|
|
461
|
+
this.defaultTemplate,
|
|
462
|
+
FeedbackIssueTemplateSource.builtin
|
|
463
|
+
);
|
|
464
|
+
}
|
|
465
|
+
async loadRaw(config) {
|
|
466
|
+
const cacheKey = `issue-forge:feedback:issue-template:${config.owner}/${config.repo}`;
|
|
467
|
+
const cached = await this.cache.getItem(cacheKey);
|
|
468
|
+
if (cached) {
|
|
469
|
+
return cached.raw;
|
|
470
|
+
}
|
|
471
|
+
try {
|
|
472
|
+
const content = createGithubAppRepoContent(this.client, config);
|
|
473
|
+
const raw = await content.readTextFile(FEEDBACK_ISSUE_TEMPLATE_PATH);
|
|
474
|
+
await this.cache.setItem(
|
|
475
|
+
cacheKey,
|
|
476
|
+
{ raw },
|
|
477
|
+
{ ttlMs: FEEDBACK_ISSUE_TEMPLATE_CACHE_TTL_MS }
|
|
478
|
+
);
|
|
479
|
+
return raw;
|
|
480
|
+
} catch (error) {
|
|
481
|
+
this.logger?.warn("feedback issue template load failed", {
|
|
482
|
+
message: error instanceof Error ? error.message : String(error)
|
|
483
|
+
});
|
|
484
|
+
await this.cache.setItem(
|
|
485
|
+
cacheKey,
|
|
486
|
+
{ raw: null },
|
|
487
|
+
{ ttlMs: FEEDBACK_ISSUE_TEMPLATE_FAILURE_TTL_MS }
|
|
488
|
+
);
|
|
489
|
+
return null;
|
|
490
|
+
}
|
|
491
|
+
}
|
|
492
|
+
parse(raw, source) {
|
|
493
|
+
const trimmed = raw.replace(/^\uFEFF/, "").trim();
|
|
494
|
+
if (!trimmed.startsWith("---")) {
|
|
495
|
+
return { title: "", labels: ["feedback"], body: trimmed, source };
|
|
496
|
+
}
|
|
497
|
+
const end = trimmed.indexOf("\n---", 3);
|
|
498
|
+
if (end < 0) {
|
|
499
|
+
return { title: "", labels: ["feedback"], body: trimmed, source };
|
|
500
|
+
}
|
|
501
|
+
const front = trimmed.slice(3, end).trim();
|
|
502
|
+
const body = trimmed.slice(end + 4).replace(/^\r?\n/, "");
|
|
503
|
+
const meta = this.parseFrontMatter(front);
|
|
504
|
+
const title = typeof meta.title === "string" ? meta.title : Array.isArray(meta.title) ? meta.title[0] ?? "" : "";
|
|
505
|
+
const labelsRaw = meta.labels;
|
|
506
|
+
const labels = Array.isArray(labelsRaw) ? labelsRaw.map(String) : typeof labelsRaw === "string" ? labelsRaw.split(",").map((s) => s.trim()).filter(Boolean) : ["feedback"];
|
|
507
|
+
return { title, labels, body, source };
|
|
508
|
+
}
|
|
509
|
+
parseFrontMatter(front) {
|
|
510
|
+
const out = {};
|
|
511
|
+
for (const line of front.split(/\r?\n/)) {
|
|
512
|
+
const idx = line.indexOf(":");
|
|
513
|
+
if (idx < 0) continue;
|
|
514
|
+
const key = line.slice(0, idx).trim();
|
|
515
|
+
let value = line.slice(idx + 1).trim();
|
|
516
|
+
if (value.startsWith('"') && value.endsWith('"') || value.startsWith("'") && value.endsWith("'")) {
|
|
517
|
+
value = value.slice(1, -1);
|
|
518
|
+
}
|
|
519
|
+
if (key === "labels" && value.includes(",")) {
|
|
520
|
+
out[key] = value.split(",").map((s) => s.trim()).filter(Boolean);
|
|
521
|
+
} else {
|
|
522
|
+
out[key] = value;
|
|
523
|
+
}
|
|
524
|
+
}
|
|
525
|
+
return out;
|
|
526
|
+
}
|
|
527
|
+
};
|
|
528
|
+
|
|
529
|
+
// src/feedback/FeedbackIssueStatusResolver.ts
|
|
530
|
+
var ISSUE_ACTION_CLOSED = "closed";
|
|
531
|
+
var ISSUE_ACTION_REOPENED = "reopened";
|
|
532
|
+
var REASON_NOT_PLANNED = "not_planned";
|
|
533
|
+
var REASON_DUPLICATE = "duplicate";
|
|
534
|
+
var FeedbackIssueStatusResolver = class {
|
|
535
|
+
resolve(event) {
|
|
536
|
+
if (event.action === ISSUE_ACTION_REOPENED) {
|
|
537
|
+
return FeedbackIssueStatus.open;
|
|
538
|
+
}
|
|
539
|
+
if (event.action !== ISSUE_ACTION_CLOSED) {
|
|
540
|
+
return null;
|
|
541
|
+
}
|
|
542
|
+
const reason = event.issue.state_reason ?? null;
|
|
543
|
+
if (reason === REASON_NOT_PLANNED || reason === REASON_DUPLICATE) {
|
|
544
|
+
return FeedbackIssueStatus.closed;
|
|
545
|
+
}
|
|
546
|
+
return FeedbackIssueStatus.resolved;
|
|
547
|
+
}
|
|
548
|
+
};
|
|
549
|
+
|
|
550
|
+
// src/feedback/FeedbackIssueSyncEngine.ts
|
|
551
|
+
var FeedbackIssueSyncEngine = class {
|
|
552
|
+
host;
|
|
553
|
+
client;
|
|
554
|
+
templateResolver;
|
|
555
|
+
renderer;
|
|
556
|
+
screenshotSync;
|
|
557
|
+
logger;
|
|
558
|
+
constructor(options) {
|
|
559
|
+
this.host = options.host;
|
|
560
|
+
this.client = options.client;
|
|
561
|
+
this.templateResolver = options.templateResolver;
|
|
562
|
+
this.renderer = options.renderer;
|
|
563
|
+
this.screenshotSync = options.screenshotSync;
|
|
564
|
+
this.logger = options.logger;
|
|
565
|
+
}
|
|
566
|
+
async syncFeedback(feedbackId, options = {}) {
|
|
567
|
+
const content = await this.host.resolveIssueContent(feedbackId);
|
|
568
|
+
if (!content) {
|
|
569
|
+
return FeedbackIssueSyncStatus.skipped;
|
|
570
|
+
}
|
|
571
|
+
if (content.issueNumber !== null) {
|
|
572
|
+
await this.screenshotSync.syncScreenshots(feedbackId, options);
|
|
573
|
+
return FeedbackIssueSyncStatus.synced;
|
|
574
|
+
}
|
|
575
|
+
const auth = await this.host.resolveForgeAuth(options);
|
|
576
|
+
if (!auth) {
|
|
577
|
+
await this.host.updateSync(feedbackId, {
|
|
578
|
+
status: FeedbackIssueSyncStatus.skipped,
|
|
579
|
+
issueNumber: null,
|
|
580
|
+
issueUrl: null,
|
|
581
|
+
error: null
|
|
582
|
+
});
|
|
583
|
+
return FeedbackIssueSyncStatus.skipped;
|
|
584
|
+
}
|
|
585
|
+
try {
|
|
586
|
+
const template = await this.templateResolver.resolve(auth);
|
|
587
|
+
const forge = createGithubAppIssueForge(this.client, auth);
|
|
588
|
+
const created = await forge.createIssue(
|
|
589
|
+
this.renderer.buildIssue(
|
|
590
|
+
template,
|
|
591
|
+
content.variables,
|
|
592
|
+
content.labels ?? []
|
|
593
|
+
)
|
|
594
|
+
);
|
|
595
|
+
await this.host.updateSync(feedbackId, {
|
|
596
|
+
status: FeedbackIssueSyncStatus.synced,
|
|
597
|
+
issueNumber: created.issueNumber,
|
|
598
|
+
issueUrl: created.issueUrl,
|
|
599
|
+
error: null
|
|
600
|
+
});
|
|
601
|
+
} catch (error) {
|
|
602
|
+
const message = error instanceof Error ? error.message : String(error);
|
|
603
|
+
this.logger?.error("feedback github sync failed", {
|
|
604
|
+
feedbackId,
|
|
605
|
+
message
|
|
606
|
+
});
|
|
607
|
+
await this.host.updateSync(feedbackId, {
|
|
608
|
+
status: FeedbackIssueSyncStatus.failed,
|
|
609
|
+
issueNumber: null,
|
|
610
|
+
issueUrl: null,
|
|
611
|
+
error: message
|
|
612
|
+
});
|
|
613
|
+
return FeedbackIssueSyncStatus.failed;
|
|
614
|
+
}
|
|
615
|
+
await this.screenshotSync.syncScreenshots(feedbackId, options);
|
|
616
|
+
return FeedbackIssueSyncStatus.synced;
|
|
617
|
+
}
|
|
618
|
+
};
|
|
619
|
+
|
|
620
|
+
// src/feedback/FeedbackIssueScreenshotSyncEngine.ts
|
|
621
|
+
var ISSUE_NUMBER_RETRY_DELAYS_MS = [
|
|
622
|
+
200,
|
|
623
|
+
400,
|
|
624
|
+
800,
|
|
625
|
+
800,
|
|
626
|
+
800
|
|
627
|
+
];
|
|
628
|
+
var SCREENSHOT_ERROR_PREFIX = "screenshot: ";
|
|
629
|
+
var FeedbackIssueScreenshotSyncEngine = class _FeedbackIssueScreenshotSyncEngine {
|
|
630
|
+
host;
|
|
631
|
+
client;
|
|
632
|
+
logger;
|
|
633
|
+
sleep;
|
|
634
|
+
constructor(options) {
|
|
635
|
+
this.host = options.host;
|
|
636
|
+
this.client = options.client;
|
|
637
|
+
this.logger = options.logger;
|
|
638
|
+
this.sleep = options.sleep ?? ((ms) => new Promise((resolve) => {
|
|
639
|
+
setTimeout(resolve, ms);
|
|
640
|
+
}));
|
|
641
|
+
}
|
|
642
|
+
/**
|
|
643
|
+
* 本地已清理后:用落库的 GitHub raw URL 检查 Issue 评论,缺失则补发(不碰 Storage)。
|
|
644
|
+
*/
|
|
645
|
+
async ensureGithubScreenshotComments(feedbackId, options = {}) {
|
|
646
|
+
const state = await this.host.findScreenshotState(feedbackId);
|
|
647
|
+
if (!state || state.issueNumber === null || state.githubUrls.length === 0) {
|
|
648
|
+
return 0;
|
|
649
|
+
}
|
|
650
|
+
const auth = await this.host.resolveForgeAuth(options);
|
|
651
|
+
if (!auth) {
|
|
652
|
+
return 0;
|
|
653
|
+
}
|
|
654
|
+
const issueNumber = state.issueNumber;
|
|
655
|
+
const urls = state.githubUrls;
|
|
656
|
+
try {
|
|
657
|
+
const forge = createGithubAppIssueForge(this.client, auth);
|
|
658
|
+
const comments = await forge.listComments({ issueNumber });
|
|
659
|
+
const alreadyPosted = urls.every(
|
|
660
|
+
(url) => comments.some((comment) => comment.body.includes(url))
|
|
661
|
+
);
|
|
662
|
+
if (alreadyPosted) {
|
|
663
|
+
return 0;
|
|
664
|
+
}
|
|
665
|
+
await forge.createComment(
|
|
666
|
+
{ issueNumber },
|
|
667
|
+
this.host.formatScreenshotComment(urls, 0)
|
|
668
|
+
);
|
|
669
|
+
await this.host.updateSync(feedbackId, {
|
|
670
|
+
status: FeedbackIssueSyncStatus.synced,
|
|
671
|
+
issueNumber,
|
|
672
|
+
issueUrl: state.issueUrl,
|
|
673
|
+
error: null
|
|
674
|
+
});
|
|
675
|
+
return urls.length;
|
|
676
|
+
} catch (error) {
|
|
677
|
+
const message = error instanceof Error ? error.message : String(error);
|
|
678
|
+
this.logger?.error("feedback screenshot comment ensure failed", {
|
|
679
|
+
feedbackId,
|
|
680
|
+
message
|
|
681
|
+
});
|
|
682
|
+
await this.host.updateSync(feedbackId, {
|
|
683
|
+
status: FeedbackIssueSyncStatus.synced,
|
|
684
|
+
issueNumber,
|
|
685
|
+
issueUrl: state.issueUrl,
|
|
686
|
+
error: `${SCREENSHOT_ERROR_PREFIX}${message}`
|
|
687
|
+
}).catch(() => void 0);
|
|
688
|
+
return 0;
|
|
689
|
+
}
|
|
690
|
+
}
|
|
691
|
+
async syncScreenshots(feedbackId, options = {}) {
|
|
692
|
+
let state = await this.host.findScreenshotState(feedbackId);
|
|
693
|
+
if (!state || state.paths.length <= state.postedCount) {
|
|
694
|
+
return 0;
|
|
695
|
+
}
|
|
696
|
+
if (state.issueNumber === null) {
|
|
697
|
+
state = await this.waitForIssueNumber(feedbackId, state);
|
|
698
|
+
if (!state || state.issueNumber === null || state.paths.length <= state.postedCount) {
|
|
699
|
+
this.logger?.warn("feedback screenshot sync skipped: issue not ready", {
|
|
700
|
+
feedbackId
|
|
701
|
+
});
|
|
702
|
+
return 0;
|
|
703
|
+
}
|
|
704
|
+
}
|
|
705
|
+
const auth = await this.host.resolveForgeAuth(options);
|
|
706
|
+
if (!auth) {
|
|
707
|
+
return 0;
|
|
708
|
+
}
|
|
709
|
+
const issueNumber = state.issueNumber;
|
|
710
|
+
const from = state.postedCount;
|
|
711
|
+
const to = state.paths.length;
|
|
712
|
+
const claimed = await this.host.compareAndSetScreenshotCount(
|
|
713
|
+
feedbackId,
|
|
714
|
+
from,
|
|
715
|
+
to
|
|
716
|
+
);
|
|
717
|
+
if (!claimed) {
|
|
718
|
+
return 0;
|
|
719
|
+
}
|
|
720
|
+
const localPaths = state.paths.slice(from);
|
|
721
|
+
try {
|
|
722
|
+
const urls = await this.uploadScreenshots(auth, feedbackId, localPaths);
|
|
723
|
+
const forge = createGithubAppIssueForge(this.client, auth);
|
|
724
|
+
const comments = await forge.listComments({ issueNumber });
|
|
725
|
+
const alreadyPosted = urls.every(
|
|
726
|
+
(url) => comments.some((comment) => comment.body.includes(url))
|
|
727
|
+
);
|
|
728
|
+
if (!alreadyPosted) {
|
|
729
|
+
await forge.createComment(
|
|
730
|
+
{ issueNumber },
|
|
731
|
+
this.host.formatScreenshotComment(urls, from)
|
|
732
|
+
);
|
|
733
|
+
}
|
|
734
|
+
await this.host.updateSync(feedbackId, {
|
|
735
|
+
status: FeedbackIssueSyncStatus.synced,
|
|
736
|
+
issueNumber,
|
|
737
|
+
issueUrl: state.issueUrl,
|
|
738
|
+
error: null
|
|
739
|
+
});
|
|
740
|
+
await this.host.releaseLocalScreenshotsAfterGithub(feedbackId, urls, localPaths).catch((cleanupError) => {
|
|
741
|
+
const message = cleanupError instanceof Error ? cleanupError.message : String(cleanupError);
|
|
742
|
+
this.logger?.error("feedback screenshot local cleanup failed", {
|
|
743
|
+
feedbackId,
|
|
744
|
+
message
|
|
745
|
+
});
|
|
746
|
+
});
|
|
747
|
+
return urls.length;
|
|
748
|
+
} catch (error) {
|
|
749
|
+
const message = error instanceof Error ? error.message : String(error);
|
|
750
|
+
this.logger?.error("feedback screenshot sync failed", {
|
|
751
|
+
feedbackId,
|
|
752
|
+
message
|
|
753
|
+
});
|
|
754
|
+
await this.host.compareAndSetScreenshotCount(feedbackId, to, from).catch(() => false);
|
|
755
|
+
await this.host.updateSync(feedbackId, {
|
|
756
|
+
status: FeedbackIssueSyncStatus.synced,
|
|
757
|
+
issueNumber,
|
|
758
|
+
issueUrl: state.issueUrl,
|
|
759
|
+
error: `${SCREENSHOT_ERROR_PREFIX}${message}`
|
|
760
|
+
}).catch(() => void 0);
|
|
761
|
+
return 0;
|
|
762
|
+
}
|
|
763
|
+
}
|
|
764
|
+
/**
|
|
765
|
+
* 私有仓 Issue Markdown 可渲染的 raw URL(同源 cookie,避免 raw.githubusercontent.com)。
|
|
766
|
+
*/
|
|
767
|
+
static buildRawAssetUrl(auth, branch, path) {
|
|
768
|
+
const encodedPath = path.split("/").filter((segment) => segment.length > 0).map((segment) => encodeURIComponent(segment)).join("/");
|
|
769
|
+
return `https://github.com/${encodeURIComponent(auth.owner)}/${encodeURIComponent(auth.repo)}/raw/${encodeURIComponent(branch)}/${encodedPath}`;
|
|
770
|
+
}
|
|
771
|
+
async waitForIssueNumber(feedbackId, initial) {
|
|
772
|
+
let latest = initial;
|
|
773
|
+
for (const delayMs of ISSUE_NUMBER_RETRY_DELAYS_MS) {
|
|
774
|
+
await this.sleep(delayMs);
|
|
775
|
+
latest = await this.host.findScreenshotState(feedbackId);
|
|
776
|
+
if (latest?.issueNumber !== null && latest?.issueNumber !== void 0) {
|
|
777
|
+
return latest;
|
|
778
|
+
}
|
|
779
|
+
}
|
|
780
|
+
return latest;
|
|
781
|
+
}
|
|
782
|
+
async uploadScreenshots(auth, feedbackId, objectPaths) {
|
|
783
|
+
const content = createGithubAppRepoContent(this.client, auth);
|
|
784
|
+
await content.ensureBranch(FEEDBACK_ISSUE_ASSETS_BRANCH, {
|
|
785
|
+
path: "README.md",
|
|
786
|
+
content: FEEDBACK_ISSUE_ASSETS_README
|
|
787
|
+
});
|
|
788
|
+
const urls = [];
|
|
789
|
+
for (const [index, objectPath] of objectPaths.entries()) {
|
|
790
|
+
const fileName = objectPath.split("/").pop() || `${String(index)}.jpg`;
|
|
791
|
+
const repoPath = `${FEEDBACK_ISSUE_ASSETS_DIR}/${feedbackId}/${fileName}`;
|
|
792
|
+
const alreadyOnBranch = await content.hasFile(
|
|
793
|
+
repoPath,
|
|
794
|
+
FEEDBACK_ISSUE_ASSETS_BRANCH
|
|
795
|
+
);
|
|
796
|
+
if (!alreadyOnBranch) {
|
|
797
|
+
const bytes = await this.host.downloadScreenshot(objectPath);
|
|
798
|
+
await content.uploadFile({
|
|
799
|
+
branch: FEEDBACK_ISSUE_ASSETS_BRANCH,
|
|
800
|
+
path: repoPath,
|
|
801
|
+
contentBase64: bytes.toString("base64"),
|
|
802
|
+
message: `chore(feedback): feedback ${feedbackId} screenshot`
|
|
803
|
+
});
|
|
804
|
+
}
|
|
805
|
+
urls.push(
|
|
806
|
+
_FeedbackIssueScreenshotSyncEngine.buildRawAssetUrl(
|
|
807
|
+
auth,
|
|
808
|
+
FEEDBACK_ISSUE_ASSETS_BRANCH,
|
|
809
|
+
repoPath
|
|
810
|
+
)
|
|
811
|
+
);
|
|
812
|
+
}
|
|
813
|
+
return urls;
|
|
814
|
+
}
|
|
815
|
+
};
|
|
816
|
+
|
|
817
|
+
// src/feedback/FeedbackIssueStatusSyncEngine.ts
|
|
818
|
+
var FeedbackIssueStatusSyncEngine = class {
|
|
819
|
+
host;
|
|
820
|
+
statusResolver;
|
|
821
|
+
logger;
|
|
822
|
+
constructor(options) {
|
|
823
|
+
this.host = options.host;
|
|
824
|
+
this.statusResolver = options.statusResolver ?? new FeedbackIssueStatusResolver();
|
|
825
|
+
this.logger = options.logger;
|
|
826
|
+
}
|
|
827
|
+
async applyIssueEvent(event) {
|
|
828
|
+
const status = this.statusResolver.resolve(event);
|
|
829
|
+
if (status === null) {
|
|
830
|
+
return 0;
|
|
831
|
+
}
|
|
832
|
+
if (!await this.isFeedbackRepo(event.repository.full_name)) {
|
|
833
|
+
this.logger?.warn("feedback status sync skipped: repo mismatch", {
|
|
834
|
+
repo: event.repository.full_name
|
|
835
|
+
});
|
|
836
|
+
return 0;
|
|
837
|
+
}
|
|
838
|
+
const updated = await this.host.updateStatusByIssueNumber(
|
|
839
|
+
event.issue.number,
|
|
840
|
+
status
|
|
841
|
+
);
|
|
842
|
+
if (updated > 0) {
|
|
843
|
+
this.logger?.info("feedback status synced from github issue", {
|
|
844
|
+
issueNumber: event.issue.number,
|
|
845
|
+
action: event.action,
|
|
846
|
+
status,
|
|
847
|
+
updated
|
|
848
|
+
});
|
|
849
|
+
}
|
|
850
|
+
return updated;
|
|
851
|
+
}
|
|
852
|
+
async isFeedbackRepo(fullName) {
|
|
853
|
+
const repo = await this.host.getFeedbackRepoFullName();
|
|
854
|
+
return repo.toLowerCase() === fullName.trim().toLowerCase();
|
|
855
|
+
}
|
|
856
|
+
};
|
|
857
|
+
|
|
858
|
+
// src/feedback/createGithubFeedbackIssueBundle.ts
|
|
859
|
+
function createGithubFeedbackIssueBundle(options) {
|
|
860
|
+
const renderer = new FeedbackIssueTemplateRenderer();
|
|
861
|
+
const templateResolver = new FeedbackIssueTemplateResolver({
|
|
862
|
+
client: options.client,
|
|
863
|
+
cache: options.cache,
|
|
864
|
+
logger: options.logger,
|
|
865
|
+
defaultTemplate: options.defaultTemplate
|
|
866
|
+
});
|
|
867
|
+
const screenshots = new FeedbackIssueScreenshotSyncEngine({
|
|
868
|
+
host: options.host,
|
|
869
|
+
client: options.client,
|
|
870
|
+
logger: options.logger
|
|
871
|
+
});
|
|
872
|
+
const sync = new FeedbackIssueSyncEngine({
|
|
873
|
+
host: options.host,
|
|
874
|
+
client: options.client,
|
|
875
|
+
templateResolver,
|
|
876
|
+
renderer,
|
|
877
|
+
screenshotSync: screenshots,
|
|
878
|
+
logger: options.logger
|
|
879
|
+
});
|
|
880
|
+
const status = new FeedbackIssueStatusSyncEngine({
|
|
881
|
+
host: options.host,
|
|
882
|
+
logger: options.logger
|
|
883
|
+
});
|
|
884
|
+
return {
|
|
885
|
+
sync,
|
|
886
|
+
screenshots,
|
|
887
|
+
status,
|
|
888
|
+
renderer,
|
|
889
|
+
templateResolver
|
|
890
|
+
};
|
|
891
|
+
}
|
|
892
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
893
|
+
0 && (module.exports = {
|
|
894
|
+
FEEDBACK_ISSUE_ASSETS_BRANCH,
|
|
895
|
+
FEEDBACK_ISSUE_ASSETS_DIR,
|
|
896
|
+
FEEDBACK_ISSUE_ASSETS_README,
|
|
897
|
+
FEEDBACK_ISSUE_DEFAULT_TEMPLATE,
|
|
898
|
+
FEEDBACK_ISSUE_DEFAULT_TITLE,
|
|
899
|
+
FEEDBACK_ISSUE_TEMPLATE_PATH,
|
|
900
|
+
FeedbackIssueScreenshotSyncEngine,
|
|
901
|
+
FeedbackIssueStatus,
|
|
902
|
+
FeedbackIssueStatusResolver,
|
|
903
|
+
FeedbackIssueStatusSyncEngine,
|
|
904
|
+
FeedbackIssueSyncEngine,
|
|
905
|
+
FeedbackIssueSyncStatus,
|
|
906
|
+
FeedbackIssueTemplateRenderer,
|
|
907
|
+
FeedbackIssueTemplateResolver,
|
|
908
|
+
FeedbackIssueTemplateSource,
|
|
909
|
+
createGithubFeedbackIssueBundle
|
|
910
|
+
});
|
|
911
|
+
//# sourceMappingURL=index.cjs.map
|