@ubiquity-os/plugin-sdk 3.11.0 → 3.11.2
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 +0 -30
- package/dist/configuration.d.mts +15 -12
- package/dist/configuration.d.ts +15 -12
- package/dist/configuration.js +30 -11
- package/dist/configuration.mjs +30 -12
- package/dist/index.js +76 -3
- package/dist/index.mjs +76 -3
- package/dist/llm.js +76 -3
- package/dist/llm.mjs +76 -3
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -21,10 +21,6 @@ The `createPlugin` function enables users to create a plugin that will run on Cl
|
|
|
21
21
|
|
|
22
22
|
The `callLlm` function sends chat completion requests to `ai.ubq.fi` using the auth token and repository context supplied by the kernel.
|
|
23
23
|
|
|
24
|
-
### `callLlm`
|
|
25
|
-
|
|
26
|
-
The `callLlm` function sends chat completion requests to `ai.ubq.fi` using the auth token and repository context supplied by the kernel.
|
|
27
|
-
|
|
28
24
|
### `postComment`
|
|
29
25
|
|
|
30
26
|
Use `context.commentHandler.postComment` to write or update a comment on the triggering issue or pull request.
|
|
@@ -87,32 +83,6 @@ const result = await callLlm(
|
|
|
87
83
|
);
|
|
88
84
|
```
|
|
89
85
|
|
|
90
|
-
## LLM Utility
|
|
91
|
-
|
|
92
|
-
```ts
|
|
93
|
-
import { callLlm } from "@ubiquity-os/plugin-sdk";
|
|
94
|
-
|
|
95
|
-
const result = await callLlm(
|
|
96
|
-
{
|
|
97
|
-
messages: [{ role: "user", content: "Summarize this issue." }],
|
|
98
|
-
},
|
|
99
|
-
context
|
|
100
|
-
);
|
|
101
|
-
```
|
|
102
|
-
|
|
103
|
-
## LLM Utility
|
|
104
|
-
|
|
105
|
-
```ts
|
|
106
|
-
import { callLlm } from "@ubiquity-os/plugin-sdk";
|
|
107
|
-
|
|
108
|
-
const result = await callLlm(
|
|
109
|
-
{
|
|
110
|
-
messages: [{ role: "user", content: "Summarize this issue." }],
|
|
111
|
-
},
|
|
112
|
-
context
|
|
113
|
-
);
|
|
114
|
-
```
|
|
115
|
-
|
|
116
86
|
## Markdown Cleaning Utility
|
|
117
87
|
|
|
118
88
|
`cleanMarkdown` removes top-level HTML comments and configured HTML tags while preserving content inside fenced/indented code blocks, inline code spans, and blockquotes.
|
package/dist/configuration.d.mts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { Value } from '@sinclair/typebox/value';
|
|
2
|
-
import
|
|
2
|
+
import { YAMLException } from 'js-yaml';
|
|
3
3
|
import * as _sinclair_typebox from '@sinclair/typebox';
|
|
4
|
-
import {
|
|
4
|
+
import { TLiteral, StaticDecode } from '@sinclair/typebox';
|
|
5
5
|
import { C as Context } from './context-Dwl3aRX-.mjs';
|
|
6
6
|
import { Manifest } from './manifest.mjs';
|
|
7
7
|
import '@octokit/webhooks';
|
|
@@ -21,7 +21,7 @@ type GithubPlugin = {
|
|
|
21
21
|
ref?: string;
|
|
22
22
|
};
|
|
23
23
|
declare const pluginSettingsSchema: _sinclair_typebox.TUnion<[_sinclair_typebox.TNull, _sinclair_typebox.TObject<{
|
|
24
|
-
with: _sinclair_typebox.
|
|
24
|
+
with: _sinclair_typebox.TRecord<_sinclair_typebox.TString, _sinclair_typebox.TUnknown>;
|
|
25
25
|
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<"issue_dependencies">, TLiteral<"issue_dependencies.blocked_by_added">, TLiteral<"issue_dependencies.blocked_by_removed">, TLiteral<"issue_dependencies.blocking_added">, TLiteral<"issue_dependencies.blocking_removed">, 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.assigned">, 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.unassigned">, 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">]>>>;
|
|
26
26
|
skipBotEvents: _sinclair_typebox.TOptional<_sinclair_typebox.TBoolean>;
|
|
27
27
|
}>]>;
|
|
@@ -29,7 +29,7 @@ type PluginSettings = StaticDecode<typeof pluginSettingsSchema>;
|
|
|
29
29
|
declare const configSchema: _sinclair_typebox.TObject<{
|
|
30
30
|
imports: _sinclair_typebox.TOptional<_sinclair_typebox.TArray<_sinclair_typebox.TString>>;
|
|
31
31
|
plugins: _sinclair_typebox.TRecord<_sinclair_typebox.TString, _sinclair_typebox.TUnion<[_sinclair_typebox.TNull, _sinclair_typebox.TObject<{
|
|
32
|
-
with: _sinclair_typebox.
|
|
32
|
+
with: _sinclair_typebox.TRecord<_sinclair_typebox.TString, _sinclair_typebox.TUnknown>;
|
|
33
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<"issue_dependencies">, TLiteral<"issue_dependencies.blocked_by_added">, TLiteral<"issue_dependencies.blocked_by_removed">, TLiteral<"issue_dependencies.blocking_added">, TLiteral<"issue_dependencies.blocking_removed">, 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.assigned">, 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.unassigned">, 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">]>>>;
|
|
34
34
|
skipBotEvents: _sinclair_typebox.TOptional<_sinclair_typebox.TBoolean>;
|
|
35
35
|
}>]>>;
|
|
@@ -42,10 +42,12 @@ declare const CONFIG_ORG_REPO = ".ubiquity-os";
|
|
|
42
42
|
type Location = {
|
|
43
43
|
owner: string;
|
|
44
44
|
repo: string;
|
|
45
|
+
environment?: string;
|
|
45
46
|
};
|
|
46
47
|
type ConfigurationRefOptions = {
|
|
47
48
|
orgRef?: string;
|
|
48
49
|
repoRef?: string;
|
|
50
|
+
environment?: string;
|
|
49
51
|
};
|
|
50
52
|
type OctokitFactory = (location: Location) => Promise<Context["octokit"] | null>;
|
|
51
53
|
interface LoggerInterface {
|
|
@@ -89,11 +91,11 @@ declare class ConfigurationHandler {
|
|
|
89
91
|
imports?: string[] | undefined;
|
|
90
92
|
plugins: {
|
|
91
93
|
[x: string]: {
|
|
92
|
-
with?: {
|
|
93
|
-
[x: string]: unknown;
|
|
94
|
-
} | undefined;
|
|
95
94
|
runsOn?: ("branch_protection_configuration" | "branch_protection_configuration.disabled" | "branch_protection_configuration.enabled" | "branch_protection_rule" | "branch_protection_rule.created" | "branch_protection_rule.deleted" | "branch_protection_rule.edited" | "check_run" | "check_run.completed" | "check_run.created" | "check_run.requested_action" | "check_run.rerequested" | "check_suite" | "check_suite.completed" | "check_suite.requested" | "check_suite.rerequested" | "code_scanning_alert" | "code_scanning_alert.appeared_in_branch" | "code_scanning_alert.closed_by_user" | "code_scanning_alert.created" | "code_scanning_alert.fixed" | "code_scanning_alert.reopened" | "code_scanning_alert.reopened_by_user" | "commit_comment" | "commit_comment.created" | "create" | "custom_property" | "custom_property.created" | "custom_property.deleted" | "custom_property.promote_to_enterprise" | "custom_property.updated" | "custom_property_values" | "custom_property_values.updated" | "delete" | "dependabot_alert" | "dependabot_alert.auto_dismissed" | "dependabot_alert.auto_reopened" | "dependabot_alert.created" | "dependabot_alert.dismissed" | "dependabot_alert.fixed" | "dependabot_alert.reintroduced" | "dependabot_alert.reopened" | "deploy_key" | "deploy_key.created" | "deploy_key.deleted" | "deployment" | "deployment.created" | "deployment_protection_rule" | "deployment_protection_rule.requested" | "deployment_review" | "deployment_review.approved" | "deployment_review.rejected" | "deployment_review.requested" | "deployment_status" | "deployment_status.created" | "discussion" | "discussion.answered" | "discussion.category_changed" | "discussion.closed" | "discussion.created" | "discussion.deleted" | "discussion.edited" | "discussion.labeled" | "discussion.locked" | "discussion.pinned" | "discussion.reopened" | "discussion.transferred" | "discussion.unanswered" | "discussion.unlabeled" | "discussion.unlocked" | "discussion.unpinned" | "discussion_comment" | "discussion_comment.created" | "discussion_comment.deleted" | "discussion_comment.edited" | "fork" | "github_app_authorization" | "github_app_authorization.revoked" | "gollum" | "installation" | "installation.created" | "installation.deleted" | "installation.new_permissions_accepted" | "installation.suspend" | "installation.unsuspend" | "installation_repositories" | "installation_repositories.added" | "installation_repositories.removed" | "installation_target" | "installation_target.renamed" | "issue_comment" | "issue_comment.created" | "issue_comment.deleted" | "issue_comment.edited" | "issue_dependencies" | "issue_dependencies.blocked_by_added" | "issue_dependencies.blocked_by_removed" | "issue_dependencies.blocking_added" | "issue_dependencies.blocking_removed" | "issues" | "issues.assigned" | "issues.closed" | "issues.deleted" | "issues.demilestoned" | "issues.edited" | "issues.labeled" | "issues.locked" | "issues.milestoned" | "issues.opened" | "issues.pinned" | "issues.reopened" | "issues.transferred" | "issues.typed" | "issues.unassigned" | "issues.unlabeled" | "issues.unlocked" | "issues.unpinned" | "issues.untyped" | "label" | "label.created" | "label.deleted" | "label.edited" | "marketplace_purchase" | "marketplace_purchase.cancelled" | "marketplace_purchase.changed" | "marketplace_purchase.pending_change" | "marketplace_purchase.pending_change_cancelled" | "marketplace_purchase.purchased" | "member" | "member.added" | "member.edited" | "member.removed" | "membership" | "membership.added" | "membership.removed" | "merge_group" | "merge_group.checks_requested" | "merge_group.destroyed" | "meta" | "meta.deleted" | "milestone" | "milestone.closed" | "milestone.created" | "milestone.deleted" | "milestone.edited" | "milestone.opened" | "org_block" | "org_block.blocked" | "org_block.unblocked" | "organization" | "organization.deleted" | "organization.member_added" | "organization.member_invited" | "organization.member_removed" | "organization.renamed" | "package" | "package.published" | "package.updated" | "page_build" | "personal_access_token_request" | "personal_access_token_request.approved" | "personal_access_token_request.cancelled" | "personal_access_token_request.created" | "personal_access_token_request.denied" | "ping" | "project" | "project.closed" | "project.created" | "project.deleted" | "project.edited" | "project.reopened" | "project_card" | "project_card.converted" | "project_card.created" | "project_card.deleted" | "project_card.edited" | "project_card.moved" | "project_column" | "project_column.created" | "project_column.deleted" | "project_column.edited" | "project_column.moved" | "projects_v2" | "projects_v2.closed" | "projects_v2.created" | "projects_v2.deleted" | "projects_v2.edited" | "projects_v2.reopened" | "projects_v2_item" | "projects_v2_item.archived" | "projects_v2_item.converted" | "projects_v2_item.created" | "projects_v2_item.deleted" | "projects_v2_item.edited" | "projects_v2_item.reordered" | "projects_v2_item.restored" | "projects_v2_status_update" | "projects_v2_status_update.created" | "projects_v2_status_update.deleted" | "projects_v2_status_update.edited" | "public" | "pull_request" | "pull_request.assigned" | "pull_request.auto_merge_disabled" | "pull_request.auto_merge_enabled" | "pull_request.closed" | "pull_request.converted_to_draft" | "pull_request.demilestoned" | "pull_request.dequeued" | "pull_request.edited" | "pull_request.enqueued" | "pull_request.labeled" | "pull_request.locked" | "pull_request.milestoned" | "pull_request.opened" | "pull_request.ready_for_review" | "pull_request.reopened" | "pull_request.review_request_removed" | "pull_request.review_requested" | "pull_request.synchronize" | "pull_request.unassigned" | "pull_request.unlabeled" | "pull_request.unlocked" | "pull_request_review" | "pull_request_review.dismissed" | "pull_request_review.edited" | "pull_request_review.submitted" | "pull_request_review_comment" | "pull_request_review_comment.created" | "pull_request_review_comment.deleted" | "pull_request_review_comment.edited" | "pull_request_review_thread" | "pull_request_review_thread.resolved" | "pull_request_review_thread.unresolved" | "push" | "registry_package" | "registry_package.published" | "registry_package.updated" | "release" | "release.created" | "release.deleted" | "release.edited" | "release.prereleased" | "release.published" | "release.released" | "release.unpublished" | "repository" | "repository.archived" | "repository.created" | "repository.deleted" | "repository.edited" | "repository.privatized" | "repository.publicized" | "repository.renamed" | "repository.transferred" | "repository.unarchived" | "repository_advisory" | "repository_advisory.published" | "repository_advisory.reported" | "repository_dispatch" | "repository_dispatch.sample.collected" | "repository_import" | "repository_ruleset" | "repository_ruleset.created" | "repository_ruleset.deleted" | "repository_ruleset.edited" | "repository_vulnerability_alert" | "repository_vulnerability_alert.create" | "repository_vulnerability_alert.dismiss" | "repository_vulnerability_alert.reopen" | "repository_vulnerability_alert.resolve" | "secret_scanning_alert" | "secret_scanning_alert.assigned" | "secret_scanning_alert.created" | "secret_scanning_alert.publicly_leaked" | "secret_scanning_alert.reopened" | "secret_scanning_alert.resolved" | "secret_scanning_alert.unassigned" | "secret_scanning_alert.validated" | "secret_scanning_alert_location" | "secret_scanning_alert_location.created" | "secret_scanning_scan" | "secret_scanning_scan.completed" | "security_advisory" | "security_advisory.published" | "security_advisory.updated" | "security_advisory.withdrawn" | "security_and_analysis" | "sponsorship" | "sponsorship.cancelled" | "sponsorship.created" | "sponsorship.edited" | "sponsorship.pending_cancellation" | "sponsorship.pending_tier_change" | "sponsorship.tier_changed" | "star" | "star.created" | "star.deleted" | "status" | "sub_issues" | "sub_issues.parent_issue_added" | "sub_issues.parent_issue_removed" | "sub_issues.sub_issue_added" | "sub_issues.sub_issue_removed" | "team" | "team.added_to_repository" | "team.created" | "team.deleted" | "team.edited" | "team.removed_from_repository" | "team_add" | "watch" | "watch.started" | "workflow_dispatch" | "workflow_job" | "workflow_job.completed" | "workflow_job.in_progress" | "workflow_job.queued" | "workflow_job.waiting" | "workflow_run" | "workflow_run.completed" | "workflow_run.in_progress" | "workflow_run.requested")[] | undefined;
|
|
96
95
|
skipBotEvents?: boolean | undefined;
|
|
96
|
+
with: {
|
|
97
|
+
[x: string]: unknown;
|
|
98
|
+
};
|
|
97
99
|
} | null;
|
|
98
100
|
};
|
|
99
101
|
}>;
|
|
@@ -109,6 +111,7 @@ declare class ConfigurationHandler {
|
|
|
109
111
|
*/
|
|
110
112
|
getConfigurationFromRepo(owner: string, repository: string, options?: {
|
|
111
113
|
ref?: string;
|
|
114
|
+
environment?: string;
|
|
112
115
|
}): Promise<{
|
|
113
116
|
config: null;
|
|
114
117
|
errors: null;
|
|
@@ -118,15 +121,15 @@ declare class ConfigurationHandler {
|
|
|
118
121
|
imports?: string[] | undefined;
|
|
119
122
|
plugins: {
|
|
120
123
|
[x: string]: {
|
|
121
|
-
with?: {
|
|
122
|
-
[x: string]: unknown;
|
|
123
|
-
} | undefined;
|
|
124
124
|
runsOn?: ("branch_protection_configuration" | "branch_protection_configuration.disabled" | "branch_protection_configuration.enabled" | "branch_protection_rule" | "branch_protection_rule.created" | "branch_protection_rule.deleted" | "branch_protection_rule.edited" | "check_run" | "check_run.completed" | "check_run.created" | "check_run.requested_action" | "check_run.rerequested" | "check_suite" | "check_suite.completed" | "check_suite.requested" | "check_suite.rerequested" | "code_scanning_alert" | "code_scanning_alert.appeared_in_branch" | "code_scanning_alert.closed_by_user" | "code_scanning_alert.created" | "code_scanning_alert.fixed" | "code_scanning_alert.reopened" | "code_scanning_alert.reopened_by_user" | "commit_comment" | "commit_comment.created" | "create" | "custom_property" | "custom_property.created" | "custom_property.deleted" | "custom_property.promote_to_enterprise" | "custom_property.updated" | "custom_property_values" | "custom_property_values.updated" | "delete" | "dependabot_alert" | "dependabot_alert.auto_dismissed" | "dependabot_alert.auto_reopened" | "dependabot_alert.created" | "dependabot_alert.dismissed" | "dependabot_alert.fixed" | "dependabot_alert.reintroduced" | "dependabot_alert.reopened" | "deploy_key" | "deploy_key.created" | "deploy_key.deleted" | "deployment" | "deployment.created" | "deployment_protection_rule" | "deployment_protection_rule.requested" | "deployment_review" | "deployment_review.approved" | "deployment_review.rejected" | "deployment_review.requested" | "deployment_status" | "deployment_status.created" | "discussion" | "discussion.answered" | "discussion.category_changed" | "discussion.closed" | "discussion.created" | "discussion.deleted" | "discussion.edited" | "discussion.labeled" | "discussion.locked" | "discussion.pinned" | "discussion.reopened" | "discussion.transferred" | "discussion.unanswered" | "discussion.unlabeled" | "discussion.unlocked" | "discussion.unpinned" | "discussion_comment" | "discussion_comment.created" | "discussion_comment.deleted" | "discussion_comment.edited" | "fork" | "github_app_authorization" | "github_app_authorization.revoked" | "gollum" | "installation" | "installation.created" | "installation.deleted" | "installation.new_permissions_accepted" | "installation.suspend" | "installation.unsuspend" | "installation_repositories" | "installation_repositories.added" | "installation_repositories.removed" | "installation_target" | "installation_target.renamed" | "issue_comment" | "issue_comment.created" | "issue_comment.deleted" | "issue_comment.edited" | "issue_dependencies" | "issue_dependencies.blocked_by_added" | "issue_dependencies.blocked_by_removed" | "issue_dependencies.blocking_added" | "issue_dependencies.blocking_removed" | "issues" | "issues.assigned" | "issues.closed" | "issues.deleted" | "issues.demilestoned" | "issues.edited" | "issues.labeled" | "issues.locked" | "issues.milestoned" | "issues.opened" | "issues.pinned" | "issues.reopened" | "issues.transferred" | "issues.typed" | "issues.unassigned" | "issues.unlabeled" | "issues.unlocked" | "issues.unpinned" | "issues.untyped" | "label" | "label.created" | "label.deleted" | "label.edited" | "marketplace_purchase" | "marketplace_purchase.cancelled" | "marketplace_purchase.changed" | "marketplace_purchase.pending_change" | "marketplace_purchase.pending_change_cancelled" | "marketplace_purchase.purchased" | "member" | "member.added" | "member.edited" | "member.removed" | "membership" | "membership.added" | "membership.removed" | "merge_group" | "merge_group.checks_requested" | "merge_group.destroyed" | "meta" | "meta.deleted" | "milestone" | "milestone.closed" | "milestone.created" | "milestone.deleted" | "milestone.edited" | "milestone.opened" | "org_block" | "org_block.blocked" | "org_block.unblocked" | "organization" | "organization.deleted" | "organization.member_added" | "organization.member_invited" | "organization.member_removed" | "organization.renamed" | "package" | "package.published" | "package.updated" | "page_build" | "personal_access_token_request" | "personal_access_token_request.approved" | "personal_access_token_request.cancelled" | "personal_access_token_request.created" | "personal_access_token_request.denied" | "ping" | "project" | "project.closed" | "project.created" | "project.deleted" | "project.edited" | "project.reopened" | "project_card" | "project_card.converted" | "project_card.created" | "project_card.deleted" | "project_card.edited" | "project_card.moved" | "project_column" | "project_column.created" | "project_column.deleted" | "project_column.edited" | "project_column.moved" | "projects_v2" | "projects_v2.closed" | "projects_v2.created" | "projects_v2.deleted" | "projects_v2.edited" | "projects_v2.reopened" | "projects_v2_item" | "projects_v2_item.archived" | "projects_v2_item.converted" | "projects_v2_item.created" | "projects_v2_item.deleted" | "projects_v2_item.edited" | "projects_v2_item.reordered" | "projects_v2_item.restored" | "projects_v2_status_update" | "projects_v2_status_update.created" | "projects_v2_status_update.deleted" | "projects_v2_status_update.edited" | "public" | "pull_request" | "pull_request.assigned" | "pull_request.auto_merge_disabled" | "pull_request.auto_merge_enabled" | "pull_request.closed" | "pull_request.converted_to_draft" | "pull_request.demilestoned" | "pull_request.dequeued" | "pull_request.edited" | "pull_request.enqueued" | "pull_request.labeled" | "pull_request.locked" | "pull_request.milestoned" | "pull_request.opened" | "pull_request.ready_for_review" | "pull_request.reopened" | "pull_request.review_request_removed" | "pull_request.review_requested" | "pull_request.synchronize" | "pull_request.unassigned" | "pull_request.unlabeled" | "pull_request.unlocked" | "pull_request_review" | "pull_request_review.dismissed" | "pull_request_review.edited" | "pull_request_review.submitted" | "pull_request_review_comment" | "pull_request_review_comment.created" | "pull_request_review_comment.deleted" | "pull_request_review_comment.edited" | "pull_request_review_thread" | "pull_request_review_thread.resolved" | "pull_request_review_thread.unresolved" | "push" | "registry_package" | "registry_package.published" | "registry_package.updated" | "release" | "release.created" | "release.deleted" | "release.edited" | "release.prereleased" | "release.published" | "release.released" | "release.unpublished" | "repository" | "repository.archived" | "repository.created" | "repository.deleted" | "repository.edited" | "repository.privatized" | "repository.publicized" | "repository.renamed" | "repository.transferred" | "repository.unarchived" | "repository_advisory" | "repository_advisory.published" | "repository_advisory.reported" | "repository_dispatch" | "repository_dispatch.sample.collected" | "repository_import" | "repository_ruleset" | "repository_ruleset.created" | "repository_ruleset.deleted" | "repository_ruleset.edited" | "repository_vulnerability_alert" | "repository_vulnerability_alert.create" | "repository_vulnerability_alert.dismiss" | "repository_vulnerability_alert.reopen" | "repository_vulnerability_alert.resolve" | "secret_scanning_alert" | "secret_scanning_alert.assigned" | "secret_scanning_alert.created" | "secret_scanning_alert.publicly_leaked" | "secret_scanning_alert.reopened" | "secret_scanning_alert.resolved" | "secret_scanning_alert.unassigned" | "secret_scanning_alert.validated" | "secret_scanning_alert_location" | "secret_scanning_alert_location.created" | "secret_scanning_scan" | "secret_scanning_scan.completed" | "security_advisory" | "security_advisory.published" | "security_advisory.updated" | "security_advisory.withdrawn" | "security_and_analysis" | "sponsorship" | "sponsorship.cancelled" | "sponsorship.created" | "sponsorship.edited" | "sponsorship.pending_cancellation" | "sponsorship.pending_tier_change" | "sponsorship.tier_changed" | "star" | "star.created" | "star.deleted" | "status" | "sub_issues" | "sub_issues.parent_issue_added" | "sub_issues.parent_issue_removed" | "sub_issues.sub_issue_added" | "sub_issues.sub_issue_removed" | "team" | "team.added_to_repository" | "team.created" | "team.deleted" | "team.edited" | "team.removed_from_repository" | "team_add" | "watch" | "watch.started" | "workflow_dispatch" | "workflow_job" | "workflow_job.completed" | "workflow_job.in_progress" | "workflow_job.queued" | "workflow_job.waiting" | "workflow_run" | "workflow_run.completed" | "workflow_run.in_progress" | "workflow_run.requested")[] | undefined;
|
|
125
125
|
skipBotEvents?: boolean | undefined;
|
|
126
|
+
with: {
|
|
127
|
+
[x: string]: unknown;
|
|
128
|
+
};
|
|
126
129
|
} | null;
|
|
127
130
|
};
|
|
128
131
|
} | null;
|
|
129
|
-
errors:
|
|
132
|
+
errors: unknown[] | Value.ValueErrorIterator | null;
|
|
130
133
|
rawData: string;
|
|
131
134
|
}>;
|
|
132
135
|
private _createImportState;
|
|
@@ -183,4 +186,4 @@ declare class ConfigurationHandler {
|
|
|
183
186
|
private _decodeManifest;
|
|
184
187
|
}
|
|
185
188
|
|
|
186
|
-
export { CONFIG_DEV_FULL_PATH, CONFIG_ORG_REPO, CONFIG_PROD_FULL_PATH, ConfigurationHandler, type ConfigurationRefOptions, type LoggerInterface, isGithubPlugin };
|
|
189
|
+
export { CONFIG_DEV_FULL_PATH, CONFIG_ORG_REPO, CONFIG_PROD_FULL_PATH, ConfigurationHandler, type ConfigurationRefOptions, type LoggerInterface, configSchema, isGithubPlugin };
|
package/dist/configuration.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { Value } from '@sinclair/typebox/value';
|
|
2
|
-
import
|
|
2
|
+
import { YAMLException } from 'js-yaml';
|
|
3
3
|
import * as _sinclair_typebox from '@sinclair/typebox';
|
|
4
|
-
import {
|
|
4
|
+
import { TLiteral, StaticDecode } from '@sinclair/typebox';
|
|
5
5
|
import { C as Context } from './context-zLHgu52i.js';
|
|
6
6
|
import { Manifest } from './manifest.js';
|
|
7
7
|
import '@octokit/webhooks';
|
|
@@ -21,7 +21,7 @@ type GithubPlugin = {
|
|
|
21
21
|
ref?: string;
|
|
22
22
|
};
|
|
23
23
|
declare const pluginSettingsSchema: _sinclair_typebox.TUnion<[_sinclair_typebox.TNull, _sinclair_typebox.TObject<{
|
|
24
|
-
with: _sinclair_typebox.
|
|
24
|
+
with: _sinclair_typebox.TRecord<_sinclair_typebox.TString, _sinclair_typebox.TUnknown>;
|
|
25
25
|
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<"issue_dependencies">, TLiteral<"issue_dependencies.blocked_by_added">, TLiteral<"issue_dependencies.blocked_by_removed">, TLiteral<"issue_dependencies.blocking_added">, TLiteral<"issue_dependencies.blocking_removed">, 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.assigned">, 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.unassigned">, 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">]>>>;
|
|
26
26
|
skipBotEvents: _sinclair_typebox.TOptional<_sinclair_typebox.TBoolean>;
|
|
27
27
|
}>]>;
|
|
@@ -29,7 +29,7 @@ type PluginSettings = StaticDecode<typeof pluginSettingsSchema>;
|
|
|
29
29
|
declare const configSchema: _sinclair_typebox.TObject<{
|
|
30
30
|
imports: _sinclair_typebox.TOptional<_sinclair_typebox.TArray<_sinclair_typebox.TString>>;
|
|
31
31
|
plugins: _sinclair_typebox.TRecord<_sinclair_typebox.TString, _sinclair_typebox.TUnion<[_sinclair_typebox.TNull, _sinclair_typebox.TObject<{
|
|
32
|
-
with: _sinclair_typebox.
|
|
32
|
+
with: _sinclair_typebox.TRecord<_sinclair_typebox.TString, _sinclair_typebox.TUnknown>;
|
|
33
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<"issue_dependencies">, TLiteral<"issue_dependencies.blocked_by_added">, TLiteral<"issue_dependencies.blocked_by_removed">, TLiteral<"issue_dependencies.blocking_added">, TLiteral<"issue_dependencies.blocking_removed">, 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.assigned">, 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.unassigned">, 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">]>>>;
|
|
34
34
|
skipBotEvents: _sinclair_typebox.TOptional<_sinclair_typebox.TBoolean>;
|
|
35
35
|
}>]>>;
|
|
@@ -42,10 +42,12 @@ declare const CONFIG_ORG_REPO = ".ubiquity-os";
|
|
|
42
42
|
type Location = {
|
|
43
43
|
owner: string;
|
|
44
44
|
repo: string;
|
|
45
|
+
environment?: string;
|
|
45
46
|
};
|
|
46
47
|
type ConfigurationRefOptions = {
|
|
47
48
|
orgRef?: string;
|
|
48
49
|
repoRef?: string;
|
|
50
|
+
environment?: string;
|
|
49
51
|
};
|
|
50
52
|
type OctokitFactory = (location: Location) => Promise<Context["octokit"] | null>;
|
|
51
53
|
interface LoggerInterface {
|
|
@@ -89,11 +91,11 @@ declare class ConfigurationHandler {
|
|
|
89
91
|
imports?: string[] | undefined;
|
|
90
92
|
plugins: {
|
|
91
93
|
[x: string]: {
|
|
92
|
-
with?: {
|
|
93
|
-
[x: string]: unknown;
|
|
94
|
-
} | undefined;
|
|
95
94
|
runsOn?: ("branch_protection_configuration" | "branch_protection_configuration.disabled" | "branch_protection_configuration.enabled" | "branch_protection_rule" | "branch_protection_rule.created" | "branch_protection_rule.deleted" | "branch_protection_rule.edited" | "check_run" | "check_run.completed" | "check_run.created" | "check_run.requested_action" | "check_run.rerequested" | "check_suite" | "check_suite.completed" | "check_suite.requested" | "check_suite.rerequested" | "code_scanning_alert" | "code_scanning_alert.appeared_in_branch" | "code_scanning_alert.closed_by_user" | "code_scanning_alert.created" | "code_scanning_alert.fixed" | "code_scanning_alert.reopened" | "code_scanning_alert.reopened_by_user" | "commit_comment" | "commit_comment.created" | "create" | "custom_property" | "custom_property.created" | "custom_property.deleted" | "custom_property.promote_to_enterprise" | "custom_property.updated" | "custom_property_values" | "custom_property_values.updated" | "delete" | "dependabot_alert" | "dependabot_alert.auto_dismissed" | "dependabot_alert.auto_reopened" | "dependabot_alert.created" | "dependabot_alert.dismissed" | "dependabot_alert.fixed" | "dependabot_alert.reintroduced" | "dependabot_alert.reopened" | "deploy_key" | "deploy_key.created" | "deploy_key.deleted" | "deployment" | "deployment.created" | "deployment_protection_rule" | "deployment_protection_rule.requested" | "deployment_review" | "deployment_review.approved" | "deployment_review.rejected" | "deployment_review.requested" | "deployment_status" | "deployment_status.created" | "discussion" | "discussion.answered" | "discussion.category_changed" | "discussion.closed" | "discussion.created" | "discussion.deleted" | "discussion.edited" | "discussion.labeled" | "discussion.locked" | "discussion.pinned" | "discussion.reopened" | "discussion.transferred" | "discussion.unanswered" | "discussion.unlabeled" | "discussion.unlocked" | "discussion.unpinned" | "discussion_comment" | "discussion_comment.created" | "discussion_comment.deleted" | "discussion_comment.edited" | "fork" | "github_app_authorization" | "github_app_authorization.revoked" | "gollum" | "installation" | "installation.created" | "installation.deleted" | "installation.new_permissions_accepted" | "installation.suspend" | "installation.unsuspend" | "installation_repositories" | "installation_repositories.added" | "installation_repositories.removed" | "installation_target" | "installation_target.renamed" | "issue_comment" | "issue_comment.created" | "issue_comment.deleted" | "issue_comment.edited" | "issue_dependencies" | "issue_dependencies.blocked_by_added" | "issue_dependencies.blocked_by_removed" | "issue_dependencies.blocking_added" | "issue_dependencies.blocking_removed" | "issues" | "issues.assigned" | "issues.closed" | "issues.deleted" | "issues.demilestoned" | "issues.edited" | "issues.labeled" | "issues.locked" | "issues.milestoned" | "issues.opened" | "issues.pinned" | "issues.reopened" | "issues.transferred" | "issues.typed" | "issues.unassigned" | "issues.unlabeled" | "issues.unlocked" | "issues.unpinned" | "issues.untyped" | "label" | "label.created" | "label.deleted" | "label.edited" | "marketplace_purchase" | "marketplace_purchase.cancelled" | "marketplace_purchase.changed" | "marketplace_purchase.pending_change" | "marketplace_purchase.pending_change_cancelled" | "marketplace_purchase.purchased" | "member" | "member.added" | "member.edited" | "member.removed" | "membership" | "membership.added" | "membership.removed" | "merge_group" | "merge_group.checks_requested" | "merge_group.destroyed" | "meta" | "meta.deleted" | "milestone" | "milestone.closed" | "milestone.created" | "milestone.deleted" | "milestone.edited" | "milestone.opened" | "org_block" | "org_block.blocked" | "org_block.unblocked" | "organization" | "organization.deleted" | "organization.member_added" | "organization.member_invited" | "organization.member_removed" | "organization.renamed" | "package" | "package.published" | "package.updated" | "page_build" | "personal_access_token_request" | "personal_access_token_request.approved" | "personal_access_token_request.cancelled" | "personal_access_token_request.created" | "personal_access_token_request.denied" | "ping" | "project" | "project.closed" | "project.created" | "project.deleted" | "project.edited" | "project.reopened" | "project_card" | "project_card.converted" | "project_card.created" | "project_card.deleted" | "project_card.edited" | "project_card.moved" | "project_column" | "project_column.created" | "project_column.deleted" | "project_column.edited" | "project_column.moved" | "projects_v2" | "projects_v2.closed" | "projects_v2.created" | "projects_v2.deleted" | "projects_v2.edited" | "projects_v2.reopened" | "projects_v2_item" | "projects_v2_item.archived" | "projects_v2_item.converted" | "projects_v2_item.created" | "projects_v2_item.deleted" | "projects_v2_item.edited" | "projects_v2_item.reordered" | "projects_v2_item.restored" | "projects_v2_status_update" | "projects_v2_status_update.created" | "projects_v2_status_update.deleted" | "projects_v2_status_update.edited" | "public" | "pull_request" | "pull_request.assigned" | "pull_request.auto_merge_disabled" | "pull_request.auto_merge_enabled" | "pull_request.closed" | "pull_request.converted_to_draft" | "pull_request.demilestoned" | "pull_request.dequeued" | "pull_request.edited" | "pull_request.enqueued" | "pull_request.labeled" | "pull_request.locked" | "pull_request.milestoned" | "pull_request.opened" | "pull_request.ready_for_review" | "pull_request.reopened" | "pull_request.review_request_removed" | "pull_request.review_requested" | "pull_request.synchronize" | "pull_request.unassigned" | "pull_request.unlabeled" | "pull_request.unlocked" | "pull_request_review" | "pull_request_review.dismissed" | "pull_request_review.edited" | "pull_request_review.submitted" | "pull_request_review_comment" | "pull_request_review_comment.created" | "pull_request_review_comment.deleted" | "pull_request_review_comment.edited" | "pull_request_review_thread" | "pull_request_review_thread.resolved" | "pull_request_review_thread.unresolved" | "push" | "registry_package" | "registry_package.published" | "registry_package.updated" | "release" | "release.created" | "release.deleted" | "release.edited" | "release.prereleased" | "release.published" | "release.released" | "release.unpublished" | "repository" | "repository.archived" | "repository.created" | "repository.deleted" | "repository.edited" | "repository.privatized" | "repository.publicized" | "repository.renamed" | "repository.transferred" | "repository.unarchived" | "repository_advisory" | "repository_advisory.published" | "repository_advisory.reported" | "repository_dispatch" | "repository_dispatch.sample.collected" | "repository_import" | "repository_ruleset" | "repository_ruleset.created" | "repository_ruleset.deleted" | "repository_ruleset.edited" | "repository_vulnerability_alert" | "repository_vulnerability_alert.create" | "repository_vulnerability_alert.dismiss" | "repository_vulnerability_alert.reopen" | "repository_vulnerability_alert.resolve" | "secret_scanning_alert" | "secret_scanning_alert.assigned" | "secret_scanning_alert.created" | "secret_scanning_alert.publicly_leaked" | "secret_scanning_alert.reopened" | "secret_scanning_alert.resolved" | "secret_scanning_alert.unassigned" | "secret_scanning_alert.validated" | "secret_scanning_alert_location" | "secret_scanning_alert_location.created" | "secret_scanning_scan" | "secret_scanning_scan.completed" | "security_advisory" | "security_advisory.published" | "security_advisory.updated" | "security_advisory.withdrawn" | "security_and_analysis" | "sponsorship" | "sponsorship.cancelled" | "sponsorship.created" | "sponsorship.edited" | "sponsorship.pending_cancellation" | "sponsorship.pending_tier_change" | "sponsorship.tier_changed" | "star" | "star.created" | "star.deleted" | "status" | "sub_issues" | "sub_issues.parent_issue_added" | "sub_issues.parent_issue_removed" | "sub_issues.sub_issue_added" | "sub_issues.sub_issue_removed" | "team" | "team.added_to_repository" | "team.created" | "team.deleted" | "team.edited" | "team.removed_from_repository" | "team_add" | "watch" | "watch.started" | "workflow_dispatch" | "workflow_job" | "workflow_job.completed" | "workflow_job.in_progress" | "workflow_job.queued" | "workflow_job.waiting" | "workflow_run" | "workflow_run.completed" | "workflow_run.in_progress" | "workflow_run.requested")[] | undefined;
|
|
96
95
|
skipBotEvents?: boolean | undefined;
|
|
96
|
+
with: {
|
|
97
|
+
[x: string]: unknown;
|
|
98
|
+
};
|
|
97
99
|
} | null;
|
|
98
100
|
};
|
|
99
101
|
}>;
|
|
@@ -109,6 +111,7 @@ declare class ConfigurationHandler {
|
|
|
109
111
|
*/
|
|
110
112
|
getConfigurationFromRepo(owner: string, repository: string, options?: {
|
|
111
113
|
ref?: string;
|
|
114
|
+
environment?: string;
|
|
112
115
|
}): Promise<{
|
|
113
116
|
config: null;
|
|
114
117
|
errors: null;
|
|
@@ -118,15 +121,15 @@ declare class ConfigurationHandler {
|
|
|
118
121
|
imports?: string[] | undefined;
|
|
119
122
|
plugins: {
|
|
120
123
|
[x: string]: {
|
|
121
|
-
with?: {
|
|
122
|
-
[x: string]: unknown;
|
|
123
|
-
} | undefined;
|
|
124
124
|
runsOn?: ("branch_protection_configuration" | "branch_protection_configuration.disabled" | "branch_protection_configuration.enabled" | "branch_protection_rule" | "branch_protection_rule.created" | "branch_protection_rule.deleted" | "branch_protection_rule.edited" | "check_run" | "check_run.completed" | "check_run.created" | "check_run.requested_action" | "check_run.rerequested" | "check_suite" | "check_suite.completed" | "check_suite.requested" | "check_suite.rerequested" | "code_scanning_alert" | "code_scanning_alert.appeared_in_branch" | "code_scanning_alert.closed_by_user" | "code_scanning_alert.created" | "code_scanning_alert.fixed" | "code_scanning_alert.reopened" | "code_scanning_alert.reopened_by_user" | "commit_comment" | "commit_comment.created" | "create" | "custom_property" | "custom_property.created" | "custom_property.deleted" | "custom_property.promote_to_enterprise" | "custom_property.updated" | "custom_property_values" | "custom_property_values.updated" | "delete" | "dependabot_alert" | "dependabot_alert.auto_dismissed" | "dependabot_alert.auto_reopened" | "dependabot_alert.created" | "dependabot_alert.dismissed" | "dependabot_alert.fixed" | "dependabot_alert.reintroduced" | "dependabot_alert.reopened" | "deploy_key" | "deploy_key.created" | "deploy_key.deleted" | "deployment" | "deployment.created" | "deployment_protection_rule" | "deployment_protection_rule.requested" | "deployment_review" | "deployment_review.approved" | "deployment_review.rejected" | "deployment_review.requested" | "deployment_status" | "deployment_status.created" | "discussion" | "discussion.answered" | "discussion.category_changed" | "discussion.closed" | "discussion.created" | "discussion.deleted" | "discussion.edited" | "discussion.labeled" | "discussion.locked" | "discussion.pinned" | "discussion.reopened" | "discussion.transferred" | "discussion.unanswered" | "discussion.unlabeled" | "discussion.unlocked" | "discussion.unpinned" | "discussion_comment" | "discussion_comment.created" | "discussion_comment.deleted" | "discussion_comment.edited" | "fork" | "github_app_authorization" | "github_app_authorization.revoked" | "gollum" | "installation" | "installation.created" | "installation.deleted" | "installation.new_permissions_accepted" | "installation.suspend" | "installation.unsuspend" | "installation_repositories" | "installation_repositories.added" | "installation_repositories.removed" | "installation_target" | "installation_target.renamed" | "issue_comment" | "issue_comment.created" | "issue_comment.deleted" | "issue_comment.edited" | "issue_dependencies" | "issue_dependencies.blocked_by_added" | "issue_dependencies.blocked_by_removed" | "issue_dependencies.blocking_added" | "issue_dependencies.blocking_removed" | "issues" | "issues.assigned" | "issues.closed" | "issues.deleted" | "issues.demilestoned" | "issues.edited" | "issues.labeled" | "issues.locked" | "issues.milestoned" | "issues.opened" | "issues.pinned" | "issues.reopened" | "issues.transferred" | "issues.typed" | "issues.unassigned" | "issues.unlabeled" | "issues.unlocked" | "issues.unpinned" | "issues.untyped" | "label" | "label.created" | "label.deleted" | "label.edited" | "marketplace_purchase" | "marketplace_purchase.cancelled" | "marketplace_purchase.changed" | "marketplace_purchase.pending_change" | "marketplace_purchase.pending_change_cancelled" | "marketplace_purchase.purchased" | "member" | "member.added" | "member.edited" | "member.removed" | "membership" | "membership.added" | "membership.removed" | "merge_group" | "merge_group.checks_requested" | "merge_group.destroyed" | "meta" | "meta.deleted" | "milestone" | "milestone.closed" | "milestone.created" | "milestone.deleted" | "milestone.edited" | "milestone.opened" | "org_block" | "org_block.blocked" | "org_block.unblocked" | "organization" | "organization.deleted" | "organization.member_added" | "organization.member_invited" | "organization.member_removed" | "organization.renamed" | "package" | "package.published" | "package.updated" | "page_build" | "personal_access_token_request" | "personal_access_token_request.approved" | "personal_access_token_request.cancelled" | "personal_access_token_request.created" | "personal_access_token_request.denied" | "ping" | "project" | "project.closed" | "project.created" | "project.deleted" | "project.edited" | "project.reopened" | "project_card" | "project_card.converted" | "project_card.created" | "project_card.deleted" | "project_card.edited" | "project_card.moved" | "project_column" | "project_column.created" | "project_column.deleted" | "project_column.edited" | "project_column.moved" | "projects_v2" | "projects_v2.closed" | "projects_v2.created" | "projects_v2.deleted" | "projects_v2.edited" | "projects_v2.reopened" | "projects_v2_item" | "projects_v2_item.archived" | "projects_v2_item.converted" | "projects_v2_item.created" | "projects_v2_item.deleted" | "projects_v2_item.edited" | "projects_v2_item.reordered" | "projects_v2_item.restored" | "projects_v2_status_update" | "projects_v2_status_update.created" | "projects_v2_status_update.deleted" | "projects_v2_status_update.edited" | "public" | "pull_request" | "pull_request.assigned" | "pull_request.auto_merge_disabled" | "pull_request.auto_merge_enabled" | "pull_request.closed" | "pull_request.converted_to_draft" | "pull_request.demilestoned" | "pull_request.dequeued" | "pull_request.edited" | "pull_request.enqueued" | "pull_request.labeled" | "pull_request.locked" | "pull_request.milestoned" | "pull_request.opened" | "pull_request.ready_for_review" | "pull_request.reopened" | "pull_request.review_request_removed" | "pull_request.review_requested" | "pull_request.synchronize" | "pull_request.unassigned" | "pull_request.unlabeled" | "pull_request.unlocked" | "pull_request_review" | "pull_request_review.dismissed" | "pull_request_review.edited" | "pull_request_review.submitted" | "pull_request_review_comment" | "pull_request_review_comment.created" | "pull_request_review_comment.deleted" | "pull_request_review_comment.edited" | "pull_request_review_thread" | "pull_request_review_thread.resolved" | "pull_request_review_thread.unresolved" | "push" | "registry_package" | "registry_package.published" | "registry_package.updated" | "release" | "release.created" | "release.deleted" | "release.edited" | "release.prereleased" | "release.published" | "release.released" | "release.unpublished" | "repository" | "repository.archived" | "repository.created" | "repository.deleted" | "repository.edited" | "repository.privatized" | "repository.publicized" | "repository.renamed" | "repository.transferred" | "repository.unarchived" | "repository_advisory" | "repository_advisory.published" | "repository_advisory.reported" | "repository_dispatch" | "repository_dispatch.sample.collected" | "repository_import" | "repository_ruleset" | "repository_ruleset.created" | "repository_ruleset.deleted" | "repository_ruleset.edited" | "repository_vulnerability_alert" | "repository_vulnerability_alert.create" | "repository_vulnerability_alert.dismiss" | "repository_vulnerability_alert.reopen" | "repository_vulnerability_alert.resolve" | "secret_scanning_alert" | "secret_scanning_alert.assigned" | "secret_scanning_alert.created" | "secret_scanning_alert.publicly_leaked" | "secret_scanning_alert.reopened" | "secret_scanning_alert.resolved" | "secret_scanning_alert.unassigned" | "secret_scanning_alert.validated" | "secret_scanning_alert_location" | "secret_scanning_alert_location.created" | "secret_scanning_scan" | "secret_scanning_scan.completed" | "security_advisory" | "security_advisory.published" | "security_advisory.updated" | "security_advisory.withdrawn" | "security_and_analysis" | "sponsorship" | "sponsorship.cancelled" | "sponsorship.created" | "sponsorship.edited" | "sponsorship.pending_cancellation" | "sponsorship.pending_tier_change" | "sponsorship.tier_changed" | "star" | "star.created" | "star.deleted" | "status" | "sub_issues" | "sub_issues.parent_issue_added" | "sub_issues.parent_issue_removed" | "sub_issues.sub_issue_added" | "sub_issues.sub_issue_removed" | "team" | "team.added_to_repository" | "team.created" | "team.deleted" | "team.edited" | "team.removed_from_repository" | "team_add" | "watch" | "watch.started" | "workflow_dispatch" | "workflow_job" | "workflow_job.completed" | "workflow_job.in_progress" | "workflow_job.queued" | "workflow_job.waiting" | "workflow_run" | "workflow_run.completed" | "workflow_run.in_progress" | "workflow_run.requested")[] | undefined;
|
|
125
125
|
skipBotEvents?: boolean | undefined;
|
|
126
|
+
with: {
|
|
127
|
+
[x: string]: unknown;
|
|
128
|
+
};
|
|
126
129
|
} | null;
|
|
127
130
|
};
|
|
128
131
|
} | null;
|
|
129
|
-
errors:
|
|
132
|
+
errors: unknown[] | Value.ValueErrorIterator | null;
|
|
130
133
|
rawData: string;
|
|
131
134
|
}>;
|
|
132
135
|
private _createImportState;
|
|
@@ -183,4 +186,4 @@ declare class ConfigurationHandler {
|
|
|
183
186
|
private _decodeManifest;
|
|
184
187
|
}
|
|
185
188
|
|
|
186
|
-
export { CONFIG_DEV_FULL_PATH, CONFIG_ORG_REPO, CONFIG_PROD_FULL_PATH, ConfigurationHandler, type ConfigurationRefOptions, type LoggerInterface, isGithubPlugin };
|
|
189
|
+
export { CONFIG_DEV_FULL_PATH, CONFIG_ORG_REPO, CONFIG_PROD_FULL_PATH, ConfigurationHandler, type ConfigurationRefOptions, type LoggerInterface, configSchema, isGithubPlugin };
|
package/dist/configuration.js
CHANGED
|
@@ -34,6 +34,7 @@ __export(configuration_exports, {
|
|
|
34
34
|
CONFIG_ORG_REPO: () => CONFIG_ORG_REPO,
|
|
35
35
|
CONFIG_PROD_FULL_PATH: () => CONFIG_PROD_FULL_PATH,
|
|
36
36
|
ConfigurationHandler: () => ConfigurationHandler,
|
|
37
|
+
configSchema: () => configSchema,
|
|
37
38
|
isGithubPlugin: () => isGithubPlugin
|
|
38
39
|
});
|
|
39
40
|
module.exports = __toCommonJS(configuration_exports);
|
|
@@ -72,7 +73,7 @@ var pluginSettingsSchema = import_typebox.Type.Union(
|
|
|
72
73
|
import_typebox.Type.Null(),
|
|
73
74
|
import_typebox.Type.Object(
|
|
74
75
|
{
|
|
75
|
-
with: import_typebox.Type.
|
|
76
|
+
with: import_typebox.Type.Record(import_typebox.Type.String(), import_typebox.Type.Unknown(), { default: {} }),
|
|
76
77
|
runsOn: import_typebox.Type.Optional(runsOnSchema),
|
|
77
78
|
skipBotEvents: import_typebox.Type.Optional(import_typebox.Type.Boolean())
|
|
78
79
|
},
|
|
@@ -160,7 +161,8 @@ function getConfigPathCandidatesForEnvironment(environment) {
|
|
|
160
161
|
return [`.github/.ubiquity-os.config.${suffix}.yml`, CONFIG_PROD_FULL_PATH];
|
|
161
162
|
}
|
|
162
163
|
function normalizeImportKey(location) {
|
|
163
|
-
|
|
164
|
+
const env = normalizeEnvironmentName(location.environment ?? "") || "default";
|
|
165
|
+
return `${location.owner}`.trim().toLowerCase() + "/" + `${location.repo}`.trim().toLowerCase() + "@" + env;
|
|
164
166
|
}
|
|
165
167
|
function isHttpUrl(value) {
|
|
166
168
|
const trimmed = value.trim();
|
|
@@ -186,14 +188,20 @@ function resolveManifestUrl(pluginUrl) {
|
|
|
186
188
|
return null;
|
|
187
189
|
}
|
|
188
190
|
}
|
|
189
|
-
function parseImportSpec(value) {
|
|
191
|
+
function parseImportSpec(value, defaultEnvironment) {
|
|
190
192
|
const trimmed = value.trim();
|
|
191
193
|
if (!trimmed) return null;
|
|
192
|
-
const
|
|
194
|
+
const [repoSpec, envSpecRaw] = trimmed.split("@");
|
|
195
|
+
const parts = repoSpec.split("/");
|
|
193
196
|
if (parts.length !== 2) return null;
|
|
194
197
|
const [owner, repo] = parts;
|
|
195
198
|
if (!owner || !repo) return null;
|
|
196
|
-
|
|
199
|
+
const envSpec = envSpecRaw?.trim();
|
|
200
|
+
if (envSpec && !VALID_CONFIG_SUFFIX.test(envSpec)) {
|
|
201
|
+
return null;
|
|
202
|
+
}
|
|
203
|
+
const inheritedEnvironment = defaultEnvironment?.trim();
|
|
204
|
+
return { owner, repo, environment: envSpec || inheritedEnvironment || void 0 };
|
|
197
205
|
}
|
|
198
206
|
function readImports(logger, value, source) {
|
|
199
207
|
if (!value) return [];
|
|
@@ -208,7 +216,7 @@ function readImports(logger, value, source) {
|
|
|
208
216
|
logger.warn("Ignoring invalid import entry; expected string.", { source, entry });
|
|
209
217
|
continue;
|
|
210
218
|
}
|
|
211
|
-
const parsed = parseImportSpec(entry);
|
|
219
|
+
const parsed = parseImportSpec(entry, source.environment);
|
|
212
220
|
if (!parsed) {
|
|
213
221
|
logger.warn("Ignoring invalid import entry; expected owner/repo.", { source, entry });
|
|
214
222
|
continue;
|
|
@@ -226,6 +234,13 @@ function stripImports(config) {
|
|
|
226
234
|
delete rest.imports;
|
|
227
235
|
return rest;
|
|
228
236
|
}
|
|
237
|
+
function unwrapTypeBoxError(error) {
|
|
238
|
+
if (error && typeof error === "object" && "error" in error) {
|
|
239
|
+
const inner = error.error;
|
|
240
|
+
return inner ?? error;
|
|
241
|
+
}
|
|
242
|
+
return error;
|
|
243
|
+
}
|
|
229
244
|
function mergeImportedConfigs(imported, base) {
|
|
230
245
|
if (!imported.length) {
|
|
231
246
|
return base;
|
|
@@ -372,7 +387,7 @@ var ConfigurationHandler = class {
|
|
|
372
387
|
* @param options - Optional ref (branch, tag, or commit SHA) for the configuration lookup
|
|
373
388
|
*/
|
|
374
389
|
async getConfigurationFromRepo(owner, repository, options) {
|
|
375
|
-
const location = { owner, repo: repository };
|
|
390
|
+
const location = { owner, repo: repository, environment: options?.environment };
|
|
376
391
|
const state = this._createImportState();
|
|
377
392
|
const octokit = await this._getOctokitForLocation(location, state);
|
|
378
393
|
if (!octokit) {
|
|
@@ -430,7 +445,8 @@ var ConfigurationHandler = class {
|
|
|
430
445
|
repository: location.repo,
|
|
431
446
|
owner: location.owner,
|
|
432
447
|
octokit,
|
|
433
|
-
ref
|
|
448
|
+
ref,
|
|
449
|
+
environment: location.environment ?? this._environment
|
|
434
450
|
});
|
|
435
451
|
if (!rawData) {
|
|
436
452
|
this._logger.warn("No raw configuration data", { owner: location.owner, repository: location.repo });
|
|
@@ -459,7 +475,8 @@ var ConfigurationHandler = class {
|
|
|
459
475
|
return { config: stripImports(decodedConfig), errors: errors.First() ? errors : null };
|
|
460
476
|
} catch (error) {
|
|
461
477
|
this._logger.warn("Error decoding configuration; Will ignore.", { err: error, owner: location.owner, repository: location.repo });
|
|
462
|
-
|
|
478
|
+
const decodedError = unwrapTypeBoxError(error);
|
|
479
|
+
return { config: null, errors: [decodedError] };
|
|
463
480
|
}
|
|
464
481
|
}
|
|
465
482
|
async _resolveImportedConfiguration(location, state, depth) {
|
|
@@ -510,13 +527,14 @@ var ConfigurationHandler = class {
|
|
|
510
527
|
repository,
|
|
511
528
|
owner,
|
|
512
529
|
octokit,
|
|
513
|
-
ref
|
|
530
|
+
ref,
|
|
531
|
+
environment
|
|
514
532
|
}) {
|
|
515
533
|
if (!repository || !owner) {
|
|
516
534
|
this._logger.warn("Repo or owner is not defined, cannot download the requested file");
|
|
517
535
|
return null;
|
|
518
536
|
}
|
|
519
|
-
const pathList = getConfigPathCandidatesForEnvironment(this._environment);
|
|
537
|
+
const pathList = getConfigPathCandidatesForEnvironment(environment ?? this._environment);
|
|
520
538
|
for (const filePath of pathList) {
|
|
521
539
|
const content = await this._tryDownloadPath({ repository, owner, octokit, filePath, ref });
|
|
522
540
|
if (content !== null) return content;
|
|
@@ -704,5 +722,6 @@ var ConfigurationHandler = class {
|
|
|
704
722
|
CONFIG_ORG_REPO,
|
|
705
723
|
CONFIG_PROD_FULL_PATH,
|
|
706
724
|
ConfigurationHandler,
|
|
725
|
+
configSchema,
|
|
707
726
|
isGithubPlugin
|
|
708
727
|
});
|
package/dist/configuration.mjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
// src/configuration.ts
|
|
2
|
-
import {
|
|
2
|
+
import { Value } from "@sinclair/typebox/value";
|
|
3
3
|
import YAML from "js-yaml";
|
|
4
4
|
import { Buffer } from "node:buffer";
|
|
5
5
|
|
|
@@ -34,7 +34,7 @@ var pluginSettingsSchema = T.Union(
|
|
|
34
34
|
T.Null(),
|
|
35
35
|
T.Object(
|
|
36
36
|
{
|
|
37
|
-
with: T.
|
|
37
|
+
with: T.Record(T.String(), T.Unknown(), { default: {} }),
|
|
38
38
|
runsOn: T.Optional(runsOnSchema),
|
|
39
39
|
skipBotEvents: T.Optional(T.Boolean())
|
|
40
40
|
},
|
|
@@ -122,7 +122,8 @@ function getConfigPathCandidatesForEnvironment(environment) {
|
|
|
122
122
|
return [`.github/.ubiquity-os.config.${suffix}.yml`, CONFIG_PROD_FULL_PATH];
|
|
123
123
|
}
|
|
124
124
|
function normalizeImportKey(location) {
|
|
125
|
-
|
|
125
|
+
const env = normalizeEnvironmentName(location.environment ?? "") || "default";
|
|
126
|
+
return `${location.owner}`.trim().toLowerCase() + "/" + `${location.repo}`.trim().toLowerCase() + "@" + env;
|
|
126
127
|
}
|
|
127
128
|
function isHttpUrl(value) {
|
|
128
129
|
const trimmed = value.trim();
|
|
@@ -148,14 +149,20 @@ function resolveManifestUrl(pluginUrl) {
|
|
|
148
149
|
return null;
|
|
149
150
|
}
|
|
150
151
|
}
|
|
151
|
-
function parseImportSpec(value) {
|
|
152
|
+
function parseImportSpec(value, defaultEnvironment) {
|
|
152
153
|
const trimmed = value.trim();
|
|
153
154
|
if (!trimmed) return null;
|
|
154
|
-
const
|
|
155
|
+
const [repoSpec, envSpecRaw] = trimmed.split("@");
|
|
156
|
+
const parts = repoSpec.split("/");
|
|
155
157
|
if (parts.length !== 2) return null;
|
|
156
158
|
const [owner, repo] = parts;
|
|
157
159
|
if (!owner || !repo) return null;
|
|
158
|
-
|
|
160
|
+
const envSpec = envSpecRaw?.trim();
|
|
161
|
+
if (envSpec && !VALID_CONFIG_SUFFIX.test(envSpec)) {
|
|
162
|
+
return null;
|
|
163
|
+
}
|
|
164
|
+
const inheritedEnvironment = defaultEnvironment?.trim();
|
|
165
|
+
return { owner, repo, environment: envSpec || inheritedEnvironment || void 0 };
|
|
159
166
|
}
|
|
160
167
|
function readImports(logger, value, source) {
|
|
161
168
|
if (!value) return [];
|
|
@@ -170,7 +177,7 @@ function readImports(logger, value, source) {
|
|
|
170
177
|
logger.warn("Ignoring invalid import entry; expected string.", { source, entry });
|
|
171
178
|
continue;
|
|
172
179
|
}
|
|
173
|
-
const parsed = parseImportSpec(entry);
|
|
180
|
+
const parsed = parseImportSpec(entry, source.environment);
|
|
174
181
|
if (!parsed) {
|
|
175
182
|
logger.warn("Ignoring invalid import entry; expected owner/repo.", { source, entry });
|
|
176
183
|
continue;
|
|
@@ -188,6 +195,13 @@ function stripImports(config) {
|
|
|
188
195
|
delete rest.imports;
|
|
189
196
|
return rest;
|
|
190
197
|
}
|
|
198
|
+
function unwrapTypeBoxError(error) {
|
|
199
|
+
if (error && typeof error === "object" && "error" in error) {
|
|
200
|
+
const inner = error.error;
|
|
201
|
+
return inner ?? error;
|
|
202
|
+
}
|
|
203
|
+
return error;
|
|
204
|
+
}
|
|
191
205
|
function mergeImportedConfigs(imported, base) {
|
|
192
206
|
if (!imported.length) {
|
|
193
207
|
return base;
|
|
@@ -334,7 +348,7 @@ var ConfigurationHandler = class {
|
|
|
334
348
|
* @param options - Optional ref (branch, tag, or commit SHA) for the configuration lookup
|
|
335
349
|
*/
|
|
336
350
|
async getConfigurationFromRepo(owner, repository, options) {
|
|
337
|
-
const location = { owner, repo: repository };
|
|
351
|
+
const location = { owner, repo: repository, environment: options?.environment };
|
|
338
352
|
const state = this._createImportState();
|
|
339
353
|
const octokit = await this._getOctokitForLocation(location, state);
|
|
340
354
|
if (!octokit) {
|
|
@@ -392,7 +406,8 @@ var ConfigurationHandler = class {
|
|
|
392
406
|
repository: location.repo,
|
|
393
407
|
owner: location.owner,
|
|
394
408
|
octokit,
|
|
395
|
-
ref
|
|
409
|
+
ref,
|
|
410
|
+
environment: location.environment ?? this._environment
|
|
396
411
|
});
|
|
397
412
|
if (!rawData) {
|
|
398
413
|
this._logger.warn("No raw configuration data", { owner: location.owner, repository: location.repo });
|
|
@@ -421,7 +436,8 @@ var ConfigurationHandler = class {
|
|
|
421
436
|
return { config: stripImports(decodedConfig), errors: errors.First() ? errors : null };
|
|
422
437
|
} catch (error) {
|
|
423
438
|
this._logger.warn("Error decoding configuration; Will ignore.", { err: error, owner: location.owner, repository: location.repo });
|
|
424
|
-
|
|
439
|
+
const decodedError = unwrapTypeBoxError(error);
|
|
440
|
+
return { config: null, errors: [decodedError] };
|
|
425
441
|
}
|
|
426
442
|
}
|
|
427
443
|
async _resolveImportedConfiguration(location, state, depth) {
|
|
@@ -472,13 +488,14 @@ var ConfigurationHandler = class {
|
|
|
472
488
|
repository,
|
|
473
489
|
owner,
|
|
474
490
|
octokit,
|
|
475
|
-
ref
|
|
491
|
+
ref,
|
|
492
|
+
environment
|
|
476
493
|
}) {
|
|
477
494
|
if (!repository || !owner) {
|
|
478
495
|
this._logger.warn("Repo or owner is not defined, cannot download the requested file");
|
|
479
496
|
return null;
|
|
480
497
|
}
|
|
481
|
-
const pathList = getConfigPathCandidatesForEnvironment(this._environment);
|
|
498
|
+
const pathList = getConfigPathCandidatesForEnvironment(environment ?? this._environment);
|
|
482
499
|
for (const filePath of pathList) {
|
|
483
500
|
const content = await this._tryDownloadPath({ repository, owner, octokit, filePath, ref });
|
|
484
501
|
if (content !== null) return content;
|
|
@@ -665,5 +682,6 @@ export {
|
|
|
665
682
|
CONFIG_ORG_REPO,
|
|
666
683
|
CONFIG_PROD_FULL_PATH,
|
|
667
684
|
ConfigurationHandler,
|
|
685
|
+
configSchema,
|
|
668
686
|
isGithubPlugin
|
|
669
687
|
};
|
package/dist/index.js
CHANGED
|
@@ -957,6 +957,25 @@ function normalizeToken(value) {
|
|
|
957
957
|
function isGitHubToken(token) {
|
|
958
958
|
return token.trim().startsWith("gh");
|
|
959
959
|
}
|
|
960
|
+
function readKernelRefreshUrl(value) {
|
|
961
|
+
if (!value || typeof value !== "object") return EMPTY_STRING;
|
|
962
|
+
return normalizeToken(value.kernelRefreshUrl);
|
|
963
|
+
}
|
|
964
|
+
function getKernelRefreshUrl(input) {
|
|
965
|
+
const direct = readKernelRefreshUrl(input);
|
|
966
|
+
if (direct) return direct;
|
|
967
|
+
const fromConfig = readKernelRefreshUrl(input.config);
|
|
968
|
+
if (fromConfig) return fromConfig;
|
|
969
|
+
return readKernelRefreshUrl(input.settings);
|
|
970
|
+
}
|
|
971
|
+
function updateInputTokens(input, tokens) {
|
|
972
|
+
if ("authToken" in input) {
|
|
973
|
+
input.authToken = tokens.authToken;
|
|
974
|
+
}
|
|
975
|
+
if ("ubiquityKernelToken" in input) {
|
|
976
|
+
input.ubiquityKernelToken = tokens.kernelToken;
|
|
977
|
+
}
|
|
978
|
+
}
|
|
960
979
|
function getEnvTokenFromInput(input) {
|
|
961
980
|
if ("env" in input) {
|
|
962
981
|
const envValue = input.env;
|
|
@@ -990,11 +1009,27 @@ function getAiBaseUrl(options) {
|
|
|
990
1009
|
}
|
|
991
1010
|
async function callLlm(options, input) {
|
|
992
1011
|
const { baseUrl, model, stream: isStream, messages, aiAuthToken, ...rest } = options;
|
|
993
|
-
|
|
994
|
-
const
|
|
1012
|
+
ensureMessages(messages);
|
|
1013
|
+
const { token: resolvedAuthToken, isGitHub } = resolveAuthToken(input, aiAuthToken);
|
|
1014
|
+
let authToken = resolvedAuthToken;
|
|
1015
|
+
let kernelToken = "ubiquityKernelToken" in input ? input.ubiquityKernelToken : void 0;
|
|
995
1016
|
const payload = getPayload(input);
|
|
996
1017
|
const { owner, repo, installationId } = getRepoMetadata(payload);
|
|
997
|
-
|
|
1018
|
+
const kernelRefreshUrl = getKernelRefreshUrl(input);
|
|
1019
|
+
const hasExplicitAiAuth = Boolean(normalizeToken(aiAuthToken));
|
|
1020
|
+
if (isGitHub && kernelRefreshUrl && kernelToken && !hasExplicitAiAuth) {
|
|
1021
|
+
const refreshed = await refreshKernelTokens({
|
|
1022
|
+
url: kernelRefreshUrl,
|
|
1023
|
+
authToken,
|
|
1024
|
+
kernelToken,
|
|
1025
|
+
owner,
|
|
1026
|
+
repo,
|
|
1027
|
+
installationId
|
|
1028
|
+
});
|
|
1029
|
+
authToken = refreshed.authToken;
|
|
1030
|
+
kernelToken = refreshed.kernelToken;
|
|
1031
|
+
updateInputTokens(input, refreshed);
|
|
1032
|
+
}
|
|
998
1033
|
const url = buildAiUrl(options, baseUrl);
|
|
999
1034
|
const body = JSON.stringify({
|
|
1000
1035
|
...rest,
|
|
@@ -1037,6 +1072,44 @@ function ensureMessages(messages) {
|
|
|
1037
1072
|
function buildAiUrl(options, baseUrl) {
|
|
1038
1073
|
return `${getAiBaseUrl({ ...options, baseUrl })}/v1/chat/completions`;
|
|
1039
1074
|
}
|
|
1075
|
+
async function refreshKernelTokens(params) {
|
|
1076
|
+
const headers = buildHeaders(params.authToken, {
|
|
1077
|
+
owner: params.owner,
|
|
1078
|
+
repo: params.repo,
|
|
1079
|
+
installationId: params.installationId,
|
|
1080
|
+
ubiquityKernelToken: params.kernelToken
|
|
1081
|
+
});
|
|
1082
|
+
const response = await fetch(params.url, { method: "POST", headers });
|
|
1083
|
+
const text = await response.text().catch(() => EMPTY_STRING);
|
|
1084
|
+
if (!response.ok) {
|
|
1085
|
+
const error = new Error(`Kernel refresh error: ${response.status} - ${text}`);
|
|
1086
|
+
error.status = response.status;
|
|
1087
|
+
throw error;
|
|
1088
|
+
}
|
|
1089
|
+
let payload = {};
|
|
1090
|
+
if (text.trim()) {
|
|
1091
|
+
try {
|
|
1092
|
+
payload = JSON.parse(text);
|
|
1093
|
+
} catch (err) {
|
|
1094
|
+
const details = err instanceof Error ? ` (${err.message})` : "";
|
|
1095
|
+
const error = new Error(`Kernel refresh error: failed to parse JSON response${details}`);
|
|
1096
|
+
error.status = response.status;
|
|
1097
|
+
throw error;
|
|
1098
|
+
}
|
|
1099
|
+
}
|
|
1100
|
+
const authToken = normalizeToken(payload.authToken);
|
|
1101
|
+
const kernelToken = normalizeToken(payload.ubiquityKernelToken);
|
|
1102
|
+
if (!authToken || !kernelToken) {
|
|
1103
|
+
const error = new Error("Kernel refresh error: response missing authToken or ubiquityKernelToken");
|
|
1104
|
+
error.status = 502;
|
|
1105
|
+
throw error;
|
|
1106
|
+
}
|
|
1107
|
+
return {
|
|
1108
|
+
authToken,
|
|
1109
|
+
kernelToken,
|
|
1110
|
+
expiresAt: typeof payload.expiresAt === "string" ? payload.expiresAt : null
|
|
1111
|
+
};
|
|
1112
|
+
}
|
|
1040
1113
|
async function fetchWithRetry(url, options, maxRetries) {
|
|
1041
1114
|
let attempt = 0;
|
|
1042
1115
|
let lastError;
|
package/dist/index.mjs
CHANGED
|
@@ -916,6 +916,25 @@ function normalizeToken(value) {
|
|
|
916
916
|
function isGitHubToken(token) {
|
|
917
917
|
return token.trim().startsWith("gh");
|
|
918
918
|
}
|
|
919
|
+
function readKernelRefreshUrl(value) {
|
|
920
|
+
if (!value || typeof value !== "object") return EMPTY_STRING;
|
|
921
|
+
return normalizeToken(value.kernelRefreshUrl);
|
|
922
|
+
}
|
|
923
|
+
function getKernelRefreshUrl(input) {
|
|
924
|
+
const direct = readKernelRefreshUrl(input);
|
|
925
|
+
if (direct) return direct;
|
|
926
|
+
const fromConfig = readKernelRefreshUrl(input.config);
|
|
927
|
+
if (fromConfig) return fromConfig;
|
|
928
|
+
return readKernelRefreshUrl(input.settings);
|
|
929
|
+
}
|
|
930
|
+
function updateInputTokens(input, tokens) {
|
|
931
|
+
if ("authToken" in input) {
|
|
932
|
+
input.authToken = tokens.authToken;
|
|
933
|
+
}
|
|
934
|
+
if ("ubiquityKernelToken" in input) {
|
|
935
|
+
input.ubiquityKernelToken = tokens.kernelToken;
|
|
936
|
+
}
|
|
937
|
+
}
|
|
919
938
|
function getEnvTokenFromInput(input) {
|
|
920
939
|
if ("env" in input) {
|
|
921
940
|
const envValue = input.env;
|
|
@@ -949,11 +968,27 @@ function getAiBaseUrl(options) {
|
|
|
949
968
|
}
|
|
950
969
|
async function callLlm(options, input) {
|
|
951
970
|
const { baseUrl, model, stream: isStream, messages, aiAuthToken, ...rest } = options;
|
|
952
|
-
|
|
953
|
-
const
|
|
971
|
+
ensureMessages(messages);
|
|
972
|
+
const { token: resolvedAuthToken, isGitHub } = resolveAuthToken(input, aiAuthToken);
|
|
973
|
+
let authToken = resolvedAuthToken;
|
|
974
|
+
let kernelToken = "ubiquityKernelToken" in input ? input.ubiquityKernelToken : void 0;
|
|
954
975
|
const payload = getPayload(input);
|
|
955
976
|
const { owner, repo, installationId } = getRepoMetadata(payload);
|
|
956
|
-
|
|
977
|
+
const kernelRefreshUrl = getKernelRefreshUrl(input);
|
|
978
|
+
const hasExplicitAiAuth = Boolean(normalizeToken(aiAuthToken));
|
|
979
|
+
if (isGitHub && kernelRefreshUrl && kernelToken && !hasExplicitAiAuth) {
|
|
980
|
+
const refreshed = await refreshKernelTokens({
|
|
981
|
+
url: kernelRefreshUrl,
|
|
982
|
+
authToken,
|
|
983
|
+
kernelToken,
|
|
984
|
+
owner,
|
|
985
|
+
repo,
|
|
986
|
+
installationId
|
|
987
|
+
});
|
|
988
|
+
authToken = refreshed.authToken;
|
|
989
|
+
kernelToken = refreshed.kernelToken;
|
|
990
|
+
updateInputTokens(input, refreshed);
|
|
991
|
+
}
|
|
957
992
|
const url = buildAiUrl(options, baseUrl);
|
|
958
993
|
const body = JSON.stringify({
|
|
959
994
|
...rest,
|
|
@@ -996,6 +1031,44 @@ function ensureMessages(messages) {
|
|
|
996
1031
|
function buildAiUrl(options, baseUrl) {
|
|
997
1032
|
return `${getAiBaseUrl({ ...options, baseUrl })}/v1/chat/completions`;
|
|
998
1033
|
}
|
|
1034
|
+
async function refreshKernelTokens(params) {
|
|
1035
|
+
const headers = buildHeaders(params.authToken, {
|
|
1036
|
+
owner: params.owner,
|
|
1037
|
+
repo: params.repo,
|
|
1038
|
+
installationId: params.installationId,
|
|
1039
|
+
ubiquityKernelToken: params.kernelToken
|
|
1040
|
+
});
|
|
1041
|
+
const response = await fetch(params.url, { method: "POST", headers });
|
|
1042
|
+
const text = await response.text().catch(() => EMPTY_STRING);
|
|
1043
|
+
if (!response.ok) {
|
|
1044
|
+
const error = new Error(`Kernel refresh error: ${response.status} - ${text}`);
|
|
1045
|
+
error.status = response.status;
|
|
1046
|
+
throw error;
|
|
1047
|
+
}
|
|
1048
|
+
let payload = {};
|
|
1049
|
+
if (text.trim()) {
|
|
1050
|
+
try {
|
|
1051
|
+
payload = JSON.parse(text);
|
|
1052
|
+
} catch (err) {
|
|
1053
|
+
const details = err instanceof Error ? ` (${err.message})` : "";
|
|
1054
|
+
const error = new Error(`Kernel refresh error: failed to parse JSON response${details}`);
|
|
1055
|
+
error.status = response.status;
|
|
1056
|
+
throw error;
|
|
1057
|
+
}
|
|
1058
|
+
}
|
|
1059
|
+
const authToken = normalizeToken(payload.authToken);
|
|
1060
|
+
const kernelToken = normalizeToken(payload.ubiquityKernelToken);
|
|
1061
|
+
if (!authToken || !kernelToken) {
|
|
1062
|
+
const error = new Error("Kernel refresh error: response missing authToken or ubiquityKernelToken");
|
|
1063
|
+
error.status = 502;
|
|
1064
|
+
throw error;
|
|
1065
|
+
}
|
|
1066
|
+
return {
|
|
1067
|
+
authToken,
|
|
1068
|
+
kernelToken,
|
|
1069
|
+
expiresAt: typeof payload.expiresAt === "string" ? payload.expiresAt : null
|
|
1070
|
+
};
|
|
1071
|
+
}
|
|
999
1072
|
async function fetchWithRetry(url, options, maxRetries) {
|
|
1000
1073
|
let attempt = 0;
|
|
1001
1074
|
let lastError;
|
package/dist/llm.js
CHANGED
|
@@ -49,6 +49,25 @@ function normalizeToken(value) {
|
|
|
49
49
|
function isGitHubToken(token) {
|
|
50
50
|
return token.trim().startsWith("gh");
|
|
51
51
|
}
|
|
52
|
+
function readKernelRefreshUrl(value) {
|
|
53
|
+
if (!value || typeof value !== "object") return EMPTY_STRING;
|
|
54
|
+
return normalizeToken(value.kernelRefreshUrl);
|
|
55
|
+
}
|
|
56
|
+
function getKernelRefreshUrl(input) {
|
|
57
|
+
const direct = readKernelRefreshUrl(input);
|
|
58
|
+
if (direct) return direct;
|
|
59
|
+
const fromConfig = readKernelRefreshUrl(input.config);
|
|
60
|
+
if (fromConfig) return fromConfig;
|
|
61
|
+
return readKernelRefreshUrl(input.settings);
|
|
62
|
+
}
|
|
63
|
+
function updateInputTokens(input, tokens) {
|
|
64
|
+
if ("authToken" in input) {
|
|
65
|
+
input.authToken = tokens.authToken;
|
|
66
|
+
}
|
|
67
|
+
if ("ubiquityKernelToken" in input) {
|
|
68
|
+
input.ubiquityKernelToken = tokens.kernelToken;
|
|
69
|
+
}
|
|
70
|
+
}
|
|
52
71
|
function getEnvTokenFromInput(input) {
|
|
53
72
|
if ("env" in input) {
|
|
54
73
|
const envValue = input.env;
|
|
@@ -82,11 +101,27 @@ function getAiBaseUrl(options) {
|
|
|
82
101
|
}
|
|
83
102
|
async function callLlm(options, input) {
|
|
84
103
|
const { baseUrl, model, stream: isStream, messages, aiAuthToken, ...rest } = options;
|
|
85
|
-
|
|
86
|
-
const
|
|
104
|
+
ensureMessages(messages);
|
|
105
|
+
const { token: resolvedAuthToken, isGitHub } = resolveAuthToken(input, aiAuthToken);
|
|
106
|
+
let authToken = resolvedAuthToken;
|
|
107
|
+
let kernelToken = "ubiquityKernelToken" in input ? input.ubiquityKernelToken : void 0;
|
|
87
108
|
const payload = getPayload(input);
|
|
88
109
|
const { owner, repo, installationId } = getRepoMetadata(payload);
|
|
89
|
-
|
|
110
|
+
const kernelRefreshUrl = getKernelRefreshUrl(input);
|
|
111
|
+
const hasExplicitAiAuth = Boolean(normalizeToken(aiAuthToken));
|
|
112
|
+
if (isGitHub && kernelRefreshUrl && kernelToken && !hasExplicitAiAuth) {
|
|
113
|
+
const refreshed = await refreshKernelTokens({
|
|
114
|
+
url: kernelRefreshUrl,
|
|
115
|
+
authToken,
|
|
116
|
+
kernelToken,
|
|
117
|
+
owner,
|
|
118
|
+
repo,
|
|
119
|
+
installationId
|
|
120
|
+
});
|
|
121
|
+
authToken = refreshed.authToken;
|
|
122
|
+
kernelToken = refreshed.kernelToken;
|
|
123
|
+
updateInputTokens(input, refreshed);
|
|
124
|
+
}
|
|
90
125
|
const url = buildAiUrl(options, baseUrl);
|
|
91
126
|
const body = JSON.stringify({
|
|
92
127
|
...rest,
|
|
@@ -129,6 +164,44 @@ function ensureMessages(messages) {
|
|
|
129
164
|
function buildAiUrl(options, baseUrl) {
|
|
130
165
|
return `${getAiBaseUrl({ ...options, baseUrl })}/v1/chat/completions`;
|
|
131
166
|
}
|
|
167
|
+
async function refreshKernelTokens(params) {
|
|
168
|
+
const headers = buildHeaders(params.authToken, {
|
|
169
|
+
owner: params.owner,
|
|
170
|
+
repo: params.repo,
|
|
171
|
+
installationId: params.installationId,
|
|
172
|
+
ubiquityKernelToken: params.kernelToken
|
|
173
|
+
});
|
|
174
|
+
const response = await fetch(params.url, { method: "POST", headers });
|
|
175
|
+
const text = await response.text().catch(() => EMPTY_STRING);
|
|
176
|
+
if (!response.ok) {
|
|
177
|
+
const error = new Error(`Kernel refresh error: ${response.status} - ${text}`);
|
|
178
|
+
error.status = response.status;
|
|
179
|
+
throw error;
|
|
180
|
+
}
|
|
181
|
+
let payload = {};
|
|
182
|
+
if (text.trim()) {
|
|
183
|
+
try {
|
|
184
|
+
payload = JSON.parse(text);
|
|
185
|
+
} catch (err) {
|
|
186
|
+
const details = err instanceof Error ? ` (${err.message})` : "";
|
|
187
|
+
const error = new Error(`Kernel refresh error: failed to parse JSON response${details}`);
|
|
188
|
+
error.status = response.status;
|
|
189
|
+
throw error;
|
|
190
|
+
}
|
|
191
|
+
}
|
|
192
|
+
const authToken = normalizeToken(payload.authToken);
|
|
193
|
+
const kernelToken = normalizeToken(payload.ubiquityKernelToken);
|
|
194
|
+
if (!authToken || !kernelToken) {
|
|
195
|
+
const error = new Error("Kernel refresh error: response missing authToken or ubiquityKernelToken");
|
|
196
|
+
error.status = 502;
|
|
197
|
+
throw error;
|
|
198
|
+
}
|
|
199
|
+
return {
|
|
200
|
+
authToken,
|
|
201
|
+
kernelToken,
|
|
202
|
+
expiresAt: typeof payload.expiresAt === "string" ? payload.expiresAt : null
|
|
203
|
+
};
|
|
204
|
+
}
|
|
132
205
|
async function fetchWithRetry(url, options, maxRetries) {
|
|
133
206
|
let attempt = 0;
|
|
134
207
|
let lastError;
|
package/dist/llm.mjs
CHANGED
|
@@ -25,6 +25,25 @@ function normalizeToken(value) {
|
|
|
25
25
|
function isGitHubToken(token) {
|
|
26
26
|
return token.trim().startsWith("gh");
|
|
27
27
|
}
|
|
28
|
+
function readKernelRefreshUrl(value) {
|
|
29
|
+
if (!value || typeof value !== "object") return EMPTY_STRING;
|
|
30
|
+
return normalizeToken(value.kernelRefreshUrl);
|
|
31
|
+
}
|
|
32
|
+
function getKernelRefreshUrl(input) {
|
|
33
|
+
const direct = readKernelRefreshUrl(input);
|
|
34
|
+
if (direct) return direct;
|
|
35
|
+
const fromConfig = readKernelRefreshUrl(input.config);
|
|
36
|
+
if (fromConfig) return fromConfig;
|
|
37
|
+
return readKernelRefreshUrl(input.settings);
|
|
38
|
+
}
|
|
39
|
+
function updateInputTokens(input, tokens) {
|
|
40
|
+
if ("authToken" in input) {
|
|
41
|
+
input.authToken = tokens.authToken;
|
|
42
|
+
}
|
|
43
|
+
if ("ubiquityKernelToken" in input) {
|
|
44
|
+
input.ubiquityKernelToken = tokens.kernelToken;
|
|
45
|
+
}
|
|
46
|
+
}
|
|
28
47
|
function getEnvTokenFromInput(input) {
|
|
29
48
|
if ("env" in input) {
|
|
30
49
|
const envValue = input.env;
|
|
@@ -58,11 +77,27 @@ function getAiBaseUrl(options) {
|
|
|
58
77
|
}
|
|
59
78
|
async function callLlm(options, input) {
|
|
60
79
|
const { baseUrl, model, stream: isStream, messages, aiAuthToken, ...rest } = options;
|
|
61
|
-
|
|
62
|
-
const
|
|
80
|
+
ensureMessages(messages);
|
|
81
|
+
const { token: resolvedAuthToken, isGitHub } = resolveAuthToken(input, aiAuthToken);
|
|
82
|
+
let authToken = resolvedAuthToken;
|
|
83
|
+
let kernelToken = "ubiquityKernelToken" in input ? input.ubiquityKernelToken : void 0;
|
|
63
84
|
const payload = getPayload(input);
|
|
64
85
|
const { owner, repo, installationId } = getRepoMetadata(payload);
|
|
65
|
-
|
|
86
|
+
const kernelRefreshUrl = getKernelRefreshUrl(input);
|
|
87
|
+
const hasExplicitAiAuth = Boolean(normalizeToken(aiAuthToken));
|
|
88
|
+
if (isGitHub && kernelRefreshUrl && kernelToken && !hasExplicitAiAuth) {
|
|
89
|
+
const refreshed = await refreshKernelTokens({
|
|
90
|
+
url: kernelRefreshUrl,
|
|
91
|
+
authToken,
|
|
92
|
+
kernelToken,
|
|
93
|
+
owner,
|
|
94
|
+
repo,
|
|
95
|
+
installationId
|
|
96
|
+
});
|
|
97
|
+
authToken = refreshed.authToken;
|
|
98
|
+
kernelToken = refreshed.kernelToken;
|
|
99
|
+
updateInputTokens(input, refreshed);
|
|
100
|
+
}
|
|
66
101
|
const url = buildAiUrl(options, baseUrl);
|
|
67
102
|
const body = JSON.stringify({
|
|
68
103
|
...rest,
|
|
@@ -105,6 +140,44 @@ function ensureMessages(messages) {
|
|
|
105
140
|
function buildAiUrl(options, baseUrl) {
|
|
106
141
|
return `${getAiBaseUrl({ ...options, baseUrl })}/v1/chat/completions`;
|
|
107
142
|
}
|
|
143
|
+
async function refreshKernelTokens(params) {
|
|
144
|
+
const headers = buildHeaders(params.authToken, {
|
|
145
|
+
owner: params.owner,
|
|
146
|
+
repo: params.repo,
|
|
147
|
+
installationId: params.installationId,
|
|
148
|
+
ubiquityKernelToken: params.kernelToken
|
|
149
|
+
});
|
|
150
|
+
const response = await fetch(params.url, { method: "POST", headers });
|
|
151
|
+
const text = await response.text().catch(() => EMPTY_STRING);
|
|
152
|
+
if (!response.ok) {
|
|
153
|
+
const error = new Error(`Kernel refresh error: ${response.status} - ${text}`);
|
|
154
|
+
error.status = response.status;
|
|
155
|
+
throw error;
|
|
156
|
+
}
|
|
157
|
+
let payload = {};
|
|
158
|
+
if (text.trim()) {
|
|
159
|
+
try {
|
|
160
|
+
payload = JSON.parse(text);
|
|
161
|
+
} catch (err) {
|
|
162
|
+
const details = err instanceof Error ? ` (${err.message})` : "";
|
|
163
|
+
const error = new Error(`Kernel refresh error: failed to parse JSON response${details}`);
|
|
164
|
+
error.status = response.status;
|
|
165
|
+
throw error;
|
|
166
|
+
}
|
|
167
|
+
}
|
|
168
|
+
const authToken = normalizeToken(payload.authToken);
|
|
169
|
+
const kernelToken = normalizeToken(payload.ubiquityKernelToken);
|
|
170
|
+
if (!authToken || !kernelToken) {
|
|
171
|
+
const error = new Error("Kernel refresh error: response missing authToken or ubiquityKernelToken");
|
|
172
|
+
error.status = 502;
|
|
173
|
+
throw error;
|
|
174
|
+
}
|
|
175
|
+
return {
|
|
176
|
+
authToken,
|
|
177
|
+
kernelToken,
|
|
178
|
+
expiresAt: typeof payload.expiresAt === "string" ? payload.expiresAt : null
|
|
179
|
+
};
|
|
180
|
+
}
|
|
108
181
|
async function fetchWithRetry(url, options, maxRetries) {
|
|
109
182
|
let attempt = 0;
|
|
110
183
|
let lastError;
|