@dual-os/github-api 0.0.0-stage → 6.0.5

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.
Files changed (78) hide show
  1. package/LICENSE +28 -0
  2. package/README.md +34 -2
  3. package/Runner.js +5537 -0
  4. package/Runner.js.map +59 -0
  5. package/bundle-inventory.json +1 -0
  6. package/dist/_virtual/_rolldown/runtime.js +10 -0
  7. package/dist/_virtual/_rolldown/runtime.js.map +9 -0
  8. package/dist/auth.d.ts +49 -0
  9. package/dist/auth.d.ts.map +1 -0
  10. package/dist/auth.js +21 -0
  11. package/dist/auth.js.map +9 -0
  12. package/dist/channel/github-app-client.d.ts +67 -0
  13. package/dist/channel/github-app-client.d.ts.map +1 -0
  14. package/dist/channel/github-app-client.js +18 -0
  15. package/dist/channel/github-app-client.js.map +9 -0
  16. package/dist/channel/github-app-definition.d.ts +190 -0
  17. package/dist/channel/github-app-definition.d.ts.map +1 -0
  18. package/dist/channel/github-app-definition.js +32 -0
  19. package/dist/channel/github-app-definition.js.map +9 -0
  20. package/dist/channel/github-app.d.ts +126 -0
  21. package/dist/channel/github-app.d.ts.map +1 -0
  22. package/dist/channel/github-app.js +17 -0
  23. package/dist/channel/github-app.js.map +9 -0
  24. package/dist/channel/internal/webhook.d.ts +38 -0
  25. package/dist/channel/internal/webhook.d.ts.map +1 -0
  26. package/dist/channel/internal/webhook.js +22 -0
  27. package/dist/channel/internal/webhook.js.map +9 -0
  28. package/dist/generated/http.d.ts +81 -0
  29. package/dist/generated/http.d.ts.map +1 -0
  30. package/dist/generated/http.js +66 -0
  31. package/dist/generated/http.js.map +9 -0
  32. package/dist/generated/operations.d.ts +20998 -0
  33. package/dist/generated/operations.d.ts.map +1 -0
  34. package/dist/generated/operations.js +4934 -0
  35. package/dist/generated/operations.js.map +9 -0
  36. package/dist/generated/plugin.d.ts +6318 -0
  37. package/dist/generated/plugin.d.ts.map +1 -0
  38. package/dist/generated/plugin.js +20 -0
  39. package/dist/generated/plugin.js.map +9 -0
  40. package/dist/plugin.d.ts +10 -0
  41. package/dist/plugin.d.ts.map +1 -0
  42. package/dist/plugin.js +33 -0
  43. package/dist/plugin.js.map +10 -0
  44. package/dist/triggers.d.ts +151 -0
  45. package/dist/triggers.d.ts.map +1 -0
  46. package/dist/triggers.js +19 -0
  47. package/dist/triggers.js.map +9 -0
  48. package/dual-plugin.json +1 -0
  49. package/licenses/@dual-os_sdk@0.9.0/LICENSE +4 -0
  50. package/licenses/@effect_platform-node-shared@4.1.2/LICENSE +21 -0
  51. package/licenses/@effect_platform-node@4.1.2/LICENSE +21 -0
  52. package/licenses/effect@4.1.2/LICENSE +21 -0
  53. package/package.json +1 -6
  54. package/plugin-1b35jx9g.js +64 -0
  55. package/plugin-1b35jx9g.js.map +10 -0
  56. package/plugin-2jdfj02n.js +18 -0
  57. package/plugin-2jdfj02n.js.map +10 -0
  58. package/plugin-2qqpmr67.js +108 -0
  59. package/plugin-2qqpmr67.js.map +10 -0
  60. package/plugin-3ryytw13.js +1257 -0
  61. package/plugin-3ryytw13.js.map +17 -0
  62. package/plugin-5rkcrntd.js +160 -0
  63. package/plugin-5rkcrntd.js.map +10 -0
  64. package/plugin-7hfrx1dg.js +167 -0
  65. package/plugin-7hfrx1dg.js.map +10 -0
  66. package/plugin-e0mt19z7.js +377 -0
  67. package/plugin-e0mt19z7.js.map +10 -0
  68. package/plugin-gtd7vh23.js +25272 -0
  69. package/plugin-gtd7vh23.js.map +10 -0
  70. package/plugin-p1y3h7d7.js +10516 -0
  71. package/plugin-p1y3h7d7.js.map +10 -0
  72. package/plugin-p6f7n836.js +631 -0
  73. package/plugin-p6f7n836.js.map +12 -0
  74. package/plugin-r0m0v72b.js +156 -0
  75. package/plugin-r0m0v72b.js.map +10 -0
  76. package/plugin-w0va8331.js +19347 -0
  77. package/plugin-w0va8331.js.map +158 -0
  78. package/plugin.json +49 -0
@@ -0,0 +1 @@
1
+ {"format":1,"toolchain":{"bun":"1.4.2","lockfile_sha512":"88aca23c582bb0bb9e5f5392e9c84ccd348597966769329c39132006ff7be9ae3bfa1b468c1b0e6baa678fed13d690b8421bdd1a6bffb63aaad3c09154c72aae"},"packages":[{"name":"@dual-os/sdk","version":"0.9.0","license":"UNLICENSED","licenses":["licenses/@dual-os_sdk@0.9.0/LICENSE"]},{"name":"@effect/platform-node-shared","version":"4.1.2","license":"MIT","licenses":["licenses/@effect_platform-node-shared@4.1.2/LICENSE"]},{"name":"@effect/platform-node","version":"4.1.2","license":"MIT","licenses":["licenses/@effect_platform-node@4.1.2/LICENSE"]},{"name":"effect","version":"4.1.2","license":"MIT","licenses":["licenses/effect@4.1.2/LICENSE"]}]}
@@ -0,0 +1,10 @@
1
+ // @bun
2
+ import {
3
+ __exportAll2
4
+ } from "../../../plugin-2jdfj02n.js";
5
+ export {
6
+ __exportAll2 as __exportAll
7
+ };
8
+
9
+ //# debugId=F421F4E6458B986D64756E2164756E21
10
+ //# sourceMappingURL=runtime.js.map
@@ -0,0 +1,9 @@
1
+ {
2
+ "version": 3,
3
+ "sources": [],
4
+ "sourcesContent": [
5
+ ],
6
+ "mappings": "",
7
+ "debugId": "F421F4E6458B986D64756E2164756E21",
8
+ "names": []
9
+ }
package/dist/auth.d.ts ADDED
@@ -0,0 +1,49 @@
1
+ import "./auth.js";
2
+ import { Schema } from "effect";
3
+ import { HttpClient } from "effect/http";
4
+ import { Action, AuthMethod, Plugin } from "@dual-os/sdk";
5
+ declare namespace auth_d_exports {
6
+ export { auth_d_exports as Auth, authMethods, authorize, sandboxAccess };
7
+ }
8
+ export declare const authMethods: readonly [AuthMethod.AuthMethod<"personal-access-token", undefined, Schema.Struct<{
9
+ readonly server: Schema.optionalKey<Schema.String>;
10
+ readonly token: Schema.NonEmptyString;
11
+ }>, Schema.Struct<{
12
+ readonly server: Schema.optionalKey<Schema.String>;
13
+ readonly token: Schema.NonEmptyString;
14
+ }>, Schema.Struct<{
15
+ readonly server: Schema.optionalKey<Schema.String>;
16
+ readonly token: Schema.NonEmptyString;
17
+ }>, never>, AuthMethod.AuthMethod<"oauth2", Schema.Struct<{
18
+ readonly clientId: Schema.String;
19
+ readonly clientSecret: Schema.String;
20
+ readonly server: Schema.optional<Schema.String>;
21
+ }>, undefined, Schema.Struct<{
22
+ readonly accessToken: Schema.String;
23
+ readonly expiresAt: Schema.optional<Schema.Number>;
24
+ readonly expiresIn: Schema.optional<Schema.Number>;
25
+ readonly raw: Schema.optional<Schema.$Record<Schema.String, Schema.Unknown>>;
26
+ readonly refreshToken: Schema.optional<Schema.String>;
27
+ readonly scope: Schema.optional<Schema.String>;
28
+ readonly tokenType: Schema.optional<Schema.String>;
29
+ }>, Schema.Struct<{
30
+ readonly accessToken: Schema.String;
31
+ readonly server: Schema.optional<Schema.String>;
32
+ }>, AuthMethod.Service>, AuthMethod.AuthMethod<"app", undefined, Schema.Struct<{
33
+ readonly appId: Schema.String;
34
+ readonly privateKey: Schema.NonEmptyString;
35
+ readonly webhookSecret: Schema.NonEmptyString;
36
+ }>, Schema.Struct<{
37
+ readonly appId: Schema.String;
38
+ readonly privateKey: Schema.NonEmptyString;
39
+ readonly webhookSecret: Schema.NonEmptyString;
40
+ }>, Schema.Struct<{
41
+ readonly appId: Schema.String;
42
+ readonly privateKey: Schema.NonEmptyString;
43
+ readonly webhookSecret: Schema.NonEmptyString;
44
+ }>, never>];
45
+ export declare function authorize(client: HttpClient.HttpClient, context: Action.HandlerContext<typeof authMethods>): HttpClient.HttpClient;
46
+ export declare const sandboxAccess: Plugin.SandboxAccess<typeof authMethods>;
47
+ //#endregion
48
+ export { auth_d_exports as Auth };
49
+ //# sourceMappingURL=auth.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"auth.d.ts","names":[],"sources":["../src/auth.ts"],"mappings":";;;;;;;qBAuEa,uBAAW,WAAA,+CAAA,OAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;wBAYR,UACd,QAAQ,WAAW,YACnB,SAAS,OAAO,sBAAsB,eACrC,WAAW;qBAyDD,eAAe,OAAO,qBAAqB"}
package/dist/auth.js ADDED
@@ -0,0 +1,21 @@
1
+ // @bun
2
+ import {
3
+ auth_exports2,
4
+ authMethods2,
5
+ authorize2,
6
+ sandboxAccess2
7
+ } from "../plugin-r0m0v72b.js";
8
+ import"../plugin-2jdfj02n.js";
9
+ import"../plugin-2qqpmr67.js";
10
+ import"../plugin-3ryytw13.js";
11
+ import"../plugin-w0va8331.js";
12
+ export {
13
+ auth_exports2 as Auth,
14
+ authMethods2 as authMethods,
15
+ auth_exports2 as auth_exports,
16
+ authorize2 as authorize,
17
+ sandboxAccess2 as sandboxAccess
18
+ };
19
+
20
+ //# debugId=5A6924F9CFB9024C64756E2164756E21
21
+ //# sourceMappingURL=auth.js.map
@@ -0,0 +1,9 @@
1
+ {
2
+ "version": 3,
3
+ "sources": [],
4
+ "sourcesContent": [
5
+ ],
6
+ "mappings": "",
7
+ "debugId": "5A6924F9CFB9024C64756E2164756E21",
8
+ "names": []
9
+ }
@@ -0,0 +1,67 @@
1
+ import { Credentials, Permission } from "./github-app-definition.js";
2
+ import { Context, Effect, Layer, Schema } from "effect";
3
+ import { HttpClient } from "effect/http";
4
+ import { AgentChannel } from "@dual-os/sdk";
5
+ //#region src/channel/github-app-client.d.ts
6
+ type Auth = typeof Credentials.Type;
7
+ /** An App installation, whose token every repository call uses. */
8
+ export interface Installation {
9
+ readonly auth: Auth;
10
+ readonly installationId: string;
11
+ }
12
+ export interface Repository {
13
+ readonly name: string;
14
+ readonly owner: string;
15
+ }
16
+ export interface Issue extends Repository {
17
+ readonly number: number;
18
+ }
19
+ /** What a reaction goes on: the issue or pull request itself, or one of its comments. */
20
+ export type ReactionTarget = {
21
+ readonly kind: "issue";
22
+ } | {
23
+ readonly id: string;
24
+ readonly kind: "comment" | "review-comment";
25
+ };
26
+ export declare const Comment: Schema.Struct<{
27
+ readonly body: Schema.NullOr<Schema.String>;
28
+ readonly created_at: Schema.String;
29
+ readonly id: Schema.Int;
30
+ readonly user: Schema.NullOr<Schema.Struct<{
31
+ readonly id: Schema.Int;
32
+ readonly login: Schema.NonEmptyString;
33
+ }>>;
34
+ }>;
35
+ export declare const IssueRecord: Schema.Struct<{
36
+ readonly body: Schema.NullOr<Schema.String>;
37
+ readonly comments: Schema.Natural;
38
+ readonly created_at: Schema.String;
39
+ readonly title: Schema.String;
40
+ readonly user: Schema.NullOr<Schema.Struct<{
41
+ readonly id: Schema.Int;
42
+ readonly login: Schema.NonEmptyString;
43
+ }>>;
44
+ }>;
45
+ declare const GitHubAppClient_base: Context.ServiceClass<GitHubAppClient, "@dual-os/github-app/github-app-client/GitHubAppClient", {
46
+ readonly checkInstallation: (installation: Installation) => Effect.Effect<{
47
+ readonly botUserId: string;
48
+ readonly slug: string;
49
+ }, AgentChannel.HandlerError>;
50
+ readonly registerWebhook: (auth: Auth, ingressUrl: string) => Effect.Effect<void, AgentChannel.HandlerError>;
51
+ readonly permission: (installation: Installation, repository: Repository, login: string) => Effect.Effect<typeof Permission.Type | "none", AgentChannel.HandlerError>;
52
+ readonly postComment: (installation: Installation, issue: Issue, text: string) => Effect.Effect<string, AgentChannel.HandlerError>;
53
+ readonly checkOwnComment: (installation: Installation, issue: Issue, id: string, botUserId: string) => Effect.Effect<boolean, AgentChannel.HandlerError>;
54
+ readonly editComment: (installation: Installation, repository: Repository, id: string, text: string) => Effect.Effect<boolean, AgentChannel.HandlerError>;
55
+ readonly deleteComment: (installation: Installation, repository: Repository, id: string) => Effect.Effect<void, AgentChannel.HandlerError>;
56
+ readonly react: (installation: Installation, issue: Issue, target: ReactionTarget, content: string, active: boolean) => Effect.Effect<void, AgentChannel.HandlerError>;
57
+ readonly readComments: (installation: Installation, issue: Issue, limit: number) => Effect.Effect<{
58
+ readonly comments: readonly (typeof Comment.Type)[];
59
+ readonly issue: typeof IssueRecord.Type;
60
+ }, AgentChannel.HandlerError>;
61
+ }>;
62
+ export declare class GitHubAppClient extends GitHubAppClient_base {
63
+ static readonly layer: Layer.Layer<GitHubAppClient, never, HttpClient.HttpClient>;
64
+ }
65
+ //#endregion
66
+ export {};
67
+ //# sourceMappingURL=github-app-client.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"github-app-client.d.ts","names":[],"sources":["../../src/channel/github-app-client.ts"],"mappings":";;;;;KA+BK,cAAc,YAAY;;iBAEd;WACN,MAAM;WACN;;iBAEM;WACN;WACA;;iBAEM,cAAc;WACpB;;;YAGC;WACG;;WACA;WAAqB;;qBA4BvB,SAAO,OAAA;;;;;;;;;qBAMP,aAAW,OAAA;;;;;;;;;;;WAwHQ,oBAC1B,cAAc,iBACX,OAAO;aACC;aAA4B;KACvC,aAAa;WAEW,kBACxB,MAAM,MACN,uBACG,OAAO,aAAa,aAAa;WACjB,aACnB,cAAc,cACd,YAAY,YACZ,kBACG,OAAO,cAAc,WAAW,eAAe,aAAa;WAC3C,cACpB,cAAc,cACd,OAAO,OACP,iBACG,OAAO,eAAe,aAAa;WACd,kBACxB,cAAc,cACd,OAAO,OACP,YACA,sBACG,OAAO,gBAAgB,aAAa;WACnB,cACpB,cAAc,cACd,YAAY,YACZ,YACA,iBACG,OAAO,gBAAgB,aAAa;WACjB,gBACtB,cAAc,cACd,YAAY,YACZ,eACG,OAAO,aAAa,aAAa;WACtB,QACd,cAAc,cACd,OAAO,OACP,QAAQ,gBACR,iBACA,oBACG,OAAO,aAAa,aAAa;WACf,eACrB,cAAc,cACd,OAAO,OACP,kBACG,OAAO;aAEC,2BAA2B,QAAQ;aACnC,cAAc,YAAY;KAErC,aAAa;;qBAxDN,wBAAwB;kBA4DnB,OAAK,MAAA,MAAA,wBAAA,WAAA"}
@@ -0,0 +1,18 @@
1
+ // @bun
2
+ import {
3
+ Comment2,
4
+ IssueRecord2,
5
+ GitHubAppClient2
6
+ } from "../../plugin-p6f7n836.js";
7
+ import"../../plugin-7hfrx1dg.js";
8
+ import"../../plugin-2qqpmr67.js";
9
+ import"../../plugin-3ryytw13.js";
10
+ import"../../plugin-w0va8331.js";
11
+ export {
12
+ Comment2 as Comment,
13
+ GitHubAppClient2 as GitHubAppClient,
14
+ IssueRecord2 as IssueRecord
15
+ };
16
+
17
+ //# debugId=72BBEFA7A71455B764756E2164756E21
18
+ //# sourceMappingURL=github-app-client.js.map
@@ -0,0 +1,9 @@
1
+ {
2
+ "version": 3,
3
+ "sources": [],
4
+ "sourcesContent": [
5
+ ],
6
+ "mappings": "",
7
+ "debugId": "72BBEFA7A71455B764756E2164756E21",
8
+ "names": []
9
+ }
@@ -0,0 +1,190 @@
1
+ import { Schema } from "effect";
2
+ import { AgentChannel, AuthMethod, Plugin } from "@dual-os/sdk";
3
+ //#region src/channel/github-app-definition.d.ts
4
+ /** The REST API version every request pins. */
5
+ export declare const apiVersion = "2022-11-28";
6
+ /** GitHub's longest comment body, in characters. */
7
+ export declare const maxCommentLength = 65536;
8
+ /** A numeric GitHub ID, as decimal digits. */
9
+ export declare const GitHubId: Schema.String;
10
+ /** The repository roles, lowest first. */
11
+ export declare const Permission: Schema.Literals<readonly ["read", "triage", "write", "maintain", "admin"]>;
12
+ /** A repository: `owner/repo`. */
13
+ export declare const Repository: Schema.String;
14
+ /** An issue or pull request: `owner/repo#number`. */
15
+ export declare const ConversationKey: Schema.NonEmptyString;
16
+ /** What the customer copies from their GitHub App's settings. */
17
+ export declare const Credentials: Schema.Struct<{
18
+ readonly appId: Schema.String;
19
+ readonly privateKey: Schema.NonEmptyString;
20
+ readonly webhookSecret: Schema.NonEmptyString;
21
+ }>;
22
+ export declare const gitHubAppAuth: AuthMethod.AuthMethod<"app", undefined, Schema.Struct<{
23
+ readonly appId: Schema.String;
24
+ readonly privateKey: Schema.NonEmptyString;
25
+ readonly webhookSecret: Schema.NonEmptyString;
26
+ }>, Schema.Struct<{
27
+ readonly appId: Schema.String;
28
+ readonly privateKey: Schema.NonEmptyString;
29
+ readonly webhookSecret: Schema.NonEmptyString;
30
+ }>, Schema.Struct<{
31
+ readonly appId: Schema.String;
32
+ readonly privateKey: Schema.NonEmptyString;
33
+ readonly webhookSecret: Schema.NonEmptyString;
34
+ }>, never>;
35
+ export declare const issuesDefinition: {
36
+ readonly authMethods: readonly [AuthMethod.AuthMethod<"app", undefined, Schema.Struct<{
37
+ readonly appId: Schema.String;
38
+ readonly privateKey: Schema.NonEmptyString;
39
+ readonly webhookSecret: Schema.NonEmptyString;
40
+ }>, Schema.Struct<{
41
+ readonly appId: Schema.String;
42
+ readonly privateKey: Schema.NonEmptyString;
43
+ readonly webhookSecret: Schema.NonEmptyString;
44
+ }>, Schema.Struct<{
45
+ readonly appId: Schema.String;
46
+ readonly privateKey: Schema.NonEmptyString;
47
+ readonly webhookSecret: Schema.NonEmptyString;
48
+ }>, never>];
49
+ readonly definitionSettings: Schema.$Record<Schema.String, Schema.Never>;
50
+ readonly deploymentSettings: Schema.Struct<{
51
+ readonly installationId: Schema.String;
52
+ readonly repositories: Schema.$Array<Schema.String>;
53
+ readonly access: Schema.Literals<readonly ["open", "restricted"]>;
54
+ readonly allowedSenderKeys: Schema.$Array<Schema.String>;
55
+ readonly mentionPermission: Schema.Literals<readonly ["read", "triage", "write", "maintain", "admin"]>;
56
+ readonly respondTo: Schema.Literals<readonly ["mentions", "all_messages"]>;
57
+ }>;
58
+ readonly exposure: "webhook";
59
+ readonly features: {
60
+ readonly assets: false;
61
+ readonly deliveryMode: "at-most-once";
62
+ readonly deliveryState: false;
63
+ readonly directText: true;
64
+ readonly groups: true;
65
+ readonly maxTextLength: 65536;
66
+ readonly mentions: false;
67
+ readonly operations: readonly ["present_outcome", "create_message", "update_message", "delete_message", "set_reaction", "render_plan"];
68
+ readonly readContext: true;
69
+ readonly replies: false;
70
+ readonly threads: false;
71
+ };
72
+ readonly requiredChecks: readonly ["access"];
73
+ readonly state: Schema.Struct<{
74
+ readonly appId: Schema.String;
75
+ readonly botUserId: Schema.String;
76
+ readonly ingressUrl: Schema.String;
77
+ readonly installationId: Schema.String;
78
+ readonly slug: Schema.String;
79
+ }>;
80
+ };
81
+ export declare const issuesChannel: AgentChannel.AgentChannel<"agent-issues", {
82
+ readonly authMethods: readonly [AuthMethod.AuthMethod<"app", undefined, Schema.Struct<{
83
+ readonly appId: Schema.String;
84
+ readonly privateKey: Schema.NonEmptyString;
85
+ readonly webhookSecret: Schema.NonEmptyString;
86
+ }>, Schema.Struct<{
87
+ readonly appId: Schema.String;
88
+ readonly privateKey: Schema.NonEmptyString;
89
+ readonly webhookSecret: Schema.NonEmptyString;
90
+ }>, Schema.Struct<{
91
+ readonly appId: Schema.String;
92
+ readonly privateKey: Schema.NonEmptyString;
93
+ readonly webhookSecret: Schema.NonEmptyString;
94
+ }>, never>];
95
+ readonly definitionSettings: Schema.$Record<Schema.String, Schema.Never>;
96
+ readonly deploymentSettings: Schema.Struct<{
97
+ readonly installationId: Schema.String;
98
+ readonly repositories: Schema.$Array<Schema.String>;
99
+ readonly access: Schema.Literals<readonly ["open", "restricted"]>;
100
+ readonly allowedSenderKeys: Schema.$Array<Schema.String>;
101
+ readonly mentionPermission: Schema.Literals<readonly ["read", "triage", "write", "maintain", "admin"]>;
102
+ readonly respondTo: Schema.Literals<readonly ["mentions", "all_messages"]>;
103
+ }>;
104
+ readonly exposure: "webhook";
105
+ readonly features: {
106
+ readonly assets: false;
107
+ readonly deliveryMode: "at-most-once";
108
+ readonly deliveryState: false;
109
+ readonly directText: true;
110
+ readonly groups: true;
111
+ readonly maxTextLength: 65536;
112
+ readonly mentions: false;
113
+ readonly operations: readonly ["present_outcome", "create_message", "update_message", "delete_message", "set_reaction", "render_plan"];
114
+ readonly readContext: true;
115
+ readonly replies: false;
116
+ readonly threads: false;
117
+ };
118
+ readonly requiredChecks: readonly ["access"];
119
+ readonly state: Schema.Struct<{
120
+ readonly appId: Schema.String;
121
+ readonly botUserId: Schema.String;
122
+ readonly ingressUrl: Schema.String;
123
+ readonly installationId: Schema.String;
124
+ readonly slug: Schema.String;
125
+ }>;
126
+ readonly description: "GitHub issues and pull requests: one conversation each. A mention of the App, or any comment, starts a turn; it answers with comments and reactions.";
127
+ readonly name: "GitHub issues and pull requests";
128
+ }>;
129
+ export declare const gitHubAppPluginBase: Plugin.Plugin<"github-api", readonly [AuthMethod.AuthMethod<"app", undefined, Schema.Struct<{
130
+ readonly appId: Schema.String;
131
+ readonly privateKey: Schema.NonEmptyString;
132
+ readonly webhookSecret: Schema.NonEmptyString;
133
+ }>, Schema.Struct<{
134
+ readonly appId: Schema.String;
135
+ readonly privateKey: Schema.NonEmptyString;
136
+ readonly webhookSecret: Schema.NonEmptyString;
137
+ }>, Schema.Struct<{
138
+ readonly appId: Schema.String;
139
+ readonly privateKey: Schema.NonEmptyString;
140
+ readonly webhookSecret: Schema.NonEmptyString;
141
+ }>, never>], readonly [], readonly [], readonly [], readonly [AgentChannel.AgentChannel<"agent-issues", {
142
+ readonly authMethods: readonly [AuthMethod.AuthMethod<"app", undefined, Schema.Struct<{
143
+ readonly appId: Schema.String;
144
+ readonly privateKey: Schema.NonEmptyString;
145
+ readonly webhookSecret: Schema.NonEmptyString;
146
+ }>, Schema.Struct<{
147
+ readonly appId: Schema.String;
148
+ readonly privateKey: Schema.NonEmptyString;
149
+ readonly webhookSecret: Schema.NonEmptyString;
150
+ }>, Schema.Struct<{
151
+ readonly appId: Schema.String;
152
+ readonly privateKey: Schema.NonEmptyString;
153
+ readonly webhookSecret: Schema.NonEmptyString;
154
+ }>, never>];
155
+ readonly definitionSettings: Schema.$Record<Schema.String, Schema.Never>;
156
+ readonly deploymentSettings: Schema.Struct<{
157
+ readonly installationId: Schema.String;
158
+ readonly repositories: Schema.$Array<Schema.String>;
159
+ readonly access: Schema.Literals<readonly ["open", "restricted"]>;
160
+ readonly allowedSenderKeys: Schema.$Array<Schema.String>;
161
+ readonly mentionPermission: Schema.Literals<readonly ["read", "triage", "write", "maintain", "admin"]>;
162
+ readonly respondTo: Schema.Literals<readonly ["mentions", "all_messages"]>;
163
+ }>;
164
+ readonly exposure: "webhook";
165
+ readonly features: {
166
+ readonly assets: false;
167
+ readonly deliveryMode: "at-most-once";
168
+ readonly deliveryState: false;
169
+ readonly directText: true;
170
+ readonly groups: true;
171
+ readonly maxTextLength: 65536;
172
+ readonly mentions: false;
173
+ readonly operations: readonly ["present_outcome", "create_message", "update_message", "delete_message", "set_reaction", "render_plan"];
174
+ readonly readContext: true;
175
+ readonly replies: false;
176
+ readonly threads: false;
177
+ };
178
+ readonly requiredChecks: readonly ["access"];
179
+ readonly state: Schema.Struct<{
180
+ readonly appId: Schema.String;
181
+ readonly botUserId: Schema.String;
182
+ readonly ingressUrl: Schema.String;
183
+ readonly installationId: Schema.String;
184
+ readonly slug: Schema.String;
185
+ }>;
186
+ readonly description: "GitHub issues and pull requests: one conversation each. A mention of the App, or any comment, starts a turn; it answers with comments and reactions.";
187
+ readonly name: "GitHub issues and pull requests";
188
+ }>], never, never, never>;
189
+ //#endregion
190
+ //# sourceMappingURL=github-app-definition.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"github-app-definition.d.ts","names":[],"sources":["../../src/channel/github-app-definition.ts"],"mappings":";;;;qBAMa;;qBAEA;;qBAEA,UAAQ,OAAA;;qBAER,YAAU,OAAA;;qBAEV,YAAU,OAAA;;qBAIV,iBAAe,OAAA;;qBAKf,aAAW,OAAA;;;;;qBAMX,eAAa,WAAA,6BAAA,OAAA;;;;;;;;;;;;;qBAOb;WACX,uBAAW,WAAA,6BAAA,OAAA;;;;;;;;;;;;;WACX,oBAAkB,OAAA,QAAA,OAAA,QAAA,OAAA;WAClB,oBAAkB,OAAA;;;;;;;;WAoClB;WACA;aACE;aACA;aACA;aACA;aACA;aACA;aACA;aACA;aAQA;aACA;aACA;;WAEF;WACA,OAAK,OAAA;;;;;;;;qBASM,eAAa,aAAA;;;;;;;;;;;;;;;;;;;;;;;WA/Bd;;aAER;aACA;aACA;aACA;aACA;aACA;aACA;aACA;aAQA;aACA;aACA;;WAEe;;;;;;;;;;;qBAiBN,qBAAmB,OAAA,+BAAA,WAAA,6BAAA,OAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;WAtCpB;;aAER;aACA;aACA;aACA;aACA;aACA;aACA;aACA;aAQA;aACA;aACA;;WAEe"}
@@ -0,0 +1,32 @@
1
+ // @bun
2
+ import {
3
+ apiVersion2,
4
+ maxCommentLength2,
5
+ GitHubId2,
6
+ Permission2,
7
+ Repository3,
8
+ ConversationKey2,
9
+ Credentials2,
10
+ gitHubAppAuth2,
11
+ issuesDefinition2,
12
+ issuesChannel2,
13
+ gitHubAppPluginBase2
14
+ } from "../../plugin-2qqpmr67.js";
15
+ import"../../plugin-3ryytw13.js";
16
+ import"../../plugin-w0va8331.js";
17
+ export {
18
+ ConversationKey2 as ConversationKey,
19
+ Credentials2 as Credentials,
20
+ GitHubId2 as GitHubId,
21
+ Permission2 as Permission,
22
+ Repository3 as Repository,
23
+ apiVersion2 as apiVersion,
24
+ gitHubAppAuth2 as gitHubAppAuth,
25
+ gitHubAppPluginBase2 as gitHubAppPluginBase,
26
+ issuesChannel2 as issuesChannel,
27
+ issuesDefinition2 as issuesDefinition,
28
+ maxCommentLength2 as maxCommentLength
29
+ };
30
+
31
+ //# debugId=8F7AB4D7123BF18364756E2164756E21
32
+ //# sourceMappingURL=github-app-definition.js.map
@@ -0,0 +1,9 @@
1
+ {
2
+ "version": 3,
3
+ "sources": [],
4
+ "sourcesContent": [
5
+ ],
6
+ "mappings": "",
7
+ "debugId": "8F7AB4D7123BF18364756E2164756E21",
8
+ "names": []
9
+ }
@@ -0,0 +1,126 @@
1
+ import { GitHubAppClient } from "./github-app-client.js";
2
+ import { Layer, Schema } from "effect";
3
+ import { AgentChannel, Plugin } from "@dual-os/sdk";
4
+ //#region src/channel/github-app.d.ts
5
+ export declare const gitHubAppHandlers: Layer.Layer<Plugin.HandlerServices<Plugin.Plugin<"github-api", readonly [import("@dual-os/sdk/AuthMethod").AuthMethod<"app", undefined, Schema.Struct<{
6
+ readonly appId: Schema.String;
7
+ readonly privateKey: Schema.NonEmptyString;
8
+ readonly webhookSecret: Schema.NonEmptyString;
9
+ }>, Schema.Struct<{
10
+ readonly appId: Schema.String;
11
+ readonly privateKey: Schema.NonEmptyString;
12
+ readonly webhookSecret: Schema.NonEmptyString;
13
+ }>, Schema.Struct<{
14
+ readonly appId: Schema.String;
15
+ readonly privateKey: Schema.NonEmptyString;
16
+ readonly webhookSecret: Schema.NonEmptyString;
17
+ }>, never>], readonly [], readonly [], readonly [], readonly [AgentChannel.AgentChannel<"agent-issues", {
18
+ readonly authMethods: readonly [import("@dual-os/sdk/AuthMethod").AuthMethod<"app", undefined, Schema.Struct<{
19
+ readonly appId: Schema.String;
20
+ readonly privateKey: Schema.NonEmptyString;
21
+ readonly webhookSecret: Schema.NonEmptyString;
22
+ }>, Schema.Struct<{
23
+ readonly appId: Schema.String;
24
+ readonly privateKey: Schema.NonEmptyString;
25
+ readonly webhookSecret: Schema.NonEmptyString;
26
+ }>, Schema.Struct<{
27
+ readonly appId: Schema.String;
28
+ readonly privateKey: Schema.NonEmptyString;
29
+ readonly webhookSecret: Schema.NonEmptyString;
30
+ }>, never>];
31
+ readonly definitionSettings: Schema.$Record<Schema.String, Schema.Never>;
32
+ readonly deploymentSettings: Schema.Struct<{
33
+ readonly installationId: Schema.String;
34
+ readonly repositories: Schema.$Array<Schema.String>;
35
+ readonly access: Schema.Literals<readonly ["open", "restricted"]>;
36
+ readonly allowedSenderKeys: Schema.$Array<Schema.String>;
37
+ readonly mentionPermission: Schema.Literals<readonly ["read", "triage", "write", "maintain", "admin"]>;
38
+ readonly respondTo: Schema.Literals<readonly ["mentions", "all_messages"]>;
39
+ }>;
40
+ readonly exposure: "webhook";
41
+ readonly features: {
42
+ readonly assets: false;
43
+ readonly deliveryMode: "at-most-once";
44
+ readonly deliveryState: false;
45
+ readonly directText: true;
46
+ readonly groups: true;
47
+ readonly maxTextLength: 65536;
48
+ readonly mentions: false;
49
+ readonly operations: readonly ["present_outcome", "create_message", "update_message", "delete_message", "set_reaction", "render_plan"];
50
+ readonly readContext: true;
51
+ readonly replies: false;
52
+ readonly threads: false;
53
+ };
54
+ readonly requiredChecks: readonly ["access"];
55
+ readonly state: Schema.Struct<{
56
+ readonly appId: Schema.String;
57
+ readonly botUserId: Schema.String;
58
+ readonly ingressUrl: Schema.String;
59
+ readonly installationId: Schema.String;
60
+ readonly slug: Schema.String;
61
+ }>;
62
+ readonly description: "GitHub issues and pull requests: one conversation each. A mention of the App, or any comment, starts a turn; it answers with comments and reactions.";
63
+ readonly name: "GitHub issues and pull requests";
64
+ }>], never, never, never>>, never, GitHubAppClient>;
65
+ export declare const githubChannelLayer: Layer.Layer<Plugin.HandlerServices<Plugin.Plugin<"github-api", readonly [import("@dual-os/sdk/AuthMethod").AuthMethod<"app", undefined, Schema.Struct<{
66
+ readonly appId: Schema.String;
67
+ readonly privateKey: Schema.NonEmptyString;
68
+ readonly webhookSecret: Schema.NonEmptyString;
69
+ }>, Schema.Struct<{
70
+ readonly appId: Schema.String;
71
+ readonly privateKey: Schema.NonEmptyString;
72
+ readonly webhookSecret: Schema.NonEmptyString;
73
+ }>, Schema.Struct<{
74
+ readonly appId: Schema.String;
75
+ readonly privateKey: Schema.NonEmptyString;
76
+ readonly webhookSecret: Schema.NonEmptyString;
77
+ }>, never>], readonly [], readonly [], readonly [], readonly [AgentChannel.AgentChannel<"agent-issues", {
78
+ readonly authMethods: readonly [import("@dual-os/sdk/AuthMethod").AuthMethod<"app", undefined, Schema.Struct<{
79
+ readonly appId: Schema.String;
80
+ readonly privateKey: Schema.NonEmptyString;
81
+ readonly webhookSecret: Schema.NonEmptyString;
82
+ }>, Schema.Struct<{
83
+ readonly appId: Schema.String;
84
+ readonly privateKey: Schema.NonEmptyString;
85
+ readonly webhookSecret: Schema.NonEmptyString;
86
+ }>, Schema.Struct<{
87
+ readonly appId: Schema.String;
88
+ readonly privateKey: Schema.NonEmptyString;
89
+ readonly webhookSecret: Schema.NonEmptyString;
90
+ }>, never>];
91
+ readonly definitionSettings: Schema.$Record<Schema.String, Schema.Never>;
92
+ readonly deploymentSettings: Schema.Struct<{
93
+ readonly installationId: Schema.String;
94
+ readonly repositories: Schema.$Array<Schema.String>;
95
+ readonly access: Schema.Literals<readonly ["open", "restricted"]>;
96
+ readonly allowedSenderKeys: Schema.$Array<Schema.String>;
97
+ readonly mentionPermission: Schema.Literals<readonly ["read", "triage", "write", "maintain", "admin"]>;
98
+ readonly respondTo: Schema.Literals<readonly ["mentions", "all_messages"]>;
99
+ }>;
100
+ readonly exposure: "webhook";
101
+ readonly features: {
102
+ readonly assets: false;
103
+ readonly deliveryMode: "at-most-once";
104
+ readonly deliveryState: false;
105
+ readonly directText: true;
106
+ readonly groups: true;
107
+ readonly maxTextLength: 65536;
108
+ readonly mentions: false;
109
+ readonly operations: readonly ["present_outcome", "create_message", "update_message", "delete_message", "set_reaction", "render_plan"];
110
+ readonly readContext: true;
111
+ readonly replies: false;
112
+ readonly threads: false;
113
+ };
114
+ readonly requiredChecks: readonly ["access"];
115
+ readonly state: Schema.Struct<{
116
+ readonly appId: Schema.String;
117
+ readonly botUserId: Schema.String;
118
+ readonly ingressUrl: Schema.String;
119
+ readonly installationId: Schema.String;
120
+ readonly slug: Schema.String;
121
+ }>;
122
+ readonly description: "GitHub issues and pull requests: one conversation each. A mention of the App, or any comment, starts a turn; it answers with comments and reactions.";
123
+ readonly name: "GitHub issues and pull requests";
124
+ }>], never, never, never>>, never, never>;
125
+ //#endregion
126
+ //# sourceMappingURL=github-app.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"github-app.d.ts","names":[],"sources":["../../src/channel/github-app.ts"],"mappings":";;;;qBA4aa,mBAAiB,MAAA,MAAA,OAAA,gBAAA,OAAA,iEAAA,6BAAA,OAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;mCAM7B;qBAEY,oBAAkB,MAAA,MAAA,OAAA,gBAAA,OAAA,iEAAA,6BAAA,OAAA"}
@@ -0,0 +1,17 @@
1
+ // @bun
2
+ import {
3
+ gitHubAppHandlers2,
4
+ githubChannelLayer2
5
+ } from "../../plugin-e0mt19z7.js";
6
+ import"../../plugin-p6f7n836.js";
7
+ import"../../plugin-7hfrx1dg.js";
8
+ import"../../plugin-2qqpmr67.js";
9
+ import"../../plugin-3ryytw13.js";
10
+ import"../../plugin-w0va8331.js";
11
+ export {
12
+ gitHubAppHandlers2 as gitHubAppHandlers,
13
+ githubChannelLayer2 as githubChannelLayer
14
+ };
15
+
16
+ //# debugId=DA1388D423FEA68764756E2164756E21
17
+ //# sourceMappingURL=github-app.js.map
@@ -0,0 +1,9 @@
1
+ {
2
+ "version": 3,
3
+ "sources": [],
4
+ "sourcesContent": [
5
+ ],
6
+ "mappings": "",
7
+ "debugId": "DA1388D423FEA68764756E2164756E21",
8
+ "names": []
9
+ }
@@ -0,0 +1,38 @@
1
+ import { Effect, Option, Schema } from "effect";
2
+ import { AgentChannel } from "@dual-os/sdk";
3
+ //#region src/channel/internal/webhook.d.ts
4
+ export declare const NumericId: Schema.Int;
5
+ /** A message about one issue or pull request, before the plugin decides whether it asks for a reply. */
6
+ export interface Inbound {
7
+ readonly author: {
8
+ readonly id: number;
9
+ readonly login: string;
10
+ };
11
+ readonly installationId: number;
12
+ readonly messageKey: string;
13
+ readonly number: number;
14
+ readonly owner: string;
15
+ readonly repository: string;
16
+ readonly text: string;
17
+ readonly timestamp: string;
18
+ }
19
+ /** The value of a request header, when it appears exactly once in any letter case. */
20
+ export declare function header(request: AgentChannel.Request, name: string): Option.Option<string>;
21
+ /** Check `X-Hub-Signature-256`, the HMAC-SHA256 of the raw body under the webhook secret. */
22
+ export declare const verify: (request: {
23
+ readonly body: string;
24
+ readonly headers: {
25
+ readonly [x: string]: string;
26
+ };
27
+ readonly method: "DELETE" | "GET" | "PATCH" | "POST" | "PUT";
28
+ readonly url: string;
29
+ }, secret: string) => Effect.Effect<{
30
+ verified: true;
31
+ }, AgentChannel.HandlerError, never>;
32
+ export declare function conversationKey(owner: string, repository: string, number: number): string;
33
+ /** The message of an issue or pull request opened, or of a comment created on one; nothing for any other event. */
34
+ export declare const parse: (event: string, body: string) => Effect.Effect<Option.None<Inbound> | Option.Some<Inbound>, AgentChannel.HandlerError, never>;
35
+ /** Whether `@slug` (also `@slug[bot]` or a link) appears outside quoted lines, which repeat an earlier mention. */
36
+ export declare function mentions(text: string, slug: string): boolean;
37
+ //#endregion
38
+ //# sourceMappingURL=webhook.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"webhook.d.ts","names":[],"sources":["../../../src/channel/internal/webhook.ts"],"mappings":";;;qBAOa,WAAS,OAAA;;iBA2CL;WACN;aAAmB;aAAqB;;WACxC;WACA;WACA;WACA;WACA;WACA;WACA;;;wBAMK,OAAO,SAAS,aAAa,SAAS,eAAY,OAAA;;qBAUrD,SAAM;;;;;;;;;GAcjB,aAAA;wBAgBc,gBAAgB,eAAe,oBAAoB;;qBAiDtD,QAAK,eAAA,iBAAA,OAAA,OAAA,OAAA,KAAA,WAAA,OAAA,KAAA,UAAA,aAAA;;wBA+BF,SAAS,cAAc"}