@cmmd-center/forge 0.9.4 → 0.9.6
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/{BunHttpServer-BgNCpQzV.mjs → BunHttpServer-C_855q3m.mjs} +6 -6
- package/dist/{BunHttpServer-DOAuw4Iq.cjs → BunHttpServer-Dxx0kzQc.cjs} +6 -6
- package/dist/{BunPTY-D-Klry5N.mjs → BunPTY-B7ThejfA.mjs} +3 -3
- package/dist/{BunPTY-2icf7sRj.cjs → BunPTY-BjHFZATJ.cjs} +3 -3
- package/dist/{BunServices-ChM4mYH9.mjs → BunServices-BFygTrvx.mjs} +3 -3
- package/dist/{BunServices-CiNXNzHD.cjs → BunServices-U1VBnEJS.cjs} +3 -3
- package/dist/{Cache-XSj5g7uG.cjs → Cache-BRhFH80U.cjs} +3 -3
- package/dist/{Cache-Cm78WiyU.mjs → Cache-CHvh_vWI.mjs} +3 -3
- package/dist/{Config-DMA9WqtC.cjs → Config-BHRBB8XM.cjs} +2 -2
- package/dist/{Config-DrOyN3WS.mjs → Config-To1VEqlB.mjs} +2 -2
- package/dist/{HttpServer-aJkhz6yu.cjs → HttpServer-BTcgkY38.cjs} +123 -4
- package/dist/{HttpServer-ByyNdEXm.mjs → HttpServer-DV-x5DVo.mjs} +118 -4
- package/dist/{NodeHttpServer-D_ismXpd.cjs → NodeHttpServer-D6YVHsL8.cjs} +7 -7
- package/dist/{NodeHttpServer-C_wePPV0.mjs → NodeHttpServer-DgD75IAg.mjs} +7 -7
- package/dist/{NodePTY-cb7HIasY.cjs → NodePTY-Bd9mvI6U.cjs} +4 -4
- package/dist/{NodePTY-BMUFdM93.mjs → NodePTY-RnitYPTs.mjs} +4 -4
- package/dist/{NodeServices-BAl07hlH.cjs → NodeServices-BcQL_53W.cjs} +1 -1
- package/dist/{NodeServices-BISZRY3e.cjs → NodeServices-BjmXNhpe.cjs} +3 -3
- package/dist/{NodeServices-Bqqy4DuH.mjs → NodeServices-Da5rUDDE.mjs} +3 -3
- package/dist/{NodeSqliteClient-SsUCk9mA.cjs → NodeSqliteClient-CG_mPdVp.cjs} +6 -6
- package/dist/{NodeSqliteClient-OdI1TawL.mjs → NodeSqliteClient-CcLD4Zvr.mjs} +6 -6
- package/dist/{NodeTerminal-B9u7fFYa.cjs → NodeTerminal-D86oor5_.cjs} +3 -3
- package/dist/{NodeTerminal-_XekCzf-.mjs → NodeTerminal-Ke6chk0A.mjs} +3 -3
- package/dist/{PTY-U3JQnLXS.cjs → PTY-BB84iC10.cjs} +2 -2
- package/dist/{PTY-CBkE5akF.mjs → PTY-X-4Tv31s.mjs} +2 -2
- package/dist/{Path-Bwl3ltR5.mjs → Path-DJTwK58E.mjs} +2 -2
- package/dist/{Path-CsbBuCFB.cjs → Path-qpublmG3.cjs} +2 -2
- package/dist/{Schema-CTXk8IgN.mjs → Schema-CKuz8TX8.mjs} +61 -6
- package/dist/{Schema-Bij_WAra.cjs → Schema-DaFukK_y.cjs} +72 -5
- package/dist/{SqlError-C2mi8_tp.cjs → SqlError-CsWFS-OU.cjs} +3 -3
- package/dist/{SqlError-1c-3v7GY.mjs → SqlError-DhK0hV8S.mjs} +3 -3
- package/dist/{SqliteClient-CdAhI4lb.cjs → SqliteClient-BpjZWL6O.cjs} +5 -5
- package/dist/{SqliteClient-aoOb51gB.mjs → SqliteClient-CA7vjiUj.mjs} +5 -5
- package/dist/bin.cjs +435 -88
- package/dist/bin.mjs +458 -112
- package/dist/{open-FIgTDosf.mjs → open-D8mGyWmt.mjs} +3 -3
- package/dist/runtimeBootstrap.cjs +1 -1
- package/dist/runtimeBootstrap.mjs +1 -1
- package/dist/{runtimeControlAuthority-Dm9z5ziU.mjs → runtimeControlAuthority-L85w5RTn.mjs} +33 -3
- package/dist/{runtimeControlAuthority-Dx6Y5LPI.cjs → runtimeControlAuthority-SNBF5Mjy.cjs} +33 -3
- package/package.json +1 -1
package/dist/bin.mjs
CHANGED
|
@@ -1,18 +1,18 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
|
|
3
3
|
import { a as __toCommonJS, i as __require, n as __esmMin, o as __toESM, r as __exportAll, t as __commonJSMin } from "./chunk-C5ckVeoz.mjs";
|
|
4
|
-
import { $ as
|
|
5
|
-
import { $ as toAsyncIterable, A as isStream, At as offerUnsafe, C as fromChannel, Ct as end, D as fromQueue, Dt as make$42, E as fromPubSub, F as merge$4, Ft as unbounded$2, G as runFold, Gt as interrupt$4, H as run$2, Ht as makeUnsafe$7, It as publish, K as runForEach, Lt as shutdown$2, M as map$7, Mt as sliding, N as mapEffect$1, Nt as take$1, Ot as offer$1, Pt as takeAll, Q as tick, R as onExit$1, Rt as subscribe$1, S as fromAsyncIterable, St as bounded, T as fromIterable$1, Tt as failCause$4, U as runCollect, Ut as await_, V as provideContext$1, W as runDrain, Wt as getCurrent, Y as succeed$4, Z as takeWhile, _ as ensuring$1, _t as fromTransform, at as make$44, b as filter$2, bt as make$41, d as concat$2, dt as drain, f as debounce$1, ft as forEach$1, g as encodeText, h as empty$5, ht as mapInput, i as FileSystem, it as get$4, j as make$43, jt as shutdown$1, k as fromSubscription, kt as offerAll, l as callback$1, p as decodeText$1, q as runForEachArray, qt as runIn, rt as unwrap$1, t as Path$2, u as catchCause$1, w as fromEffect, x as flatMap$3, xt as makeUnsafe$6, y as failCause$5, zt as unbounded$1 } from "./Path-
|
|
6
|
-
import { _ as ChildProcessSpawner, a as Stdio, g as make$45, o as make$46, r as isQuitError } from "./NodeTerminal-
|
|
7
|
-
import { n as layer$7 } from "./NodeServices-
|
|
8
|
-
import { $ as
|
|
9
|
-
import { _ as withDefault$3, a as all$1, c as logLevel, d as option$1, f as port, g as url$2, i as TrueValues, l as map$8, m as string$7, n as FalseValues, o as boolean$5, p as schema$2, r as Record$1, s as int$3, t as Boolean$2, u as number$2 } from "./Config-
|
|
10
|
-
import { a as make$48, i as keys, n as getOption, o as makeWith$1, r as invalidate, s as set$3, t as get$7 } from "./Cache-
|
|
11
|
-
import { S as layer$9, _ as defaultEscape, a as DeadlockError, b as makeCompiler$1, c as SqlError, d as UnknownError, g as custom, h as make$49, i as ConstraintError, l as SqlSyntaxError, m as SqlClient, n as AuthorizationError, o as LockTimeoutError, r as ConnectionError, s as SerializationError, t as AuthenticationError, u as StatementTimeoutError, v as defaultTransforms, y as fragment } from "./SqlError-
|
|
4
|
+
import { $ as encodeEffect, $a as fail$2, $c as map$5, $l as pipe$1, $n as filterOrFail, $r as runPromiseWith, $s as toSeconds, $t as stringifyJson, Aa as addFinalizerExit, Ac as succeed$1, Ai as whileLoop, An as cached$3, As as MinimumTraceLevel, At as withConstructorDefault, Bc as makeUnsafe$3, Bi as snapshotUnsafe, Bl as isTagged, Bn as context, Br as promise, Bs as format$1, Bt as head, C as Record, Ca as provideMerge, Ci as undefined_, Cl as format, Cn as andThen, Cr as makeSpanScoped, Cs as sync, Ct as optionalKey, D as TaggedStruct, Da as unwrap, Dc as isFailure$1, Di as useSpan, Dl as equals, Dn as as$3, Do as pretty, Ds as void_$2, Dt as toCodecStringTree, E as TaggedErrorClass, Ea as sync$2, En as annotateSpans, Eo as map$6, Er as mapError, Et as toCodecJson, F as UndefinedOr, Fa as makeUnsafe$4, Fc as get$3, Fi as withTracerEnabled, Fl as isNotNull, Fn as catchIf, Fo as addFinalizer, Fs as make$40, G as decodeExit, Ga as failCause$3, Gc as flatten$1, Gi as both, Gr as raceFirst, Gt as Transformation, H as declare, Ha as _await, Hi as update$3, Hn as currentSpan, Hr as provideContext, Hs as fromInputUnsafe, Ht as size$2, I as Union, Ia as provide$2, Ii as yieldNow, Il as isNotNullish, In as catchReason, Io as andThen$1, Ir as onInterrupt, It as assign, J as decodeUnknownEffect, Jc as getOrElse, Jl as constVoid, Jn as fail, Jr as retry, Js as min, Jt as transformOrFail, K as decodeSync, Kc as fromNullishOr, Ki as exponential, Kl as constTrue, Kn as ensuring, Kr as repeat, Ks as max, L as Unknown, La as CurrentLogAnnotations, Li as zipWith, Ll as isNotUndefined, Ln as catchTag, Lo as as$2, Lr as option, Lt as append$1, M as URLFromString, Ma as closeUnsafe, Mc as Service$1, Mn as catchCause, Mo as CurrentLoggers$1, Mr as never$1, Ms as ParentSpan, Na as forkUnsafe, Nc as add$2, Ni as withParentSpan, Nl as compose$1, Nn as catchDefect, Nr as onError$1, Ns as Tracer, O as TemplateLiteral, Oa as Scope$1, Oc as isSuccess$1, Oi as void_$1, On as asSome, Oo as prettyErrors, Or as match$1, Ot as toJsonSchemaDocument, P as Undefined, Pa as make$35, Pc as empty$1, Pi as withSpan, Pl as hasProperty, Pn as catchFilter, Pr as onExit, Ps as externalSpan, Q as encode$4, Qa as die$2, Qc as isSome, Qi as catchDone, Ql as identity, Qn as filterMapOrFail, Qs as toMillis, R as UnknownFromJsonString$1, Ra as CurrentLogSpans, Rc as getUnsafe$1, Ri as counter, Rl as isNullish, Rn as catchTags, Rr as orDie, Rt as drop$1, S as Option, Sa as provide$1, Si as txRetry, Sl as toJson, Sn as all, So as interruptors, Sr as logWarning$1, Ss as suspend, St as optional$4, T as Struct, Ta as succeedContext, Ti as uninterruptibleMask$1, Tn as annotateLogs, Ts as uninterruptibleMask, Tt as tag, Uc as firstSomeOf, Ui as withAttributes, Ul as cast, Ur as provideService, Ut as toArray, V as brand, Va as TracerTimingEnabled, Vc as merge$2, Vi as timer, Vn as contextWith, Vo as consolePretty$1, Vr as provide, Vs as fromInput, Vt as isEmpty$2, W as decodeEffect, Wa as fail$3, Wc as flatMap$2, Wi as addDelay, Wl as compose, Wn as die$1, Wr as race, X as decodeUnknownOption, Xc as getOrUndefined, Xi as recurs, Xl as dual, Xo as fiberInterrupt, Xr as runForkWith, Xs as seconds, Xt as onSome, Y as decodeUnknownExit, Ya as make$37, Yc as getOrNull, Yi as passthrough$1, Yl as constant, Yn as failCause$1, Yr as runFork, Ys as minutes, Z as decodeUnknownSync, Za as succeed$3, Zc as isNone, Zi as spaced, Zn as filter$1, Zr as runPromise, Zs as times, Zt as parseJson$1, _ as NonEmptyArray, _a as empty$4, _i as timeoutOption, _l as isEffect$1, _n as toUtc, _r as log$4, _s as scopeAddFinalizerExit, _t as isSchemaError, a as DateTimeUtc, aa as parse$6, ac as flatMapNullishOr, ai as serviceOption, an as value, ar as forEach, as as forever, at as isBetween, b as NullOr, ba as merge$3, bi as try_, bn as acquireUseRelease, bo as hasInterruptsOnly, br as logFatal, bt as makeFilter, c as Defect, ca as Class$1, cc as isReadonlyArrayNonEmpty, ci as succeedNone, cn as add$3, co as NoSuchElementError, cr as forkDetach$1, ct as isGreaterThanOrEqualTo, d as Exit, da as CurrentMemoMap, di as sync$1, dn as isGreaterThanOrEqualTo$1, dr as gen, dt as isMaxLength, ec as zero, el as match, eo as failCause$2, er as flatMap, et as encodeSync, eu as pipeArguments, fa as build, fc as map$4, fi as tap, fn as make$36, fr as ignore, ft as isMaxProperties, g as Never, ga as effectDiscard, gi as timeout, gn as toEpochMillis, gr as isEffect, gs as scope, gt as isSchema, h as Literals, ha as effectContext, hc as sort, hi as tapErrorTag, hn as toDate, hr as interruptible, hs as reportCauseUnsafe, ht as isPattern, i as Class, ia as clamp, ic as filter, ii as service, il as make$39, in as make$38, io as match$2, ir as fnUntraced, is as fnUntraced$1, it as is$1, ja as close, jc as Reference$1, ji as withFiber$1, jn as callback, jo as ConsoleRef, jr as matchEffect, js as NativeSpan, jt as withDecodingDefault, k as Trim, ka as addFinalizer$1, kn as asVoid, ko as squash, kr as matchCauseEffect, kt as toType, l as Duration, li as succeedSome, ll as PipeInspectableProto, ln as distance, lo as StackTrace, lr as forkIn, ls as loggerMake, lt as isInt, m as Literal, ma as effect, mc as reverse, mi as tapError, mn as now, mo as fail$4, mr as interrupt$1, mt as isNonEmpty, n as ArraySchema, nc as empty$3, ni as scoped, nl as some, no as isFailure, nr as flatten$2, nt as encodeUnknownExit, o as DateTimeUtcFromString, oa as Clock, oc as fromIterable, oi as sleep$4, oo as void_$3, or as forever$1, os as forkDetach, ot as isFinite$1, p as Int$1, pa as buildWithMemoMap, pi as tapCause, pn as makeUnsafe$5, po as done, pr as ignoreCause, pt as isMinLength, q as decodeTo, qc as fromUndefinedOr, qi as forever$2, ql as constUndefined, qn as exit, qr as result, qs as millis, r as Boolean$1, ra as Random$1, rc as ensure, rl as Number$2, rn as makeFormatterDefault, ro as isSuccess, rr as fn$1, rs as flatMap$1, rt as fromJsonString, sa as currentTimeMillis, sc as isArrayNonEmpty, si as succeed, sn as encodeBase64Url$2, sr as forkChild, st as isGreaterThan, t as Any, ta as isDoneCause, tc as allocate, ti as scope$1, tl as none$4, tn as InvalidValue$1, to as interrupt$3, tt as encodeUnknownEffect, u as ErrorClass, ua as TaggedError, ui as suspend$1, ul as YieldableProto, un as formatIso, ur as forkScoped, ut as isLessThanOrEqualTo, v as NonEmptyString, vi as timeoutOrElse, vl as withFiber, vn as Transaction$1, vo as hasDies, vr as logDebug, vs as sleep$3, w as String$1, wa as succeed$2, wc as fail$1, wi as uninterruptible, wn as annotateCurrentSpan, wr as map$3, ws as tracerLogger$1, wt as suspend$2, x as Number$1, xa as mergeAll, xi as tx$1, xl as NodeInspectSymbol, xn as addFinalizer$2, xo as interrupt$2, xr as logInfo, xt as mutable, y as Null, ya as launch$1, yi as tryPromise, yn as acquireRelease, yo as hasInterrupts, yr as logError, yt as make$34, z as Void, za as MinimumLogLevel, zc as make$33, zi as gauge, zl as isObject$1, zn as catch_, zr as orElseSucceed, zs as days, zt as empty$2 } from "./Schema-CKuz8TX8.mjs";
|
|
5
|
+
import { $ as toAsyncIterable, A as isStream, At as offerUnsafe, C as fromChannel, Ct as end, D as fromQueue, Dt as make$42, E as fromPubSub, F as merge$4, Ft as unbounded$2, G as runFold, Gt as interrupt$4, H as run$2, Ht as makeUnsafe$7, It as publish, K as runForEach, Lt as shutdown$2, M as map$7, Mt as sliding, N as mapEffect$1, Nt as take$1, Ot as offer$1, Pt as takeAll, Q as tick, R as onExit$1, Rt as subscribe$1, S as fromAsyncIterable, St as bounded, T as fromIterable$1, Tt as failCause$4, U as runCollect, Ut as await_, V as provideContext$1, W as runDrain, Wt as getCurrent, Y as succeed$4, Z as takeWhile, _ as ensuring$1, _t as fromTransform, at as make$44, b as filter$2, bt as make$41, d as concat$2, dt as drain, f as debounce$1, ft as forEach$1, g as encodeText, h as empty$5, ht as mapInput, i as FileSystem, it as get$4, j as make$43, jt as shutdown$1, k as fromSubscription, kt as offerAll, l as callback$1, p as decodeText$1, q as runForEachArray, qt as runIn, rt as unwrap$1, t as Path$2, u as catchCause$1, w as fromEffect, x as flatMap$3, xt as makeUnsafe$6, y as failCause$5, zt as unbounded$1 } from "./Path-DJTwK58E.mjs";
|
|
6
|
+
import { _ as ChildProcessSpawner, a as Stdio, g as make$45, o as make$46, r as isQuitError } from "./NodeTerminal-Ke6chk0A.mjs";
|
|
7
|
+
import { n as layer$7 } from "./NodeServices-Da5rUDDE.mjs";
|
|
8
|
+
import { $ as jsonUnsafe, A as SocketErrorReason, Bt as updateAndGet, Ct as jsonUnsafe$1, Dt as fromRecordUnsafe, Et as fromInput$1, Ft as make$47, G as filterStatusOk$1, I as HttpServerError, It as makeUnsafe$8, K as retryTransient, Lt as modify$3, Mt as get$5, Nt as getAndSet, Ot as merge$5, Pt as getUnsafe$2, Q as isHttpServerResponse, Rt as set$2, St as isHttpClientError, Tt as empty$7, U as layer$8, W as HttpClient, X as empty$6, Y as symbol$1, Z as file, _ as schemaBodyUrlParams, _t as bodyJson, a as withLogAddress, at as setHeader, bt as setBody, ct as uint8Array, d as logger$1, et as raw, f as withLoggerDisabled, g as schemaBodyJson, gt as bearerToken, ht as acceptJson, i as serve$1, it as setCookies, lt as filterStatusOk, m as ParsedSearchParams, mt as schemaBodyJson$1, nt as schemaJson, ot as stream, p as HttpServerRequest, rt as setCookie, st as text$1, t as HttpServer, tt as redirect, u as cors, ut as matchStatus, v as schemaHeaders, vt as get$6, xt as HttpClientErrorSchema, y as toURL, yt as post, z as RouteNotFound, zt as update$4 } from "./HttpServer-DV-x5DVo.mjs";
|
|
9
|
+
import { _ as withDefault$3, a as all$1, c as logLevel, d as option$1, f as port, g as url$2, i as TrueValues, l as map$8, m as string$7, n as FalseValues, o as boolean$5, p as schema$2, r as Record$1, s as int$3, t as Boolean$2, u as number$2 } from "./Config-To1VEqlB.mjs";
|
|
10
|
+
import { a as make$48, i as keys, n as getOption, o as makeWith$1, r as invalidate, s as set$3, t as get$7 } from "./Cache-CHvh_vWI.mjs";
|
|
11
|
+
import { S as layer$9, _ as defaultEscape, a as DeadlockError, b as makeCompiler$1, c as SqlError, d as UnknownError, g as custom, h as make$49, i as ConstraintError, l as SqlSyntaxError, m as SqlClient, n as AuthorizationError, o as LockTimeoutError, r as ConnectionError, s as SerializationError, t as AuthenticationError, u as StatementTimeoutError, v as defaultTransforms, y as fragment } from "./SqlError-DhK0hV8S.mjs";
|
|
12
12
|
import { a as diag, c as SpanKind$1, d as TraceFlags, f as ROOT_CONTEXT, i as propagation, l as isSpanContextValid, m as DiagLogLevel, n as init_esm$1, o as context$1, p as createContextKey, r as trace, s as SpanStatusCode, t as esm_exports$1 } from "./esm-Ce1GqbVk.mjs";
|
|
13
13
|
import { t as Mime_default } from "./Mime-BITO-E1U.mjs";
|
|
14
|
-
import { a as verifyCmmdAuthRuntimeTicket, c as verifyCmmdRuntimeTicketRefreshProof, d as createReadOnceFileTokenAccessor, i as sendRuntimeControlHeartbeat, l as runtimeGrantToken, n as bootstrapRuntimeControlAuthorityFromNarrowGrant, o as verifyCmmdClaudeReadinessTicket, r as readRuntimeControlAuthority, s as verifyCmmdRuntimeTicket, t as bootstrapRuntimeControlAuthority, u as setRuntimeGrantToken } from "./runtimeControlAuthority-
|
|
15
|
-
import { n as PtySpawnError, t as PtyAdapter } from "./PTY-
|
|
14
|
+
import { a as verifyCmmdAuthRuntimeTicket, c as verifyCmmdRuntimeTicketRefreshProof, d as createReadOnceFileTokenAccessor, i as sendRuntimeControlHeartbeat, l as runtimeGrantToken, n as bootstrapRuntimeControlAuthorityFromNarrowGrant, o as verifyCmmdClaudeReadinessTicket, r as readRuntimeControlAuthority, s as verifyCmmdRuntimeTicket, t as bootstrapRuntimeControlAuthority, u as setRuntimeGrantToken } from "./runtimeControlAuthority-L85w5RTn.mjs";
|
|
15
|
+
import { n as PtySpawnError, t as PtyAdapter } from "./PTY-X-4Tv31s.mjs";
|
|
16
16
|
import { createRequire } from "node:module";
|
|
17
17
|
import * as HE from "node:child_process";
|
|
18
18
|
import { execFile, execFileSync, spawn, spawnSync } from "node:child_process";
|
|
@@ -22,7 +22,7 @@ import { createCipheriv, createDecipheriv, createHash, createHmac, createPublicK
|
|
|
22
22
|
import * as FS$1 from "node:fs";
|
|
23
23
|
import fs, { accessSync, chmodSync, constants, createReadStream, existsSync, mkdirSync, mkdtempSync, promises, readFile, readFileSync, readdir, readdirSync, realpathSync, rmSync, statSync, writeFileSync } from "node:fs";
|
|
24
24
|
import * as NodeOS from "node:os";
|
|
25
|
-
import
|
|
25
|
+
import $U, { homedir, networkInterfaces, tmpdir } from "node:os";
|
|
26
26
|
import * as Path$1 from "node:path";
|
|
27
27
|
import path, { basename, delimiter, dirname, extname, isAbsolute, join, posix, relative, resolve, sep } from "node:path";
|
|
28
28
|
import { pathToFileURL } from "node:url";
|
|
@@ -17588,6 +17588,7 @@ const ExecutionEnvironmentCapabilities = Struct({
|
|
|
17588
17588
|
pullRequests: optionalKey(Boolean$1),
|
|
17589
17589
|
threadPullRequestLinking: optionalKey(Boolean$1),
|
|
17590
17590
|
cloudMode: Boolean$1.pipe(withDecodingDefault(succeed(false))),
|
|
17591
|
+
threadSettlement: optionalKey(Boolean$1),
|
|
17591
17592
|
posthogPublicKey: NullOr(String$1).pipe(withDecodingDefault(succeed(null))),
|
|
17592
17593
|
posthogHost: NullOr(String$1).pipe(withDecodingDefault(succeed(null))),
|
|
17593
17594
|
runtime: optionalKey(ExecutionEnvironmentRuntimeCapabilities),
|
|
@@ -52182,7 +52183,7 @@ function _supportsColor(haveStream, { streamIsTTY, sniffFlags = true } = {}) {
|
|
|
52182
52183
|
const min = forceColor || 0;
|
|
52183
52184
|
if (env.TERM === "dumb") return min;
|
|
52184
52185
|
if (process$1.platform === "win32") {
|
|
52185
|
-
const osRelease =
|
|
52186
|
+
const osRelease = $U.release().split(".");
|
|
52186
52187
|
if (Number(osRelease[0]) >= 10 && Number(osRelease[2]) >= 10586) return Number(osRelease[2]) >= 14931 ? 3 : 2;
|
|
52187
52188
|
return 1;
|
|
52188
52189
|
}
|
|
@@ -54625,7 +54626,7 @@ var require_ProcessDetector = /* @__PURE__ */ __commonJSMin(((exports) => {
|
|
|
54625
54626
|
exports.processDetector = void 0;
|
|
54626
54627
|
const api_1 = (init_esm$1(), __toCommonJS(esm_exports$1));
|
|
54627
54628
|
const semconv_1 = require_semconv$1();
|
|
54628
|
-
const os$
|
|
54629
|
+
const os$3 = __require("os");
|
|
54629
54630
|
/**
|
|
54630
54631
|
* ProcessDetector will be used to detect the resources related current process running
|
|
54631
54632
|
* and being instrumented from the NodeJS Process module.
|
|
@@ -54647,7 +54648,7 @@ var require_ProcessDetector = /* @__PURE__ */ __commonJSMin(((exports) => {
|
|
|
54647
54648
|
};
|
|
54648
54649
|
if (process.argv.length > 1) attributes[semconv_1.ATTR_PROCESS_COMMAND] = process.argv[1];
|
|
54649
54650
|
try {
|
|
54650
|
-
const userInfo = os$
|
|
54651
|
+
const userInfo = os$3.userInfo();
|
|
54651
54652
|
attributes[semconv_1.ATTR_PROCESS_OWNER] = userInfo.username;
|
|
54652
54653
|
} catch (e) {
|
|
54653
54654
|
api_1.diag.debug(`error obtaining process owner: ${e}`);
|
|
@@ -67570,7 +67571,7 @@ function normalizeNumberish(value) {
|
|
|
67570
67571
|
}
|
|
67571
67572
|
//#endregion
|
|
67572
67573
|
//#region package.json
|
|
67573
|
-
var version$1 = "0.9.
|
|
67574
|
+
var version$1 = "0.9.5";
|
|
67574
67575
|
//#endregion
|
|
67575
67576
|
//#region src/sentry.ts
|
|
67576
67577
|
const SERVER_APP_NAME = "forge-server";
|
|
@@ -67972,6 +67973,30 @@ const respondToAuthError = (error) => gen(function* () {
|
|
|
67972
67973
|
}));
|
|
67973
67974
|
return response;
|
|
67974
67975
|
});
|
|
67976
|
+
const OAUTH_ACCESS_TOKEN_TYPE = "urn:ietf:params:oauth:token-type:access_token";
|
|
67977
|
+
/**
|
|
67978
|
+
* The one exchange this endpoint performs, or the reason it will not.
|
|
67979
|
+
*
|
|
67980
|
+
* Returns a message rather than a boolean so the route can say which field was
|
|
67981
|
+
* wrong: an operator debugging a pairing failure otherwise cannot tell an
|
|
67982
|
+
* unsupported grant from an unsupported token type.
|
|
67983
|
+
*/
|
|
67984
|
+
function rejectUnsupportedTokenExchange(input) {
|
|
67985
|
+
if (input.grant_type !== "urn:ietf:params:oauth:grant-type:token-exchange") return "Unsupported grant_type.";
|
|
67986
|
+
if (input.subject_token_type !== "urn:t3:params:oauth:token-type:environment-bootstrap") return "Unsupported subject_token_type.";
|
|
67987
|
+
if (input.requested_token_type !== "urn:ietf:params:oauth:token-type:access_token") return "Unsupported requested_token_type.";
|
|
67988
|
+
return null;
|
|
67989
|
+
}
|
|
67990
|
+
/**
|
|
67991
|
+
* `expires_in` is a duration in seconds; a session carries an absolute instant.
|
|
67992
|
+
*
|
|
67993
|
+
* Clamped at zero so a session that expired between issuance and this call is
|
|
67994
|
+
* reported as already expired rather than as a negative lifetime, which a client
|
|
67995
|
+
* could read as a very large unsigned value.
|
|
67996
|
+
*/
|
|
67997
|
+
function accessTokenExpiresInSeconds(remainingMillis) {
|
|
67998
|
+
return Math.max(0, Math.floor(remainingMillis / 1e3));
|
|
67999
|
+
}
|
|
67975
68000
|
//#endregion
|
|
67976
68001
|
//#region ../../packages/shared/src/cmmdIdentity.ts
|
|
67977
68002
|
const MAX_CMMD_AVATAR_URL_LENGTH = 256 * 1024;
|
|
@@ -69171,6 +69196,16 @@ const CommandOAuthDeviceInput = Struct({
|
|
|
69171
69196
|
return_url: optionalKey(String$1),
|
|
69172
69197
|
scope: optionalKey(String$1)
|
|
69173
69198
|
});
|
|
69199
|
+
const OAuthTokenExchangeInput = Struct({
|
|
69200
|
+
grant_type: String$1,
|
|
69201
|
+
subject_token: String$1,
|
|
69202
|
+
subject_token_type: String$1,
|
|
69203
|
+
requested_token_type: String$1,
|
|
69204
|
+
scope: optional$4(String$1),
|
|
69205
|
+
client_label: optional$4(String$1),
|
|
69206
|
+
client_device_type: optional$4(String$1),
|
|
69207
|
+
client_os: optional$4(String$1)
|
|
69208
|
+
});
|
|
69174
69209
|
const CommandOAuthTokenInput = Struct({
|
|
69175
69210
|
grant_type: String$1,
|
|
69176
69211
|
device_code: String$1,
|
|
@@ -70012,6 +70047,50 @@ const authBearerBootstrapRouteLayer = add$1("POST", "/api/auth/bootstrap/bearer"
|
|
|
70012
70047
|
})));
|
|
70013
70048
|
return jsonUnsafe(yield* serverAuth.exchangeBootstrapCredentialForBearerSession(payload.credential, deriveAuthClientMetadata({ request })), { status: 200 });
|
|
70014
70049
|
}).pipe(catchTag("AuthError", (error) => respondToAuthError(error))));
|
|
70050
|
+
/**
|
|
70051
|
+
* FORGE COMPAT. `POST /oauth/token` — the RFC 8693 token exchange the vendored
|
|
70052
|
+
* t3code client uses to turn a pairing credential into a bearer token.
|
|
70053
|
+
*
|
|
70054
|
+
* Forge's own clients call `/api/auth/bootstrap/bearer` with JSON. The mobile app
|
|
70055
|
+
* cannot: the endpoint is baked into the vendored contract
|
|
70056
|
+
* (packages/t3-contracts/src/environmentHttp.ts) as a form-urlencoded OAuth
|
|
70057
|
+
* exchange, and without it every attempt to add an environment fails with a 404 —
|
|
70058
|
+
* which leaves the whole app unusable, since no screen works before an
|
|
70059
|
+
* environment exists.
|
|
70060
|
+
*
|
|
70061
|
+
* This is a shape adapter, not a second way to authenticate. It performs no
|
|
70062
|
+
* validation of its own and mints nothing: it forwards the subject token to the
|
|
70063
|
+
* same `exchangeBootstrapCredentialForBearerSession` the JSON route uses, so the
|
|
70064
|
+
* credential rules, expiry and session issuance stay in one place. The only work
|
|
70065
|
+
* here is vocabulary — form encoding in, OAuth field names out.
|
|
70066
|
+
*
|
|
70067
|
+
* Same pattern as the vcs.* handlers in ws.ts: the Forge server speaks upstream's
|
|
70068
|
+
* dialect over Forge's own services, rather than the vendored client being patched
|
|
70069
|
+
* to speak Forge's.
|
|
70070
|
+
*/
|
|
70071
|
+
const authOAuthTokenExchangeRouteLayer = add$1("POST", "/oauth/token", gen(function* () {
|
|
70072
|
+
const request = yield* HttpServerRequest;
|
|
70073
|
+
const serverAuth = yield* ServerAuth;
|
|
70074
|
+
const payload = yield* schemaBodyUrlParams(OAuthTokenExchangeInput).pipe(mapError((cause) => new AuthError({
|
|
70075
|
+
message: "Invalid token exchange payload.",
|
|
70076
|
+
status: 400,
|
|
70077
|
+
cause
|
|
70078
|
+
})));
|
|
70079
|
+
const refusal = rejectUnsupportedTokenExchange(payload);
|
|
70080
|
+
if (refusal !== null) return yield* new AuthError({
|
|
70081
|
+
message: refusal,
|
|
70082
|
+
status: 400
|
|
70083
|
+
});
|
|
70084
|
+
const session = yield* serverAuth.exchangeBootstrapCredentialForBearerSession(payload.subject_token, deriveAuthClientMetadata({ request }));
|
|
70085
|
+
const expiresInSeconds = accessTokenExpiresInSeconds(toMillis(distance(yield* now, session.expiresAt)));
|
|
70086
|
+
return jsonUnsafe({
|
|
70087
|
+
access_token: session.sessionToken,
|
|
70088
|
+
issued_token_type: OAUTH_ACCESS_TOKEN_TYPE,
|
|
70089
|
+
token_type: "Bearer",
|
|
70090
|
+
expires_in: expiresInSeconds,
|
|
70091
|
+
scope: payload.scope ?? session.role
|
|
70092
|
+
}, { status: 200 });
|
|
70093
|
+
}).pipe(catchTag("AuthError", (error) => respondToAuthError(error))));
|
|
70015
70094
|
const authWebSocketTokenRouteLayer = add$1("POST", "/api/auth/ws-token", gen(function* () {
|
|
70016
70095
|
const request = yield* HttpServerRequest;
|
|
70017
70096
|
const serverAuth = yield* ServerAuth;
|
|
@@ -76071,7 +76150,7 @@ var require_node_gyp_build = /* @__PURE__ */ __commonJSMin(((exports, module) =>
|
|
|
76071
76150
|
var fs$6 = __require("fs");
|
|
76072
76151
|
var path$5 = __require("path");
|
|
76073
76152
|
var url$1 = __require("url");
|
|
76074
|
-
var os$
|
|
76153
|
+
var os$2 = __require("os");
|
|
76075
76154
|
var runtimeRequire = typeof __webpack_require__ === "function" ? __non_webpack_require__ : __require;
|
|
76076
76155
|
var vars = process.config && process.config.variables || {};
|
|
76077
76156
|
var prebuildsOnly = !!process.env.PREBUILDS_ONLY;
|
|
@@ -76079,8 +76158,8 @@ var require_node_gyp_build = /* @__PURE__ */ __commonJSMin(((exports, module) =>
|
|
|
76079
76158
|
var abi = versions.modules;
|
|
76080
76159
|
if (versions.deno || process.isBun) abi = "unsupported";
|
|
76081
76160
|
var runtime = isElectron() ? "electron" : isNwjs() ? "node-webkit" : "node";
|
|
76082
|
-
var arch = process.env.npm_config_arch || os$
|
|
76083
|
-
var platform = process.env.npm_config_platform || os$
|
|
76161
|
+
var arch = process.env.npm_config_arch || os$2.arch();
|
|
76162
|
+
var platform = process.env.npm_config_platform || os$2.platform();
|
|
76084
76163
|
var libc = process.env.LIBC || (isMusl(platform) ? "musl" : "glibc");
|
|
76085
76164
|
var armv = process.env.ARM_VERSION || (arch === "arm64" ? "8" : vars.arm_version) || "";
|
|
76086
76165
|
var uv = (versions.uv || "").split(".")[0];
|
|
@@ -93715,7 +93794,7 @@ const launchDetached = (launch) => gen(function* () {
|
|
|
93715
93794
|
});
|
|
93716
93795
|
const OpenLive = effect(Open, gen(function* () {
|
|
93717
93796
|
const open = yield* tryPromise({
|
|
93718
|
-
try: () => import("./open-
|
|
93797
|
+
try: () => import("./open-D8mGyWmt.mjs"),
|
|
93719
93798
|
catch: (cause) => new OpenError$1({
|
|
93720
93799
|
message: "failed to load browser opener",
|
|
93721
93800
|
cause
|
|
@@ -98815,14 +98894,9 @@ function mapClaudeRateLimitInfo(info) {
|
|
|
98815
98894
|
}
|
|
98816
98895
|
const cachedSnapshots = /* @__PURE__ */ new Map();
|
|
98817
98896
|
let localClaudeGenerationHash = null;
|
|
98818
|
-
let localClaudeGenerationId = null;
|
|
98819
98897
|
function setLocalClaudeUsageGeneration(generationId) {
|
|
98820
|
-
localClaudeGenerationId = generationId;
|
|
98821
98898
|
localClaudeGenerationHash = createHash("sha256").update(generationId).digest("hex");
|
|
98822
98899
|
}
|
|
98823
|
-
function currentClaudeUsageGenerationId() {
|
|
98824
|
-
return localClaudeGenerationId;
|
|
98825
|
-
}
|
|
98826
98900
|
function currentClaudeUsageGenerationHash() {
|
|
98827
98901
|
const value = process.env.FORGE_PERSONAL_CLAUDE_GENERATION_HASH?.trim() ?? "";
|
|
98828
98902
|
return /^[a-f0-9]{64}$/.test(value) ? value : localClaudeGenerationHash;
|
|
@@ -99242,6 +99316,16 @@ function extractClaudeProviderAccountId(response) {
|
|
|
99242
99316
|
const providerAccountId = account.providerAccountId.trim();
|
|
99243
99317
|
return providerAccountId.length > 0 ? providerAccountId : null;
|
|
99244
99318
|
}
|
|
99319
|
+
/**
|
|
99320
|
+
* Logs a usage-publish failure, or does nothing when there was none. The null
|
|
99321
|
+
* check lives here rather than in syncClaudeCredentialForSession so that
|
|
99322
|
+
* reporting the failure costs that generator no branches.
|
|
99323
|
+
*/
|
|
99324
|
+
const logUsagePublishFailure = (failure, path) => failure === null ? void_$1 : logWarning$1("cmmd-claude-cred-sync: usage publish failed after deposit", {
|
|
99325
|
+
error: failure.cause instanceof Error ? failure.cause.message : String(failure.cause),
|
|
99326
|
+
stack: failure.cause instanceof Error ? failure.cause.stack : void 0,
|
|
99327
|
+
path
|
|
99328
|
+
});
|
|
99245
99329
|
async function publishClaudeUsageAfterSync(input) {
|
|
99246
99330
|
try {
|
|
99247
99331
|
const usage = await input.loadUsage({
|
|
@@ -99264,13 +99348,16 @@ async function publishClaudeUsageAfterSync(input) {
|
|
|
99264
99348
|
observedAt: (/* @__PURE__ */ new Date()).toISOString()
|
|
99265
99349
|
}
|
|
99266
99350
|
});
|
|
99267
|
-
|
|
99351
|
+
return null;
|
|
99352
|
+
} catch (cause) {
|
|
99353
|
+
return { cause };
|
|
99354
|
+
}
|
|
99268
99355
|
}
|
|
99269
99356
|
async function finalizeClaudeCredentialSync(input) {
|
|
99270
99357
|
const providerAccountId = extractClaudeProviderAccountId(input.response);
|
|
99271
|
-
if (providerAccountId === null) return;
|
|
99358
|
+
if (providerAccountId === null) return null;
|
|
99272
99359
|
if (input.auth.path === USER_CLAUDE_CREDENTIAL_PATH) setLocalClaudeUsageGeneration(providerAccountId);
|
|
99273
|
-
|
|
99360
|
+
return publishClaudeUsageAfterSync({
|
|
99274
99361
|
auth: input.auth,
|
|
99275
99362
|
providerAccountId,
|
|
99276
99363
|
accountEmail: input.accountEmail,
|
|
@@ -99325,7 +99412,7 @@ function syncClaudeCredentialForSession(input) {
|
|
|
99325
99412
|
}
|
|
99326
99413
|
})).pipe(orElseSucceed(() => null));
|
|
99327
99414
|
if (response === null) return { status: "failed" };
|
|
99328
|
-
yield* promise(() => finalizeClaudeCredentialSync({
|
|
99415
|
+
yield* logUsagePublishFailure(yield* promise(() => finalizeClaudeCredentialSync({
|
|
99329
99416
|
response,
|
|
99330
99417
|
auth,
|
|
99331
99418
|
accountEmail,
|
|
@@ -99333,7 +99420,7 @@ function syncClaudeCredentialForSession(input) {
|
|
|
99333
99420
|
planType: metadata.planType ?? probedMetadata.planType ?? null,
|
|
99334
99421
|
...input.homePath ? { homePath: input.homePath } : {},
|
|
99335
99422
|
loadUsage: input.loadUsage ?? fetchClaudeUsageViaOfficialClient
|
|
99336
|
-
}));
|
|
99423
|
+
})), auth.path);
|
|
99337
99424
|
return { status: "synced" };
|
|
99338
99425
|
});
|
|
99339
99426
|
}
|
|
@@ -113363,8 +113450,8 @@ effectDiscard(runMigrations());
|
|
|
113363
113450
|
//#endregion
|
|
113364
113451
|
//#region src/persistence/Layers/Sqlite.ts
|
|
113365
113452
|
const defaultSqliteClientLoaders = {
|
|
113366
|
-
bun: () => import("./SqliteClient-
|
|
113367
|
-
node: () => import("./NodeSqliteClient-
|
|
113453
|
+
bun: () => import("./SqliteClient-CA7vjiUj.mjs"),
|
|
113454
|
+
node: () => import("./NodeSqliteClient-CcLD4Zvr.mjs")
|
|
113368
113455
|
};
|
|
113369
113456
|
const makeRuntimeSqliteLayer = fn$1("makeRuntimeSqliteLayer")(function* (config) {
|
|
113370
113457
|
const loader = defaultSqliteClientLoaders[process.versions.bun !== void 0 ? "bun" : "node"];
|
|
@@ -146704,22 +146791,58 @@ function runtimeAuthoritySessionId(input) {
|
|
|
146704
146791
|
if (input.authSessionId) return input.authSessionId;
|
|
146705
146792
|
return input.threadId ? readThreadSessionId(input.threadId) : null;
|
|
146706
146793
|
}
|
|
146794
|
+
/**
|
|
146795
|
+
* Pure mapping from the three preconditions to an outcome.
|
|
146796
|
+
*
|
|
146797
|
+
* Split out so the reason can be tested without an Effect runtime, env vars or
|
|
146798
|
+
* module mocking — the decision is the thing worth pinning, not the plumbing
|
|
146799
|
+
* around it.
|
|
146800
|
+
*/
|
|
146801
|
+
function resolveBrokerTicketOutcome(input) {
|
|
146802
|
+
if (input.identityMode === "legacy") return {
|
|
146803
|
+
kind: "ticket",
|
|
146804
|
+
token: input.legacyGrantToken
|
|
146805
|
+
};
|
|
146806
|
+
if (input.identityMode === "invalid") return {
|
|
146807
|
+
kind: "unavailable",
|
|
146808
|
+
reason: "runtime identity is incomplete or invalid"
|
|
146809
|
+
};
|
|
146810
|
+
if (!input.sessionId) return {
|
|
146811
|
+
kind: "unavailable",
|
|
146812
|
+
reason: "no owner session is bound to this request"
|
|
146813
|
+
};
|
|
146814
|
+
return input.brokerAuthority ? {
|
|
146815
|
+
kind: "ticket",
|
|
146816
|
+
token: input.brokerAuthority
|
|
146817
|
+
} : {
|
|
146818
|
+
kind: "unavailable",
|
|
146819
|
+
reason: "no live broker authority for this session"
|
|
146820
|
+
};
|
|
146821
|
+
}
|
|
146707
146822
|
function runtimeProviderBrokerToken(input) {
|
|
146708
146823
|
const identity = classifyRuntimeBrokerIdentity({
|
|
146709
146824
|
machineId: configuredRuntimeMachineId() ?? void 0,
|
|
146710
146825
|
credentialEpoch: configuredRuntimeCredentialEpoch(),
|
|
146711
146826
|
brokerAuthorityMode: process.env.FORGE_CMMD_RUNTIME_BROKER_AUTHORITY_MODE
|
|
146712
146827
|
});
|
|
146713
|
-
if (identity.mode
|
|
146714
|
-
|
|
146828
|
+
if (identity.mode !== "exact") return resolveBrokerTicketOutcome({
|
|
146829
|
+
identityMode: identity.mode,
|
|
146830
|
+
legacyGrantToken: identity.mode === "legacy" ? runtimeGrantToken() : null,
|
|
146831
|
+
sessionId: null,
|
|
146832
|
+
brokerAuthority: null
|
|
146833
|
+
});
|
|
146715
146834
|
const sessionId = runtimeAuthoritySessionId(input);
|
|
146716
|
-
|
|
146717
|
-
|
|
146835
|
+
return resolveBrokerTicketOutcome({
|
|
146836
|
+
identityMode: "exact",
|
|
146837
|
+
legacyGrantToken: null,
|
|
146718
146838
|
sessionId,
|
|
146719
|
-
|
|
146720
|
-
|
|
146721
|
-
|
|
146722
|
-
|
|
146839
|
+
brokerAuthority: sessionId ? readRuntimeBrokerAuthority({
|
|
146840
|
+
sessionId,
|
|
146841
|
+
runtimeId: process.env.FORGE_CMMD_RUNTIME_ID,
|
|
146842
|
+
machineId: identity.machineId,
|
|
146843
|
+
credentialEpoch: identity.credentialEpoch,
|
|
146844
|
+
requiredScope: "provider"
|
|
146845
|
+
}) : null
|
|
146723
146846
|
});
|
|
146724
146847
|
}
|
|
146725
146848
|
async function fetchRuntimeProviderGrant(input) {
|
|
@@ -146764,8 +146887,9 @@ const issueProviderEgressCredential = (input) => tryPromise({
|
|
|
146764
146887
|
async function issueCmmdRuntimeProviderEgressCredential(input) {
|
|
146765
146888
|
const controlPlaneUrl = process.env.FORGE_COMMAND_APP_URL.replace(/\/+$/, "");
|
|
146766
146889
|
const runtimeId = encodeURIComponent(process.env.FORGE_CMMD_RUNTIME_ID);
|
|
146767
|
-
const
|
|
146768
|
-
if (
|
|
146890
|
+
const brokerTicket = runtimeProviderBrokerToken(input);
|
|
146891
|
+
if (brokerTicket.kind === "unavailable") throw new Error(`Provider token issuance requires a live exact-machine broker authority for this runtime epoch (${brokerTicket.reason}).`);
|
|
146892
|
+
const runtimeGrantToken = brokerTicket.token;
|
|
146769
146893
|
const response = await fetchRuntimeProviderGrant({
|
|
146770
146894
|
url: `${controlPlaneUrl}/api/forge/runtimes/${runtimeId}/provider/token`,
|
|
146771
146895
|
token: runtimeGrantToken,
|
|
@@ -186052,7 +186176,7 @@ var Vce = {
|
|
|
186052
186176
|
function Ve() {
|
|
186053
186177
|
return Vce;
|
|
186054
186178
|
}
|
|
186055
|
-
var Us =
|
|
186179
|
+
var Us = $U.homedir(), lk = $U.tmpdir(), { env: Vc } = process$1, Yce = (e) => {
|
|
186056
186180
|
let t = path.join(Us, "Library");
|
|
186057
186181
|
return {
|
|
186058
186182
|
data: path.join(t, "Application Support", e),
|
|
@@ -196252,12 +196376,12 @@ function qZ(e, t) {
|
|
|
196252
196376
|
}
|
|
196253
196377
|
return n;
|
|
196254
196378
|
}
|
|
196255
|
-
var os$
|
|
196379
|
+
var os$1 = "https://code.claude.com/docs/en", kKe = [
|
|
196256
196380
|
{
|
|
196257
196381
|
matches: (e) => e.path === "permissions.defaultMode" && e.code === "invalid_value",
|
|
196258
196382
|
tip: {
|
|
196259
196383
|
suggestion: "Valid modes: \"acceptEdits\" (ask before file changes), \"plan\" (analysis only), \"bypassPermissions\" (auto-accept all), or \"default\" (standard behavior)",
|
|
196260
|
-
docLink: `${os$
|
|
196384
|
+
docLink: `${os$1}/iam#permission-modes`
|
|
196261
196385
|
}
|
|
196262
196386
|
},
|
|
196263
196387
|
{
|
|
@@ -196272,7 +196396,7 @@ var os$2 = "https://code.claude.com/docs/en", kKe = [
|
|
|
196272
196396
|
matches: (e) => e.path.startsWith("env.") && e.code === "invalid_type",
|
|
196273
196397
|
tip: {
|
|
196274
196398
|
suggestion: "Environment variables must be strings. Wrap numbers and booleans in quotes. Example: \"DEBUG\": \"true\", \"PORT\": \"3000\"",
|
|
196275
|
-
docLink: `${os$
|
|
196399
|
+
docLink: `${os$1}/settings#environment-variables`
|
|
196276
196400
|
}
|
|
196277
196401
|
},
|
|
196278
196402
|
{
|
|
@@ -196283,14 +196407,14 @@ var os$2 = "https://code.claude.com/docs/en", kKe = [
|
|
|
196283
196407
|
matches: (e) => e.path.startsWith("hooks.") && e.code === "invalid_key",
|
|
196284
196408
|
tip: {
|
|
196285
196409
|
suggestion: "Not a recognized hook event. Common events: PreToolUse, PostToolUse, UserPromptSubmit, SessionStart, SessionEnd, Stop. Check spelling and capitalization.",
|
|
196286
|
-
docLink: `${os$
|
|
196410
|
+
docLink: `${os$1}/hooks`
|
|
196287
196411
|
}
|
|
196288
196412
|
},
|
|
196289
196413
|
{
|
|
196290
196414
|
matches: (e) => /\.hooks\.\d+\.command$/.test(e.path) && e.code === "invalid_type" && e.received === "undefined",
|
|
196291
196415
|
tip: {
|
|
196292
196416
|
suggestion: "Command hooks require `command`. For exec form (no shell), set `command` to the executable and `args` to its arguments: {\"type\": \"command\", \"command\": \"echo\", \"args\": [\"hi\"]}. For shell form, set `command` to the full shell string: {\"type\": \"command\", \"command\": \"echo hi\"}.",
|
|
196293
|
-
docLink: `${os$
|
|
196417
|
+
docLink: `${os$1}/hooks#exec-form-and-shell-form`
|
|
196294
196418
|
}
|
|
196295
196419
|
},
|
|
196296
196420
|
{
|
|
@@ -196305,7 +196429,7 @@ var os$2 = "https://code.claude.com/docs/en", kKe = [
|
|
|
196305
196429
|
matches: (e) => e.code === "unrecognized_keys",
|
|
196306
196430
|
tip: {
|
|
196307
196431
|
suggestion: "Check for typos or refer to the documentation for valid fields",
|
|
196308
|
-
docLink: `${os$
|
|
196432
|
+
docLink: `${os$1}/settings`
|
|
196309
196433
|
}
|
|
196310
196434
|
},
|
|
196311
196435
|
{
|
|
@@ -196320,13 +196444,13 @@ var os$2 = "https://code.claude.com/docs/en", kKe = [
|
|
|
196320
196444
|
matches: (e) => e.path === "permissions.additionalDirectories" && e.code === "invalid_type",
|
|
196321
196445
|
tip: {
|
|
196322
196446
|
suggestion: "Must be an array of directory paths. Example: [\"~/projects\", \"/tmp/workspace\"]. You can also use --add-dir flag or /add-dir command",
|
|
196323
|
-
docLink: `${os$
|
|
196447
|
+
docLink: `${os$1}/iam#working-directories`
|
|
196324
196448
|
}
|
|
196325
196449
|
}
|
|
196326
196450
|
], AKe = {
|
|
196327
|
-
permissions: `${os$
|
|
196328
|
-
env: `${os$
|
|
196329
|
-
hooks: `${os$
|
|
196451
|
+
permissions: `${os$1}/iam#configuring-permissions`,
|
|
196452
|
+
env: `${os$1}/settings#environment-variables`,
|
|
196453
|
+
hooks: `${os$1}/hooks`
|
|
196330
196454
|
};
|
|
196331
196455
|
function GZ(e) {
|
|
196332
196456
|
let t = kKe.find((r) => r.matches(e));
|
|
@@ -205013,6 +205137,48 @@ function applyPluginSkillPermissionsToDynamicTools(tools, settings) {
|
|
|
205013
205137
|
});
|
|
205014
205138
|
}
|
|
205015
205139
|
//#endregion
|
|
205140
|
+
//#region src/github/forgeGitHubToolHandler.ts
|
|
205141
|
+
/**
|
|
205142
|
+
* Shared wiring for Forge's brokered GitHub tools.
|
|
205143
|
+
*
|
|
205144
|
+
* Both provider surfaces run the same handler: Codex exposes the tools
|
|
205145
|
+
* natively, Claude reaches them over in-process MCP (`GitHubMcpServer.ts`).
|
|
205146
|
+
* The auth binding, the write confirmation gate and the audit trail live here
|
|
205147
|
+
* so a new surface cannot accidentally omit one — the handler's own defaults
|
|
205148
|
+
* are deliberately inert (no audit, never confirmed), which is safe for tests
|
|
205149
|
+
* but wrong for a real turn.
|
|
205150
|
+
*/
|
|
205151
|
+
function createForgeGitHubToolHandlerOptions(deps) {
|
|
205152
|
+
const { runWithRuntimeContext } = deps;
|
|
205153
|
+
return {
|
|
205154
|
+
broker: new GitHubBroker({
|
|
205155
|
+
resolveJwt: (auth) => runWithRuntimeContext(resolveCmmdJwtForSession({
|
|
205156
|
+
sessionId: auth.sessionId,
|
|
205157
|
+
logPrefix: deps.logPrefix,
|
|
205158
|
+
...auth.subject !== void 0 ? { subject: auth.subject } : {},
|
|
205159
|
+
...auth.forceRefresh !== void 0 ? { forceRefresh: auth.forceRefresh } : {}
|
|
205160
|
+
})),
|
|
205161
|
+
githubWriteIdentity: deps.githubWriteIdentity
|
|
205162
|
+
}),
|
|
205163
|
+
resolveAuth: async (threadId) => {
|
|
205164
|
+
const binding = await runWithRuntimeContext(readThreadAuthSession(threadId));
|
|
205165
|
+
return binding ? {
|
|
205166
|
+
sessionId: binding.sessionId,
|
|
205167
|
+
...binding.subject ? { subject: binding.subject } : {}
|
|
205168
|
+
} : null;
|
|
205169
|
+
},
|
|
205170
|
+
recordAudit: (auditEvent) => runWithRuntimeContext(recordGitHubToolAuditEvent(auditEvent).pipe(asVoid)),
|
|
205171
|
+
createConfirmation: (confirmation) => runWithRuntimeContext(createGitHubToolConfirmation(confirmation)),
|
|
205172
|
+
isConfirmed: (confirmation) => runWithRuntimeContext(consumeApprovedOrLatestGitHubToolConfirmation({
|
|
205173
|
+
confirmationId: confirmation.confirmationId,
|
|
205174
|
+
threadId: confirmation.threadId,
|
|
205175
|
+
toolName: confirmation.toolName,
|
|
205176
|
+
request: confirmation.request
|
|
205177
|
+
})),
|
|
205178
|
+
bypassWriteConfirmation: deps.bypassWriteConfirmation
|
|
205179
|
+
};
|
|
205180
|
+
}
|
|
205181
|
+
//#endregion
|
|
205016
205182
|
//#region src/provider/shellSafety.ts
|
|
205017
205183
|
const SHELL_SAFE_COMMAND_PATH_PATTERN = /^[A-Za-z0-9_.\-/\\:]+$/;
|
|
205018
205184
|
function isShellSafeCommandPath(command) {
|
|
@@ -206301,33 +206467,12 @@ const makeCodexAdapter = fn$1("makeCodexAdapter")(function* (options) {
|
|
|
206301
206467
|
}));
|
|
206302
206468
|
const browserToolEnvironmentId = yield* resolveBrowserToolEnvironmentId$1();
|
|
206303
206469
|
const computerManager = resolveComputerManager(serverConfig);
|
|
206304
|
-
const githubDynamicToolHandler = createCodexGitHubDynamicToolHandler({
|
|
206305
|
-
|
|
206306
|
-
|
|
206307
|
-
|
|
206308
|
-
logPrefix: "codex-github",
|
|
206309
|
-
...auth.subject !== void 0 ? { subject: auth.subject } : {},
|
|
206310
|
-
...auth.forceRefresh !== void 0 ? { forceRefresh: auth.forceRefresh } : {}
|
|
206311
|
-
})),
|
|
206312
|
-
githubWriteIdentity: settings.githubWriteIdentity
|
|
206313
|
-
}),
|
|
206314
|
-
resolveAuth: async (threadId) => {
|
|
206315
|
-
const binding = await runWithRuntimeContext(readThreadAuthSession(threadId));
|
|
206316
|
-
return binding ? {
|
|
206317
|
-
sessionId: binding.sessionId,
|
|
206318
|
-
...binding.subject ? { subject: binding.subject } : {}
|
|
206319
|
-
} : null;
|
|
206320
|
-
},
|
|
206321
|
-
recordAudit: (auditEvent) => runWithRuntimeContext(recordGitHubToolAuditEvent(auditEvent).pipe(asVoid)),
|
|
206322
|
-
createConfirmation: (confirmation) => runWithRuntimeContext(createGitHubToolConfirmation(confirmation)),
|
|
206323
|
-
isConfirmed: (confirmation) => runWithRuntimeContext(consumeApprovedOrLatestGitHubToolConfirmation({
|
|
206324
|
-
confirmationId: confirmation.confirmationId,
|
|
206325
|
-
threadId: confirmation.threadId,
|
|
206326
|
-
toolName: confirmation.toolName,
|
|
206327
|
-
request: confirmation.request
|
|
206328
|
-
})),
|
|
206470
|
+
const githubDynamicToolHandler = createCodexGitHubDynamicToolHandler(createForgeGitHubToolHandlerOptions({
|
|
206471
|
+
runWithRuntimeContext,
|
|
206472
|
+
githubWriteIdentity: settings.githubWriteIdentity,
|
|
206473
|
+
logPrefix: "codex-github",
|
|
206329
206474
|
bypassWriteConfirmation: input.runtimeMode === "full-access"
|
|
206330
|
-
});
|
|
206475
|
+
}));
|
|
206331
206476
|
const cmmdConnectorDynamicToolHandler = createCodexCmmdConnectorDynamicToolHandler({ resolveAuth: async (threadId) => {
|
|
206332
206477
|
const binding = await runWithRuntimeContext(readThreadAuthSession(threadId));
|
|
206333
206478
|
if (!binding) return null;
|
|
@@ -207871,6 +208016,62 @@ function createDevServerMcpServer(deps, threadId) {
|
|
|
207871
208016
|
});
|
|
207872
208017
|
}
|
|
207873
208018
|
//#endregion
|
|
208019
|
+
//#region src/github/GitHubMcpServer.ts
|
|
208020
|
+
/**
|
|
208021
|
+
* Brokered Forge GitHub tools, exposed to the Claude surface (in-process MCP).
|
|
208022
|
+
*
|
|
208023
|
+
* The Codex app-server consumes these tools as native dynamic tools; Claude
|
|
208024
|
+
* reaches them through MCP instead. Both surfaces dispatch the SAME handler
|
|
208025
|
+
* (`createCodexGitHubDynamicToolHandler`), so auth resolution, the write
|
|
208026
|
+
* confirmation gate and the audit trail are shared rather than reimplemented
|
|
208027
|
+
* per provider — this module only adapts descriptor + result shapes.
|
|
208028
|
+
*
|
|
208029
|
+
* Without it a Claude agent has no brokered push path at all and falls back to
|
|
208030
|
+
* raw `git`, which the runtime deliberately blocks via `GIT_ASKPASS=/bin/false`.
|
|
208031
|
+
*
|
|
208032
|
+
* Result envelopes are relayed verbatim as tool content: the web approval card
|
|
208033
|
+
* is built by scanning tool results for `userActionRequired`, so summarising or
|
|
208034
|
+
* reshaping the payload here would silently strip the user's ability to approve
|
|
208035
|
+
* a write.
|
|
208036
|
+
*/
|
|
208037
|
+
const GITHUB_MCP_SERVER_NAME = "forge-github";
|
|
208038
|
+
/** Joins the brokered result's content items back into a single text payload. */
|
|
208039
|
+
function readResultText(contentItems) {
|
|
208040
|
+
return contentItems.map((item) => item.text).filter((text) => typeof text === "string").join("\n");
|
|
208041
|
+
}
|
|
208042
|
+
/**
|
|
208043
|
+
* Factored out of `createGitHubMcpServer` (mirroring the Sidekick tools server)
|
|
208044
|
+
* so dispatch and envelope handling are testable without the SDK's `tool()` /
|
|
208045
|
+
* `createSdkMcpServer` machinery.
|
|
208046
|
+
*/
|
|
208047
|
+
function buildGitHubToolHandlers(runBrokeredTool, threadId) {
|
|
208048
|
+
return createCodexGitHubDynamicTools().map((descriptor) => ({
|
|
208049
|
+
name: descriptor.name,
|
|
208050
|
+
description: descriptor.description,
|
|
208051
|
+
inputSchema: jsonSchemaToZodShape(descriptor.inputSchema),
|
|
208052
|
+
handler: async (args) => {
|
|
208053
|
+
const result = await runBrokeredTool({
|
|
208054
|
+
threadId,
|
|
208055
|
+
tool: descriptor.name,
|
|
208056
|
+
arguments: args
|
|
208057
|
+
});
|
|
208058
|
+
return {
|
|
208059
|
+
content: [{
|
|
208060
|
+
type: "text",
|
|
208061
|
+
text: readResultText(result.contentItems)
|
|
208062
|
+
}],
|
|
208063
|
+
...result.success ? {} : { isError: true }
|
|
208064
|
+
};
|
|
208065
|
+
}
|
|
208066
|
+
}));
|
|
208067
|
+
}
|
|
208068
|
+
function createGitHubMcpServer(runBrokeredTool, threadId) {
|
|
208069
|
+
return z1e({
|
|
208070
|
+
name: GITHUB_MCP_SERVER_NAME,
|
|
208071
|
+
tools: buildGitHubToolHandlers(runBrokeredTool, threadId).map((entry) => U1e(entry.name, entry.description, entry.inputSchema, entry.handler))
|
|
208072
|
+
});
|
|
208073
|
+
}
|
|
208074
|
+
//#endregion
|
|
207874
208075
|
//#region src/provider/providerAuthFailureCopy.ts
|
|
207875
208076
|
/**
|
|
207876
208077
|
* Rewrite provider auth failures into an action the user can actually take.
|
|
@@ -208175,6 +208376,7 @@ function buildClaudeMcpServers(input) {
|
|
|
208175
208376
|
"forge-browser": createBrowserMcpServer(input.browserManager, input.threadId, browserToolScope(input.browserToolEnvironmentId)),
|
|
208176
208377
|
"forge-dev-server": createDevServerMcpServer(input.devServerToolDeps, input.threadId),
|
|
208177
208378
|
"cmmd-context": createCmmdContextMcpServer(input.threadId, input.resolveCmmdPat),
|
|
208379
|
+
[GITHUB_MCP_SERVER_NAME]: createGitHubMcpServer(input.runBrokeredGitHubTool, input.threadId),
|
|
208178
208380
|
...input.computerManager ? { [COMPUTER_MCP_SERVER_NAME]: createComputerMcpServer(input.computerManager, input.threadId) } : {},
|
|
208179
208381
|
...input.cmmdSidekickTools ? { "cmmd-sidekick-tools": createCmmdSidekickToolsMcpServer(input.cmmdSidekickTools.session, input.cmmdSidekickTools.tools) } : {}
|
|
208180
208382
|
};
|
|
@@ -210184,6 +210386,12 @@ const makeClaudeAdapter = fn$1("makeClaudeAdapter")(function* (options) {
|
|
|
210184
210386
|
const permissionMode = permissionModeForRuntimeMode(input.runtimeMode);
|
|
210185
210387
|
const settings = claudeQuerySettings(modelConfig.thinking, modelConfig.fastMode);
|
|
210186
210388
|
const systemPrompt = buildClaudeSystemPrompt(modelConfig.endpointProfile, serverSettings.coauthorIncludeForge);
|
|
210389
|
+
const runBrokeredGitHubTool = createCodexGitHubDynamicToolHandler(createForgeGitHubToolHandlerOptions({
|
|
210390
|
+
runWithRuntimeContext: runWithSqlRuntimeContext,
|
|
210391
|
+
githubWriteIdentity: serverSettings.githubWriteIdentity,
|
|
210392
|
+
logPrefix: "claude-github",
|
|
210393
|
+
bypassWriteConfirmation: input.runtimeMode === "full-access"
|
|
210394
|
+
}));
|
|
210187
210395
|
const queryRuntime = yield* createClaudeQueryRuntime(prompt, buildClaudeQueryOptions({
|
|
210188
210396
|
cwd: input.cwd,
|
|
210189
210397
|
effectiveApiModelId: modelConfig.effectiveApiModelId,
|
|
@@ -210203,7 +210411,8 @@ const makeClaudeAdapter = fn$1("makeClaudeAdapter")(function* (options) {
|
|
|
210203
210411
|
computerManager,
|
|
210204
210412
|
resolveCmmdPat,
|
|
210205
210413
|
devServerToolDeps,
|
|
210206
|
-
cmmdSidekickTools
|
|
210414
|
+
cmmdSidekickTools,
|
|
210415
|
+
runBrokeredGitHubTool
|
|
210207
210416
|
}), threadId);
|
|
210208
210417
|
const session = buildClaudeProviderSession({
|
|
210209
210418
|
threadId,
|
|
@@ -260386,7 +260595,7 @@ var import_multicast_dns = /* @__PURE__ */ __toESM((/* @__PURE__ */ __commonJSMi
|
|
|
260386
260595
|
var dgram = __require("dgram");
|
|
260387
260596
|
var thunky = require_thunky();
|
|
260388
260597
|
var events = __require("events");
|
|
260389
|
-
var os
|
|
260598
|
+
var os = __require("os");
|
|
260390
260599
|
var noop = function() {};
|
|
260391
260600
|
module.exports = function(opts) {
|
|
260392
260601
|
if (!opts) opts = {};
|
|
@@ -260517,14 +260726,14 @@ var import_multicast_dns = /* @__PURE__ */ __toESM((/* @__PURE__ */ __commonJSMi
|
|
|
260517
260726
|
return that;
|
|
260518
260727
|
};
|
|
260519
260728
|
function defaultInterface() {
|
|
260520
|
-
var networks = os
|
|
260729
|
+
var networks = os.networkInterfaces();
|
|
260521
260730
|
var names = Object.keys(networks);
|
|
260522
260731
|
for (var i = 0; i < names.length; i++) {
|
|
260523
260732
|
var net = networks[names[i]];
|
|
260524
260733
|
for (var j = 0; j < net.length; j++) {
|
|
260525
260734
|
var iface = net[j];
|
|
260526
260735
|
if (isIPv4(iface.family) && !iface.internal) {
|
|
260527
|
-
if (os
|
|
260736
|
+
if (os.platform() === "darwin" && names[i] === "en0") return iface.address;
|
|
260528
260737
|
return "0.0.0.0";
|
|
260529
260738
|
}
|
|
260530
260739
|
}
|
|
@@ -260532,7 +260741,7 @@ var import_multicast_dns = /* @__PURE__ */ __toESM((/* @__PURE__ */ __commonJSMi
|
|
|
260532
260741
|
return "127.0.0.1";
|
|
260533
260742
|
}
|
|
260534
260743
|
function allInterfaces() {
|
|
260535
|
-
var networks = os
|
|
260744
|
+
var networks = os.networkInterfaces();
|
|
260536
260745
|
var names = Object.keys(networks);
|
|
260537
260746
|
var res = [];
|
|
260538
260747
|
for (var i = 0; i < names.length; i++) {
|
|
@@ -283117,7 +283326,9 @@ const ProviderCommandReactorLive = effect(ProviderCommandReactor, gen(function*
|
|
|
283117
283326
|
projects: readModel.projects
|
|
283118
283327
|
});
|
|
283119
283328
|
if (!cwd) return "Forge could not resolve the project folder for this thread.";
|
|
283120
|
-
|
|
283329
|
+
const isCloudExecutionRuntime = serverConfig.forgeCmmdRuntimeMode === true;
|
|
283330
|
+
const managedRoots = [serverConfig.cloudProjectsRoot, serverConfig.worktreesDir];
|
|
283331
|
+
if (isCloudExecutionRuntime && !isPathInsideAnyRoot(cwd, managedRoots)) return `Forge blocked this agent turn because the project folder is outside the managed runtime workspace. Folder: ${cwd}. Managed roots: ${managedRoots.join(", ")}.`;
|
|
283121
283332
|
if (thread.anchorKind === "task" && project?.repositoryIdentity == null && !isGitWorkspace(cwd)) return "Forge created this task thread, but the project folder is not a Git repository yet. Import or link the repository before starting an agent turn.";
|
|
283122
283333
|
return null;
|
|
283123
283334
|
});
|
|
@@ -288475,6 +288686,7 @@ function executionEnvironmentCapabilities(serverConfig) {
|
|
|
288475
288686
|
repositoryIdentity: true,
|
|
288476
288687
|
pullRequests: isExecutionPlane,
|
|
288477
288688
|
threadPullRequestLinking: isExecutionPlane,
|
|
288689
|
+
threadSettlement: isExecutionPlane,
|
|
288478
288690
|
cloudMode: serverConfig.forgeCmmdRuntimeMode === true || isCloudShell,
|
|
288479
288691
|
runtime: {
|
|
288480
288692
|
topology: runtimeTopology(serverConfig),
|
|
@@ -289444,6 +289656,95 @@ effect(ServerSecretStore, makeLocalServerSecretStore);
|
|
|
289444
289656
|
const ServerSecretStoreRuntimeLive = effect(ServerSecretStore, gen(function* () {
|
|
289445
289657
|
return (yield* ServerConfig).forgeCloudShellMode === true ? yield* makePostgresServerSecretStore : yield* makeLocalServerSecretStore;
|
|
289446
289658
|
}));
|
|
289659
|
+
//#endregion
|
|
289660
|
+
//#region src/runtimeAuth/controlAuthorityRetry.ts
|
|
289661
|
+
/**
|
|
289662
|
+
* When to try for control authority again.
|
|
289663
|
+
*
|
|
289664
|
+
* CMMD ships continuously, so a Forge Cloud runtime will outlive restarts of its
|
|
289665
|
+
* own control plane. Obtaining authority is therefore not a startup-time
|
|
289666
|
+
* question: a runtime that asks once, gets an infrastructure page mid-deploy and
|
|
289667
|
+
* gives up stays unauthenticated until something happens to restart it while
|
|
289668
|
+
* CMMD is healthy. Measured: hours, on a Sprite whose guest was serving fine the
|
|
289669
|
+
* whole time.
|
|
289670
|
+
*
|
|
289671
|
+
* Two shapes of failure arrive here and they need opposite answers, which is why
|
|
289672
|
+
* `retryable` is decided at the boundary that saw the response rather than
|
|
289673
|
+
* guessed at here.
|
|
289674
|
+
*/
|
|
289675
|
+
/** First backoff. Short on purpose: a deploy cutover is seconds, not minutes. */
|
|
289676
|
+
const BASE_DELAY_MS = 1e3;
|
|
289677
|
+
/**
|
|
289678
|
+
* Ceiling. Unbounded doubling turns a long outage into a long TAIL: an hour down
|
|
289679
|
+
* would be followed by up to an hour of avoidable downtime after recovery.
|
|
289680
|
+
*/
|
|
289681
|
+
const MAX_DELAY_MS = 6e4;
|
|
289682
|
+
/**
|
|
289683
|
+
* Spread, as a fraction of the delay. A fleet loses authority at the same
|
|
289684
|
+
* instant when the control plane restarts, so without this every runtime
|
|
289685
|
+
* retries in lockstep and the recovering CMMD takes the whole fleet at once.
|
|
289686
|
+
*
|
|
289687
|
+
* Kept below 1 so jitter can only ADD: a later attempt must never be scheduled
|
|
289688
|
+
* sooner than an earlier one, or backoff stops meaning anything.
|
|
289689
|
+
*/
|
|
289690
|
+
const JITTER_FRACTION = .25;
|
|
289691
|
+
function nextControlAuthorityAttempt(input) {
|
|
289692
|
+
if (!input.retryable) return {
|
|
289693
|
+
retry: false,
|
|
289694
|
+
delayMs: 0
|
|
289695
|
+
};
|
|
289696
|
+
const exponent = Math.max(0, input.consecutiveFailures - 1);
|
|
289697
|
+
const cap = MAX_DELAY_MS / (1 + JITTER_FRACTION);
|
|
289698
|
+
const base = Math.min(BASE_DELAY_MS * 2 ** exponent, cap);
|
|
289699
|
+
const random = input.random ?? Math.random;
|
|
289700
|
+
return {
|
|
289701
|
+
retry: true,
|
|
289702
|
+
delayMs: Math.round(base * (1 + JITTER_FRACTION * random()))
|
|
289703
|
+
};
|
|
289704
|
+
}
|
|
289705
|
+
/** Bounded retry budget. The next connect starts a fresh one. */
|
|
289706
|
+
const DEFAULT_MAX_ATTEMPTS = 8;
|
|
289707
|
+
/**
|
|
289708
|
+
* Keep asking for control authority while asking again could plausibly work.
|
|
289709
|
+
*
|
|
289710
|
+
* Bounded rather than infinite: a loop that gives up and says so lets the caller
|
|
289711
|
+
* log something actionable, and a connect or a heartbeat will start a fresh
|
|
289712
|
+
* budget anyway. An unbounded loop would hide the condition in exactly the way
|
|
289713
|
+
* the original `.catch(() => false)` did.
|
|
289714
|
+
*/
|
|
289715
|
+
async function bootstrapWithRetry(input) {
|
|
289716
|
+
const maxAttempts = input.maxAttempts ?? DEFAULT_MAX_ATTEMPTS;
|
|
289717
|
+
let lastError;
|
|
289718
|
+
for (let attempts = 1; attempts <= maxAttempts; attempts += 1) {
|
|
289719
|
+
let retryable = true;
|
|
289720
|
+
try {
|
|
289721
|
+
if (await input.attempt()) return {
|
|
289722
|
+
ok: true,
|
|
289723
|
+
attempts
|
|
289724
|
+
};
|
|
289725
|
+
} catch (error) {
|
|
289726
|
+
lastError = error;
|
|
289727
|
+
retryable = typeof error === "object" && error !== null && "retryable" in error && error.retryable === true;
|
|
289728
|
+
}
|
|
289729
|
+
if (!retryable) return {
|
|
289730
|
+
ok: false,
|
|
289731
|
+
attempts,
|
|
289732
|
+
lastError
|
|
289733
|
+
};
|
|
289734
|
+
if (attempts === maxAttempts) break;
|
|
289735
|
+
const next = nextControlAuthorityAttempt({
|
|
289736
|
+
consecutiveFailures: attempts,
|
|
289737
|
+
retryable: true,
|
|
289738
|
+
...input.random ? { random: input.random } : {}
|
|
289739
|
+
});
|
|
289740
|
+
await input.sleep(next.delayMs);
|
|
289741
|
+
}
|
|
289742
|
+
return {
|
|
289743
|
+
ok: false,
|
|
289744
|
+
attempts: maxAttempts,
|
|
289745
|
+
lastError
|
|
289746
|
+
};
|
|
289747
|
+
}
|
|
289447
289748
|
var AuthControlPlaneError = class extends TaggedError("AuthControlPlaneError") {};
|
|
289448
289749
|
var AuthControlPlane = class extends Service$1()("forge/AuthControlPlane") {};
|
|
289449
289750
|
//#endregion
|
|
@@ -290636,19 +290937,24 @@ async function bootstrapControlAuthorityFromConnect(input) {
|
|
|
290636
290937
|
const credentialEpoch = input.verified.credentialEpoch;
|
|
290637
290938
|
const hasConnectScope = input.verified.scope.includes("http") || input.verified.scope.includes("ws");
|
|
290638
290939
|
if (!controlPlaneUrl || !provisioningGrant || machineId === null || credentialEpoch === null || !hasConnectScope) return;
|
|
290639
|
-
await
|
|
290640
|
-
|
|
290641
|
-
|
|
290642
|
-
|
|
290643
|
-
|
|
290644
|
-
|
|
290645
|
-
|
|
290646
|
-
|
|
290647
|
-
|
|
290648
|
-
|
|
290649
|
-
|
|
290650
|
-
|
|
290651
|
-
|
|
290940
|
+
await bootstrapWithRetry({
|
|
290941
|
+
attempt: () => bootstrapRuntimeControlAuthority({
|
|
290942
|
+
identity: {
|
|
290943
|
+
controlPlaneUrl,
|
|
290944
|
+
publicKeyPem: input.runtimeAuthConfig.publicKeyPem,
|
|
290945
|
+
orgId: input.verified.orgId,
|
|
290946
|
+
userId: input.verified.userId,
|
|
290947
|
+
projectId: input.verified.projectId,
|
|
290948
|
+
runtimeId: input.verified.runtimeId,
|
|
290949
|
+
machineId,
|
|
290950
|
+
credentialEpoch
|
|
290951
|
+
},
|
|
290952
|
+
connectToken: input.token,
|
|
290953
|
+
provisioningGrant
|
|
290954
|
+
}),
|
|
290955
|
+
sleep: (ms) => new Promise((resolve) => setTimeout(resolve, ms))
|
|
290956
|
+
}).then((result) => {
|
|
290957
|
+
if (!result.ok && result.lastError !== void 0) throw result.lastError;
|
|
290652
290958
|
}).catch((error) => {
|
|
290653
290959
|
console.error("[bootstrapControlAuthorityFromConnect] failed to establish runtime control authority; every heartbeat will report null until the next successful connect", {
|
|
290654
290960
|
runtimeId: input.verified.runtimeId,
|
|
@@ -295985,6 +296291,32 @@ const readPersistedServerRuntimeState = (path) => gen(function* () {
|
|
|
295985
296291
|
return yield* decodePersistedServerRuntimeState(trimmed).pipe(option);
|
|
295986
296292
|
});
|
|
295987
296293
|
//#endregion
|
|
296294
|
+
//#region src/orchestration/turnAdmission.ts
|
|
296295
|
+
/**
|
|
296296
|
+
* Whether a turn can actually run, as opposed to merely being accepted.
|
|
296297
|
+
*
|
|
296298
|
+
* A Forge Cloud runtime reaches its provider through CMMD, so without control
|
|
296299
|
+
* authority it cannot start a turn at all. It could still ACCEPT one: the
|
|
296300
|
+
* command validates, the thread and worktree are created, the user message is
|
|
296301
|
+
* recorded, and the turn then sits at `pending` forever with nothing surfaced.
|
|
296302
|
+
*
|
|
296303
|
+
* Measured on forge-cmmd-r03ad897c5e90 while CMMD was redeploying: HTTP 200 on
|
|
296304
|
+
* dispatch, five user messages, zero assistant messages, every turn stuck with
|
|
296305
|
+
* `started_at` empty. The client had no way to know.
|
|
296306
|
+
*
|
|
296307
|
+
* Kept as a pure function because the interesting part is the RULE, not the
|
|
296308
|
+
* plumbing: it is only cloud runtimes, only turns, and only when authority is
|
|
296309
|
+
* genuinely absent.
|
|
296310
|
+
*/
|
|
296311
|
+
/** Commands that need a provider, and therefore need control authority. */
|
|
296312
|
+
const TURN_COMMANDS = new Set(["thread.turn.start"]);
|
|
296313
|
+
function refuseTurnWithoutControlAuthority(input) {
|
|
296314
|
+
if (!input.cmmdRuntimeMode) return null;
|
|
296315
|
+
if (!TURN_COMMANDS.has(input.commandType)) return null;
|
|
296316
|
+
if (input.hasControlAuthority) return null;
|
|
296317
|
+
return "This runtime has no CMMD control authority, so a turn cannot reach a provider and would queue without ever running. The runtime re-establishes authority on its own; retry shortly.";
|
|
296318
|
+
}
|
|
296319
|
+
//#endregion
|
|
295988
296320
|
//#region ../../packages/shared/src/forgeCommands.ts
|
|
295989
296321
|
/** Root of the repo-local skill contracts. */
|
|
295990
296322
|
const FORGE_SKILLS_DIR = ".agents/skills";
|
|
@@ -296539,6 +296871,16 @@ const orchestrationDispatchRouteLayer = add$1("POST", "/api/orchestration/dispat
|
|
|
296539
296871
|
message: "Invalid orchestration command payload.",
|
|
296540
296872
|
cause
|
|
296541
296873
|
}))));
|
|
296874
|
+
const admissionRefusal = refuseTurnWithoutControlAuthority({
|
|
296875
|
+
commandType: normalizedCommand.type,
|
|
296876
|
+
cmmdRuntimeMode: process.env.FORGE_CMMD_RUNTIME_MODE === "true",
|
|
296877
|
+
hasControlAuthority: readRuntimeControlAuthority({
|
|
296878
|
+
runtimeId: process.env.FORGE_CMMD_RUNTIME_ID ?? "",
|
|
296879
|
+
machineId: process.env.FORGE_CMMD_RUNTIME_MACHINE_ID ?? "",
|
|
296880
|
+
credentialEpoch: Number(process.env.FORGE_CMMD_RUNTIME_CREDENTIAL_EPOCH ?? "0")
|
|
296881
|
+
}) !== null
|
|
296882
|
+
});
|
|
296883
|
+
if (admissionRefusal !== null) return yield* new OrchestrationDispatchCommandError({ message: admissionRefusal });
|
|
296542
296884
|
const dispatchEffect = normalizedCommand.type === "thread.turn.start" && normalizedCommand.bootstrap ? gen(function* () {
|
|
296543
296885
|
const git = yield* serviceOption(GitCore);
|
|
296544
296886
|
const gitStatusBroadcaster = yield* serviceOption(GitStatusBroadcaster);
|
|
@@ -298851,7 +299193,7 @@ const cmmdSetProviderAccountDefaultRouteLayer = registerProxyRoute({
|
|
|
298851
299193
|
orgIdSource: "none",
|
|
298852
299194
|
responseShape: "unwrapData"
|
|
298853
299195
|
});
|
|
298854
|
-
const
|
|
299196
|
+
const resolveConnectedClaudeGeneration = (session) => gen(function* () {
|
|
298855
299197
|
const outcome = yield* runCmmdRestProxy(session, (jwt) => cmmdGateway.request({
|
|
298856
299198
|
method: "GET",
|
|
298857
299199
|
jwt,
|
|
@@ -298865,18 +299207,22 @@ const resolveConnectedClaudeGenerationHash = (session) => gen(function* () {
|
|
|
298865
299207
|
};
|
|
298866
299208
|
return {
|
|
298867
299209
|
ok: true,
|
|
298868
|
-
value:
|
|
299210
|
+
value: {
|
|
299211
|
+
generationId: state.generationId,
|
|
299212
|
+
generationHash: createHash("sha256").update(state.generationId).digest("hex")
|
|
299213
|
+
}
|
|
298869
299214
|
};
|
|
298870
299215
|
});
|
|
298871
299216
|
/**
|
|
298872
299217
|
* The GET path is read-only. The explicit per-account POST refresh invokes
|
|
298873
299218
|
* this helper and propagates any CMMD forward failure to the caller.
|
|
298874
299219
|
*/
|
|
298875
|
-
const forwardClaudeUsageTelemetry = (session,
|
|
298876
|
-
const credentialOutcome = yield*
|
|
299220
|
+
const forwardClaudeUsageTelemetry = (session, requestedProviderAccountId, activelyPoll = false, fetchClaudeUsage = fetchClaudeUsageViaOfficialClient) => gen(function* () {
|
|
299221
|
+
const credentialOutcome = yield* resolveConnectedClaudeGeneration(session);
|
|
298877
299222
|
if (!credentialOutcome.ok) return credentialOutcome;
|
|
298878
|
-
|
|
298879
|
-
|
|
299223
|
+
if (credentialOutcome.value === null) return null;
|
|
299224
|
+
const { generationId, generationHash } = credentialOutcome.value;
|
|
299225
|
+
const providerAccountId = requestedProviderAccountId ?? generationId;
|
|
298880
299226
|
const activeSnapshot = activelyPoll && providerAccountId === generationId ? yield* tryPromise({
|
|
298881
299227
|
try: () => fetchClaudeUsage({ binaryPath: resolveClaudeBinaryPath("claude") }),
|
|
298882
299228
|
catch: (cause) => new ClaudeUsageReadError({ cause })
|
|
@@ -298884,7 +299230,7 @@ const forwardClaudeUsageTelemetry = (session, providerAccountId = currentClaudeU
|
|
|
298884
299230
|
const snapshot = activeSnapshot ? {
|
|
298885
299231
|
...activeSnapshot,
|
|
298886
299232
|
observedAt: (/* @__PURE__ */ new Date()).toISOString()
|
|
298887
|
-
} : getLatestClaudeRateLimitTelemetry(
|
|
299233
|
+
} : getLatestClaudeRateLimitTelemetry(generationHash, providerAccountId);
|
|
298888
299234
|
if (!snapshot) return null;
|
|
298889
299235
|
return yield* runCmmdRestProxy(session, (jwt) => cmmdGateway.request({
|
|
298890
299236
|
method: "POST",
|
|
@@ -310170,16 +310516,16 @@ const gitUrlCloneRouteLayer = add$1("POST", "/api/cloud/git/clone-url", gen(func
|
|
|
310170
310516
|
//#endregion
|
|
310171
310517
|
//#region src/server.ts
|
|
310172
310518
|
const PtyAdapterLive = unwrap(gen(function* () {
|
|
310173
|
-
if (typeof Bun !== "undefined") return (yield* promise(() => import("./BunPTY-
|
|
310174
|
-
else return (yield* promise(() => import("./NodePTY-
|
|
310519
|
+
if (typeof Bun !== "undefined") return (yield* promise(() => import("./BunPTY-B7ThejfA.mjs"))).layer;
|
|
310520
|
+
else return (yield* promise(() => import("./NodePTY-RnitYPTs.mjs"))).layer;
|
|
310175
310521
|
}));
|
|
310176
310522
|
const HttpServerLive = unwrap(gen(function* () {
|
|
310177
310523
|
const config = yield* ServerConfig;
|
|
310178
|
-
if (typeof Bun !== "undefined") return (yield* promise(() => import("./BunHttpServer-
|
|
310524
|
+
if (typeof Bun !== "undefined") return (yield* promise(() => import("./BunHttpServer-C_855q3m.mjs"))).layer({
|
|
310179
310525
|
port: config.port,
|
|
310180
310526
|
...config.host ? { hostname: config.host } : {}
|
|
310181
310527
|
});
|
|
310182
|
-
const [NodeHttpServer, NodeHttp] = yield* all([promise(() => import("./NodeHttpServer-
|
|
310528
|
+
const [NodeHttpServer, NodeHttp] = yield* all([promise(() => import("./NodeHttpServer-DgD75IAg.mjs")), promise(() => import("node:http"))]);
|
|
310183
310529
|
return NodeHttpServer.layer(NodeHttp.createServer, {
|
|
310184
310530
|
host: config.host,
|
|
310185
310531
|
port: config.port
|
|
@@ -310187,10 +310533,10 @@ const HttpServerLive = unwrap(gen(function* () {
|
|
|
310187
310533
|
}));
|
|
310188
310534
|
const PlatformServicesLive = unwrap(gen(function* () {
|
|
310189
310535
|
if (typeof Bun !== "undefined") {
|
|
310190
|
-
const { layer } = yield* promise(() => import("./BunServices-
|
|
310536
|
+
const { layer } = yield* promise(() => import("./BunServices-BFygTrvx.mjs"));
|
|
310191
310537
|
return layer;
|
|
310192
310538
|
} else {
|
|
310193
|
-
const { layer } = yield* promise(() => import("./NodeServices-
|
|
310539
|
+
const { layer } = yield* promise(() => import("./NodeServices-Da5rUDDE.mjs").then((n) => n.t));
|
|
310194
310540
|
return layer;
|
|
310195
310541
|
}
|
|
310196
310542
|
}));
|
|
@@ -310256,7 +310602,7 @@ const MiscRuntimeLayerLive = mergeAll(AnalyticsServiceLayerLive, OpenLive, Serve
|
|
|
310256
310602
|
const RuntimeDependenciesWithoutPullRequestsLive = ReactorLayerLive.pipe(provideMerge(CheckpointingLayerLive), provideMerge(GitLayerLive), provideMerge(OrchestrationLayerLive), provideMerge(ProviderLayerLive), provideMerge(TerminalLayerLive), provideMerge(AgentBrowserManagerLive), provideMerge(mergeAll(ThreadDevRuntimeLive, DevTunnelLive.pipe(provide$1(ThreadDevRuntimeLive)))), provideMerge(PersistenceLayerLive), provideMerge(KeybindingsLive), provideMerge(ProviderRegistryLive), provideMerge(mergeAll(ServerSettingsLive, UsageServiceLive.pipe(provide$1(ServerSettingsLive)))), provideMerge(WorkspaceLayerLive), provideMerge(WorkspaceReadinessStateLive), provideMerge(ProjectFaviconResolverLive), provideMerge(RepositoryIdentityResolverLive), provideMerge(ServerEnvironmentLive), provideMerge(AuthLayerLive), provideMerge(ServerSecretStoreLayerLive), provideMerge(mergeAll(CloudRedisCoordinationLive, CloudStateSyncLive.pipe(provide$1(PersistenceLayerLive)))), provideMerge(MiscRuntimeLayerLive));
|
|
310257
310603
|
const RuntimeDependenciesLive = pullRequestServiceFactoryLayer.pipe(provideMerge(RuntimeDependenciesWithoutPullRequestsLive), provideMerge(cmmdProjectIdentityResolverLive.pipe(provide$1(RuntimeDependenciesWithoutPullRequestsLive))), provideMerge(pullRequestProviderRuntimeLive));
|
|
310258
310604
|
const RuntimeServicesLive = ServerRuntimeStartupLive.pipe(provideMerge(RuntimeDependenciesLive));
|
|
310259
|
-
const makeRoutesLayer = mergeAll(authBearerBootstrapRouteLayer, authBootstrapRouteLayer, authCommandBearerBootstrapRouteLayer, authCommandBootstrapRouteLayer, authCmmdOAuthDeviceRouteLayer, authCmmdOAuthTokenRouteLayer, authCmmdPasswordTokenRouteLayer, authClientsRevokeOthersRouteLayer, authClientsRevokeRouteLayer, authClientsRouteLayer, authLogoutRouteLayer, authPairingLinksRevokeRouteLayer, authPairingLinksRouteLayer, authPairingCredentialRouteLayer, authSessionRouteLayer, authWebSocketTokenRouteLayer, authWebLoginRouteLayer, authWebCallbackRouteLayer, desktopLocalWebBridgePublishRouteLayer, desktopLocalWebBridgeBootstrapRouteLayer, desktopRelayControlPlaneRouteLayer, apiDocsHtmlRouteLayer, apiDocsOpenApiRouteLayer, pulseSignalStateListRouteLayer, pulseSignalStateUpsertRouteLayer, cmmdProfileRouteLayer, cmmdCreateBrainDocRouteLayer, cmmdUpdateTaskRouteLayer, cmmdUpsertTaskPullRequestRouteLayer, ...cmmdPullRequestRouteLayers, cmmdAddTaskCommentRouteLayer, cmmdWorkIntakeRouteLayer, cmmdWsTokenRouteLayer, cmmdSearchTasksRouteLayer, cmmdGetTaskCommentsRouteLayer, cmmdGetProjectCommentsRouteLayer, cmmdAddProjectCommentRouteLayer, cmmdUpdateProjectRouteLayer, cmmdGetOrgMembersRouteLayer, cmmdSimHostsRouteLayer, cmmdSimLeaseReadRouteLayer, cmmdSimLeaseClaimRouteLayer, cmmdSimLeaseReleaseRouteLayer, cmmdSimLeaseRenewRouteLayer, cmmdUploadTaskAttachmentRouteLayer, cmmdGetTaskAttachmentsRouteLayer, cmmdUpdateTaskCommentRouteLayer, cmmdDeleteTaskCommentRouteLayer, cmmdGetProjectRepositoryRouteLayer, cmmdListProjectRepositoriesRouteLayer, cmmdArchiveTaskRouteLayer, cmmdUnarchiveTaskRouteLayer, cmmdListTasksRouteLayer, cmmdCreateTaskRouteLayer, cmmdListCampaignsRouteLayer, cmmdGetCampaignRouteLayer, cmmdCreateCampaignRouteLayer, cmmdUpdateCampaignRouteLayer, cmmdDeleteCampaignRouteLayer, cmmdListSavedViewsRouteLayer, cmmdCreateSavedViewRouteLayer, cmmdImportSavedViewRouteLayer, cmmdUpdateSavedViewRouteLayer, cmmdDeleteSavedViewRouteLayer, cmmdListProjectsRouteLayer, cmmdGetProjectRouteLayer, cmmdCreateProjectRouteLayer, cmmdDeleteProjectRouteLayer, cmmdMoveProjectRouteLayer, cmmdGetProjectMembersRouteLayer, cmmdListWorkspaceMembersRouteLayer, cmmdAddProjectMemberRouteLayer, cmmdGetProjectMilestonesRouteLayer, cmmdCreateProjectMilestoneRouteLayer, cmmdUpdateProjectMilestoneRouteLayer, cmmdDeleteProjectMilestoneRouteLayer, cmmdGetProjectUpdatesRouteLayer, cmmdCreateProjectUpdateRouteLayer, cmmdUpdateProjectUpdateRouteLayer, cmmdDeleteProjectUpdateRouteLayer, cmmdImproveProjectContentRouteLayer, cmmdCreateProjectTaskDraftRouteLayer, cmmdGetProjectTaskDraftRouteLayer, cmmdUpdateProjectTaskDraftRouteLayer, cmmdPreviewProjectTaskDraftRouteLayer, cmmdCommitProjectTaskDraftRouteLayer, cmmdDiscardProjectTaskDraftRouteLayer, cmmdGetProjectLeadPlanRouteLayer, cmmdActivateProjectLeadAuthorityRouteLayer, cmmdGetProjectLeadReadinessRouteLayer, cmmdGetProjectLeadCapabilitiesRouteLayer, cmmdGetProjectLeadSummaryRouteLayer, cmmdGetProjectLeadDetailRouteLayer, cmmdGetProjectLeadBriefingRouteLayer, cmmdListProjectLeadEventsRouteLayer, cmmdExplainProjectLeadRouteLayer, cmmdPauseProjectLeadRouteLayer, cmmdResumeProjectLeadRouteLayer, cmmdReserveProjectLeadTaskRouteLayer, cmmdReleaseProjectLeadReservationRouteLayer, cmmdReconcileProjectLeadRouteLayer, cmmdResolveProjectLeadAttentionRouteLayer, cmmdClaimProjectLeadControllerRouteLayer, cmmdRenewProjectLeadControllerClaimRouteLayer, cmmdYieldProjectLeadControllerClaimRouteLayer, cmmdAcknowledgeProjectLeadControllerEventRouteLayer, cmmdRecordProjectLeadControllerDecisionRouteLayer, cmmdListForgeAutomationPresetsRouteLayer, cmmdListUserForgeAutomationRulesRouteLayer, cmmdCreateUserForgeAutomationRuleRouteLayer, cmmdUpdateUserForgeAutomationRuleRouteLayer, cmmdListUserForgeAutomationRunsRouteLayer, cmmdStartUserForgeAutomationRunRouteLayer, cmmdListForgeAutomationRulesRouteLayer, cmmdCreateForgeAutomationRuleRouteLayer, cmmdUpdateForgeAutomationRuleRouteLayer, cmmdListForgeAutomationRunsRouteLayer, cmmdStartForgeAutomationRunRouteLayer, cmmdGetForgeAutomationRunRouteLayer, cmmdRetryForgeAutomationRunRouteLayer, cmmdCancelForgeAutomationRunRouteLayer, cmmdApproveForgeAutomationEscalationRouteLayer, cmmdRejectForgeAutomationEscalationRouteLayer, cmmdListProjectAgentMembersRouteLayer, cmmdCreateProjectAgentMemberRouteLayer, cmmdGetProjectAgentMemberRouteLayer, cmmdRenameProjectAgentMemberRouteLayer, cmmdRetireProjectAgentMemberRouteLayer, cmmdUpdateProjectAgentMemberAvatarRouteLayer, cmmdListProjectAgentMemberInstancesRouteLayer, cmmdPreviewProjectAgentMemberConsolidationRouteLayer, cmmdApplyProjectAgentMemberConsolidationRouteLayer, cmmdPutProjectTaskAssignmentRouteLayer, cmmdListProjectBoardRouteLayer, cmmdGetProjectTaskWorkflowRouteLayer, cmmdUpdateProjectTaskWorkflowRouteLayer, cmmdCreateProjectBoardTaskRouteLayer, cmmdUpdateProjectBoardTaskRouteLayer, cmmdUpdateProjectBoardTaskStatusRouteLayer, cmmdListTaskExecutionOptionsRouteLayer, cmmdCreateTaskWorkSessionRouteLayer, cmmdListProjectWorkSessionsRouteLayer, cmmdGetWorkSessionRouteLayer, cmmdUpdateWorkSessionRouteLayer, cmmdAttachWorkSessionThreadRouteLayer, cmmdListTaskConversationsRouteLayer, cmmdLinkTaskConversationRouteLayer, cmmdGetTaskHistoryRouteLayer, cmmdGetTaskConversationRouteLayer, cmmdSpawnForgeThreadFromBoardTaskRouteLayer, cmmdListCenterBoardRouteLayer, cmmdCreateCenterBoardTaskRouteLayer, cmmdCreateFeedbackRouteLayer, cmmdUpdateCenterBoardTaskRouteLayer, cmmdMoveCenterBoardTaskRouteLayer, cmmdMoveProjectBoardTaskRouteLayer, cmmdArchiveProjectBoardTaskRouteLayer, cmmdUnarchiveProjectBoardTaskRouteLayer, cmmdArchiveCenterBoardTaskRouteLayer, cmmdUnarchiveCenterBoardTaskRouteLayer, cmmdBootstrapRouteLayer, cmmdGetAccountPreferencesRouteLayer, cmmdUpdateAccountPreferencesRouteLayer, cmmdGetOrgProviderPolicyRouteLayer, cmmdListChatsRouteLayer, cmmdGetChatRouteLayer, cmmdListDevicesRouteLayer, runtimeReplicationStatusRouteLayer, cmmdRegisterDeviceRouteLayer, cmmdHeartbeatRuntimeRouteLayer, cmmdGrantRuntimeAccessRouteLayer, cmmdRevokeRuntimeAccessRouteLayer, cmmdCreateRelayControlRouteLayer, cmmdCreateRelayActionGrantRouteLayer, cmmdReplaceRuntimeInventoryRouteLayer, cmmdListRuntimeInventoryRouteLayer, cmmdGetRuntimeDiagnosticsRouteLayer, cmmdProvisionAuthRuntimeRouteLayer, cmmdGetAuthRuntimeRouteLayer, cmmdDestroyAuthRuntimeRouteLayer, cmmdConnectAuthRuntimeRouteLayer, cmmdGetProviderAccountsRouteLayer, cmmdDeleteProviderAccountRouteLayer, cmmdSetProviderAccountDefaultRouteLayer, cmmdGetProviderUsageRouteLayer, cmmdRefreshProviderUsageRouteLayer, cmmdGetUserCodexCredentialRouteLayer, cmmdDeleteUserCodexCredentialRouteLayer, cmmdGetUserClaudeCredentialRouteLayer, cmmdDeleteUserClaudeCredentialRouteLayer, cmmdGetClaudeRuntimeReadinessRouteLayer, cmmdAppendRuntimeThreadEventsRouteLayer, cmmdGetRuntimeThreadReplicaRouteLayer, cmmdRenameDeviceRouteLayer, cmmdRevokeDeviceRouteLayer, cmmdInstallConnectorRouteLayer, cmmdListConnectorsRouteLayer, cmmdForgeCloudProjectsListRouteLayer, cmmdForgeCloudProjectsEventsRouteLayer, cmmdForgeCloudProjectRegisterRouteLayer, cmmdForgeCloudProjectUnregisterRouteLayer, cmmdForgeCloudProjectLifecyclePreflightRouteLayer, cmmdForgeCloudProjectRemovalRouteLayer, cmmdForgeCloudProjectRemovalReceiptRouteLayer, cmmdForgeRuntimesEnsureRouteLayer, cmmdForgeRuntimesConnectRouteLayer, ownerRuntimeCodexReadinessRouteLayer, cmmdForgeRuntimesStatusRouteLayer, cmmdForgeRuntimesStartRouteLayer, cmmdForgeRuntimesStopRouteLayer, cmmdForgeRuntimesRecycleRouteLayer, cmmdForgeRuntimesUpdateCommitRouteLayer, cmmdForgeRuntimesDestroyRouteLayer, cmmdGetTaskRouteLayer, commandUpdateTaskRouteLayer, mobileProviderCatalogRouteLayer, cmmdUsageSummaryRouteLayer, cmmdBillingRouteLayer, cmmdBillingSeriesRouteLayer, attachmentsRouteLayer, orchestrationDispatchRouteLayer, orchestrationCmmdWorkRunEventRouteLayer, orchestrationAutomationStartThreadRouteLayer, orchestrationAutomationRebindRouteLayer, orchestrationAutomationTerminalReconcileRouteLayer, mobileGitRunStackedActionRouteLayer, pullRequestDiffRouteLayer, orchestrationSnapshotRouteLayer, localAutomationListRouteLayer, localAutomationCreateRouteLayer, localAutomationUpdateRouteLayer, localAutomationDeleteRouteLayer, localAutomationRunRouteLayer, otlpTracesProxyRouteLayer, devTunnelProxyRouteLayer, devTunnelLocalPortProxyRouteLayer, projectFaviconRouteLayer, serverEnvironmentRouteLayer, browserWebRtcReadinessRouteLayer, staticAndDevRouteLayer, githubStatusRouteLayer, githubAuthorizeUrlRouteLayer, githubDisconnectRouteLayer, githubReposRouteLayer, githubCloneRouteLayer, githubCloneJobStartRouteLayer, githubCloneJobStatusRouteLayer, githubRefreshCredentialsRouteLayer, githubToolConfirmationApproveRouteLayer, projectLinkGetRouteLayer, projectLinkListRouteLayer, projectLinkSetRouteLayer, projectLinkDeleteRouteLayer, cmmdWorkspacesRouteLayer, cmmdCampaignsRouteLayer, cmmdProjectLinksRouteLayer, cmmdEnsureGitHubProjectContextRouteLayer, cmmdProjectRepositoryEnsureRouteLayer, cmmdProjectsGetRouteLayer, cmmdProjectsCreateRouteLayer, workspaceReadinessRouteLayer, runtimeLivenessRouteLayer, claudeNativeGenerationProofRouteLayer, codexRuntimeProviderReadinessRouteLayer, runtimeDiagnosticsRouteLayer, cloudFoldersRouteLayer, cloudProjectCreateRouteLayer, gitUrlCloneRouteLayer, websocketRpcRouteLayer).pipe(provide$1(browserApiCorsLayer));
|
|
310605
|
+
const makeRoutesLayer = mergeAll(authBearerBootstrapRouteLayer, authBootstrapRouteLayer, authCommandBearerBootstrapRouteLayer, authCommandBootstrapRouteLayer, authOAuthTokenExchangeRouteLayer, authCmmdOAuthDeviceRouteLayer, authCmmdOAuthTokenRouteLayer, authCmmdPasswordTokenRouteLayer, authClientsRevokeOthersRouteLayer, authClientsRevokeRouteLayer, authClientsRouteLayer, authLogoutRouteLayer, authPairingLinksRevokeRouteLayer, authPairingLinksRouteLayer, authPairingCredentialRouteLayer, authSessionRouteLayer, authWebSocketTokenRouteLayer, authWebLoginRouteLayer, authWebCallbackRouteLayer, desktopLocalWebBridgePublishRouteLayer, desktopLocalWebBridgeBootstrapRouteLayer, desktopRelayControlPlaneRouteLayer, apiDocsHtmlRouteLayer, apiDocsOpenApiRouteLayer, pulseSignalStateListRouteLayer, pulseSignalStateUpsertRouteLayer, cmmdProfileRouteLayer, cmmdCreateBrainDocRouteLayer, cmmdUpdateTaskRouteLayer, cmmdUpsertTaskPullRequestRouteLayer, ...cmmdPullRequestRouteLayers, cmmdAddTaskCommentRouteLayer, cmmdWorkIntakeRouteLayer, cmmdWsTokenRouteLayer, cmmdSearchTasksRouteLayer, cmmdGetTaskCommentsRouteLayer, cmmdGetProjectCommentsRouteLayer, cmmdAddProjectCommentRouteLayer, cmmdUpdateProjectRouteLayer, cmmdGetOrgMembersRouteLayer, cmmdSimHostsRouteLayer, cmmdSimLeaseReadRouteLayer, cmmdSimLeaseClaimRouteLayer, cmmdSimLeaseReleaseRouteLayer, cmmdSimLeaseRenewRouteLayer, cmmdUploadTaskAttachmentRouteLayer, cmmdGetTaskAttachmentsRouteLayer, cmmdUpdateTaskCommentRouteLayer, cmmdDeleteTaskCommentRouteLayer, cmmdGetProjectRepositoryRouteLayer, cmmdListProjectRepositoriesRouteLayer, cmmdArchiveTaskRouteLayer, cmmdUnarchiveTaskRouteLayer, cmmdListTasksRouteLayer, cmmdCreateTaskRouteLayer, cmmdListCampaignsRouteLayer, cmmdGetCampaignRouteLayer, cmmdCreateCampaignRouteLayer, cmmdUpdateCampaignRouteLayer, cmmdDeleteCampaignRouteLayer, cmmdListSavedViewsRouteLayer, cmmdCreateSavedViewRouteLayer, cmmdImportSavedViewRouteLayer, cmmdUpdateSavedViewRouteLayer, cmmdDeleteSavedViewRouteLayer, cmmdListProjectsRouteLayer, cmmdGetProjectRouteLayer, cmmdCreateProjectRouteLayer, cmmdDeleteProjectRouteLayer, cmmdMoveProjectRouteLayer, cmmdGetProjectMembersRouteLayer, cmmdListWorkspaceMembersRouteLayer, cmmdAddProjectMemberRouteLayer, cmmdGetProjectMilestonesRouteLayer, cmmdCreateProjectMilestoneRouteLayer, cmmdUpdateProjectMilestoneRouteLayer, cmmdDeleteProjectMilestoneRouteLayer, cmmdGetProjectUpdatesRouteLayer, cmmdCreateProjectUpdateRouteLayer, cmmdUpdateProjectUpdateRouteLayer, cmmdDeleteProjectUpdateRouteLayer, cmmdImproveProjectContentRouteLayer, cmmdCreateProjectTaskDraftRouteLayer, cmmdGetProjectTaskDraftRouteLayer, cmmdUpdateProjectTaskDraftRouteLayer, cmmdPreviewProjectTaskDraftRouteLayer, cmmdCommitProjectTaskDraftRouteLayer, cmmdDiscardProjectTaskDraftRouteLayer, cmmdGetProjectLeadPlanRouteLayer, cmmdActivateProjectLeadAuthorityRouteLayer, cmmdGetProjectLeadReadinessRouteLayer, cmmdGetProjectLeadCapabilitiesRouteLayer, cmmdGetProjectLeadSummaryRouteLayer, cmmdGetProjectLeadDetailRouteLayer, cmmdGetProjectLeadBriefingRouteLayer, cmmdListProjectLeadEventsRouteLayer, cmmdExplainProjectLeadRouteLayer, cmmdPauseProjectLeadRouteLayer, cmmdResumeProjectLeadRouteLayer, cmmdReserveProjectLeadTaskRouteLayer, cmmdReleaseProjectLeadReservationRouteLayer, cmmdReconcileProjectLeadRouteLayer, cmmdResolveProjectLeadAttentionRouteLayer, cmmdClaimProjectLeadControllerRouteLayer, cmmdRenewProjectLeadControllerClaimRouteLayer, cmmdYieldProjectLeadControllerClaimRouteLayer, cmmdAcknowledgeProjectLeadControllerEventRouteLayer, cmmdRecordProjectLeadControllerDecisionRouteLayer, cmmdListForgeAutomationPresetsRouteLayer, cmmdListUserForgeAutomationRulesRouteLayer, cmmdCreateUserForgeAutomationRuleRouteLayer, cmmdUpdateUserForgeAutomationRuleRouteLayer, cmmdListUserForgeAutomationRunsRouteLayer, cmmdStartUserForgeAutomationRunRouteLayer, cmmdListForgeAutomationRulesRouteLayer, cmmdCreateForgeAutomationRuleRouteLayer, cmmdUpdateForgeAutomationRuleRouteLayer, cmmdListForgeAutomationRunsRouteLayer, cmmdStartForgeAutomationRunRouteLayer, cmmdGetForgeAutomationRunRouteLayer, cmmdRetryForgeAutomationRunRouteLayer, cmmdCancelForgeAutomationRunRouteLayer, cmmdApproveForgeAutomationEscalationRouteLayer, cmmdRejectForgeAutomationEscalationRouteLayer, cmmdListProjectAgentMembersRouteLayer, cmmdCreateProjectAgentMemberRouteLayer, cmmdGetProjectAgentMemberRouteLayer, cmmdRenameProjectAgentMemberRouteLayer, cmmdRetireProjectAgentMemberRouteLayer, cmmdUpdateProjectAgentMemberAvatarRouteLayer, cmmdListProjectAgentMemberInstancesRouteLayer, cmmdPreviewProjectAgentMemberConsolidationRouteLayer, cmmdApplyProjectAgentMemberConsolidationRouteLayer, cmmdPutProjectTaskAssignmentRouteLayer, cmmdListProjectBoardRouteLayer, cmmdGetProjectTaskWorkflowRouteLayer, cmmdUpdateProjectTaskWorkflowRouteLayer, cmmdCreateProjectBoardTaskRouteLayer, cmmdUpdateProjectBoardTaskRouteLayer, cmmdUpdateProjectBoardTaskStatusRouteLayer, cmmdListTaskExecutionOptionsRouteLayer, cmmdCreateTaskWorkSessionRouteLayer, cmmdListProjectWorkSessionsRouteLayer, cmmdGetWorkSessionRouteLayer, cmmdUpdateWorkSessionRouteLayer, cmmdAttachWorkSessionThreadRouteLayer, cmmdListTaskConversationsRouteLayer, cmmdLinkTaskConversationRouteLayer, cmmdGetTaskHistoryRouteLayer, cmmdGetTaskConversationRouteLayer, cmmdSpawnForgeThreadFromBoardTaskRouteLayer, cmmdListCenterBoardRouteLayer, cmmdCreateCenterBoardTaskRouteLayer, cmmdCreateFeedbackRouteLayer, cmmdUpdateCenterBoardTaskRouteLayer, cmmdMoveCenterBoardTaskRouteLayer, cmmdMoveProjectBoardTaskRouteLayer, cmmdArchiveProjectBoardTaskRouteLayer, cmmdUnarchiveProjectBoardTaskRouteLayer, cmmdArchiveCenterBoardTaskRouteLayer, cmmdUnarchiveCenterBoardTaskRouteLayer, cmmdBootstrapRouteLayer, cmmdGetAccountPreferencesRouteLayer, cmmdUpdateAccountPreferencesRouteLayer, cmmdGetOrgProviderPolicyRouteLayer, cmmdListChatsRouteLayer, cmmdGetChatRouteLayer, cmmdListDevicesRouteLayer, runtimeReplicationStatusRouteLayer, cmmdRegisterDeviceRouteLayer, cmmdHeartbeatRuntimeRouteLayer, cmmdGrantRuntimeAccessRouteLayer, cmmdRevokeRuntimeAccessRouteLayer, cmmdCreateRelayControlRouteLayer, cmmdCreateRelayActionGrantRouteLayer, cmmdReplaceRuntimeInventoryRouteLayer, cmmdListRuntimeInventoryRouteLayer, cmmdGetRuntimeDiagnosticsRouteLayer, cmmdProvisionAuthRuntimeRouteLayer, cmmdGetAuthRuntimeRouteLayer, cmmdDestroyAuthRuntimeRouteLayer, cmmdConnectAuthRuntimeRouteLayer, cmmdGetProviderAccountsRouteLayer, cmmdDeleteProviderAccountRouteLayer, cmmdSetProviderAccountDefaultRouteLayer, cmmdGetProviderUsageRouteLayer, cmmdRefreshProviderUsageRouteLayer, cmmdGetUserCodexCredentialRouteLayer, cmmdDeleteUserCodexCredentialRouteLayer, cmmdGetUserClaudeCredentialRouteLayer, cmmdDeleteUserClaudeCredentialRouteLayer, cmmdGetClaudeRuntimeReadinessRouteLayer, cmmdAppendRuntimeThreadEventsRouteLayer, cmmdGetRuntimeThreadReplicaRouteLayer, cmmdRenameDeviceRouteLayer, cmmdRevokeDeviceRouteLayer, cmmdInstallConnectorRouteLayer, cmmdListConnectorsRouteLayer, cmmdForgeCloudProjectsListRouteLayer, cmmdForgeCloudProjectsEventsRouteLayer, cmmdForgeCloudProjectRegisterRouteLayer, cmmdForgeCloudProjectUnregisterRouteLayer, cmmdForgeCloudProjectLifecyclePreflightRouteLayer, cmmdForgeCloudProjectRemovalRouteLayer, cmmdForgeCloudProjectRemovalReceiptRouteLayer, cmmdForgeRuntimesEnsureRouteLayer, cmmdForgeRuntimesConnectRouteLayer, ownerRuntimeCodexReadinessRouteLayer, cmmdForgeRuntimesStatusRouteLayer, cmmdForgeRuntimesStartRouteLayer, cmmdForgeRuntimesStopRouteLayer, cmmdForgeRuntimesRecycleRouteLayer, cmmdForgeRuntimesUpdateCommitRouteLayer, cmmdForgeRuntimesDestroyRouteLayer, cmmdGetTaskRouteLayer, commandUpdateTaskRouteLayer, mobileProviderCatalogRouteLayer, cmmdUsageSummaryRouteLayer, cmmdBillingRouteLayer, cmmdBillingSeriesRouteLayer, attachmentsRouteLayer, orchestrationDispatchRouteLayer, orchestrationCmmdWorkRunEventRouteLayer, orchestrationAutomationStartThreadRouteLayer, orchestrationAutomationRebindRouteLayer, orchestrationAutomationTerminalReconcileRouteLayer, mobileGitRunStackedActionRouteLayer, pullRequestDiffRouteLayer, orchestrationSnapshotRouteLayer, localAutomationListRouteLayer, localAutomationCreateRouteLayer, localAutomationUpdateRouteLayer, localAutomationDeleteRouteLayer, localAutomationRunRouteLayer, otlpTracesProxyRouteLayer, devTunnelProxyRouteLayer, devTunnelLocalPortProxyRouteLayer, projectFaviconRouteLayer, serverEnvironmentRouteLayer, browserWebRtcReadinessRouteLayer, staticAndDevRouteLayer, githubStatusRouteLayer, githubAuthorizeUrlRouteLayer, githubDisconnectRouteLayer, githubReposRouteLayer, githubCloneRouteLayer, githubCloneJobStartRouteLayer, githubCloneJobStatusRouteLayer, githubRefreshCredentialsRouteLayer, githubToolConfirmationApproveRouteLayer, projectLinkGetRouteLayer, projectLinkListRouteLayer, projectLinkSetRouteLayer, projectLinkDeleteRouteLayer, cmmdWorkspacesRouteLayer, cmmdCampaignsRouteLayer, cmmdProjectLinksRouteLayer, cmmdEnsureGitHubProjectContextRouteLayer, cmmdProjectRepositoryEnsureRouteLayer, cmmdProjectsGetRouteLayer, cmmdProjectsCreateRouteLayer, workspaceReadinessRouteLayer, runtimeLivenessRouteLayer, claudeNativeGenerationProofRouteLayer, codexRuntimeProviderReadinessRouteLayer, runtimeDiagnosticsRouteLayer, cloudFoldersRouteLayer, cloudProjectCreateRouteLayer, gitUrlCloneRouteLayer, websocketRpcRouteLayer).pipe(provide$1(browserApiCorsLayer));
|
|
310260
310606
|
const runServer = launch$1(unwrap(gen(function* () {
|
|
310261
310607
|
const config = yield* ServerConfig;
|
|
310262
310608
|
fixPath();
|
|
@@ -311186,7 +311532,7 @@ const connectLoginCommand = make$32("login", {
|
|
|
311186
311532
|
})).json();
|
|
311187
311533
|
},
|
|
311188
311534
|
openBrowser: async (url) => {
|
|
311189
|
-
const open = (await import("./open-
|
|
311535
|
+
const open = (await import("./open-D8mGyWmt.mjs")).default;
|
|
311190
311536
|
await open(url);
|
|
311191
311537
|
return true;
|
|
311192
311538
|
},
|