@knpkv/codecommit-web 0.15.0 → 0.17.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 +13 -0
- package/dist/client/assets/index-BQbzvlT7.js +90 -0
- package/dist/client/assets/index-Rg2HVfx7.css +1 -0
- package/dist/client/assets/pr-review-workspace-B7GX-PRi.js +23 -0
- package/dist/client/index.html +2 -2
- package/dist/pull-request-coordinates.d.ts.map +1 -1
- package/dist/pull-request-coordinates.js +5 -4
- package/dist/pull-request-coordinates.js.map +1 -1
- package/dist/server/Api.d.ts +269 -269
- package/dist/server/Api.d.ts.map +1 -1
- package/dist/server/Api.js +3 -3
- package/dist/server/Api.js.map +1 -1
- package/dist/server/Server.d.ts +3 -3
- package/dist/server/Server.d.ts.map +1 -1
- package/dist/server/Server.js +13 -11
- package/dist/server/Server.js.map +1 -1
- package/dist/server/handlers/accounts-live.d.ts +1 -1
- package/dist/server/handlers/accounts-live.d.ts.map +1 -1
- package/dist/server/handlers/accounts-live.js +1 -1
- package/dist/server/handlers/accounts-live.js.map +1 -1
- package/dist/server/handlers/audit-live.d.ts +1 -1
- package/dist/server/handlers/audit-live.d.ts.map +1 -1
- package/dist/server/handlers/audit-live.js +1 -1
- package/dist/server/handlers/audit-live.js.map +1 -1
- package/dist/server/handlers/config-live.d.ts +1 -1
- package/dist/server/handlers/config-live.d.ts.map +1 -1
- package/dist/server/handlers/config-live.js +2 -2
- package/dist/server/handlers/config-live.js.map +1 -1
- package/dist/server/handlers/events-live.d.ts +1 -1
- package/dist/server/handlers/events-live.d.ts.map +1 -1
- package/dist/server/handlers/events-live.js +26 -8
- package/dist/server/handlers/events-live.js.map +1 -1
- package/dist/server/handlers/notifications-live.d.ts +2 -2
- package/dist/server/handlers/notifications-live.d.ts.map +1 -1
- package/dist/server/handlers/notifications-live.js +2 -2
- package/dist/server/handlers/notifications-live.js.map +1 -1
- package/dist/server/handlers/permissions-live.d.ts +1 -1
- package/dist/server/handlers/permissions-live.d.ts.map +1 -1
- package/dist/server/handlers/permissions-live.js +1 -1
- package/dist/server/handlers/permissions-live.js.map +1 -1
- package/dist/server/handlers/prs-live.d.ts +15 -15
- package/dist/server/handlers/prs-live.d.ts.map +1 -1
- package/dist/server/handlers/prs-live.js +3 -3
- package/dist/server/handlers/prs-live.js.map +1 -1
- package/dist/server/handlers/sandbox-live.d.ts +1 -1
- package/dist/server/handlers/sandbox-live.d.ts.map +1 -1
- package/dist/server/handlers/sandbox-live.js +2 -2
- package/dist/server/handlers/sandbox-live.js.map +1 -1
- package/dist/server/handlers/stats-live.d.ts +1 -1
- package/dist/server/handlers/stats-live.d.ts.map +1 -1
- package/dist/server/handlers/stats-live.js +1 -1
- package/dist/server/handlers/stats-live.js.map +1 -1
- package/dist/server/handlers/subscriptions-live.d.ts +1 -1
- package/dist/server/handlers/subscriptions-live.d.ts.map +1 -1
- package/dist/server/handlers/subscriptions-live.js +1 -1
- package/dist/server/handlers/subscriptions-live.js.map +1 -1
- package/dist/server/internal/OwnerSessionSecurity.d.ts +19 -8
- package/dist/server/internal/OwnerSessionSecurity.d.ts.map +1 -1
- package/dist/server/internal/OwnerSessionSecurity.js +109 -32
- package/dist/server/internal/OwnerSessionSecurity.js.map +1 -1
- package/dist/server/internal/PublicOrigin.d.ts +9 -0
- package/dist/server/internal/PublicOrigin.d.ts.map +1 -0
- package/dist/server/internal/PublicOrigin.js +17 -0
- package/dist/server/internal/PublicOrigin.js.map +1 -0
- package/dist/server/review/PullRequestReview.d.ts +77 -22
- package/dist/server/review/PullRequestReview.d.ts.map +1 -1
- package/dist/server/review/PullRequestReview.js +61 -18
- package/dist/server/review/PullRequestReview.js.map +1 -1
- package/dist/server/review/ReviewPromptBudget.d.ts +4 -0
- package/dist/server/review/ReviewPromptBudget.d.ts.map +1 -1
- package/dist/server/review/ReviewPromptBudget.js +4 -0
- package/dist/server/review/ReviewPromptBudget.js.map +1 -1
- package/dist/server/review/ReviewSkillCatalog.js +2 -2
- package/dist/tooling/authenticated-dev-proxy.d.ts +20 -5
- package/dist/tooling/authenticated-dev-proxy.d.ts.map +1 -1
- package/dist/tooling/authenticated-dev-proxy.js +25 -9
- package/dist/tooling/authenticated-dev-proxy.js.map +1 -1
- package/dist/tooling/authenticated-dev-proxy.test.js +96 -5
- package/dist/tooling/authenticated-dev-proxy.test.js.map +1 -1
- package/package.json +32 -25
- package/dist/client/assets/index-Ds8Muxxv.css +0 -1
- package/dist/client/assets/index-eLkbewLN.js +0 -90
- package/dist/client/assets/pr-review-workspace-CgczAXj_.js +0 -22
|
@@ -1,11 +1,14 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
1
|
+
import { credentialValuesEqual, decideOneTimeCredential, expiresAt, issueCsrfToken, issuePairingCode, issueSessionToken, serializeCredentialCookie } from "@knpkv/browser-pairing";
|
|
2
|
+
import { Clock, Context, Effect, Layer, Redacted, Ref, Schema } from "effect";
|
|
3
|
+
import { HttpRouter, HttpServerRequest, HttpServerResponse } from "effect/http";
|
|
3
4
|
import { ForbiddenApiError, OwnerSessionAuth, UnauthorizedApiError } from "../Api.js";
|
|
4
5
|
export class OwnerSessionSecrets extends Context.Service()("@knpkv/codecommit-web/OwnerSessionSecrets") {
|
|
5
6
|
}
|
|
6
7
|
export class UnsafeServerHostnameError extends Schema.TaggedError()("UnsafeServerHostnameError", { hostname: Schema.String, message: Schema.String }) {
|
|
7
8
|
}
|
|
8
9
|
const safeMethods = new Set(["GET", "HEAD", "OPTIONS"]);
|
|
10
|
+
const MAX_BOOTSTRAP_FAILURES = 5;
|
|
11
|
+
const authenticatedDevPublicOrigin = "http://localhost:5173";
|
|
9
12
|
export const isLoopbackHostname = (hostname) => hostname === "127.0.0.1" || hostname === "localhost" || hostname === "::1" || hostname === "[::1]";
|
|
10
13
|
export const requireLoopbackHostname = Effect.fn("OwnerSessionSecurity.requireLoopbackHostname")(function* (hostname) {
|
|
11
14
|
if (!isLoopbackHostname(hostname)) {
|
|
@@ -16,25 +19,29 @@ export const requireLoopbackHostname = Effect.fn("OwnerSessionSecurity.requireLo
|
|
|
16
19
|
}
|
|
17
20
|
return hostname;
|
|
18
21
|
});
|
|
19
|
-
export const makeOwnerSessionSecrets = Effect.fn("OwnerSessionSecurity.makeSecrets")(function* () {
|
|
20
|
-
const
|
|
22
|
+
export const makeOwnerSessionSecrets = Effect.fn("OwnerSessionSecurity.makeSecrets")(function* (authorityOrigin) {
|
|
23
|
+
const validatedAuthorityOrigin = yield* requireLoopbackOrigin(authorityOrigin);
|
|
21
24
|
const [ownerToken, csrfToken, bootstrapToken] = yield* Effect.all([
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
+
issueSessionToken(),
|
|
26
|
+
issueCsrfToken(),
|
|
27
|
+
issuePairingCode()
|
|
25
28
|
]);
|
|
26
29
|
const bootstrapAvailable = yield* Ref.make(true);
|
|
30
|
+
const bootstrapAttemptState = yield* Ref.make({ failedAttempts: 0, inFlight: 0 });
|
|
27
31
|
return OwnerSessionSecrets.of({
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
32
|
+
authorityOrigin: validatedAuthorityOrigin,
|
|
33
|
+
ownerToken,
|
|
34
|
+
csrfToken,
|
|
35
|
+
bootstrapToken,
|
|
31
36
|
bootstrapAvailable,
|
|
37
|
+
bootstrapAttemptState,
|
|
32
38
|
bootstrapExpiresAtMillis: yield* Ref.make(undefined)
|
|
33
39
|
});
|
|
34
40
|
});
|
|
35
41
|
export const activateOwnerSessionBootstrap = Effect.fn("OwnerSessionSecurity.activateBootstrap")(function* (secrets) {
|
|
36
42
|
const now = yield* Clock.currentTimeMillis;
|
|
37
|
-
yield*
|
|
43
|
+
const expiry = yield* expiresAt(now, 60_000);
|
|
44
|
+
yield* Ref.set(secrets.bootstrapExpiresAtMillis, expiry);
|
|
38
45
|
});
|
|
39
46
|
export const ownerSessionOrigin = (hostname, port) => {
|
|
40
47
|
const urlHostname = hostname === "::1" ? "[::1]" : hostname;
|
|
@@ -53,7 +60,11 @@ export const requireLoopbackOrigin = Effect.fn("OwnerSessionSecurity.requireLoop
|
|
|
53
60
|
message: "CodeCommit public origin must be a valid loopback HTTP origin"
|
|
54
61
|
})
|
|
55
62
|
});
|
|
56
|
-
if (url.protocol !== "http:" ||
|
|
63
|
+
if (url.protocol !== "http:" ||
|
|
64
|
+
!isLoopbackHostname(url.hostname) ||
|
|
65
|
+
url.pathname !== "/" ||
|
|
66
|
+
url.search !== "" ||
|
|
67
|
+
url.hash !== "") {
|
|
57
68
|
return yield* new UnsafeServerHostnameError({
|
|
58
69
|
hostname: origin,
|
|
59
70
|
message: "CodeCommit public origin must be an HTTP loopback origin without a path, query, or fragment"
|
|
@@ -61,12 +72,39 @@ export const requireLoopbackOrigin = Effect.fn("OwnerSessionSecurity.requireLoop
|
|
|
61
72
|
}
|
|
62
73
|
return url.origin;
|
|
63
74
|
});
|
|
64
|
-
|
|
75
|
+
/** Validate the advertised origin against either the bound server or the supported Vite proxy. */
|
|
76
|
+
export const requireSupportedPublicOrigin = Effect.fn("OwnerSessionSecurity.requireSupportedPublicOrigin")(function* (origin, authorityOrigin) {
|
|
77
|
+
const validatedOrigin = yield* requireLoopbackOrigin(origin);
|
|
78
|
+
const validatedAuthority = yield* requireLoopbackOrigin(authorityOrigin);
|
|
79
|
+
const authorityUrl = new URL(validatedAuthority);
|
|
80
|
+
const isSupportedProxy = validatedOrigin === authenticatedDevPublicOrigin &&
|
|
81
|
+
authorityUrl.protocol === "http:" && authorityUrl.hostname === "127.0.0.1";
|
|
82
|
+
if (validatedOrigin !== validatedAuthority && !isSupportedProxy) {
|
|
83
|
+
return yield* new UnsafeServerHostnameError({
|
|
84
|
+
hostname: origin,
|
|
85
|
+
message: "CodeCommit public origin must be the bound server or its supported Vite proxy"
|
|
86
|
+
});
|
|
87
|
+
}
|
|
88
|
+
return validatedOrigin;
|
|
89
|
+
});
|
|
90
|
+
export const resolvePublicOrigin = Effect.fn("OwnerSessionSecurity.resolvePublicOrigin")(function* (configuredOrigin, authorityOrigin) {
|
|
91
|
+
return configuredOrigin === undefined
|
|
92
|
+
? yield* requireLoopbackOrigin(authorityOrigin)
|
|
93
|
+
: yield* requireSupportedPublicOrigin(configuredOrigin, authorityOrigin);
|
|
94
|
+
});
|
|
95
|
+
export const ownerSessionCookie = (secrets) => serializeCredentialCookie(secrets.ownerToken, {
|
|
96
|
+
name: "cc_owner",
|
|
97
|
+
httpOnly: true,
|
|
98
|
+
path: "/api",
|
|
99
|
+
sameSite: "strict",
|
|
100
|
+
secure: false
|
|
101
|
+
});
|
|
65
102
|
export const authorizeOwnerRequest = Effect.fn("OwnerSessionSecurity.authorizeRequest")(function* (request, secrets) {
|
|
66
|
-
|
|
103
|
+
const ownerCredentialMatches = credentialValuesEqual(request.credential, Redacted.value(secrets.ownerToken)) === true;
|
|
104
|
+
if (!ownerCredentialMatches) {
|
|
67
105
|
return yield* new UnauthorizedApiError({ message: "Missing or invalid owner session" });
|
|
68
106
|
}
|
|
69
|
-
const sameOrigin = request.
|
|
107
|
+
const sameOrigin = request.origin !== undefined && request.origin === secrets.authorityOrigin;
|
|
70
108
|
if (request.origin !== undefined && !sameOrigin) {
|
|
71
109
|
return yield* new ForbiddenApiError({ message: "Request origin does not match the CodeCommit server" });
|
|
72
110
|
}
|
|
@@ -77,29 +115,68 @@ export const authorizeOwnerRequest = Effect.fn("OwnerSessionSecurity.authorizeRe
|
|
|
77
115
|
if (!sameOrigin) {
|
|
78
116
|
return yield* new ForbiddenApiError({ message: "Mutation origin does not match the CodeCommit server" });
|
|
79
117
|
}
|
|
80
|
-
|
|
118
|
+
const csrfTokenMatches = request.csrfToken !== undefined &&
|
|
119
|
+
credentialValuesEqual(request.csrfToken, Redacted.value(secrets.csrfToken)) === true;
|
|
120
|
+
if (!csrfTokenMatches) {
|
|
81
121
|
return yield* new ForbiddenApiError({ message: "Missing or invalid CSRF token" });
|
|
82
122
|
}
|
|
83
123
|
});
|
|
84
124
|
export const authorizeBootstrapRequest = Effect.fn("OwnerSessionSecurity.authorizeBootstrap")(function* (request, secrets) {
|
|
85
|
-
if (request.
|
|
86
|
-
return yield* new UnauthorizedApiError({ message: "Missing or invalid bootstrap token" });
|
|
87
|
-
}
|
|
88
|
-
if (request.host === undefined || request.origin !== `http://${request.host}`) {
|
|
125
|
+
if (request.origin !== secrets.authorityOrigin) {
|
|
89
126
|
return yield* new ForbiddenApiError({ message: "Bootstrap origin does not match the CodeCommit server" });
|
|
90
127
|
}
|
|
91
|
-
const
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
128
|
+
const suppliedToken = request.authorization !== undefined && request.authorization.startsWith("Bearer ")
|
|
129
|
+
? request.authorization.slice("Bearer ".length)
|
|
130
|
+
: undefined;
|
|
131
|
+
const acquireAdmission = Ref.modify(secrets.bootstrapAttemptState, (state) => {
|
|
132
|
+
if (state.failedAttempts + state.inFlight >= MAX_BOOTSTRAP_FAILURES) {
|
|
133
|
+
return ["unavailable", state];
|
|
134
|
+
}
|
|
135
|
+
const bootstrapTokenMatches = suppliedToken !== undefined &&
|
|
136
|
+
credentialValuesEqual(suppliedToken, Redacted.value(secrets.bootstrapToken)) === true;
|
|
137
|
+
if (!bootstrapTokenMatches) {
|
|
138
|
+
return ["invalid", {
|
|
139
|
+
failedAttempts: Math.min(MAX_BOOTSTRAP_FAILURES, state.failedAttempts + 1),
|
|
140
|
+
inFlight: state.inFlight
|
|
141
|
+
}];
|
|
142
|
+
}
|
|
143
|
+
return ["accepted", { ...state, inFlight: state.inFlight + 1 }];
|
|
144
|
+
}).pipe(Effect.flatMap((admission) => {
|
|
145
|
+
if (admission === "unavailable") {
|
|
146
|
+
return Effect.fail(new UnauthorizedApiError({ message: "Bootstrap confirmation temporarily unavailable" }));
|
|
147
|
+
}
|
|
148
|
+
if (admission === "invalid") {
|
|
149
|
+
return Effect.fail(new UnauthorizedApiError({ message: "Missing or invalid bootstrap token" }));
|
|
150
|
+
}
|
|
151
|
+
return Effect.void;
|
|
152
|
+
}));
|
|
153
|
+
return yield* Effect.acquireUseRelease(acquireAdmission, () => Effect.gen(function* () {
|
|
154
|
+
const expiresAt = yield* Ref.get(secrets.bootstrapExpiresAtMillis);
|
|
155
|
+
if (expiresAt === undefined) {
|
|
156
|
+
return yield* new UnauthorizedApiError({ message: "Bootstrap token is not active" });
|
|
157
|
+
}
|
|
158
|
+
const now = yield* Clock.currentTimeMillis;
|
|
159
|
+
const decision = yield* Ref.modify(secrets.bootstrapAvailable, (available) => {
|
|
160
|
+
const state = {
|
|
161
|
+
expiresAt,
|
|
162
|
+
consumedAt: available ? null : 0,
|
|
163
|
+
revokedAt: null
|
|
164
|
+
};
|
|
165
|
+
const next = decideOneTimeCredential(state, now);
|
|
166
|
+
return [next, next === "accepted" ? false : available];
|
|
167
|
+
});
|
|
168
|
+
if (decision === "expired")
|
|
169
|
+
return yield* new UnauthorizedApiError({ message: "Bootstrap token has expired" });
|
|
170
|
+
if (decision === "consumed") {
|
|
171
|
+
return yield* new UnauthorizedApiError({ message: "Bootstrap token has already been used" });
|
|
172
|
+
}
|
|
173
|
+
if (decision === "invalid") {
|
|
174
|
+
return yield* new UnauthorizedApiError({ message: "Bootstrap token state is invalid" });
|
|
175
|
+
}
|
|
176
|
+
}), () => Ref.update(secrets.bootstrapAttemptState, (state) => ({
|
|
177
|
+
...state,
|
|
178
|
+
inFlight: Math.max(0, state.inFlight - 1)
|
|
179
|
+
})));
|
|
103
180
|
});
|
|
104
181
|
export const ownerSessionAuthLayer = Layer.effect(OwnerSessionAuth, Effect.gen(function* () {
|
|
105
182
|
const secrets = yield* OwnerSessionSecrets;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"OwnerSessionSecurity.js","sourceRoot":"","sources":["../../../src/server/internal/OwnerSessionSecurity.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EA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AC/B,EACD,OAAO,CACR,CAAA;IACD,MAAM,MAAM,GAAG,KAAK,CAAC,CAAC,MAAM,CAAC,MAAM,CAAC,aAAa,CAAC,CAAA;IAClD,IAAI,MAAM,CAAC,IAAI,KAAK,SAAS,EAAE,CAAC;QAC9B,MAAM,KAAK,GAAG,MAAM,CAAC,OAAO,CAAA;QAC5B,OAAO,kBAAkB,CAAC,IAAI,CAAC,KAAK,CAAC,OAAO,EAAE;YAC5C,MAAM,EAAE,KAAK,CAAC,IAAI,KAAK,sBAAsB,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,GAAG;SAC1D,CAAC,CAAA;IACJ,CAAC;IACD,OAAO,KAAK,CAAC,CAAC,kBAAkB,CAAC,IAAI,CAAC,EAAE,SAAS,EAAE,QAAQ,CAAC,KAAK,CAAC,OAAO,CAAC,SAAS,CAAC,EAAE,EAAE;QACtF,MAAM,EAAE,GAAG;QACX,OAAO,EAAE;YACP,eAAe,EAAE,UAAU;YAC3B,YAAY,EAAE,kBAAkB,CAAC,OAAO,CAAC;SAC1C;KACF,CAAC,CAAA;AACJ,CAAC,CAAC,CACH,CACF,CAAA"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { Effect } from "effect";
|
|
2
|
+
import { type OwnerSessionSecretsContract } from "./OwnerSessionSecurity.js";
|
|
3
|
+
/** Resolve the advertised origin for one concrete server bind attempt. */
|
|
4
|
+
export declare const resolveCodeCommitPublicOrigin: (configuredOrigin: string | undefined, port: number) => Effect.Effect<string, import("./OwnerSessionSecurity.js").UnsafeServerHostnameError, never>;
|
|
5
|
+
/** Resolve the startup origin before constructing the token-bearing bootstrap URL. */
|
|
6
|
+
export declare const resolveCodeCommitBootstrapUrl: (configuredOrigin: string | undefined, port: number, secrets: OwnerSessionSecretsContract) => Effect.Effect<string, import("./OwnerSessionSecurity.js").UnsafeServerHostnameError, never>;
|
|
7
|
+
/** Keep a retrying backend off the stale Vite proxy port; advertise it directly. */
|
|
8
|
+
export declare const resolveCodeCommitBootstrapUrlForBind: (configuredOrigin: string | undefined, requestedPort: number, actualPort: number, secrets: OwnerSessionSecretsContract) => Effect.Effect<string, import("./OwnerSessionSecurity.js").UnsafeServerHostnameError, never>;
|
|
9
|
+
//# sourceMappingURL=PublicOrigin.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"PublicOrigin.d.ts","sourceRoot":"","sources":["../../../src/server/internal/PublicOrigin.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAA;AAC/B,OAAO,EAEL,KAAK,2BAA2B,EAGjC,MAAM,2BAA2B,CAAA;AAElC,0EAA0E;AAC1E,eAAO,MAAM,6BAA6B,qJAIzC,CAAA;AAED,sFAAsF;AACtF,eAAO,MAAM,6BAA6B,2LAKzC,CAAA;AAED,oFAAoF;AACpF,eAAO,MAAM,oCAAoC,wNAUhD,CAAA"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { Effect } from "effect";
|
|
2
|
+
import { ownerSessionOrigin, ownerSessionUrlForOrigin, resolvePublicOrigin } from "./OwnerSessionSecurity.js";
|
|
3
|
+
/** Resolve the advertised origin for one concrete server bind attempt. */
|
|
4
|
+
export const resolveCodeCommitPublicOrigin = Effect.fn("CodeCommitServer.resolvePublicOrigin")(function* (configuredOrigin, port) {
|
|
5
|
+
return yield* resolvePublicOrigin(configuredOrigin, ownerSessionOrigin("127.0.0.1", port));
|
|
6
|
+
});
|
|
7
|
+
/** Resolve the startup origin before constructing the token-bearing bootstrap URL. */
|
|
8
|
+
export const resolveCodeCommitBootstrapUrl = Effect.fn("CodeCommitServer.resolveBootstrapUrl")(function* (configuredOrigin, port, secrets) {
|
|
9
|
+
const publicOrigin = yield* resolveCodeCommitPublicOrigin(configuredOrigin, port);
|
|
10
|
+
return ownerSessionUrlForOrigin(publicOrigin, secrets);
|
|
11
|
+
});
|
|
12
|
+
/** Keep a retrying backend off the stale Vite proxy port; advertise it directly. */
|
|
13
|
+
export const resolveCodeCommitBootstrapUrlForBind = Effect.fn("CodeCommitServer.resolveBootstrapUrlForBind")(function* (configuredOrigin, requestedPort, actualPort, secrets) {
|
|
14
|
+
const originOverride = requestedPort === actualPort ? configuredOrigin : undefined;
|
|
15
|
+
return yield* resolveCodeCommitBootstrapUrl(originOverride, actualPort, secrets);
|
|
16
|
+
});
|
|
17
|
+
//# sourceMappingURL=PublicOrigin.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"PublicOrigin.js","sourceRoot":"","sources":["../../../src/server/internal/PublicOrigin.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAA;AAC/B,OAAO,EACL,kBAAkB,EAElB,wBAAwB,EACxB,mBAAmB,EACpB,MAAM,2BAA2B,CAAA;AAElC,0EAA0E;AAC1E,MAAM,CAAC,MAAM,6BAA6B,GAAG,MAAM,CAAC,EAAE,CAAC,sCAAsC,CAAC,CAC5F,QAAQ,CAAC,EAAC,gBAAoC,EAAE,IAAY;IAC1D,OAAO,KAAK,CAAC,CAAC,mBAAmB,CAAC,gBAAgB,EAAE,kBAAkB,CAAC,WAAW,EAAE,IAAI,CAAC,CAAC,CAAA;AAC5F,CAAC,CACF,CAAA;AAED,sFAAsF;AACtF,MAAM,CAAC,MAAM,6BAA6B,GAAG,MAAM,CAAC,EAAE,CAAC,sCAAsC,CAAC,CAC5F,QAAQ,CAAC,EAAC,gBAAoC,EAAE,IAAY,EAAE,OAAoC;IAChG,MAAM,YAAY,GAAG,KAAK,CAAC,CAAC,6BAA6B,CAAC,gBAAgB,EAAE,IAAI,CAAC,CAAA;IACjF,OAAO,wBAAwB,CAAC,YAAY,EAAE,OAAO,CAAC,CAAA;AACxD,CAAC,CACF,CAAA;AAED,oFAAoF;AACpF,MAAM,CAAC,MAAM,oCAAoC,GAAG,MAAM,CAAC,EAAE,CAAC,6CAA6C,CAAC,CAC1G,QAAQ,CAAC,EACP,gBAAoC,EACpC,aAAqB,EACrB,UAAkB,EAClB,OAAoC;IAEpC,MAAM,cAAc,GAAG,aAAa,KAAK,UAAU,CAAC,CAAC,CAAC,gBAAgB,CAAC,CAAC,CAAC,SAAS,CAAA;IAClF,OAAO,KAAK,CAAC,CAAC,6BAA6B,CAAC,cAAc,EAAE,UAAU,EAAE,OAAO,CAAC,CAAA;AAClF,CAAC,CACF,CAAA"}
|
|
@@ -4,9 +4,9 @@ import { createTwoFilesPatch } from "diff";
|
|
|
4
4
|
import { Cause, Effect, Option, Schema, Stream } from "effect";
|
|
5
5
|
import * as Crypto from "effect/Crypto";
|
|
6
6
|
import * as FileSystem from "effect/FileSystem";
|
|
7
|
+
import type * as ChildProcessSpawner from "effect/process/ChildProcessSpawner";
|
|
7
8
|
import type * as Semaphore from "effect/Semaphore";
|
|
8
|
-
import type
|
|
9
|
-
import { type PullRequestRelayReviewResponse, type RelayReviewConversationTurn, type RelayReviewKind, type RelayReviewProfile, type RelayReviewProgressPhase, RelayReviewResult, type RelayReviewStreamEvent } from "../Api.js";
|
|
9
|
+
import { type PullRequestRelayReviewResponse, RelayExplainResult, RelayNativeReviewResult, type RelayReviewConversationTurn, type RelayReviewKind, type RelayReviewProfile, type RelayReviewProgressPhase, RelayReviewResult, type RelayReviewStreamEvent } from "../Api.js";
|
|
10
10
|
import type { RelayFindingPublisherService } from "./RelayFindingPublisher.js";
|
|
11
11
|
declare const PullRequestReviewError_base: Schema.Class<PullRequestReviewError, Schema.TaggedStruct<"PullRequestReviewError", {
|
|
12
12
|
readonly operation: Schema.String;
|
|
@@ -87,17 +87,72 @@ export declare const withRelayReviewPermit: <A, E, R>(semaphore: Semaphore.Semap
|
|
|
87
87
|
export declare const withRelayReviewStreamPermit: <A, E, R>(semaphore: Semaphore.Semaphore, stream: Stream.Stream<A, E, R>) => Stream.Stream<A, E | PullRequestReviewError, R>;
|
|
88
88
|
/** Host-authored Relay prompt; repository content is isolated as untrusted evidence. */
|
|
89
89
|
export declare const makeRelayReviewPrompt: (scope: ExactReviewScope, kind: RelayReviewKind, patch: string, skillPrompt?: string) => string;
|
|
90
|
+
declare const RelayReviewConversationResult: Schema.Struct<{
|
|
91
|
+
readonly reply: Schema.String;
|
|
92
|
+
readonly review: Schema.Struct<{
|
|
93
|
+
readonly findings: Schema.$Array<Schema.Struct<{
|
|
94
|
+
readonly id: Schema.String;
|
|
95
|
+
readonly priority: Schema.Literals<readonly ["P1", "P2", "P3", "P4"]>;
|
|
96
|
+
readonly title: Schema.String;
|
|
97
|
+
readonly summary: Schema.String;
|
|
98
|
+
readonly details: Schema.String;
|
|
99
|
+
readonly recommendation: Schema.String;
|
|
100
|
+
readonly verification: Schema.String;
|
|
101
|
+
readonly publicationTarget: Schema.Literals<readonly ["pr-comment", "line-comment"]>;
|
|
102
|
+
readonly location: Schema.Union<readonly [Schema.Struct<{
|
|
103
|
+
readonly scope: Schema.Literal<"general">;
|
|
104
|
+
}>, Schema.Struct<{
|
|
105
|
+
readonly scope: Schema.Literal<"file">;
|
|
106
|
+
readonly filePath: Schema.String;
|
|
107
|
+
}>, Schema.Struct<{
|
|
108
|
+
readonly scope: Schema.Literal<"line">;
|
|
109
|
+
readonly filePath: Schema.String;
|
|
110
|
+
readonly line: Schema.Int;
|
|
111
|
+
readonly side: Schema.Literals<readonly ["before", "after"]>;
|
|
112
|
+
}>]>;
|
|
113
|
+
}>>;
|
|
114
|
+
readonly verdict: Schema.String;
|
|
115
|
+
}>;
|
|
116
|
+
}>;
|
|
117
|
+
declare const RelayExplainConversationResult: Schema.Struct<{
|
|
118
|
+
readonly reply: Schema.String;
|
|
119
|
+
readonly review: Schema.Struct<{
|
|
120
|
+
readonly findings: Schema.$Array<Schema.Struct<{
|
|
121
|
+
readonly id: Schema.String;
|
|
122
|
+
readonly priority: Schema.Literals<readonly ["P1", "P2", "P3", "P4"]>;
|
|
123
|
+
readonly title: Schema.String;
|
|
124
|
+
readonly summary: Schema.String;
|
|
125
|
+
readonly details: Schema.String;
|
|
126
|
+
readonly recommendation: Schema.String;
|
|
127
|
+
readonly verification: Schema.String;
|
|
128
|
+
readonly publicationTarget: Schema.Literals<readonly ["pr-comment", "line-comment"]>;
|
|
129
|
+
readonly location: Schema.Union<readonly [Schema.Struct<{
|
|
130
|
+
readonly scope: Schema.Literal<"general">;
|
|
131
|
+
}>, Schema.Struct<{
|
|
132
|
+
readonly scope: Schema.Literal<"file">;
|
|
133
|
+
readonly filePath: Schema.String;
|
|
134
|
+
}>, Schema.Struct<{
|
|
135
|
+
readonly scope: Schema.Literal<"line">;
|
|
136
|
+
readonly filePath: Schema.String;
|
|
137
|
+
readonly line: Schema.Int;
|
|
138
|
+
readonly side: Schema.Literals<readonly ["before", "after"]>;
|
|
139
|
+
}>]>;
|
|
140
|
+
}>>;
|
|
141
|
+
readonly verdict: Schema.String;
|
|
142
|
+
readonly explanation: Schema.String;
|
|
143
|
+
}>;
|
|
144
|
+
}>;
|
|
90
145
|
/** Exact native output contract selected before the provider process starts. */
|
|
91
|
-
export declare const relayReviewOutputSchema: (kind: RelayReviewKind) =>
|
|
146
|
+
export declare const relayReviewOutputSchema: (kind: RelayReviewKind) => typeof RelayExplainResult | typeof RelayNativeReviewResult;
|
|
92
147
|
export declare const parseRelayReviewResult: (message: string, kind: RelayReviewKind) => Option.Option<RelayReviewResult>;
|
|
93
148
|
/** Execute one ephemeral, read-only Relay pass over the exact provider patch. */
|
|
94
149
|
export declare const runPullRequestRelayReview: (client: ReadClient.CodeCommitReadClientService, pullRequest: Domain.PullRequest, expectedRevision: ExpectedReviewRevision, profile: {
|
|
95
150
|
readonly id: string;
|
|
96
151
|
readonly name: string;
|
|
97
152
|
readonly kind: "explain" | "review" | "security" | "tests";
|
|
98
|
-
readonly provider: "codex";
|
|
99
|
-
readonly harness: "native-codex";
|
|
100
|
-
readonly model: "configured-default" | "gpt-5.6-luna" | "gpt-5.6-sol" | "gpt-5.6-terra";
|
|
153
|
+
readonly provider: "claude" | "codex";
|
|
154
|
+
readonly harness: "native-claude" | "native-codex";
|
|
155
|
+
readonly model: "configured-default" | "default" | "gpt-5.6-luna" | "gpt-5.6-sol" | "gpt-5.6-terra";
|
|
101
156
|
readonly skillIds: readonly string[];
|
|
102
157
|
}, changedFiles?: PullRequestChangedFilesSource | undefined, skillPrompt?: string | undefined, reportProgress?: RelayReviewProgressReporter | undefined) => Effect.Effect<{
|
|
103
158
|
readonly pullRequestId: string & import("effect/Brand").Brand<"PullRequestId">;
|
|
@@ -109,9 +164,9 @@ export declare const runPullRequestRelayReview: (client: ReadClient.CodeCommitRe
|
|
|
109
164
|
readonly id: string;
|
|
110
165
|
readonly name: string;
|
|
111
166
|
readonly kind: "explain" | "review" | "security" | "tests";
|
|
112
|
-
readonly provider: "codex";
|
|
113
|
-
readonly harness: "native-codex";
|
|
114
|
-
readonly model: "configured-default" | "gpt-5.6-luna" | "gpt-5.6-sol" | "gpt-5.6-terra";
|
|
167
|
+
readonly provider: "claude" | "codex";
|
|
168
|
+
readonly harness: "native-claude" | "native-codex";
|
|
169
|
+
readonly model: "configured-default" | "default" | "gpt-5.6-luna" | "gpt-5.6-sol" | "gpt-5.6-terra";
|
|
115
170
|
readonly skillIds: readonly string[];
|
|
116
171
|
};
|
|
117
172
|
readonly result: {
|
|
@@ -140,7 +195,7 @@ export declare const runPullRequestRelayReview: (client: ReadClient.CodeCommitRe
|
|
|
140
195
|
readonly explanation?: string | undefined;
|
|
141
196
|
};
|
|
142
197
|
}, PullRequestReviewError, ChildProcessSpawner.ChildProcessSpawner | FileSystem.FileSystem>;
|
|
143
|
-
export declare const relayConversationOutputSchema: (kind: RelayReviewKind) =>
|
|
198
|
+
export declare const relayConversationOutputSchema: (kind: RelayReviewKind) => typeof RelayExplainConversationResult | typeof RelayReviewConversationResult;
|
|
144
199
|
/** Decode a conversation against the selected review kind without changing its wire shape. */
|
|
145
200
|
export declare const parseRelayConversationResult: (message: string, kind: RelayReviewKind) => Option.Option<{
|
|
146
201
|
readonly reply: string;
|
|
@@ -175,9 +230,9 @@ export declare const continuePullRequestRelayReview: (client: ReadClient.CodeCom
|
|
|
175
230
|
readonly id: string;
|
|
176
231
|
readonly name: string;
|
|
177
232
|
readonly kind: "explain" | "review" | "security" | "tests";
|
|
178
|
-
readonly provider: "codex";
|
|
179
|
-
readonly harness: "native-codex";
|
|
180
|
-
readonly model: "configured-default" | "gpt-5.6-luna" | "gpt-5.6-sol" | "gpt-5.6-terra";
|
|
233
|
+
readonly provider: "claude" | "codex";
|
|
234
|
+
readonly harness: "native-claude" | "native-codex";
|
|
235
|
+
readonly model: "configured-default" | "default" | "gpt-5.6-luna" | "gpt-5.6-sol" | "gpt-5.6-terra";
|
|
181
236
|
readonly skillIds: readonly string[];
|
|
182
237
|
}, currentReview: {
|
|
183
238
|
readonly findings: readonly {
|
|
@@ -219,9 +274,9 @@ export declare const continuePullRequestRelayReview: (client: ReadClient.CodeCom
|
|
|
219
274
|
readonly id: string;
|
|
220
275
|
readonly name: string;
|
|
221
276
|
readonly kind: "explain" | "review" | "security" | "tests";
|
|
222
|
-
readonly provider: "codex";
|
|
223
|
-
readonly harness: "native-codex";
|
|
224
|
-
readonly model: "configured-default" | "gpt-5.6-luna" | "gpt-5.6-sol" | "gpt-5.6-terra";
|
|
277
|
+
readonly provider: "claude" | "codex";
|
|
278
|
+
readonly harness: "native-claude" | "native-codex";
|
|
279
|
+
readonly model: "configured-default" | "default" | "gpt-5.6-luna" | "gpt-5.6-sol" | "gpt-5.6-terra";
|
|
225
280
|
readonly skillIds: readonly string[];
|
|
226
281
|
};
|
|
227
282
|
result: {
|
|
@@ -275,9 +330,9 @@ export declare const streamPullRequestRelayReview: (client: ReadClient.CodeCommi
|
|
|
275
330
|
readonly id: string;
|
|
276
331
|
readonly name: string;
|
|
277
332
|
readonly kind: "explain" | "review" | "security" | "tests";
|
|
278
|
-
readonly provider: "codex";
|
|
279
|
-
readonly harness: "native-codex";
|
|
280
|
-
readonly model: "configured-default" | "gpt-5.6-luna" | "gpt-5.6-sol" | "gpt-5.6-terra";
|
|
333
|
+
readonly provider: "claude" | "codex";
|
|
334
|
+
readonly harness: "native-claude" | "native-codex";
|
|
335
|
+
readonly model: "configured-default" | "default" | "gpt-5.6-luna" | "gpt-5.6-sol" | "gpt-5.6-terra";
|
|
281
336
|
readonly skillIds: readonly string[];
|
|
282
337
|
};
|
|
283
338
|
readonly result: {
|
|
@@ -329,9 +384,9 @@ export declare const streamPullRequestRelayConversation: (client: ReadClient.Cod
|
|
|
329
384
|
readonly id: string;
|
|
330
385
|
readonly name: string;
|
|
331
386
|
readonly kind: "explain" | "review" | "security" | "tests";
|
|
332
|
-
readonly provider: "codex";
|
|
333
|
-
readonly harness: "native-codex";
|
|
334
|
-
readonly model: "configured-default" | "gpt-5.6-luna" | "gpt-5.6-sol" | "gpt-5.6-terra";
|
|
387
|
+
readonly provider: "claude" | "codex";
|
|
388
|
+
readonly harness: "native-claude" | "native-codex";
|
|
389
|
+
readonly model: "configured-default" | "default" | "gpt-5.6-luna" | "gpt-5.6-sol" | "gpt-5.6-terra";
|
|
335
390
|
readonly skillIds: readonly string[];
|
|
336
391
|
};
|
|
337
392
|
readonly result: {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PullRequestReview.d.ts","sourceRoot":"","sources":["../../../src/server/review/PullRequestReview.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"PullRequestReview.d.ts","sourceRoot":"","sources":["../../../src/server/review/PullRequestReview.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,KAAK,MAAM,MAAM,kCAAkC,CAAA;AAC/D,OAAO,KAAK,KAAK,UAAU,MAAM,sCAAsC,CAAA;AAEvE,OAAO,EAAE,mBAAmB,EAAc,MAAM,MAAM,CAAA;AACtD,OAAO,EAAS,KAAK,EAAQ,MAAM,EAAQ,MAAM,EAAoB,MAAM,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAA;AAEnG,OAAO,KAAK,MAAM,MAAM,eAAe,CAAA;AACvC,OAAO,KAAK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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;2FA6FzC,CAAA;AAQF,8EAA8E;AAC9E,eAAO,MAAM,2BAA2B,GAAI,CAAC,EAAE,CAAC,OACzC,CAAC,MAAM,EAAE,2BAA2B,KAAK,MAAM,CAAC,MAAM,CACzD;IAAE,QAAQ,CAAC,MAAM,EAAE,8BAA8B,CAAC;IAAC,QAAQ,CAAC,KAAK,CAAC,EAAE,MAAM,CAAA;CAAE,EAC5E,CAAC,EACD,CAAC,CACF,KACA,MAAM,CAAC,MAAM,CAAC,sBAAsB,EAAE,KAAK,EAAE,CAAC,CAqB5C,CAAA;AAEL,+DAA+D;AAC/D,eAAO,MAAM,4BAA4B,WAC/B,UAAU,CAAC,2BAA2B,eACjC,MAAM,CAAC,WAAW,oBACb,sBAAsB,WAC/B,kBAAkB,gBACb,6BAA6B,GAAG,SAAS,eAC1C,MAAM;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;0EAYlB,CAAA;AAEH,gFAAgF;AAChF,eAAO,MAAM,kCAAkC,WACrC,UAAU,CAAC,2BAA2B,eACjC,MAAM,CAAC,WAAW,oBACb,sBAAsB,WAC/B,kBAAkB,iBACZ,OAAO,iBAAiB,CAAC,IAAI,SACrC,aAAa,CAAC,2BAA2B,CAAC,aACtC,MAAM,WACR,MAAM,gBACD,6BAA6B,GAAG,SAAS,eAC1C,MAAM;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;0EAgBlB,CAAA;AA8CH,kGAAkG;AAClG,eAAO,MAAM,2BAA2B;;;;;;;;;;;;;;;;;;;;;;;;yCA4CtC,CAAA"}
|
|
@@ -1,19 +1,21 @@
|
|
|
1
1
|
/** Immutable CodeCommit diff reads and prompt-only Relay execution for the web review workbench. @module */
|
|
2
|
+
import { model as claudeModel } from "@knpkv/ai-claude";
|
|
2
3
|
import { streamEvents } from "@knpkv/ai-codex";
|
|
3
4
|
import * as ReviewClient from "@knpkv/codecommit-core/ReviewClient.js";
|
|
4
5
|
import { createTwoFilesPatch, parsePatch } from "diff";
|
|
5
6
|
import { Cache, Cause, Data, Effect, Exit, Option, Predicate, Queue, Schema, Stream } from "effect";
|
|
7
|
+
import { LanguageModel } from "effect/ai";
|
|
6
8
|
import * as Crypto from "effect/Crypto";
|
|
7
9
|
import * as FileSystem from "effect/FileSystem";
|
|
8
10
|
import { RelayExplainResult, RelayNativeReviewResult, RelayReviewMessage, RelayReviewResult } from "../Api.js";
|
|
9
|
-
import { MAXIMUM_RELAY_PATCH_BYTES, MAXIMUM_RELAY_PROMPT_BYTES } from "./ReviewPromptBudget.js";
|
|
11
|
+
import { MAXIMUM_RELAY_CLAUDE_OUTPUT_BYTES, MAXIMUM_RELAY_PATCH_BYTES, MAXIMUM_RELAY_PROMPT_BYTES, MAXIMUM_RELAY_REVIEW_MESSAGE_BYTES } from "./ReviewPromptBudget.js";
|
|
10
12
|
const MAXIMUM_DIFF_FILES = 1_000;
|
|
11
13
|
const MAXIMUM_RELAY_DIFF_INPUT_LINES = 5_000;
|
|
12
14
|
const MAXIMUM_RELAY_DIFF_LINE_PAIRS = 4_000_000;
|
|
13
15
|
const RELAY_PATCH_SEPARATOR = "\n";
|
|
14
16
|
const textDecoder = new TextDecoder("utf-8", { fatal: true, ignoreBOM: true });
|
|
15
17
|
const textEncoder = new TextEncoder();
|
|
16
|
-
const withProfileModel = (profile, options) => profile.model === "configured-default" ? options : { ...options, model: profile.model };
|
|
18
|
+
const withProfileModel = (profile, options) => profile.model === "configured-default" || profile.model === "default" ? options : { ...options, model: profile.model };
|
|
17
19
|
export class PullRequestReviewError extends Schema.TaggedError()("PullRequestReviewError", {
|
|
18
20
|
operation: Schema.String,
|
|
19
21
|
message: Schema.String,
|
|
@@ -438,6 +440,14 @@ const CodexProgressEvent = Schema.fromJsonString(Schema.Struct({
|
|
|
438
440
|
const decodeCodexProgress = Schema.decodeUnknownOption(CodexProgressEvent);
|
|
439
441
|
const decodeRelayResult = Schema.decodeUnknownOption(Schema.fromJsonString(RelayReviewResult));
|
|
440
442
|
const decodeRelayExplainResult = Schema.decodeUnknownOption(Schema.fromJsonString(RelayExplainResult));
|
|
443
|
+
const RelayReviewConversationResult = Schema.Struct({
|
|
444
|
+
reply: RelayReviewMessage,
|
|
445
|
+
review: RelayNativeReviewResult
|
|
446
|
+
});
|
|
447
|
+
const RelayExplainConversationResult = Schema.Struct({
|
|
448
|
+
reply: RelayReviewMessage,
|
|
449
|
+
review: RelayExplainResult
|
|
450
|
+
});
|
|
441
451
|
/** Exact native output contract selected before the provider process starts. */
|
|
442
452
|
export const relayReviewOutputSchema = (kind) => kind === "explain" ? RelayExplainResult : RelayNativeReviewResult;
|
|
443
453
|
export const parseRelayReviewResult = (message, kind) => {
|
|
@@ -446,6 +456,49 @@ export const parseRelayReviewResult = (message, kind) => {
|
|
|
446
456
|
const decode = kind === "explain" ? decodeRelayExplainResult : decodeRelayResult;
|
|
447
457
|
return decode(trimmed).pipe(Option.orElse(() => fenced === undefined ? Option.none() : decode(fenced)));
|
|
448
458
|
};
|
|
459
|
+
const encodeClaudeAgentMessage = (value) => Effect.try({
|
|
460
|
+
try: () => JSON.stringify(value),
|
|
461
|
+
catch: (cause) => reviewError("relay-review-encode", "Claude returned an unencodable structured result", cause)
|
|
462
|
+
}).pipe(Effect.flatMap((encoded) => encoded === undefined
|
|
463
|
+
? Effect.fail(reviewError("relay-review-encode", "Claude returned no structured review result"))
|
|
464
|
+
: Effect.succeed(encoded)));
|
|
465
|
+
const claudeAgentMessage = (profile, request) => LanguageModel.generateObject({
|
|
466
|
+
objectName: "relay-review",
|
|
467
|
+
prompt: request.prompt,
|
|
468
|
+
schema: request.outputSchema
|
|
469
|
+
}).pipe(
|
|
470
|
+
// Dynamic per-review model layer: the application supplies ChildProcessSpawner at its entry point.
|
|
471
|
+
// @effect-diagnostics-next-line strictEffectProvide:off
|
|
472
|
+
Effect.provide(claudeModel({
|
|
473
|
+
access: "prompt-only",
|
|
474
|
+
cwd: request.cwd,
|
|
475
|
+
...((profile.model !== "configured-default") && { model: profile.model }),
|
|
476
|
+
timeout: request.timeout,
|
|
477
|
+
maxOutputBytes: MAXIMUM_RELAY_CLAUDE_OUTPUT_BYTES,
|
|
478
|
+
maxStderrBytes: MAXIMUM_RELAY_REVIEW_MESSAGE_BYTES
|
|
479
|
+
})), Effect.map((response) => response.value), Effect.flatMap(encodeClaudeAgentMessage), Effect.mapError((cause) => Predicate.isTagged(cause, "PullRequestReviewError")
|
|
480
|
+
? cause
|
|
481
|
+
: reviewError("relay-review", "Claude review execution failed", cause)));
|
|
482
|
+
const streamRelayAgent = (profile, request) => {
|
|
483
|
+
if (profile.provider === "codex" && profile.harness === "native-codex") {
|
|
484
|
+
return streamEvents(withProfileModel(profile, {
|
|
485
|
+
access: "read-only",
|
|
486
|
+
cwd: request.cwd,
|
|
487
|
+
maxPromptBytes: request.maxPromptBytes,
|
|
488
|
+
outputSchema: request.outputSchema,
|
|
489
|
+
prompt: request.prompt,
|
|
490
|
+
promptOnly: true,
|
|
491
|
+
timeout: request.timeout
|
|
492
|
+
})).pipe(Stream.mapError((cause) => reviewError("relay-review", "Codex review execution failed", cause)));
|
|
493
|
+
}
|
|
494
|
+
if (profile.provider === "claude" && profile.harness === "native-claude") {
|
|
495
|
+
return Stream.fromEffect(claudeAgentMessage(profile, request).pipe(Effect.map((message) => JSON.stringify({
|
|
496
|
+
type: "item.completed",
|
|
497
|
+
item: { type: "agent_message", text: message }
|
|
498
|
+
}))));
|
|
499
|
+
}
|
|
500
|
+
return Stream.fail(reviewError("relay-review-config", `Unsupported Relay reviewer configuration: ${profile.provider}/${profile.harness}/${profile.model}`));
|
|
501
|
+
};
|
|
449
502
|
/** Execute one ephemeral, read-only Relay pass over the exact provider patch. */
|
|
450
503
|
export const runPullRequestRelayReview = Effect.fn("PullRequestReview.runPullRequestRelayReview")(function* (client, pullRequest, expectedRevision, profile, changedFiles, skillPrompt = "", reportProgress = noProgress) {
|
|
451
504
|
const kind = profile.kind;
|
|
@@ -467,15 +520,14 @@ export const runPullRequestRelayReview = Effect.fn("PullRequestReview.runPullReq
|
|
|
467
520
|
const fileSystem = yield* FileSystem.FileSystem;
|
|
468
521
|
const workspace = yield* fileSystem.makeTempDirectoryScoped({ prefix: "codecommit-web-relay-" });
|
|
469
522
|
yield* reportProgress({ phase: "agent", message: "Relay is reviewing the exact patch" });
|
|
470
|
-
const message = yield*
|
|
471
|
-
access: "read-only",
|
|
523
|
+
const message = yield* streamRelayAgent(profile, {
|
|
472
524
|
cwd: workspace,
|
|
525
|
+
kind,
|
|
473
526
|
maxPromptBytes: MAXIMUM_RELAY_PROMPT_BYTES,
|
|
474
527
|
outputSchema: relayReviewOutputSchema(kind),
|
|
475
528
|
prompt,
|
|
476
|
-
promptOnly: true,
|
|
477
529
|
timeout: "5 minutes"
|
|
478
|
-
})
|
|
530
|
+
}).pipe(Stream.tap((line) => {
|
|
479
531
|
const event = decodeCodexProgress(line);
|
|
480
532
|
if (Option.isNone(event))
|
|
481
533
|
return Effect.void;
|
|
@@ -509,14 +561,6 @@ export const runPullRequestRelayReview = Effect.fn("PullRequestReview.runPullReq
|
|
|
509
561
|
? cause
|
|
510
562
|
: reviewError("relay-review", "Relay review execution failed", cause)));
|
|
511
563
|
});
|
|
512
|
-
const RelayReviewConversationResult = Schema.Struct({
|
|
513
|
-
reply: RelayReviewMessage,
|
|
514
|
-
review: RelayNativeReviewResult
|
|
515
|
-
});
|
|
516
|
-
const RelayExplainConversationResult = Schema.Struct({
|
|
517
|
-
reply: RelayReviewMessage,
|
|
518
|
-
review: RelayExplainResult
|
|
519
|
-
});
|
|
520
564
|
export const relayConversationOutputSchema = (kind) => kind === "explain" ? RelayExplainConversationResult : RelayReviewConversationResult;
|
|
521
565
|
const decodeRelayReviewConversationResult = Schema.decodeUnknownOption(Schema.fromJsonString(RelayReviewConversationResult));
|
|
522
566
|
const decodeRelayExplainConversationResult = Schema.decodeUnknownOption(Schema.fromJsonString(RelayExplainConversationResult));
|
|
@@ -577,15 +621,14 @@ export const continuePullRequestRelayReview = Effect.fn("PullRequestReview.conti
|
|
|
577
621
|
const fileSystem = yield* FileSystem.FileSystem;
|
|
578
622
|
const workspace = yield* fileSystem.makeTempDirectoryScoped({ prefix: "codecommit-web-relay-" });
|
|
579
623
|
yield* reportProgress({ phase: "agent", message: "Relay is reconciling the finding deck" });
|
|
580
|
-
const response = yield*
|
|
581
|
-
access: "read-only",
|
|
624
|
+
const response = yield* streamRelayAgent(profile, {
|
|
582
625
|
cwd: workspace,
|
|
626
|
+
kind,
|
|
583
627
|
maxPromptBytes: MAXIMUM_RELAY_PROMPT_BYTES,
|
|
584
628
|
outputSchema: relayConversationOutputSchema(kind),
|
|
585
629
|
prompt,
|
|
586
|
-
promptOnly: true,
|
|
587
630
|
timeout: "5 minutes"
|
|
588
|
-
})
|
|
631
|
+
}).pipe(Stream.tap((line) => {
|
|
589
632
|
const event = decodeCodexProgress(line);
|
|
590
633
|
return Option.isSome(event) && event.value.type === "item.completed" && event.value.item?.type === "reasoning"
|
|
591
634
|
? reportProgress({ phase: "agent", message: "Reconciliation step completed" })
|