@ubiquity-os/plugin-sdk 3.0.0 → 3.1.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.js +35 -20
- package/dist/index.mjs +32 -17
- package/dist/manifest.d.mts +25 -1
- package/dist/manifest.d.ts +25 -1
- package/dist/manifest.js +12 -1
- package/dist/manifest.mjs +11 -1
- package/dist/signature.d.mts +32 -1
- package/dist/signature.d.ts +32 -1
- package/dist/signature.js +38 -0
- package/dist/signature.mjs +37 -0
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -38,7 +38,7 @@ module.exports = __toCommonJS(src_exports);
|
|
|
38
38
|
|
|
39
39
|
// src/server.ts
|
|
40
40
|
var import_value2 = require("@sinclair/typebox/value");
|
|
41
|
-
var
|
|
41
|
+
var import_ubiquity_os_logger3 = require("@ubiquity-os/ubiquity-os-logger");
|
|
42
42
|
var import_hono = require("hono");
|
|
43
43
|
var import_adapter2 = require("hono/adapter");
|
|
44
44
|
var import_http_exception = require("hono/http-exception");
|
|
@@ -255,6 +255,31 @@ ${metadataContent}
|
|
|
255
255
|
}
|
|
256
256
|
};
|
|
257
257
|
|
|
258
|
+
// src/error.ts
|
|
259
|
+
var import_ubiquity_os_logger2 = require("@ubiquity-os/ubiquity-os-logger");
|
|
260
|
+
function transformError(context2, error) {
|
|
261
|
+
let loggerError;
|
|
262
|
+
if (error instanceof AggregateError) {
|
|
263
|
+
loggerError = context2.logger.error(
|
|
264
|
+
error.errors.map((err) => {
|
|
265
|
+
if (err instanceof import_ubiquity_os_logger2.LogReturn) {
|
|
266
|
+
return err.logMessage.raw;
|
|
267
|
+
} else if (err instanceof Error) {
|
|
268
|
+
return err.message;
|
|
269
|
+
} else {
|
|
270
|
+
return err;
|
|
271
|
+
}
|
|
272
|
+
}).join("\n\n"),
|
|
273
|
+
{ error }
|
|
274
|
+
);
|
|
275
|
+
} else if (error instanceof Error || error instanceof import_ubiquity_os_logger2.LogReturn) {
|
|
276
|
+
loggerError = error;
|
|
277
|
+
} else {
|
|
278
|
+
loggerError = context2.logger.error(String(error));
|
|
279
|
+
}
|
|
280
|
+
return loggerError;
|
|
281
|
+
}
|
|
282
|
+
|
|
258
283
|
// src/octokit.ts
|
|
259
284
|
var import_core = require("@octokit/core");
|
|
260
285
|
var import_plugin_paginate_rest = require("@octokit/plugin-paginate-rest");
|
|
@@ -409,7 +434,7 @@ function createPlugin(handler, manifest, options) {
|
|
|
409
434
|
octokit: new customOctokit({ auth: inputs.authToken }),
|
|
410
435
|
config: config2,
|
|
411
436
|
env,
|
|
412
|
-
logger: new
|
|
437
|
+
logger: new import_ubiquity_os_logger3.Logs(pluginOptions.logLevel),
|
|
413
438
|
commentHandler: new CommentHandler()
|
|
414
439
|
};
|
|
415
440
|
try {
|
|
@@ -417,12 +442,7 @@ function createPlugin(handler, manifest, options) {
|
|
|
417
442
|
return ctx.json({ stateId: inputs.stateId, output: result ?? {} });
|
|
418
443
|
} catch (error) {
|
|
419
444
|
console.error(error);
|
|
420
|
-
|
|
421
|
-
if (error instanceof Error || error instanceof import_ubiquity_os_logger2.LogReturn) {
|
|
422
|
-
loggerError = error;
|
|
423
|
-
} else {
|
|
424
|
-
loggerError = context2.logger.error(`Error: ${error}`);
|
|
425
|
-
}
|
|
445
|
+
const loggerError = transformError(context2, error);
|
|
426
446
|
if (pluginOptions.postCommentOnError && loggerError) {
|
|
427
447
|
await context2.commentHandler.postComment(context2, loggerError);
|
|
428
448
|
}
|
|
@@ -436,7 +456,7 @@ function createPlugin(handler, manifest, options) {
|
|
|
436
456
|
var core = __toESM(require("@actions/core"));
|
|
437
457
|
var github2 = __toESM(require("@actions/github"));
|
|
438
458
|
var import_value3 = require("@sinclair/typebox/value");
|
|
439
|
-
var
|
|
459
|
+
var import_ubiquity_os_logger4 = require("@ubiquity-os/ubiquity-os-logger");
|
|
440
460
|
var import_dotenv = require("dotenv");
|
|
441
461
|
(0, import_dotenv.config)();
|
|
442
462
|
async function createActionsPlugin(handler, options) {
|
|
@@ -501,7 +521,7 @@ async function createActionsPlugin(handler, options) {
|
|
|
501
521
|
octokit: new customOctokit({ auth: inputs.authToken }),
|
|
502
522
|
config: config2,
|
|
503
523
|
env,
|
|
504
|
-
logger: new
|
|
524
|
+
logger: new import_ubiquity_os_logger4.Logs(pluginOptions.logLevel),
|
|
505
525
|
commentHandler: new CommentHandler()
|
|
506
526
|
};
|
|
507
527
|
try {
|
|
@@ -510,16 +530,11 @@ async function createActionsPlugin(handler, options) {
|
|
|
510
530
|
await returnDataToKernel(pluginGithubToken, inputs.stateId, result);
|
|
511
531
|
} catch (error) {
|
|
512
532
|
console.error(error);
|
|
513
|
-
|
|
514
|
-
if (
|
|
515
|
-
core.setFailed(
|
|
516
|
-
|
|
517
|
-
|
|
518
|
-
core.setFailed(error.logMessage.raw);
|
|
519
|
-
loggerError = error;
|
|
520
|
-
} else {
|
|
521
|
-
core.setFailed(`Error: ${error}`);
|
|
522
|
-
loggerError = context2.logger.error(`Error: ${error}`);
|
|
533
|
+
const loggerError = transformError(context2, error);
|
|
534
|
+
if (loggerError instanceof import_ubiquity_os_logger4.LogReturn) {
|
|
535
|
+
core.setFailed(loggerError.logMessage.diff);
|
|
536
|
+
} else if (loggerError instanceof Error) {
|
|
537
|
+
core.setFailed(loggerError);
|
|
523
538
|
}
|
|
524
539
|
if (pluginOptions.postCommentOnError && loggerError) {
|
|
525
540
|
await context2.commentHandler.postComment(context2, loggerError);
|
package/dist/index.mjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
// src/server.ts
|
|
2
2
|
import { Value as Value2 } from "@sinclair/typebox/value";
|
|
3
|
-
import {
|
|
3
|
+
import { Logs } from "@ubiquity-os/ubiquity-os-logger";
|
|
4
4
|
import { Hono } from "hono";
|
|
5
5
|
import { env as honoEnv } from "hono/adapter";
|
|
6
6
|
import { HTTPException } from "hono/http-exception";
|
|
@@ -217,6 +217,31 @@ ${metadataContent}
|
|
|
217
217
|
}
|
|
218
218
|
};
|
|
219
219
|
|
|
220
|
+
// src/error.ts
|
|
221
|
+
import { LogReturn as LogReturn2 } from "@ubiquity-os/ubiquity-os-logger";
|
|
222
|
+
function transformError(context2, error) {
|
|
223
|
+
let loggerError;
|
|
224
|
+
if (error instanceof AggregateError) {
|
|
225
|
+
loggerError = context2.logger.error(
|
|
226
|
+
error.errors.map((err) => {
|
|
227
|
+
if (err instanceof LogReturn2) {
|
|
228
|
+
return err.logMessage.raw;
|
|
229
|
+
} else if (err instanceof Error) {
|
|
230
|
+
return err.message;
|
|
231
|
+
} else {
|
|
232
|
+
return err;
|
|
233
|
+
}
|
|
234
|
+
}).join("\n\n"),
|
|
235
|
+
{ error }
|
|
236
|
+
);
|
|
237
|
+
} else if (error instanceof Error || error instanceof LogReturn2) {
|
|
238
|
+
loggerError = error;
|
|
239
|
+
} else {
|
|
240
|
+
loggerError = context2.logger.error(String(error));
|
|
241
|
+
}
|
|
242
|
+
return loggerError;
|
|
243
|
+
}
|
|
244
|
+
|
|
220
245
|
// src/octokit.ts
|
|
221
246
|
import { Octokit } from "@octokit/core";
|
|
222
247
|
import { paginateRest } from "@octokit/plugin-paginate-rest";
|
|
@@ -379,12 +404,7 @@ function createPlugin(handler, manifest, options) {
|
|
|
379
404
|
return ctx.json({ stateId: inputs.stateId, output: result ?? {} });
|
|
380
405
|
} catch (error) {
|
|
381
406
|
console.error(error);
|
|
382
|
-
|
|
383
|
-
if (error instanceof Error || error instanceof LogReturn2) {
|
|
384
|
-
loggerError = error;
|
|
385
|
-
} else {
|
|
386
|
-
loggerError = context2.logger.error(`Error: ${error}`);
|
|
387
|
-
}
|
|
407
|
+
const loggerError = transformError(context2, error);
|
|
388
408
|
if (pluginOptions.postCommentOnError && loggerError) {
|
|
389
409
|
await context2.commentHandler.postComment(context2, loggerError);
|
|
390
410
|
}
|
|
@@ -472,16 +492,11 @@ async function createActionsPlugin(handler, options) {
|
|
|
472
492
|
await returnDataToKernel(pluginGithubToken, inputs.stateId, result);
|
|
473
493
|
} catch (error) {
|
|
474
494
|
console.error(error);
|
|
475
|
-
|
|
476
|
-
if (
|
|
477
|
-
core.setFailed(
|
|
478
|
-
|
|
479
|
-
|
|
480
|
-
core.setFailed(error.logMessage.raw);
|
|
481
|
-
loggerError = error;
|
|
482
|
-
} else {
|
|
483
|
-
core.setFailed(`Error: ${error}`);
|
|
484
|
-
loggerError = context2.logger.error(`Error: ${error}`);
|
|
495
|
+
const loggerError = transformError(context2, error);
|
|
496
|
+
if (loggerError instanceof LogReturn3) {
|
|
497
|
+
core.setFailed(loggerError.logMessage.diff);
|
|
498
|
+
} else if (loggerError instanceof Error) {
|
|
499
|
+
core.setFailed(loggerError);
|
|
485
500
|
}
|
|
486
501
|
if (pluginOptions.postCommentOnError && loggerError) {
|
|
487
502
|
await context2.commentHandler.postComment(context2, loggerError);
|
package/dist/manifest.d.mts
CHANGED
|
@@ -2,10 +2,26 @@ import * as _sinclair_typebox from '@sinclair/typebox';
|
|
|
2
2
|
import { Static } from '@sinclair/typebox';
|
|
3
3
|
|
|
4
4
|
declare const runEvent: _sinclair_typebox.TUnion<_sinclair_typebox.TLiteral<"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.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" | "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.unassigned" | "issues.unlabeled" | "issues.unlocked" | "issues.unpinned" | "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.created" | "secret_scanning_alert.reopened" | "secret_scanning_alert.resolved" | "secret_scanning_alert.validated" | "secret_scanning_alert_location" | "secret_scanning_alert_location.created" | "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">[]>;
|
|
5
|
+
declare const exampleCommandExecutionSchema: _sinclair_typebox.TObject<{
|
|
6
|
+
commandInvocation: _sinclair_typebox.TString;
|
|
7
|
+
githubContext: _sinclair_typebox.TOptional<_sinclair_typebox.TRecord<_sinclair_typebox.TString, _sinclair_typebox.TAny>>;
|
|
8
|
+
expectedToolCallResult: _sinclair_typebox.TObject<{
|
|
9
|
+
function: _sinclair_typebox.TString;
|
|
10
|
+
parameters: _sinclair_typebox.TRecord<_sinclair_typebox.TString, _sinclair_typebox.TAny>;
|
|
11
|
+
}>;
|
|
12
|
+
}>;
|
|
5
13
|
declare const commandSchema: _sinclair_typebox.TObject<{
|
|
6
14
|
description: _sinclair_typebox.TString;
|
|
7
15
|
"ubiquity:example": _sinclair_typebox.TString;
|
|
8
16
|
parameters: _sinclair_typebox.TOptional<_sinclair_typebox.TRecord<_sinclair_typebox.TString, _sinclair_typebox.TAny>>;
|
|
17
|
+
examples: _sinclair_typebox.TOptional<_sinclair_typebox.TArray<_sinclair_typebox.TObject<{
|
|
18
|
+
commandInvocation: _sinclair_typebox.TString;
|
|
19
|
+
githubContext: _sinclair_typebox.TOptional<_sinclair_typebox.TRecord<_sinclair_typebox.TString, _sinclair_typebox.TAny>>;
|
|
20
|
+
expectedToolCallResult: _sinclair_typebox.TObject<{
|
|
21
|
+
function: _sinclair_typebox.TString;
|
|
22
|
+
parameters: _sinclair_typebox.TRecord<_sinclair_typebox.TString, _sinclair_typebox.TAny>;
|
|
23
|
+
}>;
|
|
24
|
+
}>>>;
|
|
9
25
|
}>;
|
|
10
26
|
declare const manifestSchema: _sinclair_typebox.TObject<{
|
|
11
27
|
name: _sinclair_typebox.TString;
|
|
@@ -14,6 +30,14 @@ declare const manifestSchema: _sinclair_typebox.TObject<{
|
|
|
14
30
|
description: _sinclair_typebox.TString;
|
|
15
31
|
"ubiquity:example": _sinclair_typebox.TString;
|
|
16
32
|
parameters: _sinclair_typebox.TOptional<_sinclair_typebox.TRecord<_sinclair_typebox.TString, _sinclair_typebox.TAny>>;
|
|
33
|
+
examples: _sinclair_typebox.TOptional<_sinclair_typebox.TArray<_sinclair_typebox.TObject<{
|
|
34
|
+
commandInvocation: _sinclair_typebox.TString;
|
|
35
|
+
githubContext: _sinclair_typebox.TOptional<_sinclair_typebox.TRecord<_sinclair_typebox.TString, _sinclair_typebox.TAny>>;
|
|
36
|
+
expectedToolCallResult: _sinclair_typebox.TObject<{
|
|
37
|
+
function: _sinclair_typebox.TString;
|
|
38
|
+
parameters: _sinclair_typebox.TRecord<_sinclair_typebox.TString, _sinclair_typebox.TAny>;
|
|
39
|
+
}>;
|
|
40
|
+
}>>>;
|
|
17
41
|
}>>>;
|
|
18
42
|
"ubiquity:listeners": _sinclair_typebox.TOptional<_sinclair_typebox.TArray<_sinclair_typebox.TUnion<_sinclair_typebox.TLiteral<"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.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" | "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.unassigned" | "issues.unlabeled" | "issues.unlocked" | "issues.unpinned" | "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.created" | "secret_scanning_alert.reopened" | "secret_scanning_alert.resolved" | "secret_scanning_alert.validated" | "secret_scanning_alert_location" | "secret_scanning_alert_location.created" | "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">[]>>>;
|
|
19
43
|
configuration: _sinclair_typebox.TOptional<_sinclair_typebox.TRecord<_sinclair_typebox.TString, _sinclair_typebox.TAny>>;
|
|
@@ -21,4 +45,4 @@ declare const manifestSchema: _sinclair_typebox.TObject<{
|
|
|
21
45
|
}>;
|
|
22
46
|
type Manifest = Static<typeof manifestSchema>;
|
|
23
47
|
|
|
24
|
-
export { type Manifest, commandSchema, manifestSchema, runEvent };
|
|
48
|
+
export { type Manifest, commandSchema, exampleCommandExecutionSchema, manifestSchema, runEvent };
|
package/dist/manifest.d.ts
CHANGED
|
@@ -2,10 +2,26 @@ import * as _sinclair_typebox from '@sinclair/typebox';
|
|
|
2
2
|
import { Static } from '@sinclair/typebox';
|
|
3
3
|
|
|
4
4
|
declare const runEvent: _sinclair_typebox.TUnion<_sinclair_typebox.TLiteral<"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.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" | "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.unassigned" | "issues.unlabeled" | "issues.unlocked" | "issues.unpinned" | "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.created" | "secret_scanning_alert.reopened" | "secret_scanning_alert.resolved" | "secret_scanning_alert.validated" | "secret_scanning_alert_location" | "secret_scanning_alert_location.created" | "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">[]>;
|
|
5
|
+
declare const exampleCommandExecutionSchema: _sinclair_typebox.TObject<{
|
|
6
|
+
commandInvocation: _sinclair_typebox.TString;
|
|
7
|
+
githubContext: _sinclair_typebox.TOptional<_sinclair_typebox.TRecord<_sinclair_typebox.TString, _sinclair_typebox.TAny>>;
|
|
8
|
+
expectedToolCallResult: _sinclair_typebox.TObject<{
|
|
9
|
+
function: _sinclair_typebox.TString;
|
|
10
|
+
parameters: _sinclair_typebox.TRecord<_sinclair_typebox.TString, _sinclair_typebox.TAny>;
|
|
11
|
+
}>;
|
|
12
|
+
}>;
|
|
5
13
|
declare const commandSchema: _sinclair_typebox.TObject<{
|
|
6
14
|
description: _sinclair_typebox.TString;
|
|
7
15
|
"ubiquity:example": _sinclair_typebox.TString;
|
|
8
16
|
parameters: _sinclair_typebox.TOptional<_sinclair_typebox.TRecord<_sinclair_typebox.TString, _sinclair_typebox.TAny>>;
|
|
17
|
+
examples: _sinclair_typebox.TOptional<_sinclair_typebox.TArray<_sinclair_typebox.TObject<{
|
|
18
|
+
commandInvocation: _sinclair_typebox.TString;
|
|
19
|
+
githubContext: _sinclair_typebox.TOptional<_sinclair_typebox.TRecord<_sinclair_typebox.TString, _sinclair_typebox.TAny>>;
|
|
20
|
+
expectedToolCallResult: _sinclair_typebox.TObject<{
|
|
21
|
+
function: _sinclair_typebox.TString;
|
|
22
|
+
parameters: _sinclair_typebox.TRecord<_sinclair_typebox.TString, _sinclair_typebox.TAny>;
|
|
23
|
+
}>;
|
|
24
|
+
}>>>;
|
|
9
25
|
}>;
|
|
10
26
|
declare const manifestSchema: _sinclair_typebox.TObject<{
|
|
11
27
|
name: _sinclair_typebox.TString;
|
|
@@ -14,6 +30,14 @@ declare const manifestSchema: _sinclair_typebox.TObject<{
|
|
|
14
30
|
description: _sinclair_typebox.TString;
|
|
15
31
|
"ubiquity:example": _sinclair_typebox.TString;
|
|
16
32
|
parameters: _sinclair_typebox.TOptional<_sinclair_typebox.TRecord<_sinclair_typebox.TString, _sinclair_typebox.TAny>>;
|
|
33
|
+
examples: _sinclair_typebox.TOptional<_sinclair_typebox.TArray<_sinclair_typebox.TObject<{
|
|
34
|
+
commandInvocation: _sinclair_typebox.TString;
|
|
35
|
+
githubContext: _sinclair_typebox.TOptional<_sinclair_typebox.TRecord<_sinclair_typebox.TString, _sinclair_typebox.TAny>>;
|
|
36
|
+
expectedToolCallResult: _sinclair_typebox.TObject<{
|
|
37
|
+
function: _sinclair_typebox.TString;
|
|
38
|
+
parameters: _sinclair_typebox.TRecord<_sinclair_typebox.TString, _sinclair_typebox.TAny>;
|
|
39
|
+
}>;
|
|
40
|
+
}>>>;
|
|
17
41
|
}>>>;
|
|
18
42
|
"ubiquity:listeners": _sinclair_typebox.TOptional<_sinclair_typebox.TArray<_sinclair_typebox.TUnion<_sinclair_typebox.TLiteral<"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.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" | "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.unassigned" | "issues.unlabeled" | "issues.unlocked" | "issues.unpinned" | "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.created" | "secret_scanning_alert.reopened" | "secret_scanning_alert.resolved" | "secret_scanning_alert.validated" | "secret_scanning_alert_location" | "secret_scanning_alert_location.created" | "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">[]>>>;
|
|
19
43
|
configuration: _sinclair_typebox.TOptional<_sinclair_typebox.TRecord<_sinclair_typebox.TString, _sinclair_typebox.TAny>>;
|
|
@@ -21,4 +45,4 @@ declare const manifestSchema: _sinclair_typebox.TObject<{
|
|
|
21
45
|
}>;
|
|
22
46
|
type Manifest = Static<typeof manifestSchema>;
|
|
23
47
|
|
|
24
|
-
export { type Manifest, commandSchema, manifestSchema, runEvent };
|
|
48
|
+
export { type Manifest, commandSchema, exampleCommandExecutionSchema, manifestSchema, runEvent };
|
package/dist/manifest.js
CHANGED
|
@@ -21,6 +21,7 @@ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: tru
|
|
|
21
21
|
var manifest_exports = {};
|
|
22
22
|
__export(manifest_exports, {
|
|
23
23
|
commandSchema: () => commandSchema,
|
|
24
|
+
exampleCommandExecutionSchema: () => exampleCommandExecutionSchema,
|
|
24
25
|
manifestSchema: () => manifestSchema,
|
|
25
26
|
runEvent: () => runEvent
|
|
26
27
|
});
|
|
@@ -28,10 +29,19 @@ module.exports = __toCommonJS(manifest_exports);
|
|
|
28
29
|
var import_typebox = require("@sinclair/typebox");
|
|
29
30
|
var import_webhooks = require("@octokit/webhooks");
|
|
30
31
|
var runEvent = import_typebox.Type.Union(import_webhooks.emitterEventNames.map((o) => import_typebox.Type.Literal(o)));
|
|
32
|
+
var exampleCommandExecutionSchema = import_typebox.Type.Object({
|
|
33
|
+
commandInvocation: import_typebox.Type.String({ minLength: 1 }),
|
|
34
|
+
githubContext: import_typebox.Type.Optional(import_typebox.Type.Record(import_typebox.Type.String(), import_typebox.Type.Any())),
|
|
35
|
+
expectedToolCallResult: import_typebox.Type.Object({
|
|
36
|
+
function: import_typebox.Type.String({ minLength: 1 }),
|
|
37
|
+
parameters: import_typebox.Type.Record(import_typebox.Type.String(), import_typebox.Type.Any())
|
|
38
|
+
})
|
|
39
|
+
});
|
|
31
40
|
var commandSchema = import_typebox.Type.Object({
|
|
32
41
|
description: import_typebox.Type.String({ minLength: 1 }),
|
|
33
42
|
"ubiquity:example": import_typebox.Type.String({ minLength: 1 }),
|
|
34
|
-
parameters: import_typebox.Type.Optional(import_typebox.Type.Record(import_typebox.Type.String(), import_typebox.Type.Any()))
|
|
43
|
+
parameters: import_typebox.Type.Optional(import_typebox.Type.Record(import_typebox.Type.String(), import_typebox.Type.Any())),
|
|
44
|
+
examples: import_typebox.Type.Optional(import_typebox.Type.Array(exampleCommandExecutionSchema, { default: [] }))
|
|
35
45
|
});
|
|
36
46
|
var manifestSchema = import_typebox.Type.Object({
|
|
37
47
|
name: import_typebox.Type.String({ minLength: 1 }),
|
|
@@ -44,6 +54,7 @@ var manifestSchema = import_typebox.Type.Object({
|
|
|
44
54
|
// Annotate the CommonJS export names for ESM import in node:
|
|
45
55
|
0 && (module.exports = {
|
|
46
56
|
commandSchema,
|
|
57
|
+
exampleCommandExecutionSchema,
|
|
47
58
|
manifestSchema,
|
|
48
59
|
runEvent
|
|
49
60
|
});
|
package/dist/manifest.mjs
CHANGED
|
@@ -2,10 +2,19 @@
|
|
|
2
2
|
import { Type as T } from "@sinclair/typebox";
|
|
3
3
|
import { emitterEventNames } from "@octokit/webhooks";
|
|
4
4
|
var runEvent = T.Union(emitterEventNames.map((o) => T.Literal(o)));
|
|
5
|
+
var exampleCommandExecutionSchema = T.Object({
|
|
6
|
+
commandInvocation: T.String({ minLength: 1 }),
|
|
7
|
+
githubContext: T.Optional(T.Record(T.String(), T.Any())),
|
|
8
|
+
expectedToolCallResult: T.Object({
|
|
9
|
+
function: T.String({ minLength: 1 }),
|
|
10
|
+
parameters: T.Record(T.String(), T.Any())
|
|
11
|
+
})
|
|
12
|
+
});
|
|
5
13
|
var commandSchema = T.Object({
|
|
6
14
|
description: T.String({ minLength: 1 }),
|
|
7
15
|
"ubiquity:example": T.String({ minLength: 1 }),
|
|
8
|
-
parameters: T.Optional(T.Record(T.String(), T.Any()))
|
|
16
|
+
parameters: T.Optional(T.Record(T.String(), T.Any())),
|
|
17
|
+
examples: T.Optional(T.Array(exampleCommandExecutionSchema, { default: [] }))
|
|
9
18
|
});
|
|
10
19
|
var manifestSchema = T.Object({
|
|
11
20
|
name: T.String({ minLength: 1 }),
|
|
@@ -17,6 +26,7 @@ var manifestSchema = T.Object({
|
|
|
17
26
|
});
|
|
18
27
|
export {
|
|
19
28
|
commandSchema,
|
|
29
|
+
exampleCommandExecutionSchema,
|
|
20
30
|
manifestSchema,
|
|
21
31
|
runEvent
|
|
22
32
|
};
|
package/dist/signature.d.mts
CHANGED
|
@@ -1,3 +1,34 @@
|
|
|
1
|
+
import { EmitterWebhookEventName, EmitterWebhookEvent } from '@octokit/webhooks';
|
|
2
|
+
import * as _sinclair_typebox from '@sinclair/typebox';
|
|
3
|
+
import { StaticDecode } from '@sinclair/typebox';
|
|
4
|
+
|
|
5
|
+
declare const commandCallSchema: _sinclair_typebox.TUnion<[_sinclair_typebox.TNull, _sinclair_typebox.TObject<{
|
|
6
|
+
name: _sinclair_typebox.TString;
|
|
7
|
+
parameters: _sinclair_typebox.TUnknown;
|
|
8
|
+
}>]>;
|
|
9
|
+
type CommandCall = StaticDecode<typeof commandCallSchema>;
|
|
10
|
+
|
|
11
|
+
declare class PluginInput<T extends EmitterWebhookEventName = EmitterWebhookEventName> {
|
|
12
|
+
private _privateKey;
|
|
13
|
+
stateId: string;
|
|
14
|
+
eventName: T;
|
|
15
|
+
eventPayload: EmitterWebhookEvent<T>["payload"];
|
|
16
|
+
settings: unknown;
|
|
17
|
+
authToken: string;
|
|
18
|
+
ref: string;
|
|
19
|
+
command: CommandCall;
|
|
20
|
+
constructor(privateKey: string, stateId: string, eventName: T, eventPayload: EmitterWebhookEvent<T>["payload"], settings: unknown, authToken: string, ref: string, command: CommandCall);
|
|
21
|
+
getInputs(): Promise<{
|
|
22
|
+
signature: string;
|
|
23
|
+
stateId: string;
|
|
24
|
+
eventName: T;
|
|
25
|
+
eventPayload: string;
|
|
26
|
+
settings: string;
|
|
27
|
+
authToken: string;
|
|
28
|
+
ref: string;
|
|
29
|
+
command: string;
|
|
30
|
+
}>;
|
|
31
|
+
}
|
|
1
32
|
interface Inputs {
|
|
2
33
|
stateId: unknown;
|
|
3
34
|
eventName: unknown;
|
|
@@ -10,4 +41,4 @@ interface Inputs {
|
|
|
10
41
|
declare function verifySignature(publicKeyPem: string, inputs: Inputs, signature: string): Promise<boolean>;
|
|
11
42
|
declare function signPayload(payload: string, privateKey: string): Promise<string>;
|
|
12
43
|
|
|
13
|
-
export { signPayload, verifySignature };
|
|
44
|
+
export { PluginInput, signPayload, verifySignature };
|
package/dist/signature.d.ts
CHANGED
|
@@ -1,3 +1,34 @@
|
|
|
1
|
+
import { EmitterWebhookEventName, EmitterWebhookEvent } from '@octokit/webhooks';
|
|
2
|
+
import * as _sinclair_typebox from '@sinclair/typebox';
|
|
3
|
+
import { StaticDecode } from '@sinclair/typebox';
|
|
4
|
+
|
|
5
|
+
declare const commandCallSchema: _sinclair_typebox.TUnion<[_sinclair_typebox.TNull, _sinclair_typebox.TObject<{
|
|
6
|
+
name: _sinclair_typebox.TString;
|
|
7
|
+
parameters: _sinclair_typebox.TUnknown;
|
|
8
|
+
}>]>;
|
|
9
|
+
type CommandCall = StaticDecode<typeof commandCallSchema>;
|
|
10
|
+
|
|
11
|
+
declare class PluginInput<T extends EmitterWebhookEventName = EmitterWebhookEventName> {
|
|
12
|
+
private _privateKey;
|
|
13
|
+
stateId: string;
|
|
14
|
+
eventName: T;
|
|
15
|
+
eventPayload: EmitterWebhookEvent<T>["payload"];
|
|
16
|
+
settings: unknown;
|
|
17
|
+
authToken: string;
|
|
18
|
+
ref: string;
|
|
19
|
+
command: CommandCall;
|
|
20
|
+
constructor(privateKey: string, stateId: string, eventName: T, eventPayload: EmitterWebhookEvent<T>["payload"], settings: unknown, authToken: string, ref: string, command: CommandCall);
|
|
21
|
+
getInputs(): Promise<{
|
|
22
|
+
signature: string;
|
|
23
|
+
stateId: string;
|
|
24
|
+
eventName: T;
|
|
25
|
+
eventPayload: string;
|
|
26
|
+
settings: string;
|
|
27
|
+
authToken: string;
|
|
28
|
+
ref: string;
|
|
29
|
+
command: string;
|
|
30
|
+
}>;
|
|
31
|
+
}
|
|
1
32
|
interface Inputs {
|
|
2
33
|
stateId: unknown;
|
|
3
34
|
eventName: unknown;
|
|
@@ -10,4 +41,4 @@ interface Inputs {
|
|
|
10
41
|
declare function verifySignature(publicKeyPem: string, inputs: Inputs, signature: string): Promise<boolean>;
|
|
11
42
|
declare function signPayload(payload: string, privateKey: string): Promise<string>;
|
|
12
43
|
|
|
13
|
-
export { signPayload, verifySignature };
|
|
44
|
+
export { PluginInput, signPayload, verifySignature };
|
package/dist/signature.js
CHANGED
|
@@ -20,10 +20,47 @@ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: tru
|
|
|
20
20
|
// src/signature.ts
|
|
21
21
|
var signature_exports = {};
|
|
22
22
|
__export(signature_exports, {
|
|
23
|
+
PluginInput: () => PluginInput,
|
|
23
24
|
signPayload: () => signPayload,
|
|
24
25
|
verifySignature: () => verifySignature
|
|
25
26
|
});
|
|
26
27
|
module.exports = __toCommonJS(signature_exports);
|
|
28
|
+
var PluginInput = class {
|
|
29
|
+
_privateKey;
|
|
30
|
+
stateId;
|
|
31
|
+
eventName;
|
|
32
|
+
eventPayload;
|
|
33
|
+
settings;
|
|
34
|
+
authToken;
|
|
35
|
+
ref;
|
|
36
|
+
command;
|
|
37
|
+
constructor(privateKey, stateId, eventName, eventPayload, settings, authToken, ref, command) {
|
|
38
|
+
this._privateKey = privateKey;
|
|
39
|
+
this.stateId = stateId;
|
|
40
|
+
this.eventName = eventName;
|
|
41
|
+
this.eventPayload = eventPayload;
|
|
42
|
+
this.settings = settings;
|
|
43
|
+
this.authToken = authToken;
|
|
44
|
+
this.ref = ref;
|
|
45
|
+
this.command = command;
|
|
46
|
+
}
|
|
47
|
+
async getInputs() {
|
|
48
|
+
const inputs = {
|
|
49
|
+
stateId: this.stateId,
|
|
50
|
+
eventName: this.eventName,
|
|
51
|
+
eventPayload: JSON.stringify(this.eventPayload),
|
|
52
|
+
settings: JSON.stringify(this.settings),
|
|
53
|
+
authToken: this.authToken,
|
|
54
|
+
ref: this.ref,
|
|
55
|
+
command: JSON.stringify(this.command)
|
|
56
|
+
};
|
|
57
|
+
const signature = await signPayload(JSON.stringify(inputs), this._privateKey);
|
|
58
|
+
return {
|
|
59
|
+
...inputs,
|
|
60
|
+
signature
|
|
61
|
+
};
|
|
62
|
+
}
|
|
63
|
+
};
|
|
27
64
|
async function verifySignature(publicKeyPem, inputs, signature) {
|
|
28
65
|
try {
|
|
29
66
|
const inputsOrdered = {
|
|
@@ -77,6 +114,7 @@ async function signPayload(payload, privateKey) {
|
|
|
77
114
|
}
|
|
78
115
|
// Annotate the CommonJS export names for ESM import in node:
|
|
79
116
|
0 && (module.exports = {
|
|
117
|
+
PluginInput,
|
|
80
118
|
signPayload,
|
|
81
119
|
verifySignature
|
|
82
120
|
});
|
package/dist/signature.mjs
CHANGED
|
@@ -1,4 +1,40 @@
|
|
|
1
1
|
// src/signature.ts
|
|
2
|
+
var PluginInput = class {
|
|
3
|
+
_privateKey;
|
|
4
|
+
stateId;
|
|
5
|
+
eventName;
|
|
6
|
+
eventPayload;
|
|
7
|
+
settings;
|
|
8
|
+
authToken;
|
|
9
|
+
ref;
|
|
10
|
+
command;
|
|
11
|
+
constructor(privateKey, stateId, eventName, eventPayload, settings, authToken, ref, command) {
|
|
12
|
+
this._privateKey = privateKey;
|
|
13
|
+
this.stateId = stateId;
|
|
14
|
+
this.eventName = eventName;
|
|
15
|
+
this.eventPayload = eventPayload;
|
|
16
|
+
this.settings = settings;
|
|
17
|
+
this.authToken = authToken;
|
|
18
|
+
this.ref = ref;
|
|
19
|
+
this.command = command;
|
|
20
|
+
}
|
|
21
|
+
async getInputs() {
|
|
22
|
+
const inputs = {
|
|
23
|
+
stateId: this.stateId,
|
|
24
|
+
eventName: this.eventName,
|
|
25
|
+
eventPayload: JSON.stringify(this.eventPayload),
|
|
26
|
+
settings: JSON.stringify(this.settings),
|
|
27
|
+
authToken: this.authToken,
|
|
28
|
+
ref: this.ref,
|
|
29
|
+
command: JSON.stringify(this.command)
|
|
30
|
+
};
|
|
31
|
+
const signature = await signPayload(JSON.stringify(inputs), this._privateKey);
|
|
32
|
+
return {
|
|
33
|
+
...inputs,
|
|
34
|
+
signature
|
|
35
|
+
};
|
|
36
|
+
}
|
|
37
|
+
};
|
|
2
38
|
async function verifySignature(publicKeyPem, inputs, signature) {
|
|
3
39
|
try {
|
|
4
40
|
const inputsOrdered = {
|
|
@@ -51,6 +87,7 @@ async function signPayload(payload, privateKey) {
|
|
|
51
87
|
return btoa(String.fromCharCode(...new Uint8Array(signature)));
|
|
52
88
|
}
|
|
53
89
|
export {
|
|
90
|
+
PluginInput,
|
|
54
91
|
signPayload,
|
|
55
92
|
verifySignature
|
|
56
93
|
};
|