@knpkv/relay-product 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -0
- package/README.md +9 -0
- package/dist/conversation.d.ts +336 -0
- package/dist/conversation.d.ts.map +1 -0
- package/dist/conversation.js +227 -0
- package/dist/conversation.js.map +1 -0
- package/dist/dock.d.ts +36 -0
- package/dist/dock.d.ts.map +1 -0
- package/dist/dock.js +224 -0
- package/dist/dock.js.map +1 -0
- package/dist/index.d.ts +4 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +4 -0
- package/dist/index.js.map +1 -0
- package/dist/model.d.ts +85 -0
- package/dist/model.d.ts.map +1 -0
- package/dist/model.js +63 -0
- package/dist/model.js.map +1 -0
- package/dist/registry.d.ts +54 -0
- package/dist/registry.d.ts.map +1 -0
- package/dist/registry.js +36 -0
- package/dist/registry.js.map +1 -0
- package/package.json +68 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2025 knpkv
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
ADDED
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
# @knpkv/relay-product
|
|
2
|
+
|
|
3
|
+
Shared Relay dock and typed product adapter for `@knpkv/control-center` and
|
|
4
|
+
`@knpkv/codecommit-web`.
|
|
5
|
+
|
|
6
|
+
The dock owns presentation and selector state. Each product supplies typed
|
|
7
|
+
authentication, pull-request lookup, exact-page redirection, and continuation
|
|
8
|
+
operations. Pull-request thread identity is stable across new head revisions;
|
|
9
|
+
the reviewed head remains explicit conversation metadata.
|
|
@@ -0,0 +1,336 @@
|
|
|
1
|
+
import * as Context from "effect/Context";
|
|
2
|
+
import * as Effect from "effect/Effect";
|
|
3
|
+
import * as Layer from "effect/Layer";
|
|
4
|
+
import * as Schema from "effect/Schema";
|
|
5
|
+
export declare const AgenticProduct: Schema.Literals<readonly ["codecommit", "control-center"]>;
|
|
6
|
+
export type AgenticProduct = typeof AgenticProduct.Type;
|
|
7
|
+
export declare const RelayProductOperation: Schema.Literals<readonly ["continue-pull-request-conversation", "locate-pull-request-conversation"]>;
|
|
8
|
+
export type RelayProductOperation = typeof RelayProductOperation.Type;
|
|
9
|
+
export declare const ProductAuthorization: Schema.TaggedUnion<{
|
|
10
|
+
readonly codecommit: Schema.TaggedStruct<"codecommit", {
|
|
11
|
+
readonly principalId: Schema.brand<Schema.String, "RelayPrincipalId">;
|
|
12
|
+
}>;
|
|
13
|
+
readonly "control-center": Schema.TaggedStruct<"control-center", {
|
|
14
|
+
readonly principalId: Schema.brand<Schema.String, "RelayPrincipalId">;
|
|
15
|
+
readonly workspaceId: Schema.brand<Schema.String, "RelayWorkspaceId">;
|
|
16
|
+
}>;
|
|
17
|
+
}>;
|
|
18
|
+
export type ProductAuthorization = typeof ProductAuthorization.Type;
|
|
19
|
+
/** Provider identity a host agent may use to find one PR conversation. */
|
|
20
|
+
export declare const PullRequestConversationLocator: Schema.Struct<{
|
|
21
|
+
readonly accountId: Schema.optionalKey<Schema.brand<Schema.String, "RelayAccountId">>;
|
|
22
|
+
readonly provider: Schema.Literal<"codecommit">;
|
|
23
|
+
readonly pullRequestId: Schema.brand<Schema.String, "RelayPullRequestId">;
|
|
24
|
+
readonly region: Schema.brand<Schema.String, "RelayRegion">;
|
|
25
|
+
readonly repositoryName: Schema.brand<Schema.String, "RelayRepositoryName">;
|
|
26
|
+
}>;
|
|
27
|
+
export interface PullRequestConversationLocator extends Schema.Schema.Type<typeof PullRequestConversationLocator> {
|
|
28
|
+
}
|
|
29
|
+
/** Stable product-qualified identity. Head revisions never participate in thread identity. */
|
|
30
|
+
export declare const PullRequestThreadIdentity: Schema.TaggedUnion<{
|
|
31
|
+
readonly codecommit: Schema.TaggedStruct<"codecommit", {
|
|
32
|
+
readonly accountId: Schema.brand<Schema.String, "RelayAccountId">;
|
|
33
|
+
readonly pullRequestId: Schema.brand<Schema.String, "RelayPullRequestId">;
|
|
34
|
+
readonly region: Schema.brand<Schema.String, "RelayRegion">;
|
|
35
|
+
readonly repositoryName: Schema.brand<Schema.String, "RelayRepositoryName">;
|
|
36
|
+
}>;
|
|
37
|
+
readonly "control-center": Schema.TaggedStruct<"control-center", {
|
|
38
|
+
readonly pluginConnectionId: Schema.brand<Schema.String, "RelayPluginConnectionId">;
|
|
39
|
+
readonly pullRequestId: Schema.brand<Schema.String, "RelayPullRequestId">;
|
|
40
|
+
readonly repositoryName: Schema.brand<Schema.String, "RelayRepositoryName">;
|
|
41
|
+
readonly workspaceId: Schema.brand<Schema.String, "RelayWorkspaceId">;
|
|
42
|
+
}>;
|
|
43
|
+
}>;
|
|
44
|
+
export type PullRequestThreadIdentity = typeof PullRequestThreadIdentity.Type;
|
|
45
|
+
/** Durable thread identity, exact product route, and explicit Relay selection for one PR. */
|
|
46
|
+
export declare const PullRequestConversation: Schema.TaggedUnion<{
|
|
47
|
+
readonly codecommit: Schema.TaggedStruct<"codecommit", {
|
|
48
|
+
readonly route: Schema.Struct<{
|
|
49
|
+
readonly accountId: Schema.brand<Schema.String, "RelayAccountId">;
|
|
50
|
+
readonly href: Schema.String;
|
|
51
|
+
/** Credential/account alias used by the browser URL; accountId stays canonical. */
|
|
52
|
+
readonly pullRequestId: Schema.brand<Schema.String, "RelayPullRequestId">;
|
|
53
|
+
readonly routeAccountId: Schema.optionalKey<Schema.brand<Schema.String, "RelayAccountId">>;
|
|
54
|
+
}>;
|
|
55
|
+
readonly selection: Schema.Struct<{
|
|
56
|
+
readonly modelId: Schema.brand<Schema.String, "RelaySelectorId">;
|
|
57
|
+
readonly models: Schema.$Array<Schema.Struct<{
|
|
58
|
+
readonly id: Schema.brand<Schema.String, "RelaySelectorId">;
|
|
59
|
+
readonly label: Schema.String;
|
|
60
|
+
}>>;
|
|
61
|
+
readonly profileId: Schema.brand<Schema.String, "RelaySelectorId">;
|
|
62
|
+
readonly profiles: Schema.$Array<Schema.Struct<{
|
|
63
|
+
readonly id: Schema.brand<Schema.String, "RelaySelectorId">;
|
|
64
|
+
readonly label: Schema.String;
|
|
65
|
+
}>>;
|
|
66
|
+
}>;
|
|
67
|
+
readonly thread: Schema.Struct<{
|
|
68
|
+
readonly accountId: Schema.brand<Schema.String, "RelayAccountId">;
|
|
69
|
+
readonly pullRequestId: Schema.brand<Schema.String, "RelayPullRequestId">;
|
|
70
|
+
readonly region: Schema.brand<Schema.String, "RelayRegion">;
|
|
71
|
+
readonly repositoryName: Schema.brand<Schema.String, "RelayRepositoryName">;
|
|
72
|
+
}>;
|
|
73
|
+
}>;
|
|
74
|
+
readonly "control-center": Schema.TaggedStruct<"control-center", {
|
|
75
|
+
readonly route: Schema.Struct<{
|
|
76
|
+
readonly entityId: Schema.brand<Schema.String, "RelayEntityId">;
|
|
77
|
+
readonly href: Schema.String;
|
|
78
|
+
}>;
|
|
79
|
+
readonly selection: Schema.Struct<{
|
|
80
|
+
readonly modelId: Schema.brand<Schema.String, "RelaySelectorId">;
|
|
81
|
+
readonly models: Schema.$Array<Schema.Struct<{
|
|
82
|
+
readonly id: Schema.brand<Schema.String, "RelaySelectorId">;
|
|
83
|
+
readonly label: Schema.String;
|
|
84
|
+
}>>;
|
|
85
|
+
readonly profileId: Schema.brand<Schema.String, "RelaySelectorId">;
|
|
86
|
+
readonly profiles: Schema.$Array<Schema.Struct<{
|
|
87
|
+
readonly id: Schema.brand<Schema.String, "RelaySelectorId">;
|
|
88
|
+
readonly label: Schema.String;
|
|
89
|
+
}>>;
|
|
90
|
+
}>;
|
|
91
|
+
readonly thread: Schema.Struct<{
|
|
92
|
+
readonly pluginConnectionId: Schema.brand<Schema.String, "RelayPluginConnectionId">;
|
|
93
|
+
readonly pullRequestId: Schema.brand<Schema.String, "RelayPullRequestId">;
|
|
94
|
+
readonly repositoryName: Schema.brand<Schema.String, "RelayRepositoryName">;
|
|
95
|
+
readonly workspaceId: Schema.brand<Schema.String, "RelayWorkspaceId">;
|
|
96
|
+
}>;
|
|
97
|
+
}>;
|
|
98
|
+
}>;
|
|
99
|
+
export type PullRequestConversation = typeof PullRequestConversation.Type;
|
|
100
|
+
export declare const pullRequestThreadIdentity: (conversation: PullRequestConversation) => PullRequestThreadIdentity;
|
|
101
|
+
export declare const PullRequestContinuationMessage: Schema.brand<Schema.String, "PullRequestContinuationMessage">;
|
|
102
|
+
export type PullRequestContinuationMessage = typeof PullRequestContinuationMessage.Type;
|
|
103
|
+
export declare const ContinuePullRequestConversationRequest: Schema.Struct<{
|
|
104
|
+
readonly conversation: Schema.TaggedUnion<{
|
|
105
|
+
readonly codecommit: Schema.TaggedStruct<"codecommit", {
|
|
106
|
+
readonly route: Schema.Struct<{
|
|
107
|
+
readonly accountId: Schema.brand<Schema.String, "RelayAccountId">;
|
|
108
|
+
readonly href: Schema.String;
|
|
109
|
+
/** Credential/account alias used by the browser URL; accountId stays canonical. */
|
|
110
|
+
readonly pullRequestId: Schema.brand<Schema.String, "RelayPullRequestId">;
|
|
111
|
+
readonly routeAccountId: Schema.optionalKey<Schema.brand<Schema.String, "RelayAccountId">>;
|
|
112
|
+
}>;
|
|
113
|
+
readonly selection: Schema.Struct<{
|
|
114
|
+
readonly modelId: Schema.brand<Schema.String, "RelaySelectorId">;
|
|
115
|
+
readonly models: Schema.$Array<Schema.Struct<{
|
|
116
|
+
readonly id: Schema.brand<Schema.String, "RelaySelectorId">;
|
|
117
|
+
readonly label: Schema.String;
|
|
118
|
+
}>>;
|
|
119
|
+
readonly profileId: Schema.brand<Schema.String, "RelaySelectorId">;
|
|
120
|
+
readonly profiles: Schema.$Array<Schema.Struct<{
|
|
121
|
+
readonly id: Schema.brand<Schema.String, "RelaySelectorId">;
|
|
122
|
+
readonly label: Schema.String;
|
|
123
|
+
}>>;
|
|
124
|
+
}>;
|
|
125
|
+
readonly thread: Schema.Struct<{
|
|
126
|
+
readonly accountId: Schema.brand<Schema.String, "RelayAccountId">;
|
|
127
|
+
readonly pullRequestId: Schema.brand<Schema.String, "RelayPullRequestId">;
|
|
128
|
+
readonly region: Schema.brand<Schema.String, "RelayRegion">;
|
|
129
|
+
readonly repositoryName: Schema.brand<Schema.String, "RelayRepositoryName">;
|
|
130
|
+
}>;
|
|
131
|
+
}>;
|
|
132
|
+
readonly "control-center": Schema.TaggedStruct<"control-center", {
|
|
133
|
+
readonly route: Schema.Struct<{
|
|
134
|
+
readonly entityId: Schema.brand<Schema.String, "RelayEntityId">;
|
|
135
|
+
readonly href: Schema.String;
|
|
136
|
+
}>;
|
|
137
|
+
readonly selection: Schema.Struct<{
|
|
138
|
+
readonly modelId: Schema.brand<Schema.String, "RelaySelectorId">;
|
|
139
|
+
readonly models: Schema.$Array<Schema.Struct<{
|
|
140
|
+
readonly id: Schema.brand<Schema.String, "RelaySelectorId">;
|
|
141
|
+
readonly label: Schema.String;
|
|
142
|
+
}>>;
|
|
143
|
+
readonly profileId: Schema.brand<Schema.String, "RelaySelectorId">;
|
|
144
|
+
readonly profiles: Schema.$Array<Schema.Struct<{
|
|
145
|
+
readonly id: Schema.brand<Schema.String, "RelaySelectorId">;
|
|
146
|
+
readonly label: Schema.String;
|
|
147
|
+
}>>;
|
|
148
|
+
}>;
|
|
149
|
+
readonly thread: Schema.Struct<{
|
|
150
|
+
readonly pluginConnectionId: Schema.brand<Schema.String, "RelayPluginConnectionId">;
|
|
151
|
+
readonly pullRequestId: Schema.brand<Schema.String, "RelayPullRequestId">;
|
|
152
|
+
readonly repositoryName: Schema.brand<Schema.String, "RelayRepositoryName">;
|
|
153
|
+
readonly workspaceId: Schema.brand<Schema.String, "RelayWorkspaceId">;
|
|
154
|
+
}>;
|
|
155
|
+
}>;
|
|
156
|
+
}>;
|
|
157
|
+
readonly message: Schema.brand<Schema.String, "PullRequestContinuationMessage">;
|
|
158
|
+
readonly selection: Schema.Struct<{
|
|
159
|
+
readonly modelId: Schema.brand<Schema.String, "RelaySelectorId">;
|
|
160
|
+
readonly models: Schema.$Array<Schema.Struct<{
|
|
161
|
+
readonly id: Schema.brand<Schema.String, "RelaySelectorId">;
|
|
162
|
+
readonly label: Schema.String;
|
|
163
|
+
}>>;
|
|
164
|
+
readonly profileId: Schema.brand<Schema.String, "RelaySelectorId">;
|
|
165
|
+
readonly profiles: Schema.$Array<Schema.Struct<{
|
|
166
|
+
readonly id: Schema.brand<Schema.String, "RelaySelectorId">;
|
|
167
|
+
readonly label: Schema.String;
|
|
168
|
+
}>>;
|
|
169
|
+
}>;
|
|
170
|
+
}>;
|
|
171
|
+
export interface ContinuePullRequestConversationRequest extends Schema.Schema.Type<typeof ContinuePullRequestConversationRequest> {
|
|
172
|
+
}
|
|
173
|
+
export declare const PullRequestConversationContinuation: Schema.Struct<{
|
|
174
|
+
readonly messageId: Schema.brand<Schema.String, "RelayContinuationMessageId">;
|
|
175
|
+
readonly thread: Schema.TaggedUnion<{
|
|
176
|
+
readonly codecommit: Schema.TaggedStruct<"codecommit", {
|
|
177
|
+
readonly accountId: Schema.brand<Schema.String, "RelayAccountId">;
|
|
178
|
+
readonly pullRequestId: Schema.brand<Schema.String, "RelayPullRequestId">;
|
|
179
|
+
readonly region: Schema.brand<Schema.String, "RelayRegion">;
|
|
180
|
+
readonly repositoryName: Schema.brand<Schema.String, "RelayRepositoryName">;
|
|
181
|
+
}>;
|
|
182
|
+
readonly "control-center": Schema.TaggedStruct<"control-center", {
|
|
183
|
+
readonly pluginConnectionId: Schema.brand<Schema.String, "RelayPluginConnectionId">;
|
|
184
|
+
readonly pullRequestId: Schema.brand<Schema.String, "RelayPullRequestId">;
|
|
185
|
+
readonly repositoryName: Schema.brand<Schema.String, "RelayRepositoryName">;
|
|
186
|
+
readonly workspaceId: Schema.brand<Schema.String, "RelayWorkspaceId">;
|
|
187
|
+
}>;
|
|
188
|
+
}>;
|
|
189
|
+
}>;
|
|
190
|
+
export interface PullRequestConversationContinuation extends Schema.Schema.Type<typeof PullRequestConversationContinuation> {
|
|
191
|
+
}
|
|
192
|
+
declare const RelayAuthenticationRequired_base: Schema.Class<RelayAuthenticationRequired, Schema.TaggedStruct<"RelayAuthenticationRequired", {
|
|
193
|
+
readonly operation: Schema.Literals<readonly ["continue-pull-request-conversation", "locate-pull-request-conversation"]>;
|
|
194
|
+
readonly product: Schema.Literals<readonly ["codecommit", "control-center"]>;
|
|
195
|
+
}>, import("effect/Cause").YieldableError>;
|
|
196
|
+
export declare class RelayAuthenticationRequired extends RelayAuthenticationRequired_base {
|
|
197
|
+
}
|
|
198
|
+
declare const RelayAuthorizationDenied_base: Schema.Class<RelayAuthorizationDenied, Schema.TaggedStruct<"RelayAuthorizationDenied", {
|
|
199
|
+
readonly operation: Schema.Literals<readonly ["continue-pull-request-conversation", "locate-pull-request-conversation"]>;
|
|
200
|
+
readonly product: Schema.Literals<readonly ["codecommit", "control-center"]>;
|
|
201
|
+
}>, import("effect/Cause").YieldableError>;
|
|
202
|
+
export declare class RelayAuthorizationDenied extends RelayAuthorizationDenied_base {
|
|
203
|
+
}
|
|
204
|
+
declare const RelayAuthenticationUnavailable_base: Schema.Class<RelayAuthenticationUnavailable, Schema.TaggedStruct<"RelayAuthenticationUnavailable", {
|
|
205
|
+
readonly operation: Schema.Literals<readonly ["continue-pull-request-conversation", "locate-pull-request-conversation"]>;
|
|
206
|
+
readonly product: Schema.Literals<readonly ["codecommit", "control-center"]>;
|
|
207
|
+
}>, import("effect/Cause").YieldableError>;
|
|
208
|
+
export declare class RelayAuthenticationUnavailable extends RelayAuthenticationUnavailable_base {
|
|
209
|
+
}
|
|
210
|
+
declare const PullRequestConversationNotFound_base: Schema.Class<PullRequestConversationNotFound, Schema.TaggedStruct<"PullRequestConversationNotFound", {
|
|
211
|
+
readonly product: Schema.Literals<readonly ["codecommit", "control-center"]>;
|
|
212
|
+
readonly pullRequestId: Schema.brand<Schema.String, "RelayPullRequestId">;
|
|
213
|
+
readonly repositoryName: Schema.brand<Schema.String, "RelayRepositoryName">;
|
|
214
|
+
}>, import("effect/Cause").YieldableError>;
|
|
215
|
+
export declare class PullRequestConversationNotFound extends PullRequestConversationNotFound_base {
|
|
216
|
+
}
|
|
217
|
+
declare const PullRequestConversationAmbiguous_base: Schema.Class<PullRequestConversationAmbiguous, Schema.TaggedStruct<"PullRequestConversationAmbiguous", {
|
|
218
|
+
readonly matches: Schema.Int;
|
|
219
|
+
readonly product: Schema.Literals<readonly ["codecommit", "control-center"]>;
|
|
220
|
+
readonly pullRequestId: Schema.brand<Schema.String, "RelayPullRequestId">;
|
|
221
|
+
readonly repositoryName: Schema.brand<Schema.String, "RelayRepositoryName">;
|
|
222
|
+
}>, import("effect/Cause").YieldableError>;
|
|
223
|
+
export declare class PullRequestConversationAmbiguous extends PullRequestConversationAmbiguous_base {
|
|
224
|
+
}
|
|
225
|
+
declare const PullRequestConversationLookupFailed_base: Schema.Class<PullRequestConversationLookupFailed, Schema.TaggedStruct<"PullRequestConversationLookupFailed", {
|
|
226
|
+
readonly product: Schema.Literals<readonly ["codecommit", "control-center"]>;
|
|
227
|
+
}>, import("effect/Cause").YieldableError>;
|
|
228
|
+
export declare class PullRequestConversationLookupFailed extends PullRequestConversationLookupFailed_base {
|
|
229
|
+
}
|
|
230
|
+
declare const PullRequestConversationRedirectFailed_base: Schema.Class<PullRequestConversationRedirectFailed, Schema.TaggedStruct<"PullRequestConversationRedirectFailed", {
|
|
231
|
+
readonly href: Schema.String;
|
|
232
|
+
readonly product: Schema.Literals<readonly ["codecommit", "control-center"]>;
|
|
233
|
+
}>, import("effect/Cause").YieldableError>;
|
|
234
|
+
export declare class PullRequestConversationRedirectFailed extends PullRequestConversationRedirectFailed_base {
|
|
235
|
+
}
|
|
236
|
+
declare const PullRequestConversationContinuationRejected_base: Schema.Class<PullRequestConversationContinuationRejected, Schema.TaggedStruct<"PullRequestConversationContinuationRejected", {
|
|
237
|
+
readonly product: Schema.Literals<readonly ["codecommit", "control-center"]>;
|
|
238
|
+
readonly reason: Schema.Literals<readonly ["conversation-busy", "selection-unavailable", "thread-not-found"]>;
|
|
239
|
+
readonly thread: Schema.TaggedUnion<{
|
|
240
|
+
readonly codecommit: Schema.TaggedStruct<"codecommit", {
|
|
241
|
+
readonly accountId: Schema.brand<Schema.String, "RelayAccountId">;
|
|
242
|
+
readonly pullRequestId: Schema.brand<Schema.String, "RelayPullRequestId">;
|
|
243
|
+
readonly region: Schema.brand<Schema.String, "RelayRegion">;
|
|
244
|
+
readonly repositoryName: Schema.brand<Schema.String, "RelayRepositoryName">;
|
|
245
|
+
}>;
|
|
246
|
+
readonly "control-center": Schema.TaggedStruct<"control-center", {
|
|
247
|
+
readonly pluginConnectionId: Schema.brand<Schema.String, "RelayPluginConnectionId">;
|
|
248
|
+
readonly pullRequestId: Schema.brand<Schema.String, "RelayPullRequestId">;
|
|
249
|
+
readonly repositoryName: Schema.brand<Schema.String, "RelayRepositoryName">;
|
|
250
|
+
readonly workspaceId: Schema.brand<Schema.String, "RelayWorkspaceId">;
|
|
251
|
+
}>;
|
|
252
|
+
}>;
|
|
253
|
+
}>, import("effect/Cause").YieldableError>;
|
|
254
|
+
export declare class PullRequestConversationContinuationRejected extends PullRequestConversationContinuationRejected_base {
|
|
255
|
+
}
|
|
256
|
+
declare const PullRequestConversationContinuationFailed_base: Schema.Class<PullRequestConversationContinuationFailed, Schema.TaggedStruct<"PullRequestConversationContinuationFailed", {
|
|
257
|
+
readonly product: Schema.Literals<readonly ["codecommit", "control-center"]>;
|
|
258
|
+
readonly thread: Schema.TaggedUnion<{
|
|
259
|
+
readonly codecommit: Schema.TaggedStruct<"codecommit", {
|
|
260
|
+
readonly accountId: Schema.brand<Schema.String, "RelayAccountId">;
|
|
261
|
+
readonly pullRequestId: Schema.brand<Schema.String, "RelayPullRequestId">;
|
|
262
|
+
readonly region: Schema.brand<Schema.String, "RelayRegion">;
|
|
263
|
+
readonly repositoryName: Schema.brand<Schema.String, "RelayRepositoryName">;
|
|
264
|
+
}>;
|
|
265
|
+
readonly "control-center": Schema.TaggedStruct<"control-center", {
|
|
266
|
+
readonly pluginConnectionId: Schema.brand<Schema.String, "RelayPluginConnectionId">;
|
|
267
|
+
readonly pullRequestId: Schema.brand<Schema.String, "RelayPullRequestId">;
|
|
268
|
+
readonly repositoryName: Schema.brand<Schema.String, "RelayRepositoryName">;
|
|
269
|
+
readonly workspaceId: Schema.brand<Schema.String, "RelayWorkspaceId">;
|
|
270
|
+
}>;
|
|
271
|
+
}>;
|
|
272
|
+
}>, import("effect/Cause").YieldableError>;
|
|
273
|
+
export declare class PullRequestConversationContinuationFailed extends PullRequestConversationContinuationFailed_base {
|
|
274
|
+
}
|
|
275
|
+
declare const RelayProductAdapterContractError_base: Schema.Class<RelayProductAdapterContractError, Schema.TaggedStruct<"RelayProductAdapterContractError", {
|
|
276
|
+
readonly actualProduct: Schema.Literals<readonly ["codecommit", "control-center"]>;
|
|
277
|
+
readonly expectedProduct: Schema.Literals<readonly ["codecommit", "control-center"]>;
|
|
278
|
+
readonly operation: Schema.Literals<readonly ["continue-pull-request-conversation", "locate-pull-request-conversation"]>;
|
|
279
|
+
}>, import("effect/Cause").YieldableError>;
|
|
280
|
+
export declare class RelayProductAdapterContractError extends RelayProductAdapterContractError_base {
|
|
281
|
+
}
|
|
282
|
+
declare const RelayProductContinuationReceiptMismatch_base: Schema.Class<RelayProductContinuationReceiptMismatch, Schema.TaggedStruct<"RelayProductContinuationReceiptMismatch", {
|
|
283
|
+
readonly actualThread: Schema.TaggedUnion<{
|
|
284
|
+
readonly codecommit: Schema.TaggedStruct<"codecommit", {
|
|
285
|
+
readonly accountId: Schema.brand<Schema.String, "RelayAccountId">;
|
|
286
|
+
readonly pullRequestId: Schema.brand<Schema.String, "RelayPullRequestId">;
|
|
287
|
+
readonly region: Schema.brand<Schema.String, "RelayRegion">;
|
|
288
|
+
readonly repositoryName: Schema.brand<Schema.String, "RelayRepositoryName">;
|
|
289
|
+
}>;
|
|
290
|
+
readonly "control-center": Schema.TaggedStruct<"control-center", {
|
|
291
|
+
readonly pluginConnectionId: Schema.brand<Schema.String, "RelayPluginConnectionId">;
|
|
292
|
+
readonly pullRequestId: Schema.brand<Schema.String, "RelayPullRequestId">;
|
|
293
|
+
readonly repositoryName: Schema.brand<Schema.String, "RelayRepositoryName">;
|
|
294
|
+
readonly workspaceId: Schema.brand<Schema.String, "RelayWorkspaceId">;
|
|
295
|
+
}>;
|
|
296
|
+
}>;
|
|
297
|
+
readonly expectedThread: Schema.TaggedUnion<{
|
|
298
|
+
readonly codecommit: Schema.TaggedStruct<"codecommit", {
|
|
299
|
+
readonly accountId: Schema.brand<Schema.String, "RelayAccountId">;
|
|
300
|
+
readonly pullRequestId: Schema.brand<Schema.String, "RelayPullRequestId">;
|
|
301
|
+
readonly region: Schema.brand<Schema.String, "RelayRegion">;
|
|
302
|
+
readonly repositoryName: Schema.brand<Schema.String, "RelayRepositoryName">;
|
|
303
|
+
}>;
|
|
304
|
+
readonly "control-center": Schema.TaggedStruct<"control-center", {
|
|
305
|
+
readonly pluginConnectionId: Schema.brand<Schema.String, "RelayPluginConnectionId">;
|
|
306
|
+
readonly pullRequestId: Schema.brand<Schema.String, "RelayPullRequestId">;
|
|
307
|
+
readonly repositoryName: Schema.brand<Schema.String, "RelayRepositoryName">;
|
|
308
|
+
readonly workspaceId: Schema.brand<Schema.String, "RelayWorkspaceId">;
|
|
309
|
+
}>;
|
|
310
|
+
}>;
|
|
311
|
+
}>, import("effect/Cause").YieldableError>;
|
|
312
|
+
export declare class RelayProductContinuationReceiptMismatch extends RelayProductContinuationReceiptMismatch_base {
|
|
313
|
+
}
|
|
314
|
+
export type RelayAuthenticationFailure = RelayAuthenticationRequired | RelayAuthorizationDenied | RelayAuthenticationUnavailable;
|
|
315
|
+
export type PullRequestConversationLookupFailure = PullRequestConversationNotFound | PullRequestConversationAmbiguous | PullRequestConversationLookupFailed;
|
|
316
|
+
export type PullRequestConversationContinuationFailure = PullRequestConversationContinuationRejected | PullRequestConversationContinuationFailed;
|
|
317
|
+
/** Product-owned authority, backend, and router operations. No raw HTTP enters the shared module. */
|
|
318
|
+
export interface RelayProductPort {
|
|
319
|
+
readonly authorize: (operation: RelayProductOperation) => Effect.Effect<ProductAuthorization, RelayAuthenticationFailure>;
|
|
320
|
+
readonly continuePullRequestConversation: (authorization: ProductAuthorization, request: ContinuePullRequestConversationRequest) => Effect.Effect<PullRequestConversationContinuation, PullRequestConversationContinuationFailure>;
|
|
321
|
+
readonly locatePullRequestConversation: (authorization: ProductAuthorization, locator: PullRequestConversationLocator) => Effect.Effect<PullRequestConversation, PullRequestConversationLookupFailure>;
|
|
322
|
+
readonly product: AgenticProduct;
|
|
323
|
+
readonly redirectToPullRequest: (conversation: PullRequestConversation) => Effect.Effect<void, PullRequestConversationRedirectFailed>;
|
|
324
|
+
}
|
|
325
|
+
export interface RelayProductAdapter {
|
|
326
|
+
readonly continuePullRequestConversation: (request: ContinuePullRequestConversationRequest) => Effect.Effect<PullRequestConversationContinuation, RelayAuthenticationFailure | PullRequestConversationContinuationFailure | RelayProductAdapterContractError | RelayProductContinuationReceiptMismatch>;
|
|
327
|
+
readonly openPullRequestConversation: (locator: PullRequestConversationLocator) => Effect.Effect<PullRequestConversation, RelayAuthenticationFailure | PullRequestConversationLookupFailure | PullRequestConversationRedirectFailed | RelayProductAdapterContractError>;
|
|
328
|
+
}
|
|
329
|
+
declare const RelayProduct_base: Context.ServiceClass<RelayProduct, "@knpkv/relay-product/RelayProduct", RelayProductAdapter>;
|
|
330
|
+
export declare class RelayProduct extends RelayProduct_base {
|
|
331
|
+
}
|
|
332
|
+
/** One orchestration path shared by Control Center and CodeCommit product ports. */
|
|
333
|
+
export declare const makeRelayProductAdapter: (port: RelayProductPort) => RelayProductAdapter;
|
|
334
|
+
export declare const layer: (port: RelayProductPort) => Layer.Layer<RelayProduct>;
|
|
335
|
+
export {};
|
|
336
|
+
//# sourceMappingURL=conversation.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"conversation.d.ts","sourceRoot":"","sources":["../src/conversation.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,OAAO,MAAM,gBAAgB,CAAA;AACzC,OAAO,KAAK,MAAM,MAAM,eAAe,CAAA;AACvC,OAAO,KAAK,KAAK,MAAM,cAAc,CAAA;AACrC,OAAO,KAAK,MAAM,MAAM,eAAe,CAAA;AAevC,eAAO,MAAM,cAAc,4DAAoD,CAAA;AAC/E,MAAM,MAAM,cAAc,GAAG,OAAO,cAAc,CAAC,IAAI,CAAA;AAEvD,eAAO,MAAM,qBAAqB,sGAGhC,CAAA;AACF,MAAM,MAAM,qBAAqB,GAAG,OAAO,qBAAqB,CAAC,IAAI,CAAA;AAiBrE,eAAO,MAAM,oBAAoB;;;;;;;;EAQ/B,CAAA;AACF,MAAM,MAAM,oBAAoB,GAAG,OAAO,oBAAoB,CAAC,IAAI,CA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I,EAAE,qCAAqC,CAAC,CAAA;CAChE;AAED,MAAM,WAAW,mBAAmB;IAClC,QAAQ,CAAC,+BAA+B,EAAE,CACxC,OAAO,EAAE,sCAAsC,KAC5C,MAAM,CAAC,MAAM,CAChB,mCAAmC,EACjC,0BAA0B,GAC1B,0CAA0C,GAC1C,gCAAgC,GAChC,uCAAuC,CAC1C,CAAA;IACD,QAAQ,CAAC,2BAA2B,EAAE,CACpC,OAAO,EAAE,8BAA8B,KACpC,MAAM,CAAC,MAAM,CAChB,uBAAuB,EACrB,0BAA0B,GAC1B,oCAAoC,GACpC,qCAAqC,GACrC,gCAAgC,CACnC,CAAA;CACF;;AAED,qBAAa,YAAa,SAAQ,iBAEjC;CAAG;AAoCJ,oFAAoF;AACpF,eAAO,MAAM,uBAAuB,SAAU,gBAAgB,KAAG,mBAgChE,CAAA;AAED,eAAO,MAAM,KAAK,SAAU,gBAAgB,KAAG,KAAK,CAAC,KAAK,CAAC,YAAY,CACX,CAAA"}
|
|
@@ -0,0 +1,227 @@
|
|
|
1
|
+
import * as Context from "effect/Context";
|
|
2
|
+
import * as Effect from "effect/Effect";
|
|
3
|
+
import * as Layer from "effect/Layer";
|
|
4
|
+
import * as Schema from "effect/Schema";
|
|
5
|
+
import { RelaySelectorState } from "./model.js";
|
|
6
|
+
const trimmedIdentifier = (maximumLength) => Schema.String.check(Schema.isTrimmed(), Schema.isNonEmpty(), Schema.isMaxLength(maximumLength));
|
|
7
|
+
const canonicalUuid = (brand) => Schema.String.check(Schema.isUUID(7), Schema.isPattern(/^[0-9a-f]{8}-[0-9a-f]{4}-7[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$/u, {
|
|
8
|
+
expected: "a canonical lowercase UUID v7"
|
|
9
|
+
})).pipe(Schema.brand(brand));
|
|
10
|
+
export const AgenticProduct = Schema.Literals(["codecommit", "control-center"]);
|
|
11
|
+
export const RelayProductOperation = Schema.Literals([
|
|
12
|
+
"continue-pull-request-conversation",
|
|
13
|
+
"locate-pull-request-conversation"
|
|
14
|
+
]);
|
|
15
|
+
const PrincipalId = trimmedIdentifier(200).pipe(Schema.brand("RelayPrincipalId"));
|
|
16
|
+
const WorkspaceId = canonicalUuid("RelayWorkspaceId");
|
|
17
|
+
const PluginConnectionId = canonicalUuid("RelayPluginConnectionId");
|
|
18
|
+
const EntityId = canonicalUuid("RelayEntityId");
|
|
19
|
+
const RepositoryName = trimmedIdentifier(1_000).pipe(Schema.brand("RelayRepositoryName"));
|
|
20
|
+
const PullRequestId = trimmedIdentifier(200).pipe(Schema.brand("RelayPullRequestId"));
|
|
21
|
+
const AccountId = trimmedIdentifier(200).pipe(Schema.brand("RelayAccountId"));
|
|
22
|
+
const Region = trimmedIdentifier(100).pipe(Schema.brand("RelayRegion"));
|
|
23
|
+
const ProductPath = Schema.String.check(Schema.isTrimmed(), Schema.isNonEmpty(), Schema.isMaxLength(4_096), Schema.isPattern(/^\/(?!\/)/u, { expected: "an application-owned absolute path" }));
|
|
24
|
+
export const ProductAuthorization = Schema.TaggedUnion({
|
|
25
|
+
codecommit: {
|
|
26
|
+
principalId: PrincipalId
|
|
27
|
+
},
|
|
28
|
+
"control-center": {
|
|
29
|
+
principalId: PrincipalId,
|
|
30
|
+
workspaceId: WorkspaceId
|
|
31
|
+
}
|
|
32
|
+
});
|
|
33
|
+
/** Provider identity a host agent may use to find one PR conversation. */
|
|
34
|
+
export const PullRequestConversationLocator = Schema.Struct({
|
|
35
|
+
accountId: Schema.optionalKey(AccountId),
|
|
36
|
+
provider: Schema.Literal("codecommit"),
|
|
37
|
+
pullRequestId: PullRequestId,
|
|
38
|
+
region: Region,
|
|
39
|
+
repositoryName: RepositoryName
|
|
40
|
+
});
|
|
41
|
+
const ControlCenterThreadIdentity = Schema.Struct({
|
|
42
|
+
pluginConnectionId: PluginConnectionId,
|
|
43
|
+
pullRequestId: PullRequestId,
|
|
44
|
+
repositoryName: RepositoryName,
|
|
45
|
+
workspaceId: WorkspaceId
|
|
46
|
+
});
|
|
47
|
+
const CodeCommitThreadIdentity = Schema.Struct({
|
|
48
|
+
accountId: AccountId,
|
|
49
|
+
pullRequestId: PullRequestId,
|
|
50
|
+
region: Region,
|
|
51
|
+
repositoryName: RepositoryName
|
|
52
|
+
});
|
|
53
|
+
const ControlCenterPullRequestRoute = Schema.Struct({
|
|
54
|
+
entityId: EntityId,
|
|
55
|
+
href: ProductPath
|
|
56
|
+
});
|
|
57
|
+
const CodeCommitPullRequestRoute = Schema.Struct({
|
|
58
|
+
accountId: AccountId,
|
|
59
|
+
href: ProductPath,
|
|
60
|
+
/** Credential/account alias used by the browser URL; accountId stays canonical. */
|
|
61
|
+
pullRequestId: PullRequestId,
|
|
62
|
+
routeAccountId: Schema.optionalKey(AccountId)
|
|
63
|
+
});
|
|
64
|
+
/** Stable product-qualified identity. Head revisions never participate in thread identity. */
|
|
65
|
+
export const PullRequestThreadIdentity = Schema.TaggedUnion({
|
|
66
|
+
codecommit: {
|
|
67
|
+
...CodeCommitThreadIdentity.fields
|
|
68
|
+
},
|
|
69
|
+
"control-center": {
|
|
70
|
+
...ControlCenterThreadIdentity.fields
|
|
71
|
+
}
|
|
72
|
+
});
|
|
73
|
+
/** Durable thread identity, exact product route, and explicit Relay selection for one PR. */
|
|
74
|
+
export const PullRequestConversation = Schema.TaggedUnion({
|
|
75
|
+
codecommit: {
|
|
76
|
+
route: CodeCommitPullRequestRoute,
|
|
77
|
+
selection: RelaySelectorState,
|
|
78
|
+
thread: CodeCommitThreadIdentity
|
|
79
|
+
},
|
|
80
|
+
"control-center": {
|
|
81
|
+
route: ControlCenterPullRequestRoute,
|
|
82
|
+
selection: RelaySelectorState,
|
|
83
|
+
thread: ControlCenterThreadIdentity
|
|
84
|
+
}
|
|
85
|
+
}).check(Schema.makeFilter((conversation) => {
|
|
86
|
+
switch (conversation._tag) {
|
|
87
|
+
case "codecommit":
|
|
88
|
+
return (conversation.route.accountId === conversation.thread.accountId &&
|
|
89
|
+
conversation.route.pullRequestId === conversation.thread.pullRequestId &&
|
|
90
|
+
conversation.route.href ===
|
|
91
|
+
`/accounts/${encodeURIComponent(conversation.route.routeAccountId ?? conversation.route.accountId)}/prs/${encodeURIComponent(conversation.route.pullRequestId)}`);
|
|
92
|
+
case "control-center":
|
|
93
|
+
return (conversation.route.href ===
|
|
94
|
+
`/w/${conversation.thread.workspaceId}/items/${conversation.route.entityId}`);
|
|
95
|
+
}
|
|
96
|
+
}, { expected: "a product-qualified thread paired with its exact pull-request route" }));
|
|
97
|
+
export const pullRequestThreadIdentity = (conversation) => {
|
|
98
|
+
switch (conversation._tag) {
|
|
99
|
+
case "codecommit":
|
|
100
|
+
return PullRequestThreadIdentity.cases.codecommit.make(conversation.thread);
|
|
101
|
+
case "control-center":
|
|
102
|
+
return PullRequestThreadIdentity.cases["control-center"].make(conversation.thread);
|
|
103
|
+
}
|
|
104
|
+
};
|
|
105
|
+
export const PullRequestContinuationMessage = Schema.String.check(Schema.isTrimmed(), Schema.isNonEmpty(), Schema.isMaxLength(8_000)).pipe(Schema.brand("PullRequestContinuationMessage"));
|
|
106
|
+
export const ContinuePullRequestConversationRequest = Schema.Struct({
|
|
107
|
+
conversation: PullRequestConversation,
|
|
108
|
+
message: PullRequestContinuationMessage,
|
|
109
|
+
selection: RelaySelectorState
|
|
110
|
+
});
|
|
111
|
+
const ContinuationMessageId = trimmedIdentifier(200).pipe(Schema.brand("RelayContinuationMessageId"));
|
|
112
|
+
export const PullRequestConversationContinuation = Schema.Struct({
|
|
113
|
+
messageId: ContinuationMessageId,
|
|
114
|
+
thread: PullRequestThreadIdentity
|
|
115
|
+
});
|
|
116
|
+
export class RelayAuthenticationRequired extends Schema.TaggedError()("RelayAuthenticationRequired", {
|
|
117
|
+
operation: RelayProductOperation,
|
|
118
|
+
product: AgenticProduct
|
|
119
|
+
}) {
|
|
120
|
+
}
|
|
121
|
+
export class RelayAuthorizationDenied extends Schema.TaggedError()("RelayAuthorizationDenied", {
|
|
122
|
+
operation: RelayProductOperation,
|
|
123
|
+
product: AgenticProduct
|
|
124
|
+
}) {
|
|
125
|
+
}
|
|
126
|
+
export class RelayAuthenticationUnavailable extends Schema.TaggedError()("RelayAuthenticationUnavailable", {
|
|
127
|
+
operation: RelayProductOperation,
|
|
128
|
+
product: AgenticProduct
|
|
129
|
+
}) {
|
|
130
|
+
}
|
|
131
|
+
export class PullRequestConversationNotFound extends Schema.TaggedError()("PullRequestConversationNotFound", {
|
|
132
|
+
product: AgenticProduct,
|
|
133
|
+
pullRequestId: PullRequestId,
|
|
134
|
+
repositoryName: RepositoryName
|
|
135
|
+
}) {
|
|
136
|
+
}
|
|
137
|
+
export class PullRequestConversationAmbiguous extends Schema.TaggedError()("PullRequestConversationAmbiguous", {
|
|
138
|
+
matches: Schema.Int.check(Schema.isGreaterThan(1)),
|
|
139
|
+
product: AgenticProduct,
|
|
140
|
+
pullRequestId: PullRequestId,
|
|
141
|
+
repositoryName: RepositoryName
|
|
142
|
+
}) {
|
|
143
|
+
}
|
|
144
|
+
export class PullRequestConversationLookupFailed extends Schema.TaggedError()("PullRequestConversationLookupFailed", {
|
|
145
|
+
product: AgenticProduct
|
|
146
|
+
}) {
|
|
147
|
+
}
|
|
148
|
+
export class PullRequestConversationRedirectFailed extends Schema.TaggedError()("PullRequestConversationRedirectFailed", {
|
|
149
|
+
href: ProductPath,
|
|
150
|
+
product: AgenticProduct
|
|
151
|
+
}) {
|
|
152
|
+
}
|
|
153
|
+
export class PullRequestConversationContinuationRejected extends Schema.TaggedError()("PullRequestConversationContinuationRejected", {
|
|
154
|
+
product: AgenticProduct,
|
|
155
|
+
reason: Schema.Literals(["conversation-busy", "selection-unavailable", "thread-not-found"]),
|
|
156
|
+
thread: PullRequestThreadIdentity
|
|
157
|
+
}) {
|
|
158
|
+
}
|
|
159
|
+
export class PullRequestConversationContinuationFailed extends Schema.TaggedError()("PullRequestConversationContinuationFailed", {
|
|
160
|
+
product: AgenticProduct,
|
|
161
|
+
thread: PullRequestThreadIdentity
|
|
162
|
+
}) {
|
|
163
|
+
}
|
|
164
|
+
export class RelayProductAdapterContractError extends Schema.TaggedError()("RelayProductAdapterContractError", {
|
|
165
|
+
actualProduct: AgenticProduct,
|
|
166
|
+
expectedProduct: AgenticProduct,
|
|
167
|
+
operation: RelayProductOperation
|
|
168
|
+
}) {
|
|
169
|
+
}
|
|
170
|
+
export class RelayProductContinuationReceiptMismatch extends Schema.TaggedError()("RelayProductContinuationReceiptMismatch", {
|
|
171
|
+
actualThread: PullRequestThreadIdentity,
|
|
172
|
+
expectedThread: PullRequestThreadIdentity
|
|
173
|
+
}) {
|
|
174
|
+
}
|
|
175
|
+
export class RelayProduct extends Context.Service()("@knpkv/relay-product/RelayProduct") {
|
|
176
|
+
}
|
|
177
|
+
const requireProduct = (expectedProduct, actualProduct, operation) => expectedProduct === actualProduct
|
|
178
|
+
? Effect.void
|
|
179
|
+
: new RelayProductAdapterContractError({ actualProduct, expectedProduct, operation });
|
|
180
|
+
const samePullRequestThread = (left, right) => {
|
|
181
|
+
if (left._tag !== right._tag)
|
|
182
|
+
return false;
|
|
183
|
+
switch (left._tag) {
|
|
184
|
+
case "codecommit":
|
|
185
|
+
return (right._tag === "codecommit" &&
|
|
186
|
+
left.accountId === right.accountId &&
|
|
187
|
+
left.pullRequestId === right.pullRequestId &&
|
|
188
|
+
left.region === right.region &&
|
|
189
|
+
left.repositoryName === right.repositoryName);
|
|
190
|
+
case "control-center":
|
|
191
|
+
return (right._tag === "control-center" &&
|
|
192
|
+
left.pluginConnectionId === right.pluginConnectionId &&
|
|
193
|
+
left.pullRequestId === right.pullRequestId &&
|
|
194
|
+
left.repositoryName === right.repositoryName &&
|
|
195
|
+
left.workspaceId === right.workspaceId);
|
|
196
|
+
}
|
|
197
|
+
};
|
|
198
|
+
/** One orchestration path shared by Control Center and CodeCommit product ports. */
|
|
199
|
+
export const makeRelayProductAdapter = (port) => {
|
|
200
|
+
const openPullRequestConversation = Effect.fn("RelayProduct.openPullRequestConversation")(function* (locator) {
|
|
201
|
+
const operation = "locate-pull-request-conversation";
|
|
202
|
+
const authorization = yield* port.authorize(operation);
|
|
203
|
+
yield* requireProduct(port.product, authorization._tag, operation);
|
|
204
|
+
const conversation = yield* port.locatePullRequestConversation(authorization, locator);
|
|
205
|
+
yield* requireProduct(port.product, conversation._tag, operation);
|
|
206
|
+
yield* port.redirectToPullRequest(conversation);
|
|
207
|
+
return conversation;
|
|
208
|
+
});
|
|
209
|
+
const continuePullRequestConversation = Effect.fn("RelayProduct.continuePullRequestConversation")(function* (request) {
|
|
210
|
+
const operation = "continue-pull-request-conversation";
|
|
211
|
+
const authorization = yield* port.authorize(operation);
|
|
212
|
+
yield* requireProduct(port.product, authorization._tag, operation);
|
|
213
|
+
yield* requireProduct(port.product, request.conversation._tag, operation);
|
|
214
|
+
const receipt = yield* port.continuePullRequestConversation(authorization, request);
|
|
215
|
+
const expectedThread = pullRequestThreadIdentity(request.conversation);
|
|
216
|
+
if (!samePullRequestThread(expectedThread, receipt.thread)) {
|
|
217
|
+
return yield* new RelayProductContinuationReceiptMismatch({
|
|
218
|
+
actualThread: receipt.thread,
|
|
219
|
+
expectedThread
|
|
220
|
+
});
|
|
221
|
+
}
|
|
222
|
+
return receipt;
|
|
223
|
+
});
|
|
224
|
+
return RelayProduct.of({ continuePullRequestConversation, openPullRequestConversation });
|
|
225
|
+
};
|
|
226
|
+
export const layer = (port) => Layer.succeed(RelayProduct, makeRelayProductAdapter(port));
|
|
227
|
+
//# sourceMappingURL=conversation.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"conversation.js","sourceRoot":"","sources":["../src/conversation.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,OAAO,MAAM,gBAAgB,CAAA;AACzC,OAAO,KAAK,MAAM,MAAM,eAAe,CAAA;AACvC,OAAO,KAAK,KAAK,MAAM,cAAc,CAAA;AACrC,OAAO,KAAK,MAAM,MAAM,eAAe,CAAA;AAEvC,OAAO,EAAE,kBAAkB,EAAE,MAAM,YA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