@ubiquity-os/plugin-sdk 3.6.0 → 3.6.3
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 +34 -109
- package/dist/configuration.d.mts +5 -1
- package/dist/configuration.d.ts +5 -1
- package/dist/configuration.js +2659 -32
- package/dist/configuration.mjs +2659 -22
- package/dist/index.d.mts +3 -2
- package/dist/index.d.ts +3 -2
- package/dist/index.js +2258 -144
- package/dist/index.mjs +2250 -136
- package/dist/llm.d.mts +6 -43
- package/dist/llm.d.ts +6 -43
- package/dist/llm.js +94 -38
- package/dist/llm.mjs +94 -38
- package/dist/octokit.d.mts +2 -2
- package/dist/octokit.d.ts +2 -2
- package/dist/octokit.js +164 -2
- package/dist/octokit.mjs +163 -1
- package/dist/signature.d.mts +1 -3
- package/dist/signature.d.ts +1 -3
- package/dist/signature.js +1 -4
- package/dist/signature.mjs +1 -4
- package/package.json +43 -41
package/README.md
CHANGED
|
@@ -17,117 +17,42 @@ The `createActionsPlugin` function allows users to create plugins that will be a
|
|
|
17
17
|
|
|
18
18
|
The `createPlugin` function enables users to create a plugin that will run on Cloudflare Workers environment.
|
|
19
19
|
|
|
20
|
-
### `callLlm`
|
|
21
|
-
|
|
22
|
-
The `callLlm` function sends chat completion requests to `ai.ubq.fi` using the auth token and repository context supplied by the kernel.
|
|
23
|
-
|
|
24
20
|
### `postComment`
|
|
25
21
|
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
## Getting Started
|
|
29
|
-
|
|
30
|
-
To set up the project locally, `bun` is the preferred package manager.
|
|
31
|
-
|
|
32
|
-
1. Install the dependencies:
|
|
33
|
-
|
|
34
|
-
```sh
|
|
35
|
-
bun install
|
|
36
|
-
```
|
|
37
|
-
|
|
38
|
-
2. Build the SDK
|
|
39
|
-
```
|
|
40
|
-
bun sdk:build
|
|
41
|
-
```
|
|
42
|
-
3. Link it locally to another plugin
|
|
43
|
-
```
|
|
44
|
-
bun link
|
|
45
|
-
```
|
|
46
|
-
|
|
47
|
-
## Scripts
|
|
48
|
-
|
|
49
|
-
The project provides several npm scripts for various tasks:
|
|
50
|
-
|
|
51
|
-
- `bun run sdk:build`: Compiles the TypeScript code.
|
|
52
|
-
- `bun run test`: Runs the tests.
|
|
53
|
-
- `bun run lint`: Runs the linter.
|
|
54
|
-
- `bun run format`: Formats the code using Prettier.
|
|
55
|
-
|
|
56
|
-
## Testing
|
|
57
|
-
|
|
58
|
-
### Jest
|
|
59
|
-
|
|
60
|
-
To start Jest tests, run:
|
|
61
|
-
|
|
62
|
-
```sh
|
|
63
|
-
bun run test
|
|
64
|
-
```
|
|
65
|
-
|
|
66
|
-
## LLM Utility
|
|
67
|
-
|
|
68
|
-
```ts
|
|
69
|
-
import { callLlm } from "@ubiquity-os/plugin-sdk";
|
|
70
|
-
|
|
71
|
-
const result = await callLlm(
|
|
72
|
-
{
|
|
73
|
-
messages: [{ role: "user", content: "Summarize this issue." }],
|
|
74
|
-
},
|
|
75
|
-
context
|
|
76
|
-
);
|
|
77
|
-
```
|
|
78
|
-
|
|
79
|
-
## Markdown Cleaning Utility
|
|
80
|
-
|
|
81
|
-
`cleanMarkdown` removes top-level HTML comments and configured HTML tags while preserving content inside fenced/indented code blocks, inline code spans, and blockquotes.
|
|
82
|
-
|
|
83
|
-
### Import
|
|
84
|
-
|
|
85
|
-
```ts
|
|
86
|
-
import { cleanMarkdown, type CleanMarkdownOptions } from "@ubiquity-os/plugin-sdk/markdown";
|
|
87
|
-
```
|
|
88
|
-
|
|
89
|
-
### Options (`CleanMarkdownOptions`)
|
|
90
|
-
|
|
91
|
-
| Option | Type | Default | Description |
|
|
92
|
-
| -------------------- | --------------------------------- | ------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
93
|
-
| `tags` | `(keyof HTMLElementTagNameMap)[]` | `[]` | List of HTML tag names to strip. Whole block tokens that are a single matching root element are removed entirely. Inline self-closing/void-like occurrences (e.g. `<br>`) are also removed. |
|
|
94
|
-
| `collapseEmptyLines` | `boolean` | `false` | Collapses runs of 3+ blank lines down to exactly 2. |
|
|
95
|
-
|
|
96
|
-
### Behavior Summary
|
|
97
|
-
|
|
98
|
-
- Strips HTML comments (`<!-- ... -->`) outside protected contexts:
|
|
99
|
-
- Not inside fenced/indented code blocks
|
|
100
|
-
- Not inside inline code spans
|
|
101
|
-
- Not inside blockquotes (blockquote content is left untouched)
|
|
102
|
-
- Removes entire HTML block tokens consisting of a single root element whose tag is in `tags`.
|
|
103
|
-
- Removes inline occurrences of any tag in `tags` (void/self-closing style).
|
|
104
|
-
- Leaves everything else unchanged to minimize diff noise.
|
|
105
|
-
- Final output is trimmed (no trailing blank lines).
|
|
106
|
-
|
|
107
|
-
### Example
|
|
108
|
-
|
|
109
|
-
```ts
|
|
110
|
-
const input = `
|
|
111
|
-
<!-- build badge -->
|
|
112
|
-
<details>
|
|
113
|
-
<summary>Info</summary>
|
|
114
|
-
Content inside details
|
|
115
|
-
</details>
|
|
116
|
-
|
|
117
|
-
Paragraph with <br> line break and \`<br>\` in code.
|
|
118
|
-
|
|
119
|
-
\`\`\`ts
|
|
120
|
-
// Code block with <!-- comment --> and <br>
|
|
121
|
-
const x = 1;
|
|
122
|
-
\`\`\`
|
|
123
|
-
|
|
124
|
-
> Blockquote with <!-- preserved comment --> and <br>.
|
|
125
|
-
`;
|
|
22
|
+
### `callLlm`
|
|
126
23
|
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
24
|
+
The `callLlm` function allows plugins to securely call the ai.ubq.fi LLM endpoint using inherited GitHub authentication.
|
|
25
|
+
|
|
26
|
+
#### Usage
|
|
27
|
+
|
|
28
|
+
```typescript
|
|
29
|
+
import { PluginInput, createPlugin, callLlm } from '@ubiquity-os/plugin-sdk';
|
|
30
|
+
|
|
31
|
+
export default createPlugin({
|
|
32
|
+
async onCommand(input: PluginInput) {
|
|
33
|
+
// Non-streaming: resolves to ChatCompletion.
|
|
34
|
+
const result = await callLlm(
|
|
35
|
+
{
|
|
36
|
+
messages: [{ role: 'user', content: 'Hello, world!' }]
|
|
37
|
+
},
|
|
38
|
+
input
|
|
39
|
+
);
|
|
40
|
+
|
|
41
|
+
// Streaming: returns AsyncIterable<ChatCompletionChunk>.
|
|
42
|
+
const stream = await callLlm(
|
|
43
|
+
{
|
|
44
|
+
messages: [{ role: 'user', content: 'Hello, world!' }],
|
|
45
|
+
stream: true
|
|
46
|
+
},
|
|
47
|
+
input
|
|
48
|
+
);
|
|
49
|
+
for await (const chunk of stream) {
|
|
50
|
+
const delta = chunk.choices?.[0]?.delta?.content ?? '';
|
|
51
|
+
// handle delta
|
|
52
|
+
}
|
|
53
|
+
return { success: true };
|
|
54
|
+
}
|
|
130
55
|
});
|
|
131
|
-
|
|
132
|
-
console.log(cleaned);
|
|
133
56
|
```
|
|
57
|
+
|
|
58
|
+
Automatically extracts `authToken`, `owner`, `repo` from input and passes to ai.ubq.fi with proper headers for secure, repo-scoped access.
|
package/dist/configuration.d.mts
CHANGED
|
@@ -11,7 +11,7 @@ import './octokit.mjs';
|
|
|
11
11
|
import '@octokit/core/types';
|
|
12
12
|
import '@octokit/plugin-paginate-graphql';
|
|
13
13
|
import '@octokit/plugin-paginate-rest';
|
|
14
|
-
import '@octokit/
|
|
14
|
+
import '@octokit/request-error';
|
|
15
15
|
import '@octokit/core';
|
|
16
16
|
|
|
17
17
|
type GithubPlugin = {
|
|
@@ -27,6 +27,7 @@ declare const pluginSettingsSchema: _sinclair_typebox.TUnion<[_sinclair_typebox.
|
|
|
27
27
|
}>]>;
|
|
28
28
|
type PluginSettings = StaticDecode<typeof pluginSettingsSchema>;
|
|
29
29
|
declare const configSchema: _sinclair_typebox.TObject<{
|
|
30
|
+
imports: _sinclair_typebox.TOptional<_sinclair_typebox.TArray<_sinclair_typebox.TString>>;
|
|
30
31
|
plugins: _sinclair_typebox.TRecord<_sinclair_typebox.TString, _sinclair_typebox.TUnion<[_sinclair_typebox.TNull, _sinclair_typebox.TObject<{
|
|
31
32
|
with: _sinclair_typebox.TRecord<_sinclair_typebox.TString, _sinclair_typebox.TUnknown>;
|
|
32
33
|
runsOn: _sinclair_typebox.TOptional<_sinclair_typebox.TArray<_sinclair_typebox.TUnion<[TLiteral<"branch_protection_configuration">, TLiteral<"branch_protection_configuration.disabled">, TLiteral<"branch_protection_configuration.enabled">, TLiteral<"branch_protection_rule">, TLiteral<"branch_protection_rule.created">, TLiteral<"branch_protection_rule.deleted">, TLiteral<"branch_protection_rule.edited">, TLiteral<"check_run">, TLiteral<"check_run.completed">, TLiteral<"check_run.created">, TLiteral<"check_run.requested_action">, TLiteral<"check_run.rerequested">, TLiteral<"check_suite">, TLiteral<"check_suite.completed">, TLiteral<"check_suite.requested">, TLiteral<"check_suite.rerequested">, TLiteral<"code_scanning_alert">, TLiteral<"code_scanning_alert.appeared_in_branch">, TLiteral<"code_scanning_alert.closed_by_user">, TLiteral<"code_scanning_alert.created">, TLiteral<"code_scanning_alert.fixed">, TLiteral<"code_scanning_alert.reopened">, TLiteral<"code_scanning_alert.reopened_by_user">, TLiteral<"commit_comment">, TLiteral<"commit_comment.created">, TLiteral<"create">, TLiteral<"custom_property">, TLiteral<"custom_property.created">, TLiteral<"custom_property.deleted">, TLiteral<"custom_property.promote_to_enterprise">, TLiteral<"custom_property.updated">, TLiteral<"custom_property_values">, TLiteral<"custom_property_values.updated">, TLiteral<"delete">, TLiteral<"dependabot_alert">, TLiteral<"dependabot_alert.auto_dismissed">, TLiteral<"dependabot_alert.auto_reopened">, TLiteral<"dependabot_alert.created">, TLiteral<"dependabot_alert.dismissed">, TLiteral<"dependabot_alert.fixed">, TLiteral<"dependabot_alert.reintroduced">, TLiteral<"dependabot_alert.reopened">, TLiteral<"deploy_key">, TLiteral<"deploy_key.created">, TLiteral<"deploy_key.deleted">, TLiteral<"deployment">, TLiteral<"deployment.created">, TLiteral<"deployment_protection_rule">, TLiteral<"deployment_protection_rule.requested">, TLiteral<"deployment_review">, TLiteral<"deployment_review.approved">, TLiteral<"deployment_review.rejected">, TLiteral<"deployment_review.requested">, TLiteral<"deployment_status">, TLiteral<"deployment_status.created">, TLiteral<"discussion">, TLiteral<"discussion.answered">, TLiteral<"discussion.category_changed">, TLiteral<"discussion.closed">, TLiteral<"discussion.created">, TLiteral<"discussion.deleted">, TLiteral<"discussion.edited">, TLiteral<"discussion.labeled">, TLiteral<"discussion.locked">, TLiteral<"discussion.pinned">, TLiteral<"discussion.reopened">, TLiteral<"discussion.transferred">, TLiteral<"discussion.unanswered">, TLiteral<"discussion.unlabeled">, TLiteral<"discussion.unlocked">, TLiteral<"discussion.unpinned">, TLiteral<"discussion_comment">, TLiteral<"discussion_comment.created">, TLiteral<"discussion_comment.deleted">, TLiteral<"discussion_comment.edited">, TLiteral<"fork">, TLiteral<"github_app_authorization">, TLiteral<"github_app_authorization.revoked">, TLiteral<"gollum">, TLiteral<"installation">, TLiteral<"installation.created">, TLiteral<"installation.deleted">, TLiteral<"installation.new_permissions_accepted">, TLiteral<"installation.suspend">, TLiteral<"installation.unsuspend">, TLiteral<"installation_repositories">, TLiteral<"installation_repositories.added">, TLiteral<"installation_repositories.removed">, TLiteral<"installation_target">, TLiteral<"installation_target.renamed">, TLiteral<"issue_comment">, TLiteral<"issue_comment.created">, TLiteral<"issue_comment.deleted">, TLiteral<"issue_comment.edited">, TLiteral<"issues">, TLiteral<"issues.assigned">, TLiteral<"issues.closed">, TLiteral<"issues.deleted">, TLiteral<"issues.demilestoned">, TLiteral<"issues.edited">, TLiteral<"issues.labeled">, TLiteral<"issues.locked">, TLiteral<"issues.milestoned">, TLiteral<"issues.opened">, TLiteral<"issues.pinned">, TLiteral<"issues.reopened">, TLiteral<"issues.transferred">, TLiteral<"issues.typed">, TLiteral<"issues.unassigned">, TLiteral<"issues.unlabeled">, TLiteral<"issues.unlocked">, TLiteral<"issues.unpinned">, TLiteral<"issues.untyped">, TLiteral<"label">, TLiteral<"label.created">, TLiteral<"label.deleted">, TLiteral<"label.edited">, TLiteral<"marketplace_purchase">, TLiteral<"marketplace_purchase.cancelled">, TLiteral<"marketplace_purchase.changed">, TLiteral<"marketplace_purchase.pending_change">, TLiteral<"marketplace_purchase.pending_change_cancelled">, TLiteral<"marketplace_purchase.purchased">, TLiteral<"member">, TLiteral<"member.added">, TLiteral<"member.edited">, TLiteral<"member.removed">, TLiteral<"membership">, TLiteral<"membership.added">, TLiteral<"membership.removed">, TLiteral<"merge_group">, TLiteral<"merge_group.checks_requested">, TLiteral<"merge_group.destroyed">, TLiteral<"meta">, TLiteral<"meta.deleted">, TLiteral<"milestone">, TLiteral<"milestone.closed">, TLiteral<"milestone.created">, TLiteral<"milestone.deleted">, TLiteral<"milestone.edited">, TLiteral<"milestone.opened">, TLiteral<"org_block">, TLiteral<"org_block.blocked">, TLiteral<"org_block.unblocked">, TLiteral<"organization">, TLiteral<"organization.deleted">, TLiteral<"organization.member_added">, TLiteral<"organization.member_invited">, TLiteral<"organization.member_removed">, TLiteral<"organization.renamed">, TLiteral<"package">, TLiteral<"package.published">, TLiteral<"package.updated">, TLiteral<"page_build">, TLiteral<"personal_access_token_request">, TLiteral<"personal_access_token_request.approved">, TLiteral<"personal_access_token_request.cancelled">, TLiteral<"personal_access_token_request.created">, TLiteral<"personal_access_token_request.denied">, TLiteral<"ping">, TLiteral<"project">, TLiteral<"project.closed">, TLiteral<"project.created">, TLiteral<"project.deleted">, TLiteral<"project.edited">, TLiteral<"project.reopened">, TLiteral<"project_card">, TLiteral<"project_card.converted">, TLiteral<"project_card.created">, TLiteral<"project_card.deleted">, TLiteral<"project_card.edited">, TLiteral<"project_card.moved">, TLiteral<"project_column">, TLiteral<"project_column.created">, TLiteral<"project_column.deleted">, TLiteral<"project_column.edited">, TLiteral<"project_column.moved">, TLiteral<"projects_v2">, TLiteral<"projects_v2.closed">, TLiteral<"projects_v2.created">, TLiteral<"projects_v2.deleted">, TLiteral<"projects_v2.edited">, TLiteral<"projects_v2.reopened">, TLiteral<"projects_v2_item">, TLiteral<"projects_v2_item.archived">, TLiteral<"projects_v2_item.converted">, TLiteral<"projects_v2_item.created">, TLiteral<"projects_v2_item.deleted">, TLiteral<"projects_v2_item.edited">, TLiteral<"projects_v2_item.reordered">, TLiteral<"projects_v2_item.restored">, TLiteral<"projects_v2_status_update">, TLiteral<"projects_v2_status_update.created">, TLiteral<"projects_v2_status_update.deleted">, TLiteral<"projects_v2_status_update.edited">, TLiteral<"public">, TLiteral<"pull_request">, TLiteral<"pull_request.assigned">, TLiteral<"pull_request.auto_merge_disabled">, TLiteral<"pull_request.auto_merge_enabled">, TLiteral<"pull_request.closed">, TLiteral<"pull_request.converted_to_draft">, TLiteral<"pull_request.demilestoned">, TLiteral<"pull_request.dequeued">, TLiteral<"pull_request.edited">, TLiteral<"pull_request.enqueued">, TLiteral<"pull_request.labeled">, TLiteral<"pull_request.locked">, TLiteral<"pull_request.milestoned">, TLiteral<"pull_request.opened">, TLiteral<"pull_request.ready_for_review">, TLiteral<"pull_request.reopened">, TLiteral<"pull_request.review_request_removed">, TLiteral<"pull_request.review_requested">, TLiteral<"pull_request.synchronize">, TLiteral<"pull_request.unassigned">, TLiteral<"pull_request.unlabeled">, TLiteral<"pull_request.unlocked">, TLiteral<"pull_request_review">, TLiteral<"pull_request_review.dismissed">, TLiteral<"pull_request_review.edited">, TLiteral<"pull_request_review.submitted">, TLiteral<"pull_request_review_comment">, TLiteral<"pull_request_review_comment.created">, TLiteral<"pull_request_review_comment.deleted">, TLiteral<"pull_request_review_comment.edited">, TLiteral<"pull_request_review_thread">, TLiteral<"pull_request_review_thread.resolved">, TLiteral<"pull_request_review_thread.unresolved">, TLiteral<"push">, TLiteral<"registry_package">, TLiteral<"registry_package.published">, TLiteral<"registry_package.updated">, TLiteral<"release">, TLiteral<"release.created">, TLiteral<"release.deleted">, TLiteral<"release.edited">, TLiteral<"release.prereleased">, TLiteral<"release.published">, TLiteral<"release.released">, TLiteral<"release.unpublished">, TLiteral<"repository">, TLiteral<"repository.archived">, TLiteral<"repository.created">, TLiteral<"repository.deleted">, TLiteral<"repository.edited">, TLiteral<"repository.privatized">, TLiteral<"repository.publicized">, TLiteral<"repository.renamed">, TLiteral<"repository.transferred">, TLiteral<"repository.unarchived">, TLiteral<"repository_advisory">, TLiteral<"repository_advisory.published">, TLiteral<"repository_advisory.reported">, TLiteral<"repository_dispatch">, TLiteral<"repository_dispatch.sample.collected">, TLiteral<"repository_import">, TLiteral<"repository_ruleset">, TLiteral<"repository_ruleset.created">, TLiteral<"repository_ruleset.deleted">, TLiteral<"repository_ruleset.edited">, TLiteral<"repository_vulnerability_alert">, TLiteral<"repository_vulnerability_alert.create">, TLiteral<"repository_vulnerability_alert.dismiss">, TLiteral<"repository_vulnerability_alert.reopen">, TLiteral<"repository_vulnerability_alert.resolve">, TLiteral<"secret_scanning_alert">, TLiteral<"secret_scanning_alert.created">, TLiteral<"secret_scanning_alert.publicly_leaked">, TLiteral<"secret_scanning_alert.reopened">, TLiteral<"secret_scanning_alert.resolved">, TLiteral<"secret_scanning_alert.validated">, TLiteral<"secret_scanning_alert_location">, TLiteral<"secret_scanning_alert_location.created">, TLiteral<"secret_scanning_scan">, TLiteral<"secret_scanning_scan.completed">, TLiteral<"security_advisory">, TLiteral<"security_advisory.published">, TLiteral<"security_advisory.updated">, TLiteral<"security_advisory.withdrawn">, TLiteral<"security_and_analysis">, TLiteral<"sponsorship">, TLiteral<"sponsorship.cancelled">, TLiteral<"sponsorship.created">, TLiteral<"sponsorship.edited">, TLiteral<"sponsorship.pending_cancellation">, TLiteral<"sponsorship.pending_tier_change">, TLiteral<"sponsorship.tier_changed">, TLiteral<"star">, TLiteral<"star.created">, TLiteral<"star.deleted">, TLiteral<"status">, TLiteral<"sub_issues">, TLiteral<"sub_issues.parent_issue_added">, TLiteral<"sub_issues.parent_issue_removed">, TLiteral<"sub_issues.sub_issue_added">, TLiteral<"sub_issues.sub_issue_removed">, TLiteral<"team">, TLiteral<"team.added_to_repository">, TLiteral<"team.created">, TLiteral<"team.deleted">, TLiteral<"team.edited">, TLiteral<"team.removed_from_repository">, TLiteral<"team_add">, TLiteral<"watch">, TLiteral<"watch.started">, TLiteral<"workflow_dispatch">, TLiteral<"workflow_job">, TLiteral<"workflow_job.completed">, TLiteral<"workflow_job.in_progress">, TLiteral<"workflow_job.queued">, TLiteral<"workflow_job.waiting">, TLiteral<"workflow_run">, TLiteral<"workflow_run.completed">, TLiteral<"workflow_run.in_progress">, TLiteral<"workflow_run.requested">]>>>;
|
|
@@ -46,6 +47,7 @@ interface LoggerInterface {
|
|
|
46
47
|
debug(message: string, metadata?: Record<string, unknown>): void;
|
|
47
48
|
error(message: string, metadata?: Record<string, unknown>): void;
|
|
48
49
|
info(message: string, metadata?: Record<string, unknown>): void;
|
|
50
|
+
ok(message: string, metadata?: Record<string, unknown>): void;
|
|
49
51
|
warn(message: string, metadata?: Record<string, unknown>): void;
|
|
50
52
|
}
|
|
51
53
|
/**
|
|
@@ -73,6 +75,7 @@ declare class ConfigurationHandler {
|
|
|
73
75
|
* @returns The merged plugin configuration with resolved plugin settings.
|
|
74
76
|
*/
|
|
75
77
|
getConfiguration(location?: Location): Promise<{
|
|
78
|
+
imports?: string[] | undefined;
|
|
76
79
|
plugins: {
|
|
77
80
|
[x: string]: {
|
|
78
81
|
skipBotEvents?: boolean | undefined;
|
|
@@ -95,6 +98,7 @@ declare class ConfigurationHandler {
|
|
|
95
98
|
rawData: null;
|
|
96
99
|
} | {
|
|
97
100
|
config: {
|
|
101
|
+
imports?: string[] | undefined;
|
|
98
102
|
plugins: {
|
|
99
103
|
[x: string]: {
|
|
100
104
|
skipBotEvents?: boolean | undefined;
|
package/dist/configuration.d.ts
CHANGED
|
@@ -11,7 +11,7 @@ import './octokit.js';
|
|
|
11
11
|
import '@octokit/core/types';
|
|
12
12
|
import '@octokit/plugin-paginate-graphql';
|
|
13
13
|
import '@octokit/plugin-paginate-rest';
|
|
14
|
-
import '@octokit/
|
|
14
|
+
import '@octokit/request-error';
|
|
15
15
|
import '@octokit/core';
|
|
16
16
|
|
|
17
17
|
type GithubPlugin = {
|
|
@@ -27,6 +27,7 @@ declare const pluginSettingsSchema: _sinclair_typebox.TUnion<[_sinclair_typebox.
|
|
|
27
27
|
}>]>;
|
|
28
28
|
type PluginSettings = StaticDecode<typeof pluginSettingsSchema>;
|
|
29
29
|
declare const configSchema: _sinclair_typebox.TObject<{
|
|
30
|
+
imports: _sinclair_typebox.TOptional<_sinclair_typebox.TArray<_sinclair_typebox.TString>>;
|
|
30
31
|
plugins: _sinclair_typebox.TRecord<_sinclair_typebox.TString, _sinclair_typebox.TUnion<[_sinclair_typebox.TNull, _sinclair_typebox.TObject<{
|
|
31
32
|
with: _sinclair_typebox.TRecord<_sinclair_typebox.TString, _sinclair_typebox.TUnknown>;
|
|
32
33
|
runsOn: _sinclair_typebox.TOptional<_sinclair_typebox.TArray<_sinclair_typebox.TUnion<[TLiteral<"branch_protection_configuration">, TLiteral<"branch_protection_configuration.disabled">, TLiteral<"branch_protection_configuration.enabled">, TLiteral<"branch_protection_rule">, TLiteral<"branch_protection_rule.created">, TLiteral<"branch_protection_rule.deleted">, TLiteral<"branch_protection_rule.edited">, TLiteral<"check_run">, TLiteral<"check_run.completed">, TLiteral<"check_run.created">, TLiteral<"check_run.requested_action">, TLiteral<"check_run.rerequested">, TLiteral<"check_suite">, TLiteral<"check_suite.completed">, TLiteral<"check_suite.requested">, TLiteral<"check_suite.rerequested">, TLiteral<"code_scanning_alert">, TLiteral<"code_scanning_alert.appeared_in_branch">, TLiteral<"code_scanning_alert.closed_by_user">, TLiteral<"code_scanning_alert.created">, TLiteral<"code_scanning_alert.fixed">, TLiteral<"code_scanning_alert.reopened">, TLiteral<"code_scanning_alert.reopened_by_user">, TLiteral<"commit_comment">, TLiteral<"commit_comment.created">, TLiteral<"create">, TLiteral<"custom_property">, TLiteral<"custom_property.created">, TLiteral<"custom_property.deleted">, TLiteral<"custom_property.promote_to_enterprise">, TLiteral<"custom_property.updated">, TLiteral<"custom_property_values">, TLiteral<"custom_property_values.updated">, TLiteral<"delete">, TLiteral<"dependabot_alert">, TLiteral<"dependabot_alert.auto_dismissed">, TLiteral<"dependabot_alert.auto_reopened">, TLiteral<"dependabot_alert.created">, TLiteral<"dependabot_alert.dismissed">, TLiteral<"dependabot_alert.fixed">, TLiteral<"dependabot_alert.reintroduced">, TLiteral<"dependabot_alert.reopened">, TLiteral<"deploy_key">, TLiteral<"deploy_key.created">, TLiteral<"deploy_key.deleted">, TLiteral<"deployment">, TLiteral<"deployment.created">, TLiteral<"deployment_protection_rule">, TLiteral<"deployment_protection_rule.requested">, TLiteral<"deployment_review">, TLiteral<"deployment_review.approved">, TLiteral<"deployment_review.rejected">, TLiteral<"deployment_review.requested">, TLiteral<"deployment_status">, TLiteral<"deployment_status.created">, TLiteral<"discussion">, TLiteral<"discussion.answered">, TLiteral<"discussion.category_changed">, TLiteral<"discussion.closed">, TLiteral<"discussion.created">, TLiteral<"discussion.deleted">, TLiteral<"discussion.edited">, TLiteral<"discussion.labeled">, TLiteral<"discussion.locked">, TLiteral<"discussion.pinned">, TLiteral<"discussion.reopened">, TLiteral<"discussion.transferred">, TLiteral<"discussion.unanswered">, TLiteral<"discussion.unlabeled">, TLiteral<"discussion.unlocked">, TLiteral<"discussion.unpinned">, TLiteral<"discussion_comment">, TLiteral<"discussion_comment.created">, TLiteral<"discussion_comment.deleted">, TLiteral<"discussion_comment.edited">, TLiteral<"fork">, TLiteral<"github_app_authorization">, TLiteral<"github_app_authorization.revoked">, TLiteral<"gollum">, TLiteral<"installation">, TLiteral<"installation.created">, TLiteral<"installation.deleted">, TLiteral<"installation.new_permissions_accepted">, TLiteral<"installation.suspend">, TLiteral<"installation.unsuspend">, TLiteral<"installation_repositories">, TLiteral<"installation_repositories.added">, TLiteral<"installation_repositories.removed">, TLiteral<"installation_target">, TLiteral<"installation_target.renamed">, TLiteral<"issue_comment">, TLiteral<"issue_comment.created">, TLiteral<"issue_comment.deleted">, TLiteral<"issue_comment.edited">, TLiteral<"issues">, TLiteral<"issues.assigned">, TLiteral<"issues.closed">, TLiteral<"issues.deleted">, TLiteral<"issues.demilestoned">, TLiteral<"issues.edited">, TLiteral<"issues.labeled">, TLiteral<"issues.locked">, TLiteral<"issues.milestoned">, TLiteral<"issues.opened">, TLiteral<"issues.pinned">, TLiteral<"issues.reopened">, TLiteral<"issues.transferred">, TLiteral<"issues.typed">, TLiteral<"issues.unassigned">, TLiteral<"issues.unlabeled">, TLiteral<"issues.unlocked">, TLiteral<"issues.unpinned">, TLiteral<"issues.untyped">, TLiteral<"label">, TLiteral<"label.created">, TLiteral<"label.deleted">, TLiteral<"label.edited">, TLiteral<"marketplace_purchase">, TLiteral<"marketplace_purchase.cancelled">, TLiteral<"marketplace_purchase.changed">, TLiteral<"marketplace_purchase.pending_change">, TLiteral<"marketplace_purchase.pending_change_cancelled">, TLiteral<"marketplace_purchase.purchased">, TLiteral<"member">, TLiteral<"member.added">, TLiteral<"member.edited">, TLiteral<"member.removed">, TLiteral<"membership">, TLiteral<"membership.added">, TLiteral<"membership.removed">, TLiteral<"merge_group">, TLiteral<"merge_group.checks_requested">, TLiteral<"merge_group.destroyed">, TLiteral<"meta">, TLiteral<"meta.deleted">, TLiteral<"milestone">, TLiteral<"milestone.closed">, TLiteral<"milestone.created">, TLiteral<"milestone.deleted">, TLiteral<"milestone.edited">, TLiteral<"milestone.opened">, TLiteral<"org_block">, TLiteral<"org_block.blocked">, TLiteral<"org_block.unblocked">, TLiteral<"organization">, TLiteral<"organization.deleted">, TLiteral<"organization.member_added">, TLiteral<"organization.member_invited">, TLiteral<"organization.member_removed">, TLiteral<"organization.renamed">, TLiteral<"package">, TLiteral<"package.published">, TLiteral<"package.updated">, TLiteral<"page_build">, TLiteral<"personal_access_token_request">, TLiteral<"personal_access_token_request.approved">, TLiteral<"personal_access_token_request.cancelled">, TLiteral<"personal_access_token_request.created">, TLiteral<"personal_access_token_request.denied">, TLiteral<"ping">, TLiteral<"project">, TLiteral<"project.closed">, TLiteral<"project.created">, TLiteral<"project.deleted">, TLiteral<"project.edited">, TLiteral<"project.reopened">, TLiteral<"project_card">, TLiteral<"project_card.converted">, TLiteral<"project_card.created">, TLiteral<"project_card.deleted">, TLiteral<"project_card.edited">, TLiteral<"project_card.moved">, TLiteral<"project_column">, TLiteral<"project_column.created">, TLiteral<"project_column.deleted">, TLiteral<"project_column.edited">, TLiteral<"project_column.moved">, TLiteral<"projects_v2">, TLiteral<"projects_v2.closed">, TLiteral<"projects_v2.created">, TLiteral<"projects_v2.deleted">, TLiteral<"projects_v2.edited">, TLiteral<"projects_v2.reopened">, TLiteral<"projects_v2_item">, TLiteral<"projects_v2_item.archived">, TLiteral<"projects_v2_item.converted">, TLiteral<"projects_v2_item.created">, TLiteral<"projects_v2_item.deleted">, TLiteral<"projects_v2_item.edited">, TLiteral<"projects_v2_item.reordered">, TLiteral<"projects_v2_item.restored">, TLiteral<"projects_v2_status_update">, TLiteral<"projects_v2_status_update.created">, TLiteral<"projects_v2_status_update.deleted">, TLiteral<"projects_v2_status_update.edited">, TLiteral<"public">, TLiteral<"pull_request">, TLiteral<"pull_request.assigned">, TLiteral<"pull_request.auto_merge_disabled">, TLiteral<"pull_request.auto_merge_enabled">, TLiteral<"pull_request.closed">, TLiteral<"pull_request.converted_to_draft">, TLiteral<"pull_request.demilestoned">, TLiteral<"pull_request.dequeued">, TLiteral<"pull_request.edited">, TLiteral<"pull_request.enqueued">, TLiteral<"pull_request.labeled">, TLiteral<"pull_request.locked">, TLiteral<"pull_request.milestoned">, TLiteral<"pull_request.opened">, TLiteral<"pull_request.ready_for_review">, TLiteral<"pull_request.reopened">, TLiteral<"pull_request.review_request_removed">, TLiteral<"pull_request.review_requested">, TLiteral<"pull_request.synchronize">, TLiteral<"pull_request.unassigned">, TLiteral<"pull_request.unlabeled">, TLiteral<"pull_request.unlocked">, TLiteral<"pull_request_review">, TLiteral<"pull_request_review.dismissed">, TLiteral<"pull_request_review.edited">, TLiteral<"pull_request_review.submitted">, TLiteral<"pull_request_review_comment">, TLiteral<"pull_request_review_comment.created">, TLiteral<"pull_request_review_comment.deleted">, TLiteral<"pull_request_review_comment.edited">, TLiteral<"pull_request_review_thread">, TLiteral<"pull_request_review_thread.resolved">, TLiteral<"pull_request_review_thread.unresolved">, TLiteral<"push">, TLiteral<"registry_package">, TLiteral<"registry_package.published">, TLiteral<"registry_package.updated">, TLiteral<"release">, TLiteral<"release.created">, TLiteral<"release.deleted">, TLiteral<"release.edited">, TLiteral<"release.prereleased">, TLiteral<"release.published">, TLiteral<"release.released">, TLiteral<"release.unpublished">, TLiteral<"repository">, TLiteral<"repository.archived">, TLiteral<"repository.created">, TLiteral<"repository.deleted">, TLiteral<"repository.edited">, TLiteral<"repository.privatized">, TLiteral<"repository.publicized">, TLiteral<"repository.renamed">, TLiteral<"repository.transferred">, TLiteral<"repository.unarchived">, TLiteral<"repository_advisory">, TLiteral<"repository_advisory.published">, TLiteral<"repository_advisory.reported">, TLiteral<"repository_dispatch">, TLiteral<"repository_dispatch.sample.collected">, TLiteral<"repository_import">, TLiteral<"repository_ruleset">, TLiteral<"repository_ruleset.created">, TLiteral<"repository_ruleset.deleted">, TLiteral<"repository_ruleset.edited">, TLiteral<"repository_vulnerability_alert">, TLiteral<"repository_vulnerability_alert.create">, TLiteral<"repository_vulnerability_alert.dismiss">, TLiteral<"repository_vulnerability_alert.reopen">, TLiteral<"repository_vulnerability_alert.resolve">, TLiteral<"secret_scanning_alert">, TLiteral<"secret_scanning_alert.created">, TLiteral<"secret_scanning_alert.publicly_leaked">, TLiteral<"secret_scanning_alert.reopened">, TLiteral<"secret_scanning_alert.resolved">, TLiteral<"secret_scanning_alert.validated">, TLiteral<"secret_scanning_alert_location">, TLiteral<"secret_scanning_alert_location.created">, TLiteral<"secret_scanning_scan">, TLiteral<"secret_scanning_scan.completed">, TLiteral<"security_advisory">, TLiteral<"security_advisory.published">, TLiteral<"security_advisory.updated">, TLiteral<"security_advisory.withdrawn">, TLiteral<"security_and_analysis">, TLiteral<"sponsorship">, TLiteral<"sponsorship.cancelled">, TLiteral<"sponsorship.created">, TLiteral<"sponsorship.edited">, TLiteral<"sponsorship.pending_cancellation">, TLiteral<"sponsorship.pending_tier_change">, TLiteral<"sponsorship.tier_changed">, TLiteral<"star">, TLiteral<"star.created">, TLiteral<"star.deleted">, TLiteral<"status">, TLiteral<"sub_issues">, TLiteral<"sub_issues.parent_issue_added">, TLiteral<"sub_issues.parent_issue_removed">, TLiteral<"sub_issues.sub_issue_added">, TLiteral<"sub_issues.sub_issue_removed">, TLiteral<"team">, TLiteral<"team.added_to_repository">, TLiteral<"team.created">, TLiteral<"team.deleted">, TLiteral<"team.edited">, TLiteral<"team.removed_from_repository">, TLiteral<"team_add">, TLiteral<"watch">, TLiteral<"watch.started">, TLiteral<"workflow_dispatch">, TLiteral<"workflow_job">, TLiteral<"workflow_job.completed">, TLiteral<"workflow_job.in_progress">, TLiteral<"workflow_job.queued">, TLiteral<"workflow_job.waiting">, TLiteral<"workflow_run">, TLiteral<"workflow_run.completed">, TLiteral<"workflow_run.in_progress">, TLiteral<"workflow_run.requested">]>>>;
|
|
@@ -46,6 +47,7 @@ interface LoggerInterface {
|
|
|
46
47
|
debug(message: string, metadata?: Record<string, unknown>): void;
|
|
47
48
|
error(message: string, metadata?: Record<string, unknown>): void;
|
|
48
49
|
info(message: string, metadata?: Record<string, unknown>): void;
|
|
50
|
+
ok(message: string, metadata?: Record<string, unknown>): void;
|
|
49
51
|
warn(message: string, metadata?: Record<string, unknown>): void;
|
|
50
52
|
}
|
|
51
53
|
/**
|
|
@@ -73,6 +75,7 @@ declare class ConfigurationHandler {
|
|
|
73
75
|
* @returns The merged plugin configuration with resolved plugin settings.
|
|
74
76
|
*/
|
|
75
77
|
getConfiguration(location?: Location): Promise<{
|
|
78
|
+
imports?: string[] | undefined;
|
|
76
79
|
plugins: {
|
|
77
80
|
[x: string]: {
|
|
78
81
|
skipBotEvents?: boolean | undefined;
|
|
@@ -95,6 +98,7 @@ declare class ConfigurationHandler {
|
|
|
95
98
|
rawData: null;
|
|
96
99
|
} | {
|
|
97
100
|
config: {
|
|
101
|
+
imports?: string[] | undefined;
|
|
98
102
|
plugins: {
|
|
99
103
|
[x: string]: {
|
|
100
104
|
skipBotEvents?: boolean | undefined;
|