t3code-cli 0.14.2 → 0.15.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/README.md +36 -1
- package/dist/application.d.ts +2 -2
- package/dist/application.js +1 -1
- package/dist/auth.d.ts +1 -1
- package/dist/auth.js +1 -1
- package/dist/bin.js +935 -336
- package/dist/cli.d.ts +1 -1
- package/dist/cli.js +1 -1
- package/dist/client-runtime/authorization.d.ts +1 -1
- package/dist/client-runtime/authorization.js +1 -1
- package/dist/client-runtime/connection.d.ts +1 -1
- package/dist/client-runtime/connection.js +1 -1
- package/dist/client-runtime/environment.d.ts +3 -1
- package/dist/client-runtime/environment.js +1 -1
- package/dist/client-runtime/errors.js +1 -1
- package/dist/client-runtime/operations/projects.d.ts +1 -1
- package/dist/client-runtime/operations.d.ts +1 -1
- package/dist/client-runtime/platform.d.ts +1 -1
- package/dist/client-runtime/platform.js +1 -1
- package/dist/client-runtime/relay.d.ts +9 -2
- package/dist/client-runtime/relay.js +12 -2
- package/dist/client-runtime/rpc.d.ts +2 -2
- package/dist/client-runtime/rpc.js +2 -2
- package/dist/client-runtime/state/assets.d.ts +1 -1
- package/dist/client-runtime/state/assets.js +1 -1
- package/dist/client-runtime/state/auth.d.ts +1 -1
- package/dist/client-runtime/state/auth.js +1 -1
- package/dist/client-runtime/state/connections.js +1 -1
- package/dist/client-runtime/state/entities.d.ts +1 -1
- package/dist/client-runtime/state/filesystem.d.ts +1 -1
- package/dist/client-runtime/state/filesystem.js +1 -1
- package/dist/client-runtime/state/git.d.ts +2 -1
- package/dist/client-runtime/state/git.js +1 -1
- package/dist/client-runtime/state/models.d.ts +1 -1
- package/dist/client-runtime/state/models.js +1 -1
- package/dist/client-runtime/state/orchestration.d.ts +1 -1
- package/dist/client-runtime/state/orchestration.js +1 -1
- package/dist/client-runtime/state/presentation.d.ts +7 -1
- package/dist/client-runtime/state/presentation.js +1 -1
- package/dist/client-runtime/state/preview.d.ts +5 -2
- package/dist/client-runtime/state/preview.js +3 -2
- package/dist/client-runtime/state/project-grouping.d.ts +1 -1
- package/dist/client-runtime/state/project-grouping.js +1 -1
- package/dist/client-runtime/state/projects.d.ts +1 -1
- package/dist/client-runtime/state/pull-requests.d.ts +478 -0
- package/dist/client-runtime/state/pull-requests.js +172 -0
- package/dist/client-runtime/state/relay.d.ts +1 -1
- package/dist/client-runtime/state/relay.js +1 -1
- package/dist/client-runtime/state/review.d.ts +1 -1
- package/dist/client-runtime/state/review.js +1 -1
- package/dist/client-runtime/state/runtime.d.ts +2 -2
- package/dist/client-runtime/state/runtime.js +2 -2
- package/dist/client-runtime/state/server.d.ts +13 -1
- package/dist/client-runtime/state/server.js +1 -1
- package/dist/client-runtime/state/session.d.ts +13 -1
- package/dist/client-runtime/state/session.js +1 -1
- package/dist/client-runtime/state/shell.d.ts +7 -1
- package/dist/client-runtime/state/shell.js +1 -1
- package/dist/client-runtime/state/source-control.d.ts +1 -1
- package/dist/client-runtime/state/source-control.js +1 -1
- package/dist/client-runtime/state/subagentRuntime.d.ts +1 -1
- package/dist/client-runtime/state/terminal.d.ts +1 -1
- package/dist/client-runtime/state/terminal.js +1 -1
- package/dist/client-runtime/state/thread-search.d.ts +1 -1
- package/dist/client-runtime/state/thread-search.js +1 -1
- package/dist/client-runtime/state/thread-settled.d.ts +11 -8
- package/dist/client-runtime/state/thread-settled.js +2 -229
- package/dist/client-runtime/state/thread-sort.d.ts +1 -1
- package/dist/client-runtime/state/thread-sort.js +1 -1
- package/dist/client-runtime/state/threads.d.ts +1 -1
- package/dist/client-runtime/state/threads.js +1 -1
- package/dist/client-runtime/state/vcs.d.ts +1 -1
- package/dist/client-runtime/state/vcs.js +1 -1
- package/dist/config.d.ts +1 -1
- package/dist/config.js +1 -1
- package/dist/connection.d.ts +1 -1
- package/dist/connection.js +1 -1
- package/dist/contracts.d.ts +1 -1
- package/dist/contracts.js +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +1 -1
- package/dist/node.d.ts +1 -1
- package/dist/node.js +1 -1
- package/dist/orchestration.d.ts +12 -6
- package/dist/orchestration.js +2 -2
- package/dist/preview.d.ts +1 -1
- package/dist/rpc.d.ts +4 -9
- package/dist/rpc.js +1 -1
- package/dist/runtime.d.ts +1 -1
- package/dist/shared/DrainableWorker.js +1 -1
- package/dist/shared/KeyedCoalescingWorker.js +1 -1
- package/dist/shared/Net.d.ts +6 -0
- package/dist/shared/Net.js +2 -1
- package/dist/shared/advertisedEndpoint.d.ts +1 -1
- package/dist/shared/advertisedEndpoint.js +1 -1
- package/dist/shared/agentAwareness.d.ts +1 -1
- package/dist/shared/backgroundActivitySettings.d.ts +1 -1
- package/dist/shared/connectAuth.d.ts +23 -4
- package/dist/shared/connectAuth.js +40 -7
- package/dist/shared/devHome.js +1 -1
- package/dist/shared/dpop.js +1 -1
- package/dist/shared/git.d.ts +1 -1
- package/dist/shared/httpObservability.js +1 -1
- package/dist/shared/httpReadiness.js +1 -1
- package/dist/shared/keybindings.d.ts +1 -1
- package/dist/shared/model.d.ts +1 -1
- package/dist/shared/oauthScope.js +1 -1
- package/dist/shared/observability.js +1 -1
- package/dist/shared/preview.js +1 -1
- package/dist/shared/previewViewport.d.ts +1 -1
- package/dist/shared/previewViewport.js +1 -1
- package/dist/shared/projectScripts.d.ts +1 -1
- package/dist/shared/relayAuth.js +1 -1
- package/dist/shared/relayClient.d.ts +1 -1
- package/dist/shared/relayClient.js +1 -1
- package/dist/shared/relayJwt.js +1 -1
- package/dist/shared/relayTracing.js +1 -1
- package/dist/shared/relayUrl.js +1 -1
- package/dist/shared/remote.js +1 -1
- package/dist/shared/schemaYaml.js +1 -1
- package/dist/shared/serverSettings.d.ts +1 -1
- package/dist/shared/serverSettings.js +1 -1
- package/dist/shared/shell.js +1 -1
- package/dist/shared/sourceControl.d.ts +1 -1
- package/dist/shared/t3ProjectFile.d.ts +1 -1
- package/dist/shared/t3ProjectFile.js +1 -1
- package/dist/shared/terminalLabels.d.ts +1 -1
- package/dist/shared/threadEnvMode.d.ts +1 -1
- package/dist/shared/toolActivity.d.ts +1 -1
- package/dist/shared/usageFormat.d.ts +16 -3
- package/dist/shared/usageFormat.js +92 -6
- package/dist/shared/usageMerge.d.ts +13 -2
- package/dist/shared/usageMerge.js +23 -0
- package/dist/shared.d.ts +3470 -378
- package/dist/shared.js +2434 -617
- package/dist/t3tools.d.ts +2 -2
- package/dist/t3tools.js +2 -2
- package/package.json +2 -2
- package/src/application/error.ts +2 -2
- package/src/application/index.ts +1 -0
- package/src/application/service.ts +38 -4
- package/src/application/thread-commands.ts +78 -0
- package/src/application/threads.ts +113 -16
- package/src/cli/app.ts +2 -0
- package/src/cli/ask-lifecycle.ts +331 -0
- package/src/cli/ask.ts +390 -0
- package/src/cli/error.ts +70 -0
- package/src/cli/format/thread.ts +26 -6
- package/src/cli/thread.ts +12 -0
- package/src/cli/threads/messages.ts +33 -3
- package/src/cli/threads/pin.ts +46 -0
- package/src/cli/threads/send.ts +5 -1
- package/src/cli/threads/settle.ts +46 -0
- package/src/cli/threads/snooze.ts +117 -0
- package/src/cli/threads/start.ts +6 -1
- package/src/cli/threads/unpin.ts +48 -0
- package/src/cli/threads/unsettle.ts +48 -0
- package/src/cli/threads/unsnooze.ts +48 -0
- package/src/connection/prepared.ts +12 -2
- package/src/orchestration/error.ts +10 -0
- package/src/orchestration/index.ts +1 -0
- package/src/orchestration/layer.ts +72 -0
- package/src/orchestration/service.ts +11 -3
- package/src/rpc/ws-group.ts +1 -0
- package/src/runtime/layer.ts +9 -4
|
@@ -0,0 +1,478 @@
|
|
|
1
|
+
import { $O as EnvironmentAuthorizationError, Da as EnvironmentNotRegisteredError, LE as PullRequestDiffInput, Oa as EnvironmentRegistry, RE as PullRequestDiffResult, TD as PullRequestUnavailableError, f as AtomCommand, hn as EnvironmentRpcUnavailableError, iD as PullRequestOperationError, ms as PreparedConnection, no as RemoteEnvironmentRequestError, vk as EnvironmentId } from "../../shared.js";
|
|
2
|
+
import * as Context from "effect/Context";
|
|
3
|
+
import * as Effect from "effect/Effect";
|
|
4
|
+
import "effect/Option";
|
|
5
|
+
import * as Layer from "effect/Layer";
|
|
6
|
+
import { HttpClient } from "effect/unstable/http";
|
|
7
|
+
import { Atom } from "effect/unstable/reactivity";
|
|
8
|
+
//#region upstream-t3code/packages/client-runtime/src/state/pullRequestDiffHttp.d.ts
|
|
9
|
+
declare const PullRequestDiffLoader_base: Context.ServiceClass<PullRequestDiffLoader, "@t3tools/client-runtime/state/pullRequestDiffHttp/PullRequestDiffLoader", {
|
|
10
|
+
readonly load: (prepared: PreparedConnection, input: PullRequestDiffInput) => Effect.Effect<PullRequestDiffResult, RemoteEnvironmentRequestError>;
|
|
11
|
+
}>;
|
|
12
|
+
declare class PullRequestDiffLoader extends PullRequestDiffLoader_base {}
|
|
13
|
+
declare const pullRequestDiffLoaderLayer: Layer.Layer<PullRequestDiffLoader, never, HttpClient.HttpClient>;
|
|
14
|
+
//#endregion
|
|
15
|
+
//#region upstream-t3code/packages/client-runtime/src/state/pullRequests.d.ts
|
|
16
|
+
declare const EnvironmentHttpConnectionNotReadyError_base: new <A extends Record<string, any> = {}>(args: import("effect/Types").VoidIfEmpty<{ readonly [P in keyof A as P extends "_tag" ? never : P]: A[P]; }>) => import("effect/Cause").YieldableError & {
|
|
17
|
+
readonly _tag: "EnvironmentHttpConnectionNotReadyError";
|
|
18
|
+
} & Readonly<A>;
|
|
19
|
+
declare class EnvironmentHttpConnectionNotReadyError extends EnvironmentHttpConnectionNotReadyError_base<{
|
|
20
|
+
readonly message: string;
|
|
21
|
+
}> {}
|
|
22
|
+
/**
|
|
23
|
+
* Every read shells out to the GitHub CLI, so results are reused for a short while and
|
|
24
|
+
* refreshed explicitly. Mutations run serially per environment: `gh` actions on the same
|
|
25
|
+
* pull request are order-sensitive, and the detail view refetches after each one.
|
|
26
|
+
*/
|
|
27
|
+
declare function createPullRequestEnvironmentAtoms<R, E>(runtime: Atom.AtomRuntime<EnvironmentRegistry | PullRequestDiffLoader | R, E>): {
|
|
28
|
+
list: (target: {
|
|
29
|
+
readonly environmentId: EnvironmentId;
|
|
30
|
+
readonly input: {
|
|
31
|
+
readonly state: "all" | "closed" | "merged" | "open";
|
|
32
|
+
readonly involvement?: "all" | "authored" | "reviewing" | undefined;
|
|
33
|
+
readonly filters?: {
|
|
34
|
+
readonly draft?: "hide" | "only" | undefined;
|
|
35
|
+
readonly review?: "approved" | "changes-requested" | "none" | "review-required" | undefined;
|
|
36
|
+
readonly checks?: "failing" | "passing" | undefined;
|
|
37
|
+
readonly labels?: readonly (readonly string[])[] | undefined;
|
|
38
|
+
readonly excludedLabels?: readonly string[] | undefined;
|
|
39
|
+
readonly author?: string | undefined;
|
|
40
|
+
} | undefined;
|
|
41
|
+
readonly projectId?: (string & import("effect/Brand").Brand<"ProjectId">) | undefined;
|
|
42
|
+
readonly projectIds?: readonly (string & import("effect/Brand").Brand<"ProjectId">)[] | undefined;
|
|
43
|
+
readonly host?: string | undefined;
|
|
44
|
+
readonly limit?: number | undefined;
|
|
45
|
+
readonly cursors?: {
|
|
46
|
+
readonly [x: string]: string;
|
|
47
|
+
} | undefined;
|
|
48
|
+
readonly query?: string | undefined;
|
|
49
|
+
};
|
|
50
|
+
}) => Atom.Atom<import("effect/unstable/reactivity/AsyncResult").AsyncResult<{
|
|
51
|
+
readonly viewers: {
|
|
52
|
+
readonly [x: string]: string;
|
|
53
|
+
};
|
|
54
|
+
readonly providers: readonly {
|
|
55
|
+
readonly host: string;
|
|
56
|
+
readonly kind: "azure-devops" | "bitbucket" | "github" | "gitlab" | "unknown";
|
|
57
|
+
readonly searchesOnHost: boolean;
|
|
58
|
+
readonly projectCount: number;
|
|
59
|
+
readonly configured: boolean;
|
|
60
|
+
readonly detail: string | null;
|
|
61
|
+
}[];
|
|
62
|
+
readonly entries: readonly {
|
|
63
|
+
readonly provider: "azure-devops" | "bitbucket" | "github" | "gitlab" | "unknown";
|
|
64
|
+
readonly host: string;
|
|
65
|
+
readonly projectId: string & import("effect/Brand").Brand<"ProjectId">;
|
|
66
|
+
readonly projectTitle: string;
|
|
67
|
+
readonly repository: string;
|
|
68
|
+
readonly number: number;
|
|
69
|
+
readonly title: string;
|
|
70
|
+
readonly url: string;
|
|
71
|
+
readonly author: {
|
|
72
|
+
readonly login: string;
|
|
73
|
+
readonly name: string | null;
|
|
74
|
+
readonly avatarUrl: string | null;
|
|
75
|
+
} | null;
|
|
76
|
+
readonly headBranch: string;
|
|
77
|
+
readonly baseBranch: string;
|
|
78
|
+
readonly state: "closed" | "merged" | "open";
|
|
79
|
+
readonly isDraft: boolean;
|
|
80
|
+
readonly mergeability: "conflicting" | "mergeable" | "unknown";
|
|
81
|
+
readonly additions: number;
|
|
82
|
+
readonly deletions: number;
|
|
83
|
+
readonly createdAt: string;
|
|
84
|
+
readonly updatedAt: string;
|
|
85
|
+
readonly viewerReviewRequested: boolean;
|
|
86
|
+
readonly labels: readonly {
|
|
87
|
+
readonly name: string;
|
|
88
|
+
readonly color: string | null;
|
|
89
|
+
}[];
|
|
90
|
+
readonly reviewDecision?: "approved" | "changes-requested" | "review-required" | undefined;
|
|
91
|
+
readonly checksState?: "failing" | "passing" | "pending" | undefined;
|
|
92
|
+
}[];
|
|
93
|
+
readonly errors: readonly {
|
|
94
|
+
readonly projectId: string & import("effect/Brand").Brand<"ProjectId">;
|
|
95
|
+
readonly projectTitle: string;
|
|
96
|
+
readonly message: string;
|
|
97
|
+
}[];
|
|
98
|
+
readonly truncated: boolean;
|
|
99
|
+
readonly nextCursors: {
|
|
100
|
+
readonly [x: string]: string;
|
|
101
|
+
};
|
|
102
|
+
}, E | EnvironmentAuthorizationError | EnvironmentRpcUnavailableError | Error | PullRequestOperationError | PullRequestUnavailableError | import("effect/unstable/rpc/RpcClientError").RpcClientError>>;
|
|
103
|
+
/**
|
|
104
|
+
* The line counts for rows the listing has already handed over. Its own query because the
|
|
105
|
+
* listing is quicker without them — measured over twelve repositories, ~4.0s against ~7.1s —
|
|
106
|
+
* so the rows arrive first and their stats a moment later. Kept longer than the listing:
|
|
107
|
+
* a change request's size only moves when somebody pushes to it.
|
|
108
|
+
*/
|
|
109
|
+
listStats: (target: {
|
|
110
|
+
readonly environmentId: EnvironmentId;
|
|
111
|
+
readonly input: {
|
|
112
|
+
readonly refs: readonly {
|
|
113
|
+
readonly projectId: string & import("effect/Brand").Brand<"ProjectId">;
|
|
114
|
+
readonly repository: string;
|
|
115
|
+
readonly number: number;
|
|
116
|
+
}[];
|
|
117
|
+
};
|
|
118
|
+
}) => Atom.Atom<import("effect/unstable/reactivity/AsyncResult").AsyncResult<{
|
|
119
|
+
readonly stats: readonly {
|
|
120
|
+
readonly projectId: string & import("effect/Brand").Brand<"ProjectId">;
|
|
121
|
+
readonly repository: string;
|
|
122
|
+
readonly number: number;
|
|
123
|
+
readonly additions: number;
|
|
124
|
+
readonly deletions: number;
|
|
125
|
+
}[];
|
|
126
|
+
}, E | EnvironmentAuthorizationError | EnvironmentRpcUnavailableError | Error | PullRequestOperationError | PullRequestUnavailableError | import("effect/unstable/rpc/RpcClientError").RpcClientError>>;
|
|
127
|
+
detail: (target: {
|
|
128
|
+
readonly environmentId: EnvironmentId;
|
|
129
|
+
readonly input: {
|
|
130
|
+
readonly projectId: string & import("effect/Brand").Brand<"ProjectId">;
|
|
131
|
+
readonly repository: string;
|
|
132
|
+
readonly number: number;
|
|
133
|
+
};
|
|
134
|
+
}) => Atom.Atom<import("effect/unstable/reactivity/AsyncResult").AsyncResult<{
|
|
135
|
+
readonly provider: "azure-devops" | "bitbucket" | "github" | "gitlab" | "unknown";
|
|
136
|
+
readonly capabilities: {
|
|
137
|
+
readonly diff: boolean;
|
|
138
|
+
readonly comment: boolean;
|
|
139
|
+
readonly actions: readonly ("close" | "disable-auto-merge" | "draft" | "enable-auto-merge" | "merge" | "ready" | "reopen" | "update-branch")[];
|
|
140
|
+
readonly mergeMethods: readonly ("merge" | "rebase" | "squash")[];
|
|
141
|
+
readonly updateMethods?: readonly ("merge" | "rebase")[] | undefined;
|
|
142
|
+
readonly search: boolean;
|
|
143
|
+
readonly reactions?: boolean | undefined;
|
|
144
|
+
readonly review: {
|
|
145
|
+
readonly inlineComment: boolean;
|
|
146
|
+
readonly reply: boolean;
|
|
147
|
+
readonly resolve: boolean;
|
|
148
|
+
readonly verdicts: readonly ("approve" | "comment" | "request-changes")[];
|
|
149
|
+
};
|
|
150
|
+
readonly reviewers: {
|
|
151
|
+
readonly request: boolean;
|
|
152
|
+
readonly listCandidates: boolean;
|
|
153
|
+
};
|
|
154
|
+
readonly edit?: {
|
|
155
|
+
readonly changeRequest: boolean;
|
|
156
|
+
readonly comment: boolean;
|
|
157
|
+
} | undefined;
|
|
158
|
+
};
|
|
159
|
+
readonly viewerPermissions: {
|
|
160
|
+
readonly actions: readonly ("close" | "disable-auto-merge" | "draft" | "enable-auto-merge" | "merge" | "ready" | "reopen" | "update-branch")[];
|
|
161
|
+
readonly comment: boolean;
|
|
162
|
+
readonly resolve: boolean;
|
|
163
|
+
readonly verdicts: readonly ("approve" | "comment" | "request-changes")[];
|
|
164
|
+
readonly requestReviewers: boolean;
|
|
165
|
+
readonly updateMethods?: readonly ("merge" | "rebase")[] | undefined;
|
|
166
|
+
};
|
|
167
|
+
readonly projectId: string & import("effect/Brand").Brand<"ProjectId">;
|
|
168
|
+
readonly projectTitle: string;
|
|
169
|
+
readonly workspaceRoot: string;
|
|
170
|
+
readonly repository: string;
|
|
171
|
+
readonly number: number;
|
|
172
|
+
readonly title: string;
|
|
173
|
+
readonly body: string;
|
|
174
|
+
readonly url: string;
|
|
175
|
+
readonly author: {
|
|
176
|
+
readonly login: string;
|
|
177
|
+
readonly name: string | null;
|
|
178
|
+
readonly avatarUrl: string | null;
|
|
179
|
+
} | null;
|
|
180
|
+
readonly state: "closed" | "merged" | "open";
|
|
181
|
+
readonly isDraft: boolean;
|
|
182
|
+
readonly mergeability: "conflicting" | "mergeable" | "unknown";
|
|
183
|
+
readonly additions: number;
|
|
184
|
+
readonly deletions: number;
|
|
185
|
+
readonly changedFiles: number;
|
|
186
|
+
readonly headBranch: string;
|
|
187
|
+
readonly baseBranch: string;
|
|
188
|
+
readonly createdAt: string;
|
|
189
|
+
readonly updatedAt: string;
|
|
190
|
+
readonly mergedAt: string | null;
|
|
191
|
+
readonly closedAt: string | null;
|
|
192
|
+
readonly reviewers: readonly {
|
|
193
|
+
readonly login: string;
|
|
194
|
+
readonly name: string | null;
|
|
195
|
+
readonly avatarUrl: string | null;
|
|
196
|
+
}[];
|
|
197
|
+
readonly labels: readonly {
|
|
198
|
+
readonly name: string;
|
|
199
|
+
readonly color: string | null;
|
|
200
|
+
}[];
|
|
201
|
+
readonly checks: readonly {
|
|
202
|
+
readonly name: string;
|
|
203
|
+
readonly status: "cancelled" | "failure" | "neutral" | "pending" | "skipped" | "success";
|
|
204
|
+
readonly description: string | null;
|
|
205
|
+
readonly url: string | null;
|
|
206
|
+
}[];
|
|
207
|
+
readonly mergeCapabilities: {
|
|
208
|
+
readonly merge: boolean;
|
|
209
|
+
readonly squash: boolean;
|
|
210
|
+
readonly rebase: boolean;
|
|
211
|
+
};
|
|
212
|
+
readonly viewer?: string | undefined;
|
|
213
|
+
readonly baseComparison?: "behind" | "unknown" | "up-to-date" | undefined;
|
|
214
|
+
readonly behindBy?: number | undefined;
|
|
215
|
+
readonly autoMergeEnabled?: boolean | undefined;
|
|
216
|
+
}, E | EnvironmentAuthorizationError | EnvironmentRpcUnavailableError | Error | PullRequestOperationError | PullRequestUnavailableError | import("effect/unstable/rpc/RpcClientError").RpcClientError>>;
|
|
217
|
+
activity: (target: {
|
|
218
|
+
readonly environmentId: EnvironmentId;
|
|
219
|
+
readonly input: {
|
|
220
|
+
readonly projectId: string & import("effect/Brand").Brand<"ProjectId">;
|
|
221
|
+
readonly repository: string;
|
|
222
|
+
readonly number: number;
|
|
223
|
+
};
|
|
224
|
+
}) => Atom.Atom<import("effect/unstable/reactivity/AsyncResult").AsyncResult<{
|
|
225
|
+
readonly author?: {
|
|
226
|
+
readonly login: string;
|
|
227
|
+
readonly name: string | null;
|
|
228
|
+
readonly avatarUrl: string | null;
|
|
229
|
+
} | null | undefined;
|
|
230
|
+
readonly reviewers?: readonly {
|
|
231
|
+
readonly login: string;
|
|
232
|
+
readonly name: string | null;
|
|
233
|
+
readonly avatarUrl: string | null;
|
|
234
|
+
}[] | undefined;
|
|
235
|
+
readonly comments: readonly {
|
|
236
|
+
readonly id: string;
|
|
237
|
+
readonly kind: "issue-comment" | "review" | "review-comment";
|
|
238
|
+
readonly author: {
|
|
239
|
+
readonly login: string;
|
|
240
|
+
readonly name: string | null;
|
|
241
|
+
readonly avatarUrl: string | null;
|
|
242
|
+
} | null;
|
|
243
|
+
readonly body: string;
|
|
244
|
+
readonly createdAt: string;
|
|
245
|
+
readonly url: string | null;
|
|
246
|
+
readonly path: string | null;
|
|
247
|
+
readonly reviewState: string | null;
|
|
248
|
+
readonly reactions?: readonly {
|
|
249
|
+
readonly content: "confused" | "eyes" | "heart" | "hooray" | "laugh" | "rocket" | "thumbs-down" | "thumbs-up";
|
|
250
|
+
readonly count: number;
|
|
251
|
+
readonly actors: readonly string[];
|
|
252
|
+
readonly viewerHasReacted: boolean;
|
|
253
|
+
}[] | undefined;
|
|
254
|
+
}[];
|
|
255
|
+
readonly commentCount: number;
|
|
256
|
+
readonly commentsTruncated: boolean;
|
|
257
|
+
readonly reviewThreads: readonly {
|
|
258
|
+
readonly id: string;
|
|
259
|
+
readonly path: string;
|
|
260
|
+
readonly line: number | null;
|
|
261
|
+
readonly side: "left" | "right";
|
|
262
|
+
readonly isResolved: boolean;
|
|
263
|
+
readonly isOutdated: boolean;
|
|
264
|
+
readonly comments: readonly {
|
|
265
|
+
readonly id: string;
|
|
266
|
+
readonly author: {
|
|
267
|
+
readonly login: string;
|
|
268
|
+
readonly name: string | null;
|
|
269
|
+
readonly avatarUrl: string | null;
|
|
270
|
+
} | null;
|
|
271
|
+
readonly body: string;
|
|
272
|
+
readonly createdAt: string;
|
|
273
|
+
readonly url: string | null;
|
|
274
|
+
readonly reactions?: readonly {
|
|
275
|
+
readonly content: "confused" | "eyes" | "heart" | "hooray" | "laugh" | "rocket" | "thumbs-down" | "thumbs-up";
|
|
276
|
+
readonly count: number;
|
|
277
|
+
readonly actors: readonly string[];
|
|
278
|
+
readonly viewerHasReacted: boolean;
|
|
279
|
+
}[] | undefined;
|
|
280
|
+
}[];
|
|
281
|
+
}[];
|
|
282
|
+
readonly commits: readonly {
|
|
283
|
+
readonly oid: string;
|
|
284
|
+
readonly messageHeadline: string;
|
|
285
|
+
readonly committedDate: string;
|
|
286
|
+
readonly additions?: number | undefined;
|
|
287
|
+
readonly deletions?: number | undefined;
|
|
288
|
+
readonly authors?: readonly {
|
|
289
|
+
readonly login: string;
|
|
290
|
+
readonly name: string | null;
|
|
291
|
+
readonly avatarUrl: string | null;
|
|
292
|
+
}[] | undefined;
|
|
293
|
+
}[];
|
|
294
|
+
readonly reactions?: readonly {
|
|
295
|
+
readonly content: "confused" | "eyes" | "heart" | "hooray" | "laugh" | "rocket" | "thumbs-down" | "thumbs-up";
|
|
296
|
+
readonly count: number;
|
|
297
|
+
readonly actors: readonly string[];
|
|
298
|
+
readonly viewerHasReacted: boolean;
|
|
299
|
+
}[] | undefined;
|
|
300
|
+
}, E | EnvironmentAuthorizationError | EnvironmentRpcUnavailableError | Error | PullRequestOperationError | PullRequestUnavailableError | import("effect/unstable/rpc/RpcClientError").RpcClientError>>;
|
|
301
|
+
diff: (target: {
|
|
302
|
+
readonly environmentId: EnvironmentId;
|
|
303
|
+
readonly input: {
|
|
304
|
+
readonly projectId: string & import("effect/Brand").Brand<"ProjectId">;
|
|
305
|
+
readonly repository: string;
|
|
306
|
+
readonly number: number;
|
|
307
|
+
readonly cursor?: string | undefined;
|
|
308
|
+
readonly commit?: string | undefined;
|
|
309
|
+
};
|
|
310
|
+
}) => Atom.Atom<import("effect/unstable/reactivity/AsyncResult").AsyncResult<{
|
|
311
|
+
readonly patch: string;
|
|
312
|
+
readonly truncated: boolean;
|
|
313
|
+
readonly nextCursor: string | null;
|
|
314
|
+
readonly omittedFileStats?: readonly {
|
|
315
|
+
readonly path: string;
|
|
316
|
+
readonly additions: number;
|
|
317
|
+
readonly deletions: number;
|
|
318
|
+
}[] | undefined;
|
|
319
|
+
}, E | EnvironmentHttpConnectionNotReadyError | Error | RemoteEnvironmentRequestError>>;
|
|
320
|
+
diffFileContents: AtomCommand<{
|
|
321
|
+
readonly environmentId: EnvironmentId;
|
|
322
|
+
readonly input: {
|
|
323
|
+
readonly projectId: string & import("effect/Brand").Brand<"ProjectId">;
|
|
324
|
+
readonly repository: string;
|
|
325
|
+
readonly number: number;
|
|
326
|
+
readonly commit?: string | undefined;
|
|
327
|
+
readonly changeType: "change" | "deleted" | "new" | "rename-changed" | "rename-pure";
|
|
328
|
+
readonly oldPath: string;
|
|
329
|
+
readonly newPath: string;
|
|
330
|
+
};
|
|
331
|
+
}, {
|
|
332
|
+
readonly oldContents: string;
|
|
333
|
+
readonly newContents: string;
|
|
334
|
+
}, E | EnvironmentAuthorizationError | EnvironmentNotRegisteredError | EnvironmentRpcUnavailableError | PullRequestOperationError | PullRequestUnavailableError | import("effect/unstable/rpc/RpcClientError").RpcClientError>;
|
|
335
|
+
runAction: AtomCommand<{
|
|
336
|
+
readonly environmentId: EnvironmentId;
|
|
337
|
+
readonly input: {
|
|
338
|
+
readonly projectId: string & import("effect/Brand").Brand<"ProjectId">;
|
|
339
|
+
readonly repository: string;
|
|
340
|
+
readonly number: number;
|
|
341
|
+
readonly action: "close" | "disable-auto-merge" | "draft" | "enable-auto-merge" | "merge" | "ready" | "reopen" | "update-branch";
|
|
342
|
+
readonly mergeMethod?: "merge" | "rebase" | "squash" | undefined;
|
|
343
|
+
readonly updateMethod?: "merge" | "rebase" | undefined;
|
|
344
|
+
};
|
|
345
|
+
}, void, E | EnvironmentAuthorizationError | EnvironmentNotRegisteredError | EnvironmentRpcUnavailableError | PullRequestOperationError | PullRequestUnavailableError | import("effect/unstable/rpc/RpcClientError").RpcClientError>;
|
|
346
|
+
update: AtomCommand<{
|
|
347
|
+
readonly environmentId: EnvironmentId;
|
|
348
|
+
readonly input: {
|
|
349
|
+
readonly projectId: string & import("effect/Brand").Brand<"ProjectId">;
|
|
350
|
+
readonly repository: string;
|
|
351
|
+
readonly number: number;
|
|
352
|
+
readonly title?: string | undefined;
|
|
353
|
+
readonly body?: string | undefined;
|
|
354
|
+
};
|
|
355
|
+
}, void, E | EnvironmentAuthorizationError | EnvironmentNotRegisteredError | EnvironmentRpcUnavailableError | PullRequestOperationError | PullRequestUnavailableError | import("effect/unstable/rpc/RpcClientError").RpcClientError>;
|
|
356
|
+
comment: AtomCommand<{
|
|
357
|
+
readonly environmentId: EnvironmentId;
|
|
358
|
+
readonly input: {
|
|
359
|
+
readonly projectId: string & import("effect/Brand").Brand<"ProjectId">;
|
|
360
|
+
readonly repository: string;
|
|
361
|
+
readonly number: number;
|
|
362
|
+
readonly body: string;
|
|
363
|
+
};
|
|
364
|
+
}, void, E | EnvironmentAuthorizationError | EnvironmentNotRegisteredError | EnvironmentRpcUnavailableError | PullRequestOperationError | PullRequestUnavailableError | import("effect/unstable/rpc/RpcClientError").RpcClientError>;
|
|
365
|
+
updateComment: AtomCommand<{
|
|
366
|
+
readonly environmentId: EnvironmentId;
|
|
367
|
+
readonly input: {
|
|
368
|
+
readonly projectId: string & import("effect/Brand").Brand<"ProjectId">;
|
|
369
|
+
readonly repository: string;
|
|
370
|
+
readonly number: number;
|
|
371
|
+
readonly commentId: string;
|
|
372
|
+
readonly kind: "issue-comment" | "review-comment";
|
|
373
|
+
readonly body: string;
|
|
374
|
+
};
|
|
375
|
+
}, void, E | EnvironmentAuthorizationError | EnvironmentNotRegisteredError | EnvironmentRpcUnavailableError | PullRequestOperationError | PullRequestUnavailableError | import("effect/unstable/rpc/RpcClientError").RpcClientError>;
|
|
376
|
+
submitReview: AtomCommand<{
|
|
377
|
+
readonly environmentId: EnvironmentId;
|
|
378
|
+
readonly input: {
|
|
379
|
+
readonly projectId: string & import("effect/Brand").Brand<"ProjectId">;
|
|
380
|
+
readonly repository: string;
|
|
381
|
+
readonly number: number;
|
|
382
|
+
readonly verdict: "approve" | "comment" | "request-changes";
|
|
383
|
+
readonly body: string;
|
|
384
|
+
readonly comments: readonly {
|
|
385
|
+
readonly path: string;
|
|
386
|
+
readonly oldPath?: string | undefined;
|
|
387
|
+
readonly line: number;
|
|
388
|
+
readonly side: "left" | "right";
|
|
389
|
+
readonly body: string;
|
|
390
|
+
}[];
|
|
391
|
+
};
|
|
392
|
+
}, void, E | EnvironmentAuthorizationError | EnvironmentNotRegisteredError | EnvironmentRpcUnavailableError | PullRequestOperationError | PullRequestUnavailableError | import("effect/unstable/rpc/RpcClientError").RpcClientError>;
|
|
393
|
+
replyToThread: AtomCommand<{
|
|
394
|
+
readonly environmentId: EnvironmentId;
|
|
395
|
+
readonly input: {
|
|
396
|
+
readonly projectId: string & import("effect/Brand").Brand<"ProjectId">;
|
|
397
|
+
readonly repository: string;
|
|
398
|
+
readonly number: number;
|
|
399
|
+
readonly threadId: string;
|
|
400
|
+
readonly body: string;
|
|
401
|
+
};
|
|
402
|
+
}, void, E | EnvironmentAuthorizationError | EnvironmentNotRegisteredError | EnvironmentRpcUnavailableError | PullRequestOperationError | PullRequestUnavailableError | import("effect/unstable/rpc/RpcClientError").RpcClientError>;
|
|
403
|
+
/**
|
|
404
|
+
* Its own query rather than part of the detail: the people who may be asked are only wanted
|
|
405
|
+
* once somebody opens the reviewer menu, so this atom is read then and not before. Kept fresh
|
|
406
|
+
* for a minute, because who has access to a repository changes far more slowly than the
|
|
407
|
+
* change request it is being read for.
|
|
408
|
+
*/
|
|
409
|
+
reviewerCandidates: (target: {
|
|
410
|
+
readonly environmentId: EnvironmentId;
|
|
411
|
+
readonly input: {
|
|
412
|
+
readonly projectId: string & import("effect/Brand").Brand<"ProjectId">;
|
|
413
|
+
readonly repository: string;
|
|
414
|
+
readonly number: number;
|
|
415
|
+
};
|
|
416
|
+
}) => Atom.Atom<import("effect/unstable/reactivity/AsyncResult").AsyncResult<{
|
|
417
|
+
readonly candidates: readonly {
|
|
418
|
+
readonly login: string;
|
|
419
|
+
readonly name: string | null;
|
|
420
|
+
readonly avatarUrl: string | null;
|
|
421
|
+
readonly id: string;
|
|
422
|
+
readonly kind: "team" | "user";
|
|
423
|
+
readonly isRequested: boolean;
|
|
424
|
+
}[];
|
|
425
|
+
readonly truncated: boolean;
|
|
426
|
+
}, E | EnvironmentAuthorizationError | EnvironmentRpcUnavailableError | Error | PullRequestOperationError | PullRequestUnavailableError | import("effect/unstable/rpc/RpcClientError").RpcClientError>>;
|
|
427
|
+
requestReviewers: AtomCommand<{
|
|
428
|
+
readonly environmentId: EnvironmentId;
|
|
429
|
+
readonly input: {
|
|
430
|
+
readonly projectId: string & import("effect/Brand").Brand<"ProjectId">;
|
|
431
|
+
readonly repository: string;
|
|
432
|
+
readonly number: number;
|
|
433
|
+
readonly reviewers: readonly {
|
|
434
|
+
readonly id: string;
|
|
435
|
+
readonly kind: "team" | "user";
|
|
436
|
+
}[];
|
|
437
|
+
readonly requested: boolean;
|
|
438
|
+
};
|
|
439
|
+
}, void, E | EnvironmentAuthorizationError | EnvironmentNotRegisteredError | EnvironmentRpcUnavailableError | PullRequestOperationError | PullRequestUnavailableError | import("effect/unstable/rpc/RpcClientError").RpcClientError>;
|
|
440
|
+
setThreadResolution: AtomCommand<{
|
|
441
|
+
readonly environmentId: EnvironmentId;
|
|
442
|
+
readonly input: {
|
|
443
|
+
readonly projectId: string & import("effect/Brand").Brand<"ProjectId">;
|
|
444
|
+
readonly repository: string;
|
|
445
|
+
readonly number: number;
|
|
446
|
+
readonly threadId: string;
|
|
447
|
+
readonly resolved: boolean;
|
|
448
|
+
};
|
|
449
|
+
}, void, E | EnvironmentAuthorizationError | EnvironmentNotRegisteredError | EnvironmentRpcUnavailableError | PullRequestOperationError | PullRequestUnavailableError | import("effect/unstable/rpc/RpcClientError").RpcClientError>;
|
|
450
|
+
setReaction: AtomCommand<{
|
|
451
|
+
readonly environmentId: EnvironmentId;
|
|
452
|
+
readonly input: {
|
|
453
|
+
readonly projectId: string & import("effect/Brand").Brand<"ProjectId">;
|
|
454
|
+
readonly repository: string;
|
|
455
|
+
readonly number: number;
|
|
456
|
+
readonly subjectId?: string | undefined;
|
|
457
|
+
readonly content: "confused" | "eyes" | "heart" | "hooray" | "laugh" | "rocket" | "thumbs-down" | "thumbs-up";
|
|
458
|
+
readonly reacted: boolean;
|
|
459
|
+
};
|
|
460
|
+
}, void, E | EnvironmentAuthorizationError | EnvironmentNotRegisteredError | EnvironmentRpcUnavailableError | PullRequestOperationError | PullRequestUnavailableError | import("effect/unstable/rpc/RpcClientError").RpcClientError>;
|
|
461
|
+
/**
|
|
462
|
+
* Explicit refresh: forget the server's cached answers, then re-run the reads. A separate
|
|
463
|
+
* request rather than a flag on a read, so only a person's refresh spends host requests
|
|
464
|
+
* while every silent re-read shares the cache.
|
|
465
|
+
*/
|
|
466
|
+
invalidate: AtomCommand<{
|
|
467
|
+
readonly environmentId: EnvironmentId;
|
|
468
|
+
readonly input: {
|
|
469
|
+
readonly reference?: {
|
|
470
|
+
readonly projectId: string & import("effect/Brand").Brand<"ProjectId">;
|
|
471
|
+
readonly repository: string;
|
|
472
|
+
readonly number: number;
|
|
473
|
+
} | undefined;
|
|
474
|
+
};
|
|
475
|
+
}, void, E | EnvironmentAuthorizationError | EnvironmentNotRegisteredError | EnvironmentRpcUnavailableError | PullRequestOperationError | PullRequestUnavailableError | import("effect/unstable/rpc/RpcClientError").RpcClientError>;
|
|
476
|
+
};
|
|
477
|
+
//#endregion
|
|
478
|
+
export { EnvironmentHttpConnectionNotReadyError, PullRequestDiffLoader, createPullRequestEnvironmentAtoms, pullRequestDiffLoaderLayer };
|
|
@@ -0,0 +1,172 @@
|
|
|
1
|
+
import { AN as Service, HM as TaggedError, Ho as makeEnvironmentHttpApiClient, Hr as buildEnvironmentAuthHeaders, Kj as fn, Qj as gen, Ra as EnvironmentSupervisor, Uo as makeEnvironmentHttpApiUrlBuilder, Ur as withEnvironmentCredentials, VN as isNone, Vo as executeEnvironmentHttpRequest, Vy as get, YM as effect, _r as createEnvironmentRpcCommand, gr as createEnvironmentQueryAtomFamily, hM as provideService, lc as WS_METHODS, mr as createAtomCommandScheduler, ro as ManagedRelayDpopSigner, vD as HttpClient, vr as createEnvironmentRpcQueryAtomFamily, yM as serviceOption } from "../../shared.js";
|
|
2
|
+
//#region upstream-t3code/packages/client-runtime/src/state/pullRequestDiffHttp.ts
|
|
3
|
+
const DEFAULT_PULL_REQUEST_DIFF_TIMEOUT_MS = 6e4;
|
|
4
|
+
const fetchEnvironmentPullRequestDiff = fn("clientRuntime.state.fetchEnvironmentPullRequestDiff")(function* (input) {
|
|
5
|
+
const requestUrl = makeEnvironmentHttpApiUrlBuilder(input.prepared.httpBaseUrl).pullRequests.diff();
|
|
6
|
+
const client = yield* makeEnvironmentHttpApiClient(input.prepared.httpBaseUrl);
|
|
7
|
+
const headers = yield* buildEnvironmentAuthHeaders(input.prepared.httpAuthorization, "POST", requestUrl, input.signer);
|
|
8
|
+
return yield* executeEnvironmentHttpRequest(requestUrl, input.timeoutMs ?? DEFAULT_PULL_REQUEST_DIFF_TIMEOUT_MS, withEnvironmentCredentials(input.prepared.httpAuthorization, client.pullRequests.diff({
|
|
9
|
+
payload: input.diff,
|
|
10
|
+
headers
|
|
11
|
+
})));
|
|
12
|
+
});
|
|
13
|
+
var PullRequestDiffLoader = class extends Service()("@t3tools/client-runtime/state/pullRequestDiffHttp/PullRequestDiffLoader") {};
|
|
14
|
+
const pullRequestDiffLoaderLayer = effect(PullRequestDiffLoader, gen(function* () {
|
|
15
|
+
const httpClient = yield* HttpClient;
|
|
16
|
+
const signer = yield* serviceOption(ManagedRelayDpopSigner);
|
|
17
|
+
return PullRequestDiffLoader.of({ load: (prepared, input) => fetchEnvironmentPullRequestDiff({
|
|
18
|
+
prepared,
|
|
19
|
+
diff: input,
|
|
20
|
+
signer
|
|
21
|
+
}).pipe(provideService(HttpClient, httpClient)) });
|
|
22
|
+
}));
|
|
23
|
+
//#endregion
|
|
24
|
+
//#region upstream-t3code/packages/client-runtime/src/state/pullRequests.ts
|
|
25
|
+
var EnvironmentHttpConnectionNotReadyError = class extends TaggedError("EnvironmentHttpConnectionNotReadyError") {};
|
|
26
|
+
/**
|
|
27
|
+
* Every read shells out to the GitHub CLI, so results are reused for a short while and
|
|
28
|
+
* refreshed explicitly. Mutations run serially per environment: `gh` actions on the same
|
|
29
|
+
* pull request are order-sensitive, and the detail view refetches after each one.
|
|
30
|
+
*/
|
|
31
|
+
function createPullRequestEnvironmentAtoms(runtime) {
|
|
32
|
+
const commandScheduler = createAtomCommandScheduler();
|
|
33
|
+
const serialPerEnvironment = {
|
|
34
|
+
mode: "serial",
|
|
35
|
+
key: ({ environmentId }) => environmentId
|
|
36
|
+
};
|
|
37
|
+
return {
|
|
38
|
+
list: createEnvironmentRpcQueryAtomFamily(runtime, {
|
|
39
|
+
label: "environment-data:pull-requests:list",
|
|
40
|
+
tag: WS_METHODS.pullRequestsList,
|
|
41
|
+
staleTimeMs: 3e4
|
|
42
|
+
}),
|
|
43
|
+
/**
|
|
44
|
+
* The line counts for rows the listing has already handed over. Its own query because the
|
|
45
|
+
* listing is quicker without them — measured over twelve repositories, ~4.0s against ~7.1s —
|
|
46
|
+
* so the rows arrive first and their stats a moment later. Kept longer than the listing:
|
|
47
|
+
* a change request's size only moves when somebody pushes to it.
|
|
48
|
+
*/
|
|
49
|
+
listStats: createEnvironmentRpcQueryAtomFamily(runtime, {
|
|
50
|
+
label: "environment-data:pull-requests:list-stats",
|
|
51
|
+
tag: WS_METHODS.pullRequestsListStats,
|
|
52
|
+
staleTimeMs: 6e4
|
|
53
|
+
}),
|
|
54
|
+
detail: createEnvironmentRpcQueryAtomFamily(runtime, {
|
|
55
|
+
label: "environment-data:pull-requests:detail",
|
|
56
|
+
tag: WS_METHODS.pullRequestsDetail,
|
|
57
|
+
staleTimeMs: 15e3
|
|
58
|
+
}),
|
|
59
|
+
activity: createEnvironmentRpcQueryAtomFamily(runtime, {
|
|
60
|
+
label: "environment-data:pull-requests:activity",
|
|
61
|
+
tag: WS_METHODS.pullRequestsActivity,
|
|
62
|
+
staleTimeMs: 15e3
|
|
63
|
+
}),
|
|
64
|
+
diff: createEnvironmentQueryAtomFamily(runtime, {
|
|
65
|
+
label: "environment-data:pull-requests:diff",
|
|
66
|
+
staleTimeMs: 6e4,
|
|
67
|
+
execute: (input) => gen(function* () {
|
|
68
|
+
const supervisor = yield* EnvironmentSupervisor;
|
|
69
|
+
const loader = yield* PullRequestDiffLoader;
|
|
70
|
+
const prepared = yield* get(supervisor.prepared);
|
|
71
|
+
if (isNone(prepared)) return yield* new EnvironmentHttpConnectionNotReadyError({ message: "The environment HTTP connection is not ready." });
|
|
72
|
+
return yield* loader.load(prepared.value, input);
|
|
73
|
+
})
|
|
74
|
+
}),
|
|
75
|
+
diffFileContents: createEnvironmentRpcCommand(runtime, {
|
|
76
|
+
label: "environment-data:pull-requests:diff-file-contents",
|
|
77
|
+
tag: WS_METHODS.pullRequestsDiffFileContents,
|
|
78
|
+
scheduler: commandScheduler,
|
|
79
|
+
concurrency: {
|
|
80
|
+
mode: "singleFlight",
|
|
81
|
+
key: ({ environmentId, input }) => JSON.stringify([
|
|
82
|
+
environmentId,
|
|
83
|
+
input.projectId,
|
|
84
|
+
input.repository,
|
|
85
|
+
input.number,
|
|
86
|
+
input.commit ?? null,
|
|
87
|
+
input.changeType,
|
|
88
|
+
input.oldPath,
|
|
89
|
+
input.newPath
|
|
90
|
+
])
|
|
91
|
+
}
|
|
92
|
+
}),
|
|
93
|
+
runAction: createEnvironmentRpcCommand(runtime, {
|
|
94
|
+
label: "environment-data:pull-requests:run-action",
|
|
95
|
+
tag: WS_METHODS.pullRequestsRunAction,
|
|
96
|
+
scheduler: commandScheduler,
|
|
97
|
+
concurrency: serialPerEnvironment
|
|
98
|
+
}),
|
|
99
|
+
update: createEnvironmentRpcCommand(runtime, {
|
|
100
|
+
label: "environment-data:pull-requests:update",
|
|
101
|
+
tag: WS_METHODS.pullRequestsUpdate,
|
|
102
|
+
scheduler: commandScheduler,
|
|
103
|
+
concurrency: serialPerEnvironment
|
|
104
|
+
}),
|
|
105
|
+
comment: createEnvironmentRpcCommand(runtime, {
|
|
106
|
+
label: "environment-data:pull-requests:comment",
|
|
107
|
+
tag: WS_METHODS.pullRequestsComment,
|
|
108
|
+
scheduler: commandScheduler,
|
|
109
|
+
concurrency: serialPerEnvironment
|
|
110
|
+
}),
|
|
111
|
+
updateComment: createEnvironmentRpcCommand(runtime, {
|
|
112
|
+
label: "environment-data:pull-requests:update-comment",
|
|
113
|
+
tag: WS_METHODS.pullRequestsUpdateComment,
|
|
114
|
+
scheduler: commandScheduler,
|
|
115
|
+
concurrency: serialPerEnvironment
|
|
116
|
+
}),
|
|
117
|
+
submitReview: createEnvironmentRpcCommand(runtime, {
|
|
118
|
+
label: "environment-data:pull-requests:submit-review",
|
|
119
|
+
tag: WS_METHODS.pullRequestsSubmitReview,
|
|
120
|
+
scheduler: commandScheduler,
|
|
121
|
+
concurrency: serialPerEnvironment
|
|
122
|
+
}),
|
|
123
|
+
replyToThread: createEnvironmentRpcCommand(runtime, {
|
|
124
|
+
label: "environment-data:pull-requests:reply-to-thread",
|
|
125
|
+
tag: WS_METHODS.pullRequestsReplyToThread,
|
|
126
|
+
scheduler: commandScheduler,
|
|
127
|
+
concurrency: serialPerEnvironment
|
|
128
|
+
}),
|
|
129
|
+
/**
|
|
130
|
+
* Its own query rather than part of the detail: the people who may be asked are only wanted
|
|
131
|
+
* once somebody opens the reviewer menu, so this atom is read then and not before. Kept fresh
|
|
132
|
+
* for a minute, because who has access to a repository changes far more slowly than the
|
|
133
|
+
* change request it is being read for.
|
|
134
|
+
*/
|
|
135
|
+
reviewerCandidates: createEnvironmentRpcQueryAtomFamily(runtime, {
|
|
136
|
+
label: "environment-data:pull-requests:reviewer-candidates",
|
|
137
|
+
tag: WS_METHODS.pullRequestsReviewerCandidates,
|
|
138
|
+
staleTimeMs: 6e4
|
|
139
|
+
}),
|
|
140
|
+
requestReviewers: createEnvironmentRpcCommand(runtime, {
|
|
141
|
+
label: "environment-data:pull-requests:request-reviewers",
|
|
142
|
+
tag: WS_METHODS.pullRequestsRequestReviewers,
|
|
143
|
+
scheduler: commandScheduler,
|
|
144
|
+
concurrency: serialPerEnvironment
|
|
145
|
+
}),
|
|
146
|
+
setThreadResolution: createEnvironmentRpcCommand(runtime, {
|
|
147
|
+
label: "environment-data:pull-requests:set-thread-resolution",
|
|
148
|
+
tag: WS_METHODS.pullRequestsSetThreadResolution,
|
|
149
|
+
scheduler: commandScheduler,
|
|
150
|
+
concurrency: serialPerEnvironment
|
|
151
|
+
}),
|
|
152
|
+
setReaction: createEnvironmentRpcCommand(runtime, {
|
|
153
|
+
label: "environment-data:pull-requests:set-reaction",
|
|
154
|
+
tag: WS_METHODS.pullRequestsSetReaction,
|
|
155
|
+
scheduler: commandScheduler,
|
|
156
|
+
concurrency: serialPerEnvironment
|
|
157
|
+
}),
|
|
158
|
+
/**
|
|
159
|
+
* Explicit refresh: forget the server's cached answers, then re-run the reads. A separate
|
|
160
|
+
* request rather than a flag on a read, so only a person's refresh spends host requests
|
|
161
|
+
* while every silent re-read shares the cache.
|
|
162
|
+
*/
|
|
163
|
+
invalidate: createEnvironmentRpcCommand(runtime, {
|
|
164
|
+
label: "environment-data:pull-requests:invalidate",
|
|
165
|
+
tag: WS_METHODS.pullRequestsInvalidate,
|
|
166
|
+
scheduler: commandScheduler,
|
|
167
|
+
concurrency: serialPerEnvironment
|
|
168
|
+
})
|
|
169
|
+
};
|
|
170
|
+
}
|
|
171
|
+
//#endregion
|
|
172
|
+
export { EnvironmentHttpConnectionNotReadyError, PullRequestDiffLoader, createPullRequestEnvironmentAtoms, pullRequestDiffLoaderLayer };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { f as AtomCommand, ma as RelayEnvironmentDiscoveryState, pa as RelayEnvironmentDiscovery } from "../../shared.js";
|
|
2
2
|
import { AsyncResult, Atom } from "effect/unstable/reactivity";
|
|
3
3
|
//#region upstream-t3code/packages/client-runtime/src/state/relayDiscovery.d.ts
|
|
4
4
|
declare function createRelayEnvironmentDiscoveryAtoms<R, E>(runtime: Atom.AtomRuntime<RelayEnvironmentDiscovery | R, E>): {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { By as changes, Gj as flatMap, Kr as make, LN as getOrElse, Sr as createRuntimeCommand, Yr as withLabel, ei as value, fa as EMPTY_RELAY_ENVIRONMENT_DISCOVERY_STATE, pa as RelayEnvironmentDiscovery, rM as map, sj as unwrap } from "../../shared.js";
|
|
2
2
|
//#region upstream-t3code/packages/client-runtime/src/state/relayDiscovery.ts
|
|
3
3
|
function createRelayEnvironmentDiscoveryAtoms(runtime) {
|
|
4
4
|
const stateAtom = runtime.atom(unwrap(RelayEnvironmentDiscovery.pipe(map((discovery) => changes(discovery.state)))), { initialValue: EMPTY_RELAY_ENVIRONMENT_DISCOVERY_STATE });
|