@cmmd-center/forge 0.13.82 → 0.13.83
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 +145 -134
- package/dist/bin.mjs +169 -158
- package/dist/client/assets/{DiffPanel-B47H2Ztq.js → DiffPanel-BzKkiaBf.js} +3 -3
- package/dist/client/assets/{DiffPanel.logic-DT4FolWZ.js → DiffPanel.logic-VfGGX1sz.js} +2 -2
- package/dist/client/assets/DiffPanelShell-JOSW9RYb.js +2537 -0
- package/dist/client/assets/{DiffWorkerPoolProvider-BrgXjqS5.js → DiffWorkerPoolProvider-L5rgnah4.js} +30 -30
- package/dist/client/assets/{PullRequestCodePanel-3MHkasTp.js → PullRequestCodePanel-CE_QRZf2.js} +2 -2
- package/dist/client/assets/{Virtualizer-BF72qd4z.js → Virtualizer-BAVMak1h.js} +2 -2
- package/dist/client/assets/cmmdAuthRedirect-CbWPYc_g.js +3 -0
- package/dist/client/assets/{index-jjmPqZtL.js → index-DVBLRDej.js} +61 -61
- package/dist/client/index.html +5 -5
- 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/cmmdAuthRedirect-lzr9SGGx.js +0 -2
package/dist/bin.cjs
CHANGED
|
@@ -66275,7 +66275,7 @@ function normalizeNumberish(value) {
|
|
|
66275
66275
|
}
|
|
66276
66276
|
//#endregion
|
|
66277
66277
|
//#region package.json
|
|
66278
|
-
var version$1 = "0.13.
|
|
66278
|
+
var version$1 = "0.13.83";
|
|
66279
66279
|
//#endregion
|
|
66280
66280
|
//#region src/sentry.ts
|
|
66281
66281
|
const SERVER_APP_NAME = "forge-server";
|
|
@@ -80176,10 +80176,7 @@ function dedupeChecks(entries) {
|
|
|
80176
80176
|
for (const entry of survivors) countsByName.set(entry.check.name, (countsByName.get(entry.check.name) ?? 0) + 1);
|
|
80177
80177
|
return survivors.map((entry) => {
|
|
80178
80178
|
const workflowName = entry.workflowName ?? "";
|
|
80179
|
-
return workflowName.length > 0 && (countsByName.get(entry.check.name) ?? 0) > 1 ? {
|
|
80180
|
-
...entry.check,
|
|
80181
|
-
name: `${workflowName} / ${entry.check.name}`
|
|
80182
|
-
} : entry.check;
|
|
80179
|
+
return workflowName.length > 0 && (countsByName.get(entry.check.name) ?? 0) > 1 ? Object.assign({}, entry.check, { name: `${workflowName} / ${entry.check.name}` }) : entry.check;
|
|
80183
80180
|
});
|
|
80184
80181
|
}
|
|
80185
80182
|
//#endregion
|
|
@@ -87555,13 +87552,8 @@ const make$21 = require_Schema$1.gen(function* () {
|
|
|
87555
87552
|
author: withAvatar(pullRequest.author, reviewThreads.avatarsByLogin, input.host),
|
|
87556
87553
|
reviewers: reviewThreads.reviewers,
|
|
87557
87554
|
reactions: reviewThreads.reactions,
|
|
87558
|
-
commits: (reviewThreads.commits.length > 0 ? reviewThreads.commits : pullRequest.commits).map((commit) => ({
|
|
87559
|
-
|
|
87560
|
-
...reviewThreads.commitStats.get(commit.oid),
|
|
87561
|
-
authors: commit.authors?.map((author) => withAvatar(author, reviewThreads.avatarsByLogin, input.host) ?? author)
|
|
87562
|
-
})),
|
|
87563
|
-
comments: [...pullRequest.comments, ...reviewThreads.comments].map((comment) => ({
|
|
87564
|
-
...comment,
|
|
87555
|
+
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) })),
|
|
87556
|
+
comments: [...pullRequest.comments, ...reviewThreads.comments].map((comment) => Object.assign({}, comment, {
|
|
87565
87557
|
body: comment.kind === "review" && comment.reviewState?.toUpperCase() === "DISMISSED" && rendersEmpty(comment.body) ? reviewThreads.dismissalsByReviewId.get(comment.id) ?? comment.body : comment.body,
|
|
87566
87558
|
author: withAvatar(comment.author, reviewThreads.avatarsByLogin, input.host),
|
|
87567
87559
|
reactions: comment.reactions ?? reviewThreads.reactionsById.get(comment.id) ?? []
|
|
@@ -151788,7 +151780,7 @@ const OPENAI_PROXY_ENV_KEYS = ["OPENAI_API_KEY", "OPENAI_BASE_URL"];
|
|
|
151788
151780
|
function personalCodexServedByControlPlane(env = process.env) {
|
|
151789
151781
|
return env.FORGE_CMMD_RUNTIME_MODE === "true" && env.FORGE_PERSONAL_CODEX_VIA_EGRESS === "true";
|
|
151790
151782
|
}
|
|
151791
|
-
function resolveCodexAccessMode(input) {
|
|
151783
|
+
function resolveCodexAccessMode$1(input) {
|
|
151792
151784
|
if (clampWorkspaceAccessMode(input.accessMode) === "workspace") return "workspace";
|
|
151793
151785
|
if (personalCodexServedByControlPlane(input.env ?? process.env)) return "workspace";
|
|
151794
151786
|
if (!input.hasCodexChatGptLogin()) throw personalCodexAuthError("This runtime is not signed in to ChatGPT. Open Settings > Providers and connect ChatGPT on this runtime.");
|
|
@@ -153506,7 +153498,7 @@ var CodexAppServerManager = class extends node_events.EventEmitter {
|
|
|
153506
153498
|
cwd: resolvedCwd,
|
|
153507
153499
|
...codexHomePath ? { homePath: codexHomePath } : {}
|
|
153508
153500
|
});
|
|
153509
|
-
const accessMode = resolveCodexAccessMode({
|
|
153501
|
+
const accessMode = resolveCodexAccessMode$1({
|
|
153510
153502
|
accessMode: input.accessMode ?? "workspace",
|
|
153511
153503
|
hasCodexChatGptLogin: () => hasCodexChatGptLogin({
|
|
153512
153504
|
binaryPath: codexBinaryPath,
|
|
@@ -223465,6 +223457,9 @@ const makeTerminationError = (handle) => require_Schema$1.match(handle.exitCode,
|
|
|
223465
223457
|
});
|
|
223466
223458
|
//#endregion
|
|
223467
223459
|
//#region ../../packages/effect-acp/src/client.ts
|
|
223460
|
+
function runNotificationHandlers(registration, notification) {
|
|
223461
|
+
return require_Schema$1.forEach(registration.handlers, (handler) => handler(notification).pipe(require_Schema$1.catch_(() => require_Schema$1.void_)), { discard: true });
|
|
223462
|
+
}
|
|
223468
223463
|
var AcpClient = class extends require_Schema$1.Service()("effect-acp/AcpClient") {};
|
|
223469
223464
|
const make$12 = require_Schema$1.fn("effect-acp/AcpClient.make")(function* (stdio, options = {}, terminationError) {
|
|
223470
223465
|
const coreHandlers = {};
|
|
@@ -223482,7 +223477,6 @@ const make$12 = require_Schema$1.fn("effect-acp/AcpClient.make")(function* (stdi
|
|
|
223482
223477
|
const extNotificationHandlers = /* @__PURE__ */ new Map();
|
|
223483
223478
|
let unknownExtRequestHandler;
|
|
223484
223479
|
let unknownExtNotificationHandler;
|
|
223485
|
-
const runNotificationHandlers = (registration, notification) => require_Schema$1.forEach(registration.handlers, (handler) => handler(notification).pipe(require_Schema$1.catch_(() => require_Schema$1.void_)), { discard: true });
|
|
223486
223480
|
const flushBufferedNotifications = (registration) => require_Schema$1.suspend$1(() => {
|
|
223487
223481
|
if (registration.handlers.length === 0 || registration.pending.length === 0) return require_Schema$1.void_;
|
|
223488
223482
|
const pending = registration.pending.splice(0, registration.pending.length);
|
|
@@ -237727,6 +237721,34 @@ const CodexProviderLive = require_Schema$1.effect(CodexProvider, require_Schema$
|
|
|
237727
237721
|
//#region src/git/Layers/CodexTextGeneration.ts
|
|
237728
237722
|
const CODEX_GIT_TEXT_GENERATION_REASONING_EFFORT = "low";
|
|
237729
237723
|
const CODEX_TIMEOUT_MS = 18e4;
|
|
237724
|
+
const readCodexStreamAsString = (operation, stream) => stream.pipe(require_Path.decodeText(), require_Path.runFold(() => "", (acc, chunk) => acc + chunk), require_Schema$1.mapError((cause) => normalizeCliError("codex", operation, cause, "Failed to collect process output")));
|
|
237725
|
+
function buildCodexExecArgs(input) {
|
|
237726
|
+
return [
|
|
237727
|
+
"exec",
|
|
237728
|
+
"--ephemeral",
|
|
237729
|
+
"--skip-git-repo-check",
|
|
237730
|
+
"-s",
|
|
237731
|
+
"read-only",
|
|
237732
|
+
"--model",
|
|
237733
|
+
input.model,
|
|
237734
|
+
"--config",
|
|
237735
|
+
`model_reasoning_effort="${input.reasoningEffort}"`,
|
|
237736
|
+
"--config",
|
|
237737
|
+
`project_doc_max_bytes=${CODEX_PROJECT_DOC_MAX_BYTES}`,
|
|
237738
|
+
...input.fastMode ? ["--config", `service_tier="fast"`] : [],
|
|
237739
|
+
"--output-schema",
|
|
237740
|
+
input.schemaPath,
|
|
237741
|
+
"--output-last-message",
|
|
237742
|
+
input.outputPath,
|
|
237743
|
+
"--json",
|
|
237744
|
+
...input.imagePaths.flatMap((imagePath) => ["--image", imagePath]),
|
|
237745
|
+
"-"
|
|
237746
|
+
];
|
|
237747
|
+
}
|
|
237748
|
+
function resolveCodexAccessMode(configuredAccessMode) {
|
|
237749
|
+
const accessMode = clampWorkspaceAccessMode(configuredAccessMode);
|
|
237750
|
+
return accessMode === "personal" && personalCodexServedByControlPlane() ? "workspace" : accessMode;
|
|
237751
|
+
}
|
|
237730
237752
|
/**
|
|
237731
237753
|
* Byte budget Codex spends on `AGENTS.md` when it builds project instructions.
|
|
237732
237754
|
* The Codex config reference defines `project_doc_max_bytes` as "Maximum bytes
|
|
@@ -237748,7 +237770,6 @@ const makeCodexTextGeneration = require_Schema$1.gen(function* () {
|
|
|
237748
237770
|
const serverConfig = yield* require_Schema$1.service(ServerConfig);
|
|
237749
237771
|
const serverSettingsService = yield* require_Schema$1.service(ServerSettingsService);
|
|
237750
237772
|
const textGenerationUsage = yield* require_Schema$1.service(TextGenerationUsage);
|
|
237751
|
-
const readStreamAsString = (operation, stream) => stream.pipe(require_Path.decodeText(), require_Path.runFold(() => "", (acc, chunk) => acc + chunk), require_Schema$1.mapError((cause) => normalizeCliError("codex", operation, cause, "Failed to collect process output")));
|
|
237752
237773
|
const writeTempFile = (operation, prefix, content) => {
|
|
237753
237774
|
return fileSystem.makeTempFileScoped({ prefix: `forge-${prefix}-${process.pid}-${(0, node_crypto.randomUUID)()}.tmp` }).pipe(require_Schema$1.tap((filePath) => fileSystem.writeFileString(filePath, content)), require_Schema$1.mapError((cause) => new TextGenerationError({
|
|
237754
237775
|
operation,
|
|
@@ -237836,39 +237857,47 @@ const makeCodexTextGeneration = require_Schema$1.gen(function* () {
|
|
|
237836
237857
|
const outputPath = yield* writeTempFile(operation, "codex-output", "");
|
|
237837
237858
|
const workingDirectory = yield* makeNeutralWorkingDirectory(operation);
|
|
237838
237859
|
const codexSettings = yield* require_Schema$1.map(serverSettingsService.getSettings, (settings) => settings.providers.codex).pipe(require_Schema$1.catch_(() => require_Schema$1.undefined_));
|
|
237839
|
-
const
|
|
237860
|
+
const launchCodexCommand = (command) => require_Schema$1.gen(function* () {
|
|
237861
|
+
const child = yield* commandSpawner.spawn(command).pipe(require_Schema$1.mapError((cause) => normalizeCliError("codex", operation, cause, "Failed to spawn Codex CLI process")));
|
|
237862
|
+
const [stdout, stderr, exitCode] = yield* require_Schema$1.all([
|
|
237863
|
+
readCodexStreamAsString(operation, child.stdout),
|
|
237864
|
+
readCodexStreamAsString(operation, child.stderr),
|
|
237865
|
+
child.exitCode.pipe(require_Schema$1.mapError((cause) => normalizeCliError("codex", operation, cause, "Failed to read Codex CLI exit code")))
|
|
237866
|
+
], { concurrency: "unbounded" });
|
|
237867
|
+
if (exitCode === 0) return stdout;
|
|
237868
|
+
const detail = stderr.trim() || stdout.trim();
|
|
237869
|
+
return yield* new TextGenerationError({
|
|
237870
|
+
operation,
|
|
237871
|
+
detail: detail.length > 0 ? `Codex CLI command failed: ${detail}` : `Codex CLI command failed with code ${exitCode}.`
|
|
237872
|
+
});
|
|
237873
|
+
});
|
|
237874
|
+
const resolveCodexCommandTarget = require_Schema$1.fn("runCodexJson.resolveCommandTarget")(function* () {
|
|
237840
237875
|
const normalizedOptions = normalizeCodexModelOptionsWithCapabilities(getCodexModelCapabilities(modelSelection.model), modelSelection.options);
|
|
237841
237876
|
const reasoningEffort = modelSelection.options?.reasoningEffort ?? CODEX_GIT_TEXT_GENERATION_REASONING_EFFORT;
|
|
237842
|
-
const
|
|
237843
|
-
|
|
237844
|
-
|
|
237845
|
-
|
|
237877
|
+
const accessMode = resolveCodexAccessMode(codexSettings?.accessMode ?? "workspace");
|
|
237878
|
+
return {
|
|
237879
|
+
normalizedOptions,
|
|
237880
|
+
reasoningEffort,
|
|
237846
237881
|
accessMode,
|
|
237882
|
+
providerProxyToken: yield* resolveCodexProviderProxyToken({
|
|
237883
|
+
operation,
|
|
237884
|
+
accessMode,
|
|
237885
|
+
model: modelSelection.model,
|
|
237886
|
+
...threadId ? { threadId } : {},
|
|
237887
|
+
authSessionId
|
|
237888
|
+
})
|
|
237889
|
+
};
|
|
237890
|
+
});
|
|
237891
|
+
const runCodexCommand = require_Schema$1.fn("runCodexJson.runCodexCommand")(function* () {
|
|
237892
|
+
const { normalizedOptions, reasoningEffort, accessMode, providerProxyToken } = yield* resolveCodexCommandTarget();
|
|
237893
|
+
return yield* launchCodexCommand(require_NodeTerminal.make$2(codexSettings?.binaryPath || "codex", buildCodexExecArgs({
|
|
237847
237894
|
model: modelSelection.model,
|
|
237848
|
-
|
|
237849
|
-
|
|
237850
|
-
});
|
|
237851
|
-
const command = require_NodeTerminal.make$2(codexSettings?.binaryPath || "codex", [
|
|
237852
|
-
"exec",
|
|
237853
|
-
"--ephemeral",
|
|
237854
|
-
"--skip-git-repo-check",
|
|
237855
|
-
"-s",
|
|
237856
|
-
"read-only",
|
|
237857
|
-
"--model",
|
|
237858
|
-
modelSelection.model,
|
|
237859
|
-
"--config",
|
|
237860
|
-
`model_reasoning_effort="${reasoningEffort}"`,
|
|
237861
|
-
"--config",
|
|
237862
|
-
`project_doc_max_bytes=${CODEX_PROJECT_DOC_MAX_BYTES}`,
|
|
237863
|
-
...normalizedOptions?.fastMode ? ["--config", `service_tier="fast"`] : [],
|
|
237864
|
-
"--output-schema",
|
|
237895
|
+
reasoningEffort,
|
|
237896
|
+
fastMode: normalizedOptions?.fastMode,
|
|
237865
237897
|
schemaPath,
|
|
237866
|
-
"--output-last-message",
|
|
237867
237898
|
outputPath,
|
|
237868
|
-
|
|
237869
|
-
|
|
237870
|
-
"-"
|
|
237871
|
-
], {
|
|
237899
|
+
imagePaths
|
|
237900
|
+
}), {
|
|
237872
237901
|
env: scrubForgeProviderChildEnvSecrets(buildCodexProcessEnv({
|
|
237873
237902
|
baseEnv: process.env,
|
|
237874
237903
|
accessMode,
|
|
@@ -237881,23 +237910,7 @@ const makeCodexTextGeneration = require_Schema$1.gen(function* () {
|
|
|
237881
237910
|
cwd: workingDirectory,
|
|
237882
237911
|
shell: process.platform === "win32",
|
|
237883
237912
|
stdin: { stream: require_Path.encodeText(require_Path.make$1(prompt)) }
|
|
237884
|
-
});
|
|
237885
|
-
const child = yield* commandSpawner.spawn(command).pipe(require_Schema$1.mapError((cause) => normalizeCliError("codex", operation, cause, "Failed to spawn Codex CLI process")));
|
|
237886
|
-
const [stdout, stderr, exitCode] = yield* require_Schema$1.all([
|
|
237887
|
-
readStreamAsString(operation, child.stdout),
|
|
237888
|
-
readStreamAsString(operation, child.stderr),
|
|
237889
|
-
child.exitCode.pipe(require_Schema$1.mapError((cause) => normalizeCliError("codex", operation, cause, "Failed to read Codex CLI exit code")))
|
|
237890
|
-
], { concurrency: "unbounded" });
|
|
237891
|
-
if (exitCode !== 0) {
|
|
237892
|
-
const stderrDetail = stderr.trim();
|
|
237893
|
-
const stdoutDetail = stdout.trim();
|
|
237894
|
-
const detail = stderrDetail.length > 0 ? stderrDetail : stdoutDetail;
|
|
237895
|
-
return yield* new TextGenerationError({
|
|
237896
|
-
operation,
|
|
237897
|
-
detail: detail.length > 0 ? `Codex CLI command failed: ${detail}` : `Codex CLI command failed with code ${exitCode}.`
|
|
237898
|
-
});
|
|
237899
|
-
}
|
|
237900
|
-
return stdout;
|
|
237913
|
+
}));
|
|
237901
237914
|
});
|
|
237902
237915
|
const cleanup = require_Schema$1.all([...[
|
|
237903
237916
|
schemaPath,
|
|
@@ -238037,6 +238050,7 @@ const CodexTextGenerationLive = require_Schema$1.effect(TextGeneration, makeCode
|
|
|
238037
238050
|
* @module ClaudeTextGeneration
|
|
238038
238051
|
*/
|
|
238039
238052
|
const CLAUDE_TIMEOUT_MS = 18e4;
|
|
238053
|
+
const readClaudeStreamAsString = (operation, stream) => stream.pipe(require_Path.decodeText(), require_Path.runFold(() => "", (acc, chunk) => acc + chunk), require_Schema$1.mapError((cause) => normalizeCliError("claude", operation, cause, "Failed to collect process output")));
|
|
238040
238054
|
/**
|
|
238041
238055
|
* Schema for the wrapper JSON returned by `claude -p --output-format json`.
|
|
238042
238056
|
* We only care about `structured_output`.
|
|
@@ -238072,7 +238086,6 @@ const makeClaudeTextGeneration = require_Schema$1.gen(function* () {
|
|
|
238072
238086
|
...report.providerSessionId ? { providerSessionId: report.providerSessionId } : {}
|
|
238073
238087
|
});
|
|
238074
238088
|
});
|
|
238075
|
-
const readStreamAsString = (operation, stream) => stream.pipe(require_Path.decodeText(), require_Path.runFold(() => "", (acc, chunk) => acc + chunk), require_Schema$1.mapError((cause) => normalizeCliError("claude", operation, cause, "Failed to collect process output")));
|
|
238076
238089
|
/**
|
|
238077
238090
|
* Spawn the Claude CLI with structured JSON output and return the parsed,
|
|
238078
238091
|
* schema-validated result.
|
|
@@ -238105,8 +238118,8 @@ const makeClaudeTextGeneration = require_Schema$1.gen(function* () {
|
|
|
238105
238118
|
});
|
|
238106
238119
|
const child = yield* commandSpawner.spawn(command).pipe(require_Schema$1.mapError((cause) => normalizeCliError("claude", operation, cause, "Failed to spawn Claude CLI process")));
|
|
238107
238120
|
const [stdout, stderr, exitCode] = yield* require_Schema$1.all([
|
|
238108
|
-
|
|
238109
|
-
|
|
238121
|
+
readClaudeStreamAsString(operation, child.stdout),
|
|
238122
|
+
readClaudeStreamAsString(operation, child.stderr),
|
|
238110
238123
|
child.exitCode.pipe(require_Schema$1.mapError((cause) => normalizeCliError("claude", operation, cause, "Failed to read Claude CLI exit code")))
|
|
238111
238124
|
], { concurrency: "unbounded" });
|
|
238112
238125
|
if (exitCode !== 0) {
|
|
@@ -238503,6 +238516,21 @@ var TerminalProcessSignalError = class extends require_Schema$1.TaggedErrorClass
|
|
|
238503
238516
|
cause: require_Schema$1.optional(require_Schema$1.Defect),
|
|
238504
238517
|
signal: require_Schema$1.Literals(["SIGTERM", "SIGKILL"])
|
|
238505
238518
|
}) {};
|
|
238519
|
+
function toTerminalHistoryError(operation, threadId, terminalId) {
|
|
238520
|
+
return (cause) => new TerminalHistoryError({
|
|
238521
|
+
operation,
|
|
238522
|
+
threadId,
|
|
238523
|
+
terminalId,
|
|
238524
|
+
cause
|
|
238525
|
+
});
|
|
238526
|
+
}
|
|
238527
|
+
function requireRunningProcess(session) {
|
|
238528
|
+
if (session.process && session.status === "running") return require_Schema$1.succeed(session.process);
|
|
238529
|
+
return require_Schema$1.fail(new TerminalNotRunningError({
|
|
238530
|
+
threadId: session.threadId,
|
|
238531
|
+
terminalId: session.terminalId
|
|
238532
|
+
}));
|
|
238533
|
+
}
|
|
238506
238534
|
const MAX_TERMINAL_CONTROL_RECEIPTS = 256;
|
|
238507
238535
|
function terminalControlPayloadHash(method, payload) {
|
|
238508
238536
|
return (0, node_crypto.createHash)("sha256").update(method).update("\0").update(payload).digest("base64url");
|
|
@@ -238948,12 +238976,6 @@ const makeTerminalManagerWithOptions = require_Schema$1.fn("makeTerminalManagerW
|
|
|
238948
238976
|
return node_path.default.join(logsDir, `${threadPart}_${toSafeTerminalId(terminalId)}.log`);
|
|
238949
238977
|
};
|
|
238950
238978
|
const legacyHistoryPath = (threadId) => node_path.default.join(logsDir, `${legacySafeThreadId(threadId)}.log`);
|
|
238951
|
-
const toTerminalHistoryError = (operation, threadId, terminalId) => (cause) => new TerminalHistoryError({
|
|
238952
|
-
operation,
|
|
238953
|
-
threadId,
|
|
238954
|
-
terminalId,
|
|
238955
|
-
cause
|
|
238956
|
-
});
|
|
238957
238979
|
const readManagerState = get$2(managerStateRef);
|
|
238958
238980
|
const modifyManagerState = (f) => modify$2(managerStateRef, f);
|
|
238959
238981
|
const getThreadSemaphore = (threadId) => modifyEffect(threadLocksRef, (current) => {
|
|
@@ -239616,13 +239638,6 @@ const makeTerminalManagerWithOptions = require_Schema$1.fn("makeTerminalManagerW
|
|
|
239616
239638
|
transitionReceipts.delete(oldest);
|
|
239617
239639
|
}
|
|
239618
239640
|
};
|
|
239619
|
-
const requireRunningProcess = (session) => {
|
|
239620
|
-
if (session.process && session.status === "running") return require_Schema$1.succeed(session.process);
|
|
239621
|
-
return require_Schema$1.fail(new TerminalNotRunningError({
|
|
239622
|
-
threadId: session.threadId,
|
|
239623
|
-
terminalId: session.terminalId
|
|
239624
|
-
}));
|
|
239625
|
-
};
|
|
239626
239641
|
const write = require_Schema$1.fn("terminal.write")(function* (input) {
|
|
239627
239642
|
const terminalId = input.terminalId ?? "default";
|
|
239628
239643
|
const session = yield* requireSession(input.threadId, terminalId);
|
|
@@ -292599,7 +292614,7 @@ function mapProviderSessionStatusToOrchestrationStatus(status) {
|
|
|
292599
292614
|
}
|
|
292600
292615
|
}
|
|
292601
292616
|
const turnStartKeyForEvent = (event) => event.commandId !== null ? `command:${event.commandId}` : `event:${event.eventId}`;
|
|
292602
|
-
const serverCommandId$
|
|
292617
|
+
const serverCommandId$2 = (tag) => CommandId.make(`server:${tag}:${crypto.randomUUID()}`);
|
|
292603
292618
|
const HANDLED_TURN_START_KEY_MAX = 1e4;
|
|
292604
292619
|
const HANDLED_TURN_START_KEY_TTL = require_Schema$1.minutes(30);
|
|
292605
292620
|
const DEFAULT_RUNTIME_MODE = "full-access";
|
|
@@ -293021,7 +293036,7 @@ const make$8 = require_Schema$1.gen(function* () {
|
|
|
293021
293036
|
const threadSessionAccountIds = /* @__PURE__ */ new Map();
|
|
293022
293037
|
const appendProviderFailureActivity = (input) => orchestrationEngine.dispatch({
|
|
293023
293038
|
type: "thread.activity.append",
|
|
293024
|
-
commandId: serverCommandId$
|
|
293039
|
+
commandId: serverCommandId$2("provider-failure-activity"),
|
|
293025
293040
|
threadId: input.threadId,
|
|
293026
293041
|
activity: {
|
|
293027
293042
|
id: EventId.make(crypto.randomUUID()),
|
|
@@ -293039,7 +293054,7 @@ const make$8 = require_Schema$1.gen(function* () {
|
|
|
293039
293054
|
});
|
|
293040
293055
|
const setThreadSession = (input) => orchestrationEngine.dispatch({
|
|
293041
293056
|
type: "thread.session.set",
|
|
293042
|
-
commandId: serverCommandId$
|
|
293057
|
+
commandId: serverCommandId$2("provider-session-set"),
|
|
293043
293058
|
threadId: input.threadId,
|
|
293044
293059
|
session: input.session,
|
|
293045
293060
|
createdAt: input.createdAt
|
|
@@ -293322,7 +293337,7 @@ const make$8 = require_Schema$1.gen(function* () {
|
|
|
293322
293337
|
});
|
|
293323
293338
|
yield* orchestrationEngine.dispatch({
|
|
293324
293339
|
type: "thread.meta.update",
|
|
293325
|
-
commandId: serverCommandId$
|
|
293340
|
+
commandId: serverCommandId$2("worktree-branch-rename"),
|
|
293326
293341
|
threadId: input.threadId,
|
|
293327
293342
|
branch: renamed.branch,
|
|
293328
293343
|
worktreePath: cwd
|
|
@@ -293361,7 +293376,7 @@ const make$8 = require_Schema$1.gen(function* () {
|
|
|
293361
293376
|
if (!canReplaceThreadTitle(thread.title, input.titleSeed)) return;
|
|
293362
293377
|
yield* orchestrationEngine.dispatch({
|
|
293363
293378
|
type: "thread.meta.update",
|
|
293364
|
-
commandId: serverCommandId$
|
|
293379
|
+
commandId: serverCommandId$2("thread-title-rename"),
|
|
293365
293380
|
threadId: input.threadId,
|
|
293366
293381
|
title: generated.title
|
|
293367
293382
|
});
|
|
@@ -293424,7 +293439,7 @@ const make$8 = require_Schema$1.gen(function* () {
|
|
|
293424
293439
|
const dispatchThreadTitleRegenerationCompletion = require_Schema$1.fn("dispatchThreadTitleRegenerationCompletion")(function* (input) {
|
|
293425
293440
|
yield* orchestrationEngine.dispatch({
|
|
293426
293441
|
type: "thread.title.regeneration.complete",
|
|
293427
|
-
commandId: serverCommandId$
|
|
293442
|
+
commandId: serverCommandId$2("thread-title-regeneration-complete"),
|
|
293428
293443
|
threadId: input.threadId,
|
|
293429
293444
|
requestId: input.requestId,
|
|
293430
293445
|
...input.title !== void 0 ? { title: input.title } : {}
|
|
@@ -293733,7 +293748,7 @@ const make$8 = require_Schema$1.gen(function* () {
|
|
|
293733
293748
|
});
|
|
293734
293749
|
const appendRecoverableTurnStartTimeout = (event) => orchestrationEngine.dispatch({
|
|
293735
293750
|
type: "thread.activity.append",
|
|
293736
|
-
commandId: serverCommandId$
|
|
293751
|
+
commandId: serverCommandId$2("provider-turn-start-timeout"),
|
|
293737
293752
|
threadId: event.payload.threadId,
|
|
293738
293753
|
activity: {
|
|
293739
293754
|
id: EventId.make(crypto.randomUUID()),
|
|
@@ -294567,7 +294582,13 @@ function isGitOutputLimitError(error) {
|
|
|
294567
294582
|
const text = `${"detail" in error && typeof error.detail === "string" ? error.detail : ""}\n${"message" in error && typeof error.message === "string" ? error.message : ""}`;
|
|
294568
294583
|
return text.includes("output exceeded") && text.includes("bytes and was truncated");
|
|
294569
294584
|
}
|
|
294570
|
-
const serverCommandId = (tag) => CommandId.make(`server:${tag}:${crypto.randomUUID()}`);
|
|
294585
|
+
const serverCommandId$1 = (tag) => CommandId.make(`server:${tag}:${crypto.randomUUID()}`);
|
|
294586
|
+
function findSessionWithCwd(session) {
|
|
294587
|
+
return session?.cwd ? require_Schema$1.some({
|
|
294588
|
+
threadId: session.threadId,
|
|
294589
|
+
cwd: session.cwd
|
|
294590
|
+
}) : require_Schema$1.none();
|
|
294591
|
+
}
|
|
294571
294592
|
const make$7 = require_Schema$1.gen(function* () {
|
|
294572
294593
|
const orchestrationEngine = yield* OrchestrationEngineService;
|
|
294573
294594
|
const providerService = yield* ProviderService;
|
|
@@ -294577,7 +294598,7 @@ const make$7 = require_Schema$1.gen(function* () {
|
|
|
294577
294598
|
const gitStatusBroadcaster = yield* GitStatusBroadcaster;
|
|
294578
294599
|
const appendRevertFailureActivity = (input) => orchestrationEngine.dispatch({
|
|
294579
294600
|
type: "thread.activity.append",
|
|
294580
|
-
commandId: serverCommandId("checkpoint-revert-failure"),
|
|
294601
|
+
commandId: serverCommandId$1("checkpoint-revert-failure"),
|
|
294581
294602
|
threadId: input.threadId,
|
|
294582
294603
|
activity: {
|
|
294583
294604
|
id: EventId.make(crypto.randomUUID()),
|
|
@@ -294595,7 +294616,7 @@ const make$7 = require_Schema$1.gen(function* () {
|
|
|
294595
294616
|
});
|
|
294596
294617
|
const appendCaptureFailureActivity = (input) => orchestrationEngine.dispatch({
|
|
294597
294618
|
type: "thread.activity.append",
|
|
294598
|
-
commandId: serverCommandId("checkpoint-capture-failure"),
|
|
294619
|
+
commandId: serverCommandId$1("checkpoint-capture-failure"),
|
|
294599
294620
|
threadId: input.threadId,
|
|
294600
294621
|
activity: {
|
|
294601
294622
|
id: EventId.make(crypto.randomUUID()),
|
|
@@ -294613,7 +294634,7 @@ const make$7 = require_Schema$1.gen(function* () {
|
|
|
294613
294634
|
});
|
|
294614
294635
|
const appendDiffSummarySkippedActivity = (input) => orchestrationEngine.dispatch({
|
|
294615
294636
|
type: "thread.activity.append",
|
|
294616
|
-
commandId: serverCommandId("checkpoint-diff-summary-skipped"),
|
|
294637
|
+
commandId: serverCommandId$1("checkpoint-diff-summary-skipped"),
|
|
294617
294638
|
threadId: input.threadId,
|
|
294618
294639
|
activity: {
|
|
294619
294640
|
id: EventId.make(crypto.randomUUID()),
|
|
@@ -294629,20 +294650,12 @@ const make$7 = require_Schema$1.gen(function* () {
|
|
|
294629
294650
|
const resolveSessionRuntimeForThread = require_Schema$1.fn("resolveSessionRuntimeForThread")(function* (threadId) {
|
|
294630
294651
|
const thread = (yield* orchestrationEngine.getReadModel()).threads.find((entry) => entry.id === threadId);
|
|
294631
294652
|
const sessions = yield* providerService.listSessions();
|
|
294632
|
-
const findSessionWithCwd = (session) => {
|
|
294633
|
-
if (!session?.cwd) return require_Schema$1.none();
|
|
294634
|
-
return require_Schema$1.some({
|
|
294635
|
-
threadId: session.threadId,
|
|
294636
|
-
cwd: session.cwd
|
|
294637
|
-
});
|
|
294638
|
-
};
|
|
294639
294653
|
if (thread) {
|
|
294640
294654
|
const fromProjected = findSessionWithCwd(sessions.find((session) => session.threadId === thread.id));
|
|
294641
294655
|
if (require_Schema$1.isSome(fromProjected)) return fromProjected;
|
|
294642
294656
|
}
|
|
294643
294657
|
return require_Schema$1.none();
|
|
294644
294658
|
});
|
|
294645
|
-
const isGitWorkspace = (cwd) => isGitRepository(cwd);
|
|
294646
294659
|
const resolveCheckpointCwd = require_Schema$1.fn("resolveCheckpointCwd")(function* (input) {
|
|
294647
294660
|
const fromSession = yield* resolveSessionRuntimeForThread(input.threadId);
|
|
294648
294661
|
const fromThread = resolveThreadWorkspaceCwd({
|
|
@@ -294657,7 +294670,7 @@ const make$7 = require_Schema$1.gen(function* () {
|
|
|
294657
294670
|
onSome: (runtime) => runtime.cwd
|
|
294658
294671
|
});
|
|
294659
294672
|
if (!cwd) return;
|
|
294660
|
-
if (!
|
|
294673
|
+
if (!isGitRepository(cwd)) return;
|
|
294661
294674
|
return cwd;
|
|
294662
294675
|
});
|
|
294663
294676
|
const captureAndDispatchCheckpoint = require_Schema$1.fn("captureAndDispatchCheckpoint")(function* (input) {
|
|
@@ -294717,7 +294730,7 @@ const make$7 = require_Schema$1.gen(function* () {
|
|
|
294717
294730
|
const assistantMessageId = input.assistantMessageId ?? input.thread.messages.toReversed().find((entry) => entry.role === "assistant" && entry.turnId === input.turnId)?.id ?? MessageId.make(`assistant:${input.turnId}`);
|
|
294718
294731
|
yield* orchestrationEngine.dispatch({
|
|
294719
294732
|
type: "thread.turn.diff.complete",
|
|
294720
|
-
commandId: serverCommandId("checkpoint-turn-diff-complete"),
|
|
294733
|
+
commandId: serverCommandId$1("checkpoint-turn-diff-complete"),
|
|
294721
294734
|
threadId: input.threadId,
|
|
294722
294735
|
turnId: input.turnId,
|
|
294723
294736
|
completedAt: input.createdAt,
|
|
@@ -294746,7 +294759,7 @@ const make$7 = require_Schema$1.gen(function* () {
|
|
|
294746
294759
|
});
|
|
294747
294760
|
yield* orchestrationEngine.dispatch({
|
|
294748
294761
|
type: "thread.activity.append",
|
|
294749
|
-
commandId: serverCommandId("checkpoint-captured-activity"),
|
|
294762
|
+
commandId: serverCommandId$1("checkpoint-captured-activity"),
|
|
294750
294763
|
threadId: input.threadId,
|
|
294751
294764
|
activity: {
|
|
294752
294765
|
id: EventId.make(crypto.randomUUID()),
|
|
@@ -294928,7 +294941,7 @@ const make$7 = require_Schema$1.gen(function* () {
|
|
|
294928
294941
|
}).pipe(require_Schema$1.catch_(() => require_Schema$1.void_));
|
|
294929
294942
|
return;
|
|
294930
294943
|
}
|
|
294931
|
-
if (!
|
|
294944
|
+
if (!isGitRepository(sessionRuntime.value.cwd)) {
|
|
294932
294945
|
yield* appendRevertFailureActivity({
|
|
294933
294946
|
threadId: event.payload.threadId,
|
|
294934
294947
|
turnCount: event.payload.turnCount,
|
|
@@ -294984,7 +294997,7 @@ const make$7 = require_Schema$1.gen(function* () {
|
|
|
294984
294997
|
});
|
|
294985
294998
|
yield* orchestrationEngine.dispatch({
|
|
294986
294999
|
type: "thread.revert.complete",
|
|
294987
|
-
commandId: serverCommandId("checkpoint-revert-complete"),
|
|
295000
|
+
commandId: serverCommandId$1("checkpoint-revert-complete"),
|
|
294988
295001
|
threadId: event.payload.threadId,
|
|
294989
295002
|
turnCount: event.payload.turnCount,
|
|
294990
295003
|
createdAt: now
|
|
@@ -299323,7 +299336,7 @@ function resolveBuildCommitFromEnv(env) {
|
|
|
299323
299336
|
* environment descriptor down instead of reporting an honest "unknown".
|
|
299324
299337
|
*/
|
|
299325
299338
|
function readBakedBuildCommit() {
|
|
299326
|
-
return "
|
|
299339
|
+
return "f79faf155154414eb732bc0ef180d7b98f2b7888";
|
|
299327
299340
|
}
|
|
299328
299341
|
async function resolveServerBuildCommit(input) {
|
|
299329
299342
|
if (isFullCommitSha(input.baked)) return input.baked;
|
|
@@ -300720,6 +300733,15 @@ var AuthPairingLinkRepository = class extends require_Schema$1.Service()("forge/
|
|
|
300720
300733
|
function toPersistenceSqlOrDecodeError$4(sqlOperation, decodeOperation) {
|
|
300721
300734
|
return (cause) => require_Schema$1.isSchemaError(cause) ? toPersistenceDecodeError(decodeOperation)(cause) : toPersistenceSqlError(sqlOperation)(cause);
|
|
300722
300735
|
}
|
|
300736
|
+
function decodeCredential(row) {
|
|
300737
|
+
return require_Schema$1.try_({
|
|
300738
|
+
try: () => ({
|
|
300739
|
+
...row,
|
|
300740
|
+
credential: decodeSensitiveValue("auth-pairing-link", row.credential)
|
|
300741
|
+
}),
|
|
300742
|
+
catch: toPersistenceDecodeDefect("AuthPairingLinkRepository.decryptCredential")
|
|
300743
|
+
});
|
|
300744
|
+
}
|
|
300723
300745
|
const makeAuthPairingLinkRepository = require_Schema$1.gen(function* () {
|
|
300724
300746
|
const sql = yield* require_SqlError.SqlClient;
|
|
300725
300747
|
const StoredCreateAuthPairingLinkInput = require_Schema$1.Struct({
|
|
@@ -300841,13 +300863,6 @@ const makeAuthPairingLinkRepository = require_Schema$1.gen(function* () {
|
|
|
300841
300863
|
WHERE credential_lookup = ${credentialLookup}
|
|
300842
300864
|
`
|
|
300843
300865
|
});
|
|
300844
|
-
const decodeCredential = (row) => require_Schema$1.try_({
|
|
300845
|
-
try: () => ({
|
|
300846
|
-
...row,
|
|
300847
|
-
credential: decodeSensitiveValue("auth-pairing-link", row.credential)
|
|
300848
|
-
}),
|
|
300849
|
-
catch: toPersistenceDecodeDefect("AuthPairingLinkRepository.decryptCredential")
|
|
300850
|
-
});
|
|
300851
300866
|
const create = (input) => createPairingLinkRow({
|
|
300852
300867
|
...input,
|
|
300853
300868
|
credential: encodeSensitiveValue("auth-pairing-link", input.credential),
|
|
@@ -313778,14 +313793,8 @@ function buildRuntimeUsageRowBatch(rows, cursor, batchSize = 500) {
|
|
|
313778
313793
|
previousHeadHash: cursor.headHash,
|
|
313779
313794
|
rows: capped.map((row, index) => {
|
|
313780
313795
|
const sequence = cursor.acknowledgedSequence + 1 + index;
|
|
313781
|
-
|
|
313782
|
-
|
|
313783
|
-
sequence,
|
|
313784
|
-
payloadHash: hashRuntimeUsageRow({
|
|
313785
|
-
...row,
|
|
313786
|
-
sequence
|
|
313787
|
-
})
|
|
313788
|
-
};
|
|
313796
|
+
const sequencedRow = Object.assign({}, row, { sequence });
|
|
313797
|
+
return Object.assign(sequencedRow, { payloadHash: hashRuntimeUsageRow(sequencedRow) });
|
|
313789
313798
|
})
|
|
313790
313799
|
};
|
|
313791
313800
|
}
|
|
@@ -316294,6 +316303,23 @@ const EXECUTABLE_STAGES = [
|
|
|
316294
316303
|
];
|
|
316295
316304
|
const encoder = new TextEncoder();
|
|
316296
316305
|
const decoder = new TextDecoder();
|
|
316306
|
+
function decodePersistedReport(item) {
|
|
316307
|
+
let value;
|
|
316308
|
+
try {
|
|
316309
|
+
value = JSON.parse(item.payloadJson);
|
|
316310
|
+
} catch {
|
|
316311
|
+
return null;
|
|
316312
|
+
}
|
|
316313
|
+
if (value === null || typeof value !== "object" || Array.isArray(value)) return null;
|
|
316314
|
+
const report = value;
|
|
316315
|
+
return [
|
|
316316
|
+
report.stage === item.stage,
|
|
316317
|
+
Number.isSafeInteger(report.attempt),
|
|
316318
|
+
(report.attempt ?? 0) > 0,
|
|
316319
|
+
Number.isSafeInteger(report.expectedLockVersion),
|
|
316320
|
+
(report.expectedLockVersion ?? -1) >= 0
|
|
316321
|
+
].every(Boolean) ? report : null;
|
|
316322
|
+
}
|
|
316297
316323
|
function isRecord$2(value) {
|
|
316298
316324
|
return Boolean(value) && typeof value === "object" && !Array.isArray(value);
|
|
316299
316325
|
}
|
|
@@ -317735,23 +317761,6 @@ const makePipelineRunCoordinator = require_Schema$1.gen(function* () {
|
|
|
317735
317761
|
})).applied) return yield* coordinatorError("reconcileTerminalHandoff", "PIPELINE_RECONCILE_CONFLICT", "The pipeline binding changed before its terminal state could be reconciled.");
|
|
317736
317762
|
yield* finalizeTerminalResources(binding, publicationGeneration);
|
|
317737
317763
|
}).pipe(require_Schema$1.mapError((cause) => cause instanceof PipelineRunCoordinatorError ? cause : coordinatorError("reconcileTerminalHandoff", "PIPELINE_RECONCILE_FAILED", `Failed to reconcile terminal CMMD run ${input.runId}.`, cause)));
|
|
317738
|
-
const decodePersistedReport = (item) => {
|
|
317739
|
-
let value;
|
|
317740
|
-
try {
|
|
317741
|
-
value = JSON.parse(item.payloadJson);
|
|
317742
|
-
} catch {
|
|
317743
|
-
return null;
|
|
317744
|
-
}
|
|
317745
|
-
if (value === null || typeof value !== "object" || Array.isArray(value)) return null;
|
|
317746
|
-
const report = value;
|
|
317747
|
-
return [
|
|
317748
|
-
report.stage === item.stage,
|
|
317749
|
-
Number.isSafeInteger(report.attempt),
|
|
317750
|
-
(report.attempt ?? 0) > 0,
|
|
317751
|
-
Number.isSafeInteger(report.expectedLockVersion),
|
|
317752
|
-
(report.expectedLockVersion ?? -1) >= 0
|
|
317753
|
-
].every(Boolean) ? report : null;
|
|
317754
|
-
};
|
|
317755
317764
|
const synchronizeNonAppliedReport = (item, binding, authority, reportEpoch, currentEpoch) => require_Schema$1.gen(function* () {
|
|
317756
317765
|
const snapshot = yield* client.read({
|
|
317757
317766
|
runId: item.runId,
|
|
@@ -321681,6 +321690,9 @@ function requireMergeValue(value, message) {
|
|
|
321681
321690
|
if (value === null || value === void 0) throw new Error(message);
|
|
321682
321691
|
return value;
|
|
321683
321692
|
}
|
|
321693
|
+
function serverCommandId(tag) {
|
|
321694
|
+
return CommandId.make(`server:agent-protocol:${tag}:${crypto.randomUUID()}`);
|
|
321695
|
+
}
|
|
321684
321696
|
const make = require_Schema$1.gen(function* () {
|
|
321685
321697
|
const orchestration = yield* OrchestrationEngineService;
|
|
321686
321698
|
const projectionSnapshotQuery = yield* ProjectionSnapshotQuery;
|
|
@@ -321692,7 +321704,6 @@ const make = require_Schema$1.gen(function* () {
|
|
|
321692
321704
|
const dispatch = (command) => runPromise(orchestration.dispatch(command).pipe(require_Schema$1.asVoid));
|
|
321693
321705
|
const readThread = (threadId) => runPromise(readDurableWorkerDetail(projectionSnapshotQuery, threadId)).then(require_Schema$1.getOrNull);
|
|
321694
321706
|
const readProject = (projectId) => runPromise(projectionSnapshotQuery.getProjectShellById(projectId)).then(require_Schema$1.getOrNull);
|
|
321695
|
-
const serverCommandId = (tag) => CommandId.make(`server:agent-protocol:${tag}:${crypto.randomUUID()}`);
|
|
321696
321707
|
const appendActivity = async (input) => {
|
|
321697
321708
|
const createdAt = input.createdAt ?? (/* @__PURE__ */ new Date()).toISOString();
|
|
321698
321709
|
await dispatch({
|