@cmmd-center/forge 0.9.17 → 0.9.18
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 +716 -405
- package/dist/bin.mjs +743 -444
- package/dist/client/assets/{CanvasPanel-D9sKevpO.js → CanvasPanel-DO2u5-Xk.js} +2 -2
- package/dist/client/assets/{CompositeItem-Bsi2e5qV.js → CompositeItem-BNUtGUNS.js} +2 -2
- package/dist/client/assets/{DiffPanel-ClMWe6-c.js → DiffPanel-CiOqFcOU.js} +2 -2
- package/dist/client/assets/{DiffPanel.logic-o7tDdTzf.js → DiffPanel.logic-CcUKnHmG.js} +2 -2
- package/dist/client/assets/{DiffPanelShell-R1Q66jTc.js → DiffPanelShell-B8YmcyIS.js} +33 -33
- package/dist/client/assets/{DiffWorkerPoolProvider-lEFZi8QR.js → DiffWorkerPoolProvider-XttvFu9p.js} +2 -2
- package/dist/client/assets/{PullRequestCodePanel-BpbniIb5.js → PullRequestCodePanel-BwnGKUmC.js} +2 -2
- package/dist/client/assets/{Virtualizer-B5NXbN5f.js → Virtualizer-DD1kZz4_.js} +2 -2
- package/dist/client/assets/{canvasStateStore-qioLqOoT.js → canvasStateStore-BVOZ0hkY.js} +2 -2
- package/dist/client/assets/{cmmdAuthRedirect-lmPzseq5.js → cmmdAuthRedirect-COJsfxk2.js} +2 -2
- package/dist/client/assets/{index-D0769c3n.js → index-B6v3s1Ki.js} +57 -57
- package/dist/client/assets/{index-4a61qSZ4.css → index-BUnBt2Vq.css} +1 -1
- package/dist/client/assets/{src-BL6J64vk.js → src-DEn2qb9-.js} +3 -3
- package/dist/client/assets/{toggle-CW3yNjj1.js → toggle-vjiHllrh.js} +2 -2
- package/dist/client/assets/{useTriggerFocusGuards-mvO6ygs-.js → useTriggerFocusGuards-DMJ0Xu3Z.js} +2 -2
- package/dist/client/index.html +11 -11
- package/dist/{open-FIgTDosf.mjs → open-D8mGyWmt.mjs} +3 -3
- package/package.json +1 -1
package/dist/bin.mjs
CHANGED
|
@@ -22,7 +22,7 @@ import { createCipheriv, createDecipheriv, createHash, createHmac, createPublicK
|
|
|
22
22
|
import * as FS$1 from "node:fs";
|
|
23
23
|
import fs, { accessSync, chmodSync, constants, createReadStream, existsSync, mkdirSync, mkdtempSync, promises, readFile, readFileSync, readdir, readdirSync, realpathSync, rmSync, statSync, writeFileSync } from "node:fs";
|
|
24
24
|
import * as NodeOS from "node:os";
|
|
25
|
-
import
|
|
25
|
+
import $U, { homedir, networkInterfaces, tmpdir } from "node:os";
|
|
26
26
|
import * as Path$1 from "node:path";
|
|
27
27
|
import path, { basename, delimiter, dirname, extname, isAbsolute, join, posix, relative, resolve, sep } from "node:path";
|
|
28
28
|
import { pathToFileURL } from "node:url";
|
|
@@ -19105,6 +19105,23 @@ const ProjectAvailability = Literals([
|
|
|
19105
19105
|
"missing",
|
|
19106
19106
|
"unknown"
|
|
19107
19107
|
]);
|
|
19108
|
+
/**
|
|
19109
|
+
* The CMMD record that places one Forge Project onto one Environment.
|
|
19110
|
+
*
|
|
19111
|
+
* The organization and the CMMD project together are the durable identity of a
|
|
19112
|
+
* Checkout on that Environment, and the key every lookup uses; a directory path
|
|
19113
|
+
* only breaks ties. A Forge Cloud Environment is per (organization, user), so
|
|
19114
|
+
* every Checkout on it reports the same workspace root and, once connected,
|
|
19115
|
+
* an empty `cwd` — nothing about a directory can tell them apart.
|
|
19116
|
+
*
|
|
19117
|
+
* Optional everywhere it appears: a project created before this field existed,
|
|
19118
|
+
* or one added by hand rather than from a Registration, carries none and is
|
|
19119
|
+
* still matched by the directory rules.
|
|
19120
|
+
*/
|
|
19121
|
+
const CmmdRegistration = Struct({
|
|
19122
|
+
cmmdOrganizationId: PositiveInt,
|
|
19123
|
+
cmmdProjectId: PositiveInt
|
|
19124
|
+
});
|
|
19108
19125
|
const OrchestrationProject = Struct({
|
|
19109
19126
|
id: ProjectId,
|
|
19110
19127
|
title: TrimmedNonEmptyString,
|
|
@@ -19113,6 +19130,7 @@ const OrchestrationProject = Struct({
|
|
|
19113
19130
|
availability: optional$4(ProjectAvailability),
|
|
19114
19131
|
defaultModelSelection: NullOr(ModelSelection),
|
|
19115
19132
|
defaultThreadEnvMode: optional$4(NullOr(ThreadEnvMode)),
|
|
19133
|
+
cmmdRegistration: optional$4(NullOr(CmmdRegistration)),
|
|
19116
19134
|
scripts: ArraySchema(ProjectScript),
|
|
19117
19135
|
createdAt: IsoDateTime,
|
|
19118
19136
|
updatedAt: IsoDateTime,
|
|
@@ -19384,6 +19402,7 @@ const OrchestrationProjectShell = Struct({
|
|
|
19384
19402
|
availability: optional$4(ProjectAvailability),
|
|
19385
19403
|
defaultModelSelection: NullOr(ModelSelection),
|
|
19386
19404
|
defaultThreadEnvMode: optional$4(NullOr(ThreadEnvMode)),
|
|
19405
|
+
cmmdRegistration: optional$4(NullOr(CmmdRegistration)),
|
|
19387
19406
|
scripts: ArraySchema(ProjectScript),
|
|
19388
19407
|
createdAt: IsoDateTime,
|
|
19389
19408
|
updatedAt: IsoDateTime
|
|
@@ -19463,6 +19482,7 @@ const ProjectCreateCommand = Struct({
|
|
|
19463
19482
|
workspaceRoot: TrimmedNonEmptyString,
|
|
19464
19483
|
defaultModelSelection: optional$4(NullOr(ModelSelection)),
|
|
19465
19484
|
defaultThreadEnvMode: optional$4(NullOr(ThreadEnvMode)),
|
|
19485
|
+
cmmdRegistration: optional$4(NullOr(CmmdRegistration)),
|
|
19466
19486
|
createdAt: IsoDateTime
|
|
19467
19487
|
});
|
|
19468
19488
|
const ProjectMetaUpdateCommand = Struct({
|
|
@@ -19473,6 +19493,7 @@ const ProjectMetaUpdateCommand = Struct({
|
|
|
19473
19493
|
workspaceRoot: optional$4(TrimmedNonEmptyString),
|
|
19474
19494
|
defaultModelSelection: optional$4(NullOr(ModelSelection)),
|
|
19475
19495
|
defaultThreadEnvMode: optional$4(NullOr(ThreadEnvMode)),
|
|
19496
|
+
cmmdRegistration: optional$4(NullOr(CmmdRegistration)),
|
|
19476
19497
|
scripts: optional$4(ArraySchema(ProjectScript))
|
|
19477
19498
|
});
|
|
19478
19499
|
const ProjectDeleteCommand = Struct({
|
|
@@ -19863,6 +19884,7 @@ const ProjectCreatedPayload$1 = Struct({
|
|
|
19863
19884
|
repositoryIdentity: optional$4(NullOr(RepositoryIdentity)),
|
|
19864
19885
|
defaultModelSelection: NullOr(ModelSelection),
|
|
19865
19886
|
defaultThreadEnvMode: optional$4(NullOr(ThreadEnvMode)),
|
|
19887
|
+
cmmdRegistration: optional$4(NullOr(CmmdRegistration)),
|
|
19866
19888
|
scripts: ArraySchema(ProjectScript),
|
|
19867
19889
|
createdAt: IsoDateTime,
|
|
19868
19890
|
updatedAt: IsoDateTime
|
|
@@ -19874,6 +19896,7 @@ const ProjectMetaUpdatedPayload$1 = Struct({
|
|
|
19874
19896
|
repositoryIdentity: optional$4(NullOr(RepositoryIdentity)),
|
|
19875
19897
|
defaultModelSelection: optional$4(NullOr(ModelSelection)),
|
|
19876
19898
|
defaultThreadEnvMode: optional$4(NullOr(ThreadEnvMode)),
|
|
19899
|
+
cmmdRegistration: optional$4(NullOr(CmmdRegistration)),
|
|
19877
19900
|
scripts: optional$4(ArraySchema(ProjectScript)),
|
|
19878
19901
|
updatedAt: IsoDateTime
|
|
19879
19902
|
});
|
|
@@ -20783,23 +20806,33 @@ const ThreadMetadataUpdatedPayload = Struct({
|
|
|
20783
20806
|
name: optional$4(TrimmedNonEmptyStringSchema$2),
|
|
20784
20807
|
metadata: optional$4(UnknownRecordSchema)
|
|
20785
20808
|
});
|
|
20786
|
-
const ThreadTokenUsageUpdatedPayload = Struct({
|
|
20787
|
-
|
|
20788
|
-
|
|
20789
|
-
|
|
20790
|
-
|
|
20791
|
-
|
|
20792
|
-
|
|
20793
|
-
|
|
20794
|
-
|
|
20795
|
-
|
|
20796
|
-
|
|
20797
|
-
|
|
20798
|
-
|
|
20799
|
-
|
|
20800
|
-
|
|
20801
|
-
|
|
20802
|
-
|
|
20809
|
+
const ThreadTokenUsageUpdatedPayload = Struct({
|
|
20810
|
+
usage: Struct({
|
|
20811
|
+
usedTokens: NonNegativeInt,
|
|
20812
|
+
totalProcessedTokens: optional$4(NonNegativeInt),
|
|
20813
|
+
maxTokens: optional$4(PositiveInt),
|
|
20814
|
+
inputTokens: optional$4(NonNegativeInt),
|
|
20815
|
+
cachedInputTokens: optional$4(NonNegativeInt),
|
|
20816
|
+
outputTokens: optional$4(NonNegativeInt),
|
|
20817
|
+
reasoningOutputTokens: optional$4(NonNegativeInt),
|
|
20818
|
+
lastUsedTokens: optional$4(NonNegativeInt),
|
|
20819
|
+
lastInputTokens: optional$4(NonNegativeInt),
|
|
20820
|
+
lastCachedInputTokens: optional$4(NonNegativeInt),
|
|
20821
|
+
lastOutputTokens: optional$4(NonNegativeInt),
|
|
20822
|
+
lastReasoningOutputTokens: optional$4(NonNegativeInt),
|
|
20823
|
+
toolUses: optional$4(NonNegativeInt),
|
|
20824
|
+
durationMs: optional$4(NonNegativeInt),
|
|
20825
|
+
compactsAutomatically: optional$4(Boolean$1)
|
|
20826
|
+
}),
|
|
20827
|
+
turnUsage: optional$4(Struct({
|
|
20828
|
+
scope: Literals(["turn-total", "call-delta"]),
|
|
20829
|
+
uncachedInputTokens: NonNegativeInt,
|
|
20830
|
+
cachedInputTokens: NonNegativeInt,
|
|
20831
|
+
cacheCreationTokens: NonNegativeInt,
|
|
20832
|
+
outputTokens: NonNegativeInt,
|
|
20833
|
+
reasoningTokens: NonNegativeInt
|
|
20834
|
+
}))
|
|
20835
|
+
});
|
|
20803
20836
|
const ThreadRealtimeStartedPayload = Struct({ realtimeSessionId: optional$4(TrimmedNonEmptyStringSchema$2) });
|
|
20804
20837
|
const ThreadRealtimeItemAddedPayload = Struct({ item: Unknown });
|
|
20805
20838
|
const ThreadRealtimeAudioDeltaPayload = Struct({ audio: Unknown });
|
|
@@ -49519,7 +49552,7 @@ function _supportsColor(haveStream, { streamIsTTY, sniffFlags = true } = {}) {
|
|
|
49519
49552
|
const min = forceColor || 0;
|
|
49520
49553
|
if (env.TERM === "dumb") return min;
|
|
49521
49554
|
if (process$1.platform === "win32") {
|
|
49522
|
-
const osRelease =
|
|
49555
|
+
const osRelease = $U.release().split(".");
|
|
49523
49556
|
if (Number(osRelease[0]) >= 10 && Number(osRelease[2]) >= 10586) return Number(osRelease[2]) >= 14931 ? 3 : 2;
|
|
49524
49557
|
return 1;
|
|
49525
49558
|
}
|
|
@@ -51962,7 +51995,7 @@ var require_ProcessDetector = /* @__PURE__ */ __commonJSMin(((exports) => {
|
|
|
51962
51995
|
exports.processDetector = void 0;
|
|
51963
51996
|
const api_1 = (init_esm$1(), __toCommonJS(esm_exports$1));
|
|
51964
51997
|
const semconv_1 = require_semconv$1();
|
|
51965
|
-
const os$
|
|
51998
|
+
const os$3 = __require("os");
|
|
51966
51999
|
/**
|
|
51967
52000
|
* ProcessDetector will be used to detect the resources related current process running
|
|
51968
52001
|
* and being instrumented from the NodeJS Process module.
|
|
@@ -51984,7 +52017,7 @@ var require_ProcessDetector = /* @__PURE__ */ __commonJSMin(((exports) => {
|
|
|
51984
52017
|
};
|
|
51985
52018
|
if (process.argv.length > 1) attributes[semconv_1.ATTR_PROCESS_COMMAND] = process.argv[1];
|
|
51986
52019
|
try {
|
|
51987
|
-
const userInfo = os$
|
|
52020
|
+
const userInfo = os$3.userInfo();
|
|
51988
52021
|
attributes[semconv_1.ATTR_PROCESS_OWNER] = userInfo.username;
|
|
51989
52022
|
} catch (e) {
|
|
51990
52023
|
api_1.diag.debug(`error obtaining process owner: ${e}`);
|
|
@@ -64907,7 +64940,7 @@ function normalizeNumberish(value) {
|
|
|
64907
64940
|
}
|
|
64908
64941
|
//#endregion
|
|
64909
64942
|
//#region package.json
|
|
64910
|
-
var version$1 = "0.9.
|
|
64943
|
+
var version$1 = "0.9.18";
|
|
64911
64944
|
//#endregion
|
|
64912
64945
|
//#region src/sentry.ts
|
|
64913
64946
|
const SERVER_APP_NAME = "forge-server";
|
|
@@ -68036,7 +68069,8 @@ function fixPath(options = {}) {
|
|
|
68036
68069
|
if (shellPath) break;
|
|
68037
68070
|
}
|
|
68038
68071
|
const launchctlPath = platform === "darwin" && !shellPath ? (options.readLaunchctlPath ?? readPathFromLaunchctl)() : void 0;
|
|
68039
|
-
const
|
|
68072
|
+
const hydratedPath = shellPath ?? launchctlPath;
|
|
68073
|
+
const mergedPath = options.preferProcessPath ? mergePathEntries(env.PATH, hydratedPath, platform) : mergePathEntries(hydratedPath, env.PATH, platform);
|
|
68040
68074
|
if (mergedPath) env.PATH = mergedPath;
|
|
68041
68075
|
} catch (error) {
|
|
68042
68076
|
logWarning("Failed to hydrate PATH from the user environment.", error);
|
|
@@ -73537,7 +73571,7 @@ var require_node_gyp_build = /* @__PURE__ */ __commonJSMin(((exports, module) =>
|
|
|
73537
73571
|
var fs$6 = __require("fs");
|
|
73538
73572
|
var path$5 = __require("path");
|
|
73539
73573
|
var url$1 = __require("url");
|
|
73540
|
-
var os$
|
|
73574
|
+
var os$2 = __require("os");
|
|
73541
73575
|
var runtimeRequire = typeof __webpack_require__ === "function" ? __non_webpack_require__ : __require;
|
|
73542
73576
|
var vars = process.config && process.config.variables || {};
|
|
73543
73577
|
var prebuildsOnly = !!process.env.PREBUILDS_ONLY;
|
|
@@ -73545,8 +73579,8 @@ var require_node_gyp_build = /* @__PURE__ */ __commonJSMin(((exports, module) =>
|
|
|
73545
73579
|
var abi = versions.modules;
|
|
73546
73580
|
if (versions.deno || process.isBun) abi = "unsupported";
|
|
73547
73581
|
var runtime = isElectron() ? "electron" : isNwjs() ? "node-webkit" : "node";
|
|
73548
|
-
var arch = process.env.npm_config_arch || os$
|
|
73549
|
-
var platform = process.env.npm_config_platform || os$
|
|
73582
|
+
var arch = process.env.npm_config_arch || os$2.arch();
|
|
73583
|
+
var platform = process.env.npm_config_platform || os$2.platform();
|
|
73550
73584
|
var libc = process.env.LIBC || (isMusl(platform) ? "musl" : "glibc");
|
|
73551
73585
|
var armv = process.env.ARM_VERSION || (arch === "arm64" ? "8" : vars.arm_version) || "";
|
|
73552
73586
|
var uv = (versions.uv || "").split(".")[0];
|
|
@@ -91204,7 +91238,7 @@ const launchDetached = (launch) => gen(function* () {
|
|
|
91204
91238
|
});
|
|
91205
91239
|
const OpenLive = effect(Open, gen(function* () {
|
|
91206
91240
|
const open = yield* tryPromise({
|
|
91207
|
-
try: () => import("./open-
|
|
91241
|
+
try: () => import("./open-D8mGyWmt.mjs"),
|
|
91208
91242
|
catch: (cause) => new OpenError$1({
|
|
91209
91243
|
message: "failed to load browser opener",
|
|
91210
91244
|
cause
|
|
@@ -91879,305 +91913,6 @@ var AnalyticsService = class AnalyticsService extends Service$1()("forge/telemet
|
|
|
91879
91913
|
});
|
|
91880
91914
|
};
|
|
91881
91915
|
//#endregion
|
|
91882
|
-
//#region src/cmmdSync/CmmdSyncClient.ts
|
|
91883
|
-
const SYNC_TIMEOUT_MS = 1e4;
|
|
91884
|
-
var CmmdSyncError = class extends TaggedError("CmmdSyncError") {};
|
|
91885
|
-
var CmmdSyncClient = class extends Service$1()("forge/cmmdSync/CmmdSyncClient") {};
|
|
91886
|
-
const CmmdSyncClientLive = effect(CmmdSyncClient, gen(function* () {
|
|
91887
|
-
const serverSettings = yield* ServerSettingsService;
|
|
91888
|
-
const syncTurn = (payload) => gen(function* () {
|
|
91889
|
-
const { baseUrl, apiKey } = (yield* serverSettings.getSettings.pipe(orDie)).providers.cmmd;
|
|
91890
|
-
const url = `${baseUrl.replace(/\/$/, "")}/api/forge/turns`;
|
|
91891
|
-
const headers = { "Content-Type": "application/json" };
|
|
91892
|
-
if (apiKey) headers["Authorization"] = `Bearer ${apiKey}`;
|
|
91893
|
-
const response = yield* tryPromise({
|
|
91894
|
-
try: () => fetch(url, {
|
|
91895
|
-
method: "POST",
|
|
91896
|
-
headers,
|
|
91897
|
-
body: JSON.stringify(payload),
|
|
91898
|
-
signal: AbortSignal.timeout(SYNC_TIMEOUT_MS)
|
|
91899
|
-
}),
|
|
91900
|
-
catch: (cause) => new CmmdSyncError({
|
|
91901
|
-
statusCode: 0,
|
|
91902
|
-
body: String(cause)
|
|
91903
|
-
})
|
|
91904
|
-
});
|
|
91905
|
-
const body = yield* tryPromise({
|
|
91906
|
-
try: () => response.text(),
|
|
91907
|
-
catch: (cause) => new CmmdSyncError({
|
|
91908
|
-
statusCode: response.status,
|
|
91909
|
-
body: String(cause)
|
|
91910
|
-
})
|
|
91911
|
-
});
|
|
91912
|
-
if (!response.ok) return yield* new CmmdSyncError({
|
|
91913
|
-
statusCode: response.status,
|
|
91914
|
-
body
|
|
91915
|
-
});
|
|
91916
|
-
return yield* try_({
|
|
91917
|
-
try: () => JSON.parse(body),
|
|
91918
|
-
catch: (cause) => new CmmdSyncError({
|
|
91919
|
-
statusCode: 200,
|
|
91920
|
-
body: String(cause)
|
|
91921
|
-
})
|
|
91922
|
-
});
|
|
91923
|
-
});
|
|
91924
|
-
return { syncTurn };
|
|
91925
|
-
}));
|
|
91926
|
-
//#endregion
|
|
91927
|
-
//#region src/persistence/Services/ProjectionProjects.ts
|
|
91928
|
-
/**
|
|
91929
|
-
* ProjectionProjectRepository - Projection repository interface for projects.
|
|
91930
|
-
*
|
|
91931
|
-
* Owns persistence operations for project rows in the orchestration projection
|
|
91932
|
-
* read model.
|
|
91933
|
-
*
|
|
91934
|
-
* @module ProjectionProjectRepository
|
|
91935
|
-
*/
|
|
91936
|
-
const ProjectionProject = Struct({
|
|
91937
|
-
projectId: ProjectId,
|
|
91938
|
-
title: String$1,
|
|
91939
|
-
workspaceRoot: String$1,
|
|
91940
|
-
defaultModelSelection: NullOr(ModelSelection),
|
|
91941
|
-
defaultThreadEnvMode: NullOr(ThreadEnvMode),
|
|
91942
|
-
scripts: ArraySchema(ProjectScript),
|
|
91943
|
-
createdAt: IsoDateTime,
|
|
91944
|
-
updatedAt: IsoDateTime,
|
|
91945
|
-
deletedAt: NullOr(IsoDateTime)
|
|
91946
|
-
});
|
|
91947
|
-
const GetProjectionProjectInput = Struct({ projectId: ProjectId });
|
|
91948
|
-
const DeleteProjectionProjectInput = Struct({ projectId: ProjectId });
|
|
91949
|
-
/**
|
|
91950
|
-
* ProjectionProjectRepository - Service tag for project projection persistence.
|
|
91951
|
-
*/
|
|
91952
|
-
var ProjectionProjectRepository = class extends Service$1()("forge/persistence/Services/ProjectionProjects/ProjectionProjectRepository") {};
|
|
91953
|
-
//#endregion
|
|
91954
|
-
//#region src/persistence/Services/ProjectionThreadMessages.ts
|
|
91955
|
-
/**
|
|
91956
|
-
* ProjectionThreadMessageRepository - Projection repository interface for messages.
|
|
91957
|
-
*
|
|
91958
|
-
* Owns persistence operations for projected thread messages rendered in the
|
|
91959
|
-
* orchestration read model.
|
|
91960
|
-
*
|
|
91961
|
-
* @module ProjectionThreadMessageRepository
|
|
91962
|
-
*/
|
|
91963
|
-
const ProjectionThreadMessage = Struct({
|
|
91964
|
-
messageId: MessageId,
|
|
91965
|
-
threadId: ThreadId,
|
|
91966
|
-
turnId: NullOr(TurnId),
|
|
91967
|
-
role: OrchestrationMessageRole,
|
|
91968
|
-
text: String$1,
|
|
91969
|
-
attachments: optional$4(ArraySchema(ChatAttachment)),
|
|
91970
|
-
isStreaming: Boolean$1,
|
|
91971
|
-
createdAt: IsoDateTime,
|
|
91972
|
-
updatedAt: IsoDateTime
|
|
91973
|
-
});
|
|
91974
|
-
const ListProjectionThreadMessagesInput = Struct({ threadId: ThreadId });
|
|
91975
|
-
const GetProjectionThreadMessageInput = Struct({ messageId: MessageId });
|
|
91976
|
-
const DeleteProjectionThreadMessagesInput = Struct({ threadId: ThreadId });
|
|
91977
|
-
/**
|
|
91978
|
-
* ProjectionThreadMessageRepository - Service tag for message projection persistence.
|
|
91979
|
-
*/
|
|
91980
|
-
var ProjectionThreadMessageRepository = class extends Service$1()("forge/persistence/Services/ProjectionThreadMessages/ProjectionThreadMessageRepository") {};
|
|
91981
|
-
//#endregion
|
|
91982
|
-
//#region src/persistence/Services/ProjectionThreads.ts
|
|
91983
|
-
/**
|
|
91984
|
-
* ProjectionThreadRepository - Projection repository interface for threads.
|
|
91985
|
-
*
|
|
91986
|
-
* Owns persistence operations for projected thread records in the
|
|
91987
|
-
* orchestration read model.
|
|
91988
|
-
*
|
|
91989
|
-
* @module ProjectionThreadRepository
|
|
91990
|
-
*/
|
|
91991
|
-
const ProjectionThread = Struct({
|
|
91992
|
-
threadId: ThreadId,
|
|
91993
|
-
projectId: ProjectId,
|
|
91994
|
-
title: String$1,
|
|
91995
|
-
modelSelection: ModelSelection,
|
|
91996
|
-
runtimeMode: RuntimeMode$1,
|
|
91997
|
-
interactionMode: ProviderInteractionMode,
|
|
91998
|
-
branch: NullOr(String$1),
|
|
91999
|
-
worktreePath: NullOr(String$1),
|
|
92000
|
-
latestTurnId: NullOr(TurnId),
|
|
92001
|
-
createdAt: IsoDateTime,
|
|
92002
|
-
updatedAt: IsoDateTime,
|
|
92003
|
-
archivedAt: NullOr(IsoDateTime),
|
|
92004
|
-
settledAt: NullOr(IsoDateTime),
|
|
92005
|
-
settledOverride: NullOr(Literals(["settled", "active"])),
|
|
92006
|
-
latestUserMessageAt: NullOr(IsoDateTime),
|
|
92007
|
-
pendingApprovalCount: NonNegativeInt,
|
|
92008
|
-
pendingUserInputCount: NonNegativeInt,
|
|
92009
|
-
hasActionableProposedPlan: NonNegativeInt,
|
|
92010
|
-
deletedAt: NullOr(IsoDateTime),
|
|
92011
|
-
kind: ThreadKind.pipe(withDecodingDefault(succeed("master"))),
|
|
92012
|
-
parentThreadId: NullOr(ThreadId).pipe(withDecodingDefault(succeed(null))),
|
|
92013
|
-
anchorKind: CmmdAnchorKind.pipe(withDecodingDefault(succeed("scratch"))),
|
|
92014
|
-
anchorCmmdId: NullOr(String$1).pipe(withDecodingDefault(succeed(null))),
|
|
92015
|
-
linkedPullRequest: optionalKey(NullOr(LinkedPullRequest)),
|
|
92016
|
-
status: ThreadStatus.pipe(withDecodingDefault(succeed("idle"))),
|
|
92017
|
-
workerRole: NullOr(WorkerRole).pipe(withDecodingDefault(succeed(null))),
|
|
92018
|
-
goal: NullOr(String$1).pipe(withDecodingDefault(succeed(null))),
|
|
92019
|
-
titleRegeneration: NullOr(ThreadTitleRegeneration).pipe(withDecodingDefault(succeed(null))),
|
|
92020
|
-
pendingAutoCreatePrompt: optional$4(NullOr(AutoCreateTaskPrompt)).pipe(withDecodingDefault(succeed(null))),
|
|
92021
|
-
rateLimitStatus: optional$4(ArraySchema(ThreadProviderRateLimitStatus)).pipe(withDecodingDefault(succeed([])))
|
|
92022
|
-
});
|
|
92023
|
-
const GetProjectionThreadInput = Struct({ threadId: ThreadId });
|
|
92024
|
-
const DeleteProjectionThreadInput = Struct({ threadId: ThreadId });
|
|
92025
|
-
const ListProjectionThreadsByProjectInput = Struct({ projectId: ProjectId });
|
|
92026
|
-
/**
|
|
92027
|
-
* ProjectionThreadRepository - Service tag for thread projection persistence.
|
|
92028
|
-
*/
|
|
92029
|
-
var ProjectionThreadRepository = class extends Service$1()("forge/persistence/Services/ProjectionThreads/ProjectionThreadRepository") {};
|
|
92030
|
-
//#endregion
|
|
92031
|
-
//#region src/cmmdSync/TurnSerializer.ts
|
|
92032
|
-
var TurnSerializer = class extends Service$1()("forge/cmmdSync/TurnSerializer") {};
|
|
92033
|
-
const TurnSerializerLive = effect(TurnSerializer, gen(function* () {
|
|
92034
|
-
const threadRepo = yield* ProjectionThreadRepository;
|
|
92035
|
-
const projectRepo = yield* ProjectionProjectRepository;
|
|
92036
|
-
const messageRepo = yield* ProjectionThreadMessageRepository;
|
|
92037
|
-
const buildPayload = (threadId, turnId, completedAt) => gen(function* () {
|
|
92038
|
-
const maybeThread = yield* threadRepo.getById({ threadId }).pipe(orDie);
|
|
92039
|
-
if (isNone(maybeThread)) return yield* die$1(/* @__PURE__ */ new Error(`Thread ${threadId} not found for CMMD sync`));
|
|
92040
|
-
const thread = maybeThread.value;
|
|
92041
|
-
const maybeProject = yield* projectRepo.getById({ projectId: thread.projectId }).pipe(orDie);
|
|
92042
|
-
if (isNone(maybeProject)) return yield* die$1(/* @__PURE__ */ new Error(`Project ${thread.projectId} not found for CMMD sync`));
|
|
92043
|
-
const project = maybeProject.value;
|
|
92044
|
-
const turnMsgs = (yield* messageRepo.listByThreadId({ threadId }).pipe(orDie)).filter((m) => m.turnId === turnId);
|
|
92045
|
-
const userMsg = turnMsgs.find((m) => m.role === "user")?.text ?? "";
|
|
92046
|
-
const assistantMsg = turnMsgs.find((m) => m.role === "assistant")?.text ?? "";
|
|
92047
|
-
const startedAt = turnMsgs.find((m) => m.role === "user")?.createdAt ?? completedAt;
|
|
92048
|
-
return {
|
|
92049
|
-
forgeSessionId: threadId,
|
|
92050
|
-
forgeTurnId: turnId,
|
|
92051
|
-
workspaceId: null,
|
|
92052
|
-
userId: null,
|
|
92053
|
-
projectPath: project.workspaceRoot,
|
|
92054
|
-
projectTitle: project.title,
|
|
92055
|
-
threadTitle: thread.title,
|
|
92056
|
-
model: thread.modelSelection.model,
|
|
92057
|
-
branch: thread.branch,
|
|
92058
|
-
userMessage: userMsg,
|
|
92059
|
-
assistantMessage: assistantMsg,
|
|
92060
|
-
toolCalls: [],
|
|
92061
|
-
status: "complete",
|
|
92062
|
-
startedAt,
|
|
92063
|
-
completedAt,
|
|
92064
|
-
forgeVersion: version$1
|
|
92065
|
-
};
|
|
92066
|
-
});
|
|
92067
|
-
return { buildPayload };
|
|
92068
|
-
}));
|
|
92069
|
-
//#endregion
|
|
92070
|
-
//#region src/cmmdSync/TurnCompletionWatcher.ts
|
|
92071
|
-
var TurnCompletionWatcher = class extends Service$1()("forge/cmmdSync/TurnCompletionWatcher") {};
|
|
92072
|
-
const isTurnDiffCompleted = (e) => e.type === "thread.turn-diff-completed";
|
|
92073
|
-
const TurnCompletionWatcherLive = effect(TurnCompletionWatcher, gen(function* () {
|
|
92074
|
-
const engine = yield* OrchestrationEngineService;
|
|
92075
|
-
const serializer = yield* TurnSerializer;
|
|
92076
|
-
const syncClient = yield* CmmdSyncClient;
|
|
92077
|
-
const serverSettings = yield* ServerSettingsService;
|
|
92078
|
-
const sql = yield* SqlClient;
|
|
92079
|
-
const enqueueForRetry = (threadId, turnId, payloadJson) => sql`
|
|
92080
|
-
INSERT INTO cmmd_session_sync_queue
|
|
92081
|
-
(thread_id, turn_id, payload_json, status, attempt_count, created_at)
|
|
92082
|
-
VALUES
|
|
92083
|
-
(${threadId}, ${turnId}, ${payloadJson}, 'pending', 0, ${(/* @__PURE__ */ new Date()).toISOString()})
|
|
92084
|
-
ON CONFLICT (turn_id) DO NOTHING
|
|
92085
|
-
`.pipe(orDie);
|
|
92086
|
-
const processEvent = (event) => gen(function* () {
|
|
92087
|
-
const settings = yield* serverSettings.getSettings.pipe(orDie);
|
|
92088
|
-
if (!settings.providers.cmmd.enabled || !settings.providers.cmmd.apiKey) return;
|
|
92089
|
-
const { threadId, turnId, completedAt } = event.payload;
|
|
92090
|
-
const turnPayload = yield* serializer.buildPayload(threadId, turnId, completedAt);
|
|
92091
|
-
yield* syncClient.syncTurn(turnPayload).pipe(catch_((err) => gen(function* () {
|
|
92092
|
-
yield* logWarning$1("CMMD sync: push failed, queuing for retry", {
|
|
92093
|
-
threadId,
|
|
92094
|
-
turnId,
|
|
92095
|
-
statusCode: err.statusCode
|
|
92096
|
-
});
|
|
92097
|
-
if (err.statusCode === 0 || err.statusCode >= 500) yield* enqueueForRetry(threadId, turnId, JSON.stringify(turnPayload));
|
|
92098
|
-
})));
|
|
92099
|
-
}).pipe(catchCause((cause) => logError("CMMD sync: unhandled error in turn watcher", {
|
|
92100
|
-
cause,
|
|
92101
|
-
threadId: event.payload.threadId,
|
|
92102
|
-
turnId: event.payload.turnId
|
|
92103
|
-
})));
|
|
92104
|
-
const start = () => engine.streamDomainEvents.pipe(filter$2(isTurnDiffCompleted), mapEffect$1(processEvent, { concurrency: 1 }), runDrain, forkScoped, asVoid);
|
|
92105
|
-
return { start };
|
|
92106
|
-
}));
|
|
92107
|
-
//#endregion
|
|
92108
|
-
//#region src/cmmdSync/SyncWorker.ts
|
|
92109
|
-
const MAX_ATTEMPTS = 5;
|
|
92110
|
-
const DRAIN_BATCH = 10;
|
|
92111
|
-
var CmmdSyncWorker = class extends Service$1()("forge/cmmdSync/CmmdSyncWorker") {};
|
|
92112
|
-
/**
|
|
92113
|
-
* Recovers rows that were set to 'in_flight' before a server crash.
|
|
92114
|
-
*
|
|
92115
|
-
* Exported so regression tests can call it directly through the test's SqlClient
|
|
92116
|
-
* (same ambient context) while verifying the exact production SQL path.
|
|
92117
|
-
* `start()` delegates to this constant.
|
|
92118
|
-
*/
|
|
92119
|
-
const resetOrphanedInFlightRows = gen(function* () {
|
|
92120
|
-
yield* (yield* SqlClient)`
|
|
92121
|
-
UPDATE cmmd_session_sync_queue SET status = 'pending'
|
|
92122
|
-
WHERE status = 'in_flight'
|
|
92123
|
-
`.pipe(orDie);
|
|
92124
|
-
});
|
|
92125
|
-
const CmmdSyncWorkerLive = effect(CmmdSyncWorker, gen(function* () {
|
|
92126
|
-
const syncClient = yield* CmmdSyncClient;
|
|
92127
|
-
const serverSettings = yield* ServerSettingsService;
|
|
92128
|
-
const sql = yield* SqlClient;
|
|
92129
|
-
const processRow = (row) => gen(function* () {
|
|
92130
|
-
yield* sql`
|
|
92131
|
-
UPDATE cmmd_session_sync_queue
|
|
92132
|
-
SET status = 'in_flight', attempt_count = attempt_count + 1, last_attempted_at = ${(/* @__PURE__ */ new Date()).toISOString()}
|
|
92133
|
-
WHERE turn_id = ${row.turn_id}
|
|
92134
|
-
`.pipe(orDie);
|
|
92135
|
-
const payload = JSON.parse(row.payload_json);
|
|
92136
|
-
yield* syncClient.syncTurn(payload).pipe(flatMap(() => sql`DELETE FROM cmmd_session_sync_queue WHERE turn_id = ${row.turn_id}`.pipe(orDie)), catch_((err) => gen(function* () {
|
|
92137
|
-
const isClientError = err.statusCode >= 400 && err.statusCode < 500;
|
|
92138
|
-
const exhausted = row.attempt_count + 1 >= MAX_ATTEMPTS;
|
|
92139
|
-
const nextStatus = isClientError || exhausted ? "failed" : "pending";
|
|
92140
|
-
yield* sql`
|
|
92141
|
-
UPDATE cmmd_session_sync_queue
|
|
92142
|
-
SET status = ${nextStatus}
|
|
92143
|
-
WHERE turn_id = ${row.turn_id}
|
|
92144
|
-
`.pipe(orDie);
|
|
92145
|
-
if (nextStatus === "failed") yield* logWarning$1("CMMD sync: turn permanently failed", {
|
|
92146
|
-
turnId: row.turn_id,
|
|
92147
|
-
threadId: row.thread_id,
|
|
92148
|
-
statusCode: err.statusCode,
|
|
92149
|
-
attempts: row.attempt_count + 1
|
|
92150
|
-
});
|
|
92151
|
-
})), catchCause((cause) => gen(function* () {
|
|
92152
|
-
const nextStatus = row.attempt_count + 1 >= MAX_ATTEMPTS ? "failed" : "pending";
|
|
92153
|
-
yield* sql`
|
|
92154
|
-
UPDATE cmmd_session_sync_queue
|
|
92155
|
-
SET status = ${nextStatus}
|
|
92156
|
-
WHERE turn_id = ${row.turn_id}
|
|
92157
|
-
`.pipe(orDie);
|
|
92158
|
-
yield* logError("CMMD sync: unhandled defect in processRow", {
|
|
92159
|
-
turnId: row.turn_id,
|
|
92160
|
-
threadId: row.thread_id,
|
|
92161
|
-
cause,
|
|
92162
|
-
nextStatus
|
|
92163
|
-
});
|
|
92164
|
-
})));
|
|
92165
|
-
});
|
|
92166
|
-
const drainQueue = gen(function* () {
|
|
92167
|
-
const settings = yield* serverSettings.getSettings.pipe(orDie);
|
|
92168
|
-
if (!settings.providers.cmmd.enabled || !settings.providers.cmmd.apiKey) return;
|
|
92169
|
-
yield* forEach(yield* sql`
|
|
92170
|
-
SELECT turn_id, thread_id, payload_json, attempt_count
|
|
92171
|
-
FROM cmmd_session_sync_queue
|
|
92172
|
-
WHERE status = 'pending'
|
|
92173
|
-
ORDER BY created_at ASC
|
|
92174
|
-
LIMIT ${DRAIN_BATCH}
|
|
92175
|
-
`.pipe(orDie), processRow, { concurrency: 1 });
|
|
92176
|
-
});
|
|
92177
|
-
const start = () => resetOrphanedInFlightRows.pipe(provideService(SqlClient, sql), andThen(drainQueue.pipe(catchCause((cause) => logError("CMMD sync worker: unexpected error during drain", { cause })), repeat(spaced("30 seconds")), forkScoped, asVoid)));
|
|
92178
|
-
return { start };
|
|
92179
|
-
}));
|
|
92180
|
-
//#endregion
|
|
92181
91916
|
//#region src/runtimeReplication/Services/RuntimeReplication.ts
|
|
92182
91917
|
var RuntimeReplication = class extends Service$1()("forge/runtimeReplication/Services/RuntimeReplication") {};
|
|
92183
91918
|
//#endregion
|
|
@@ -92641,8 +92376,33 @@ const replicaEventKinds = new Set([
|
|
|
92641
92376
|
"activity_summary",
|
|
92642
92377
|
"turn_status",
|
|
92643
92378
|
"error_summary",
|
|
92644
|
-
"tool_call"
|
|
92379
|
+
"tool_call",
|
|
92380
|
+
"turn_usage"
|
|
92645
92381
|
]);
|
|
92382
|
+
const turnUsageTokenKeys = [
|
|
92383
|
+
"uncachedInputTokens",
|
|
92384
|
+
"cachedInputTokens",
|
|
92385
|
+
"cacheCreationTokens",
|
|
92386
|
+
"outputTokens",
|
|
92387
|
+
"reasoningTokens"
|
|
92388
|
+
];
|
|
92389
|
+
function isNonNegativeInt(value) {
|
|
92390
|
+
return typeof value === "number" && Number.isSafeInteger(value) && value >= 0;
|
|
92391
|
+
}
|
|
92392
|
+
/** `usage` is null for an Unreported turn, otherwise exactly the five buckets. */
|
|
92393
|
+
function isValidTurnUsageTokens(value) {
|
|
92394
|
+
if (value === null) return true;
|
|
92395
|
+
if (!isRecord$16(value)) return false;
|
|
92396
|
+
return turnUsageTokenKeys.every((key) => isNonNegativeInt(value[key])) && Object.keys(value).every((key) => turnUsageTokenKeys.includes(key));
|
|
92397
|
+
}
|
|
92398
|
+
/** A turn_usage row: no text, no status, and its record in `payload`. */
|
|
92399
|
+
function hasValidTurnUsagePayload(value) {
|
|
92400
|
+
const payload = value.payload;
|
|
92401
|
+
return value.text === null && value.status === null && typeof value.turnId === "string" && value.turnId.length > 0 && isRecord$16(payload) && isNonBlankString(payload.provider) && isNonBlankString(payload.model) && "usage" in payload && isValidTurnUsageTokens(payload.usage);
|
|
92402
|
+
}
|
|
92403
|
+
function hasValidEventTurn(value) {
|
|
92404
|
+
return !("turnId" in value) || value.turnId === null || isNonBlankString(value.turnId);
|
|
92405
|
+
}
|
|
92646
92406
|
const replicaTurnStatuses$1 = new Set([
|
|
92647
92407
|
"pending",
|
|
92648
92408
|
"running",
|
|
@@ -92662,9 +92422,10 @@ function hasEventPayloadKey(value) {
|
|
|
92662
92422
|
return value.kind !== "tool_call" || "payload" in value;
|
|
92663
92423
|
}
|
|
92664
92424
|
function hasValidEventFields(value) {
|
|
92665
|
-
return hasValidEventSequence(value.sequence) && isNonBlankString(value.eventId) && replicaEventKinds.has(value.kind) && nullableString(value.text) && hasValidEventStatus(value) && hasEventPayloadKey(value) && isIsoDateTime(value.occurredAt);
|
|
92425
|
+
return hasValidEventSequence(value.sequence) && isNonBlankString(value.eventId) && replicaEventKinds.has(value.kind) && hasValidEventTurn(value) && nullableString(value.text) && hasValidEventStatus(value) && hasEventPayloadKey(value) && isIsoDateTime(value.occurredAt);
|
|
92666
92426
|
}
|
|
92667
92427
|
function hasValidEventPayload(value) {
|
|
92428
|
+
if (value.kind === "turn_usage") return hasValidTurnUsagePayload(value);
|
|
92668
92429
|
if (value.kind === "turn_status") return value.text === null && value.status !== null;
|
|
92669
92430
|
if (value.kind === "tool_call") return isNonBlankString(value.text) && value.status !== null;
|
|
92670
92431
|
return isNonBlankString(value.text) && value.status === null;
|
|
@@ -92771,28 +92532,41 @@ const REPLICA_MESSAGE_ID_PREFIX = "replica-source-v1:";
|
|
|
92771
92532
|
function isReservedReplicaSourceMessageId(value) {
|
|
92772
92533
|
return value.startsWith(REPLICA_MESSAGE_ID_PREFIX);
|
|
92773
92534
|
}
|
|
92535
|
+
/**
|
|
92536
|
+
* A hydrated message keeps its CMMD turn inside its id rather than in the
|
|
92537
|
+
* projection's `turnId`: `retainThreadMessagesAfterRevert` drops messages whose
|
|
92538
|
+
* turn is not among the local checkpoints, and a hydrated thread has none, so
|
|
92539
|
+
* a later local revert would erase recovered history. The id is the one slot
|
|
92540
|
+
* the serializer can read back without touching revert semantics.
|
|
92541
|
+
*/
|
|
92774
92542
|
function encodeReplicaSourceMessageId(input) {
|
|
92775
|
-
|
|
92543
|
+
const base = `${REPLICA_MESSAGE_ID_PREFIX}${input.sequence}:${Buffer.from(input.scope).toString("base64url")}:${Buffer.from(input.eventId).toString("base64url")}`;
|
|
92544
|
+
return input.turnId ? `${base}:${Buffer.from(input.turnId).toString("base64url")}` : base;
|
|
92545
|
+
}
|
|
92546
|
+
/** Decodes one base64url segment, or null when it does not round-trip exactly. */
|
|
92547
|
+
function decodeExactSegment(encoded) {
|
|
92548
|
+
const decoded = Buffer.from(encoded, "base64url").toString("utf8");
|
|
92549
|
+
return decoded.length > 0 && Buffer.from(decoded).toString("base64url") === encoded ? decoded : null;
|
|
92776
92550
|
}
|
|
92777
92551
|
function decodeReplicaSourceMessageId(value) {
|
|
92778
92552
|
if (!value.startsWith(REPLICA_MESSAGE_ID_PREFIX)) return null;
|
|
92779
|
-
const
|
|
92780
|
-
|
|
92781
|
-
|
|
92782
|
-
const sequence = Number(value.slice(18, sequenceSeparator));
|
|
92553
|
+
const [sequenceText, encodedScope, encodedEventId, encodedTurnId, ...rest] = value.slice(18).split(":");
|
|
92554
|
+
if (rest.length > 0 || encodedScope === void 0 || encodedEventId === void 0) return null;
|
|
92555
|
+
const sequence = Number(sequenceText);
|
|
92783
92556
|
if (!Number.isSafeInteger(sequence) || sequence <= 0) return null;
|
|
92784
|
-
|
|
92785
|
-
|
|
92786
|
-
|
|
92787
|
-
|
|
92788
|
-
|
|
92789
|
-
|
|
92790
|
-
|
|
92791
|
-
|
|
92792
|
-
|
|
92793
|
-
|
|
92794
|
-
|
|
92795
|
-
|
|
92557
|
+
const scope = decodeExactSegment(encodedScope);
|
|
92558
|
+
const eventId = decodeExactSegment(encodedEventId);
|
|
92559
|
+
if (scope === null || eventId === null) return null;
|
|
92560
|
+
if (encodedTurnId === void 0) return {
|
|
92561
|
+
sequence,
|
|
92562
|
+
eventId
|
|
92563
|
+
};
|
|
92564
|
+
const turnId = decodeExactSegment(encodedTurnId);
|
|
92565
|
+
return turnId === null ? null : {
|
|
92566
|
+
sequence,
|
|
92567
|
+
eventId,
|
|
92568
|
+
turnId
|
|
92569
|
+
};
|
|
92796
92570
|
}
|
|
92797
92571
|
var RuntimeThreadHistoryConflict = class extends Error {
|
|
92798
92572
|
constructor(message) {
|
|
@@ -92810,22 +92584,50 @@ function runtimeThreadFinalGenerationId(runtimeId, streamKey, events) {
|
|
|
92810
92584
|
const projectionHash = Crypto.createHash("sha256").update(JSON.stringify(events)).digest("base64url");
|
|
92811
92585
|
return `${runtimeThreadGenerationId(runtimeId, streamKey)}:final:${projectionHash}`;
|
|
92812
92586
|
}
|
|
92587
|
+
function canonicalKindFields(event) {
|
|
92588
|
+
switch (event.kind) {
|
|
92589
|
+
case "user_message":
|
|
92590
|
+
case "assistant_message": return { text: event.text };
|
|
92591
|
+
case "activity_summary":
|
|
92592
|
+
case "error_summary": return { summary: event.summary };
|
|
92593
|
+
case "turn_status": return { status: event.status };
|
|
92594
|
+
case "tool_call": return {
|
|
92595
|
+
summary: event.summary,
|
|
92596
|
+
status: event.status,
|
|
92597
|
+
...event.payload !== void 0 ? { payload: event.payload } : {}
|
|
92598
|
+
};
|
|
92599
|
+
case "turn_usage": return canonicalTurnUsageFields(event);
|
|
92600
|
+
}
|
|
92601
|
+
}
|
|
92602
|
+
/**
|
|
92603
|
+
* CMMD's forge-runtime-thread-replication-protocol.ts builds this object in
|
|
92604
|
+
* the same order and rejects a batch whose hash differs. `turnId` comes after
|
|
92605
|
+
* every kind-specific field so an event sent without one hashes byte for byte
|
|
92606
|
+
* as it did before recorded turns existed.
|
|
92607
|
+
*/
|
|
92813
92608
|
function canonicalEventPayload(event) {
|
|
92814
92609
|
return JSON.stringify({
|
|
92815
92610
|
sequence: event.sequence,
|
|
92816
92611
|
eventId: event.eventId,
|
|
92817
92612
|
occurredAt: event.occurredAt,
|
|
92818
92613
|
kind: event.kind,
|
|
92819
|
-
...event
|
|
92820
|
-
...event.
|
|
92821
|
-
...event.kind === "turn_status" ? { status: event.status } : {},
|
|
92822
|
-
...event.kind === "tool_call" ? {
|
|
92823
|
-
summary: event.summary,
|
|
92824
|
-
status: event.status,
|
|
92825
|
-
...event.payload !== void 0 ? { payload: event.payload } : {}
|
|
92826
|
-
} : {}
|
|
92614
|
+
...canonicalKindFields(event),
|
|
92615
|
+
...event.turnId !== void 0 ? { turnId: event.turnId } : {}
|
|
92827
92616
|
});
|
|
92828
92617
|
}
|
|
92618
|
+
function canonicalTurnUsageFields(event) {
|
|
92619
|
+
return {
|
|
92620
|
+
provider: event.provider,
|
|
92621
|
+
model: event.model,
|
|
92622
|
+
usage: event.usage === null ? null : {
|
|
92623
|
+
uncachedInputTokens: event.usage.uncachedInputTokens,
|
|
92624
|
+
cachedInputTokens: event.usage.cachedInputTokens,
|
|
92625
|
+
cacheCreationTokens: event.usage.cacheCreationTokens,
|
|
92626
|
+
outputTokens: event.usage.outputTokens,
|
|
92627
|
+
reasoningTokens: event.usage.reasoningTokens
|
|
92628
|
+
}
|
|
92629
|
+
};
|
|
92630
|
+
}
|
|
92829
92631
|
function hashRuntimeThreadEvent(event) {
|
|
92830
92632
|
return sha256$3(canonicalEventPayload(event));
|
|
92831
92633
|
}
|
|
@@ -92946,7 +92748,8 @@ function replicaMessage(runtimeId, generationId, event) {
|
|
|
92946
92748
|
id: MessageId.make(encodeReplicaSourceMessageId({
|
|
92947
92749
|
sequence: event.sequence,
|
|
92948
92750
|
scope: stableReplicaDigest(runtimeId, generationId),
|
|
92949
|
-
eventId: event.eventId
|
|
92751
|
+
eventId: event.eventId,
|
|
92752
|
+
turnId: event.turnId ?? null
|
|
92950
92753
|
})),
|
|
92951
92754
|
role: event.kind === "user_message" ? "user" : "assistant",
|
|
92952
92755
|
text: event.text ?? "",
|
|
@@ -92956,11 +92759,33 @@ function replicaMessage(runtimeId, generationId, event) {
|
|
|
92956
92759
|
updatedAt: event.occurredAt
|
|
92957
92760
|
};
|
|
92958
92761
|
}
|
|
92959
|
-
function
|
|
92960
|
-
const
|
|
92762
|
+
function replicaTurnUsage(event) {
|
|
92763
|
+
const payload = event.payload;
|
|
92764
|
+
return {
|
|
92765
|
+
eventId: event.eventId,
|
|
92766
|
+
occurredAt: event.occurredAt,
|
|
92767
|
+
kind: "turn_usage",
|
|
92768
|
+
turnId: event.turnId,
|
|
92769
|
+
provider: payload.provider,
|
|
92770
|
+
model: payload.model,
|
|
92771
|
+
usage: payload.usage === null ? null : {
|
|
92772
|
+
uncachedInputTokens: payload.usage.uncachedInputTokens,
|
|
92773
|
+
cachedInputTokens: payload.usage.cachedInputTokens,
|
|
92774
|
+
cacheCreationTokens: payload.usage.cacheCreationTokens,
|
|
92775
|
+
outputTokens: payload.usage.outputTokens,
|
|
92776
|
+
reasoningTokens: payload.usage.reasoningTokens
|
|
92777
|
+
}
|
|
92778
|
+
};
|
|
92779
|
+
}
|
|
92780
|
+
function replicaEventBase(event) {
|
|
92781
|
+
const turn = typeof event.turnId === "string" ? { turnId: event.turnId } : {};
|
|
92782
|
+
return {
|
|
92961
92783
|
eventId: event.eventId,
|
|
92962
|
-
occurredAt: event.occurredAt
|
|
92784
|
+
occurredAt: event.occurredAt,
|
|
92785
|
+
...turn
|
|
92963
92786
|
};
|
|
92787
|
+
}
|
|
92788
|
+
function replicaTextEvent(event, base) {
|
|
92964
92789
|
switch (event.kind) {
|
|
92965
92790
|
case "user_message":
|
|
92966
92791
|
case "assistant_message": return {
|
|
@@ -92974,31 +92799,50 @@ function replicaSourceEvent(event) {
|
|
|
92974
92799
|
kind: event.kind,
|
|
92975
92800
|
summary: event.text
|
|
92976
92801
|
};
|
|
92977
|
-
|
|
92978
|
-
...base,
|
|
92979
|
-
kind: event.kind,
|
|
92980
|
-
status: event.status
|
|
92981
|
-
};
|
|
92982
|
-
case "tool_call": return {
|
|
92983
|
-
...base,
|
|
92984
|
-
kind: event.kind,
|
|
92985
|
-
summary: event.text,
|
|
92986
|
-
status: event.status,
|
|
92987
|
-
payload: event.payload ?? void 0
|
|
92988
|
-
};
|
|
92802
|
+
default: return null;
|
|
92989
92803
|
}
|
|
92990
92804
|
}
|
|
92805
|
+
function replicaSourceEvent(event) {
|
|
92806
|
+
const base = replicaEventBase(event);
|
|
92807
|
+
const textEvent = replicaTextEvent(event, base);
|
|
92808
|
+
if (textEvent !== null) return textEvent;
|
|
92809
|
+
if (event.kind === "turn_usage") return replicaTurnUsage(event);
|
|
92810
|
+
if (event.kind === "turn_status") return {
|
|
92811
|
+
...base,
|
|
92812
|
+
kind: event.kind,
|
|
92813
|
+
status: replicaTurnStatus(event)
|
|
92814
|
+
};
|
|
92815
|
+
return {
|
|
92816
|
+
...base,
|
|
92817
|
+
kind: "tool_call",
|
|
92818
|
+
summary: event.text,
|
|
92819
|
+
status: event.status,
|
|
92820
|
+
payload: event.payload ?? void 0
|
|
92821
|
+
};
|
|
92822
|
+
}
|
|
92823
|
+
function replicaTurnStatus(event) {
|
|
92824
|
+
return event.status;
|
|
92825
|
+
}
|
|
92826
|
+
function replicaActivitySummary(event) {
|
|
92827
|
+
if (event.kind === "turn_status") return event.status ?? "unknown";
|
|
92828
|
+
if (event.kind === "turn_usage") return "Turn usage recorded";
|
|
92829
|
+
return event.text ?? "";
|
|
92830
|
+
}
|
|
92831
|
+
function replicaActivityTone(event) {
|
|
92832
|
+
const failed = event.kind === "turn_status" && event.status === "failed";
|
|
92833
|
+
return event.kind === "error_summary" || failed ? "error" : "info";
|
|
92834
|
+
}
|
|
92991
92835
|
function replicaActivity(runtimeId, generationId, event) {
|
|
92992
|
-
const summary = event.kind === "turn_status" ? event.status ?? "unknown" : event.text ?? "";
|
|
92993
92836
|
return {
|
|
92994
92837
|
id: EventId.make("replica:" + stableReplicaDigest(runtimeId, generationId, event.eventId, "activity")),
|
|
92995
|
-
tone: event
|
|
92838
|
+
tone: replicaActivityTone(event),
|
|
92996
92839
|
kind: "replica." + event.kind,
|
|
92997
|
-
summary,
|
|
92840
|
+
summary: replicaActivitySummary(event),
|
|
92998
92841
|
payload: {
|
|
92999
92842
|
sourceEventId: event.eventId,
|
|
93000
92843
|
sourceGenerationId: generationId,
|
|
93001
92844
|
sourceRuntimeId: runtimeId,
|
|
92845
|
+
sourceTurnId: typeof event.turnId === "string" ? event.turnId : null,
|
|
93002
92846
|
status: event.status,
|
|
93003
92847
|
text: event.text,
|
|
93004
92848
|
payload: event.payload
|
|
@@ -93723,8 +93567,6 @@ const ServerRuntimeStartupLive = effect(ServerRuntimeStartup, gen(function* () {
|
|
|
93723
93567
|
const serverConfig = yield* ServerConfig;
|
|
93724
93568
|
const keybindings = yield* Keybindings;
|
|
93725
93569
|
const orchestrationReactor = yield* OrchestrationReactor;
|
|
93726
|
-
const turnCompletionWatcher = yield* TurnCompletionWatcher;
|
|
93727
|
-
const cmmdSyncWorker = yield* CmmdSyncWorker;
|
|
93728
93570
|
const runtimeReplication = yield* RuntimeReplication;
|
|
93729
93571
|
const localAutomationRunReconciler = yield* LocalAutomationRunReconciler;
|
|
93730
93572
|
const agentProtocol = yield* AgentProtocolReactor;
|
|
@@ -93761,8 +93603,6 @@ const ServerRuntimeStartupLive = effect(ServerRuntimeStartup, gen(function* () {
|
|
|
93761
93603
|
yield* runStartupPhase("reactors.start", orchestrationReactor.start().pipe(provide$2(reactorScope)));
|
|
93762
93604
|
yield* logDebug("startup phase: reconciling local automation runs");
|
|
93763
93605
|
yield* runStartupPhase("local-automations.reconcile", localAutomationRunReconciler.start().pipe(provide$2(reactorScope)));
|
|
93764
|
-
yield* logDebug("startup phase: starting CMMD session sync");
|
|
93765
|
-
yield* runStartupPhase("cmmd-sync.start", all([turnCompletionWatcher.start().pipe(provide$2(reactorScope)), cmmdSyncWorker.start().pipe(provide$2(reactorScope))]).pipe(asVoid));
|
|
93766
93606
|
yield* logDebug("startup phase: starting CMMD runtime replication");
|
|
93767
93607
|
yield* runStartupPhase("runtime-replication.start", runtimeReplication.start().pipe(provide$2(reactorScope)));
|
|
93768
93608
|
yield* logDebug("startup phase: starting CMMD pipeline reactors");
|
|
@@ -94095,36 +93935,92 @@ function finiteNumber$1(value) {
|
|
|
94095
93935
|
* Entries without both an input and an output rate are dropped: a half-priced
|
|
94096
93936
|
* model would silently under-report cost, which is worse than reporting the
|
|
94097
93937
|
* model as unpriced.
|
|
93938
|
+
*
|
|
93939
|
+
* Entries keep their full normalized key. Collapsing `claude-opus-5` and
|
|
93940
|
+
* `deepinfra/anthropic/claude-opus-5` onto one key let the last one listed win,
|
|
93941
|
+
* and the DeepInfra entry carries no cache-read rate, so cached Claude tokens
|
|
93942
|
+
* were priced at the full input rate. A bare name is aliased only when no
|
|
93943
|
+
* canonical entry claims it and every qualified entry agrees on the rate.
|
|
94098
93944
|
*/
|
|
94099
93945
|
function parseRateTable(document) {
|
|
94100
93946
|
const table = /* @__PURE__ */ new Map();
|
|
94101
93947
|
if (typeof document !== "object" || document === null) return table;
|
|
94102
93948
|
for (const [name, raw] of Object.entries(document)) {
|
|
94103
|
-
|
|
94104
|
-
const
|
|
94105
|
-
|
|
94106
|
-
|
|
94107
|
-
if (input === null || output === null) continue;
|
|
94108
|
-
table.set(normalizeModelName(name), {
|
|
94109
|
-
inputCostPerToken: input,
|
|
94110
|
-
outputCostPerToken: output,
|
|
94111
|
-
cacheReadCostPerToken: finiteNumber$1(entry.cache_read_input_token_cost) ?? input,
|
|
94112
|
-
cacheCreationCostPerToken: finiteNumber$1(entry.cache_creation_input_token_cost) ?? input
|
|
94113
|
-
});
|
|
93949
|
+
const rate = readRate(raw);
|
|
93950
|
+
const key = normalizeRateKey(name);
|
|
93951
|
+
if (rate === null || key.length === 0) continue;
|
|
93952
|
+
table.set(key, rate);
|
|
94114
93953
|
}
|
|
93954
|
+
addBareNameAliases(table);
|
|
94115
93955
|
return table;
|
|
94116
93956
|
}
|
|
93957
|
+
/** One LiteLLM entry's rates, or `null` when it is not priced in full. */
|
|
93958
|
+
function readRate(raw) {
|
|
93959
|
+
if (typeof raw !== "object" || raw === null) return null;
|
|
93960
|
+
const entry = raw;
|
|
93961
|
+
const input = finiteNumber$1(entry.input_cost_per_token);
|
|
93962
|
+
const output = finiteNumber$1(entry.output_cost_per_token);
|
|
93963
|
+
if (input === null || output === null) return null;
|
|
93964
|
+
return {
|
|
93965
|
+
inputCostPerToken: input,
|
|
93966
|
+
outputCostPerToken: output,
|
|
93967
|
+
cacheReadCostPerToken: finiteNumber$1(entry.cache_read_input_token_cost) ?? input,
|
|
93968
|
+
cacheCreationCostPerToken: finiteNumber$1(entry.cache_creation_input_token_cost) ?? input
|
|
93969
|
+
};
|
|
93970
|
+
}
|
|
94117
93971
|
/**
|
|
94118
|
-
*
|
|
93972
|
+
* Lets a bare name resolve when the table only carries qualified spellings of
|
|
93973
|
+
* it, which is how a transcript's `gpt-5.6-terra` reaches `azure/gpt-5.6-terra`.
|
|
94119
93974
|
*
|
|
94120
|
-
*
|
|
94121
|
-
*
|
|
94122
|
-
* about casing.
|
|
93975
|
+
* A canonical entry always wins, and a bare name claimed at two different rates
|
|
93976
|
+
* gets no alias at all: document order is not a tiebreaker.
|
|
94123
93977
|
*/
|
|
94124
|
-
function
|
|
94125
|
-
const
|
|
94126
|
-
|
|
94127
|
-
|
|
93978
|
+
function addBareNameAliases(table) {
|
|
93979
|
+
for (const [alias, rate] of bareNameAliasCandidates(table)) if (rate !== null) table.set(alias, rate);
|
|
93980
|
+
}
|
|
93981
|
+
/** The bare name `key` could stand in for, or `null` when it cannot. */
|
|
93982
|
+
function aliasableBareName(table, key) {
|
|
93983
|
+
const alias = bareModelName(key);
|
|
93984
|
+
if (alias.length === 0 || alias === key) return null;
|
|
93985
|
+
return table.has(alias) ? null : alias;
|
|
93986
|
+
}
|
|
93987
|
+
/** Bare names to alias, mapped to `null` where the qualified rates disagree. */
|
|
93988
|
+
function bareNameAliasCandidates(table) {
|
|
93989
|
+
const candidates = /* @__PURE__ */ new Map();
|
|
93990
|
+
for (const [key, rate] of table) {
|
|
93991
|
+
const alias = aliasableBareName(table, key);
|
|
93992
|
+
if (alias === null) continue;
|
|
93993
|
+
const held = candidates.get(alias);
|
|
93994
|
+
if (held === void 0) candidates.set(alias, rate);
|
|
93995
|
+
else if (held !== null && !sameRate(held, rate)) candidates.set(alias, null);
|
|
93996
|
+
}
|
|
93997
|
+
return candidates;
|
|
93998
|
+
}
|
|
93999
|
+
function sameRate(a, b) {
|
|
94000
|
+
return a.inputCostPerToken === b.inputCostPerToken && a.outputCostPerToken === b.outputCostPerToken && a.cacheReadCostPerToken === b.cacheReadCostPerToken && a.cacheCreationCostPerToken === b.cacheCreationCostPerToken;
|
|
94001
|
+
}
|
|
94002
|
+
/**
|
|
94003
|
+
* The key an entry is stored under, and the key a reported model is looked up
|
|
94004
|
+
* by. Trimmed and lowercased only: transcripts are inconsistent about casing,
|
|
94005
|
+
* but a `provider/` prefix names a different row and must survive.
|
|
94006
|
+
*/
|
|
94007
|
+
function normalizeRateKey(model) {
|
|
94008
|
+
return model.trim().toLowerCase();
|
|
94009
|
+
}
|
|
94010
|
+
/** The key with any `provider/` prefix removed. */
|
|
94011
|
+
function bareModelName(key) {
|
|
94012
|
+
const slash = key.lastIndexOf("/");
|
|
94013
|
+
return slash === -1 ? key : key.slice(slash + 1);
|
|
94014
|
+
}
|
|
94015
|
+
/**
|
|
94016
|
+
* Drops a bracketed variant suffix such as `claude-opus-5[1m]`, which Claude
|
|
94017
|
+
* Code writes for the 1M context tier. The rate table only knows the base name,
|
|
94018
|
+
* and we price at the base tier anyway, so a turn on the wide-context tier
|
|
94019
|
+
* would otherwise come back unpriced.
|
|
94020
|
+
*/
|
|
94021
|
+
function stripVariantSuffix(key) {
|
|
94022
|
+
const bracket = key.indexOf("[");
|
|
94023
|
+
return bracket === -1 ? key : key.slice(0, bracket);
|
|
94128
94024
|
}
|
|
94129
94025
|
/**
|
|
94130
94026
|
* Models we never price, regardless of the table.
|
|
@@ -94142,9 +94038,10 @@ const UNPRICEABLE_MODELS = new Set([
|
|
|
94142
94038
|
"fable"
|
|
94143
94039
|
]);
|
|
94144
94040
|
function lookupRate(table, model) {
|
|
94145
|
-
const
|
|
94146
|
-
|
|
94147
|
-
|
|
94041
|
+
const key = stripVariantSuffix(normalizeRateKey(model));
|
|
94042
|
+
const bareName = bareModelName(key);
|
|
94043
|
+
if (bareName.length === 0 || UNPRICEABLE_MODELS.has(bareName)) return null;
|
|
94044
|
+
return table.get(key) ?? null;
|
|
94148
94045
|
}
|
|
94149
94046
|
/**
|
|
94150
94047
|
* Prices a bucket's tokens.
|
|
@@ -94431,7 +94328,15 @@ async function readTranscriptRecords(filePath, provider) {
|
|
|
94431
94328
|
}
|
|
94432
94329
|
//#endregion
|
|
94433
94330
|
//#region src/usage/usageScanCache.ts
|
|
94434
|
-
|
|
94331
|
+
/**
|
|
94332
|
+
* Bumped whenever cached records could differ from what a fresh parse produces.
|
|
94333
|
+
*
|
|
94334
|
+
* Version 1 was written before `parseCodexLine` suppressed the parent history a
|
|
94335
|
+
* forked rollout copies in, so those caches hold every copied record twice. A
|
|
94336
|
+
* transcript never changes after it is written, so a stale entry is a warm hit
|
|
94337
|
+
* forever: only the version discarding the file evicts them.
|
|
94338
|
+
*/
|
|
94339
|
+
const USAGE_SCAN_CACHE_VERSION = 2;
|
|
94435
94340
|
/** Appends `value` to `table` unless it is already there, returning its index. */
|
|
94436
94341
|
function intern(table, index, value) {
|
|
94437
94342
|
const existing = index.get(value);
|
|
@@ -94483,7 +94388,7 @@ function isStringTable(value) {
|
|
|
94483
94388
|
*
|
|
94484
94389
|
* The intern tables must be all strings: a numeric entry would pass the
|
|
94485
94390
|
* per-record undefined guard, land in a record's model, and crash the aggregate
|
|
94486
|
-
*
|
|
94391
|
+
* when that model is priced. A corrupt table rejects the whole cache.
|
|
94487
94392
|
*/
|
|
94488
94393
|
function decodeEnvelope$1(document) {
|
|
94489
94394
|
if (typeof document !== "object" || document === null) return null;
|
|
@@ -94648,7 +94553,7 @@ const RATES_CACHE_FILE = "usage-model-rates.json";
|
|
|
94648
94553
|
const SCAN_CACHE_FILE = "usage-scan-cache.json";
|
|
94649
94554
|
var UsageService = class extends Service$1()("forge/usage/UsageService") {};
|
|
94650
94555
|
succeed$2(UsageService, UsageService.of({ readSummary: (input) => succeed({
|
|
94651
|
-
contractVersion:
|
|
94556
|
+
contractVersion: 2,
|
|
94652
94557
|
readAt: "1970-01-01T00:00:00.000Z",
|
|
94653
94558
|
timeZone: input.timeZone,
|
|
94654
94559
|
sinceDay: input.sinceDay,
|
|
@@ -94928,7 +94833,7 @@ const UsageServiceLive = effect(UsageService, gen(function* () {
|
|
|
94928
94833
|
const readAt = yield* now;
|
|
94929
94834
|
const finishedAtMs = yield* currentTimeMillis;
|
|
94930
94835
|
return {
|
|
94931
|
-
contractVersion:
|
|
94836
|
+
contractVersion: 2,
|
|
94932
94837
|
readAt: formatIso(readAt),
|
|
94933
94838
|
timeZone: input.timeZone,
|
|
94934
94839
|
sinceDay: input.sinceDay,
|
|
@@ -108315,7 +108220,7 @@ const postgresSchemaStatements = [
|
|
|
108315
108220
|
"CREATE TABLE IF NOT EXISTS orchestration_command_receipts (\n command_id TEXT PRIMARY KEY,\n aggregate_kind TEXT NOT NULL,\n aggregate_id TEXT NOT NULL,\n accepted_at TEXT NOT NULL,\n result_sequence INTEGER NOT NULL,\n status TEXT NOT NULL,\n error TEXT\n )",
|
|
108316
108221
|
"CREATE TABLE IF NOT EXISTS checkpoint_diff_blobs (\n thread_id TEXT NOT NULL,\n from_turn_count INTEGER NOT NULL,\n to_turn_count INTEGER NOT NULL,\n diff TEXT NOT NULL,\n created_at TEXT NOT NULL,\n UNIQUE (thread_id, from_turn_count, to_turn_count)\n )",
|
|
108317
108222
|
"CREATE TABLE IF NOT EXISTS provider_session_runtime (\n thread_id TEXT PRIMARY KEY,\n provider_name TEXT NOT NULL,\n adapter_key TEXT NOT NULL,\n runtime_mode TEXT NOT NULL DEFAULT 'full-access',\n status TEXT NOT NULL,\n last_seen_at TEXT NOT NULL,\n resume_cursor_json TEXT,\n runtime_payload_json TEXT\n )",
|
|
108318
|
-
"CREATE TABLE IF NOT EXISTS projection_projects (\n project_id TEXT PRIMARY KEY,\n title TEXT NOT NULL,\n workspace_root TEXT NOT NULL,\n scripts_json TEXT NOT NULL,\n created_at TEXT NOT NULL,\n updated_at TEXT NOT NULL,\n deleted_at TEXT\n , default_model_selection_json TEXT, default_thread_env_mode TEXT)",
|
|
108223
|
+
"CREATE TABLE IF NOT EXISTS projection_projects (\n project_id TEXT PRIMARY KEY,\n title TEXT NOT NULL,\n workspace_root TEXT NOT NULL,\n scripts_json TEXT NOT NULL,\n created_at TEXT NOT NULL,\n updated_at TEXT NOT NULL,\n deleted_at TEXT\n , default_model_selection_json TEXT, default_thread_env_mode TEXT, cmmd_registration_json TEXT)",
|
|
108319
108224
|
"CREATE TABLE IF NOT EXISTS projection_threads (\n thread_id TEXT PRIMARY KEY,\n project_id TEXT NOT NULL,\n title TEXT NOT NULL,\n branch TEXT,\n worktree_path TEXT,\n latest_turn_id TEXT,\n created_at TEXT NOT NULL,\n updated_at TEXT NOT NULL,\n deleted_at TEXT\n , runtime_mode TEXT NOT NULL DEFAULT 'full-access', interaction_mode TEXT NOT NULL DEFAULT 'default', model_selection_json TEXT, archived_at TEXT, latest_user_message_at TEXT, pending_approval_count INTEGER NOT NULL DEFAULT 0, pending_user_input_count INTEGER NOT NULL DEFAULT 0, has_actionable_proposed_plan INTEGER NOT NULL DEFAULT 0, kind TEXT NOT NULL DEFAULT 'master', parent_thread_id TEXT, status TEXT NOT NULL DEFAULT 'idle', anchor_kind TEXT NOT NULL DEFAULT 'scratch', anchor_cmmd_id TEXT, worker_role TEXT DEFAULT NULL, goal TEXT, pending_auto_create_prompt_json TEXT, title_regeneration_json TEXT, rate_limit_status_json TEXT, linked_pull_request_json TEXT, settled_at TEXT, settled_override TEXT)",
|
|
108320
108225
|
"CREATE TABLE IF NOT EXISTS projection_thread_messages (\n message_id TEXT PRIMARY KEY,\n thread_id TEXT NOT NULL,\n turn_id TEXT,\n role TEXT NOT NULL,\n text TEXT NOT NULL,\n is_streaming INTEGER NOT NULL,\n created_at TEXT NOT NULL,\n updated_at TEXT NOT NULL\n , attachments_json TEXT)",
|
|
108321
108226
|
"CREATE TABLE IF NOT EXISTS projection_thread_activities (\n activity_id TEXT PRIMARY KEY,\n thread_id TEXT NOT NULL,\n turn_id TEXT,\n tone TEXT NOT NULL,\n kind TEXT NOT NULL,\n summary TEXT NOT NULL,\n payload_json TEXT NOT NULL,\n created_at TEXT NOT NULL\n , sequence INTEGER)",
|
|
@@ -108586,7 +108491,8 @@ const postgresUpgradeMigrations = new Map([
|
|
|
108586
108491
|
thread_id TEXT NOT NULL PRIMARY KEY,
|
|
108587
108492
|
detail TEXT NOT NULL,
|
|
108588
108493
|
quarantined_at TEXT NOT NULL
|
|
108589
|
-
)`]]
|
|
108494
|
+
)`]],
|
|
108495
|
+
[74, [`ALTER TABLE projection_projects ADD COLUMN IF NOT EXISTS cmmd_registration_json TEXT`]]
|
|
108590
108496
|
]);
|
|
108591
108497
|
function requirePostgresUpgradeStatements(version) {
|
|
108592
108498
|
const statements = postgresUpgradeMigrations.get(version);
|
|
@@ -108612,15 +108518,15 @@ const runPostgresMigrations = fn$1("runPostgresMigrations")(function* () {
|
|
|
108612
108518
|
ORDER BY version DESC
|
|
108613
108519
|
LIMIT 1
|
|
108614
108520
|
`)[0]?.version ?? 0;
|
|
108615
|
-
if (currentVersion >
|
|
108521
|
+
if (currentVersion > 74) return yield* die$1(/* @__PURE__ */ new Error(`Forge Postgres schema ${currentVersion} is newer than server schema 74.`));
|
|
108616
108522
|
if (currentVersion === 0) {
|
|
108617
108523
|
for (const statement of postgresSchemaStatements) yield* sql.unsafe(statement);
|
|
108618
108524
|
yield* sql`
|
|
108619
108525
|
INSERT INTO forge_schema_migrations (version)
|
|
108620
|
-
VALUES (${
|
|
108526
|
+
VALUES (${74})
|
|
108621
108527
|
ON CONFLICT (version) DO NOTHING
|
|
108622
108528
|
`;
|
|
108623
|
-
} else for (let version = currentVersion + 1; version <=
|
|
108529
|
+
} else for (let version = currentVersion + 1; version <= 74; version += 1) {
|
|
108624
108530
|
const statements = yield* sync$1(() => requirePostgresUpgradeStatements(version));
|
|
108625
108531
|
for (const statement of statements) yield* sql.unsafe(statement);
|
|
108626
108532
|
yield* sql`
|
|
@@ -111278,6 +111184,31 @@ var _073_ReplicaThreadQuarantine_default = gen(function* () {
|
|
|
111278
111184
|
`;
|
|
111279
111185
|
});
|
|
111280
111186
|
//#endregion
|
|
111187
|
+
//#region src/persistence/Migrations/074_ProjectCmmdRegistration.ts
|
|
111188
|
+
/**
|
|
111189
|
+
* Let a Checkout say which Registration it was created from.
|
|
111190
|
+
*
|
|
111191
|
+
* A Forge Cloud Environment is per (organization, user), so one Environment
|
|
111192
|
+
* holds every Checkout its owner registered. They all report the sprite's own
|
|
111193
|
+
* root as their workspace root, and once connected they report an empty `cwd`,
|
|
111194
|
+
* so nothing about a path can tell them apart. The Registration is the durable
|
|
111195
|
+
* identity, and until now it lived only on the CMMD catalog row: the Checkout
|
|
111196
|
+
* itself could not answer which project it was.
|
|
111197
|
+
*
|
|
111198
|
+
* NULL is a Checkout that was not created from a Registration, and that is
|
|
111199
|
+
* every row written before this column existed. Those keep resolving through
|
|
111200
|
+
* the directory rules, so nothing is backfilled and no existing row is touched.
|
|
111201
|
+
*/
|
|
111202
|
+
var _074_ProjectCmmdRegistration_default = gen(function* () {
|
|
111203
|
+
const sql = yield* SqlClient;
|
|
111204
|
+
if (!(yield* sql`
|
|
111205
|
+
PRAGMA table_info(projection_projects)
|
|
111206
|
+
`).some((column) => column.name === "cmmd_registration_json")) yield* sql`
|
|
111207
|
+
ALTER TABLE projection_projects
|
|
111208
|
+
ADD COLUMN cmmd_registration_json TEXT
|
|
111209
|
+
`;
|
|
111210
|
+
});
|
|
111211
|
+
//#endregion
|
|
111281
111212
|
//#region src/persistence/Migrations.ts
|
|
111282
111213
|
/**
|
|
111283
111214
|
* MigrationsLive - Migration runner with inline loader
|
|
@@ -111663,6 +111594,11 @@ const migrationEntries = [
|
|
|
111663
111594
|
73,
|
|
111664
111595
|
"ReplicaThreadQuarantine",
|
|
111665
111596
|
_073_ReplicaThreadQuarantine_default
|
|
111597
|
+
],
|
|
111598
|
+
[
|
|
111599
|
+
74,
|
|
111600
|
+
"ProjectCmmdRegistration",
|
|
111601
|
+
_074_ProjectCmmdRegistration_default
|
|
111666
111602
|
]
|
|
111667
111603
|
];
|
|
111668
111604
|
const makeMigrationLoader = (throughId) => fromRecord(Object.fromEntries(migrationEntries.filter(([id]) => throughId === void 0 || id <= throughId).map(([id, name, migration]) => [`${id}_${name}`, migration])));
|
|
@@ -184417,7 +184353,7 @@ var Vce = {
|
|
|
184417
184353
|
function Ve() {
|
|
184418
184354
|
return Vce;
|
|
184419
184355
|
}
|
|
184420
|
-
var Us =
|
|
184356
|
+
var Us = $U.homedir(), lk = $U.tmpdir(), { env: Vc } = process$1, Yce = (e) => {
|
|
184421
184357
|
let t = path.join(Us, "Library");
|
|
184422
184358
|
return {
|
|
184423
184359
|
data: path.join(t, "Application Support", e),
|
|
@@ -194617,12 +194553,12 @@ function qZ(e, t) {
|
|
|
194617
194553
|
}
|
|
194618
194554
|
return n;
|
|
194619
194555
|
}
|
|
194620
|
-
var os$
|
|
194556
|
+
var os$1 = "https://code.claude.com/docs/en", kKe = [
|
|
194621
194557
|
{
|
|
194622
194558
|
matches: (e) => e.path === "permissions.defaultMode" && e.code === "invalid_value",
|
|
194623
194559
|
tip: {
|
|
194624
194560
|
suggestion: "Valid modes: \"acceptEdits\" (ask before file changes), \"plan\" (analysis only), \"bypassPermissions\" (auto-accept all), or \"default\" (standard behavior)",
|
|
194625
|
-
docLink: `${os$
|
|
194561
|
+
docLink: `${os$1}/iam#permission-modes`
|
|
194626
194562
|
}
|
|
194627
194563
|
},
|
|
194628
194564
|
{
|
|
@@ -194637,7 +194573,7 @@ var os$2 = "https://code.claude.com/docs/en", kKe = [
|
|
|
194637
194573
|
matches: (e) => e.path.startsWith("env.") && e.code === "invalid_type",
|
|
194638
194574
|
tip: {
|
|
194639
194575
|
suggestion: "Environment variables must be strings. Wrap numbers and booleans in quotes. Example: \"DEBUG\": \"true\", \"PORT\": \"3000\"",
|
|
194640
|
-
docLink: `${os$
|
|
194576
|
+
docLink: `${os$1}/settings#environment-variables`
|
|
194641
194577
|
}
|
|
194642
194578
|
},
|
|
194643
194579
|
{
|
|
@@ -194648,14 +194584,14 @@ var os$2 = "https://code.claude.com/docs/en", kKe = [
|
|
|
194648
194584
|
matches: (e) => e.path.startsWith("hooks.") && e.code === "invalid_key",
|
|
194649
194585
|
tip: {
|
|
194650
194586
|
suggestion: "Not a recognized hook event. Common events: PreToolUse, PostToolUse, UserPromptSubmit, SessionStart, SessionEnd, Stop. Check spelling and capitalization.",
|
|
194651
|
-
docLink: `${os$
|
|
194587
|
+
docLink: `${os$1}/hooks`
|
|
194652
194588
|
}
|
|
194653
194589
|
},
|
|
194654
194590
|
{
|
|
194655
194591
|
matches: (e) => /\.hooks\.\d+\.command$/.test(e.path) && e.code === "invalid_type" && e.received === "undefined",
|
|
194656
194592
|
tip: {
|
|
194657
194593
|
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\"}.",
|
|
194658
|
-
docLink: `${os$
|
|
194594
|
+
docLink: `${os$1}/hooks#exec-form-and-shell-form`
|
|
194659
194595
|
}
|
|
194660
194596
|
},
|
|
194661
194597
|
{
|
|
@@ -194670,7 +194606,7 @@ var os$2 = "https://code.claude.com/docs/en", kKe = [
|
|
|
194670
194606
|
matches: (e) => e.code === "unrecognized_keys",
|
|
194671
194607
|
tip: {
|
|
194672
194608
|
suggestion: "Check for typos or refer to the documentation for valid fields",
|
|
194673
|
-
docLink: `${os$
|
|
194609
|
+
docLink: `${os$1}/settings`
|
|
194674
194610
|
}
|
|
194675
194611
|
},
|
|
194676
194612
|
{
|
|
@@ -194685,13 +194621,13 @@ var os$2 = "https://code.claude.com/docs/en", kKe = [
|
|
|
194685
194621
|
matches: (e) => e.path === "permissions.additionalDirectories" && e.code === "invalid_type",
|
|
194686
194622
|
tip: {
|
|
194687
194623
|
suggestion: "Must be an array of directory paths. Example: [\"~/projects\", \"/tmp/workspace\"]. You can also use --add-dir flag or /add-dir command",
|
|
194688
|
-
docLink: `${os$
|
|
194624
|
+
docLink: `${os$1}/iam#working-directories`
|
|
194689
194625
|
}
|
|
194690
194626
|
}
|
|
194691
194627
|
], AKe = {
|
|
194692
|
-
permissions: `${os$
|
|
194693
|
-
env: `${os$
|
|
194694
|
-
hooks: `${os$
|
|
194628
|
+
permissions: `${os$1}/iam#configuring-permissions`,
|
|
194629
|
+
env: `${os$1}/settings#environment-variables`,
|
|
194630
|
+
hooks: `${os$1}/hooks`
|
|
194695
194631
|
};
|
|
194696
194632
|
function GZ(e) {
|
|
194697
194633
|
let t = kKe.find((r) => r.matches(e));
|
|
@@ -204306,13 +204242,45 @@ function mapCodexThreadNameUpdatedEvent(event, canonicalThreadId, payload) {
|
|
|
204306
204242
|
}
|
|
204307
204243
|
}];
|
|
204308
204244
|
}
|
|
204245
|
+
/**
|
|
204246
|
+
* One provider call's spend, from Codex's `last_token_usage`. Codex reports
|
|
204247
|
+
* `input_tokens` inclusive of the cached and cache-write portions, so the
|
|
204248
|
+
* uncached bucket is the remainder; reasoning is reported inside output and
|
|
204249
|
+
* is surfaced separately without being added again. Mirrors
|
|
204250
|
+
* `parseCodexLine` in usage/usageTranscripts.ts so a Recorded turn and a
|
|
204251
|
+
* scanned transcript agree on the same numbers.
|
|
204252
|
+
*/
|
|
204253
|
+
function codexTurnUsageDelta(value) {
|
|
204254
|
+
const usage = asObject$2(value);
|
|
204255
|
+
const lastUsage = asObject$2(usage?.last_token_usage ?? usage?.last);
|
|
204256
|
+
if (!lastUsage) return void 0;
|
|
204257
|
+
const int = (key, alt) => Math.max(0, Math.trunc(asNumber(lastUsage[key]) ?? asNumber(lastUsage[alt]) ?? 0));
|
|
204258
|
+
const inputTokens = int("input_tokens", "inputTokens");
|
|
204259
|
+
const cachedInputTokens = int("cached_input_tokens", "cachedInputTokens");
|
|
204260
|
+
const cacheCreationTokens = int("cache_write_input_tokens", "cacheWriteInputTokens");
|
|
204261
|
+
const outputTokens = int("output_tokens", "outputTokens");
|
|
204262
|
+
if (inputTokens + cachedInputTokens + cacheCreationTokens + outputTokens === 0) return void 0;
|
|
204263
|
+
return {
|
|
204264
|
+
scope: "call-delta",
|
|
204265
|
+
uncachedInputTokens: Math.max(0, inputTokens - cachedInputTokens - cacheCreationTokens),
|
|
204266
|
+
cachedInputTokens,
|
|
204267
|
+
cacheCreationTokens,
|
|
204268
|
+
outputTokens,
|
|
204269
|
+
reasoningTokens: Math.min(outputTokens, int("reasoning_output_tokens", "reasoningOutputTokens"))
|
|
204270
|
+
};
|
|
204271
|
+
}
|
|
204309
204272
|
function mapCodexThreadTokenUsageEvent(event, canonicalThreadId, payload) {
|
|
204310
|
-
const
|
|
204273
|
+
const tokenUsage = asObject$2(payload?.tokenUsage);
|
|
204274
|
+
const normalizedUsage = normalizeCodexTokenUsage(tokenUsage ?? event.payload);
|
|
204311
204275
|
if (!normalizedUsage) return [];
|
|
204276
|
+
const turnUsage = codexTurnUsageDelta(tokenUsage ?? event.payload);
|
|
204312
204277
|
return [{
|
|
204313
204278
|
type: "thread.token-usage.updated",
|
|
204314
204279
|
...runtimeEventBase(event, canonicalThreadId),
|
|
204315
|
-
payload: {
|
|
204280
|
+
payload: {
|
|
204281
|
+
usage: normalizedUsage,
|
|
204282
|
+
...turnUsage ? { turnUsage } : {}
|
|
204283
|
+
}
|
|
204316
204284
|
}];
|
|
204317
204285
|
}
|
|
204318
204286
|
const codexThreadMethodMappers = {
|
|
@@ -206936,6 +206904,29 @@ function finiteNumberField(usage, key) {
|
|
|
206936
206904
|
function finiteNumberFieldOrZero(usage, key) {
|
|
206937
206905
|
return finiteNumberField(usage, key) ?? 0;
|
|
206938
206906
|
}
|
|
206907
|
+
/**
|
|
206908
|
+
* The whole turn's spend from the SDK result message, cache split intact.
|
|
206909
|
+
* Claude reports `input_tokens` exclusive of the cached and cache-creation
|
|
206910
|
+
* portions, so the buckets are already disjoint. Claude does not report
|
|
206911
|
+
* reasoning separately.
|
|
206912
|
+
*/
|
|
206913
|
+
function claudeTurnUsageTotal(value) {
|
|
206914
|
+
const usage = asClaudeUsageRecord(value);
|
|
206915
|
+
if (!usage) return void 0;
|
|
206916
|
+
const uncachedInputTokens = finiteNumberFieldOrZero(usage, "input_tokens");
|
|
206917
|
+
const cachedInputTokens = finiteNumberFieldOrZero(usage, "cache_read_input_tokens");
|
|
206918
|
+
const cacheCreationTokens = finiteNumberFieldOrZero(usage, "cache_creation_input_tokens");
|
|
206919
|
+
const outputTokens = finiteNumberFieldOrZero(usage, "output_tokens");
|
|
206920
|
+
if (uncachedInputTokens + cachedInputTokens + cacheCreationTokens + outputTokens <= 0) return;
|
|
206921
|
+
return {
|
|
206922
|
+
scope: "turn-total",
|
|
206923
|
+
uncachedInputTokens: Math.trunc(uncachedInputTokens),
|
|
206924
|
+
cachedInputTokens: Math.trunc(cachedInputTokens),
|
|
206925
|
+
cacheCreationTokens: Math.trunc(cacheCreationTokens),
|
|
206926
|
+
outputTokens: Math.trunc(outputTokens),
|
|
206927
|
+
reasoningTokens: 0
|
|
206928
|
+
};
|
|
206929
|
+
}
|
|
206939
206930
|
function normalizedClaudeInputTokens(usage) {
|
|
206940
206931
|
return finiteNumberFieldOrZero(usage, "input_tokens") + finiteNumberFieldOrZero(usage, "cache_creation_input_tokens") + finiteNumberFieldOrZero(usage, "cache_read_input_tokens");
|
|
206941
206932
|
}
|
|
@@ -207578,8 +207569,9 @@ const makeClaudeAdapter = fn$1("makeClaudeAdapter")(function* (options) {
|
|
|
207578
207569
|
}
|
|
207579
207570
|
});
|
|
207580
207571
|
});
|
|
207581
|
-
const emitTurnUsageUpdated = fn$1("emitTurnUsageUpdated")(function* (context, turnState, usageSnapshot) {
|
|
207572
|
+
const emitTurnUsageUpdated = fn$1("emitTurnUsageUpdated")(function* (context, turnState, usageSnapshot, result) {
|
|
207582
207573
|
if (!usageSnapshot) return;
|
|
207574
|
+
const turnUsage = claudeTurnUsageTotal(result?.usage);
|
|
207583
207575
|
const usageStamp = yield* makeEventStamp();
|
|
207584
207576
|
yield* offerRuntimeEvent({
|
|
207585
207577
|
type: "thread.token-usage.updated",
|
|
@@ -207588,7 +207580,10 @@ const makeClaudeAdapter = fn$1("makeClaudeAdapter")(function* (options) {
|
|
|
207588
207580
|
createdAt: usageStamp.createdAt,
|
|
207589
207581
|
threadId: context.session.threadId,
|
|
207590
207582
|
...turnState ? { turnId: turnState.turnId } : {},
|
|
207591
|
-
payload: {
|
|
207583
|
+
payload: {
|
|
207584
|
+
usage: usageSnapshot,
|
|
207585
|
+
...turnUsage ? { turnUsage } : {}
|
|
207586
|
+
},
|
|
207592
207587
|
providerRefs: turnState ? nativeProviderRefs(context) : {}
|
|
207593
207588
|
});
|
|
207594
207589
|
});
|
|
@@ -207606,7 +207601,7 @@ const makeClaudeAdapter = fn$1("makeClaudeAdapter")(function* (options) {
|
|
|
207606
207601
|
});
|
|
207607
207602
|
});
|
|
207608
207603
|
const emitTurnCompletionWithoutActiveTurn = fn$1("emitTurnCompletionWithoutActiveTurn")(function* (context, status, errorMessage, result, usageSnapshot) {
|
|
207609
|
-
yield* emitTurnUsageUpdated(context, void 0, usageSnapshot);
|
|
207604
|
+
yield* emitTurnUsageUpdated(context, void 0, usageSnapshot, result);
|
|
207610
207605
|
yield* emitTurnCompleted(context, void 0, status, errorMessage, result);
|
|
207611
207606
|
});
|
|
207612
207607
|
const completeInFlightTools = fn$1("completeInFlightTools")(function* (context, turnState, status, result) {
|
|
@@ -207670,7 +207665,7 @@ const makeClaudeAdapter = fn$1("makeClaudeAdapter")(function* (options) {
|
|
|
207670
207665
|
yield* completeInFlightTools(context, turnState, status, result);
|
|
207671
207666
|
yield* completePendingAssistantTextBlocks(context, turnState, status, result);
|
|
207672
207667
|
recordCompletedTurn(context, turnState);
|
|
207673
|
-
yield* emitTurnUsageUpdated(context, turnState, usageSnapshot);
|
|
207668
|
+
yield* emitTurnUsageUpdated(context, turnState, usageSnapshot, result);
|
|
207674
207669
|
yield* emitTurnCompleted(context, turnState, status, errorMessage, result);
|
|
207675
207670
|
yield* finalizeTurnSession(context, status, errorMessage);
|
|
207676
207671
|
});
|
|
@@ -258944,7 +258939,7 @@ var import_multicast_dns = /* @__PURE__ */ __toESM((/* @__PURE__ */ __commonJSMi
|
|
|
258944
258939
|
var dgram = __require("dgram");
|
|
258945
258940
|
var thunky = require_thunky();
|
|
258946
258941
|
var events = __require("events");
|
|
258947
|
-
var os
|
|
258942
|
+
var os = __require("os");
|
|
258948
258943
|
var noop = function() {};
|
|
258949
258944
|
module.exports = function(opts) {
|
|
258950
258945
|
if (!opts) opts = {};
|
|
@@ -259075,14 +259070,14 @@ var import_multicast_dns = /* @__PURE__ */ __toESM((/* @__PURE__ */ __commonJSMi
|
|
|
259075
259070
|
return that;
|
|
259076
259071
|
};
|
|
259077
259072
|
function defaultInterface() {
|
|
259078
|
-
var networks = os
|
|
259073
|
+
var networks = os.networkInterfaces();
|
|
259079
259074
|
var names = Object.keys(networks);
|
|
259080
259075
|
for (var i = 0; i < names.length; i++) {
|
|
259081
259076
|
var net = networks[names[i]];
|
|
259082
259077
|
for (var j = 0; j < net.length; j++) {
|
|
259083
259078
|
var iface = net[j];
|
|
259084
259079
|
if (isIPv4(iface.family) && !iface.internal) {
|
|
259085
|
-
if (os
|
|
259080
|
+
if (os.platform() === "darwin" && names[i] === "en0") return iface.address;
|
|
259086
259081
|
return "0.0.0.0";
|
|
259087
259082
|
}
|
|
259088
259083
|
}
|
|
@@ -259090,7 +259085,7 @@ var import_multicast_dns = /* @__PURE__ */ __toESM((/* @__PURE__ */ __commonJSMi
|
|
|
259090
259085
|
return "127.0.0.1";
|
|
259091
259086
|
}
|
|
259092
259087
|
function allInterfaces() {
|
|
259093
|
-
var networks = os
|
|
259088
|
+
var networks = os.networkInterfaces();
|
|
259094
259089
|
var names = Object.keys(networks);
|
|
259095
259090
|
var res = [];
|
|
259096
259091
|
for (var i = 0; i < names.length; i++) {
|
|
@@ -277403,6 +277398,83 @@ var PlanTaskCreationReactor = class extends Service$1()("forge/orchestration/Ser
|
|
|
277403
277398
|
*/
|
|
277404
277399
|
var SpriteTaskHoldReactor = class extends Service$1()("forge/orchestration/Services/SpriteTaskHoldReactor") {};
|
|
277405
277400
|
//#endregion
|
|
277401
|
+
//#region src/persistence/Services/ProjectionProjects.ts
|
|
277402
|
+
/**
|
|
277403
|
+
* ProjectionProjectRepository - Projection repository interface for projects.
|
|
277404
|
+
*
|
|
277405
|
+
* Owns persistence operations for project rows in the orchestration projection
|
|
277406
|
+
* read model.
|
|
277407
|
+
*
|
|
277408
|
+
* @module ProjectionProjectRepository
|
|
277409
|
+
*/
|
|
277410
|
+
const ProjectionProject = Struct({
|
|
277411
|
+
projectId: ProjectId,
|
|
277412
|
+
title: String$1,
|
|
277413
|
+
workspaceRoot: String$1,
|
|
277414
|
+
defaultModelSelection: NullOr(ModelSelection),
|
|
277415
|
+
defaultThreadEnvMode: NullOr(ThreadEnvMode),
|
|
277416
|
+
cmmdRegistration: NullOr(CmmdRegistration),
|
|
277417
|
+
scripts: ArraySchema(ProjectScript),
|
|
277418
|
+
createdAt: IsoDateTime,
|
|
277419
|
+
updatedAt: IsoDateTime,
|
|
277420
|
+
deletedAt: NullOr(IsoDateTime)
|
|
277421
|
+
});
|
|
277422
|
+
const GetProjectionProjectInput = Struct({ projectId: ProjectId });
|
|
277423
|
+
const DeleteProjectionProjectInput = Struct({ projectId: ProjectId });
|
|
277424
|
+
/**
|
|
277425
|
+
* ProjectionProjectRepository - Service tag for project projection persistence.
|
|
277426
|
+
*/
|
|
277427
|
+
var ProjectionProjectRepository = class extends Service$1()("forge/persistence/Services/ProjectionProjects/ProjectionProjectRepository") {};
|
|
277428
|
+
//#endregion
|
|
277429
|
+
//#region src/persistence/Services/ProjectionThreads.ts
|
|
277430
|
+
/**
|
|
277431
|
+
* ProjectionThreadRepository - Projection repository interface for threads.
|
|
277432
|
+
*
|
|
277433
|
+
* Owns persistence operations for projected thread records in the
|
|
277434
|
+
* orchestration read model.
|
|
277435
|
+
*
|
|
277436
|
+
* @module ProjectionThreadRepository
|
|
277437
|
+
*/
|
|
277438
|
+
const ProjectionThread = Struct({
|
|
277439
|
+
threadId: ThreadId,
|
|
277440
|
+
projectId: ProjectId,
|
|
277441
|
+
title: String$1,
|
|
277442
|
+
modelSelection: ModelSelection,
|
|
277443
|
+
runtimeMode: RuntimeMode$1,
|
|
277444
|
+
interactionMode: ProviderInteractionMode,
|
|
277445
|
+
branch: NullOr(String$1),
|
|
277446
|
+
worktreePath: NullOr(String$1),
|
|
277447
|
+
latestTurnId: NullOr(TurnId),
|
|
277448
|
+
createdAt: IsoDateTime,
|
|
277449
|
+
updatedAt: IsoDateTime,
|
|
277450
|
+
archivedAt: NullOr(IsoDateTime),
|
|
277451
|
+
settledAt: NullOr(IsoDateTime),
|
|
277452
|
+
settledOverride: NullOr(Literals(["settled", "active"])),
|
|
277453
|
+
latestUserMessageAt: NullOr(IsoDateTime),
|
|
277454
|
+
pendingApprovalCount: NonNegativeInt,
|
|
277455
|
+
pendingUserInputCount: NonNegativeInt,
|
|
277456
|
+
hasActionableProposedPlan: NonNegativeInt,
|
|
277457
|
+
deletedAt: NullOr(IsoDateTime),
|
|
277458
|
+
kind: ThreadKind.pipe(withDecodingDefault(succeed("master"))),
|
|
277459
|
+
parentThreadId: NullOr(ThreadId).pipe(withDecodingDefault(succeed(null))),
|
|
277460
|
+
anchorKind: CmmdAnchorKind.pipe(withDecodingDefault(succeed("scratch"))),
|
|
277461
|
+
anchorCmmdId: NullOr(String$1).pipe(withDecodingDefault(succeed(null))),
|
|
277462
|
+
linkedPullRequest: optionalKey(NullOr(LinkedPullRequest)),
|
|
277463
|
+
status: ThreadStatus.pipe(withDecodingDefault(succeed("idle"))),
|
|
277464
|
+
workerRole: NullOr(WorkerRole).pipe(withDecodingDefault(succeed(null))),
|
|
277465
|
+
goal: NullOr(String$1).pipe(withDecodingDefault(succeed(null))),
|
|
277466
|
+
titleRegeneration: NullOr(ThreadTitleRegeneration).pipe(withDecodingDefault(succeed(null))),
|
|
277467
|
+
pendingAutoCreatePrompt: optional$4(NullOr(AutoCreateTaskPrompt)).pipe(withDecodingDefault(succeed(null))),
|
|
277468
|
+
rateLimitStatus: optional$4(ArraySchema(ThreadProviderRateLimitStatus)).pipe(withDecodingDefault(succeed([])))
|
|
277469
|
+
});
|
|
277470
|
+
const GetProjectionThreadInput = Struct({ threadId: ThreadId });
|
|
277471
|
+
const DeleteProjectionThreadInput = Struct({ threadId: ThreadId });
|
|
277472
|
+
const ListProjectionThreadsByProjectInput = Struct({ projectId: ProjectId });
|
|
277473
|
+
/**
|
|
277474
|
+
* ProjectionThreadRepository - Service tag for thread projection persistence.
|
|
277475
|
+
*/
|
|
277476
|
+
var ProjectionThreadRepository = class extends Service$1()("forge/persistence/Services/ProjectionThreads/ProjectionThreadRepository") {};
|
|
277477
|
+
//#endregion
|
|
277406
277478
|
//#region src/orchestration/Layers/OrchestrationReactor.ts
|
|
277407
277479
|
const RETENTION_SWEEP_INTERVAL_MS = 300 * 1e3;
|
|
277408
277480
|
const OrchestrationReactorLive = effect(OrchestrationReactor, gen(function* () {
|
|
@@ -279952,7 +280024,10 @@ function threadEventToActivities(event) {
|
|
|
279952
280024
|
tone: "info",
|
|
279953
280025
|
kind: "context-window.updated",
|
|
279954
280026
|
summary: "Context window updated",
|
|
279955
|
-
payload
|
|
280027
|
+
payload: {
|
|
280028
|
+
...payload,
|
|
280029
|
+
...event.payload.turnUsage ? { turnUsage: event.payload.turnUsage } : {}
|
|
280030
|
+
}
|
|
279956
280031
|
}] : [];
|
|
279957
280032
|
}
|
|
279958
280033
|
default: return;
|
|
@@ -286285,6 +286360,7 @@ const ProjectCheckoutDeletionLive = effect(ProjectCheckoutDeletion, gen(function
|
|
|
286285
286360
|
//#region src/persistence/Layers/ProjectionProjects.ts
|
|
286286
286361
|
const ProjectionProjectDbRow = ProjectionProject.mapFields(assign({
|
|
286287
286362
|
defaultModelSelection: NullOr(fromJsonString(ModelSelection)),
|
|
286363
|
+
cmmdRegistration: NullOr(fromJsonString(CmmdRegistration)),
|
|
286288
286364
|
scripts: fromJsonString(ArraySchema(ProjectScript))
|
|
286289
286365
|
}));
|
|
286290
286366
|
const ProjectionProjectRepositoryLive = effect(ProjectionProjectRepository, gen(function* () {
|
|
@@ -286298,6 +286374,7 @@ const ProjectionProjectRepositoryLive = effect(ProjectionProjectRepository, gen(
|
|
|
286298
286374
|
workspace_root,
|
|
286299
286375
|
default_model_selection_json,
|
|
286300
286376
|
default_thread_env_mode,
|
|
286377
|
+
cmmd_registration_json,
|
|
286301
286378
|
scripts_json,
|
|
286302
286379
|
created_at,
|
|
286303
286380
|
updated_at,
|
|
@@ -286309,6 +286386,7 @@ const ProjectionProjectRepositoryLive = effect(ProjectionProjectRepository, gen(
|
|
|
286309
286386
|
${row.workspaceRoot},
|
|
286310
286387
|
${row.defaultModelSelection !== null ? JSON.stringify(row.defaultModelSelection) : null},
|
|
286311
286388
|
${row.defaultThreadEnvMode},
|
|
286389
|
+
${row.cmmdRegistration !== null ? JSON.stringify(row.cmmdRegistration) : null},
|
|
286312
286390
|
${JSON.stringify(row.scripts)},
|
|
286313
286391
|
${row.createdAt},
|
|
286314
286392
|
${row.updatedAt},
|
|
@@ -286320,6 +286398,7 @@ const ProjectionProjectRepositoryLive = effect(ProjectionProjectRepository, gen(
|
|
|
286320
286398
|
workspace_root = excluded.workspace_root,
|
|
286321
286399
|
default_model_selection_json = excluded.default_model_selection_json,
|
|
286322
286400
|
default_thread_env_mode = excluded.default_thread_env_mode,
|
|
286401
|
+
cmmd_registration_json = excluded.cmmd_registration_json,
|
|
286323
286402
|
scripts_json = excluded.scripts_json,
|
|
286324
286403
|
created_at = excluded.created_at,
|
|
286325
286404
|
updated_at = excluded.updated_at,
|
|
@@ -286336,6 +286415,7 @@ const ProjectionProjectRepositoryLive = effect(ProjectionProjectRepository, gen(
|
|
|
286336
286415
|
workspace_root AS "workspaceRoot",
|
|
286337
286416
|
default_model_selection_json AS "defaultModelSelection",
|
|
286338
286417
|
default_thread_env_mode AS "defaultThreadEnvMode",
|
|
286418
|
+
cmmd_registration_json AS "cmmdRegistration",
|
|
286339
286419
|
scripts_json AS "scripts",
|
|
286340
286420
|
created_at AS "createdAt",
|
|
286341
286421
|
updated_at AS "updatedAt",
|
|
@@ -286354,6 +286434,7 @@ const ProjectionProjectRepositoryLive = effect(ProjectionProjectRepository, gen(
|
|
|
286354
286434
|
workspace_root AS "workspaceRoot",
|
|
286355
286435
|
default_model_selection_json AS "defaultModelSelection",
|
|
286356
286436
|
default_thread_env_mode AS "defaultThreadEnvMode",
|
|
286437
|
+
cmmd_registration_json AS "cmmdRegistration",
|
|
286357
286438
|
scripts_json AS "scripts",
|
|
286358
286439
|
created_at AS "createdAt",
|
|
286359
286440
|
updated_at AS "updatedAt",
|
|
@@ -287503,7 +287584,7 @@ function resolveBuildCommitFromEnv(env) {
|
|
|
287503
287584
|
* environment descriptor down instead of reporting an honest "unknown".
|
|
287504
287585
|
*/
|
|
287505
287586
|
function readBakedBuildCommit() {
|
|
287506
|
-
return "
|
|
287587
|
+
return "0ef3571b544de985c96601544e36094a62787683";
|
|
287507
287588
|
}
|
|
287508
287589
|
async function resolveServerBuildCommit(input) {
|
|
287509
287590
|
if (isFullCommitSha(input.baked)) return input.baked;
|
|
@@ -287675,7 +287756,7 @@ const ServerEnvironmentLive = effect(ServerEnvironment, fn$1("makeServerEnvironm
|
|
|
287675
287756
|
os,
|
|
287676
287757
|
arch: platformArch()
|
|
287677
287758
|
},
|
|
287678
|
-
serverVersion:
|
|
287759
|
+
serverVersion: version$1,
|
|
287679
287760
|
...buildCommit !== void 0 ? { buildCommit } : {},
|
|
287680
287761
|
capabilities: {
|
|
287681
287762
|
...executionEnvironmentCapabilities(serverConfig),
|
|
@@ -290654,6 +290735,7 @@ const decideOrchestrationCommand = fn$1("decideOrchestrationCommand")(function*
|
|
|
290654
290735
|
workspaceRoot: command.workspaceRoot,
|
|
290655
290736
|
defaultModelSelection: command.defaultModelSelection ?? null,
|
|
290656
290737
|
...command.defaultThreadEnvMode !== void 0 ? { defaultThreadEnvMode: command.defaultThreadEnvMode } : {},
|
|
290738
|
+
...command.cmmdRegistration !== void 0 ? { cmmdRegistration: command.cmmdRegistration } : {},
|
|
290657
290739
|
scripts: [],
|
|
290658
290740
|
createdAt: command.createdAt,
|
|
290659
290741
|
updatedAt: command.createdAt
|
|
@@ -290680,6 +290762,7 @@ const decideOrchestrationCommand = fn$1("decideOrchestrationCommand")(function*
|
|
|
290680
290762
|
...command.workspaceRoot !== void 0 ? { workspaceRoot: command.workspaceRoot } : {},
|
|
290681
290763
|
...command.defaultModelSelection !== void 0 ? { defaultModelSelection: command.defaultModelSelection } : {},
|
|
290682
290764
|
...command.defaultThreadEnvMode !== void 0 ? { defaultThreadEnvMode: command.defaultThreadEnvMode } : {},
|
|
290765
|
+
...command.cmmdRegistration !== void 0 ? { cmmdRegistration: command.cmmdRegistration } : {},
|
|
290683
290766
|
...command.scripts !== void 0 ? { scripts: command.scripts } : {},
|
|
290684
290767
|
updatedAt: occurredAt
|
|
290685
290768
|
}
|
|
@@ -291541,6 +291624,7 @@ function projectProjectDomainEvent(nextBase, event) {
|
|
|
291541
291624
|
workspaceRoot: payload.workspaceRoot,
|
|
291542
291625
|
defaultModelSelection: payload.defaultModelSelection,
|
|
291543
291626
|
defaultThreadEnvMode: payload.defaultThreadEnvMode ?? null,
|
|
291627
|
+
cmmdRegistration: payload.cmmdRegistration ?? null,
|
|
291544
291628
|
scripts: payload.scripts,
|
|
291545
291629
|
createdAt: payload.createdAt,
|
|
291546
291630
|
updatedAt: payload.updatedAt,
|
|
@@ -291559,6 +291643,7 @@ function projectProjectDomainEvent(nextBase, event) {
|
|
|
291559
291643
|
...payload.workspaceRoot !== void 0 ? { workspaceRoot: payload.workspaceRoot } : {},
|
|
291560
291644
|
...payload.defaultModelSelection !== void 0 ? { defaultModelSelection: payload.defaultModelSelection } : {},
|
|
291561
291645
|
...payload.defaultThreadEnvMode !== void 0 ? { defaultThreadEnvMode: payload.defaultThreadEnvMode } : {},
|
|
291646
|
+
...payload.cmmdRegistration !== void 0 ? { cmmdRegistration: payload.cmmdRegistration } : {},
|
|
291562
291647
|
...payload.scripts !== void 0 ? { scripts: payload.scripts } : {},
|
|
291563
291648
|
updatedAt: payload.updatedAt
|
|
291564
291649
|
} : project)
|
|
@@ -292162,6 +292247,34 @@ const DeleteProjectionThreadActivitiesInput = Struct({ threadId: ThreadId });
|
|
|
292162
292247
|
*/
|
|
292163
292248
|
var ProjectionThreadActivityRepository = class extends Service$1()("forge/persistence/Services/ProjectionThreadActivities/ProjectionThreadActivityRepository") {};
|
|
292164
292249
|
//#endregion
|
|
292250
|
+
//#region src/persistence/Services/ProjectionThreadMessages.ts
|
|
292251
|
+
/**
|
|
292252
|
+
* ProjectionThreadMessageRepository - Projection repository interface for messages.
|
|
292253
|
+
*
|
|
292254
|
+
* Owns persistence operations for projected thread messages rendered in the
|
|
292255
|
+
* orchestration read model.
|
|
292256
|
+
*
|
|
292257
|
+
* @module ProjectionThreadMessageRepository
|
|
292258
|
+
*/
|
|
292259
|
+
const ProjectionThreadMessage = Struct({
|
|
292260
|
+
messageId: MessageId,
|
|
292261
|
+
threadId: ThreadId,
|
|
292262
|
+
turnId: NullOr(TurnId),
|
|
292263
|
+
role: OrchestrationMessageRole,
|
|
292264
|
+
text: String$1,
|
|
292265
|
+
attachments: optional$4(ArraySchema(ChatAttachment)),
|
|
292266
|
+
isStreaming: Boolean$1,
|
|
292267
|
+
createdAt: IsoDateTime,
|
|
292268
|
+
updatedAt: IsoDateTime
|
|
292269
|
+
});
|
|
292270
|
+
const ListProjectionThreadMessagesInput = Struct({ threadId: ThreadId });
|
|
292271
|
+
const GetProjectionThreadMessageInput = Struct({ messageId: MessageId });
|
|
292272
|
+
const DeleteProjectionThreadMessagesInput = Struct({ threadId: ThreadId });
|
|
292273
|
+
/**
|
|
292274
|
+
* ProjectionThreadMessageRepository - Service tag for message projection persistence.
|
|
292275
|
+
*/
|
|
292276
|
+
var ProjectionThreadMessageRepository = class extends Service$1()("forge/persistence/Services/ProjectionThreadMessages/ProjectionThreadMessageRepository") {};
|
|
292277
|
+
//#endregion
|
|
292165
292278
|
//#region src/persistence/Services/ProjectionThreadProposedPlans.ts
|
|
292166
292279
|
const ProjectionThreadProposedPlan = Struct({
|
|
292167
292280
|
planId: OrchestrationProposedPlanId,
|
|
@@ -293098,6 +293211,7 @@ const OrchestrationProjectionPipelineLive = effect(OrchestrationProjectionPipeli
|
|
|
293098
293211
|
workspaceRoot: event.payload.workspaceRoot,
|
|
293099
293212
|
defaultModelSelection: event.payload.defaultModelSelection,
|
|
293100
293213
|
defaultThreadEnvMode: event.payload.defaultThreadEnvMode ?? null,
|
|
293214
|
+
cmmdRegistration: event.payload.cmmdRegistration ?? null,
|
|
293101
293215
|
scripts: event.payload.scripts,
|
|
293102
293216
|
createdAt: event.payload.createdAt,
|
|
293103
293217
|
updatedAt: event.payload.updatedAt,
|
|
@@ -293113,6 +293227,7 @@ const OrchestrationProjectionPipelineLive = effect(OrchestrationProjectionPipeli
|
|
|
293113
293227
|
...event.payload.workspaceRoot !== void 0 ? { workspaceRoot: event.payload.workspaceRoot } : {},
|
|
293114
293228
|
...event.payload.defaultModelSelection !== void 0 ? { defaultModelSelection: event.payload.defaultModelSelection } : {},
|
|
293115
293229
|
...event.payload.defaultThreadEnvMode !== void 0 ? { defaultThreadEnvMode: event.payload.defaultThreadEnvMode } : {},
|
|
293230
|
+
...event.payload.cmmdRegistration !== void 0 ? { cmmdRegistration: event.payload.cmmdRegistration } : {},
|
|
293116
293231
|
...event.payload.scripts !== void 0 ? { scripts: event.payload.scripts } : {},
|
|
293117
293232
|
updatedAt: event.payload.updatedAt
|
|
293118
293233
|
});
|
|
@@ -294004,6 +294119,7 @@ const decodeShellSnapshot = decodeUnknownEffect(OrchestrationShellSnapshot);
|
|
|
294004
294119
|
const decodeThread = decodeUnknownEffect(OrchestrationThread);
|
|
294005
294120
|
const ProjectionProjectDbRowSchema = ProjectionProject.mapFields(assign({
|
|
294006
294121
|
defaultModelSelection: NullOr(fromJsonString(ModelSelection)),
|
|
294122
|
+
cmmdRegistration: NullOr(fromJsonString(CmmdRegistration)),
|
|
294007
294123
|
scripts: fromJsonString(ArraySchema(ProjectScript))
|
|
294008
294124
|
}));
|
|
294009
294125
|
const ProjectionThreadMessageDbRowSchema = ProjectionThreadMessage.mapFields(assign({
|
|
@@ -294142,6 +294258,7 @@ function mapProjectShellRow(row, repositoryIdentity, availability) {
|
|
|
294142
294258
|
repositoryIdentity,
|
|
294143
294259
|
availability,
|
|
294144
294260
|
defaultModelSelection: row.defaultModelSelection,
|
|
294261
|
+
cmmdRegistration: row.cmmdRegistration,
|
|
294145
294262
|
scripts: row.scripts,
|
|
294146
294263
|
createdAt: row.createdAt,
|
|
294147
294264
|
updatedAt: row.updatedAt
|
|
@@ -294179,6 +294296,7 @@ const OrchestrationInfrastructureLayerLive = mergeAll(effect(ProjectionSnapshotQ
|
|
|
294179
294296
|
workspace_root AS "workspaceRoot",
|
|
294180
294297
|
default_model_selection_json AS "defaultModelSelection",
|
|
294181
294298
|
default_thread_env_mode AS "defaultThreadEnvMode",
|
|
294299
|
+
cmmd_registration_json AS "cmmdRegistration",
|
|
294182
294300
|
scripts_json AS "scripts",
|
|
294183
294301
|
created_at AS "createdAt",
|
|
294184
294302
|
updated_at AS "updatedAt",
|
|
@@ -294474,6 +294592,7 @@ const OrchestrationInfrastructureLayerLive = mergeAll(effect(ProjectionSnapshotQ
|
|
|
294474
294592
|
workspace_root AS "workspaceRoot",
|
|
294475
294593
|
default_model_selection_json AS "defaultModelSelection",
|
|
294476
294594
|
default_thread_env_mode AS "defaultThreadEnvMode",
|
|
294595
|
+
cmmd_registration_json AS "cmmdRegistration",
|
|
294477
294596
|
scripts_json AS "scripts",
|
|
294478
294597
|
created_at AS "createdAt",
|
|
294479
294598
|
updated_at AS "updatedAt",
|
|
@@ -294495,6 +294614,7 @@ const OrchestrationInfrastructureLayerLive = mergeAll(effect(ProjectionSnapshotQ
|
|
|
294495
294614
|
workspace_root AS "workspaceRoot",
|
|
294496
294615
|
default_model_selection_json AS "defaultModelSelection",
|
|
294497
294616
|
default_thread_env_mode AS "defaultThreadEnvMode",
|
|
294617
|
+
cmmd_registration_json AS "cmmdRegistration",
|
|
294498
294618
|
scripts_json AS "scripts",
|
|
294499
294619
|
created_at AS "createdAt",
|
|
294500
294620
|
updated_at AS "updatedAt",
|
|
@@ -294515,6 +294635,7 @@ const OrchestrationInfrastructureLayerLive = mergeAll(effect(ProjectionSnapshotQ
|
|
|
294515
294635
|
workspace_root AS "workspaceRoot",
|
|
294516
294636
|
default_model_selection_json AS "defaultModelSelection",
|
|
294517
294637
|
default_thread_env_mode AS "defaultThreadEnvMode",
|
|
294638
|
+
cmmd_registration_json AS "cmmdRegistration",
|
|
294518
294639
|
scripts_json AS "scripts",
|
|
294519
294640
|
created_at AS "createdAt",
|
|
294520
294641
|
updated_at AS "updatedAt",
|
|
@@ -294832,6 +294953,7 @@ const OrchestrationInfrastructureLayerLive = mergeAll(effect(ProjectionSnapshotQ
|
|
|
294832
294953
|
repositoryIdentity: repositoryIdentities.get(row.projectId) ?? null,
|
|
294833
294954
|
availability: projectAvailabilities.get(row.projectId) ?? "unknown",
|
|
294834
294955
|
defaultModelSelection: row.defaultModelSelection,
|
|
294956
|
+
cmmdRegistration: row.cmmdRegistration,
|
|
294835
294957
|
scripts: row.scripts,
|
|
294836
294958
|
createdAt: row.createdAt,
|
|
294837
294959
|
updatedAt: row.updatedAt,
|
|
@@ -298330,6 +298452,23 @@ const cmmdRenameDeviceRouteLayer = registerProxyRoute({
|
|
|
298330
298452
|
orgIdSource: "none",
|
|
298331
298453
|
responseShape: "unwrapData"
|
|
298332
298454
|
});
|
|
298455
|
+
/**
|
|
298456
|
+
* Name the caller's cloud Environment (FOR-36371).
|
|
298457
|
+
*
|
|
298458
|
+
* Owner JWT lane, like every other `/api/cmmd/forge-runtimes/*` control call.
|
|
298459
|
+
* CMMD scopes the rename to the caller's own Environment and answers 409
|
|
298460
|
+
* `environment_name_taken` when this Seat already has one by that name; both
|
|
298461
|
+
* the status and the code reach the browser unchanged, which is what lets the
|
|
298462
|
+
* rename field say something specific instead of "something went wrong".
|
|
298463
|
+
*/
|
|
298464
|
+
const cmmdRenameForgeRuntimeRouteLayer = registerProxyRoute({
|
|
298465
|
+
forgePath: "/api/cmmd/forge-runtimes/:runtimeId/rename",
|
|
298466
|
+
method: "POST",
|
|
298467
|
+
cmmdPath: "/api/forge/context/runtimes/:runtimeId/rename",
|
|
298468
|
+
orgIdSource: "none",
|
|
298469
|
+
responseShape: "unwrapData",
|
|
298470
|
+
successStatus: 200
|
|
298471
|
+
});
|
|
298333
298472
|
const cmmdRevokeDeviceRouteLayer = registerProxyRoute({
|
|
298334
298473
|
forgePath: "/api/cmmd/devices/:deviceId/revoke",
|
|
298335
298474
|
method: "POST",
|
|
@@ -300255,16 +300394,26 @@ const replicaTurnStatuses = new Set([
|
|
|
300255
300394
|
function isRecord$6(value) {
|
|
300256
300395
|
return typeof value === "object" && value !== null && !Array.isArray(value);
|
|
300257
300396
|
}
|
|
300397
|
+
function replicaSourceSequence(value) {
|
|
300398
|
+
return typeof value === "number" && Number.isSafeInteger(value) && value > 0 ? value : null;
|
|
300399
|
+
}
|
|
300400
|
+
function replicaSourceEventId(value) {
|
|
300401
|
+
return typeof value === "string" && value.length > 0 ? value : null;
|
|
300402
|
+
}
|
|
300403
|
+
function replicaSourceTurn(sourceTurnId) {
|
|
300404
|
+
return typeof sourceTurnId === "string" && sourceTurnId.length > 0 ? { turnId: sourceTurnId } : {};
|
|
300405
|
+
}
|
|
300258
300406
|
function replicaActivitySource(activity) {
|
|
300259
300407
|
if (!activity.kind.startsWith("replica.") || !isRecord$6(activity.payload)) return null;
|
|
300260
|
-
const sourceSequence = activity.sequence;
|
|
300261
|
-
const eventId = activity.payload.sourceEventId;
|
|
300262
|
-
if (sourceSequence ===
|
|
300263
|
-
return
|
|
300408
|
+
const sourceSequence = replicaSourceSequence(activity.sequence);
|
|
300409
|
+
const eventId = replicaSourceEventId(activity.payload.sourceEventId);
|
|
300410
|
+
if (sourceSequence === null || eventId === null) return null;
|
|
300411
|
+
return {
|
|
300264
300412
|
sourceSequence,
|
|
300265
300413
|
eventId,
|
|
300266
|
-
occurredAt: activity.createdAt
|
|
300267
|
-
|
|
300414
|
+
occurredAt: activity.createdAt,
|
|
300415
|
+
turn: replicaSourceTurn(activity.payload.sourceTurnId)
|
|
300416
|
+
};
|
|
300268
300417
|
}
|
|
300269
300418
|
function replicaSummaryEvent(activity, source) {
|
|
300270
300419
|
if (activity.kind !== "replica.activity_summary" && activity.kind !== "replica.error_summary") return null;
|
|
@@ -300274,6 +300423,7 @@ function replicaSummaryEvent(activity, source) {
|
|
|
300274
300423
|
event: {
|
|
300275
300424
|
eventId: source.eventId,
|
|
300276
300425
|
occurredAt: source.occurredAt,
|
|
300426
|
+
...source.turn,
|
|
300277
300427
|
kind: activity.kind.slice(8),
|
|
300278
300428
|
summary: typeof sourceText === "string" ? sourceText : activity.summary
|
|
300279
300429
|
}
|
|
@@ -300287,6 +300437,7 @@ function replicaTurnEvent(activity, source) {
|
|
|
300287
300437
|
event: {
|
|
300288
300438
|
eventId: source.eventId,
|
|
300289
300439
|
occurredAt: source.occurredAt,
|
|
300440
|
+
...source.turn,
|
|
300290
300441
|
kind: "turn_status",
|
|
300291
300442
|
status
|
|
300292
300443
|
}
|
|
@@ -300302,6 +300453,7 @@ function replicaToolCallEvent(activity, source) {
|
|
|
300302
300453
|
event: {
|
|
300303
300454
|
eventId: source.eventId,
|
|
300304
300455
|
occurredAt: source.occurredAt,
|
|
300456
|
+
...source.turn,
|
|
300305
300457
|
kind: "tool_call",
|
|
300306
300458
|
summary: sourceText,
|
|
300307
300459
|
status,
|
|
@@ -300309,9 +300461,36 @@ function replicaToolCallEvent(activity, source) {
|
|
|
300309
300461
|
}
|
|
300310
300462
|
};
|
|
300311
300463
|
}
|
|
300464
|
+
function replicaTurnUsageEvent(activity, source) {
|
|
300465
|
+
if (activity.kind !== "replica.turn_usage" || !isRecord$6(activity.payload)) return null;
|
|
300466
|
+
const usage = activity.payload.payload;
|
|
300467
|
+
if (!("turnId" in source.turn) || !isRecord$6(usage)) return null;
|
|
300468
|
+
const provider = usage.provider;
|
|
300469
|
+
const model = usage.model;
|
|
300470
|
+
if (typeof provider !== "string" || typeof model !== "string" || !("usage" in usage)) return null;
|
|
300471
|
+
const tokens = usage.usage;
|
|
300472
|
+
return {
|
|
300473
|
+
sourceSequence: source.sourceSequence,
|
|
300474
|
+
event: {
|
|
300475
|
+
eventId: source.eventId,
|
|
300476
|
+
occurredAt: source.occurredAt,
|
|
300477
|
+
kind: "turn_usage",
|
|
300478
|
+
turnId: source.turn.turnId,
|
|
300479
|
+
provider,
|
|
300480
|
+
model,
|
|
300481
|
+
usage: tokens === null ? null : {
|
|
300482
|
+
uncachedInputTokens: tokens.uncachedInputTokens,
|
|
300483
|
+
cachedInputTokens: tokens.cachedInputTokens,
|
|
300484
|
+
cacheCreationTokens: tokens.cacheCreationTokens,
|
|
300485
|
+
outputTokens: tokens.outputTokens,
|
|
300486
|
+
reasoningTokens: tokens.reasoningTokens
|
|
300487
|
+
}
|
|
300488
|
+
}
|
|
300489
|
+
};
|
|
300490
|
+
}
|
|
300312
300491
|
function serializeReplicaActivity(activity) {
|
|
300313
300492
|
const source = replicaActivitySource(activity);
|
|
300314
|
-
return source === null ? null : replicaSummaryEvent(activity, source) ?? replicaTurnEvent(activity, source) ?? replicaToolCallEvent(activity, source);
|
|
300493
|
+
return source === null ? null : replicaSummaryEvent(activity, source) ?? replicaTurnEvent(activity, source) ?? replicaToolCallEvent(activity, source) ?? replicaTurnUsageEvent(activity, source);
|
|
300315
300494
|
}
|
|
300316
300495
|
function serializeReplicaMessage(message) {
|
|
300317
300496
|
const source = decodeReplicaSourceMessageId(message.id);
|
|
@@ -300321,6 +300500,7 @@ function serializeReplicaMessage(message) {
|
|
|
300321
300500
|
event: {
|
|
300322
300501
|
eventId: source.eventId,
|
|
300323
300502
|
occurredAt: message.createdAt,
|
|
300503
|
+
...source.turnId === void 0 ? {} : { turnId: source.turnId },
|
|
300324
300504
|
kind: message.role === "user" ? "user_message" : "assistant_message",
|
|
300325
300505
|
text: message.text
|
|
300326
300506
|
}
|
|
@@ -300397,12 +300577,17 @@ function canonicalRuntimeEventTimestamp(value) {
|
|
|
300397
300577
|
if (Number.isNaN(timestamp.getTime())) throw new Error(`Invalid runtime event timestamp: ${value}`);
|
|
300398
300578
|
return timestamp.toISOString();
|
|
300399
300579
|
}
|
|
300580
|
+
/** Spread onto an event: present only when the projection knows the turn. */
|
|
300581
|
+
function eventTurn(turnId) {
|
|
300582
|
+
return turnId ? { turnId } : {};
|
|
300583
|
+
}
|
|
300400
300584
|
function orderedLocalMessageEvent(message, content) {
|
|
300401
300585
|
return {
|
|
300402
300586
|
sourceSequence: null,
|
|
300403
300587
|
event: {
|
|
300404
300588
|
eventId: `message:${message.id}`,
|
|
300405
300589
|
occurredAt: canonicalRuntimeEventTimestamp(message.createdAt),
|
|
300590
|
+
...eventTurn(message.turnId),
|
|
300406
300591
|
kind: message.role === "user" ? "user_message" : "assistant_message",
|
|
300407
300592
|
text: content
|
|
300408
300593
|
}
|
|
@@ -300433,6 +300618,7 @@ function serializeNativeToolActivity(activity) {
|
|
|
300433
300618
|
event: {
|
|
300434
300619
|
eventId: `activity:${activity.id}`,
|
|
300435
300620
|
occurredAt: canonicalRuntimeEventTimestamp(activity.createdAt),
|
|
300621
|
+
...eventTurn(activity.turnId),
|
|
300436
300622
|
kind: "tool_call",
|
|
300437
300623
|
summary,
|
|
300438
300624
|
status: activityStatus(activity),
|
|
@@ -300475,11 +300661,123 @@ function serializeProviderFailureActivity(activity) {
|
|
|
300475
300661
|
event: {
|
|
300476
300662
|
eventId: `activity:${activity.id}`,
|
|
300477
300663
|
occurredAt: canonicalRuntimeEventTimestamp(activity.createdAt),
|
|
300664
|
+
...eventTurn(activity.turnId),
|
|
300478
300665
|
kind: "error_summary",
|
|
300479
300666
|
summary: text(detail === null ? summary : `${summary}: ${detail}`, 4e3) ?? summary
|
|
300480
300667
|
}
|
|
300481
300668
|
};
|
|
300482
300669
|
}
|
|
300670
|
+
const turnUsageKeys = [
|
|
300671
|
+
"uncachedInputTokens",
|
|
300672
|
+
"cachedInputTokens",
|
|
300673
|
+
"cacheCreationTokens",
|
|
300674
|
+
"outputTokens",
|
|
300675
|
+
"reasoningTokens"
|
|
300676
|
+
];
|
|
300677
|
+
function isTurnUsageRecord(value) {
|
|
300678
|
+
if (!value || typeof value !== "object") return false;
|
|
300679
|
+
const record = value;
|
|
300680
|
+
return (record.scope === "turn-total" || record.scope === "call-delta") && turnUsageKeys.every((key) => Number.isSafeInteger(record[key]) && record[key] >= 0);
|
|
300681
|
+
}
|
|
300682
|
+
function providerTurnUsage(activity) {
|
|
300683
|
+
if (activity.kind !== "context-window.updated") return null;
|
|
300684
|
+
const payload = activity.payload;
|
|
300685
|
+
const usage = payload && typeof payload === "object" ? payload.turnUsage : void 0;
|
|
300686
|
+
return isTurnUsageRecord(usage) ? usage : null;
|
|
300687
|
+
}
|
|
300688
|
+
function tokensOf(usage) {
|
|
300689
|
+
return {
|
|
300690
|
+
uncachedInputTokens: usage.uncachedInputTokens,
|
|
300691
|
+
cachedInputTokens: usage.cachedInputTokens,
|
|
300692
|
+
cacheCreationTokens: usage.cacheCreationTokens,
|
|
300693
|
+
outputTokens: usage.outputTokens,
|
|
300694
|
+
reasoningTokens: usage.reasoningTokens
|
|
300695
|
+
};
|
|
300696
|
+
}
|
|
300697
|
+
/**
|
|
300698
|
+
* What one turn spent, from the usage the adapter reported while it ran.
|
|
300699
|
+
*
|
|
300700
|
+
* A `turn-total` (Claude, from the result message) is the whole turn, so the
|
|
300701
|
+
* last one wins. Otherwise the turn is the sum of its `call-delta` rows
|
|
300702
|
+
* (Codex, one per token update) after dropping consecutive duplicates, the
|
|
300703
|
+
* same rule usage/usageTranscripts.ts applies to a Codex rollout so a Recorded
|
|
300704
|
+
* turn and a scanned transcript agree. No usage at all is an Unreported turn.
|
|
300705
|
+
*/
|
|
300706
|
+
function turnUsageTokens(activities) {
|
|
300707
|
+
const reported = activities.map(providerTurnUsage).filter((usage) => usage !== null);
|
|
300708
|
+
const total = reported.findLast((usage) => usage.scope === "turn-total");
|
|
300709
|
+
if (total) return tokensOf(total);
|
|
300710
|
+
let summed = null;
|
|
300711
|
+
let previous = null;
|
|
300712
|
+
for (const delta of reported) {
|
|
300713
|
+
const signature = JSON.stringify(tokensOf(delta));
|
|
300714
|
+
if (signature === previous) continue;
|
|
300715
|
+
previous = signature;
|
|
300716
|
+
const tokens = tokensOf(delta);
|
|
300717
|
+
summed = summed ? {
|
|
300718
|
+
uncachedInputTokens: summed.uncachedInputTokens + tokens.uncachedInputTokens,
|
|
300719
|
+
cachedInputTokens: summed.cachedInputTokens + tokens.cachedInputTokens,
|
|
300720
|
+
cacheCreationTokens: summed.cacheCreationTokens + tokens.cacheCreationTokens,
|
|
300721
|
+
outputTokens: summed.outputTokens + tokens.outputTokens,
|
|
300722
|
+
reasoningTokens: summed.reasoningTokens + tokens.reasoningTokens
|
|
300723
|
+
} : tokens;
|
|
300724
|
+
}
|
|
300725
|
+
return summed;
|
|
300726
|
+
}
|
|
300727
|
+
/**
|
|
300728
|
+
* One Recorded turn per settled local turn: the turns named on this thread's
|
|
300729
|
+
* own messages and activities, minus the one still running (it would churn a
|
|
300730
|
+
* new generation on every token update). Hydrated replica rows carry no local
|
|
300731
|
+
* turn, so a recovered thread does not re-record turns CMMD already holds.
|
|
300732
|
+
*
|
|
300733
|
+
* Model and provider are the thread's current selection. The adapters do not
|
|
300734
|
+
* yet report which model answered a given turn, so a mid-thread model switch
|
|
300735
|
+
* is attributed to the selection in force when the thread is serialized.
|
|
300736
|
+
* Recorded on FOR-36388.
|
|
300737
|
+
*/
|
|
300738
|
+
/** Turns named on this thread's own rows; hydrated replica rows carry no local turn. */
|
|
300739
|
+
function localTurnIds(thread) {
|
|
300740
|
+
const fromMessages = thread.messages.filter((message) => !message.streaming).map((message) => message.turnId);
|
|
300741
|
+
const fromActivities = thread.activities.filter((activity) => !activity.kind.startsWith("replica.")).map((activity) => activity.turnId);
|
|
300742
|
+
const turnIds = /* @__PURE__ */ new Set();
|
|
300743
|
+
for (const turnId of [...fromMessages, ...fromActivities]) if (turnId) turnIds.add(turnId);
|
|
300744
|
+
return turnIds;
|
|
300745
|
+
}
|
|
300746
|
+
function settledTurnIds(thread) {
|
|
300747
|
+
const turnIds = localTurnIds(thread);
|
|
300748
|
+
if (thread.latestTurn?.state === "running") turnIds.delete(thread.latestTurn.turnId);
|
|
300749
|
+
return turnIds;
|
|
300750
|
+
}
|
|
300751
|
+
function turnActivities(thread, turnId) {
|
|
300752
|
+
return thread.activities.filter((activity) => activity.turnId === turnId).toSorted((left, right) => left.createdAt.localeCompare(right.createdAt) || left.id.localeCompare(right.id));
|
|
300753
|
+
}
|
|
300754
|
+
/** The last thing that happened in the turn: what the Recorded turn is stamped with. */
|
|
300755
|
+
function turnLatestAt(thread, turnId, activities) {
|
|
300756
|
+
return [...activities.map((activity) => activity.createdAt), ...thread.messages.filter((message) => message.turnId === turnId).map((message) => message.createdAt)].toSorted().at(-1);
|
|
300757
|
+
}
|
|
300758
|
+
function recordedTurnEvent(thread, turnId) {
|
|
300759
|
+
const activities = turnActivities(thread, turnId);
|
|
300760
|
+
const latestAt = turnLatestAt(thread, turnId, activities);
|
|
300761
|
+
if (latestAt === void 0) return null;
|
|
300762
|
+
return {
|
|
300763
|
+
sourceSequence: null,
|
|
300764
|
+
event: {
|
|
300765
|
+
eventId: `usage:${turnId}`,
|
|
300766
|
+
occurredAt: canonicalRuntimeEventTimestamp(latestAt),
|
|
300767
|
+
kind: "turn_usage",
|
|
300768
|
+
turnId,
|
|
300769
|
+
provider: thread.modelSelection?.provider ?? "unknown",
|
|
300770
|
+
model: thread.modelSelection?.model ?? "unknown",
|
|
300771
|
+
usage: turnUsageTokens(activities)
|
|
300772
|
+
}
|
|
300773
|
+
};
|
|
300774
|
+
}
|
|
300775
|
+
function serializeRecordedTurns(thread) {
|
|
300776
|
+
return [...settledTurnIds(thread)].flatMap((turnId) => {
|
|
300777
|
+
const event = recordedTurnEvent(thread, turnId);
|
|
300778
|
+
return event === null ? [] : [event];
|
|
300779
|
+
});
|
|
300780
|
+
}
|
|
300483
300781
|
function serializeRuntimeThreadEvents(thread) {
|
|
300484
300782
|
const messages = thread.messages.flatMap(serializeThreadMessage);
|
|
300485
300783
|
const failureActivities = thread.activities.flatMap((activity) => {
|
|
@@ -300494,11 +300792,13 @@ function serializeRuntimeThreadEvents(thread) {
|
|
|
300494
300792
|
const event = serializeNativeToolActivity(activity);
|
|
300495
300793
|
return event === null ? [] : [event];
|
|
300496
300794
|
});
|
|
300795
|
+
const recordedTurns = serializeRecordedTurns(thread);
|
|
300497
300796
|
return [
|
|
300498
300797
|
...messages,
|
|
300499
300798
|
...replicaActivities,
|
|
300500
300799
|
...toolActivities,
|
|
300501
|
-
...failureActivities
|
|
300800
|
+
...failureActivities,
|
|
300801
|
+
...recordedTurns
|
|
300502
300802
|
].toSorted((left, right) => {
|
|
300503
300803
|
if (left.sourceSequence !== null && right.sourceSequence !== null) return left.sourceSequence - right.sourceSequence;
|
|
300504
300804
|
if (left.sourceSequence !== null) return -1;
|
|
@@ -309693,7 +309993,6 @@ const PlatformServicesLive = unwrap(gen(function* () {
|
|
|
309693
309993
|
return layer;
|
|
309694
309994
|
}
|
|
309695
309995
|
}));
|
|
309696
|
-
const CmmdSyncLayerLive = empty$4.pipe(provideMerge(TurnCompletionWatcherLive), provideMerge(CmmdSyncWorkerLive), provideMerge(TurnSerializerLive), provideMerge(CmmdSyncClientLive));
|
|
309697
309996
|
const RuntimeReplicationLayerLive = RuntimeReplicationLive.pipe(provideMerge(RuntimeReplicationClientLive), provideMerge(RuntimeReplicationOutboxLive), provideMerge(ActiveHourMeterLive.pipe(provide$1(RuntimeReplicationOutboxLive))));
|
|
309698
309997
|
const RuntimeDrainLayerLive = RuntimeDrainReporterLive.pipe(provideMerge(RuntimeDrainStateLive));
|
|
309699
309998
|
const RuntimeAwareProviderReactorsLive = mergeAll(ProviderRuntimeIngestionLive, ProviderCommandReactorLive).pipe(provide$1(RuntimeDrainLayerLive));
|
|
@@ -309701,7 +310000,7 @@ const PipelineWorkerCoordinatorLayerLive = PipelineWorkerCoordinatorLive.pipe(pr
|
|
|
309701
310000
|
const AgentProtocolReactorLayerLive = AgentProtocolReactorLive.pipe(provideMerge(PipelineRunStoreLive));
|
|
309702
310001
|
const PipelineRunCoordinatorLayerLive = PipelineRunCoordinatorLive.pipe(provideMerge(PipelineProviderAuthorityInstallerLive), provideMerge(PipelineChangeInspectorLive), provideMerge(PipelineContextArtifactStoreLive), provideMerge(PipelineModelPolicyLive), provideMerge(PipelineRunClientLive), provideMerge(PipelineRunStoreLive), provideMerge(PipelineRunWorkspaceAllocatorLive), provideMerge(PipelineStagePolicyLive), provideMerge(PipelineWorkerCoordinatorLayerLive));
|
|
309703
310002
|
const PipelineRuntimeLayerLive = PipelineCoordinatorReactorLive.pipe(provideMerge(PipelineRunCoordinatorLayerLive), provideMerge(AgentProtocolReactorLayerLive));
|
|
309704
|
-
const ReactorLayerLive = empty$4.pipe(provideMerge(OrchestrationReactorLive), provideMerge(ApprovedWorkerPlanReactorLive), provideMerge(RuntimeAwareProviderReactorsLive), provideMerge(CheckpointReactorLive), provideMerge(SpriteTaskHoldReactorLive), provideMerge(PlanTaskCreationReactorLive), provideMerge(RuntimeReceiptBusLive), provideMerge(
|
|
310003
|
+
const ReactorLayerLive = empty$4.pipe(provideMerge(OrchestrationReactorLive), provideMerge(ApprovedWorkerPlanReactorLive), provideMerge(RuntimeAwareProviderReactorsLive), provideMerge(CheckpointReactorLive), provideMerge(SpriteTaskHoldReactorLive), provideMerge(PlanTaskCreationReactorLive), provideMerge(RuntimeReceiptBusLive), provideMerge(RuntimeReplicationLayerLive), provideMerge(PipelineRuntimeLayerLive), provideMerge(LocalAutomationRunReconcilerLive));
|
|
309705
310004
|
const CheckpointingLayerLive = empty$4.pipe(provideMerge(CheckpointDiffQueryLive), provideMerge(CheckpointStoreLive));
|
|
309706
310005
|
const ProviderLayerLive = unwrap(gen(function* () {
|
|
309707
310006
|
const config = yield* ServerConfig;
|
|
@@ -309755,10 +310054,10 @@ const MiscRuntimeLayerLive = mergeAll(AnalyticsServiceLayerLive, OpenLive, Serve
|
|
|
309755
310054
|
const RuntimeDependenciesWithoutPullRequestsLive = ReactorLayerLive.pipe(provideMerge(CheckpointingLayerLive), provideMerge(GitLayerLive), provideMerge(OrchestrationLayerLive), provideMerge(ProviderLayerLive), provideMerge(TerminalLayerLive), provideMerge(AgentBrowserManagerLive), provideMerge(mergeAll(ThreadDevRuntimeLive, DevTunnelLive.pipe(provide$1(ThreadDevRuntimeLive)))), provideMerge(PersistenceLayerLive), provideMerge(KeybindingsLive), provideMerge(ProviderRegistryLive), provideMerge(mergeAll(ServerSettingsLive, UsageServiceLive.pipe(provide$1(ServerSettingsLive)))), provideMerge(WorkspaceLayerLive), provideMerge(WorkspaceReadinessStateLive), provideMerge(ProjectFaviconResolverLive), provideMerge(RepositoryIdentityResolverLive), provideMerge(ServerEnvironmentLive), provideMerge(AuthLayerLive), provideMerge(ServerSecretStoreLayerLive), provideMerge(mergeAll(CloudRedisCoordinationLive, CloudStateSyncLive.pipe(provide$1(PersistenceLayerLive)))), provideMerge(MiscRuntimeLayerLive));
|
|
309756
310055
|
const RuntimeDependenciesLive = pullRequestServiceFactoryLayer.pipe(provideMerge(RuntimeDependenciesWithoutPullRequestsLive), provideMerge(cmmdProjectIdentityResolverLive.pipe(provide$1(RuntimeDependenciesWithoutPullRequestsLive))), provideMerge(pullRequestProviderRuntimeLive));
|
|
309757
310056
|
const RuntimeServicesLive = ServerRuntimeStartupLive.pipe(provideMerge(RuntimeDependenciesLive));
|
|
309758
|
-
const makeRoutesLayer = mergeAll(authBearerBootstrapRouteLayer, authBootstrapRouteLayer, authCommandBearerBootstrapRouteLayer, authCommandBootstrapRouteLayer, authOAuthTokenExchangeRouteLayer, authWebSocketTicketRouteLayer, authCmmdOAuthDeviceRouteLayer, authCmmdOAuthTokenRouteLayer, authCmmdPasswordTokenRouteLayer, authClientsRevokeOthersRouteLayer, authClientsRevokeRouteLayer, authClientsRouteLayer, authLogoutRouteLayer, authPairingLinksRevokeRouteLayer, authPairingLinksRouteLayer, authPairingCredentialRouteLayer, authSessionRouteLayer, authWebSocketTokenRouteLayer, authWebLoginRouteLayer, authWebCallbackRouteLayer, desktopLocalWebBridgePublishRouteLayer, desktopLocalWebBridgeBootstrapRouteLayer, desktopRelayControlPlaneRouteLayer, apiDocsHtmlRouteLayer, apiDocsOpenApiRouteLayer, pulseSignalStateListRouteLayer, pulseSignalStateUpsertRouteLayer, cmmdProfileRouteLayer, cmmdCreateBrainDocRouteLayer, cmmdUpdateTaskRouteLayer, cmmdUpsertTaskPullRequestRouteLayer, ...cmmdPullRequestRouteLayers, cmmdAddTaskCommentRouteLayer, cmmdWorkIntakeRouteLayer, cmmdWsTokenRouteLayer, cmmdSearchTasksRouteLayer, cmmdGetTaskCommentsRouteLayer, cmmdGetProjectCommentsRouteLayer, cmmdAddProjectCommentRouteLayer, cmmdUpdateProjectRouteLayer, cmmdGetOrgMembersRouteLayer, cmmdSimHostsRouteLayer, cmmdSimLeaseReadRouteLayer, cmmdSimLeaseClaimRouteLayer, cmmdSimLeaseReleaseRouteLayer, cmmdSimLeaseRenewRouteLayer, cmmdUploadTaskAttachmentRouteLayer, cmmdGetTaskAttachmentsRouteLayer, cmmdUpdateTaskCommentRouteLayer, cmmdDeleteTaskCommentRouteLayer, cmmdGetProjectRepositoryRouteLayer, cmmdListProjectRepositoriesRouteLayer, cmmdArchiveTaskRouteLayer, cmmdUnarchiveTaskRouteLayer, cmmdListTasksRouteLayer, cmmdCreateTaskRouteLayer, cmmdListCampaignsRouteLayer, cmmdGetCampaignRouteLayer, cmmdCreateCampaignRouteLayer, cmmdUpdateCampaignRouteLayer, cmmdDeleteCampaignRouteLayer, cmmdListSavedViewsRouteLayer, cmmdCreateSavedViewRouteLayer, cmmdImportSavedViewRouteLayer, cmmdUpdateSavedViewRouteLayer, cmmdDeleteSavedViewRouteLayer, cmmdListProjectsRouteLayer, cmmdGetProjectRouteLayer, cmmdCreateProjectRouteLayer, cmmdDeleteProjectRouteLayer, cmmdMoveProjectRouteLayer, cmmdGetProjectMembersRouteLayer, cmmdListWorkspaceMembersRouteLayer, cmmdAddProjectMemberRouteLayer, cmmdGetProjectMilestonesRouteLayer, cmmdCreateProjectMilestoneRouteLayer, cmmdUpdateProjectMilestoneRouteLayer, cmmdDeleteProjectMilestoneRouteLayer, cmmdGetProjectUpdatesRouteLayer, cmmdCreateProjectUpdateRouteLayer, cmmdUpdateProjectUpdateRouteLayer, cmmdDeleteProjectUpdateRouteLayer, cmmdImproveProjectContentRouteLayer, cmmdCreateProjectTaskDraftRouteLayer, cmmdGetProjectTaskDraftRouteLayer, cmmdUpdateProjectTaskDraftRouteLayer, cmmdPreviewProjectTaskDraftRouteLayer, cmmdCommitProjectTaskDraftRouteLayer, cmmdDiscardProjectTaskDraftRouteLayer, cmmdGetProjectLeadPlanRouteLayer, cmmdActivateProjectLeadAuthorityRouteLayer, cmmdGetProjectLeadReadinessRouteLayer, cmmdGetProjectLeadCapabilitiesRouteLayer, cmmdGetProjectLeadSummaryRouteLayer, cmmdGetProjectLeadDetailRouteLayer, cmmdGetProjectLeadBriefingRouteLayer, cmmdListProjectLeadEventsRouteLayer, cmmdExplainProjectLeadRouteLayer, cmmdPauseProjectLeadRouteLayer, cmmdResumeProjectLeadRouteLayer, cmmdReserveProjectLeadTaskRouteLayer, cmmdReleaseProjectLeadReservationRouteLayer, cmmdReconcileProjectLeadRouteLayer, cmmdResolveProjectLeadAttentionRouteLayer, cmmdClaimProjectLeadControllerRouteLayer, cmmdRenewProjectLeadControllerClaimRouteLayer, cmmdYieldProjectLeadControllerClaimRouteLayer, cmmdAcknowledgeProjectLeadControllerEventRouteLayer, cmmdRecordProjectLeadControllerDecisionRouteLayer, cmmdListForgeAutomationPresetsRouteLayer, cmmdListUserForgeAutomationRulesRouteLayer, cmmdCreateUserForgeAutomationRuleRouteLayer, cmmdUpdateUserForgeAutomationRuleRouteLayer, cmmdListUserForgeAutomationRunsRouteLayer, cmmdStartUserForgeAutomationRunRouteLayer, cmmdListForgeAutomationRulesRouteLayer, cmmdCreateForgeAutomationRuleRouteLayer, cmmdUpdateForgeAutomationRuleRouteLayer, cmmdListForgeAutomationRunsRouteLayer, cmmdStartForgeAutomationRunRouteLayer, cmmdGetForgeAutomationRunRouteLayer, cmmdRetryForgeAutomationRunRouteLayer, cmmdCancelForgeAutomationRunRouteLayer, cmmdApproveForgeAutomationEscalationRouteLayer, cmmdRejectForgeAutomationEscalationRouteLayer, cmmdListProjectAgentMembersRouteLayer, cmmdCreateProjectAgentMemberRouteLayer, cmmdGetProjectAgentMemberRouteLayer, cmmdRenameProjectAgentMemberRouteLayer, cmmdRetireProjectAgentMemberRouteLayer, cmmdUpdateProjectAgentMemberAvatarRouteLayer, cmmdListProjectAgentMemberInstancesRouteLayer, cmmdPreviewProjectAgentMemberConsolidationRouteLayer, cmmdApplyProjectAgentMemberConsolidationRouteLayer, cmmdPutProjectTaskAssignmentRouteLayer, cmmdListProjectBoardRouteLayer, cmmdGetProjectTaskWorkflowRouteLayer, cmmdUpdateProjectTaskWorkflowRouteLayer, cmmdCreateProjectBoardTaskRouteLayer, cmmdUpdateProjectBoardTaskRouteLayer, cmmdUpdateProjectBoardTaskStatusRouteLayer, cmmdListTaskExecutionOptionsRouteLayer, cmmdCreateTaskWorkSessionRouteLayer, cmmdListProjectWorkSessionsRouteLayer, cmmdGetWorkSessionRouteLayer, cmmdUpdateWorkSessionRouteLayer, cmmdAttachWorkSessionThreadRouteLayer, cmmdListTaskConversationsRouteLayer, cmmdLinkTaskConversationRouteLayer, cmmdGetTaskHistoryRouteLayer, cmmdGetTaskConversationRouteLayer, cmmdSpawnForgeThreadFromBoardTaskRouteLayer, cmmdListCenterBoardRouteLayer, cmmdCreateCenterBoardTaskRouteLayer, cmmdCreateFeedbackRouteLayer, cmmdUpdateCenterBoardTaskRouteLayer, cmmdMoveCenterBoardTaskRouteLayer, cmmdMoveProjectBoardTaskRouteLayer, cmmdArchiveProjectBoardTaskRouteLayer, cmmdUnarchiveProjectBoardTaskRouteLayer, cmmdArchiveCenterBoardTaskRouteLayer, cmmdUnarchiveCenterBoardTaskRouteLayer, cmmdBootstrapRouteLayer, cmmdGetAccountPreferencesRouteLayer, cmmdUpdateAccountPreferencesRouteLayer, cmmdGetOrgProviderPolicyRouteLayer, cmmdListChatsRouteLayer, cmmdGetChatRouteLayer, cmmdListDevicesRouteLayer, runtimeReplicationStatusRouteLayer, cmmdRegisterDeviceRouteLayer, cmmdHeartbeatRuntimeRouteLayer, cmmdGrantRuntimeAccessRouteLayer, cmmdRevokeRuntimeAccessRouteLayer, cmmdCreateRelayControlRouteLayer, cmmdCreateRelayActionGrantRouteLayer, cmmdReplaceRuntimeInventoryRouteLayer, cmmdListRuntimeInventoryRouteLayer, cmmdGetRuntimeDiagnosticsRouteLayer, cmmdProvisionAuthRuntimeRouteLayer, cmmdGetAuthRuntimeRouteLayer, cmmdDestroyAuthRuntimeRouteLayer, cmmdConnectAuthRuntimeRouteLayer, cmmdGetProviderAccountsRouteLayer, cmmdDeleteProviderAccountRouteLayer, cmmdSetProviderAccountDefaultRouteLayer, cmmdGetProviderUsageRouteLayer, cmmdRefreshProviderUsageRouteLayer, cmmdGetUserCodexCredentialRouteLayer, cmmdDeleteUserCodexCredentialRouteLayer, cmmdGetUserClaudeCredentialRouteLayer, cmmdDeleteUserClaudeCredentialRouteLayer, cmmdGetClaudeRuntimeReadinessRouteLayer, cmmdAppendRuntimeThreadEventsRouteLayer, cmmdGetRuntimeThreadReplicaRouteLayer, cmmdRenameDeviceRouteLayer, cmmdRevokeDeviceRouteLayer, cmmdInstallConnectorRouteLayer, cmmdListConnectorsRouteLayer, cmmdForgeCloudProjectsListRouteLayer, cmmdForgeCloudProjectsEventsRouteLayer, cmmdForgeCloudProjectRegisterRouteLayer, cmmdForgeCloudProjectUnregisterRouteLayer, cmmdForgeCloudProjectLifecyclePreflightRouteLayer, cmmdForgeCloudProjectRemovalRouteLayer, cmmdForgeCloudProjectRemovalPreviewRouteLayer, cmmdForgeCloudProjectRemovalReceiptRouteLayer, cmmdForgeRuntimesEnsureRouteLayer, cmmdForgeRuntimesConnectRouteLayer, ownerRuntimeCodexReadinessRouteLayer, cmmdForgeRuntimesStatusRouteLayer, cmmdForgeRuntimesStartRouteLayer, cmmdForgeRuntimesStopRouteLayer, cmmdForgeRuntimesRecycleRouteLayer, cmmdForgeRuntimesUpdateCommitRouteLayer, cmmdForgeRuntimesDestroyRouteLayer, cmmdGetTaskRouteLayer, commandUpdateTaskRouteLayer, mobileProviderCatalogRouteLayer, cmmdUsageSummaryRouteLayer, cmmdBillingRouteLayer, cmmdBillingSeriesRouteLayer, attachmentsRouteLayer, orchestrationDispatchRouteLayer, orchestrationCmmdWorkRunEventRouteLayer, orchestrationAutomationStartThreadRouteLayer, orchestrationAutomationRebindRouteLayer, orchestrationAutomationTerminalReconcileRouteLayer, mobileGitRunStackedActionRouteLayer, pullRequestDiffRouteLayer, orchestrationSnapshotRouteLayer, localAutomationListRouteLayer, localAutomationCreateRouteLayer, localAutomationUpdateRouteLayer, localAutomationDeleteRouteLayer, localAutomationRunRouteLayer, otlpTracesProxyRouteLayer, devTunnelProxyRouteLayer, devTunnelLocalPortProxyRouteLayer, projectFaviconRouteLayer, serverEnvironmentRouteLayer, browserWebRtcReadinessRouteLayer, staticAndDevRouteLayer, githubStatusRouteLayer, githubAuthorizeUrlRouteLayer, githubDisconnectRouteLayer, githubReposRouteLayer, githubCloneRouteLayer, githubCloneJobStartRouteLayer, githubCloneJobStatusRouteLayer, githubRefreshCredentialsRouteLayer, githubToolConfirmationApproveRouteLayer, projectLinkGetRouteLayer, projectLinkListRouteLayer, projectLinkSetRouteLayer, projectLinkDeleteRouteLayer, cmmdWorkspacesRouteLayer, cmmdCampaignsRouteLayer, cmmdProjectLinksRouteLayer, cmmdEnsureGitHubProjectContextRouteLayer, cmmdProjectRepositoryEnsureRouteLayer, cmmdProjectsGetRouteLayer, cmmdProjectsCreateRouteLayer, workspaceReadinessRouteLayer, runtimeLivenessRouteLayer, claudeNativeGenerationProofRouteLayer, claudeUsageRouteLayer, codexRuntimeProviderReadinessRouteLayer, runtimeDiagnosticsRouteLayer, cloudFoldersRouteLayer, cloudProjectCreateRouteLayer, gitUrlCloneRouteLayer, websocketRpcRouteLayer).pipe(provide$1(browserApiCorsLayer));
|
|
310057
|
+
const makeRoutesLayer = mergeAll(authBearerBootstrapRouteLayer, authBootstrapRouteLayer, authCommandBearerBootstrapRouteLayer, authCommandBootstrapRouteLayer, authOAuthTokenExchangeRouteLayer, authWebSocketTicketRouteLayer, authCmmdOAuthDeviceRouteLayer, authCmmdOAuthTokenRouteLayer, authCmmdPasswordTokenRouteLayer, authClientsRevokeOthersRouteLayer, authClientsRevokeRouteLayer, authClientsRouteLayer, authLogoutRouteLayer, authPairingLinksRevokeRouteLayer, authPairingLinksRouteLayer, authPairingCredentialRouteLayer, authSessionRouteLayer, authWebSocketTokenRouteLayer, authWebLoginRouteLayer, authWebCallbackRouteLayer, desktopLocalWebBridgePublishRouteLayer, desktopLocalWebBridgeBootstrapRouteLayer, desktopRelayControlPlaneRouteLayer, apiDocsHtmlRouteLayer, apiDocsOpenApiRouteLayer, pulseSignalStateListRouteLayer, pulseSignalStateUpsertRouteLayer, cmmdProfileRouteLayer, cmmdCreateBrainDocRouteLayer, cmmdUpdateTaskRouteLayer, cmmdUpsertTaskPullRequestRouteLayer, ...cmmdPullRequestRouteLayers, cmmdAddTaskCommentRouteLayer, cmmdWorkIntakeRouteLayer, cmmdWsTokenRouteLayer, cmmdSearchTasksRouteLayer, cmmdGetTaskCommentsRouteLayer, cmmdGetProjectCommentsRouteLayer, cmmdAddProjectCommentRouteLayer, cmmdUpdateProjectRouteLayer, cmmdGetOrgMembersRouteLayer, cmmdSimHostsRouteLayer, cmmdSimLeaseReadRouteLayer, cmmdSimLeaseClaimRouteLayer, cmmdSimLeaseReleaseRouteLayer, cmmdSimLeaseRenewRouteLayer, cmmdUploadTaskAttachmentRouteLayer, cmmdGetTaskAttachmentsRouteLayer, cmmdUpdateTaskCommentRouteLayer, cmmdDeleteTaskCommentRouteLayer, cmmdGetProjectRepositoryRouteLayer, cmmdListProjectRepositoriesRouteLayer, cmmdArchiveTaskRouteLayer, cmmdUnarchiveTaskRouteLayer, cmmdListTasksRouteLayer, cmmdCreateTaskRouteLayer, cmmdListCampaignsRouteLayer, cmmdGetCampaignRouteLayer, cmmdCreateCampaignRouteLayer, cmmdUpdateCampaignRouteLayer, cmmdDeleteCampaignRouteLayer, cmmdListSavedViewsRouteLayer, cmmdCreateSavedViewRouteLayer, cmmdImportSavedViewRouteLayer, cmmdUpdateSavedViewRouteLayer, cmmdDeleteSavedViewRouteLayer, cmmdListProjectsRouteLayer, cmmdGetProjectRouteLayer, cmmdCreateProjectRouteLayer, cmmdDeleteProjectRouteLayer, cmmdMoveProjectRouteLayer, cmmdGetProjectMembersRouteLayer, cmmdListWorkspaceMembersRouteLayer, cmmdAddProjectMemberRouteLayer, cmmdGetProjectMilestonesRouteLayer, cmmdCreateProjectMilestoneRouteLayer, cmmdUpdateProjectMilestoneRouteLayer, cmmdDeleteProjectMilestoneRouteLayer, cmmdGetProjectUpdatesRouteLayer, cmmdCreateProjectUpdateRouteLayer, cmmdUpdateProjectUpdateRouteLayer, cmmdDeleteProjectUpdateRouteLayer, cmmdImproveProjectContentRouteLayer, cmmdCreateProjectTaskDraftRouteLayer, cmmdGetProjectTaskDraftRouteLayer, cmmdUpdateProjectTaskDraftRouteLayer, cmmdPreviewProjectTaskDraftRouteLayer, cmmdCommitProjectTaskDraftRouteLayer, cmmdDiscardProjectTaskDraftRouteLayer, cmmdGetProjectLeadPlanRouteLayer, cmmdActivateProjectLeadAuthorityRouteLayer, cmmdGetProjectLeadReadinessRouteLayer, cmmdGetProjectLeadCapabilitiesRouteLayer, cmmdGetProjectLeadSummaryRouteLayer, cmmdGetProjectLeadDetailRouteLayer, cmmdGetProjectLeadBriefingRouteLayer, cmmdListProjectLeadEventsRouteLayer, cmmdExplainProjectLeadRouteLayer, cmmdPauseProjectLeadRouteLayer, cmmdResumeProjectLeadRouteLayer, cmmdReserveProjectLeadTaskRouteLayer, cmmdReleaseProjectLeadReservationRouteLayer, cmmdReconcileProjectLeadRouteLayer, cmmdResolveProjectLeadAttentionRouteLayer, cmmdClaimProjectLeadControllerRouteLayer, cmmdRenewProjectLeadControllerClaimRouteLayer, cmmdYieldProjectLeadControllerClaimRouteLayer, cmmdAcknowledgeProjectLeadControllerEventRouteLayer, cmmdRecordProjectLeadControllerDecisionRouteLayer, cmmdListForgeAutomationPresetsRouteLayer, cmmdListUserForgeAutomationRulesRouteLayer, cmmdCreateUserForgeAutomationRuleRouteLayer, cmmdUpdateUserForgeAutomationRuleRouteLayer, cmmdListUserForgeAutomationRunsRouteLayer, cmmdStartUserForgeAutomationRunRouteLayer, cmmdListForgeAutomationRulesRouteLayer, cmmdCreateForgeAutomationRuleRouteLayer, cmmdUpdateForgeAutomationRuleRouteLayer, cmmdListForgeAutomationRunsRouteLayer, cmmdStartForgeAutomationRunRouteLayer, cmmdGetForgeAutomationRunRouteLayer, cmmdRetryForgeAutomationRunRouteLayer, cmmdCancelForgeAutomationRunRouteLayer, cmmdApproveForgeAutomationEscalationRouteLayer, cmmdRejectForgeAutomationEscalationRouteLayer, cmmdListProjectAgentMembersRouteLayer, cmmdCreateProjectAgentMemberRouteLayer, cmmdGetProjectAgentMemberRouteLayer, cmmdRenameProjectAgentMemberRouteLayer, cmmdRetireProjectAgentMemberRouteLayer, cmmdUpdateProjectAgentMemberAvatarRouteLayer, cmmdListProjectAgentMemberInstancesRouteLayer, cmmdPreviewProjectAgentMemberConsolidationRouteLayer, cmmdApplyProjectAgentMemberConsolidationRouteLayer, cmmdPutProjectTaskAssignmentRouteLayer, cmmdListProjectBoardRouteLayer, cmmdGetProjectTaskWorkflowRouteLayer, cmmdUpdateProjectTaskWorkflowRouteLayer, cmmdCreateProjectBoardTaskRouteLayer, cmmdUpdateProjectBoardTaskRouteLayer, cmmdUpdateProjectBoardTaskStatusRouteLayer, cmmdListTaskExecutionOptionsRouteLayer, cmmdCreateTaskWorkSessionRouteLayer, cmmdListProjectWorkSessionsRouteLayer, cmmdGetWorkSessionRouteLayer, cmmdUpdateWorkSessionRouteLayer, cmmdAttachWorkSessionThreadRouteLayer, cmmdListTaskConversationsRouteLayer, cmmdLinkTaskConversationRouteLayer, cmmdGetTaskHistoryRouteLayer, cmmdGetTaskConversationRouteLayer, cmmdSpawnForgeThreadFromBoardTaskRouteLayer, cmmdListCenterBoardRouteLayer, cmmdCreateCenterBoardTaskRouteLayer, cmmdCreateFeedbackRouteLayer, cmmdUpdateCenterBoardTaskRouteLayer, cmmdMoveCenterBoardTaskRouteLayer, cmmdMoveProjectBoardTaskRouteLayer, cmmdArchiveProjectBoardTaskRouteLayer, cmmdUnarchiveProjectBoardTaskRouteLayer, cmmdArchiveCenterBoardTaskRouteLayer, cmmdUnarchiveCenterBoardTaskRouteLayer, cmmdBootstrapRouteLayer, cmmdGetAccountPreferencesRouteLayer, cmmdUpdateAccountPreferencesRouteLayer, cmmdGetOrgProviderPolicyRouteLayer, cmmdListChatsRouteLayer, cmmdGetChatRouteLayer, cmmdListDevicesRouteLayer, runtimeReplicationStatusRouteLayer, cmmdRegisterDeviceRouteLayer, cmmdHeartbeatRuntimeRouteLayer, cmmdGrantRuntimeAccessRouteLayer, cmmdRevokeRuntimeAccessRouteLayer, cmmdCreateRelayControlRouteLayer, cmmdCreateRelayActionGrantRouteLayer, cmmdReplaceRuntimeInventoryRouteLayer, cmmdListRuntimeInventoryRouteLayer, cmmdGetRuntimeDiagnosticsRouteLayer, cmmdProvisionAuthRuntimeRouteLayer, cmmdGetAuthRuntimeRouteLayer, cmmdDestroyAuthRuntimeRouteLayer, cmmdConnectAuthRuntimeRouteLayer, cmmdGetProviderAccountsRouteLayer, cmmdDeleteProviderAccountRouteLayer, cmmdSetProviderAccountDefaultRouteLayer, cmmdGetProviderUsageRouteLayer, cmmdRefreshProviderUsageRouteLayer, cmmdGetUserCodexCredentialRouteLayer, cmmdDeleteUserCodexCredentialRouteLayer, cmmdGetUserClaudeCredentialRouteLayer, cmmdDeleteUserClaudeCredentialRouteLayer, cmmdGetClaudeRuntimeReadinessRouteLayer, cmmdAppendRuntimeThreadEventsRouteLayer, cmmdGetRuntimeThreadReplicaRouteLayer, cmmdRenameDeviceRouteLayer, cmmdRevokeDeviceRouteLayer, cmmdInstallConnectorRouteLayer, cmmdListConnectorsRouteLayer, cmmdForgeCloudProjectsListRouteLayer, cmmdForgeCloudProjectsEventsRouteLayer, cmmdForgeCloudProjectRegisterRouteLayer, cmmdForgeCloudProjectUnregisterRouteLayer, cmmdForgeCloudProjectLifecyclePreflightRouteLayer, cmmdForgeCloudProjectRemovalRouteLayer, cmmdForgeCloudProjectRemovalPreviewRouteLayer, cmmdForgeCloudProjectRemovalReceiptRouteLayer, cmmdForgeRuntimesEnsureRouteLayer, cmmdForgeRuntimesConnectRouteLayer, ownerRuntimeCodexReadinessRouteLayer, cmmdForgeRuntimesStatusRouteLayer, cmmdForgeRuntimesStartRouteLayer, cmmdForgeRuntimesStopRouteLayer, cmmdForgeRuntimesRecycleRouteLayer, cmmdForgeRuntimesUpdateCommitRouteLayer, cmmdForgeRuntimesDestroyRouteLayer, cmmdRenameForgeRuntimeRouteLayer, cmmdGetTaskRouteLayer, commandUpdateTaskRouteLayer, mobileProviderCatalogRouteLayer, cmmdUsageSummaryRouteLayer, cmmdBillingRouteLayer, cmmdBillingSeriesRouteLayer, attachmentsRouteLayer, orchestrationDispatchRouteLayer, orchestrationCmmdWorkRunEventRouteLayer, orchestrationAutomationStartThreadRouteLayer, orchestrationAutomationRebindRouteLayer, orchestrationAutomationTerminalReconcileRouteLayer, mobileGitRunStackedActionRouteLayer, pullRequestDiffRouteLayer, orchestrationSnapshotRouteLayer, localAutomationListRouteLayer, localAutomationCreateRouteLayer, localAutomationUpdateRouteLayer, localAutomationDeleteRouteLayer, localAutomationRunRouteLayer, otlpTracesProxyRouteLayer, devTunnelProxyRouteLayer, devTunnelLocalPortProxyRouteLayer, projectFaviconRouteLayer, serverEnvironmentRouteLayer, browserWebRtcReadinessRouteLayer, staticAndDevRouteLayer, githubStatusRouteLayer, githubAuthorizeUrlRouteLayer, githubDisconnectRouteLayer, githubReposRouteLayer, githubCloneRouteLayer, githubCloneJobStartRouteLayer, githubCloneJobStatusRouteLayer, githubRefreshCredentialsRouteLayer, githubToolConfirmationApproveRouteLayer, projectLinkGetRouteLayer, projectLinkListRouteLayer, projectLinkSetRouteLayer, projectLinkDeleteRouteLayer, cmmdWorkspacesRouteLayer, cmmdCampaignsRouteLayer, cmmdProjectLinksRouteLayer, cmmdEnsureGitHubProjectContextRouteLayer, cmmdProjectRepositoryEnsureRouteLayer, cmmdProjectsGetRouteLayer, cmmdProjectsCreateRouteLayer, workspaceReadinessRouteLayer, runtimeLivenessRouteLayer, claudeNativeGenerationProofRouteLayer, claudeUsageRouteLayer, codexRuntimeProviderReadinessRouteLayer, runtimeDiagnosticsRouteLayer, cloudFoldersRouteLayer, cloudProjectCreateRouteLayer, gitUrlCloneRouteLayer, websocketRpcRouteLayer).pipe(provide$1(browserApiCorsLayer));
|
|
309759
310058
|
const runServer = launch$1(unwrap(gen(function* () {
|
|
309760
310059
|
const config = yield* ServerConfig;
|
|
309761
|
-
fixPath();
|
|
310060
|
+
fixPath({ preferProcessPath: config.forgeCmmdRuntimeMode === true });
|
|
309762
310061
|
const httpListeningLayer = effectDiscard(gen(function* () {
|
|
309763
310062
|
yield* HttpServer;
|
|
309764
310063
|
yield* (yield* ServerRuntimeStartup).markHttpListening;
|
|
@@ -310685,7 +310984,7 @@ const connectLoginCommand = make$32("login", {
|
|
|
310685
310984
|
})).json();
|
|
310686
310985
|
},
|
|
310687
310986
|
openBrowser: async (url) => {
|
|
310688
|
-
const open = (await import("./open-
|
|
310987
|
+
const open = (await import("./open-D8mGyWmt.mjs")).default;
|
|
310689
310988
|
await open(url);
|
|
310690
310989
|
return true;
|
|
310691
310990
|
},
|