@cmmd-center/forge 0.13.92 → 0.13.93
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/bin.cjs +331 -91
- package/dist/bin.mjs +331 -91
- package/dist/client/assets/{DiffPanel-C37SDXUs.js → DiffPanel-CLk1Bgp1.js} +2 -2
- package/dist/client/assets/{DiffPanel.logic-D7Qjzo8o.js → DiffPanel.logic-CcHMZM1Y.js} +2 -2
- package/dist/client/assets/{DiffWorkerPoolProvider-B1C81-dL.js → DiffWorkerPoolProvider-FrL5ZM1K.js} +2 -2
- package/dist/client/assets/{PullRequestCodePanel-BLjOVvZc.js → PullRequestCodePanel-D4w7S-dm.js} +2 -2
- package/dist/client/assets/{Virtualizer-Bi-1tOHj.js → Virtualizer-CVkyeAyj.js} +2 -2
- package/dist/client/assets/{WorkerPoolContext-BwA1RAnm.js → WorkerPoolContext-DWQ4L294.js} +115 -115
- package/dist/client/assets/{cmmdAuthRedirect-Bx5ApJLL.js → cmmdAuthRedirect-DJMI3b92.js} +2 -2
- package/dist/client/assets/index-B9Alklxx.css +1 -0
- package/dist/client/assets/{index-PlTOUnMB.js → index-q03RpQPf.js} +60 -60
- package/dist/client/index.html +6 -6
- package/dist/forge-build.json +1 -1
- package/package.json +1 -1
- package/dist/client/assets/index-BvseDV5h.css +0 -1
package/dist/bin.cjs
CHANGED
|
@@ -27077,12 +27077,12 @@ function encodeCmmdRuntimeThreadWorkspaceMetadata(workspace) {
|
|
|
27077
27077
|
}
|
|
27078
27078
|
//#endregion
|
|
27079
27079
|
//#region ../../packages/contracts/src/cmmdRuntimeToolActivity.ts
|
|
27080
|
-
function isRecord$
|
|
27080
|
+
function isRecord$25(value) {
|
|
27081
27081
|
return value !== null && typeof value === "object" && !Array.isArray(value);
|
|
27082
27082
|
}
|
|
27083
27083
|
function encodeCmmdRuntimeToolActivityPayload(kind, payload) {
|
|
27084
27084
|
return {
|
|
27085
|
-
...isRecord$
|
|
27085
|
+
...isRecord$25(payload) ? payload : { sourcePayload: payload },
|
|
27086
27086
|
forgeToolActivity: {
|
|
27087
27087
|
schemaVersion: 1,
|
|
27088
27088
|
source: "native",
|
|
@@ -27105,7 +27105,7 @@ const WORKTREE_LAUNCH_ACTIVITY_KINDS = new Set([
|
|
|
27105
27105
|
]);
|
|
27106
27106
|
function encodeCmmdRuntimeWorktreeLaunchActivityPayload(kind, payload) {
|
|
27107
27107
|
return {
|
|
27108
|
-
...isRecord$
|
|
27108
|
+
...isRecord$25(payload) ? payload : { sourcePayload: payload },
|
|
27109
27109
|
forgeWorktreeLaunchActivity: {
|
|
27110
27110
|
schemaVersion: 1,
|
|
27111
27111
|
source: "native",
|
|
@@ -27125,7 +27125,7 @@ function isCmmdRuntimeWorktreeLaunchActivityKind(kind) {
|
|
|
27125
27125
|
const CMMD_RUNTIME_PLAN_ACTIVITY_KIND = "turn.plan.updated";
|
|
27126
27126
|
function encodeCmmdRuntimePlanActivityPayload(kind, payload) {
|
|
27127
27127
|
return {
|
|
27128
|
-
...isRecord$
|
|
27128
|
+
...isRecord$25(payload) ? payload : { sourcePayload: payload },
|
|
27129
27129
|
forgePlanActivity: {
|
|
27130
27130
|
schemaVersion: 1,
|
|
27131
27131
|
source: "native",
|
|
@@ -27134,15 +27134,15 @@ function encodeCmmdRuntimePlanActivityPayload(kind, payload) {
|
|
|
27134
27134
|
};
|
|
27135
27135
|
}
|
|
27136
27136
|
function decodeCmmdRuntimePlanActivity(payload) {
|
|
27137
|
-
if (!isRecord$
|
|
27137
|
+
if (!isRecord$25(payload)) return null;
|
|
27138
27138
|
const metadata = payload["forgePlanActivity"];
|
|
27139
|
-
if (!isRecord$
|
|
27139
|
+
if (!isRecord$25(metadata)) return null;
|
|
27140
27140
|
if (metadata["schemaVersion"] !== 1 || metadata["source"] !== "native" || metadata["kind"] !== "turn.plan.updated") return null;
|
|
27141
27141
|
const rawPlan = payload["plan"];
|
|
27142
27142
|
return {
|
|
27143
27143
|
kind: CMMD_RUNTIME_PLAN_ACTIVITY_KIND,
|
|
27144
27144
|
plan: Array.isArray(rawPlan) ? rawPlan.flatMap((entry) => {
|
|
27145
|
-
if (!isRecord$
|
|
27145
|
+
if (!isRecord$25(entry)) return [];
|
|
27146
27146
|
const step = entry["step"];
|
|
27147
27147
|
const status = entry["status"];
|
|
27148
27148
|
if (typeof step !== "string" || step.trim().length === 0) return [];
|
|
@@ -31166,13 +31166,13 @@ async function completePendingDesktopRelayIdentityRotation(input) {
|
|
|
31166
31166
|
}
|
|
31167
31167
|
//#endregion
|
|
31168
31168
|
//#region ../../packages/relay-host/src/internal/desktopRelayJws.ts
|
|
31169
|
-
function isRecord$
|
|
31169
|
+
function isRecord$24(value) {
|
|
31170
31170
|
return typeof value === "object" && value !== null && !Array.isArray(value);
|
|
31171
31171
|
}
|
|
31172
31172
|
function decodeBase64UrlJson$1(value) {
|
|
31173
31173
|
try {
|
|
31174
31174
|
const decoded = JSON.parse(Buffer.from(value, "base64url").toString("utf8"));
|
|
31175
|
-
return isRecord$
|
|
31175
|
+
return isRecord$24(decoded) ? decoded : null;
|
|
31176
31176
|
} catch {
|
|
31177
31177
|
return null;
|
|
31178
31178
|
}
|
|
@@ -31326,11 +31326,11 @@ var DesktopRelayControlPlaneError = class extends Error {
|
|
|
31326
31326
|
this.name = "DesktopRelayControlPlaneError";
|
|
31327
31327
|
}
|
|
31328
31328
|
};
|
|
31329
|
-
function isRecord$
|
|
31329
|
+
function isRecord$23(value) {
|
|
31330
31330
|
return typeof value === "object" && value !== null && !Array.isArray(value);
|
|
31331
31331
|
}
|
|
31332
31332
|
function parseErrorPayload(value) {
|
|
31333
|
-
return isRecord$
|
|
31333
|
+
return isRecord$23(value) ? value : {};
|
|
31334
31334
|
}
|
|
31335
31335
|
function messageFromErrorPayload(payload, fallback) {
|
|
31336
31336
|
return typeof payload.error === "string" && payload.error.trim().length > 0 ? payload.error.trim() : fallback;
|
|
@@ -31428,7 +31428,7 @@ async function postControlPlane(input) {
|
|
|
31428
31428
|
const errorPayload = parseErrorPayload(payload);
|
|
31429
31429
|
throw new DesktopRelayControlPlaneError(typeof errorPayload.code === "string" && errorPayload.code.trim().length > 0 ? errorPayload.code.trim() : `CMMD_HTTP_${response.status}`, messageFromErrorPayload(errorPayload, `CMMD relay request failed (${response.status}).`), response.status === 408 || response.status === 429 || response.status >= 500);
|
|
31430
31430
|
}
|
|
31431
|
-
if (!isRecord$
|
|
31431
|
+
if (!isRecord$23(payload) || !("data" in payload)) throw new DesktopRelayControlPlaneError("CONTROL_PLANE_INVALID_RESPONSE", "CMMD returned an invalid Forge relay response.", false);
|
|
31432
31432
|
return payload.data;
|
|
31433
31433
|
}
|
|
31434
31434
|
function resolveRegisteredDevice(input) {
|
|
@@ -66311,7 +66311,7 @@ function normalizeNumberish(value) {
|
|
|
66311
66311
|
}
|
|
66312
66312
|
//#endregion
|
|
66313
66313
|
//#region package.json
|
|
66314
|
-
var version$1 = "0.13.
|
|
66314
|
+
var version$1 = "0.13.93";
|
|
66315
66315
|
//#endregion
|
|
66316
66316
|
//#region src/sentry.ts
|
|
66317
66317
|
const SERVER_APP_NAME = "forge-server";
|
|
@@ -66927,17 +66927,17 @@ function readCmmdAvatarUrl(raw) {
|
|
|
66927
66927
|
}
|
|
66928
66928
|
//#endregion
|
|
66929
66929
|
//#region src/cmmdIdentity.ts
|
|
66930
|
-
function readTrimmedString$
|
|
66930
|
+
function readTrimmedString$3(value) {
|
|
66931
66931
|
return typeof value === "string" ? value.trim() || null : null;
|
|
66932
66932
|
}
|
|
66933
66933
|
function asRecord$14(value) {
|
|
66934
66934
|
return value && typeof value === "object" ? value : null;
|
|
66935
66935
|
}
|
|
66936
66936
|
function readDirectPlanLabelFromRecord(obj) {
|
|
66937
|
-
return readTrimmedString$
|
|
66937
|
+
return readTrimmedString$3(obj["planLabel"]) ?? readTrimmedString$3(obj["plan_label"]) ?? readTrimmedString$3(obj["planName"]) ?? readTrimmedString$3(obj["plan_name"]) ?? readTrimmedString$3(obj["subscriptionPlan"]) ?? readTrimmedString$3(obj["subscription_plan"]) ?? readTrimmedString$3(obj["billingPlan"]) ?? readTrimmedString$3(obj["billing_plan"]);
|
|
66938
66938
|
}
|
|
66939
66939
|
function readNestedPlanLabelFromRecord(obj) {
|
|
66940
|
-
return readDirectPlanLabelFromRecord(obj) ?? readTrimmedString$
|
|
66940
|
+
return readDirectPlanLabelFromRecord(obj) ?? readTrimmedString$3(obj["displayName"]) ?? readTrimmedString$3(obj["display_name"]) ?? readTrimmedString$3(obj["name"]) ?? readTrimmedString$3(obj["label"]) ?? readTrimmedString$3(obj["tier"]);
|
|
66941
66941
|
}
|
|
66942
66942
|
function readCmmdPlanLabel(obj) {
|
|
66943
66943
|
const direct = readDirectPlanLabelFromRecord(obj);
|
|
@@ -70780,11 +70780,23 @@ function createCloudflareTurnIceServerResolver(options) {
|
|
|
70780
70780
|
//#region src/http.ts
|
|
70781
70781
|
const PROJECT_FAVICON_CACHE_CONTROL = "public, max-age=3600";
|
|
70782
70782
|
const PROJECT_FAVICON_MISS_CACHE_CONTROL = "public, max-age=300";
|
|
70783
|
+
/**
|
|
70784
|
+
* Origins allowed to embed Forge's SPA (CMMD /forge iframe). Docs keep their
|
|
70785
|
+
* own CSP with frame-ancestors 'none'. Do not put a broad * here.
|
|
70786
|
+
*/
|
|
70787
|
+
const CMMD_FRAME_ANCESTORS = [
|
|
70788
|
+
"https://cmmd.ai",
|
|
70789
|
+
"https://*.cmmd.ai",
|
|
70790
|
+
"http://127.0.0.1:3015",
|
|
70791
|
+
"http://localhost:3015",
|
|
70792
|
+
"http://127.0.0.1:3000",
|
|
70793
|
+
"http://localhost:3000"
|
|
70794
|
+
];
|
|
70783
70795
|
const BROWSER_DOCUMENT_SECURITY_HEADERS = {
|
|
70784
70796
|
"permissions-policy": "camera=(), microphone=(), geolocation=()",
|
|
70785
70797
|
"referrer-policy": "no-referrer",
|
|
70786
70798
|
"x-content-type-options": "nosniff",
|
|
70787
|
-
"
|
|
70799
|
+
"content-security-policy": `frame-ancestors ${CMMD_FRAME_ANCESTORS.join(" ")}`
|
|
70788
70800
|
};
|
|
70789
70801
|
const STATIC_IMMUTABLE_CACHE_CONTROL = "public, max-age=31536000, immutable";
|
|
70790
70802
|
const STATIC_REVALIDATE_CACHE_CONTROL = "no-cache";
|
|
@@ -70806,19 +70818,31 @@ function normalizeConfiguredCorsOrigin(value) {
|
|
|
70806
70818
|
const CONFIGURED_CORS_ORIGINS = [normalizeConfiguredCorsOrigin(process.env.VITE_DEV_SERVER_URL), normalizeConfiguredCorsOrigin(process.env.FORGE_EXTRA_CORS_ORIGIN)].filter((origin) => origin !== void 0);
|
|
70807
70819
|
const ALLOWED_CORS_ORIGINS = new Set([
|
|
70808
70820
|
"http://localhost:3000",
|
|
70821
|
+
"http://localhost:3015",
|
|
70809
70822
|
"http://localhost:5733",
|
|
70810
70823
|
"http://localhost:13773",
|
|
70811
70824
|
"http://localhost:5173",
|
|
70812
70825
|
"http://127.0.0.1:3000",
|
|
70826
|
+
"http://127.0.0.1:3015",
|
|
70813
70827
|
"http://127.0.0.1:5733",
|
|
70814
70828
|
"http://127.0.0.1:13773",
|
|
70815
70829
|
"http://127.0.0.1:5173",
|
|
70830
|
+
"https://cmmd.ai",
|
|
70816
70831
|
"https://forge-cloud.cmmd.ai",
|
|
70817
70832
|
"forge://app",
|
|
70818
70833
|
...CONFIGURED_CORS_ORIGINS
|
|
70819
70834
|
]);
|
|
70835
|
+
function isCmmdAiCorsOrigin(origin) {
|
|
70836
|
+
try {
|
|
70837
|
+
const url = new URL(origin);
|
|
70838
|
+
if (url.protocol !== "https:") return false;
|
|
70839
|
+
return url.hostname === "cmmd.ai" || url.hostname.endsWith(".cmmd.ai");
|
|
70840
|
+
} catch {
|
|
70841
|
+
return false;
|
|
70842
|
+
}
|
|
70843
|
+
}
|
|
70820
70844
|
function isAllowedCorsOrigin(origin) {
|
|
70821
|
-
return ALLOWED_CORS_ORIGINS.has(origin);
|
|
70845
|
+
return ALLOWED_CORS_ORIGINS.has(origin) || isCmmdAiCorsOrigin(origin);
|
|
70822
70846
|
}
|
|
70823
70847
|
const browserApiCorsLayer = middleware(require_HttpServer.cors({
|
|
70824
70848
|
allowedOrigins: isAllowedCorsOrigin,
|
|
@@ -71922,7 +71946,7 @@ const EMPTY_PARSED_ERROR = {
|
|
|
71922
71946
|
function asRecord$13(value) {
|
|
71923
71947
|
return value !== null && typeof value === "object" && !Array.isArray(value) ? value : null;
|
|
71924
71948
|
}
|
|
71925
|
-
function readTrimmedString$
|
|
71949
|
+
function readTrimmedString$2(value) {
|
|
71926
71950
|
return (typeof value === "string" ? value.trim() : "") || null;
|
|
71927
71951
|
}
|
|
71928
71952
|
function readErrorEnvelope(record) {
|
|
@@ -71931,7 +71955,7 @@ function readErrorEnvelope(record) {
|
|
|
71931
71955
|
function readUpstreamErrorCode(body) {
|
|
71932
71956
|
const record = asRecord$13(body);
|
|
71933
71957
|
if (record === null) return null;
|
|
71934
|
-
return readTrimmedString$
|
|
71958
|
+
return readTrimmedString$2(record["code"]) ?? readTrimmedString$2(readErrorEnvelope(record)?.["code"]);
|
|
71935
71959
|
}
|
|
71936
71960
|
function readErrorMessage$2(raw) {
|
|
71937
71961
|
const record = asRecord$13(raw);
|
|
@@ -73174,12 +73198,12 @@ function resolveDesktopRelayControlPlaneTarget(path, configuredRuntimeId) {
|
|
|
73174
73198
|
code: "RELAY_OPERATION_DENIED"
|
|
73175
73199
|
};
|
|
73176
73200
|
}
|
|
73177
|
-
function isRecord$
|
|
73201
|
+
function isRecord$22(value) {
|
|
73178
73202
|
return typeof value === "object" && value !== null && !Array.isArray(value);
|
|
73179
73203
|
}
|
|
73180
73204
|
function relayControlPlaneBodyMatchesRuntime(path, body, configuredRuntimeId) {
|
|
73181
73205
|
if (path !== "/api/forge/context/devices/register") return true;
|
|
73182
|
-
if (!isRecord$
|
|
73206
|
+
if (!isRecord$22(body) || !isRecord$22(body.runtime)) return false;
|
|
73183
73207
|
return body.runtime.runtimeId === configuredRuntimeId;
|
|
73184
73208
|
}
|
|
73185
73209
|
/** Matches the client id `connect login` used, so CMMD accepts the refresh. */
|
|
@@ -73194,7 +73218,7 @@ function forbiddenResponse() {
|
|
|
73194
73218
|
return errorResponse(403, "RELAY_BRIDGE_FORBIDDEN", "Desktop relay bridge access denied.");
|
|
73195
73219
|
}
|
|
73196
73220
|
function relayProxyErrorResponse(error) {
|
|
73197
|
-
if (error instanceof CmmdProxyRequestError && isRecord$
|
|
73221
|
+
if (error instanceof CmmdProxyRequestError && isRecord$22(error.body)) {
|
|
73198
73222
|
const code = typeof error.body.code === "string" ? error.body.code : error.code;
|
|
73199
73223
|
const message = typeof error.body.error === "string" ? error.body.error : error.detail;
|
|
73200
73224
|
return errorResponse(error.status >= 500 ? 502 : error.status, code, message ?? "CMMD relay coordination failed.");
|
|
@@ -95888,7 +95912,7 @@ const REPLICA_THREAD_STATUSES = [
|
|
|
95888
95912
|
];
|
|
95889
95913
|
//#endregion
|
|
95890
95914
|
//#region src/runtimeReplication/replicaDecodeModel.ts
|
|
95891
|
-
function isRecord$
|
|
95915
|
+
function isRecord$21(value) {
|
|
95892
95916
|
return typeof value === "object" && value !== null && !Array.isArray(value);
|
|
95893
95917
|
}
|
|
95894
95918
|
function isNonBlankString(value) {
|
|
@@ -95908,7 +95932,7 @@ function nullableInteger(value) {
|
|
|
95908
95932
|
return value === null || typeof value === "number" && Number.isSafeInteger(value);
|
|
95909
95933
|
}
|
|
95910
95934
|
function unwrapEnvelope(payload, expectedDomain) {
|
|
95911
|
-
if (!isRecord$
|
|
95935
|
+
if (!isRecord$21(payload) || !isRecord$21(payload.meta) || !isRecord$21(payload.data)) return null;
|
|
95912
95936
|
const { domain, timestamp, version } = payload.meta;
|
|
95913
95937
|
if (!isNonBlankString(domain) || expectedDomain !== void 0 && domain !== expectedDomain || version !== "1.0" || !isIsoDateTime(timestamp)) return null;
|
|
95914
95938
|
return payload.data;
|
|
@@ -95921,12 +95945,12 @@ function hasValidRuntimeIdentity(value) {
|
|
|
95921
95945
|
].includes(String(value.runtimeKind)) && typeof value.displayName === "string" && typeof value.status === "string";
|
|
95922
95946
|
}
|
|
95923
95947
|
function decodeRuntime$1(value) {
|
|
95924
|
-
if (!isRecord$
|
|
95925
|
-
if (!nullableString(value.endpointUrl) || value.endpointUrl !== null && !URL.canParse(value.endpointUrl) || !nullableInteger(value.deviceId) || !nullableString(value.workspaceRoot) || !nullableString(value.githubRepoFullName) || !(value.lastSeenAt === null || isIsoDateTime(value.lastSeenAt)) || !(value.metadata === void 0 || value.metadata === null || isRecord$
|
|
95948
|
+
if (!isRecord$21(value) || !hasValidRuntimeIdentity(value)) return null;
|
|
95949
|
+
if (!nullableString(value.endpointUrl) || value.endpointUrl !== null && !URL.canParse(value.endpointUrl) || !nullableInteger(value.deviceId) || !nullableString(value.workspaceRoot) || !nullableString(value.githubRepoFullName) || !(value.lastSeenAt === null || isIsoDateTime(value.lastSeenAt)) || !(value.metadata === void 0 || value.metadata === null || isRecord$21(value.metadata))) return null;
|
|
95926
95950
|
return value;
|
|
95927
95951
|
}
|
|
95928
95952
|
function decodeProject(value) {
|
|
95929
|
-
if (!isRecord$
|
|
95953
|
+
if (!isRecord$21(value) || !isNonBlankString(value.projectId) || typeof value.title !== "string" || !nullableString(value.githubRepoFullName) || !nullableString(value.branch)) return null;
|
|
95930
95954
|
return {
|
|
95931
95955
|
projectId: value.projectId,
|
|
95932
95956
|
title: value.title,
|
|
@@ -95935,11 +95959,11 @@ function decodeProject(value) {
|
|
|
95935
95959
|
};
|
|
95936
95960
|
}
|
|
95937
95961
|
function decodeThread$1(value) {
|
|
95938
|
-
if (!isRecord$
|
|
95962
|
+
if (!isRecord$21(value) || !isNonBlankString(value.threadId) || typeof value.title !== "string" || !isReplicaThreadStatus(value.status) || !nullableString(value.model) || !nullableString(value.branch) || !(value.lastActivityAt === null || isIsoDateTime(value.lastActivityAt)) || !(value.metadata === void 0 || value.metadata === null || isRecord$21(value.metadata))) return null;
|
|
95939
95963
|
return value;
|
|
95940
95964
|
}
|
|
95941
95965
|
function decodeSummary(value) {
|
|
95942
|
-
if (!isRecord$
|
|
95966
|
+
if (!isRecord$21(value) || !nullableString(value.conversationId)) return null;
|
|
95943
95967
|
const project = decodeProject(value.project);
|
|
95944
95968
|
const thread = decodeThread$1(value.thread);
|
|
95945
95969
|
return project === null || thread === null ? null : {
|
|
@@ -96050,7 +96074,7 @@ function isNonNegativeInt(value) {
|
|
|
96050
96074
|
/** `usage` is null for an Unreported turn, otherwise exactly the five buckets. */
|
|
96051
96075
|
function isValidTurnUsageTokens(value) {
|
|
96052
96076
|
if (value === null) return true;
|
|
96053
|
-
if (!isRecord$
|
|
96077
|
+
if (!isRecord$21(value)) return false;
|
|
96054
96078
|
return turnUsageTokenKeys.every((key) => isNonNegativeInt(value[key])) && Object.keys(value).every((key) => turnUsageTokenKeys.includes(key));
|
|
96055
96079
|
}
|
|
96056
96080
|
/** The row itself: no text, no status, and the turn it belongs to. */
|
|
@@ -96059,7 +96083,7 @@ function hasValidTurnUsageEnvelope(value) {
|
|
|
96059
96083
|
}
|
|
96060
96084
|
/** What the row records: who ran it, what it spent, and what it says of itself. */
|
|
96061
96085
|
function hasValidTurnUsageRecord(payload) {
|
|
96062
|
-
return isRecord$
|
|
96086
|
+
return isRecord$21(payload) && isNonBlankString(payload.provider) && isNonBlankString(payload.model) && "usage" in payload && isValidTurnUsageTokens(payload.usage) && hasValidTurnUsageAttribution(payload);
|
|
96063
96087
|
}
|
|
96064
96088
|
/** A turn_usage row: no text, no status, and its record in `payload`. */
|
|
96065
96089
|
function hasValidTurnUsagePayload(value) {
|
|
@@ -96096,7 +96120,7 @@ function hasValidEventPayload(value) {
|
|
|
96096
96120
|
return isNonBlankString(value.text) && value.status === null;
|
|
96097
96121
|
}
|
|
96098
96122
|
function decodeEvent$1(value) {
|
|
96099
|
-
if (!isRecord$
|
|
96123
|
+
if (!isRecord$21(value) || !hasValidEventFields(value) || !hasValidEventPayload(value)) return null;
|
|
96100
96124
|
return value;
|
|
96101
96125
|
}
|
|
96102
96126
|
function decodeEvents(data) {
|
|
@@ -96117,11 +96141,11 @@ function decodeReplicaThreadDetail(payload) {
|
|
|
96117
96141
|
const thread = decodeThread$1(data.thread);
|
|
96118
96142
|
const reachability = decodeReachability(data.reachability);
|
|
96119
96143
|
const events = decodeEvents(data);
|
|
96120
|
-
if (runtime === null || project === null || thread === null || reachability === null || events === null || !isRecord$
|
|
96144
|
+
if (runtime === null || project === null || thread === null || reachability === null || events === null || !isRecord$21(data.execution) || typeof data.execution.available !== "boolean" || ![
|
|
96121
96145
|
null,
|
|
96122
96146
|
"runtime_offline",
|
|
96123
96147
|
"runtime_unavailable"
|
|
96124
|
-
].includes(data.execution.reason) || (data.execution.available ? data.execution.reason !== null : data.execution.reason === null) || !isRecord$
|
|
96148
|
+
].includes(data.execution.reason) || (data.execution.available ? data.execution.reason !== null : data.execution.reason === null) || !isRecord$21(data.replication) || data.replication.protocolVersion !== 2 || !isNonBlankString(data.replication.generationId) || !Number.isSafeInteger(data.replication.acknowledgedSequence) || Number(data.replication.acknowledgedSequence) < 0 || !isNonBlankString(data.replication.headHash)) return null;
|
|
96125
96149
|
return {
|
|
96126
96150
|
conversationId: data.conversationId,
|
|
96127
96151
|
runtime,
|
|
@@ -97197,7 +97221,7 @@ function resolveRuntimeReplicationRuntimeId(config) {
|
|
|
97197
97221
|
}
|
|
97198
97222
|
//#endregion
|
|
97199
97223
|
//#region src/usage/providerTokenBuckets.ts
|
|
97200
|
-
function isRecord$
|
|
97224
|
+
function isRecord$20(value) {
|
|
97201
97225
|
return typeof value === "object" && value !== null && !Array.isArray(value);
|
|
97202
97226
|
}
|
|
97203
97227
|
function count(record, ...keys) {
|
|
@@ -97218,7 +97242,7 @@ function reportedOrNull(tokens) {
|
|
|
97218
97242
|
* the app server sends camelCase.
|
|
97219
97243
|
*/
|
|
97220
97244
|
function codexTokenBuckets(value) {
|
|
97221
|
-
if (!isRecord$
|
|
97245
|
+
if (!isRecord$20(value)) return null;
|
|
97222
97246
|
const inputTokens = count(value, "input_tokens", "inputTokens");
|
|
97223
97247
|
const cachedInputTokens = count(value, "cached_input_tokens", "cachedInputTokens");
|
|
97224
97248
|
const cacheCreationTokens = count(value, "cache_write_input_tokens", "cacheWriteInputTokens");
|
|
@@ -97237,7 +97261,7 @@ function codexTokenBuckets(value) {
|
|
|
97237
97261
|
* tokens into output and does not break them out, so reasoning stays zero.
|
|
97238
97262
|
*/
|
|
97239
97263
|
function claudeTokenBuckets(value) {
|
|
97240
|
-
if (!isRecord$
|
|
97264
|
+
if (!isRecord$20(value)) return null;
|
|
97241
97265
|
return reportedOrNull({
|
|
97242
97266
|
uncachedInputTokens: count(value, "input_tokens", "inputTokens"),
|
|
97243
97267
|
cachedInputTokens: count(value, "cache_read_input_tokens", "cacheReadInputTokens"),
|
|
@@ -98408,7 +98432,7 @@ const replicaTurnStatuses = new Set([
|
|
|
98408
98432
|
"cancelled",
|
|
98409
98433
|
"interrupted"
|
|
98410
98434
|
]);
|
|
98411
|
-
function isRecord$
|
|
98435
|
+
function isRecord$19(value) {
|
|
98412
98436
|
return typeof value === "object" && value !== null && !Array.isArray(value);
|
|
98413
98437
|
}
|
|
98414
98438
|
function replicaSourceSequence(value) {
|
|
@@ -98421,7 +98445,7 @@ function replicaSourceTurn(sourceTurnId) {
|
|
|
98421
98445
|
return typeof sourceTurnId === "string" && sourceTurnId.length > 0 ? { turnId: sourceTurnId } : {};
|
|
98422
98446
|
}
|
|
98423
98447
|
function replicaActivitySource(activity) {
|
|
98424
|
-
if (!activity.kind.startsWith("replica.") || !isRecord$
|
|
98448
|
+
if (!activity.kind.startsWith("replica.") || !isRecord$19(activity.payload)) return null;
|
|
98425
98449
|
const sourceSequence = replicaSourceSequence(activity.sequence);
|
|
98426
98450
|
const eventId = replicaSourceEventId(activity.payload.sourceEventId);
|
|
98427
98451
|
if (sourceSequence === null || eventId === null) return null;
|
|
@@ -98434,7 +98458,7 @@ function replicaActivitySource(activity) {
|
|
|
98434
98458
|
}
|
|
98435
98459
|
function replicaSummaryEvent(activity, source) {
|
|
98436
98460
|
if (activity.kind !== "replica.activity_summary" && activity.kind !== "replica.error_summary") return null;
|
|
98437
|
-
const sourceText = isRecord$
|
|
98461
|
+
const sourceText = isRecord$19(activity.payload) ? activity.payload.text : null;
|
|
98438
98462
|
return {
|
|
98439
98463
|
sourceSequence: source.sourceSequence,
|
|
98440
98464
|
event: {
|
|
@@ -98447,7 +98471,7 @@ function replicaSummaryEvent(activity, source) {
|
|
|
98447
98471
|
};
|
|
98448
98472
|
}
|
|
98449
98473
|
function replicaTurnEvent(activity, source) {
|
|
98450
|
-
const status = isRecord$
|
|
98474
|
+
const status = isRecord$19(activity.payload) ? activity.payload.status : null;
|
|
98451
98475
|
if (activity.kind !== "replica.turn_status" || !replicaTurnStatuses.has(status)) return null;
|
|
98452
98476
|
return {
|
|
98453
98477
|
sourceSequence: source.sourceSequence,
|
|
@@ -98461,7 +98485,7 @@ function replicaTurnEvent(activity, source) {
|
|
|
98461
98485
|
};
|
|
98462
98486
|
}
|
|
98463
98487
|
function replicaToolCallEvent(activity, source) {
|
|
98464
|
-
if (activity.kind !== "replica.tool_call" || !isRecord$
|
|
98488
|
+
if (activity.kind !== "replica.tool_call" || !isRecord$19(activity.payload)) return null;
|
|
98465
98489
|
const sourceText = activity.payload.text;
|
|
98466
98490
|
const status = activity.payload.status;
|
|
98467
98491
|
if (typeof sourceText !== "string" || typeof status !== "string") return null;
|
|
@@ -98479,9 +98503,9 @@ function replicaToolCallEvent(activity, source) {
|
|
|
98479
98503
|
};
|
|
98480
98504
|
}
|
|
98481
98505
|
function replicaTurnUsageEvent(activity, source) {
|
|
98482
|
-
if (activity.kind !== "replica.turn_usage" || !isRecord$
|
|
98506
|
+
if (activity.kind !== "replica.turn_usage" || !isRecord$19(activity.payload)) return null;
|
|
98483
98507
|
const usage = activity.payload.payload;
|
|
98484
|
-
if (!("turnId" in source.turn) || !isRecord$
|
|
98508
|
+
if (!("turnId" in source.turn) || !isRecord$19(usage)) return null;
|
|
98485
98509
|
const provider = usage.provider;
|
|
98486
98510
|
const model = usage.model;
|
|
98487
98511
|
if (typeof provider !== "string" || typeof model !== "string" || !("usage" in usage)) return null;
|
|
@@ -99405,9 +99429,9 @@ function isUsageSessionLookupRuntimeNotFound(error) {
|
|
|
99405
99429
|
async function isRuntimeNotFoundResponse(response) {
|
|
99406
99430
|
if (response.status !== 404) return false;
|
|
99407
99431
|
const body = await response.json().catch(() => null);
|
|
99408
|
-
return isRecord$
|
|
99432
|
+
return isRecord$18(body) && body["code"] === "RUNTIME_NOT_FOUND";
|
|
99409
99433
|
}
|
|
99410
|
-
function isRecord$
|
|
99434
|
+
function isRecord$18(value) {
|
|
99411
99435
|
return typeof value === "object" && value !== null;
|
|
99412
99436
|
}
|
|
99413
99437
|
/**
|
|
@@ -99419,11 +99443,11 @@ function isRecord$17(value) {
|
|
|
99419
99443
|
* no count on the page saying so.
|
|
99420
99444
|
*/
|
|
99421
99445
|
function decodeHeldSessions(body) {
|
|
99422
|
-
const held = isRecord$
|
|
99446
|
+
const held = isRecord$18(body) && isRecord$18(body["data"]) ? body["data"]["held"] : void 0;
|
|
99423
99447
|
if (!Array.isArray(held)) throw new Error("The usage session lookup returned an invalid body.");
|
|
99424
99448
|
return held.map((row) => {
|
|
99425
|
-
const providerSessionId = isRecord$
|
|
99426
|
-
const runtimeId = isRecord$
|
|
99449
|
+
const providerSessionId = isRecord$18(row) ? row["providerSessionId"] : void 0;
|
|
99450
|
+
const runtimeId = isRecord$18(row) ? row["runtimeId"] : void 0;
|
|
99427
99451
|
if (typeof providerSessionId !== "string" || typeof runtimeId !== "string") throw new Error("The usage session lookup returned an invalid held row.");
|
|
99428
99452
|
return {
|
|
99429
99453
|
providerSessionId,
|
|
@@ -102238,7 +102262,7 @@ function emptyConfig(source, path) {
|
|
|
102238
102262
|
issues: []
|
|
102239
102263
|
};
|
|
102240
102264
|
}
|
|
102241
|
-
function isRecord$
|
|
102265
|
+
function isRecord$17(value) {
|
|
102242
102266
|
return typeof value === "object" && value !== null && !Array.isArray(value);
|
|
102243
102267
|
}
|
|
102244
102268
|
function stringArray(value) {
|
|
@@ -102266,7 +102290,7 @@ function terminalsFromValue(value) {
|
|
|
102266
102290
|
name: `Terminal ${index + 1}`,
|
|
102267
102291
|
command: terminal.trim()
|
|
102268
102292
|
}];
|
|
102269
|
-
if (!isRecord$
|
|
102293
|
+
if (!isRecord$17(terminal)) return [];
|
|
102270
102294
|
const command = typeof terminal.command === "string" ? terminal.command.trim() : "";
|
|
102271
102295
|
if (!command) return [];
|
|
102272
102296
|
return [{
|
|
@@ -102305,7 +102329,7 @@ function readConfigFile(source, path) {
|
|
|
102305
102329
|
}]
|
|
102306
102330
|
};
|
|
102307
102331
|
}
|
|
102308
|
-
if (!isRecord$
|
|
102332
|
+
if (!isRecord$17(parsed)) return {
|
|
102309
102333
|
...emptyConfig(source, path),
|
|
102310
102334
|
issues: [{
|
|
102311
102335
|
severity: "blocked",
|
|
@@ -103519,7 +103543,7 @@ const CLAUDE_IDENTITY_KEYS = new Set([
|
|
|
103519
103543
|
"credentialGenerationId"
|
|
103520
103544
|
]);
|
|
103521
103545
|
const CLAUDE_IDENTITY_OPTIONAL_KEYS = new Set(["providerAccountIdentity"]);
|
|
103522
|
-
function isRecord$
|
|
103546
|
+
function isRecord$16(value) {
|
|
103523
103547
|
return typeof value === "object" && value !== null && !Array.isArray(value);
|
|
103524
103548
|
}
|
|
103525
103549
|
function isStrictRfc3339DateTime(value) {
|
|
@@ -103548,7 +103572,7 @@ function hasAllowedKeys(value, required, optional) {
|
|
|
103548
103572
|
return keys.every((key) => required.has(key) || optional.has(key)) && [...required].every((key) => keys.includes(key));
|
|
103549
103573
|
}
|
|
103550
103574
|
function parseDeliveryIdentity(value, provider) {
|
|
103551
|
-
if (!isRecord$
|
|
103575
|
+
if (!isRecord$16(value)) return null;
|
|
103552
103576
|
if (provider === "openai") return parseCodexDeliveryIdentity(value);
|
|
103553
103577
|
if (provider === "anthropic") return parseClaudeDeliveryIdentity(value);
|
|
103554
103578
|
return null;
|
|
@@ -103583,7 +103607,7 @@ function parseClaudeDeliveryIdentity(value) {
|
|
|
103583
103607
|
};
|
|
103584
103608
|
}
|
|
103585
103609
|
function parseProviderRuntimeDeliveryReceipt(value, expected) {
|
|
103586
|
-
if (!isRecord$
|
|
103610
|
+
if (!isRecord$16(value) || !hasExactKeys$2(value, RECEIPT_KEYS)) return null;
|
|
103587
103611
|
const identity = parseDeliveryIdentity(value.identity, expected.provider);
|
|
103588
103612
|
if (!identity || typeof value.receiptId !== "string" || value.receiptId.length === 0 || value.receiptId.length > 256 || value.runtimeId !== expected.runtimeId || value.machineId !== expected.machineId || value.credentialEpoch !== expected.credentialEpoch || !Number.isInteger(value.credentialEpoch) || value.credentialEpoch < 0 || !isStrictRfc3339DateTime(value.issuedAt) || value.expiresAt !== expected.expiresAt || value.expiresAt !== null && !isStrictRfc3339DateTime(value.expiresAt)) return null;
|
|
103589
103613
|
return {
|
|
@@ -103605,8 +103629,8 @@ function providerDeliveryBindingFromReceipt(receipt) {
|
|
|
103605
103629
|
};
|
|
103606
103630
|
}
|
|
103607
103631
|
function readProviderDeliveryBinding(value) {
|
|
103608
|
-
if (!isRecord$
|
|
103609
|
-
const identityProvider = isRecord$
|
|
103632
|
+
if (!isRecord$16(value) || !hasExactKeys$2(value, BINDING_KEYS)) return null;
|
|
103633
|
+
const identityProvider = isRecord$16(value.identity) ? value.identity.provider : void 0;
|
|
103610
103634
|
const tokenProvider = identityProvider === "codex" ? "openai" : identityProvider === "claude" ? "anthropic" : null;
|
|
103611
103635
|
if (!tokenProvider) return null;
|
|
103612
103636
|
const identity = parseDeliveryIdentity(value.identity, tokenProvider);
|
|
@@ -151008,12 +151032,12 @@ function decodeProviderKind(providerName, operation) {
|
|
|
151008
151032
|
detail: `Unknown persisted provider '${providerName}'.`
|
|
151009
151033
|
}));
|
|
151010
151034
|
}
|
|
151011
|
-
function isRecord$
|
|
151035
|
+
function isRecord$15(value) {
|
|
151012
151036
|
return value !== null && typeof value === "object" && !Array.isArray(value);
|
|
151013
151037
|
}
|
|
151014
151038
|
function mergeRuntimePayload(existing, next) {
|
|
151015
151039
|
if (next === void 0) return existing ?? null;
|
|
151016
|
-
if (isRecord$
|
|
151040
|
+
if (isRecord$15(existing) && isRecord$15(next)) return {
|
|
151017
151041
|
...existing,
|
|
151018
151042
|
...next
|
|
151019
151043
|
};
|
|
@@ -153038,7 +153062,7 @@ const PAGINATION_KEYS = new Set([
|
|
|
153038
153062
|
"total",
|
|
153039
153063
|
"hasMore"
|
|
153040
153064
|
]);
|
|
153041
|
-
function isRecord$
|
|
153065
|
+
function isRecord$14(value) {
|
|
153042
153066
|
return typeof value === "object" && value !== null && !Array.isArray(value);
|
|
153043
153067
|
}
|
|
153044
153068
|
function hasOnlyKeys(value, allowed) {
|
|
@@ -153051,17 +153075,17 @@ function isRfc3339(value) {
|
|
|
153051
153075
|
return typeof value === "string" && RFC3339.test(value) && Number.isFinite(Date.parse(value));
|
|
153052
153076
|
}
|
|
153053
153077
|
function isEnvelopeMeta(value) {
|
|
153054
|
-
if (!isRecord$
|
|
153078
|
+
if (!isRecord$14(value) || !hasExactKeys$1(value, META_KEYS)) return false;
|
|
153055
153079
|
return typeof value.domain === "string" && value.domain.length > 0 && isRfc3339(value.timestamp) && typeof value.version === "string" && value.version.length > 0;
|
|
153056
153080
|
}
|
|
153057
153081
|
function isPagination(value) {
|
|
153058
|
-
if (!isRecord$
|
|
153082
|
+
if (!isRecord$14(value) || !hasExactKeys$1(value, PAGINATION_KEYS)) return false;
|
|
153059
153083
|
return Number.isInteger(value.page) && value.page >= 0 && Number.isInteger(value.limit) && value.limit >= 0 && Number.isInteger(value.total) && value.total >= 0 && typeof value.hasMore === "boolean";
|
|
153060
153084
|
}
|
|
153061
153085
|
function readLocalProviderAccountId(authJson) {
|
|
153062
153086
|
try {
|
|
153063
153087
|
const value = JSON.parse(authJson);
|
|
153064
|
-
if (!isRecord$
|
|
153088
|
+
if (!isRecord$14(value) || value.auth_mode !== "chatgpt" || !isRecord$14(value.tokens)) return null;
|
|
153065
153089
|
const providerAccountId = value.tokens.account_id;
|
|
153066
153090
|
if (typeof providerAccountId !== "string") return null;
|
|
153067
153091
|
const normalized = providerAccountId.trim();
|
|
@@ -153074,13 +153098,13 @@ function resolveLocalAuthJsonPath(homePath) {
|
|
|
153074
153098
|
return (0, node_path.join)(homePath?.trim() || process.env.CODEX_HOME?.trim() || (0, node_path.join)((0, node_os.homedir)(), ".codex"), "auth.json");
|
|
153075
153099
|
}
|
|
153076
153100
|
function parseCodexAccountIdentityEnvelope(value) {
|
|
153077
|
-
if (!isRecord$
|
|
153101
|
+
if (!isRecord$14(value) || !hasOnlyKeys(value, ENVELOPE_KEYS)) return null;
|
|
153078
153102
|
if (!("data" in value) || !("meta" in value) || !isEnvelopeMeta(value.meta)) return null;
|
|
153079
153103
|
if (value.pagination !== void 0 && !isPagination(value.pagination)) return null;
|
|
153080
153104
|
return readCodexAccountIdentity(value.data);
|
|
153081
153105
|
}
|
|
153082
153106
|
function readCodexAccountIdentity(value) {
|
|
153083
|
-
if (!isRecord$
|
|
153107
|
+
if (!isRecord$14(value) || !hasExactKeys$1(value, IDENTITY_KEYS)) return null;
|
|
153084
153108
|
if (value.kind !== "provider_account" || value.provider !== "codex" || typeof value.providerAccountIdentity !== "string" || !PROVIDER_ACCOUNT_IDENTITY$1.test(value.providerAccountIdentity)) return null;
|
|
153085
153109
|
return {
|
|
153086
153110
|
kind: "provider_account",
|
|
@@ -212698,7 +212722,7 @@ const MAX_WORKER_PLAN_ITEMS = 5;
|
|
|
212698
212722
|
function asRecord$10(value) {
|
|
212699
212723
|
return typeof value === "object" && value !== null && !Array.isArray(value) ? value : void 0;
|
|
212700
212724
|
}
|
|
212701
|
-
function readTrimmedString(value) {
|
|
212725
|
+
function readTrimmedString$1(value) {
|
|
212702
212726
|
return typeof value === "string" ? value.trim() : void 0;
|
|
212703
212727
|
}
|
|
212704
212728
|
function isValidWorkerSlug(value) {
|
|
@@ -212712,9 +212736,9 @@ function isValidWorkerSummary(value) {
|
|
|
212712
212736
|
}
|
|
212713
212737
|
function decodeWorkerPlanItem(value) {
|
|
212714
212738
|
const item = asRecord$10(value);
|
|
212715
|
-
const slug = readTrimmedString(item?.slug);
|
|
212716
|
-
const title = readTrimmedString(item?.title);
|
|
212717
|
-
const summary = readTrimmedString(item?.summary);
|
|
212739
|
+
const slug = readTrimmedString$1(item?.slug);
|
|
212740
|
+
const title = readTrimmedString$1(item?.title);
|
|
212741
|
+
const summary = readTrimmedString$1(item?.summary);
|
|
212718
212742
|
if (!isValidWorkerSlug(slug)) return void 0;
|
|
212719
212743
|
if (!isValidWorkerTitle(title)) return void 0;
|
|
212720
212744
|
if (!isValidWorkerSummary(summary)) return void 0;
|
|
@@ -214978,8 +215002,8 @@ function cliSelectsOsStore(input) {
|
|
|
214978
215002
|
if (input.env[CLAUDE_FORCE_OS_CREDENTIAL_STORE_ENV] === "1") return true;
|
|
214979
215003
|
const config = readConfig(input);
|
|
214980
215004
|
if (config === null) return false;
|
|
214981
|
-
const features = isRecord$
|
|
214982
|
-
const flag = isRecord$
|
|
215005
|
+
const features = isRecord$13(config.parsed) ? config.parsed[CACHED_FEATURES_KEY] : void 0;
|
|
215006
|
+
const flag = isRecord$13(features) ? features[OS_STORE_FLAG_KEY] : void 0;
|
|
214983
215007
|
return typeof flag === "boolean" ? flag : null;
|
|
214984
215008
|
}
|
|
214985
215009
|
/**
|
|
@@ -215007,7 +215031,7 @@ function hasSessionBus(input) {
|
|
|
215007
215031
|
const runtimeDirectory = input.env.XDG_RUNTIME_DIR?.trim();
|
|
215008
215032
|
return runtimeDirectory ? input.fileExists((0, node_path.join)(runtimeDirectory, "bus")) : false;
|
|
215009
215033
|
}
|
|
215010
|
-
function isRecord$
|
|
215034
|
+
function isRecord$13(value) {
|
|
215011
215035
|
return typeof value === "object" && value !== null && !Array.isArray(value);
|
|
215012
215036
|
}
|
|
215013
215037
|
//#endregion
|
|
@@ -215931,7 +215955,7 @@ function createCodewebAgentTokenMintClient(input) {
|
|
|
215931
215955
|
}
|
|
215932
215956
|
function parseMintResponse(httpStatus, body) {
|
|
215933
215957
|
if (httpStatus === 404) return { status: "unknown_identity" };
|
|
215934
|
-
if (!isRecord$
|
|
215958
|
+
if (!isRecord$12(body)) return { status: "unavailable" };
|
|
215935
215959
|
if (body["status"] === "minted" && typeof body["token"] === "string") return {
|
|
215936
215960
|
status: "minted",
|
|
215937
215961
|
token: body["token"]
|
|
@@ -215943,7 +215967,7 @@ function parseMintResponse(httpStatus, body) {
|
|
|
215943
215967
|
};
|
|
215944
215968
|
return { status: "unavailable" };
|
|
215945
215969
|
}
|
|
215946
|
-
function isRecord$
|
|
215970
|
+
function isRecord$12(value) {
|
|
215947
215971
|
return typeof value === "object" && value !== null;
|
|
215948
215972
|
}
|
|
215949
215973
|
//#endregion
|
|
@@ -223018,7 +223042,7 @@ function deriveToolActivityPresentation(input) {
|
|
|
223018
223042
|
}
|
|
223019
223043
|
//#endregion
|
|
223020
223044
|
//#region src/provider/acp/AcpRuntimeModel.ts
|
|
223021
|
-
function isRecord$
|
|
223045
|
+
function isRecord$11(value) {
|
|
223022
223046
|
return typeof value === "object" && value !== null && !Array.isArray(value);
|
|
223023
223047
|
}
|
|
223024
223048
|
function extractModelConfigId(sessionResponse) {
|
|
@@ -223090,7 +223114,7 @@ function extractCommandFromTitle(title) {
|
|
|
223090
223114
|
return /`([^`]+)`/.exec(title)?.[1]?.trim() || void 0;
|
|
223091
223115
|
}
|
|
223092
223116
|
function extractToolCallCommand(rawInput, title) {
|
|
223093
|
-
if (isRecord$
|
|
223117
|
+
if (isRecord$11(rawInput)) {
|
|
223094
223118
|
const directCommand = normalizeCommandValue(rawInput.command);
|
|
223095
223119
|
if (directCommand) return directCommand;
|
|
223096
223120
|
const executable = typeof rawInput.executable === "string" ? rawInput.executable.trim() : "";
|
|
@@ -224957,11 +224981,11 @@ function settlePendingUserInputsAsEmptyAnswers(pendingUserInputs) {
|
|
|
224957
224981
|
const pendingEntries = Array.from(pendingUserInputs.values());
|
|
224958
224982
|
return require_Schema$1.forEach(pendingEntries, (pending) => require_Schema$1.succeed$2(pending.answers, {}).pipe(require_Schema$1.ignore), { discard: true });
|
|
224959
224983
|
}
|
|
224960
|
-
function isRecord$
|
|
224984
|
+
function isRecord$10(value) {
|
|
224961
224985
|
return typeof value === "object" && value !== null && !Array.isArray(value);
|
|
224962
224986
|
}
|
|
224963
224987
|
function parseCursorResume(raw) {
|
|
224964
|
-
if (!isRecord$
|
|
224988
|
+
if (!isRecord$10(raw)) return void 0;
|
|
224965
224989
|
if (raw.schemaVersion !== CURSOR_RESUME_VERSION) return void 0;
|
|
224966
224990
|
if (typeof raw.sessionId !== "string" || !raw.sessionId.trim()) return void 0;
|
|
224967
224991
|
return { sessionId: raw.sessionId.trim() };
|
|
@@ -234518,7 +234542,7 @@ function readinessData(value) {
|
|
|
234518
234542
|
return decodeClaudeRuntimeReadiness(value.data);
|
|
234519
234543
|
}
|
|
234520
234544
|
function decodeClaudeRuntimeReadiness(value) {
|
|
234521
|
-
if (!isRecord$
|
|
234545
|
+
if (!isRecord$9(value) || !hasValidClaudeRuntimeReadinessFields(value)) throw new ClaudeRuntimeReadinessError(CLAUDE_READINESS_COPY.unavailable);
|
|
234522
234546
|
return value;
|
|
234523
234547
|
}
|
|
234524
234548
|
function hasValidClaudeRuntimeReadinessFields(value) {
|
|
@@ -234527,7 +234551,7 @@ function hasValidClaudeRuntimeReadinessFields(value) {
|
|
|
234527
234551
|
function isNullableString$1(value) {
|
|
234528
234552
|
return value === null || typeof value === "string";
|
|
234529
234553
|
}
|
|
234530
|
-
function isRecord$
|
|
234554
|
+
function isRecord$9(value) {
|
|
234531
234555
|
return typeof value === "object" && value !== null && !Array.isArray(value);
|
|
234532
234556
|
}
|
|
234533
234557
|
function isRuntimeTicketSession(sessionId) {
|
|
@@ -288978,7 +289002,7 @@ function renderPipelineWorkerTaskPacket(input) {
|
|
|
288978
289002
|
"Recommended loop: forge-fix"
|
|
288979
289003
|
].join("\n\n");
|
|
288980
289004
|
}
|
|
288981
|
-
function isRecord$
|
|
289005
|
+
function isRecord$8(value) {
|
|
288982
289006
|
return value !== null && typeof value === "object" && !Array.isArray(value);
|
|
288983
289007
|
}
|
|
288984
289008
|
function nonEmptyStrings(value) {
|
|
@@ -289092,7 +289116,7 @@ function decodeStatefulGoldenPath(value, index, errors) {
|
|
|
289092
289116
|
};
|
|
289093
289117
|
}
|
|
289094
289118
|
function decodeGoldenPath(value, index, errors) {
|
|
289095
|
-
if (!isRecord$
|
|
289119
|
+
if (!isRecord$8(value)) {
|
|
289096
289120
|
errors.push(`workers[${index}].goldenPath must be an object`);
|
|
289097
289121
|
return null;
|
|
289098
289122
|
}
|
|
@@ -289102,7 +289126,7 @@ function decodeGoldenPath(value, index, errors) {
|
|
|
289102
289126
|
return null;
|
|
289103
289127
|
}
|
|
289104
289128
|
function decodeWorker(value, index, errors) {
|
|
289105
|
-
if (!isRecord$
|
|
289129
|
+
if (!isRecord$8(value)) {
|
|
289106
289130
|
errors.push(`workers[${index}] must be an object`);
|
|
289107
289131
|
return null;
|
|
289108
289132
|
}
|
|
@@ -289162,7 +289186,7 @@ function decodeLegacyFileScopes(value, index, errors) {
|
|
|
289162
289186
|
return scopes.map(normalizeScope);
|
|
289163
289187
|
}
|
|
289164
289188
|
function decodeLegacyWorker(value, index, errors) {
|
|
289165
|
-
if (!isRecord$
|
|
289189
|
+
if (!isRecord$8(value)) {
|
|
289166
289190
|
errors.push(`workers[${index}] must be an object`);
|
|
289167
289191
|
return null;
|
|
289168
289192
|
}
|
|
@@ -289224,7 +289248,7 @@ function validateMode(mode, riskLevel, workers, errors) {
|
|
|
289224
289248
|
}
|
|
289225
289249
|
function decodePipelineWorkerPlan(value) {
|
|
289226
289250
|
const errors = [];
|
|
289227
|
-
if (!isRecord$
|
|
289251
|
+
if (!isRecord$8(value)) return {
|
|
289228
289252
|
ok: false,
|
|
289229
289253
|
errors: ["worker plan must be an object"]
|
|
289230
289254
|
};
|
|
@@ -290098,7 +290122,7 @@ var ApprovedWorkerPlanInvariantError = class extends Error {
|
|
|
290098
290122
|
this.name = "ApprovedWorkerPlanInvariantError";
|
|
290099
290123
|
}
|
|
290100
290124
|
};
|
|
290101
|
-
function isRecord$
|
|
290125
|
+
function isRecord$7(value) {
|
|
290102
290126
|
return typeof value === "object" && value !== null;
|
|
290103
290127
|
}
|
|
290104
290128
|
function exactPositiveInteger(value) {
|
|
@@ -290113,7 +290137,7 @@ function assertApprovedWorkerIdentity(worker, expected) {
|
|
|
290113
290137
|
if (worker.id !== expected.workerThreadId || worker.kind !== "worker" || worker.parentThreadId !== expected.masterThreadId || worker.projectId !== expected.projectId || worker.anchorKind !== "task" || worker.anchorCmmdId !== expected.taskId || worker.branch !== expected.branch || worker.worktreePath !== expected.worktreePath) throw new ApprovedWorkerPlanInvariantError(`Existing worker '${expected.workerThreadId}' does not match the approved plan identity.`);
|
|
290114
290138
|
}
|
|
290115
290139
|
function activityMatchesPrompt(thread, kind, promptId) {
|
|
290116
|
-
return thread.activities.some((activity) => activity.kind === kind && isRecord$
|
|
290140
|
+
return thread.activities.some((activity) => activity.kind === kind && isRecord$7(activity.payload) && activity.payload["promptId"] === promptId);
|
|
290117
290141
|
}
|
|
290118
290142
|
function workerIdentity(prompt, slug) {
|
|
290119
290143
|
const token = (0, node_crypto.createHash)("sha256").update(`${prompt.masterThreadId}\n${prompt.promptId}\n${slug}`).digest("hex").slice(0, 24);
|
|
@@ -299758,7 +299782,7 @@ function resolveBuildCommitFromEnv(env) {
|
|
|
299758
299782
|
* environment descriptor down instead of reporting an honest "unknown".
|
|
299759
299783
|
*/
|
|
299760
299784
|
function readBakedBuildCommit() {
|
|
299761
|
-
return "
|
|
299785
|
+
return "52671486a7eccd32066591f8c8125252a3a6084a";
|
|
299762
299786
|
}
|
|
299763
299787
|
async function resolveServerBuildCommit(input) {
|
|
299764
299788
|
if (isFullCommitSha(input.baked)) return input.baked;
|
|
@@ -299981,6 +300005,219 @@ const makeServerEnvironment = require_Schema$1.fn("makeServerEnvironment")(funct
|
|
|
299981
300005
|
});
|
|
299982
300006
|
const ServerEnvironmentLive = require_Schema$1.effect(ServerEnvironment, makeServerEnvironment());
|
|
299983
300007
|
//#endregion
|
|
300008
|
+
//#region src/auth/http/cmmdEmbedExchange.ts
|
|
300009
|
+
function oauthSubjectForUserId(userId) {
|
|
300010
|
+
return `user:${userId}`;
|
|
300011
|
+
}
|
|
300012
|
+
const EmbedExchangeInput = require_Schema$1.Struct({ code: require_Schema$1.String });
|
|
300013
|
+
function isRecord$6(value) {
|
|
300014
|
+
return typeof value === "object" && value !== null;
|
|
300015
|
+
}
|
|
300016
|
+
function readTrimmedString(value) {
|
|
300017
|
+
if (typeof value !== "string") return void 0;
|
|
300018
|
+
const trimmed = value.trim();
|
|
300019
|
+
return trimmed.length > 0 ? trimmed : void 0;
|
|
300020
|
+
}
|
|
300021
|
+
function readFiniteNumber(value) {
|
|
300022
|
+
return typeof value === "number" && Number.isFinite(value) ? value : null;
|
|
300023
|
+
}
|
|
300024
|
+
function identityFromRedeemed(redeemed) {
|
|
300025
|
+
return normalizeCmmdUserIdentity(redeemed.user) ?? {
|
|
300026
|
+
id: String(redeemed.userId),
|
|
300027
|
+
firstName: null,
|
|
300028
|
+
lastName: null,
|
|
300029
|
+
email: `user-${redeemed.userId}@embed.local`,
|
|
300030
|
+
username: redeemed.displayName?.trim() || `user-${redeemed.userId}`
|
|
300031
|
+
};
|
|
300032
|
+
}
|
|
300033
|
+
function optionalRedeemedFields(body) {
|
|
300034
|
+
const refreshToken = readTrimmedString(body.refreshToken);
|
|
300035
|
+
const displayName = typeof body.displayName === "string" ? body.displayName : void 0;
|
|
300036
|
+
const forgeOwnerAssertion = readTrimmedString(body.forgeOwnerAssertion);
|
|
300037
|
+
const sessionGrant = readTrimmedString(body.sessionGrant);
|
|
300038
|
+
const sessionGrantExpiresAt = typeof body.sessionGrantExpiresAt === "string" ? body.sessionGrantExpiresAt : void 0;
|
|
300039
|
+
return {
|
|
300040
|
+
...refreshToken !== void 0 ? { refreshToken } : {},
|
|
300041
|
+
...displayName !== void 0 ? { displayName } : {},
|
|
300042
|
+
...forgeOwnerAssertion !== void 0 ? { forgeOwnerAssertion } : {},
|
|
300043
|
+
...sessionGrant !== void 0 ? { sessionGrant } : {},
|
|
300044
|
+
...sessionGrantExpiresAt !== void 0 ? { sessionGrantExpiresAt } : {}
|
|
300045
|
+
};
|
|
300046
|
+
}
|
|
300047
|
+
function readRedeemedEmbedHandoff(body) {
|
|
300048
|
+
if (!isRecord$6(body)) return null;
|
|
300049
|
+
const accessToken = readTrimmedString(body.accessToken);
|
|
300050
|
+
const mcpToken = readTrimmedString(body.mcpToken);
|
|
300051
|
+
const organizationId = readFiniteNumber(body.organizationId);
|
|
300052
|
+
const userId = readFiniteNumber(body.userId);
|
|
300053
|
+
if (accessToken === void 0 || mcpToken === void 0 || accessToken.length < 24 || mcpToken.length < 24 || organizationId === null || userId === null) return null;
|
|
300054
|
+
return {
|
|
300055
|
+
accessToken,
|
|
300056
|
+
mcpToken,
|
|
300057
|
+
organizationId,
|
|
300058
|
+
userId,
|
|
300059
|
+
user: body.user,
|
|
300060
|
+
...optionalRedeemedFields(body)
|
|
300061
|
+
};
|
|
300062
|
+
}
|
|
300063
|
+
function redeemEmbedCodeWithCmmd(code) {
|
|
300064
|
+
return require_Schema$1.tryPromise({
|
|
300065
|
+
try: () => fetch(resolveCommandAppEndpoint("/api/forge/embed/handoff/redeem"), {
|
|
300066
|
+
method: "POST",
|
|
300067
|
+
headers: { "content-type": "application/json" },
|
|
300068
|
+
body: JSON.stringify({ code })
|
|
300069
|
+
}),
|
|
300070
|
+
catch: (cause) => new AuthError({
|
|
300071
|
+
message: "Failed to redeem the CMMD embed handoff with CMMD.",
|
|
300072
|
+
status: 500,
|
|
300073
|
+
cause
|
|
300074
|
+
})
|
|
300075
|
+
}).pipe(require_Schema$1.flatMap((response) => require_Schema$1.tryPromise({
|
|
300076
|
+
try: async () => {
|
|
300077
|
+
const text = await response.text();
|
|
300078
|
+
let json = null;
|
|
300079
|
+
if (text.length > 0) try {
|
|
300080
|
+
json = JSON.parse(text);
|
|
300081
|
+
} catch {
|
|
300082
|
+
json = null;
|
|
300083
|
+
}
|
|
300084
|
+
return {
|
|
300085
|
+
ok: response.ok,
|
|
300086
|
+
status: response.status,
|
|
300087
|
+
json
|
|
300088
|
+
};
|
|
300089
|
+
},
|
|
300090
|
+
catch: (cause) => new AuthError({
|
|
300091
|
+
message: "Failed to read the CMMD embed handoff response.",
|
|
300092
|
+
status: 500,
|
|
300093
|
+
cause
|
|
300094
|
+
})
|
|
300095
|
+
})), require_Schema$1.flatMap(({ ok, status, json }) => {
|
|
300096
|
+
if (!ok) return require_Schema$1.fail(new AuthError({
|
|
300097
|
+
message: status === 400 || status === 401 || status === 404 ? "CMMD embed handoff code is invalid or expired." : "CMMD rejected the embed handoff redeem.",
|
|
300098
|
+
status: status === 400 || status === 401 || status === 404 ? 401 : 500
|
|
300099
|
+
}));
|
|
300100
|
+
const redeemed = readRedeemedEmbedHandoff(json);
|
|
300101
|
+
if (!redeemed) return require_Schema$1.fail(new AuthError({
|
|
300102
|
+
message: "CMMD returned an incomplete embed handoff payload.",
|
|
300103
|
+
status: 500
|
|
300104
|
+
}));
|
|
300105
|
+
return require_Schema$1.succeed(redeemed);
|
|
300106
|
+
}));
|
|
300107
|
+
}
|
|
300108
|
+
function persistLocalEmbedSession(input) {
|
|
300109
|
+
return require_Schema$1.gen(function* () {
|
|
300110
|
+
yield* setCommandAccessTokenForSession(input.sessionId, input.redeemed.mcpToken).pipe(require_Schema$1.mapError((cause) => new AuthError({
|
|
300111
|
+
message: "Failed to persist CMMD access token.",
|
|
300112
|
+
status: 500,
|
|
300113
|
+
cause
|
|
300114
|
+
})));
|
|
300115
|
+
yield* setCommandJwtForSession(input.sessionId, input.redeemed.accessToken, input.redeemed.refreshToken ? { refreshToken: input.redeemed.refreshToken } : {}).pipe(require_Schema$1.mapError((cause) => new AuthError({
|
|
300116
|
+
message: "Failed to persist CMMD JWT.",
|
|
300117
|
+
status: 500,
|
|
300118
|
+
cause
|
|
300119
|
+
})));
|
|
300120
|
+
const identity = identityFromRedeemed(input.redeemed);
|
|
300121
|
+
yield* setCmmdUserIdentityForSession(input.sessionId, identity).pipe(require_Schema$1.mapError((cause) => new AuthError({
|
|
300122
|
+
message: "Failed to persist CMMD identity.",
|
|
300123
|
+
status: 500,
|
|
300124
|
+
cause
|
|
300125
|
+
})));
|
|
300126
|
+
return identity;
|
|
300127
|
+
});
|
|
300128
|
+
}
|
|
300129
|
+
const authCmmdEmbedExchangeRouteLayer = add$1("POST", "/api/auth/cmmd-embed/exchange", require_Schema$1.gen(function* () {
|
|
300130
|
+
const request = yield* require_HttpServer.HttpServerRequest;
|
|
300131
|
+
const limited = rateLimitOrRespond({
|
|
300132
|
+
routeClass: "auth-bootstrap",
|
|
300133
|
+
clientKey: clientKeyFromRequest(request)
|
|
300134
|
+
});
|
|
300135
|
+
if (limited) return limited;
|
|
300136
|
+
const code = (yield* require_HttpServer.schemaBodyJson(EmbedExchangeInput).pipe(require_Schema$1.mapError((cause) => new AuthError({
|
|
300137
|
+
message: "Invalid CMMD embed handoff payload.",
|
|
300138
|
+
status: 400,
|
|
300139
|
+
cause
|
|
300140
|
+
})))).code.trim();
|
|
300141
|
+
if (code.length < 16) return yield* new AuthError({
|
|
300142
|
+
message: "Invalid CMMD embed handoff code.",
|
|
300143
|
+
status: 401
|
|
300144
|
+
});
|
|
300145
|
+
const redeemed = yield* redeemEmbedCodeWithCmmd(code);
|
|
300146
|
+
const serverAuth = yield* ServerAuth;
|
|
300147
|
+
const sessions = yield* SessionCredentialService;
|
|
300148
|
+
if (serverAuth.isForgeCloudShell?.() === true) {
|
|
300149
|
+
const assertionToken = redeemed.forgeOwnerAssertion?.trim();
|
|
300150
|
+
const sessionGrant = redeemed.sessionGrant?.trim();
|
|
300151
|
+
if (!assertionToken || !sessionGrant) return yield* new AuthError({
|
|
300152
|
+
message: "CMMD embed handoff did not include Forge Cloud owner credentials.",
|
|
300153
|
+
status: 500
|
|
300154
|
+
});
|
|
300155
|
+
const assertion = yield* validateCloudOwnerCallbackAssertion({
|
|
300156
|
+
serverAuth,
|
|
300157
|
+
assertionToken,
|
|
300158
|
+
authenticatedUserId: redeemed.userId
|
|
300159
|
+
});
|
|
300160
|
+
if (!assertion) return yield* new AuthError({
|
|
300161
|
+
message: "CMMD embed handoff owner assertion was rejected.",
|
|
300162
|
+
status: 401
|
|
300163
|
+
});
|
|
300164
|
+
const identity = identityFromRedeemed(redeemed);
|
|
300165
|
+
yield* persistCloudOwnerArtifacts({
|
|
300166
|
+
assertion,
|
|
300167
|
+
accessToken: redeemed.mcpToken,
|
|
300168
|
+
identity,
|
|
300169
|
+
jwtToken: redeemed.accessToken,
|
|
300170
|
+
refreshToken: redeemed.refreshToken,
|
|
300171
|
+
sessionGrant,
|
|
300172
|
+
sessionGrantExpiresAt: redeemed.sessionGrantExpiresAt
|
|
300173
|
+
});
|
|
300174
|
+
let response = yield* require_HttpServer.jsonUnsafe({
|
|
300175
|
+
authenticated: true,
|
|
300176
|
+
organizationId: redeemed.organizationId,
|
|
300177
|
+
cloudShell: true
|
|
300178
|
+
}, { status: 200 }).pipe(require_HttpServer.setCookie(FORGE_CLOUD_OWNER_ASSERTION_COOKIE, assertion.token, cloudOwnerAssertionCookieOptions(assertion)));
|
|
300179
|
+
const grantExpiresAt = redeemed.sessionGrantExpiresAt ? new Date(redeemed.sessionGrantExpiresAt) : new Date(Date.now() + 2160 * 60 * 60 * 1e3);
|
|
300180
|
+
response = yield* response.pipe(require_HttpServer.setCookie(FORGE_CLOUD_SESSION_GRANT_COOKIE, sessionGrant, cloudOwnerSessionGrantCookieOptions({
|
|
300181
|
+
token: sessionGrant,
|
|
300182
|
+
expiresAt: grantExpiresAt
|
|
300183
|
+
})));
|
|
300184
|
+
return response;
|
|
300185
|
+
}
|
|
300186
|
+
const issued = yield* sessions.issue({
|
|
300187
|
+
method: "browser-session-cookie",
|
|
300188
|
+
role: "owner",
|
|
300189
|
+
subject: oauthSubjectForUserId(redeemed.userId),
|
|
300190
|
+
client: deriveAuthClientMetadata({
|
|
300191
|
+
request,
|
|
300192
|
+
label: "CMMD embed"
|
|
300193
|
+
})
|
|
300194
|
+
}).pipe(require_Schema$1.mapError((cause) => new AuthError({
|
|
300195
|
+
message: "Failed to issue authenticated session.",
|
|
300196
|
+
cause
|
|
300197
|
+
})));
|
|
300198
|
+
const cmmdIdentity = yield* persistLocalEmbedSession({
|
|
300199
|
+
sessionId: issued.sessionId,
|
|
300200
|
+
redeemed
|
|
300201
|
+
});
|
|
300202
|
+
if (redeemed.sessionGrant) yield* setCommandSessionGrantForSession(issued.sessionId, redeemed.sessionGrant).pipe(require_Schema$1.ignore({ log: false }));
|
|
300203
|
+
const secure = shouldUseSecureCookie(forgePublicUrlForRequest(request));
|
|
300204
|
+
return yield* require_HttpServer.jsonUnsafe({
|
|
300205
|
+
authenticated: true,
|
|
300206
|
+
role: issued.role,
|
|
300207
|
+
sessionMethod: issued.method,
|
|
300208
|
+
expiresAt: require_Schema$1.toUtc(issued.expiresAt),
|
|
300209
|
+
cmmdIdentity,
|
|
300210
|
+
organizationId: redeemed.organizationId,
|
|
300211
|
+
cloudShell: false
|
|
300212
|
+
}, { status: 200 }).pipe(require_HttpServer.setCookie(sessions.cookieName, issued.token, {
|
|
300213
|
+
expires: require_Schema$1.toDate(issued.expiresAt),
|
|
300214
|
+
httpOnly: true,
|
|
300215
|
+
path: "/",
|
|
300216
|
+
sameSite: "lax",
|
|
300217
|
+
secure
|
|
300218
|
+
}));
|
|
300219
|
+
}).pipe(require_Schema$1.catchTag("AuthError", (error) => respondToAuthError(error))));
|
|
300220
|
+
//#endregion
|
|
299984
300221
|
//#region src/auth/http/cloudOwnerDeviceSession.ts
|
|
299985
300222
|
/**
|
|
299986
300223
|
* Native OAuth clients allowed to redeem a Forge Cloud session grant through
|
|
@@ -300124,7 +300361,10 @@ const cloudOwnerSessionRevokeRouteLayer = add$1("POST", "/api/auth/cloud/session
|
|
|
300124
300361
|
const SCALAR_API_REFERENCE_URL = "https://cdn.jsdelivr.net/npm/@scalar/api-reference@1.64.1";
|
|
300125
300362
|
const SCALAR_API_REFERENCE_INTEGRITY = "sha384-SmFRDuBBmEoCbbBCTcn8/+cIQONyH0xgOKpsp6OttBlI8uG9uc6iAO8SonYQ3e1W";
|
|
300126
300363
|
const API_DOCS_SECURITY_HEADERS = {
|
|
300127
|
-
|
|
300364
|
+
"permissions-policy": BROWSER_DOCUMENT_SECURITY_HEADERS["permissions-policy"],
|
|
300365
|
+
"referrer-policy": BROWSER_DOCUMENT_SECURITY_HEADERS["referrer-policy"],
|
|
300366
|
+
"x-content-type-options": BROWSER_DOCUMENT_SECURITY_HEADERS["x-content-type-options"],
|
|
300367
|
+
"x-frame-options": "DENY",
|
|
300128
300368
|
"content-security-policy": [
|
|
300129
300369
|
"default-src 'none'",
|
|
300130
300370
|
"script-src 'self' https://cdn.jsdelivr.net",
|
|
@@ -323667,7 +323907,7 @@ const MiscRuntimeLayerLive = require_Schema$1.mergeAll(AnalyticsServiceLayerLive
|
|
|
323667
323907
|
const RuntimeDependenciesWithoutPullRequestsLive = ReactorLayerLive.pipe(require_Schema$1.provideMerge(CheckpointingLayerLive), require_Schema$1.provideMerge(GitLayerLive), require_Schema$1.provideMerge(OrchestrationLayerLive), require_Schema$1.provideMerge(ProviderLayerLive), require_Schema$1.provideMerge(TerminalLayerLive), require_Schema$1.provideMerge(AgentBrowserManagerLive), require_Schema$1.provideMerge(require_Schema$1.mergeAll(ThreadDevRuntimeLive, DevTunnelLive.pipe(require_Schema$1.provide$1(ThreadDevRuntimeLive)))), require_Schema$1.provideMerge(PersistenceLayerLive), require_Schema$1.provideMerge(KeybindingsLive), require_Schema$1.provideMerge(ProviderRegistryLive), require_Schema$1.provideMerge(require_Schema$1.mergeAll(ServerSettingsLive, UsageServiceLive.pipe(require_Schema$1.provide$1(ServerSettingsLive), require_Schema$1.provide$1(UsageSessionLookupLive), require_Schema$1.provide$1(UsageRecordedSourceLive.pipe(require_Schema$1.provide$1(OrchestrationLayerLive), require_Schema$1.provide$1(RuntimeReplicationOutboxLive), require_Schema$1.provide$1(ProviderSessionRuntimeRepositoryLive), require_Schema$1.provide$1(TextGenerationSessionRepositoryLive)))))), require_Schema$1.provideMerge(WorkspaceLayerLive), require_Schema$1.provideMerge(WorkspaceReadinessStateLive), require_Schema$1.provideMerge(ProjectFaviconResolverLive), require_Schema$1.provideMerge(RepositoryIdentityResolverLive), require_Schema$1.provideMerge(ServerEnvironmentLive), require_Schema$1.provideMerge(AuthLayerLive), require_Schema$1.provideMerge(ServerSecretStoreLayerLive), require_Schema$1.provideMerge(require_Schema$1.mergeAll(CloudRedisCoordinationLive, CloudStateSyncLive.pipe(require_Schema$1.provide$1(PersistenceLayerLive)))), require_Schema$1.provideMerge(MiscRuntimeLayerLive));
|
|
323668
323908
|
const RuntimeDependenciesLive = pullRequestServiceFactoryLayer.pipe(require_Schema$1.provideMerge(RuntimeDependenciesWithoutPullRequestsLive), require_Schema$1.provideMerge(cmmdProjectIdentityResolverLive.pipe(require_Schema$1.provide$1(RuntimeDependenciesWithoutPullRequestsLive))), require_Schema$1.provideMerge(pullRequestProviderRuntimeLive));
|
|
323669
323909
|
const RuntimeServicesLive = ServerRuntimeStartupLive.pipe(require_Schema$1.provideMerge(RuntimeDependenciesLive));
|
|
323670
|
-
const makeRoutesLayer = require_Schema$1.mergeAll(attachmentUploadRouteLayer, authBearerBootstrapRouteLayer, authBootstrapRouteLayer, authCommandBearerBootstrapRouteLayer, authCommandBootstrapRouteLayer, authOAuthTokenExchangeRouteLayer, authWebSocketTicketRouteLayer, authCmmdOAuthDeviceRouteLayer, authCmmdOAuthTokenRouteLayer, authCmmdPasswordTokenRouteLayer, authClientsRevokeOthersRouteLayer, authClientsRevokeRouteLayer, authClientsRouteLayer, authLogoutRouteLayer, authPairingLinksRevokeRouteLayer, authPairingLinksRouteLayer, authPairingCredentialRouteLayer, authSessionRenewRouteLayer, authSessionRouteLayer, authWebSocketTokenRouteLayer, authWebLoginRouteLayer, authWebCallbackRouteLayer, cloudOwnerSessionRedeemRouteLayer, cloudOwnerSessionRevokeRouteLayer, desktopLocalWebBridgePublishRouteLayer, desktopLocalWebBridgeBootstrapRouteLayer, desktopRelayControlPlaneRouteLayer, apiDocsHtmlRouteLayer, apiDocsOpenApiRouteLayer, pulseSignalStateListRouteLayer, pulseSignalStateUpsertRouteLayer, cmmdProfileRouteLayer, ...cmmdProxyRouteLayers, cmmdWorkIntakeRouteLayer, cmmdWsTokenRouteLayer, cmmdGetProjectCommentsRouteLayer, cmmdAddProjectCommentRouteLayer, cmmdUpdateProjectRouteLayer, cmmdUploadTaskAttachmentRouteLayer, cmmdUpdateTaskCommentRouteLayer, cmmdListWorkspaceMembersRouteLayer, cmmdAddProjectMemberRouteLayer, cmmdUpdateProjectAgentMemberAvatarRouteLayer, runtimeReplicationStatusRouteLayer, cmmdRefreshProviderUsageRouteLayer, cmmdForgeCloudProjectsListRouteLayer, cmmdForgeCloudProjectsEventsRouteLayer, cmmdForgeEnvironmentsEventsRouteLayer, cmmdForgeRuntimesEnsureRouteLayer, cmmdForgeRuntimesConnectRouteLayer, ownerRuntimeCodexReadinessRouteLayer, cmmdForgeRuntimesStatusRouteLayer, cmmdForgeRuntimesStartRouteLayer, cmmdForgeRuntimesStopRouteLayer, cmmdForgeRuntimesRecycleRouteLayer, cmmdForgeRuntimesUpdateCommitRouteLayer, cmmdForgeRuntimesDestroyRouteLayer, mobileProviderCatalogRouteLayer, attachmentsRouteLayer, orchestrationDispatchRouteLayer, orchestrationCmmdWorkRunEventRouteLayer, orchestrationAutomationStartThreadRouteLayer, orchestrationAutomationRebindRouteLayer, orchestrationAutomationTerminalReconcileRouteLayer, mobileGitRunStackedActionRouteLayer, pullRequestDiffRouteLayer, orchestrationSnapshotRouteLayer, orchestrationThreadSnapshotRouteLayer, localAutomationListRouteLayer, localAutomationCreateRouteLayer, localAutomationUpdateRouteLayer, localAutomationDeleteRouteLayer, localAutomationRunRouteLayer, otlpTracesProxyRouteLayer, devTunnelProxyRouteLayer, devTunnelLocalPortProxyRouteLayer, projectFaviconRouteLayer, serverEnvironmentRouteLayer, browserWebRtcReadinessRouteLayer, staticAndDevRouteLayer, githubStatusRouteLayer, githubAuthorizeUrlRouteLayer, githubDisconnectRouteLayer, githubReposRouteLayer, githubCloneRouteLayer, githubCloneJobStartRouteLayer, githubCloneJobStatusRouteLayer, githubRefreshCredentialsRouteLayer, githubToolConfirmationApproveRouteLayer, projectLinkGetRouteLayer, projectLinkListRouteLayer, projectLinkSetRouteLayer, projectLinkDeleteRouteLayer, cmmdWorkspacesRouteLayer, cmmdCampaignsRouteLayer, cmmdProjectLinksRouteLayer, cmmdEnsureGitHubProjectContextRouteLayer, cmmdProjectRepositoryEnsureRouteLayer, cmmdProjectsGetRouteLayer, cmmdProjectsCreateRouteLayer, workspaceReadinessRouteLayer, runtimeLivenessRouteLayer, runtimeFilesystemHealthRouteLayer, claudeNativeGenerationProofRouteLayer, claudeUsageRouteLayer, codexRuntimeProviderReadinessRouteLayer, runtimeDiagnosticsRouteLayer, cloudFoldersRouteLayer, cloudProjectCreateRouteLayer, gitUrlCloneRouteLayer, websocketRpcRouteLayer).pipe(require_Schema$1.provide$1(browserApiCorsLayer));
|
|
323910
|
+
const makeRoutesLayer = require_Schema$1.mergeAll(attachmentUploadRouteLayer, authBearerBootstrapRouteLayer, authBootstrapRouteLayer, authCommandBearerBootstrapRouteLayer, authCommandBootstrapRouteLayer, authCmmdEmbedExchangeRouteLayer, authOAuthTokenExchangeRouteLayer, authWebSocketTicketRouteLayer, authCmmdOAuthDeviceRouteLayer, authCmmdOAuthTokenRouteLayer, authCmmdPasswordTokenRouteLayer, authClientsRevokeOthersRouteLayer, authClientsRevokeRouteLayer, authClientsRouteLayer, authLogoutRouteLayer, authPairingLinksRevokeRouteLayer, authPairingLinksRouteLayer, authPairingCredentialRouteLayer, authSessionRenewRouteLayer, authSessionRouteLayer, authWebSocketTokenRouteLayer, authWebLoginRouteLayer, authWebCallbackRouteLayer, cloudOwnerSessionRedeemRouteLayer, cloudOwnerSessionRevokeRouteLayer, desktopLocalWebBridgePublishRouteLayer, desktopLocalWebBridgeBootstrapRouteLayer, desktopRelayControlPlaneRouteLayer, apiDocsHtmlRouteLayer, apiDocsOpenApiRouteLayer, pulseSignalStateListRouteLayer, pulseSignalStateUpsertRouteLayer, cmmdProfileRouteLayer, ...cmmdProxyRouteLayers, cmmdWorkIntakeRouteLayer, cmmdWsTokenRouteLayer, cmmdGetProjectCommentsRouteLayer, cmmdAddProjectCommentRouteLayer, cmmdUpdateProjectRouteLayer, cmmdUploadTaskAttachmentRouteLayer, cmmdUpdateTaskCommentRouteLayer, cmmdListWorkspaceMembersRouteLayer, cmmdAddProjectMemberRouteLayer, cmmdUpdateProjectAgentMemberAvatarRouteLayer, runtimeReplicationStatusRouteLayer, cmmdRefreshProviderUsageRouteLayer, cmmdForgeCloudProjectsListRouteLayer, cmmdForgeCloudProjectsEventsRouteLayer, cmmdForgeEnvironmentsEventsRouteLayer, cmmdForgeRuntimesEnsureRouteLayer, cmmdForgeRuntimesConnectRouteLayer, ownerRuntimeCodexReadinessRouteLayer, cmmdForgeRuntimesStatusRouteLayer, cmmdForgeRuntimesStartRouteLayer, cmmdForgeRuntimesStopRouteLayer, cmmdForgeRuntimesRecycleRouteLayer, cmmdForgeRuntimesUpdateCommitRouteLayer, cmmdForgeRuntimesDestroyRouteLayer, mobileProviderCatalogRouteLayer, attachmentsRouteLayer, orchestrationDispatchRouteLayer, orchestrationCmmdWorkRunEventRouteLayer, orchestrationAutomationStartThreadRouteLayer, orchestrationAutomationRebindRouteLayer, orchestrationAutomationTerminalReconcileRouteLayer, mobileGitRunStackedActionRouteLayer, pullRequestDiffRouteLayer, orchestrationSnapshotRouteLayer, orchestrationThreadSnapshotRouteLayer, localAutomationListRouteLayer, localAutomationCreateRouteLayer, localAutomationUpdateRouteLayer, localAutomationDeleteRouteLayer, localAutomationRunRouteLayer, otlpTracesProxyRouteLayer, devTunnelProxyRouteLayer, devTunnelLocalPortProxyRouteLayer, projectFaviconRouteLayer, serverEnvironmentRouteLayer, browserWebRtcReadinessRouteLayer, staticAndDevRouteLayer, githubStatusRouteLayer, githubAuthorizeUrlRouteLayer, githubDisconnectRouteLayer, githubReposRouteLayer, githubCloneRouteLayer, githubCloneJobStartRouteLayer, githubCloneJobStatusRouteLayer, githubRefreshCredentialsRouteLayer, githubToolConfirmationApproveRouteLayer, projectLinkGetRouteLayer, projectLinkListRouteLayer, projectLinkSetRouteLayer, projectLinkDeleteRouteLayer, cmmdWorkspacesRouteLayer, cmmdCampaignsRouteLayer, cmmdProjectLinksRouteLayer, cmmdEnsureGitHubProjectContextRouteLayer, cmmdProjectRepositoryEnsureRouteLayer, cmmdProjectsGetRouteLayer, cmmdProjectsCreateRouteLayer, workspaceReadinessRouteLayer, runtimeLivenessRouteLayer, runtimeFilesystemHealthRouteLayer, claudeNativeGenerationProofRouteLayer, claudeUsageRouteLayer, codexRuntimeProviderReadinessRouteLayer, runtimeDiagnosticsRouteLayer, cloudFoldersRouteLayer, cloudProjectCreateRouteLayer, gitUrlCloneRouteLayer, websocketRpcRouteLayer).pipe(require_Schema$1.provide$1(browserApiCorsLayer));
|
|
323671
323911
|
const makeServerLayer = require_Schema$1.unwrap(require_Schema$1.gen(function* () {
|
|
323672
323912
|
const config = yield* ServerConfig;
|
|
323673
323913
|
fixPath({ preferProcessPath: config.forgeCmmdRuntimeMode === true });
|