@cmmd-center/forge 0.10.6 → 0.10.8
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 +1235 -764
- package/dist/bin.mjs +1235 -762
- package/dist/client/assets/{CanvasPanel-Dr4I7MnM.js → CanvasPanel-ECmvVI7T.js} +2 -2
- package/dist/client/assets/{CompositeItem-Cj6_oAlz.js → CompositeItem-8hzrVacr.js} +2 -2
- package/dist/client/assets/{DiffPanel-njtnlFro.js → DiffPanel-BmZCQ7ie.js} +3 -3
- package/dist/client/assets/{DiffPanel.logic-BiWRNb4k.js → DiffPanel.logic-EQgKCWRo.js} +2 -2
- package/dist/client/assets/DiffPanelShell-CpaWJE6J.js +2531 -0
- package/dist/client/assets/{DiffWorkerPoolProvider-DWrja16U.js → DiffWorkerPoolProvider-CU7zWBfP.js} +8 -8
- package/dist/client/assets/{PullRequestCodePanel-CAaq9dk8.js → PullRequestCodePanel-FhNDL-Wv.js} +3 -3
- package/dist/client/assets/{Virtualizer-BXpiamky.js → Virtualizer-BLq-Dt-i.js} +2 -2
- package/dist/client/assets/{canvasStateStore-DncdOQ4J.js → canvasStateStore-3EN8RaUf.js} +2 -2
- package/dist/client/assets/{cmmdAuthRedirect-DWiMDVzN.js → cmmdAuthRedirect-DwPtzhq9.js} +2 -2
- package/dist/client/assets/index-BYEPqKu0.js +151 -0
- package/dist/client/assets/index-D22UpSjv.css +1 -0
- package/dist/client/assets/{src-CtyKlVph.js → src-DZBONdiY.js} +2 -2
- package/dist/client/assets/{toggle-pTm2fPLg.js → toggle-mQ7UG7Dd.js} +2 -2
- package/dist/client/assets/{useTriggerFocusGuards-B4Ejoaox.js → useTriggerFocusGuards-BUEnX8xa.js} +2 -2
- package/dist/client/index.html +11 -11
- package/dist/forge-build.json +1 -1
- package/package.json +1 -1
- package/dist/client/assets/DiffPanelShell-AKUK0L-g.js +0 -2531
- package/dist/client/assets/index-DBIIL0ML.js +0 -151
- package/dist/client/assets/index-T36rURmx.css +0 -1
package/dist/bin.cjs
CHANGED
|
@@ -16544,7 +16544,7 @@ function makeNetServiceShape(createServer = node_net.createServer) {
|
|
|
16544
16544
|
}
|
|
16545
16545
|
//#endregion
|
|
16546
16546
|
//#region ../../packages/shared/src/releaseInfo.generated.ts
|
|
16547
|
-
const FORGE_RELEASE_VERSION = "0.10.
|
|
16547
|
+
const FORGE_RELEASE_VERSION = "0.10.5";
|
|
16548
16548
|
//#endregion
|
|
16549
16549
|
//#region ../../packages/shared/src/hostProcess.ts
|
|
16550
16550
|
/**
|
|
@@ -24457,6 +24457,7 @@ const UsageBucket = require_Schema$1.Struct({
|
|
|
24457
24457
|
costSource: UsageCostSource,
|
|
24458
24458
|
records: NonNegativeInt,
|
|
24459
24459
|
unpricedRecords: NonNegativeInt,
|
|
24460
|
+
unreportedRecords: require_Schema$1.optional(NonNegativeInt),
|
|
24460
24461
|
sessions: NonNegativeInt,
|
|
24461
24462
|
runtimeId: require_Schema$1.optional(TrimmedNonEmptyString),
|
|
24462
24463
|
origin: require_Schema$1.optional(UsageBucketOrigin),
|
|
@@ -65378,7 +65379,7 @@ function normalizeNumberish(value) {
|
|
|
65378
65379
|
}
|
|
65379
65380
|
//#endregion
|
|
65380
65381
|
//#region package.json
|
|
65381
|
-
var version$1 = "0.10.
|
|
65382
|
+
var version$1 = "0.10.8";
|
|
65382
65383
|
//#endregion
|
|
65383
65384
|
//#region src/sentry.ts
|
|
65384
65385
|
const SERVER_APP_NAME = "forge-server";
|
|
@@ -70304,6 +70305,14 @@ function invalidateCachedCmmdWorkIntakeForIdentity(identityKey) {
|
|
|
70304
70305
|
*
|
|
70305
70306
|
* Bespoke routes (MCP/PAT transport, hybrid fallback, multipart) stay in
|
|
70306
70307
|
* http.ts and are NOT migrated here.
|
|
70308
|
+
*
|
|
70309
|
+
* A second, narrower entry point — `registerProxyHandler` / `ProxyHandlerRoute`
|
|
70310
|
+
* — covers routes whose middle (request parsing, the actual gateway call,
|
|
70311
|
+
* success shaping) cannot be expressed by the five `ProxyRoute` fields above,
|
|
70312
|
+
* while still sharing the same prologue: session auth, the CMMD-connection
|
|
70313
|
+
* gate, and the same `buildProxyErrorResponse` error mapping plus
|
|
70314
|
+
* `clearUnrecoverableCmmdAuthForSession` on an auth failure. See the type doc
|
|
70315
|
+
* below for the exact contract.
|
|
70307
70316
|
*/
|
|
70308
70317
|
/** Substitutes ":paramName" tokens in a path template from a params record. */
|
|
70309
70318
|
function substitutePath(template, params) {
|
|
@@ -70353,6 +70362,29 @@ function buildProxyErrorResponse(error) {
|
|
|
70353
70362
|
}
|
|
70354
70363
|
return require_HttpServer.jsonUnsafe({ error: "CMMD REST request failed." }, { status: 502 });
|
|
70355
70364
|
}
|
|
70365
|
+
/**
|
|
70366
|
+
* Clears every unrecoverable CMMD credential tied to this session, logging a
|
|
70367
|
+
* warning rather than failing the request if the clear itself errors — a
|
|
70368
|
+
* session that already has no usable credential must still get its 401,
|
|
70369
|
+
* not a 500 from a failed best-effort cleanup.
|
|
70370
|
+
*/
|
|
70371
|
+
function clearCmmdAuthAfterFailure(sessionId) {
|
|
70372
|
+
return clearUnrecoverableCmmdAuthForSession(sessionId).pipe(require_Schema$1.catch_((error) => require_Schema$1.logWarning("Failed to clear unrecoverable CMMD auth after CMMD auth failure.", {
|
|
70373
|
+
cause: error,
|
|
70374
|
+
sessionId
|
|
70375
|
+
})));
|
|
70376
|
+
}
|
|
70377
|
+
/**
|
|
70378
|
+
* The single "no usable CMMD credential" response: clears whatever
|
|
70379
|
+
* unrecoverable auth state this session is holding, then returns the
|
|
70380
|
+
* canonical `CMMD_AUTH_REQUIRED` body. Every prologue path that decides the
|
|
70381
|
+
* session has no way to reach CMMD — a missing PAT, a JWT that fails to
|
|
70382
|
+
* resolve, a bespoke gate elsewhere in http.ts — emits this same response so
|
|
70383
|
+
* the Shell only ever has one `CMMD_AUTH_REQUIRED` body to branch on.
|
|
70384
|
+
*/
|
|
70385
|
+
function respondCmmdConnectionRequired(sessionId) {
|
|
70386
|
+
return clearCmmdAuthAfterFailure(sessionId).pipe(require_Schema$1.as(buildProxyErrorResponse(new CmmdProxyAuthenticationRequiredError("CMMD connection required. Reconnect CMMD to continue."))));
|
|
70387
|
+
}
|
|
70356
70388
|
async function dispatchToProxy(method, jwt, cmmdPath, rawBody, orgId, searchParams) {
|
|
70357
70389
|
return cmmdGateway.request({
|
|
70358
70390
|
method,
|
|
@@ -70383,12 +70415,27 @@ function buildProxySearchParams(input) {
|
|
|
70383
70415
|
return Object.keys(result).length > 0 ? result : void 0;
|
|
70384
70416
|
}
|
|
70385
70417
|
const _registeredRoutes = [];
|
|
70386
|
-
|
|
70387
|
-
|
|
70388
|
-
*
|
|
70389
|
-
|
|
70390
|
-
|
|
70391
|
-
|
|
70418
|
+
const _registeredLayers = [];
|
|
70419
|
+
/**
|
|
70420
|
+
* Layers produced by every registerProxyRoute call so far, in registration
|
|
70421
|
+
* order. Callers that want only the routes registered by their own module
|
|
70422
|
+
* should snapshot `.length` before their own registerProxyRoute calls run and
|
|
70423
|
+
* slice from that index — see command/http.ts's `cmmdProxyRouteLayers`.
|
|
70424
|
+
*
|
|
70425
|
+
* Typed via `ReturnType<typeof buildProxyRouteLayer>` (not `HttpRouter.add`
|
|
70426
|
+
* directly, and not `registerProxyRoute` itself — that would be circular
|
|
70427
|
+
* since registerProxyRoute pushes onto this same array): `buildProxyRouteLayer`
|
|
70428
|
+
* takes a concrete, non-generic `ProxyRoute` argument and never references
|
|
70429
|
+
* this array, so its return type is fully resolved independently. Referencing
|
|
70430
|
+
* the generic `HttpRouter.add` on its own instead collapses its unresolved E/R
|
|
70431
|
+
* type parameters to `unknown`, which then leaks into makeRoutesLayer's
|
|
70432
|
+
* requirements channel everywhere this array is spread.
|
|
70433
|
+
*/
|
|
70434
|
+
function registeredProxyRouteLayers() {
|
|
70435
|
+
return Object.freeze([..._registeredLayers]);
|
|
70436
|
+
}
|
|
70437
|
+
/** Builds the Effect HttpRouter layer for one route, with no registry side effects. */
|
|
70438
|
+
function buildProxyRouteLayer(route) {
|
|
70392
70439
|
const handler = require_Schema$1.gen(function* () {
|
|
70393
70440
|
const req = yield* require_HttpServer.HttpServerRequest;
|
|
70394
70441
|
const session = yield* (yield* ServerAuth).authenticateHttpRequest(req);
|
|
@@ -70411,23 +70458,14 @@ function registerProxyRoute(route) {
|
|
|
70411
70458
|
forceRefresh
|
|
70412
70459
|
});
|
|
70413
70460
|
const jwt = yield* resolveJwt();
|
|
70414
|
-
if (!jwt)
|
|
70415
|
-
yield* clearUnrecoverableCmmdAuthForSession(session.sessionId).pipe(require_Schema$1.catch_((error) => require_Schema$1.logWarning("Failed to clear unrecoverable CMMD auth after missing JWT.", {
|
|
70416
|
-
cause: error,
|
|
70417
|
-
sessionId: session.sessionId
|
|
70418
|
-
})));
|
|
70419
|
-
return buildProxyErrorResponse(new CmmdProxyAuthenticationRequiredError("CMMD connection required. Reconnect CMMD to continue."));
|
|
70420
|
-
}
|
|
70461
|
+
if (!jwt) return yield* respondCmmdConnectionRequired(session.sessionId);
|
|
70421
70462
|
let outcome = yield* require_Schema$1.promise(() => runProxy(() => dispatchToProxy(route.method, jwt, cmmdPath, rawBody, orgId, searchParams)));
|
|
70422
70463
|
if (!outcome.ok && outcome.error instanceof CmmdProxyAuthError) {
|
|
70423
70464
|
const refreshedJwt = yield* resolveJwt(true);
|
|
70424
70465
|
if (refreshedJwt && refreshedJwt !== jwt) outcome = yield* require_Schema$1.promise(() => runProxy(() => dispatchToProxy(route.method, refreshedJwt, cmmdPath, rawBody, orgId, searchParams)));
|
|
70425
70466
|
}
|
|
70426
70467
|
if (!outcome.ok) {
|
|
70427
|
-
if (outcome.error instanceof CmmdProxyAuthError || outcome.error instanceof CmmdProxyAuthenticationRequiredError) yield*
|
|
70428
|
-
cause: error,
|
|
70429
|
-
sessionId: session.sessionId
|
|
70430
|
-
})));
|
|
70468
|
+
if (outcome.error instanceof CmmdProxyAuthError || outcome.error instanceof CmmdProxyAuthenticationRequiredError) yield* clearCmmdAuthAfterFailure(session.sessionId);
|
|
70431
70469
|
return buildProxyErrorResponse(outcome.error);
|
|
70432
70470
|
}
|
|
70433
70471
|
const payload = route.responseShape === "passthrough" ? outcome.value : unwrapEnvelope$1(outcome.value);
|
|
@@ -70438,6 +70476,59 @@ function registerProxyRoute(route) {
|
|
|
70438
70476
|
}).pipe(require_Schema$1.catchTag("AuthError", (error) => respondToAuthError(error)));
|
|
70439
70477
|
return add$1(route.method, route.forgePath, handler);
|
|
70440
70478
|
}
|
|
70479
|
+
/**
|
|
70480
|
+
* Generates an Effect HttpRouter layer for the given route and records it in
|
|
70481
|
+
* the registry (for auditing / tests, and so command/http.ts's
|
|
70482
|
+
* `cmmdProxyRouteLayers` can pick it up). The returned layer registers one
|
|
70483
|
+
* handler at forgePath.
|
|
70484
|
+
*/
|
|
70485
|
+
function registerProxyRoute(route) {
|
|
70486
|
+
_registeredRoutes.push(route);
|
|
70487
|
+
const layer = buildProxyRouteLayer(route);
|
|
70488
|
+
_registeredLayers.push(layer);
|
|
70489
|
+
return layer;
|
|
70490
|
+
}
|
|
70491
|
+
/**
|
|
70492
|
+
* Builds the bare handler Effect for one handler route (no `HttpRouter.add`
|
|
70493
|
+
* wrapping, no registry side effects) — exposed on its own so tests can
|
|
70494
|
+
* exercise it the same way they exercise every other bespoke handler in
|
|
70495
|
+
* http.ts: providing `HttpServerRequest` / `ServerAuth` directly and running
|
|
70496
|
+
* the Effect, without standing up a router.
|
|
70497
|
+
*/
|
|
70498
|
+
function buildProxyHandlerEffect(route) {
|
|
70499
|
+
return require_Schema$1.gen(function* () {
|
|
70500
|
+
const req = yield* require_HttpServer.HttpServerRequest;
|
|
70501
|
+
const session = yield* (yield* ServerAuth).authenticateHttpRequest(req);
|
|
70502
|
+
if (!readCommandAccessTokenForSession(session.sessionId)) return yield* respondCmmdConnectionRequired(session.sessionId);
|
|
70503
|
+
const parsed = yield* route.parse(req);
|
|
70504
|
+
if (!parsed.ok) return require_HttpServer.jsonUnsafe(parsed.body, { status: parsed.status });
|
|
70505
|
+
const result$4 = yield* route.run(parsed.value, { session }).pipe(require_Schema$1.result);
|
|
70506
|
+
if (require_Schema$1.isFailure$1(result$4)) {
|
|
70507
|
+
const error = result$4.failure;
|
|
70508
|
+
if (error instanceof CmmdProxyAuthError || error instanceof CmmdProxyAuthenticationRequiredError) yield* clearCmmdAuthAfterFailure(session.sessionId);
|
|
70509
|
+
return buildProxyErrorResponse(error);
|
|
70510
|
+
}
|
|
70511
|
+
return require_HttpServer.jsonUnsafe(result$4.success.body, { status: result$4.success.status });
|
|
70512
|
+
}).pipe(require_Schema$1.catchTag("AuthError", (error) => respondToAuthError(error)));
|
|
70513
|
+
}
|
|
70514
|
+
const _registeredHandlerRoutes = [];
|
|
70515
|
+
/**
|
|
70516
|
+
* Builds the handler Effect for one route, mounts it via `HttpRouter.add` and
|
|
70517
|
+
* records that layer in the same registry `registerProxyRoute` uses (so
|
|
70518
|
+
* command/http.ts's `cmmdProxyRouteLayers` picks it up without a separate
|
|
70519
|
+
* mount list) — then returns the bare handler Effect rather than the layer,
|
|
70520
|
+
* so the caller can keep a single `__xHandlerForTests`-style export that
|
|
70521
|
+
* doubles as both the thing under test and the thing that gets mounted.
|
|
70522
|
+
*/
|
|
70523
|
+
function registerProxyHandler(route) {
|
|
70524
|
+
_registeredHandlerRoutes.push({
|
|
70525
|
+
method: route.method,
|
|
70526
|
+
forgePath: route.forgePath
|
|
70527
|
+
});
|
|
70528
|
+
const handler = buildProxyHandlerEffect(route);
|
|
70529
|
+
_registeredLayers.push(add$1(route.method, route.forgePath, handler));
|
|
70530
|
+
return handler;
|
|
70531
|
+
}
|
|
70441
70532
|
//#endregion
|
|
70442
70533
|
//#region src/connect/credentialRefresh.ts
|
|
70443
70534
|
async function refreshConnectCredential(deps) {
|
|
@@ -92611,6 +92702,172 @@ function classifyRuntimeReplicationHttpFailure(failure) {
|
|
|
92611
92702
|
};
|
|
92612
92703
|
}
|
|
92613
92704
|
//#endregion
|
|
92705
|
+
//#region src/runtimeReplication/runtimeLane.ts
|
|
92706
|
+
/**
|
|
92707
|
+
* Read a grant-lane response the way the gateway reads an owner-lane one: a
|
|
92708
|
+
* non-2xx becomes a `CmmdProxyRequestError` carrying the status and CMMD's
|
|
92709
|
+
* error code, so a caller can classify either lane's failure with one rule.
|
|
92710
|
+
*/
|
|
92711
|
+
async function parseRuntimeLaneResponse(response) {
|
|
92712
|
+
const text = await response.text();
|
|
92713
|
+
let body = null;
|
|
92714
|
+
if (text) try {
|
|
92715
|
+
body = JSON.parse(text);
|
|
92716
|
+
} catch {
|
|
92717
|
+
body = null;
|
|
92718
|
+
}
|
|
92719
|
+
if (!response.ok) {
|
|
92720
|
+
const code = readRuntimeReplicationErrorCode(body);
|
|
92721
|
+
throw new CmmdProxyRequestError(`CMMD runtime replication failed (${response.status})`, response.status, null, code ? { code } : null);
|
|
92722
|
+
}
|
|
92723
|
+
if (body === null) throw new Error("CMMD runtime replication returned an empty or invalid JSON response.");
|
|
92724
|
+
return body;
|
|
92725
|
+
}
|
|
92726
|
+
/**
|
|
92727
|
+
* One request on whichever lane the runtime holds. The caller has already
|
|
92728
|
+
* built the path for `lane.kind`; this only decides the transport and the
|
|
92729
|
+
* credential header, and normalises failures to the gateway's error classes.
|
|
92730
|
+
*/
|
|
92731
|
+
async function requestOnRuntimeLane(lane, request, transport = {}) {
|
|
92732
|
+
if (lane.kind === "owner-session") return (transport.gateway ?? cmmdGateway).request({
|
|
92733
|
+
method: request.method,
|
|
92734
|
+
jwt: lane.jwt,
|
|
92735
|
+
path: request.path,
|
|
92736
|
+
...request.body === void 0 ? {} : { body: request.body }
|
|
92737
|
+
});
|
|
92738
|
+
return parseRuntimeLaneResponse(await (transport.fetchImpl ?? fetch)(new URL(request.path, `${lane.controlPlaneUrl}/`), {
|
|
92739
|
+
method: request.method,
|
|
92740
|
+
headers: {
|
|
92741
|
+
authorization: `Bearer ${lane.grantToken}`,
|
|
92742
|
+
accept: "application/json",
|
|
92743
|
+
...request.body === void 0 ? {} : { "content-type": "application/json" }
|
|
92744
|
+
},
|
|
92745
|
+
...request.body === void 0 ? {} : { body: JSON.stringify(request.body) },
|
|
92746
|
+
...request.signal === void 0 ? {} : { signal: request.signal }
|
|
92747
|
+
}));
|
|
92748
|
+
}
|
|
92749
|
+
function mapRuntimeReplicationClientError(error, operation) {
|
|
92750
|
+
if (error instanceof CmmdProxyAuthError) return new RuntimeReplicationClientError({
|
|
92751
|
+
kind: "auth",
|
|
92752
|
+
code: "CMMD_AUTH_REQUIRED",
|
|
92753
|
+
detail: error.message
|
|
92754
|
+
});
|
|
92755
|
+
if (error instanceof CmmdProxyAuthenticationRequiredError) return new RuntimeReplicationClientError({
|
|
92756
|
+
kind: "auth",
|
|
92757
|
+
code: "CMMD_AUTH_REQUIRED",
|
|
92758
|
+
detail: error.message
|
|
92759
|
+
});
|
|
92760
|
+
if (error instanceof CmmdProxyPermissionError) return new RuntimeReplicationClientError({
|
|
92761
|
+
kind: "permanent",
|
|
92762
|
+
code: "CMMD_PERMISSION_DENIED",
|
|
92763
|
+
detail: error.message
|
|
92764
|
+
});
|
|
92765
|
+
if (error instanceof CmmdProxyRequestError) return new RuntimeReplicationClientError(classifyRuntimeReplicationHttpFailure({
|
|
92766
|
+
status: error.status,
|
|
92767
|
+
body: error.body,
|
|
92768
|
+
detail: error.detail ?? error.message,
|
|
92769
|
+
...operation ? { operation } : {}
|
|
92770
|
+
}));
|
|
92771
|
+
return new RuntimeReplicationClientError({
|
|
92772
|
+
kind: "retryable",
|
|
92773
|
+
code: "CMMD_UNAVAILABLE",
|
|
92774
|
+
detail: error instanceof Error ? error.message : String(error)
|
|
92775
|
+
});
|
|
92776
|
+
}
|
|
92777
|
+
//#endregion
|
|
92778
|
+
//#region src/runtimeReplication/lifecycleIntentClient.ts
|
|
92779
|
+
/**
|
|
92780
|
+
* The runtime half of a lifecycle intent: a settle or un-settle a person asked
|
|
92781
|
+
* for while this runtime was offline, held by CMMD until the runtime lists it,
|
|
92782
|
+
* applies it through its own orchestration, and acknowledges it.
|
|
92783
|
+
*
|
|
92784
|
+
* Both lanes carry the same envelope (pinned equal in the contracts package),
|
|
92785
|
+
* so one client serves the desktop's owner-session lane and the cloud
|
|
92786
|
+
* runtime's grant lane; only the path family differs.
|
|
92787
|
+
*/
|
|
92788
|
+
const LIFECYCLE_INTENT_TIMEOUT = "10 seconds";
|
|
92789
|
+
const LifecycleIntentListEnvelope = require_Schema$1.Struct({ data: require_Schema$1.Struct({ intents: require_Schema$1.ArraySchema(require_Schema$1.Struct({
|
|
92790
|
+
runtimeId: require_Schema$1.String,
|
|
92791
|
+
threadId: require_Schema$1.String,
|
|
92792
|
+
action: require_Schema$1.Literals(["settle", "unsettle"]),
|
|
92793
|
+
requestedAt: require_Schema$1.String
|
|
92794
|
+
})) }) });
|
|
92795
|
+
const LifecycleIntentAcknowledgementEnvelope = require_Schema$1.Struct({ data: require_Schema$1.Struct({ acknowledged: require_Schema$1.Number }) });
|
|
92796
|
+
const decodeListEnvelope = require_Schema$1.decodeUnknownSync(LifecycleIntentListEnvelope);
|
|
92797
|
+
const decodeAcknowledgementEnvelope = require_Schema$1.decodeUnknownSync(LifecycleIntentAcknowledgementEnvelope);
|
|
92798
|
+
function decodeLifecycleIntentListResponse(response) {
|
|
92799
|
+
return decodeListEnvelope(response).data;
|
|
92800
|
+
}
|
|
92801
|
+
function decodeLifecycleIntentAcknowledgementResponse(response) {
|
|
92802
|
+
return decodeAcknowledgementEnvelope(response).data;
|
|
92803
|
+
}
|
|
92804
|
+
/**
|
|
92805
|
+
* Ids arrive from runtime rows, not constrained to path-safe characters, so
|
|
92806
|
+
* they are encoded the way every other runtime-lane path builder encodes them.
|
|
92807
|
+
*/
|
|
92808
|
+
function lifecycleIntentPath(lane, operation) {
|
|
92809
|
+
const base = `/api/forge/context/${lane.kind === "grant" ? "runtime-replication" : "devices"}/runtimes/${encodeURIComponent(lane.runtimeId)}/thread-lifecycle-intents`;
|
|
92810
|
+
return operation === "ack" ? `${base}/ack` : base;
|
|
92811
|
+
}
|
|
92812
|
+
function timedOut(operation) {
|
|
92813
|
+
return new RuntimeReplicationClientError({
|
|
92814
|
+
kind: "retryable",
|
|
92815
|
+
code: "CMMD_TIMEOUT",
|
|
92816
|
+
detail: `CMMD lifecycle intent ${operation} timed out.`
|
|
92817
|
+
});
|
|
92818
|
+
}
|
|
92819
|
+
function decodeOrFail(response, decode, label) {
|
|
92820
|
+
return require_Schema$1.try_({
|
|
92821
|
+
try: () => decode(response),
|
|
92822
|
+
catch: (cause) => new RuntimeReplicationClientError({
|
|
92823
|
+
kind: "permanent",
|
|
92824
|
+
code: "CMMD_PROTOCOL_INVALID_RESPONSE",
|
|
92825
|
+
detail: `CMMD returned an invalid lifecycle intent ${label}: ${cause instanceof Error ? cause.message : String(cause)}`
|
|
92826
|
+
})
|
|
92827
|
+
});
|
|
92828
|
+
}
|
|
92829
|
+
/**
|
|
92830
|
+
* Every pending intent for this runtime, or an empty list.
|
|
92831
|
+
*
|
|
92832
|
+
* 404 is an ordinary answer, not a failure: a CMMD that predates the route
|
|
92833
|
+
* has nothing pending for anyone, and a runtime it has not registered yet has
|
|
92834
|
+
* nothing pending either. Every other non-2xx is a typed error -- a signed-out
|
|
92835
|
+
* owner (auth) is the caller's to skip, an outage is the next tick's to retry.
|
|
92836
|
+
*/
|
|
92837
|
+
function listPendingLifecycleIntents(lane, transport) {
|
|
92838
|
+
return require_Schema$1.tryPromise({
|
|
92839
|
+
try: (signal) => requestOnRuntimeLane(lane, {
|
|
92840
|
+
method: "GET",
|
|
92841
|
+
path: lifecycleIntentPath(lane, "list"),
|
|
92842
|
+
signal
|
|
92843
|
+
}, transport),
|
|
92844
|
+
catch: (cause) => cause instanceof CmmdProxyRequestError && cause.status === 404 ? null : mapRuntimeReplicationClientError(cause)
|
|
92845
|
+
}).pipe(require_Schema$1.catch_((cause) => cause === null ? require_Schema$1.succeed(null) : require_Schema$1.fail(cause)), require_Schema$1.flatMap((response) => response === null ? require_Schema$1.succeed([]) : decodeOrFail(response, decodeLifecycleIntentListResponse, "list").pipe(require_Schema$1.map((list) => list.intents))), require_Schema$1.timeoutOrElse({
|
|
92846
|
+
duration: LIFECYCLE_INTENT_TIMEOUT,
|
|
92847
|
+
orElse: () => require_Schema$1.fail(timedOut("list"))
|
|
92848
|
+
}));
|
|
92849
|
+
}
|
|
92850
|
+
/**
|
|
92851
|
+
* Tell CMMD which intents were applied (or deliberately skipped), by thread
|
|
92852
|
+
* and requested time. CMMD drops only an intent whose requested time matches,
|
|
92853
|
+
* so a newer request recorded while this one was being applied survives.
|
|
92854
|
+
*/
|
|
92855
|
+
function acknowledgeLifecycleIntents(lane, intents, transport) {
|
|
92856
|
+
const body = { intents };
|
|
92857
|
+
return require_Schema$1.tryPromise({
|
|
92858
|
+
try: (signal) => requestOnRuntimeLane(lane, {
|
|
92859
|
+
method: "POST",
|
|
92860
|
+
path: lifecycleIntentPath(lane, "ack"),
|
|
92861
|
+
body,
|
|
92862
|
+
signal
|
|
92863
|
+
}, transport),
|
|
92864
|
+
catch: mapRuntimeReplicationClientError
|
|
92865
|
+
}).pipe(require_Schema$1.flatMap((response) => decodeOrFail(response, decodeLifecycleIntentAcknowledgementResponse, "acknowledgement")), require_Schema$1.timeoutOrElse({
|
|
92866
|
+
duration: LIFECYCLE_INTENT_TIMEOUT,
|
|
92867
|
+
orElse: () => require_Schema$1.fail(timedOut("ack"))
|
|
92868
|
+
}));
|
|
92869
|
+
}
|
|
92870
|
+
//#endregion
|
|
92614
92871
|
//#region src/runtimeReplication/runtimeReplicationGrantPolicy.ts
|
|
92615
92872
|
/**
|
|
92616
92873
|
* Chooses which CMMD grant a replication send should use: the in-memory
|
|
@@ -92716,26 +92973,11 @@ function runtimeReplicationDevicePath(input) {
|
|
|
92716
92973
|
const threadId = input.streamKey.slice(7);
|
|
92717
92974
|
return `${devicePath}/threads/${encodeURIComponent(threadId)}/events`;
|
|
92718
92975
|
}
|
|
92719
|
-
async function parseRuntimeReplicationResponse(response) {
|
|
92720
|
-
const text = await response.text();
|
|
92721
|
-
let body = null;
|
|
92722
|
-
if (text) try {
|
|
92723
|
-
body = JSON.parse(text);
|
|
92724
|
-
} catch {
|
|
92725
|
-
body = null;
|
|
92726
|
-
}
|
|
92727
|
-
if (!response.ok) {
|
|
92728
|
-
const code = readRuntimeReplicationErrorCode(body);
|
|
92729
|
-
throw new CmmdProxyRequestError(`CMMD runtime replication failed (${response.status})`, response.status, null, code ? { code } : null);
|
|
92730
|
-
}
|
|
92731
|
-
if (body === null) throw new Error("CMMD runtime replication returned an empty or invalid JSON response.");
|
|
92732
|
-
return body;
|
|
92733
|
-
}
|
|
92734
92976
|
async function requestRuntimeReplicationWithGrant(input, fetchImpl = fetch) {
|
|
92735
92977
|
const abortController = new AbortController();
|
|
92736
92978
|
const timeout = setTimeout(() => abortController.abort(), RUNTIME_REPLICATION_TIMEOUT_MS);
|
|
92737
92979
|
try {
|
|
92738
|
-
return await
|
|
92980
|
+
return await parseRuntimeLaneResponse(await fetchImpl(new URL(runtimeReplicationGrantPath(input), `${input.controlPlaneUrl}/`), {
|
|
92739
92981
|
method: input.operation === "inventory" ? "PUT" : "POST",
|
|
92740
92982
|
headers: {
|
|
92741
92983
|
authorization: `Bearer ${input.grantToken}`,
|
|
@@ -92748,34 +92990,6 @@ async function requestRuntimeReplicationWithGrant(input, fetchImpl = fetch) {
|
|
|
92748
92990
|
clearTimeout(timeout);
|
|
92749
92991
|
}
|
|
92750
92992
|
}
|
|
92751
|
-
function mapRuntimeReplicationClientError(error, operation) {
|
|
92752
|
-
if (error instanceof CmmdProxyAuthError) return new RuntimeReplicationClientError({
|
|
92753
|
-
kind: "auth",
|
|
92754
|
-
code: "CMMD_AUTH_REQUIRED",
|
|
92755
|
-
detail: error.message
|
|
92756
|
-
});
|
|
92757
|
-
if (error instanceof CmmdProxyAuthenticationRequiredError) return new RuntimeReplicationClientError({
|
|
92758
|
-
kind: "auth",
|
|
92759
|
-
code: "CMMD_AUTH_REQUIRED",
|
|
92760
|
-
detail: error.message
|
|
92761
|
-
});
|
|
92762
|
-
if (error instanceof CmmdProxyPermissionError) return new RuntimeReplicationClientError({
|
|
92763
|
-
kind: "permanent",
|
|
92764
|
-
code: "CMMD_PERMISSION_DENIED",
|
|
92765
|
-
detail: error.message
|
|
92766
|
-
});
|
|
92767
|
-
if (error instanceof CmmdProxyRequestError) return new RuntimeReplicationClientError(classifyRuntimeReplicationHttpFailure({
|
|
92768
|
-
status: error.status,
|
|
92769
|
-
body: error.body,
|
|
92770
|
-
detail: error.detail ?? error.message,
|
|
92771
|
-
...operation ? { operation } : {}
|
|
92772
|
-
}));
|
|
92773
|
-
return new RuntimeReplicationClientError({
|
|
92774
|
-
kind: "retryable",
|
|
92775
|
-
code: "CMMD_UNAVAILABLE",
|
|
92776
|
-
detail: error instanceof Error ? error.message : String(error)
|
|
92777
|
-
});
|
|
92778
|
-
}
|
|
92779
92993
|
function decodeRuntimeThreadAcknowledgementResponse(response) {
|
|
92780
92994
|
return decodeThreadAcknowledgement(response).data.acknowledgement;
|
|
92781
92995
|
}
|
|
@@ -92851,9 +93065,12 @@ function replicateWithOwnerSession(sql, input) {
|
|
|
92851
93065
|
const jwt = owner.jwt;
|
|
92852
93066
|
const path = runtimeReplicationDevicePath(input);
|
|
92853
93067
|
const response = yield* require_Schema$1.tryPromise({
|
|
92854
|
-
try: () =>
|
|
93068
|
+
try: () => requestOnRuntimeLane({
|
|
93069
|
+
kind: "owner-session",
|
|
93070
|
+
runtimeId: input.runtimeId,
|
|
93071
|
+
jwt
|
|
93072
|
+
}, {
|
|
92855
93073
|
method: input.operation === "inventory" ? "PUT" : "POST",
|
|
92856
|
-
jwt,
|
|
92857
93074
|
path,
|
|
92858
93075
|
body: input.payload
|
|
92859
93076
|
}),
|
|
@@ -92864,11 +93081,63 @@ function replicateWithOwnerSession(sql, input) {
|
|
|
92864
93081
|
return yield* decodeAcknowledgementOrFail(response, decodeRuntimeThreadAcknowledgementResponse, "transcript");
|
|
92865
93082
|
});
|
|
92866
93083
|
}
|
|
93084
|
+
/**
|
|
93085
|
+
* The lane this runtime holds right now, resolved per call because both
|
|
93086
|
+
* credentials rotate: the cloud grant is re-read from the control authority,
|
|
93087
|
+
* and the owner session is whichever sign-in is newest on this desktop.
|
|
93088
|
+
*/
|
|
93089
|
+
function resolveRuntimeLane(config, sql, input) {
|
|
93090
|
+
return require_Schema$1.gen(function* () {
|
|
93091
|
+
if (config.forgeCmmdRuntimeMode === true) {
|
|
93092
|
+
const cloudGrant = resolveCloudRuntimeReplicationGrant(config);
|
|
93093
|
+
if (!cloudGrant) return yield* new RuntimeReplicationClientError({
|
|
93094
|
+
kind: "auth",
|
|
93095
|
+
code: "CMMD_RUNTIME_GRANT_REQUIRED",
|
|
93096
|
+
detail: "Cloud runtime replication requires a canonical runtime ID, CMMD URL, and scoped runtime grant."
|
|
93097
|
+
});
|
|
93098
|
+
if (input.runtimeId !== cloudGrant.runtimeId) return yield* new RuntimeReplicationClientError({
|
|
93099
|
+
kind: "permanent",
|
|
93100
|
+
code: "CMMD_RUNTIME_ID_MISMATCH",
|
|
93101
|
+
detail: "The requested runtime does not match this cloud runtime identity."
|
|
93102
|
+
});
|
|
93103
|
+
return {
|
|
93104
|
+
kind: "grant",
|
|
93105
|
+
controlPlaneUrl: cloudGrant.controlPlaneUrl,
|
|
93106
|
+
runtimeId: cloudGrant.runtimeId,
|
|
93107
|
+
grantToken: cloudGrant.grantToken
|
|
93108
|
+
};
|
|
93109
|
+
}
|
|
93110
|
+
const owner = yield* resolveCmmdOwnerSessionCredential(sql, { logPrefix: input.logPrefix });
|
|
93111
|
+
if (owner.kind === "no-session") return yield* new RuntimeReplicationClientError({
|
|
93112
|
+
kind: "auth",
|
|
93113
|
+
code: "CMMD_AUTH_REQUIRED",
|
|
93114
|
+
detail: "CMMD sign-in is required for runtime replication."
|
|
93115
|
+
});
|
|
93116
|
+
if (owner.kind === "no-credential") return yield* new RuntimeReplicationClientError({
|
|
93117
|
+
kind: "auth",
|
|
93118
|
+
code: "CMMD_AUTH_REQUIRED",
|
|
93119
|
+
detail: "CMMD REST credentials are unavailable for runtime replication."
|
|
93120
|
+
});
|
|
93121
|
+
return {
|
|
93122
|
+
kind: "owner-session",
|
|
93123
|
+
runtimeId: input.runtimeId,
|
|
93124
|
+
jwt: owner.jwt
|
|
93125
|
+
};
|
|
93126
|
+
});
|
|
93127
|
+
}
|
|
92867
93128
|
const RuntimeReplicationClientLive = require_Schema$1.effect(RuntimeReplicationClient, require_Schema$1.gen(function* () {
|
|
92868
93129
|
const sql = yield* require_SqlError.SqlClient;
|
|
92869
93130
|
const config = yield* ServerConfig;
|
|
92870
93131
|
const send = (input) => config.forgeCmmdRuntimeMode === true ? replicateWithRuntimeGrant(config, input) : replicateWithOwnerSession(sql, input);
|
|
92871
|
-
|
|
93132
|
+
const lane = (runtimeId) => resolveRuntimeLane(config, sql, {
|
|
93133
|
+
runtimeId,
|
|
93134
|
+
logPrefix: "lifecycle-intents"
|
|
93135
|
+
});
|
|
93136
|
+
return RuntimeReplicationClient.of({
|
|
93137
|
+
send,
|
|
93138
|
+
listPendingLifecycleIntents: ({ runtimeId }) => lane(runtimeId).pipe(require_Schema$1.flatMap((l) => listPendingLifecycleIntents(l))),
|
|
93139
|
+
acknowledgeLifecycleIntents: ({ runtimeId, intents }) => lane(runtimeId).pipe(require_Schema$1.flatMap((l) => acknowledgeLifecycleIntents(l, intents)))
|
|
93140
|
+
});
|
|
92872
93141
|
}));
|
|
92873
93142
|
//#endregion
|
|
92874
93143
|
//#region src/runtimeReplication/Services/RuntimeReplicationOutbox.ts
|
|
@@ -93186,6 +93455,14 @@ function stableReplicaDigest(...values) {
|
|
|
93186
93455
|
function replicaHydrationCommandId(runtimeId, generationId, threadId) {
|
|
93187
93456
|
return CommandId.make("runtime-replica-hydration:" + stableReplicaDigest(runtimeId, generationId, threadId));
|
|
93188
93457
|
}
|
|
93458
|
+
/**
|
|
93459
|
+
* One id per (runtime, thread, requested time): a restart between dispatch and
|
|
93460
|
+
* acknowledgement re-lists the same intent, and the engine's command receipts
|
|
93461
|
+
* turn the second dispatch into a no-op instead of a second settle.
|
|
93462
|
+
*/
|
|
93463
|
+
function lifecycleIntentCommandId(runtimeId, threadId, requestedAt) {
|
|
93464
|
+
return CommandId.make("lifecycle-intent:" + stableReplicaDigest(runtimeId, threadId, requestedAt));
|
|
93465
|
+
}
|
|
93189
93466
|
//#endregion
|
|
93190
93467
|
//#region src/runtimeReplication/protocol.ts
|
|
93191
93468
|
const EMPTY_RUNTIME_THREAD_HEAD_HASH = "sha256:47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU";
|
|
@@ -94136,6 +94413,21 @@ function totalTokens(totals) {
|
|
|
94136
94413
|
return totals.uncachedInputTokens + totals.cachedInputTokens + totals.cacheCreationTokens + totals.outputTokens;
|
|
94137
94414
|
}
|
|
94138
94415
|
/**
|
|
94416
|
+
* What a transcript record's own on-disk facts say it is a row of.
|
|
94417
|
+
*
|
|
94418
|
+
* Reuses exactly the facts `usageDrivers.ts`'s `isForgeAgent` reads to route a
|
|
94419
|
+
* record to the Forge agents lane, minus the "is this one of this
|
|
94420
|
+
* environment's own threads" gate: a Claude sidechain or a Codex subagent
|
|
94421
|
+
* rollout is a Subagent row regardless of which thread (if any) it hangs
|
|
94422
|
+
* under, so a subagent driven from outside Forge is still `subagent`, not a
|
|
94423
|
+
* plain Recorded-turn-shaped `turn`. Exported so the scan cache can recompute
|
|
94424
|
+
* the same value on decode instead of storing it as a redundant column.
|
|
94425
|
+
*/
|
|
94426
|
+
function transcriptRecordKind(provider, sidechain, rootSessionId) {
|
|
94427
|
+
if (provider === "claude") return sidechain === true ? "subagent" : "turn";
|
|
94428
|
+
return rootSessionId !== void 0 ? "subagent" : "turn";
|
|
94429
|
+
}
|
|
94430
|
+
/**
|
|
94139
94431
|
* Cheap substring gate applied before `JSON.parse`.
|
|
94140
94432
|
*
|
|
94141
94433
|
* Transcripts are mostly tool output; only a minority of lines carry usage. On
|
|
@@ -94204,6 +94496,7 @@ function parseClaudeLine(line, diagnostics) {
|
|
|
94204
94496
|
const dedupeKey = claudeDedupeKey(stringAt(messageRecord, "id"), stringAt(record, "requestId"));
|
|
94205
94497
|
const cost = record["costUSD"];
|
|
94206
94498
|
const launcher = stringAt(record, "entrypoint");
|
|
94499
|
+
const sidechain = record["isSidechain"] === true;
|
|
94207
94500
|
return {
|
|
94208
94501
|
provider: "claude",
|
|
94209
94502
|
timestampMs,
|
|
@@ -94212,8 +94505,9 @@ function parseClaudeLine(line, diagnostics) {
|
|
|
94212
94505
|
totals: claudeTokenBuckets(usageRecord) ?? EMPTY_TOTALS,
|
|
94213
94506
|
reportedCostUsd: typeof cost === "number" && Number.isFinite(cost) ? cost : null,
|
|
94214
94507
|
dedupeKey,
|
|
94508
|
+
kind: transcriptRecordKind("claude", sidechain, void 0),
|
|
94215
94509
|
...launcher === null ? {} : { launcher },
|
|
94216
|
-
...
|
|
94510
|
+
...sidechain ? { sidechain: true } : {}
|
|
94217
94511
|
};
|
|
94218
94512
|
}
|
|
94219
94513
|
function initialCodexScanState() {
|
|
@@ -94330,6 +94624,7 @@ function parseCodexTokenCount(record, payloadRecord, state) {
|
|
|
94330
94624
|
totals,
|
|
94331
94625
|
reportedCostUsd: null,
|
|
94332
94626
|
dedupeKey: null,
|
|
94627
|
+
kind: transcriptRecordKind("codex", void 0, state.rootSessionId),
|
|
94333
94628
|
...codexSessionFields(state)
|
|
94334
94629
|
};
|
|
94335
94630
|
}
|
|
@@ -94598,7 +94893,8 @@ var UsageAggregator = class {
|
|
|
94598
94893
|
origin,
|
|
94599
94894
|
sync,
|
|
94600
94895
|
runtimeId,
|
|
94601
|
-
driver
|
|
94896
|
+
driver,
|
|
94897
|
+
record.kind
|
|
94602
94898
|
].join("\0");
|
|
94603
94899
|
const existing = this.#buckets.get(key);
|
|
94604
94900
|
if (existing !== void 0) return existing;
|
|
@@ -94636,7 +94932,7 @@ var UsageAggregator = class {
|
|
|
94636
94932
|
finish() {
|
|
94637
94933
|
const buckets = [];
|
|
94638
94934
|
for (const [key, bucket] of this.#buckets) {
|
|
94639
|
-
const [day = "", hourStart = "", provider = "", model = "", origin = "", sync = "", runtimeId = "", driver = ""] = key.split("\0");
|
|
94935
|
+
const [day = "", hourStart = "", provider = "", model = "", origin = "", sync = "", runtimeId = "", driver = "", kind = ""] = key.split("\0");
|
|
94640
94936
|
buckets.push({
|
|
94641
94937
|
day,
|
|
94642
94938
|
...hourStart === "" ? {} : { hourStart },
|
|
@@ -94652,10 +94948,15 @@ var UsageAggregator = class {
|
|
|
94652
94948
|
origin,
|
|
94653
94949
|
...sync === "" ? {} : { sync },
|
|
94654
94950
|
...runtimeId === "" ? {} : { runtimeId },
|
|
94655
|
-
...driver === "" ? {} : { driver }
|
|
94951
|
+
...driver === "" ? {} : { driver },
|
|
94952
|
+
kind
|
|
94656
94953
|
});
|
|
94657
94954
|
}
|
|
94658
|
-
buckets.sort((a, b) =>
|
|
94955
|
+
buckets.sort((a, b) => {
|
|
94956
|
+
const left = bucketSortKey(a);
|
|
94957
|
+
const right = bucketSortKey(b);
|
|
94958
|
+
return left < right ? -1 : left > right ? 1 : 0;
|
|
94959
|
+
});
|
|
94659
94960
|
return {
|
|
94660
94961
|
buckets,
|
|
94661
94962
|
duplicatesDropped: this.#duplicatesDropped,
|
|
@@ -94673,7 +94974,8 @@ function bucketSortKey(bucket) {
|
|
|
94673
94974
|
bucket.origin ?? "",
|
|
94674
94975
|
bucket.sync ?? "",
|
|
94675
94976
|
bucket.runtimeId ?? "",
|
|
94676
|
-
bucket.driver ?? ""
|
|
94977
|
+
bucket.driver ?? "",
|
|
94978
|
+
bucket.kind ?? ""
|
|
94677
94979
|
].join("\0");
|
|
94678
94980
|
}
|
|
94679
94981
|
/**
|
|
@@ -95662,6 +95964,7 @@ function syncOf(sequence, options, threadId, events) {
|
|
|
95662
95964
|
return sequence <= cursor.acknowledgedSequence ? "acknowledged" : "pending";
|
|
95663
95965
|
}
|
|
95664
95966
|
function recordOf(event, provider, sync, threadId, runtimeId) {
|
|
95967
|
+
const kind = event.usageKind ?? "turn";
|
|
95665
95968
|
return {
|
|
95666
95969
|
provider,
|
|
95667
95970
|
timestampMs: Date.parse(event.occurredAt),
|
|
@@ -95670,6 +95973,7 @@ function recordOf(event, provider, sync, threadId, runtimeId) {
|
|
|
95670
95973
|
totals: event.usage ?? EMPTY_TOTALS,
|
|
95671
95974
|
reportedCostUsd: null,
|
|
95672
95975
|
dedupeKey: `recorded:${threadId}:${event.turnId}:${event.usageKind ?? "turn"}:${event.subagentId ?? ""}:${event.model}`,
|
|
95976
|
+
kind,
|
|
95673
95977
|
origin: "recorded",
|
|
95674
95978
|
...sync === void 0 ? {} : { sync },
|
|
95675
95979
|
...runtimeId === void 0 ? {} : { runtimeId },
|
|
@@ -96391,6 +96695,22 @@ async function readTranscriptRecords(filePath, provider) {
|
|
|
96391
96695
|
//#endregion
|
|
96392
96696
|
//#region src/usage/usageScanCache.ts
|
|
96393
96697
|
/**
|
|
96698
|
+
* Durable per-file scan cache.
|
|
96699
|
+
*
|
|
96700
|
+
* Transcripts are append-only and a file that has not changed can never yield
|
|
96701
|
+
* different usage, so parsed records are keyed by `(size, mtime)` and reused.
|
|
96702
|
+
* Without this every server restart re-parses the whole window: seconds for a
|
|
96703
|
+
* 30-day scan, against milliseconds to reload this cache.
|
|
96704
|
+
*
|
|
96705
|
+
* Caching *per file* rather than per day is deliberate. It is timezone
|
|
96706
|
+
* independent, so changing the reporting zone does not invalidate anything, and
|
|
96707
|
+
* it keeps cross-file de-duplication exact: cached entries are de-duplicated
|
|
96708
|
+
* within their own file only, and the aggregator still applies the global
|
|
96709
|
+
* dedupe pass over the small surviving key set.
|
|
96710
|
+
*
|
|
96711
|
+
* @module usageScanCache
|
|
96712
|
+
*/
|
|
96713
|
+
/**
|
|
96394
96714
|
* Bumped whenever cached records could differ from what a fresh parse produces.
|
|
96395
96715
|
*
|
|
96396
96716
|
* Version 1 was written before `parseCodexLine` suppressed the parent history a
|
|
@@ -96536,6 +96856,7 @@ function decodeRecord(row, provider, tables) {
|
|
|
96536
96856
|
},
|
|
96537
96857
|
reportedCostUsd: finiteNumber(reportedCostUsd),
|
|
96538
96858
|
dedupeKey: typeof dedupeKey === "string" ? dedupeKey : null,
|
|
96859
|
+
kind: transcriptRecordKind(provider, session.sidechain, session.rootSessionId),
|
|
96539
96860
|
...session
|
|
96540
96861
|
};
|
|
96541
96862
|
}
|
|
@@ -99508,144 +99829,6 @@ function claudeWriteToken(env = process.env) {
|
|
|
99508
99829
|
return accessor.read(env);
|
|
99509
99830
|
}
|
|
99510
99831
|
//#endregion
|
|
99511
|
-
//#region src/usage/providerRateLimits.ts
|
|
99512
|
-
/**
|
|
99513
|
-
* In-process cache of the latest Claude 5h/7d rate-limit telemetry, decoded
|
|
99514
|
-
* from the genuine Claude Agent SDK's own `rate_limit_event` messages
|
|
99515
|
-
* (see ClaudeAdapter.ts). This is intentionally NOT a CMMD call site: CMMD
|
|
99516
|
-
* must never replay a personal Claude OAuth token against api.anthropic.com
|
|
99517
|
-
* from its own backend (see CMMD's personal-claude-delivery.ts) - the only
|
|
99518
|
-
* legitimate source for this data is the real in-VM SDK session reporting it
|
|
99519
|
-
* as a side effect of a real turn.
|
|
99520
|
-
*
|
|
99521
|
-
* Snapshots are fenced by the exact non-secret credential-generation hash.
|
|
99522
|
-
* A Forge process can outlive an account reconnect, so a process-wide singleton
|
|
99523
|
-
* without that fence can leak account A's windows into account B's session.
|
|
99524
|
-
* The request-scoped route that reads this
|
|
99525
|
-
* cache (apps/server/src/command/http.ts) is what actually forwards it to
|
|
99526
|
-
* CMMD, using the request's own authenticated session - a background event
|
|
99527
|
-
* pipeline has no such session to reuse safely.
|
|
99528
|
-
*/
|
|
99529
|
-
/**
|
|
99530
|
-
* The SDK only ever reports ONE window per event. Only `five_hour` and
|
|
99531
|
-
* `seven_day` map to the two windows the Usage page shows; the
|
|
99532
|
-
* per-model/overage variants (seven_day_opus, overage, ...) are ignored here
|
|
99533
|
-
* on purpose rather than silently overwriting the plain 7-day figure.
|
|
99534
|
-
*/
|
|
99535
|
-
function mapClaudeRateLimitInfo(info) {
|
|
99536
|
-
if (typeof info.utilization !== "number" || typeof info.resetsAt !== "number" || !info.status) return null;
|
|
99537
|
-
const kind = info.rateLimitType === "five_hour" ? "fiveHour" : info.rateLimitType === "seven_day" ? "sevenDay" : null;
|
|
99538
|
-
if (!kind) return null;
|
|
99539
|
-
return {
|
|
99540
|
-
kind,
|
|
99541
|
-
window: {
|
|
99542
|
-
usedPercent: Math.round(info.utilization * 100),
|
|
99543
|
-
resetsAt: (/* @__PURE__ */ new Date(info.resetsAt * 1e3)).toISOString(),
|
|
99544
|
-
status: info.status
|
|
99545
|
-
}
|
|
99546
|
-
};
|
|
99547
|
-
}
|
|
99548
|
-
const SEVEN_DAY_MODEL_PREFIX = "seven_day_";
|
|
99549
|
-
const SEVEN_DAY_OVERAGE_SUFFIX = "overage_included";
|
|
99550
|
-
function capitalizeModelSuffix(suffix) {
|
|
99551
|
-
return suffix.length === 0 ? suffix : suffix.charAt(0).toUpperCase() + suffix.slice(1);
|
|
99552
|
-
}
|
|
99553
|
-
/**
|
|
99554
|
-
* Maps a per-model weekly SDKRateLimitInfo (`seven_day_<model>`, e.g.
|
|
99555
|
-
* `seven_day_opus`) into a `ProviderUsageModelWindow`. `seven_day_overage_included`
|
|
99556
|
-
* is not a per-model window (it reports overage-inclusive quota, not a
|
|
99557
|
-
* specific model) and stays ignored here, same as plain `overage`.
|
|
99558
|
-
*/
|
|
99559
|
-
function mapClaudeModelRateLimitInfo(info) {
|
|
99560
|
-
if (typeof info.utilization !== "number" || typeof info.resetsAt !== "number" || !info.status) return null;
|
|
99561
|
-
if (!info.rateLimitType?.startsWith(SEVEN_DAY_MODEL_PREFIX)) return null;
|
|
99562
|
-
const suffix = info.rateLimitType.slice(10);
|
|
99563
|
-
if (suffix.length === 0 || suffix === SEVEN_DAY_OVERAGE_SUFFIX) return null;
|
|
99564
|
-
return {
|
|
99565
|
-
model: capitalizeModelSuffix(suffix),
|
|
99566
|
-
window: {
|
|
99567
|
-
usedPercent: Math.round(info.utilization * 100),
|
|
99568
|
-
resetsAt: (/* @__PURE__ */ new Date(info.resetsAt * 1e3)).toISOString(),
|
|
99569
|
-
status: info.status
|
|
99570
|
-
}
|
|
99571
|
-
};
|
|
99572
|
-
}
|
|
99573
|
-
const cachedSnapshots = /* @__PURE__ */ new Map();
|
|
99574
|
-
let localClaudeGenerationHash = null;
|
|
99575
|
-
function setLocalClaudeUsageGeneration(generationId) {
|
|
99576
|
-
localClaudeGenerationHash = (0, node_crypto.createHash)("sha256").update(generationId).digest("hex");
|
|
99577
|
-
}
|
|
99578
|
-
function currentClaudeUsageGenerationHash() {
|
|
99579
|
-
const value = process.env.FORGE_PERSONAL_CLAUDE_GENERATION_HASH?.trim() ?? "";
|
|
99580
|
-
return /^[a-f0-9]{64}$/.test(value) ? value : localClaudeGenerationHash;
|
|
99581
|
-
}
|
|
99582
|
-
function cacheKeyFor(generationHash, providerAccountId) {
|
|
99583
|
-
return providerAccountId ? `${providerAccountId}:${generationHash}` : generationHash;
|
|
99584
|
-
}
|
|
99585
|
-
/**
|
|
99586
|
-
* `observedAt` here is a placeholder, not an observation — it becomes
|
|
99587
|
-
* meaningful only once a standard (five_hour/seven_day) window actually
|
|
99588
|
-
* lands via `withStandardWindow`, which recomputes it from the retained
|
|
99589
|
-
* windows' own observation times. A per-model-only cache (no standard window
|
|
99590
|
-
* yet) still carries this placeholder, so callers should treat `observedAt`
|
|
99591
|
-
* as trustworthy only once `fiveHour` or `sevenDay` is non-null.
|
|
99592
|
-
*/
|
|
99593
|
-
function emptyCachedSnapshot(observedAt) {
|
|
99594
|
-
return {
|
|
99595
|
-
fiveHour: null,
|
|
99596
|
-
sevenDay: null,
|
|
99597
|
-
modelWindowsByModel: {},
|
|
99598
|
-
observedAt,
|
|
99599
|
-
fiveHourObservedAt: null,
|
|
99600
|
-
sevenDayObservedAt: null
|
|
99601
|
-
};
|
|
99602
|
-
}
|
|
99603
|
-
/** Oldest observation among the retained standard windows, so one fresh event cannot mask stale data. */
|
|
99604
|
-
function oldestObservedAt(fiveHourObservedAt, sevenDayObservedAt) {
|
|
99605
|
-
return [fiveHourObservedAt, sevenDayObservedAt].filter((value) => value !== null).toSorted()[0];
|
|
99606
|
-
}
|
|
99607
|
-
function withStandardWindow(previous, mapped, observedAt) {
|
|
99608
|
-
const isFiveHour = mapped.kind === "fiveHour";
|
|
99609
|
-
const fiveHourObservedAt = isFiveHour ? observedAt : previous.fiveHourObservedAt;
|
|
99610
|
-
const sevenDayObservedAt = isFiveHour ? previous.sevenDayObservedAt : observedAt;
|
|
99611
|
-
return {
|
|
99612
|
-
...previous,
|
|
99613
|
-
fiveHour: isFiveHour ? mapped.window : previous.fiveHour,
|
|
99614
|
-
sevenDay: isFiveHour ? previous.sevenDay : mapped.window,
|
|
99615
|
-
fiveHourObservedAt,
|
|
99616
|
-
sevenDayObservedAt,
|
|
99617
|
-
observedAt: oldestObservedAt(fiveHourObservedAt, sevenDayObservedAt)
|
|
99618
|
-
};
|
|
99619
|
-
}
|
|
99620
|
-
function withModelWindow(previous, mapped) {
|
|
99621
|
-
return {
|
|
99622
|
-
...previous,
|
|
99623
|
-
modelWindowsByModel: {
|
|
99624
|
-
...previous.modelWindowsByModel,
|
|
99625
|
-
[mapped.model]: mapped.window
|
|
99626
|
-
}
|
|
99627
|
-
};
|
|
99628
|
-
}
|
|
99629
|
-
/**
|
|
99630
|
-
* Merges a single-window update into the cached snapshot without clobbering
|
|
99631
|
-
* the other windows. A per-model weekly report (`seven_day_<model>`) merges
|
|
99632
|
-
* into `modelWindowsByModel` keyed by model, leaving every other model and
|
|
99633
|
-
* the plain five_hour/seven_day windows untouched.
|
|
99634
|
-
*/
|
|
99635
|
-
function recordClaudeRateLimitTelemetry(info, generationHash = currentClaudeUsageGenerationHash(), providerAccountId) {
|
|
99636
|
-
if (generationHash === null) return;
|
|
99637
|
-
const cacheKey = cacheKeyFor(generationHash, providerAccountId);
|
|
99638
|
-
const observedAt = (/* @__PURE__ */ new Date()).toISOString();
|
|
99639
|
-
const previous = cachedSnapshots.get(cacheKey) ?? emptyCachedSnapshot(observedAt);
|
|
99640
|
-
const standard = mapClaudeRateLimitInfo(info);
|
|
99641
|
-
if (standard) {
|
|
99642
|
-
cachedSnapshots.set(cacheKey, withStandardWindow(previous, standard, observedAt));
|
|
99643
|
-
return;
|
|
99644
|
-
}
|
|
99645
|
-
const model = mapClaudeModelRateLimitInfo(info);
|
|
99646
|
-
if (model) cachedSnapshots.set(cacheKey, withModelWindow(previous, model));
|
|
99647
|
-
}
|
|
99648
|
-
//#endregion
|
|
99649
99832
|
//#region src/providerAuth/ClaudeDeviceAuth.ts
|
|
99650
99833
|
const AUTHORIZE_URL_PATTERN = /https:\/\/[^\s]*\/oauth\/authorize\?[^\s]+/u;
|
|
99651
99834
|
const ANSI_ESCAPE_PATTERN$1 = new RegExp(String.raw`\x1B\[[0-?]*[ -/]*[@-~]`, "gu");
|
|
@@ -100160,7 +100343,6 @@ async function finalizeClaudeCredentialSync(input) {
|
|
|
100160
100343
|
const providerAccountId = extractClaudeProviderAccountId(input.response);
|
|
100161
100344
|
const credentialGenerationId = extractClaudeCredentialGenerationId(input.response);
|
|
100162
100345
|
if (providerAccountId === null || credentialGenerationId === null) return null;
|
|
100163
|
-
if (input.auth.path === USER_CLAUDE_CREDENTIAL_PATH) setLocalClaudeUsageGeneration(credentialGenerationId);
|
|
100164
100346
|
return publishClaudeUsageAfterSync({
|
|
100165
100347
|
auth: input.auth,
|
|
100166
100348
|
providerAccountId,
|
|
@@ -147276,137 +147458,6 @@ const LocalAutomationRepositoryLive = require_Schema$1.effect(LocalAutomationRep
|
|
|
147276
147458
|
*/
|
|
147277
147459
|
var CodexAdapter = class extends require_Schema$1.Service()("forge/provider/Services/CodexAdapter") {};
|
|
147278
147460
|
//#endregion
|
|
147279
|
-
//#region ../../packages/shared/src/model.ts
|
|
147280
|
-
/** Check whether a capabilities object includes a given effort value. */
|
|
147281
|
-
function hasEffortLevel(caps, value) {
|
|
147282
|
-
return caps.reasoningEffortLevels.some((l) => l.value === value);
|
|
147283
|
-
}
|
|
147284
|
-
/** Return the default effort value for a capabilities object, or null if none. */
|
|
147285
|
-
function getDefaultEffort(caps) {
|
|
147286
|
-
return caps.reasoningEffortLevels.find((l) => l.isDefault)?.value ?? null;
|
|
147287
|
-
}
|
|
147288
|
-
/**
|
|
147289
|
-
* Resolve a raw effort option against capabilities.
|
|
147290
|
-
*
|
|
147291
|
-
* Returns the effective effort value — the explicit value if supported and not
|
|
147292
|
-
* prompt-injected, otherwise the model's default. Returns `undefined` only
|
|
147293
|
-
* when the model has no effort levels at all.
|
|
147294
|
-
*
|
|
147295
|
-
* Prompt-injected efforts (e.g. "ultrathink") are excluded because they are
|
|
147296
|
-
* applied via prompt text, not the effort API parameter.
|
|
147297
|
-
*/
|
|
147298
|
-
function resolveEffort(caps, raw) {
|
|
147299
|
-
const defaultValue = getDefaultEffort(caps);
|
|
147300
|
-
const trimmed = typeof raw === "string" ? raw.trim() : null;
|
|
147301
|
-
if (trimmed && !caps.promptInjectedEffortLevels.includes(trimmed) && hasEffortLevel(caps, trimmed)) return trimmed;
|
|
147302
|
-
return defaultValue ?? void 0;
|
|
147303
|
-
}
|
|
147304
|
-
/** Check whether a capabilities object includes a given context window value. */
|
|
147305
|
-
function hasContextWindowOption(caps, value) {
|
|
147306
|
-
return caps.contextWindowOptions.some((o) => o.value === value);
|
|
147307
|
-
}
|
|
147308
|
-
/** Return the default context window value, or `null` if none is defined. */
|
|
147309
|
-
function getDefaultContextWindow(caps) {
|
|
147310
|
-
return caps.contextWindowOptions.find((o) => o.isDefault)?.value ?? null;
|
|
147311
|
-
}
|
|
147312
|
-
/**
|
|
147313
|
-
* Resolve a raw `contextWindow` option against capabilities.
|
|
147314
|
-
*
|
|
147315
|
-
* Returns the effective context window value — the explicit value if supported,
|
|
147316
|
-
* otherwise the model's default. Returns `undefined` only when the model has
|
|
147317
|
-
* no context window options at all.
|
|
147318
|
-
*
|
|
147319
|
-
* Unlike effort levels (where the API has matching defaults), the context
|
|
147320
|
-
* window requires an explicit API suffix (e.g. `[1m]`), so we always preserve
|
|
147321
|
-
* the resolved value to avoid ambiguity between "user chose the default" and
|
|
147322
|
-
* "not specified".
|
|
147323
|
-
*/
|
|
147324
|
-
function resolveContextWindow(caps, raw) {
|
|
147325
|
-
const defaultValue = getDefaultContextWindow(caps);
|
|
147326
|
-
if (!raw) return defaultValue ?? void 0;
|
|
147327
|
-
return hasContextWindowOption(caps, raw) ? raw : defaultValue ?? void 0;
|
|
147328
|
-
}
|
|
147329
|
-
function normalizeCodexModelOptionsWithCapabilities(caps, modelOptions) {
|
|
147330
|
-
const reasoningEffort = resolveEffort(caps, modelOptions?.reasoningEffort);
|
|
147331
|
-
const fastMode = caps.supportsFastMode ? modelOptions?.fastMode : void 0;
|
|
147332
|
-
const nextOptions = {
|
|
147333
|
-
...reasoningEffort ? { reasoningEffort } : {},
|
|
147334
|
-
...fastMode !== void 0 ? { fastMode } : {}
|
|
147335
|
-
};
|
|
147336
|
-
return Object.keys(nextOptions).length > 0 ? nextOptions : void 0;
|
|
147337
|
-
}
|
|
147338
|
-
function normalizeClaudeModelOptionsWithCapabilities(caps, modelOptions) {
|
|
147339
|
-
const effort = resolveEffort(caps, modelOptions?.effort);
|
|
147340
|
-
const thinking = caps.supportsThinkingToggle ? modelOptions?.thinking : void 0;
|
|
147341
|
-
const fastMode = caps.supportsFastMode ? modelOptions?.fastMode : void 0;
|
|
147342
|
-
const contextWindow = resolveContextWindow(caps, modelOptions?.contextWindow);
|
|
147343
|
-
const nextOptions = {
|
|
147344
|
-
...thinking !== void 0 ? { thinking } : {},
|
|
147345
|
-
...effort ? { effort } : {},
|
|
147346
|
-
...fastMode !== void 0 ? { fastMode } : {},
|
|
147347
|
-
...contextWindow !== void 0 ? { contextWindow } : {}
|
|
147348
|
-
};
|
|
147349
|
-
return Object.keys(nextOptions).length > 0 ? nextOptions : void 0;
|
|
147350
|
-
}
|
|
147351
|
-
function normalizeModelSlug(model, provider = "codex") {
|
|
147352
|
-
if (typeof model !== "string") return null;
|
|
147353
|
-
const trimmed = model.trim();
|
|
147354
|
-
if (!trimmed) return null;
|
|
147355
|
-
const aliases = MODEL_SLUG_ALIASES_BY_PROVIDER[provider];
|
|
147356
|
-
const aliased = Object.prototype.hasOwnProperty.call(aliases, trimmed) ? aliases[trimmed] : void 0;
|
|
147357
|
-
return typeof aliased === "string" ? aliased : trimmed;
|
|
147358
|
-
}
|
|
147359
|
-
/** Trim a string, returning null for empty/missing values. */
|
|
147360
|
-
function trimOrNull(value) {
|
|
147361
|
-
if (typeof value !== "string") return null;
|
|
147362
|
-
return value.trim() || null;
|
|
147363
|
-
}
|
|
147364
|
-
/**
|
|
147365
|
-
* Resolve the actual API model identifier from a model selection.
|
|
147366
|
-
*
|
|
147367
|
-
* Provider-aware: each provider can map `contextWindow` (or other options)
|
|
147368
|
-
* to whatever the API requires — a model-id suffix, a separate parameter, etc.
|
|
147369
|
-
* The canonical slug stored in the selection stays unchanged so the
|
|
147370
|
-
* capabilities system keeps working.
|
|
147371
|
-
*
|
|
147372
|
-
* Expects `contextWindow` to already be resolved (via `resolveContextWindow`)
|
|
147373
|
-
* to the effective value, not stripped to `undefined` for defaults.
|
|
147374
|
-
*/
|
|
147375
|
-
function resolveApiModelId(modelSelection) {
|
|
147376
|
-
switch (modelSelection.provider) {
|
|
147377
|
-
case "claudeAgent": switch (modelSelection.options?.contextWindow) {
|
|
147378
|
-
case "1m": return `${modelSelection.model}[1m]`;
|
|
147379
|
-
default: return modelSelection.model;
|
|
147380
|
-
}
|
|
147381
|
-
default: return modelSelection.model;
|
|
147382
|
-
}
|
|
147383
|
-
}
|
|
147384
|
-
function applyClaudePromptEffortPrefix(text, effort) {
|
|
147385
|
-
const trimmed = text.trim();
|
|
147386
|
-
if (!trimmed) return trimmed;
|
|
147387
|
-
if (effort !== "ultrathink") return trimmed;
|
|
147388
|
-
if (trimmed.startsWith("Ultrathink:")) return trimmed;
|
|
147389
|
-
return `Ultrathink:\n${trimmed}`;
|
|
147390
|
-
}
|
|
147391
|
-
function getRawProviderOptionSelectionValue(selections, id) {
|
|
147392
|
-
return selections?.find((candidate) => candidate.id === id)?.value;
|
|
147393
|
-
}
|
|
147394
|
-
function getProviderOptionSelectionValue(selections, id) {
|
|
147395
|
-
return getRawProviderOptionSelectionValue(selections, id);
|
|
147396
|
-
}
|
|
147397
|
-
function getProviderOptionStringSelectionValue(selections, id) {
|
|
147398
|
-
const value = getProviderOptionSelectionValue(selections, id);
|
|
147399
|
-
return typeof value === "string" ? value : void 0;
|
|
147400
|
-
}
|
|
147401
|
-
function flatProviderOptions(selection) {
|
|
147402
|
-
if (!selection) return void 0;
|
|
147403
|
-
if (selection.provider !== "cursor" && selection.provider !== "opencode") return void 0;
|
|
147404
|
-
return selection.options;
|
|
147405
|
-
}
|
|
147406
|
-
function getModelSelectionStringOptionValue(selection, id) {
|
|
147407
|
-
return getProviderOptionStringSelectionValue(flatProviderOptions(selection), id);
|
|
147408
|
-
}
|
|
147409
|
-
//#endregion
|
|
147410
147461
|
//#region src/provider/codexCliVersion.ts
|
|
147411
147462
|
const CODEX_VERSION_PATTERN = /\bv?(\d+\.\d+(?:\.\d+)?(?:-[0-9A-Za-z.-]+)?)\b/;
|
|
147412
147463
|
const MINIMUM_CODEX_CLI_VERSION = "0.37.0";
|
|
@@ -148061,6 +148112,213 @@ async function probeCodexDiscovery(input) {
|
|
|
148061
148112
|
});
|
|
148062
148113
|
}
|
|
148063
148114
|
//#endregion
|
|
148115
|
+
//#region ../../packages/shared/src/model.ts
|
|
148116
|
+
/** Check whether a capabilities object includes a given effort value. */
|
|
148117
|
+
function hasEffortLevel(caps, value) {
|
|
148118
|
+
return caps.reasoningEffortLevels.some((l) => l.value === value);
|
|
148119
|
+
}
|
|
148120
|
+
/** Return the default effort value for a capabilities object, or null if none. */
|
|
148121
|
+
function getDefaultEffort(caps) {
|
|
148122
|
+
return caps.reasoningEffortLevels.find((l) => l.isDefault)?.value ?? null;
|
|
148123
|
+
}
|
|
148124
|
+
/**
|
|
148125
|
+
* Resolve a raw effort option against capabilities.
|
|
148126
|
+
*
|
|
148127
|
+
* Returns the effective effort value — the explicit value if supported and not
|
|
148128
|
+
* prompt-injected, otherwise the model's default. Returns `undefined` only
|
|
148129
|
+
* when the model has no effort levels at all.
|
|
148130
|
+
*
|
|
148131
|
+
* Prompt-injected efforts (e.g. "ultrathink") are excluded because they are
|
|
148132
|
+
* applied via prompt text, not the effort API parameter.
|
|
148133
|
+
*/
|
|
148134
|
+
function resolveEffort(caps, raw) {
|
|
148135
|
+
const defaultValue = getDefaultEffort(caps);
|
|
148136
|
+
const trimmed = typeof raw === "string" ? raw.trim() : null;
|
|
148137
|
+
if (trimmed && !caps.promptInjectedEffortLevels.includes(trimmed) && hasEffortLevel(caps, trimmed)) return trimmed;
|
|
148138
|
+
return defaultValue ?? void 0;
|
|
148139
|
+
}
|
|
148140
|
+
/** Check whether a capabilities object includes a given context window value. */
|
|
148141
|
+
function hasContextWindowOption(caps, value) {
|
|
148142
|
+
return caps.contextWindowOptions.some((o) => o.value === value);
|
|
148143
|
+
}
|
|
148144
|
+
/** Return the default context window value, or `null` if none is defined. */
|
|
148145
|
+
function getDefaultContextWindow(caps) {
|
|
148146
|
+
return caps.contextWindowOptions.find((o) => o.isDefault)?.value ?? null;
|
|
148147
|
+
}
|
|
148148
|
+
/**
|
|
148149
|
+
* Resolve a raw `contextWindow` option against capabilities.
|
|
148150
|
+
*
|
|
148151
|
+
* Returns the effective context window value — the explicit value if supported,
|
|
148152
|
+
* otherwise the model's default. Returns `undefined` only when the model has
|
|
148153
|
+
* no context window options at all.
|
|
148154
|
+
*
|
|
148155
|
+
* Unlike effort levels (where the API has matching defaults), the context
|
|
148156
|
+
* window requires an explicit API suffix (e.g. `[1m]`), so we always preserve
|
|
148157
|
+
* the resolved value to avoid ambiguity between "user chose the default" and
|
|
148158
|
+
* "not specified".
|
|
148159
|
+
*/
|
|
148160
|
+
function resolveContextWindow(caps, raw) {
|
|
148161
|
+
const defaultValue = getDefaultContextWindow(caps);
|
|
148162
|
+
if (!raw) return defaultValue ?? void 0;
|
|
148163
|
+
return hasContextWindowOption(caps, raw) ? raw : defaultValue ?? void 0;
|
|
148164
|
+
}
|
|
148165
|
+
function normalizeCodexModelOptionsWithCapabilities(caps, modelOptions) {
|
|
148166
|
+
const reasoningEffort = resolveEffort(caps, modelOptions?.reasoningEffort);
|
|
148167
|
+
const fastMode = caps.supportsFastMode ? modelOptions?.fastMode : void 0;
|
|
148168
|
+
const nextOptions = {
|
|
148169
|
+
...reasoningEffort ? { reasoningEffort } : {},
|
|
148170
|
+
...fastMode !== void 0 ? { fastMode } : {}
|
|
148171
|
+
};
|
|
148172
|
+
return Object.keys(nextOptions).length > 0 ? nextOptions : void 0;
|
|
148173
|
+
}
|
|
148174
|
+
function normalizeClaudeModelOptionsWithCapabilities(caps, modelOptions) {
|
|
148175
|
+
const effort = resolveEffort(caps, modelOptions?.effort);
|
|
148176
|
+
const thinking = caps.supportsThinkingToggle ? modelOptions?.thinking : void 0;
|
|
148177
|
+
const fastMode = caps.supportsFastMode ? modelOptions?.fastMode : void 0;
|
|
148178
|
+
const contextWindow = resolveContextWindow(caps, modelOptions?.contextWindow);
|
|
148179
|
+
const nextOptions = {
|
|
148180
|
+
...thinking !== void 0 ? { thinking } : {},
|
|
148181
|
+
...effort ? { effort } : {},
|
|
148182
|
+
...fastMode !== void 0 ? { fastMode } : {},
|
|
148183
|
+
...contextWindow !== void 0 ? { contextWindow } : {}
|
|
148184
|
+
};
|
|
148185
|
+
return Object.keys(nextOptions).length > 0 ? nextOptions : void 0;
|
|
148186
|
+
}
|
|
148187
|
+
function normalizeModelSlug(model, provider = "codex") {
|
|
148188
|
+
if (typeof model !== "string") return null;
|
|
148189
|
+
const trimmed = model.trim();
|
|
148190
|
+
if (!trimmed) return null;
|
|
148191
|
+
const aliases = MODEL_SLUG_ALIASES_BY_PROVIDER[provider];
|
|
148192
|
+
const aliased = Object.prototype.hasOwnProperty.call(aliases, trimmed) ? aliases[trimmed] : void 0;
|
|
148193
|
+
return typeof aliased === "string" ? aliased : trimmed;
|
|
148194
|
+
}
|
|
148195
|
+
/** Trim a string, returning null for empty/missing values. */
|
|
148196
|
+
function trimOrNull(value) {
|
|
148197
|
+
if (typeof value !== "string") return null;
|
|
148198
|
+
return value.trim() || null;
|
|
148199
|
+
}
|
|
148200
|
+
/**
|
|
148201
|
+
* Resolve the actual API model identifier from a model selection.
|
|
148202
|
+
*
|
|
148203
|
+
* Provider-aware: each provider can map `contextWindow` (or other options)
|
|
148204
|
+
* to whatever the API requires — a model-id suffix, a separate parameter, etc.
|
|
148205
|
+
* The canonical slug stored in the selection stays unchanged so the
|
|
148206
|
+
* capabilities system keeps working.
|
|
148207
|
+
*
|
|
148208
|
+
* Expects `contextWindow` to already be resolved (via `resolveContextWindow`)
|
|
148209
|
+
* to the effective value, not stripped to `undefined` for defaults.
|
|
148210
|
+
*/
|
|
148211
|
+
function resolveApiModelId(modelSelection) {
|
|
148212
|
+
switch (modelSelection.provider) {
|
|
148213
|
+
case "claudeAgent": switch (modelSelection.options?.contextWindow) {
|
|
148214
|
+
case "1m": return `${modelSelection.model}[1m]`;
|
|
148215
|
+
default: return modelSelection.model;
|
|
148216
|
+
}
|
|
148217
|
+
default: return modelSelection.model;
|
|
148218
|
+
}
|
|
148219
|
+
}
|
|
148220
|
+
function applyClaudePromptEffortPrefix(text, effort) {
|
|
148221
|
+
const trimmed = text.trim();
|
|
148222
|
+
if (!trimmed) return trimmed;
|
|
148223
|
+
if (effort !== "ultrathink") return trimmed;
|
|
148224
|
+
if (trimmed.startsWith("Ultrathink:")) return trimmed;
|
|
148225
|
+
return `Ultrathink:\n${trimmed}`;
|
|
148226
|
+
}
|
|
148227
|
+
function getRawProviderOptionSelectionValue(selections, id) {
|
|
148228
|
+
return selections?.find((candidate) => candidate.id === id)?.value;
|
|
148229
|
+
}
|
|
148230
|
+
function getProviderOptionSelectionValue(selections, id) {
|
|
148231
|
+
return getRawProviderOptionSelectionValue(selections, id);
|
|
148232
|
+
}
|
|
148233
|
+
function getProviderOptionStringSelectionValue(selections, id) {
|
|
148234
|
+
const value = getProviderOptionSelectionValue(selections, id);
|
|
148235
|
+
return typeof value === "string" ? value : void 0;
|
|
148236
|
+
}
|
|
148237
|
+
function flatProviderOptions(selection) {
|
|
148238
|
+
if (!selection) return void 0;
|
|
148239
|
+
if (selection.provider !== "cursor" && selection.provider !== "opencode") return void 0;
|
|
148240
|
+
return selection.options;
|
|
148241
|
+
}
|
|
148242
|
+
function getModelSelectionStringOptionValue(selection, id) {
|
|
148243
|
+
return getProviderOptionStringSelectionValue(flatProviderOptions(selection), id);
|
|
148244
|
+
}
|
|
148245
|
+
function acceptableModelSlug(value) {
|
|
148246
|
+
const trimmed = value?.trim();
|
|
148247
|
+
if (!trimmed || trimmed.length > 120) return;
|
|
148248
|
+
return trimmed;
|
|
148249
|
+
}
|
|
148250
|
+
/**
|
|
148251
|
+
* Order the credential's model scope: selected model first, then the catalog,
|
|
148252
|
+
* deduplicated and capped.
|
|
148253
|
+
*
|
|
148254
|
+
* Returns `undefined` when there is no catalog to widen to, which is the signal
|
|
148255
|
+
* to send the old single-model body. A slug CMMD would refuse is dropped rather
|
|
148256
|
+
* than sent, because one bad entry 400s the whole mint and takes the session
|
|
148257
|
+
* with it.
|
|
148258
|
+
*/
|
|
148259
|
+
function providerEgressModelScope(model, models) {
|
|
148260
|
+
const catalog = (models ?? []).map(acceptableModelSlug).filter((slug) => slug !== void 0);
|
|
148261
|
+
if (catalog.length === 0) return;
|
|
148262
|
+
const selected = acceptableModelSlug(model);
|
|
148263
|
+
const ordered = new Set(selected ? [selected] : []);
|
|
148264
|
+
for (const slug of catalog) {
|
|
148265
|
+
if (ordered.size >= 32) break;
|
|
148266
|
+
ordered.add(slug);
|
|
148267
|
+
}
|
|
148268
|
+
return [...ordered];
|
|
148269
|
+
}
|
|
148270
|
+
//#endregion
|
|
148271
|
+
//#region src/provider/codexCredentialModelScope.ts
|
|
148272
|
+
/**
|
|
148273
|
+
* Which Codex models one workspace egress credential has to cover.
|
|
148274
|
+
*
|
|
148275
|
+
* FOR-36501: the credential was scoped to the model the user picked, and the
|
|
148276
|
+
* Codex app-server holds one credential for the whole process. A turn on
|
|
148277
|
+
* gpt-6-astra that called `spawn_agent` with gpt-5.6-terra therefore lost the
|
|
148278
|
+
* child to a 401 before it spent a token. The subagent model is the model's own
|
|
148279
|
+
* choice in the tool arguments, so Forge cannot predict it and has to scope the
|
|
148280
|
+
* credential to the catalog a spawn can pick from.
|
|
148281
|
+
*
|
|
148282
|
+
* The catalog is the built-in Codex list, which is what the picker offers. It
|
|
148283
|
+
* includes the Spark model even though only a Pro account may call it: the
|
|
148284
|
+
* account snapshot is not resolved at issue time in workspace mode, and CMMD
|
|
148285
|
+
* still decides per call which models the account may use, so a slug in the
|
|
148286
|
+
* scope is permission to ask, never permission to spend.
|
|
148287
|
+
*/
|
|
148288
|
+
/**
|
|
148289
|
+
* Normalize a Codex model slug to the one the app-server and the mint route use.
|
|
148290
|
+
*
|
|
148291
|
+
* Lives here rather than in codexAppServerManager.ts so the catalog builder can
|
|
148292
|
+
* use it without importing the manager back. The manager re-exports it, which is
|
|
148293
|
+
* where every existing caller still reads it from.
|
|
148294
|
+
*/
|
|
148295
|
+
function normalizeCodexModelSlug(model, preferredId) {
|
|
148296
|
+
const normalized = normalizeModelSlug(model);
|
|
148297
|
+
if (!normalized) return;
|
|
148298
|
+
if (preferredId?.endsWith("-codex") && preferredId !== normalized) return preferredId;
|
|
148299
|
+
return normalized;
|
|
148300
|
+
}
|
|
148301
|
+
/** The model a proxy token is minted for when the thread names none. */
|
|
148302
|
+
function resolveCodexProviderProxyTokenModel(model) {
|
|
148303
|
+
const displaySlug = model?.trim().toLowerCase().replace(/\s+/g, "-");
|
|
148304
|
+
return normalizeCodexModelSlug(displaySlug) ?? "gpt-6-astra";
|
|
148305
|
+
}
|
|
148306
|
+
/** Every built-in Codex slug a `spawn_agent` call can name. */
|
|
148307
|
+
function codexCredentialModelCatalog() {
|
|
148308
|
+
return CODEX_BUILT_IN_MODELS.map((model) => normalizeCodexModelSlug(model.slug) ?? model.slug);
|
|
148309
|
+
}
|
|
148310
|
+
/**
|
|
148311
|
+
* The `models` list to mint a Codex session credential with.
|
|
148312
|
+
*
|
|
148313
|
+
* `undefined` means the catalog is unknown, and the caller then sends `model`
|
|
148314
|
+
* alone, exactly as before this card. That is the only safe answer: an empty
|
|
148315
|
+
* list would narrow the credential rather than widen it.
|
|
148316
|
+
*/
|
|
148317
|
+
function buildCodexCredentialModelScope(input) {
|
|
148318
|
+
const catalog = (input.catalogModels ?? codexCredentialModelCatalog()).map((slug) => normalizeCodexModelSlug(slug) ?? slug).filter((slug) => slug.trim().length > 0);
|
|
148319
|
+
return providerEgressModelScope(input.selectedModel, catalog);
|
|
148320
|
+
}
|
|
148321
|
+
//#endregion
|
|
148064
148322
|
//#region src/egress/providerDeliveryReceipt.ts
|
|
148065
148323
|
const PROVIDER_ACCOUNT_IDENTITY$2 = /^pai_v1_[A-Za-z0-9_-]{43}$/;
|
|
148066
148324
|
const UUID = /^[0-9a-f]{8}-[0-9a-f]{4}-[1-8][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$/i;
|
|
@@ -148312,6 +148570,21 @@ function runtimeProviderEgressBaseUrl(provider, controlPlaneUrl) {
|
|
|
148312
148570
|
anthropic: "/api/provider-egress/anthropic"
|
|
148313
148571
|
}[provider]}`;
|
|
148314
148572
|
}
|
|
148573
|
+
/**
|
|
148574
|
+
* The model fields of a mint body.
|
|
148575
|
+
*
|
|
148576
|
+
* `model` stays the single selected model, which is what CMMD runs its
|
|
148577
|
+
* post-mint constraint check on. `models` appears only when the caller knows a
|
|
148578
|
+
* catalog, so a caller that does not know one sends exactly the body it sent
|
|
148579
|
+
* before FOR-36501.
|
|
148580
|
+
*/
|
|
148581
|
+
function providerEgressModelBodyFields(input) {
|
|
148582
|
+
const scope = providerEgressModelScope(input.model, input.models);
|
|
148583
|
+
return {
|
|
148584
|
+
...input.model ? { model: input.model } : {},
|
|
148585
|
+
...scope ? { models: scope } : {}
|
|
148586
|
+
};
|
|
148587
|
+
}
|
|
148315
148588
|
const issueProviderEgressToken = (input) => issueProviderEgressCredential(input).pipe(require_Schema$1.map((credential) => credential.token));
|
|
148316
148589
|
const issueProviderEgressCredential = (input) => require_Schema$1.tryPromise({
|
|
148317
148590
|
try: async () => {
|
|
@@ -148335,7 +148608,7 @@ async function issueCmmdRuntimeProviderEgressCredential(input) {
|
|
|
148335
148608
|
token: runtimeGrantToken,
|
|
148336
148609
|
body: JSON.stringify({
|
|
148337
148610
|
provider: input.provider,
|
|
148338
|
-
...input
|
|
148611
|
+
...providerEgressModelBodyFields(input),
|
|
148339
148612
|
...input.provider === "openai" && input.providerAccountId ? { provider_account_id: input.providerAccountId } : {}
|
|
148340
148613
|
})
|
|
148341
148614
|
});
|
|
@@ -148451,7 +148724,7 @@ function issueCmmdLocalUserProviderEgressCredential(input) {
|
|
|
148451
148724
|
},
|
|
148452
148725
|
body: JSON.stringify({
|
|
148453
148726
|
provider: input.provider,
|
|
148454
|
-
...input
|
|
148727
|
+
...providerEgressModelBodyFields(input),
|
|
148455
148728
|
...input.provider === "openai" && input.providerAccountId ? { provider_account_id: input.providerAccountId } : {},
|
|
148456
148729
|
client: "local-desktop",
|
|
148457
148730
|
sessionId,
|
|
@@ -148834,16 +149107,6 @@ function mapCodexRuntimeMode(runtimeMode) {
|
|
|
148834
149107
|
async function killChildTree(child) {
|
|
148835
149108
|
await killCodexChildProcess(child);
|
|
148836
149109
|
}
|
|
148837
|
-
function normalizeCodexModelSlug(model, preferredId) {
|
|
148838
|
-
const normalized = normalizeModelSlug(model);
|
|
148839
|
-
if (!normalized) return;
|
|
148840
|
-
if (preferredId?.endsWith("-codex") && preferredId !== normalized) return preferredId;
|
|
148841
|
-
return normalized;
|
|
148842
|
-
}
|
|
148843
|
-
function resolveCodexProviderProxyTokenModel(model) {
|
|
148844
|
-
const displaySlug = model?.trim().toLowerCase().replace(/\s+/g, "-");
|
|
148845
|
-
return normalizeCodexModelSlug(displaySlug) ?? "gpt-6-astra";
|
|
148846
|
-
}
|
|
148847
149110
|
function buildCodexCollaborationMode(input) {
|
|
148848
149111
|
if (input.interactionMode === void 0) return;
|
|
148849
149112
|
const model = normalizeCodexModelSlug(input.model) ?? "gpt-6-astra";
|
|
@@ -149394,9 +149657,11 @@ var CodexAppServerManager = class extends node_events.EventEmitter {
|
|
|
149394
149657
|
const proxyConfig = getOpenAiProviderEgressProxyConfig({ allowLocalUser: true });
|
|
149395
149658
|
if (proxyConfig.mode === "disabled") return null;
|
|
149396
149659
|
if (proxyConfig.mode === "misconfigured") throw new ProviderEgressTokenError({ message: proxyConfig.message });
|
|
149660
|
+
const models = buildCodexCredentialModelScope({ selectedModel: input.model });
|
|
149397
149661
|
return await require_Schema$1.runPromise(issueProviderEgressCredential({
|
|
149398
149662
|
provider: "openai",
|
|
149399
149663
|
model: input.model,
|
|
149664
|
+
...models ? { models } : {},
|
|
149400
149665
|
threadId: input.threadId,
|
|
149401
149666
|
...input.providerAccountId ? { providerAccountId: input.providerAccountId } : {}
|
|
149402
149667
|
}));
|
|
@@ -207096,6 +207361,7 @@ function toCanonicalItemType(raw) {
|
|
|
207096
207361
|
if (type.includes("computer")) return "mcp_tool_call";
|
|
207097
207362
|
if (type.includes("mcp")) return "mcp_tool_call";
|
|
207098
207363
|
if (type.includes("dynamic tool")) return "dynamic_tool_call";
|
|
207364
|
+
if (type.includes("sub agent")) return "collab_agent_tool_call";
|
|
207099
207365
|
if (type.includes("collab")) return "collab_agent_tool_call";
|
|
207100
207366
|
if (type.includes("web search")) return "web_search";
|
|
207101
207367
|
if (type.includes("image")) return "image_view";
|
|
@@ -207160,6 +207426,21 @@ function itemDetail(item, payload) {
|
|
|
207160
207426
|
return trimmed;
|
|
207161
207427
|
}
|
|
207162
207428
|
}
|
|
207429
|
+
const SUB_AGENT_ACTIVITY_TITLE = "Subagent";
|
|
207430
|
+
/**
|
|
207431
|
+
* The text a subagent spawn shows in the timeline.
|
|
207432
|
+
*
|
|
207433
|
+
* A `SubAgentActivity` item carries only the agent path, the child thread id,
|
|
207434
|
+
* and whether the spawn started or completed. `itemDetail` reads none of those
|
|
207435
|
+
* fields, and both the started and the completed item arrive as `item/completed`,
|
|
207436
|
+
* so the lifecycle status cannot tell them apart either. Without this the row
|
|
207437
|
+
* renders as a bare title with no text under it. The app-server wire is
|
|
207438
|
+
* camelCase and the rollout file is snake_case, so read both.
|
|
207439
|
+
*/
|
|
207440
|
+
function subAgentActivityDetail(item) {
|
|
207441
|
+
const parts = [asString$2(item.agentPath)?.trim() || asString$2(item.agent_path)?.trim(), asString$2(item.kind)?.trim()].filter((part) => part !== void 0 && part.length > 0);
|
|
207442
|
+
return parts.length > 0 ? parts.join(" ") : void 0;
|
|
207443
|
+
}
|
|
207163
207444
|
function toRequestTypeFromMethod(method) {
|
|
207164
207445
|
switch (method) {
|
|
207165
207446
|
case "item/commandExecution/requestApproval": return "command_execution_approval";
|
|
@@ -207331,7 +207612,9 @@ function mapItemLifecycle(event, canonicalThreadId, lifecycle) {
|
|
|
207331
207612
|
if ((itemType === "mcp_tool_call" || itemType === "dynamic_tool_call") && (isBrowserToolName(source.name) || isBrowserToolName(source.toolName) || isBrowserToolName(source.method) || isBrowserToolName(payload?.toolName) || isBrowserToolName(payload?.method))) itemType = "browser_automation";
|
|
207332
207613
|
if ((itemType === "unknown" || itemType === "mcp_tool_call" || itemType === "dynamic_tool_call") && (isComputerToolName(source.name) || isComputerToolName(source.toolName) || isComputerToolName(source.method) || isComputerToolName(payload?.toolName) || isComputerToolName(payload?.method))) itemType = "mcp_tool_call";
|
|
207333
207614
|
if (itemType === "unknown" && lifecycle !== "item.updated") return;
|
|
207334
|
-
const
|
|
207615
|
+
const subAgentDetail = normalizeItemType(source.type).includes("sub agent") ? subAgentActivityDetail(source) : void 0;
|
|
207616
|
+
const detail = subAgentDetail ?? itemDetail(source, payload ?? {});
|
|
207617
|
+
const title = subAgentDetail ? SUB_AGENT_ACTIVITY_TITLE : itemTitle(itemType);
|
|
207335
207618
|
const status = lifecycle === "item.started" ? "inProgress" : lifecycle === "item.completed" ? "completed" : void 0;
|
|
207336
207619
|
return {
|
|
207337
207620
|
...runtimeEventBase(event, canonicalThreadId),
|
|
@@ -207339,7 +207622,7 @@ function mapItemLifecycle(event, canonicalThreadId, lifecycle) {
|
|
|
207339
207622
|
payload: {
|
|
207340
207623
|
itemType,
|
|
207341
207624
|
...status ? { status } : {},
|
|
207342
|
-
...
|
|
207625
|
+
...title ? { title } : {},
|
|
207343
207626
|
...detail ? { detail } : {},
|
|
207344
207627
|
...event.payload !== void 0 ? { data: event.payload } : {}
|
|
207345
207628
|
}
|
|
@@ -207583,36 +207866,23 @@ function mapCodexThreadNameUpdatedEvent(event, canonicalThreadId, payload) {
|
|
|
207583
207866
|
}
|
|
207584
207867
|
}];
|
|
207585
207868
|
}
|
|
207586
|
-
/** One provider call's spend, from Codex's `last_token_usage`. */
|
|
207587
|
-
function codexTurnUsageDelta(value) {
|
|
207588
|
-
const usage = asObject$2(value);
|
|
207589
|
-
return codexUsageBuckets(usage?.last_token_usage ?? usage?.last, "call-delta");
|
|
207590
|
-
}
|
|
207591
207869
|
/**
|
|
207592
|
-
* One
|
|
207593
|
-
*
|
|
207594
|
-
*
|
|
207595
|
-
*
|
|
207870
|
+
* One provider call's spend, from Codex's `last_token_usage`. Reads the
|
|
207871
|
+
* buckets via `codexTokenBuckets`, the shared home of the Claude/Codex
|
|
207872
|
+
* disjointness rule (providerTokenBuckets.ts): Codex reports `input_tokens`
|
|
207873
|
+
* inclusive of the cached and cache-write portions, so the uncached bucket is
|
|
207874
|
+
* the remainder, and reasoning is reported inside output and surfaced
|
|
207875
|
+
* separately without being added again. Mirrors `parseCodexLine` in
|
|
207596
207876
|
* usage/usageTranscripts.ts so a Recorded turn and a scanned transcript agree
|
|
207597
207877
|
* on the same numbers.
|
|
207598
207878
|
*/
|
|
207599
|
-
function
|
|
207600
|
-
const
|
|
207601
|
-
|
|
207602
|
-
|
|
207603
|
-
|
|
207604
|
-
|
|
207605
|
-
|
|
207606
|
-
const outputTokens = int("output_tokens", "outputTokens");
|
|
207607
|
-
if (inputTokens + cachedInputTokens + cacheCreationTokens + outputTokens === 0) return void 0;
|
|
207608
|
-
return {
|
|
207609
|
-
scope,
|
|
207610
|
-
uncachedInputTokens: Math.max(0, inputTokens - cachedInputTokens - cacheCreationTokens),
|
|
207611
|
-
cachedInputTokens,
|
|
207612
|
-
cacheCreationTokens,
|
|
207613
|
-
outputTokens,
|
|
207614
|
-
reasoningTokens: Math.min(outputTokens, int("reasoning_output_tokens", "reasoningOutputTokens"))
|
|
207615
|
-
};
|
|
207879
|
+
function codexTurnUsageDelta(value) {
|
|
207880
|
+
const usage = asObject$2(value);
|
|
207881
|
+
const buckets = codexTokenBuckets(usage?.last_token_usage ?? usage?.last);
|
|
207882
|
+
return buckets ? {
|
|
207883
|
+
scope: "call-delta",
|
|
207884
|
+
...buckets
|
|
207885
|
+
} : void 0;
|
|
207616
207886
|
}
|
|
207617
207887
|
function mapCodexThreadTokenUsageEvent(event, canonicalThreadId, payload) {
|
|
207618
207888
|
const tokenUsage = asObject$2(payload?.tokenUsage);
|
|
@@ -208306,6 +208576,7 @@ const DEFAULT_PUBLIC_PROVIDER_ERROR = "CMMD is temporarily unavailable. Check th
|
|
|
208306
208576
|
function categorizePublicProviderError(message) {
|
|
208307
208577
|
if (!message) return null;
|
|
208308
208578
|
const m = message.toLowerCase();
|
|
208579
|
+
if (/\bforge_provider_model_not_allowed\b/.test(m) || /\bnot\s+scoped\s+to\s+the\s+requested\s+model\b/.test(m)) return "The workspace AI credential does not cover the model this turn asked for. Retry, or pick that model for the thread.";
|
|
208309
208580
|
if (/\bmodel\b[\s\S]*\b(not\s+(found|available|supported)|does\s+not\s+exist|unsupported|invalid|unknown)\b/.test(m) || /\b(unsupported|unknown|invalid)\b[\s\S]*\bmodel\b/.test(m) || /\b(model_not_found|invalid_model|model_not_supported)\b/.test(m)) return "The selected model isn't available right now. Pick a different model and retry.";
|
|
208310
208581
|
if (/\b(rate[\s-]?limit|too\s+many\s+requests|quota|insufficient_quota)\b/.test(m) || /\b429\b/.test(m)) return "The AI service is rate-limited or out of quota. Wait a moment and retry.";
|
|
208311
208582
|
if (/\b(unauthorized|forbidden|authentication\s+(failed|error|required)|invalid\s+api\s+key|expired\s+(token|credential))\b/.test(m) || /\b40[13]\b/.test(m)) return "Workspace AI authentication failed. Reconnect the workspace and retry.";
|
|
@@ -210157,9 +210428,6 @@ function buildClaudeSessionContext(input) {
|
|
|
210157
210428
|
query: input.queryRuntime,
|
|
210158
210429
|
streamFiber: void 0,
|
|
210159
210430
|
startedAt: input.startedAt,
|
|
210160
|
-
recordsPersonalUsageTelemetry: input.recordsPersonalUsageTelemetry,
|
|
210161
|
-
personalUsageGenerationHash: input.personalUsageGenerationHash,
|
|
210162
|
-
personalUsageProviderAccountId: input.personalUsageProviderAccountId,
|
|
210163
210431
|
basePermissionMode: input.permissionMode,
|
|
210164
210432
|
resumeSessionId: input.sessionId,
|
|
210165
210433
|
pendingApprovals: input.pendingApprovals,
|
|
@@ -210517,26 +210785,18 @@ function finiteNumberFieldOrZero(usage, key) {
|
|
|
210517
210785
|
}
|
|
210518
210786
|
/**
|
|
210519
210787
|
* The whole turn's spend from the SDK result message, cache split intact.
|
|
210520
|
-
*
|
|
210521
|
-
*
|
|
210522
|
-
*
|
|
210788
|
+
* Reads the buckets via `claudeTokenBuckets`, the shared home of the
|
|
210789
|
+
* Claude/Codex disjointness rule (providerTokenBuckets.ts): Claude reports
|
|
210790
|
+
* `input_tokens` exclusive of the cached and cache-creation portions, so the
|
|
210791
|
+
* buckets are already disjoint, and Claude does not report reasoning
|
|
210792
|
+
* separately.
|
|
210523
210793
|
*/
|
|
210524
210794
|
function claudeTurnUsageTotal(value) {
|
|
210525
|
-
const
|
|
210526
|
-
|
|
210527
|
-
const uncachedInputTokens = finiteNumberFieldOrZero(usage, "input_tokens");
|
|
210528
|
-
const cachedInputTokens = finiteNumberFieldOrZero(usage, "cache_read_input_tokens");
|
|
210529
|
-
const cacheCreationTokens = finiteNumberFieldOrZero(usage, "cache_creation_input_tokens");
|
|
210530
|
-
const outputTokens = finiteNumberFieldOrZero(usage, "output_tokens");
|
|
210531
|
-
if (uncachedInputTokens + cachedInputTokens + cacheCreationTokens + outputTokens <= 0) return;
|
|
210532
|
-
return {
|
|
210795
|
+
const buckets = claudeTokenBuckets(value);
|
|
210796
|
+
return buckets ? {
|
|
210533
210797
|
scope: "turn-total",
|
|
210534
|
-
|
|
210535
|
-
|
|
210536
|
-
cacheCreationTokens: Math.trunc(cacheCreationTokens),
|
|
210537
|
-
outputTokens: Math.trunc(outputTokens),
|
|
210538
|
-
reasoningTokens: 0
|
|
210539
|
-
};
|
|
210798
|
+
...buckets
|
|
210799
|
+
} : void 0;
|
|
210540
210800
|
}
|
|
210541
210801
|
const EMPTY_MODEL_USAGE_BUCKETS = {
|
|
210542
210802
|
uncachedInputTokens: 0,
|
|
@@ -210549,20 +210809,14 @@ function bucketsTotal(buckets) {
|
|
|
210549
210809
|
return buckets.uncachedInputTokens + buckets.cachedInputTokens + buckets.cacheCreationTokens + buckets.outputTokens;
|
|
210550
210810
|
}
|
|
210551
210811
|
/**
|
|
210552
|
-
* One `ModelUsage` entry as buckets
|
|
210553
|
-
* camelCase, unlike `result.usage`,
|
|
210554
|
-
* Claude reports `inputTokens` exclusive of the
|
|
210555
|
-
* portions, so the buckets are already disjoint, and
|
|
210812
|
+
* One `ModelUsage` entry as buckets, via `claudeTokenBuckets`. `ModelUsage`
|
|
210813
|
+
* names its fields in camelCase, unlike `result.usage`, but `claudeTokenBuckets`
|
|
210814
|
+
* already reads both spellings. Claude reports `inputTokens` exclusive of the
|
|
210815
|
+
* cached and cache-creation portions, so the buckets are already disjoint, and
|
|
210816
|
+
* it reports no reasoning.
|
|
210556
210817
|
*/
|
|
210557
210818
|
function claudeModelUsageBuckets(usage) {
|
|
210558
|
-
|
|
210559
|
-
return {
|
|
210560
|
-
uncachedInputTokens: Math.trunc(finiteNumberFieldOrZero(record, "inputTokens")),
|
|
210561
|
-
cachedInputTokens: Math.trunc(finiteNumberFieldOrZero(record, "cacheReadInputTokens")),
|
|
210562
|
-
cacheCreationTokens: Math.trunc(finiteNumberFieldOrZero(record, "cacheCreationInputTokens")),
|
|
210563
|
-
outputTokens: Math.trunc(finiteNumberFieldOrZero(record, "outputTokens")),
|
|
210564
|
-
reasoningTokens: 0
|
|
210565
|
-
};
|
|
210819
|
+
return claudeTokenBuckets(usage) ?? EMPTY_MODEL_USAGE_BUCKETS;
|
|
210566
210820
|
}
|
|
210567
210821
|
/**
|
|
210568
210822
|
* What each model spent during THIS turn, from the SDK's per-model totals.
|
|
@@ -211906,7 +212160,6 @@ const makeClaudeAdapter = require_Schema$1.fn("makeClaudeAdapter")(function* (op
|
|
|
211906
212160
|
return;
|
|
211907
212161
|
}
|
|
211908
212162
|
if (message.type === "rate_limit_event") {
|
|
211909
|
-
if (context.recordsPersonalUsageTelemetry) recordClaudeRateLimitTelemetry(message.rate_limit_info, context.personalUsageGenerationHash, context.personalUsageProviderAccountId);
|
|
211910
212163
|
yield* offerRuntimeEvent({
|
|
211911
212164
|
...base,
|
|
211912
212165
|
type: "account.rate-limits.updated",
|
|
@@ -212404,10 +212657,7 @@ const makeClaudeAdapter = require_Schema$1.fn("makeClaudeAdapter")(function* (op
|
|
|
212404
212657
|
inFlightTools,
|
|
212405
212658
|
resumeSessionAt: resumeState?.resumeSessionAt,
|
|
212406
212659
|
effectiveApiModelId: modelConfig.effectiveApiModelId,
|
|
212407
|
-
effectiveEffort: modelConfig.effectiveEffort
|
|
212408
|
-
recordsPersonalUsageTelemetry: sessionProvider === PROVIDER$11 && modelConfig.endpointProfile === void 0 && providerProxyCredential === null && !claudeSettings.anthropicBaseUrl && !claudeSettings.anthropicApiKey,
|
|
212409
|
-
personalUsageGenerationHash: currentClaudeUsageGenerationHash(),
|
|
212410
|
-
personalUsageProviderAccountId: modelConfig.modelSelection?.provider === "claudeAgent" ? modelConfig.modelSelection.providerAccountId : void 0
|
|
212660
|
+
effectiveEffort: modelConfig.effectiveEffort
|
|
212411
212661
|
});
|
|
212412
212662
|
yield* require_HttpServer.set(contextRef, context$4);
|
|
212413
212663
|
sessions.set(threadId, context$4);
|
|
@@ -284699,6 +284949,27 @@ const makeRuntimeDrainReporter = require_Schema$1.gen(function* () {
|
|
|
284699
284949
|
var RuntimeDrainReporter = class extends require_Schema$1.Service()("forge/runtimeDrain/RuntimeDrainReporter") {};
|
|
284700
284950
|
const RuntimeDrainReporterLive = require_Schema$1.effect(RuntimeDrainReporter, makeRuntimeDrainReporter);
|
|
284701
284951
|
//#endregion
|
|
284952
|
+
//#region src/usage/providerRateLimits.ts
|
|
284953
|
+
/**
|
|
284954
|
+
* The SDK only ever reports ONE window per event. Only `five_hour` and
|
|
284955
|
+
* `seven_day` map to the two windows the Usage page shows; the
|
|
284956
|
+
* per-model/overage variants (seven_day_opus, overage, ...) are ignored here
|
|
284957
|
+
* on purpose rather than silently overwriting the plain 7-day figure.
|
|
284958
|
+
*/
|
|
284959
|
+
function mapClaudeRateLimitInfo(info) {
|
|
284960
|
+
if (typeof info.utilization !== "number" || typeof info.resetsAt !== "number" || !info.status) return null;
|
|
284961
|
+
const kind = info.rateLimitType === "five_hour" ? "fiveHour" : info.rateLimitType === "seven_day" ? "sevenDay" : null;
|
|
284962
|
+
if (!kind) return null;
|
|
284963
|
+
return {
|
|
284964
|
+
kind,
|
|
284965
|
+
window: {
|
|
284966
|
+
usedPercent: Math.round(info.utilization * 100),
|
|
284967
|
+
resetsAt: (/* @__PURE__ */ new Date(info.resetsAt * 1e3)).toISOString(),
|
|
284968
|
+
status: info.status
|
|
284969
|
+
}
|
|
284970
|
+
};
|
|
284971
|
+
}
|
|
284972
|
+
//#endregion
|
|
284702
284973
|
//#region src/orchestration/Layers/ProviderRuntimeIngestion.ts
|
|
284703
284974
|
const providerTurnKey = (threadId, turnId) => `${threadId}:${turnId}`;
|
|
284704
284975
|
const providerCommandId = (event, tag) => CommandId.make(`provider:${event.eventId}:${tag}:${crypto.randomUUID()}`);
|
|
@@ -291765,7 +292036,7 @@ function resolveBuildCommitFromEnv(env) {
|
|
|
291765
292036
|
* environment descriptor down instead of reporting an honest "unknown".
|
|
291766
292037
|
*/
|
|
291767
292038
|
function readBakedBuildCommit() {
|
|
291768
|
-
return "
|
|
292039
|
+
return "ce557b7ba4e4d217f25ff499adb104f8cd18a703";
|
|
291769
292040
|
}
|
|
291770
292041
|
async function resolveServerBuildCommit(input) {
|
|
291771
292042
|
if (isFullCommitSha(input.baked)) return input.baked;
|
|
@@ -301020,6 +301291,7 @@ function resolveWsUrl(baseUrl) {
|
|
|
301020
301291
|
const callCmmdTool = legacyCmmdToolBridge.callTool;
|
|
301021
301292
|
const extractMcpToolText = legacyCmmdToolBridge.extractText;
|
|
301022
301293
|
const isCmmdMcpAuthError = legacyCmmdToolBridge.isAuthError;
|
|
301294
|
+
const __cmmdProxyRouteLayersStartIndex = registeredProxyRouteLayers().length;
|
|
301023
301295
|
/**
|
|
301024
301296
|
* CMMD-side path for the PROJECT-keyed Forge Cloud catalog. Shared by the list
|
|
301025
301297
|
* proxy, the SSE poll-and-emit proxy, and the register/unregister proxies so the
|
|
@@ -301029,8 +301301,9 @@ const CMMD_CLOUD_PROJECTS_PATH = "/api/forge/context/cloud-projects";
|
|
|
301029
301301
|
const CMMD_RUNTIMES_PATH = "/api/forge/context/runtimes";
|
|
301030
301302
|
/**
|
|
301031
301303
|
* Authenticate the browser session and resolve the CMMD JWT to forward
|
|
301032
|
-
* upstream.
|
|
301033
|
-
* turns into
|
|
301304
|
+
* upstream. `jwt` is null when none could be resolved, which every caller
|
|
301305
|
+
* turns into `respondCmmdConnectionRequired(session.sessionId)` — the same
|
|
301306
|
+
* unified `CMMD_AUTH_REQUIRED` body and auth-clear the registry uses.
|
|
301034
301307
|
*
|
|
301035
301308
|
* Shared so the auth preamble is written once rather than once per proxy route.
|
|
301036
301309
|
*/
|
|
@@ -301038,11 +301311,14 @@ function makeCmmdProxyAccessTokenEffect(logPrefix) {
|
|
|
301038
301311
|
return require_Schema$1.gen(function* () {
|
|
301039
301312
|
const request = yield* require_HttpServer.HttpServerRequest;
|
|
301040
301313
|
const session = yield* (yield* ServerAuth).authenticateHttpRequest(request);
|
|
301041
|
-
return
|
|
301042
|
-
|
|
301043
|
-
|
|
301044
|
-
|
|
301045
|
-
|
|
301314
|
+
return {
|
|
301315
|
+
session,
|
|
301316
|
+
jwt: yield* resolveCmmdJwtForSession({
|
|
301317
|
+
sessionId: session.sessionId,
|
|
301318
|
+
subject: session.subject,
|
|
301319
|
+
logPrefix
|
|
301320
|
+
})
|
|
301321
|
+
};
|
|
301046
301322
|
});
|
|
301047
301323
|
}
|
|
301048
301324
|
var WorkIntakeSnapshotReadError = class extends require_Schema$1.TaggedErrorClass()("WorkIntakeSnapshotReadError", {
|
|
@@ -301122,32 +301398,19 @@ const cmmdProfileRouteLayer = add$1("GET", "/api/cmmd/profile", require_Schema$1
|
|
|
301122
301398
|
* `resolution`/`sinceTime`/`untilTime` when the page is drawing hours, which is
|
|
301123
301399
|
* what lets CMMD cut hour buckets rather than only days.
|
|
301124
301400
|
*/
|
|
301125
|
-
|
|
301401
|
+
registerProxyRoute({
|
|
301126
301402
|
forgePath: "/api/cmmd/usage/summary",
|
|
301127
301403
|
method: "GET",
|
|
301128
301404
|
cmmdPath: "/api/forge/context/usage/summary",
|
|
301129
301405
|
orgIdSource: "none"
|
|
301130
301406
|
});
|
|
301131
|
-
|
|
301132
|
-
* The workspace's CMMD plan: entitlements, the current period, and how much of
|
|
301133
|
-
* each metered allowance is left. This is subscription consumption, which is a
|
|
301134
|
-
* different question from the API-equivalent estimate the usage summary above
|
|
301135
|
-
* computes from transcripts.
|
|
301136
|
-
*
|
|
301137
|
-
* `orgIdSource` is `query` (FOR-36406): a plan belongs to an organization, and
|
|
301138
|
-
* without one CMMD answers for the user's default organization, which is their
|
|
301139
|
-
* personal space rather than the workspace their Environment runs in. The web
|
|
301140
|
-
* passes the Environment's organization as `?orgId=` and the registry turns it
|
|
301141
|
-
* into `X-Organization-ID`; without it CMMD still answers, for the default.
|
|
301142
|
-
*/
|
|
301143
|
-
const cmmdBillingRouteLayer = registerProxyRoute({
|
|
301407
|
+
registerProxyRoute({
|
|
301144
301408
|
forgePath: "/api/cmmd/billing",
|
|
301145
301409
|
method: "GET",
|
|
301146
301410
|
cmmdPath: "/api/forge/context/billing",
|
|
301147
301411
|
orgIdSource: "query"
|
|
301148
301412
|
});
|
|
301149
|
-
|
|
301150
|
-
const cmmdBillingSeriesRouteLayer = registerProxyRoute({
|
|
301413
|
+
registerProxyRoute({
|
|
301151
301414
|
forgePath: "/api/cmmd/billing/series",
|
|
301152
301415
|
method: "GET",
|
|
301153
301416
|
cmmdPath: "/api/forge/context/billing/series",
|
|
@@ -301185,6 +301448,15 @@ function runCmmdRestProxy(session, proxy, dependencies = {}) {
|
|
|
301185
301448
|
});
|
|
301186
301449
|
}
|
|
301187
301450
|
/**
|
|
301451
|
+
* Adapts `runCmmdRestProxy`'s `{ ok, value | error }` outcome into a
|
|
301452
|
+
* `ProxyHandlerRoute.run` result: the shared shape every converted handler's
|
|
301453
|
+
* `run` uses so it stays the three or so lines of the actual gateway call
|
|
301454
|
+
* plus response shaping, with resolve-and-retry left to `runCmmdRestProxy`.
|
|
301455
|
+
*/
|
|
301456
|
+
function runCmmdRestProxyAsHandlerResult(session, proxy, shape) {
|
|
301457
|
+
return runCmmdRestProxy(session, proxy).pipe(require_Schema$1.flatMap((outcome) => outcome.ok ? require_Schema$1.succeed(shape(outcome.value)) : require_Schema$1.fail(outcome.error)));
|
|
301458
|
+
}
|
|
301459
|
+
/**
|
|
301188
301460
|
* Forge-context REST responses wrap their payload in `{ data, meta, pagination? }`
|
|
301189
301461
|
* (see CMMD `sendForgeEnvelope`). Unwrap to the bare payload so handler response
|
|
301190
301462
|
* shapes match what the web client expected from the prior MCP text path.
|
|
@@ -301349,22 +301621,34 @@ function buildCreateBrainDocumentInput(payload) {
|
|
|
301349
301621
|
...payload.tags && payload.tags.length > 0 ? { tags: payload.tags } : {}
|
|
301350
301622
|
};
|
|
301351
301623
|
}
|
|
301352
|
-
|
|
301353
|
-
|
|
301354
|
-
|
|
301355
|
-
|
|
301356
|
-
|
|
301357
|
-
|
|
301358
|
-
|
|
301624
|
+
function parseCreateBrainDocRequest(request) {
|
|
301625
|
+
return request.json.pipe(require_Schema$1.orElseSucceed(() => null), require_Schema$1.map((rawBody) => {
|
|
301626
|
+
const payload = parseBrainDocPayload(rawBody);
|
|
301627
|
+
return payload ? {
|
|
301628
|
+
ok: true,
|
|
301629
|
+
value: payload
|
|
301630
|
+
} : {
|
|
301631
|
+
ok: false,
|
|
301632
|
+
status: 400,
|
|
301633
|
+
body: { error: "Invalid request: title (1-500 chars) and content (1-100k chars) are required." }
|
|
301634
|
+
};
|
|
301635
|
+
}));
|
|
301636
|
+
}
|
|
301637
|
+
registerProxyHandler({
|
|
301638
|
+
forgePath: "/api/cmmd/brain-docs",
|
|
301639
|
+
method: "POST",
|
|
301640
|
+
parse: parseCreateBrainDocRequest,
|
|
301641
|
+
run: (payload, { session }) => runCmmdRestProxyAsHandlerResult(session, (jwt) => cmmdGateway.createBrainDocument({
|
|
301359
301642
|
jwt,
|
|
301360
301643
|
document: buildCreateBrainDocumentInput(payload)
|
|
301361
|
-
}))
|
|
301362
|
-
|
|
301363
|
-
|
|
301364
|
-
|
|
301365
|
-
|
|
301366
|
-
|
|
301367
|
-
})
|
|
301644
|
+
}), (value) => ({
|
|
301645
|
+
status: 201,
|
|
301646
|
+
body: {
|
|
301647
|
+
success: true,
|
|
301648
|
+
doc: unwrapForgeEnvelope(value)
|
|
301649
|
+
}
|
|
301650
|
+
}))
|
|
301651
|
+
});
|
|
301368
301652
|
function normalizeOptionalNullableString(value, options) {
|
|
301369
301653
|
if (value === void 0) return void 0;
|
|
301370
301654
|
if (value === null) return null;
|
|
@@ -301418,46 +301702,77 @@ function buildUpdateTaskToolInput(payload) {
|
|
|
301418
301702
|
...payload.labels !== void 0 ? { tags: payload.labels } : {}
|
|
301419
301703
|
};
|
|
301420
301704
|
}
|
|
301421
|
-
|
|
301422
|
-
|
|
301423
|
-
|
|
301424
|
-
|
|
301425
|
-
|
|
301426
|
-
|
|
301705
|
+
function parseUpdateCmmdTaskRequest(request) {
|
|
301706
|
+
return request.json.pipe(require_Schema$1.orElseSucceed(() => null), require_Schema$1.map((rawBody) => {
|
|
301707
|
+
const payload = parseUpdateTaskPayload(rawBody);
|
|
301708
|
+
return payload ? {
|
|
301709
|
+
ok: true,
|
|
301710
|
+
value: payload
|
|
301711
|
+
} : {
|
|
301712
|
+
ok: false,
|
|
301713
|
+
status: 400,
|
|
301714
|
+
body: { error: "Invalid request: taskId is required and at least one update field must be provided." }
|
|
301715
|
+
};
|
|
301716
|
+
}));
|
|
301717
|
+
}
|
|
301718
|
+
function runUpdateCmmdTask(payload, { session }) {
|
|
301427
301719
|
const { taskId, ...patch } = buildUpdateTaskToolInput(payload);
|
|
301428
|
-
|
|
301720
|
+
return runCmmdRestProxyAsHandlerResult(session, (jwt) => cmmdGateway.updateTask({
|
|
301429
301721
|
jwt,
|
|
301430
301722
|
taskId: String(taskId),
|
|
301431
301723
|
patch
|
|
301432
|
-
}))
|
|
301433
|
-
if (restOutcome.ok) {
|
|
301724
|
+
}), (value) => {
|
|
301434
301725
|
invalidateCachedCmmdWorkIntakeForSession(session.sessionId);
|
|
301435
|
-
return
|
|
301436
|
-
|
|
301437
|
-
|
|
301438
|
-
|
|
301439
|
-
|
|
301440
|
-
|
|
301441
|
-
}
|
|
301442
|
-
|
|
301443
|
-
|
|
301444
|
-
|
|
301445
|
-
|
|
301446
|
-
|
|
301447
|
-
|
|
301448
|
-
|
|
301449
|
-
|
|
301450
|
-
|
|
301726
|
+
return {
|
|
301727
|
+
status: 200,
|
|
301728
|
+
body: {
|
|
301729
|
+
success: true,
|
|
301730
|
+
details: unwrapForgeEnvelope(value)
|
|
301731
|
+
}
|
|
301732
|
+
};
|
|
301733
|
+
});
|
|
301734
|
+
}
|
|
301735
|
+
registerProxyHandler({
|
|
301736
|
+
forgePath: "/api/cmmd/tasks/update",
|
|
301737
|
+
method: "POST",
|
|
301738
|
+
parse: parseUpdateCmmdTaskRequest,
|
|
301739
|
+
run: runUpdateCmmdTask
|
|
301740
|
+
});
|
|
301741
|
+
registerProxyHandler({
|
|
301742
|
+
forgePath: "/api/command/tasks/update",
|
|
301743
|
+
method: "POST",
|
|
301744
|
+
parse: parseUpdateCmmdTaskRequest,
|
|
301745
|
+
run: runUpdateCmmdTask
|
|
301746
|
+
});
|
|
301747
|
+
function parseAddCmmdTaskCommentRequest(request) {
|
|
301748
|
+
return request.json.pipe(require_Schema$1.orElseSucceed(() => null), require_Schema$1.map((rawBody) => {
|
|
301749
|
+
const payload = parseTaskCommentPayload(rawBody);
|
|
301750
|
+
return payload ? {
|
|
301751
|
+
ok: true,
|
|
301752
|
+
value: payload
|
|
301753
|
+
} : {
|
|
301754
|
+
ok: false,
|
|
301755
|
+
status: 400,
|
|
301756
|
+
body: { error: "taskId and content (max 2000 chars) are required." }
|
|
301757
|
+
};
|
|
301758
|
+
}));
|
|
301759
|
+
}
|
|
301760
|
+
registerProxyHandler({
|
|
301761
|
+
forgePath: "/api/cmmd/tasks/comment",
|
|
301762
|
+
method: "POST",
|
|
301763
|
+
parse: parseAddCmmdTaskCommentRequest,
|
|
301764
|
+
run: (payload, { session }) => runCmmdRestProxyAsHandlerResult(session, (jwt) => cmmdGateway.addTaskComment({
|
|
301451
301765
|
jwt,
|
|
301452
301766
|
taskId: payload.taskId,
|
|
301453
301767
|
content: payload.content
|
|
301454
|
-
}))
|
|
301455
|
-
|
|
301456
|
-
|
|
301457
|
-
|
|
301458
|
-
|
|
301459
|
-
|
|
301460
|
-
})
|
|
301768
|
+
}), (value) => ({
|
|
301769
|
+
status: 201,
|
|
301770
|
+
body: {
|
|
301771
|
+
success: true,
|
|
301772
|
+
details: unwrapForgeEnvelope(value)
|
|
301773
|
+
}
|
|
301774
|
+
}))
|
|
301775
|
+
});
|
|
301461
301776
|
function parseTaskCommentPayload(body) {
|
|
301462
301777
|
if (typeof body !== "object" || body === null) return null;
|
|
301463
301778
|
const b = body;
|
|
@@ -301486,24 +301801,38 @@ function normalizeTaskSearchParams(url) {
|
|
|
301486
301801
|
limit: Math.min(Number(url.searchParams.get("limit") ?? "20"), 50)
|
|
301487
301802
|
};
|
|
301488
301803
|
}
|
|
301489
|
-
|
|
301490
|
-
|
|
301491
|
-
|
|
301492
|
-
|
|
301493
|
-
|
|
301494
|
-
|
|
301495
|
-
|
|
301496
|
-
|
|
301497
|
-
|
|
301498
|
-
|
|
301804
|
+
function parseSearchCmmdTasksRequest(request) {
|
|
301805
|
+
return require_Schema$1.sync(() => ({
|
|
301806
|
+
ok: true,
|
|
301807
|
+
value: normalizeTaskSearchParams(new URL(request.url, "http://localhost"))
|
|
301808
|
+
}));
|
|
301809
|
+
}
|
|
301810
|
+
function runSearchCmmdTasks(search, { session }) {
|
|
301811
|
+
if (!search) return require_Schema$1.succeed({
|
|
301812
|
+
status: 200,
|
|
301813
|
+
body: {
|
|
301814
|
+
tasks: [],
|
|
301815
|
+
total: 0
|
|
301816
|
+
}
|
|
301817
|
+
});
|
|
301818
|
+
const accessToken = readCommandAccessTokenForSession(session.sessionId) ?? "";
|
|
301819
|
+
return require_Schema$1.promise(() => callCmmdTool(accessToken, "search_tasks", {
|
|
301499
301820
|
query: search.query,
|
|
301500
301821
|
limit: search.limit
|
|
301501
|
-
})))
|
|
301502
|
-
|
|
301503
|
-
|
|
301504
|
-
|
|
301505
|
-
|
|
301506
|
-
}
|
|
301822
|
+
})).pipe(require_Schema$1.map((result) => ({
|
|
301823
|
+
status: 200,
|
|
301824
|
+
body: parseJsonObjectText(extractMcpToolText(result)) ?? {
|
|
301825
|
+
tasks: [],
|
|
301826
|
+
total: 0
|
|
301827
|
+
}
|
|
301828
|
+
})));
|
|
301829
|
+
}
|
|
301830
|
+
registerProxyHandler({
|
|
301831
|
+
forgePath: "/api/cmmd/tasks/search",
|
|
301832
|
+
method: "GET",
|
|
301833
|
+
parse: parseSearchCmmdTasksRequest,
|
|
301834
|
+
run: runSearchCmmdTasks
|
|
301835
|
+
});
|
|
301507
301836
|
function parseJsonObjectText(text) {
|
|
301508
301837
|
if (!text) return null;
|
|
301509
301838
|
try {
|
|
@@ -301517,23 +301846,47 @@ function parsePositiveIntegerId(value) {
|
|
|
301517
301846
|
const numericId = Number(value);
|
|
301518
301847
|
return Number.isInteger(numericId) && numericId > 0 ? numericId : null;
|
|
301519
301848
|
}
|
|
301520
|
-
|
|
301521
|
-
|
|
301522
|
-
|
|
301523
|
-
|
|
301524
|
-
|
|
301525
|
-
|
|
301526
|
-
|
|
301527
|
-
|
|
301528
|
-
|
|
301849
|
+
function parseGetCmmdTaskRequest(request) {
|
|
301850
|
+
return require_Schema$1.sync(() => {
|
|
301851
|
+
const taskId = extractIdFromPath(new URL(request.url, "http://localhost").pathname, 1);
|
|
301852
|
+
if (!taskId) return {
|
|
301853
|
+
ok: false,
|
|
301854
|
+
status: 400,
|
|
301855
|
+
body: { error: "Task ID is required." }
|
|
301856
|
+
};
|
|
301857
|
+
const numericId = parsePositiveIntegerId(taskId);
|
|
301858
|
+
if (!numericId) return {
|
|
301859
|
+
ok: false,
|
|
301860
|
+
status: 400,
|
|
301861
|
+
body: { error: "Invalid task ID." }
|
|
301862
|
+
};
|
|
301863
|
+
return {
|
|
301864
|
+
ok: true,
|
|
301865
|
+
value: numericId
|
|
301866
|
+
};
|
|
301867
|
+
});
|
|
301868
|
+
}
|
|
301869
|
+
function runGetCmmdTask(numericId, { session }) {
|
|
301870
|
+
return runCmmdRestProxyAsHandlerResult(session, (jwt) => cmmdGateway.getTask({
|
|
301529
301871
|
jwt,
|
|
301530
301872
|
taskId: String(numericId)
|
|
301531
|
-
}))
|
|
301532
|
-
|
|
301533
|
-
|
|
301534
|
-
|
|
301535
|
-
|
|
301536
|
-
}
|
|
301873
|
+
}), (value) => {
|
|
301874
|
+
const task = unwrapForgeEnvelope(value);
|
|
301875
|
+
return task === null || task === void 0 ? {
|
|
301876
|
+
status: 404,
|
|
301877
|
+
body: { error: "Task not found." }
|
|
301878
|
+
} : {
|
|
301879
|
+
status: 200,
|
|
301880
|
+
body: task
|
|
301881
|
+
};
|
|
301882
|
+
});
|
|
301883
|
+
}
|
|
301884
|
+
registerProxyHandler({
|
|
301885
|
+
forgePath: "/api/cmmd/tasks/:id",
|
|
301886
|
+
method: "GET",
|
|
301887
|
+
parse: parseGetCmmdTaskRequest,
|
|
301888
|
+
run: runGetCmmdTask
|
|
301889
|
+
});
|
|
301537
301890
|
function extractIdFromPath(pathname, fromEnd) {
|
|
301538
301891
|
const parts = pathname.split("/").filter(Boolean);
|
|
301539
301892
|
return parts[parts.length - fromEnd];
|
|
@@ -301545,23 +301898,37 @@ function decodePathSegment(segment) {
|
|
|
301545
301898
|
return null;
|
|
301546
301899
|
}
|
|
301547
301900
|
}
|
|
301548
|
-
|
|
301549
|
-
|
|
301550
|
-
|
|
301551
|
-
|
|
301552
|
-
|
|
301553
|
-
|
|
301554
|
-
|
|
301901
|
+
function parseGetCmmdTaskCommentsRequest(request) {
|
|
301902
|
+
return require_Schema$1.sync(() => {
|
|
301903
|
+
const taskId = extractIdFromPath(new URL(request.url, "http://localhost").pathname, 2);
|
|
301904
|
+
return taskId ? {
|
|
301905
|
+
ok: true,
|
|
301906
|
+
value: taskId
|
|
301907
|
+
} : {
|
|
301908
|
+
ok: false,
|
|
301909
|
+
status: 400,
|
|
301910
|
+
body: { error: "Task ID is required." }
|
|
301911
|
+
};
|
|
301912
|
+
});
|
|
301913
|
+
}
|
|
301914
|
+
function runGetCmmdTaskComments(taskId, { session }) {
|
|
301915
|
+
return runCmmdRestProxyAsHandlerResult(session, (jwt) => cmmdGateway.listTaskComments({
|
|
301555
301916
|
jwt,
|
|
301556
301917
|
taskId
|
|
301557
|
-
}))
|
|
301558
|
-
|
|
301559
|
-
|
|
301560
|
-
|
|
301561
|
-
|
|
301562
|
-
|
|
301563
|
-
|
|
301564
|
-
}
|
|
301918
|
+
}), (value) => {
|
|
301919
|
+
const data = unwrapForgeEnvelope(value);
|
|
301920
|
+
return {
|
|
301921
|
+
status: 200,
|
|
301922
|
+
body: { comments: Array.isArray(data) ? data : [] }
|
|
301923
|
+
};
|
|
301924
|
+
});
|
|
301925
|
+
}
|
|
301926
|
+
registerProxyHandler({
|
|
301927
|
+
forgePath: "/api/cmmd/tasks/:id/comments",
|
|
301928
|
+
method: "GET",
|
|
301929
|
+
parse: parseGetCmmdTaskCommentsRequest,
|
|
301930
|
+
run: runGetCmmdTaskComments
|
|
301931
|
+
});
|
|
301565
301932
|
function normalizeCommentList(value) {
|
|
301566
301933
|
if (Array.isArray(value)) return value;
|
|
301567
301934
|
if (!value || typeof value !== "object") return [];
|
|
@@ -301667,55 +302034,54 @@ const cmmdUpdateProjectRouteLayer = add$1("PATCH", "/api/cmmd/projects/:id", req
|
|
|
301667
302034
|
project: outcome.value
|
|
301668
302035
|
}, { status: 200 });
|
|
301669
302036
|
}).pipe(require_Schema$1.catchTag("AuthError", (error) => respondToAuthError(error))));
|
|
301670
|
-
|
|
302037
|
+
registerProxyRoute({
|
|
301671
302038
|
forgePath: "/api/cmmd/projects/:id/repository",
|
|
301672
302039
|
method: "GET",
|
|
301673
302040
|
cmmdPath: "/api/forge/context/projects/:id/repository",
|
|
301674
302041
|
orgIdSource: "none",
|
|
301675
302042
|
responseShape: "unwrapData"
|
|
301676
302043
|
});
|
|
301677
|
-
|
|
301678
|
-
const cmmdListProjectRepositoriesRouteLayer = registerProxyRoute({
|
|
302044
|
+
registerProxyRoute({
|
|
301679
302045
|
forgePath: "/api/cmmd/projects/:projectId/repositories",
|
|
301680
302046
|
method: "GET",
|
|
301681
302047
|
cmmdPath: "/api/forge/context/projects/:projectId/repositories",
|
|
301682
302048
|
orgIdSource: "none",
|
|
301683
302049
|
responseShape: "unwrapData"
|
|
301684
302050
|
});
|
|
301685
|
-
|
|
302051
|
+
registerProxyRoute({
|
|
301686
302052
|
forgePath: "/api/cmmd/organizations/:id/members",
|
|
301687
302053
|
method: "GET",
|
|
301688
302054
|
cmmdPath: "/api/organizations/:id/members",
|
|
301689
302055
|
orgIdSource: "none",
|
|
301690
302056
|
responseShape: "unwrapData"
|
|
301691
302057
|
});
|
|
301692
|
-
|
|
302058
|
+
registerProxyRoute({
|
|
301693
302059
|
forgePath: "/api/cmmd/sim-host/hosts",
|
|
301694
302060
|
method: "GET",
|
|
301695
302061
|
cmmdPath: "/api/forge/context/sim-host/hosts",
|
|
301696
302062
|
responseShape: "unwrapData"
|
|
301697
302063
|
});
|
|
301698
|
-
|
|
302064
|
+
registerProxyRoute({
|
|
301699
302065
|
forgePath: "/api/cmmd/sim-host/leases",
|
|
301700
302066
|
method: "GET",
|
|
301701
302067
|
cmmdPath: "/api/forge/context/sim-host/leases",
|
|
301702
302068
|
responseShape: "unwrapData"
|
|
301703
302069
|
});
|
|
301704
|
-
|
|
302070
|
+
registerProxyRoute({
|
|
301705
302071
|
forgePath: "/api/cmmd/sim-host/leases",
|
|
301706
302072
|
method: "POST",
|
|
301707
302073
|
cmmdPath: "/api/forge/context/sim-host/leases",
|
|
301708
302074
|
responseShape: "unwrapData",
|
|
301709
302075
|
successStatus: 200
|
|
301710
302076
|
});
|
|
301711
|
-
|
|
302077
|
+
registerProxyRoute({
|
|
301712
302078
|
forgePath: "/api/cmmd/sim-host/leases/:leaseId/release",
|
|
301713
302079
|
method: "POST",
|
|
301714
302080
|
cmmdPath: "/api/forge/context/sim-host/leases/:leaseId/release",
|
|
301715
302081
|
responseShape: "unwrapData",
|
|
301716
302082
|
successStatus: 200
|
|
301717
302083
|
});
|
|
301718
|
-
|
|
302084
|
+
registerProxyRoute({
|
|
301719
302085
|
forgePath: "/api/cmmd/sim-host/leases/:leaseId/renew",
|
|
301720
302086
|
method: "POST",
|
|
301721
302087
|
cmmdPath: "/api/forge/context/sim-host/leases/:leaseId/renew",
|
|
@@ -301739,7 +302105,7 @@ function getMultipartContentType(headers) {
|
|
|
301739
302105
|
const contentType = headers["content-type"] ?? "";
|
|
301740
302106
|
return contentType.includes("multipart/form-data") ? contentType : null;
|
|
301741
302107
|
}
|
|
301742
|
-
|
|
302108
|
+
registerProxyRoute({
|
|
301743
302109
|
forgePath: "/api/cmmd/tasks/:id/attachments",
|
|
301744
302110
|
method: "GET",
|
|
301745
302111
|
cmmdPath: "/api/forge/context/tasks/:id/attachments",
|
|
@@ -301774,150 +302140,150 @@ const cmmdUpdateTaskCommentRouteLayer = add$1("PATCH", "/api/cmmd/tasks/:taskId/
|
|
|
301774
302140
|
...outcome.value
|
|
301775
302141
|
}, { status: 200 });
|
|
301776
302142
|
}).pipe(require_Schema$1.catchTag("AuthError", (error) => respondToAuthError(error))));
|
|
301777
|
-
|
|
302143
|
+
registerProxyRoute({
|
|
301778
302144
|
forgePath: "/api/cmmd/tasks/:taskId/comments/:commentId",
|
|
301779
302145
|
method: "DELETE",
|
|
301780
302146
|
cmmdPath: "/api/forge/context/tasks/:taskId/comments/:commentId",
|
|
301781
302147
|
orgIdSource: "none",
|
|
301782
302148
|
requestBody: "json"
|
|
301783
302149
|
});
|
|
301784
|
-
|
|
302150
|
+
registerProxyRoute({
|
|
301785
302151
|
forgePath: "/api/cmmd/projects/:projectId/agent-members",
|
|
301786
302152
|
method: "GET",
|
|
301787
302153
|
cmmdPath: "/api/forge/context/projects/:projectId/agent-members",
|
|
301788
302154
|
orgIdSource: "none",
|
|
301789
302155
|
responseShape: "unwrapData"
|
|
301790
302156
|
});
|
|
301791
|
-
|
|
302157
|
+
registerProxyRoute({
|
|
301792
302158
|
forgePath: "/api/cmmd/projects/:projectId/agent-members",
|
|
301793
302159
|
method: "POST",
|
|
301794
302160
|
cmmdPath: "/api/forge/context/projects/:projectId/agent-members",
|
|
301795
302161
|
orgIdSource: "none",
|
|
301796
302162
|
responseShape: "unwrapData"
|
|
301797
302163
|
});
|
|
301798
|
-
|
|
302164
|
+
registerProxyRoute({
|
|
301799
302165
|
forgePath: "/api/cmmd/projects/:projectId/agent-members/:memberId",
|
|
301800
302166
|
method: "GET",
|
|
301801
302167
|
cmmdPath: "/api/forge/context/projects/:projectId/agent-members/:memberId",
|
|
301802
302168
|
orgIdSource: "none",
|
|
301803
302169
|
responseShape: "unwrapData"
|
|
301804
302170
|
});
|
|
301805
|
-
|
|
302171
|
+
registerProxyRoute({
|
|
301806
302172
|
forgePath: "/api/cmmd/projects/:projectId/agent-members/:memberId",
|
|
301807
302173
|
method: "PATCH",
|
|
301808
302174
|
cmmdPath: "/api/forge/context/projects/:projectId/agent-members/:memberId",
|
|
301809
302175
|
orgIdSource: "none",
|
|
301810
302176
|
responseShape: "unwrapData"
|
|
301811
302177
|
});
|
|
301812
|
-
|
|
302178
|
+
registerProxyRoute({
|
|
301813
302179
|
forgePath: "/api/cmmd/projects/:projectId/agent-members/:memberId/retire",
|
|
301814
302180
|
method: "POST",
|
|
301815
302181
|
cmmdPath: "/api/forge/context/projects/:projectId/agent-members/:memberId/retire",
|
|
301816
302182
|
orgIdSource: "none",
|
|
301817
302183
|
responseShape: "unwrapData"
|
|
301818
302184
|
});
|
|
301819
|
-
|
|
302185
|
+
registerProxyRoute({
|
|
301820
302186
|
forgePath: "/api/cmmd/projects/:projectId/agent-members/:memberId/instances",
|
|
301821
302187
|
method: "GET",
|
|
301822
302188
|
cmmdPath: "/api/forge/context/projects/:projectId/agent-members/:memberId/instances",
|
|
301823
302189
|
orgIdSource: "none",
|
|
301824
302190
|
responseShape: "unwrapData"
|
|
301825
302191
|
});
|
|
301826
|
-
|
|
302192
|
+
registerProxyRoute({
|
|
301827
302193
|
forgePath: "/api/cmmd/projects/:projectId/agent-members/consolidation/preview",
|
|
301828
302194
|
method: "POST",
|
|
301829
302195
|
cmmdPath: "/api/forge/context/projects/:projectId/agent-members/consolidation/preview",
|
|
301830
302196
|
orgIdSource: "none",
|
|
301831
302197
|
responseShape: "unwrapData"
|
|
301832
302198
|
});
|
|
301833
|
-
|
|
302199
|
+
registerProxyRoute({
|
|
301834
302200
|
forgePath: "/api/cmmd/projects/:projectId/agent-members/consolidation/apply",
|
|
301835
302201
|
method: "POST",
|
|
301836
302202
|
cmmdPath: "/api/forge/context/projects/:projectId/agent-members/consolidation/apply",
|
|
301837
302203
|
orgIdSource: "none",
|
|
301838
302204
|
responseShape: "unwrapData"
|
|
301839
302205
|
});
|
|
301840
|
-
|
|
302206
|
+
registerProxyRoute({
|
|
301841
302207
|
forgePath: "/api/cmmd/projects/:projectId/tasks/:taskId/assignment",
|
|
301842
302208
|
method: "PUT",
|
|
301843
302209
|
cmmdPath: "/api/forge/context/projects/:projectId/tasks/:taskId/assignment",
|
|
301844
302210
|
orgIdSource: "none",
|
|
301845
302211
|
responseShape: "unwrapData"
|
|
301846
302212
|
});
|
|
301847
|
-
|
|
302213
|
+
registerProxyRoute({
|
|
301848
302214
|
forgePath: "/api/cmmd/tasks",
|
|
301849
302215
|
method: "GET",
|
|
301850
302216
|
cmmdPath: "/api/forge/context/tasks"
|
|
301851
302217
|
});
|
|
301852
|
-
|
|
302218
|
+
registerProxyRoute({
|
|
301853
302219
|
forgePath: "/api/cmmd/tasks",
|
|
301854
302220
|
method: "POST",
|
|
301855
302221
|
cmmdPath: "/api/forge/context/tasks"
|
|
301856
302222
|
});
|
|
301857
|
-
|
|
302223
|
+
registerProxyRoute({
|
|
301858
302224
|
forgePath: "/api/cmmd/tasks/:id/archive",
|
|
301859
302225
|
method: "POST",
|
|
301860
302226
|
cmmdPath: "/api/forge/context/tasks/:id/archive",
|
|
301861
302227
|
orgIdSource: "none"
|
|
301862
302228
|
});
|
|
301863
|
-
|
|
302229
|
+
registerProxyRoute({
|
|
301864
302230
|
forgePath: "/api/cmmd/tasks/:id/unarchive",
|
|
301865
302231
|
method: "POST",
|
|
301866
302232
|
cmmdPath: "/api/forge/context/tasks/:id/unarchive",
|
|
301867
302233
|
orgIdSource: "none"
|
|
301868
302234
|
});
|
|
301869
|
-
|
|
302235
|
+
registerProxyRoute({
|
|
301870
302236
|
forgePath: "/api/cmmd/saved-views",
|
|
301871
302237
|
method: "GET",
|
|
301872
302238
|
cmmdPath: "/api/forge/context/saved-views",
|
|
301873
302239
|
orgIdSource: "none"
|
|
301874
302240
|
});
|
|
301875
|
-
|
|
302241
|
+
registerProxyRoute({
|
|
301876
302242
|
forgePath: "/api/cmmd/saved-views",
|
|
301877
302243
|
method: "POST",
|
|
301878
302244
|
cmmdPath: "/api/forge/context/saved-views",
|
|
301879
302245
|
orgIdSource: "none",
|
|
301880
302246
|
successStatus: 201
|
|
301881
302247
|
});
|
|
301882
|
-
|
|
302248
|
+
registerProxyRoute({
|
|
301883
302249
|
forgePath: "/api/cmmd/saved-views/import",
|
|
301884
302250
|
method: "POST",
|
|
301885
302251
|
cmmdPath: "/api/forge/context/saved-views/import",
|
|
301886
302252
|
orgIdSource: "none"
|
|
301887
302253
|
});
|
|
301888
|
-
|
|
302254
|
+
registerProxyRoute({
|
|
301889
302255
|
forgePath: "/api/cmmd/saved-views/:viewId",
|
|
301890
302256
|
method: "PATCH",
|
|
301891
302257
|
cmmdPath: "/api/forge/context/saved-views/:viewId",
|
|
301892
302258
|
orgIdSource: "none"
|
|
301893
302259
|
});
|
|
301894
|
-
|
|
302260
|
+
registerProxyRoute({
|
|
301895
302261
|
forgePath: "/api/cmmd/saved-views/:viewId",
|
|
301896
302262
|
method: "DELETE",
|
|
301897
302263
|
cmmdPath: "/api/forge/context/saved-views/:viewId",
|
|
301898
302264
|
orgIdSource: "none",
|
|
301899
302265
|
forwardSearchParams: true
|
|
301900
302266
|
});
|
|
301901
|
-
|
|
302267
|
+
registerProxyRoute({
|
|
301902
302268
|
forgePath: "/api/cmmd/projects",
|
|
301903
302269
|
method: "GET",
|
|
301904
302270
|
cmmdPath: "/api/forge/context/projects",
|
|
301905
302271
|
responseShape: "passthrough"
|
|
301906
302272
|
});
|
|
301907
|
-
|
|
302273
|
+
registerProxyRoute({
|
|
301908
302274
|
forgePath: "/api/cmmd/projects/:id",
|
|
301909
302275
|
method: "GET",
|
|
301910
302276
|
cmmdPath: "/api/forge/context/projects/:id",
|
|
301911
302277
|
orgIdSource: "none",
|
|
301912
302278
|
responseShape: "passthrough"
|
|
301913
302279
|
});
|
|
301914
|
-
|
|
302280
|
+
registerProxyRoute({
|
|
301915
302281
|
forgePath: "/api/cmmd/projects",
|
|
301916
302282
|
method: "POST",
|
|
301917
302283
|
cmmdPath: "/api/projects",
|
|
301918
302284
|
responseShape: "passthrough"
|
|
301919
302285
|
});
|
|
301920
|
-
|
|
302286
|
+
registerProxyRoute({
|
|
301921
302287
|
forgePath: "/api/cmmd/projects/:id",
|
|
301922
302288
|
method: "DELETE",
|
|
301923
302289
|
cmmdPath: "/api/forge/context/projects/:id",
|
|
@@ -301925,78 +302291,78 @@ const cmmdDeleteProjectRouteLayer = registerProxyRoute({
|
|
|
301925
302291
|
fixedSearchParams: { soft: "false" },
|
|
301926
302292
|
workIntakeInvalidation: "always"
|
|
301927
302293
|
});
|
|
301928
|
-
|
|
302294
|
+
registerProxyRoute({
|
|
301929
302295
|
forgePath: "/api/cmmd/projects/:id/move",
|
|
301930
302296
|
method: "POST",
|
|
301931
302297
|
cmmdPath: "/api/forge/context/projects/:id/move",
|
|
301932
302298
|
orgIdSource: "none",
|
|
301933
302299
|
responseShape: "unwrapData"
|
|
301934
302300
|
});
|
|
301935
|
-
|
|
302301
|
+
registerProxyRoute({
|
|
301936
302302
|
forgePath: "/api/cmmd/projects/:id/members",
|
|
301937
302303
|
method: "GET",
|
|
301938
302304
|
cmmdPath: "/api/forge/context/projects/:id/team"
|
|
301939
302305
|
});
|
|
301940
|
-
|
|
302306
|
+
registerProxyRoute({
|
|
301941
302307
|
forgePath: "/api/cmmd/projects/:id/milestones",
|
|
301942
302308
|
method: "GET",
|
|
301943
302309
|
cmmdPath: "/api/forge/context/projects/:id/milestones"
|
|
301944
302310
|
});
|
|
301945
|
-
|
|
302311
|
+
registerProxyRoute({
|
|
301946
302312
|
forgePath: "/api/cmmd/projects/:id/milestones",
|
|
301947
302313
|
method: "POST",
|
|
301948
302314
|
cmmdPath: "/api/forge/context/projects/:id/milestones",
|
|
301949
302315
|
orgIdSource: "none",
|
|
301950
302316
|
responseShape: "unwrapData"
|
|
301951
302317
|
});
|
|
301952
|
-
|
|
302318
|
+
registerProxyRoute({
|
|
301953
302319
|
forgePath: "/api/cmmd/projects/:id/milestones/:milestoneId",
|
|
301954
302320
|
method: "PATCH",
|
|
301955
302321
|
cmmdPath: "/api/forge/context/projects/:id/milestones/:milestoneId",
|
|
301956
302322
|
orgIdSource: "none",
|
|
301957
302323
|
responseShape: "unwrapData"
|
|
301958
302324
|
});
|
|
301959
|
-
|
|
302325
|
+
registerProxyRoute({
|
|
301960
302326
|
forgePath: "/api/cmmd/projects/:id/milestones/:milestoneId",
|
|
301961
302327
|
method: "DELETE",
|
|
301962
302328
|
cmmdPath: "/api/forge/context/projects/:id/milestones/:milestoneId",
|
|
301963
302329
|
orgIdSource: "none"
|
|
301964
302330
|
});
|
|
301965
|
-
|
|
302331
|
+
registerProxyRoute({
|
|
301966
302332
|
forgePath: "/api/cmmd/projects/:id/updates",
|
|
301967
302333
|
method: "GET",
|
|
301968
302334
|
cmmdPath: "/api/forge/context/projects/:id/updates",
|
|
301969
302335
|
orgIdSource: "none",
|
|
301970
302336
|
responseShape: "passthrough"
|
|
301971
302337
|
});
|
|
301972
|
-
|
|
302338
|
+
registerProxyRoute({
|
|
301973
302339
|
forgePath: "/api/cmmd/projects/:id/updates",
|
|
301974
302340
|
method: "POST",
|
|
301975
302341
|
cmmdPath: "/api/forge/context/projects/:id/updates",
|
|
301976
302342
|
orgIdSource: "none",
|
|
301977
302343
|
responseShape: "unwrapData"
|
|
301978
302344
|
});
|
|
301979
|
-
|
|
302345
|
+
registerProxyRoute({
|
|
301980
302346
|
forgePath: "/api/cmmd/projects/:id/updates/:updateId",
|
|
301981
302347
|
method: "PATCH",
|
|
301982
302348
|
cmmdPath: "/api/forge/context/projects/:id/updates/:updateId",
|
|
301983
302349
|
orgIdSource: "none",
|
|
301984
302350
|
responseShape: "unwrapData"
|
|
301985
302351
|
});
|
|
301986
|
-
|
|
302352
|
+
registerProxyRoute({
|
|
301987
302353
|
forgePath: "/api/cmmd/projects/:id/updates/:updateId",
|
|
301988
302354
|
method: "DELETE",
|
|
301989
302355
|
cmmdPath: "/api/forge/context/projects/:id/updates/:updateId",
|
|
301990
302356
|
orgIdSource: "none"
|
|
301991
302357
|
});
|
|
301992
|
-
|
|
302358
|
+
registerProxyRoute({
|
|
301993
302359
|
forgePath: "/api/cmmd/projects/:id/content/readability",
|
|
301994
302360
|
method: "POST",
|
|
301995
302361
|
cmmdPath: "/api/forge/context/projects/:id/content/readability",
|
|
301996
302362
|
orgIdSource: "none",
|
|
301997
302363
|
responseShape: "unwrapData"
|
|
301998
302364
|
});
|
|
301999
|
-
|
|
302365
|
+
registerProxyRoute({
|
|
302000
302366
|
forgePath: "/api/cmmd/projects/:projectId/task-drafts",
|
|
302001
302367
|
method: "POST",
|
|
302002
302368
|
cmmdPath: "/api/forge/context/projects/:projectId/task-drafts",
|
|
@@ -302004,7 +302370,7 @@ const cmmdCreateProjectTaskDraftRouteLayer = registerProxyRoute({
|
|
|
302004
302370
|
responseShape: "unwrapData",
|
|
302005
302371
|
successStatus: 201
|
|
302006
302372
|
});
|
|
302007
|
-
|
|
302373
|
+
registerProxyRoute({
|
|
302008
302374
|
forgePath: "/api/cmmd/projects/:projectId/task-drafts/:draftId",
|
|
302009
302375
|
method: "GET",
|
|
302010
302376
|
cmmdPath: "/api/forge/context/projects/:projectId/task-drafts/:draftId",
|
|
@@ -302012,7 +302378,7 @@ const cmmdGetProjectTaskDraftRouteLayer = registerProxyRoute({
|
|
|
302012
302378
|
responseShape: "unwrapData",
|
|
302013
302379
|
successStatus: 200
|
|
302014
302380
|
});
|
|
302015
|
-
|
|
302381
|
+
registerProxyRoute({
|
|
302016
302382
|
forgePath: "/api/cmmd/projects/:projectId/task-drafts/:draftId",
|
|
302017
302383
|
method: "PATCH",
|
|
302018
302384
|
cmmdPath: "/api/forge/context/projects/:projectId/task-drafts/:draftId",
|
|
@@ -302020,7 +302386,7 @@ const cmmdUpdateProjectTaskDraftRouteLayer = registerProxyRoute({
|
|
|
302020
302386
|
responseShape: "unwrapData",
|
|
302021
302387
|
successStatus: 200
|
|
302022
302388
|
});
|
|
302023
|
-
|
|
302389
|
+
registerProxyRoute({
|
|
302024
302390
|
forgePath: "/api/cmmd/projects/:projectId/task-drafts/:draftId/preview",
|
|
302025
302391
|
method: "POST",
|
|
302026
302392
|
cmmdPath: "/api/forge/context/projects/:projectId/task-drafts/:draftId/preview",
|
|
@@ -302028,7 +302394,7 @@ const cmmdPreviewProjectTaskDraftRouteLayer = registerProxyRoute({
|
|
|
302028
302394
|
responseShape: "unwrapData",
|
|
302029
302395
|
successStatus: 200
|
|
302030
302396
|
});
|
|
302031
|
-
|
|
302397
|
+
registerProxyRoute({
|
|
302032
302398
|
forgePath: "/api/cmmd/projects/:projectId/task-drafts/:draftId/commit",
|
|
302033
302399
|
method: "POST",
|
|
302034
302400
|
cmmdPath: "/api/forge/context/projects/:projectId/task-drafts/:draftId/commit",
|
|
@@ -302036,7 +302402,7 @@ const cmmdCommitProjectTaskDraftRouteLayer = registerProxyRoute({
|
|
|
302036
302402
|
responseShape: "unwrapData",
|
|
302037
302403
|
successStatus: 200
|
|
302038
302404
|
});
|
|
302039
|
-
|
|
302405
|
+
registerProxyRoute({
|
|
302040
302406
|
forgePath: "/api/cmmd/projects/:projectId/task-drafts/:draftId/discard",
|
|
302041
302407
|
method: "POST",
|
|
302042
302408
|
cmmdPath: "/api/forge/context/projects/:projectId/task-drafts/:draftId/discard",
|
|
@@ -302044,352 +302410,352 @@ const cmmdDiscardProjectTaskDraftRouteLayer = registerProxyRoute({
|
|
|
302044
302410
|
responseShape: "unwrapData",
|
|
302045
302411
|
successStatus: 200
|
|
302046
302412
|
});
|
|
302047
|
-
|
|
302413
|
+
registerProxyRoute({
|
|
302048
302414
|
forgePath: "/api/cmmd/projects/:projectId/project-lead/plan",
|
|
302049
302415
|
method: "GET",
|
|
302050
302416
|
cmmdPath: "/api/forge/context/projects/:projectId/project-lead/plan",
|
|
302051
302417
|
orgIdSource: "none"
|
|
302052
302418
|
});
|
|
302053
|
-
|
|
302419
|
+
registerProxyRoute({
|
|
302054
302420
|
forgePath: "/api/cmmd/projects/:projectId/project-lead/authority/activate",
|
|
302055
302421
|
method: "POST",
|
|
302056
302422
|
cmmdPath: "/api/forge/context/projects/:projectId/project-lead/authority/activate",
|
|
302057
302423
|
orgIdSource: "none",
|
|
302058
302424
|
responseShape: "unwrapData"
|
|
302059
302425
|
});
|
|
302060
|
-
|
|
302426
|
+
registerProxyRoute({
|
|
302061
302427
|
forgePath: "/api/cmmd/projects/:projectId/project-lead/readiness",
|
|
302062
302428
|
method: "GET",
|
|
302063
302429
|
cmmdPath: "/api/forge/context/projects/:projectId/project-lead/readiness",
|
|
302064
302430
|
orgIdSource: "none"
|
|
302065
302431
|
});
|
|
302066
|
-
|
|
302432
|
+
registerProxyRoute({
|
|
302067
302433
|
forgePath: "/api/cmmd/projects/:projectId/project-lead/capabilities",
|
|
302068
302434
|
method: "GET",
|
|
302069
302435
|
cmmdPath: "/api/forge/context/projects/:projectId/project-lead/capabilities",
|
|
302070
302436
|
orgIdSource: "none"
|
|
302071
302437
|
});
|
|
302072
|
-
|
|
302438
|
+
registerProxyRoute({
|
|
302073
302439
|
forgePath: "/api/cmmd/projects/:projectId/project-lead/summary",
|
|
302074
302440
|
method: "GET",
|
|
302075
302441
|
cmmdPath: "/api/forge/context/projects/:projectId/project-lead/summary",
|
|
302076
302442
|
orgIdSource: "none"
|
|
302077
302443
|
});
|
|
302078
|
-
|
|
302444
|
+
registerProxyRoute({
|
|
302079
302445
|
forgePath: "/api/cmmd/projects/:projectId/project-lead/detail",
|
|
302080
302446
|
method: "GET",
|
|
302081
302447
|
cmmdPath: "/api/forge/context/projects/:projectId/project-lead/detail",
|
|
302082
302448
|
orgIdSource: "none"
|
|
302083
302449
|
});
|
|
302084
|
-
|
|
302450
|
+
registerProxyRoute({
|
|
302085
302451
|
forgePath: "/api/cmmd/projects/:projectId/project-lead/briefing",
|
|
302086
302452
|
method: "GET",
|
|
302087
302453
|
cmmdPath: "/api/forge/context/projects/:projectId/project-lead/briefing",
|
|
302088
302454
|
orgIdSource: "none"
|
|
302089
302455
|
});
|
|
302090
|
-
|
|
302456
|
+
registerProxyRoute({
|
|
302091
302457
|
forgePath: "/api/cmmd/projects/:projectId/project-lead/events",
|
|
302092
302458
|
method: "GET",
|
|
302093
302459
|
cmmdPath: "/api/forge/context/projects/:projectId/project-lead/events",
|
|
302094
302460
|
orgIdSource: "none"
|
|
302095
302461
|
});
|
|
302096
|
-
|
|
302462
|
+
registerProxyRoute({
|
|
302097
302463
|
forgePath: "/api/cmmd/projects/:projectId/project-lead/explain",
|
|
302098
302464
|
method: "GET",
|
|
302099
302465
|
cmmdPath: "/api/forge/context/projects/:projectId/project-lead/explain",
|
|
302100
302466
|
orgIdSource: "none"
|
|
302101
302467
|
});
|
|
302102
|
-
|
|
302468
|
+
registerProxyRoute({
|
|
302103
302469
|
forgePath: "/api/cmmd/projects/:projectId/project-lead/pause",
|
|
302104
302470
|
method: "POST",
|
|
302105
302471
|
cmmdPath: "/api/forge/context/projects/:projectId/project-lead/pause",
|
|
302106
302472
|
orgIdSource: "none"
|
|
302107
302473
|
});
|
|
302108
|
-
|
|
302474
|
+
registerProxyRoute({
|
|
302109
302475
|
forgePath: "/api/cmmd/projects/:projectId/project-lead/resume",
|
|
302110
302476
|
method: "POST",
|
|
302111
302477
|
cmmdPath: "/api/forge/context/projects/:projectId/project-lead/resume",
|
|
302112
302478
|
orgIdSource: "none"
|
|
302113
302479
|
});
|
|
302114
|
-
|
|
302480
|
+
registerProxyRoute({
|
|
302115
302481
|
forgePath: "/api/cmmd/projects/:projectId/project-lead/tasks/:taskId/reservations",
|
|
302116
302482
|
method: "POST",
|
|
302117
302483
|
cmmdPath: "/api/forge/context/projects/:projectId/project-lead/tasks/:taskId/reservations",
|
|
302118
302484
|
orgIdSource: "none"
|
|
302119
302485
|
});
|
|
302120
|
-
|
|
302486
|
+
registerProxyRoute({
|
|
302121
302487
|
forgePath: "/api/cmmd/projects/:projectId/project-lead/reservations/:reservationId/release",
|
|
302122
302488
|
method: "POST",
|
|
302123
302489
|
cmmdPath: "/api/forge/context/projects/:projectId/project-lead/reservations/:reservationId/release",
|
|
302124
302490
|
orgIdSource: "none"
|
|
302125
302491
|
});
|
|
302126
|
-
|
|
302492
|
+
registerProxyRoute({
|
|
302127
302493
|
forgePath: "/api/cmmd/projects/:projectId/project-lead/reconcile",
|
|
302128
302494
|
method: "POST",
|
|
302129
302495
|
cmmdPath: "/api/forge/context/projects/:projectId/project-lead/reconcile",
|
|
302130
302496
|
orgIdSource: "none"
|
|
302131
302497
|
});
|
|
302132
|
-
|
|
302498
|
+
registerProxyRoute({
|
|
302133
302499
|
forgePath: "/api/cmmd/projects/:projectId/project-lead/attention/:attentionId/resolve",
|
|
302134
302500
|
method: "POST",
|
|
302135
302501
|
cmmdPath: "/api/forge/context/projects/:projectId/project-lead/attention/:attentionId/resolve",
|
|
302136
302502
|
orgIdSource: "none"
|
|
302137
302503
|
});
|
|
302138
|
-
|
|
302504
|
+
registerProxyRoute({
|
|
302139
302505
|
forgePath: "/api/cmmd/projects/:projectId/project-lead/controller/claim",
|
|
302140
302506
|
method: "POST",
|
|
302141
302507
|
cmmdPath: "/api/forge/context/projects/:projectId/project-lead/controller/claim",
|
|
302142
302508
|
orgIdSource: "none"
|
|
302143
302509
|
});
|
|
302144
|
-
|
|
302510
|
+
registerProxyRoute({
|
|
302145
302511
|
forgePath: "/api/cmmd/projects/:projectId/project-lead/controller/claim/renew",
|
|
302146
302512
|
method: "POST",
|
|
302147
302513
|
cmmdPath: "/api/forge/context/projects/:projectId/project-lead/controller/claim/renew",
|
|
302148
302514
|
orgIdSource: "none"
|
|
302149
302515
|
});
|
|
302150
|
-
|
|
302516
|
+
registerProxyRoute({
|
|
302151
302517
|
forgePath: "/api/cmmd/projects/:projectId/project-lead/controller/claim/yield",
|
|
302152
302518
|
method: "POST",
|
|
302153
302519
|
cmmdPath: "/api/forge/context/projects/:projectId/project-lead/controller/claim/yield",
|
|
302154
302520
|
orgIdSource: "none"
|
|
302155
302521
|
});
|
|
302156
|
-
|
|
302522
|
+
registerProxyRoute({
|
|
302157
302523
|
forgePath: "/api/cmmd/projects/:projectId/project-lead/controller/events/:eventId/acknowledge",
|
|
302158
302524
|
method: "POST",
|
|
302159
302525
|
cmmdPath: "/api/forge/context/projects/:projectId/project-lead/controller/events/:eventId/acknowledge",
|
|
302160
302526
|
orgIdSource: "none"
|
|
302161
302527
|
});
|
|
302162
|
-
|
|
302528
|
+
registerProxyRoute({
|
|
302163
302529
|
forgePath: "/api/cmmd/projects/:projectId/project-lead/controller/decisions",
|
|
302164
302530
|
method: "POST",
|
|
302165
302531
|
cmmdPath: "/api/forge/context/projects/:projectId/project-lead/controller/decisions",
|
|
302166
302532
|
orgIdSource: "none"
|
|
302167
302533
|
});
|
|
302168
|
-
|
|
302534
|
+
registerProxyRoute({
|
|
302169
302535
|
forgePath: "/api/cmmd/automations/presets",
|
|
302170
302536
|
method: "GET",
|
|
302171
302537
|
cmmdPath: "/api/forge/context/automations/presets",
|
|
302172
302538
|
orgIdSource: "none",
|
|
302173
302539
|
responseShape: "unwrapData"
|
|
302174
302540
|
});
|
|
302175
|
-
|
|
302541
|
+
registerProxyRoute({
|
|
302176
302542
|
forgePath: "/api/cmmd/automations/user/rules",
|
|
302177
302543
|
method: "GET",
|
|
302178
302544
|
cmmdPath: "/api/forge/context/automations/user/rules",
|
|
302179
302545
|
orgIdSource: "none",
|
|
302180
302546
|
responseShape: "unwrapData"
|
|
302181
302547
|
});
|
|
302182
|
-
|
|
302548
|
+
registerProxyRoute({
|
|
302183
302549
|
forgePath: "/api/cmmd/automations/user/rules",
|
|
302184
302550
|
method: "POST",
|
|
302185
302551
|
cmmdPath: "/api/forge/context/automations/user/rules",
|
|
302186
302552
|
orgIdSource: "none",
|
|
302187
302553
|
responseShape: "unwrapData"
|
|
302188
302554
|
});
|
|
302189
|
-
|
|
302555
|
+
registerProxyRoute({
|
|
302190
302556
|
forgePath: "/api/cmmd/automations/user/rules/:ruleId",
|
|
302191
302557
|
method: "PATCH",
|
|
302192
302558
|
cmmdPath: "/api/forge/context/automations/user/rules/:ruleId",
|
|
302193
302559
|
orgIdSource: "none",
|
|
302194
302560
|
responseShape: "unwrapData"
|
|
302195
302561
|
});
|
|
302196
|
-
|
|
302562
|
+
registerProxyRoute({
|
|
302197
302563
|
forgePath: "/api/cmmd/automations/user/rules/:ruleId/runs",
|
|
302198
302564
|
method: "GET",
|
|
302199
302565
|
cmmdPath: "/api/forge/context/automations/user/rules/:ruleId/runs",
|
|
302200
302566
|
orgIdSource: "none",
|
|
302201
302567
|
responseShape: "unwrapData"
|
|
302202
302568
|
});
|
|
302203
|
-
|
|
302569
|
+
registerProxyRoute({
|
|
302204
302570
|
forgePath: "/api/cmmd/automations/user/rules/:ruleId/runs",
|
|
302205
302571
|
method: "POST",
|
|
302206
302572
|
cmmdPath: "/api/forge/context/automations/user/rules/:ruleId/runs",
|
|
302207
302573
|
orgIdSource: "none",
|
|
302208
302574
|
responseShape: "unwrapData"
|
|
302209
302575
|
});
|
|
302210
|
-
|
|
302576
|
+
registerProxyRoute({
|
|
302211
302577
|
forgePath: "/api/cmmd/automations/projects/:projectId/rules",
|
|
302212
302578
|
method: "GET",
|
|
302213
302579
|
cmmdPath: "/api/forge/context/automations/projects/:projectId/rules",
|
|
302214
302580
|
orgIdSource: "query",
|
|
302215
302581
|
responseShape: "unwrapData"
|
|
302216
302582
|
});
|
|
302217
|
-
|
|
302583
|
+
registerProxyRoute({
|
|
302218
302584
|
forgePath: "/api/cmmd/automations/projects/:projectId/rules",
|
|
302219
302585
|
method: "POST",
|
|
302220
302586
|
cmmdPath: "/api/forge/context/automations/projects/:projectId/rules",
|
|
302221
302587
|
orgIdSource: "query",
|
|
302222
302588
|
responseShape: "unwrapData"
|
|
302223
302589
|
});
|
|
302224
|
-
|
|
302590
|
+
registerProxyRoute({
|
|
302225
302591
|
forgePath: "/api/cmmd/automations/projects/:projectId/rules/:ruleId",
|
|
302226
302592
|
method: "PATCH",
|
|
302227
302593
|
cmmdPath: "/api/forge/context/automations/projects/:projectId/rules/:ruleId",
|
|
302228
302594
|
orgIdSource: "query",
|
|
302229
302595
|
responseShape: "unwrapData"
|
|
302230
302596
|
});
|
|
302231
|
-
|
|
302597
|
+
registerProxyRoute({
|
|
302232
302598
|
forgePath: "/api/cmmd/automations/projects/:projectId/runs",
|
|
302233
302599
|
method: "GET",
|
|
302234
302600
|
cmmdPath: "/api/forge/context/automations/projects/:projectId/runs",
|
|
302235
302601
|
orgIdSource: "query",
|
|
302236
302602
|
responseShape: "unwrapData"
|
|
302237
302603
|
});
|
|
302238
|
-
|
|
302604
|
+
registerProxyRoute({
|
|
302239
302605
|
forgePath: "/api/cmmd/automations/projects/:projectId/tasks/:taskId/runs",
|
|
302240
302606
|
method: "POST",
|
|
302241
302607
|
cmmdPath: "/api/forge/context/automations/projects/:projectId/tasks/:taskId/runs",
|
|
302242
302608
|
orgIdSource: "query",
|
|
302243
302609
|
responseShape: "unwrapData"
|
|
302244
302610
|
});
|
|
302245
|
-
|
|
302611
|
+
registerProxyRoute({
|
|
302246
302612
|
forgePath: "/api/cmmd/automations/runs/:runId",
|
|
302247
302613
|
method: "GET",
|
|
302248
302614
|
cmmdPath: "/api/forge/context/automations/runs/:runId",
|
|
302249
302615
|
orgIdSource: "query",
|
|
302250
302616
|
responseShape: "unwrapData"
|
|
302251
302617
|
});
|
|
302252
|
-
|
|
302618
|
+
registerProxyRoute({
|
|
302253
302619
|
forgePath: "/api/cmmd/automations/runs/:runId/retry",
|
|
302254
302620
|
method: "POST",
|
|
302255
302621
|
cmmdPath: "/api/forge/context/automations/runs/:runId/retry",
|
|
302256
302622
|
orgIdSource: "query",
|
|
302257
302623
|
responseShape: "unwrapData"
|
|
302258
302624
|
});
|
|
302259
|
-
|
|
302625
|
+
registerProxyRoute({
|
|
302260
302626
|
forgePath: "/api/cmmd/automations/runs/:runId/cancel",
|
|
302261
302627
|
method: "POST",
|
|
302262
302628
|
cmmdPath: "/api/forge/context/automations/runs/:runId/cancel",
|
|
302263
302629
|
orgIdSource: "query",
|
|
302264
302630
|
responseShape: "unwrapData"
|
|
302265
302631
|
});
|
|
302266
|
-
|
|
302632
|
+
registerProxyRoute({
|
|
302267
302633
|
forgePath: "/api/cmmd/automations/runs/:runId/escalations/approve",
|
|
302268
302634
|
method: "POST",
|
|
302269
302635
|
cmmdPath: "/api/forge/context/automations/runs/:runId/escalations/approve",
|
|
302270
302636
|
orgIdSource: "query",
|
|
302271
302637
|
responseShape: "unwrapData"
|
|
302272
302638
|
});
|
|
302273
|
-
|
|
302639
|
+
registerProxyRoute({
|
|
302274
302640
|
forgePath: "/api/cmmd/automations/runs/:runId/escalations/reject",
|
|
302275
302641
|
method: "POST",
|
|
302276
302642
|
cmmdPath: "/api/forge/context/automations/runs/:runId/escalations/reject",
|
|
302277
302643
|
orgIdSource: "query",
|
|
302278
302644
|
responseShape: "unwrapData"
|
|
302279
302645
|
});
|
|
302280
|
-
|
|
302646
|
+
registerProxyRoute({
|
|
302281
302647
|
forgePath: "/api/cmmd/projects/:id/board",
|
|
302282
302648
|
method: "GET",
|
|
302283
302649
|
cmmdPath: "/api/forge/context/projects/:id/board",
|
|
302284
302650
|
orgIdSource: "none",
|
|
302285
302651
|
responseShape: "unwrapData"
|
|
302286
302652
|
});
|
|
302287
|
-
|
|
302653
|
+
registerProxyRoute({
|
|
302288
302654
|
forgePath: "/api/cmmd/projects/:id/task-workflow",
|
|
302289
302655
|
method: "GET",
|
|
302290
302656
|
cmmdPath: "/api/forge/context/projects/:id/task-workflow",
|
|
302291
302657
|
orgIdSource: "none",
|
|
302292
302658
|
responseShape: "unwrapData"
|
|
302293
302659
|
});
|
|
302294
|
-
|
|
302660
|
+
registerProxyRoute({
|
|
302295
302661
|
forgePath: "/api/cmmd/projects/:id/task-workflow",
|
|
302296
302662
|
method: "PUT",
|
|
302297
302663
|
cmmdPath: "/api/forge/context/projects/:id/task-workflow",
|
|
302298
302664
|
orgIdSource: "none",
|
|
302299
302665
|
responseShape: "unwrapData"
|
|
302300
302666
|
});
|
|
302301
|
-
|
|
302667
|
+
registerProxyRoute({
|
|
302302
302668
|
forgePath: "/api/cmmd/projects/:id/board",
|
|
302303
302669
|
method: "POST",
|
|
302304
302670
|
cmmdPath: "/api/forge/context/projects/:id/board",
|
|
302305
302671
|
orgIdSource: "none",
|
|
302306
302672
|
responseShape: "unwrapData"
|
|
302307
302673
|
});
|
|
302308
|
-
|
|
302674
|
+
registerProxyRoute({
|
|
302309
302675
|
forgePath: "/api/cmmd/projects/:id/board/:taskId",
|
|
302310
302676
|
method: "PATCH",
|
|
302311
302677
|
cmmdPath: "/api/forge/context/projects/:id/board/:taskId",
|
|
302312
302678
|
orgIdSource: "none",
|
|
302313
302679
|
responseShape: "unwrapData"
|
|
302314
302680
|
});
|
|
302315
|
-
|
|
302681
|
+
registerProxyRoute({
|
|
302316
302682
|
forgePath: "/api/cmmd/projects/:id/board/:taskId/status",
|
|
302317
302683
|
method: "PATCH",
|
|
302318
302684
|
cmmdPath: "/api/forge/context/projects/:id/board/:taskId/status",
|
|
302319
302685
|
orgIdSource: "none",
|
|
302320
302686
|
responseShape: "unwrapData"
|
|
302321
302687
|
});
|
|
302322
|
-
|
|
302688
|
+
registerProxyRoute({
|
|
302323
302689
|
forgePath: "/api/cmmd/projects/:id/board/:taskId/execution-options",
|
|
302324
302690
|
method: "GET",
|
|
302325
302691
|
cmmdPath: "/api/forge/context/projects/:id/board/:taskId/execution-options",
|
|
302326
302692
|
orgIdSource: "none",
|
|
302327
302693
|
responseShape: "unwrapData"
|
|
302328
302694
|
});
|
|
302329
|
-
|
|
302695
|
+
registerProxyRoute({
|
|
302330
302696
|
forgePath: "/api/cmmd/projects/:id/board/:taskId/work-sessions",
|
|
302331
302697
|
method: "POST",
|
|
302332
302698
|
cmmdPath: "/api/forge/context/projects/:id/board/:taskId/work-sessions",
|
|
302333
302699
|
orgIdSource: "none",
|
|
302334
302700
|
responseShape: "unwrapData"
|
|
302335
302701
|
});
|
|
302336
|
-
|
|
302702
|
+
registerProxyRoute({
|
|
302337
302703
|
forgePath: "/api/cmmd/projects/:id/work-sessions",
|
|
302338
302704
|
method: "GET",
|
|
302339
302705
|
cmmdPath: "/api/forge/context/projects/:id/work-sessions",
|
|
302340
302706
|
orgIdSource: "none",
|
|
302341
302707
|
responseShape: "unwrapData"
|
|
302342
302708
|
});
|
|
302343
|
-
|
|
302709
|
+
registerProxyRoute({
|
|
302344
302710
|
forgePath: "/api/cmmd/work-sessions/:workSessionId",
|
|
302345
302711
|
method: "GET",
|
|
302346
302712
|
cmmdPath: "/api/forge/context/work-sessions/:workSessionId",
|
|
302347
302713
|
orgIdSource: "none",
|
|
302348
302714
|
responseShape: "unwrapData"
|
|
302349
302715
|
});
|
|
302350
|
-
|
|
302716
|
+
registerProxyRoute({
|
|
302351
302717
|
forgePath: "/api/cmmd/work-sessions/:workSessionId",
|
|
302352
302718
|
method: "PATCH",
|
|
302353
302719
|
cmmdPath: "/api/forge/context/work-sessions/:workSessionId",
|
|
302354
302720
|
orgIdSource: "none",
|
|
302355
302721
|
responseShape: "unwrapData"
|
|
302356
302722
|
});
|
|
302357
|
-
|
|
302723
|
+
registerProxyRoute({
|
|
302358
302724
|
forgePath: "/api/cmmd/work-sessions/:workSessionId/threads",
|
|
302359
302725
|
method: "POST",
|
|
302360
302726
|
cmmdPath: "/api/forge/context/work-sessions/:workSessionId/threads",
|
|
302361
302727
|
orgIdSource: "none",
|
|
302362
302728
|
responseShape: "unwrapData"
|
|
302363
302729
|
});
|
|
302364
|
-
|
|
302730
|
+
registerProxyRoute({
|
|
302365
302731
|
forgePath: "/api/cmmd/tasks/:taskId/conversations",
|
|
302366
302732
|
method: "GET",
|
|
302367
302733
|
cmmdPath: "/api/forge/context/tasks/:taskId/conversations",
|
|
302368
302734
|
orgIdSource: "none",
|
|
302369
302735
|
responseShape: "unwrapData"
|
|
302370
302736
|
});
|
|
302371
|
-
|
|
302737
|
+
registerProxyRoute({
|
|
302372
302738
|
forgePath: "/api/cmmd/tasks/:taskId/conversations",
|
|
302373
302739
|
method: "POST",
|
|
302374
302740
|
cmmdPath: "/api/forge/context/tasks/:taskId/conversations",
|
|
302375
302741
|
orgIdSource: "none",
|
|
302376
302742
|
responseShape: "unwrapData"
|
|
302377
302743
|
});
|
|
302378
|
-
|
|
302744
|
+
registerProxyRoute({
|
|
302379
302745
|
forgePath: "/api/cmmd/tasks/:taskId/history",
|
|
302380
302746
|
method: "GET",
|
|
302381
302747
|
cmmdPath: "/api/forge/context/tasks/:taskId/history",
|
|
302382
302748
|
orgIdSource: "none",
|
|
302383
302749
|
responseShape: "unwrapData"
|
|
302384
302750
|
});
|
|
302385
|
-
|
|
302751
|
+
registerProxyRoute({
|
|
302386
302752
|
forgePath: "/api/cmmd/tasks/:taskId/pull-requests",
|
|
302387
302753
|
method: "PUT",
|
|
302388
302754
|
cmmdPath: "/api/forge/context/tasks/:taskId/pull-requests",
|
|
302389
302755
|
orgIdSource: "none",
|
|
302390
302756
|
responseShape: "unwrapData"
|
|
302391
302757
|
});
|
|
302392
|
-
const
|
|
302758
|
+
for (const path of [
|
|
302393
302759
|
"list",
|
|
302394
302760
|
"list-stats",
|
|
302395
302761
|
"detail",
|
|
@@ -302407,70 +302773,70 @@ const cmmdPullRequestRouteLayers = [
|
|
|
302407
302773
|
"thread/resolution",
|
|
302408
302774
|
"reviewers",
|
|
302409
302775
|
"reaction"
|
|
302410
|
-
]
|
|
302776
|
+
]) registerProxyRoute({
|
|
302411
302777
|
forgePath: `/api/cmmd/pull-requests/${path}`,
|
|
302412
302778
|
method: "POST",
|
|
302413
302779
|
cmmdPath: `/api/forge/context/pull-requests/${path}`,
|
|
302414
302780
|
orgIdSource: "none",
|
|
302415
302781
|
responseShape: "unwrapData"
|
|
302416
|
-
})
|
|
302417
|
-
|
|
302782
|
+
});
|
|
302783
|
+
registerProxyRoute({
|
|
302418
302784
|
forgePath: "/api/cmmd/tasks/:taskId/conversations/:conversationId",
|
|
302419
302785
|
method: "GET",
|
|
302420
302786
|
cmmdPath: "/api/forge/context/tasks/:taskId/conversations/:conversationId",
|
|
302421
302787
|
orgIdSource: "none",
|
|
302422
302788
|
responseShape: "unwrapData"
|
|
302423
302789
|
});
|
|
302424
|
-
|
|
302790
|
+
registerProxyRoute({
|
|
302425
302791
|
forgePath: "/api/cmmd/projects/:id/board/:taskId/spawn-forge-thread",
|
|
302426
302792
|
method: "POST",
|
|
302427
302793
|
cmmdPath: "/api/forge/context/projects/:id/board/:taskId/spawn-forge-thread",
|
|
302428
302794
|
orgIdSource: "none",
|
|
302429
302795
|
responseShape: "unwrapData"
|
|
302430
302796
|
});
|
|
302431
|
-
|
|
302797
|
+
registerProxyRoute({
|
|
302432
302798
|
forgePath: "/api/cmmd/work-items/board",
|
|
302433
302799
|
method: "GET",
|
|
302434
302800
|
cmmdPath: "/api/forge/context/work-items/board",
|
|
302435
302801
|
orgIdSource: "none",
|
|
302436
302802
|
responseShape: "unwrapData"
|
|
302437
302803
|
});
|
|
302438
|
-
|
|
302804
|
+
registerProxyRoute({
|
|
302439
302805
|
forgePath: "/api/cmmd/work-items/board",
|
|
302440
302806
|
method: "POST",
|
|
302441
302807
|
cmmdPath: "/api/forge/context/work-items/board",
|
|
302442
302808
|
orgIdSource: "none",
|
|
302443
302809
|
responseShape: "unwrapData"
|
|
302444
302810
|
});
|
|
302445
|
-
|
|
302811
|
+
registerProxyRoute({
|
|
302446
302812
|
forgePath: "/api/cmmd/feedback",
|
|
302447
302813
|
method: "POST",
|
|
302448
302814
|
cmmdPath: "/api/forge/context/feedback",
|
|
302449
302815
|
orgIdSource: "none",
|
|
302450
302816
|
responseShape: "unwrapData"
|
|
302451
302817
|
});
|
|
302452
|
-
|
|
302818
|
+
registerProxyRoute({
|
|
302453
302819
|
forgePath: "/api/cmmd/work-items/board/:taskId",
|
|
302454
302820
|
method: "PATCH",
|
|
302455
302821
|
cmmdPath: "/api/forge/context/work-items/board/:taskId",
|
|
302456
302822
|
orgIdSource: "none",
|
|
302457
302823
|
responseShape: "unwrapData"
|
|
302458
302824
|
});
|
|
302459
|
-
|
|
302825
|
+
registerProxyRoute({
|
|
302460
302826
|
forgePath: "/api/cmmd/work-items/board/:taskId/move",
|
|
302461
302827
|
method: "PATCH",
|
|
302462
302828
|
cmmdPath: "/api/forge/context/work-items/board/:taskId/move",
|
|
302463
302829
|
orgIdSource: "none",
|
|
302464
302830
|
responseShape: "unwrapData"
|
|
302465
302831
|
});
|
|
302466
|
-
|
|
302832
|
+
registerProxyRoute({
|
|
302467
302833
|
forgePath: "/api/cmmd/projects/:projectId/board/:taskId/move",
|
|
302468
302834
|
method: "PATCH",
|
|
302469
302835
|
cmmdPath: "/api/forge/context/projects/:projectId/board/:taskId/move",
|
|
302470
302836
|
orgIdSource: "none",
|
|
302471
302837
|
responseShape: "unwrapData"
|
|
302472
302838
|
});
|
|
302473
|
-
|
|
302839
|
+
registerProxyRoute({
|
|
302474
302840
|
forgePath: "/api/cmmd/projects/:projectId/board/:taskId/archive",
|
|
302475
302841
|
method: "POST",
|
|
302476
302842
|
cmmdPath: "/api/forge/context/projects/:projectId/board/:taskId/archive",
|
|
@@ -302478,7 +302844,7 @@ const cmmdArchiveProjectBoardTaskRouteLayer = registerProxyRoute({
|
|
|
302478
302844
|
responseShape: "unwrapData",
|
|
302479
302845
|
requestBody: "none"
|
|
302480
302846
|
});
|
|
302481
|
-
|
|
302847
|
+
registerProxyRoute({
|
|
302482
302848
|
forgePath: "/api/cmmd/projects/:projectId/board/:taskId/unarchive",
|
|
302483
302849
|
method: "POST",
|
|
302484
302850
|
cmmdPath: "/api/forge/context/projects/:projectId/board/:taskId/unarchive",
|
|
@@ -302486,7 +302852,7 @@ const cmmdUnarchiveProjectBoardTaskRouteLayer = registerProxyRoute({
|
|
|
302486
302852
|
responseShape: "unwrapData",
|
|
302487
302853
|
requestBody: "none"
|
|
302488
302854
|
});
|
|
302489
|
-
|
|
302855
|
+
registerProxyRoute({
|
|
302490
302856
|
forgePath: "/api/cmmd/work-items/board/:taskId/archive",
|
|
302491
302857
|
method: "POST",
|
|
302492
302858
|
cmmdPath: "/api/forge/context/work-items/board/:taskId/archive",
|
|
@@ -302494,7 +302860,7 @@ const cmmdArchiveCenterBoardTaskRouteLayer = registerProxyRoute({
|
|
|
302494
302860
|
responseShape: "unwrapData",
|
|
302495
302861
|
requestBody: "none"
|
|
302496
302862
|
});
|
|
302497
|
-
|
|
302863
|
+
registerProxyRoute({
|
|
302498
302864
|
forgePath: "/api/cmmd/work-items/board/:taskId/unarchive",
|
|
302499
302865
|
method: "POST",
|
|
302500
302866
|
cmmdPath: "/api/forge/context/work-items/board/:taskId/unarchive",
|
|
@@ -302502,109 +302868,109 @@ const cmmdUnarchiveCenterBoardTaskRouteLayer = registerProxyRoute({
|
|
|
302502
302868
|
responseShape: "unwrapData",
|
|
302503
302869
|
requestBody: "none"
|
|
302504
302870
|
});
|
|
302505
|
-
|
|
302871
|
+
registerProxyRoute({
|
|
302506
302872
|
forgePath: "/api/cmmd/campaigns",
|
|
302507
302873
|
method: "GET",
|
|
302508
302874
|
cmmdPath: "/api/forge/context/campaigns",
|
|
302509
302875
|
orgIdSource: "none",
|
|
302510
302876
|
responseShape: "passthrough"
|
|
302511
302877
|
});
|
|
302512
|
-
|
|
302878
|
+
registerProxyRoute({
|
|
302513
302879
|
forgePath: "/api/cmmd/campaigns/:id",
|
|
302514
302880
|
method: "GET",
|
|
302515
302881
|
cmmdPath: "/api/forge/context/campaigns/:id",
|
|
302516
302882
|
orgIdSource: "none",
|
|
302517
302883
|
responseShape: "passthrough"
|
|
302518
302884
|
});
|
|
302519
|
-
|
|
302885
|
+
registerProxyRoute({
|
|
302520
302886
|
forgePath: "/api/cmmd/campaigns",
|
|
302521
302887
|
method: "POST",
|
|
302522
302888
|
cmmdPath: "/api/projects/campaigns",
|
|
302523
302889
|
responseShape: "passthrough"
|
|
302524
302890
|
});
|
|
302525
|
-
|
|
302891
|
+
registerProxyRoute({
|
|
302526
302892
|
forgePath: "/api/cmmd/campaigns/:id",
|
|
302527
302893
|
method: "PUT",
|
|
302528
302894
|
cmmdPath: "/api/projects/campaigns/:id",
|
|
302529
302895
|
responseShape: "passthrough"
|
|
302530
302896
|
});
|
|
302531
|
-
|
|
302897
|
+
registerProxyRoute({
|
|
302532
302898
|
forgePath: "/api/cmmd/campaigns/:id",
|
|
302533
302899
|
method: "DELETE",
|
|
302534
302900
|
cmmdPath: "/api/projects/campaigns/:id",
|
|
302535
302901
|
orgIdSource: "none"
|
|
302536
302902
|
});
|
|
302537
|
-
|
|
302903
|
+
registerProxyRoute({
|
|
302538
302904
|
forgePath: "/api/cmmd/bootstrap",
|
|
302539
302905
|
method: "GET",
|
|
302540
302906
|
cmmdPath: "/api/forge/context/bootstrap",
|
|
302541
302907
|
orgIdSource: "none",
|
|
302542
302908
|
responseShape: "passthrough"
|
|
302543
302909
|
});
|
|
302544
|
-
|
|
302910
|
+
registerProxyRoute({
|
|
302545
302911
|
forgePath: "/api/cmmd/account/preferences",
|
|
302546
302912
|
method: "GET",
|
|
302547
302913
|
cmmdPath: "/api/forge/context/account/preferences",
|
|
302548
302914
|
orgIdSource: "none",
|
|
302549
302915
|
responseShape: "unwrapData"
|
|
302550
302916
|
});
|
|
302551
|
-
|
|
302917
|
+
registerProxyRoute({
|
|
302552
302918
|
forgePath: "/api/cmmd/account/preferences",
|
|
302553
302919
|
method: "PATCH",
|
|
302554
302920
|
cmmdPath: "/api/forge/context/account/preferences",
|
|
302555
302921
|
orgIdSource: "none",
|
|
302556
302922
|
responseShape: "unwrapData"
|
|
302557
302923
|
});
|
|
302558
|
-
|
|
302924
|
+
registerProxyRoute({
|
|
302559
302925
|
forgePath: "/api/cmmd/org/provider-policy",
|
|
302560
302926
|
method: "GET",
|
|
302561
302927
|
cmmdPath: "/api/forge/context/org/provider-policy",
|
|
302562
302928
|
orgIdSource: "none",
|
|
302563
302929
|
responseShape: "unwrapData"
|
|
302564
302930
|
});
|
|
302565
|
-
|
|
302931
|
+
registerProxyRoute({
|
|
302566
302932
|
forgePath: "/api/cmmd/chats",
|
|
302567
302933
|
method: "GET",
|
|
302568
302934
|
cmmdPath: "/api/forge/context/chats",
|
|
302569
302935
|
orgIdSource: "none",
|
|
302570
302936
|
responseShape: "unwrapData"
|
|
302571
302937
|
});
|
|
302572
|
-
|
|
302938
|
+
registerProxyRoute({
|
|
302573
302939
|
forgePath: "/api/cmmd/chats/:threadId",
|
|
302574
302940
|
method: "GET",
|
|
302575
302941
|
cmmdPath: "/api/forge/context/chats/:threadId",
|
|
302576
302942
|
orgIdSource: "none",
|
|
302577
302943
|
responseShape: "unwrapData"
|
|
302578
302944
|
});
|
|
302579
|
-
|
|
302945
|
+
registerProxyRoute({
|
|
302580
302946
|
forgePath: "/api/cmmd/devices",
|
|
302581
302947
|
method: "GET",
|
|
302582
302948
|
cmmdPath: "/api/forge/context/devices",
|
|
302583
302949
|
orgIdSource: "none",
|
|
302584
302950
|
responseShape: "unwrapData"
|
|
302585
302951
|
});
|
|
302586
|
-
|
|
302952
|
+
registerProxyRoute({
|
|
302587
302953
|
forgePath: "/api/cmmd/devices/register",
|
|
302588
302954
|
method: "POST",
|
|
302589
302955
|
cmmdPath: "/api/forge/context/devices/register",
|
|
302590
302956
|
orgIdSource: "none",
|
|
302591
302957
|
responseShape: "unwrapData"
|
|
302592
302958
|
});
|
|
302593
|
-
|
|
302959
|
+
registerProxyRoute({
|
|
302594
302960
|
forgePath: "/api/cmmd/devices/runtimes/:runtimeId/heartbeat",
|
|
302595
302961
|
method: "POST",
|
|
302596
302962
|
cmmdPath: "/api/forge/context/devices/runtimes/:runtimeId/heartbeat",
|
|
302597
302963
|
orgIdSource: "none",
|
|
302598
302964
|
responseShape: "unwrapData"
|
|
302599
302965
|
});
|
|
302600
|
-
|
|
302966
|
+
registerProxyRoute({
|
|
302601
302967
|
forgePath: "/api/cmmd/devices/runtimes/:runtimeId/access-grants",
|
|
302602
302968
|
method: "POST",
|
|
302603
302969
|
cmmdPath: "/api/forge/context/devices/runtimes/:runtimeId/access-grants",
|
|
302604
302970
|
orgIdSource: "none",
|
|
302605
302971
|
responseShape: "unwrapData"
|
|
302606
302972
|
});
|
|
302607
|
-
|
|
302973
|
+
registerProxyRoute({
|
|
302608
302974
|
forgePath: "/api/cmmd/devices/runtimes/:runtimeId/access-grants/:grantId/revoke",
|
|
302609
302975
|
method: "POST",
|
|
302610
302976
|
cmmdPath: "/api/forge/context/devices/runtimes/:runtimeId/access-grants/:grantId/revoke",
|
|
@@ -302612,46 +302978,60 @@ const cmmdRevokeRuntimeAccessRouteLayer = registerProxyRoute({
|
|
|
302612
302978
|
responseShape: "unwrapData",
|
|
302613
302979
|
successStatus: 200
|
|
302614
302980
|
});
|
|
302615
|
-
|
|
302981
|
+
registerProxyRoute({
|
|
302616
302982
|
forgePath: "/api/cmmd/devices/runtimes/:runtimeId/relay-routes",
|
|
302617
302983
|
method: "POST",
|
|
302618
302984
|
cmmdPath: "/api/forge/context/devices/runtimes/:runtimeId/relay-routes",
|
|
302619
302985
|
orgIdSource: "none",
|
|
302620
302986
|
responseShape: "unwrapData"
|
|
302621
302987
|
});
|
|
302622
|
-
|
|
302988
|
+
registerProxyRoute({
|
|
302623
302989
|
forgePath: "/api/cmmd/devices/runtimes/:runtimeId/relay-action-grants",
|
|
302624
302990
|
method: "POST",
|
|
302625
302991
|
cmmdPath: "/api/forge/context/devices/runtimes/:runtimeId/relay-action-grants",
|
|
302626
302992
|
orgIdSource: "none",
|
|
302627
302993
|
responseShape: "unwrapData"
|
|
302628
302994
|
});
|
|
302629
|
-
|
|
302995
|
+
registerProxyRoute({
|
|
302630
302996
|
forgePath: "/api/cmmd/devices/runtimes/:runtimeId/inventory",
|
|
302631
302997
|
method: "PUT",
|
|
302632
302998
|
cmmdPath: "/api/forge/context/devices/runtimes/:runtimeId/inventory",
|
|
302633
302999
|
orgIdSource: "none",
|
|
302634
303000
|
responseShape: "unwrapData"
|
|
302635
303001
|
});
|
|
302636
|
-
|
|
303002
|
+
registerProxyRoute({
|
|
302637
303003
|
forgePath: "/api/cmmd/runtime-inventory",
|
|
302638
303004
|
method: "GET",
|
|
302639
303005
|
cmmdPath: "/api/forge/context/runtime-inventory",
|
|
302640
303006
|
orgIdSource: "none",
|
|
302641
303007
|
responseShape: "unwrapData"
|
|
302642
303008
|
});
|
|
303009
|
+
registerProxyRoute({
|
|
303010
|
+
forgePath: "/api/cmmd/threads/:runtimeId/:threadId/lifecycle-intent",
|
|
303011
|
+
method: "PUT",
|
|
303012
|
+
cmmdPath: "/api/forge/context/threads/:runtimeId/:threadId/lifecycle-intent",
|
|
303013
|
+
orgIdSource: "none",
|
|
303014
|
+
requestBody: "json",
|
|
303015
|
+
responseShape: "unwrapData"
|
|
303016
|
+
});
|
|
303017
|
+
registerProxyRoute({
|
|
303018
|
+
forgePath: "/api/cmmd/threads/:runtimeId/:threadId/lifecycle-intent",
|
|
303019
|
+
method: "DELETE",
|
|
303020
|
+
cmmdPath: "/api/forge/context/threads/:runtimeId/:threadId/lifecycle-intent",
|
|
303021
|
+
orgIdSource: "none"
|
|
303022
|
+
});
|
|
302643
303023
|
/**
|
|
302644
303024
|
* Owner-scoped, bounded control-plane observation. This is intentionally
|
|
302645
303025
|
* separate from the runtime inventory publisher and never wakes a runtime.
|
|
302646
303026
|
*/
|
|
302647
|
-
|
|
303027
|
+
registerProxyRoute({
|
|
302648
303028
|
forgePath: "/api/cmmd/runtime-diagnostics/v2/runtimes/:runtimeId",
|
|
302649
303029
|
method: "GET",
|
|
302650
303030
|
cmmdPath: "/api/forge/context/runtime-diagnostics/v2/runtimes/:runtimeId",
|
|
302651
303031
|
orgIdSource: "none",
|
|
302652
303032
|
responseShape: "unwrapData"
|
|
302653
303033
|
});
|
|
302654
|
-
|
|
303034
|
+
registerProxyRoute({
|
|
302655
303035
|
forgePath: "/api/cmmd/auth-runtime",
|
|
302656
303036
|
method: "POST",
|
|
302657
303037
|
cmmdPath: "/api/forge/context/auth-runtime",
|
|
@@ -302659,21 +303039,21 @@ const cmmdProvisionAuthRuntimeRouteLayer = registerProxyRoute({
|
|
|
302659
303039
|
responseShape: "unwrapData",
|
|
302660
303040
|
requestBody: "none"
|
|
302661
303041
|
});
|
|
302662
|
-
|
|
303042
|
+
registerProxyRoute({
|
|
302663
303043
|
forgePath: "/api/cmmd/auth-runtime",
|
|
302664
303044
|
method: "GET",
|
|
302665
303045
|
cmmdPath: "/api/forge/context/auth-runtime",
|
|
302666
303046
|
orgIdSource: "none",
|
|
302667
303047
|
responseShape: "unwrapData"
|
|
302668
303048
|
});
|
|
302669
|
-
|
|
303049
|
+
registerProxyRoute({
|
|
302670
303050
|
forgePath: "/api/cmmd/auth-runtime",
|
|
302671
303051
|
method: "DELETE",
|
|
302672
303052
|
cmmdPath: "/api/forge/context/auth-runtime",
|
|
302673
303053
|
orgIdSource: "none",
|
|
302674
303054
|
responseShape: "unwrapData"
|
|
302675
303055
|
});
|
|
302676
|
-
|
|
303056
|
+
registerProxyRoute({
|
|
302677
303057
|
forgePath: "/api/cmmd/auth-runtime/connect",
|
|
302678
303058
|
method: "POST",
|
|
302679
303059
|
cmmdPath: "/api/forge/context/auth-runtime/connect",
|
|
@@ -302681,14 +303061,14 @@ const cmmdConnectAuthRuntimeRouteLayer = registerProxyRoute({
|
|
|
302681
303061
|
responseShape: "unwrapData",
|
|
302682
303062
|
requestBody: "none"
|
|
302683
303063
|
});
|
|
302684
|
-
|
|
303064
|
+
registerProxyRoute({
|
|
302685
303065
|
forgePath: "/api/cmmd/providers/accounts",
|
|
302686
303066
|
method: "GET",
|
|
302687
303067
|
cmmdPath: "/api/forge/context/providers/accounts",
|
|
302688
303068
|
orgIdSource: "none",
|
|
302689
303069
|
responseShape: "unwrapData"
|
|
302690
303070
|
});
|
|
302691
|
-
|
|
303071
|
+
registerProxyRoute({
|
|
302692
303072
|
forgePath: "/api/cmmd/providers/accounts/:id",
|
|
302693
303073
|
method: "DELETE",
|
|
302694
303074
|
cmmdPath: "/api/forge/context/providers/accounts/:id",
|
|
@@ -302696,23 +303076,29 @@ const cmmdDeleteProviderAccountRouteLayer = registerProxyRoute({
|
|
|
302696
303076
|
responseShape: "unwrapData",
|
|
302697
303077
|
requestBody: "none"
|
|
302698
303078
|
});
|
|
302699
|
-
|
|
303079
|
+
registerProxyRoute({
|
|
302700
303080
|
forgePath: "/api/cmmd/providers/accounts/default",
|
|
302701
303081
|
method: "PUT",
|
|
302702
303082
|
cmmdPath: "/api/forge/context/providers/accounts/default",
|
|
302703
303083
|
orgIdSource: "none",
|
|
302704
303084
|
responseShape: "unwrapData"
|
|
302705
303085
|
});
|
|
302706
|
-
|
|
302707
|
-
|
|
302708
|
-
|
|
303086
|
+
registerProxyHandler({
|
|
303087
|
+
forgePath: "/api/cmmd/providers/usage",
|
|
303088
|
+
method: "GET",
|
|
303089
|
+
parse: () => require_Schema$1.succeed({
|
|
303090
|
+
ok: true,
|
|
303091
|
+
value: void 0
|
|
303092
|
+
}),
|
|
303093
|
+
run: (_parsed, { session }) => runCmmdRestProxyAsHandlerResult(session, (jwt) => cmmdGateway.request({
|
|
302709
303094
|
method: "GET",
|
|
302710
303095
|
jwt,
|
|
302711
303096
|
path: "/api/forge/context/providers/usage"
|
|
302712
|
-
}))
|
|
302713
|
-
|
|
302714
|
-
|
|
302715
|
-
})
|
|
303097
|
+
}), (value) => ({
|
|
303098
|
+
status: 200,
|
|
303099
|
+
body: unwrapForgeEnvelope(value)
|
|
303100
|
+
}))
|
|
303101
|
+
});
|
|
302716
303102
|
function parseProviderUsageRefreshInput(rawBody) {
|
|
302717
303103
|
if (rawBody === null || typeof rawBody !== "object") return null;
|
|
302718
303104
|
const body = rawBody;
|
|
@@ -302794,56 +303180,56 @@ function makeRefreshProviderUsageHandler(dependencies = {}) {
|
|
|
302794
303180
|
}).pipe(require_Schema$1.catchTag("AuthError", (error) => respondToAuthError(error)));
|
|
302795
303181
|
}
|
|
302796
303182
|
const cmmdRefreshProviderUsageRouteLayer = add$1("POST", "/api/cmmd/providers/usage/refresh", makeRefreshProviderUsageHandler());
|
|
302797
|
-
|
|
303183
|
+
registerProxyRoute({
|
|
302798
303184
|
forgePath: "/api/cmmd/providers/codex/credential",
|
|
302799
303185
|
method: "GET",
|
|
302800
303186
|
cmmdPath: "/api/forge/context/providers/codex/credential",
|
|
302801
303187
|
orgIdSource: "none",
|
|
302802
303188
|
responseShape: "unwrapData"
|
|
302803
303189
|
});
|
|
302804
|
-
|
|
303190
|
+
registerProxyRoute({
|
|
302805
303191
|
forgePath: "/api/cmmd/providers/codex/credential",
|
|
302806
303192
|
method: "DELETE",
|
|
302807
303193
|
cmmdPath: "/api/forge/context/providers/codex/credential",
|
|
302808
303194
|
orgIdSource: "none",
|
|
302809
303195
|
responseShape: "unwrapData"
|
|
302810
303196
|
});
|
|
302811
|
-
|
|
303197
|
+
registerProxyRoute({
|
|
302812
303198
|
forgePath: "/api/cmmd/providers/claude/credential",
|
|
302813
303199
|
method: "GET",
|
|
302814
303200
|
cmmdPath: "/api/forge/context/providers/claude/credential",
|
|
302815
303201
|
orgIdSource: "none",
|
|
302816
303202
|
responseShape: "unwrapData"
|
|
302817
303203
|
});
|
|
302818
|
-
|
|
303204
|
+
registerProxyRoute({
|
|
302819
303205
|
forgePath: "/api/cmmd/providers/claude/credential",
|
|
302820
303206
|
method: "DELETE",
|
|
302821
303207
|
cmmdPath: "/api/forge/context/providers/claude/credential",
|
|
302822
303208
|
orgIdSource: "none",
|
|
302823
303209
|
responseShape: "unwrapData"
|
|
302824
303210
|
});
|
|
302825
|
-
|
|
303211
|
+
registerProxyRoute({
|
|
302826
303212
|
forgePath: "/api/cmmd/providers/claude/runtime-readiness/:runtimeId",
|
|
302827
303213
|
method: "GET",
|
|
302828
303214
|
cmmdPath: "/api/forge/context/providers/claude/runtime-readiness/:runtimeId",
|
|
302829
303215
|
orgIdSource: "none",
|
|
302830
303216
|
responseShape: "unwrapData"
|
|
302831
303217
|
});
|
|
302832
|
-
|
|
303218
|
+
registerProxyRoute({
|
|
302833
303219
|
forgePath: "/api/cmmd/devices/runtimes/:runtimeId/threads/:threadId/events",
|
|
302834
303220
|
method: "POST",
|
|
302835
303221
|
cmmdPath: "/api/forge/context/devices/runtimes/:runtimeId/threads/:threadId/events",
|
|
302836
303222
|
orgIdSource: "none",
|
|
302837
303223
|
responseShape: "unwrapData"
|
|
302838
303224
|
});
|
|
302839
|
-
|
|
303225
|
+
registerProxyRoute({
|
|
302840
303226
|
forgePath: "/api/cmmd/threads/:runtimeId/:threadId",
|
|
302841
303227
|
method: "GET",
|
|
302842
303228
|
cmmdPath: "/api/forge/context/threads/:runtimeId/:threadId",
|
|
302843
303229
|
orgIdSource: "none",
|
|
302844
303230
|
responseShape: "unwrapData"
|
|
302845
303231
|
});
|
|
302846
|
-
|
|
303232
|
+
registerProxyRoute({
|
|
302847
303233
|
forgePath: "/api/cmmd/devices/:deviceId/rename",
|
|
302848
303234
|
method: "POST",
|
|
302849
303235
|
cmmdPath: "/api/forge/context/devices/:deviceId/rename",
|
|
@@ -302859,7 +303245,7 @@ const cmmdRenameDeviceRouteLayer = registerProxyRoute({
|
|
|
302859
303245
|
* the status and the code reach the browser unchanged, which is what lets the
|
|
302860
303246
|
* rename field say something specific instead of "something went wrong".
|
|
302861
303247
|
*/
|
|
302862
|
-
|
|
303248
|
+
registerProxyRoute({
|
|
302863
303249
|
forgePath: "/api/cmmd/forge-runtimes/:runtimeId/rename",
|
|
302864
303250
|
method: "POST",
|
|
302865
303251
|
cmmdPath: "/api/forge/context/runtimes/:runtimeId/rename",
|
|
@@ -302867,7 +303253,7 @@ const cmmdRenameForgeRuntimeRouteLayer = registerProxyRoute({
|
|
|
302867
303253
|
responseShape: "unwrapData",
|
|
302868
303254
|
successStatus: 200
|
|
302869
303255
|
});
|
|
302870
|
-
|
|
303256
|
+
registerProxyRoute({
|
|
302871
303257
|
forgePath: "/api/cmmd/devices/:deviceId/revoke",
|
|
302872
303258
|
method: "POST",
|
|
302873
303259
|
cmmdPath: "/api/forge/context/devices/:deviceId/revoke",
|
|
@@ -302876,24 +303262,21 @@ const cmmdRevokeDeviceRouteLayer = registerProxyRoute({
|
|
|
302876
303262
|
requestBody: "none",
|
|
302877
303263
|
successStatus: 200
|
|
302878
303264
|
});
|
|
302879
|
-
|
|
303265
|
+
registerProxyRoute({
|
|
302880
303266
|
forgePath: "/api/cmmd/connectors",
|
|
302881
303267
|
method: "GET",
|
|
302882
303268
|
cmmdPath: "/api/forge/context/connectors",
|
|
302883
303269
|
orgIdSource: "none"
|
|
302884
303270
|
});
|
|
302885
|
-
|
|
303271
|
+
registerProxyRoute({
|
|
302886
303272
|
forgePath: "/api/cmmd/connectors/:connectorId/install",
|
|
302887
303273
|
method: "POST",
|
|
302888
303274
|
cmmdPath: "/api/forge/context/connectors/:connectorId/install",
|
|
302889
303275
|
orgIdSource: "none"
|
|
302890
303276
|
});
|
|
302891
303277
|
const cmmdForgeCloudProjectsListRouteLayer = add$1("GET", "/api/cmmd/forge-cloud-projects", require_Schema$1.gen(function* () {
|
|
302892
|
-
const accessToken = yield* makeCmmdProxyAccessTokenEffect("forge-cloud-projects");
|
|
302893
|
-
if (!accessToken) return
|
|
302894
|
-
code: "CMMD_AUTH_REQUIRED",
|
|
302895
|
-
message: "CMMD authentication is required. Sign in again to continue."
|
|
302896
|
-
});
|
|
303278
|
+
const { session, jwt: accessToken } = yield* makeCmmdProxyAccessTokenEffect("forge-cloud-projects");
|
|
303279
|
+
if (!accessToken) return yield* respondCmmdConnectionRequired(session.sessionId);
|
|
302897
303280
|
const upstreamUrl = `${resolveCommandAppUrl()}${CMMD_CLOUD_PROJECTS_PATH}`;
|
|
302898
303281
|
const upstreamOrError = yield* fetchCmmdUpstreamWithRetry(() => fetch(upstreamUrl, { headers: {
|
|
302899
303282
|
Authorization: `Bearer ${accessToken}`,
|
|
@@ -302904,10 +303287,7 @@ const cmmdForgeCloudProjectsListRouteLayer = add$1("GET", "/api/cmmd/forge-cloud
|
|
|
302904
303287
|
code: "CMMD_UNAVAILABLE"
|
|
302905
303288
|
}, { status: 503 });
|
|
302906
303289
|
const upstream = upstreamOrError.res;
|
|
302907
|
-
if (upstream.status === 401 || upstream.status === 403) return
|
|
302908
|
-
code: "CMMD_AUTH_REQUIRED",
|
|
302909
|
-
message: "CMMD authentication expired. Sign in again to continue."
|
|
302910
|
-
});
|
|
303290
|
+
if (upstream.status === 401 || upstream.status === 403) return yield* respondCmmdConnectionRequired(session.sessionId);
|
|
302911
303291
|
const bodyOrError = yield* require_Schema$1.tryPromise(() => upstream.text()).pipe(require_Schema$1.map((text) => ({
|
|
302912
303292
|
ok: true,
|
|
302913
303293
|
text
|
|
@@ -302929,35 +303309,35 @@ const cmmdForgeCloudProjectsListRouteLayer = add$1("GET", "/api/cmmd/forge-cloud
|
|
|
302929
303309
|
headers: { "content-type": "application/json" }
|
|
302930
303310
|
});
|
|
302931
303311
|
}).pipe(require_Schema$1.catchTag("AuthError", (error) => respondToAuthError(error))));
|
|
302932
|
-
|
|
303312
|
+
registerProxyRoute({
|
|
302933
303313
|
forgePath: "/api/cmmd/forge-cloud-projects",
|
|
302934
303314
|
method: "POST",
|
|
302935
303315
|
cmmdPath: CMMD_CLOUD_PROJECTS_PATH,
|
|
302936
303316
|
orgIdSource: "none",
|
|
302937
303317
|
responseShape: "unwrapData"
|
|
302938
303318
|
});
|
|
302939
|
-
|
|
303319
|
+
registerProxyRoute({
|
|
302940
303320
|
forgePath: "/api/cmmd/forge-cloud-projects/:projectId",
|
|
302941
303321
|
method: "DELETE",
|
|
302942
303322
|
cmmdPath: `${CMMD_CLOUD_PROJECTS_PATH}/:projectId`,
|
|
302943
303323
|
orgIdSource: "none",
|
|
302944
303324
|
responseShape: "unwrapData"
|
|
302945
303325
|
});
|
|
302946
|
-
|
|
303326
|
+
registerProxyRoute({
|
|
302947
303327
|
forgePath: "/api/cmmd/forge-cloud-projects/:projectId/lifecycle-preflight",
|
|
302948
303328
|
method: "GET",
|
|
302949
303329
|
cmmdPath: `${CMMD_CLOUD_PROJECTS_PATH}/:projectId/lifecycle-preflight`,
|
|
302950
303330
|
orgIdSource: "none",
|
|
302951
303331
|
responseShape: "unwrapData"
|
|
302952
303332
|
});
|
|
302953
|
-
|
|
303333
|
+
registerProxyRoute({
|
|
302954
303334
|
forgePath: "/api/cmmd/forge-cloud-projects/:projectId/removal-preview",
|
|
302955
303335
|
method: "GET",
|
|
302956
303336
|
cmmdPath: `${CMMD_CLOUD_PROJECTS_PATH}/:projectId/removal-preview`,
|
|
302957
303337
|
orgIdSource: "none",
|
|
302958
303338
|
responseShape: "unwrapData"
|
|
302959
303339
|
});
|
|
302960
|
-
|
|
303340
|
+
registerProxyRoute({
|
|
302961
303341
|
forgePath: "/api/cmmd/forge-cloud-projects/:projectId/removal",
|
|
302962
303342
|
method: "POST",
|
|
302963
303343
|
cmmdPath: `${CMMD_CLOUD_PROJECTS_PATH}/:projectId/removal`,
|
|
@@ -302966,7 +303346,7 @@ const cmmdForgeCloudProjectRemovalRouteLayer = registerProxyRoute({
|
|
|
302966
303346
|
successStatus: 202,
|
|
302967
303347
|
workIntakeInvalidation: "completedPermanentRemoval"
|
|
302968
303348
|
});
|
|
302969
|
-
|
|
303349
|
+
registerProxyRoute({
|
|
302970
303350
|
forgePath: "/api/cmmd/forge-cloud-project-removals/:operationId",
|
|
302971
303351
|
method: "GET",
|
|
302972
303352
|
cmmdPath: `${CMMD_CLOUD_PROJECTS_PATH}/removals/:operationId`,
|
|
@@ -303030,11 +303410,8 @@ function makeFetchCloudProjectsFrameEffect(upstreamUrl, accessToken) {
|
|
|
303030
303410
|
})).pipe(require_Schema$1.catch_(() => require_Schema$1.succeed(null)));
|
|
303031
303411
|
}
|
|
303032
303412
|
const cmmdForgeCloudProjectsEventsRouteLayer = add$1("GET", "/api/cmmd/forge-cloud-projects/events", require_Schema$1.gen(function* () {
|
|
303033
|
-
const accessToken = yield* makeCmmdProxyAccessTokenEffect("forge-cloud-projects/events");
|
|
303034
|
-
if (!accessToken) return
|
|
303035
|
-
code: "CMMD_AUTH_REQUIRED",
|
|
303036
|
-
message: "CMMD authentication is required. Sign in again to continue."
|
|
303037
|
-
});
|
|
303413
|
+
const { session, jwt: accessToken } = yield* makeCmmdProxyAccessTokenEffect("forge-cloud-projects/events");
|
|
303414
|
+
if (!accessToken) return yield* respondCmmdConnectionRequired(session.sessionId);
|
|
303038
303415
|
const fetchCloudProjectsFrame = makeFetchCloudProjectsFrameEffect(`${resolveCommandAppUrl()}${CMMD_CLOUD_PROJECTS_PATH}`, accessToken);
|
|
303039
303416
|
const dataStream = require_Path.concat(require_Path.fromEffect(fetchCloudProjectsFrame), require_Path.tick(FORGE_RUNTIMES_POLL_INTERVAL).pipe(require_Path.mapEffect(() => fetchCloudProjectsFrame))).pipe(require_Path.filter((frame) => frame !== null));
|
|
303040
303417
|
const keepaliveStream = require_Path.tick(FORGE_RUNTIMES_KEEPALIVE_INTERVAL).pipe(require_Path.map(() => FORGE_RUNTIMES_KEEPALIVE_FRAME));
|
|
@@ -303107,11 +303484,8 @@ function fetchCmmdUpstreamWithRetry(send, policy = "idempotent") {
|
|
|
303107
303484
|
}
|
|
303108
303485
|
const cmmdForgeRuntimesEnsureRouteLayer = add$1("POST", "/api/cmmd/forge-runtimes/ensure", require_Schema$1.gen(function* () {
|
|
303109
303486
|
const request = yield* require_HttpServer.HttpServerRequest;
|
|
303110
|
-
const accessToken = yield* makeCmmdProxyAccessTokenEffect("forge-runtimes/ensure");
|
|
303111
|
-
if (!accessToken) return
|
|
303112
|
-
code: "CMMD_AUTH_REQUIRED",
|
|
303113
|
-
message: "CMMD authentication is required. Sign in again to continue."
|
|
303114
|
-
});
|
|
303487
|
+
const { session, jwt: accessToken } = yield* makeCmmdProxyAccessTokenEffect("forge-runtimes/ensure");
|
|
303488
|
+
if (!accessToken) return yield* respondCmmdConnectionRequired(session.sessionId);
|
|
303115
303489
|
const scopedBody = splitCmmdRuntimeOrganizationScope(yield* request.json.pipe(require_Schema$1.catch_(() => require_Schema$1.succeed({}))));
|
|
303116
303490
|
if (!scopedBody) return require_HttpServer.jsonUnsafe({ error: "A valid organizationId is required when organization scope is provided." }, { status: 400 });
|
|
303117
303491
|
const upstreamUrl = `${resolveCommandAppUrl()}/api/forge/context/runtimes/ensure`;
|
|
@@ -303130,10 +303504,7 @@ const cmmdForgeRuntimesEnsureRouteLayer = add$1("POST", "/api/cmmd/forge-runtime
|
|
|
303130
303504
|
code: "CMMD_UNAVAILABLE"
|
|
303131
303505
|
}, { status: 503 });
|
|
303132
303506
|
const upstream = upstreamOrError.res;
|
|
303133
|
-
if (upstream.status === 401 || upstream.status === 403) return
|
|
303134
|
-
code: "CMMD_AUTH_REQUIRED",
|
|
303135
|
-
message: "CMMD authentication expired. Sign in again to continue."
|
|
303136
|
-
});
|
|
303507
|
+
if (upstream.status === 401 || upstream.status === 403) return yield* respondCmmdConnectionRequired(session.sessionId);
|
|
303137
303508
|
const bodyOrError = yield* require_Schema$1.tryPromise(() => upstream.text()).pipe(require_Schema$1.map((text) => ({
|
|
303138
303509
|
ok: true,
|
|
303139
303510
|
text
|
|
@@ -303157,11 +303528,8 @@ const cmmdForgeRuntimesEnsureRouteLayer = add$1("POST", "/api/cmmd/forge-runtime
|
|
|
303157
303528
|
}).pipe(require_Schema$1.catchTag("AuthError", (error) => respondToAuthError(error))));
|
|
303158
303529
|
const cmmdForgeRuntimesConnectRouteLayer = add$1("POST", "/api/cmmd/forge-runtimes/:runtimeId/connect", require_Schema$1.gen(function* () {
|
|
303159
303530
|
const request = yield* require_HttpServer.HttpServerRequest;
|
|
303160
|
-
const accessToken = yield* makeCmmdProxyAccessTokenEffect("forge-runtimes/connect");
|
|
303161
|
-
if (!accessToken) return
|
|
303162
|
-
code: "CMMD_AUTH_REQUIRED",
|
|
303163
|
-
message: "CMMD authentication is required. Sign in again to continue."
|
|
303164
|
-
});
|
|
303531
|
+
const { session, jwt: accessToken } = yield* makeCmmdProxyAccessTokenEffect("forge-runtimes/connect");
|
|
303532
|
+
if (!accessToken) return yield* respondCmmdConnectionRequired(session.sessionId);
|
|
303165
303533
|
const runtimeId = extractIdFromPath(new URL(request.url, "http://localhost").pathname, 2);
|
|
303166
303534
|
if (!runtimeId) return require_HttpServer.jsonUnsafe({ error: "Runtime ID is required." }, { status: 400 });
|
|
303167
303535
|
const scopedBody = splitCmmdRuntimeOrganizationScope(yield* request.json.pipe(require_Schema$1.catch_(() => require_Schema$1.succeed({}))));
|
|
@@ -303182,10 +303550,7 @@ const cmmdForgeRuntimesConnectRouteLayer = add$1("POST", "/api/cmmd/forge-runtim
|
|
|
303182
303550
|
code: "CMMD_UNAVAILABLE"
|
|
303183
303551
|
}, { status: 503 });
|
|
303184
303552
|
const upstream = upstreamOrError.res;
|
|
303185
|
-
if (upstream.status === 401 || upstream.status === 403) return
|
|
303186
|
-
code: "CMMD_AUTH_REQUIRED",
|
|
303187
|
-
message: "CMMD authentication expired. Sign in again to continue."
|
|
303188
|
-
});
|
|
303553
|
+
if (upstream.status === 401 || upstream.status === 403) return yield* respondCmmdConnectionRequired(session.sessionId);
|
|
303189
303554
|
const bodyOrError = yield* require_Schema$1.tryPromise(() => upstream.text()).pipe(require_Schema$1.map((text) => ({
|
|
303190
303555
|
ok: true,
|
|
303191
303556
|
text
|
|
@@ -303209,11 +303574,8 @@ const cmmdForgeRuntimesConnectRouteLayer = add$1("POST", "/api/cmmd/forge-runtim
|
|
|
303209
303574
|
}).pipe(require_Schema$1.catchTag("AuthError", (error) => respondToAuthError(error))));
|
|
303210
303575
|
const cmmdForgeRuntimesStatusRouteLayer = add$1("GET", "/api/cmmd/forge-runtimes/:runtimeId/status", require_Schema$1.gen(function* () {
|
|
303211
303576
|
const request = yield* require_HttpServer.HttpServerRequest;
|
|
303212
|
-
const accessToken = yield* makeCmmdProxyAccessTokenEffect("forge-runtimes/status");
|
|
303213
|
-
if (!accessToken) return
|
|
303214
|
-
code: "CMMD_AUTH_REQUIRED",
|
|
303215
|
-
message: "CMMD authentication is required. Sign in again to continue."
|
|
303216
|
-
});
|
|
303577
|
+
const { session, jwt: accessToken } = yield* makeCmmdProxyAccessTokenEffect("forge-runtimes/status");
|
|
303578
|
+
if (!accessToken) return yield* respondCmmdConnectionRequired(session.sessionId);
|
|
303217
303579
|
const runtimeId = extractIdFromPath(new URL(request.url, "http://localhost").pathname, 2);
|
|
303218
303580
|
if (!runtimeId) return require_HttpServer.jsonUnsafe({ error: "Runtime ID is required." }, { status: 400 });
|
|
303219
303581
|
const upstreamUrl = `${resolveCommandAppUrl()}/api/forge/context/runtimes/${encodeURIComponent(runtimeId)}/status`;
|
|
@@ -303229,10 +303591,7 @@ const cmmdForgeRuntimesStatusRouteLayer = add$1("GET", "/api/cmmd/forge-runtimes
|
|
|
303229
303591
|
code: "CMMD_UNAVAILABLE"
|
|
303230
303592
|
}, { status: 503 });
|
|
303231
303593
|
const upstream = upstreamOrError.res;
|
|
303232
|
-
if (upstream.status === 401 || upstream.status === 403) return
|
|
303233
|
-
code: "CMMD_AUTH_REQUIRED",
|
|
303234
|
-
message: "CMMD authentication expired. Sign in again to continue."
|
|
303235
|
-
});
|
|
303594
|
+
if (upstream.status === 401 || upstream.status === 403) return yield* respondCmmdConnectionRequired(session.sessionId);
|
|
303236
303595
|
const bodyOrError = yield* require_Schema$1.tryPromise(() => upstream.text()).pipe(require_Schema$1.map((text) => ({
|
|
303237
303596
|
ok: true,
|
|
303238
303597
|
text
|
|
@@ -303263,10 +303622,7 @@ function makeCmmdForgeRuntimesLifecycleHandler(action) {
|
|
|
303263
303622
|
subject: session.subject,
|
|
303264
303623
|
logPrefix: `forge-runtimes/${action}`
|
|
303265
303624
|
});
|
|
303266
|
-
if (!accessToken) return
|
|
303267
|
-
code: "CMMD_AUTH_REQUIRED",
|
|
303268
|
-
message: "CMMD authentication is required. Sign in again to continue."
|
|
303269
|
-
});
|
|
303625
|
+
if (!accessToken) return yield* respondCmmdConnectionRequired(session.sessionId);
|
|
303270
303626
|
const runtimeId = extractIdFromPath(new URL(request.url, "http://localhost").pathname, 2);
|
|
303271
303627
|
if (!runtimeId) return require_HttpServer.jsonUnsafe({ error: "Runtime ID is required." }, { status: 400 });
|
|
303272
303628
|
const scopedBody = splitCmmdRuntimeOrganizationScope(yield* request.json.pipe(require_Schema$1.catch_(() => require_Schema$1.succeed({}))));
|
|
@@ -303287,10 +303643,7 @@ function makeCmmdForgeRuntimesLifecycleHandler(action) {
|
|
|
303287
303643
|
code: "CMMD_UNAVAILABLE"
|
|
303288
303644
|
}, { status: 503 });
|
|
303289
303645
|
const upstream = upstreamOrError.res;
|
|
303290
|
-
if (upstream.status === 401 || upstream.status === 403) return
|
|
303291
|
-
code: "CMMD_AUTH_REQUIRED",
|
|
303292
|
-
message: "CMMD authentication expired. Sign in again to continue."
|
|
303293
|
-
});
|
|
303646
|
+
if (upstream.status === 401 || upstream.status === 403) return yield* respondCmmdConnectionRequired(session.sessionId);
|
|
303294
303647
|
const bodyOrError = yield* require_Schema$1.tryPromise(() => upstream.text()).pipe(require_Schema$1.map((text) => ({
|
|
303295
303648
|
ok: true,
|
|
303296
303649
|
text
|
|
@@ -303323,11 +303676,8 @@ const cmmdForgeRuntimesRecycleRouteLayer = add$1("POST", "/api/cmmd/forge-runtim
|
|
|
303323
303676
|
const cmmdForgeRuntimesUpdateCommitRouteLayer = add$1("POST", "/api/cmmd/forge-runtimes/:runtimeId/update-commit", __cmmdForgeRuntimesUpdateCommitHandlerForTests);
|
|
303324
303677
|
const cmmdForgeRuntimesDestroyRouteLayer = add$1("POST", "/api/cmmd/forge-runtimes/:runtimeId/destroy", require_Schema$1.gen(function* () {
|
|
303325
303678
|
const request = yield* require_HttpServer.HttpServerRequest;
|
|
303326
|
-
const accessToken = yield* makeCmmdProxyAccessTokenEffect("forge-runtimes/destroy");
|
|
303327
|
-
if (!accessToken) return
|
|
303328
|
-
code: "CMMD_AUTH_REQUIRED",
|
|
303329
|
-
message: "CMMD authentication is required. Sign in again to continue."
|
|
303330
|
-
});
|
|
303679
|
+
const { session, jwt: accessToken } = yield* makeCmmdProxyAccessTokenEffect("forge-runtimes/destroy");
|
|
303680
|
+
if (!accessToken) return yield* respondCmmdConnectionRequired(session.sessionId);
|
|
303331
303681
|
const runtimeId = extractIdFromPath(new URL(request.url, "http://localhost").pathname, 2);
|
|
303332
303682
|
if (!runtimeId) return require_HttpServer.jsonUnsafe({ error: "Runtime ID is required." }, { status: 400 });
|
|
303333
303683
|
const scopedBody = splitCmmdRuntimeOrganizationScope(yield* request.json.pipe(require_Schema$1.catch_(() => require_Schema$1.succeed({}))));
|
|
@@ -303348,10 +303698,7 @@ const cmmdForgeRuntimesDestroyRouteLayer = add$1("POST", "/api/cmmd/forge-runtim
|
|
|
303348
303698
|
code: "CMMD_UNAVAILABLE"
|
|
303349
303699
|
}, { status: 503 });
|
|
303350
303700
|
const upstream = upstreamOrError.res;
|
|
303351
|
-
if (upstream.status === 401 || upstream.status === 403) return
|
|
303352
|
-
code: "CMMD_AUTH_REQUIRED",
|
|
303353
|
-
message: "CMMD authentication expired. Sign in again to continue."
|
|
303354
|
-
});
|
|
303701
|
+
if (upstream.status === 401 || upstream.status === 403) return yield* respondCmmdConnectionRequired(session.sessionId);
|
|
303355
303702
|
const bodyOrError = yield* require_Schema$1.tryPromise(() => upstream.text()).pipe(require_Schema$1.map((text) => ({
|
|
303356
303703
|
ok: true,
|
|
303357
303704
|
text
|
|
@@ -303373,6 +303720,7 @@ const cmmdForgeRuntimesDestroyRouteLayer = add$1("POST", "/api/cmmd/forge-runtim
|
|
|
303373
303720
|
headers: { "content-type": "application/json" }
|
|
303374
303721
|
});
|
|
303375
303722
|
}).pipe(require_Schema$1.catchTag("AuthError", (error) => respondToAuthError(error))));
|
|
303723
|
+
const cmmdProxyRouteLayers = registeredProxyRouteLayers().slice(__cmmdProxyRouteLayersStartIndex);
|
|
303376
303724
|
//#endregion
|
|
303377
303725
|
//#region src/cmmdData/projectTeamProxyRoutes.ts
|
|
303378
303726
|
const cmmdListWorkspaceMembersRouteLayer = registerProxyRoute({
|
|
@@ -304615,6 +304963,103 @@ function recordRuntimeReplicationOutboxDiagnostics(diagnostics, now = Date.now()
|
|
|
304615
304963
|
]).pipe(require_Schema$1.asVoid);
|
|
304616
304964
|
}
|
|
304617
304965
|
//#endregion
|
|
304966
|
+
//#region src/runtimeReplication/pendingLifecycleIntents.ts
|
|
304967
|
+
/**
|
|
304968
|
+
* The newest moment a person or a turn touched this thread, mirroring the
|
|
304969
|
+
* client's `threadLastActivityAt` over the full thread rather than its shell:
|
|
304970
|
+
* the shell's `latestUserMessageAt` is projected from exactly these messages.
|
|
304971
|
+
*/
|
|
304972
|
+
function readModelThreadLastActivityAt(thread) {
|
|
304973
|
+
const candidates = [
|
|
304974
|
+
...thread.messages.filter((message) => message.role === "user").map((m) => m.createdAt),
|
|
304975
|
+
thread.latestTurn?.requestedAt,
|
|
304976
|
+
thread.latestTurn?.startedAt,
|
|
304977
|
+
thread.latestTurn?.completedAt
|
|
304978
|
+
];
|
|
304979
|
+
let latest = null;
|
|
304980
|
+
let latestTimestamp = Number.NEGATIVE_INFINITY;
|
|
304981
|
+
for (const candidate of candidates) {
|
|
304982
|
+
if (candidate === null || candidate === void 0) continue;
|
|
304983
|
+
const timestamp = Date.parse(candidate);
|
|
304984
|
+
if (timestamp > latestTimestamp) {
|
|
304985
|
+
latest = candidate;
|
|
304986
|
+
latestTimestamp = timestamp;
|
|
304987
|
+
}
|
|
304988
|
+
}
|
|
304989
|
+
return latest;
|
|
304990
|
+
}
|
|
304991
|
+
function intentIsSpent(thread, intent) {
|
|
304992
|
+
const lastActivityAt = readModelThreadLastActivityAt(thread);
|
|
304993
|
+
if (lastActivityAt === null) return false;
|
|
304994
|
+
const activity = Date.parse(lastActivityAt);
|
|
304995
|
+
const requested = Date.parse(intent.requestedAt);
|
|
304996
|
+
return Number.isFinite(activity) && Number.isFinite(requested) && activity > requested;
|
|
304997
|
+
}
|
|
304998
|
+
function commandFor(runtimeId, intent) {
|
|
304999
|
+
const commandId = lifecycleIntentCommandId(runtimeId, intent.threadId, intent.requestedAt);
|
|
305000
|
+
const threadId = ThreadId.make(intent.threadId);
|
|
305001
|
+
return intent.action === "settle" ? {
|
|
305002
|
+
type: "thread.settle",
|
|
305003
|
+
commandId,
|
|
305004
|
+
threadId,
|
|
305005
|
+
settledOverride: "settled"
|
|
305006
|
+
} : {
|
|
305007
|
+
type: "thread.unsettle",
|
|
305008
|
+
commandId,
|
|
305009
|
+
threadId
|
|
305010
|
+
};
|
|
305011
|
+
}
|
|
305012
|
+
const applyOne = require_Schema$1.fn("applyLifecycleIntent")(function* (runtimeId, intent, dependencies) {
|
|
305013
|
+
const base = {
|
|
305014
|
+
runtimeId,
|
|
305015
|
+
threadId: intent.threadId,
|
|
305016
|
+
action: intent.action,
|
|
305017
|
+
requestedAt: intent.requestedAt
|
|
305018
|
+
};
|
|
305019
|
+
const report = (outcome, detail) => dependencies.log({
|
|
305020
|
+
...base,
|
|
305021
|
+
outcome,
|
|
305022
|
+
...detail === void 0 ? {} : { detail }
|
|
305023
|
+
}).pipe(require_Schema$1.as(outcome));
|
|
305024
|
+
const thread = (yield* dependencies.getReadModel()).threads.find((candidate) => candidate.id === intent.threadId);
|
|
305025
|
+
if (thread === void 0) return yield* report("missing-thread");
|
|
305026
|
+
if (intentIsSpent(thread, intent)) return yield* report("spent");
|
|
305027
|
+
return yield* dependencies.dispatch(commandFor(runtimeId, intent)).pipe(require_Schema$1.flatMap(() => report("applied")), require_Schema$1.catch_((error) => error._tag === "OrchestrationCommandInvariantError" || error._tag === "OrchestrationCommandPreviouslyRejectedError" ? report("refused", error.detail) : report("failed", error.message)));
|
|
305028
|
+
});
|
|
305029
|
+
/**
|
|
305030
|
+
* One tick: list, apply each, acknowledge everything that got an answer.
|
|
305031
|
+
*
|
|
305032
|
+
* A signed-out owner is not an error to retry into the log every five
|
|
305033
|
+
* minutes; it is a state the desktop leaves when someone signs in, so it is
|
|
305034
|
+
* logged once at info and the tick ends. Any other listing or acknowledgement
|
|
305035
|
+
* failure is returned typed, and the intents stay pending on CMMD.
|
|
305036
|
+
*/
|
|
305037
|
+
function applyPendingLifecycleIntents(input, dependencies) {
|
|
305038
|
+
return require_Schema$1.gen(function* () {
|
|
305039
|
+
const intents = yield* dependencies.listPending();
|
|
305040
|
+
if (intents.length === 0) return;
|
|
305041
|
+
const answered = [];
|
|
305042
|
+
for (const intent of intents) if ((yield* applyOne(input.runtimeId, intent, dependencies)) !== "failed") answered.push({
|
|
305043
|
+
threadId: intent.threadId,
|
|
305044
|
+
requestedAt: intent.requestedAt
|
|
305045
|
+
});
|
|
305046
|
+
if (answered.length === 0) return;
|
|
305047
|
+
yield* dependencies.acknowledge(answered);
|
|
305048
|
+
}).pipe(require_Schema$1.catch_((error) => error.kind === "auth" ? require_Schema$1.logInfo("Lifecycle intents skipped: CMMD sign-in is required.", {
|
|
305049
|
+
runtimeId: input.runtimeId,
|
|
305050
|
+
code: error.code
|
|
305051
|
+
}) : require_Schema$1.fail(error)));
|
|
305052
|
+
}
|
|
305053
|
+
/**
|
|
305054
|
+
* One structured line per intent, so a row that "came back" after a wake can
|
|
305055
|
+
* be explained from the log: applied, refused by the decider, or spent by
|
|
305056
|
+
* newer activity.
|
|
305057
|
+
*/
|
|
305058
|
+
function logLifecycleIntentOutcome(outcome) {
|
|
305059
|
+
const message = `Lifecycle intent ${outcome.outcome}.`;
|
|
305060
|
+
return outcome.outcome === "refused" || outcome.outcome === "failed" ? require_Schema$1.logWarning(message, outcome) : require_Schema$1.logInfo(message, outcome);
|
|
305061
|
+
}
|
|
305062
|
+
//#endregion
|
|
304618
305063
|
//#region src/runtimeReplication/processOutboxItem.ts
|
|
304619
305064
|
function publicationMetricAttributes(item, outcome, failure) {
|
|
304620
305065
|
return {
|
|
@@ -304811,6 +305256,31 @@ const RuntimeReplicationLive = require_Schema$1.effect(RuntimeReplication, requi
|
|
|
304811
305256
|
}).pipe(require_Schema$1.asVoid, require_Schema$1.catchCause((cause) => require_Schema$1.logError("Runtime replication reconciliation failed.", { cause })));
|
|
304812
305257
|
const heartbeat = enqueueAll.pipe(require_Schema$1.repeat(require_Schema$1.spaced("5 minutes")), require_Schema$1.forkScoped);
|
|
304813
305258
|
/**
|
|
305259
|
+
* Settle and un-settle requests a person recorded in CMMD while this
|
|
305260
|
+
* runtime was offline. The first tick runs at once, which is the
|
|
305261
|
+
* startup case (this phase starts after the orchestration reactors);
|
|
305262
|
+
* every heartbeat after that picks up requests made while awake. The
|
|
305263
|
+
* tick handles its own expected failures; the supervisor restarts the
|
|
305264
|
+
* schedule if it ever dies between ticks.
|
|
305265
|
+
*/
|
|
305266
|
+
const lifecycleIntents = runSupervisedRepeat({
|
|
305267
|
+
label: "Lifecycle intent applier",
|
|
305268
|
+
work: applyPendingLifecycleIntents({ runtimeId }, {
|
|
305269
|
+
listPending: () => client.listPendingLifecycleIntents({ runtimeId }),
|
|
305270
|
+
acknowledge: (intents) => client.acknowledgeLifecycleIntents({
|
|
305271
|
+
runtimeId,
|
|
305272
|
+
intents
|
|
305273
|
+
}),
|
|
305274
|
+
dispatch: engine.dispatch,
|
|
305275
|
+
getReadModel: engine.getReadModel,
|
|
305276
|
+
log: logLifecycleIntentOutcome
|
|
305277
|
+
}).pipe(require_Schema$1.catchCause((cause) => require_Schema$1.logError("Lifecycle intent tick failed.", {
|
|
305278
|
+
cause,
|
|
305279
|
+
runtimeId
|
|
305280
|
+
}))),
|
|
305281
|
+
interval: "5 minutes"
|
|
305282
|
+
}).pipe(require_Schema$1.forkScoped);
|
|
305283
|
+
/**
|
|
304814
305284
|
* Closes and reports whatever Active Hour interval is currently open,
|
|
304815
305285
|
* every 5 minutes -- the same cadence as the inventory heartbeat, not
|
|
304816
305286
|
* because the two are related, but because it is a reasonable default
|
|
@@ -304865,6 +305335,7 @@ const RuntimeReplicationLive = require_Schema$1.effect(RuntimeReplication, requi
|
|
|
304865
305335
|
reactor,
|
|
304866
305336
|
providerReactor,
|
|
304867
305337
|
heartbeat,
|
|
305338
|
+
lifecycleIntents,
|
|
304868
305339
|
activeHourFlush,
|
|
304869
305340
|
worker,
|
|
304870
305341
|
observeOutbox
|
|
@@ -314280,7 +314751,7 @@ const MiscRuntimeLayerLive = require_Schema$1.mergeAll(AnalyticsServiceLayerLive
|
|
|
314280
314751
|
const RuntimeDependenciesWithoutPullRequestsLive = ReactorLayerLive.pipe(require_Schema$1.provideMerge(CheckpointingLayerLive), require_Schema$1.provideMerge(GitLayerLive), require_Schema$1.provideMerge(OrchestrationLayerLive), require_Schema$1.provideMerge(ProviderLayerLive), require_Schema$1.provideMerge(TerminalLayerLive), require_Schema$1.provideMerge(AgentBrowserManagerLive), require_Schema$1.provideMerge(require_Schema$1.mergeAll(ThreadDevRuntimeLive, DevTunnelLive.pipe(require_Schema$1.provide$1(ThreadDevRuntimeLive)))), require_Schema$1.provideMerge(PersistenceLayerLive), require_Schema$1.provideMerge(KeybindingsLive), require_Schema$1.provideMerge(ProviderRegistryLive), require_Schema$1.provideMerge(require_Schema$1.mergeAll(ServerSettingsLive, UsageServiceLive.pipe(require_Schema$1.provide$1(ServerSettingsLive), require_Schema$1.provide$1(UsageSessionLookupLive), require_Schema$1.provide$1(UsageRecordedSourceLive.pipe(require_Schema$1.provide$1(OrchestrationLayerLive), require_Schema$1.provide$1(RuntimeReplicationOutboxLive), require_Schema$1.provide$1(ProviderSessionRuntimeRepositoryLive), require_Schema$1.provide$1(TextGenerationSessionRepositoryLive)))))), require_Schema$1.provideMerge(WorkspaceLayerLive), require_Schema$1.provideMerge(WorkspaceReadinessStateLive), require_Schema$1.provideMerge(ProjectFaviconResolverLive), require_Schema$1.provideMerge(RepositoryIdentityResolverLive), require_Schema$1.provideMerge(ServerEnvironmentLive), require_Schema$1.provideMerge(AuthLayerLive), require_Schema$1.provideMerge(ServerSecretStoreLayerLive), require_Schema$1.provideMerge(require_Schema$1.mergeAll(CloudRedisCoordinationLive, CloudStateSyncLive.pipe(require_Schema$1.provide$1(PersistenceLayerLive)))), require_Schema$1.provideMerge(MiscRuntimeLayerLive));
|
|
314281
314752
|
const RuntimeDependenciesLive = pullRequestServiceFactoryLayer.pipe(require_Schema$1.provideMerge(RuntimeDependenciesWithoutPullRequestsLive), require_Schema$1.provideMerge(cmmdProjectIdentityResolverLive.pipe(require_Schema$1.provide$1(RuntimeDependenciesWithoutPullRequestsLive))), require_Schema$1.provideMerge(pullRequestProviderRuntimeLive));
|
|
314282
314753
|
const RuntimeServicesLive = ServerRuntimeStartupLive.pipe(require_Schema$1.provideMerge(RuntimeDependenciesLive));
|
|
314283
|
-
const makeRoutesLayer = require_Schema$1.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,
|
|
314754
|
+
const makeRoutesLayer = require_Schema$1.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, ...cmmdProxyRouteLayers, cmmdWorkIntakeRouteLayer, cmmdWsTokenRouteLayer, cmmdGetProjectCommentsRouteLayer, cmmdAddProjectCommentRouteLayer, cmmdUpdateProjectRouteLayer, cmmdUploadTaskAttachmentRouteLayer, cmmdUpdateTaskCommentRouteLayer, cmmdListWorkspaceMembersRouteLayer, cmmdAddProjectMemberRouteLayer, cmmdUpdateProjectAgentMemberAvatarRouteLayer, runtimeReplicationStatusRouteLayer, cmmdRefreshProviderUsageRouteLayer, cmmdForgeCloudProjectsListRouteLayer, cmmdForgeCloudProjectsEventsRouteLayer, cmmdForgeRuntimesEnsureRouteLayer, cmmdForgeRuntimesConnectRouteLayer, ownerRuntimeCodexReadinessRouteLayer, cmmdForgeRuntimesStatusRouteLayer, cmmdForgeRuntimesStartRouteLayer, cmmdForgeRuntimesStopRouteLayer, cmmdForgeRuntimesRecycleRouteLayer, cmmdForgeRuntimesUpdateCommitRouteLayer, cmmdForgeRuntimesDestroyRouteLayer, mobileProviderCatalogRouteLayer, 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(require_Schema$1.provide$1(browserApiCorsLayer));
|
|
314284
314755
|
const makeServerLayer = require_Schema$1.unwrap(require_Schema$1.gen(function* () {
|
|
314285
314756
|
const config = yield* ServerConfig;
|
|
314286
314757
|
fixPath({ preferProcessPath: config.forgeCmmdRuntimeMode === true });
|