@cmmd-center/forge 0.13.95 → 0.13.97
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-DTG5XWSi.cjs → BunHttpServer-CtFGbsWr.cjs} +2 -2
- package/dist/{BunHttpServer-BpaVqxli.mjs → BunHttpServer-o7ISooSQ.mjs} +2 -2
- package/dist/{HttpServer-5UTabe01.mjs → HttpServer-BbbI8N6_.mjs} +79 -39
- package/dist/{HttpServer-DZ6iaxyk.cjs → HttpServer-CRBqMWdP.cjs} +47 -1
- package/dist/{NodeHttpServer-DePOzmYy.mjs → NodeHttpServer-BngJqAIT.mjs} +2 -2
- package/dist/{NodeHttpServer-RV5QsVeb.cjs → NodeHttpServer-DyI6OyMg.cjs} +2 -2
- package/dist/bin.cjs +781 -406
- package/dist/bin.mjs +891 -516
- package/dist/client/assets/{DiffPanel-CAkf79MN.js → DiffPanel-CYrraC28.js} +2 -2
- package/dist/client/assets/{DiffPanel.logic-B9IU5Q5Q.js → DiffPanel.logic-DyXOs7eK.js} +2 -2
- package/dist/client/assets/{DiffWorkerPoolProvider-BaJzbqHW.js → DiffWorkerPoolProvider-DMt6DknG.js} +2 -2
- package/dist/client/assets/{PullRequestCodePanel-ItXVNv0A.js → PullRequestCodePanel-CgjWVTVM.js} +2 -2
- package/dist/client/assets/{Virtualizer-D6N688Z0.js → Virtualizer-D0TQdce0.js} +2 -2
- package/dist/client/assets/{WorkerPoolContext-Q7KzTxot.js → WorkerPoolContext-DkMo0hso.js} +4 -4
- package/dist/client/assets/{index-CuTM56F9.js → index-CzgrA9VN.js} +6 -6
- package/dist/client/index.html +4 -4
- package/dist/forge-build.json +1 -1
- package/package.json +1 -1
package/dist/bin.mjs
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
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 encodeEffect, $a as make$
|
|
5
|
-
import { $t as interrupt$4, A as fromSubscription, At as end, B as onExit$1, Bt as sliding, C as fromChannel, Ct as fromSubscriptionArray, D as fromPull, Dt as make$
|
|
6
|
-
import { _ as ChildProcessSpawner, a as Stdio, g as make$
|
|
4
|
+
import { $ as encodeEffect, $a as make$38, $i as spaced, $n as filterMapOrFail, $r as runPromise, $s as max, $t as stringifyJson, Aa as Scope$1, Ai as void_$1, An as cached$3, Ar as match$1, As as uninterruptibleMask, At as withConstructorDefault, Ba as CurrentLogSpans, Bi as counter, Bn as catch_, Bo as addFinalizer, Br as orDie, Bs as make$41, Bt as head, C as Record, Ca as mergeAll, Cc as map$4, Ci as tx$1, Cn as andThen, Co as hasDies, Cr as logInfo, Cs as sleep$3, Ct as optionalKey, D as TaggedStruct, Da as succeedContext, Di as uninterruptibleMask$1, Dn as as$3, Do as interruptors, Ds as suspend, Dt as toCodecStringTree, E as TaggedErrorClass, Ea as succeed$2, Ec as sort, Ei as uninterruptible, En as annotateSpans, Eo as interrupt$2, Er as map$3, Et as toCodecJson, F as UndefinedOr, Fa as forkUnsafe, Fc as fail$1, Fi as withParentSpan, Fn as catchFilter, Fr as onError$1, Fs as MinimumTraceLevel, G as decodeExit, Ga as done, Gc as empty$1, Gi as withAttributes, Gl as hasProperty, Gn as die$1, Gr as provideService, Gs as format$1, Gt as Transformation, H as declare, Hc as Reference$1, Hi as snapshotUnsafe, Hn as contextWith, Ho as as$2, Hr as promise, Ht as size$2, I as Union, Ia as make$36, Ii as withSpan, In as catchIf, Io as ConsoleRef, Ir as onExit, Is as NativeSpan, It as assign, J as decodeUnknownEffect, Ja as failCause$3, Ji as exponential, Jl as isNotUndefined, Jn as exit, Jr as repeat, Js as hours, Jt as transformOrFail, K as decodeSync, Kc as get$3, Ki as addDelay, Kl as isNotNull, Ko as consolePretty$1, Kr as race, Ks as fromInput, L as Unknown, La as makeUnsafe$4, Li as withTracerEnabled, Ln as catchReason, Lo as CurrentLoggers$1, Ls as ParentSpan, Lt as append$1, M as URLFromString, Ma as addFinalizerExit, Mi as whileLoop, Ml as NodeInspectSymbol, Mn as callback, Mo as pretty, Ms as void_$2, Na as close, Ni as withFiber$1, Nl as toJson, Nn as catchCause, No as prettyErrors, Nr as matchEffect, O as TemplateLiteral, Oa as sync$2, Ol as isEffect$1, On as asSome, Or as mapError, Os as sync, Ot as toJsonSchemaDocument, P as Undefined, Pa as closeUnsafe, Pl as format, Pn as catchDefect, Po as squash, Pr as never$1, Q as encode$4, Qc as merge$2, Qi as recurs, Qn as filter$1, Qr as runForkWith, R as UnknownFromJsonString$1, Ra as provide$2, Rc as isFailure$1, Ri as yieldNow, Rl as equals, Rn as catchTag, Rr as onInterrupt, Rs as Tracer, Rt as drop$1, S as Option, Sa as merge$3, Si as try_, Sn as all, Sr as logFatal, Ss as scopeAddFinalizerExit, St as optional$4, T as Struct, Ta as provideMerge, Tc as reverse, Ti as undefined_, Tn as annotateLogs, To as hasInterruptsOnly, Tr as makeSpanScoped, Tt as tag, Ua as TracerTimingEnabled, Uc as Service$1, Ui as timer, Un as currentSpan, Ur as provide, Ut as toArray, V as brand, Va as MinimumLogLevel, Vc as succeed$1, Vi as gauge, Vn as context, Vo as andThen$1, Vr as orElseSucceed, Vt as isEmpty$2, W as decodeEffect, Wa as _await, Wc as add$2, Wi as update$3, Wl as compose$1, Wr as provideContext, Ws as days, X as decodeUnknownOption, Xc as make$34, Xl as isObject$1, Xn as failCause$1, Xr as retry, Xt as onSome, Y as decodeUnknownExit, Yc as getUnsafe$1, Yi as forever$2, Yl as isNullish, Yn as fail, Yr as result, Z as decodeUnknownSync, Za as isDeferred, Zc as makeUnsafe$3, Zi as passthrough$1, Zl as isTagged, Zr as runFork, Zs as isGreaterThan$1, Zt as parseJson$1, _ as NonEmptyArray, _a as effectContext, _i as tapErrorTag, _n as toUtc, _t as isSchemaError, a as DateTimeUtc, aa as Random$1, ac as sum$1, al as getOrElse, an as value, ao as interrupt$3, ar as fnUntraced, at as isBetween, au as constVoid, b as NullOr, bi as timeoutOrElse, bl as PipeInspectableProto, bn as acquireUseRelease, br as logDebug, bs as reportCauseUnsafe, bt as makeFilter, c as Defect, ca as Clock, cc as toSeconds, ci as sleep$4, cl as isNone, cn as add$3, co as match$2, cr as forkChild, cs as flatMap$1, ct as isGreaterThanOrEqualTo, d as Exit, dc as empty$3, di as succeedSome, dl as match, dn as isGreaterThanOrEqualTo$1, dr as forkScoped, ds as forkDetach, dt as isMaxLength, du as pipeArguments, ea as catchDone, ec as millis, el as firstSomeOf, er as filterOrFail, et as encodeSync, eu as cast, fa as TaggedError, fc as ensure, fi as suspend$1, fl as none$4, fn as make$37, fr as gen, ft as isMaxProperties, g as Never, ga as effect, gi as tapError, gn as toEpochMillis, gr as interruptible, gt as isSchema, h as Literals, ha as buildWithMemoMap, hc as fromIterable, hi as tapCause, hl as make$40, hn as toDate, hr as interrupt$1, ht as isPattern, i as Class, ic as subtract, ii as scoped, il as fromUndefinedOr, in as make$39, io as failCause$2, ir as fn$1, it as is$1, iu as constUndefined, ja as addFinalizer$1, jn as cachedWithTTL, jo as map$6, jr as matchCauseEffect, jt as withDecodingDefault, k as Trim, ka as unwrap, ki as useSpan, kl as withFiber, kn as asVoid, ks as tracerLogger$1, kt as toType, l as Duration, la as currentTimeMillis, lc as zero, li as succeed, ll as isSome, ln as distance, lr as forkDetach$1, ls as fnUntraced$1, lt as isInt, lu as identity, m as Literal, ma as build, mc as flatMapNullishOr, mi as tap, ml as Number$2, mn as now, mo as StackTrace, mr as ignoreCause, ms as loggerMake, mt as isNonEmpty, n as ArraySchema, nc as minutes, nl as flatten$1, no as die$2, nt as encodeUnknownExit, o as DateTimeUtcFromString, oa as clamp, oc as times, oi as service, ol as getOrNull, oo as isFailure, or as forEach, ot as isFinite$1, ou as constant, p as Int$1, pa as CurrentMemoMap, pc as filter, pi as sync$1, pl as some, pn as makeUnsafe$5, po as NoSuchElementError, pr as ignore, pt as isMinLength, q as decodeTo, qa as fail$3, qi as both, ql as isNotNullish, qn as ensuring, qr as raceFirst, qs as fromInputUnsafe, r as Boolean$1, ra as isDoneCause, rc as seconds, ri as scope$1, rl as fromNullishOr, rn as makeFormatterDefault, ro as fail$2, rr as flatten$2, rt as fromJsonString, ru as constTrue, sa as parse$6, sc as toMillis, si as serviceOption, sl as getOrUndefined, sn as encodeBase64Url$2, so as isSuccess, sr as forever$1, st as isGreaterThan, su as dual, t as Any, tc as min, ti as runPromiseWith, tl as flatMap$2, tn as InvalidValue$1, to as succeed$3, tr as flatMap, ts as fiberInterrupt, tt as encodeUnknownEffect, tu as compose, u as ErrorClass, ua as Class$1, uc as allocate, ui as succeedNone, ul as map$5, un as formatIso, uo as void_$3, ur as forkIn, us as forever, ut as isLessThanOrEqualTo, uu as pipe$1, v as NonEmptyString, va as effectDiscard, vc as isArrayNonEmpty, vi as timeout$1, vn as Transaction$1, vo as done$1, vr as isEffect, w as String$1, wa as provide$1, wi as txRetry, wn as annotateCurrentSpan, wo as hasInterrupts, wr as logWarning$1, wt as suspend$2, x as Number$1, xa as launch$1, xi as tryPromise, xl as YieldableProto, xn as addFinalizer$2, xr as logError, xs as scope, xt as mutable, y as Null, ya as empty$4, yc as isReadonlyArrayNonEmpty, yi as timeoutOption, yn as acquireRelease, yo as fail$4, yr as log$4, yt as make$35, z as Void, za as CurrentLogAnnotations, zc as isSuccess$1, zi as zipWith, zn as catchTags, zr as option, zs as externalSpan, zt as empty$2 } from "./Schema-Ay3DUM83.mjs";
|
|
5
|
+
import { $t as interrupt$4, A as fromSubscription, At as end, B as onExit$1, Bt as sliding, C as fromChannel, Ct as fromSubscriptionArray, D as fromPull, Dt as make$43, E as fromPubSub, F as mapEffect$1, Ft as offer$1, G as runCollect, Gt as shutdown$2, Ht as takeAll, I as mapError$1, It as offerAll, J as runForEach, K as runDrain, Kt as subscribe$1, L as merge$4, Lt as offerUnsafe, M as make$42, Mt as failCause$4, N as map$7, O as fromQueue, Ot as makeUnsafe$6, P as mapAccum, Pt as make$44, Q as succeed$4, Qt as getCurrent, S as fromAsyncIterable, T as fromIterable$1, U as provideContext$1, Ut as unbounded$2, Vt as take$1, W as run$2, Wt as publish, X as runHead, Xt as makeUnsafe$7, Y as runForEachArray, Zt as await_, _t as drain, b as flatMap$3, c as callback$1, ct as get$4, d as debounce$1, dt as make$46, et as takeWhile, f as decodeText$1, g as ensuring$1, h as encodeText, j as isStream, kt as bounded, l as catchCause$1, lt as make$45, m as empty$5, nt as toAsyncIterable, q as runFold, qt as unbounded$1, r as FileSystem, rt as toPull, st as unwrap$1, t as Path$2, tn as runIn, tt as tick, u as concat$2, ut as get$5, v as failCause$5, vt as forEach$1, w as fromEffect, wt as fromTransform, x as fromArray, xt as mapInput, y as filter$2, zt as shutdown$1 } from "./Path-BIaGSU2M.mjs";
|
|
6
|
+
import { _ as ChildProcessSpawner, a as Stdio, g as make$47, o as make$48, r as isQuitError } from "./NodeTerminal-CeaWke6-.mjs";
|
|
7
7
|
import { n as layer$7 } from "./NodeServices-Bt1GwPBR.mjs";
|
|
8
|
-
import { $ as file, A as SocketErrorReason, At as merge$5, Bt as set$3, Ct as HttpClientErrorSchema, Dt as empty$7, Ft as getAndSet, G as TracerPropagationEnabled, Ht as updateAndGet, I as HttpServerError, It as getUnsafe$2, J as transformResponse, K as filterStatusOk$1, Lt as make$
|
|
8
|
+
import { $ as file, A as SocketErrorReason, At as merge$5, Bt as set$3, Ct as HttpClientErrorSchema, Dt as empty$7, Ft as getAndSet, G as TracerPropagationEnabled, Gt as run$3, Ht as updateAndGet, I as HttpServerError, It as getUnsafe$2, J as transformResponse, K as filterStatusOk$1, Lt as make$49, Ot as fromInput$1, Pt as get$6, Q as empty$6, Rt as makeUnsafe$8, St as setBody, Tt as jsonUnsafe$1, U as layer$8, Vt as update$4, W as HttpClient, Wt as make$50, Z as symbol$1, _ as schemaBodyUrlParams, _t as acceptJson, a as withLogAddress, at as setCookie, bt as get$7, ct as stream, d as logger$1, dt as filterStatusOk, et as isHttpServerResponse, f as withLoggerDisabled, ft as matchStatus, g as schemaBodyJson, gt as schemaBodyJson$1, i as serve$1, it as schemaJson, kt as fromRecordUnsafe, lt as text$2, m as ParsedSearchParams, nt as raw, ot as setCookies, p as HttpServerRequest, q as retryTransient, rt as redirect, st as setHeader, t as HttpServer, tt as jsonUnsafe, u as cors, ut as uint8Array, v as schemaHeaders, vt as bearerToken, wt as isHttpClientError, xt as post, y as toURL, yt as bodyJson, z as RouteNotFound, zt as modify$3 } from "./HttpServer-BbbI8N6_.mjs";
|
|
9
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$2, t as Boolean$2, u as number$2 } from "./Config-BnFFyBjD.mjs";
|
|
10
10
|
import { a as make$51, i as keys, n as getOption, o as makeWith$1, r as invalidate, s as set$4, t as get$8 } from "./Cache-DOwpGEYJ.mjs";
|
|
11
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$52, 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-BBR7DPrQ.mjs";
|
|
@@ -14746,7 +14746,7 @@ const isCommand = (u) => hasProperty(u, TypeId$10);
|
|
|
14746
14746
|
* @since 4.0.0
|
|
14747
14747
|
* @category constructors
|
|
14748
14748
|
*/
|
|
14749
|
-
const make$
|
|
14749
|
+
const make$33 = (name, config, handler) => {
|
|
14750
14750
|
return makeCommand({
|
|
14751
14751
|
name,
|
|
14752
14752
|
config: parseConfig(config ?? {}),
|
|
@@ -15081,7 +15081,7 @@ const runWith = (command, config) => {
|
|
|
15081
15081
|
program = provideService(program, LogLevel, logLevel);
|
|
15082
15082
|
const services = match(logLevel, {
|
|
15083
15083
|
onNone: () => empty$1(),
|
|
15084
|
-
onSome: (level) => make$
|
|
15084
|
+
onSome: (level) => make$34(MinimumLogLevel, level)
|
|
15085
15085
|
});
|
|
15086
15086
|
yield* provideContext(program, services);
|
|
15087
15087
|
}, catchFilter((error) => isCliError(error) && error._tag === "ShowHelp" ? succeed$1(error) : fail$1(error), (error) => andThen(showHelp(command, error), fail(error))), catchFilter((e) => isQuitError(e) ? succeed$1(e) : fail$1(e), (_) => interrupt$1));
|
|
@@ -15262,7 +15262,7 @@ const CurrentLoggers = CurrentLoggers$1;
|
|
|
15262
15262
|
* @since 2.0.0
|
|
15263
15263
|
* @category constructors
|
|
15264
15264
|
*/
|
|
15265
|
-
const make$
|
|
15265
|
+
const make$32 = loggerMake;
|
|
15266
15266
|
/**
|
|
15267
15267
|
* Returns a new `Logger` which will aggregate logs output by the specified
|
|
15268
15268
|
* `Logger` over the provided `window`. After the `window` has elapsed, the
|
|
@@ -15558,7 +15558,7 @@ const makeUnsafe$2 = (value) => {
|
|
|
15558
15558
|
* @since 2.0.0
|
|
15559
15559
|
* @category constructors
|
|
15560
15560
|
*/
|
|
15561
|
-
const make$
|
|
15561
|
+
const make$31 = (value) => sync$1(() => makeUnsafe$2(value));
|
|
15562
15562
|
/**
|
|
15563
15563
|
* @since 2.0.0
|
|
15564
15564
|
* @category getters
|
|
@@ -15627,7 +15627,7 @@ const TypeId$8 = "~effect/transactions/TxRef";
|
|
|
15627
15627
|
* })
|
|
15628
15628
|
* ```
|
|
15629
15629
|
*/
|
|
15630
|
-
const make$
|
|
15630
|
+
const make$30 = (initial) => sync$1(() => makeUnsafe$1(initial));
|
|
15631
15631
|
/**
|
|
15632
15632
|
* Creates a new `TxRef` with the specified initial value.
|
|
15633
15633
|
*
|
|
@@ -15810,7 +15810,7 @@ const TxChunkProto = {
|
|
|
15810
15810
|
* })
|
|
15811
15811
|
* ```
|
|
15812
15812
|
*/
|
|
15813
|
-
const empty = () => map$3(make$
|
|
15813
|
+
const empty = () => map$3(make$30(empty$2()), (ref) => makeUnsafe(ref));
|
|
15814
15814
|
/**
|
|
15815
15815
|
* Creates a new `TxChunk` with the specified TxRef.
|
|
15816
15816
|
*
|
|
@@ -16102,7 +16102,7 @@ const TxQueueProto = {
|
|
|
16102
16102
|
*/
|
|
16103
16103
|
const unbounded = () => gen(function* () {
|
|
16104
16104
|
const items = yield* empty();
|
|
16105
|
-
const stateRef = yield* make$
|
|
16105
|
+
const stateRef = yield* make$30({ _tag: "Open" });
|
|
16106
16106
|
const txQueue = Object.create(TxQueueProto);
|
|
16107
16107
|
txQueue.strategy = "unbounded";
|
|
16108
16108
|
txQueue.capacity = Number.POSITIVE_INFINITY;
|
|
@@ -25063,7 +25063,7 @@ const schema$1 = /* @__PURE__ */ declare(isStream);
|
|
|
25063
25063
|
* @category Stream
|
|
25064
25064
|
*/
|
|
25065
25065
|
function Stream$1(success, error) {
|
|
25066
|
-
return make$
|
|
25066
|
+
return make$35(schema$1.ast, {
|
|
25067
25067
|
[StreamSchemaTypeId]: StreamSchemaTypeId,
|
|
25068
25068
|
success,
|
|
25069
25069
|
error
|
|
@@ -25193,7 +25193,7 @@ const makeProto$1 = (options) => {
|
|
|
25193
25193
|
* @since 4.0.0
|
|
25194
25194
|
* @category constructors
|
|
25195
25195
|
*/
|
|
25196
|
-
const make$
|
|
25196
|
+
const make$29 = (tag, options) => {
|
|
25197
25197
|
const successSchema = options?.success ?? Void;
|
|
25198
25198
|
const errorSchema = options?.error ?? Never;
|
|
25199
25199
|
const defectSchema = options?.defect ?? Defect;
|
|
@@ -25340,7 +25340,7 @@ const RpcGroupProto = {
|
|
|
25340
25340
|
});
|
|
25341
25341
|
},
|
|
25342
25342
|
annotateRpcs(service, value) {
|
|
25343
|
-
return this.annotateRpcsMerge(make$
|
|
25343
|
+
return this.annotateRpcsMerge(make$34(service, value));
|
|
25344
25344
|
},
|
|
25345
25345
|
annotateMerge(context) {
|
|
25346
25346
|
return makeProto({
|
|
@@ -25365,7 +25365,7 @@ const makeProto = (options) => Object.assign(function() {}, RpcGroupProto, {
|
|
|
25365
25365
|
* @since 4.0.0
|
|
25366
25366
|
* @category groups
|
|
25367
25367
|
*/
|
|
25368
|
-
const make$
|
|
25368
|
+
const make$28 = (...rpcs) => makeProto({
|
|
25369
25369
|
requests: new Map(rpcs.map((rpc) => [rpc._tag, rpc])),
|
|
25370
25370
|
annotations: empty$1()
|
|
25371
25371
|
});
|
|
@@ -26091,319 +26091,319 @@ const WS_METHODS = {
|
|
|
26091
26091
|
attachmentsDelete: "attachments.delete",
|
|
26092
26092
|
providerUploadFeedback: "provider.uploadFeedback"
|
|
26093
26093
|
};
|
|
26094
|
-
const WsServerUpsertKeybindingRpc = make$
|
|
26094
|
+
const WsServerUpsertKeybindingRpc = make$29(WS_METHODS.serverUpsertKeybinding, {
|
|
26095
26095
|
payload: ServerUpsertKeybindingInput,
|
|
26096
26096
|
success: ServerUpsertKeybindingResult,
|
|
26097
26097
|
error: KeybindingsConfigError
|
|
26098
26098
|
});
|
|
26099
|
-
const WsServerRemoveKeybindingRpc = make$
|
|
26099
|
+
const WsServerRemoveKeybindingRpc = make$29(WS_METHODS.serverRemoveKeybinding, {
|
|
26100
26100
|
payload: ServerRemoveKeybindingInput,
|
|
26101
26101
|
success: ServerRemoveKeybindingResult,
|
|
26102
26102
|
error: KeybindingsConfigError
|
|
26103
26103
|
});
|
|
26104
|
-
const WsServerGetConfigRpc = make$
|
|
26104
|
+
const WsServerGetConfigRpc = make$29(WS_METHODS.serverGetConfig, {
|
|
26105
26105
|
payload: Struct({}),
|
|
26106
26106
|
success: ServerConfig$1,
|
|
26107
26107
|
error: Union([KeybindingsConfigError, ServerSettingsError])
|
|
26108
26108
|
});
|
|
26109
|
-
const WsServerRefreshProvidersRpc = make$
|
|
26109
|
+
const WsServerRefreshProvidersRpc = make$29(WS_METHODS.serverRefreshProviders, {
|
|
26110
26110
|
payload: Struct({}),
|
|
26111
26111
|
success: ServerProviderUpdatedPayload
|
|
26112
26112
|
});
|
|
26113
|
-
const WsServerStartProviderAuthRpc = make$
|
|
26113
|
+
const WsServerStartProviderAuthRpc = make$29(WS_METHODS.serverStartProviderAuth, {
|
|
26114
26114
|
payload: ProviderAuthStartInput,
|
|
26115
26115
|
success: ProviderAuthSession
|
|
26116
26116
|
});
|
|
26117
|
-
const WsServerRepairProviderAuthRuntimeRpc = make$
|
|
26117
|
+
const WsServerRepairProviderAuthRuntimeRpc = make$29(WS_METHODS.serverRepairProviderAuthRuntime, {
|
|
26118
26118
|
payload: ProviderAuthRuntimeRepairInput,
|
|
26119
26119
|
success: ProviderAuthRuntimeRepairResult
|
|
26120
26120
|
});
|
|
26121
|
-
const WsServerDisconnectProviderAuthRpc = make$
|
|
26121
|
+
const WsServerDisconnectProviderAuthRpc = make$29(WS_METHODS.serverDisconnectProviderAuth, {
|
|
26122
26122
|
payload: ProviderAuthDisconnectInput,
|
|
26123
26123
|
success: ServerProviderUpdatedPayload
|
|
26124
26124
|
});
|
|
26125
|
-
const WsServerGetProviderAuthSessionRpc = make$
|
|
26125
|
+
const WsServerGetProviderAuthSessionRpc = make$29(WS_METHODS.serverGetProviderAuthSession, {
|
|
26126
26126
|
payload: ProviderAuthSessionInput,
|
|
26127
26127
|
success: ProviderAuthSession
|
|
26128
26128
|
});
|
|
26129
|
-
const WsServerCancelProviderAuthRpc = make$
|
|
26129
|
+
const WsServerCancelProviderAuthRpc = make$29(WS_METHODS.serverCancelProviderAuth, {
|
|
26130
26130
|
payload: ProviderAuthSessionInput,
|
|
26131
26131
|
success: ProviderAuthSession
|
|
26132
26132
|
});
|
|
26133
|
-
const WsServerSubmitProviderAuthCodeRpc = make$
|
|
26133
|
+
const WsServerSubmitProviderAuthCodeRpc = make$29(WS_METHODS.serverSubmitProviderAuthCode, {
|
|
26134
26134
|
payload: ProviderAuthSubmitCodeInput,
|
|
26135
26135
|
success: ProviderAuthSession
|
|
26136
26136
|
});
|
|
26137
|
-
const WsServerSyncPersonalCodexToCloudRpc = make$
|
|
26137
|
+
const WsServerSyncPersonalCodexToCloudRpc = make$29(WS_METHODS.serverSyncPersonalCodexToCloud, {
|
|
26138
26138
|
payload: ProviderCredentialCloudSyncInput,
|
|
26139
26139
|
success: ProviderCredentialCloudSyncResult
|
|
26140
26140
|
});
|
|
26141
|
-
const WsServerSyncPersonalClaudeToCloudRpc = make$
|
|
26141
|
+
const WsServerSyncPersonalClaudeToCloudRpc = make$29(WS_METHODS.serverSyncPersonalClaudeToCloud, {
|
|
26142
26142
|
payload: ProviderCredentialCloudSyncInput,
|
|
26143
26143
|
success: ProviderCredentialCloudSyncResult
|
|
26144
26144
|
});
|
|
26145
|
-
const WsServerGetSettingsRpc = make$
|
|
26145
|
+
const WsServerGetSettingsRpc = make$29(WS_METHODS.serverGetSettings, {
|
|
26146
26146
|
payload: Struct({}),
|
|
26147
26147
|
success: ServerSettings,
|
|
26148
26148
|
error: ServerSettingsError
|
|
26149
26149
|
});
|
|
26150
|
-
const WsServerUpdateSettingsRpc = make$
|
|
26150
|
+
const WsServerUpdateSettingsRpc = make$29(WS_METHODS.serverUpdateSettings, {
|
|
26151
26151
|
payload: Struct({ patch: ServerSettingsPatch }),
|
|
26152
26152
|
success: ServerSettings,
|
|
26153
26153
|
error: ServerSettingsError
|
|
26154
26154
|
});
|
|
26155
|
-
const WsServerUpdateEnvironmentDisplayNameRpc = make$
|
|
26155
|
+
const WsServerUpdateEnvironmentDisplayNameRpc = make$29(WS_METHODS.serverUpdateEnvironmentDisplayName, {
|
|
26156
26156
|
payload: ServerEnvironmentDisplayNameUpdateInput,
|
|
26157
26157
|
success: ServerEnvironmentDisplayNameUpdateResult
|
|
26158
26158
|
});
|
|
26159
|
-
const WsServerTraceDiagnosticsRpc = make$
|
|
26159
|
+
const WsServerTraceDiagnosticsRpc = make$29(WS_METHODS.serverGetTraceDiagnostics, {
|
|
26160
26160
|
payload: Struct({ slowSpanThresholdMs: optionalKey(NonNegativeInt) }),
|
|
26161
26161
|
success: ServerTraceDiagnosticsResult
|
|
26162
26162
|
});
|
|
26163
|
-
const WsServerHeartbeatRpc = make$
|
|
26163
|
+
const WsServerHeartbeatRpc = make$29(WS_METHODS.serverHeartbeat, {
|
|
26164
26164
|
payload: Struct({}),
|
|
26165
26165
|
success: Struct({})
|
|
26166
26166
|
});
|
|
26167
26167
|
const PullRequestRpcError = Union([PullRequestUnavailableError, PullRequestOperationError]);
|
|
26168
|
-
const WsPullRequestsListRpc = make$
|
|
26168
|
+
const WsPullRequestsListRpc = make$29(WS_METHODS.pullRequestsList, {
|
|
26169
26169
|
payload: PullRequestListInput,
|
|
26170
26170
|
success: PullRequestListResult,
|
|
26171
26171
|
error: PullRequestRpcError
|
|
26172
26172
|
});
|
|
26173
|
-
const WsPullRequestsListStatsRpc = make$
|
|
26173
|
+
const WsPullRequestsListStatsRpc = make$29(WS_METHODS.pullRequestsListStats, {
|
|
26174
26174
|
payload: PullRequestListStatsInput,
|
|
26175
26175
|
success: PullRequestListStatsResult,
|
|
26176
26176
|
error: PullRequestRpcError
|
|
26177
26177
|
});
|
|
26178
|
-
const WsPullRequestsDetailRpc = make$
|
|
26178
|
+
const WsPullRequestsDetailRpc = make$29(WS_METHODS.pullRequestsDetail, {
|
|
26179
26179
|
payload: PullRequestRef,
|
|
26180
26180
|
success: PullRequestDetail,
|
|
26181
26181
|
error: PullRequestRpcError
|
|
26182
26182
|
});
|
|
26183
|
-
const WsPullRequestsActivityRpc = make$
|
|
26183
|
+
const WsPullRequestsActivityRpc = make$29(WS_METHODS.pullRequestsActivity, {
|
|
26184
26184
|
payload: PullRequestRef,
|
|
26185
26185
|
success: PullRequestActivity,
|
|
26186
26186
|
error: PullRequestRpcError
|
|
26187
26187
|
});
|
|
26188
|
-
const WsPullRequestsThreadCommentsRpc = make$
|
|
26188
|
+
const WsPullRequestsThreadCommentsRpc = make$29(WS_METHODS.pullRequestsThreadComments, {
|
|
26189
26189
|
payload: PullRequestThreadCommentsInput,
|
|
26190
26190
|
success: PullRequestThreadCommentsResult,
|
|
26191
26191
|
error: PullRequestRpcError
|
|
26192
26192
|
});
|
|
26193
|
-
const WsPullRequestsDiffFileContentsRpc = make$
|
|
26193
|
+
const WsPullRequestsDiffFileContentsRpc = make$29(WS_METHODS.pullRequestsDiffFileContents, {
|
|
26194
26194
|
payload: PullRequestDiffFileContentsInput,
|
|
26195
26195
|
success: PullRequestDiffFileContentsResult,
|
|
26196
26196
|
error: PullRequestRpcError
|
|
26197
26197
|
});
|
|
26198
|
-
const WsPullRequestsRunActionRpc = make$
|
|
26198
|
+
const WsPullRequestsRunActionRpc = make$29(WS_METHODS.pullRequestsRunAction, {
|
|
26199
26199
|
payload: PullRequestActionInput,
|
|
26200
26200
|
success: Void,
|
|
26201
26201
|
error: PullRequestRpcError
|
|
26202
26202
|
});
|
|
26203
|
-
const WsPullRequestsUpdateRpc = make$
|
|
26203
|
+
const WsPullRequestsUpdateRpc = make$29(WS_METHODS.pullRequestsUpdate, {
|
|
26204
26204
|
payload: PullRequestUpdateInput,
|
|
26205
26205
|
success: Void,
|
|
26206
26206
|
error: PullRequestRpcError
|
|
26207
26207
|
});
|
|
26208
|
-
const WsPullRequestsCommentRpc = make$
|
|
26208
|
+
const WsPullRequestsCommentRpc = make$29(WS_METHODS.pullRequestsComment, {
|
|
26209
26209
|
payload: PullRequestCommentInput,
|
|
26210
26210
|
success: Void,
|
|
26211
26211
|
error: PullRequestRpcError
|
|
26212
26212
|
});
|
|
26213
|
-
const WsPullRequestsUpdateCommentRpc = make$
|
|
26213
|
+
const WsPullRequestsUpdateCommentRpc = make$29(WS_METHODS.pullRequestsUpdateComment, {
|
|
26214
26214
|
payload: PullRequestCommentUpdateInput,
|
|
26215
26215
|
success: Void,
|
|
26216
26216
|
error: PullRequestRpcError
|
|
26217
26217
|
});
|
|
26218
|
-
const WsPullRequestsSubmitReviewRpc = make$
|
|
26218
|
+
const WsPullRequestsSubmitReviewRpc = make$29(WS_METHODS.pullRequestsSubmitReview, {
|
|
26219
26219
|
payload: PullRequestSubmitReviewInput,
|
|
26220
26220
|
success: Void,
|
|
26221
26221
|
error: PullRequestRpcError
|
|
26222
26222
|
});
|
|
26223
|
-
const WsPullRequestsReplyToThreadRpc = make$
|
|
26223
|
+
const WsPullRequestsReplyToThreadRpc = make$29(WS_METHODS.pullRequestsReplyToThread, {
|
|
26224
26224
|
payload: PullRequestThreadReplyInput,
|
|
26225
26225
|
success: Void,
|
|
26226
26226
|
error: PullRequestRpcError
|
|
26227
26227
|
});
|
|
26228
|
-
const WsPullRequestsSetThreadResolutionRpc = make$
|
|
26228
|
+
const WsPullRequestsSetThreadResolutionRpc = make$29(WS_METHODS.pullRequestsSetThreadResolution, {
|
|
26229
26229
|
payload: PullRequestThreadResolutionInput,
|
|
26230
26230
|
success: Void,
|
|
26231
26231
|
error: PullRequestRpcError
|
|
26232
26232
|
});
|
|
26233
|
-
const WsPullRequestsSetReactionRpc = make$
|
|
26233
|
+
const WsPullRequestsSetReactionRpc = make$29(WS_METHODS.pullRequestsSetReaction, {
|
|
26234
26234
|
payload: PullRequestReactionInput,
|
|
26235
26235
|
success: Void,
|
|
26236
26236
|
error: PullRequestRpcError
|
|
26237
26237
|
});
|
|
26238
|
-
const WsPullRequestsInvalidateRpc = make$
|
|
26238
|
+
const WsPullRequestsInvalidateRpc = make$29(WS_METHODS.pullRequestsInvalidate, {
|
|
26239
26239
|
payload: PullRequestInvalidateInput,
|
|
26240
26240
|
success: Void,
|
|
26241
26241
|
error: PullRequestRpcError
|
|
26242
26242
|
});
|
|
26243
|
-
const WsPullRequestsReviewerCandidatesRpc = make$
|
|
26243
|
+
const WsPullRequestsReviewerCandidatesRpc = make$29(WS_METHODS.pullRequestsReviewerCandidates, {
|
|
26244
26244
|
payload: PullRequestRef,
|
|
26245
26245
|
success: PullRequestReviewerCandidateList,
|
|
26246
26246
|
error: PullRequestRpcError
|
|
26247
26247
|
});
|
|
26248
|
-
const WsPullRequestsRequestReviewersRpc = make$
|
|
26248
|
+
const WsPullRequestsRequestReviewersRpc = make$29(WS_METHODS.pullRequestsRequestReviewers, {
|
|
26249
26249
|
payload: PullRequestReviewerRequestInput,
|
|
26250
26250
|
success: Void,
|
|
26251
26251
|
error: PullRequestRpcError
|
|
26252
26252
|
});
|
|
26253
|
-
const WsProjectsSearchContentsRpc = make$
|
|
26253
|
+
const WsProjectsSearchContentsRpc = make$29(WS_METHODS.projectsSearchContents, {
|
|
26254
26254
|
payload: ProjectSearchContentsInput,
|
|
26255
26255
|
success: ProjectSearchContentsResult,
|
|
26256
26256
|
error: ProjectSearchContentsError
|
|
26257
26257
|
});
|
|
26258
|
-
const WsProjectsSearchEntriesRpc = make$
|
|
26258
|
+
const WsProjectsSearchEntriesRpc = make$29(WS_METHODS.projectsSearchEntries, {
|
|
26259
26259
|
payload: ProjectSearchEntriesInput,
|
|
26260
26260
|
success: ProjectSearchEntriesResult,
|
|
26261
26261
|
error: ProjectSearchEntriesError
|
|
26262
26262
|
});
|
|
26263
|
-
const WsProjectsWriteFileRpc = make$
|
|
26263
|
+
const WsProjectsWriteFileRpc = make$29(WS_METHODS.projectsWriteFile, {
|
|
26264
26264
|
payload: ProjectWriteFileInput,
|
|
26265
26265
|
success: ProjectWriteFileResult,
|
|
26266
26266
|
error: ProjectWriteFileError
|
|
26267
26267
|
});
|
|
26268
|
-
const WsProjectCheckoutDeletionPreviewRpc = make$
|
|
26268
|
+
const WsProjectCheckoutDeletionPreviewRpc = make$29(WS_METHODS.projectCheckoutDeletionPreview, {
|
|
26269
26269
|
payload: ProjectCheckoutDeletionPreviewInput,
|
|
26270
26270
|
success: ProjectCheckoutDeletionPreview
|
|
26271
26271
|
});
|
|
26272
|
-
const WsProjectCheckoutDeletionExecuteRpc = make$
|
|
26272
|
+
const WsProjectCheckoutDeletionExecuteRpc = make$29(WS_METHODS.projectCheckoutDeletionExecute, {
|
|
26273
26273
|
payload: ProjectCheckoutDeletionExecuteInput,
|
|
26274
26274
|
success: ProjectCheckoutDeletionResult
|
|
26275
26275
|
});
|
|
26276
|
-
const WsWorkspaceReadFileRpc = make$
|
|
26276
|
+
const WsWorkspaceReadFileRpc = make$29(WS_METHODS.workspaceReadFile, {
|
|
26277
26277
|
payload: BulkTransferReadFileInput,
|
|
26278
26278
|
success: BulkTransferStreamEvent,
|
|
26279
26279
|
error: BulkTransferError,
|
|
26280
26280
|
stream: true
|
|
26281
26281
|
});
|
|
26282
|
-
const WsWorkspaceBeginWriteFileRpc = make$
|
|
26282
|
+
const WsWorkspaceBeginWriteFileRpc = make$29(WS_METHODS.workspaceBeginWriteFile, {
|
|
26283
26283
|
payload: BulkTransferWriteBeginInput,
|
|
26284
26284
|
success: BulkTransferWriteBeginResult,
|
|
26285
26285
|
error: BulkTransferError
|
|
26286
26286
|
});
|
|
26287
|
-
const WsWorkspaceWriteFileChunkRpc = make$
|
|
26287
|
+
const WsWorkspaceWriteFileChunkRpc = make$29(WS_METHODS.workspaceWriteFileChunk, {
|
|
26288
26288
|
payload: BulkTransferWriteChunkInput,
|
|
26289
26289
|
success: BulkTransferWriteChunkResult,
|
|
26290
26290
|
error: BulkTransferError
|
|
26291
26291
|
});
|
|
26292
|
-
const WsWorkspaceCommitWriteFileRpc = make$
|
|
26292
|
+
const WsWorkspaceCommitWriteFileRpc = make$29(WS_METHODS.workspaceCommitWriteFile, {
|
|
26293
26293
|
payload: BulkTransferIdInput,
|
|
26294
26294
|
success: BulkTransferWriteCommitResult,
|
|
26295
26295
|
error: BulkTransferError
|
|
26296
26296
|
});
|
|
26297
|
-
const WsWorkspaceCancelWriteFileRpc = make$
|
|
26297
|
+
const WsWorkspaceCancelWriteFileRpc = make$29(WS_METHODS.workspaceCancelWriteFile, {
|
|
26298
26298
|
payload: BulkTransferIdInput,
|
|
26299
26299
|
success: BulkTransferCancelResult,
|
|
26300
26300
|
error: BulkTransferError
|
|
26301
26301
|
});
|
|
26302
|
-
const WsShellOpenInEditorRpc = make$
|
|
26302
|
+
const WsShellOpenInEditorRpc = make$29(WS_METHODS.shellOpenInEditor, {
|
|
26303
26303
|
payload: OpenInEditorInput,
|
|
26304
26304
|
error: OpenError$1
|
|
26305
26305
|
});
|
|
26306
|
-
const WsSubscribeGitStatusRpc = make$
|
|
26306
|
+
const WsSubscribeGitStatusRpc = make$29(WS_METHODS.subscribeGitStatus, {
|
|
26307
26307
|
payload: GitStatusInput,
|
|
26308
26308
|
success: GitStatusStreamEvent,
|
|
26309
26309
|
error: GitManagerServiceError,
|
|
26310
26310
|
stream: true
|
|
26311
26311
|
});
|
|
26312
|
-
const WsGitPullRpc = make$
|
|
26312
|
+
const WsGitPullRpc = make$29(WS_METHODS.gitPull, {
|
|
26313
26313
|
payload: GitPullInput,
|
|
26314
26314
|
success: GitPullResult,
|
|
26315
26315
|
error: GitCommandError
|
|
26316
26316
|
});
|
|
26317
|
-
const WsGitRefreshStatusRpc = make$
|
|
26317
|
+
const WsGitRefreshStatusRpc = make$29(WS_METHODS.gitRefreshStatus, {
|
|
26318
26318
|
payload: GitStatusInput,
|
|
26319
26319
|
success: GitStatusResult,
|
|
26320
26320
|
error: GitManagerServiceError
|
|
26321
26321
|
});
|
|
26322
|
-
const WsGitRunStackedActionRpc = make$
|
|
26322
|
+
const WsGitRunStackedActionRpc = make$29(WS_METHODS.gitRunStackedAction, {
|
|
26323
26323
|
payload: GitRunStackedActionInput,
|
|
26324
26324
|
success: GitActionProgressEvent,
|
|
26325
26325
|
error: GitManagerServiceError,
|
|
26326
26326
|
stream: true
|
|
26327
26327
|
});
|
|
26328
|
-
const WsGitResolvePullRequestRpc = make$
|
|
26328
|
+
const WsGitResolvePullRequestRpc = make$29(WS_METHODS.gitResolvePullRequest, {
|
|
26329
26329
|
payload: GitPullRequestRefInput,
|
|
26330
26330
|
success: GitResolvePullRequestResult,
|
|
26331
26331
|
error: GitManagerServiceError
|
|
26332
26332
|
});
|
|
26333
|
-
const WsGitPreparePullRequestThreadRpc = make$
|
|
26333
|
+
const WsGitPreparePullRequestThreadRpc = make$29(WS_METHODS.gitPreparePullRequestThread, {
|
|
26334
26334
|
payload: GitPreparePullRequestThreadInput,
|
|
26335
26335
|
success: GitPreparePullRequestThreadResult,
|
|
26336
26336
|
error: GitManagerServiceError
|
|
26337
26337
|
});
|
|
26338
|
-
const WsGitListBranchesRpc = make$
|
|
26338
|
+
const WsGitListBranchesRpc = make$29(WS_METHODS.gitListBranches, {
|
|
26339
26339
|
payload: GitListBranchesInput,
|
|
26340
26340
|
success: GitListBranchesResult,
|
|
26341
26341
|
error: GitCommandError
|
|
26342
26342
|
});
|
|
26343
|
-
const WsVcsListRefsRpc = make$
|
|
26343
|
+
const WsVcsListRefsRpc = make$29(WS_METHODS.vcsListRefs, {
|
|
26344
26344
|
payload: VcsListRefsInput,
|
|
26345
26345
|
success: VcsListRefsResult,
|
|
26346
26346
|
error: GitCommandError
|
|
26347
26347
|
});
|
|
26348
|
-
const WsVcsRefreshStatusRpc = make$
|
|
26348
|
+
const WsVcsRefreshStatusRpc = make$29(WS_METHODS.vcsRefreshStatus, {
|
|
26349
26349
|
payload: GitStatusInput,
|
|
26350
26350
|
success: VcsStatusResult,
|
|
26351
26351
|
error: GitManagerServiceError
|
|
26352
26352
|
});
|
|
26353
|
-
const WsSubscribeVcsStatusRpc = make$
|
|
26353
|
+
const WsSubscribeVcsStatusRpc = make$29(WS_METHODS.subscribeVcsStatus, {
|
|
26354
26354
|
payload: GitStatusInput,
|
|
26355
26355
|
success: VcsStatusStreamEvent,
|
|
26356
26356
|
error: GitManagerServiceError,
|
|
26357
26357
|
stream: true
|
|
26358
26358
|
});
|
|
26359
|
-
const WsVcsPullRpc = make$
|
|
26359
|
+
const WsVcsPullRpc = make$29(WS_METHODS.vcsPull, {
|
|
26360
26360
|
payload: VcsPullInput,
|
|
26361
26361
|
success: VcsPullResult,
|
|
26362
26362
|
error: GitCommandError
|
|
26363
26363
|
});
|
|
26364
|
-
const WsVcsCreateWorktreeRpc = make$
|
|
26364
|
+
const WsVcsCreateWorktreeRpc = make$29(WS_METHODS.vcsCreateWorktree, {
|
|
26365
26365
|
payload: VcsCreateWorktreeInput,
|
|
26366
26366
|
success: VcsCreateWorktreeResult,
|
|
26367
26367
|
error: Union([GitCommandError, VcsUnsupportedRequestError])
|
|
26368
26368
|
});
|
|
26369
|
-
const WsVcsRemoveWorktreeRpc = make$
|
|
26369
|
+
const WsVcsRemoveWorktreeRpc = make$29(WS_METHODS.vcsRemoveWorktree, {
|
|
26370
26370
|
payload: GitRemoveWorktreeInput,
|
|
26371
26371
|
error: GitCommandError
|
|
26372
26372
|
});
|
|
26373
|
-
const WsVcsCreateRefRpc = make$
|
|
26373
|
+
const WsVcsCreateRefRpc = make$29(WS_METHODS.vcsCreateRef, {
|
|
26374
26374
|
payload: VcsCreateRefInput,
|
|
26375
26375
|
success: VcsCreateRefResult,
|
|
26376
26376
|
error: GitCommandError
|
|
26377
26377
|
});
|
|
26378
|
-
const WsVcsSwitchRefRpc = make$
|
|
26378
|
+
const WsVcsSwitchRefRpc = make$29(WS_METHODS.vcsSwitchRef, {
|
|
26379
26379
|
payload: VcsSwitchRefInput,
|
|
26380
26380
|
success: VcsSwitchRefResult,
|
|
26381
26381
|
error: GitCommandError
|
|
26382
26382
|
});
|
|
26383
|
-
const WsVcsInitRpc = make$
|
|
26383
|
+
const WsVcsInitRpc = make$29(WS_METHODS.vcsInit, {
|
|
26384
26384
|
payload: VcsInitInput,
|
|
26385
26385
|
error: Union([GitCommandError, VcsUnsupportedRequestError])
|
|
26386
26386
|
});
|
|
26387
|
-
const WsGitCreateWorktreeRpc = make$
|
|
26387
|
+
const WsGitCreateWorktreeRpc = make$29(WS_METHODS.gitCreateWorktree, {
|
|
26388
26388
|
payload: GitCreateWorktreeInput,
|
|
26389
26389
|
success: GitCreateWorktreeResult,
|
|
26390
26390
|
error: GitCommandError
|
|
26391
26391
|
});
|
|
26392
|
-
const WsGitRemoveWorktreeRpc = make$
|
|
26392
|
+
const WsGitRemoveWorktreeRpc = make$29(WS_METHODS.gitRemoveWorktree, {
|
|
26393
26393
|
payload: GitRemoveWorktreeInput,
|
|
26394
26394
|
error: GitCommandError
|
|
26395
26395
|
});
|
|
26396
|
-
const WsGitCreateBranchRpc = make$
|
|
26396
|
+
const WsGitCreateBranchRpc = make$29(WS_METHODS.gitCreateBranch, {
|
|
26397
26397
|
payload: GitCreateBranchInput,
|
|
26398
26398
|
success: GitCreateBranchResult,
|
|
26399
26399
|
error: GitCommandError
|
|
26400
26400
|
});
|
|
26401
|
-
const WsGitCheckoutRpc = make$
|
|
26401
|
+
const WsGitCheckoutRpc = make$29(WS_METHODS.gitCheckout, {
|
|
26402
26402
|
payload: GitCheckoutInput,
|
|
26403
26403
|
success: GitCheckoutResult,
|
|
26404
26404
|
error: GitCommandError
|
|
26405
26405
|
});
|
|
26406
|
-
const WsGitInitRpc = make$
|
|
26406
|
+
const WsGitInitRpc = make$29(WS_METHODS.gitInit, {
|
|
26407
26407
|
payload: GitInitInput,
|
|
26408
26408
|
error: GitCommandError
|
|
26409
26409
|
});
|
|
@@ -26411,7 +26411,7 @@ const WsGitInitRpc = make$30(WS_METHODS.gitInit, {
|
|
|
26411
26411
|
* The git half of a review: the branch range and the uncommitted work. The
|
|
26412
26412
|
* per-turn diffs beside it arrive through `orchestration.getTurnDiff`.
|
|
26413
26413
|
*/
|
|
26414
|
-
const WsReviewGetDiffPreviewRpc = make$
|
|
26414
|
+
const WsReviewGetDiffPreviewRpc = make$29(WS_METHODS.reviewGetDiffPreview, {
|
|
26415
26415
|
payload: ReviewDiffPreviewInput,
|
|
26416
26416
|
success: ReviewDiffPreviewResult,
|
|
26417
26417
|
error: Union([ReviewDiffPreviewError])
|
|
@@ -26421,12 +26421,12 @@ const WsReviewGetDiffPreviewRpc = make$30(WS_METHODS.reviewGetDiffPreview, {
|
|
|
26421
26421
|
* chunked bulk-transfer stream. A viewer wants the text once; a transfer wants
|
|
26422
26422
|
* offsets and checksums.
|
|
26423
26423
|
*/
|
|
26424
|
-
const WsProjectsReadFileRpc = make$
|
|
26424
|
+
const WsProjectsReadFileRpc = make$29(WS_METHODS.projectsReadFile, {
|
|
26425
26425
|
payload: ProjectReadFileInput,
|
|
26426
26426
|
success: ProjectReadFileResult,
|
|
26427
26427
|
error: Union([ProjectReadFileError])
|
|
26428
26428
|
});
|
|
26429
|
-
const WsFilesystemBrowseRpc = make$
|
|
26429
|
+
const WsFilesystemBrowseRpc = make$29(WS_METHODS.filesystemBrowse, {
|
|
26430
26430
|
payload: FilesystemBrowseInput,
|
|
26431
26431
|
success: FilesystemBrowseResult,
|
|
26432
26432
|
error: Union([FilesystemBrowseError])
|
|
@@ -26436,87 +26436,87 @@ const WsFilesystemBrowseRpc = make$30(WS_METHODS.filesystemBrowse, {
|
|
|
26436
26436
|
* Routed through the server because the phone keeps only the Forge-minted
|
|
26437
26437
|
* session token, never a CMMD one.
|
|
26438
26438
|
*/
|
|
26439
|
-
const WsCloudListRuntimesRpc = make$
|
|
26439
|
+
const WsCloudListRuntimesRpc = make$29(WS_METHODS.cloudListRuntimes, {
|
|
26440
26440
|
payload: CloudRuntimeListInput,
|
|
26441
26441
|
success: CloudRuntimeListResult,
|
|
26442
26442
|
error: Union([CloudRuntimeListError])
|
|
26443
26443
|
});
|
|
26444
|
-
const WsTerminalOpenRpc = make$
|
|
26444
|
+
const WsTerminalOpenRpc = make$29(WS_METHODS.terminalOpen, {
|
|
26445
26445
|
payload: TerminalOpenInput,
|
|
26446
26446
|
success: TerminalSessionSnapshot,
|
|
26447
26447
|
error: TerminalError
|
|
26448
26448
|
});
|
|
26449
|
-
const WsTerminalAttachRpc = make$
|
|
26449
|
+
const WsTerminalAttachRpc = make$29(WS_METHODS.terminalAttach, {
|
|
26450
26450
|
payload: TerminalAttachInput,
|
|
26451
26451
|
success: TerminalAttachStreamEvent,
|
|
26452
26452
|
error: TerminalError,
|
|
26453
26453
|
stream: true
|
|
26454
26454
|
});
|
|
26455
|
-
const WsTerminalWriteRpc = make$
|
|
26455
|
+
const WsTerminalWriteRpc = make$29(WS_METHODS.terminalWrite, {
|
|
26456
26456
|
payload: TerminalWriteRequest,
|
|
26457
26457
|
success: TerminalControlAck,
|
|
26458
26458
|
error: TerminalError
|
|
26459
26459
|
});
|
|
26460
|
-
const WsTerminalResizeRpc = make$
|
|
26460
|
+
const WsTerminalResizeRpc = make$29(WS_METHODS.terminalResize, {
|
|
26461
26461
|
payload: TerminalResizeRequest,
|
|
26462
26462
|
success: TerminalControlAck,
|
|
26463
26463
|
error: TerminalError
|
|
26464
26464
|
});
|
|
26465
|
-
const WsTerminalSignalRpc = make$
|
|
26465
|
+
const WsTerminalSignalRpc = make$29(WS_METHODS.terminalSignal, {
|
|
26466
26466
|
payload: TerminalSignalRequest,
|
|
26467
26467
|
success: TerminalControlAck,
|
|
26468
26468
|
error: TerminalError
|
|
26469
26469
|
});
|
|
26470
|
-
const WsTerminalClearRpc = make$
|
|
26470
|
+
const WsTerminalClearRpc = make$29(WS_METHODS.terminalClear, {
|
|
26471
26471
|
payload: TerminalClearRequest,
|
|
26472
26472
|
success: TerminalControlAck,
|
|
26473
26473
|
error: TerminalError
|
|
26474
26474
|
});
|
|
26475
|
-
const WsTerminalRestartRpc = make$
|
|
26475
|
+
const WsTerminalRestartRpc = make$29(WS_METHODS.terminalRestart, {
|
|
26476
26476
|
payload: TerminalRestartRequest,
|
|
26477
26477
|
success: TerminalRestartResult,
|
|
26478
26478
|
error: TerminalError
|
|
26479
26479
|
});
|
|
26480
|
-
const WsTerminalCloseRpc = make$
|
|
26480
|
+
const WsTerminalCloseRpc = make$29(WS_METHODS.terminalClose, {
|
|
26481
26481
|
payload: TerminalCloseRequest,
|
|
26482
26482
|
success: TerminalControlAck,
|
|
26483
26483
|
error: TerminalError
|
|
26484
26484
|
});
|
|
26485
|
-
const WsBrowserOpenSessionRpc = make$
|
|
26485
|
+
const WsBrowserOpenSessionRpc = make$29(WS_METHODS.browserOpenSession, {
|
|
26486
26486
|
payload: BrowserOpenSessionInput,
|
|
26487
26487
|
success: BrowserSessionSnapshot,
|
|
26488
26488
|
error: BrowserError
|
|
26489
26489
|
});
|
|
26490
|
-
const WsBrowserListSessionsRpc = make$
|
|
26490
|
+
const WsBrowserListSessionsRpc = make$29(WS_METHODS.browserListSessions, {
|
|
26491
26491
|
payload: BrowserListSessionsInput,
|
|
26492
26492
|
success: ArraySchema(BrowserSessionSnapshot),
|
|
26493
26493
|
error: BrowserError
|
|
26494
26494
|
});
|
|
26495
|
-
const WsBrowserCloseSessionRpc = make$
|
|
26495
|
+
const WsBrowserCloseSessionRpc = make$29(WS_METHODS.browserCloseSession, {
|
|
26496
26496
|
payload: BrowserCloseSessionInput,
|
|
26497
26497
|
error: BrowserError
|
|
26498
26498
|
});
|
|
26499
|
-
const WsBrowserGetSessionRpc = make$
|
|
26499
|
+
const WsBrowserGetSessionRpc = make$29(WS_METHODS.browserGetSession, {
|
|
26500
26500
|
payload: BrowserGetSessionInput,
|
|
26501
26501
|
success: NullOr(BrowserSessionSnapshot),
|
|
26502
26502
|
error: BrowserError
|
|
26503
26503
|
});
|
|
26504
|
-
const WsBrowserCommandRpc = make$
|
|
26504
|
+
const WsBrowserCommandRpc = make$29(WS_METHODS.browserCommand, {
|
|
26505
26505
|
payload: BrowserCommandInput,
|
|
26506
26506
|
success: BrowserCommandResult,
|
|
26507
26507
|
error: BrowserError
|
|
26508
26508
|
});
|
|
26509
|
-
const WsBrowserClearBrowsingDataRpc = make$
|
|
26509
|
+
const WsBrowserClearBrowsingDataRpc = make$29(WS_METHODS.browserClearBrowsingData, {
|
|
26510
26510
|
payload: BrowserClearBrowsingDataInput,
|
|
26511
26511
|
success: BrowserClearBrowsingDataResult,
|
|
26512
26512
|
error: BrowserError
|
|
26513
26513
|
});
|
|
26514
|
-
const WsBrowserAttachDisplayRpc = make$
|
|
26514
|
+
const WsBrowserAttachDisplayRpc = make$29(WS_METHODS.browserAttachDisplay, {
|
|
26515
26515
|
payload: BrowserDisplayAttachInput,
|
|
26516
26516
|
success: BrowserDisplayAttachResult,
|
|
26517
26517
|
error: BrowserError
|
|
26518
26518
|
});
|
|
26519
|
-
const WsBrowserAddDisplayIceCandidateRpc = make$
|
|
26519
|
+
const WsBrowserAddDisplayIceCandidateRpc = make$29(WS_METHODS.browserAddDisplayIceCandidate, {
|
|
26520
26520
|
payload: BrowserDisplayIceCandidateInput,
|
|
26521
26521
|
success: Struct({}),
|
|
26522
26522
|
error: BrowserError
|
|
@@ -26528,87 +26528,87 @@ const WsBrowserAddDisplayIceCandidateRpc = make$30(WS_METHODS.browserAddDisplayI
|
|
|
26528
26528
|
* page: it can click a DOM element but cannot touch the dock, a file manager,
|
|
26529
26529
|
* or anything else outside Chromium. This one lands on the display itself.
|
|
26530
26530
|
*/
|
|
26531
|
-
const WsComputerInputRpc = make$
|
|
26531
|
+
const WsComputerInputRpc = make$29(WS_METHODS.computerInput, {
|
|
26532
26532
|
payload: ComputerInputInput,
|
|
26533
26533
|
success: ComputerInputResult,
|
|
26534
26534
|
error: ComputerError
|
|
26535
26535
|
});
|
|
26536
|
-
const WsDevTunnelRegisterRpc = make$
|
|
26536
|
+
const WsDevTunnelRegisterRpc = make$29(WS_METHODS.devTunnelRegister, {
|
|
26537
26537
|
payload: DevTunnelRegisterInput,
|
|
26538
26538
|
success: DevTunnelRecord,
|
|
26539
26539
|
error: DevTunnelError
|
|
26540
26540
|
});
|
|
26541
|
-
const WsDevTunnelUnregisterRpc = make$
|
|
26541
|
+
const WsDevTunnelUnregisterRpc = make$29(WS_METHODS.devTunnelUnregister, {
|
|
26542
26542
|
payload: DevTunnelUnregisterInput,
|
|
26543
26543
|
error: DevTunnelError
|
|
26544
26544
|
});
|
|
26545
|
-
const WsDevTunnelListRpc = make$
|
|
26545
|
+
const WsDevTunnelListRpc = make$29(WS_METHODS.devTunnelList, {
|
|
26546
26546
|
payload: DevTunnelListInput,
|
|
26547
26547
|
success: ArraySchema(DevTunnelRecord),
|
|
26548
26548
|
error: DevTunnelError
|
|
26549
26549
|
});
|
|
26550
|
-
const WsThreadDevRuntimeGetRpc = make$
|
|
26550
|
+
const WsThreadDevRuntimeGetRpc = make$29(WS_METHODS.threadDevRuntimeGet, {
|
|
26551
26551
|
payload: ThreadDevRuntimeGetInput,
|
|
26552
26552
|
success: NullOr(ThreadDevRuntimeRecord),
|
|
26553
26553
|
error: ThreadDevRuntimeError
|
|
26554
26554
|
});
|
|
26555
|
-
const WsThreadDevRuntimeAllocatePortRpc = make$
|
|
26555
|
+
const WsThreadDevRuntimeAllocatePortRpc = make$29(WS_METHODS.threadDevRuntimeAllocatePort, {
|
|
26556
26556
|
payload: ThreadDevRuntimeAllocatePortInput,
|
|
26557
26557
|
success: ThreadDevRuntimeRecord,
|
|
26558
26558
|
error: ThreadDevRuntimeError
|
|
26559
26559
|
});
|
|
26560
|
-
const WsThreadDevRuntimeReleaseRpc = make$
|
|
26560
|
+
const WsThreadDevRuntimeReleaseRpc = make$29(WS_METHODS.threadDevRuntimeRelease, {
|
|
26561
26561
|
payload: ThreadDevRuntimeReleaseInput,
|
|
26562
26562
|
error: ThreadDevRuntimeError
|
|
26563
26563
|
});
|
|
26564
|
-
const WsWorkspaceEnvironmentPreflightRpc = make$
|
|
26564
|
+
const WsWorkspaceEnvironmentPreflightRpc = make$29(WS_METHODS.workspaceEnvironmentPreflight, {
|
|
26565
26565
|
payload: WorkspaceEnvironmentPreflightInput,
|
|
26566
26566
|
success: WorkspaceEnvironmentPreflightReport,
|
|
26567
26567
|
error: WorkspaceEnvironmentError
|
|
26568
26568
|
});
|
|
26569
|
-
const WsWorkspaceEnsureScratchRpc = make$
|
|
26569
|
+
const WsWorkspaceEnsureScratchRpc = make$29(WS_METHODS.workspaceEnsureScratch, {
|
|
26570
26570
|
payload: WorkspaceEnsureScratchInput,
|
|
26571
26571
|
success: WorkspaceEnsureScratchResult,
|
|
26572
26572
|
error: WorkspaceEnvironmentError
|
|
26573
26573
|
});
|
|
26574
|
-
const WsOrchestrationDispatchCommandRpc = make$
|
|
26574
|
+
const WsOrchestrationDispatchCommandRpc = make$29(ORCHESTRATION_WS_METHODS.dispatchCommand, {
|
|
26575
26575
|
payload: ClientOrchestrationCommand,
|
|
26576
26576
|
success: OrchestrationRpcSchemas.dispatchCommand.output,
|
|
26577
26577
|
error: OrchestrationDispatchCommandError
|
|
26578
26578
|
});
|
|
26579
|
-
const WsOrchestrationGetTurnDiffRpc = make$
|
|
26579
|
+
const WsOrchestrationGetTurnDiffRpc = make$29(ORCHESTRATION_WS_METHODS.getTurnDiff, {
|
|
26580
26580
|
payload: OrchestrationGetTurnDiffInput,
|
|
26581
26581
|
success: OrchestrationRpcSchemas.getTurnDiff.output,
|
|
26582
26582
|
error: OrchestrationGetTurnDiffError
|
|
26583
26583
|
});
|
|
26584
|
-
const WsOrchestrationGetFullThreadDiffRpc = make$
|
|
26584
|
+
const WsOrchestrationGetFullThreadDiffRpc = make$29(ORCHESTRATION_WS_METHODS.getFullThreadDiff, {
|
|
26585
26585
|
payload: OrchestrationGetFullThreadDiffInput,
|
|
26586
26586
|
success: OrchestrationRpcSchemas.getFullThreadDiff.output,
|
|
26587
26587
|
error: OrchestrationGetFullThreadDiffError
|
|
26588
26588
|
});
|
|
26589
|
-
const WsOrchestrationStreamTurnDiffRpc = make$
|
|
26589
|
+
const WsOrchestrationStreamTurnDiffRpc = make$29(ORCHESTRATION_WS_METHODS.streamTurnDiff, {
|
|
26590
26590
|
payload: OrchestrationGetTurnDiffInput,
|
|
26591
26591
|
success: BulkTransferStreamEvent,
|
|
26592
26592
|
error: Union([OrchestrationGetTurnDiffError, BulkTransferError]),
|
|
26593
26593
|
stream: true
|
|
26594
26594
|
});
|
|
26595
|
-
const WsOrchestrationStreamFullThreadDiffRpc = make$
|
|
26595
|
+
const WsOrchestrationStreamFullThreadDiffRpc = make$29(ORCHESTRATION_WS_METHODS.streamFullThreadDiff, {
|
|
26596
26596
|
payload: OrchestrationGetFullThreadDiffInput,
|
|
26597
26597
|
success: BulkTransferStreamEvent,
|
|
26598
26598
|
error: Union([OrchestrationGetFullThreadDiffError, BulkTransferError]),
|
|
26599
26599
|
stream: true
|
|
26600
26600
|
});
|
|
26601
|
-
const WsOrchestrationReplayEventsRpc = make$
|
|
26601
|
+
const WsOrchestrationReplayEventsRpc = make$29(ORCHESTRATION_WS_METHODS.replayEvents, {
|
|
26602
26602
|
payload: OrchestrationReplayEventsInput,
|
|
26603
26603
|
success: OrchestrationRpcSchemas.replayEvents.output,
|
|
26604
26604
|
error: OrchestrationReplayEventsError
|
|
26605
26605
|
});
|
|
26606
|
-
const WsOrchestrationGetArchivedShellSnapshotRpc = make$
|
|
26606
|
+
const WsOrchestrationGetArchivedShellSnapshotRpc = make$29(ORCHESTRATION_WS_METHODS.getArchivedShellSnapshot, {
|
|
26607
26607
|
payload: OrchestrationRpcSchemas.getArchivedShellSnapshot.input,
|
|
26608
26608
|
success: OrchestrationRpcSchemas.getArchivedShellSnapshot.output,
|
|
26609
26609
|
error: OrchestrationGetSnapshotError
|
|
26610
26610
|
});
|
|
26611
|
-
const WsOrchestrationSearchThreadsRpc = make$
|
|
26611
|
+
const WsOrchestrationSearchThreadsRpc = make$29(ORCHESTRATION_WS_METHODS.searchThreads, {
|
|
26612
26612
|
payload: OrchestrationSearchThreadsInput,
|
|
26613
26613
|
success: OrchestrationRpcSchemas.searchThreads.output,
|
|
26614
26614
|
error: OrchestrationSearchThreadsError
|
|
@@ -26619,7 +26619,7 @@ const WsOrchestrationSearchThreadsRpc = make$30(ORCHESTRATION_WS_METHODS.searchT
|
|
|
26619
26619
|
* route and `subscribeThread`'s fallback snapshot serve, over the RPC socket
|
|
26620
26620
|
* instead.
|
|
26621
26621
|
*/
|
|
26622
|
-
const WsOrchestrationGetThreadDetailPageRpc = make$
|
|
26622
|
+
const WsOrchestrationGetThreadDetailPageRpc = make$29(ORCHESTRATION_WS_METHODS.getThreadDetailPage, {
|
|
26623
26623
|
payload: OrchestrationRpcSchemas.getThreadDetailPage.input,
|
|
26624
26624
|
success: OrchestrationRpcSchemas.getThreadDetailPage.output,
|
|
26625
26625
|
error: OrchestrationGetSnapshotError
|
|
@@ -26632,29 +26632,29 @@ const WsOrchestrationGetThreadDetailPageRpc = make$30(ORCHESTRATION_WS_METHODS.g
|
|
|
26632
26632
|
* also be authorized, and a repository the caller cannot reach is a failure
|
|
26633
26633
|
* here rather than a clone that dies half way.
|
|
26634
26634
|
*/
|
|
26635
|
-
const WsSourceControlLookupRepositoryRpc = make$
|
|
26635
|
+
const WsSourceControlLookupRepositoryRpc = make$29(WS_METHODS.sourceControlLookupRepository, {
|
|
26636
26636
|
payload: SourceControlRepositoryLookupInput,
|
|
26637
26637
|
success: SourceControlRepositoryInfo,
|
|
26638
26638
|
error: SourceControlRepositoryError
|
|
26639
26639
|
});
|
|
26640
|
-
const WsSourceControlCloneRepositoryRpc = make$
|
|
26640
|
+
const WsSourceControlCloneRepositoryRpc = make$29(WS_METHODS.sourceControlCloneRepository, {
|
|
26641
26641
|
payload: SourceControlCloneRepositoryInput,
|
|
26642
26642
|
success: SourceControlCloneRepositoryResult,
|
|
26643
26643
|
error: SourceControlRepositoryError
|
|
26644
26644
|
});
|
|
26645
|
-
const WsOrchestrationSubscribeShellRpc = make$
|
|
26645
|
+
const WsOrchestrationSubscribeShellRpc = make$29(ORCHESTRATION_WS_METHODS.subscribeShell, {
|
|
26646
26646
|
payload: OrchestrationRpcSchemas.subscribeShell.input,
|
|
26647
26647
|
success: OrchestrationRpcSchemas.subscribeShell.output,
|
|
26648
26648
|
error: OrchestrationGetSnapshotError,
|
|
26649
26649
|
stream: true
|
|
26650
26650
|
});
|
|
26651
|
-
const WsOrchestrationSubscribeThreadRpc = make$
|
|
26651
|
+
const WsOrchestrationSubscribeThreadRpc = make$29(ORCHESTRATION_WS_METHODS.subscribeThread, {
|
|
26652
26652
|
payload: OrchestrationRpcSchemas.subscribeThread.input,
|
|
26653
26653
|
success: OrchestrationRpcSchemas.subscribeThread.output,
|
|
26654
26654
|
error: OrchestrationGetSnapshotError,
|
|
26655
26655
|
stream: true
|
|
26656
26656
|
});
|
|
26657
|
-
const WsSubscribeTerminalEventsRpc = make$
|
|
26657
|
+
const WsSubscribeTerminalEventsRpc = make$29(WS_METHODS.subscribeTerminalEvents, {
|
|
26658
26658
|
payload: Struct({}),
|
|
26659
26659
|
success: TerminalEvent,
|
|
26660
26660
|
stream: true
|
|
@@ -26675,65 +26675,65 @@ const WsSubscribeTerminalEventsRpc = make$30(WS_METHODS.subscribeTerminalEvents,
|
|
|
26675
26675
|
* The client's activity report, accepted and dropped. See
|
|
26676
26676
|
* packages/contracts/src/clientActivityCompat.ts for why there is no answer.
|
|
26677
26677
|
*/
|
|
26678
|
-
const WsServerReportClientActivityRpc = make$
|
|
26679
|
-
const WsServerDiscoverSourceControlRpc = make$
|
|
26678
|
+
const WsServerReportClientActivityRpc = make$29(WS_METHODS.serverReportClientActivity, { payload: ClientActivityReportInput });
|
|
26679
|
+
const WsServerDiscoverSourceControlRpc = make$29(WS_METHODS.serverDiscoverSourceControl, {
|
|
26680
26680
|
payload: Struct({}),
|
|
26681
26681
|
success: SourceControlDiscoveryResult
|
|
26682
26682
|
});
|
|
26683
|
-
const WsProjectsListEntriesRpc = make$
|
|
26683
|
+
const WsProjectsListEntriesRpc = make$29(WS_METHODS.projectsListEntries, {
|
|
26684
26684
|
payload: ProjectListEntriesInput,
|
|
26685
26685
|
success: ProjectListEntriesResult,
|
|
26686
26686
|
error: ProjectListEntriesError
|
|
26687
26687
|
});
|
|
26688
|
-
const WsSubscribeTerminalMetadataRpc = make$
|
|
26688
|
+
const WsSubscribeTerminalMetadataRpc = make$29(WS_METHODS.subscribeTerminalMetadata, {
|
|
26689
26689
|
payload: Struct({}),
|
|
26690
26690
|
success: TerminalMetadataStreamEvent,
|
|
26691
26691
|
stream: true
|
|
26692
26692
|
});
|
|
26693
|
-
const WsSubscribeBrowserEventsRpc = make$
|
|
26693
|
+
const WsSubscribeBrowserEventsRpc = make$29(WS_METHODS.subscribeBrowserEvents, {
|
|
26694
26694
|
payload: BrowserSubscribeInput,
|
|
26695
26695
|
success: BrowserStreamEvent,
|
|
26696
26696
|
error: BrowserError,
|
|
26697
26697
|
stream: true
|
|
26698
26698
|
});
|
|
26699
|
-
const WsSubscribeServerConfigRpc = make$
|
|
26699
|
+
const WsSubscribeServerConfigRpc = make$29(WS_METHODS.subscribeServerConfig, {
|
|
26700
26700
|
payload: Struct({}),
|
|
26701
26701
|
success: ServerConfigStreamEvent,
|
|
26702
26702
|
error: Union([KeybindingsConfigError, ServerSettingsError]),
|
|
26703
26703
|
stream: true
|
|
26704
26704
|
});
|
|
26705
|
-
const WsSubscribeServerLifecycleRpc = make$
|
|
26705
|
+
const WsSubscribeServerLifecycleRpc = make$29(WS_METHODS.subscribeServerLifecycle, {
|
|
26706
26706
|
payload: Struct({}),
|
|
26707
26707
|
success: ServerLifecycleStreamEvent,
|
|
26708
26708
|
stream: true
|
|
26709
26709
|
});
|
|
26710
|
-
const WsSubscribeAuthAccessRpc = make$
|
|
26710
|
+
const WsSubscribeAuthAccessRpc = make$29(WS_METHODS.subscribeAuthAccess, {
|
|
26711
26711
|
payload: Struct({}),
|
|
26712
26712
|
success: AuthAccessStreamEvent,
|
|
26713
26713
|
stream: true
|
|
26714
26714
|
});
|
|
26715
|
-
const WsSubscribeWorkspaceReadinessRpc = make$
|
|
26715
|
+
const WsSubscribeWorkspaceReadinessRpc = make$29(WS_METHODS.subscribeWorkspaceReadiness, {
|
|
26716
26716
|
payload: WorkspaceReadinessSubscribeInput,
|
|
26717
26717
|
success: PhaseEvent,
|
|
26718
26718
|
error: WorkspaceReadinessError,
|
|
26719
26719
|
stream: true
|
|
26720
26720
|
});
|
|
26721
|
-
const WsRpcGroup = make$
|
|
26721
|
+
const WsRpcGroup = make$28(WsServerGetConfigRpc, WsServerRefreshProvidersRpc, WsServerStartProviderAuthRpc, WsServerRepairProviderAuthRuntimeRpc, WsServerDisconnectProviderAuthRpc, WsServerGetProviderAuthSessionRpc, WsServerCancelProviderAuthRpc, WsServerSubmitProviderAuthCodeRpc, WsServerSyncPersonalCodexToCloudRpc, WsServerSyncPersonalClaudeToCloudRpc, WsServerUpsertKeybindingRpc, WsServerRemoveKeybindingRpc, WsServerGetSettingsRpc, WsServerUpdateSettingsRpc, WsServerUpdateEnvironmentDisplayNameRpc, WsServerTraceDiagnosticsRpc, WsServerHeartbeatRpc, make$29(WS_METHODS.usageGetSummary, {
|
|
26722
26722
|
payload: UsageSummaryInput,
|
|
26723
26723
|
success: UsageSummary,
|
|
26724
26724
|
error: UsageReadError
|
|
26725
|
-
}), WsPullRequestsListRpc, WsPullRequestsListStatsRpc, WsPullRequestsDetailRpc, WsPullRequestsActivityRpc, WsPullRequestsThreadCommentsRpc, WsPullRequestsDiffFileContentsRpc, WsPullRequestsRunActionRpc, WsPullRequestsUpdateRpc, WsPullRequestsCommentRpc, WsPullRequestsUpdateCommentRpc, WsPullRequestsSubmitReviewRpc, WsPullRequestsReplyToThreadRpc, WsPullRequestsSetThreadResolutionRpc, WsPullRequestsSetReactionRpc, WsPullRequestsInvalidateRpc, WsPullRequestsReviewerCandidatesRpc, WsPullRequestsRequestReviewersRpc, WsProjectsSearchContentsRpc, WsProjectsSearchEntriesRpc, WsProjectsWriteFileRpc, WsProjectCheckoutDeletionPreviewRpc, WsProjectCheckoutDeletionExecuteRpc, WsWorkspaceReadFileRpc, WsWorkspaceBeginWriteFileRpc, WsWorkspaceWriteFileChunkRpc, WsWorkspaceCommitWriteFileRpc, WsWorkspaceCancelWriteFileRpc, WsShellOpenInEditorRpc, WsSubscribeGitStatusRpc, WsGitPullRpc, WsGitRefreshStatusRpc, WsGitRunStackedActionRpc, WsGitResolvePullRequestRpc, WsGitPreparePullRequestThreadRpc, WsGitListBranchesRpc, WsVcsListRefsRpc, WsVcsRefreshStatusRpc, WsSubscribeVcsStatusRpc, WsVcsPullRpc, WsVcsCreateWorktreeRpc, WsVcsRemoveWorktreeRpc, WsVcsCreateRefRpc, WsVcsSwitchRefRpc, WsVcsInitRpc, WsGitCreateWorktreeRpc, WsGitRemoveWorktreeRpc, WsGitCreateBranchRpc, WsGitCheckoutRpc, WsGitInitRpc, WsFilesystemBrowseRpc, WsProjectsReadFileRpc, WsReviewGetDiffPreviewRpc, WsCloudListRuntimesRpc, WsTerminalOpenRpc, WsTerminalAttachRpc, WsTerminalWriteRpc, WsTerminalResizeRpc, WsTerminalSignalRpc, WsTerminalClearRpc, WsTerminalRestartRpc, WsTerminalCloseRpc, WsBrowserOpenSessionRpc, WsBrowserListSessionsRpc, WsBrowserCloseSessionRpc, WsBrowserGetSessionRpc, WsBrowserCommandRpc, WsBrowserClearBrowsingDataRpc, WsBrowserAttachDisplayRpc, WsBrowserAddDisplayIceCandidateRpc, WsComputerInputRpc, WsDevTunnelRegisterRpc, WsDevTunnelUnregisterRpc, WsDevTunnelListRpc, WsThreadDevRuntimeGetRpc, WsThreadDevRuntimeAllocatePortRpc, WsThreadDevRuntimeReleaseRpc, WsWorkspaceEnvironmentPreflightRpc, WsWorkspaceEnsureScratchRpc, WsSubscribeTerminalEventsRpc, WsSubscribeTerminalMetadataRpc, WsProjectsListEntriesRpc, WsServerDiscoverSourceControlRpc, WsServerReportClientActivityRpc, WsSubscribeBrowserEventsRpc, WsSubscribeServerConfigRpc, WsSubscribeServerLifecycleRpc, WsSubscribeAuthAccessRpc, WsSubscribeWorkspaceReadinessRpc, WsOrchestrationDispatchCommandRpc, WsOrchestrationGetTurnDiffRpc, WsOrchestrationGetFullThreadDiffRpc, WsOrchestrationStreamTurnDiffRpc, WsOrchestrationStreamFullThreadDiffRpc, WsOrchestrationReplayEventsRpc, WsOrchestrationGetArchivedShellSnapshotRpc, WsOrchestrationSubscribeShellRpc, WsOrchestrationSubscribeThreadRpc, make$
|
|
26725
|
+
}), WsPullRequestsListRpc, WsPullRequestsListStatsRpc, WsPullRequestsDetailRpc, WsPullRequestsActivityRpc, WsPullRequestsThreadCommentsRpc, WsPullRequestsDiffFileContentsRpc, WsPullRequestsRunActionRpc, WsPullRequestsUpdateRpc, WsPullRequestsCommentRpc, WsPullRequestsUpdateCommentRpc, WsPullRequestsSubmitReviewRpc, WsPullRequestsReplyToThreadRpc, WsPullRequestsSetThreadResolutionRpc, WsPullRequestsSetReactionRpc, WsPullRequestsInvalidateRpc, WsPullRequestsReviewerCandidatesRpc, WsPullRequestsRequestReviewersRpc, WsProjectsSearchContentsRpc, WsProjectsSearchEntriesRpc, WsProjectsWriteFileRpc, WsProjectCheckoutDeletionPreviewRpc, WsProjectCheckoutDeletionExecuteRpc, WsWorkspaceReadFileRpc, WsWorkspaceBeginWriteFileRpc, WsWorkspaceWriteFileChunkRpc, WsWorkspaceCommitWriteFileRpc, WsWorkspaceCancelWriteFileRpc, WsShellOpenInEditorRpc, WsSubscribeGitStatusRpc, WsGitPullRpc, WsGitRefreshStatusRpc, WsGitRunStackedActionRpc, WsGitResolvePullRequestRpc, WsGitPreparePullRequestThreadRpc, WsGitListBranchesRpc, WsVcsListRefsRpc, WsVcsRefreshStatusRpc, WsSubscribeVcsStatusRpc, WsVcsPullRpc, WsVcsCreateWorktreeRpc, WsVcsRemoveWorktreeRpc, WsVcsCreateRefRpc, WsVcsSwitchRefRpc, WsVcsInitRpc, WsGitCreateWorktreeRpc, WsGitRemoveWorktreeRpc, WsGitCreateBranchRpc, WsGitCheckoutRpc, WsGitInitRpc, WsFilesystemBrowseRpc, WsProjectsReadFileRpc, WsReviewGetDiffPreviewRpc, WsCloudListRuntimesRpc, WsTerminalOpenRpc, WsTerminalAttachRpc, WsTerminalWriteRpc, WsTerminalResizeRpc, WsTerminalSignalRpc, WsTerminalClearRpc, WsTerminalRestartRpc, WsTerminalCloseRpc, WsBrowserOpenSessionRpc, WsBrowserListSessionsRpc, WsBrowserCloseSessionRpc, WsBrowserGetSessionRpc, WsBrowserCommandRpc, WsBrowserClearBrowsingDataRpc, WsBrowserAttachDisplayRpc, WsBrowserAddDisplayIceCandidateRpc, WsComputerInputRpc, WsDevTunnelRegisterRpc, WsDevTunnelUnregisterRpc, WsDevTunnelListRpc, WsThreadDevRuntimeGetRpc, WsThreadDevRuntimeAllocatePortRpc, WsThreadDevRuntimeReleaseRpc, WsWorkspaceEnvironmentPreflightRpc, WsWorkspaceEnsureScratchRpc, WsSubscribeTerminalEventsRpc, WsSubscribeTerminalMetadataRpc, WsProjectsListEntriesRpc, WsServerDiscoverSourceControlRpc, WsServerReportClientActivityRpc, WsSubscribeBrowserEventsRpc, WsSubscribeServerConfigRpc, WsSubscribeServerLifecycleRpc, WsSubscribeAuthAccessRpc, WsSubscribeWorkspaceReadinessRpc, WsOrchestrationDispatchCommandRpc, WsOrchestrationGetTurnDiffRpc, WsOrchestrationGetFullThreadDiffRpc, WsOrchestrationStreamTurnDiffRpc, WsOrchestrationStreamFullThreadDiffRpc, WsOrchestrationReplayEventsRpc, WsOrchestrationGetArchivedShellSnapshotRpc, WsOrchestrationSubscribeShellRpc, WsOrchestrationSubscribeThreadRpc, make$29(WS_METHODS.assetsCreateUrl, {
|
|
26726
26726
|
payload: AssetsRpcSchemas.createUrl.input,
|
|
26727
26727
|
success: AssetsRpcSchemas.createUrl.output,
|
|
26728
26728
|
error: AssetAccessError
|
|
26729
|
-
}), make$
|
|
26729
|
+
}), make$29(WS_METHODS.attachmentsCreateUploadUrl, {
|
|
26730
26730
|
payload: AttachmentCreateUploadUrlInput,
|
|
26731
26731
|
success: AttachmentCreateUploadUrlResult,
|
|
26732
26732
|
error: AttachmentUploadSigningKeyError
|
|
26733
|
-
}), make$
|
|
26733
|
+
}), make$29(WS_METHODS.attachmentsDelete, {
|
|
26734
26734
|
payload: AttachmentDeleteInput,
|
|
26735
26735
|
success: Void
|
|
26736
|
-
}), make$
|
|
26736
|
+
}), make$29(WS_METHODS.providerUploadFeedback, {
|
|
26737
26737
|
payload: ProviderUploadFeedbackInput,
|
|
26738
26738
|
success: ProviderUploadFeedbackResult,
|
|
26739
26739
|
error: ProviderUploadFeedbackError
|
|
@@ -34361,7 +34361,7 @@ function parse$5(input) {
|
|
|
34361
34361
|
const FULL_PATH_REGEXP = /^https?:\/\/.*?\//;
|
|
34362
34362
|
const OPTIONAL_PARAM_REGEXP = /(\/:[^/()]*?)\?(\/?)/;
|
|
34363
34363
|
/** @internal */
|
|
34364
|
-
const make$
|
|
34364
|
+
const make$27 = (options = {}) => new RouterImpl(options);
|
|
34365
34365
|
var RouterImpl = class {
|
|
34366
34366
|
constructor(options = {}) {
|
|
34367
34367
|
this.options = {
|
|
@@ -34880,7 +34880,7 @@ const httpMethods = [
|
|
|
34880
34880
|
* @since 1.0.0
|
|
34881
34881
|
* @category constructors
|
|
34882
34882
|
*/
|
|
34883
|
-
const make$
|
|
34883
|
+
const make$26 = make$27;
|
|
34884
34884
|
//#endregion
|
|
34885
34885
|
//#region ../../node_modules/.bun/effect@4.0.0-beta.51/node_modules/effect/dist/unstable/http/HttpRouter.js
|
|
34886
34886
|
/**
|
|
@@ -34896,8 +34896,8 @@ const HttpRouter = /* @__PURE__ */ Service$1("effect/http/HttpRouter");
|
|
|
34896
34896
|
* @since 4.0.0
|
|
34897
34897
|
* @category HttpRouter
|
|
34898
34898
|
*/
|
|
34899
|
-
const make$
|
|
34900
|
-
const router = make$
|
|
34899
|
+
const make$25 = /* @__PURE__ */ gen(function* () {
|
|
34900
|
+
const router = make$26(yield* RouterConfig);
|
|
34901
34901
|
const middleware = /* @__PURE__ */ new Set();
|
|
34902
34902
|
const addAll = (routes) => contextWith((context) => {
|
|
34903
34903
|
const middleware = getMiddleware(context);
|
|
@@ -35027,7 +35027,7 @@ const add$1 = (method, path, handler, options) => use((router) => router.add(met
|
|
|
35027
35027
|
* @since 4.0.0
|
|
35028
35028
|
* @category HttpRouter
|
|
35029
35029
|
*/
|
|
35030
|
-
const layer$5 = /* @__PURE__ */ effect(HttpRouter)(make$
|
|
35030
|
+
const layer$5 = /* @__PURE__ */ effect(HttpRouter)(make$25);
|
|
35031
35031
|
const RouteTypeId = "~effect/http/HttpRouter/Route";
|
|
35032
35032
|
const makeRoute = (options) => ({
|
|
35033
35033
|
...options,
|
|
@@ -66041,7 +66041,7 @@ function normalizeNumberish(value) {
|
|
|
66041
66041
|
}
|
|
66042
66042
|
//#endregion
|
|
66043
66043
|
//#region package.json
|
|
66044
|
-
var version$1 = "0.13.
|
|
66044
|
+
var version$1 = "0.13.97";
|
|
66045
66045
|
//#endregion
|
|
66046
66046
|
//#region src/sentry.ts
|
|
66047
66047
|
const SERVER_APP_NAME = "forge-server";
|
|
@@ -70888,7 +70888,7 @@ const storeAttachmentUpload = fn$1("AttachmentUpload.store")(function* (claims,
|
|
|
70888
70888
|
const fileSystem = yield* FileSystem;
|
|
70889
70889
|
const path = yield* Path$2;
|
|
70890
70890
|
let receivedBytes = 0;
|
|
70891
|
-
const bodyStream = body instanceof Uint8Array ? make$
|
|
70891
|
+
const bodyStream = body instanceof Uint8Array ? make$42(body) : body;
|
|
70892
70892
|
return yield* gen(function* () {
|
|
70893
70893
|
yield* fileSystem.makeDirectory(path.dirname(finalPath), { recursive: true });
|
|
70894
70894
|
yield* run$2(bodyStream.pipe(takeWhile((chunk) => {
|
|
@@ -76837,7 +76837,7 @@ let clientIdCounter = 0;
|
|
|
76837
76837
|
* @since 4.0.0
|
|
76838
76838
|
* @category client
|
|
76839
76839
|
*/
|
|
76840
|
-
const make$
|
|
76840
|
+
const make$24 = /* @__PURE__ */ fnUntraced(function* (group, options) {
|
|
76841
76841
|
const clientId = clientIdCounter++;
|
|
76842
76842
|
const { run, send, supportsAck, supportsTransferables } = yield* Protocol$1;
|
|
76843
76843
|
const entries = /* @__PURE__ */ new Map();
|
|
@@ -76981,7 +76981,7 @@ const makeNoSerialization = /* @__PURE__ */ fnUntraced(function* (group, options
|
|
|
76981
76981
|
const services = yield* context();
|
|
76982
76982
|
const scope = get$3(services, Scope$1);
|
|
76983
76983
|
const trackFiber = runIn(forkUnsafe(scope, "parallel"));
|
|
76984
|
-
const concurrencySemaphore = concurrency === "unbounded" ? void 0 : yield* make$
|
|
76984
|
+
const concurrencySemaphore = concurrency === "unbounded" ? void 0 : yield* make$43(concurrency);
|
|
76985
76985
|
const clients = /* @__PURE__ */ new Map();
|
|
76986
76986
|
let isShutdown = false;
|
|
76987
76987
|
const shutdownLatch = makeUnsafe$7(false);
|
|
@@ -77212,10 +77212,10 @@ const applyMiddleware = (context, handler, options) => {
|
|
|
77212
77212
|
* @since 4.0.0
|
|
77213
77213
|
* @category server
|
|
77214
77214
|
*/
|
|
77215
|
-
const make$
|
|
77215
|
+
const make$23 = /* @__PURE__ */ fnUntraced(function* (group, options) {
|
|
77216
77216
|
const { disconnects, end, run, send, supportsAck, supportsSpanPropagation, supportsTransferables } = yield* Protocol;
|
|
77217
77217
|
const services = yield* context();
|
|
77218
|
-
const scope = yield* make$
|
|
77218
|
+
const scope = yield* make$36();
|
|
77219
77219
|
const server = yield* makeNoSerialization(group, {
|
|
77220
77220
|
...options,
|
|
77221
77221
|
disableClientAcks: !supportsAck,
|
|
@@ -77384,12 +77384,12 @@ const makeProtocolWithHttpEffectWebsocket = /* @__PURE__ */ gen(function* () {
|
|
|
77384
77384
|
*/
|
|
77385
77385
|
const toHttpEffectWebsocket = /* @__PURE__ */ fnUntraced(function* (group, options) {
|
|
77386
77386
|
const { httpEffect, protocol } = yield* makeProtocolWithHttpEffectWebsocket;
|
|
77387
|
-
yield* make$
|
|
77387
|
+
yield* make$23(group, options).pipe(provideService(Protocol, protocol), forkScoped);
|
|
77388
77388
|
return httpEffect;
|
|
77389
77389
|
});
|
|
77390
77390
|
const makeSocketProtocol = /* @__PURE__ */ gen(function* () {
|
|
77391
77391
|
const serialization = yield* RpcSerialization;
|
|
77392
|
-
const disconnects = yield* make$
|
|
77392
|
+
const disconnects = yield* make$44();
|
|
77393
77393
|
let clientId = 0;
|
|
77394
77394
|
const clients = /* @__PURE__ */ new Map();
|
|
77395
77395
|
const clientIds = /* @__PURE__ */ new Set();
|
|
@@ -79007,7 +79007,7 @@ function updateSuccessfulEntry(input) {
|
|
|
79007
79007
|
return next;
|
|
79008
79008
|
}
|
|
79009
79009
|
const makeSourceControlRateLimit = gen(function* () {
|
|
79010
|
-
const entries = yield* make$
|
|
79010
|
+
const entries = yield* make$49(/* @__PURE__ */ new Map());
|
|
79011
79011
|
const check = fn$1("SourceControlRateLimit.check")(function* (input, options) {
|
|
79012
79012
|
const now = yield* currentTimeMillis;
|
|
79013
79013
|
const entry = (yield* get$6(entries)).get(normalizedKey(input));
|
|
@@ -80042,7 +80042,7 @@ function trimmed$2(value) {
|
|
|
80042
80042
|
* the other hosts already use.
|
|
80043
80043
|
*/
|
|
80044
80044
|
function toIsoUtc(value) {
|
|
80045
|
-
return match(make$
|
|
80045
|
+
return match(make$37(value), {
|
|
80046
80046
|
onNone: () => value,
|
|
80047
80047
|
onSome: formatIso
|
|
80048
80048
|
});
|
|
@@ -84203,7 +84203,7 @@ function resolveGithubWriteIdentity(getSettings) {
|
|
|
84203
84203
|
}
|
|
84204
84204
|
var ServerSettingsService = class ServerSettingsService extends Service$1()("forge/serverSettings/ServerSettingsService") {
|
|
84205
84205
|
static layerTest = (overrides = {}) => effect(ServerSettingsService, gen(function* () {
|
|
84206
|
-
const currentSettingsRef = yield* make$
|
|
84206
|
+
const currentSettingsRef = yield* make$49(deepMerge$1(DEFAULT_SERVER_SETTINGS, overrides));
|
|
84207
84207
|
return {
|
|
84208
84208
|
start: void_$1,
|
|
84209
84209
|
ready: void_$1,
|
|
@@ -84261,12 +84261,12 @@ const ServerSettingsLive = effect(ServerSettingsService, gen(function* () {
|
|
|
84261
84261
|
const { settingsPath } = yield* ServerConfig;
|
|
84262
84262
|
const fs = yield* FileSystem;
|
|
84263
84263
|
const pathService = yield* Path$2;
|
|
84264
|
-
const writeSemaphore = yield* make$
|
|
84264
|
+
const writeSemaphore = yield* make$43(1);
|
|
84265
84265
|
const cacheKey = "settings";
|
|
84266
84266
|
const changesPubSub = yield* unbounded$1();
|
|
84267
|
-
const startedRef = yield* make$
|
|
84268
|
-
const startedDeferred = yield* make$
|
|
84269
|
-
const watcherScope = yield* make$
|
|
84267
|
+
const startedRef = yield* make$49(false);
|
|
84268
|
+
const startedDeferred = yield* make$38();
|
|
84269
|
+
const watcherScope = yield* make$36("sequential");
|
|
84270
84270
|
yield* addFinalizer$2(() => close(watcherScope, void_$3));
|
|
84271
84271
|
const emitChange = (settings) => publish(changesPubSub, settings).pipe(asVoid);
|
|
84272
84272
|
const readConfigExists = fs.exists(settingsPath).pipe(mapError((cause) => new ServerSettingsError({
|
|
@@ -86344,7 +86344,7 @@ function toReviewThreadListing(threads, dismissalsByReviewId) {
|
|
|
86344
86344
|
viewer: threads.metadata.viewer
|
|
86345
86345
|
};
|
|
86346
86346
|
}
|
|
86347
|
-
const make$
|
|
86347
|
+
const make$21 = gen(function* () {
|
|
86348
86348
|
const github = yield* GitHubCli$1;
|
|
86349
86349
|
/**
|
|
86350
86350
|
* The pull request's own node id, which is what a mutation against the pull request itself is
|
|
@@ -87049,9 +87049,9 @@ const make$22 = gen(function* () {
|
|
|
87049
87049
|
})))
|
|
87050
87050
|
});
|
|
87051
87051
|
});
|
|
87052
|
-
effect(GitHubPullRequestCli, make$
|
|
87052
|
+
effect(GitHubPullRequestCli, make$21);
|
|
87053
87053
|
/** Builds a PR CLI for one authenticated session without touching global git or auth state. */
|
|
87054
|
-
const makeFromCommandRunner = (runner) => make$
|
|
87054
|
+
const makeFromCommandRunner = (runner) => make$21.pipe(provideService(GitHubCli$1, runner));
|
|
87055
87055
|
//#endregion
|
|
87056
87056
|
//#region src/pullRequest/GitHubPullRequestProvider.ts
|
|
87057
87057
|
const CAPABILITIES$3 = {
|
|
@@ -87171,7 +87171,7 @@ function loginAvatarUrl(login, host) {
|
|
|
87171
87171
|
}
|
|
87172
87172
|
/** True where markdown would render nothing: whitespace, or only HTML comments. */
|
|
87173
87173
|
const rendersEmpty = (body) => body.replace(/<!--[\s\S]*?-->/g, "").trim().length === 0;
|
|
87174
|
-
const make$
|
|
87174
|
+
const make$20 = gen(function* () {
|
|
87175
87175
|
const cli = yield* GitHubPullRequestCli;
|
|
87176
87176
|
const fail = (operation) => (error) => new PullRequestProviderError({
|
|
87177
87177
|
provider: "github",
|
|
@@ -87380,7 +87380,7 @@ const make$21 = gen(function* () {
|
|
|
87380
87380
|
};
|
|
87381
87381
|
});
|
|
87382
87382
|
/** Constructs the provider from a session-bound command service supplied by the caller. */
|
|
87383
|
-
const makeFromCli = (cli) => make$
|
|
87383
|
+
const makeFromCli = (cli) => make$20.pipe(provideService(GitHubPullRequestCli, cli));
|
|
87384
87384
|
//#endregion
|
|
87385
87385
|
//#region src/git/AgentAttribution.ts
|
|
87386
87386
|
/**
|
|
@@ -92993,7 +92993,7 @@ function toResolvableLinks(links) {
|
|
|
92993
92993
|
* A Forge project id is installation-local; it must never be sent to CMMD as a project id.
|
|
92994
92994
|
*/
|
|
92995
92995
|
var CmmdProjectIdentityResolver = class extends Service$1()("forge/pullRequest/CmmdProjectIdentityResolver") {};
|
|
92996
|
-
const make$
|
|
92996
|
+
const make$19 = gen(function* () {
|
|
92997
92997
|
const environment = yield* ServerEnvironment;
|
|
92998
92998
|
const repositoryIdentity = yield* RepositoryIdentityResolver;
|
|
92999
92999
|
const resolve = (forgeProjectId, cmmdJwt) => gen(function* () {
|
|
@@ -93034,7 +93034,7 @@ function resolveCanonicalKey(repositoryIdentity, forgeProjectId) {
|
|
|
93034
93034
|
return (yield* repositoryIdentity.resolve(workspaceRoot))?.canonicalKey ?? null;
|
|
93035
93035
|
}).pipe(orElseSucceed(() => null));
|
|
93036
93036
|
}
|
|
93037
|
-
const cmmdProjectIdentityResolverLive = effect(CmmdProjectIdentityResolver, make$
|
|
93037
|
+
const cmmdProjectIdentityResolverLive = effect(CmmdProjectIdentityResolver, make$19);
|
|
93038
93038
|
//#endregion
|
|
93039
93039
|
//#region src/pullRequest/PullRequestServiceFactory.ts
|
|
93040
93040
|
var PullRequestServiceFactory = class extends Service$1()("forge/pullRequest/PullRequestServiceFactory") {};
|
|
@@ -93512,12 +93512,12 @@ const KeybindingsLive = effect(Keybindings, gen(function* () {
|
|
|
93512
93512
|
const { keybindingsConfigPath } = yield* ServerConfig;
|
|
93513
93513
|
const fs = yield* FileSystem;
|
|
93514
93514
|
const path = yield* Path$2;
|
|
93515
|
-
const upsertSemaphore = yield* make$
|
|
93515
|
+
const upsertSemaphore = yield* make$43(1);
|
|
93516
93516
|
const resolvedConfigCacheKey = "resolved";
|
|
93517
93517
|
const changesPubSub = yield* unbounded$1();
|
|
93518
|
-
const startedRef = yield* make$
|
|
93519
|
-
const startedDeferred = yield* make$
|
|
93520
|
-
const watcherScope = yield* make$
|
|
93518
|
+
const startedRef = yield* make$49(false);
|
|
93519
|
+
const startedDeferred = yield* make$38();
|
|
93520
|
+
const watcherScope = yield* make$36("sequential");
|
|
93521
93521
|
yield* addFinalizer$2(() => close(watcherScope, void_$3));
|
|
93522
93522
|
const emitChange = (configState) => publish(changesPubSub, configState).pipe(asVoid);
|
|
93523
93523
|
const readConfigExists = fs.exists(keybindingsConfigPath).pipe(mapError((cause) => new KeybindingsConfigError({
|
|
@@ -94841,7 +94841,7 @@ var ProviderRegistry = class extends Service$1()("forge/provider/Services/Provid
|
|
|
94841
94841
|
var ServerLifecycleEvents = class extends Service$1()("forge/serverLifecycleEvents") {};
|
|
94842
94842
|
const ServerLifecycleEventsLive = effect(ServerLifecycleEvents, gen(function* () {
|
|
94843
94843
|
const pubsub = yield* unbounded$1();
|
|
94844
|
-
const state = yield* make$
|
|
94844
|
+
const state = yield* make$49({
|
|
94845
94845
|
sequence: 0,
|
|
94846
94846
|
events: []
|
|
94847
94847
|
});
|
|
@@ -96626,7 +96626,7 @@ function normalizeCount(count) {
|
|
|
96626
96626
|
return Number.isFinite(count) ? Math.max(0, Math.floor(count)) : 0;
|
|
96627
96627
|
}
|
|
96628
96628
|
const makeRuntimeDrainState = gen(function* () {
|
|
96629
|
-
const stateRef = yield* make$
|
|
96629
|
+
const stateRef = yield* make$49(initialState);
|
|
96630
96630
|
const update = (f) => updateAndGet(stateRef, f).pipe(map$3(snapshotFromState));
|
|
96631
96631
|
return {
|
|
96632
96632
|
beginTurn: (input) => update((state) => {
|
|
@@ -98014,6 +98014,119 @@ function providerAuthFailureMessage(message, provider, env = process.env) {
|
|
|
98014
98014
|
}).message;
|
|
98015
98015
|
}
|
|
98016
98016
|
//#endregion
|
|
98017
|
+
//#region ../../packages/shared/src/publicProviderCopy.ts
|
|
98018
|
+
const PUBLIC_PROVIDER_LEAK_PATTERNS = [
|
|
98019
|
+
/\bDeepSeek\b/i,
|
|
98020
|
+
/\bKimi\b/i,
|
|
98021
|
+
/\bMoonshot\b/i,
|
|
98022
|
+
/\bdeepseek[-._a-z0-9]*\b/i,
|
|
98023
|
+
/\bkimi[-._a-z0-9]*\b/i,
|
|
98024
|
+
/\bmoonshot[-._a-z0-9]*\b/i,
|
|
98025
|
+
/\bAPEX_API_KEY\b/,
|
|
98026
|
+
/\bDEEPSEEK_API_KEY\b/,
|
|
98027
|
+
/\bKIMI_API_KEY\b/,
|
|
98028
|
+
/\bOPENAI_API_KEY\b/,
|
|
98029
|
+
/\bANTHROPIC_API_KEY\b/,
|
|
98030
|
+
/\bCURSOR_API_KEY\b/,
|
|
98031
|
+
/\bOPENCODE_API_KEY\b/,
|
|
98032
|
+
/\bforge_proxy_[A-Za-z0-9._-]+\b/,
|
|
98033
|
+
/\bProviderValidationError\b/,
|
|
98034
|
+
/\/forge-server\/node_modules\//,
|
|
98035
|
+
/https?:\/\/[^\s'"<>)]*\/api\/provider-egress\/[^\s'"<>)]*/i,
|
|
98036
|
+
/https?:\/\/[^\s'"<>)]*(?:apex|deepseek|moonshot|kimi)[^\s'"<>)]*/i
|
|
98037
|
+
];
|
|
98038
|
+
const DEFAULT_PUBLIC_PROVIDER_ERROR = "CMMD is temporarily unavailable. Check the workspace AI connection and retry.";
|
|
98039
|
+
function isProviderRateOrQuotaError(message) {
|
|
98040
|
+
if (!message) return false;
|
|
98041
|
+
const normalized = message.toLowerCase();
|
|
98042
|
+
return /\b(rate[\s-]?limit|too\s+many\s+requests|usage[ _-]limit|usage_limit_reached|quota|insufficient_quota)\b/.test(normalized) || /\b429\b/.test(normalized);
|
|
98043
|
+
}
|
|
98044
|
+
function providerLifecycleOrAccountCopy(message) {
|
|
98045
|
+
if (/\bbound to provider account\b/.test(message) && /\bcannot use provider account\b/.test(message)) return "Forge could not switch this conversation to the selected AI account. Retry the account switch.";
|
|
98046
|
+
if (/\bforge_runtime_repairing\b/.test(message) || /\bthis turn was interrupted because the environment is being repaired\b/.test(message)) return "This turn was interrupted because the environment is being repaired. Retry after the repair finishes.";
|
|
98047
|
+
if (/\bforge_runtime_stopped\b/.test(message) || /\bthis turn was interrupted because the environment was stopped\b/.test(message)) return "This turn was interrupted because the environment was stopped. Start the environment and retry.";
|
|
98048
|
+
return null;
|
|
98049
|
+
}
|
|
98050
|
+
/**
|
|
98051
|
+
* Infer a SAFE, clearer failure category from a (possibly leaky) provider error.
|
|
98052
|
+
*
|
|
98053
|
+
* Returns a canned, user-facing message — it never echoes the raw input, so it
|
|
98054
|
+
* is safe to use even when the source message contains provider internals.
|
|
98055
|
+
* Used to give actionable feedback ("model isn't available", "rate-limited",
|
|
98056
|
+
* "auth failed") instead of the blanket "CMMD is temporarily unavailable."
|
|
98057
|
+
* Returns null when no category can be confidently inferred.
|
|
98058
|
+
*/
|
|
98059
|
+
function categorizePublicProviderError(message) {
|
|
98060
|
+
if (!message) return null;
|
|
98061
|
+
const m = message.toLowerCase();
|
|
98062
|
+
const lifecycleOrAccountCopy = providerLifecycleOrAccountCopy(m);
|
|
98063
|
+
if (lifecycleOrAccountCopy !== null) return lifecycleOrAccountCopy;
|
|
98064
|
+
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.";
|
|
98065
|
+
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.";
|
|
98066
|
+
if (isProviderRateOrQuotaError(m)) return "The AI service is rate-limited or out of quota. Wait a moment and retry.";
|
|
98067
|
+
if (/_credential_reconnect_required\b/.test(m)) return "The workspace AI credential needs to be reconnected. Reconnect it in Settings > Providers, then retry.";
|
|
98068
|
+
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.";
|
|
98069
|
+
if (/\b(timed?\s*out|timeout|overloaded|service\s+unavailable)\b/.test(m) || /\b50[234]\b/.test(m)) return "The AI service is temporarily overloaded. Retry in a moment.";
|
|
98070
|
+
return null;
|
|
98071
|
+
}
|
|
98072
|
+
function containsPublicProviderLeak(message) {
|
|
98073
|
+
if (!message) return false;
|
|
98074
|
+
return PUBLIC_PROVIDER_LEAK_PATTERNS.some((pattern) => pattern.test(message));
|
|
98075
|
+
}
|
|
98076
|
+
function sanitizePublicProviderText(message, options = {}) {
|
|
98077
|
+
if (message === void 0 || message === null) return null;
|
|
98078
|
+
const trimmed = message.trim();
|
|
98079
|
+
if (trimmed.length === 0) return null;
|
|
98080
|
+
if (!containsPublicProviderLeak(trimmed)) return trimmed;
|
|
98081
|
+
return categorizePublicProviderError(trimmed) ?? options.fallback ?? "CMMD is temporarily unavailable. Check the workspace AI connection and retry.";
|
|
98082
|
+
}
|
|
98083
|
+
//#endregion
|
|
98084
|
+
//#region src/orchestration/providerRetryableFailure.ts
|
|
98085
|
+
/**
|
|
98086
|
+
* Classifies a provider turn-start failure as a retryable rate-limit or
|
|
98087
|
+
* transient-availability failure (429/503), a terminal failure that names why
|
|
98088
|
+
* it will never clear on its own, or unrecognized (null).
|
|
98089
|
+
*
|
|
98090
|
+
* CMMD-Center/forge#3558: a 429 from CMMD's provider egress used to leave no
|
|
98091
|
+
* trace at all, because nothing in the turn-start path recognized it as a
|
|
98092
|
+
* distinct, retryable failure. `ProviderCommandReactor` uses this to decide
|
|
98093
|
+
* whether to retry a turn start with backoff, and to name the provider,
|
|
98094
|
+
* status and Retry-After in the `provider.turn.start.failed` activity CMMD's
|
|
98095
|
+
* watchdog reads once retries are exhausted.
|
|
98096
|
+
*
|
|
98097
|
+
* Reuses `isProviderRateOrQuotaError` (the same predicate the public-copy
|
|
98098
|
+
* sanitizer uses to recognize a rate-limit message) rather than restating its
|
|
98099
|
+
* word list here.
|
|
98100
|
+
*/
|
|
98101
|
+
const SERVICE_UNAVAILABLE_PATTERN = /\b(503|service\s+unavailable)\b/i;
|
|
98102
|
+
const RATE_LIMITED_PAST_TENSE_PATTERN = /\brate[\s-]?limit(?:ed|ing)?\b/i;
|
|
98103
|
+
const QUOTA_OR_USAGE_LIMIT_PATTERN = /\b(usage[ _-]limit|usage_limit_reached|quota|insufficient_quota)\b/i;
|
|
98104
|
+
const EXPLICIT_429_PATTERN = /\b429\b/;
|
|
98105
|
+
const RETRY_AFTER_SECONDS_PATTERN = /retry-after[^0-9]{0,10}(\d+)|(?:try again|retry)\s+in\s+(\d+)\s*(?:s\b|sec(?:onds?)?\b)?/i;
|
|
98106
|
+
function parseRetryAfterSeconds(detail) {
|
|
98107
|
+
const match = detail.match(RETRY_AFTER_SECONDS_PATTERN);
|
|
98108
|
+
if (!match) return null;
|
|
98109
|
+
const raw = match[1] ?? match[2];
|
|
98110
|
+
const seconds = raw ? Number(raw) : NaN;
|
|
98111
|
+
return Number.isFinite(seconds) ? seconds : null;
|
|
98112
|
+
}
|
|
98113
|
+
function classifyRetryableProviderFailure(detail) {
|
|
98114
|
+
if (!detail || detail.trim().length === 0) return null;
|
|
98115
|
+
if (QUOTA_OR_USAGE_LIMIT_PATTERN.test(detail) && !EXPLICIT_429_PATTERN.test(detail)) return {
|
|
98116
|
+
kind: "terminal",
|
|
98117
|
+
reason: "quota",
|
|
98118
|
+
message: detail
|
|
98119
|
+
};
|
|
98120
|
+
const isRateLimited = isProviderRateOrQuotaError(detail) || RATE_LIMITED_PAST_TENSE_PATTERN.test(detail);
|
|
98121
|
+
const isUnavailable = SERVICE_UNAVAILABLE_PATTERN.test(detail);
|
|
98122
|
+
if (!isRateLimited && !isUnavailable) return null;
|
|
98123
|
+
return {
|
|
98124
|
+
kind: "retryable",
|
|
98125
|
+
status: isRateLimited ? 429 : 503,
|
|
98126
|
+
retryAfterSeconds: parseRetryAfterSeconds(detail)
|
|
98127
|
+
};
|
|
98128
|
+
}
|
|
98129
|
+
//#endregion
|
|
98017
98130
|
//#region src/orchestration/turnFailureReason.ts
|
|
98018
98131
|
/**
|
|
98019
98132
|
* Machine-readable reasons for a turn that failed before it produced any
|
|
@@ -98047,6 +98160,31 @@ function classifyProviderTurnStartFailureReason(detail) {
|
|
|
98047
98160
|
message
|
|
98048
98161
|
};
|
|
98049
98162
|
}
|
|
98163
|
+
/**
|
|
98164
|
+
* Classifies a turn that ended mid-flight, after it had already started
|
|
98165
|
+
* (CMMD-Center/forge#3562 piece A): a `runtime.error` that reached CMMD as
|
|
98166
|
+
* `error_summary`, now also read into a `turn_status: failed` reason.
|
|
98167
|
+
*
|
|
98168
|
+
* `provider_turn_failed` is the code CMMD's own error_summary heuristic
|
|
98169
|
+
* already assigns this class of failure
|
|
98170
|
+
* (`shared/forge-work-session-failure-reasons.ts`), so a Forge-sent
|
|
98171
|
+
* `turn_status` carrying it lines up with what CMMD already infers instead
|
|
98172
|
+
* of teaching it a new code for the common case. `provider_usage_limit`
|
|
98173
|
+
* reuses the same wording `classifyRetryableProviderFailure` already treats
|
|
98174
|
+
* as a wall that will not clear by retrying (CMMD-Center/forge#3558): a
|
|
98175
|
+
* usage-limit message inside a turn that already ended is worth naming
|
|
98176
|
+
* specifically, even without the fuller upstream port (see the piece A PR's
|
|
98177
|
+
* follow-up issue) that would stop Codex from retrying against that wall in
|
|
98178
|
+
* the first place.
|
|
98179
|
+
*/
|
|
98180
|
+
function classifyMidTurnFailureReason(detail) {
|
|
98181
|
+
const message = detail && detail.trim().length > 0 ? detail : "The runtime reported an error while this run was in progress.";
|
|
98182
|
+
const classified = classifyRetryableProviderFailure(detail);
|
|
98183
|
+
return {
|
|
98184
|
+
code: classified?.kind === "terminal" && classified.reason === "quota" ? "provider_usage_limit" : "provider_turn_failed",
|
|
98185
|
+
message
|
|
98186
|
+
};
|
|
98187
|
+
}
|
|
98050
98188
|
function checkpointTimeoutReason(detail) {
|
|
98051
98189
|
return {
|
|
98052
98190
|
code: "checkpoint_timeout",
|
|
@@ -98181,6 +98319,108 @@ function serializeReplicaMessage(message) {
|
|
|
98181
98319
|
};
|
|
98182
98320
|
}
|
|
98183
98321
|
//#endregion
|
|
98322
|
+
//#region src/orchestration/turnTerminalStatus.ts
|
|
98323
|
+
/**
|
|
98324
|
+
* Shared vocabulary between the reactor that records how a turn ended
|
|
98325
|
+
* (`Layers/CheckpointReactor.ts`, on the provider's own `turn.completed`
|
|
98326
|
+
* event) and the serializer that turns that record into CMMD's `turn_status`
|
|
98327
|
+
* terminal event (`runtimeReplication/turnTerminalStatusSerializer.ts`).
|
|
98328
|
+
* CMMD-Center/forge#3562 piece A, CMMD-Center/CMMD#5822.
|
|
98329
|
+
*/
|
|
98330
|
+
/** The activity kind this durable record uses. Never sent to CMMD as-is: the
|
|
98331
|
+
* serializer reads it and emits the wire `turn_status` event instead. */
|
|
98332
|
+
const TURN_TERMINAL_STATUS_ACTIVITY_KIND = "turn.terminal-status";
|
|
98333
|
+
/**
|
|
98334
|
+
* CMMD's three-way outcome from the provider's own four-way `turn.completed`
|
|
98335
|
+
* state. `cancelled` and `interrupted` both read as `interrupted`: neither
|
|
98336
|
+
* the provider wording nor CMMD's Work Session UI distinguishes an
|
|
98337
|
+
* operator-cancelled turn from one the provider gave up on mid-flight.
|
|
98338
|
+
*/
|
|
98339
|
+
function turnTerminalOutcomeFromRuntimeState(state) {
|
|
98340
|
+
if (state === "failed") return "failed";
|
|
98341
|
+
if (state === "completed") return "completed";
|
|
98342
|
+
return "interrupted";
|
|
98343
|
+
}
|
|
98344
|
+
/**
|
|
98345
|
+
* Deterministic activity id for a turn's terminal record: never
|
|
98346
|
+
* `crypto.randomUUID()`. The projector replaces an activity by id
|
|
98347
|
+
* (`thread.activity-appended`), so a redelivered `turn.completed` for the
|
|
98348
|
+
* same turn lands on the same row instead of adding a second one, and the
|
|
98349
|
+
* serializer's own `eventId` (`activity:<id>`) inherits the same guarantee.
|
|
98350
|
+
*/
|
|
98351
|
+
function turnTerminalStatusActivityId(turnId) {
|
|
98352
|
+
return `turn-terminal:${turnId}`;
|
|
98353
|
+
}
|
|
98354
|
+
//#endregion
|
|
98355
|
+
//#region src/runtimeReplication/eventFormatting.ts
|
|
98356
|
+
/**
|
|
98357
|
+
* Small formatting helpers shared by every source `serializer.ts` folds into
|
|
98358
|
+
* a thread's replicated event list. Kept in their own module, with no
|
|
98359
|
+
* dependency on `serializer.ts` itself, so a narrower serializer (such as
|
|
98360
|
+
* `turnTerminalStatusSerializer.ts`) can reuse them without creating an
|
|
98361
|
+
* import cycle back into the file that assembles the full event list.
|
|
98362
|
+
*/
|
|
98363
|
+
function text(value, max) {
|
|
98364
|
+
const normalized = value.trim();
|
|
98365
|
+
return normalized ? normalized.slice(0, max) : null;
|
|
98366
|
+
}
|
|
98367
|
+
function canonicalRuntimeEventTimestamp(value) {
|
|
98368
|
+
let timestamp = new Date(value);
|
|
98369
|
+
if (Number.isNaN(timestamp.getTime())) {
|
|
98370
|
+
const legacyBsdNanoseconds = value.match(/^(.*:\d{2})\.\d+NZ$/);
|
|
98371
|
+
timestamp = new Date(legacyBsdNanoseconds ? `${legacyBsdNanoseconds[1]}Z` : value);
|
|
98372
|
+
}
|
|
98373
|
+
if (Number.isNaN(timestamp.getTime())) throw new Error(`Invalid runtime event timestamp: ${value}`);
|
|
98374
|
+
return timestamp.toISOString();
|
|
98375
|
+
}
|
|
98376
|
+
//#endregion
|
|
98377
|
+
//#region src/runtimeReplication/turnTerminalStatusSerializer.ts
|
|
98378
|
+
function outcomeOf(payload) {
|
|
98379
|
+
if (!payload || typeof payload !== "object") return null;
|
|
98380
|
+
const outcome = payload.outcome;
|
|
98381
|
+
return outcome === "completed" || outcome === "interrupted" || outcome === "failed" ? outcome : null;
|
|
98382
|
+
}
|
|
98383
|
+
function errorMessageOf(payload) {
|
|
98384
|
+
if (!payload || typeof payload !== "object") return null;
|
|
98385
|
+
const message = payload.errorMessage;
|
|
98386
|
+
return typeof message === "string" && message.trim().length > 0 ? message : null;
|
|
98387
|
+
}
|
|
98388
|
+
/**
|
|
98389
|
+
* Turns the one durable activity `Layers/CheckpointReactor.ts` records when a
|
|
98390
|
+
* turn ends into CMMD's `turn_status` terminal event (CMMD-Center/forge#3562
|
|
98391
|
+
* piece A, CMMD-Center/CMMD#5822): `completed`, `interrupted`, or `failed`
|
|
98392
|
+
* with a structured `reason`. `error_summary` (`serializeFailureActivity` in
|
|
98393
|
+
* `serializer.ts`) keeps replicating separately for a mid-turn failure; this
|
|
98394
|
+
* is added next to it, never instead of it.
|
|
98395
|
+
*
|
|
98396
|
+
* The activity's own id is deterministic (`turn-terminal:<turnId>`,
|
|
98397
|
+
* `turnTerminalStatusActivityId`), so this event's `eventId` -- built from
|
|
98398
|
+
* that id the same way every other activity-sourced event on this thread is
|
|
98399
|
+
* (`activity:<id>`) -- can never collide with a second, different terminal
|
|
98400
|
+
* status for the same turn: there is exactly one activity row to read it
|
|
98401
|
+
* from, and the reactor that writes that row never overwrites it once set.
|
|
98402
|
+
*/
|
|
98403
|
+
function serializeTurnTerminalStatusActivity(activity) {
|
|
98404
|
+
if (activity.kind !== "turn.terminal-status" || !activity.turnId) return null;
|
|
98405
|
+
const outcome = outcomeOf(activity.payload);
|
|
98406
|
+
if (outcome === null) return null;
|
|
98407
|
+
const reason = outcome === "failed" ? classifyMidTurnFailureReason(errorMessageOf(activity.payload)) : null;
|
|
98408
|
+
return {
|
|
98409
|
+
sourceSequence: null,
|
|
98410
|
+
event: {
|
|
98411
|
+
eventId: `activity:${activity.id}`,
|
|
98412
|
+
occurredAt: canonicalRuntimeEventTimestamp(activity.createdAt),
|
|
98413
|
+
turnId: activity.turnId,
|
|
98414
|
+
kind: "turn_status",
|
|
98415
|
+
status: outcome,
|
|
98416
|
+
...reason ? { reason: {
|
|
98417
|
+
code: reason.code,
|
|
98418
|
+
message: text(reason.message, 2e3) ?? reason.message
|
|
98419
|
+
} } : {}
|
|
98420
|
+
}
|
|
98421
|
+
};
|
|
98422
|
+
}
|
|
98423
|
+
//#endregion
|
|
98184
98424
|
//#region src/runtimeReplication/serializer.ts
|
|
98185
98425
|
function threadStatus(thread) {
|
|
98186
98426
|
if (thread.archivedAt) return "archived";
|
|
@@ -98247,19 +98487,6 @@ function serializeRuntimeInventory(snapshot, providerInventory) {
|
|
|
98247
98487
|
...providerInventory === void 0 ? {} : { providers: serializeProviderCatalog(providerInventory) }
|
|
98248
98488
|
};
|
|
98249
98489
|
}
|
|
98250
|
-
function text(value, max) {
|
|
98251
|
-
const normalized = value.trim();
|
|
98252
|
-
return normalized ? normalized.slice(0, max) : null;
|
|
98253
|
-
}
|
|
98254
|
-
function canonicalRuntimeEventTimestamp(value) {
|
|
98255
|
-
let timestamp = new Date(value);
|
|
98256
|
-
if (Number.isNaN(timestamp.getTime())) {
|
|
98257
|
-
const legacyBsdNanoseconds = value.match(/^(.*:\d{2})\.\d+NZ$/);
|
|
98258
|
-
timestamp = new Date(legacyBsdNanoseconds ? `${legacyBsdNanoseconds[1]}Z` : value);
|
|
98259
|
-
}
|
|
98260
|
-
if (Number.isNaN(timestamp.getTime())) throw new Error(`Invalid runtime event timestamp: ${value}`);
|
|
98261
|
-
return timestamp.toISOString();
|
|
98262
|
-
}
|
|
98263
98490
|
/** Spread onto an event: present only when the projection knows the turn. */
|
|
98264
98491
|
function eventTurn(turnId) {
|
|
98265
98492
|
return turnId ? { turnId } : {};
|
|
@@ -98564,10 +98791,13 @@ function foldReportedUsage(reported) {
|
|
|
98564
98791
|
* model, so a mid-thread switch used to republish a finished turn as a second
|
|
98565
98792
|
* row for spend that happened once (FOR-36388, fixed in FOR-36438).
|
|
98566
98793
|
*/
|
|
98567
|
-
/** Turns named on this thread's own rows; hydrated replica rows carry no local
|
|
98794
|
+
/** Turns named on this thread's own rows; hydrated replica rows carry no local
|
|
98795
|
+
* turn, and the terminal-status activity (CMMD-Center/forge#3562 piece A) is
|
|
98796
|
+
* a wire-protocol source in its own right, not a Usage signal, so it is
|
|
98797
|
+
* excluded the same way a `replica.*` activity is. */
|
|
98568
98798
|
function localTurnIds(thread) {
|
|
98569
98799
|
const fromMessages = thread.messages.filter((message) => !message.streaming).map((message) => message.turnId);
|
|
98570
|
-
const fromActivities = thread.activities.filter((activity) => !activity.kind.startsWith("replica.")).map((activity) => activity.turnId);
|
|
98800
|
+
const fromActivities = thread.activities.filter((activity) => !activity.kind.startsWith("replica.") && activity.kind !== "turn.terminal-status").map((activity) => activity.turnId);
|
|
98571
98801
|
const turnIds = /* @__PURE__ */ new Set();
|
|
98572
98802
|
for (const turnId of [...fromMessages, ...fromActivities]) if (turnId) turnIds.add(turnId);
|
|
98573
98803
|
return turnIds;
|
|
@@ -98577,8 +98807,12 @@ function settledTurnIds(thread) {
|
|
|
98577
98807
|
if (thread.latestTurn?.state === "running") turnIds.delete(thread.latestTurn.turnId);
|
|
98578
98808
|
return turnIds;
|
|
98579
98809
|
}
|
|
98810
|
+
/** A turn's own activities for Usage derivation, excluding the terminal-status
|
|
98811
|
+
* activity: that record's own `createdAt` (the turn's very end) must never
|
|
98812
|
+
* shift `turnLatestAt`, or an already-acknowledged usage row would rehash
|
|
98813
|
+
* the moment a turn that used to have no terminal activity gains one. */
|
|
98580
98814
|
function turnActivities(thread, turnId) {
|
|
98581
|
-
return thread.activities.filter((activity) => activity.turnId === turnId).toSorted((left, right) => left.createdAt.localeCompare(right.createdAt) || left.id.localeCompare(right.id));
|
|
98815
|
+
return thread.activities.filter((activity) => activity.turnId === turnId && activity.kind !== "turn.terminal-status").toSorted((left, right) => left.createdAt.localeCompare(right.createdAt) || left.id.localeCompare(right.id));
|
|
98582
98816
|
}
|
|
98583
98817
|
/** The last thing that happened in the turn: what the Recorded turn is stamped with. */
|
|
98584
98818
|
function turnLatestAt(thread, turnId, activities) {
|
|
@@ -98787,6 +99021,10 @@ function serializeRuntimeThreadEvents(thread) {
|
|
|
98787
99021
|
const event = serializePlanActivity(activity);
|
|
98788
99022
|
return event === null ? [] : [event];
|
|
98789
99023
|
});
|
|
99024
|
+
const turnTerminalStatuses = thread.activities.flatMap((activity) => {
|
|
99025
|
+
const event = serializeTurnTerminalStatusActivity(activity);
|
|
99026
|
+
return event === null ? [] : [event];
|
|
99027
|
+
});
|
|
98790
99028
|
const recordedTurns = serializeRecordedTurns(thread);
|
|
98791
99029
|
const textGenerations = serializeTextGenerations(thread);
|
|
98792
99030
|
const priorEvents = [
|
|
@@ -98796,6 +99034,7 @@ function serializeRuntimeThreadEvents(thread) {
|
|
|
98796
99034
|
...worktreeLaunchActivities,
|
|
98797
99035
|
...planActivities,
|
|
98798
99036
|
...failureActivities,
|
|
99037
|
+
...turnTerminalStatuses,
|
|
98799
99038
|
...recordedTurns,
|
|
98800
99039
|
...textGenerations
|
|
98801
99040
|
];
|
|
@@ -99247,7 +99486,7 @@ function askTheLedger(request) {
|
|
|
99247
99486
|
return logWarning$1("usage session lookup failed; local lanes keep their records").pipe(annotateLogs({ cause: outcome.error }), as$3(UNAVAILABLE.callFailed));
|
|
99248
99487
|
}));
|
|
99249
99488
|
}
|
|
99250
|
-
const make$
|
|
99489
|
+
const make$15 = (fetchImpl, resolveOwnerCredential) => gen(function* () {
|
|
99251
99490
|
const config = yield* ServerConfig;
|
|
99252
99491
|
const sql = yield* SqlClient;
|
|
99253
99492
|
/** The cloud lane: this runtime's own scoped grant. */
|
|
@@ -99286,7 +99525,7 @@ const make$16 = (fetchImpl, resolveOwnerCredential) => gen(function* () {
|
|
|
99286
99525
|
* without a signed-in machine behind it. Both default to the real thing.
|
|
99287
99526
|
*/
|
|
99288
99527
|
function makeUsageSessionLookupLayer(fetchImpl = fetch, resolveOwnerCredential = resolveOwnerCredentialLive) {
|
|
99289
|
-
return effect(UsageSessionLookup, make$
|
|
99528
|
+
return effect(UsageSessionLookup, make$15(fetchImpl, resolveOwnerCredential));
|
|
99290
99529
|
}
|
|
99291
99530
|
const UsageSessionLookupLive = makeUsageSessionLookupLayer();
|
|
99292
99531
|
//#endregion
|
|
@@ -99901,8 +100140,8 @@ function parseJson(raw) {
|
|
|
99901
100140
|
}
|
|
99902
100141
|
}
|
|
99903
100142
|
function resolveHourlyWindow(input) {
|
|
99904
|
-
const sinceTime = input.sinceTime === void 0 ? none$4() : make$
|
|
99905
|
-
const untilTime = input.untilTime === void 0 ? none$4() : make$
|
|
100143
|
+
const sinceTime = input.sinceTime === void 0 ? none$4() : make$37(input.sinceTime);
|
|
100144
|
+
const untilTime = input.untilTime === void 0 ? none$4() : make$37(input.untilTime);
|
|
99906
100145
|
if (isNone(sinceTime) || isNone(untilTime)) return "Hourly usage requires valid sinceTime and untilTime instants";
|
|
99907
100146
|
const sinceTimeMs = toEpochMillis(sinceTime.value);
|
|
99908
100147
|
const untilTimeMs = toEpochMillis(untilTime.value);
|
|
@@ -99938,7 +100177,7 @@ function resolveWindow(input) {
|
|
|
99938
100177
|
};
|
|
99939
100178
|
hourly = resolved;
|
|
99940
100179
|
}
|
|
99941
|
-
const windowStart = make$
|
|
100180
|
+
const windowStart = make$37(`${input.sinceDay}T00:00:00Z`);
|
|
99942
100181
|
if (isNone(windowStart)) return {
|
|
99943
100182
|
kind: "invalid",
|
|
99944
100183
|
detail: `sinceDay '${input.sinceDay}' is not a valid date`
|
|
@@ -100096,7 +100335,7 @@ function failedRecordedSources(hostId, detail) {
|
|
|
100096
100335
|
message: detail
|
|
100097
100336
|
}));
|
|
100098
100337
|
}
|
|
100099
|
-
const make$
|
|
100338
|
+
const make$14 = (hooks) => gen(function* () {
|
|
100100
100339
|
const fileSystem = yield* FileSystem;
|
|
100101
100340
|
const path = yield* Path$2;
|
|
100102
100341
|
const config = yield* ServerConfig;
|
|
@@ -100109,9 +100348,9 @@ const make$15 = (hooks) => gen(function* () {
|
|
|
100109
100348
|
const lookupCache = /* @__PURE__ */ new Map();
|
|
100110
100349
|
let lookupCacheDirty = false;
|
|
100111
100350
|
const selfRuntimeId = resolveRuntimeReplicationRuntimeId(config);
|
|
100112
|
-
const scanScope = yield* make$
|
|
100351
|
+
const scanScope = yield* make$36("sequential");
|
|
100113
100352
|
yield* addFinalizer$2(() => close(scanScope, void_$3));
|
|
100114
|
-
const scanSemaphore = yield* make$
|
|
100353
|
+
const scanSemaphore = yield* make$43(1);
|
|
100115
100354
|
const inFlight = /* @__PURE__ */ new Map();
|
|
100116
100355
|
const ratesCachePath = path.join(config.stateDir, RATES_CACHE_FILE);
|
|
100117
100356
|
const scanCachePath = path.join(config.stateDir, SCAN_CACHE_FILE);
|
|
@@ -100515,7 +100754,7 @@ const make$15 = (hooks) => gen(function* () {
|
|
|
100515
100754
|
const key = summaryKey(input);
|
|
100516
100755
|
const joined = inFlight.get(key);
|
|
100517
100756
|
if (joined !== void 0) return yield* _await(joined);
|
|
100518
|
-
const deferred = yield* make$
|
|
100757
|
+
const deferred = yield* make$38();
|
|
100519
100758
|
inFlight.set(key, deferred);
|
|
100520
100759
|
yield* scanSemaphore.withPermits(1)(computeSummary(input, window)).pipe(exit, flatMap((exit) => done(deferred, exit)), ensuring(sync$1(() => {
|
|
100521
100760
|
inFlight.delete(key);
|
|
@@ -100525,7 +100764,7 @@ const make$15 = (hooks) => gen(function* () {
|
|
|
100525
100764
|
});
|
|
100526
100765
|
/** The service with a seam into the scan; tests pass their own hooks. */
|
|
100527
100766
|
function makeUsageServiceLayer(hooks = NOOP_SCAN_HOOKS) {
|
|
100528
|
-
return effect(UsageService, make$
|
|
100767
|
+
return effect(UsageService, make$14(hooks));
|
|
100529
100768
|
}
|
|
100530
100769
|
const UsageServiceLive = makeUsageServiceLayer();
|
|
100531
100770
|
const DAY_MS = 1440 * 60 * 1e3;
|
|
@@ -100571,7 +100810,7 @@ const runUsageScanWarmup = (options) => gen(function* () {
|
|
|
100571
100810
|
const now = options.now ?? currentTimeMillis;
|
|
100572
100811
|
const startDelayMs = options.startDelayMs ?? 2e4;
|
|
100573
100812
|
const intervalMs = options.intervalMs ?? 36e5;
|
|
100574
|
-
const scanning = yield* make$
|
|
100813
|
+
const scanning = yield* make$49(false);
|
|
100575
100814
|
yield* sleep(startDelayMs);
|
|
100576
100815
|
return yield* forever$1(gen(function* () {
|
|
100577
100816
|
if (yield* get$6(scanning)) yield* logInfo("usage scan warm-up skipped; the previous scan is still running");
|
|
@@ -100588,9 +100827,9 @@ var ServerRuntimeStartupError = class extends TaggedError("ServerRuntimeStartupE
|
|
|
100588
100827
|
var ServerRuntimeStartup = class extends Service$1()("forge/serverRuntimeStartup") {};
|
|
100589
100828
|
const settleQueuedCommand = (deferred, exit) => isSuccess(exit) ? succeed$3(deferred, exit.value) : failCause$3(deferred, exit.cause);
|
|
100590
100829
|
const makeCommandGate = gen(function* () {
|
|
100591
|
-
const commandReady = yield* make$
|
|
100830
|
+
const commandReady = yield* make$38();
|
|
100592
100831
|
const commandQueue = yield* unbounded$2();
|
|
100593
|
-
const commandReadinessState = yield* make$
|
|
100832
|
+
const commandReadinessState = yield* make$49("pending");
|
|
100594
100833
|
yield* forkScoped(forever$1(take$1(commandQueue).pipe(flatMap((command) => command.run))));
|
|
100595
100834
|
return {
|
|
100596
100835
|
awaitCommandReady: _await(commandReady),
|
|
@@ -100606,7 +100845,7 @@ const makeCommandGate = gen(function* () {
|
|
|
100606
100845
|
const readinessState = yield* get$6(commandReadinessState);
|
|
100607
100846
|
if (readinessState === "ready") return yield* effect;
|
|
100608
100847
|
if (readinessState !== "pending") return yield* readinessState;
|
|
100609
|
-
const result = yield* make$
|
|
100848
|
+
const result = yield* make$38();
|
|
100610
100849
|
yield* offer$1(commandQueue, { run: _await(commandReady).pipe(flatMap(() => effect), exit, flatMap((exit) => settleQueuedCommand(result, exit))) });
|
|
100611
100850
|
return yield* _await(result);
|
|
100612
100851
|
})
|
|
@@ -100818,8 +101057,8 @@ const ServerRuntimeStartupLive = effect(ServerRuntimeStartup, gen(function* () {
|
|
|
100818
101057
|
const usage = yield* UsageService;
|
|
100819
101058
|
const drainState = yield* RuntimeDrainState;
|
|
100820
101059
|
const commandGate = yield* makeCommandGate;
|
|
100821
|
-
const httpListening = yield* make$
|
|
100822
|
-
const reactorScope = yield* make$
|
|
101060
|
+
const httpListening = yield* make$38();
|
|
101061
|
+
const reactorScope = yield* make$36("sequential");
|
|
100823
101062
|
yield* addFinalizer$2(() => close(reactorScope, void_$3));
|
|
100824
101063
|
const startup = gen(function* () {
|
|
100825
101064
|
yield* logDebug("startup phase: starting keybindings runtime");
|
|
@@ -101590,8 +101829,8 @@ function previewUrlForPort(port) {
|
|
|
101590
101829
|
return `http://127.0.0.1:${port}/`;
|
|
101591
101830
|
}
|
|
101592
101831
|
const ThreadDevRuntimeLive = effect(ThreadDevRuntime, gen(function* () {
|
|
101593
|
-
const byThreadId = yield* make$
|
|
101594
|
-
const usedPorts = yield* make$
|
|
101832
|
+
const byThreadId = yield* make$49(/* @__PURE__ */ new Map());
|
|
101833
|
+
const usedPorts = yield* make$49(/* @__PURE__ */ new Set());
|
|
101595
101834
|
const allocateNextPort = gen(function* () {
|
|
101596
101835
|
const used = yield* get$6(usedPorts);
|
|
101597
101836
|
for (let port = DEFAULT_PORT_MIN; port <= DEFAULT_PORT_MAX; port += 1) if (!used.has(port)) return port;
|
|
@@ -107078,7 +107317,7 @@ function makeSnapshotThenLiveStream(input) {
|
|
|
107078
107317
|
const liveEvents = yield* input.subscribeLiveEvents;
|
|
107079
107318
|
const snapshot = yield* input.loadSnapshot;
|
|
107080
107319
|
const eventsAfterSnapshot = liveEvents.pipe(filter$2((event) => event.sequence > snapshot.snapshotSequence));
|
|
107081
|
-
return concat$2(make$
|
|
107320
|
+
return concat$2(make$42({
|
|
107082
107321
|
kind: "snapshot",
|
|
107083
107322
|
snapshot
|
|
107084
107323
|
}), eventsAfterSnapshot);
|
|
@@ -107740,7 +107979,7 @@ const makeWsRpcLayer = (currentSessionId, currentUserId) => WsRpcGroup.toLayer(g
|
|
|
107740
107979
|
discard: true
|
|
107741
107980
|
}).pipe(ignoreCause({ log: true }), forkScoped);
|
|
107742
107981
|
const liveUpdates = merge$4(keybindingsUpdates, merge$4(providerStatuses, merge$4(settingsUpdates, environmentUpdates)));
|
|
107743
|
-
return concat$2(make$
|
|
107982
|
+
return concat$2(make$42({
|
|
107744
107983
|
version: 1,
|
|
107745
107984
|
type: "snapshot",
|
|
107746
107985
|
config: yield* loadServerConfig
|
|
@@ -107754,9 +107993,9 @@ const makeWsRpcLayer = (currentSessionId, currentUserId) => WsRpcGroup.toLayer(g
|
|
|
107754
107993
|
}), { "rpc.aggregate": "server" }),
|
|
107755
107994
|
[WS_METHODS.subscribeAuthAccess]: (_input) => observeRpcStreamEffect(WS_METHODS.subscribeAuthAccess, gen(function* () {
|
|
107756
107995
|
const initialSnapshot = yield* loadAuthAccessSnapshot();
|
|
107757
|
-
const revisionRef = yield* make$
|
|
107996
|
+
const revisionRef = yield* make$49(1);
|
|
107758
107997
|
const liveEvents = merge$4(bootstrapCredentials.streamChanges, sessions.streamChanges).pipe(mapEffect$1((change) => updateAndGet(revisionRef, (revision) => revision + 1).pipe(map$3((revision) => toAuthAccessStreamEvent(change, revision, currentSessionId)))));
|
|
107759
|
-
return concat$2(make$
|
|
107998
|
+
return concat$2(make$42({
|
|
107760
107999
|
version: 1,
|
|
107761
108000
|
revision: 1,
|
|
107762
108001
|
type: "snapshot",
|
|
@@ -114999,7 +115238,7 @@ const PgClient = /* @__PURE__ */ Service$1("@effect/sql-pg/PgClient");
|
|
|
114999
115238
|
* @category constructors
|
|
115000
115239
|
* @since 1.0.0
|
|
115001
115240
|
*/
|
|
115002
|
-
const make$
|
|
115241
|
+
const make$13 = (options) => fromPool({
|
|
115003
115242
|
...options,
|
|
115004
115243
|
acquire: gen(function* () {
|
|
115005
115244
|
const pool = new Pool({
|
|
@@ -115108,7 +115347,7 @@ const fromPool = /* @__PURE__ */ fnUntraced(function* (options) {
|
|
|
115108
115347
|
});
|
|
115109
115348
|
const reserve = map$3(reserveRaw, makeConection);
|
|
115110
115349
|
const onListenClientError = (_) => {};
|
|
115111
|
-
const listenAcquirer = yield* make$
|
|
115350
|
+
const listenAcquirer = yield* make$45({ acquire: acquireRelease(tryPromise({
|
|
115112
115351
|
try: async () => {
|
|
115113
115352
|
const client = new Client(pool.options);
|
|
115114
115353
|
await client.connect();
|
|
@@ -115121,12 +115360,12 @@ const fromPool = /* @__PURE__ */ fnUntraced(function* (options) {
|
|
|
115121
115360
|
return client.end();
|
|
115122
115361
|
}).pipe(timeoutOption(1e3))) });
|
|
115123
115362
|
let config = {
|
|
115124
|
-
url: pool.options.connectionString ? make$
|
|
115363
|
+
url: pool.options.connectionString ? make$39(pool.options.connectionString) : void 0,
|
|
115125
115364
|
host: pool.options.host,
|
|
115126
115365
|
port: pool.options.port,
|
|
115127
115366
|
database: pool.options.database,
|
|
115128
115367
|
username: pool.options.user,
|
|
115129
|
-
password: typeof pool.options.password === "string" ? make$
|
|
115368
|
+
password: typeof pool.options.password === "string" ? make$39(pool.options.password) : void 0,
|
|
115130
115369
|
ssl: pool.options.ssl,
|
|
115131
115370
|
applicationName: pool.options.application_name,
|
|
115132
115371
|
types: pool.options.types
|
|
@@ -115138,7 +115377,7 @@ const fromPool = /* @__PURE__ */ fnUntraced(function* (options) {
|
|
|
115138
115377
|
host: config.host ?? parsed.host ?? void 0,
|
|
115139
115378
|
port: config.port ?? (parsed.port ? getOrUndefined(parse$6(parsed.port)) : void 0),
|
|
115140
115379
|
username: config.username ?? parsed.user ?? void 0,
|
|
115141
|
-
password: config.password ?? (parsed.password ? make$
|
|
115380
|
+
password: config.password ?? (parsed.password ? make$39(parsed.password) : void 0),
|
|
115142
115381
|
database: config.database ?? parsed.database ?? void 0
|
|
115143
115382
|
};
|
|
115144
115383
|
} catch {}
|
|
@@ -115272,12 +115511,12 @@ const makeCancel = (pool, client) => {
|
|
|
115272
115511
|
* @category layers
|
|
115273
115512
|
* @since 1.0.0
|
|
115274
115513
|
*/
|
|
115275
|
-
const layerFrom = (acquire) => effectContext(map$3(acquire, (client) => make$
|
|
115514
|
+
const layerFrom = (acquire) => effectContext(map$3(acquire, (client) => make$34(PgClient, client).pipe(add$2(SqlClient, client)))).pipe(provide$1(layer$9));
|
|
115276
115515
|
/**
|
|
115277
115516
|
* @category layers
|
|
115278
115517
|
* @since 1.0.0
|
|
115279
115518
|
*/
|
|
115280
|
-
const layer$3 = (config) => layerFrom(make$
|
|
115519
|
+
const layer$3 = (config) => layerFrom(make$13(config));
|
|
115281
115520
|
/**
|
|
115282
115521
|
* @category constructor
|
|
115283
115522
|
* @since 1.0.0
|
|
@@ -115804,7 +116043,7 @@ const CloudStateSyncLive = effectDiscard(gen(function* () {
|
|
|
115804
116043
|
//#region src/persistence/Layers/Postgres.ts
|
|
115805
116044
|
function makePostgresPersistenceLive(config, databaseUrl) {
|
|
115806
116045
|
const client = layer$3({
|
|
115807
|
-
url: make$
|
|
116046
|
+
url: make$39(databaseUrl),
|
|
115808
116047
|
applicationName: "forge-cloud-shell",
|
|
115809
116048
|
connectTimeout: "10 seconds",
|
|
115810
116049
|
idleTimeout: "30 seconds",
|
|
@@ -115830,7 +116069,7 @@ var MigrationError = class extends TaggedError("MigrationError") {};
|
|
|
115830
116069
|
* @category constructor
|
|
115831
116070
|
* @since 4.0.0
|
|
115832
116071
|
*/
|
|
115833
|
-
const make$
|
|
116072
|
+
const make$12 = ({ dumpSchema = () => void_$1 }) => ({ loader, schemaDirectory, table = "effect_sql_migrations" }) => gen(function* () {
|
|
115834
116073
|
const sql = yield* SqlClient;
|
|
115835
116074
|
const ensureMigrationsTable = sql.onDialectOrElse({
|
|
115836
116075
|
mssql: () => sql`IF OBJECT_ID(N'${sql.literal(table)}', N'U') IS NULL
|
|
@@ -115919,7 +116158,7 @@ const make$13 = ({ dumpSchema = () => void_$1 }) => ({ loader, schemaDirectory,
|
|
|
115919
116158
|
if (schemaDirectory && completed.length > 0) yield* dumpSchema(`${schemaDirectory}/_schema.sql`, table).pipe(catchCause((cause) => logInfo("Could not dump schema", cause)));
|
|
115920
116159
|
return completed;
|
|
115921
116160
|
});
|
|
115922
|
-
const migrationOrder = /* @__PURE__ */ make$
|
|
116161
|
+
const migrationOrder = /* @__PURE__ */ make$40(([a], [b]) => Number$2(a, b));
|
|
115923
116162
|
/**
|
|
115924
116163
|
* @since 4.0.0
|
|
115925
116164
|
* @category loaders
|
|
@@ -118909,7 +119148,7 @@ const makeMigrationLoader = (throughId) => fromRecord(Object.fromEntries(migrati
|
|
|
118909
119148
|
* Migrator run function - no schema dumping needed
|
|
118910
119149
|
* Uses the base Migrator.make without platform dependencies
|
|
118911
119150
|
*/
|
|
118912
|
-
const run = make$
|
|
119151
|
+
const run = make$12({});
|
|
118913
119152
|
/**
|
|
118914
119153
|
* Run all pending migrations.
|
|
118915
119154
|
*
|
|
@@ -150143,7 +150382,7 @@ const AnalyticsServiceLayerLive = effect(AnalyticsService, gen(function* () {
|
|
|
150143
150382
|
const httpClient = yield* HttpClient;
|
|
150144
150383
|
const serverConfig = yield* ServerConfig;
|
|
150145
150384
|
const identifier = yield* getTelemetryIdentifier;
|
|
150146
|
-
const bufferRef = yield* make$
|
|
150385
|
+
const bufferRef = yield* make$49([]);
|
|
150147
150386
|
const clientType = serverConfig.mode === "desktop" ? "desktop-app" : "cli-web-client";
|
|
150148
150387
|
const enqueueBufferedEvent = (event, properties) => flatMap(now, (now) => modify$3(bufferRef, (current) => {
|
|
150149
150388
|
const appended = [...current, {
|
|
@@ -150304,7 +150543,7 @@ function formatLoggerMessage(message) {
|
|
|
150304
150543
|
return typeof message === "string" ? message : String(message);
|
|
150305
150544
|
}
|
|
150306
150545
|
function makeLineLogger(streamLabel) {
|
|
150307
|
-
return make$
|
|
150546
|
+
return make$32(({ date, message }) => `[${date.toISOString()}] ${streamLabel}: ${formatLoggerMessage(message)}\n`);
|
|
150308
150547
|
}
|
|
150309
150548
|
function resolveStreamLabel(stream) {
|
|
150310
150549
|
switch (stream) {
|
|
@@ -150365,7 +150604,7 @@ const makeThreadWriter = fn$1("makeThreadWriter")(function* (input) {
|
|
|
150365
150604
|
return;
|
|
150366
150605
|
}
|
|
150367
150606
|
const sink = sinkResult.sink;
|
|
150368
|
-
const scope = yield* make$
|
|
150607
|
+
const scope = yield* make$36();
|
|
150369
150608
|
const loggerLayer = layer$6([yield* batched(makeLineLogger(input.streamLabel), {
|
|
150370
150609
|
window: input.batchWindowMs,
|
|
150371
150610
|
flush: fn$1("makeThreadWriter.flush")(function* (messages) {
|
|
@@ -150420,7 +150659,7 @@ const makeEventNdjsonLogger = fn$1("makeEventNdjsonLogger")(function* (filePath,
|
|
|
150420
150659
|
});
|
|
150421
150660
|
return;
|
|
150422
150661
|
}
|
|
150423
|
-
const stateRef = yield* make$
|
|
150662
|
+
const stateRef = yield* make$31({
|
|
150424
150663
|
threadWriters: /* @__PURE__ */ new Map(),
|
|
150425
150664
|
failedSegments: /* @__PURE__ */ new Set()
|
|
150426
150665
|
});
|
|
@@ -212275,7 +212514,7 @@ const MODEL_LIST_PROBE_TIMEOUT_MS = 5e3;
|
|
|
212275
212514
|
const probeCliModels = (input) => gen(function* () {
|
|
212276
212515
|
const useShell = process.platform === "win32";
|
|
212277
212516
|
if (useShell && !isShellSafeCommandPath(input.binaryPath)) return;
|
|
212278
|
-
const command = make$
|
|
212517
|
+
const command = make$47(input.binaryPath, [...input.args], {
|
|
212279
212518
|
shell: useShell,
|
|
212280
212519
|
env: scrubForgeProviderChildEnvSecrets(process.env)
|
|
212281
212520
|
});
|
|
@@ -213749,73 +213988,6 @@ const makeCodexAdapter = fn$1("makeCodexAdapter")(function* (options) {
|
|
|
213749
213988
|
function makeCodexAdapterLive(options) {
|
|
213750
213989
|
return effect(CodexAdapter, makeCodexAdapter(options));
|
|
213751
213990
|
}
|
|
213752
|
-
//#endregion
|
|
213753
|
-
//#region ../../packages/shared/src/publicProviderCopy.ts
|
|
213754
|
-
const PUBLIC_PROVIDER_LEAK_PATTERNS = [
|
|
213755
|
-
/\bDeepSeek\b/i,
|
|
213756
|
-
/\bKimi\b/i,
|
|
213757
|
-
/\bMoonshot\b/i,
|
|
213758
|
-
/\bdeepseek[-._a-z0-9]*\b/i,
|
|
213759
|
-
/\bkimi[-._a-z0-9]*\b/i,
|
|
213760
|
-
/\bmoonshot[-._a-z0-9]*\b/i,
|
|
213761
|
-
/\bAPEX_API_KEY\b/,
|
|
213762
|
-
/\bDEEPSEEK_API_KEY\b/,
|
|
213763
|
-
/\bKIMI_API_KEY\b/,
|
|
213764
|
-
/\bOPENAI_API_KEY\b/,
|
|
213765
|
-
/\bANTHROPIC_API_KEY\b/,
|
|
213766
|
-
/\bCURSOR_API_KEY\b/,
|
|
213767
|
-
/\bOPENCODE_API_KEY\b/,
|
|
213768
|
-
/\bforge_proxy_[A-Za-z0-9._-]+\b/,
|
|
213769
|
-
/\bProviderValidationError\b/,
|
|
213770
|
-
/\/forge-server\/node_modules\//,
|
|
213771
|
-
/https?:\/\/[^\s'"<>)]*\/api\/provider-egress\/[^\s'"<>)]*/i,
|
|
213772
|
-
/https?:\/\/[^\s'"<>)]*(?:apex|deepseek|moonshot|kimi)[^\s'"<>)]*/i
|
|
213773
|
-
];
|
|
213774
|
-
const DEFAULT_PUBLIC_PROVIDER_ERROR = "CMMD is temporarily unavailable. Check the workspace AI connection and retry.";
|
|
213775
|
-
function isProviderRateOrQuotaError(message) {
|
|
213776
|
-
if (!message) return false;
|
|
213777
|
-
const normalized = message.toLowerCase();
|
|
213778
|
-
return /\b(rate[\s-]?limit|too\s+many\s+requests|usage[ _-]limit|usage_limit_reached|quota|insufficient_quota)\b/.test(normalized) || /\b429\b/.test(normalized);
|
|
213779
|
-
}
|
|
213780
|
-
function providerLifecycleOrAccountCopy(message) {
|
|
213781
|
-
if (/\bbound to provider account\b/.test(message) && /\bcannot use provider account\b/.test(message)) return "Forge could not switch this conversation to the selected AI account. Retry the account switch.";
|
|
213782
|
-
if (/\bforge_runtime_repairing\b/.test(message) || /\bthis turn was interrupted because the environment is being repaired\b/.test(message)) return "This turn was interrupted because the environment is being repaired. Retry after the repair finishes.";
|
|
213783
|
-
if (/\bforge_runtime_stopped\b/.test(message) || /\bthis turn was interrupted because the environment was stopped\b/.test(message)) return "This turn was interrupted because the environment was stopped. Start the environment and retry.";
|
|
213784
|
-
return null;
|
|
213785
|
-
}
|
|
213786
|
-
/**
|
|
213787
|
-
* Infer a SAFE, clearer failure category from a (possibly leaky) provider error.
|
|
213788
|
-
*
|
|
213789
|
-
* Returns a canned, user-facing message — it never echoes the raw input, so it
|
|
213790
|
-
* is safe to use even when the source message contains provider internals.
|
|
213791
|
-
* Used to give actionable feedback ("model isn't available", "rate-limited",
|
|
213792
|
-
* "auth failed") instead of the blanket "CMMD is temporarily unavailable."
|
|
213793
|
-
* Returns null when no category can be confidently inferred.
|
|
213794
|
-
*/
|
|
213795
|
-
function categorizePublicProviderError(message) {
|
|
213796
|
-
if (!message) return null;
|
|
213797
|
-
const m = message.toLowerCase();
|
|
213798
|
-
const lifecycleOrAccountCopy = providerLifecycleOrAccountCopy(m);
|
|
213799
|
-
if (lifecycleOrAccountCopy !== null) return lifecycleOrAccountCopy;
|
|
213800
|
-
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.";
|
|
213801
|
-
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.";
|
|
213802
|
-
if (isProviderRateOrQuotaError(m)) return "The AI service is rate-limited or out of quota. Wait a moment and retry.";
|
|
213803
|
-
if (/_credential_reconnect_required\b/.test(m)) return "The workspace AI credential needs to be reconnected. Reconnect it in Settings > Providers, then retry.";
|
|
213804
|
-
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.";
|
|
213805
|
-
if (/\b(timed?\s*out|timeout|overloaded|service\s+unavailable)\b/.test(m) || /\b50[234]\b/.test(m)) return "The AI service is temporarily overloaded. Retry in a moment.";
|
|
213806
|
-
return null;
|
|
213807
|
-
}
|
|
213808
|
-
function containsPublicProviderLeak(message) {
|
|
213809
|
-
if (!message) return false;
|
|
213810
|
-
return PUBLIC_PROVIDER_LEAK_PATTERNS.some((pattern) => pattern.test(message));
|
|
213811
|
-
}
|
|
213812
|
-
function sanitizePublicProviderText(message, options = {}) {
|
|
213813
|
-
if (message === void 0 || message === null) return null;
|
|
213814
|
-
const trimmed = message.trim();
|
|
213815
|
-
if (trimmed.length === 0) return null;
|
|
213816
|
-
if (!containsPublicProviderLeak(trimmed)) return trimmed;
|
|
213817
|
-
return categorizePublicProviderError(trimmed) ?? options.fallback ?? "CMMD is temporarily unavailable. Check the workspace AI connection and retry.";
|
|
213818
|
-
}
|
|
213819
213991
|
function resolveApexBaseUrl(settings, config) {
|
|
213820
213992
|
return config?.forgeApexBaseUrl || settings.baseUrl || "https://apex.cmmd.ai";
|
|
213821
213993
|
}
|
|
@@ -214374,11 +214546,11 @@ async function runClaudeCommand$1(execFileImpl, binaryPath, args, env) {
|
|
|
214374
214546
|
//#endregion
|
|
214375
214547
|
//#region src/provider/makeManagedServerProvider.ts
|
|
214376
214548
|
const makeManagedServerProvider = fn$1("makeManagedServerProvider")(function* (input) {
|
|
214377
|
-
const refreshSemaphore = yield* make$
|
|
214549
|
+
const refreshSemaphore = yield* make$43(1);
|
|
214378
214550
|
const changesPubSub = yield* acquireRelease(unbounded$1(), shutdown$2);
|
|
214379
214551
|
const initialSettings = yield* input.getSettings;
|
|
214380
|
-
const snapshotRef = yield* make$
|
|
214381
|
-
const settingsRef = yield* make$
|
|
214552
|
+
const snapshotRef = yield* make$49(input.initialSnapshot(initialSettings));
|
|
214553
|
+
const settingsRef = yield* make$49(initialSettings);
|
|
214382
214554
|
const applySnapshotBase = fn$1("applySnapshot")(function* (nextSettings, options) {
|
|
214383
214555
|
const forceRefresh = options?.forceRefresh === true;
|
|
214384
214556
|
const previousSettings = yield* get$6(settingsRef);
|
|
@@ -214397,10 +214569,10 @@ const makeManagedServerProvider = fn$1("makeManagedServerProvider")(function* (i
|
|
|
214397
214569
|
return yield* applySnapshot(yield* input.getSettings, { forceRefresh: true });
|
|
214398
214570
|
});
|
|
214399
214571
|
yield* runForEach(input.streamSettings, (nextSettings) => asVoid(applySnapshot(nextSettings))).pipe(forkScoped);
|
|
214400
|
-
const refreshFailureCount = yield* make$
|
|
214572
|
+
const refreshFailureCount = yield* make$49(0);
|
|
214401
214573
|
const QUICK_RETRY_MS = 5e3;
|
|
214402
214574
|
const MAX_QUICK_RETRIES = 3;
|
|
214403
|
-
const quickRetriesSoFar = yield* make$
|
|
214575
|
+
const quickRetriesSoFar = yield* make$49(0);
|
|
214404
214576
|
yield* forever$1(gen(function* () {
|
|
214405
214577
|
const failureCount = yield* get$6(refreshFailureCount);
|
|
214406
214578
|
const quickRetriesDone = yield* get$6(quickRetriesSoFar);
|
|
@@ -214695,7 +214867,7 @@ function makeClaudeCredentialAnswersResolver(options) {
|
|
|
214695
214867
|
*/
|
|
214696
214868
|
function runSupervisedRepeat(input) {
|
|
214697
214869
|
return gen(function* () {
|
|
214698
|
-
const shutdownSignal = yield* make$
|
|
214870
|
+
const shutdownSignal = yield* make$38();
|
|
214699
214871
|
yield* addFinalizer$2(() => succeed$3(shutdownSignal, void 0));
|
|
214700
214872
|
let firstAttempt = true;
|
|
214701
214873
|
while (true) {
|
|
@@ -215160,7 +215332,7 @@ const runClaudeCommand = fn$1("runClaudeCommand")(function* (args) {
|
|
|
215160
215332
|
}));
|
|
215161
215333
|
const claudeSettings = yield* service(ServerSettingsService).pipe(flatMap((service) => service.getSettings), map$3((settings) => settings.providers.claudeAgent));
|
|
215162
215334
|
const effectiveConfigPath = claudeSettings.configPath || config.forgeClaudeConfigPath || process.env.CLAUDE_CONFIG_DIR || void 0;
|
|
215163
|
-
const command = make$
|
|
215335
|
+
const command = make$47(claudeSettings.binaryPath, [...args], {
|
|
215164
215336
|
shell: process.platform === "win32",
|
|
215165
215337
|
env: scrubForgeProviderChildEnvSecrets({
|
|
215166
215338
|
...process.env,
|
|
@@ -218339,7 +218511,7 @@ const makeClaudeAdapter = fn$1("makeClaudeAdapter")(function* (options) {
|
|
|
218339
218511
|
const handleAskUserQuestion = fn$1("handleAskUserQuestion")(function* (context, toolInput, callbackOptions, pendingUserInputs, runFork) {
|
|
218340
218512
|
const requestId = ApprovalRequestId.make(yield* nextUUIDv4);
|
|
218341
218513
|
const questions = userInputQuestionsFromToolInput(toolInput);
|
|
218342
|
-
const answersDeferred = yield* make$
|
|
218514
|
+
const answersDeferred = yield* make$38();
|
|
218343
218515
|
let aborted = false;
|
|
218344
218516
|
const requestedStamp = yield* makeEventStamp();
|
|
218345
218517
|
yield* offerRuntimeEvent({
|
|
@@ -218427,7 +218599,7 @@ const makeClaudeAdapter = fn$1("makeClaudeAdapter")(function* (options) {
|
|
|
218427
218599
|
const requestId = ApprovalRequestId.make(yield* nextUUIDv4);
|
|
218428
218600
|
const requestType = classifyRequestType(toolName);
|
|
218429
218601
|
const detail = summarizeToolRequest(toolName, toolInput);
|
|
218430
|
-
const decisionDeferred = yield* make$
|
|
218602
|
+
const decisionDeferred = yield* make$38();
|
|
218431
218603
|
const pendingApproval = {
|
|
218432
218604
|
requestType,
|
|
218433
218605
|
detail,
|
|
@@ -218697,7 +218869,7 @@ const makeClaudeAdapter = fn$1("makeClaudeAdapter")(function* (options) {
|
|
|
218697
218869
|
const pendingApprovals = /* @__PURE__ */ new Map();
|
|
218698
218870
|
const pendingUserInputs = /* @__PURE__ */ new Map();
|
|
218699
218871
|
const inFlightTools = /* @__PURE__ */ new Map();
|
|
218700
|
-
const contextRef = yield* make$
|
|
218872
|
+
const contextRef = yield* make$49(void 0);
|
|
218701
218873
|
const canUseTool = makeCanUseTool(contextRef, input.runtimeMode, pendingApprovals, pendingUserInputs, runFork, runPromise);
|
|
218702
218874
|
const serverSettings = yield* serverSettingsService.getSettings.pipe(mapError((error) => new ProviderAdapterProcessError({
|
|
218703
218875
|
provider: PROVIDER$11,
|
|
@@ -223001,9 +223173,9 @@ const makeAcpPatchedProtocol = fn$1("makeAcpPatchedProtocol")(function* (options
|
|
|
223001
223173
|
const notificationQueue = yield* sliding(1024);
|
|
223002
223174
|
const disconnects = yield* unbounded$2();
|
|
223003
223175
|
const outgoing = yield* unbounded$2();
|
|
223004
|
-
const nextRequestId = yield* make$
|
|
223005
|
-
const terminationHandled = yield* make$
|
|
223006
|
-
const extPending = yield* make$
|
|
223176
|
+
const nextRequestId = yield* make$49(1n);
|
|
223177
|
+
const terminationHandled = yield* make$49(false);
|
|
223178
|
+
const extPending = yield* make$49(/* @__PURE__ */ new Map());
|
|
223007
223179
|
const logProtocol = (event) => {
|
|
223008
223180
|
if (event.direction === "incoming" && !options.logIncoming) return void_$1;
|
|
223009
223181
|
if (event.direction === "outgoing" && !options.logOutgoing) return void_$1;
|
|
@@ -223209,7 +223381,7 @@ const makeAcpPatchedProtocol = fn$1("makeAcpPatchedProtocol")(function* (options
|
|
|
223209
223381
|
},
|
|
223210
223382
|
request: fn$1("sendRequest")(function* (method, payload) {
|
|
223211
223383
|
const requestId = yield* modify$3(nextRequestId, (current) => [current, current + 1n]);
|
|
223212
|
-
const deferred = yield* make$
|
|
223384
|
+
const deferred = yield* make$38();
|
|
223213
223385
|
yield* update$4(extPending, (pending) => new Map(pending).set(String(requestId), deferred));
|
|
223214
223386
|
yield* offerOutgoing({
|
|
223215
223387
|
_tag: "Request",
|
|
@@ -223237,113 +223409,113 @@ function toRpcClientError(error) {
|
|
|
223237
223409
|
}
|
|
223238
223410
|
//#endregion
|
|
223239
223411
|
//#region ../../packages/effect-acp/src/rpc.ts
|
|
223240
|
-
const InitializeRpc = make$
|
|
223412
|
+
const InitializeRpc = make$29(AGENT_METHODS.initialize, {
|
|
223241
223413
|
payload: InitializeRequest,
|
|
223242
223414
|
success: InitializeResponse,
|
|
223243
223415
|
error: Error$1
|
|
223244
223416
|
});
|
|
223245
|
-
const AuthenticateRpc = make$
|
|
223417
|
+
const AuthenticateRpc = make$29(AGENT_METHODS.authenticate, {
|
|
223246
223418
|
payload: AuthenticateRequest,
|
|
223247
223419
|
success: AuthenticateResponse,
|
|
223248
223420
|
error: Error$1
|
|
223249
223421
|
});
|
|
223250
|
-
const LogoutRpc = make$
|
|
223422
|
+
const LogoutRpc = make$29(AGENT_METHODS.logout, {
|
|
223251
223423
|
payload: LogoutRequest,
|
|
223252
223424
|
success: LogoutResponse,
|
|
223253
223425
|
error: Error$1
|
|
223254
223426
|
});
|
|
223255
|
-
const NewSessionRpc = make$
|
|
223427
|
+
const NewSessionRpc = make$29(AGENT_METHODS.session_new, {
|
|
223256
223428
|
payload: NewSessionRequest,
|
|
223257
223429
|
success: NewSessionResponse,
|
|
223258
223430
|
error: Error$1
|
|
223259
223431
|
});
|
|
223260
|
-
const LoadSessionRpc = make$
|
|
223432
|
+
const LoadSessionRpc = make$29(AGENT_METHODS.session_load, {
|
|
223261
223433
|
payload: LoadSessionRequest,
|
|
223262
223434
|
success: LoadSessionResponse,
|
|
223263
223435
|
error: Error$1
|
|
223264
223436
|
});
|
|
223265
|
-
const ListSessionsRpc = make$
|
|
223437
|
+
const ListSessionsRpc = make$29(AGENT_METHODS.session_list, {
|
|
223266
223438
|
payload: ListSessionsRequest,
|
|
223267
223439
|
success: ListSessionsResponse,
|
|
223268
223440
|
error: Error$1
|
|
223269
223441
|
});
|
|
223270
|
-
const ForkSessionRpc = make$
|
|
223442
|
+
const ForkSessionRpc = make$29(AGENT_METHODS.session_fork, {
|
|
223271
223443
|
payload: ForkSessionRequest,
|
|
223272
223444
|
success: ForkSessionResponse,
|
|
223273
223445
|
error: Error$1
|
|
223274
223446
|
});
|
|
223275
|
-
const ResumeSessionRpc = make$
|
|
223447
|
+
const ResumeSessionRpc = make$29(AGENT_METHODS.session_resume, {
|
|
223276
223448
|
payload: ResumeSessionRequest,
|
|
223277
223449
|
success: ResumeSessionResponse,
|
|
223278
223450
|
error: Error$1
|
|
223279
223451
|
});
|
|
223280
|
-
const CloseSessionRpc = make$
|
|
223452
|
+
const CloseSessionRpc = make$29(AGENT_METHODS.session_close, {
|
|
223281
223453
|
payload: CloseSessionRequest,
|
|
223282
223454
|
success: CloseSessionResponse,
|
|
223283
223455
|
error: Error$1
|
|
223284
223456
|
});
|
|
223285
|
-
const PromptRpc = make$
|
|
223457
|
+
const PromptRpc = make$29(AGENT_METHODS.session_prompt, {
|
|
223286
223458
|
payload: PromptRequest,
|
|
223287
223459
|
success: PromptResponse,
|
|
223288
223460
|
error: Error$1
|
|
223289
223461
|
});
|
|
223290
|
-
const SetSessionModelRpc = make$
|
|
223462
|
+
const SetSessionModelRpc = make$29(AGENT_METHODS.session_set_model, {
|
|
223291
223463
|
payload: SetSessionModelRequest,
|
|
223292
223464
|
success: SetSessionModelResponse,
|
|
223293
223465
|
error: Error$1
|
|
223294
223466
|
});
|
|
223295
|
-
const SetSessionConfigOptionRpc = make$
|
|
223467
|
+
const SetSessionConfigOptionRpc = make$29(AGENT_METHODS.session_set_config_option, {
|
|
223296
223468
|
payload: SetSessionConfigOptionRequest,
|
|
223297
223469
|
success: SetSessionConfigOptionResponse,
|
|
223298
223470
|
error: Error$1
|
|
223299
223471
|
});
|
|
223300
|
-
const ReadTextFileRpc = make$
|
|
223472
|
+
const ReadTextFileRpc = make$29(CLIENT_METHODS.fs_read_text_file, {
|
|
223301
223473
|
payload: ReadTextFileRequest,
|
|
223302
223474
|
success: ReadTextFileResponse,
|
|
223303
223475
|
error: Error$1
|
|
223304
223476
|
});
|
|
223305
|
-
const WriteTextFileRpc = make$
|
|
223477
|
+
const WriteTextFileRpc = make$29(CLIENT_METHODS.fs_write_text_file, {
|
|
223306
223478
|
payload: WriteTextFileRequest,
|
|
223307
223479
|
success: WriteTextFileResponse,
|
|
223308
223480
|
error: Error$1
|
|
223309
223481
|
});
|
|
223310
|
-
const RequestPermissionRpc = make$
|
|
223482
|
+
const RequestPermissionRpc = make$29(CLIENT_METHODS.session_request_permission, {
|
|
223311
223483
|
payload: RequestPermissionRequest,
|
|
223312
223484
|
success: RequestPermissionResponse,
|
|
223313
223485
|
error: Error$1
|
|
223314
223486
|
});
|
|
223315
|
-
const ElicitationRpc = make$
|
|
223487
|
+
const ElicitationRpc = make$29(CLIENT_METHODS.session_elicitation, {
|
|
223316
223488
|
payload: ElicitationRequest,
|
|
223317
223489
|
success: ElicitationResponse,
|
|
223318
223490
|
error: Error$1
|
|
223319
223491
|
});
|
|
223320
|
-
const CreateTerminalRpc = make$
|
|
223492
|
+
const CreateTerminalRpc = make$29(CLIENT_METHODS.terminal_create, {
|
|
223321
223493
|
payload: CreateTerminalRequest,
|
|
223322
223494
|
success: CreateTerminalResponse,
|
|
223323
223495
|
error: Error$1
|
|
223324
223496
|
});
|
|
223325
|
-
const TerminalOutputRpc = make$
|
|
223497
|
+
const TerminalOutputRpc = make$29(CLIENT_METHODS.terminal_output, {
|
|
223326
223498
|
payload: TerminalOutputRequest,
|
|
223327
223499
|
success: TerminalOutputResponse,
|
|
223328
223500
|
error: Error$1
|
|
223329
223501
|
});
|
|
223330
|
-
const ReleaseTerminalRpc = make$
|
|
223502
|
+
const ReleaseTerminalRpc = make$29(CLIENT_METHODS.terminal_release, {
|
|
223331
223503
|
payload: ReleaseTerminalRequest,
|
|
223332
223504
|
success: ReleaseTerminalResponse,
|
|
223333
223505
|
error: Error$1
|
|
223334
223506
|
});
|
|
223335
|
-
const WaitForTerminalExitRpc = make$
|
|
223507
|
+
const WaitForTerminalExitRpc = make$29(CLIENT_METHODS.terminal_wait_for_exit, {
|
|
223336
223508
|
payload: WaitForTerminalExitRequest,
|
|
223337
223509
|
success: WaitForTerminalExitResponse,
|
|
223338
223510
|
error: Error$1
|
|
223339
223511
|
});
|
|
223340
|
-
const KillTerminalRpc = make$
|
|
223512
|
+
const KillTerminalRpc = make$29(CLIENT_METHODS.terminal_kill, {
|
|
223341
223513
|
payload: KillTerminalRequest,
|
|
223342
223514
|
success: KillTerminalResponse,
|
|
223343
223515
|
error: Error$1
|
|
223344
223516
|
});
|
|
223345
|
-
const AgentRpcs = make$
|
|
223346
|
-
const ClientRpcs = make$
|
|
223517
|
+
const AgentRpcs = make$28(InitializeRpc, AuthenticateRpc, LogoutRpc, NewSessionRpc, LoadSessionRpc, ListSessionsRpc, ForkSessionRpc, ResumeSessionRpc, CloseSessionRpc, PromptRpc, SetSessionModelRpc, SetSessionConfigOptionRpc);
|
|
223518
|
+
const ClientRpcs = make$28(ReadTextFileRpc, WriteTextFileRpc, RequestPermissionRpc, ElicitationRpc, CreateTerminalRpc, TerminalOutputRpc, ReleaseTerminalRpc, WaitForTerminalExitRpc, KillTerminalRpc);
|
|
223347
223519
|
//#endregion
|
|
223348
223520
|
//#region ../../packages/effect-acp/src/_internal/shared.ts
|
|
223349
223521
|
const isError = is$1(Error$1);
|
|
@@ -223372,7 +223544,7 @@ ArraySchema(Unknown);
|
|
|
223372
223544
|
//#endregion
|
|
223373
223545
|
//#region ../../packages/effect-acp/src/_internal/stdio.ts
|
|
223374
223546
|
const encoder$1 = new TextEncoder();
|
|
223375
|
-
const makeChildStdio = (handle) => make$
|
|
223547
|
+
const makeChildStdio = (handle) => make$48({
|
|
223376
223548
|
args: succeed([]),
|
|
223377
223549
|
stdin: handle.stdout,
|
|
223378
223550
|
stdout: () => mapInput(handle.stdin, (chunk) => typeof chunk === "string" ? encoder$1.encode(chunk) : chunk),
|
|
@@ -223383,7 +223555,7 @@ fn$1("makeInMemoryStdio")(function* () {
|
|
|
223383
223555
|
const output = yield* unbounded$2();
|
|
223384
223556
|
const decoder = new TextDecoder();
|
|
223385
223557
|
return {
|
|
223386
|
-
stdio: make$
|
|
223558
|
+
stdio: make$48({
|
|
223387
223559
|
args: succeed([]),
|
|
223388
223560
|
stdin: fromQueue(input),
|
|
223389
223561
|
stdout: () => forEach$1((chunk) => offer$1(output, typeof chunk === "string" ? chunk : decoder.decode(chunk, { stream: true }))),
|
|
@@ -223406,7 +223578,7 @@ function runNotificationHandlers(registration, notification) {
|
|
|
223406
223578
|
return forEach(registration.handlers, (handler) => handler(notification).pipe(catch_(() => void_$1)), { discard: true });
|
|
223407
223579
|
}
|
|
223408
223580
|
var AcpClient = class extends Service$1()("effect-acp/AcpClient") {};
|
|
223409
|
-
const make$
|
|
223581
|
+
const make$11 = fn$1("effect-acp/AcpClient.make")(function* (stdio, options = {}, terminationError) {
|
|
223410
223582
|
const coreHandlers = {};
|
|
223411
223583
|
const notificationHandlers = {
|
|
223412
223584
|
sessionUpdate: {
|
|
@@ -223473,9 +223645,9 @@ const make$12 = fn$1("effect-acp/AcpClient.make")(function* (stdio, options = {}
|
|
|
223473
223645
|
[CLIENT_METHODS.terminal_kill]: (payload) => runHandler(coreHandlers.terminalKill, payload, CLIENT_METHODS.terminal_kill).pipe(map$3((result) => result ?? {})),
|
|
223474
223646
|
[CLIENT_METHODS.terminal_release]: (payload) => runHandler(coreHandlers.terminalRelease, payload, CLIENT_METHODS.terminal_release).pipe(map$3((result) => result ?? {}))
|
|
223475
223647
|
}));
|
|
223476
|
-
yield* make$
|
|
223648
|
+
yield* make$23(ClientRpcs).pipe(provideService(Protocol, transport.serverProtocol), provide(clientHandlerLayer), forkScoped);
|
|
223477
223649
|
let nextRpcRequestId = 1n << 32n;
|
|
223478
|
-
const rpc = yield* make$
|
|
223650
|
+
const rpc = yield* make$24(AgentRpcs, { generateRequestId: () => nextRpcRequestId++ }).pipe(provideService(Protocol$1, transport.clientProtocol));
|
|
223479
223651
|
return AcpClient.of({
|
|
223480
223652
|
raw: {
|
|
223481
223653
|
notifications: transport.incoming,
|
|
@@ -223560,7 +223732,7 @@ const make$12 = fn$1("effect-acp/AcpClient.make")(function* (stdio, options = {}
|
|
|
223560
223732
|
});
|
|
223561
223733
|
});
|
|
223562
223734
|
const layerChildProcess = (handle, options = {}) => {
|
|
223563
|
-
return effect(AcpClient, make$
|
|
223735
|
+
return effect(AcpClient, make$11(makeChildStdio(handle), options, makeTerminationError(handle)));
|
|
223564
223736
|
};
|
|
223565
223737
|
//#endregion
|
|
223566
223738
|
//#region src/provider/acp/AcpSessionRuntime.ts
|
|
@@ -223602,11 +223774,11 @@ const makeAcpSessionRuntime = (options) => gen(function* () {
|
|
|
223602
223774
|
const spawner = yield* ChildProcessSpawner;
|
|
223603
223775
|
const runtimeScope = yield* Scope$1;
|
|
223604
223776
|
const eventQueue = yield* unbounded$2();
|
|
223605
|
-
const modeStateRef = yield* make$
|
|
223606
|
-
const toolCallsRef = yield* make$
|
|
223607
|
-
const assistantSegmentRef = yield* make$
|
|
223608
|
-
const configOptionsRef = yield* make$
|
|
223609
|
-
const startStateRef = yield* make$
|
|
223777
|
+
const modeStateRef = yield* make$49(void 0);
|
|
223778
|
+
const toolCallsRef = yield* make$49(/* @__PURE__ */ new Map());
|
|
223779
|
+
const assistantSegmentRef = yield* make$49({ nextSegmentIndex: 0 });
|
|
223780
|
+
const configOptionsRef = yield* make$49(sessionConfigOptionsFromSetup(void 0));
|
|
223781
|
+
const startStateRef = yield* make$49({ _tag: "NotStarted" });
|
|
223610
223782
|
const logRequest = (event) => options.requestLogger ? options.requestLogger(event) : void_$1;
|
|
223611
223783
|
const runLoggedRequest = (method, payload, effect) => logRequest({
|
|
223612
223784
|
method,
|
|
@@ -223628,7 +223800,7 @@ const makeAcpSessionRuntime = (options) => gen(function* () {
|
|
|
223628
223800
|
command: options.spawn.command,
|
|
223629
223801
|
cause: /* @__PURE__ */ new Error(`Refusing to spawn ACP child process: command path contains shell metacharacters that cmd.exe would interpret as additional commands. Adjust the provider \`binaryPath\` setting to an unquoted absolute path.`)
|
|
223630
223802
|
});
|
|
223631
|
-
const acpContext = yield* build(layerChildProcess(yield* spawner.spawn(make$
|
|
223803
|
+
const acpContext = yield* build(layerChildProcess(yield* spawner.spawn(make$47(options.spawn.command, [...options.spawn.args], {
|
|
223632
223804
|
...options.spawn.cwd ? { cwd: options.spawn.cwd } : {},
|
|
223633
223805
|
env: scrubForgeProviderChildEnvSecrets({
|
|
223634
223806
|
...process.env,
|
|
@@ -223960,7 +224132,7 @@ const makeStartCoordinator = (startStateRef, startOnce) => gen(function* () {
|
|
|
223960
224132
|
const currentState = yield* get$6(startStateRef);
|
|
223961
224133
|
if (currentState._tag === "Started") return currentState.result;
|
|
223962
224134
|
if (currentState._tag === "Starting") return yield* _await(currentState.deferred);
|
|
223963
|
-
const deferred = yield* make$
|
|
224135
|
+
const deferred = yield* make$38();
|
|
223964
224136
|
return yield* yield* modify$3(startStateRef, (state) => {
|
|
223965
224137
|
switch (state._tag) {
|
|
223966
224138
|
case "Started": return [succeed(state.result), state];
|
|
@@ -224082,7 +224254,7 @@ const readCursorApiKey = (_settings) => process.env.CURSOR_API_KEY || null;
|
|
|
224082
224254
|
const runCursorCommand = fn$1("runCursorCommand")(function* (binaryPath, args) {
|
|
224083
224255
|
const useShell = process.platform === "win32";
|
|
224084
224256
|
if (useShell && !isShellSafeCommandPath(binaryPath)) return yield* fail(/* @__PURE__ */ new Error(`Refusing to spawn cursor-agent: \`binaryPath\` contains shell metacharacters that cmd.exe would interpret as additional commands.`));
|
|
224085
|
-
return yield* spawnAndCollect(binaryPath, make$
|
|
224257
|
+
return yield* spawnAndCollect(binaryPath, make$47(binaryPath, [...args], {
|
|
224086
224258
|
shell: useShell,
|
|
224087
224259
|
env: scrubForgeProviderChildEnvSecrets(process.env)
|
|
224088
224260
|
}));
|
|
@@ -224668,7 +224840,7 @@ function makeCursorAdapter(cursorSettings, options) {
|
|
|
224668
224840
|
const nativeEventLogger = options?.nativeEventLogger ?? (options?.nativeEventLogPath !== void 0 ? yield* makeEventNdjsonLogger(options.nativeEventLogPath, { stream: "native" }) : void 0);
|
|
224669
224841
|
const managedNativeEventLogger = options?.nativeEventLogger === void 0 ? nativeEventLogger : void 0;
|
|
224670
224842
|
const sessions = /* @__PURE__ */ new Map();
|
|
224671
|
-
const threadLocksRef = yield* make$
|
|
224843
|
+
const threadLocksRef = yield* make$31(/* @__PURE__ */ new Map());
|
|
224672
224844
|
const runtimeEventPubSub = yield* unbounded$1();
|
|
224673
224845
|
const nowIso = map$3(now, formatIso);
|
|
224674
224846
|
const nextEventId = map$3(nextUUIDv4, (id) => EventId.make(id));
|
|
@@ -224679,7 +224851,7 @@ function makeCursorAdapter(cursorSettings, options) {
|
|
|
224679
224851
|
const offerRuntimeEvent = (event) => publish(runtimeEventPubSub, event).pipe(asVoid);
|
|
224680
224852
|
const getThreadSemaphore = (threadId) => modifyEffect(threadLocksRef, (current) => {
|
|
224681
224853
|
return match(fromNullishOr(current.get(threadId)), {
|
|
224682
|
-
onNone: () => make$
|
|
224854
|
+
onNone: () => make$43(1).pipe(map$3((semaphore) => {
|
|
224683
224855
|
const next = new Map(current);
|
|
224684
224856
|
next.set(threadId, semaphore);
|
|
224685
224857
|
return [semaphore, next];
|
|
@@ -224760,7 +224932,7 @@ function makeCursorAdapter(cursorSettings, options) {
|
|
|
224760
224932
|
if (existing && !existing.stopped) yield* stopSessionInternal(existing);
|
|
224761
224933
|
const pendingApprovals = /* @__PURE__ */ new Map();
|
|
224762
224934
|
const pendingUserInputs = /* @__PURE__ */ new Map();
|
|
224763
|
-
const sessionScope = yield* make$
|
|
224935
|
+
const sessionScope = yield* make$36("sequential");
|
|
224764
224936
|
let sessionScopeTransferred = false;
|
|
224765
224937
|
yield* addFinalizer$2(() => sessionScopeTransferred ? void_$1 : close(sessionScope, void_$3));
|
|
224766
224938
|
let ctx;
|
|
@@ -224794,7 +224966,7 @@ function makeCursorAdapter(cursorSettings, options) {
|
|
|
224794
224966
|
yield* logNative(input.threadId, "cursor/ask_question", params, "acp.cursor.extension");
|
|
224795
224967
|
const requestId = ApprovalRequestId.make(crypto.randomUUID());
|
|
224796
224968
|
const runtimeRequestId = RuntimeRequestId.make(requestId);
|
|
224797
|
-
const answers = yield* make$
|
|
224969
|
+
const answers = yield* make$38();
|
|
224798
224970
|
pendingUserInputs.set(requestId, { answers });
|
|
224799
224971
|
yield* offerRuntimeEvent({
|
|
224800
224972
|
type: "user-input.requested",
|
|
@@ -224856,7 +225028,7 @@ function makeCursorAdapter(cursorSettings, options) {
|
|
|
224856
225028
|
const permissionRequest = parsePermissionRequest(params);
|
|
224857
225029
|
const requestId = ApprovalRequestId.make(crypto.randomUUID());
|
|
224858
225030
|
const runtimeRequestId = RuntimeRequestId.make(requestId);
|
|
224859
|
-
const decision = yield* make$
|
|
225031
|
+
const decision = yield* make$38();
|
|
224860
225032
|
pendingApprovals.set(requestId, {
|
|
224861
225033
|
decision,
|
|
224862
225034
|
kind: permissionRequest.kind
|
|
@@ -231904,7 +232076,7 @@ const makeOpenCodeRuntime = gen(function* () {
|
|
|
231904
232076
|
const netService = yield* NetService;
|
|
231905
232077
|
const runOpenCodeCommand = (input) => gen(function* () {
|
|
231906
232078
|
yield* rejectUnsafeWindowsBinaryPath("runOpenCodeCommand", input.binaryPath);
|
|
231907
|
-
const child = yield* spawner.spawn(make$
|
|
232079
|
+
const child = yield* spawner.spawn(make$47(input.binaryPath, [...input.args], {
|
|
231908
232080
|
shell: process.platform === "win32",
|
|
231909
232081
|
env: input.environment ?? process.env
|
|
231910
232082
|
}));
|
|
@@ -231939,7 +232111,7 @@ const makeOpenCodeRuntime = gen(function* () {
|
|
|
231939
232111
|
`--hostname=${hostname}`,
|
|
231940
232112
|
`--port=${port}`
|
|
231941
232113
|
];
|
|
231942
|
-
const child = yield* spawner.spawn(make$
|
|
232114
|
+
const child = yield* spawner.spawn(make$47(input.binaryPath, args, {
|
|
231943
232115
|
detached: process.platform !== "win32",
|
|
231944
232116
|
shell: process.platform === "win32",
|
|
231945
232117
|
env: {
|
|
@@ -231960,9 +232132,9 @@ const makeOpenCodeRuntime = gen(function* () {
|
|
|
231960
232132
|
} catch {}
|
|
231961
232133
|
});
|
|
231962
232134
|
yield* addFinalizer$1(runtimeScope, killOpenCodeProcessGroup("SIGTERM").pipe(andThen(sleep$4("1 second")), andThen(killOpenCodeProcessGroup("SIGKILL")), ignore));
|
|
231963
|
-
const stdoutRef = yield* make$
|
|
231964
|
-
const stderrRef = yield* make$
|
|
231965
|
-
const readyDeferred = yield* make$
|
|
232135
|
+
const stdoutRef = yield* make$49("");
|
|
232136
|
+
const stderrRef = yield* make$49("");
|
|
232137
|
+
const readyDeferred = yield* make$38();
|
|
231966
232138
|
const setReadyFromStdoutChunk = (chunk) => updateAndGet(stdoutRef, (stdout) => `${stdout}${chunk}`).pipe(flatMap((nextStdout) => {
|
|
231967
232139
|
const parsed = parseServerUrlFromOutput(nextStdout);
|
|
231968
232140
|
return parsed ? succeed$3(readyDeferred, parsed).pipe(ignore) : void_$1;
|
|
@@ -232220,7 +232392,7 @@ function classifyGlobalEventEnvelope(envelope) {
|
|
|
232220
232392
|
payload
|
|
232221
232393
|
};
|
|
232222
232394
|
}
|
|
232223
|
-
const isoFromEpochMs = (value) => make$
|
|
232395
|
+
const isoFromEpochMs = (value) => make$37(value).pipe(match({
|
|
232224
232396
|
onNone: () => void 0,
|
|
232225
232397
|
onSome: formatIso
|
|
232226
232398
|
}));
|
|
@@ -232653,7 +232825,7 @@ function makeOpenCodeAdapter(openCodeSettings, options) {
|
|
|
232653
232825
|
sessions.delete(input.threadId);
|
|
232654
232826
|
}
|
|
232655
232827
|
const started = yield* gen(function* () {
|
|
232656
|
-
const sessionScope = yield* make$
|
|
232828
|
+
const sessionScope = yield* make$36();
|
|
232657
232829
|
const startedExit = yield* exit(gen(function* () {
|
|
232658
232830
|
const server = yield* openCodeRuntime.connectToOpenCodeServer({
|
|
232659
232831
|
binaryPath,
|
|
@@ -232720,7 +232892,7 @@ function makeOpenCodeAdapter(openCodeSettings, options) {
|
|
|
232720
232892
|
activeTurnId: void 0,
|
|
232721
232893
|
activeAgent: void 0,
|
|
232722
232894
|
activeVariant: void 0,
|
|
232723
|
-
stopped: yield* make$
|
|
232895
|
+
stopped: yield* make$49(false),
|
|
232724
232896
|
sessionScope: started.sessionScope
|
|
232725
232897
|
};
|
|
232726
232898
|
sessions.set(input.threadId, context);
|
|
@@ -233220,7 +233392,7 @@ const makeProviderService = fn$1("makeProviderService")(function* (options) {
|
|
|
233220
233392
|
const canonicalEventLogger = options?.canonicalEventLogger ?? (options?.canonicalEventLogPath !== void 0 ? yield* makeEventNdjsonLogger(options.canonicalEventLogPath, { stream: "canonical" }) : void 0);
|
|
233221
233393
|
const registry = yield* ProviderAdapterRegistry;
|
|
233222
233394
|
const directory = yield* ProviderSessionDirectory;
|
|
233223
|
-
const sessionLocks = yield* make$
|
|
233395
|
+
const sessionLocks = yield* make$46({ lookup: (_threadId) => make$43(1) });
|
|
233224
233396
|
const withSessionLock = (threadId, effect) => get$5(sessionLocks, threadId).pipe(flatMap((lock) => lock.withPermit(effect)), scoped);
|
|
233225
233397
|
const runtimeEventPubSub = yield* unbounded$1();
|
|
233226
233398
|
const assertProviderExecutable = options?.assertProviderExecutable ?? (() => succeed(null));
|
|
@@ -235185,7 +235357,7 @@ const createTrace2Monitor = fn$1("createTrace2Monitor")(function* (input, progre
|
|
|
235185
235357
|
suffix: ".json"
|
|
235186
235358
|
});
|
|
235187
235359
|
const hookStartByChildKey = /* @__PURE__ */ new Map();
|
|
235188
|
-
const traceTailState = yield* make$
|
|
235360
|
+
const traceTailState = yield* make$49({
|
|
235189
235361
|
processedChars: 0,
|
|
235190
235362
|
remainder: ""
|
|
235191
235363
|
});
|
|
@@ -235231,7 +235403,7 @@ const createTrace2Monitor = fn$1("createTrace2Monitor")(function* (input, progre
|
|
|
235231
235403
|
});
|
|
235232
235404
|
}
|
|
235233
235405
|
});
|
|
235234
|
-
const readTraceDelta = (yield* make$
|
|
235406
|
+
const readTraceDelta = (yield* make$43(1)).withPermit(fs.readFileString(traceFilePath).pipe(flatMap((contents) => uninterruptible(modify$3(traceTailState, ({ processedChars, remainder }) => {
|
|
235235
235407
|
if (contents.length <= processedChars) return [[], {
|
|
235236
235408
|
processedChars,
|
|
235237
235409
|
remainder
|
|
@@ -235360,7 +235532,7 @@ const GitCoreLive = effect(GitCore, fn$1("makeGitCore")(function* (options) {
|
|
|
235360
235532
|
const truncateOutputAtMaxBytes = input.truncateOutputAtMaxBytes ?? false;
|
|
235361
235533
|
return yield* fn$1("runGitCommand")(function* () {
|
|
235362
235534
|
const trace2Monitor = yield* createTrace2Monitor(commandInput, input.progress).pipe(provideService(Path$2, path$10), provideService(FileSystem, fileSystem), mapError(toGitCommandError(commandInput, "failed to create trace2 monitor.")));
|
|
235363
|
-
const child = yield* commandSpawner.spawn(make$
|
|
235535
|
+
const child = yield* commandSpawner.spawn(make$47("git", commandInput.args, {
|
|
235364
235536
|
cwd: commandInput.cwd,
|
|
235365
235537
|
env: withRepositoryOwnershipTrust({
|
|
235366
235538
|
...process.env,
|
|
@@ -235372,7 +235544,7 @@ const GitCoreLive = effect(GitCore, fn$1("makeGitCore")(function* (options) {
|
|
|
235372
235544
|
collectOutput(commandInput, child.stdout, maxOutputBytes, truncateOutputAtMaxBytes, input.progress?.onStdoutLine),
|
|
235373
235545
|
collectOutput(commandInput, child.stderr, maxOutputBytes, truncateOutputAtMaxBytes, input.progress?.onStderrLine),
|
|
235374
235546
|
child.exitCode.pipe(map$3((value) => Number(value)), mapError(toGitCommandError(commandInput, "failed to report exit code."))),
|
|
235375
|
-
input.stdin === void 0 ? void_$1 : run$2(encodeText(make$
|
|
235547
|
+
input.stdin === void 0 ? void_$1 : run$2(encodeText(make$42(input.stdin)), child.stdin).pipe(mapError(toGitCommandError(commandInput, "failed to write stdin.")))
|
|
235376
235548
|
], { concurrency: "unbounded" }).pipe(map$3(([stdout, stderr, exitCode]) => [
|
|
235377
235549
|
stdout,
|
|
235378
235550
|
stderr,
|
|
@@ -236743,9 +236915,9 @@ function fingerprintStatusPart(status) {
|
|
|
236743
236915
|
const GitStatusBroadcasterLive = effect(GitStatusBroadcaster, gen(function* () {
|
|
236744
236916
|
const gitManager = yield* GitManager;
|
|
236745
236917
|
const changesPubSub = yield* acquireRelease(unbounded$1(), (pubsub) => shutdown$2(pubsub));
|
|
236746
|
-
const broadcasterScope = yield* acquireRelease(make$
|
|
236747
|
-
const cacheRef = yield* make$
|
|
236748
|
-
const pollersRef = yield* make$
|
|
236918
|
+
const broadcasterScope = yield* acquireRelease(make$36(), (scope) => close(scope, void_$3));
|
|
236919
|
+
const cacheRef = yield* make$49(/* @__PURE__ */ new Map());
|
|
236920
|
+
const pollersRef = yield* make$31(/* @__PURE__ */ new Map());
|
|
236749
236921
|
const getCachedStatus = fn$1("getCachedStatus")(function* (cwd) {
|
|
236750
236922
|
return yield* get$6(cacheRef).pipe(map$3((cache) => cache.get(cwd) ?? null));
|
|
236751
236923
|
});
|
|
@@ -236899,7 +237071,7 @@ const GitStatusBroadcasterLive = effect(GitStatusBroadcaster, gen(function* () {
|
|
|
236899
237071
|
const initialRemote = (yield* getCachedStatus(normalizedCwd))?.remote?.value ?? null;
|
|
236900
237072
|
yield* retainRemotePoller(normalizedCwd);
|
|
236901
237073
|
const release = releaseRemotePoller(normalizedCwd).pipe(ignore, asVoid);
|
|
236902
|
-
return concat$2(make$
|
|
237074
|
+
return concat$2(make$42({
|
|
236903
237075
|
_tag: "snapshot",
|
|
236904
237076
|
local: initialLocal,
|
|
236905
237077
|
remote: initialRemote
|
|
@@ -237370,7 +237542,7 @@ const runCodexCommand = fn$1("runCodexCommand")(function* (args) {
|
|
|
237370
237542
|
}));
|
|
237371
237543
|
const codexSettings = yield* (yield* ServerSettingsService).getSettings.pipe(map$3((settings) => settings.providers.codex));
|
|
237372
237544
|
const effectiveHomePath = codexSettings.homePath || config.forgeCodexHomePath || process.env.CODEX_HOME || void 0;
|
|
237373
|
-
const command = make$
|
|
237545
|
+
const command = make$47(codexSettings.binaryPath, [...args], {
|
|
237374
237546
|
shell: process.platform === "win32",
|
|
237375
237547
|
env: scrubForgeProviderChildEnvSecrets({
|
|
237376
237548
|
...process.env,
|
|
@@ -237810,7 +237982,7 @@ const CodexTextGenerationLive = effect(TextGeneration, gen(function* () {
|
|
|
237810
237982
|
});
|
|
237811
237983
|
const runCodexCommand = fn$1("runCodexJson.runCodexCommand")(function* () {
|
|
237812
237984
|
const { normalizedOptions, reasoningEffort, accessMode, providerProxyToken } = yield* resolveCodexCommandTarget();
|
|
237813
|
-
return yield* launchCodexCommand(make$
|
|
237985
|
+
return yield* launchCodexCommand(make$47(codexSettings?.binaryPath || "codex", buildCodexExecArgs({
|
|
237814
237986
|
model: modelSelection.model,
|
|
237815
237987
|
reasoningEffort,
|
|
237816
237988
|
fastMode: normalizedOptions?.fastMode,
|
|
@@ -237829,7 +238001,7 @@ const CodexTextGenerationLive = effect(TextGeneration, gen(function* () {
|
|
|
237829
238001
|
})),
|
|
237830
238002
|
cwd: workingDirectory,
|
|
237831
238003
|
shell: process.platform === "win32",
|
|
237832
|
-
stdin: { stream: encodeText(make$
|
|
238004
|
+
stdin: { stream: encodeText(make$42(prompt)) }
|
|
237833
238005
|
}));
|
|
237834
238006
|
});
|
|
237835
238007
|
const cleanup = all([...[
|
|
@@ -238019,7 +238191,7 @@ const ClaudeTextGenerationLive = effect(TextGeneration, gen(function* () {
|
|
|
238019
238191
|
};
|
|
238020
238192
|
const claudeSettings = yield* map$3(serverSettingsService.getSettings, (settings) => settings.providers.claudeAgent).pipe(catch_(() => undefined_));
|
|
238021
238193
|
const rawStdout = yield* fn$1("runClaudeJson.runClaudeCommand")(function* () {
|
|
238022
|
-
const command = make$
|
|
238194
|
+
const command = make$47(claudeSettings?.binaryPath || "claude", [
|
|
238023
238195
|
"-p",
|
|
238024
238196
|
"--output-format",
|
|
238025
238197
|
"json",
|
|
@@ -238033,7 +238205,7 @@ const ClaudeTextGenerationLive = effect(TextGeneration, gen(function* () {
|
|
|
238033
238205
|
], {
|
|
238034
238206
|
cwd,
|
|
238035
238207
|
shell: process.platform === "win32",
|
|
238036
|
-
stdin: { stream: encodeText(make$
|
|
238208
|
+
stdin: { stream: encodeText(make$42(prompt)) }
|
|
238037
238209
|
});
|
|
238038
238210
|
const child = yield* commandSpawner.spawn(command).pipe(mapError((cause) => normalizeCliError("claude", operation, cause, "Failed to spawn Claude CLI process")));
|
|
238039
238211
|
const [stdout, stderr, exitCode] = yield* all([
|
|
@@ -238314,7 +238486,7 @@ const TextGenerationUsageLive = effect(TextGenerationUsage, gen(function* () {
|
|
|
238314
238486
|
//#region ../../packages/shared/src/KeyedCoalescingWorker.ts
|
|
238315
238487
|
const makeKeyedCoalescingWorker = (options) => gen(function* () {
|
|
238316
238488
|
const queue = yield* acquireRelease(unbounded(), shutdown);
|
|
238317
|
-
const stateRef = yield* make$
|
|
238489
|
+
const stateRef = yield* make$30({
|
|
238318
238490
|
latestByKey: /* @__PURE__ */ new Map(),
|
|
238319
238491
|
queuedKeys: /* @__PURE__ */ new Set(),
|
|
238320
238492
|
activeKeys: /* @__PURE__ */ new Set()
|
|
@@ -238874,14 +239046,14 @@ const makeTerminalManagerWithOptions = fn$1("makeTerminalManagerWithOptions")(fu
|
|
|
238874
239046
|
const processKillGraceMs = options.processKillGraceMs ?? DEFAULT_PROCESS_KILL_GRACE_MS;
|
|
238875
239047
|
const maxRetainedInactiveSessions = options.maxRetainedInactiveSessions ?? DEFAULT_MAX_RETAINED_INACTIVE_SESSIONS;
|
|
238876
239048
|
yield* fileSystem.makeDirectory(logsDir, { recursive: true }).pipe(orDie);
|
|
238877
|
-
const managerStateRef = yield* make$
|
|
239049
|
+
const managerStateRef = yield* make$31({
|
|
238878
239050
|
sessions: /* @__PURE__ */ new Map(),
|
|
238879
239051
|
killFibers: /* @__PURE__ */ new Map()
|
|
238880
239052
|
});
|
|
238881
|
-
const threadLocksRef = yield* make$
|
|
239053
|
+
const threadLocksRef = yield* make$31(/* @__PURE__ */ new Map());
|
|
238882
239054
|
const terminalEventListeners = /* @__PURE__ */ new Set();
|
|
238883
239055
|
const transitionReceipts = /* @__PURE__ */ new Map();
|
|
238884
|
-
const workerScope = yield* make$
|
|
239056
|
+
const workerScope = yield* make$36("sequential");
|
|
238885
239057
|
yield* addFinalizer$2(() => close(workerScope, void_$3));
|
|
238886
239058
|
const publishEvent = (event) => gen(function* () {
|
|
238887
239059
|
for (const listener of terminalEventListeners) yield* listener(event).pipe(ignoreCause({ log: true }));
|
|
@@ -238896,7 +239068,7 @@ const makeTerminalManagerWithOptions = fn$1("makeTerminalManagerWithOptions")(fu
|
|
|
238896
239068
|
const modifyManagerState = (f) => modify$2(managerStateRef, f);
|
|
238897
239069
|
const getThreadSemaphore = (threadId) => modifyEffect(threadLocksRef, (current) => {
|
|
238898
239070
|
return match(fromNullishOr(current.get(threadId)), {
|
|
238899
|
-
onNone: () => make$
|
|
239071
|
+
onNone: () => make$43(1).pipe(map$3((semaphore) => {
|
|
238900
239072
|
const next = new Map(current);
|
|
238901
239073
|
next.set(threadId, semaphore);
|
|
238902
239074
|
return [semaphore, next];
|
|
@@ -241784,6 +241956,18 @@ var SpriteTaskHoldManager = class {
|
|
|
241784
241956
|
return [...this.#holds.keys()];
|
|
241785
241957
|
}
|
|
241786
241958
|
/**
|
|
241959
|
+
* Every hold key currently associated with one thread: what `releaseThread`
|
|
241960
|
+
* releases. Read-only and synchronous, so a caller can snapshot what is
|
|
241961
|
+
* live right now and decide later, from that snapshot, what it is still
|
|
241962
|
+
* safe to release -- rather than asking this manager what is live AFTER
|
|
241963
|
+
* some delay of its own, by which point a fresh acquire may have replaced
|
|
241964
|
+
* the very hold the caller meant to release (SpriteTaskHoldReactor's
|
|
241965
|
+
* session.exited handling does exactly this, forge#3602).
|
|
241966
|
+
*/
|
|
241967
|
+
activeTurnIdsForThread(threadId) {
|
|
241968
|
+
return [...this.#holds.entries()].filter(([, hold]) => hold.threadId === threadId).map(([turnId]) => turnId);
|
|
241969
|
+
}
|
|
241970
|
+
/**
|
|
241787
241971
|
* `maxRefreshes` bounds a hold that has no terminal event of its own, such as a launch
|
|
241788
241972
|
* whose turn may never start. When the budget is spent the hold releases itself.
|
|
241789
241973
|
*
|
|
@@ -242059,7 +242243,7 @@ var SpriteTaskHoldManager = class {
|
|
|
242059
242243
|
* from silently dropping the holds of the other turns running beside it.
|
|
242060
242244
|
*/
|
|
242061
242245
|
async releaseThread(threadId) {
|
|
242062
|
-
const turnIds =
|
|
242246
|
+
const turnIds = this.activeTurnIdsForThread(threadId);
|
|
242063
242247
|
await Promise.all(turnIds.map((turnId) => this.release(turnId)));
|
|
242064
242248
|
}
|
|
242065
242249
|
/**
|
|
@@ -287916,7 +288100,7 @@ const GitManagerLive = effect(GitManager, fn$1("makeGitManager")(function* () {
|
|
|
287916
288100
|
preparePullRequestThread,
|
|
287917
288101
|
runStackedAction: fn$1("runStackedAction")(function* (input, options) {
|
|
287918
288102
|
const progress = createProgressEmitter(input, options);
|
|
287919
|
-
const currentPhase = yield* make$
|
|
288103
|
+
const currentPhase = yield* make$49(none$4());
|
|
287920
288104
|
return yield* fn$1("runStackedAction.runAction")(function* () {
|
|
287921
288105
|
const initialStatus = yield* gitCore.statusDetails(input.cwd);
|
|
287922
288106
|
const wantsCommit = isCommitAction(input.action);
|
|
@@ -289857,7 +290041,7 @@ const ApprovedWorkerPlanReactorLive = effect(ApprovedWorkerPlanReactor, gen(func
|
|
|
289857
290041
|
const git = yield* GitCore;
|
|
289858
290042
|
const runPromise = runPromiseWith(yield* context());
|
|
289859
290043
|
const eventState = makeApprovedWorkerPlanEventState();
|
|
289860
|
-
const reconcileSemaphore = yield* make$
|
|
290044
|
+
const reconcileSemaphore = yield* make$43(1);
|
|
289861
290045
|
const dispatch = (command) => runPromise(orchestration.dispatch(command).pipe(asVoid));
|
|
289862
290046
|
const readMasterContext = async (prompt) => {
|
|
289863
290047
|
const thread = getOrNull(await runPromise(readDurableWorkerDetail(projectionSnapshotQuery, ThreadId.make(prompt.masterThreadId))));
|
|
@@ -291133,7 +291317,7 @@ const makeRuntimeDrainReporter = gen(function* () {
|
|
|
291133
291317
|
const providerService = yield* ProviderService;
|
|
291134
291318
|
const serverConfig = yield* ServerConfig;
|
|
291135
291319
|
const spriteTaskHoldReactor = yield* SpriteTaskHoldReactor;
|
|
291136
|
-
const reportSemaphore = yield* make$
|
|
291320
|
+
const reportSemaphore = yield* make$43(1);
|
|
291137
291321
|
let heartbeatSilent = false;
|
|
291138
291322
|
const applyControlPlaneState = (runtime) => drainState.applyControlPlaneState({
|
|
291139
291323
|
draining: runtime.draining,
|
|
@@ -291716,7 +291900,7 @@ function shouldApplyProviderTurnCompleted(activeTurnId, eventTurnId) {
|
|
|
291716
291900
|
const ProviderRuntimeIngestionLive = effect(ProviderRuntimeIngestionService, fn$1("make")(function* () {
|
|
291717
291901
|
const orchestrationEngine = yield* OrchestrationEngineService;
|
|
291718
291902
|
const claudeUsageTelemetry = yield* ClaudeUsageTelemetry;
|
|
291719
|
-
const claudeUsageScope = yield* make$
|
|
291903
|
+
const claudeUsageScope = yield* make$36("parallel");
|
|
291720
291904
|
yield* addFinalizer$2(() => close(claudeUsageScope, void_$3));
|
|
291721
291905
|
const providerService = yield* ProviderService;
|
|
291722
291906
|
const projectionTurnRepository = yield* ProjectionTurnRepository;
|
|
@@ -292355,7 +292539,7 @@ const ClaudeUsageTelemetryLive = effect(ClaudeUsageTelemetry, gen(function* () {
|
|
|
292355
292539
|
*/
|
|
292356
292540
|
const makeDrainableWorker = (process) => gen(function* () {
|
|
292357
292541
|
const queue = yield* acquireRelease(unbounded(), shutdown);
|
|
292358
|
-
const outstanding = yield* make$
|
|
292542
|
+
const outstanding = yield* make$30(0);
|
|
292359
292543
|
yield* take(queue).pipe(tap((a) => ensuring(process(a), update$1(outstanding, (n) => n - 1))), forever$1, forkScoped);
|
|
292360
292544
|
const drain = get$1(outstanding).pipe(tap((n) => n > 0 ? txRetry : void_$1), tx$1);
|
|
292361
292545
|
const enqueue = (element) => offer(queue, element).pipe(tap(() => update$1(outstanding, (n) => n + 1)), tx$1);
|
|
@@ -292506,52 +292690,6 @@ function applyThreadGoalPreamble(goal, input) {
|
|
|
292506
292690
|
return trimmedInput.length > 0 ? `${preamble}\n\n${trimmedInput}` : preamble;
|
|
292507
292691
|
}
|
|
292508
292692
|
//#endregion
|
|
292509
|
-
//#region src/orchestration/providerRetryableFailure.ts
|
|
292510
|
-
/**
|
|
292511
|
-
* Classifies a provider turn-start failure as a retryable rate-limit or
|
|
292512
|
-
* transient-availability failure (429/503), a terminal failure that names why
|
|
292513
|
-
* it will never clear on its own, or unrecognized (null).
|
|
292514
|
-
*
|
|
292515
|
-
* CMMD-Center/forge#3558: a 429 from CMMD's provider egress used to leave no
|
|
292516
|
-
* trace at all, because nothing in the turn-start path recognized it as a
|
|
292517
|
-
* distinct, retryable failure. `ProviderCommandReactor` uses this to decide
|
|
292518
|
-
* whether to retry a turn start with backoff, and to name the provider,
|
|
292519
|
-
* status and Retry-After in the `provider.turn.start.failed` activity CMMD's
|
|
292520
|
-
* watchdog reads once retries are exhausted.
|
|
292521
|
-
*
|
|
292522
|
-
* Reuses `isProviderRateOrQuotaError` (the same predicate the public-copy
|
|
292523
|
-
* sanitizer uses to recognize a rate-limit message) rather than restating its
|
|
292524
|
-
* word list here.
|
|
292525
|
-
*/
|
|
292526
|
-
const SERVICE_UNAVAILABLE_PATTERN = /\b(503|service\s+unavailable)\b/i;
|
|
292527
|
-
const RATE_LIMITED_PAST_TENSE_PATTERN = /\brate[\s-]?limit(?:ed|ing)?\b/i;
|
|
292528
|
-
const QUOTA_OR_USAGE_LIMIT_PATTERN = /\b(usage[ _-]limit|usage_limit_reached|quota|insufficient_quota)\b/i;
|
|
292529
|
-
const EXPLICIT_429_PATTERN = /\b429\b/;
|
|
292530
|
-
const RETRY_AFTER_SECONDS_PATTERN = /retry-after[^0-9]{0,10}(\d+)|(?:try again|retry)\s+in\s+(\d+)\s*(?:s\b|sec(?:onds?)?\b)?/i;
|
|
292531
|
-
function parseRetryAfterSeconds(detail) {
|
|
292532
|
-
const match = detail.match(RETRY_AFTER_SECONDS_PATTERN);
|
|
292533
|
-
if (!match) return null;
|
|
292534
|
-
const raw = match[1] ?? match[2];
|
|
292535
|
-
const seconds = raw ? Number(raw) : NaN;
|
|
292536
|
-
return Number.isFinite(seconds) ? seconds : null;
|
|
292537
|
-
}
|
|
292538
|
-
function classifyRetryableProviderFailure(detail) {
|
|
292539
|
-
if (!detail || detail.trim().length === 0) return null;
|
|
292540
|
-
if (QUOTA_OR_USAGE_LIMIT_PATTERN.test(detail) && !EXPLICIT_429_PATTERN.test(detail)) return {
|
|
292541
|
-
kind: "terminal",
|
|
292542
|
-
reason: "quota",
|
|
292543
|
-
message: detail
|
|
292544
|
-
};
|
|
292545
|
-
const isRateLimited = isProviderRateOrQuotaError(detail) || RATE_LIMITED_PAST_TENSE_PATTERN.test(detail);
|
|
292546
|
-
const isUnavailable = SERVICE_UNAVAILABLE_PATTERN.test(detail);
|
|
292547
|
-
if (!isRateLimited && !isUnavailable) return null;
|
|
292548
|
-
return {
|
|
292549
|
-
kind: "retryable",
|
|
292550
|
-
status: isRateLimited ? 429 : 503,
|
|
292551
|
-
retryAfterSeconds: parseRetryAfterSeconds(detail)
|
|
292552
|
-
};
|
|
292553
|
-
}
|
|
292554
|
-
//#endregion
|
|
292555
292693
|
//#region src/orchestration/Layers/ProviderCommandReactor.ts
|
|
292556
292694
|
function toNonEmptyProviderInput(value) {
|
|
292557
292695
|
const normalized = value?.trim();
|
|
@@ -293148,7 +293286,7 @@ const ProviderCommandReactorLive = effect(ProviderCommandReactor, gen(function*
|
|
|
293148
293286
|
* gap between the ack and this call (review item 1).
|
|
293149
293287
|
*/
|
|
293150
293288
|
const watchTurnStartOutcome = fn$1("watchTurnStartOutcome")(function* (input) {
|
|
293151
|
-
const lastRetrySignal = yield* make$
|
|
293289
|
+
const lastRetrySignal = yield* make$49(null);
|
|
293152
293290
|
const terminalEvent = yield* fromQueue(input.events).pipe(mapEffect$1((event) => gen(function* () {
|
|
293153
293291
|
if (event.type === "runtime.warning") {
|
|
293154
293292
|
const classified = classifyRetryableProviderFailure(event.payload.message);
|
|
@@ -294727,12 +294865,62 @@ const CheckpointReactorLive = effect(CheckpointReactor, gen(function* () {
|
|
|
294727
294865
|
createdAt: input.createdAt
|
|
294728
294866
|
});
|
|
294729
294867
|
});
|
|
294868
|
+
/**
|
|
294869
|
+
* The one durable, deterministic-id activity that records how a turn ended
|
|
294870
|
+
* (CMMD-Center/forge#3562 piece A, CMMD-Center/CMMD#5822): `completed`,
|
|
294871
|
+
* `interrupted` (an abort or a provider cancellation), or `failed` with the
|
|
294872
|
+
* provider's own error message. Recorded here, ahead of every
|
|
294873
|
+
* checkpoint-specific early return below, so it fires for every turn
|
|
294874
|
+
* regardless of whether this workspace can capture a git checkpoint at
|
|
294875
|
+
* all -- unlike a checkpoint, this never depends on `resolveCheckpointCwd`.
|
|
294876
|
+
*
|
|
294877
|
+
* The activity id is derived from the turn id, never `crypto.randomUUID()`,
|
|
294878
|
+
* so a redelivered `turn.completed` for the same turn replaces the same
|
|
294879
|
+
* row rather than adding a second one. The guard below additionally
|
|
294880
|
+
* refuses to touch a turn that already has one: first write wins, so a
|
|
294881
|
+
* later, different signal for the same turn can never overwrite an
|
|
294882
|
+
* outcome CMMD may already have acknowledged.
|
|
294883
|
+
*
|
|
294884
|
+
* Deriving the wire `turn_status` event from a new activity recorded at
|
|
294885
|
+
* the moment the turn actually ends -- not from `thread.latestTurn` or
|
|
294886
|
+
* `thread.checkpoints`, both of which already hold outcomes for turns that
|
|
294887
|
+
* settled before this shipped -- is deliberate: those would insert a brand
|
|
294888
|
+
* new event into history CMMD already acknowledged for every existing
|
|
294889
|
+
* thread, which `RuntimeThreadHistoryConflict` exists specifically to
|
|
294890
|
+
* reject (CMMD-Center/forge#3497). A turn that settled before this shipped
|
|
294891
|
+
* gets no terminal event; only a turn that ends after it does.
|
|
294892
|
+
*/
|
|
294893
|
+
const recordTurnTerminalStatus = fn$1("recordTurnTerminalStatus")(function* (event, thread, turnId) {
|
|
294894
|
+
const activityId = turnTerminalStatusActivityId(turnId);
|
|
294895
|
+
if (thread.activities.some((activity) => activity.id === activityId)) return;
|
|
294896
|
+
const outcome = turnTerminalOutcomeFromRuntimeState(event.payload.state);
|
|
294897
|
+
const recordedAt = (/* @__PURE__ */ new Date()).toISOString();
|
|
294898
|
+
yield* orchestrationEngine.dispatch({
|
|
294899
|
+
type: "thread.activity.append",
|
|
294900
|
+
commandId: serverCommandId$1("turn-terminal-status"),
|
|
294901
|
+
threadId: event.threadId,
|
|
294902
|
+
activity: {
|
|
294903
|
+
id: EventId.make(activityId),
|
|
294904
|
+
tone: outcome === "failed" ? "error" : "info",
|
|
294905
|
+
kind: TURN_TERMINAL_STATUS_ACTIVITY_KIND,
|
|
294906
|
+
summary: `Turn ${outcome}`,
|
|
294907
|
+
payload: {
|
|
294908
|
+
outcome,
|
|
294909
|
+
...outcome === "failed" && event.payload.errorMessage ? { errorMessage: event.payload.errorMessage } : {}
|
|
294910
|
+
},
|
|
294911
|
+
turnId,
|
|
294912
|
+
createdAt: recordedAt
|
|
294913
|
+
},
|
|
294914
|
+
createdAt: recordedAt
|
|
294915
|
+
});
|
|
294916
|
+
});
|
|
294730
294917
|
const captureCheckpointFromTurnCompletion = fn$1("captureCheckpointFromTurnCompletion")(function* (event) {
|
|
294731
294918
|
const turnId = toTurnId(event.turnId);
|
|
294732
294919
|
if (!turnId) return;
|
|
294733
294920
|
const readModel = yield* orchestrationEngine.getReadModel();
|
|
294734
294921
|
const thread = readModel.threads.find((entry) => entry.id === event.threadId);
|
|
294735
294922
|
if (!thread) return;
|
|
294923
|
+
yield* recordTurnTerminalStatus(event, thread, turnId);
|
|
294736
294924
|
if (thread.session?.activeTurnId && !sameId(thread.session.activeTurnId, turnId)) return;
|
|
294737
294925
|
if (thread.checkpoints.some((checkpoint) => checkpoint.turnId === turnId && checkpoint.status !== "missing")) return;
|
|
294738
294926
|
const checkpointCwd = yield* resolveCheckpointCwd({
|
|
@@ -295032,6 +295220,9 @@ const CheckpointReactorLive = effect(CheckpointReactor, gen(function* () {
|
|
|
295032
295220
|
};
|
|
295033
295221
|
}));
|
|
295034
295222
|
//#endregion
|
|
295223
|
+
//#region src/runtimeReplication/Services/RuntimeReplicationThreadFlush.ts
|
|
295224
|
+
var RuntimeReplicationThreadFlush = class extends Service$1()("forge/runtimeReplication/Services/RuntimeReplicationThreadFlush") {};
|
|
295225
|
+
//#endregion
|
|
295035
295226
|
//#region src/orchestration/Layers/SpriteTaskHoldReactor.ts
|
|
295036
295227
|
/**
|
|
295037
295228
|
* Holds the sprite awake for the duration of every agent turn.
|
|
@@ -295047,6 +295238,48 @@ const CheckpointReactorLive = effect(CheckpointReactor, gen(function* () {
|
|
|
295047
295238
|
* `turn.started` / `turn.completed` through `ProviderService.streamEvents`.
|
|
295048
295239
|
*/
|
|
295049
295240
|
/**
|
|
295241
|
+
* Bound for how long a terminal turn event (`turn.completed` / `turn.aborted`)
|
|
295242
|
+
* waits on that thread's pending replication before releasing the sprite's
|
|
295243
|
+
* turn hold anyway (forge#3600). The sprite freezes about a second after the
|
|
295244
|
+
* hold goes, so this is also roughly how much longer a finished turn's sprite
|
|
295245
|
+
* stays billed.
|
|
295246
|
+
*
|
|
295247
|
+
* Justified from the numbers already in this codebase, not a guess: the
|
|
295248
|
+
* outbox drain loop claims and posts on a 2 s tick
|
|
295249
|
+
* (`Schedule.spaced("2 seconds")` in RuntimeReplication.ts), each CMMD publish
|
|
295250
|
+
* attempt has its own 10 s deadline (`RUNTIME_REPLICATION_TIMEOUT_MS` in
|
|
295251
|
+
* RuntimeReplicationClient.ts), and `claim()` orders a thread's inventory row
|
|
295252
|
+
* ahead of its thread-events row, so one tick can mean two requests before the
|
|
295253
|
+
* thread's own batch goes out. 15 s covers one drain tick plus one full
|
|
295254
|
+
* publish attempt with headroom for that second request, while still keeping
|
|
295255
|
+
* a completed turn's sprite from staying billed anywhere near CMMD's own
|
|
295256
|
+
* stalled-turn sweep window (production: about 15 minutes, per forge#3600).
|
|
295257
|
+
*/
|
|
295258
|
+
const REPLICATION_FLUSH_TIMEOUT_MS = 15e3;
|
|
295259
|
+
/**
|
|
295260
|
+
* How often the flush re-checks the thread's outbox row while waiting. Short
|
|
295261
|
+
* enough that the wait tracks CMMD's actual ack latency (typically well under
|
|
295262
|
+
* a second) rather than the bound, long enough that a 15 s wait costs at most
|
|
295263
|
+
* about 60 reads against the outbox table.
|
|
295264
|
+
*/
|
|
295265
|
+
const REPLICATION_FLUSH_POLL_INTERVAL_MS = 250;
|
|
295266
|
+
/**
|
|
295267
|
+
* A single extra wait before trusting a flush's very first "nothing pending"
|
|
295268
|
+
* read (forge#3600 review follow-up). SpriteTaskHoldReactor and
|
|
295269
|
+
* RuntimeReplication's own domain-event-driven enqueue are independent
|
|
295270
|
+
* subscribers of the same ProviderService.streamEvents broadcast: this
|
|
295271
|
+
* reactor can see turn.completed and read the outbox before the OTHER
|
|
295272
|
+
* subscriber has finished projecting the turn's final events into a row. In
|
|
295273
|
+
* both production runs behind forge#3600, the final assistant_message and
|
|
295274
|
+
* turn_usage writes landed about a second apart from each other (00:43:15Z
|
|
295275
|
+
* and 00:43:16Z), so an immediate "nothing pending" read cannot be trusted:
|
|
295276
|
+
* that is exactly the race that stranded both turns. One settle wait,
|
|
295277
|
+
* re-checked once, closes it without turning every genuinely idle turn's
|
|
295278
|
+
* release into a long poll -- a thread that already has nothing to replicate
|
|
295279
|
+
* pays this once, never the full flushTimeoutMs bound.
|
|
295280
|
+
*/
|
|
295281
|
+
const REPLICATION_FLUSH_SETTLE_MS = 1e3;
|
|
295282
|
+
/**
|
|
295050
295283
|
* A launch hold refreshes every 60 s, so this budget is about ten minutes. A launch whose turn
|
|
295051
295284
|
* never starts, because the provider refused it or the process died first, has no event to
|
|
295052
295285
|
* release it. The budget is what stops that hold from keeping the sprite billing.
|
|
@@ -295064,8 +295297,69 @@ const TURN_START_HOLD_MAX_REFRESHES = 10;
|
|
|
295064
295297
|
/** The hold id for `holdTurnStart` / `releaseTurnStart`. Distinct from `launchHoldId` on purpose:
|
|
295065
295298
|
* see the shape's doc comment on `holdTurnStart`. */
|
|
295066
295299
|
const turnStartHoldId = (key) => `turn-start-${key}`;
|
|
295067
|
-
const
|
|
295300
|
+
const makeSpriteTaskHoldReactor = (overrides = {}) => gen(function* () {
|
|
295068
295301
|
const providerService = yield* ProviderService;
|
|
295302
|
+
const replicationOutbox = yield* RuntimeReplicationThreadFlush;
|
|
295303
|
+
const replicationRuntimeId = resolveRuntimeReplicationRuntimeId(yield* ServerConfig);
|
|
295304
|
+
const flushTimeoutMs = overrides.replicationFlushTimeoutMs ?? REPLICATION_FLUSH_TIMEOUT_MS;
|
|
295305
|
+
const flushPollIntervalMs = overrides.replicationFlushPollIntervalMs ?? REPLICATION_FLUSH_POLL_INTERVAL_MS;
|
|
295306
|
+
const flushSettleMs = overrides.replicationFlushSettleMs ?? REPLICATION_FLUSH_SETTLE_MS;
|
|
295307
|
+
/**
|
|
295308
|
+
* Waits for CMMD to acknowledge this thread's outstanding replication -- or
|
|
295309
|
+
* for nothing to have been pending in the first place -- before the caller
|
|
295310
|
+
* releases the turn hold that keeps the sprite awake for the outbox drain
|
|
295311
|
+
* loop to run (forge#3600). Bounded so a wedged publish cannot hold a
|
|
295312
|
+
* finished turn's sprite open indefinitely: the bound firing releases
|
|
295313
|
+
* anyway and logs a warning with however much was still outstanding.
|
|
295314
|
+
*
|
|
295315
|
+
* Never fails: a defect from the outbox read (a SQL error, say) is caught
|
|
295316
|
+
* and treated the same as a timeout -- release the hold rather than let a
|
|
295317
|
+
* replication-read bug strand the sprite awake, or worse, crash the worker
|
|
295318
|
+
* that also has to release every OTHER turn's hold.
|
|
295319
|
+
*/
|
|
295320
|
+
const flushThreadReplication = (threadId) => {
|
|
295321
|
+
if (replicationRuntimeId === void 0) return void_$1;
|
|
295322
|
+
const runtimeId = replicationRuntimeId;
|
|
295323
|
+
const streamKey = `thread:${threadId}`;
|
|
295324
|
+
const startedAt = Date.now();
|
|
295325
|
+
const poll = (phase) => replicationOutbox.readPendingCount({
|
|
295326
|
+
runtimeId,
|
|
295327
|
+
streamKey
|
|
295328
|
+
}).pipe(flatMap((pending) => {
|
|
295329
|
+
if (pending === 0) {
|
|
295330
|
+
if (phase === "initial") return sleep$4(flushSettleMs).pipe(andThen(suspend$1(() => poll("settle-recheck"))));
|
|
295331
|
+
return succeed({
|
|
295332
|
+
outcome: phase === "settle-recheck" ? "nothing_pending" : "delivered",
|
|
295333
|
+
pending,
|
|
295334
|
+
settled: phase === "settle-recheck"
|
|
295335
|
+
});
|
|
295336
|
+
}
|
|
295337
|
+
if (Date.now() - startedAt >= flushTimeoutMs) return succeed({
|
|
295338
|
+
outcome: "timed_out",
|
|
295339
|
+
pending,
|
|
295340
|
+
settled: false
|
|
295341
|
+
});
|
|
295342
|
+
return sleep$4(flushPollIntervalMs).pipe(andThen(suspend$1(() => poll("steady"))));
|
|
295343
|
+
}));
|
|
295344
|
+
return poll("initial").pipe(flatMap(({ outcome, pending, settled }) => {
|
|
295345
|
+
const elapsedMs = Date.now() - startedAt;
|
|
295346
|
+
const logOutcome = logInfo("sprite task hold replication flush", {
|
|
295347
|
+
threadId,
|
|
295348
|
+
outcome,
|
|
295349
|
+
pending,
|
|
295350
|
+
elapsedMs,
|
|
295351
|
+
...settled ? { settledMs: flushSettleMs } : {}
|
|
295352
|
+
});
|
|
295353
|
+
return outcome === "timed_out" ? logOutcome.pipe(andThen(logWarning$1("sprite task hold replication flush timed out; releasing the turn hold anyway", {
|
|
295354
|
+
threadId,
|
|
295355
|
+
pending,
|
|
295356
|
+
elapsedMs
|
|
295357
|
+
}))) : logOutcome;
|
|
295358
|
+
}), catchCause((cause) => logError("sprite task hold replication flush failed; releasing the turn hold anyway", {
|
|
295359
|
+
threadId,
|
|
295360
|
+
cause: pretty(cause)
|
|
295361
|
+
})));
|
|
295362
|
+
};
|
|
295069
295363
|
const manager = makeSpriteTaskHoldManager(process.env, (message, cause) => {
|
|
295070
295364
|
runFork(logWarning$1(message, { cause: cause instanceof Error ? cause.message : cause }));
|
|
295071
295365
|
}, (event) => {
|
|
@@ -295094,61 +295388,111 @@ const SpriteTaskHoldReactorLive = effect(SpriteTaskHoldReactor, gen(function* ()
|
|
|
295094
295388
|
const launchCallers = /* @__PURE__ */ new Map();
|
|
295095
295389
|
const launchGeneration = /* @__PURE__ */ new Map();
|
|
295096
295390
|
const turnLaunchGeneration = /* @__PURE__ */ new Map();
|
|
295391
|
+
const turnHoldGeneration = /* @__PURE__ */ new Map();
|
|
295392
|
+
let nextTurnHoldGeneration = 0;
|
|
295097
295393
|
/**
|
|
295098
|
-
*
|
|
295099
|
-
*
|
|
295100
|
-
*
|
|
295101
|
-
*
|
|
295102
|
-
*
|
|
295103
|
-
*
|
|
295104
|
-
*
|
|
295105
|
-
* release it here when no such newer launch has started since this turn's
|
|
295106
|
-
* own turn.started was processed (CodeRabbit review, forge#3592). A no-op
|
|
295107
|
-
* when this turn's own generation is stale, or when the hold was already
|
|
295108
|
-
* released.
|
|
295394
|
+
* Release a launch hold left over from a turn hand-off that never
|
|
295395
|
+
* confirmed, once the turn it was covering has reached a terminal state
|
|
295396
|
+
* one way or another. `capturedGeneration` must be read from
|
|
295397
|
+
* `turnLaunchGeneration` by the caller before this runs -- see that map's
|
|
295398
|
+
* own doc comment for why the read cannot happen in here. A no-op when
|
|
295399
|
+
* nothing was captured, when a newer launch has since superseded it, or
|
|
295400
|
+
* when the hold was already released.
|
|
295109
295401
|
*/
|
|
295110
|
-
const
|
|
295111
|
-
const capturedGeneration = turnLaunchGeneration.get(turnId);
|
|
295112
|
-
turnLaunchGeneration.delete(turnId);
|
|
295402
|
+
const releaseLingeringLaunchHoldIfCurrent = async (threadId, capturedGeneration) => {
|
|
295113
295403
|
if (manager === null || capturedGeneration === void 0) return;
|
|
295114
295404
|
if (launchGeneration.get(threadId) !== capturedGeneration) return;
|
|
295115
295405
|
await manager.release(launchHoldId(threadId));
|
|
295116
295406
|
};
|
|
295407
|
+
/**
|
|
295408
|
+
* Release a completed or aborted turn's hold, once its thread's pending
|
|
295409
|
+
* replication has flushed (forge#3600). Skips the release entirely once
|
|
295410
|
+
* `turnHoldGeneration` has moved past `expectedGeneration`: see that map's
|
|
295411
|
+
* own doc comment for the reused-turnId race this guards against.
|
|
295412
|
+
*/
|
|
295413
|
+
const processTerminalItem = (item) => flushThreadReplication(item.threadId).pipe(andThen(promise(async () => {
|
|
295414
|
+
if (manager === null) return;
|
|
295415
|
+
if (turnHoldGeneration.get(item.turnId) !== item.expectedGeneration) return;
|
|
295416
|
+
await manager.release(item.turnId);
|
|
295417
|
+
await releaseLingeringLaunchHoldIfCurrent(item.threadId, item.capturedLaunchGeneration);
|
|
295418
|
+
if (turnHoldGeneration.get(item.turnId) === item.expectedGeneration) turnHoldGeneration.delete(item.turnId);
|
|
295419
|
+
})));
|
|
295420
|
+
/**
|
|
295421
|
+
* Release every hold a dead session was covering, once its thread's
|
|
295422
|
+
* pending replication has flushed (#3603 item 1: this used to call
|
|
295423
|
+
* `manager.releaseThread` on the spot, with nothing stopping a provider
|
|
295424
|
+
* process that died right after its own turn from stranding that turn's
|
|
295425
|
+
* final events the same way forge#3600 did for a clean completion).
|
|
295426
|
+
* `turns` and `capturedLaunchGeneration` are snapshotted by the caller at
|
|
295427
|
+
* session.exited time, BEFORE the flush runs: a launch or a turn that
|
|
295428
|
+
* starts on this thread WHILE the flush is running must survive. Reading
|
|
295429
|
+
* "what is live for this thread" only AFTER the flush -- the naive
|
|
295430
|
+
* flush-then-releaseThread shape -- would reopen the exact hand-off gap
|
|
295431
|
+
* forge#3589 already closed once, just moved behind a longer wait.
|
|
295432
|
+
*/
|
|
295433
|
+
const processSessionExited = (item) => flushThreadReplication(item.threadId).pipe(andThen(promise(async () => {
|
|
295434
|
+
if (manager === null) return;
|
|
295435
|
+
await Promise.all(item.turns.filter((turn) => turnHoldGeneration.get(turn.turnId) === turn.expectedGeneration).map(async (turn) => {
|
|
295436
|
+
await manager.release(turn.turnId);
|
|
295437
|
+
if (turnHoldGeneration.get(turn.turnId) === turn.expectedGeneration) turnHoldGeneration.delete(turn.turnId);
|
|
295438
|
+
}));
|
|
295439
|
+
await releaseLingeringLaunchHoldIfCurrent(item.threadId, item.capturedLaunchGeneration);
|
|
295440
|
+
})));
|
|
295117
295441
|
const start = fn$1("start")(function* () {
|
|
295118
295442
|
if (manager === null) return;
|
|
295443
|
+
const terminalFibers = yield* make$50();
|
|
295444
|
+
const onTurnStarted = (turnIdKey, threadId) => {
|
|
295445
|
+
const generation = launchGeneration.get(threadId) ?? 0;
|
|
295446
|
+
turnHoldGeneration.set(turnIdKey, ++nextTurnHoldGeneration);
|
|
295447
|
+
return promise(async () => {
|
|
295448
|
+
const outcome = await manager.acquire(turnIdKey, threadId);
|
|
295449
|
+
launchCallers.delete(threadId);
|
|
295450
|
+
turnLaunchGeneration.set(turnIdKey, generation);
|
|
295451
|
+
if (outcome === "succeeded") await manager.release(launchHoldId(threadId));
|
|
295452
|
+
});
|
|
295453
|
+
};
|
|
295454
|
+
/** Shared by turn.completed and turn.aborted: see the dispatch below for why they are distinct wire events but handled identically. */
|
|
295455
|
+
const onTerminalTurnEvent = (turnIdKey, threadIdKey) => {
|
|
295456
|
+
const capturedLaunchGeneration = turnLaunchGeneration.get(turnIdKey);
|
|
295457
|
+
turnLaunchGeneration.delete(turnIdKey);
|
|
295458
|
+
return run$3(terminalFibers, processTerminalItem({
|
|
295459
|
+
turnId: turnIdKey,
|
|
295460
|
+
threadId: threadIdKey,
|
|
295461
|
+
expectedGeneration: turnHoldGeneration.get(turnIdKey) ?? 0,
|
|
295462
|
+
capturedLaunchGeneration
|
|
295463
|
+
})).pipe(asVoid);
|
|
295464
|
+
};
|
|
295465
|
+
const onSessionExited = (threadId) => {
|
|
295466
|
+
launchCallers.delete(threadId);
|
|
295467
|
+
const launchKey = launchHoldId(threadId);
|
|
295468
|
+
const turns = manager.activeTurnIdsForThread(threadId).filter((turnId) => turnId !== launchKey).map((turnId) => ({
|
|
295469
|
+
turnId,
|
|
295470
|
+
expectedGeneration: turnHoldGeneration.get(turnId) ?? 0
|
|
295471
|
+
}));
|
|
295472
|
+
for (const turn of turns) turnLaunchGeneration.delete(turn.turnId);
|
|
295473
|
+
return run$3(terminalFibers, processSessionExited({
|
|
295474
|
+
threadId,
|
|
295475
|
+
turns,
|
|
295476
|
+
capturedLaunchGeneration: launchGeneration.get(threadId)
|
|
295477
|
+
})).pipe(asVoid);
|
|
295478
|
+
};
|
|
295119
295479
|
yield* forkScoped(runForEach(providerService.streamEvents, (event) => {
|
|
295120
295480
|
if (event.type === "turn.started") {
|
|
295121
295481
|
const turnId = event.turnId;
|
|
295122
295482
|
if (turnId === void 0) return void_$1;
|
|
295123
|
-
|
|
295124
|
-
const generation = launchGeneration.get(threadId) ?? 0;
|
|
295125
|
-
return promise(async () => {
|
|
295126
|
-
const outcome = await manager.acquire(String(turnId), threadId);
|
|
295127
|
-
launchCallers.delete(threadId);
|
|
295128
|
-
turnLaunchGeneration.set(String(turnId), generation);
|
|
295129
|
-
if (outcome === "succeeded") await manager.release(launchHoldId(threadId));
|
|
295130
|
-
});
|
|
295483
|
+
return onTurnStarted(String(turnId), String(event.threadId));
|
|
295131
295484
|
}
|
|
295132
295485
|
if (event.type === "turn.completed") {
|
|
295133
295486
|
const turnId = event.turnId;
|
|
295134
295487
|
if (turnId === void 0) return void_$1;
|
|
295135
|
-
return
|
|
295136
|
-
await manager.release(String(turnId));
|
|
295137
|
-
await releaseLingeringLaunchHold(String(turnId), String(event.threadId));
|
|
295138
|
-
});
|
|
295488
|
+
return onTerminalTurnEvent(String(turnId), String(event.threadId));
|
|
295139
295489
|
}
|
|
295140
295490
|
if (event.type === "turn.aborted") {
|
|
295141
295491
|
const turnId = event.turnId;
|
|
295142
295492
|
if (turnId === void 0) return void_$1;
|
|
295143
|
-
return
|
|
295144
|
-
await manager.release(String(turnId));
|
|
295145
|
-
await releaseLingeringLaunchHold(String(turnId), String(event.threadId));
|
|
295146
|
-
});
|
|
295147
|
-
}
|
|
295148
|
-
if (event.type === "session.exited") {
|
|
295149
|
-
launchCallers.delete(String(event.threadId));
|
|
295150
|
-
return promise(() => manager.releaseThread(String(event.threadId)));
|
|
295493
|
+
return onTerminalTurnEvent(String(turnId), String(event.threadId));
|
|
295151
295494
|
}
|
|
295495
|
+
if (event.type === "session.exited") return onSessionExited(String(event.threadId));
|
|
295152
295496
|
return void_$1;
|
|
295153
295497
|
}));
|
|
295154
295498
|
});
|
|
@@ -295185,7 +295529,8 @@ const SpriteTaskHoldReactorLive = effect(SpriteTaskHoldReactor, gen(function* ()
|
|
|
295185
295529
|
releaseTurnStart,
|
|
295186
295530
|
releaseAll: onManager((taskHolds) => taskHolds.releaseAll())
|
|
295187
295531
|
};
|
|
295188
|
-
})
|
|
295532
|
+
});
|
|
295533
|
+
const SpriteTaskHoldReactorLive = effect(SpriteTaskHoldReactor, makeSpriteTaskHoldReactor());
|
|
295189
295534
|
//#endregion
|
|
295190
295535
|
//#region src/orchestration/Layers/PlanTaskCreationReactor.ts
|
|
295191
295536
|
var PlanMaterializationRequestError = class extends TaggedError("PlanMaterializationRequestError") {};
|
|
@@ -296012,7 +296357,7 @@ const readOpenCodeApiKey = (_settings) => process.env.OPENCODE_API_KEY || proces
|
|
|
296012
296357
|
const runOpenCodeCommand = fn$1("runOpenCodeCommand")(function* (binaryPath, args) {
|
|
296013
296358
|
const useShell = process.platform === "win32";
|
|
296014
296359
|
if (useShell && !isShellSafeCommandPath(binaryPath)) return yield* fail(/* @__PURE__ */ new Error(`Refusing to spawn opencode: \`binaryPath\` contains shell metacharacters that cmd.exe would interpret as additional commands.`));
|
|
296015
|
-
return yield* spawnAndCollect(binaryPath, make$
|
|
296360
|
+
return yield* spawnAndCollect(binaryPath, make$47(binaryPath, [...args], {
|
|
296016
296361
|
shell: useShell,
|
|
296017
296362
|
env: scrubForgeProviderChildEnvSecrets(process.env)
|
|
296018
296363
|
}));
|
|
@@ -296280,7 +296625,7 @@ const ProviderRegistryLive = effect(ProviderRegistry, gen(function* () {
|
|
|
296280
296625
|
provider
|
|
296281
296626
|
})]));
|
|
296282
296627
|
const fallbackByProvider = new Map(fallbackProviders.map((provider) => [provider.provider, provider]));
|
|
296283
|
-
const providersRef = yield* make$
|
|
296628
|
+
const providersRef = yield* make$49(yield* forEach(PROVIDER_CACHE_IDS, (provider) => {
|
|
296284
296629
|
const filePath = cachePathByProvider.get(provider);
|
|
296285
296630
|
const fallbackProvider = fallbackByProvider.get(provider);
|
|
296286
296631
|
return readProviderStatusCache(filePath).pipe(provideService(FileSystem, fileSystem), map$3((cachedProvider) => {
|
|
@@ -297396,7 +297741,7 @@ const makeWorkspaceBulkTransfer = (options = {}) => gen(function* () {
|
|
|
297396
297741
|
const workspacePaths = yield* WorkspacePaths;
|
|
297397
297742
|
const workspaceEntries = yield* WorkspaceEntries;
|
|
297398
297743
|
const fault = options.fault ?? (() => void_$1);
|
|
297399
|
-
const transferLocks = yield* forEach(Array.from({ length: TRANSFER_LOCK_STRIPE_COUNT }), () => make$
|
|
297744
|
+
const transferLocks = yield* forEach(Array.from({ length: TRANSFER_LOCK_STRIPE_COUNT }), () => make$43(1));
|
|
297400
297745
|
const withTransferLock = (transferId, effect) => transferLocks[transferLockStripe(transferId)].withPermit(effect);
|
|
297401
297746
|
const findTransfer = (transferId) => sql`
|
|
297402
297747
|
SELECT transfer_id AS "transferId", workspace_root AS "workspaceRoot",
|
|
@@ -298443,7 +298788,7 @@ const make$3 = /* @__PURE__ */ fnUntraced(function* (options) {
|
|
|
298443
298788
|
excludeLogSpans: options.excludeLogSpans ?? false,
|
|
298444
298789
|
clock: yield* Clock
|
|
298445
298790
|
};
|
|
298446
|
-
return make$
|
|
298791
|
+
return make$32((options) => {
|
|
298447
298792
|
exporter.push(makeLogRecord(options, opts));
|
|
298448
298793
|
});
|
|
298449
298794
|
});
|
|
@@ -298881,7 +299226,7 @@ const make$1 = /* @__PURE__ */ fnUntraced(function* (options) {
|
|
|
298881
299226
|
if (!span.sampled) return;
|
|
298882
299227
|
exporter.push(makeOtlpSpan(span));
|
|
298883
299228
|
}
|
|
298884
|
-
return make$
|
|
299229
|
+
return make$41({
|
|
298885
299230
|
span(options) {
|
|
298886
299231
|
return makeSpan({
|
|
298887
299232
|
...options,
|
|
@@ -299207,8 +299552,8 @@ const makeLocalFileTracer = fn$1("makeLocalFileTracer")(function* (options) {
|
|
|
299207
299552
|
maxFiles: options.maxFiles,
|
|
299208
299553
|
batchWindowMs: options.batchWindowMs
|
|
299209
299554
|
}));
|
|
299210
|
-
const delegate = options.delegate ?? make$
|
|
299211
|
-
return make$
|
|
299555
|
+
const delegate = options.delegate ?? make$41({ span: (spanOptions) => new NativeSpan(spanOptions) });
|
|
299556
|
+
return make$41({
|
|
299212
299557
|
span(spanOptions) {
|
|
299213
299558
|
return new LocalFileSpan(spanOptions, delegate.span(spanOptions), sink.push);
|
|
299214
299559
|
},
|
|
@@ -299332,7 +299677,7 @@ function resolveBuildCommitFromEnv(env) {
|
|
|
299332
299677
|
* environment descriptor down instead of reporting an honest "unknown".
|
|
299333
299678
|
*/
|
|
299334
299679
|
function readBakedBuildCommit() {
|
|
299335
|
-
return "
|
|
299680
|
+
return "c825d8a74e28836b97016dbd8c2abc730841a622";
|
|
299336
299681
|
}
|
|
299337
299682
|
async function resolveServerBuildCommit(input) {
|
|
299338
299683
|
if (isFullCommitSha(input.baked)) return input.baked;
|
|
@@ -299508,7 +299853,7 @@ const ServerEnvironmentLive = effect(ServerEnvironment, fn$1("makeServerEnvironm
|
|
|
299508
299853
|
return yield* decodeUnknownEffect(EnvironmentMetadata)(parsed).pipe(orElseSucceed(() => ({ displayName: null })));
|
|
299509
299854
|
});
|
|
299510
299855
|
const writeMetadata = (metadata) => fileSystem.writeFileString(serverConfig.environmentMetadataPath, `${JSON.stringify(metadata, null, 2)}\n`);
|
|
299511
|
-
const displayNameOverrideRef = yield* make$
|
|
299856
|
+
const displayNameOverrideRef = yield* make$49(normalizeDisplayName((yield* readMetadata).displayName ?? null));
|
|
299512
299857
|
const posthog = yield* PosthogPublicConfig.asEffect();
|
|
299513
299858
|
const buildCommit = yield* promise(() => resolveServerBuildCommit({
|
|
299514
299859
|
baked: readBakedBuildCommit(),
|
|
@@ -301115,7 +301460,7 @@ const internalBootstrapCredentialError = (message, cause) => new BootstrapCreden
|
|
|
301115
301460
|
const BootstrapCredentialServiceLive = effect(BootstrapCredentialService, gen(function* () {
|
|
301116
301461
|
const config = yield* ServerConfig;
|
|
301117
301462
|
const pairingLinks = yield* AuthPairingLinkRepository;
|
|
301118
|
-
const seededGrantsRef = yield* make$
|
|
301463
|
+
const seededGrantsRef = yield* make$49(/* @__PURE__ */ new Map());
|
|
301119
301464
|
const changesPubSub = yield* unbounded$1();
|
|
301120
301465
|
const seedGrant = (credential, grant) => update$4(seededGrantsRef, (current) => {
|
|
301121
301466
|
const next = new Map(current);
|
|
@@ -301586,7 +301931,7 @@ const SessionCredentialServiceLive = effect(SessionCredentialService, gen(functi
|
|
|
301586
301931
|
if (serverConfig.forgeCloudShellMode === true && configuredSigningKey === null) return yield* die$1(/* @__PURE__ */ new Error("FORGE_SESSION_SIGNING_KEY must decode to at least 32 bytes in cloud-shell mode. Forge Cloud refuses to issue restart-unsafe or replica-local sessions."));
|
|
301587
301932
|
const signingSecret = configuredSigningKey ?? (yield* secretStore.getOrCreateRandom(SIGNING_SECRET_NAME, 32));
|
|
301588
301933
|
const statelessCookieSessions = configuredSigningKey !== null;
|
|
301589
|
-
const connectedSessionsRef = yield* make$
|
|
301934
|
+
const connectedSessionsRef = yield* make$49(/* @__PURE__ */ new Map());
|
|
301590
301935
|
const changesPubSub = yield* unbounded$1();
|
|
301591
301936
|
const cookieName = resolveSessionCookieName({
|
|
301592
301937
|
mode: serverConfig.mode,
|
|
@@ -302095,7 +302440,7 @@ function verifyForgeCloudOwnerCallbackAssertion(assertion, config) {
|
|
|
302095
302440
|
}));
|
|
302096
302441
|
const verifier = assertionVerifierConfig(config);
|
|
302097
302442
|
const verified = verifier ? verifyAssertion(assertion, verifier) : null;
|
|
302098
|
-
const expiresAt = verified ? make$
|
|
302443
|
+
const expiresAt = verified ? make$37(verified.expiresAtMilliseconds) : none$4();
|
|
302099
302444
|
if (!verified || isNone(expiresAt)) return fail(new AuthError({
|
|
302100
302445
|
message: "Invalid Forge Cloud owner assertion.",
|
|
302101
302446
|
status: 401
|
|
@@ -304497,7 +304842,7 @@ const OrchestrationEngineLive = effect(OrchestrationEngineService, gen(function*
|
|
|
304497
304842
|
const getReadModel = () => sync$1(() => readModel);
|
|
304498
304843
|
const readEvents = (fromSequenceExclusive) => eventStore.readFromSequence(fromSequenceExclusive);
|
|
304499
304844
|
const dispatch = (command) => gen(function* () {
|
|
304500
|
-
const result = yield* make$
|
|
304845
|
+
const result = yield* make$38();
|
|
304501
304846
|
yield* offer$1(commandQueue, {
|
|
304502
304847
|
command,
|
|
304503
304848
|
result,
|
|
@@ -313708,7 +314053,7 @@ const RuntimeReplicationLive = effect(RuntimeReplication, gen(function* () {
|
|
|
313708
314053
|
const terminal = yield* serviceOption(TerminalManager);
|
|
313709
314054
|
const activeHourMeter = yield* ActiveHourMeter;
|
|
313710
314055
|
const runtimeId = resolveRuntimeReplicationRuntimeId(config);
|
|
313711
|
-
const outboxWarningActive = yield* make$
|
|
314056
|
+
const outboxWarningActive = yield* make$49(false);
|
|
313712
314057
|
const enqueueInventoryPayload = (payload) => runtimeId ? outbox.enqueue({
|
|
313713
314058
|
runtimeId,
|
|
313714
314059
|
streamKey: "inventory",
|
|
@@ -314899,6 +315244,36 @@ const RuntimeReplicationOutboxLive = effect(RuntimeReplicationOutbox, gen(functi
|
|
|
314899
315244
|
getDiagnostics
|
|
314900
315245
|
});
|
|
314901
315246
|
}));
|
|
315247
|
+
//#endregion
|
|
315248
|
+
//#region src/runtimeReplication/Layers/RuntimeReplicationThreadFlush.ts
|
|
315249
|
+
/**
|
|
315250
|
+
* A thread's outbox row holds its whole unacknowledged batch as one
|
|
315251
|
+
* `{ events: [...] }` payload -- RuntimeReplicationOutbox upserts by
|
|
315252
|
+
* `(runtime_id, stream_key)`, so there is at most one row per thread -- so the
|
|
315253
|
+
* count is that array's length. A row whose payload does not decode that way
|
|
315254
|
+
* (a blocked THREAD_STREAM_LOCAL_HISTORY_CONFLICT placeholder, for instance)
|
|
315255
|
+
* still represents one undelivered publication, so it counts as 1 rather than
|
|
315256
|
+
* 0: a caller bounding a wait on this number must never read a blocked row as
|
|
315257
|
+
* "nothing pending".
|
|
315258
|
+
*/
|
|
315259
|
+
function pendingEventCount(payloadJson) {
|
|
315260
|
+
try {
|
|
315261
|
+
const parsed = JSON.parse(payloadJson);
|
|
315262
|
+
if (Array.isArray(parsed.events)) return parsed.events.length;
|
|
315263
|
+
} catch {}
|
|
315264
|
+
return 1;
|
|
315265
|
+
}
|
|
315266
|
+
const RuntimeReplicationThreadFlushLive = effect(RuntimeReplicationThreadFlush, gen(function* () {
|
|
315267
|
+
const sql = yield* SqlClient;
|
|
315268
|
+
const readPendingCount = (input) => sql`
|
|
315269
|
+
SELECT payload_json AS "payloadJson" FROM runtime_replication_outbox
|
|
315270
|
+
WHERE runtime_id = ${input.runtimeId} AND stream_key = ${input.streamKey}
|
|
315271
|
+
`.pipe(map$3((rows) => {
|
|
315272
|
+
const row = rows[0];
|
|
315273
|
+
return row === void 0 ? 0 : pendingEventCount(row.payloadJson);
|
|
315274
|
+
}), orDie);
|
|
315275
|
+
return RuntimeReplicationThreadFlush.of({ readPendingCount });
|
|
315276
|
+
}));
|
|
314902
315277
|
/**
|
|
314903
315278
|
* Gates guest-side Active Hour measurement (FOR-32642). Shadow-only: even
|
|
314904
315279
|
* with this on, whether a reported interval is also recorded against the
|
|
@@ -314931,7 +315306,7 @@ const isActiveHourMeteringEnabled = gen(function* () {
|
|
|
314931
315306
|
}).pipe(catch_(() => succeed(false)));
|
|
314932
315307
|
const ActiveHourMeterLive = effect(ActiveHourMeter, gen(function* () {
|
|
314933
315308
|
const outbox = yield* RuntimeReplicationOutbox;
|
|
314934
|
-
const statesByRuntime = yield* make$
|
|
315309
|
+
const statesByRuntime = yield* make$49(/* @__PURE__ */ new Map());
|
|
314935
315310
|
const markAwake = (runtimeId) => gen(function* () {
|
|
314936
315311
|
if (!(yield* isActiveHourMeteringEnabled)) return;
|
|
314937
315312
|
yield* update$4(statesByRuntime, (states) => {
|
|
@@ -316960,7 +317335,7 @@ const PipelineRunCoordinatorLive = effect(PipelineRunCoordinator, gen(function*
|
|
|
316960
317335
|
const providerAuthorityInstallations = /* @__PURE__ */ new Map();
|
|
316961
317336
|
const providerAuthorityPublications = /* @__PURE__ */ new Map();
|
|
316962
317337
|
const preparedHandoffs = /* @__PURE__ */ new WeakMap();
|
|
316963
|
-
const authorityCleanupScope = yield* make$
|
|
317338
|
+
const authorityCleanupScope = yield* make$36("parallel");
|
|
316964
317339
|
yield* addFinalizer$2(() => close(authorityCleanupScope, void_$3));
|
|
316965
317340
|
const retryAuthoritySecretCleanup = (work, cause) => {
|
|
316966
317341
|
const now = /* @__PURE__ */ new Date();
|
|
@@ -317336,12 +317711,12 @@ const PipelineRunCoordinatorLive = effect(PipelineRunCoordinator, gen(function*
|
|
|
317336
317711
|
if (!preparedHandoffMatchesRun(preparedHandoff, input.runId)) return yield* coordinatorError("registerHandoff", "PIPELINE_HANDOFF_PREPARATION_INVALID", "The pipeline handoff preparation is missing, belongs to another run, or was already consumed.");
|
|
317337
317712
|
preparedHandoffs.delete(input.preparedHandoff);
|
|
317338
317713
|
const ownedProviderAuthorityInstallations = /* @__PURE__ */ new Set();
|
|
317339
|
-
const preparedAuthorityRef = yield* make$
|
|
317714
|
+
const preparedAuthorityRef = yield* make$49({
|
|
317340
317715
|
authority: preparedHandoff.authority,
|
|
317341
317716
|
preparation: preparedHandoff.providerAuthorityPreparation
|
|
317342
317717
|
});
|
|
317343
|
-
const acceptingHeartbeatRef = yield* make$
|
|
317344
|
-
const heartbeatPublicationSemaphore = yield* make$
|
|
317718
|
+
const acceptingHeartbeatRef = yield* make$49(true);
|
|
317719
|
+
const heartbeatPublicationSemaphore = yield* make$43(1);
|
|
317345
317720
|
if ((yield* store.getByRunId(input.runId)) !== null) return yield* coordinatorError("registerHandoff", "PIPELINE_HANDOFF_ALREADY_BOUND", "The CMMD run already has a Forge task thread and must use the authority rebind contract.");
|
|
317346
317721
|
const snapshot = preparedHandoff.snapshot;
|
|
317347
317722
|
const readModel = yield* orchestration.getReadModel();
|
|
@@ -321223,7 +321598,7 @@ function makeProjectLeadSchedulerLive(options = {}) {
|
|
|
321223
321598
|
return effect(ProjectLeadScheduler, gen(function* () {
|
|
321224
321599
|
const client = yield* ProjectLeadControllerClient;
|
|
321225
321600
|
const dispatcher = yield* ProjectLeadReservationDispatcher;
|
|
321226
|
-
const semaphore = yield* make$
|
|
321601
|
+
const semaphore = yield* make$43(1);
|
|
321227
321602
|
const leaseSeconds = options.leaseSeconds ?? DEFAULT_LEASE_SECONDS;
|
|
321228
321603
|
const batchSize = options.batchSize ?? DEFAULT_BATCH_SIZE;
|
|
321229
321604
|
const projectLimit = options.projectLimit ?? DEFAULT_PROJECT_LIMIT;
|
|
@@ -322188,14 +322563,14 @@ const AgentProtocolReactorLive = effect(AgentProtocolReactor, gen(function* () {
|
|
|
322188
322563
|
const PRUNE_GRACE_MS = 6e4;
|
|
322189
322564
|
const makeUserSlot = gen(function* () {
|
|
322190
322565
|
return {
|
|
322191
|
-
snapshotRef: yield* make$
|
|
322566
|
+
snapshotRef: yield* make$49(null),
|
|
322192
322567
|
pubsub: yield* unbounded$1(),
|
|
322193
|
-
subscriberCountRef: yield* make$
|
|
322568
|
+
subscriberCountRef: yield* make$49(0)
|
|
322194
322569
|
};
|
|
322195
322570
|
});
|
|
322196
322571
|
const WorkspaceReadinessStateLive = effect(WorkspaceReadinessState, gen(function* () {
|
|
322197
|
-
const slotsRef = yield* make$
|
|
322198
|
-
const pruneScope = yield* make$
|
|
322572
|
+
const slotsRef = yield* make$31(/* @__PURE__ */ new Map());
|
|
322573
|
+
const pruneScope = yield* make$36("sequential");
|
|
322199
322574
|
yield* addFinalizer$2(() => close(pruneScope, void_$3));
|
|
322200
322575
|
/**
|
|
322201
322576
|
* Atomically get-or-create the slot for `userId`. The Synchronized wrapper
|
|
@@ -323256,8 +323631,8 @@ const PtyAdapterLive = unwrap(gen(function* () {
|
|
|
323256
323631
|
}));
|
|
323257
323632
|
const HttpServerLive = unwrap(gen(function* () {
|
|
323258
323633
|
const config = yield* ServerConfig;
|
|
323259
|
-
if (typeof Bun !== "undefined") return (yield* promise(() => import("./BunHttpServer-
|
|
323260
|
-
const [NodeHttpServer, NodeHttp] = yield* all([promise(() => import("./NodeHttpServer-
|
|
323634
|
+
if (typeof Bun !== "undefined") return (yield* promise(() => import("./BunHttpServer-o7ISooSQ.mjs"))).layer(bunHttpServerOptions(config));
|
|
323635
|
+
const [NodeHttpServer, NodeHttp] = yield* all([promise(() => import("./NodeHttpServer-BngJqAIT.mjs")), promise(() => import("node:http"))]);
|
|
323261
323636
|
return NodeHttpServer.layer(NodeHttp.createServer, {
|
|
323262
323637
|
host: config.host,
|
|
323263
323638
|
port: config.port
|
|
@@ -323272,7 +323647,7 @@ const PlatformServicesLive = unwrap(gen(function* () {
|
|
|
323272
323647
|
return layer;
|
|
323273
323648
|
}
|
|
323274
323649
|
}));
|
|
323275
|
-
const RuntimeReplicationLayerLive = RuntimeReplicationLive.pipe(provideMerge(RuntimeReplicationClientLive), provideMerge(RuntimeReplicationOutboxLive), provideMerge(ActiveHourMeterLive.pipe(provide$1(RuntimeReplicationOutboxLive))));
|
|
323650
|
+
const RuntimeReplicationLayerLive = RuntimeReplicationLive.pipe(provideMerge(RuntimeReplicationClientLive), provideMerge(RuntimeReplicationOutboxLive), provideMerge(RuntimeReplicationThreadFlushLive), provideMerge(ActiveHourMeterLive.pipe(provide$1(RuntimeReplicationOutboxLive))));
|
|
323276
323651
|
const RuntimeDrainLayerLive = RuntimeDrainReporterLive.pipe(provideMerge(RuntimeDrainStateLive));
|
|
323277
323652
|
const RuntimeAwareProviderReactorsLive = mergeAll(ProviderRuntimeIngestionLive, ProviderCommandReactorLive).pipe(provide$1(RuntimeDrainLayerLive), provideMerge(RuntimeDrainStateLive), provide$1(ClaudeUsageTelemetryLive));
|
|
323278
323653
|
const PipelineWorkerCoordinatorLayerLive = PipelineWorkerCoordinatorLive.pipe(provideMerge(PipelineRunClientLive));
|
|
@@ -324045,7 +324420,7 @@ const tokenOnlyFlag = boolean$2("token-only").pipe(withDescription$2("Print only
|
|
|
324045
324420
|
* it stays least-privilege unless the operator asks otherwise.
|
|
324046
324421
|
*/
|
|
324047
324422
|
const pairingRoleFlag = choice("role", ["owner", "client"]).pipe(withDescription$2("Role for the issued pairing token."), withDefault("client"));
|
|
324048
|
-
const pairingCreateCommand = make$
|
|
324423
|
+
const pairingCreateCommand = make$33("create", {
|
|
324049
324424
|
...authLocationFlags,
|
|
324050
324425
|
ttl: ttlFlag,
|
|
324051
324426
|
role: pairingRoleFlag,
|
|
@@ -324063,24 +324438,24 @@ const pairingCreateCommand = make$34("create", {
|
|
|
324063
324438
|
...isSome(flags.baseUrl) ? { baseUrl: flags.baseUrl.value } : {}
|
|
324064
324439
|
}));
|
|
324065
324440
|
}), { quietLogs: flags.json })));
|
|
324066
|
-
const pairingListCommand = make$
|
|
324441
|
+
const pairingListCommand = make$33("list", {
|
|
324067
324442
|
...authLocationFlags,
|
|
324068
324443
|
json: jsonFlag
|
|
324069
324444
|
}).pipe(withDescription$1("List active client pairing tokens without revealing their secrets."), withHandler((flags) => runWithAuthControlPlane(flags, (authControlPlane) => gen(function* () {
|
|
324070
324445
|
yield* log$3(formatPairingCredentialList(yield* authControlPlane.listPairingLinks({ role: "client" }), { json: flags.json }));
|
|
324071
324446
|
}), { quietLogs: flags.json })));
|
|
324072
|
-
const pairingRevokeCommand = make$
|
|
324447
|
+
const pairingRevokeCommand = make$33("revoke", {
|
|
324073
324448
|
...authLocationFlags,
|
|
324074
324449
|
id: string$4("id").pipe(withDescription$3("Pairing credential id to revoke."))
|
|
324075
324450
|
}).pipe(withDescription$1("Revoke an active client pairing token."), withHandler((flags) => runWithAuthControlPlane(flags, (authControlPlane) => gen(function* () {
|
|
324076
324451
|
yield* log$3((yield* authControlPlane.revokePairingLink(flags.id)) ? `Revoked pairing credential ${flags.id}.\n` : `No active pairing credential found for ${flags.id}.\n`);
|
|
324077
324452
|
}))));
|
|
324078
|
-
const pairingCommand = make$
|
|
324453
|
+
const pairingCommand = make$33("pairing").pipe(withDescription$1("Manage one-time client pairing tokens."), withSubcommands([
|
|
324079
324454
|
pairingCreateCommand,
|
|
324080
324455
|
pairingListCommand,
|
|
324081
324456
|
pairingRevokeCommand
|
|
324082
324457
|
]));
|
|
324083
|
-
const sessionIssueCommand = make$
|
|
324458
|
+
const sessionIssueCommand = make$33("issue", {
|
|
324084
324459
|
...authLocationFlags,
|
|
324085
324460
|
ttl: ttlFlag,
|
|
324086
324461
|
role: sessionRoleFlag,
|
|
@@ -324099,25 +324474,25 @@ const sessionIssueCommand = make$34("issue", {
|
|
|
324099
324474
|
tokenOnly: flags.tokenOnly
|
|
324100
324475
|
}));
|
|
324101
324476
|
}), { quietLogs: flags.json || flags.tokenOnly })));
|
|
324102
|
-
const sessionListCommand = make$
|
|
324477
|
+
const sessionListCommand = make$33("list", {
|
|
324103
324478
|
...authLocationFlags,
|
|
324104
324479
|
json: jsonFlag
|
|
324105
324480
|
}).pipe(withDescription$1("List active sessions without revealing bearer tokens."), withHandler((flags) => runWithAuthControlPlane(flags, (authControlPlane) => gen(function* () {
|
|
324106
324481
|
yield* log$3(formatSessionList(yield* authControlPlane.listSessions(), { json: flags.json }));
|
|
324107
324482
|
}), { quietLogs: flags.json })));
|
|
324108
|
-
const sessionRevokeCommand = make$
|
|
324483
|
+
const sessionRevokeCommand = make$33("revoke", {
|
|
324109
324484
|
...authLocationFlags,
|
|
324110
324485
|
sessionId: string$4("session-id").pipe(withDescription$3("Session id to revoke."), withSchema$1(AuthSessionId))
|
|
324111
324486
|
}).pipe(withDescription$1("Revoke an active session."), withHandler((flags) => runWithAuthControlPlane(flags, (authControlPlane) => gen(function* () {
|
|
324112
324487
|
yield* log$3((yield* authControlPlane.revokeSession(flags.sessionId)) ? `Revoked session ${flags.sessionId}.\n` : `No active session found for ${flags.sessionId}.\n`);
|
|
324113
324488
|
}))));
|
|
324114
|
-
const sessionCommand = make$
|
|
324489
|
+
const sessionCommand = make$33("session").pipe(withDescription$1("Manage bearer sessions."), withSubcommands([
|
|
324115
324490
|
sessionIssueCommand,
|
|
324116
324491
|
sessionListCommand,
|
|
324117
324492
|
sessionRevokeCommand
|
|
324118
324493
|
]));
|
|
324119
|
-
const authCommand = make$
|
|
324120
|
-
const projectAddCommand = make$
|
|
324494
|
+
const authCommand = make$33("auth").pipe(withDescription$1("Manage the local auth control plane for headless deployments."), withSubcommands([pairingCommand, sessionCommand]));
|
|
324495
|
+
const projectAddCommand = make$33("add", {
|
|
324121
324496
|
...projectLocationFlags,
|
|
324122
324497
|
workspaceRoot: string$4("path").pipe(withDescription$3("Workspace root to add as a project.")),
|
|
324123
324498
|
title: string$3("title").pipe(withDescription$2("Optional project title."), optional$1)
|
|
@@ -324137,7 +324512,7 @@ const projectAddCommand = make$34("add", {
|
|
|
324137
324512
|
});
|
|
324138
324513
|
return `Added project ${projectId} (${title}) at ${workspaceRoot}.`;
|
|
324139
324514
|
}))));
|
|
324140
|
-
const projectRemoveCommand = make$
|
|
324515
|
+
const projectRemoveCommand = make$33("remove", {
|
|
324141
324516
|
...projectLocationFlags,
|
|
324142
324517
|
project: string$4("project").pipe(withDescription$3("Project id or workspace root to remove."))
|
|
324143
324518
|
}).pipe(withDescription$1("Remove a project."), withHandler((flags) => runProjectMutation(flags, fn$1("projectRemoveMutation")(function* ({ snapshot, dispatch }) {
|
|
@@ -324152,7 +324527,7 @@ const projectRemoveCommand = make$34("remove", {
|
|
|
324152
324527
|
});
|
|
324153
324528
|
return `Removed project ${project.id} (${project.title}).`;
|
|
324154
324529
|
}))));
|
|
324155
|
-
const projectRenameCommand = make$
|
|
324530
|
+
const projectRenameCommand = make$33("rename", {
|
|
324156
324531
|
...projectLocationFlags,
|
|
324157
324532
|
project: string$4("project").pipe(withDescription$3("Project id or workspace root to rename.")),
|
|
324158
324533
|
title: string$4("title").pipe(withDescription$3("New project title."))
|
|
@@ -324175,12 +324550,12 @@ const parseCmmdProjectId = (value) => {
|
|
|
324175
324550
|
const projectId = Number(value);
|
|
324176
324551
|
return Number.isSafeInteger(projectId) && projectId > 0 ? succeed(projectId) : fail(/* @__PURE__ */ new Error(`Invalid CMMD project id '${value}'. Expected a positive integer.`));
|
|
324177
324552
|
};
|
|
324178
|
-
const projectLeadExplainCommand = make$
|
|
324553
|
+
const projectLeadExplainCommand = make$33("explain", {
|
|
324179
324554
|
...projectLocationFlags,
|
|
324180
324555
|
projectId: string$4("project-id").pipe(withDescription$3("Numeric CMMD project id.")),
|
|
324181
324556
|
json: jsonFlag
|
|
324182
324557
|
}).pipe(withDescription$1("Explain canonical Project Lead controller state."), withHandler((flags) => parseCmmdProjectId(flags.projectId).pipe(flatMap((projectId) => runProjectLeadQuery(flags, projectId, (explanation) => flags.json ? JSON.stringify(explanation, null, 2) : formatProjectLeadExplanation(projectId, explanation))))));
|
|
324183
|
-
const projectLeadDoctorCommand = make$
|
|
324558
|
+
const projectLeadDoctorCommand = make$33("doctor", {
|
|
324184
324559
|
...projectLocationFlags,
|
|
324185
324560
|
projectId: string$4("project-id").pipe(withDescription$3("Numeric CMMD project id.")),
|
|
324186
324561
|
json: jsonFlag
|
|
@@ -324188,7 +324563,7 @@ const projectLeadDoctorCommand = make$34("doctor", {
|
|
|
324188
324563
|
const report = diagnoseProjectLead(projectId, explanation);
|
|
324189
324564
|
return flags.json ? JSON.stringify(report, null, 2) : formatProjectLeadDoctor(report);
|
|
324190
324565
|
})))));
|
|
324191
|
-
const projectLeadCommand = make$
|
|
324566
|
+
const projectLeadCommand = make$33("lead").pipe(withDescription$1("Inspect the CMMD-owned Project Lead controller."), withSubcommands([projectLeadExplainCommand, projectLeadDoctorCommand]));
|
|
324192
324567
|
const connectStatePathFor = fn$1("connectStatePathFor")(function* (flags) {
|
|
324193
324568
|
const config = yield* resolveCliAuthConfig(flags, yield* LogLevel);
|
|
324194
324569
|
return (yield* Path$2).join(config.stateDir, "connect.json");
|
|
@@ -324201,18 +324576,18 @@ const runConnectCommand = (flags, update) => gen(function* () {
|
|
|
324201
324576
|
const state = next ?? current;
|
|
324202
324577
|
yield* log$3(flags.json ? JSON.stringify(state, null, 2) : formatConnectStatus(state));
|
|
324203
324578
|
});
|
|
324204
|
-
const connectStatusCommand = make$
|
|
324579
|
+
const connectStatusCommand = make$33("status", {
|
|
324205
324580
|
...projectLocationFlags,
|
|
324206
324581
|
json: jsonFlag
|
|
324207
324582
|
}).pipe(withDescription$1("Show whether this machine is offered to CMMD over the relay."), withHandler((flags) => runConnectCommand(flags, () => null)));
|
|
324208
|
-
const connectLinkCommand = make$
|
|
324583
|
+
const connectLinkCommand = make$33("link", {
|
|
324209
324584
|
...projectLocationFlags,
|
|
324210
324585
|
json: jsonFlag
|
|
324211
324586
|
}).pipe(withDescription$1("Offer this machine to CMMD over the relay on the next start."), withHandler((flags) => runConnectCommand(flags, (current) => ({
|
|
324212
324587
|
...current,
|
|
324213
324588
|
linked: true
|
|
324214
324589
|
}))));
|
|
324215
|
-
const connectUnlinkCommand = make$
|
|
324590
|
+
const connectUnlinkCommand = make$33("unlink", {
|
|
324216
324591
|
...projectLocationFlags,
|
|
324217
324592
|
json: jsonFlag
|
|
324218
324593
|
}).pipe(withDescription$1("Stop offering this machine, keeping its runtime identity so relinking is the same device."), withHandler((flags) => runConnectCommand(flags, (current) => ({
|
|
@@ -324223,7 +324598,7 @@ const noBrowserLoginFlag = boolean$2("no-browser").pipe(withDescription$2("Print
|
|
|
324223
324598
|
const CONNECT_CLI_CLIENT_ID = "cmmd-forge-web";
|
|
324224
324599
|
const connectSecretsFor = (stateDir) => createFileSecretStorage({ keyPath: Path$1.join(stateDir, "connect-secret.key") });
|
|
324225
324600
|
const loginEmailFlag = string$3("email").pipe(withDescription$2("Sign in with this CMMD email and a password prompt instead of the browser flow."), optional$1);
|
|
324226
|
-
const connectLoginCommand = make$
|
|
324601
|
+
const connectLoginCommand = make$33("login", {
|
|
324227
324602
|
...projectLocationFlags,
|
|
324228
324603
|
noBrowser: noBrowserLoginFlag,
|
|
324229
324604
|
email: loginEmailFlag
|
|
@@ -324290,7 +324665,7 @@ const connectLoginCommand = make$34("login", {
|
|
|
324290
324665
|
});
|
|
324291
324666
|
yield* log$3("Signed in to CMMD. Run `cmmd-forge connect link` to offer this machine.");
|
|
324292
324667
|
})));
|
|
324293
|
-
const connectLogoutCommand = make$
|
|
324668
|
+
const connectLogoutCommand = make$33("logout", { ...projectLocationFlags }).pipe(withDescription$1("Sign this machine out of CMMD and stop offering it."), withHandler((flags) => gen(function* () {
|
|
324294
324669
|
const config = yield* resolveCliAuthConfig(flags, yield* LogLevel);
|
|
324295
324670
|
const statePath = Path$1.join(config.stateDir, "connect.json");
|
|
324296
324671
|
writeConnectState(statePath, {
|
|
@@ -324300,14 +324675,14 @@ const connectLogoutCommand = make$34("logout", { ...projectLocationFlags }).pipe
|
|
|
324300
324675
|
clearConnectCredential(Path$1.join(config.stateDir, "connect-credential.json"));
|
|
324301
324676
|
yield* log$3("Signed out of CMMD and stopped offering this machine.");
|
|
324302
324677
|
})));
|
|
324303
|
-
const connectCommand = make$
|
|
324678
|
+
const connectCommand = make$33("connect").pipe(withDescription$1("Offer this machine to CMMD so other surfaces can reach it."), withSubcommands([
|
|
324304
324679
|
connectStatusCommand,
|
|
324305
324680
|
connectLoginCommand,
|
|
324306
324681
|
connectLogoutCommand,
|
|
324307
324682
|
connectLinkCommand,
|
|
324308
324683
|
connectUnlinkCommand
|
|
324309
324684
|
]));
|
|
324310
|
-
const projectCommand = make$
|
|
324685
|
+
const projectCommand = make$33("project").pipe(withDescription$1("Manage projects."), withSubcommands([
|
|
324311
324686
|
projectAddCommand,
|
|
324312
324687
|
projectRemoveCommand,
|
|
324313
324688
|
projectRenameCommand,
|
|
@@ -324322,12 +324697,12 @@ const runServerCommand = (flags, options) => gen(function* () {
|
|
|
324322
324697
|
});
|
|
324323
324698
|
return yield* runServer.pipe(provideService(ServerConfig, config));
|
|
324324
324699
|
});
|
|
324325
|
-
const startCommand = make$
|
|
324326
|
-
const serveCommand = make$
|
|
324700
|
+
const startCommand = make$33("start", { ...sharedServerCommandFlags }).pipe(withDescription$1("Run the Forge server."), withHandler((flags) => runServerCommand(flags)));
|
|
324701
|
+
const serveCommand = make$33("serve", { ...sharedServerCommandFlags }).pipe(withDescription$1("Run the Forge server without opening a browser and print headless pairing details."), withHandler((flags) => runServerCommand(flags, {
|
|
324327
324702
|
startupPresentation: "headless",
|
|
324328
324703
|
forceAutoBootstrapProjectFromCwd: false
|
|
324329
324704
|
})));
|
|
324330
|
-
const cli = make$
|
|
324705
|
+
const cli = make$33("cmmd-forge", { ...sharedServerCommandFlags }).pipe(withDescription$1("Run the Forge server."), withHandler((flags) => runServerCommand(flags)), withSubcommands([
|
|
324331
324706
|
startCommand,
|
|
324332
324707
|
serveCommand,
|
|
324333
324708
|
authCommand,
|