@cmmd-center/forge 0.13.46 → 0.13.48
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 +257 -84
- package/dist/bin.mjs +280 -108
- package/dist/client/assets/{CanvasPanel-VKPUBFca.js → CanvasPanel-DuyJKBry.js} +2 -2
- package/dist/client/assets/{CompositeItem-DZBAkVp1.js → CompositeItem-BsSeqHOM.js} +2 -2
- package/dist/client/assets/{DiffPanel-DtwPM18A.js → DiffPanel-BLym-hc9.js} +2 -2
- package/dist/client/assets/{DiffPanel.logic-ChgJm5ah.js → DiffPanel.logic-Wbhh-3Qp.js} +2 -2
- package/dist/client/assets/{DiffPanelShell-src4jZSc.js → DiffPanelShell-DpGXypQr.js} +97 -97
- package/dist/client/assets/{DiffWorkerPoolProvider-CBvutvTu.js → DiffWorkerPoolProvider-Dn7JEdwJ.js} +2 -2
- package/dist/client/assets/{PullRequestCodePanel-DTWGpKE_.js → PullRequestCodePanel-CAR7rIRF.js} +2 -2
- package/dist/client/assets/{Virtualizer-B7bxYYIG.js → Virtualizer-w3CQ99-n.js} +2 -2
- package/dist/client/assets/{canvasStateStore-Sg1O0hdB.js → canvasStateStore-C37HT3rg.js} +2 -2
- package/dist/client/assets/{cmmdAuthRedirect-DfXDzrOQ.js → cmmdAuthRedirect-lzr9SGGx.js} +2 -2
- package/dist/client/assets/{index-FcNN5Jgi.js → index-X8hVzGKO.js} +6 -6
- package/dist/client/assets/{popover-Di83hwea.js → popover-e5ijhFqh.js} +2 -2
- package/dist/client/assets/src-IM0FnQax.js +3 -0
- package/dist/client/assets/{toggle-Dop8-jYQ.js → toggle-glskd-s9.js} +2 -2
- package/dist/client/index.html +10 -10
- package/dist/forge-build.json +1 -1
- package/dist/{open-2-reBrpv.mjs → open-yHTUkd2Y.mjs} +3 -3
- package/package.json +1 -1
- package/dist/client/assets/src-rKJju-ZW.js +0 -3
package/dist/bin.mjs
CHANGED
|
@@ -23,7 +23,7 @@ import { createCipheriv, createDecipheriv, createHash, createHmac, createPublicK
|
|
|
23
23
|
import * as FS$1 from "node:fs";
|
|
24
24
|
import fs, { accessSync, chmodSync, constants, createReadStream, existsSync, mkdirSync, mkdtempSync, promises, readFile, readFileSync, readdir, readdirSync, realpathSync, rmSync, statSync, unlinkSync, writeFileSync } from "node:fs";
|
|
25
25
|
import * as NodeOS from "node:os";
|
|
26
|
-
import
|
|
26
|
+
import os, { homedir, networkInterfaces, tmpdir } from "node:os";
|
|
27
27
|
import * as Path$1 from "node:path";
|
|
28
28
|
import path, { basename, delimiter, dirname, extname, isAbsolute, join, posix, relative, resolve, sep } from "node:path";
|
|
29
29
|
import { pathToFileURL } from "node:url";
|
|
@@ -21163,7 +21163,8 @@ Literals([
|
|
|
21163
21163
|
"deprecation.notice",
|
|
21164
21164
|
"files.persisted",
|
|
21165
21165
|
"runtime.warning",
|
|
21166
|
-
"runtime.error"
|
|
21166
|
+
"runtime.error",
|
|
21167
|
+
"codeweb.workspace.required"
|
|
21167
21168
|
]);
|
|
21168
21169
|
const SessionStartedType = Literal("session.started");
|
|
21169
21170
|
const SessionConfiguredType = Literal("session.configured");
|
|
@@ -21209,6 +21210,7 @@ const McpOauthCompletedType = Literal("mcp.oauth.completed");
|
|
|
21209
21210
|
const ModelReroutedType = Literal("model.rerouted");
|
|
21210
21211
|
const ConfigWarningType = Literal("config.warning");
|
|
21211
21212
|
const DeprecationNoticeType = Literal("deprecation.notice");
|
|
21213
|
+
const CodewebWorkspaceRequiredType = Literal("codeweb.workspace.required");
|
|
21212
21214
|
const FilesPersistedType = Literal("files.persisted");
|
|
21213
21215
|
const RuntimeWarningType = Literal("runtime.warning");
|
|
21214
21216
|
const RuntimeErrorType = Literal("runtime.error");
|
|
@@ -21502,6 +21504,12 @@ const DeprecationNoticePayload = Struct({
|
|
|
21502
21504
|
summary: TrimmedNonEmptyStringSchema$2,
|
|
21503
21505
|
details: optional$4(TrimmedNonEmptyStringSchema$2)
|
|
21504
21506
|
});
|
|
21507
|
+
/**
|
|
21508
|
+
* CodeWeb's mint answered `workspace_required` (forge#3408): the person must
|
|
21509
|
+
* open the signed, single-use URL once to pick a Workspace. Forge surfaces
|
|
21510
|
+
* it instead of seating an unauthenticated CodeWeb server.
|
|
21511
|
+
*/
|
|
21512
|
+
const CodewebWorkspaceRequiredPayload = Struct({ chooseWorkspaceUrl: String$1 });
|
|
21505
21513
|
const FilesPersistedPayload = Struct({
|
|
21506
21514
|
files: ArraySchema(Struct({
|
|
21507
21515
|
filename: TrimmedNonEmptyStringSchema$2,
|
|
@@ -21742,6 +21750,11 @@ Union([
|
|
|
21742
21750
|
type: DeprecationNoticeType,
|
|
21743
21751
|
payload: DeprecationNoticePayload
|
|
21744
21752
|
}),
|
|
21753
|
+
Struct({
|
|
21754
|
+
...ProviderRuntimeEventBase.fields,
|
|
21755
|
+
type: CodewebWorkspaceRequiredType,
|
|
21756
|
+
payload: CodewebWorkspaceRequiredPayload
|
|
21757
|
+
}),
|
|
21745
21758
|
Struct({
|
|
21746
21759
|
...ProviderRuntimeEventBase.fields,
|
|
21747
21760
|
type: FilesPersistedType,
|
|
@@ -26722,12 +26735,12 @@ function encodeCmmdRuntimeThreadWorkspaceMetadata(workspace) {
|
|
|
26722
26735
|
}
|
|
26723
26736
|
//#endregion
|
|
26724
26737
|
//#region ../../packages/contracts/src/cmmdRuntimeToolActivity.ts
|
|
26725
|
-
function isRecord$
|
|
26738
|
+
function isRecord$24(value) {
|
|
26726
26739
|
return value !== null && typeof value === "object" && !Array.isArray(value);
|
|
26727
26740
|
}
|
|
26728
26741
|
function encodeCmmdRuntimeToolActivityPayload(kind, payload) {
|
|
26729
26742
|
return {
|
|
26730
|
-
...isRecord$
|
|
26743
|
+
...isRecord$24(payload) ? payload : { sourcePayload: payload },
|
|
26731
26744
|
forgeToolActivity: {
|
|
26732
26745
|
schemaVersion: 1,
|
|
26733
26746
|
source: "native",
|
|
@@ -26750,7 +26763,7 @@ const WORKTREE_LAUNCH_ACTIVITY_KINDS = new Set([
|
|
|
26750
26763
|
]);
|
|
26751
26764
|
function encodeCmmdRuntimeWorktreeLaunchActivityPayload(kind, payload) {
|
|
26752
26765
|
return {
|
|
26753
|
-
...isRecord$
|
|
26766
|
+
...isRecord$24(payload) ? payload : { sourcePayload: payload },
|
|
26754
26767
|
forgeWorktreeLaunchActivity: {
|
|
26755
26768
|
schemaVersion: 1,
|
|
26756
26769
|
source: "native",
|
|
@@ -26770,7 +26783,7 @@ function isCmmdRuntimeWorktreeLaunchActivityKind(kind) {
|
|
|
26770
26783
|
const CMMD_RUNTIME_PLAN_ACTIVITY_KIND = "turn.plan.updated";
|
|
26771
26784
|
function encodeCmmdRuntimePlanActivityPayload(kind, payload) {
|
|
26772
26785
|
return {
|
|
26773
|
-
...isRecord$
|
|
26786
|
+
...isRecord$24(payload) ? payload : { sourcePayload: payload },
|
|
26774
26787
|
forgePlanActivity: {
|
|
26775
26788
|
schemaVersion: 1,
|
|
26776
26789
|
source: "native",
|
|
@@ -26779,15 +26792,15 @@ function encodeCmmdRuntimePlanActivityPayload(kind, payload) {
|
|
|
26779
26792
|
};
|
|
26780
26793
|
}
|
|
26781
26794
|
function decodeCmmdRuntimePlanActivity(payload) {
|
|
26782
|
-
if (!isRecord$
|
|
26795
|
+
if (!isRecord$24(payload)) return null;
|
|
26783
26796
|
const metadata = payload["forgePlanActivity"];
|
|
26784
|
-
if (!isRecord$
|
|
26797
|
+
if (!isRecord$24(metadata)) return null;
|
|
26785
26798
|
if (metadata["schemaVersion"] !== 1 || metadata["source"] !== "native" || metadata["kind"] !== "turn.plan.updated") return null;
|
|
26786
26799
|
const rawPlan = payload["plan"];
|
|
26787
26800
|
return {
|
|
26788
26801
|
kind: CMMD_RUNTIME_PLAN_ACTIVITY_KIND,
|
|
26789
26802
|
plan: Array.isArray(rawPlan) ? rawPlan.flatMap((entry) => {
|
|
26790
|
-
if (!isRecord$
|
|
26803
|
+
if (!isRecord$24(entry)) return [];
|
|
26791
26804
|
const step = entry["step"];
|
|
26792
26805
|
const status = entry["status"];
|
|
26793
26806
|
if (typeof step !== "string" || step.trim().length === 0) return [];
|
|
@@ -30803,13 +30816,13 @@ async function completePendingDesktopRelayIdentityRotation(input) {
|
|
|
30803
30816
|
}
|
|
30804
30817
|
//#endregion
|
|
30805
30818
|
//#region ../../packages/relay-host/src/internal/desktopRelayJws.ts
|
|
30806
|
-
function isRecord$
|
|
30819
|
+
function isRecord$23(value) {
|
|
30807
30820
|
return typeof value === "object" && value !== null && !Array.isArray(value);
|
|
30808
30821
|
}
|
|
30809
30822
|
function decodeBase64UrlJson$1(value) {
|
|
30810
30823
|
try {
|
|
30811
30824
|
const decoded = JSON.parse(Buffer.from(value, "base64url").toString("utf8"));
|
|
30812
|
-
return isRecord$
|
|
30825
|
+
return isRecord$23(decoded) ? decoded : null;
|
|
30813
30826
|
} catch {
|
|
30814
30827
|
return null;
|
|
30815
30828
|
}
|
|
@@ -30963,11 +30976,11 @@ var DesktopRelayControlPlaneError = class extends Error {
|
|
|
30963
30976
|
this.name = "DesktopRelayControlPlaneError";
|
|
30964
30977
|
}
|
|
30965
30978
|
};
|
|
30966
|
-
function isRecord$
|
|
30979
|
+
function isRecord$22(value) {
|
|
30967
30980
|
return typeof value === "object" && value !== null && !Array.isArray(value);
|
|
30968
30981
|
}
|
|
30969
30982
|
function parseErrorPayload(value) {
|
|
30970
|
-
return isRecord$
|
|
30983
|
+
return isRecord$22(value) ? value : {};
|
|
30971
30984
|
}
|
|
30972
30985
|
function messageFromErrorPayload(payload, fallback) {
|
|
30973
30986
|
return typeof payload.error === "string" && payload.error.trim().length > 0 ? payload.error.trim() : fallback;
|
|
@@ -31065,7 +31078,7 @@ async function postControlPlane(input) {
|
|
|
31065
31078
|
const errorPayload = parseErrorPayload(payload);
|
|
31066
31079
|
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);
|
|
31067
31080
|
}
|
|
31068
|
-
if (!isRecord$
|
|
31081
|
+
if (!isRecord$22(payload) || !("data" in payload)) throw new DesktopRelayControlPlaneError("CONTROL_PLANE_INVALID_RESPONSE", "CMMD returned an invalid Forge relay response.", false);
|
|
31069
31082
|
return payload.data;
|
|
31070
31083
|
}
|
|
31071
31084
|
function resolveRegisteredDevice(input) {
|
|
@@ -50560,7 +50573,7 @@ function _supportsColor(haveStream, { streamIsTTY, sniffFlags = true } = {}) {
|
|
|
50560
50573
|
const min = forceColor || 0;
|
|
50561
50574
|
if (env.TERM === "dumb") return min;
|
|
50562
50575
|
if (process$1.platform === "win32") {
|
|
50563
|
-
const osRelease =
|
|
50576
|
+
const osRelease = os.release().split(".");
|
|
50564
50577
|
if (Number(osRelease[0]) >= 10 && Number(osRelease[2]) >= 10586) return Number(osRelease[2]) >= 14931 ? 3 : 2;
|
|
50565
50578
|
return 1;
|
|
50566
50579
|
}
|
|
@@ -53003,7 +53016,7 @@ var require_ProcessDetector = /* @__PURE__ */ __commonJSMin(((exports) => {
|
|
|
53003
53016
|
exports.processDetector = void 0;
|
|
53004
53017
|
const api_1 = (init_esm$1(), __toCommonJS(esm_exports$1));
|
|
53005
53018
|
const semconv_1 = require_semconv$1();
|
|
53006
|
-
const os$
|
|
53019
|
+
const os$4 = __require("os");
|
|
53007
53020
|
/**
|
|
53008
53021
|
* ProcessDetector will be used to detect the resources related current process running
|
|
53009
53022
|
* and being instrumented from the NodeJS Process module.
|
|
@@ -53025,7 +53038,7 @@ var require_ProcessDetector = /* @__PURE__ */ __commonJSMin(((exports) => {
|
|
|
53025
53038
|
};
|
|
53026
53039
|
if (process.argv.length > 1) attributes[semconv_1.ATTR_PROCESS_COMMAND] = process.argv[1];
|
|
53027
53040
|
try {
|
|
53028
|
-
const userInfo = os$
|
|
53041
|
+
const userInfo = os$4.userInfo();
|
|
53029
53042
|
attributes[semconv_1.ATTR_PROCESS_OWNER] = userInfo.username;
|
|
53030
53043
|
} catch (e) {
|
|
53031
53044
|
api_1.diag.debug(`error obtaining process owner: ${e}`);
|
|
@@ -65948,7 +65961,7 @@ function normalizeNumberish(value) {
|
|
|
65948
65961
|
}
|
|
65949
65962
|
//#endregion
|
|
65950
65963
|
//#region package.json
|
|
65951
|
-
var version$1 = "0.13.
|
|
65964
|
+
var version$1 = "0.13.48";
|
|
65952
65965
|
//#endregion
|
|
65953
65966
|
//#region src/sentry.ts
|
|
65954
65967
|
const SERVER_APP_NAME = "forge-server";
|
|
@@ -69417,6 +69430,7 @@ var ServerConfig = class ServerConfig extends Service$1()("forge/config/ServerCo
|
|
|
69417
69430
|
forgeCodexHomePath: void 0,
|
|
69418
69431
|
forgeClaudeConfigPath: void 0,
|
|
69419
69432
|
forgeApexBaseUrl: void 0,
|
|
69433
|
+
codewebServiceToken: void 0,
|
|
69420
69434
|
cloudProjectsRoot: DEFAULT_CLOUD_PROJECTS_ROOT,
|
|
69421
69435
|
...overrides
|
|
69422
69436
|
};
|
|
@@ -72620,12 +72634,12 @@ function resolveDesktopRelayControlPlaneTarget(path, configuredRuntimeId) {
|
|
|
72620
72634
|
code: "RELAY_OPERATION_DENIED"
|
|
72621
72635
|
};
|
|
72622
72636
|
}
|
|
72623
|
-
function isRecord$
|
|
72637
|
+
function isRecord$21(value) {
|
|
72624
72638
|
return typeof value === "object" && value !== null && !Array.isArray(value);
|
|
72625
72639
|
}
|
|
72626
72640
|
function relayControlPlaneBodyMatchesRuntime(path, body, configuredRuntimeId) {
|
|
72627
72641
|
if (path !== "/api/forge/context/devices/register") return true;
|
|
72628
|
-
if (!isRecord$
|
|
72642
|
+
if (!isRecord$21(body) || !isRecord$21(body.runtime)) return false;
|
|
72629
72643
|
return body.runtime.runtimeId === configuredRuntimeId;
|
|
72630
72644
|
}
|
|
72631
72645
|
/** Matches the client id `connect login` used, so CMMD accepts the refresh. */
|
|
@@ -72640,7 +72654,7 @@ function forbiddenResponse() {
|
|
|
72640
72654
|
return errorResponse(403, "RELAY_BRIDGE_FORBIDDEN", "Desktop relay bridge access denied.");
|
|
72641
72655
|
}
|
|
72642
72656
|
function relayProxyErrorResponse(error) {
|
|
72643
|
-
if (error instanceof CmmdProxyRequestError && isRecord$
|
|
72657
|
+
if (error instanceof CmmdProxyRequestError && isRecord$21(error.body)) {
|
|
72644
72658
|
const code = typeof error.body.code === "string" ? error.body.code : error.code;
|
|
72645
72659
|
const message = typeof error.body.error === "string" ? error.body.error : error.detail;
|
|
72646
72660
|
return errorResponse(error.status >= 500 ? 502 : error.status, code, message ?? "CMMD relay coordination failed.");
|
|
@@ -75830,7 +75844,7 @@ var require_node_gyp_build = /* @__PURE__ */ __commonJSMin(((exports, module) =>
|
|
|
75830
75844
|
var fs$6 = __require("fs");
|
|
75831
75845
|
var path$5 = __require("path");
|
|
75832
75846
|
var url$1 = __require("url");
|
|
75833
|
-
var os$
|
|
75847
|
+
var os$3 = __require("os");
|
|
75834
75848
|
var runtimeRequire = typeof __webpack_require__ === "function" ? __non_webpack_require__ : __require;
|
|
75835
75849
|
var vars = process.config && process.config.variables || {};
|
|
75836
75850
|
var prebuildsOnly = !!process.env.PREBUILDS_ONLY;
|
|
@@ -75838,8 +75852,8 @@ var require_node_gyp_build = /* @__PURE__ */ __commonJSMin(((exports, module) =>
|
|
|
75838
75852
|
var abi = versions.modules;
|
|
75839
75853
|
if (versions.deno || process.isBun) abi = "unsupported";
|
|
75840
75854
|
var runtime = isElectron() ? "electron" : isNwjs() ? "node-webkit" : "node";
|
|
75841
|
-
var arch = process.env.npm_config_arch || os$
|
|
75842
|
-
var platform = process.env.npm_config_platform || os$
|
|
75855
|
+
var arch = process.env.npm_config_arch || os$3.arch();
|
|
75856
|
+
var platform = process.env.npm_config_platform || os$3.platform();
|
|
75843
75857
|
var libc = process.env.LIBC || (isMusl(platform) ? "musl" : "glibc");
|
|
75844
75858
|
var armv = process.env.ARM_VERSION || (arch === "arm64" ? "8" : vars.arm_version) || "";
|
|
75845
75859
|
var uv = (versions.uv || "").split(".")[0];
|
|
@@ -77193,10 +77207,10 @@ var CheckpointDiffQuery = class extends Service$1()("forge/checkpointing/Service
|
|
|
77193
77207
|
* Forge server with neither configured has no attached desktop, which is a
|
|
77194
77208
|
* normal configuration for web and cloud — not an error.
|
|
77195
77209
|
*/
|
|
77196
|
-
const DEFAULT_TIMEOUT_MS$
|
|
77210
|
+
const DEFAULT_TIMEOUT_MS$6 = 15e3;
|
|
77197
77211
|
function createHostBridgeComputerManager(options) {
|
|
77198
77212
|
const fetchImpl = options.fetchImpl ?? fetch;
|
|
77199
|
-
const timeoutMs = options.timeoutMs ?? DEFAULT_TIMEOUT_MS$
|
|
77213
|
+
const timeoutMs = options.timeoutMs ?? DEFAULT_TIMEOUT_MS$6;
|
|
77200
77214
|
return { execute: async ({ command }) => {
|
|
77201
77215
|
const response = await fetchImpl(`${options.url}/agent-computer/host-bridge`, {
|
|
77202
77216
|
method: "POST",
|
|
@@ -77347,7 +77361,7 @@ async function recordDisplayToWebm(input) {
|
|
|
77347
77361
|
* permission.
|
|
77348
77362
|
*/
|
|
77349
77363
|
const DEFAULT_DISPLAY = ":99";
|
|
77350
|
-
const DEFAULT_TIMEOUT_MS$
|
|
77364
|
+
const DEFAULT_TIMEOUT_MS$5 = 15e3;
|
|
77351
77365
|
/** Screenshots are megabytes of PNG on stdout; the 1 MB execFile default truncates them. */
|
|
77352
77366
|
const SCREENSHOT_MAX_BUFFER_BYTES = 64 * 1024 * 1024;
|
|
77353
77367
|
const TYPE_DELAY_MS = 12;
|
|
@@ -77648,7 +77662,7 @@ async function executeDisplaySurfaceCommand(command, deps) {
|
|
|
77648
77662
|
}
|
|
77649
77663
|
function createX11ComputerManager(options = {}) {
|
|
77650
77664
|
const display = options.display ?? DEFAULT_DISPLAY;
|
|
77651
|
-
const timeoutMs = options.timeoutMs ?? DEFAULT_TIMEOUT_MS$
|
|
77665
|
+
const timeoutMs = options.timeoutMs ?? DEFAULT_TIMEOUT_MS$5;
|
|
77652
77666
|
const runner = options.runner ?? defaultRunner(display, timeoutMs);
|
|
77653
77667
|
const launcher = options.launcher ?? defaultLauncher();
|
|
77654
77668
|
const launch = async (file, args) => {
|
|
@@ -93527,7 +93541,7 @@ const launchDetached = (launch) => gen(function* () {
|
|
|
93527
93541
|
});
|
|
93528
93542
|
const OpenLive = effect(Open, gen(function* () {
|
|
93529
93543
|
const open = yield* tryPromise({
|
|
93530
|
-
try: () => import("./open-
|
|
93544
|
+
try: () => import("./open-yHTUkd2Y.mjs"),
|
|
93531
93545
|
catch: (cause) => new OpenError$1({
|
|
93532
93546
|
message: "failed to load browser opener",
|
|
93533
93547
|
cause
|
|
@@ -95098,7 +95112,7 @@ const REPLICA_THREAD_STATUSES = [
|
|
|
95098
95112
|
];
|
|
95099
95113
|
//#endregion
|
|
95100
95114
|
//#region src/runtimeReplication/replicaDecodeModel.ts
|
|
95101
|
-
function isRecord$
|
|
95115
|
+
function isRecord$20(value) {
|
|
95102
95116
|
return typeof value === "object" && value !== null && !Array.isArray(value);
|
|
95103
95117
|
}
|
|
95104
95118
|
function isNonBlankString(value) {
|
|
@@ -95118,7 +95132,7 @@ function nullableInteger(value) {
|
|
|
95118
95132
|
return value === null || typeof value === "number" && Number.isSafeInteger(value);
|
|
95119
95133
|
}
|
|
95120
95134
|
function unwrapEnvelope(payload, expectedDomain) {
|
|
95121
|
-
if (!isRecord$
|
|
95135
|
+
if (!isRecord$20(payload) || !isRecord$20(payload.meta) || !isRecord$20(payload.data)) return null;
|
|
95122
95136
|
const { domain, timestamp, version } = payload.meta;
|
|
95123
95137
|
if (!isNonBlankString(domain) || expectedDomain !== void 0 && domain !== expectedDomain || version !== "1.0" || !isIsoDateTime(timestamp)) return null;
|
|
95124
95138
|
return payload.data;
|
|
@@ -95131,12 +95145,12 @@ function hasValidRuntimeIdentity(value) {
|
|
|
95131
95145
|
].includes(String(value.runtimeKind)) && typeof value.displayName === "string" && typeof value.status === "string";
|
|
95132
95146
|
}
|
|
95133
95147
|
function decodeRuntime$1(value) {
|
|
95134
|
-
if (!isRecord$
|
|
95135
|
-
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$
|
|
95148
|
+
if (!isRecord$20(value) || !hasValidRuntimeIdentity(value)) return null;
|
|
95149
|
+
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$20(value.metadata))) return null;
|
|
95136
95150
|
return value;
|
|
95137
95151
|
}
|
|
95138
95152
|
function decodeProject(value) {
|
|
95139
|
-
if (!isRecord$
|
|
95153
|
+
if (!isRecord$20(value) || !isNonBlankString(value.projectId) || typeof value.title !== "string" || !nullableString(value.githubRepoFullName) || !nullableString(value.branch)) return null;
|
|
95140
95154
|
return {
|
|
95141
95155
|
projectId: value.projectId,
|
|
95142
95156
|
title: value.title,
|
|
@@ -95145,11 +95159,11 @@ function decodeProject(value) {
|
|
|
95145
95159
|
};
|
|
95146
95160
|
}
|
|
95147
95161
|
function decodeThread$1(value) {
|
|
95148
|
-
if (!isRecord$
|
|
95162
|
+
if (!isRecord$20(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$20(value.metadata))) return null;
|
|
95149
95163
|
return value;
|
|
95150
95164
|
}
|
|
95151
95165
|
function decodeSummary(value) {
|
|
95152
|
-
if (!isRecord$
|
|
95166
|
+
if (!isRecord$20(value) || !nullableString(value.conversationId)) return null;
|
|
95153
95167
|
const project = decodeProject(value.project);
|
|
95154
95168
|
const thread = decodeThread$1(value.thread);
|
|
95155
95169
|
return project === null || thread === null ? null : {
|
|
@@ -95260,7 +95274,7 @@ function isNonNegativeInt(value) {
|
|
|
95260
95274
|
/** `usage` is null for an Unreported turn, otherwise exactly the five buckets. */
|
|
95261
95275
|
function isValidTurnUsageTokens(value) {
|
|
95262
95276
|
if (value === null) return true;
|
|
95263
|
-
if (!isRecord$
|
|
95277
|
+
if (!isRecord$20(value)) return false;
|
|
95264
95278
|
return turnUsageTokenKeys.every((key) => isNonNegativeInt(value[key])) && Object.keys(value).every((key) => turnUsageTokenKeys.includes(key));
|
|
95265
95279
|
}
|
|
95266
95280
|
/** The row itself: no text, no status, and the turn it belongs to. */
|
|
@@ -95269,7 +95283,7 @@ function hasValidTurnUsageEnvelope(value) {
|
|
|
95269
95283
|
}
|
|
95270
95284
|
/** What the row records: who ran it, what it spent, and what it says of itself. */
|
|
95271
95285
|
function hasValidTurnUsageRecord(payload) {
|
|
95272
|
-
return isRecord$
|
|
95286
|
+
return isRecord$20(payload) && isNonBlankString(payload.provider) && isNonBlankString(payload.model) && "usage" in payload && isValidTurnUsageTokens(payload.usage) && hasValidTurnUsageAttribution(payload);
|
|
95273
95287
|
}
|
|
95274
95288
|
/** A turn_usage row: no text, no status, and its record in `payload`. */
|
|
95275
95289
|
function hasValidTurnUsagePayload(value) {
|
|
@@ -95306,7 +95320,7 @@ function hasValidEventPayload(value) {
|
|
|
95306
95320
|
return isNonBlankString(value.text) && value.status === null;
|
|
95307
95321
|
}
|
|
95308
95322
|
function decodeEvent$1(value) {
|
|
95309
|
-
if (!isRecord$
|
|
95323
|
+
if (!isRecord$20(value) || !hasValidEventFields(value) || !hasValidEventPayload(value)) return null;
|
|
95310
95324
|
return value;
|
|
95311
95325
|
}
|
|
95312
95326
|
function decodeEvents(data) {
|
|
@@ -95327,11 +95341,11 @@ function decodeReplicaThreadDetail(payload) {
|
|
|
95327
95341
|
const thread = decodeThread$1(data.thread);
|
|
95328
95342
|
const reachability = decodeReachability(data.reachability);
|
|
95329
95343
|
const events = decodeEvents(data);
|
|
95330
|
-
if (runtime === null || project === null || thread === null || reachability === null || events === null || !isRecord$
|
|
95344
|
+
if (runtime === null || project === null || thread === null || reachability === null || events === null || !isRecord$20(data.execution) || typeof data.execution.available !== "boolean" || ![
|
|
95331
95345
|
null,
|
|
95332
95346
|
"runtime_offline",
|
|
95333
95347
|
"runtime_unavailable"
|
|
95334
|
-
].includes(data.execution.reason) || (data.execution.available ? data.execution.reason !== null : data.execution.reason === null) || !isRecord$
|
|
95348
|
+
].includes(data.execution.reason) || (data.execution.available ? data.execution.reason !== null : data.execution.reason === null) || !isRecord$20(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;
|
|
95335
95349
|
return {
|
|
95336
95350
|
conversationId: data.conversationId,
|
|
95337
95351
|
runtime,
|
|
@@ -96406,7 +96420,7 @@ function resolveRuntimeReplicationRuntimeId(config) {
|
|
|
96406
96420
|
}
|
|
96407
96421
|
//#endregion
|
|
96408
96422
|
//#region src/usage/providerTokenBuckets.ts
|
|
96409
|
-
function isRecord$
|
|
96423
|
+
function isRecord$19(value) {
|
|
96410
96424
|
return typeof value === "object" && value !== null && !Array.isArray(value);
|
|
96411
96425
|
}
|
|
96412
96426
|
function count(record, ...keys) {
|
|
@@ -96427,7 +96441,7 @@ function reportedOrNull(tokens) {
|
|
|
96427
96441
|
* the app server sends camelCase.
|
|
96428
96442
|
*/
|
|
96429
96443
|
function codexTokenBuckets(value) {
|
|
96430
|
-
if (!isRecord$
|
|
96444
|
+
if (!isRecord$19(value)) return null;
|
|
96431
96445
|
const inputTokens = count(value, "input_tokens", "inputTokens");
|
|
96432
96446
|
const cachedInputTokens = count(value, "cached_input_tokens", "cachedInputTokens");
|
|
96433
96447
|
const cacheCreationTokens = count(value, "cache_write_input_tokens", "cacheWriteInputTokens");
|
|
@@ -96446,7 +96460,7 @@ function codexTokenBuckets(value) {
|
|
|
96446
96460
|
* tokens into output and does not break them out, so reasoning stays zero.
|
|
96447
96461
|
*/
|
|
96448
96462
|
function claudeTokenBuckets(value) {
|
|
96449
|
-
if (!isRecord$
|
|
96463
|
+
if (!isRecord$19(value)) return null;
|
|
96450
96464
|
return reportedOrNull({
|
|
96451
96465
|
uncachedInputTokens: count(value, "input_tokens", "inputTokens"),
|
|
96452
96466
|
cachedInputTokens: count(value, "cache_read_input_tokens", "cacheReadInputTokens"),
|
|
@@ -97388,7 +97402,7 @@ const replicaTurnStatuses = new Set([
|
|
|
97388
97402
|
"cancelled",
|
|
97389
97403
|
"interrupted"
|
|
97390
97404
|
]);
|
|
97391
|
-
function isRecord$
|
|
97405
|
+
function isRecord$18(value) {
|
|
97392
97406
|
return typeof value === "object" && value !== null && !Array.isArray(value);
|
|
97393
97407
|
}
|
|
97394
97408
|
function replicaSourceSequence(value) {
|
|
@@ -97401,7 +97415,7 @@ function replicaSourceTurn(sourceTurnId) {
|
|
|
97401
97415
|
return typeof sourceTurnId === "string" && sourceTurnId.length > 0 ? { turnId: sourceTurnId } : {};
|
|
97402
97416
|
}
|
|
97403
97417
|
function replicaActivitySource(activity) {
|
|
97404
|
-
if (!activity.kind.startsWith("replica.") || !isRecord$
|
|
97418
|
+
if (!activity.kind.startsWith("replica.") || !isRecord$18(activity.payload)) return null;
|
|
97405
97419
|
const sourceSequence = replicaSourceSequence(activity.sequence);
|
|
97406
97420
|
const eventId = replicaSourceEventId(activity.payload.sourceEventId);
|
|
97407
97421
|
if (sourceSequence === null || eventId === null) return null;
|
|
@@ -97414,7 +97428,7 @@ function replicaActivitySource(activity) {
|
|
|
97414
97428
|
}
|
|
97415
97429
|
function replicaSummaryEvent(activity, source) {
|
|
97416
97430
|
if (activity.kind !== "replica.activity_summary" && activity.kind !== "replica.error_summary") return null;
|
|
97417
|
-
const sourceText = isRecord$
|
|
97431
|
+
const sourceText = isRecord$18(activity.payload) ? activity.payload.text : null;
|
|
97418
97432
|
return {
|
|
97419
97433
|
sourceSequence: source.sourceSequence,
|
|
97420
97434
|
event: {
|
|
@@ -97427,7 +97441,7 @@ function replicaSummaryEvent(activity, source) {
|
|
|
97427
97441
|
};
|
|
97428
97442
|
}
|
|
97429
97443
|
function replicaTurnEvent(activity, source) {
|
|
97430
|
-
const status = isRecord$
|
|
97444
|
+
const status = isRecord$18(activity.payload) ? activity.payload.status : null;
|
|
97431
97445
|
if (activity.kind !== "replica.turn_status" || !replicaTurnStatuses.has(status)) return null;
|
|
97432
97446
|
return {
|
|
97433
97447
|
sourceSequence: source.sourceSequence,
|
|
@@ -97441,7 +97455,7 @@ function replicaTurnEvent(activity, source) {
|
|
|
97441
97455
|
};
|
|
97442
97456
|
}
|
|
97443
97457
|
function replicaToolCallEvent(activity, source) {
|
|
97444
|
-
if (activity.kind !== "replica.tool_call" || !isRecord$
|
|
97458
|
+
if (activity.kind !== "replica.tool_call" || !isRecord$18(activity.payload)) return null;
|
|
97445
97459
|
const sourceText = activity.payload.text;
|
|
97446
97460
|
const status = activity.payload.status;
|
|
97447
97461
|
if (typeof sourceText !== "string" || typeof status !== "string") return null;
|
|
@@ -97459,9 +97473,9 @@ function replicaToolCallEvent(activity, source) {
|
|
|
97459
97473
|
};
|
|
97460
97474
|
}
|
|
97461
97475
|
function replicaTurnUsageEvent(activity, source) {
|
|
97462
|
-
if (activity.kind !== "replica.turn_usage" || !isRecord$
|
|
97476
|
+
if (activity.kind !== "replica.turn_usage" || !isRecord$18(activity.payload)) return null;
|
|
97463
97477
|
const usage = activity.payload.payload;
|
|
97464
|
-
if (!("turnId" in source.turn) || !isRecord$
|
|
97478
|
+
if (!("turnId" in source.turn) || !isRecord$18(usage)) return null;
|
|
97465
97479
|
const provider = usage.provider;
|
|
97466
97480
|
const model = usage.model;
|
|
97467
97481
|
if (typeof provider !== "string" || typeof model !== "string" || !("usage" in usage)) return null;
|
|
@@ -98329,9 +98343,9 @@ function isUsageSessionLookupRuntimeNotFound(error) {
|
|
|
98329
98343
|
async function isRuntimeNotFoundResponse(response) {
|
|
98330
98344
|
if (response.status !== 404) return false;
|
|
98331
98345
|
const body = await response.json().catch(() => null);
|
|
98332
|
-
return isRecord$
|
|
98346
|
+
return isRecord$17(body) && body["code"] === "RUNTIME_NOT_FOUND";
|
|
98333
98347
|
}
|
|
98334
|
-
function isRecord$
|
|
98348
|
+
function isRecord$17(value) {
|
|
98335
98349
|
return typeof value === "object" && value !== null;
|
|
98336
98350
|
}
|
|
98337
98351
|
/**
|
|
@@ -98343,11 +98357,11 @@ function isRecord$16(value) {
|
|
|
98343
98357
|
* no count on the page saying so.
|
|
98344
98358
|
*/
|
|
98345
98359
|
function decodeHeldSessions(body) {
|
|
98346
|
-
const held = isRecord$
|
|
98360
|
+
const held = isRecord$17(body) && isRecord$17(body["data"]) ? body["data"]["held"] : void 0;
|
|
98347
98361
|
if (!Array.isArray(held)) throw new Error("The usage session lookup returned an invalid body.");
|
|
98348
98362
|
return held.map((row) => {
|
|
98349
|
-
const providerSessionId = isRecord$
|
|
98350
|
-
const runtimeId = isRecord$
|
|
98363
|
+
const providerSessionId = isRecord$17(row) ? row["providerSessionId"] : void 0;
|
|
98364
|
+
const runtimeId = isRecord$17(row) ? row["runtimeId"] : void 0;
|
|
98351
98365
|
if (typeof providerSessionId !== "string" || typeof runtimeId !== "string") throw new Error("The usage session lookup returned an invalid held row.");
|
|
98352
98366
|
return {
|
|
98353
98367
|
providerSessionId,
|
|
@@ -101157,7 +101171,7 @@ function emptyConfig(source, path) {
|
|
|
101157
101171
|
issues: []
|
|
101158
101172
|
};
|
|
101159
101173
|
}
|
|
101160
|
-
function isRecord$
|
|
101174
|
+
function isRecord$16(value) {
|
|
101161
101175
|
return typeof value === "object" && value !== null && !Array.isArray(value);
|
|
101162
101176
|
}
|
|
101163
101177
|
function stringArray(value) {
|
|
@@ -101185,7 +101199,7 @@ function terminalsFromValue(value) {
|
|
|
101185
101199
|
name: `Terminal ${index + 1}`,
|
|
101186
101200
|
command: terminal.trim()
|
|
101187
101201
|
}];
|
|
101188
|
-
if (!isRecord$
|
|
101202
|
+
if (!isRecord$16(terminal)) return [];
|
|
101189
101203
|
const command = typeof terminal.command === "string" ? terminal.command.trim() : "";
|
|
101190
101204
|
if (!command) return [];
|
|
101191
101205
|
return [{
|
|
@@ -101224,7 +101238,7 @@ function readConfigFile(source, path) {
|
|
|
101224
101238
|
}]
|
|
101225
101239
|
};
|
|
101226
101240
|
}
|
|
101227
|
-
if (!isRecord$
|
|
101241
|
+
if (!isRecord$16(parsed)) return {
|
|
101228
101242
|
...emptyConfig(source, path),
|
|
101229
101243
|
issues: [{
|
|
101230
101244
|
severity: "blocked",
|
|
@@ -102394,7 +102408,7 @@ const CLAUDE_IDENTITY_KEYS = new Set([
|
|
|
102394
102408
|
"credentialGenerationId"
|
|
102395
102409
|
]);
|
|
102396
102410
|
const CLAUDE_IDENTITY_OPTIONAL_KEYS = new Set(["providerAccountIdentity"]);
|
|
102397
|
-
function isRecord$
|
|
102411
|
+
function isRecord$15(value) {
|
|
102398
102412
|
return typeof value === "object" && value !== null && !Array.isArray(value);
|
|
102399
102413
|
}
|
|
102400
102414
|
function isStrictRfc3339DateTime(value) {
|
|
@@ -102423,7 +102437,7 @@ function hasAllowedKeys(value, required, optional) {
|
|
|
102423
102437
|
return keys.every((key) => required.has(key) || optional.has(key)) && [...required].every((key) => keys.includes(key));
|
|
102424
102438
|
}
|
|
102425
102439
|
function parseDeliveryIdentity(value, provider) {
|
|
102426
|
-
if (!isRecord$
|
|
102440
|
+
if (!isRecord$15(value)) return null;
|
|
102427
102441
|
if (provider === "openai") return parseCodexDeliveryIdentity(value);
|
|
102428
102442
|
if (provider === "anthropic") return parseClaudeDeliveryIdentity(value);
|
|
102429
102443
|
return null;
|
|
@@ -102458,7 +102472,7 @@ function parseClaudeDeliveryIdentity(value) {
|
|
|
102458
102472
|
};
|
|
102459
102473
|
}
|
|
102460
102474
|
function parseProviderRuntimeDeliveryReceipt(value, expected) {
|
|
102461
|
-
if (!isRecord$
|
|
102475
|
+
if (!isRecord$15(value) || !hasExactKeys$2(value, RECEIPT_KEYS)) return null;
|
|
102462
102476
|
const identity = parseDeliveryIdentity(value.identity, expected.provider);
|
|
102463
102477
|
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;
|
|
102464
102478
|
return {
|
|
@@ -102480,8 +102494,8 @@ function providerDeliveryBindingFromReceipt(receipt) {
|
|
|
102480
102494
|
};
|
|
102481
102495
|
}
|
|
102482
102496
|
function readProviderDeliveryBinding(value) {
|
|
102483
|
-
if (!isRecord$
|
|
102484
|
-
const identityProvider = isRecord$
|
|
102497
|
+
if (!isRecord$15(value) || !hasExactKeys$2(value, BINDING_KEYS)) return null;
|
|
102498
|
+
const identityProvider = isRecord$15(value.identity) ? value.identity.provider : void 0;
|
|
102485
102499
|
const tokenProvider = identityProvider === "codex" ? "openai" : identityProvider === "claude" ? "anthropic" : null;
|
|
102486
102500
|
if (!tokenProvider) return null;
|
|
102487
102501
|
const identity = parseDeliveryIdentity(value.identity, tokenProvider);
|
|
@@ -149815,12 +149829,12 @@ function decodeProviderKind(providerName, operation) {
|
|
|
149815
149829
|
detail: `Unknown persisted provider '${providerName}'.`
|
|
149816
149830
|
}));
|
|
149817
149831
|
}
|
|
149818
|
-
function isRecord$
|
|
149832
|
+
function isRecord$14(value) {
|
|
149819
149833
|
return value !== null && typeof value === "object" && !Array.isArray(value);
|
|
149820
149834
|
}
|
|
149821
149835
|
function mergeRuntimePayload(existing, next) {
|
|
149822
149836
|
if (next === void 0) return existing ?? null;
|
|
149823
|
-
if (isRecord$
|
|
149837
|
+
if (isRecord$14(existing) && isRecord$14(next)) return {
|
|
149824
149838
|
...existing,
|
|
149825
149839
|
...next
|
|
149826
149840
|
};
|
|
@@ -151784,7 +151798,7 @@ const PAGINATION_KEYS = new Set([
|
|
|
151784
151798
|
"total",
|
|
151785
151799
|
"hasMore"
|
|
151786
151800
|
]);
|
|
151787
|
-
function isRecord$
|
|
151801
|
+
function isRecord$13(value) {
|
|
151788
151802
|
return typeof value === "object" && value !== null && !Array.isArray(value);
|
|
151789
151803
|
}
|
|
151790
151804
|
function hasOnlyKeys(value, allowed) {
|
|
@@ -151797,17 +151811,17 @@ function isRfc3339(value) {
|
|
|
151797
151811
|
return typeof value === "string" && RFC3339.test(value) && Number.isFinite(Date.parse(value));
|
|
151798
151812
|
}
|
|
151799
151813
|
function isEnvelopeMeta(value) {
|
|
151800
|
-
if (!isRecord$
|
|
151814
|
+
if (!isRecord$13(value) || !hasExactKeys$1(value, META_KEYS)) return false;
|
|
151801
151815
|
return typeof value.domain === "string" && value.domain.length > 0 && isRfc3339(value.timestamp) && typeof value.version === "string" && value.version.length > 0;
|
|
151802
151816
|
}
|
|
151803
151817
|
function isPagination(value) {
|
|
151804
|
-
if (!isRecord$
|
|
151818
|
+
if (!isRecord$13(value) || !hasExactKeys$1(value, PAGINATION_KEYS)) return false;
|
|
151805
151819
|
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";
|
|
151806
151820
|
}
|
|
151807
151821
|
function readLocalProviderAccountId(authJson) {
|
|
151808
151822
|
try {
|
|
151809
151823
|
const value = JSON.parse(authJson);
|
|
151810
|
-
if (!isRecord$
|
|
151824
|
+
if (!isRecord$13(value) || value.auth_mode !== "chatgpt" || !isRecord$13(value.tokens)) return null;
|
|
151811
151825
|
const providerAccountId = value.tokens.account_id;
|
|
151812
151826
|
if (typeof providerAccountId !== "string") return null;
|
|
151813
151827
|
const normalized = providerAccountId.trim();
|
|
@@ -151820,13 +151834,13 @@ function resolveLocalAuthJsonPath(homePath) {
|
|
|
151820
151834
|
return join(homePath?.trim() || process.env.CODEX_HOME?.trim() || join(homedir(), ".codex"), "auth.json");
|
|
151821
151835
|
}
|
|
151822
151836
|
function parseCodexAccountIdentityEnvelope(value) {
|
|
151823
|
-
if (!isRecord$
|
|
151837
|
+
if (!isRecord$13(value) || !hasOnlyKeys(value, ENVELOPE_KEYS)) return null;
|
|
151824
151838
|
if (!("data" in value) || !("meta" in value) || !isEnvelopeMeta(value.meta)) return null;
|
|
151825
151839
|
if (value.pagination !== void 0 && !isPagination(value.pagination)) return null;
|
|
151826
151840
|
return readCodexAccountIdentity(value.data);
|
|
151827
151841
|
}
|
|
151828
151842
|
function readCodexAccountIdentity(value) {
|
|
151829
|
-
if (!isRecord$
|
|
151843
|
+
if (!isRecord$13(value) || !hasExactKeys$1(value, IDENTITY_KEYS)) return null;
|
|
151830
151844
|
if (value.kind !== "provider_account" || value.provider !== "codex" || typeof value.providerAccountIdentity !== "string" || !PROVIDER_ACCOUNT_IDENTITY$1.test(value.providerAccountIdentity)) return null;
|
|
151831
151845
|
return {
|
|
151832
151846
|
kind: "provider_account",
|
|
@@ -191045,7 +191059,7 @@ var Vce = {
|
|
|
191045
191059
|
function Ve() {
|
|
191046
191060
|
return Vce;
|
|
191047
191061
|
}
|
|
191048
|
-
var Us =
|
|
191062
|
+
var Us = os.homedir(), lk = os.tmpdir(), { env: Vc } = process$1, Yce = (e) => {
|
|
191049
191063
|
let t = path.join(Us, "Library");
|
|
191050
191064
|
return {
|
|
191051
191065
|
data: path.join(t, "Application Support", e),
|
|
@@ -201245,12 +201259,12 @@ function qZ(e, t) {
|
|
|
201245
201259
|
}
|
|
201246
201260
|
return n;
|
|
201247
201261
|
}
|
|
201248
|
-
var os$
|
|
201262
|
+
var os$2 = "https://code.claude.com/docs/en", kKe = [
|
|
201249
201263
|
{
|
|
201250
201264
|
matches: (e) => e.path === "permissions.defaultMode" && e.code === "invalid_value",
|
|
201251
201265
|
tip: {
|
|
201252
201266
|
suggestion: "Valid modes: \"acceptEdits\" (ask before file changes), \"plan\" (analysis only), \"bypassPermissions\" (auto-accept all), or \"default\" (standard behavior)",
|
|
201253
|
-
docLink: `${os$
|
|
201267
|
+
docLink: `${os$2}/iam#permission-modes`
|
|
201254
201268
|
}
|
|
201255
201269
|
},
|
|
201256
201270
|
{
|
|
@@ -201265,7 +201279,7 @@ var os$1 = "https://code.claude.com/docs/en", kKe = [
|
|
|
201265
201279
|
matches: (e) => e.path.startsWith("env.") && e.code === "invalid_type",
|
|
201266
201280
|
tip: {
|
|
201267
201281
|
suggestion: "Environment variables must be strings. Wrap numbers and booleans in quotes. Example: \"DEBUG\": \"true\", \"PORT\": \"3000\"",
|
|
201268
|
-
docLink: `${os$
|
|
201282
|
+
docLink: `${os$2}/settings#environment-variables`
|
|
201269
201283
|
}
|
|
201270
201284
|
},
|
|
201271
201285
|
{
|
|
@@ -201276,14 +201290,14 @@ var os$1 = "https://code.claude.com/docs/en", kKe = [
|
|
|
201276
201290
|
matches: (e) => e.path.startsWith("hooks.") && e.code === "invalid_key",
|
|
201277
201291
|
tip: {
|
|
201278
201292
|
suggestion: "Not a recognized hook event. Common events: PreToolUse, PostToolUse, UserPromptSubmit, SessionStart, SessionEnd, Stop. Check spelling and capitalization.",
|
|
201279
|
-
docLink: `${os$
|
|
201293
|
+
docLink: `${os$2}/hooks`
|
|
201280
201294
|
}
|
|
201281
201295
|
},
|
|
201282
201296
|
{
|
|
201283
201297
|
matches: (e) => /\.hooks\.\d+\.command$/.test(e.path) && e.code === "invalid_type" && e.received === "undefined",
|
|
201284
201298
|
tip: {
|
|
201285
201299
|
suggestion: "Command hooks require `command`. For exec form (no shell), set `command` to the executable and `args` to its arguments: {\"type\": \"command\", \"command\": \"echo\", \"args\": [\"hi\"]}. For shell form, set `command` to the full shell string: {\"type\": \"command\", \"command\": \"echo hi\"}.",
|
|
201286
|
-
docLink: `${os$
|
|
201300
|
+
docLink: `${os$2}/hooks#exec-form-and-shell-form`
|
|
201287
201301
|
}
|
|
201288
201302
|
},
|
|
201289
201303
|
{
|
|
@@ -201298,7 +201312,7 @@ var os$1 = "https://code.claude.com/docs/en", kKe = [
|
|
|
201298
201312
|
matches: (e) => e.code === "unrecognized_keys",
|
|
201299
201313
|
tip: {
|
|
201300
201314
|
suggestion: "Check for typos or refer to the documentation for valid fields",
|
|
201301
|
-
docLink: `${os$
|
|
201315
|
+
docLink: `${os$2}/settings`
|
|
201302
201316
|
}
|
|
201303
201317
|
},
|
|
201304
201318
|
{
|
|
@@ -201313,13 +201327,13 @@ var os$1 = "https://code.claude.com/docs/en", kKe = [
|
|
|
201313
201327
|
matches: (e) => e.path === "permissions.additionalDirectories" && e.code === "invalid_type",
|
|
201314
201328
|
tip: {
|
|
201315
201329
|
suggestion: "Must be an array of directory paths. Example: [\"~/projects\", \"/tmp/workspace\"]. You can also use --add-dir flag or /add-dir command",
|
|
201316
|
-
docLink: `${os$
|
|
201330
|
+
docLink: `${os$2}/iam#working-directories`
|
|
201317
201331
|
}
|
|
201318
201332
|
}
|
|
201319
201333
|
], AKe = {
|
|
201320
|
-
permissions: `${os$
|
|
201321
|
-
env: `${os$
|
|
201322
|
-
hooks: `${os$
|
|
201334
|
+
permissions: `${os$2}/iam#configuring-permissions`,
|
|
201335
|
+
env: `${os$2}/settings#environment-variables`,
|
|
201336
|
+
hooks: `${os$2}/hooks`
|
|
201323
201337
|
};
|
|
201324
201338
|
function GZ(e) {
|
|
201325
201339
|
let t = kKe.find((r) => r.matches(e));
|
|
@@ -211104,7 +211118,7 @@ function isShellSafeCommandPath(command) {
|
|
|
211104
211118
|
}
|
|
211105
211119
|
//#endregion
|
|
211106
211120
|
//#region src/provider/providerSnapshot.ts
|
|
211107
|
-
const DEFAULT_TIMEOUT_MS$
|
|
211121
|
+
const DEFAULT_TIMEOUT_MS$4 = 4e3;
|
|
211108
211122
|
function resolveForgeBrowserSkillPath(cwd = process.cwd()) {
|
|
211109
211123
|
const candidates = [
|
|
211110
211124
|
Path$1.resolve(cwd, ".agents/skills/browser/SKILL.md"),
|
|
@@ -213598,8 +213612,8 @@ function cliSelectsOsStore(input) {
|
|
|
213598
213612
|
if (input.env[CLAUDE_FORCE_OS_CREDENTIAL_STORE_ENV] === "1") return true;
|
|
213599
213613
|
const config = readConfig(input);
|
|
213600
213614
|
if (config === null) return false;
|
|
213601
|
-
const features = isRecord$
|
|
213602
|
-
const flag = isRecord$
|
|
213615
|
+
const features = isRecord$12(config.parsed) ? config.parsed[CACHED_FEATURES_KEY] : void 0;
|
|
213616
|
+
const flag = isRecord$12(features) ? features[OS_STORE_FLAG_KEY] : void 0;
|
|
213603
213617
|
return typeof flag === "boolean" ? flag : null;
|
|
213604
213618
|
}
|
|
213605
213619
|
/**
|
|
@@ -213627,7 +213641,7 @@ function hasSessionBus(input) {
|
|
|
213627
213641
|
const runtimeDirectory = input.env.XDG_RUNTIME_DIR?.trim();
|
|
213628
213642
|
return runtimeDirectory ? input.fileExists(join(runtimeDirectory, "bus")) : false;
|
|
213629
213643
|
}
|
|
213630
|
-
function isRecord$
|
|
213644
|
+
function isRecord$12(value) {
|
|
213631
213645
|
return typeof value === "object" && value !== null && !Array.isArray(value);
|
|
213632
213646
|
}
|
|
213633
213647
|
//#endregion
|
|
@@ -214298,7 +214312,7 @@ const checkClaudeProviderStatus = fn$1("checkClaudeProviderStatus")(function* (r
|
|
|
214298
214312
|
const capabilitiesProbeInput = claudeCapabilitiesProbeInput(claudeSettings.binaryPath, effectiveConfigPath);
|
|
214299
214313
|
const discovery = yield* resolveClaudeDiscovery(capabilitiesProbeInput, resolveSlashCommands, resolveModels);
|
|
214300
214314
|
const models = modelsForClaudeCliVersion(providerModelsFromSettings(resolveClaudeProviderModels(discovery.models), PROVIDER$12, claudeSettings.customModels, DEFAULT_CLAUDE_MODEL_CAPABILITIES, endpointProfileDisplayNames(claudeSettings)), parsedVersion);
|
|
214301
|
-
const authProbe = yield* runClaudeCommand(["auth", "status"]).pipe(timeoutOption(DEFAULT_TIMEOUT_MS$
|
|
214315
|
+
const authProbe = yield* runClaudeCommand(["auth", "status"]).pipe(timeoutOption(DEFAULT_TIMEOUT_MS$4), result);
|
|
214302
214316
|
return yield* withClaudeCredentialAnswers(buildClaudeProviderFromAuthProbe({
|
|
214303
214317
|
authProbe,
|
|
214304
214318
|
authMetadata: yield* resolveClaudeAuthMetadata(authProbe, capabilitiesProbeInput, resolveSubscriptionType),
|
|
@@ -214344,7 +214358,7 @@ const makePendingClaudeProvider = (claudeSettings) => {
|
|
|
214344
214358
|
* A refresh can wait behind a check that already holds the provider's refresh
|
|
214345
214359
|
* permit before running its own, so it gets two check budgets.
|
|
214346
214360
|
*/
|
|
214347
|
-
const CREDENTIAL_ANSWER_REFRESH_TIMEOUT_MS = 2 * (CLAUDE_VERSION_PROBE_TIMEOUT_MS + CAPABILITIES_PROBE_TIMEOUT_MS$1 + DEFAULT_TIMEOUT_MS$
|
|
214361
|
+
const CREDENTIAL_ANSWER_REFRESH_TIMEOUT_MS = 2 * (CLAUDE_VERSION_PROBE_TIMEOUT_MS + CAPABILITIES_PROBE_TIMEOUT_MS$1 + DEFAULT_TIMEOUT_MS$4);
|
|
214348
214362
|
/** The gap after each answer refresh, and the pause before a restart. */
|
|
214349
214363
|
const CREDENTIAL_ANSWER_REFRESH_SPACING = seconds(1);
|
|
214350
214364
|
/**
|
|
@@ -214509,6 +214523,114 @@ function resolveCodewebMcpEnabled(input) {
|
|
|
214509
214523
|
return input.grant ? input.grant.enabled : input.setting;
|
|
214510
214524
|
}
|
|
214511
214525
|
//#endregion
|
|
214526
|
+
//#region src/codeweb/AgentTokenMint.ts
|
|
214527
|
+
/**
|
|
214528
|
+
* CodeWeb Agent Token mint client (forge#3408; contract CodeWeb#175/#179).
|
|
214529
|
+
*
|
|
214530
|
+
* ADR-011: the person never runs a browser dance for tokens when the mint
|
|
214531
|
+
* succeeds. Forge mints silently at session construction with the shared
|
|
214532
|
+
* service credential and the caller's CMMD identity, and holds the returned
|
|
214533
|
+
* plaintext only in memory for that session — CodeWeb returns it exactly
|
|
214534
|
+
* once and this module never logs it.
|
|
214535
|
+
*
|
|
214536
|
+
* Every failure mode folds into a closed result union instead of throwing:
|
|
214537
|
+
* a CodeWeb outage must never fail (or even delay beyond the timeout) a
|
|
214538
|
+
* session start.
|
|
214539
|
+
*
|
|
214540
|
+
* @module AgentTokenMint
|
|
214541
|
+
*/
|
|
214542
|
+
/** The mint endpoint lives beside the MCP server on the same CodeWeb host. */
|
|
214543
|
+
const CODEWEB_MINT_URL = new URL("/forge/agent-tokens", CODEWEB_MCP_SERVER_URL).toString();
|
|
214544
|
+
/** Bounded so a CodeWeb outage cannot stall session construction (ADR-011). */
|
|
214545
|
+
const DEFAULT_TIMEOUT_MS$3 = 3e3;
|
|
214546
|
+
function createCodewebAgentTokenMintClient(input) {
|
|
214547
|
+
const fetchImpl = input.fetchImpl ?? fetch;
|
|
214548
|
+
const timeoutMs = input.timeoutMs ?? DEFAULT_TIMEOUT_MS$3;
|
|
214549
|
+
return { mint: async ({ cmmdUserId }) => {
|
|
214550
|
+
try {
|
|
214551
|
+
const response = await fetchImpl(CODEWEB_MINT_URL, {
|
|
214552
|
+
method: "POST",
|
|
214553
|
+
headers: {
|
|
214554
|
+
"X-Forge-Service-Token": input.serviceToken,
|
|
214555
|
+
"Content-Type": "application/json"
|
|
214556
|
+
},
|
|
214557
|
+
body: JSON.stringify({ cmmd_user_id: cmmdUserId }),
|
|
214558
|
+
signal: AbortSignal.timeout(timeoutMs)
|
|
214559
|
+
});
|
|
214560
|
+
return parseMintResponse(response.status, await response.json());
|
|
214561
|
+
} catch {
|
|
214562
|
+
return { status: "unavailable" };
|
|
214563
|
+
}
|
|
214564
|
+
} };
|
|
214565
|
+
}
|
|
214566
|
+
function parseMintResponse(httpStatus, body) {
|
|
214567
|
+
if (httpStatus === 404) return { status: "unknown_identity" };
|
|
214568
|
+
if (!isRecord$11(body)) return { status: "unavailable" };
|
|
214569
|
+
if (body["status"] === "minted" && typeof body["token"] === "string") return {
|
|
214570
|
+
status: "minted",
|
|
214571
|
+
token: body["token"]
|
|
214572
|
+
};
|
|
214573
|
+
if (body["status"] === "already_issued") return { status: "already_issued" };
|
|
214574
|
+
if (body["status"] === "workspace_required" && typeof body["choose_workspace_url"] === "string") return {
|
|
214575
|
+
status: "workspace_required",
|
|
214576
|
+
chooseWorkspaceUrl: body["choose_workspace_url"]
|
|
214577
|
+
};
|
|
214578
|
+
return { status: "unavailable" };
|
|
214579
|
+
}
|
|
214580
|
+
function isRecord$11(value) {
|
|
214581
|
+
return typeof value === "object" && value !== null;
|
|
214582
|
+
}
|
|
214583
|
+
//#endregion
|
|
214584
|
+
//#region src/codeweb/CodewebMcpSessionAuth.ts
|
|
214585
|
+
/**
|
|
214586
|
+
* Per-session CodeWeb MCP auth decision (forge#3408).
|
|
214587
|
+
*
|
|
214588
|
+
* Runs once at session construction when the CodeWeb injection is enabled:
|
|
214589
|
+
* resolves the owning CMMD identity for the thread, mints an Agent Token
|
|
214590
|
+
* with the shared service credential, and classifies the outcome. The
|
|
214591
|
+
* classification decides what the provider surfaces:
|
|
214592
|
+
*
|
|
214593
|
+
* - `authorized` — carry `Authorization: Bearer <token>` on the entry.
|
|
214594
|
+
* - `ungated` — register without credentials: no CMMD identity or service
|
|
214595
|
+
* credential is available (local/dev), or CodeWeb already issued a token
|
|
214596
|
+
* Forge does not hold (`already_issued`, `unknown_identity`). The
|
|
214597
|
+
* client-side MCP OAuth challenge (CodeWeb#22) is the recovery path that
|
|
214598
|
+
* keeps tools usable in the same session.
|
|
214599
|
+
* - `workspace_required` — omit the entry and surface the one-time
|
|
214600
|
+
* choose-your-Workspace link instead. Registering an unauthenticated
|
|
214601
|
+
* server for a user who provably cannot authenticate would only burn
|
|
214602
|
+
* agent turns on 401s; the surfaced link is the actionable step, and the
|
|
214603
|
+
* next session mints silently.
|
|
214604
|
+
* - `omitted` — the mint endpoint was unreachable or answered unexpectedly.
|
|
214605
|
+
* Fail closed to no entry for this session: a broken mint must not seat a
|
|
214606
|
+
* permanently-failing server in every session. ADR-011: session start
|
|
214607
|
+
* never depends on CodeWeb being up.
|
|
214608
|
+
*
|
|
214609
|
+
* @module CodewebMcpSessionAuth
|
|
214610
|
+
*/
|
|
214611
|
+
function resolveCodewebMcpInjection(input) {
|
|
214612
|
+
if (!input.enabled) return succeed({ kind: "disabled" });
|
|
214613
|
+
const ownerSessionId = readThreadSessionId(input.threadId);
|
|
214614
|
+
const cmmdUserId = ownerSessionId === null ? null : readCmmdUserIdentityForSession(ownerSessionId)?.id ?? null;
|
|
214615
|
+
if (cmmdUserId === null || input.serviceToken === void 0) return succeed({ kind: "ungated" });
|
|
214616
|
+
const mintClient = input.mintClient ?? createCodewebAgentTokenMintClient({ serviceToken: input.serviceToken });
|
|
214617
|
+
return promise(() => mintClient.mint({ cmmdUserId })).pipe(map$3((mint) => {
|
|
214618
|
+
switch (mint.status) {
|
|
214619
|
+
case "minted": return {
|
|
214620
|
+
kind: "authorized",
|
|
214621
|
+
bearerToken: mint.token
|
|
214622
|
+
};
|
|
214623
|
+
case "workspace_required": return {
|
|
214624
|
+
kind: "workspace_required",
|
|
214625
|
+
chooseWorkspaceUrl: mint.chooseWorkspaceUrl
|
|
214626
|
+
};
|
|
214627
|
+
case "already_issued":
|
|
214628
|
+
case "unknown_identity": return { kind: "ungated" };
|
|
214629
|
+
case "unavailable": return { kind: "omitted" };
|
|
214630
|
+
}
|
|
214631
|
+
}));
|
|
214632
|
+
}
|
|
214633
|
+
//#endregion
|
|
214512
214634
|
//#region src/cmmdData/cmmdContextMcpServer.ts
|
|
214513
214635
|
/**
|
|
214514
214636
|
* CMMD Context MCP server (in-process, read-only).
|
|
@@ -215385,14 +215507,30 @@ function buildClaudeMcpServers(input) {
|
|
|
215385
215507
|
[GITHUB_MCP_SERVER_NAME]: createGitHubMcpServer(input.runBrokeredGitHubTool, input.threadId, input.serverSettings),
|
|
215386
215508
|
...input.computerManager ? { [COMPUTER_MCP_SERVER_NAME]: createComputerMcpServer(input.computerManager, input.threadId) } : {},
|
|
215387
215509
|
...input.cmmdSidekickTools ? { "cmmd-sidekick-tools": createCmmdSidekickToolsMcpServer(input.cmmdSidekickTools.session, input.cmmdSidekickTools.tools) } : {},
|
|
215388
|
-
...
|
|
215389
|
-
|
|
215390
|
-
|
|
215391
|
-
|
|
215510
|
+
...codewebEntryForInjection(input.codewebMcpInjection)
|
|
215511
|
+
};
|
|
215512
|
+
}
|
|
215513
|
+
/**
|
|
215514
|
+
* CodeWeb entry per the session auth decision: `authorized` carries the
|
|
215515
|
+
* minted Agent Token (plaintext appears exactly once, held in memory for
|
|
215516
|
+
* this session); `ungated` registers without credentials so the client-side
|
|
215517
|
+
* MCP OAuth challenge can run; `workspace_required` and `omitted` seat
|
|
215518
|
+
* nothing — the surfaced link and the next session's mint retry are the
|
|
215519
|
+
* recovery paths.
|
|
215520
|
+
*/
|
|
215521
|
+
function codewebEntryForInjection(injection) {
|
|
215522
|
+
switch (injection.kind) {
|
|
215523
|
+
case "authorized": return { [CODEWEB_MCP_SERVER_NAME]: {
|
|
215524
|
+
type: "http",
|
|
215525
|
+
url: CODEWEB_MCP_SERVER_URL,
|
|
215526
|
+
headers: { Authorization: `Bearer ${injection.bearerToken}` }
|
|
215527
|
+
} };
|
|
215528
|
+
case "ungated": return { [CODEWEB_MCP_SERVER_NAME]: {
|
|
215392
215529
|
type: "http",
|
|
215393
215530
|
url: CODEWEB_MCP_SERVER_URL
|
|
215394
|
-
} }
|
|
215395
|
-
|
|
215531
|
+
} };
|
|
215532
|
+
default: return {};
|
|
215533
|
+
}
|
|
215396
215534
|
}
|
|
215397
215535
|
function claudeQueryWorkingDirectoryOptions(cwd) {
|
|
215398
215536
|
return cwd ? {
|
|
@@ -217631,6 +217769,25 @@ const makeClaudeAdapter = fn$1("makeClaudeAdapter")(function* (options) {
|
|
|
217631
217769
|
detail: error.message,
|
|
217632
217770
|
cause: error
|
|
217633
217771
|
})));
|
|
217772
|
+
const codewebMcpInjection = yield* resolveCodewebMcpInjection({
|
|
217773
|
+
enabled: resolveCodewebMcpEnabled({
|
|
217774
|
+
grant: cmmdSidekickResolution.codewebMcpGrant,
|
|
217775
|
+
setting: serverSettings.codewebMcp
|
|
217776
|
+
}),
|
|
217777
|
+
threadId,
|
|
217778
|
+
serviceToken: serverConfig.codewebServiceToken
|
|
217779
|
+
});
|
|
217780
|
+
if (codewebMcpInjection.kind === "workspace_required") {
|
|
217781
|
+
const stamp = yield* makeEventStamp();
|
|
217782
|
+
yield* offerRuntimeEvent({
|
|
217783
|
+
type: "codeweb.workspace.required",
|
|
217784
|
+
eventId: stamp.eventId,
|
|
217785
|
+
provider: PROVIDER$11,
|
|
217786
|
+
createdAt: stamp.createdAt,
|
|
217787
|
+
threadId,
|
|
217788
|
+
payload: { chooseWorkspaceUrl: codewebMcpInjection.chooseWorkspaceUrl }
|
|
217789
|
+
});
|
|
217790
|
+
}
|
|
217634
217791
|
const claudeSettings = serverSettings.providers.claudeAgent;
|
|
217635
217792
|
const claudeBinaryPath = claudeSettings.binaryPath;
|
|
217636
217793
|
const { selectedAccountIdentity, claudeCredentialDirectory } = yield* resolveSelectedCredentialDirectory(input, resumeState, claudeBinaryPath);
|
|
@@ -217671,7 +217828,7 @@ const makeClaudeAdapter = fn$1("makeClaudeAdapter")(function* (options) {
|
|
|
217671
217828
|
resolveCmmdPat,
|
|
217672
217829
|
devServerToolDeps,
|
|
217673
217830
|
cmmdSidekickTools: cmmdSidekickResolution.registration,
|
|
217674
|
-
|
|
217831
|
+
codewebMcpInjection,
|
|
217675
217832
|
runBrokeredGitHubTool,
|
|
217676
217833
|
serverSettings
|
|
217677
217834
|
}), threadId);
|
|
@@ -222491,7 +222648,10 @@ function buildAcpMcpServers(input) {
|
|
|
222491
222648
|
type: "http",
|
|
222492
222649
|
name: CODEWEB_MCP_SERVER_NAME,
|
|
222493
222650
|
url: CODEWEB_MCP_SERVER_URL,
|
|
222494
|
-
headers: [
|
|
222651
|
+
headers: input.codewebBearerToken ? [{
|
|
222652
|
+
name: "Authorization",
|
|
222653
|
+
value: `Bearer ${input.codewebBearerToken}`
|
|
222654
|
+
}] : []
|
|
222495
222655
|
}];
|
|
222496
222656
|
}
|
|
222497
222657
|
var AcpSessionRuntime = class AcpSessionRuntime extends Service$1()("forge/provider/acp/AcpSessionRuntime") {
|
|
@@ -223006,7 +223166,7 @@ const checkCursorProviderStatus = fn$1("checkCursorProviderStatus")(function* ()
|
|
|
223006
223166
|
message: "Cursor is disabled in Forge settings."
|
|
223007
223167
|
}
|
|
223008
223168
|
});
|
|
223009
|
-
const versionProbe = yield* runCursorCommand(cursorSettings.binaryPath, ["--version"]).pipe(timeoutOption(DEFAULT_TIMEOUT_MS$
|
|
223169
|
+
const versionProbe = yield* runCursorCommand(cursorSettings.binaryPath, ["--version"]).pipe(timeoutOption(DEFAULT_TIMEOUT_MS$4), result);
|
|
223010
223170
|
if (isFailure$1(versionProbe)) {
|
|
223011
223171
|
const error = versionProbe.failure;
|
|
223012
223172
|
return buildServerProvider({
|
|
@@ -269300,7 +269460,7 @@ var import_multicast_dns = /* @__PURE__ */ __toESM((/* @__PURE__ */ __commonJSMi
|
|
|
269300
269460
|
var dgram = __require("dgram");
|
|
269301
269461
|
var thunky = require_thunky();
|
|
269302
269462
|
var events = __require("events");
|
|
269303
|
-
var os = __require("os");
|
|
269463
|
+
var os$1 = __require("os");
|
|
269304
269464
|
var noop = function() {};
|
|
269305
269465
|
module.exports = function(opts) {
|
|
269306
269466
|
if (!opts) opts = {};
|
|
@@ -269431,14 +269591,14 @@ var import_multicast_dns = /* @__PURE__ */ __toESM((/* @__PURE__ */ __commonJSMi
|
|
|
269431
269591
|
return that;
|
|
269432
269592
|
};
|
|
269433
269593
|
function defaultInterface() {
|
|
269434
|
-
var networks = os.networkInterfaces();
|
|
269594
|
+
var networks = os$1.networkInterfaces();
|
|
269435
269595
|
var names = Object.keys(networks);
|
|
269436
269596
|
for (var i = 0; i < names.length; i++) {
|
|
269437
269597
|
var net = networks[names[i]];
|
|
269438
269598
|
for (var j = 0; j < net.length; j++) {
|
|
269439
269599
|
var iface = net[j];
|
|
269440
269600
|
if (isIPv4(iface.family) && !iface.internal) {
|
|
269441
|
-
if (os.platform() === "darwin" && names[i] === "en0") return iface.address;
|
|
269601
|
+
if (os$1.platform() === "darwin" && names[i] === "en0") return iface.address;
|
|
269442
269602
|
return "0.0.0.0";
|
|
269443
269603
|
}
|
|
269444
269604
|
}
|
|
@@ -269446,7 +269606,7 @@ var import_multicast_dns = /* @__PURE__ */ __toESM((/* @__PURE__ */ __commonJSMi
|
|
|
269446
269606
|
return "127.0.0.1";
|
|
269447
269607
|
}
|
|
269448
269608
|
function allInterfaces() {
|
|
269449
|
-
var networks = os.networkInterfaces();
|
|
269609
|
+
var networks = os$1.networkInterfaces();
|
|
269450
269610
|
var names = Object.keys(networks);
|
|
269451
269611
|
var res = [];
|
|
269452
269612
|
for (var i = 0; i < names.length; i++) {
|
|
@@ -289189,6 +289349,16 @@ function runtimeStatusEventToActivities(event) {
|
|
|
289189
289349
|
summary: "Runtime error",
|
|
289190
289350
|
payload: { message: truncateDetail(event.payload.message) }
|
|
289191
289351
|
}];
|
|
289352
|
+
case "codeweb.workspace.required": return [{
|
|
289353
|
+
...activityBase(event),
|
|
289354
|
+
tone: "info",
|
|
289355
|
+
kind: "codeweb.workspace.required",
|
|
289356
|
+
summary: "CodeWeb: choose your Workspace to enable its tools",
|
|
289357
|
+
payload: {
|
|
289358
|
+
detail: `One-time setup: open ${event.payload.chooseWorkspaceUrl} to choose your CodeWeb Workspace, then retry.`,
|
|
289359
|
+
chooseWorkspaceUrl: event.payload.chooseWorkspaceUrl
|
|
289360
|
+
}
|
|
289361
|
+
}];
|
|
289192
289362
|
case "runtime.warning": return [{
|
|
289193
289363
|
...activityBase(event),
|
|
289194
289364
|
tone: "info",
|
|
@@ -294078,7 +294248,7 @@ const checkOpenCodeProviderStatus = fn$1("checkOpenCodeProviderStatus")(function
|
|
|
294078
294248
|
message: "OpenCode is disabled in Forge settings."
|
|
294079
294249
|
}
|
|
294080
294250
|
});
|
|
294081
|
-
const versionProbe = yield* runOpenCodeCommand(opencodeSettings.binaryPath, ["--version"]).pipe(timeoutOption(DEFAULT_TIMEOUT_MS$
|
|
294251
|
+
const versionProbe = yield* runOpenCodeCommand(opencodeSettings.binaryPath, ["--version"]).pipe(timeoutOption(DEFAULT_TIMEOUT_MS$4), result);
|
|
294082
294252
|
if (isFailure$1(versionProbe)) {
|
|
294083
294253
|
const error = versionProbe.failure;
|
|
294084
294254
|
return buildServerProvider({
|
|
@@ -297340,7 +297510,7 @@ function resolveBuildCommitFromEnv(env) {
|
|
|
297340
297510
|
* environment descriptor down instead of reporting an honest "unknown".
|
|
297341
297511
|
*/
|
|
297342
297512
|
function readBakedBuildCommit() {
|
|
297343
|
-
return "
|
|
297513
|
+
return "3d38f5e907e83b83422e19db2ab78ada5d96f94a";
|
|
297344
297514
|
}
|
|
297345
297515
|
async function resolveServerBuildCommit(input) {
|
|
297346
297516
|
if (isFullCommitSha(input.baked)) return input.baked;
|
|
@@ -321329,6 +321499,7 @@ const EnvServerConfig = all$1({
|
|
|
321329
321499
|
forgeCodexHomePath: string$7("FORGE_CODEX_HOME").pipe(option$1, map$8(getOrUndefined)),
|
|
321330
321500
|
forgeClaudeConfigPath: string$7("FORGE_CLAUDE_CONFIG_PATH").pipe(option$1, map$8(getOrUndefined)),
|
|
321331
321501
|
forgeApexBaseUrl: string$7("FORGE_APEX_BASE_URL").pipe(option$1, map$8(getOrUndefined)),
|
|
321502
|
+
codewebServiceToken: string$7("FORGE_CODEWEB_SERVICE_TOKEN").pipe(option$1, map$8(getOrUndefined)),
|
|
321332
321503
|
browserWebRtcIceServers: string$7("FORGE_BROWSER_WEBRTC_ICE_SERVERS").pipe(option$1, map$8(getOrUndefined)),
|
|
321333
321504
|
browserWebRtcCloudflareTurnKeyId: string$7("FORGE_BROWSER_WEBRTC_CLOUDFLARE_TURN_KEY_ID").pipe(option$1, map$8(getOrUndefined)),
|
|
321334
321505
|
browserWebRtcCloudflareTurnKeyApiToken: string$7("FORGE_BROWSER_WEBRTC_CLOUDFLARE_TURN_KEY_API_TOKEN").pipe(option$1, map$8(getOrUndefined)),
|
|
@@ -321523,6 +321694,7 @@ const resolveServerConfig = (flags, cliLogLevel, options) => gen(function* () {
|
|
|
321523
321694
|
forgeCodexHomePath: env.forgeCodexHomePath,
|
|
321524
321695
|
forgeClaudeConfigPath: env.forgeClaudeConfigPath,
|
|
321525
321696
|
forgeApexBaseUrl: env.forgeApexBaseUrl,
|
|
321697
|
+
codewebServiceToken: env.codewebServiceToken,
|
|
321526
321698
|
cloudProjectsRoot: env.cloudProjectsRoot ?? "/projects"
|
|
321527
321699
|
};
|
|
321528
321700
|
if (config.forgeCloudShellMode === true && (!config.forgeCloudOwnerAssertionPublicKey?.trim() || !config.forgeCloudOwnerAssertionKeyId?.trim())) return yield* die$1(/* @__PURE__ */ new Error("FORGE_CMMD_CLOUD_OWNER_ASSERTION_PUBLIC_KEY and FORGE_CMMD_CLOUD_OWNER_ASSERTION_KEY_ID are required in cloud-shell mode; runtime ticket keys are not accepted for Cloud owner assertions."));
|
|
@@ -321631,16 +321803,16 @@ const findActiveProjectTarget = fn$1("findActiveProjectTarget")(function* (input
|
|
|
321631
321803
|
workspaceRoot: resolved.workspaceRoot
|
|
321632
321804
|
};
|
|
321633
321805
|
});
|
|
321634
|
-
const fetchLiveOrchestrationSnapshot = (origin, bearerToken$
|
|
321806
|
+
const fetchLiveOrchestrationSnapshot = (origin, bearerToken$2) => runLiveServerRequest(get$7(`${origin}/api/orchestration/snapshot`).pipe(acceptJson, bearerToken(bearerToken$2)), matchStatus({
|
|
321635
321807
|
"2xx": decodeOrchestrationReadModelResponse,
|
|
321636
321808
|
orElse: (response) => readErrorMessageFromResponse(response).pipe(flatMap((message) => fail(new Error(message))))
|
|
321637
321809
|
}));
|
|
321638
321810
|
const ProjectLeadExplanationEnvelope = Struct({ data: ProjectLeadExplanationSchema });
|
|
321639
|
-
const fetchLiveProjectLeadExplanation = (origin, bearerToken$
|
|
321811
|
+
const fetchLiveProjectLeadExplanation = (origin, bearerToken$1, projectId) => runLiveServerRequest(get$7(`${origin}/api/cmmd/projects/${projectId}/project-lead/explain`).pipe(acceptJson, bearerToken(bearerToken$1)), matchStatus({
|
|
321640
321812
|
"2xx": (response) => schemaBodyJson$1(ProjectLeadExplanationEnvelope)(response).pipe(map$3((body) => body.data)),
|
|
321641
321813
|
orElse: (response) => readErrorMessageFromResponse(response).pipe(flatMap((message) => fail(new Error(message))))
|
|
321642
321814
|
}));
|
|
321643
|
-
const dispatchLiveOrchestrationCommand = (origin, bearerToken$
|
|
321815
|
+
const dispatchLiveOrchestrationCommand = (origin, bearerToken$3, command) => post(`${origin}/api/orchestration/dispatch`).pipe(acceptJson, bearerToken(bearerToken$3), bodyJson(command), flatMap((request) => runLiveServerRequest(request, matchStatus({
|
|
321644
321816
|
"2xx": () => void_$1,
|
|
321645
321817
|
orElse: (response) => readErrorMessageFromResponse(response).pipe(flatMap((message) => fail(new Error(message))))
|
|
321646
321818
|
}))));
|
|
@@ -321941,7 +322113,7 @@ const connectLoginCommand = make$34("login", {
|
|
|
321941
322113
|
})).json();
|
|
321942
322114
|
},
|
|
321943
322115
|
openBrowser: async (url) => {
|
|
321944
|
-
const open = (await import("./open-
|
|
322116
|
+
const open = (await import("./open-yHTUkd2Y.mjs")).default;
|
|
321945
322117
|
await open(url);
|
|
321946
322118
|
return true;
|
|
321947
322119
|
},
|