@cmmd-center/forge 0.13.82 → 0.13.84
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 +158 -134
- package/dist/bin.mjs +242 -213
- package/dist/client/assets/{CanvasPanel-AjtGwv2H.js → CanvasPanel-Dyho_JDo.js} +2 -2
- package/dist/client/assets/{CompositeItem-B_Qce_Zi.js → CompositeItem-DeDhuBZB.js} +2 -2
- package/dist/client/assets/{DiffPanel-B47H2Ztq.js → DiffPanel-B4iZmA47.js} +3 -3
- package/dist/client/assets/{DiffPanel.logic-DT4FolWZ.js → DiffPanel.logic-BpahIUC5.js} +4 -4
- package/dist/client/assets/{DiffWorkerPoolProvider-BrgXjqS5.js → DiffWorkerPoolProvider-CZ4RyCYi.js} +30 -30
- package/dist/client/assets/PullRequestCodePanel-CKRAtq2X.js +5 -0
- package/dist/client/assets/Virtualizer-CDLGfmSn.js +2 -0
- package/dist/client/assets/WorkerPoolContext--cbYuhHG.js +2537 -0
- package/dist/client/assets/{canvasStateStore-BpKdB-dM.js → canvasStateStore-DJ_OzrrC.js} +2 -2
- package/dist/client/assets/cmmdAuthRedirect-Bqx90tp9.js +3 -0
- package/dist/client/assets/index-pi7gtd2m.js +153 -0
- package/dist/client/assets/{popover-RLwH5jQy.js → popover-D20eY2oM.js} +2 -2
- package/dist/client/assets/{src-IM0FnQax.js → src-CoTxmdk3.js} +2 -2
- package/dist/client/assets/{toggle-BUzYChlq.js → toggle-AqC0QUc1.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/DiffPanelShell-DYfYdx6r.js +0 -2537
- package/dist/client/assets/PullRequestCodePanel-3MHkasTp.js +0 -5
- package/dist/client/assets/Virtualizer-BF72qd4z.js +0 -2
- package/dist/client/assets/cmmdAuthRedirect-lzr9SGGx.js +0 -2
- package/dist/client/assets/index-jjmPqZtL.js +0 -154
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";
|
|
@@ -19653,6 +19653,63 @@ const BrowserPointerButton = Literals([
|
|
|
19653
19653
|
"middle",
|
|
19654
19654
|
"right"
|
|
19655
19655
|
]);
|
|
19656
|
+
const BrowserClickPointCommand = Struct({
|
|
19657
|
+
type: Literal("clickPoint"),
|
|
19658
|
+
...BrowserBaseTabAction.fields,
|
|
19659
|
+
x: Number$1,
|
|
19660
|
+
y: Number$1,
|
|
19661
|
+
button: optional$4(BrowserPointerButton),
|
|
19662
|
+
clickCount: optional$4(Number$1)
|
|
19663
|
+
});
|
|
19664
|
+
const BrowserWheelCommand = Struct({
|
|
19665
|
+
type: Literal("wheel"),
|
|
19666
|
+
...BrowserBaseTabAction.fields,
|
|
19667
|
+
deltaX: Number$1,
|
|
19668
|
+
deltaY: Number$1,
|
|
19669
|
+
x: optional$4(Number$1),
|
|
19670
|
+
y: optional$4(Number$1)
|
|
19671
|
+
});
|
|
19672
|
+
const BrowserPressKeyCommand = Struct({
|
|
19673
|
+
type: Literal("pressKey"),
|
|
19674
|
+
...BrowserBaseTabAction.fields,
|
|
19675
|
+
key: TrimmedNonEmptyString,
|
|
19676
|
+
x: optional$4(Number$1),
|
|
19677
|
+
y: optional$4(Number$1)
|
|
19678
|
+
});
|
|
19679
|
+
const BrowserTypeTextCommand = Struct({
|
|
19680
|
+
type: Literal("typeText"),
|
|
19681
|
+
...BrowserBaseTabAction.fields,
|
|
19682
|
+
text: String$1,
|
|
19683
|
+
pressEnter: optional$4(Boolean$1)
|
|
19684
|
+
});
|
|
19685
|
+
const BrowserSnapshotCommand = Struct({
|
|
19686
|
+
type: Literal("snapshot"),
|
|
19687
|
+
...BrowserBaseTabAction.fields
|
|
19688
|
+
});
|
|
19689
|
+
const BrowserScreenshotCommand = Struct({
|
|
19690
|
+
type: Literal("screenshot"),
|
|
19691
|
+
...BrowserBaseTabAction.fields,
|
|
19692
|
+
fullPage: optional$4(Boolean$1)
|
|
19693
|
+
});
|
|
19694
|
+
const BrowserSetViewportCommand = Struct({
|
|
19695
|
+
type: Literal("setViewport"),
|
|
19696
|
+
viewport: BrowserViewport
|
|
19697
|
+
});
|
|
19698
|
+
const BrowserResetViewportCommand = Struct({ type: Literal("resetViewport") });
|
|
19699
|
+
const BrowserSetVisibilityCommand = Struct({
|
|
19700
|
+
type: Literal("setVisibility"),
|
|
19701
|
+
visibility: BrowserVisibility
|
|
19702
|
+
});
|
|
19703
|
+
const BrowserNameSessionCommand = Struct({
|
|
19704
|
+
type: Literal("nameSession"),
|
|
19705
|
+
name: TrimmedNonEmptyString
|
|
19706
|
+
});
|
|
19707
|
+
const BrowserConsoleLogsCommand = Struct({
|
|
19708
|
+
type: Literal("consoleLogs"),
|
|
19709
|
+
tabId: optional$4(BrowserTabId),
|
|
19710
|
+
limit: optional$4(Number$1),
|
|
19711
|
+
levels: optional$4(ArraySchema(BrowserConsoleLogLevel))
|
|
19712
|
+
});
|
|
19656
19713
|
const BrowserCommand = Union([
|
|
19657
19714
|
BrowserNavigateCommand,
|
|
19658
19715
|
BrowserNewTabCommand,
|
|
@@ -19664,63 +19721,21 @@ const BrowserCommand = Union([
|
|
|
19664
19721
|
BrowserClickCommand,
|
|
19665
19722
|
BrowserTypeCommand,
|
|
19666
19723
|
BrowserScrollCommand,
|
|
19724
|
+
BrowserClickPointCommand,
|
|
19725
|
+
BrowserWheelCommand,
|
|
19726
|
+
BrowserPressKeyCommand,
|
|
19727
|
+
BrowserTypeTextCommand,
|
|
19728
|
+
BrowserSnapshotCommand,
|
|
19729
|
+
BrowserScreenshotCommand,
|
|
19730
|
+
BrowserSetViewportCommand,
|
|
19731
|
+
BrowserResetViewportCommand,
|
|
19732
|
+
BrowserSetVisibilityCommand,
|
|
19667
19733
|
Struct({
|
|
19668
|
-
type: Literal("
|
|
19669
|
-
|
|
19670
|
-
x: Number$1,
|
|
19671
|
-
y: Number$1,
|
|
19672
|
-
button: optional$4(BrowserPointerButton),
|
|
19673
|
-
clickCount: optional$4(Number$1)
|
|
19674
|
-
}),
|
|
19675
|
-
Struct({
|
|
19676
|
-
type: Literal("wheel"),
|
|
19677
|
-
...BrowserBaseTabAction.fields,
|
|
19678
|
-
deltaX: Number$1,
|
|
19679
|
-
deltaY: Number$1,
|
|
19680
|
-
x: optional$4(Number$1),
|
|
19681
|
-
y: optional$4(Number$1)
|
|
19682
|
-
}),
|
|
19683
|
-
Struct({
|
|
19684
|
-
type: Literal("pressKey"),
|
|
19685
|
-
...BrowserBaseTabAction.fields,
|
|
19686
|
-
key: TrimmedNonEmptyString,
|
|
19687
|
-
x: optional$4(Number$1),
|
|
19688
|
-
y: optional$4(Number$1)
|
|
19689
|
-
}),
|
|
19690
|
-
Struct({
|
|
19691
|
-
type: Literal("typeText"),
|
|
19692
|
-
...BrowserBaseTabAction.fields,
|
|
19693
|
-
text: String$1,
|
|
19694
|
-
pressEnter: optional$4(Boolean$1)
|
|
19695
|
-
}),
|
|
19696
|
-
Struct({
|
|
19697
|
-
type: Literal("snapshot"),
|
|
19698
|
-
...BrowserBaseTabAction.fields
|
|
19699
|
-
}),
|
|
19700
|
-
Struct({
|
|
19701
|
-
type: Literal("screenshot"),
|
|
19702
|
-
...BrowserBaseTabAction.fields,
|
|
19703
|
-
fullPage: optional$4(Boolean$1)
|
|
19704
|
-
}),
|
|
19705
|
-
Struct({
|
|
19706
|
-
type: Literal("setViewport"),
|
|
19707
|
-
viewport: BrowserViewport
|
|
19734
|
+
type: Literal("setAudioMuted"),
|
|
19735
|
+
muted: Boolean$1
|
|
19708
19736
|
}),
|
|
19709
|
-
|
|
19710
|
-
|
|
19711
|
-
type: Literal("setVisibility"),
|
|
19712
|
-
visibility: BrowserVisibility
|
|
19713
|
-
}),
|
|
19714
|
-
Struct({
|
|
19715
|
-
type: Literal("nameSession"),
|
|
19716
|
-
name: TrimmedNonEmptyString
|
|
19717
|
-
}),
|
|
19718
|
-
Struct({
|
|
19719
|
-
type: Literal("consoleLogs"),
|
|
19720
|
-
tabId: optional$4(BrowserTabId),
|
|
19721
|
-
limit: optional$4(Number$1),
|
|
19722
|
-
levels: optional$4(ArraySchema(BrowserConsoleLogLevel))
|
|
19723
|
-
})
|
|
19737
|
+
BrowserNameSessionCommand,
|
|
19738
|
+
BrowserConsoleLogsCommand
|
|
19724
19739
|
]);
|
|
19725
19740
|
const BrowserOpenSessionInput = Struct({
|
|
19726
19741
|
threadId: ThreadId,
|
|
@@ -50591,7 +50606,7 @@ function _supportsColor(haveStream, { streamIsTTY, sniffFlags = true } = {}) {
|
|
|
50591
50606
|
const min = forceColor || 0;
|
|
50592
50607
|
if (env.TERM === "dumb") return min;
|
|
50593
50608
|
if (process$1.platform === "win32") {
|
|
50594
|
-
const osRelease =
|
|
50609
|
+
const osRelease = os.release().split(".");
|
|
50595
50610
|
if (Number(osRelease[0]) >= 10 && Number(osRelease[2]) >= 10586) return Number(osRelease[2]) >= 14931 ? 3 : 2;
|
|
50596
50611
|
return 1;
|
|
50597
50612
|
}
|
|
@@ -53034,7 +53049,7 @@ var require_ProcessDetector = /* @__PURE__ */ __commonJSMin(((exports) => {
|
|
|
53034
53049
|
exports.processDetector = void 0;
|
|
53035
53050
|
const api_1 = (init_esm$1(), __toCommonJS(esm_exports$1));
|
|
53036
53051
|
const semconv_1 = require_semconv$1();
|
|
53037
|
-
const os$
|
|
53052
|
+
const os$4 = __require("os");
|
|
53038
53053
|
/**
|
|
53039
53054
|
* ProcessDetector will be used to detect the resources related current process running
|
|
53040
53055
|
* and being instrumented from the NodeJS Process module.
|
|
@@ -53056,7 +53071,7 @@ var require_ProcessDetector = /* @__PURE__ */ __commonJSMin(((exports) => {
|
|
|
53056
53071
|
};
|
|
53057
53072
|
if (process.argv.length > 1) attributes[semconv_1.ATTR_PROCESS_COMMAND] = process.argv[1];
|
|
53058
53073
|
try {
|
|
53059
|
-
const userInfo = os$
|
|
53074
|
+
const userInfo = os$4.userInfo();
|
|
53060
53075
|
attributes[semconv_1.ATTR_PROCESS_OWNER] = userInfo.username;
|
|
53061
53076
|
} catch (e) {
|
|
53062
53077
|
api_1.diag.debug(`error obtaining process owner: ${e}`);
|
|
@@ -65979,7 +65994,7 @@ function normalizeNumberish(value) {
|
|
|
65979
65994
|
}
|
|
65980
65995
|
//#endregion
|
|
65981
65996
|
//#region package.json
|
|
65982
|
-
var version$1 = "0.13.
|
|
65997
|
+
var version$1 = "0.13.84";
|
|
65983
65998
|
//#endregion
|
|
65984
65999
|
//#region src/sentry.ts
|
|
65985
66000
|
const SERVER_APP_NAME = "forge-server";
|
|
@@ -76022,7 +76037,7 @@ var require_node_gyp_build = /* @__PURE__ */ __commonJSMin(((exports, module) =>
|
|
|
76022
76037
|
var fs$6 = __require("fs");
|
|
76023
76038
|
var path$5 = __require("path");
|
|
76024
76039
|
var url$1 = __require("url");
|
|
76025
|
-
var os$
|
|
76040
|
+
var os$3 = __require("os");
|
|
76026
76041
|
var runtimeRequire = typeof __webpack_require__ === "function" ? __non_webpack_require__ : __require;
|
|
76027
76042
|
var vars = process.config && process.config.variables || {};
|
|
76028
76043
|
var prebuildsOnly = !!process.env.PREBUILDS_ONLY;
|
|
@@ -76030,8 +76045,8 @@ var require_node_gyp_build = /* @__PURE__ */ __commonJSMin(((exports, module) =>
|
|
|
76030
76045
|
var abi = versions.modules;
|
|
76031
76046
|
if (versions.deno || process.isBun) abi = "unsupported";
|
|
76032
76047
|
var runtime = isElectron() ? "electron" : isNwjs() ? "node-webkit" : "node";
|
|
76033
|
-
var arch = process.env.npm_config_arch || os$
|
|
76034
|
-
var platform = process.env.npm_config_platform || os$
|
|
76048
|
+
var arch = process.env.npm_config_arch || os$3.arch();
|
|
76049
|
+
var platform = process.env.npm_config_platform || os$3.platform();
|
|
76035
76050
|
var libc = process.env.LIBC || (isMusl(platform) ? "musl" : "glibc");
|
|
76036
76051
|
var armv = process.env.ARM_VERSION || (arch === "arm64" ? "8" : vars.arm_version) || "";
|
|
76037
76052
|
var uv = (versions.uv || "").split(".")[0];
|
|
@@ -79845,10 +79860,7 @@ function dedupeChecks(entries) {
|
|
|
79845
79860
|
for (const entry of survivors) countsByName.set(entry.check.name, (countsByName.get(entry.check.name) ?? 0) + 1);
|
|
79846
79861
|
return survivors.map((entry) => {
|
|
79847
79862
|
const workflowName = entry.workflowName ?? "";
|
|
79848
|
-
return workflowName.length > 0 && (countsByName.get(entry.check.name) ?? 0) > 1 ? {
|
|
79849
|
-
...entry.check,
|
|
79850
|
-
name: `${workflowName} / ${entry.check.name}`
|
|
79851
|
-
} : entry.check;
|
|
79863
|
+
return workflowName.length > 0 && (countsByName.get(entry.check.name) ?? 0) > 1 ? Object.assign({}, entry.check, { name: `${workflowName} / ${entry.check.name}` }) : entry.check;
|
|
79852
79864
|
});
|
|
79853
79865
|
}
|
|
79854
79866
|
//#endregion
|
|
@@ -87199,13 +87211,8 @@ const make$21 = gen(function* () {
|
|
|
87199
87211
|
author: withAvatar(pullRequest.author, reviewThreads.avatarsByLogin, input.host),
|
|
87200
87212
|
reviewers: reviewThreads.reviewers,
|
|
87201
87213
|
reactions: reviewThreads.reactions,
|
|
87202
|
-
commits: (reviewThreads.commits.length > 0 ? reviewThreads.commits : pullRequest.commits).map((commit) => ({
|
|
87203
|
-
|
|
87204
|
-
...reviewThreads.commitStats.get(commit.oid),
|
|
87205
|
-
authors: commit.authors?.map((author) => withAvatar(author, reviewThreads.avatarsByLogin, input.host) ?? author)
|
|
87206
|
-
})),
|
|
87207
|
-
comments: [...pullRequest.comments, ...reviewThreads.comments].map((comment) => ({
|
|
87208
|
-
...comment,
|
|
87214
|
+
commits: (reviewThreads.commits.length > 0 ? reviewThreads.commits : pullRequest.commits).map((commit) => Object.assign({}, commit, reviewThreads.commitStats.get(commit.oid), { authors: commit.authors?.map((author) => withAvatar(author, reviewThreads.avatarsByLogin, input.host) ?? author) })),
|
|
87215
|
+
comments: [...pullRequest.comments, ...reviewThreads.comments].map((comment) => Object.assign({}, comment, {
|
|
87209
87216
|
body: comment.kind === "review" && comment.reviewState?.toUpperCase() === "DISMISSED" && rendersEmpty(comment.body) ? reviewThreads.dismissalsByReviewId.get(comment.id) ?? comment.body : comment.body,
|
|
87210
87217
|
author: withAvatar(comment.author, reviewThreads.avatarsByLogin, input.host),
|
|
87211
87218
|
reactions: comment.reactions ?? reviewThreads.reactionsById.get(comment.id) ?? []
|
|
@@ -93872,7 +93879,7 @@ const launchDetached = (launch) => gen(function* () {
|
|
|
93872
93879
|
});
|
|
93873
93880
|
const OpenLive = effect(Open, gen(function* () {
|
|
93874
93881
|
const open = yield* tryPromise({
|
|
93875
|
-
try: () => import("./open-
|
|
93882
|
+
try: () => import("./open-yHTUkd2Y.mjs"),
|
|
93876
93883
|
catch: (cause) => new OpenError$1({
|
|
93877
93884
|
message: "failed to load browser opener",
|
|
93878
93885
|
cause
|
|
@@ -151361,7 +151368,7 @@ const OPENAI_PROXY_ENV_KEYS = ["OPENAI_API_KEY", "OPENAI_BASE_URL"];
|
|
|
151361
151368
|
function personalCodexServedByControlPlane(env = process.env) {
|
|
151362
151369
|
return env.FORGE_CMMD_RUNTIME_MODE === "true" && env.FORGE_PERSONAL_CODEX_VIA_EGRESS === "true";
|
|
151363
151370
|
}
|
|
151364
|
-
function resolveCodexAccessMode(input) {
|
|
151371
|
+
function resolveCodexAccessMode$1(input) {
|
|
151365
151372
|
if (clampWorkspaceAccessMode(input.accessMode) === "workspace") return "workspace";
|
|
151366
151373
|
if (personalCodexServedByControlPlane(input.env ?? process.env)) return "workspace";
|
|
151367
151374
|
if (!input.hasCodexChatGptLogin()) throw personalCodexAuthError("This runtime is not signed in to ChatGPT. Open Settings > Providers and connect ChatGPT on this runtime.");
|
|
@@ -153079,7 +153086,7 @@ var CodexAppServerManager = class extends EventEmitter$1 {
|
|
|
153079
153086
|
cwd: resolvedCwd,
|
|
153080
153087
|
...codexHomePath ? { homePath: codexHomePath } : {}
|
|
153081
153088
|
});
|
|
153082
|
-
const accessMode = resolveCodexAccessMode({
|
|
153089
|
+
const accessMode = resolveCodexAccessMode$1({
|
|
153083
153090
|
accessMode: input.accessMode ?? "workspace",
|
|
153084
153091
|
hasCodexChatGptLogin: () => hasCodexChatGptLogin({
|
|
153085
153092
|
binaryPath: codexBinaryPath,
|
|
@@ -191811,7 +191818,7 @@ var Vce = {
|
|
|
191811
191818
|
function Ve() {
|
|
191812
191819
|
return Vce;
|
|
191813
191820
|
}
|
|
191814
|
-
var Us =
|
|
191821
|
+
var Us = os.homedir(), lk = os.tmpdir(), { env: Vc } = process$1, Yce = (e) => {
|
|
191815
191822
|
let t = path.join(Us, "Library");
|
|
191816
191823
|
return {
|
|
191817
191824
|
data: path.join(t, "Application Support", e),
|
|
@@ -202011,12 +202018,12 @@ function qZ(e, t) {
|
|
|
202011
202018
|
}
|
|
202012
202019
|
return n;
|
|
202013
202020
|
}
|
|
202014
|
-
var os$
|
|
202021
|
+
var os$2 = "https://code.claude.com/docs/en", kKe = [
|
|
202015
202022
|
{
|
|
202016
202023
|
matches: (e) => e.path === "permissions.defaultMode" && e.code === "invalid_value",
|
|
202017
202024
|
tip: {
|
|
202018
202025
|
suggestion: "Valid modes: \"acceptEdits\" (ask before file changes), \"plan\" (analysis only), \"bypassPermissions\" (auto-accept all), or \"default\" (standard behavior)",
|
|
202019
|
-
docLink: `${os$
|
|
202026
|
+
docLink: `${os$2}/iam#permission-modes`
|
|
202020
202027
|
}
|
|
202021
202028
|
},
|
|
202022
202029
|
{
|
|
@@ -202031,7 +202038,7 @@ var os$1 = "https://code.claude.com/docs/en", kKe = [
|
|
|
202031
202038
|
matches: (e) => e.path.startsWith("env.") && e.code === "invalid_type",
|
|
202032
202039
|
tip: {
|
|
202033
202040
|
suggestion: "Environment variables must be strings. Wrap numbers and booleans in quotes. Example: \"DEBUG\": \"true\", \"PORT\": \"3000\"",
|
|
202034
|
-
docLink: `${os$
|
|
202041
|
+
docLink: `${os$2}/settings#environment-variables`
|
|
202035
202042
|
}
|
|
202036
202043
|
},
|
|
202037
202044
|
{
|
|
@@ -202042,14 +202049,14 @@ var os$1 = "https://code.claude.com/docs/en", kKe = [
|
|
|
202042
202049
|
matches: (e) => e.path.startsWith("hooks.") && e.code === "invalid_key",
|
|
202043
202050
|
tip: {
|
|
202044
202051
|
suggestion: "Not a recognized hook event. Common events: PreToolUse, PostToolUse, UserPromptSubmit, SessionStart, SessionEnd, Stop. Check spelling and capitalization.",
|
|
202045
|
-
docLink: `${os$
|
|
202052
|
+
docLink: `${os$2}/hooks`
|
|
202046
202053
|
}
|
|
202047
202054
|
},
|
|
202048
202055
|
{
|
|
202049
202056
|
matches: (e) => /\.hooks\.\d+\.command$/.test(e.path) && e.code === "invalid_type" && e.received === "undefined",
|
|
202050
202057
|
tip: {
|
|
202051
202058
|
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\"}.",
|
|
202052
|
-
docLink: `${os$
|
|
202059
|
+
docLink: `${os$2}/hooks#exec-form-and-shell-form`
|
|
202053
202060
|
}
|
|
202054
202061
|
},
|
|
202055
202062
|
{
|
|
@@ -202064,7 +202071,7 @@ var os$1 = "https://code.claude.com/docs/en", kKe = [
|
|
|
202064
202071
|
matches: (e) => e.code === "unrecognized_keys",
|
|
202065
202072
|
tip: {
|
|
202066
202073
|
suggestion: "Check for typos or refer to the documentation for valid fields",
|
|
202067
|
-
docLink: `${os$
|
|
202074
|
+
docLink: `${os$2}/settings`
|
|
202068
202075
|
}
|
|
202069
202076
|
},
|
|
202070
202077
|
{
|
|
@@ -202079,13 +202086,13 @@ var os$1 = "https://code.claude.com/docs/en", kKe = [
|
|
|
202079
202086
|
matches: (e) => e.path === "permissions.additionalDirectories" && e.code === "invalid_type",
|
|
202080
202087
|
tip: {
|
|
202081
202088
|
suggestion: "Must be an array of directory paths. Example: [\"~/projects\", \"/tmp/workspace\"]. You can also use --add-dir flag or /add-dir command",
|
|
202082
|
-
docLink: `${os$
|
|
202089
|
+
docLink: `${os$2}/iam#working-directories`
|
|
202083
202090
|
}
|
|
202084
202091
|
}
|
|
202085
202092
|
], AKe = {
|
|
202086
|
-
permissions: `${os$
|
|
202087
|
-
env: `${os$
|
|
202088
|
-
hooks: `${os$
|
|
202093
|
+
permissions: `${os$2}/iam#configuring-permissions`,
|
|
202094
|
+
env: `${os$2}/settings#environment-variables`,
|
|
202095
|
+
hooks: `${os$2}/hooks`
|
|
202089
202096
|
};
|
|
202090
202097
|
function GZ(e) {
|
|
202091
202098
|
let t = kKe.find((r) => r.matches(e));
|
|
@@ -223029,6 +223036,9 @@ const makeTerminationError = (handle) => match$1(handle.exitCode, {
|
|
|
223029
223036
|
});
|
|
223030
223037
|
//#endregion
|
|
223031
223038
|
//#region ../../packages/effect-acp/src/client.ts
|
|
223039
|
+
function runNotificationHandlers(registration, notification) {
|
|
223040
|
+
return forEach(registration.handlers, (handler) => handler(notification).pipe(catch_(() => void_$1)), { discard: true });
|
|
223041
|
+
}
|
|
223032
223042
|
var AcpClient = class extends Service$1()("effect-acp/AcpClient") {};
|
|
223033
223043
|
const make$12 = fn$1("effect-acp/AcpClient.make")(function* (stdio, options = {}, terminationError) {
|
|
223034
223044
|
const coreHandlers = {};
|
|
@@ -223046,7 +223056,6 @@ const make$12 = fn$1("effect-acp/AcpClient.make")(function* (stdio, options = {}
|
|
|
223046
223056
|
const extNotificationHandlers = /* @__PURE__ */ new Map();
|
|
223047
223057
|
let unknownExtRequestHandler;
|
|
223048
223058
|
let unknownExtNotificationHandler;
|
|
223049
|
-
const runNotificationHandlers = (registration, notification) => forEach(registration.handlers, (handler) => handler(notification).pipe(catch_(() => void_$1)), { discard: true });
|
|
223050
223059
|
const flushBufferedNotifications = (registration) => suspend$1(() => {
|
|
223051
223060
|
if (registration.handlers.length === 0 || registration.pending.length === 0) return void_$1;
|
|
223052
223061
|
return forEach(registration.pending.splice(0, registration.pending.length), (notification) => runNotificationHandlers(registration, notification), { discard: true });
|
|
@@ -237256,6 +237265,34 @@ const CodexProviderLive = effect(CodexProvider, gen(function* () {
|
|
|
237256
237265
|
//#region src/git/Layers/CodexTextGeneration.ts
|
|
237257
237266
|
const CODEX_GIT_TEXT_GENERATION_REASONING_EFFORT = "low";
|
|
237258
237267
|
const CODEX_TIMEOUT_MS = 18e4;
|
|
237268
|
+
const readCodexStreamAsString = (operation, stream) => stream.pipe(decodeText$1(), runFold(() => "", (acc, chunk) => acc + chunk), mapError((cause) => normalizeCliError("codex", operation, cause, "Failed to collect process output")));
|
|
237269
|
+
function buildCodexExecArgs(input) {
|
|
237270
|
+
return [
|
|
237271
|
+
"exec",
|
|
237272
|
+
"--ephemeral",
|
|
237273
|
+
"--skip-git-repo-check",
|
|
237274
|
+
"-s",
|
|
237275
|
+
"read-only",
|
|
237276
|
+
"--model",
|
|
237277
|
+
input.model,
|
|
237278
|
+
"--config",
|
|
237279
|
+
`model_reasoning_effort="${input.reasoningEffort}"`,
|
|
237280
|
+
"--config",
|
|
237281
|
+
`project_doc_max_bytes=${CODEX_PROJECT_DOC_MAX_BYTES}`,
|
|
237282
|
+
...input.fastMode ? ["--config", `service_tier="fast"`] : [],
|
|
237283
|
+
"--output-schema",
|
|
237284
|
+
input.schemaPath,
|
|
237285
|
+
"--output-last-message",
|
|
237286
|
+
input.outputPath,
|
|
237287
|
+
"--json",
|
|
237288
|
+
...input.imagePaths.flatMap((imagePath) => ["--image", imagePath]),
|
|
237289
|
+
"-"
|
|
237290
|
+
];
|
|
237291
|
+
}
|
|
237292
|
+
function resolveCodexAccessMode(configuredAccessMode) {
|
|
237293
|
+
const accessMode = clampWorkspaceAccessMode(configuredAccessMode);
|
|
237294
|
+
return accessMode === "personal" && personalCodexServedByControlPlane() ? "workspace" : accessMode;
|
|
237295
|
+
}
|
|
237259
237296
|
/**
|
|
237260
237297
|
* Byte budget Codex spends on `AGENTS.md` when it builds project instructions.
|
|
237261
237298
|
* The Codex config reference defines `project_doc_max_bytes` as "Maximum bytes
|
|
@@ -237277,7 +237314,6 @@ const CodexTextGenerationLive = effect(TextGeneration, gen(function* () {
|
|
|
237277
237314
|
const serverConfig = yield* service(ServerConfig);
|
|
237278
237315
|
const serverSettingsService = yield* service(ServerSettingsService);
|
|
237279
237316
|
const textGenerationUsage = yield* service(TextGenerationUsage);
|
|
237280
|
-
const readStreamAsString = (operation, stream) => stream.pipe(decodeText$1(), runFold(() => "", (acc, chunk) => acc + chunk), mapError((cause) => normalizeCliError("codex", operation, cause, "Failed to collect process output")));
|
|
237281
237317
|
const writeTempFile = (operation, prefix, content) => {
|
|
237282
237318
|
return fileSystem.makeTempFileScoped({ prefix: `forge-${prefix}-${process.pid}-${randomUUID()}.tmp` }).pipe(tap((filePath) => fileSystem.writeFileString(filePath, content)), mapError((cause) => new TextGenerationError({
|
|
237283
237319
|
operation,
|
|
@@ -237365,39 +237401,47 @@ const CodexTextGenerationLive = effect(TextGeneration, gen(function* () {
|
|
|
237365
237401
|
const outputPath = yield* writeTempFile(operation, "codex-output", "");
|
|
237366
237402
|
const workingDirectory = yield* makeNeutralWorkingDirectory(operation);
|
|
237367
237403
|
const codexSettings = yield* map$3(serverSettingsService.getSettings, (settings) => settings.providers.codex).pipe(catch_(() => undefined_));
|
|
237368
|
-
const
|
|
237404
|
+
const launchCodexCommand = (command) => gen(function* () {
|
|
237405
|
+
const child = yield* commandSpawner.spawn(command).pipe(mapError((cause) => normalizeCliError("codex", operation, cause, "Failed to spawn Codex CLI process")));
|
|
237406
|
+
const [stdout, stderr, exitCode] = yield* all([
|
|
237407
|
+
readCodexStreamAsString(operation, child.stdout),
|
|
237408
|
+
readCodexStreamAsString(operation, child.stderr),
|
|
237409
|
+
child.exitCode.pipe(mapError((cause) => normalizeCliError("codex", operation, cause, "Failed to read Codex CLI exit code")))
|
|
237410
|
+
], { concurrency: "unbounded" });
|
|
237411
|
+
if (exitCode === 0) return stdout;
|
|
237412
|
+
const detail = stderr.trim() || stdout.trim();
|
|
237413
|
+
return yield* new TextGenerationError({
|
|
237414
|
+
operation,
|
|
237415
|
+
detail: detail.length > 0 ? `Codex CLI command failed: ${detail}` : `Codex CLI command failed with code ${exitCode}.`
|
|
237416
|
+
});
|
|
237417
|
+
});
|
|
237418
|
+
const resolveCodexCommandTarget = fn$1("runCodexJson.resolveCommandTarget")(function* () {
|
|
237369
237419
|
const normalizedOptions = normalizeCodexModelOptionsWithCapabilities(getCodexModelCapabilities(modelSelection.model), modelSelection.options);
|
|
237370
237420
|
const reasoningEffort = modelSelection.options?.reasoningEffort ?? CODEX_GIT_TEXT_GENERATION_REASONING_EFFORT;
|
|
237371
|
-
const
|
|
237372
|
-
|
|
237373
|
-
|
|
237374
|
-
|
|
237421
|
+
const accessMode = resolveCodexAccessMode(codexSettings?.accessMode ?? "workspace");
|
|
237422
|
+
return {
|
|
237423
|
+
normalizedOptions,
|
|
237424
|
+
reasoningEffort,
|
|
237375
237425
|
accessMode,
|
|
237426
|
+
providerProxyToken: yield* resolveCodexProviderProxyToken({
|
|
237427
|
+
operation,
|
|
237428
|
+
accessMode,
|
|
237429
|
+
model: modelSelection.model,
|
|
237430
|
+
...threadId ? { threadId } : {},
|
|
237431
|
+
authSessionId
|
|
237432
|
+
})
|
|
237433
|
+
};
|
|
237434
|
+
});
|
|
237435
|
+
const runCodexCommand = fn$1("runCodexJson.runCodexCommand")(function* () {
|
|
237436
|
+
const { normalizedOptions, reasoningEffort, accessMode, providerProxyToken } = yield* resolveCodexCommandTarget();
|
|
237437
|
+
return yield* launchCodexCommand(make$48(codexSettings?.binaryPath || "codex", buildCodexExecArgs({
|
|
237376
237438
|
model: modelSelection.model,
|
|
237377
|
-
|
|
237378
|
-
|
|
237379
|
-
});
|
|
237380
|
-
const command = make$48(codexSettings?.binaryPath || "codex", [
|
|
237381
|
-
"exec",
|
|
237382
|
-
"--ephemeral",
|
|
237383
|
-
"--skip-git-repo-check",
|
|
237384
|
-
"-s",
|
|
237385
|
-
"read-only",
|
|
237386
|
-
"--model",
|
|
237387
|
-
modelSelection.model,
|
|
237388
|
-
"--config",
|
|
237389
|
-
`model_reasoning_effort="${reasoningEffort}"`,
|
|
237390
|
-
"--config",
|
|
237391
|
-
`project_doc_max_bytes=${CODEX_PROJECT_DOC_MAX_BYTES}`,
|
|
237392
|
-
...normalizedOptions?.fastMode ? ["--config", `service_tier="fast"`] : [],
|
|
237393
|
-
"--output-schema",
|
|
237439
|
+
reasoningEffort,
|
|
237440
|
+
fastMode: normalizedOptions?.fastMode,
|
|
237394
237441
|
schemaPath,
|
|
237395
|
-
"--output-last-message",
|
|
237396
237442
|
outputPath,
|
|
237397
|
-
|
|
237398
|
-
|
|
237399
|
-
"-"
|
|
237400
|
-
], {
|
|
237443
|
+
imagePaths
|
|
237444
|
+
}), {
|
|
237401
237445
|
env: scrubForgeProviderChildEnvSecrets(buildCodexProcessEnv({
|
|
237402
237446
|
baseEnv: process.env,
|
|
237403
237447
|
accessMode,
|
|
@@ -237410,23 +237454,7 @@ const CodexTextGenerationLive = effect(TextGeneration, gen(function* () {
|
|
|
237410
237454
|
cwd: workingDirectory,
|
|
237411
237455
|
shell: process.platform === "win32",
|
|
237412
237456
|
stdin: { stream: encodeText(make$43(prompt)) }
|
|
237413
|
-
});
|
|
237414
|
-
const child = yield* commandSpawner.spawn(command).pipe(mapError((cause) => normalizeCliError("codex", operation, cause, "Failed to spawn Codex CLI process")));
|
|
237415
|
-
const [stdout, stderr, exitCode] = yield* all([
|
|
237416
|
-
readStreamAsString(operation, child.stdout),
|
|
237417
|
-
readStreamAsString(operation, child.stderr),
|
|
237418
|
-
child.exitCode.pipe(mapError((cause) => normalizeCliError("codex", operation, cause, "Failed to read Codex CLI exit code")))
|
|
237419
|
-
], { concurrency: "unbounded" });
|
|
237420
|
-
if (exitCode !== 0) {
|
|
237421
|
-
const stderrDetail = stderr.trim();
|
|
237422
|
-
const stdoutDetail = stdout.trim();
|
|
237423
|
-
const detail = stderrDetail.length > 0 ? stderrDetail : stdoutDetail;
|
|
237424
|
-
return yield* new TextGenerationError({
|
|
237425
|
-
operation,
|
|
237426
|
-
detail: detail.length > 0 ? `Codex CLI command failed: ${detail}` : `Codex CLI command failed with code ${exitCode}.`
|
|
237427
|
-
});
|
|
237428
|
-
}
|
|
237429
|
-
return stdout;
|
|
237457
|
+
}));
|
|
237430
237458
|
});
|
|
237431
237459
|
const cleanup = all([...[
|
|
237432
237460
|
schemaPath,
|
|
@@ -237565,6 +237593,7 @@ const CodexTextGenerationLive = effect(TextGeneration, gen(function* () {
|
|
|
237565
237593
|
* @module ClaudeTextGeneration
|
|
237566
237594
|
*/
|
|
237567
237595
|
const CLAUDE_TIMEOUT_MS = 18e4;
|
|
237596
|
+
const readClaudeStreamAsString = (operation, stream) => stream.pipe(decodeText$1(), runFold(() => "", (acc, chunk) => acc + chunk), mapError((cause) => normalizeCliError("claude", operation, cause, "Failed to collect process output")));
|
|
237568
237597
|
/**
|
|
237569
237598
|
* Schema for the wrapper JSON returned by `claude -p --output-format json`.
|
|
237570
237599
|
* We only care about `structured_output`.
|
|
@@ -237600,7 +237629,6 @@ const ClaudeTextGenerationLive = effect(TextGeneration, gen(function* () {
|
|
|
237600
237629
|
...report.providerSessionId ? { providerSessionId: report.providerSessionId } : {}
|
|
237601
237630
|
});
|
|
237602
237631
|
});
|
|
237603
|
-
const readStreamAsString = (operation, stream) => stream.pipe(decodeText$1(), runFold(() => "", (acc, chunk) => acc + chunk), mapError((cause) => normalizeCliError("claude", operation, cause, "Failed to collect process output")));
|
|
237604
237632
|
/**
|
|
237605
237633
|
* Spawn the Claude CLI with structured JSON output and return the parsed,
|
|
237606
237634
|
* schema-validated result.
|
|
@@ -237633,8 +237661,8 @@ const ClaudeTextGenerationLive = effect(TextGeneration, gen(function* () {
|
|
|
237633
237661
|
});
|
|
237634
237662
|
const child = yield* commandSpawner.spawn(command).pipe(mapError((cause) => normalizeCliError("claude", operation, cause, "Failed to spawn Claude CLI process")));
|
|
237635
237663
|
const [stdout, stderr, exitCode] = yield* all([
|
|
237636
|
-
|
|
237637
|
-
|
|
237664
|
+
readClaudeStreamAsString(operation, child.stdout),
|
|
237665
|
+
readClaudeStreamAsString(operation, child.stderr),
|
|
237638
237666
|
child.exitCode.pipe(mapError((cause) => normalizeCliError("claude", operation, cause, "Failed to read Claude CLI exit code")))
|
|
237639
237667
|
], { concurrency: "unbounded" });
|
|
237640
237668
|
if (exitCode !== 0) {
|
|
@@ -238029,6 +238057,21 @@ var TerminalProcessSignalError = class extends TaggedErrorClass()("TerminalProce
|
|
|
238029
238057
|
cause: optional$4(Defect),
|
|
238030
238058
|
signal: Literals(["SIGTERM", "SIGKILL"])
|
|
238031
238059
|
}) {};
|
|
238060
|
+
function toTerminalHistoryError(operation, threadId, terminalId) {
|
|
238061
|
+
return (cause) => new TerminalHistoryError({
|
|
238062
|
+
operation,
|
|
238063
|
+
threadId,
|
|
238064
|
+
terminalId,
|
|
238065
|
+
cause
|
|
238066
|
+
});
|
|
238067
|
+
}
|
|
238068
|
+
function requireRunningProcess(session) {
|
|
238069
|
+
if (session.process && session.status === "running") return succeed(session.process);
|
|
238070
|
+
return fail(new TerminalNotRunningError({
|
|
238071
|
+
threadId: session.threadId,
|
|
238072
|
+
terminalId: session.terminalId
|
|
238073
|
+
}));
|
|
238074
|
+
}
|
|
238032
238075
|
const MAX_TERMINAL_CONTROL_RECEIPTS = 256;
|
|
238033
238076
|
function terminalControlPayloadHash(method, payload) {
|
|
238034
238077
|
return createHash("sha256").update(method).update("\0").update(payload).digest("base64url");
|
|
@@ -238473,12 +238516,6 @@ const makeTerminalManagerWithOptions = fn$1("makeTerminalManagerWithOptions")(fu
|
|
|
238473
238516
|
return path.join(logsDir, `${threadPart}_${toSafeTerminalId(terminalId)}.log`);
|
|
238474
238517
|
};
|
|
238475
238518
|
const legacyHistoryPath = (threadId) => path.join(logsDir, `${legacySafeThreadId(threadId)}.log`);
|
|
238476
|
-
const toTerminalHistoryError = (operation, threadId, terminalId) => (cause) => new TerminalHistoryError({
|
|
238477
|
-
operation,
|
|
238478
|
-
threadId,
|
|
238479
|
-
terminalId,
|
|
238480
|
-
cause
|
|
238481
|
-
});
|
|
238482
238519
|
const readManagerState = get$2(managerStateRef);
|
|
238483
238520
|
const modifyManagerState = (f) => modify$2(managerStateRef, f);
|
|
238484
238521
|
const getThreadSemaphore = (threadId) => modifyEffect(threadLocksRef, (current) => {
|
|
@@ -239135,13 +239172,6 @@ const makeTerminalManagerWithOptions = fn$1("makeTerminalManagerWithOptions")(fu
|
|
|
239135
239172
|
transitionReceipts.delete(oldest);
|
|
239136
239173
|
}
|
|
239137
239174
|
};
|
|
239138
|
-
const requireRunningProcess = (session) => {
|
|
239139
|
-
if (session.process && session.status === "running") return succeed(session.process);
|
|
239140
|
-
return fail(new TerminalNotRunningError({
|
|
239141
|
-
threadId: session.threadId,
|
|
239142
|
-
terminalId: session.terminalId
|
|
239143
|
-
}));
|
|
239144
|
-
};
|
|
239145
239175
|
const write = fn$1("terminal.write")(function* (input) {
|
|
239146
239176
|
const terminalId = input.terminalId ?? "default";
|
|
239147
239177
|
const session = yield* requireSession(input.threadId, terminalId);
|
|
@@ -241788,6 +241818,9 @@ const HOST_COMMAND_MAPPERS = {
|
|
|
241788
241818
|
...command.x !== void 0 ? { x: command.x } : {},
|
|
241789
241819
|
...command.y !== void 0 ? { y: command.y } : {}
|
|
241790
241820
|
}),
|
|
241821
|
+
setAudioMuted: () => {
|
|
241822
|
+
throw new Error("setAudioMuted is only supported over the desktop native browser bridge.");
|
|
241823
|
+
},
|
|
241791
241824
|
setViewport: (command) => ({
|
|
241792
241825
|
type: "setViewport",
|
|
241793
241826
|
viewport: command.viewport
|
|
@@ -270288,7 +270321,7 @@ var import_multicast_dns = /* @__PURE__ */ __toESM((/* @__PURE__ */ __commonJSMi
|
|
|
270288
270321
|
var dgram = __require("dgram");
|
|
270289
270322
|
var thunky = require_thunky();
|
|
270290
270323
|
var events = __require("events");
|
|
270291
|
-
var os = __require("os");
|
|
270324
|
+
var os$1 = __require("os");
|
|
270292
270325
|
var noop = function() {};
|
|
270293
270326
|
module.exports = function(opts) {
|
|
270294
270327
|
if (!opts) opts = {};
|
|
@@ -270419,14 +270452,14 @@ var import_multicast_dns = /* @__PURE__ */ __toESM((/* @__PURE__ */ __commonJSMi
|
|
|
270419
270452
|
return that;
|
|
270420
270453
|
};
|
|
270421
270454
|
function defaultInterface() {
|
|
270422
|
-
var networks = os.networkInterfaces();
|
|
270455
|
+
var networks = os$1.networkInterfaces();
|
|
270423
270456
|
var names = Object.keys(networks);
|
|
270424
270457
|
for (var i = 0; i < names.length; i++) {
|
|
270425
270458
|
var net = networks[names[i]];
|
|
270426
270459
|
for (var j = 0; j < net.length; j++) {
|
|
270427
270460
|
var iface = net[j];
|
|
270428
270461
|
if (isIPv4(iface.family) && !iface.internal) {
|
|
270429
|
-
if (os.platform() === "darwin" && names[i] === "en0") return iface.address;
|
|
270462
|
+
if (os$1.platform() === "darwin" && names[i] === "en0") return iface.address;
|
|
270430
270463
|
return "0.0.0.0";
|
|
270431
270464
|
}
|
|
270432
270465
|
}
|
|
@@ -270434,7 +270467,7 @@ var import_multicast_dns = /* @__PURE__ */ __toESM((/* @__PURE__ */ __commonJSMi
|
|
|
270434
270467
|
return "127.0.0.1";
|
|
270435
270468
|
}
|
|
270436
270469
|
function allInterfaces() {
|
|
270437
|
-
var networks = os.networkInterfaces();
|
|
270470
|
+
var networks = os$1.networkInterfaces();
|
|
270438
270471
|
var names = Object.keys(networks);
|
|
270439
270472
|
var res = [];
|
|
270440
270473
|
for (var i = 0; i < names.length; i++) {
|
|
@@ -292078,7 +292111,7 @@ function mapProviderSessionStatusToOrchestrationStatus(status) {
|
|
|
292078
292111
|
}
|
|
292079
292112
|
}
|
|
292080
292113
|
const turnStartKeyForEvent = (event) => event.commandId !== null ? `command:${event.commandId}` : `event:${event.eventId}`;
|
|
292081
|
-
const serverCommandId$
|
|
292114
|
+
const serverCommandId$2 = (tag) => CommandId.make(`server:${tag}:${crypto.randomUUID()}`);
|
|
292082
292115
|
const HANDLED_TURN_START_KEY_MAX = 1e4;
|
|
292083
292116
|
const HANDLED_TURN_START_KEY_TTL = minutes(30);
|
|
292084
292117
|
const DEFAULT_RUNTIME_MODE = "full-access";
|
|
@@ -292500,7 +292533,7 @@ const ProviderCommandReactorLive = effect(ProviderCommandReactor, gen(function*
|
|
|
292500
292533
|
const threadSessionAccountIds = /* @__PURE__ */ new Map();
|
|
292501
292534
|
const appendProviderFailureActivity = (input) => orchestrationEngine.dispatch({
|
|
292502
292535
|
type: "thread.activity.append",
|
|
292503
|
-
commandId: serverCommandId$
|
|
292536
|
+
commandId: serverCommandId$2("provider-failure-activity"),
|
|
292504
292537
|
threadId: input.threadId,
|
|
292505
292538
|
activity: {
|
|
292506
292539
|
id: EventId.make(crypto.randomUUID()),
|
|
@@ -292518,7 +292551,7 @@ const ProviderCommandReactorLive = effect(ProviderCommandReactor, gen(function*
|
|
|
292518
292551
|
});
|
|
292519
292552
|
const setThreadSession = (input) => orchestrationEngine.dispatch({
|
|
292520
292553
|
type: "thread.session.set",
|
|
292521
|
-
commandId: serverCommandId$
|
|
292554
|
+
commandId: serverCommandId$2("provider-session-set"),
|
|
292522
292555
|
threadId: input.threadId,
|
|
292523
292556
|
session: input.session,
|
|
292524
292557
|
createdAt: input.createdAt
|
|
@@ -292801,7 +292834,7 @@ const ProviderCommandReactorLive = effect(ProviderCommandReactor, gen(function*
|
|
|
292801
292834
|
});
|
|
292802
292835
|
yield* orchestrationEngine.dispatch({
|
|
292803
292836
|
type: "thread.meta.update",
|
|
292804
|
-
commandId: serverCommandId$
|
|
292837
|
+
commandId: serverCommandId$2("worktree-branch-rename"),
|
|
292805
292838
|
threadId: input.threadId,
|
|
292806
292839
|
branch: renamed.branch,
|
|
292807
292840
|
worktreePath: cwd
|
|
@@ -292840,7 +292873,7 @@ const ProviderCommandReactorLive = effect(ProviderCommandReactor, gen(function*
|
|
|
292840
292873
|
if (!canReplaceThreadTitle(thread.title, input.titleSeed)) return;
|
|
292841
292874
|
yield* orchestrationEngine.dispatch({
|
|
292842
292875
|
type: "thread.meta.update",
|
|
292843
|
-
commandId: serverCommandId$
|
|
292876
|
+
commandId: serverCommandId$2("thread-title-rename"),
|
|
292844
292877
|
threadId: input.threadId,
|
|
292845
292878
|
title: generated.title
|
|
292846
292879
|
});
|
|
@@ -292903,7 +292936,7 @@ const ProviderCommandReactorLive = effect(ProviderCommandReactor, gen(function*
|
|
|
292903
292936
|
const dispatchThreadTitleRegenerationCompletion = fn$1("dispatchThreadTitleRegenerationCompletion")(function* (input) {
|
|
292904
292937
|
yield* orchestrationEngine.dispatch({
|
|
292905
292938
|
type: "thread.title.regeneration.complete",
|
|
292906
|
-
commandId: serverCommandId$
|
|
292939
|
+
commandId: serverCommandId$2("thread-title-regeneration-complete"),
|
|
292907
292940
|
threadId: input.threadId,
|
|
292908
292941
|
requestId: input.requestId,
|
|
292909
292942
|
...input.title !== void 0 ? { title: input.title } : {}
|
|
@@ -293211,7 +293244,7 @@ const ProviderCommandReactorLive = effect(ProviderCommandReactor, gen(function*
|
|
|
293211
293244
|
});
|
|
293212
293245
|
const appendRecoverableTurnStartTimeout = (event) => orchestrationEngine.dispatch({
|
|
293213
293246
|
type: "thread.activity.append",
|
|
293214
|
-
commandId: serverCommandId$
|
|
293247
|
+
commandId: serverCommandId$2("provider-turn-start-timeout"),
|
|
293215
293248
|
threadId: event.payload.threadId,
|
|
293216
293249
|
activity: {
|
|
293217
293250
|
id: EventId.make(crypto.randomUUID()),
|
|
@@ -294044,7 +294077,13 @@ function isGitOutputLimitError(error) {
|
|
|
294044
294077
|
const text = `${"detail" in error && typeof error.detail === "string" ? error.detail : ""}\n${"message" in error && typeof error.message === "string" ? error.message : ""}`;
|
|
294045
294078
|
return text.includes("output exceeded") && text.includes("bytes and was truncated");
|
|
294046
294079
|
}
|
|
294047
|
-
const serverCommandId = (tag) => CommandId.make(`server:${tag}:${crypto.randomUUID()}`);
|
|
294080
|
+
const serverCommandId$1 = (tag) => CommandId.make(`server:${tag}:${crypto.randomUUID()}`);
|
|
294081
|
+
function findSessionWithCwd(session) {
|
|
294082
|
+
return session?.cwd ? some({
|
|
294083
|
+
threadId: session.threadId,
|
|
294084
|
+
cwd: session.cwd
|
|
294085
|
+
}) : none$4();
|
|
294086
|
+
}
|
|
294048
294087
|
const CheckpointReactorLive = effect(CheckpointReactor, gen(function* () {
|
|
294049
294088
|
const orchestrationEngine = yield* OrchestrationEngineService;
|
|
294050
294089
|
const providerService = yield* ProviderService;
|
|
@@ -294054,7 +294093,7 @@ const CheckpointReactorLive = effect(CheckpointReactor, gen(function* () {
|
|
|
294054
294093
|
const gitStatusBroadcaster = yield* GitStatusBroadcaster;
|
|
294055
294094
|
const appendRevertFailureActivity = (input) => orchestrationEngine.dispatch({
|
|
294056
294095
|
type: "thread.activity.append",
|
|
294057
|
-
commandId: serverCommandId("checkpoint-revert-failure"),
|
|
294096
|
+
commandId: serverCommandId$1("checkpoint-revert-failure"),
|
|
294058
294097
|
threadId: input.threadId,
|
|
294059
294098
|
activity: {
|
|
294060
294099
|
id: EventId.make(crypto.randomUUID()),
|
|
@@ -294072,7 +294111,7 @@ const CheckpointReactorLive = effect(CheckpointReactor, gen(function* () {
|
|
|
294072
294111
|
});
|
|
294073
294112
|
const appendCaptureFailureActivity = (input) => orchestrationEngine.dispatch({
|
|
294074
294113
|
type: "thread.activity.append",
|
|
294075
|
-
commandId: serverCommandId("checkpoint-capture-failure"),
|
|
294114
|
+
commandId: serverCommandId$1("checkpoint-capture-failure"),
|
|
294076
294115
|
threadId: input.threadId,
|
|
294077
294116
|
activity: {
|
|
294078
294117
|
id: EventId.make(crypto.randomUUID()),
|
|
@@ -294090,7 +294129,7 @@ const CheckpointReactorLive = effect(CheckpointReactor, gen(function* () {
|
|
|
294090
294129
|
});
|
|
294091
294130
|
const appendDiffSummarySkippedActivity = (input) => orchestrationEngine.dispatch({
|
|
294092
294131
|
type: "thread.activity.append",
|
|
294093
|
-
commandId: serverCommandId("checkpoint-diff-summary-skipped"),
|
|
294132
|
+
commandId: serverCommandId$1("checkpoint-diff-summary-skipped"),
|
|
294094
294133
|
threadId: input.threadId,
|
|
294095
294134
|
activity: {
|
|
294096
294135
|
id: EventId.make(crypto.randomUUID()),
|
|
@@ -294106,20 +294145,12 @@ const CheckpointReactorLive = effect(CheckpointReactor, gen(function* () {
|
|
|
294106
294145
|
const resolveSessionRuntimeForThread = fn$1("resolveSessionRuntimeForThread")(function* (threadId) {
|
|
294107
294146
|
const thread = (yield* orchestrationEngine.getReadModel()).threads.find((entry) => entry.id === threadId);
|
|
294108
294147
|
const sessions = yield* providerService.listSessions();
|
|
294109
|
-
const findSessionWithCwd = (session) => {
|
|
294110
|
-
if (!session?.cwd) return none$4();
|
|
294111
|
-
return some({
|
|
294112
|
-
threadId: session.threadId,
|
|
294113
|
-
cwd: session.cwd
|
|
294114
|
-
});
|
|
294115
|
-
};
|
|
294116
294148
|
if (thread) {
|
|
294117
294149
|
const fromProjected = findSessionWithCwd(sessions.find((session) => session.threadId === thread.id));
|
|
294118
294150
|
if (isSome(fromProjected)) return fromProjected;
|
|
294119
294151
|
}
|
|
294120
294152
|
return none$4();
|
|
294121
294153
|
});
|
|
294122
|
-
const isGitWorkspace = (cwd) => isGitRepository(cwd);
|
|
294123
294154
|
const resolveCheckpointCwd = fn$1("resolveCheckpointCwd")(function* (input) {
|
|
294124
294155
|
const fromSession = yield* resolveSessionRuntimeForThread(input.threadId);
|
|
294125
294156
|
const fromThread = resolveThreadWorkspaceCwd({
|
|
@@ -294134,7 +294165,7 @@ const CheckpointReactorLive = effect(CheckpointReactor, gen(function* () {
|
|
|
294134
294165
|
onSome: (runtime) => runtime.cwd
|
|
294135
294166
|
});
|
|
294136
294167
|
if (!cwd) return;
|
|
294137
|
-
if (!
|
|
294168
|
+
if (!isGitRepository(cwd)) return;
|
|
294138
294169
|
return cwd;
|
|
294139
294170
|
});
|
|
294140
294171
|
const captureAndDispatchCheckpoint = fn$1("captureAndDispatchCheckpoint")(function* (input) {
|
|
@@ -294194,7 +294225,7 @@ const CheckpointReactorLive = effect(CheckpointReactor, gen(function* () {
|
|
|
294194
294225
|
const assistantMessageId = input.assistantMessageId ?? input.thread.messages.toReversed().find((entry) => entry.role === "assistant" && entry.turnId === input.turnId)?.id ?? MessageId.make(`assistant:${input.turnId}`);
|
|
294195
294226
|
yield* orchestrationEngine.dispatch({
|
|
294196
294227
|
type: "thread.turn.diff.complete",
|
|
294197
|
-
commandId: serverCommandId("checkpoint-turn-diff-complete"),
|
|
294228
|
+
commandId: serverCommandId$1("checkpoint-turn-diff-complete"),
|
|
294198
294229
|
threadId: input.threadId,
|
|
294199
294230
|
turnId: input.turnId,
|
|
294200
294231
|
completedAt: input.createdAt,
|
|
@@ -294223,7 +294254,7 @@ const CheckpointReactorLive = effect(CheckpointReactor, gen(function* () {
|
|
|
294223
294254
|
});
|
|
294224
294255
|
yield* orchestrationEngine.dispatch({
|
|
294225
294256
|
type: "thread.activity.append",
|
|
294226
|
-
commandId: serverCommandId("checkpoint-captured-activity"),
|
|
294257
|
+
commandId: serverCommandId$1("checkpoint-captured-activity"),
|
|
294227
294258
|
threadId: input.threadId,
|
|
294228
294259
|
activity: {
|
|
294229
294260
|
id: EventId.make(crypto.randomUUID()),
|
|
@@ -294405,7 +294436,7 @@ const CheckpointReactorLive = effect(CheckpointReactor, gen(function* () {
|
|
|
294405
294436
|
}).pipe(catch_(() => void_$1));
|
|
294406
294437
|
return;
|
|
294407
294438
|
}
|
|
294408
|
-
if (!
|
|
294439
|
+
if (!isGitRepository(sessionRuntime.value.cwd)) {
|
|
294409
294440
|
yield* appendRevertFailureActivity({
|
|
294410
294441
|
threadId: event.payload.threadId,
|
|
294411
294442
|
turnCount: event.payload.turnCount,
|
|
@@ -294461,7 +294492,7 @@ const CheckpointReactorLive = effect(CheckpointReactor, gen(function* () {
|
|
|
294461
294492
|
});
|
|
294462
294493
|
yield* orchestrationEngine.dispatch({
|
|
294463
294494
|
type: "thread.revert.complete",
|
|
294464
|
-
commandId: serverCommandId("checkpoint-revert-complete"),
|
|
294495
|
+
commandId: serverCommandId$1("checkpoint-revert-complete"),
|
|
294465
294496
|
threadId: event.payload.threadId,
|
|
294466
294497
|
turnCount: event.payload.turnCount,
|
|
294467
294498
|
createdAt: now
|
|
@@ -298768,7 +298799,7 @@ function resolveBuildCommitFromEnv(env) {
|
|
|
298768
298799
|
* environment descriptor down instead of reporting an honest "unknown".
|
|
298769
298800
|
*/
|
|
298770
298801
|
function readBakedBuildCommit() {
|
|
298771
|
-
return "
|
|
298802
|
+
return "c9cd5df237295bb4b5d502b6d379c1b9cbd1bf8f";
|
|
298772
298803
|
}
|
|
298773
298804
|
async function resolveServerBuildCommit(input) {
|
|
298774
298805
|
if (isFullCommitSha(input.baked)) return input.baked;
|
|
@@ -300154,6 +300185,15 @@ var AuthPairingLinkRepository = class extends Service$1()("forge/persistence/Ser
|
|
|
300154
300185
|
function toPersistenceSqlOrDecodeError$4(sqlOperation, decodeOperation) {
|
|
300155
300186
|
return (cause) => isSchemaError(cause) ? toPersistenceDecodeError(decodeOperation)(cause) : toPersistenceSqlError(sqlOperation)(cause);
|
|
300156
300187
|
}
|
|
300188
|
+
function decodeCredential(row) {
|
|
300189
|
+
return try_({
|
|
300190
|
+
try: () => ({
|
|
300191
|
+
...row,
|
|
300192
|
+
credential: decodeSensitiveValue("auth-pairing-link", row.credential)
|
|
300193
|
+
}),
|
|
300194
|
+
catch: toPersistenceDecodeDefect("AuthPairingLinkRepository.decryptCredential")
|
|
300195
|
+
});
|
|
300196
|
+
}
|
|
300157
300197
|
const AuthPairingLinkRepositoryLive = effect(AuthPairingLinkRepository, gen(function* () {
|
|
300158
300198
|
const sql = yield* SqlClient;
|
|
300159
300199
|
const StoredCreateAuthPairingLinkInput = Struct({
|
|
@@ -300275,13 +300315,6 @@ const AuthPairingLinkRepositoryLive = effect(AuthPairingLinkRepository, gen(func
|
|
|
300275
300315
|
WHERE credential_lookup = ${credentialLookup}
|
|
300276
300316
|
`
|
|
300277
300317
|
});
|
|
300278
|
-
const decodeCredential = (row) => try_({
|
|
300279
|
-
try: () => ({
|
|
300280
|
-
...row,
|
|
300281
|
-
credential: decodeSensitiveValue("auth-pairing-link", row.credential)
|
|
300282
|
-
}),
|
|
300283
|
-
catch: toPersistenceDecodeDefect("AuthPairingLinkRepository.decryptCredential")
|
|
300284
|
-
});
|
|
300285
300318
|
const create = (input) => createPairingLinkRow({
|
|
300286
300319
|
...input,
|
|
300287
300320
|
credential: encodeSensitiveValue("auth-pairing-link", input.credential),
|
|
@@ -313137,14 +313170,8 @@ function buildRuntimeUsageRowBatch(rows, cursor, batchSize = 500) {
|
|
|
313137
313170
|
previousHeadHash: cursor.headHash,
|
|
313138
313171
|
rows: capped.map((row, index) => {
|
|
313139
313172
|
const sequence = cursor.acknowledgedSequence + 1 + index;
|
|
313140
|
-
|
|
313141
|
-
|
|
313142
|
-
sequence,
|
|
313143
|
-
payloadHash: hashRuntimeUsageRow({
|
|
313144
|
-
...row,
|
|
313145
|
-
sequence
|
|
313146
|
-
})
|
|
313147
|
-
};
|
|
313173
|
+
const sequencedRow = Object.assign({}, row, { sequence });
|
|
313174
|
+
return Object.assign(sequencedRow, { payloadHash: hashRuntimeUsageRow(sequencedRow) });
|
|
313148
313175
|
})
|
|
313149
313176
|
};
|
|
313150
313177
|
}
|
|
@@ -315635,6 +315662,23 @@ const EXECUTABLE_STAGES = [
|
|
|
315635
315662
|
];
|
|
315636
315663
|
const encoder = new TextEncoder();
|
|
315637
315664
|
const decoder = new TextDecoder();
|
|
315665
|
+
function decodePersistedReport(item) {
|
|
315666
|
+
let value;
|
|
315667
|
+
try {
|
|
315668
|
+
value = JSON.parse(item.payloadJson);
|
|
315669
|
+
} catch {
|
|
315670
|
+
return null;
|
|
315671
|
+
}
|
|
315672
|
+
if (value === null || typeof value !== "object" || Array.isArray(value)) return null;
|
|
315673
|
+
const report = value;
|
|
315674
|
+
return [
|
|
315675
|
+
report.stage === item.stage,
|
|
315676
|
+
Number.isSafeInteger(report.attempt),
|
|
315677
|
+
(report.attempt ?? 0) > 0,
|
|
315678
|
+
Number.isSafeInteger(report.expectedLockVersion),
|
|
315679
|
+
(report.expectedLockVersion ?? -1) >= 0
|
|
315680
|
+
].every(Boolean) ? report : null;
|
|
315681
|
+
}
|
|
315638
315682
|
function isRecord$2(value) {
|
|
315639
315683
|
return Boolean(value) && typeof value === "object" && !Array.isArray(value);
|
|
315640
315684
|
}
|
|
@@ -317076,23 +317120,6 @@ const PipelineRunCoordinatorLive = effect(PipelineRunCoordinator, gen(function*
|
|
|
317076
317120
|
})).applied) return yield* coordinatorError("reconcileTerminalHandoff", "PIPELINE_RECONCILE_CONFLICT", "The pipeline binding changed before its terminal state could be reconciled.");
|
|
317077
317121
|
yield* finalizeTerminalResources(binding, publicationGeneration);
|
|
317078
317122
|
}).pipe(mapError((cause) => cause instanceof PipelineRunCoordinatorError ? cause : coordinatorError("reconcileTerminalHandoff", "PIPELINE_RECONCILE_FAILED", `Failed to reconcile terminal CMMD run ${input.runId}.`, cause)));
|
|
317079
|
-
const decodePersistedReport = (item) => {
|
|
317080
|
-
let value;
|
|
317081
|
-
try {
|
|
317082
|
-
value = JSON.parse(item.payloadJson);
|
|
317083
|
-
} catch {
|
|
317084
|
-
return null;
|
|
317085
|
-
}
|
|
317086
|
-
if (value === null || typeof value !== "object" || Array.isArray(value)) return null;
|
|
317087
|
-
const report = value;
|
|
317088
|
-
return [
|
|
317089
|
-
report.stage === item.stage,
|
|
317090
|
-
Number.isSafeInteger(report.attempt),
|
|
317091
|
-
(report.attempt ?? 0) > 0,
|
|
317092
|
-
Number.isSafeInteger(report.expectedLockVersion),
|
|
317093
|
-
(report.expectedLockVersion ?? -1) >= 0
|
|
317094
|
-
].every(Boolean) ? report : null;
|
|
317095
|
-
};
|
|
317096
317123
|
const synchronizeNonAppliedReport = (item, binding, authority, reportEpoch, currentEpoch) => gen(function* () {
|
|
317097
317124
|
const snapshot = yield* client.read({
|
|
317098
317125
|
runId: item.runId,
|
|
@@ -321016,6 +321043,9 @@ function requireMergeValue(value, message) {
|
|
|
321016
321043
|
if (value === null || value === void 0) throw new Error(message);
|
|
321017
321044
|
return value;
|
|
321018
321045
|
}
|
|
321046
|
+
function serverCommandId(tag) {
|
|
321047
|
+
return CommandId.make(`server:agent-protocol:${tag}:${crypto.randomUUID()}`);
|
|
321048
|
+
}
|
|
321019
321049
|
const AgentProtocolReactorLive = effect(AgentProtocolReactor, gen(function* () {
|
|
321020
321050
|
const orchestration = yield* OrchestrationEngineService;
|
|
321021
321051
|
const projectionSnapshotQuery = yield* ProjectionSnapshotQuery;
|
|
@@ -321026,7 +321056,6 @@ const AgentProtocolReactorLive = effect(AgentProtocolReactor, gen(function* () {
|
|
|
321026
321056
|
const dispatch = (command) => runPromise(orchestration.dispatch(command).pipe(asVoid));
|
|
321027
321057
|
const readThread = (threadId) => runPromise(readDurableWorkerDetail(projectionSnapshotQuery, threadId)).then(getOrNull);
|
|
321028
321058
|
const readProject = (projectId) => runPromise(projectionSnapshotQuery.getProjectShellById(projectId)).then(getOrNull);
|
|
321029
|
-
const serverCommandId = (tag) => CommandId.make(`server:agent-protocol:${tag}:${crypto.randomUUID()}`);
|
|
321030
321059
|
const appendActivity = async (input) => {
|
|
321031
321060
|
const createdAt = input.createdAt ?? (/* @__PURE__ */ new Date()).toISOString();
|
|
321032
321061
|
await dispatch({
|
|
@@ -323401,7 +323430,7 @@ const connectLoginCommand = make$34("login", {
|
|
|
323401
323430
|
})).json();
|
|
323402
323431
|
},
|
|
323403
323432
|
openBrowser: async (url) => {
|
|
323404
|
-
const open = (await import("./open-
|
|
323433
|
+
const open = (await import("./open-yHTUkd2Y.mjs")).default;
|
|
323405
323434
|
await open(url);
|
|
323406
323435
|
return true;
|
|
323407
323436
|
},
|