paperclip-github-plugin 0.18.0 → 0.20.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/README.md +106 -480
- package/dist/manifest.js +309 -259
- package/dist/ui/index.js +2760 -35023
- package/dist/ui/index.js.map +4 -4
- package/dist/worker.js +2880 -16379
- package/package.json +8 -15
package/dist/manifest.js
CHANGED
|
@@ -4,20 +4,12 @@ import { createRequire } from "node:module";
|
|
|
4
4
|
// src/github-agent-tools.ts
|
|
5
5
|
var repositoryProperty = {
|
|
6
6
|
type: "string",
|
|
7
|
-
description: "GitHub repository as owner/repo or https://github.com/owner/repo.
|
|
7
|
+
description: "GitHub repository as owner/repo or https://github.com/owner/repo."
|
|
8
8
|
};
|
|
9
9
|
var organizationProperty = {
|
|
10
10
|
type: "string",
|
|
11
11
|
description: "GitHub organization login that owns the Projects."
|
|
12
12
|
};
|
|
13
|
-
var paperclipIssueIdProperty = {
|
|
14
|
-
type: "string",
|
|
15
|
-
description: "Paperclip issue id used to infer the linked GitHub issue and repository when available."
|
|
16
|
-
};
|
|
17
|
-
var followThroughAssigneeAgentIdProperty = {
|
|
18
|
-
type: ["string", "null"],
|
|
19
|
-
description: "Optional durable Paperclip agent owner for actionable follow-through on this linked pull request. The agent must belong to the authenticated company. Pass null to clear an existing owner."
|
|
20
|
-
};
|
|
21
13
|
var issueNumberProperty = {
|
|
22
14
|
type: "integer",
|
|
23
15
|
minimum: 1,
|
|
@@ -42,25 +34,60 @@ var llmModelProperty = {
|
|
|
42
34
|
description: "Exact LLM name used to draft the GitHub content. When provided, the plugin includes it in the mandatory AI-authorship footer."
|
|
43
35
|
};
|
|
44
36
|
var issueTargetSchema = {
|
|
45
|
-
|
|
37
|
+
allOf: [
|
|
46
38
|
{
|
|
47
|
-
required: ["
|
|
48
|
-
},
|
|
49
|
-
{
|
|
50
|
-
required: ["issueNumber"]
|
|
39
|
+
required: ["repository", "issueNumber"]
|
|
51
40
|
}
|
|
52
41
|
]
|
|
53
42
|
};
|
|
54
43
|
var pullRequestTargetSchema = {
|
|
55
|
-
|
|
44
|
+
allOf: [
|
|
56
45
|
{
|
|
57
|
-
required: ["
|
|
58
|
-
},
|
|
59
|
-
{
|
|
60
|
-
required: ["pullRequestNumber"]
|
|
46
|
+
required: ["repository", "pullRequestNumber"]
|
|
61
47
|
}
|
|
62
48
|
]
|
|
63
49
|
};
|
|
50
|
+
var checkRunUpdateProperties = {
|
|
51
|
+
status: {
|
|
52
|
+
type: "string",
|
|
53
|
+
enum: ["queued", "in_progress", "completed"],
|
|
54
|
+
description: "Check status. Setting conclusion implies completed."
|
|
55
|
+
},
|
|
56
|
+
conclusion: {
|
|
57
|
+
type: "string",
|
|
58
|
+
enum: ["success", "failure", "neutral", "cancelled", "skipped", "timed_out", "action_required"],
|
|
59
|
+
description: "Required when status is completed."
|
|
60
|
+
},
|
|
61
|
+
title: {
|
|
62
|
+
type: "string",
|
|
63
|
+
description: "Short output title. Requires summary."
|
|
64
|
+
},
|
|
65
|
+
summary: {
|
|
66
|
+
type: "string",
|
|
67
|
+
description: "Markdown output summary, up to 65535 characters. Requires title."
|
|
68
|
+
},
|
|
69
|
+
text: {
|
|
70
|
+
type: "string",
|
|
71
|
+
description: "Optional longer Markdown output details."
|
|
72
|
+
},
|
|
73
|
+
detailsUrl: {
|
|
74
|
+
type: "string",
|
|
75
|
+
description: "Optional link shown as the check details."
|
|
76
|
+
},
|
|
77
|
+
externalId: {
|
|
78
|
+
type: "string",
|
|
79
|
+
description: "Optional caller reference stored on the check run."
|
|
80
|
+
}
|
|
81
|
+
};
|
|
82
|
+
var pullRequestLabelsProperty = {
|
|
83
|
+
type: "array",
|
|
84
|
+
minItems: 1,
|
|
85
|
+
items: {
|
|
86
|
+
type: "string",
|
|
87
|
+
minLength: 1
|
|
88
|
+
},
|
|
89
|
+
description: "Label names."
|
|
90
|
+
};
|
|
64
91
|
var organizationProjectTargetSchema = {
|
|
65
92
|
anyOf: [
|
|
66
93
|
{
|
|
@@ -130,8 +157,7 @@ var GITHUB_AGENT_TOOLS = [
|
|
|
130
157
|
...issueTargetSchema,
|
|
131
158
|
properties: {
|
|
132
159
|
repository: repositoryProperty,
|
|
133
|
-
issueNumber: issueNumberProperty
|
|
134
|
-
paperclipIssueId: paperclipIssueIdProperty
|
|
160
|
+
issueNumber: issueNumberProperty
|
|
135
161
|
}
|
|
136
162
|
}
|
|
137
163
|
},
|
|
@@ -145,8 +171,7 @@ var GITHUB_AGENT_TOOLS = [
|
|
|
145
171
|
...issueTargetSchema,
|
|
146
172
|
properties: {
|
|
147
173
|
repository: repositoryProperty,
|
|
148
|
-
issueNumber: issueNumberProperty
|
|
149
|
-
paperclipIssueId: paperclipIssueIdProperty
|
|
174
|
+
issueNumber: issueNumberProperty
|
|
150
175
|
}
|
|
151
176
|
}
|
|
152
177
|
},
|
|
@@ -161,7 +186,6 @@ var GITHUB_AGENT_TOOLS = [
|
|
|
161
186
|
properties: {
|
|
162
187
|
repository: repositoryProperty,
|
|
163
188
|
issueNumber: issueNumberProperty,
|
|
164
|
-
paperclipIssueId: paperclipIssueIdProperty,
|
|
165
189
|
title: {
|
|
166
190
|
type: "string"
|
|
167
191
|
},
|
|
@@ -238,8 +262,7 @@ var GITHUB_AGENT_TOOLS = [
|
|
|
238
262
|
...issueTargetSchema,
|
|
239
263
|
properties: {
|
|
240
264
|
repository: repositoryProperty,
|
|
241
|
-
issueNumber: issueNumberProperty
|
|
242
|
-
paperclipIssueId: paperclipIssueIdProperty
|
|
265
|
+
issueNumber: issueNumberProperty
|
|
243
266
|
}
|
|
244
267
|
}
|
|
245
268
|
},
|
|
@@ -255,7 +278,6 @@ var GITHUB_AGENT_TOOLS = [
|
|
|
255
278
|
properties: {
|
|
256
279
|
repository: repositoryProperty,
|
|
257
280
|
issueNumber: issueNumberProperty,
|
|
258
|
-
paperclipIssueId: paperclipIssueIdProperty,
|
|
259
281
|
body: {
|
|
260
282
|
type: "string",
|
|
261
283
|
minLength: 1,
|
|
@@ -265,76 +287,6 @@ var GITHUB_AGENT_TOOLS = [
|
|
|
265
287
|
}
|
|
266
288
|
}
|
|
267
289
|
},
|
|
268
|
-
{
|
|
269
|
-
name: "create_pull_request",
|
|
270
|
-
displayName: "Create Pull Request",
|
|
271
|
-
description: "Publish the local branch at the exact requested commit, verify the remote branch, then create and link a GitHub pull request in one operation. Optional labels and reviewer requests are applied right after creation and reported back; a failure in those follow-up steps does not undo the pull request. The GitHub credential remains inside the trusted plugin worker. When a non-empty body is provided, the plugin appends an AI-authorship footer and includes llmModel when supplied.",
|
|
272
|
-
parametersSchema: {
|
|
273
|
-
type: "object",
|
|
274
|
-
additionalProperties: false,
|
|
275
|
-
required: ["paperclipIssueId", "head", "headCommitSha", "base", "title"],
|
|
276
|
-
properties: {
|
|
277
|
-
repository: {
|
|
278
|
-
type: "string",
|
|
279
|
-
description: "Target GitHub repository as owner/repo or https://github.com/owner/repo. It may be outside Paperclip repository mappings. Omit only when the issue project has exactly one mapped repository."
|
|
280
|
-
},
|
|
281
|
-
workspaceRelativePath: {
|
|
282
|
-
type: "string",
|
|
283
|
-
description: "Optional path to the local Git checkout, relative to the trusted issue execution workspace. Use this when a general-purpose workspace contains the target repository in a subdirectory."
|
|
284
|
-
},
|
|
285
|
-
paperclipIssueId: {
|
|
286
|
-
type: "string",
|
|
287
|
-
description: "Paperclip issue id used to resolve the trusted execution workspace and durable pull-request link."
|
|
288
|
-
},
|
|
289
|
-
followThroughAssigneeAgentId: followThroughAssigneeAgentIdProperty,
|
|
290
|
-
head: {
|
|
291
|
-
type: "string",
|
|
292
|
-
description: "Plain local branch name to publish. Owner-qualified branches and arbitrary refspecs are rejected."
|
|
293
|
-
},
|
|
294
|
-
headCommitSha: {
|
|
295
|
-
type: "string",
|
|
296
|
-
pattern: "^[0-9a-fA-F]{40}$",
|
|
297
|
-
description: "Full 40-character commit SHA that must equal the exact local branch tip and the verified remote branch tip."
|
|
298
|
-
},
|
|
299
|
-
base: {
|
|
300
|
-
type: "string",
|
|
301
|
-
description: "Base branch name."
|
|
302
|
-
},
|
|
303
|
-
title: {
|
|
304
|
-
type: "string"
|
|
305
|
-
},
|
|
306
|
-
body: {
|
|
307
|
-
type: "string",
|
|
308
|
-
description: "Optional human-facing pull request description. If provided, it must remain non-empty after trimming and removing any existing AI footer."
|
|
309
|
-
},
|
|
310
|
-
llmModel: llmModelProperty,
|
|
311
|
-
draft: {
|
|
312
|
-
type: "boolean"
|
|
313
|
-
},
|
|
314
|
-
labels: {
|
|
315
|
-
type: "array",
|
|
316
|
-
items: {
|
|
317
|
-
type: "string"
|
|
318
|
-
},
|
|
319
|
-
description: "Optional GitHub labels to add to the new pull request, for example the approved `type:` label. Labels are applied after the pull request is created; failures are returned as warnings."
|
|
320
|
-
},
|
|
321
|
-
userReviewers: {
|
|
322
|
-
type: "array",
|
|
323
|
-
items: {
|
|
324
|
-
type: "string"
|
|
325
|
-
},
|
|
326
|
-
description: "Optional GitHub user logins to request as reviewers right after creation, for example the linked issue author when they are not the pull request author. Failures are returned as warnings."
|
|
327
|
-
},
|
|
328
|
-
teamReviewers: {
|
|
329
|
-
type: "array",
|
|
330
|
-
items: {
|
|
331
|
-
type: "string"
|
|
332
|
-
},
|
|
333
|
-
description: "Optional GitHub team slugs to request as reviewers right after creation. Failures are returned as warnings."
|
|
334
|
-
}
|
|
335
|
-
}
|
|
336
|
-
}
|
|
337
|
-
},
|
|
338
290
|
{
|
|
339
291
|
name: "get_pull_request",
|
|
340
292
|
displayName: "Get Pull Request",
|
|
@@ -345,8 +297,7 @@ var GITHUB_AGENT_TOOLS = [
|
|
|
345
297
|
...pullRequestTargetSchema,
|
|
346
298
|
properties: {
|
|
347
299
|
repository: repositoryProperty,
|
|
348
|
-
pullRequestNumber: pullRequestNumberProperty
|
|
349
|
-
paperclipIssueId: paperclipIssueIdProperty
|
|
300
|
+
pullRequestNumber: pullRequestNumberProperty
|
|
350
301
|
}
|
|
351
302
|
}
|
|
352
303
|
},
|
|
@@ -361,7 +312,6 @@ var GITHUB_AGENT_TOOLS = [
|
|
|
361
312
|
properties: {
|
|
362
313
|
repository: repositoryProperty,
|
|
363
314
|
pullRequestNumber: pullRequestNumberProperty,
|
|
364
|
-
paperclipIssueId: paperclipIssueIdProperty,
|
|
365
315
|
title: {
|
|
366
316
|
type: "string"
|
|
367
317
|
},
|
|
@@ -401,8 +351,7 @@ var GITHUB_AGENT_TOOLS = [
|
|
|
401
351
|
...pullRequestTargetSchema,
|
|
402
352
|
properties: {
|
|
403
353
|
repository: repositoryProperty,
|
|
404
|
-
pullRequestNumber: pullRequestNumberProperty
|
|
405
|
-
paperclipIssueId: paperclipIssueIdProperty
|
|
354
|
+
pullRequestNumber: pullRequestNumberProperty
|
|
406
355
|
}
|
|
407
356
|
}
|
|
408
357
|
},
|
|
@@ -416,8 +365,7 @@ var GITHUB_AGENT_TOOLS = [
|
|
|
416
365
|
...pullRequestTargetSchema,
|
|
417
366
|
properties: {
|
|
418
367
|
repository: repositoryProperty,
|
|
419
|
-
pullRequestNumber: pullRequestNumberProperty
|
|
420
|
-
paperclipIssueId: paperclipIssueIdProperty
|
|
368
|
+
pullRequestNumber: pullRequestNumberProperty
|
|
421
369
|
}
|
|
422
370
|
}
|
|
423
371
|
},
|
|
@@ -431,8 +379,7 @@ var GITHUB_AGENT_TOOLS = [
|
|
|
431
379
|
...pullRequestTargetSchema,
|
|
432
380
|
properties: {
|
|
433
381
|
repository: repositoryProperty,
|
|
434
|
-
pullRequestNumber: pullRequestNumberProperty
|
|
435
|
-
paperclipIssueId: paperclipIssueIdProperty
|
|
382
|
+
pullRequestNumber: pullRequestNumberProperty
|
|
436
383
|
}
|
|
437
384
|
}
|
|
438
385
|
},
|
|
@@ -454,8 +401,7 @@ var GITHUB_AGENT_TOOLS = [
|
|
|
454
401
|
minLength: 1,
|
|
455
402
|
description: "Human-facing reply body without the AI footer. It must remain non-empty after trimming and removing any existing AI footer."
|
|
456
403
|
},
|
|
457
|
-
llmModel: llmModelProperty
|
|
458
|
-
paperclipIssueId: paperclipIssueIdProperty
|
|
404
|
+
llmModel: llmModelProperty
|
|
459
405
|
}
|
|
460
406
|
}
|
|
461
407
|
},
|
|
@@ -471,8 +417,7 @@ var GITHUB_AGENT_TOOLS = [
|
|
|
471
417
|
threadId: {
|
|
472
418
|
type: "string",
|
|
473
419
|
description: "GitHub pull request review thread node id."
|
|
474
|
-
}
|
|
475
|
-
paperclipIssueId: paperclipIssueIdProperty
|
|
420
|
+
}
|
|
476
421
|
}
|
|
477
422
|
}
|
|
478
423
|
},
|
|
@@ -488,8 +433,7 @@ var GITHUB_AGENT_TOOLS = [
|
|
|
488
433
|
threadId: {
|
|
489
434
|
type: "string",
|
|
490
435
|
description: "GitHub pull request review thread node id."
|
|
491
|
-
}
|
|
492
|
-
paperclipIssueId: paperclipIssueIdProperty
|
|
436
|
+
}
|
|
493
437
|
}
|
|
494
438
|
}
|
|
495
439
|
},
|
|
@@ -504,7 +448,6 @@ var GITHUB_AGENT_TOOLS = [
|
|
|
504
448
|
properties: {
|
|
505
449
|
repository: repositoryProperty,
|
|
506
450
|
pullRequestNumber: pullRequestNumberProperty,
|
|
507
|
-
paperclipIssueId: paperclipIssueIdProperty,
|
|
508
451
|
userReviewers: {
|
|
509
452
|
type: "array",
|
|
510
453
|
minItems: 1,
|
|
@@ -521,12 +464,6 @@ var GITHUB_AGENT_TOOLS = [
|
|
|
521
464
|
}
|
|
522
465
|
},
|
|
523
466
|
anyOf: [
|
|
524
|
-
{
|
|
525
|
-
required: ["paperclipIssueId", "userReviewers"]
|
|
526
|
-
},
|
|
527
|
-
{
|
|
528
|
-
required: ["paperclipIssueId", "teamReviewers"]
|
|
529
|
-
},
|
|
530
467
|
{
|
|
531
468
|
required: ["pullRequestNumber", "userReviewers"]
|
|
532
469
|
},
|
|
@@ -536,6 +473,156 @@ var GITHUB_AGENT_TOOLS = [
|
|
|
536
473
|
]
|
|
537
474
|
}
|
|
538
475
|
},
|
|
476
|
+
{
|
|
477
|
+
name: "submit_pull_request_review",
|
|
478
|
+
displayName: "Submit Pull Request Review",
|
|
479
|
+
description: "Submit a pull request review as COMMENT or REQUEST_CHANGES, optionally with inline comments on changed lines. Approving is not supported: approval stays with human reviewers. Provide only the human-facing body; the plugin appends the required AI-authorship footer and includes llmModel when supplied.",
|
|
480
|
+
parametersSchema: {
|
|
481
|
+
type: "object",
|
|
482
|
+
additionalProperties: false,
|
|
483
|
+
required: ["body"],
|
|
484
|
+
...pullRequestTargetSchema,
|
|
485
|
+
properties: {
|
|
486
|
+
repository: repositoryProperty,
|
|
487
|
+
pullRequestNumber: pullRequestNumberProperty,
|
|
488
|
+
event: {
|
|
489
|
+
type: "string",
|
|
490
|
+
enum: ["COMMENT", "REQUEST_CHANGES"],
|
|
491
|
+
description: "Review verdict. Defaults to COMMENT. APPROVE is deliberately not accepted."
|
|
492
|
+
},
|
|
493
|
+
body: {
|
|
494
|
+
type: "string",
|
|
495
|
+
minLength: 1,
|
|
496
|
+
description: "Review summary without the AI footer."
|
|
497
|
+
},
|
|
498
|
+
commitId: {
|
|
499
|
+
type: "string",
|
|
500
|
+
description: "Optional head commit SHA the review applies to. GitHub rejects inline comments when this does not match the reviewed diff; omit to review the current head."
|
|
501
|
+
},
|
|
502
|
+
comments: {
|
|
503
|
+
type: "array",
|
|
504
|
+
maxItems: 50,
|
|
505
|
+
description: "Optional inline comments. Each one targets a line of the pull request diff.",
|
|
506
|
+
items: {
|
|
507
|
+
type: "object",
|
|
508
|
+
additionalProperties: false,
|
|
509
|
+
required: ["path", "line", "body"],
|
|
510
|
+
properties: {
|
|
511
|
+
path: {
|
|
512
|
+
type: "string",
|
|
513
|
+
description: "File path relative to the repository root."
|
|
514
|
+
},
|
|
515
|
+
line: {
|
|
516
|
+
type: "integer",
|
|
517
|
+
minimum: 1,
|
|
518
|
+
description: "Line in the file the comment applies to (the last line for a multi-line comment)."
|
|
519
|
+
},
|
|
520
|
+
side: {
|
|
521
|
+
type: "string",
|
|
522
|
+
enum: ["LEFT", "RIGHT"],
|
|
523
|
+
description: "RIGHT for added or unchanged lines (default), LEFT for deleted lines."
|
|
524
|
+
},
|
|
525
|
+
startLine: {
|
|
526
|
+
type: "integer",
|
|
527
|
+
minimum: 1,
|
|
528
|
+
description: "First line of a multi-line comment."
|
|
529
|
+
},
|
|
530
|
+
startSide: {
|
|
531
|
+
type: "string",
|
|
532
|
+
enum: ["LEFT", "RIGHT"],
|
|
533
|
+
description: "Side of startLine. Defaults to side."
|
|
534
|
+
},
|
|
535
|
+
body: {
|
|
536
|
+
type: "string",
|
|
537
|
+
minLength: 1,
|
|
538
|
+
description: "Inline comment text."
|
|
539
|
+
}
|
|
540
|
+
}
|
|
541
|
+
}
|
|
542
|
+
},
|
|
543
|
+
llmModel: llmModelProperty
|
|
544
|
+
}
|
|
545
|
+
}
|
|
546
|
+
},
|
|
547
|
+
{
|
|
548
|
+
name: "create_check_run",
|
|
549
|
+
displayName: "Create Check Run",
|
|
550
|
+
description: 'Create a GitHub check run on a pull request head commit, for example an "AI first pass" check that branch rules can require. Requires GitHub App authentication: GitHub does not let personal tokens write check runs.',
|
|
551
|
+
parametersSchema: {
|
|
552
|
+
type: "object",
|
|
553
|
+
additionalProperties: false,
|
|
554
|
+
required: ["name"],
|
|
555
|
+
anyOf: [
|
|
556
|
+
{ required: ["pullRequestNumber"] },
|
|
557
|
+
{ required: ["headSha"] }
|
|
558
|
+
],
|
|
559
|
+
properties: {
|
|
560
|
+
repository: repositoryProperty,
|
|
561
|
+
pullRequestNumber: pullRequestNumberProperty,
|
|
562
|
+
headSha: {
|
|
563
|
+
type: "string",
|
|
564
|
+
description: "Commit SHA to attach the check to. Defaults to the pull request head commit."
|
|
565
|
+
},
|
|
566
|
+
name: {
|
|
567
|
+
type: "string",
|
|
568
|
+
minLength: 1,
|
|
569
|
+
description: 'Check name shown on the pull request, such as "AI first pass".'
|
|
570
|
+
},
|
|
571
|
+
...checkRunUpdateProperties
|
|
572
|
+
}
|
|
573
|
+
}
|
|
574
|
+
},
|
|
575
|
+
{
|
|
576
|
+
name: "update_check_run",
|
|
577
|
+
displayName: "Update Check Run",
|
|
578
|
+
description: "Update a check run created by create_check_run: move it to in_progress, or complete it with a conclusion and summary. Requires GitHub App authentication.",
|
|
579
|
+
parametersSchema: {
|
|
580
|
+
type: "object",
|
|
581
|
+
additionalProperties: false,
|
|
582
|
+
required: ["checkRunId"],
|
|
583
|
+
properties: {
|
|
584
|
+
repository: repositoryProperty,
|
|
585
|
+
checkRunId: {
|
|
586
|
+
type: "integer",
|
|
587
|
+
minimum: 1,
|
|
588
|
+
description: "Check run id returned by create_check_run."
|
|
589
|
+
},
|
|
590
|
+
...checkRunUpdateProperties
|
|
591
|
+
}
|
|
592
|
+
}
|
|
593
|
+
},
|
|
594
|
+
{
|
|
595
|
+
name: "add_pull_request_labels",
|
|
596
|
+
displayName: "Add Pull Request Labels",
|
|
597
|
+
description: "Add labels to a pull request without touching its other labels.",
|
|
598
|
+
parametersSchema: {
|
|
599
|
+
type: "object",
|
|
600
|
+
additionalProperties: false,
|
|
601
|
+
required: ["labels"],
|
|
602
|
+
...pullRequestTargetSchema,
|
|
603
|
+
properties: {
|
|
604
|
+
repository: repositoryProperty,
|
|
605
|
+
pullRequestNumber: pullRequestNumberProperty,
|
|
606
|
+
labels: pullRequestLabelsProperty
|
|
607
|
+
}
|
|
608
|
+
}
|
|
609
|
+
},
|
|
610
|
+
{
|
|
611
|
+
name: "remove_pull_request_labels",
|
|
612
|
+
displayName: "Remove Pull Request Labels",
|
|
613
|
+
description: "Remove labels from a pull request. Labels the pull request does not have are ignored.",
|
|
614
|
+
parametersSchema: {
|
|
615
|
+
type: "object",
|
|
616
|
+
additionalProperties: false,
|
|
617
|
+
required: ["labels"],
|
|
618
|
+
...pullRequestTargetSchema,
|
|
619
|
+
properties: {
|
|
620
|
+
repository: repositoryProperty,
|
|
621
|
+
pullRequestNumber: pullRequestNumberProperty,
|
|
622
|
+
labels: pullRequestLabelsProperty
|
|
623
|
+
}
|
|
624
|
+
}
|
|
625
|
+
},
|
|
539
626
|
{
|
|
540
627
|
name: "list_organization_projects",
|
|
541
628
|
displayName: "List Organization Projects",
|
|
@@ -574,7 +661,6 @@ var GITHUB_AGENT_TOOLS = [
|
|
|
574
661
|
properties: {
|
|
575
662
|
repository: repositoryProperty,
|
|
576
663
|
pullRequestNumber: pullRequestNumberProperty,
|
|
577
|
-
paperclipIssueId: paperclipIssueIdProperty,
|
|
578
664
|
projectId: projectIdProperty,
|
|
579
665
|
organization: organizationProperty,
|
|
580
666
|
projectNumber: projectNumberProperty
|
|
@@ -597,7 +683,6 @@ var GITHUB_AGENT_TOOLS = [
|
|
|
597
683
|
properties: {
|
|
598
684
|
repository: repositoryProperty,
|
|
599
685
|
pullRequestNumber: pullRequestNumberProperty,
|
|
600
|
-
paperclipIssueId: paperclipIssueIdProperty,
|
|
601
686
|
fileName: {
|
|
602
687
|
type: "string",
|
|
603
688
|
description: "Asset filename. The plugin sanitizes it and preserves a safe extension."
|
|
@@ -634,92 +719,103 @@ var GITHUB_AGENT_TOOLS = [
|
|
|
634
719
|
}
|
|
635
720
|
},
|
|
636
721
|
{
|
|
637
|
-
name: "
|
|
638
|
-
displayName: "
|
|
639
|
-
description: "
|
|
722
|
+
name: "remember_memory",
|
|
723
|
+
displayName: "Remember",
|
|
724
|
+
description: "Save a short note to the company memory that every agent shares, such as a repository convention, a known flaky test, or a reviewer preference. Saving the same repository and topic again replaces the note. Keep notes factual and specific; never store secrets or personal data.",
|
|
640
725
|
parametersSchema: {
|
|
641
726
|
type: "object",
|
|
642
727
|
additionalProperties: false,
|
|
643
|
-
required: ["
|
|
644
|
-
anyOf: [
|
|
645
|
-
{
|
|
646
|
-
required: ["reference"]
|
|
647
|
-
},
|
|
648
|
-
{
|
|
649
|
-
required: ["issueNumber"]
|
|
650
|
-
},
|
|
651
|
-
{
|
|
652
|
-
required: ["pullRequestNumber"]
|
|
653
|
-
},
|
|
654
|
-
{
|
|
655
|
-
required: ["pullRequestUrl"]
|
|
656
|
-
}
|
|
657
|
-
],
|
|
728
|
+
required: ["topic", "content"],
|
|
658
729
|
properties: {
|
|
659
|
-
|
|
730
|
+
repository: {
|
|
660
731
|
type: "string",
|
|
661
|
-
|
|
662
|
-
description: "Whether to link a GitHub issue or pull request."
|
|
732
|
+
description: "GitHub repository as owner/repo the note applies to. Omit for a company-wide note."
|
|
663
733
|
},
|
|
664
|
-
|
|
734
|
+
topic: {
|
|
665
735
|
type: "string",
|
|
666
|
-
|
|
736
|
+
minLength: 1,
|
|
737
|
+
maxLength: 120,
|
|
738
|
+
description: 'Short title that identifies the note, such as "flaky test: HttpClientSpec".'
|
|
667
739
|
},
|
|
668
|
-
|
|
740
|
+
content: {
|
|
669
741
|
type: "string",
|
|
670
|
-
|
|
742
|
+
minLength: 1,
|
|
743
|
+
maxLength: 2e3,
|
|
744
|
+
description: "The note itself."
|
|
671
745
|
},
|
|
672
|
-
|
|
746
|
+
tags: {
|
|
747
|
+
type: "array",
|
|
748
|
+
maxItems: 10,
|
|
749
|
+
items: { type: "string" },
|
|
750
|
+
description: 'Optional tags, such as "review", "triage" or "ci".'
|
|
751
|
+
}
|
|
752
|
+
}
|
|
753
|
+
}
|
|
754
|
+
},
|
|
755
|
+
{
|
|
756
|
+
name: "recall_memories",
|
|
757
|
+
displayName: "Recall",
|
|
758
|
+
description: "Look up notes in the shared company memory. Returns notes for the repository plus company-wide notes, best matches first. Call it before starting work on a repository, with a few keywords.",
|
|
759
|
+
parametersSchema: {
|
|
760
|
+
type: "object",
|
|
761
|
+
additionalProperties: false,
|
|
762
|
+
properties: {
|
|
763
|
+
query: {
|
|
673
764
|
type: "string",
|
|
674
|
-
description: "
|
|
765
|
+
description: "Keywords matched against note topics, tags and content. Omit to get the most recent notes."
|
|
675
766
|
},
|
|
676
|
-
|
|
677
|
-
pullRequestNumber: pullRequestNumberProperty,
|
|
678
|
-
pullRequestUrl: {
|
|
767
|
+
repository: {
|
|
679
768
|
type: "string",
|
|
680
|
-
description: "
|
|
769
|
+
description: "GitHub repository as owner/repo. Company-wide notes are always included."
|
|
770
|
+
},
|
|
771
|
+
tags: {
|
|
772
|
+
type: "array",
|
|
773
|
+
items: { type: "string" },
|
|
774
|
+
description: "Only return notes with at least one of these tags."
|
|
681
775
|
},
|
|
682
|
-
|
|
776
|
+
limit: {
|
|
777
|
+
type: "integer",
|
|
778
|
+
minimum: 1,
|
|
779
|
+
maximum: 25,
|
|
780
|
+
description: "Maximum number of notes. Defaults to 10."
|
|
781
|
+
}
|
|
683
782
|
}
|
|
684
783
|
}
|
|
685
784
|
},
|
|
686
785
|
{
|
|
687
|
-
name: "
|
|
688
|
-
displayName: "
|
|
689
|
-
description: "
|
|
786
|
+
name: "forget_memory",
|
|
787
|
+
displayName: "Forget",
|
|
788
|
+
description: "Remove a note from the shared company memory when it is wrong or no longer true.",
|
|
690
789
|
parametersSchema: {
|
|
691
790
|
type: "object",
|
|
692
791
|
additionalProperties: false,
|
|
693
|
-
required: ["
|
|
792
|
+
required: ["topic"],
|
|
694
793
|
properties: {
|
|
695
|
-
|
|
696
|
-
type: "string",
|
|
697
|
-
description: "Paperclip issue id in the authenticated tool run company."
|
|
698
|
-
},
|
|
699
|
-
from: {
|
|
794
|
+
repository: {
|
|
700
795
|
type: "string",
|
|
701
|
-
description: "
|
|
796
|
+
description: "Repository of the note as owner/repo. Omit for a company-wide note."
|
|
702
797
|
},
|
|
703
|
-
|
|
798
|
+
topic: {
|
|
704
799
|
type: "string",
|
|
705
|
-
|
|
800
|
+
minLength: 1,
|
|
801
|
+
maxLength: 120,
|
|
802
|
+
description: "Topic of the note to remove."
|
|
706
803
|
}
|
|
707
804
|
}
|
|
708
805
|
}
|
|
709
806
|
}
|
|
710
807
|
];
|
|
711
808
|
|
|
712
|
-
// src/
|
|
809
|
+
// src/github-webhooks.ts
|
|
810
|
+
var GITHUB_WEBHOOK_ENDPOINT_KEY = "github";
|
|
811
|
+
|
|
812
|
+
// src/plugin-id.ts
|
|
713
813
|
var GITHUB_SYNC_PLUGIN_ID = "paperclip-github-plugin";
|
|
714
|
-
var COMPANY_METRIC_API_ROUTE_KEY = "record-company-metric-event";
|
|
715
|
-
var COMPANY_METRIC_API_ROUTE_PATH = "/company-metrics/events";
|
|
716
|
-
var COMPANY_METRIC_API_ROUTE_URL_PATH = `/api/plugins/${GITHUB_SYNC_PLUGIN_ID}/api${COMPANY_METRIC_API_ROUTE_PATH}`;
|
|
717
814
|
|
|
718
815
|
// src/manifest.ts
|
|
719
816
|
var require2 = createRequire(import.meta.url);
|
|
720
817
|
var packageJson = require2("../package.json");
|
|
721
|
-
var
|
|
722
|
-
var MANIFEST_VERSION = "0.18.0"?.trim() || typeof packageJson.version === "string" && packageJson.version.trim() || process.env.npm_package_version?.trim() || "0.0.0-dev";
|
|
818
|
+
var MANIFEST_VERSION = "0.20.0"?.trim() || typeof packageJson.version === "string" && packageJson.version.trim() || process.env.npm_package_version?.trim() || "0.0.0-dev";
|
|
723
819
|
var COMPANY_SECRET_REF_VALUE_SCHEMA = {
|
|
724
820
|
anyOf: [
|
|
725
821
|
{ type: "string" },
|
|
@@ -738,35 +834,21 @@ var manifest = {
|
|
|
738
834
|
id: GITHUB_SYNC_PLUGIN_ID,
|
|
739
835
|
apiVersion: 1,
|
|
740
836
|
version: MANIFEST_VERSION,
|
|
741
|
-
displayName: "GitHub
|
|
742
|
-
description: "
|
|
837
|
+
displayName: "GitHub",
|
|
838
|
+
description: "GitHub App identity, webhook wakes, GitHub tools and shared memory for Paperclip agents.",
|
|
743
839
|
author: "\xC1lvaro S\xE1nchez-Mariscal",
|
|
744
840
|
categories: ["connector", "ui"],
|
|
745
841
|
capabilities: [
|
|
746
|
-
"ui.sidebar.register",
|
|
747
|
-
"ui.page.register",
|
|
748
|
-
"ui.dashboardWidget.register",
|
|
749
|
-
"ui.detailTab.register",
|
|
750
|
-
"ui.action.register",
|
|
751
842
|
"plugin.state.read",
|
|
752
843
|
"plugin.state.write",
|
|
753
844
|
"instance.settings.register",
|
|
754
|
-
"
|
|
755
|
-
"execution.workspaces.read",
|
|
756
|
-
"issues.read",
|
|
757
|
-
"issues.checkout",
|
|
758
|
-
"issues.create",
|
|
759
|
-
"issues.update",
|
|
760
|
-
"issues.wakeup",
|
|
761
|
-
"issue.relations.read",
|
|
762
|
-
"issue.comments.read",
|
|
763
|
-
"issue.comments.create",
|
|
845
|
+
"companies.read",
|
|
764
846
|
"agents.read",
|
|
765
|
-
"
|
|
766
|
-
"api.routes.register",
|
|
847
|
+
"agents.invoke",
|
|
767
848
|
"http.outbound",
|
|
768
849
|
"secrets.read-ref",
|
|
769
|
-
"agent.tools.register"
|
|
850
|
+
"agent.tools.register",
|
|
851
|
+
"webhooks.receive"
|
|
770
852
|
],
|
|
771
853
|
instanceConfigSchema: {
|
|
772
854
|
type: "object",
|
|
@@ -777,33 +859,48 @@ var manifest = {
|
|
|
777
859
|
description: "Company id to Paperclip secret reference for the GitHub token.",
|
|
778
860
|
additionalProperties: COMPANY_SECRET_REF_VALUE_SCHEMA
|
|
779
861
|
},
|
|
780
|
-
|
|
862
|
+
githubAppsByCompanyId: {
|
|
781
863
|
type: "object",
|
|
782
|
-
title: "
|
|
783
|
-
description: "Company id to
|
|
864
|
+
title: "GitHub App Authentication",
|
|
865
|
+
description: "Company id to the GitHub App and installation the company authenticates as. Takes precedence over the GitHub token.",
|
|
866
|
+
additionalProperties: {
|
|
867
|
+
type: "object",
|
|
868
|
+
properties: {
|
|
869
|
+
appId: { type: "string" },
|
|
870
|
+
installationId: { type: "integer" },
|
|
871
|
+
slug: { type: "string" }
|
|
872
|
+
},
|
|
873
|
+
required: ["appId", "installationId"]
|
|
874
|
+
}
|
|
875
|
+
},
|
|
876
|
+
githubAppPrivateKeyRefs: {
|
|
877
|
+
type: "object",
|
|
878
|
+
title: "GitHub App Private Key Secrets",
|
|
879
|
+
description: "Company id to Paperclip secret reference for the GitHub App private key.",
|
|
784
880
|
additionalProperties: COMPANY_SECRET_REF_VALUE_SCHEMA
|
|
785
881
|
},
|
|
786
|
-
|
|
787
|
-
type: "
|
|
788
|
-
title: "
|
|
882
|
+
githubWebhookSecretRefs: {
|
|
883
|
+
type: "object",
|
|
884
|
+
title: "GitHub App Webhook Secrets",
|
|
885
|
+
description: "Company id to Paperclip secret reference for the GitHub App webhook secret.",
|
|
886
|
+
additionalProperties: COMPANY_SECRET_REF_VALUE_SCHEMA
|
|
887
|
+
},
|
|
888
|
+
githubEventRoutesByCompanyId: {
|
|
889
|
+
type: "object",
|
|
890
|
+
title: "GitHub Event Routes",
|
|
891
|
+
description: "Company id to the list of GitHub events that wake a Paperclip agent.",
|
|
892
|
+
additionalProperties: {
|
|
893
|
+
type: "array",
|
|
894
|
+
items: { type: "object" }
|
|
895
|
+
}
|
|
789
896
|
}
|
|
790
897
|
}
|
|
791
898
|
},
|
|
792
|
-
|
|
899
|
+
webhooks: [
|
|
793
900
|
{
|
|
794
|
-
|
|
795
|
-
displayName: "
|
|
796
|
-
description: "
|
|
797
|
-
schedule: SCHEDULE_TICK_CRON
|
|
798
|
-
}
|
|
799
|
-
],
|
|
800
|
-
apiRoutes: [
|
|
801
|
-
{
|
|
802
|
-
routeKey: COMPANY_METRIC_API_ROUTE_KEY,
|
|
803
|
-
method: "POST",
|
|
804
|
-
path: COMPANY_METRIC_API_ROUTE_PATH,
|
|
805
|
-
auth: "agent",
|
|
806
|
-
capability: "api.routes.register"
|
|
901
|
+
endpointKey: GITHUB_WEBHOOK_ENDPOINT_KEY,
|
|
902
|
+
displayName: "GitHub App events",
|
|
903
|
+
description: "Signed GitHub App webhook deliveries. Matching events wake the Paperclip agent named by an event route."
|
|
807
904
|
}
|
|
808
905
|
],
|
|
809
906
|
tools: GITHUB_AGENT_TOOLS,
|
|
@@ -813,57 +910,10 @@ var manifest = {
|
|
|
813
910
|
},
|
|
814
911
|
ui: {
|
|
815
912
|
slots: [
|
|
816
|
-
{
|
|
817
|
-
type: "page",
|
|
818
|
-
id: "paperclip-github-plugin-project-pull-requests-page",
|
|
819
|
-
displayName: "Pull Requests",
|
|
820
|
-
exportName: "GitHubSyncProjectPullRequestsPage",
|
|
821
|
-
routePath: "github-pull-requests"
|
|
822
|
-
},
|
|
823
|
-
{
|
|
824
|
-
type: "projectSidebarItem",
|
|
825
|
-
id: "paperclip-github-plugin-project-pull-requests-sidebar-item",
|
|
826
|
-
displayName: "Pull Requests",
|
|
827
|
-
exportName: "GitHubSyncProjectPullRequestsSidebarItem",
|
|
828
|
-
entityTypes: ["project"],
|
|
829
|
-
order: 40
|
|
830
|
-
},
|
|
831
|
-
{
|
|
832
|
-
type: "dashboardWidget",
|
|
833
|
-
id: "paperclip-github-plugin-dashboard-widget",
|
|
834
|
-
displayName: "GitHub Sync",
|
|
835
|
-
exportName: "GitHubSyncDashboardWidget"
|
|
836
|
-
},
|
|
837
|
-
{
|
|
838
|
-
type: "dashboardWidget",
|
|
839
|
-
id: "paperclip-github-plugin-kpi-dashboard-widget",
|
|
840
|
-
displayName: "GitHub KPIs",
|
|
841
|
-
exportName: "GitHubSyncKpiDashboardWidget"
|
|
842
|
-
},
|
|
843
|
-
{
|
|
844
|
-
type: "taskDetailView",
|
|
845
|
-
id: "paperclip-github-plugin-issue-detail-tab",
|
|
846
|
-
displayName: "GitHub",
|
|
847
|
-
exportName: "GitHubSyncIssueTaskDetailView",
|
|
848
|
-
entityTypes: ["issue"]
|
|
849
|
-
},
|
|
850
|
-
{
|
|
851
|
-
type: "globalToolbarButton",
|
|
852
|
-
id: "paperclip-github-plugin-global-toolbar-button",
|
|
853
|
-
displayName: "GitHub Sync",
|
|
854
|
-
exportName: "GitHubSyncGlobalToolbarButton"
|
|
855
|
-
},
|
|
856
|
-
{
|
|
857
|
-
type: "toolbarButton",
|
|
858
|
-
id: "paperclip-github-plugin-toolbar-button",
|
|
859
|
-
displayName: "GitHub Sync",
|
|
860
|
-
exportName: "GitHubSyncEntityToolbarButton",
|
|
861
|
-
entityTypes: ["project"]
|
|
862
|
-
},
|
|
863
913
|
{
|
|
864
914
|
type: "settingsPage",
|
|
865
915
|
id: "paperclip-github-plugin-settings-page",
|
|
866
|
-
displayName: "GitHub
|
|
916
|
+
displayName: "GitHub",
|
|
867
917
|
exportName: "GitHubSyncSettingsPage"
|
|
868
918
|
}
|
|
869
919
|
]
|