alink-cli 0.8.10 → 0.9.0
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/{Config-Bj2ZPCsP.mjs → Config-CxDW-52j.mjs} +2 -2
- package/dist/{Config-Bj2ZPCsP.mjs.map → Config-CxDW-52j.mjs.map} +1 -1
- package/dist/{NodeHttpServer-BGJlR_Kf.mjs → NodeHttpServer-D2VeYRw1.mjs} +5 -5
- package/dist/{NodeHttpServer-BGJlR_Kf.mjs.map → NodeHttpServer-D2VeYRw1.mjs.map} +1 -1
- package/dist/{NodeServices-DDZTiw5K.mjs → NodeServices-BtcL7AtO.mjs} +3 -3
- package/dist/{NodeServices-DDZTiw5K.mjs.map → NodeServices-BtcL7AtO.mjs.map} +1 -1
- package/dist/{NodeSocket-08w4osAf.mjs → NodeSocket-CLfrrutd.mjs} +2 -2
- package/dist/{NodeSocket-08w4osAf.mjs.map → NodeSocket-CLfrrutd.mjs.map} +1 -1
- package/dist/{NodeSqliteClient-Byu521pt.mjs → NodeSqliteClient-FfrElFAX.mjs} +4 -4
- package/dist/{NodeSqliteClient-Byu521pt.mjs.map → NodeSqliteClient-FfrElFAX.mjs.map} +1 -1
- package/dist/{Schema-B3i-HrZQ.mjs → Schema-B4KtKnpr.mjs} +34 -2
- package/dist/Schema-B4KtKnpr.mjs.map +1 -0
- package/dist/{SqlClient-DcM69ZvI.mjs → SqlClient-BQM_tAo_.mjs} +2 -2
- package/dist/{SqlClient-DcM69ZvI.mjs.map → SqlClient-BQM_tAo_.mjs.map} +1 -1
- package/dist/bin.mjs +1242 -538
- package/dist/bin.mjs.map +1 -1
- package/package.json +2 -1
- package/dist/Schema-B3i-HrZQ.mjs.map +0 -1
package/dist/bin.mjs
CHANGED
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
|
|
3
|
-
import { $ as make$
|
|
4
|
-
import { $ as decodeUnknownExit, $
|
|
5
|
-
import { a as isQuitError, g as ChildProcessSpawner, h as make$
|
|
6
|
-
import { _ as withDefault$2, a as all$1, c as logLevel, d as option$1, f as port, g as url$1, i as TrueValues, l as map$10, m as string$4, n as FalseValues, o as boolean$3, p as schema$1, r as Record$1, s as int, t as Boolean$2, u as number } from "./Config-
|
|
7
|
-
import { c as getOption$1, d as make$
|
|
3
|
+
import { $ as make$65, A as withLoggerDisabled, At as matchStatus, B as limitsServices, Bt as post$1, C as update$2, Ct as setHeader, D as compression, Dt as uint8Array$1, Et as text$2, F as schemaHeaders, Ft as appendUrlParams, G as CloseEvent, Gt as setUrl, Ht as setBody, I as schemaSearchParams, It as bodyFormData, Jt as HttpClientErrorSchema, K as SocketError, Kt as DecodeError, L as toURL, Lt as bodyJson, M as ParsedSearchParams, O as cors$1, Ot as urlParams$1, P as schemaCookies, Pt as schemaBodyJson, Q as join$1, Rt as get$4, S as set$2, Sn as __commonJSMin, T as appendPreResponseHandler, Tt as stream, Ut as setHeader$1, Vt as prependUrl, Wt as setHeaders, X as makeWebSocket, Xt as isHttpClientError, Y as make$66, Yt as StatusCodeError, Z as awaitEmpty, Zt as empty$2, _ as get$3, _n as fromInput, _t as mergeCookies, a as layer$43, an as CurrentRedactedNames, b as makeUnsafe$3, bn as hasBody, cn as fromRecordUnsafe, d as HttpClient, dn as jsonUnsafe$1, en as set$3, et as run$4, f as TracerPropagationEnabled, g as transformResponse$1, gn as urlParams, gt as jsonUnsafe, h as retryTransient, hn as uint8Array, ht as isHttpServerResponse, j as HttpServerRequest, k as logger, kt as filterStatusOk, l as serve$1, ln as merge, lt as symbol$1, m as mapRequest, mn as text$1, mt as file, o as HttpServer, on as empty$3, ot as RouteNotFound, p as filterStatusOk$1, pt as empty$1, q as SocketErrorReason, qt as HttpClientError, r as Mime_default, rt as HttpServerError, sn as fromInput$1, t as layerWebSocketConstructor, tt as runtime, u as withLogAddress, un as isHttpBody, ut as toResponse, v as getAndSet, vn as schemaRecord, w as updateAndGet, wn as __require, wt as setHeaders$1, x as modify$2, xn as map$3, xt as schemaJson, y as make$63, yn as toRecord, yt as redirect, zt as make$64 } from "./NodeSocket-CLfrrutd.mjs";
|
|
4
|
+
import { $ as decodeUnknownExit, $a as flatMap$1, $d as hasProperty, $l as format$1, $o as scopedWith, $s as TaggedError, $t as Union$1, $u as add$2, A as StructWithRest, Aa as asVoid, Ac as _await, Ai as make$75, An as encodeBase64, Ao as matchEffect, Ar as mapEffect$1, As as withSpan, At as suspend$1, B as Union, Ba as catchTags, Bc as succeed$4, Bi as offerUnsafe, Bn as now$1, Bo as provide$1, Br as provideService$1, Bs as forever$1, Bt as value, C as Number$1, Ca as andThen, Cc as forkUnsafe, Cd as map$6, Cl as CurrentLoggers$1, Cn as parseJson, Co as map$4, Cs as useSpan, Ct as isTrimmed, Cu as flatMapNullishOr, D as String$1, Da as annotateSpans, Dc as MinimumLogLevel, Dd as Number$2, Di as pipeTo, Dn as decodeBase64String, Do as match$2, Dr as make$74, Ds as withFiber$1, Dt as mutable, E as Record, Ea as annotateLogsScoped, Ec as provide$2, Ed as some, Ei as mapEffect$2, Er as isStream, Es as withErrorReporting, Et as makeFilter, Eu as isReadonlyArrayNonEmpty, Fi as failCause$3, Fl as reportCauseUnsafe, Fn as isGreaterThan$1, Fo as onInterrupt, Fr as onExit$1, Fs as snapshotUnsafe, Ft as toJsonSchemaDocument, G as annotateKey, Ga as currentParentSpan, Gc as isFailure, Gi as takeAll, Gl as ParentSpan, Gn as InvalidValue$1, Go as result, Gr as runFoldEffect, Gs as isDoneCause, Gt as toJsonSchemaMultiDocument, Gu as getOrUndefined$2, H as UnknownFromJsonString$1, Hc as fail$4, Hd as toJson, Hi as shutdown$1, Hn as toEpochMillis, Ho as provideService, Hr as runCollect, Hs as passthrough, Ht as toMultiDocumentOpenApi3_1, Hu as fail$1, I as URLFromString, Ia as catchFilter, Ic as isDeferred, Id as isEffect$1, In as isGreaterThanOrEqualTo$1, Io as option, Is as timer, It as toType, Iu as map$7, J as decodeEffect, Ja as ensuring, Ji as shutdown$2, Jl as make$77, Jn as Path, Jo as runForkWith, Js as Clock, K as brand, Ka as die, Kc as isSuccess, Kd as equals, Ki as unbounded$2, Kl as Tracer, Ko as retry, Kr as runForEach, Ks as parse$2, Kt as escapeToken, Ku as isFailure$1, L as Uint8Array$1, La as catchIf, Ld as withFiber, Li as make$78, Ln as isLessThan$1, Lo as orDie, Lr as pipeThroughChannel, Ls as update$3, Lt as withConstructorDefault, M as TaggedStruct, Ma as callback, Md as setStackTraceLimit, Mi as bounded, Mn as encodeHex, Mo as onError, Mr as merge$2, Ms as yieldNow, Mt as toCodecJson, Mu as reverse, N as TemplateLiteral, Na as catchCause, Nc as fail$3, Nd as Prototype, Ni as end, Nn as add$3, No as onExit, Ns as zipWith, Nt as toCodecJsonAST, Nu as sort, O as StringFromUriComponent, Oa as as, Oc as TracerEnabled, Od as make$72, On as decodeBase64Url, Oo as matchCauseEffect, Or as map$8, Ot as optional$3, Ou as map$5, Pa as catchDefect, Pc as failCause$2, Pd as PipeInspectableProto, Pn as formatIso, Ps as counter, Pt as toCodecStringTree, Q as decodeUnknownEffect, Qa as filterOrFail, Qc as StackTrace, Qd as compose$1, Ql as days, Qo as scoped, Qr as toAsyncIterable, Qs as TaggedClass, Qt as isSchemaError, Qu as Service$2, R as Undefined, Ra as catchReason, Rc as make$73, Rd as assignProperty, Ri as offer$1, Rl as sync$1, Rn as make$71, Ro as orElseSucceed, Rs as withAttributes, Rt as withDecodingDefault, S as NullOr, Sa as all, Sc as closeUnsafe, Sd as isSome, Si as filterArray, Sl as ConsoleRef, Sn as onSome, So as makeSpanScoped, Sr as fromQueue, Ss as updateContext, St as isSchema, Su as findLast, T as OptionFromNullOr, Ta as annotateLogs, Tc as makeUnsafe$8, Td as none, Tl as consolePretty$1, Tn as stringifyJson, To as mapError, Tr as groupedWithin, Ts as whileLoop, Tt as make$70, Tu as isArrayNonEmpty, U as Void, Ua as context, Uc as failCause$4, Ud as format, Ui as sliding$1, Ul as MinimumTraceLevel, Un as toUtc, Uo as raceFirst, Ur as runDrain, Us as spaced, Ut as apply, Uu as failVoid, V as Unknown, Va as catch_, Vc as die$1, Vd as NodeInspectSymbol, Vn as toDate, Vo as provideContext, Vr as run$5, Vt as VALID_OPEN_API_COMPONENTS_SCHEMAS_KEY_REGEXP, W as annotate$2, Wa as contextWith, Wc as interrupt$3, Wi as take$1, Wl as NativeSpan, Wn as Forbidden$1, Wo as repeat, Wr as runFold, Ws as catchDone, Wt as toRepresentations, Wu as getOrThrow, X as decodeSync, Xa as fail, Xi as subscribe, Xn as FileSystem, Xs as currentTimeNanos, Y as decodeExit, Ya as exit, Yc as void_$2, Yi as sliding, Yo as runPromiseWith, Ys as currentTimeMillis, Yu as succeed$2, Z as decodeTo, Za as failCause$1, Zc as NoSuchElementError, Zi as unbounded$1, Zo as scope, Zr as takeWhile, Zt as SchemaError, Zu as Reference, _c as unwrap, _d as fromUndefinedOr, _f as identity, _i as forEach$1, _l as map$9, _n as Transformation, _o as logDebug, _s as try_, _t as isMaxLength, _u as ensure, a as Class, aa as join$2, ac as effectContext, ad as getUnsafe$1, af as isTagged, al as findErrorOption, an as isLiteral, ao as forever, ar as debounce, as as succeedSome, at as encodeUnknownExit, b as NonEmptyString, ba as acquireUseRelease, bc as addFinalizerExit, bd as getOrUndefined, bi as mapInput, bl as squash, bn as transformOrFail, bo as logInfo, br as fromIterable$1, bs as uninterruptible, bt as isNonEmpty, bu as findFirst, c as Defect, ca as drop$1, cd as merge$1, cf as cast, ci as has, cl as hasInterrupts, cn as isOptional, co as forkScoped, cr as drain, cs as tap, ct as instanceOf, cu as minutes, d as ErrorClass, da as isEmpty$2, dc as provide, dd as exists, df as constTrue, dl as interruptors, dn as isVoid, do as ignore$1, ds as tapError, dt as isFinite, du as toMillis, ea as makeUnsafe$7, ec as taggedEnum, ed as empty$5, ef as isNotNull, el as combine$1, es as service, et as decodeUnknownOption, eu as fromInput$2, f as Exit, fa as size$2, fc as provideMerge, fd as filter, ff as constUndefined, fl as isCause, fn as resolveAt, fo as ignoreCause, fr as fail$5, fs as tapErrorTag, ft as isGreaterThan, g as Literals, gc as tap$1, gd as fromNullishOr, gi as drain$1, go as log$1, gr as fromAsyncIterable, gs as tryPromise, gt as isLessThanOrEqualTo, gu as empty$4, h as Literal, ha as PlatformError, hc as sync$2, hd as flatten, hf as dual, hn as toEncoded, ho as isEffect, hr as flatMap$2, ht as isLessThan, i as Cause, ic as effect, id as getOrUndefined$1, if as isString, ii as withSpan$1, in as isDeclaration, io as forEach, ir as concat, is as succeedNone, it as encodeUnknownEffect, j as TaggedErrorClass, ja as cached, jc as die$2, jd as getStackTraceLimit, ji as makeUnsafe$5, jl as fnUntraced$1, jn as encodeBase64Url, jo as never, jr as mapError$1, js as withTracerEnabled, jt as tag, ju as reduce, k as Struct, ka as asSome, kc as TracerTimingEnabled, ki as splitLines, kn as decodeBase64UrlString, kr as mapArrayEffect, ks as withParentSpan, kt as optionalKey, ku as match, l as Duration, la as empty$6, lc as launch, ld as omit, lf as compose, li as invalidate, ll as hasInterruptsOnly, ln as isSuspend, lo as fromResult, lr as empty$7, ls as tapCause, lt as is, lu as nanos, m as Int, mc as succeedContext, md as flatMap$3, mf as constant, mn as resolveIdentifier, mo as interruptible, mr as filter$2, ms as timeoutOption, mt as isInt, mu as allocate, n as ArraySchema, na as getCurrent, nc as build, nd as getOption, nf as isNullish, ni as transformPull, nn as getAST, no as fn, nr as catchCause$1, ns as sleep, nt as encodeEffect, nu as hours, o as DateTimeUtc, oa as runIn, oc as effectDiscard, od as make$68, on as isNull, oo as forkChild, or as decodeText, os as suspend, ot as fieldsAssign, ou as max, p as Finite, pa as toArray, pc as succeed$3, pd as firstSomeOf, pf as constVoid, pl as isFailReason, pn as resolveDescription, po as interrupt$1, pr as failCause$5, ps as timeout, pt as isGreaterThanOrEqualTo, pu as zero, q as declare, qc as match$3, qi as publish, ql as externalSpan, qn as makeFormatterDefault, qo as runFork, qr as runForEachArray, qs as round, qt as assign, qu as isSuccess$1, r as Boolean$1, ra as interrupt$4, rc as buildWithMemoMap, rd as getOrElse$1, rf as isObject$1, ri as unwrap$1, rl as fail$2, rn as getLastEncoding, ro as fnUntraced, rr as changes, rs as succeed$1, rt as encodeSync, s as DateTimeUtcFromString, sa as append$1, sc as empty$8, sd as makeUnsafe$4, si as get$6, sl as hasDies, sn as isObjects, so as forkIn, ss as sync, st as fromJsonString, su as millis, t as Any, ta as await_, tc as CurrentMemoMap, td as get$5, tf as isNotUndefined, to as flatten$1, tr as callback$1, ts as serviceOption, tt as encode$1, tu as fromInputUnsafe, u as DurationFromMillis, ua as head, uc as mergeAll, ud as contains, uf as constFalse, ui as make$69, ul as interrupt$2, un as isUnion, uo as gen, ur as encodeText, us as tapDefect, ut as isBetween, uu as seconds, v as Never, va as Transaction, vc as Scope, vd as getOrElse, vf as pipe, vl as pretty, vo as logError, vr as fromEffect, vs as tx, vt as isMaxProperties, vu as filter$1, w as Option, wa as annotateCurrentSpan, wc as make$76, wd as match$1, wi as fromTransform, wr as fromSubscription, ws as void_$1, wu as fromIterable, x as Null, xa as addFinalizer, xc as close, xd as isNone, xi as decodeText$1, xn as trim, xo as logWarning$1, xr as fromPubSub, xt as isPattern, xu as findFirstIndex, y as NonEmptyArray, ya as acquireRelease, yc as addFinalizer$1, yd as getOrNull, yf as pipeArguments, yl as prettyErrors, yn as transform$1, yo as logFatal, yr as fromEffectSchedule, ys as txRetry, yt as isMinLength, yu as filterMap, z as UndefinedOr, za as catchTag, zi as offerAll, zl as tracerLogger$1, zn as makeUnsafe$6, zo as promise, zr as provideContext$1, zs as addDelay, zt as make$67 } from "./Schema-B4KtKnpr.mjs";
|
|
5
|
+
import { a as isQuitError, g as ChildProcessSpawner, h as make$79, i as Terminal$1, l as Crypto, n as layer$44, o as Stdio, r as QuitError, s as make$80, u as fromReadable } from "./NodeServices-BtcL7AtO.mjs";
|
|
6
|
+
import { _ as withDefault$2, a as all$1, c as logLevel, d as option$1, f as port, g as url$1, i as TrueValues, l as map$10, m as string$4, n as FalseValues, o as boolean$3, p as schema$1, r as Record$1, s as int, t as Boolean$2, u as number } from "./Config-CxDW-52j.mjs";
|
|
7
|
+
import { c as getOption$1, d as make$81, f as makeWith$1, l as invalidate$1, n as SqlClient, p as set$4, s as get$7, u as keys } from "./SqlClient-BQM_tAo_.mjs";
|
|
8
|
+
import * as NodeModule from "node:module";
|
|
8
9
|
import * as NodeChildProcess from "node:child_process";
|
|
9
10
|
import * as NodeCrypto from "node:crypto";
|
|
10
11
|
import { createCipheriv, createDecipheriv, hkdfSync, randomBytes, randomUUID } from "node:crypto";
|
|
@@ -17,7 +18,7 @@ import { fileURLToPath } from "node:url";
|
|
|
17
18
|
import * as NodeReadline from "node:readline";
|
|
18
19
|
import { parse } from "yaml";
|
|
19
20
|
import * as NodeNet from "node:net";
|
|
20
|
-
import { createRequire } from "module";
|
|
21
|
+
import { createRequire as createRequire$1 } from "module";
|
|
21
22
|
import * as NodeFSP from "node:fs/promises";
|
|
22
23
|
import { FileFinder } from "@ff-labs/fff-node";
|
|
23
24
|
import { query } from "@anthropic-ai/claude-agent-sdk";
|
|
@@ -5880,7 +5881,7 @@ const map$2 = /*#__PURE__*/ dual(2, (self, f) => flatMap(self, (a) => succeed(f(
|
|
|
5880
5881
|
* @category constructors
|
|
5881
5882
|
* @since 4.0.0
|
|
5882
5883
|
*/
|
|
5883
|
-
const password = (options) => basePrompt(options, "password").pipe(map$2(make$
|
|
5884
|
+
const password = (options) => basePrompt(options, "password").pipe(map$2(make$67));
|
|
5884
5885
|
/**
|
|
5885
5886
|
* Runs a prompt by reading terminal input and rendering prompt frames until the
|
|
5886
5887
|
* prompt submits a value.
|
|
@@ -10588,7 +10589,7 @@ const isCommand = (u) => hasProperty(u, TypeId$14);
|
|
|
10588
10589
|
* @category constructors
|
|
10589
10590
|
* @since 4.0.0
|
|
10590
10591
|
*/
|
|
10591
|
-
const make$
|
|
10592
|
+
const make$62 = (name, config, handler) => {
|
|
10592
10593
|
return makeCommand({
|
|
10593
10594
|
name,
|
|
10594
10595
|
config: parseConfig(config ?? {}),
|
|
@@ -11084,7 +11085,7 @@ const runWith = (command, config) => {
|
|
|
11084
11085
|
}
|
|
11085
11086
|
const services = match$1(logLevel, {
|
|
11086
11087
|
onNone: () => empty$5(),
|
|
11087
|
-
onSome: (level) => make$
|
|
11088
|
+
onSome: (level) => make$68(MinimumLogLevel, level)
|
|
11088
11089
|
});
|
|
11089
11090
|
yield* provideContext(program, services);
|
|
11090
11091
|
}, catchFilter((error) => isCliError(error) && error._tag === "ShowHelp" ? succeed$2(error) : fail$1(error), (error) => andThen(showHelp(command, error), fail(error))), catchFilter((e) => isQuitError(e) ? succeed$2(e) : fail$1(e), (_) => interrupt$1));
|
|
@@ -11102,7 +11103,7 @@ const closeServer = (server) => {
|
|
|
11102
11103
|
* NetService - Service tag for startup networking helpers.
|
|
11103
11104
|
*/
|
|
11104
11105
|
var NetService = class extends Service$2()("@t3tools/shared/Net/NetService") {};
|
|
11105
|
-
const make$
|
|
11106
|
+
const make$61 = () => {
|
|
11106
11107
|
/**
|
|
11107
11108
|
* Returns true when a TCP server can bind to {host, port}.
|
|
11108
11109
|
* `EADDRNOTAVAIL` is treated as available so IPv6-absent hosts don't fail
|
|
@@ -11211,7 +11212,7 @@ const make$58 = () => {
|
|
|
11211
11212
|
})
|
|
11212
11213
|
};
|
|
11213
11214
|
};
|
|
11214
|
-
const layer$
|
|
11215
|
+
const layer$42 = sync$2(NetService, make$61);
|
|
11215
11216
|
//#endregion
|
|
11216
11217
|
//#region package.json
|
|
11217
11218
|
var version = "0.0.31";
|
|
@@ -12086,7 +12087,7 @@ function parse$1(input) {
|
|
|
12086
12087
|
const FULL_PATH_REGEXP = /^https?:\/\/.*?\//;
|
|
12087
12088
|
const OPTIONAL_PARAM_REGEXP = /(\/:[^/()]*?)\?(\/?)/;
|
|
12088
12089
|
/** @internal */
|
|
12089
|
-
const make$
|
|
12090
|
+
const make$60 = (options = {}) => new RouterImpl(options);
|
|
12090
12091
|
var RouterImpl = class {
|
|
12091
12092
|
constructor(options = {}) {
|
|
12092
12093
|
this.options = {
|
|
@@ -12605,7 +12606,7 @@ const httpMethods = [
|
|
|
12605
12606
|
* @since 1.0.0
|
|
12606
12607
|
* @category constructors
|
|
12607
12608
|
*/
|
|
12608
|
-
const make$
|
|
12609
|
+
const make$59 = make$60;
|
|
12609
12610
|
//#endregion
|
|
12610
12611
|
//#region ../../node_modules/.pnpm/effect@4.0.0-beta.103_patch_hash=a18f963109656ddbeb2a99ca45f942ecf54830986259eb01ce6a970421c9c6a9/node_modules/effect/dist/unstable/http/HttpRouter.js
|
|
12611
12612
|
/**
|
|
@@ -12640,8 +12641,8 @@ const HttpRouter = /*#__PURE__*/ Service$2("effect/http/HttpRouter");
|
|
|
12640
12641
|
* @category constructors
|
|
12641
12642
|
* @since 4.0.0
|
|
12642
12643
|
*/
|
|
12643
|
-
const make$
|
|
12644
|
-
const router = make$
|
|
12644
|
+
const make$58 = /*#__PURE__*/ gen(function* () {
|
|
12645
|
+
const router = make$59(yield* RouterConfig);
|
|
12645
12646
|
const middleware = /* @__PURE__ */ new Set();
|
|
12646
12647
|
const addAll = (routes) => contextWith((context) => {
|
|
12647
12648
|
const middleware = getMiddleware(context);
|
|
@@ -12807,7 +12808,7 @@ const add$1 = (method, path, handler, options) => use((router) => router.add(met
|
|
|
12807
12808
|
* @category layers
|
|
12808
12809
|
* @since 4.0.0
|
|
12809
12810
|
*/
|
|
12810
|
-
const layer$
|
|
12811
|
+
const layer$41 = /*#__PURE__*/ effect(HttpRouter)(make$58);
|
|
12811
12812
|
const RouteTypeId = "~effect/http/HttpRouter/Route";
|
|
12812
12813
|
const makeRoute = (options) => ({
|
|
12813
12814
|
...options,
|
|
@@ -12939,11 +12940,11 @@ var MiddlewareImpl = class MiddlewareImpl {
|
|
|
12939
12940
|
this.dependencies = dependencies;
|
|
12940
12941
|
const contextKey = `effect/http/HttpRouter/Middleware-${++middlewareId}`;
|
|
12941
12942
|
this.layer = effectContext(gen({ self: this }, function* () {
|
|
12942
|
-
const context$
|
|
12943
|
-
const stack = [context$
|
|
12943
|
+
const context$4 = yield* context();
|
|
12944
|
+
const stack = [context$4.mapUnsafe.get(fnContextKey)];
|
|
12944
12945
|
if (this.dependencies) {
|
|
12945
12946
|
const memoMap = yield* CurrentMemoMap;
|
|
12946
|
-
const scope = get$5(context$
|
|
12947
|
+
const scope = get$5(context$4, Scope);
|
|
12947
12948
|
const depsContext = yield* buildWithMemoMap(this.dependencies, memoMap, scope);
|
|
12948
12949
|
stack.push(...getMiddleware(depsContext));
|
|
12949
12950
|
}
|
|
@@ -12991,7 +12992,7 @@ const cors = (options) => middleware(cors$1(options), { global: true });
|
|
|
12991
12992
|
const serve = (appLayer, options) => {
|
|
12992
12993
|
let middleware = options?.middleware;
|
|
12993
12994
|
if (options?.disableLogger !== true) middleware = middleware ? compose(middleware, logger) : logger;
|
|
12994
|
-
const RouterLayer = options?.routerConfig ? provide(layer$
|
|
12995
|
+
const RouterLayer = options?.routerConfig ? provide(layer$41, succeed$3(RouterConfig)(options.routerConfig)) : layer$41;
|
|
12995
12996
|
return gen(function* () {
|
|
12996
12997
|
const handler = (yield* HttpRouter).asHttpEffect();
|
|
12997
12998
|
return middleware ? serve$1(handler, middleware) : serve$1(handler);
|
|
@@ -13098,7 +13099,7 @@ function makeProto$4(options) {
|
|
|
13098
13099
|
* @category constructors
|
|
13099
13100
|
* @since 4.0.0
|
|
13100
13101
|
*/
|
|
13101
|
-
const make$
|
|
13102
|
+
const make$57 = (method) => (identifier, path, options) => {
|
|
13102
13103
|
const disableCodecs = options?.disableCodecs ?? false;
|
|
13103
13104
|
const transformStringTree = disableCodecs ? identity : toCodecStringTree;
|
|
13104
13105
|
return makeProto$4({
|
|
@@ -13239,15 +13240,15 @@ function transformPayload(schema, method) {
|
|
|
13239
13240
|
* @category constructors
|
|
13240
13241
|
* @since 4.0.0
|
|
13241
13242
|
*/
|
|
13242
|
-
const get$2 = /*#__PURE__*/ make$
|
|
13243
|
+
const get$2 = /*#__PURE__*/ make$57("GET");
|
|
13243
13244
|
/**
|
|
13244
13245
|
* Creates a `POST` endpoint declaration.
|
|
13245
13246
|
*
|
|
13246
13247
|
* @category constructors
|
|
13247
13248
|
* @since 4.0.0
|
|
13248
13249
|
*/
|
|
13249
|
-
const post = /*#__PURE__*/ make$
|
|
13250
|
-
const del = /*#__PURE__*/ make$
|
|
13250
|
+
const post = /*#__PURE__*/ make$57("POST");
|
|
13251
|
+
const del = /*#__PURE__*/ make$57("DELETE");
|
|
13251
13252
|
//#endregion
|
|
13252
13253
|
//#region ../../node_modules/.pnpm/effect@4.0.0-beta.103_patch_hash=a18f963109656ddbeb2a99ca45f942ecf54830986259eb01ce6a970421c9c6a9/node_modules/effect/dist/unstable/httpapi/HttpApi.js
|
|
13253
13254
|
const TypeId$11 = "~effect/httpapi/HttpApi";
|
|
@@ -13322,7 +13323,7 @@ const makeProto$3 = (options) => {
|
|
|
13322
13323
|
* @category constructors
|
|
13323
13324
|
* @since 4.0.0
|
|
13324
13325
|
*/
|
|
13325
|
-
const make$
|
|
13326
|
+
const make$56 = (identifier) => makeProto$3({
|
|
13326
13327
|
identifier,
|
|
13327
13328
|
groups: {},
|
|
13328
13329
|
annotations: empty$5()
|
|
@@ -13461,7 +13462,7 @@ const makeProto$2 = (options) => {
|
|
|
13461
13462
|
* @category constructors
|
|
13462
13463
|
* @since 4.0.0
|
|
13463
13464
|
*/
|
|
13464
|
-
const make$
|
|
13465
|
+
const make$55 = (identifier, options) => makeProto$2({
|
|
13465
13466
|
identifier,
|
|
13466
13467
|
topLevel: options?.topLevel ?? false,
|
|
13467
13468
|
endpoints: {},
|
|
@@ -16172,11 +16173,11 @@ const RelayHealthResponse = Struct({
|
|
|
16172
16173
|
ok: Boolean$1,
|
|
16173
16174
|
service: Literal("relay")
|
|
16174
16175
|
});
|
|
16175
|
-
const RelayHealthGroup = make$
|
|
16176
|
+
const RelayHealthGroup = make$55("health").add(get$2("health", "/health", {
|
|
16176
16177
|
success: RelayHealthResponse,
|
|
16177
16178
|
error: RelayInternalError
|
|
16178
16179
|
}).annotate(Summary, "Check relay health")).annotate(Description, "Service health and readiness.");
|
|
16179
|
-
const RelayMetadataGroup = make$
|
|
16180
|
+
const RelayMetadataGroup = make$55("metadata").add(get$2("authorizationServer", "/.well-known/oauth-authorization-server", { success: RelayAuthorizationServerMetadata }).annotate(Summary, "Read OAuth authorization-server metadata"), get$2("protectedResource", "/.well-known/oauth-protected-resource", { success: RelayProtectedResourceMetadata }).annotate(Summary, "Read OAuth protected-resource metadata")).annotate(Description, "OAuth and DPoP discovery metadata.");
|
|
16180
16181
|
const RelayRegisterDeviceEndpoint = post("registerDevice", "/v1/mobile/devices", {
|
|
16181
16182
|
headers: RelayDpopRequestHeaders,
|
|
16182
16183
|
payload: RelayDeviceRegistrationRequest,
|
|
@@ -16200,8 +16201,8 @@ const RelayUnregisterDeviceEndpoint = del("unregisterDevice", "/v1/mobile/device
|
|
|
16200
16201
|
success: RelayOkResponse,
|
|
16201
16202
|
error: RelayAuthAndInternalErrors
|
|
16202
16203
|
}).annotate(Summary, "Unregister a mobile device");
|
|
16203
|
-
const RelayMobileGroup = make$
|
|
16204
|
-
const RelayClientGroup = make$
|
|
16204
|
+
const RelayMobileGroup = make$55("mobile").add(RelayRegisterDeviceEndpoint, RelayRegisterLiveActivityEndpoint, RelayAgentActivitySnapshotEndpoint, RelayUnregisterDeviceEndpoint).annotate(Description, "Mobile push-notification and Live Activity registration.").middleware(RelayDpopClientAuth);
|
|
16205
|
+
const RelayClientGroup = make$55("client").add(get$2("listEnvironments", "/v1/environments", {
|
|
16205
16206
|
headers: RelayBearerRequestHeaders,
|
|
16206
16207
|
success: RelayListEnvironmentsResponse,
|
|
16207
16208
|
error: RelayAuthAndInternalErrors
|
|
@@ -16236,7 +16237,7 @@ const RelayExchangeDpopAccessTokenEndpoint = post("exchangeDpopAccessToken", "/v
|
|
|
16236
16237
|
success: RelayDpopAccessTokenResponse,
|
|
16237
16238
|
error: RelayAuthAndInternalErrors
|
|
16238
16239
|
}).annotate(Summary, "Exchange a Clerk token for a DPoP access token").annotate(Description, "Bootstrap endpoint. Send the DPoP proof JWT in the dpop header and the Clerk token in subject_token. The returned access token is bound to the proof key.");
|
|
16239
|
-
const RelayTokenGroup = make$
|
|
16240
|
+
const RelayTokenGroup = make$55("token").add(RelayExchangeDpopAccessTokenEndpoint).annotate(Description, "OAuth token exchange for DPoP-bound client access.");
|
|
16240
16241
|
const RelayConnectEnvironmentEndpoint = post("connectEnvironment", "/v1/environments/:environmentId/connect", {
|
|
16241
16242
|
headers: RelayDpopRequestHeaders,
|
|
16242
16243
|
params: Struct({ environmentId: EnvironmentId }),
|
|
@@ -16250,8 +16251,8 @@ const RelayGetEnvironmentStatusEndpoint = post("getEnvironmentStatus", "/v1/envi
|
|
|
16250
16251
|
success: RelayEnvironmentStatusResponse,
|
|
16251
16252
|
error: RelayEnvironmentConnectErrors
|
|
16252
16253
|
}).annotate(Summary, "Check environment status");
|
|
16253
|
-
const RelayDpopClientGroup = make$
|
|
16254
|
-
const RelayServerGroup = make$
|
|
16254
|
+
const RelayDpopClientGroup = make$55("dpopClient").add(RelayConnectEnvironmentEndpoint, RelayGetEnvironmentStatusEndpoint).annotate(Description, "DPoP-authenticated client access to linked environments.").middleware(RelayDpopClientAuth);
|
|
16255
|
+
const RelayServerGroup = make$55("server").add(post("publishAgentActivity", "/v1/environments/:environmentId/threads/:threadId/agent-activity", {
|
|
16255
16256
|
params: Struct({
|
|
16256
16257
|
environmentId: EnvironmentId,
|
|
16257
16258
|
threadId: ThreadId
|
|
@@ -16260,7 +16261,7 @@ const RelayServerGroup = make$52("server").add(post("publishAgentActivity", "/v1
|
|
|
16260
16261
|
success: RelayPublishResponse,
|
|
16261
16262
|
error: RelayAgentActivityPublishErrors
|
|
16262
16263
|
}).annotate(Summary, "Publish agent activity")).annotate(Description, "Environment-authenticated activity publication.").middleware(RelayEnvironmentAuth);
|
|
16263
|
-
make$
|
|
16264
|
+
make$56("RelayApi").add(RelayHealthGroup, RelayMetadataGroup, RelayMobileGroup, RelayClientGroup, RelayTokenGroup, RelayDpopClientGroup, RelayServerGroup).annotate(Title$1, "AgentLink Relay API").annotate(Version, "1.0.0").annotate(Description, "Control-plane API for linking T3 environments, connecting authorized clients, and publishing agent activity.");
|
|
16264
16265
|
//#endregion
|
|
16265
16266
|
//#region ../t3-contracts/src/environmentHttp.ts
|
|
16266
16267
|
const OptionalBearerHeaders = Struct({
|
|
@@ -16438,8 +16439,8 @@ const EnvironmentCloudPreferencesRequest = Struct({ publishAgentActivity: Boolea
|
|
|
16438
16439
|
const AuthPairingLinkRevokeResult = Struct({ revoked: Boolean$1 });
|
|
16439
16440
|
const AuthClientSessionRevokeResult = Struct({ revoked: Boolean$1 });
|
|
16440
16441
|
const AuthOtherClientSessionsRevokeResult = Struct({ revokedCount: Number$1 });
|
|
16441
|
-
var EnvironmentMetadataHttpApi = class extends make$
|
|
16442
|
-
var EnvironmentAuthHttpApi = class extends make$
|
|
16442
|
+
var EnvironmentMetadataHttpApi = class extends make$55("metadata").add(get$2("descriptor", "/.well-known/t3/environment", { success: ExecutionEnvironmentDescriptor })) {};
|
|
16443
|
+
var EnvironmentAuthHttpApi = class extends make$55("auth").add(get$2("session", "/api/auth/session", {
|
|
16443
16444
|
headers: OptionalBearerHeaders,
|
|
16444
16445
|
success: AuthSessionState,
|
|
16445
16446
|
error: [EnvironmentInternalError]
|
|
@@ -16485,7 +16486,7 @@ var EnvironmentAuthHttpApi = class extends make$52("auth").add(get$2("session",
|
|
|
16485
16486
|
error: EnvironmentScopedOperationErrors
|
|
16486
16487
|
}).middleware(EnvironmentAuthenticatedAuth)) {};
|
|
16487
16488
|
const EnvironmentOrchestrationThreadSnapshotParams = Struct({ threadId: ThreadId });
|
|
16488
|
-
var EnvironmentOrchestrationHttpApi = class extends make$
|
|
16489
|
+
var EnvironmentOrchestrationHttpApi = class extends make$55("orchestration").add(get$2("snapshot", "/api/orchestration/snapshot", {
|
|
16489
16490
|
headers: OptionalBearerHeaders,
|
|
16490
16491
|
success: OrchestrationReadModel,
|
|
16491
16492
|
error: EnvironmentOrchestrationSnapshotErrors
|
|
@@ -16504,7 +16505,7 @@ var EnvironmentOrchestrationHttpApi = class extends make$52("orchestration").add
|
|
|
16504
16505
|
success: DispatchResult,
|
|
16505
16506
|
error: EnvironmentOrchestrationDispatchErrors
|
|
16506
16507
|
}).middleware(EnvironmentAuthenticatedAuth)) {};
|
|
16507
|
-
var EnvironmentConnectHttpApi = class extends make$
|
|
16508
|
+
var EnvironmentConnectHttpApi = class extends make$55("connect").add(post("linkProof", "/api/connect/link-proof", {
|
|
16508
16509
|
headers: OptionalBearerHeaders,
|
|
16509
16510
|
payload: RelayLinkProofRequest,
|
|
16510
16511
|
success: RelayEnvironmentLinkProof,
|
|
@@ -16540,7 +16541,7 @@ var EnvironmentConnectHttpApi = class extends make$52("connect").add(post("linkP
|
|
|
16540
16541
|
success: RelayEnvironmentMintResponse,
|
|
16541
16542
|
error: EnvironmentHttpCloudErrors
|
|
16542
16543
|
})) {};
|
|
16543
|
-
var EnvironmentHttpApi = class extends make$
|
|
16544
|
+
var EnvironmentHttpApi = class extends make$56("environment").add(EnvironmentMetadataHttpApi).add(EnvironmentAuthHttpApi).add(EnvironmentOrchestrationHttpApi).add(EnvironmentConnectHttpApi) {};
|
|
16544
16545
|
//#endregion
|
|
16545
16546
|
//#region ../t3-contracts/src/relayClient.ts
|
|
16546
16547
|
const RelayClientStatusSchema = Union([
|
|
@@ -16763,10 +16764,10 @@ const TypeId$7 = "~effect/LayerMap";
|
|
|
16763
16764
|
* @category constructors
|
|
16764
16765
|
* @since 3.14.0
|
|
16765
16766
|
*/
|
|
16766
|
-
const make$
|
|
16767
|
-
const context$
|
|
16768
|
-
const memoMap = CurrentMemoMap.forkOrCreate(context$
|
|
16769
|
-
const rcMap = yield* make$
|
|
16767
|
+
const make$54 = /*#__PURE__*/ fnUntraced(function* (lookup, options) {
|
|
16768
|
+
const context$3 = yield* context();
|
|
16769
|
+
const memoMap = CurrentMemoMap.forkOrCreate(context$3);
|
|
16770
|
+
const rcMap = yield* make$69({
|
|
16770
16771
|
lookup: (key) => contextWith((_) => buildWithMemoMap(lookup(key), memoMap, get$5(_, Scope))),
|
|
16771
16772
|
idleTimeToLive: options?.idleTimeToLive
|
|
16772
16773
|
});
|
|
@@ -16831,7 +16832,7 @@ const make$51 = /*#__PURE__*/ fnUntraced(function* (lookup, options) {
|
|
|
16831
16832
|
* @category constructors
|
|
16832
16833
|
* @since 3.14.0
|
|
16833
16834
|
*/
|
|
16834
|
-
const fromRecord$1 = (layers, options) => make$
|
|
16835
|
+
const fromRecord$1 = (layers, options) => make$54((key) => layers[key], {
|
|
16835
16836
|
...options,
|
|
16836
16837
|
preloadKeys: options?.preload ? Object.keys(layers) : void 0
|
|
16837
16838
|
});
|
|
@@ -16893,7 +16894,7 @@ const Service = () => (id, options) => {
|
|
|
16893
16894
|
Object.defineProperty(TagClass, "stack", { get() {
|
|
16894
16895
|
return creationError.stack;
|
|
16895
16896
|
} });
|
|
16896
|
-
TagClass_.layerNoDeps = effect(TagClass_)("lookup" in options ? make$
|
|
16897
|
+
TagClass_.layerNoDeps = effect(TagClass_)("lookup" in options ? make$54(options.lookup, options) : fromRecord$1(options.layers, options));
|
|
16897
16898
|
TagClass_.layer = options.dependencies && options.dependencies.length > 0 ? provide(TagClass_.layerNoDeps, options.dependencies) : TagClass_.layerNoDeps;
|
|
16898
16899
|
TagClass_.get = (key) => unwrap(map$4(TagClass_, (layerMap) => layerMap.get(key)));
|
|
16899
16900
|
TagClass_.contextEffect = (key) => flatMap$1(TagClass_, (layerMap) => layerMap.contextEffect(key));
|
|
@@ -17018,7 +17019,7 @@ const tracerLogger = tracerLogger$1;
|
|
|
17018
17019
|
* @category layers
|
|
17019
17020
|
* @since 4.0.0
|
|
17020
17021
|
*/
|
|
17021
|
-
const layer$
|
|
17022
|
+
const layer$40 = (loggers, options) => effect(CurrentLoggers, withFiber(fnUntraced$1(function* (fiber) {
|
|
17022
17023
|
const currentLoggers = new Set(options?.mergeWithExisting === true ? fiber.getRef(CurrentLoggers$1) : []);
|
|
17023
17024
|
for (const logger of loggers) currentLoggers.add(isEffect$1(logger) ? yield* logger : logger);
|
|
17024
17025
|
return currentLoggers;
|
|
@@ -17084,7 +17085,7 @@ const makeUnsafe$2 = (value) => {
|
|
|
17084
17085
|
* @category constructors
|
|
17085
17086
|
* @since 2.0.0
|
|
17086
17087
|
*/
|
|
17087
|
-
const make$
|
|
17088
|
+
const make$53 = (value) => sync(() => makeUnsafe$2(value));
|
|
17088
17089
|
/**
|
|
17089
17090
|
* Reads the current value synchronously, bypassing the `Effect` API and the
|
|
17090
17091
|
* ref's semaphore.
|
|
@@ -17169,7 +17170,7 @@ const TypeId$5 = "~effect/transactions/TxRef";
|
|
|
17169
17170
|
* @category constructors
|
|
17170
17171
|
* @since 2.0.0
|
|
17171
17172
|
*/
|
|
17172
|
-
const make$
|
|
17173
|
+
const make$52 = (initial) => sync(() => makeUnsafe$1(initial));
|
|
17173
17174
|
/**
|
|
17174
17175
|
* Creates a new `TxRef` synchronously with the specified initial value.
|
|
17175
17176
|
*
|
|
@@ -17397,7 +17398,7 @@ const TxChunkProto = {
|
|
|
17397
17398
|
* @category constructors
|
|
17398
17399
|
* @since 4.0.0
|
|
17399
17400
|
*/
|
|
17400
|
-
const empty = () => map$4(make$
|
|
17401
|
+
const empty = () => map$4(make$52(empty$6()), (ref) => makeUnsafe(ref));
|
|
17401
17402
|
/**
|
|
17402
17403
|
* Creates a new `TxChunk` with the specified TxRef.
|
|
17403
17404
|
*
|
|
@@ -17722,7 +17723,7 @@ const TxQueueProto = {
|
|
|
17722
17723
|
*/
|
|
17723
17724
|
const unbounded = () => gen(function* () {
|
|
17724
17725
|
const items = yield* empty();
|
|
17725
|
-
const stateRef = yield* make$
|
|
17726
|
+
const stateRef = yield* make$52({ _tag: "Open" });
|
|
17726
17727
|
const txQueue = Object.create(TxQueueProto);
|
|
17727
17728
|
txQueue.strategy = "unbounded";
|
|
17728
17729
|
txQueue.capacity = Number.POSITIVE_INFINITY;
|
|
@@ -22845,7 +22846,7 @@ const schema = /*#__PURE__*/ declare(isStream);
|
|
|
22845
22846
|
* @since 4.0.0
|
|
22846
22847
|
*/
|
|
22847
22848
|
function Stream(success, error) {
|
|
22848
|
-
return make$
|
|
22849
|
+
return make$70(schema.ast, {
|
|
22849
22850
|
[StreamSchemaTypeId]: StreamSchemaTypeId,
|
|
22850
22851
|
success,
|
|
22851
22852
|
error
|
|
@@ -22999,7 +23000,7 @@ const makeProto$1 = (options) => {
|
|
|
22999
23000
|
* @category constructors
|
|
23000
23001
|
* @since 4.0.0
|
|
23001
23002
|
*/
|
|
23002
|
-
const make$
|
|
23003
|
+
const make$51 = (tag, options) => {
|
|
23003
23004
|
const successSchema = options?.success ?? Void;
|
|
23004
23005
|
const errorSchema = options?.error ?? Never;
|
|
23005
23006
|
const defectSchema = options?.defect ?? Defect();
|
|
@@ -23155,7 +23156,7 @@ const RpcGroupProto = {
|
|
|
23155
23156
|
});
|
|
23156
23157
|
},
|
|
23157
23158
|
annotateRpcs(service, value) {
|
|
23158
|
-
return this.annotateRpcsMerge(make$
|
|
23159
|
+
return this.annotateRpcsMerge(make$68(service, value));
|
|
23159
23160
|
},
|
|
23160
23161
|
annotateMerge(context) {
|
|
23161
23162
|
return makeProto({
|
|
@@ -23182,7 +23183,7 @@ const makeProto = (options) => Object.assign(function() {}, RpcGroupProto, {
|
|
|
23182
23183
|
* @category constructors
|
|
23183
23184
|
* @since 4.0.0
|
|
23184
23185
|
*/
|
|
23185
|
-
const make$
|
|
23186
|
+
const make$50 = (...rpcs) => makeProto({
|
|
23186
23187
|
requests: new Map(rpcs.map((rpc) => [rpc._tag, rpc])),
|
|
23187
23188
|
annotations: empty$5()
|
|
23188
23189
|
});
|
|
@@ -23266,22 +23267,22 @@ const WS_METHODS = {
|
|
|
23266
23267
|
subscribeBackgroundPolicy: "subscribeBackgroundPolicy",
|
|
23267
23268
|
subscribeResourceTelemetry: "subscribeResourceTelemetry"
|
|
23268
23269
|
};
|
|
23269
|
-
const WsServerUpsertKeybindingRpc = make$
|
|
23270
|
+
const WsServerUpsertKeybindingRpc = make$51(WS_METHODS.serverUpsertKeybinding, {
|
|
23270
23271
|
payload: ServerUpsertKeybindingInput,
|
|
23271
23272
|
success: ServerUpsertKeybindingResult,
|
|
23272
23273
|
error: Union([KeybindingsConfigError, EnvironmentAuthorizationError])
|
|
23273
23274
|
});
|
|
23274
|
-
const WsServerRemoveKeybindingRpc = make$
|
|
23275
|
+
const WsServerRemoveKeybindingRpc = make$51(WS_METHODS.serverRemoveKeybinding, {
|
|
23275
23276
|
payload: ServerRemoveKeybindingInput,
|
|
23276
23277
|
success: ServerRemoveKeybindingResult,
|
|
23277
23278
|
error: Union([KeybindingsConfigError, EnvironmentAuthorizationError])
|
|
23278
23279
|
});
|
|
23279
|
-
const WsServerProbeRpc = make$
|
|
23280
|
+
const WsServerProbeRpc = make$51(WS_METHODS.serverProbe, {
|
|
23280
23281
|
payload: Struct({}),
|
|
23281
23282
|
success: Struct({}),
|
|
23282
23283
|
error: EnvironmentAuthorizationError
|
|
23283
23284
|
});
|
|
23284
|
-
const WsServerGetConfigRpc = make$
|
|
23285
|
+
const WsServerGetConfigRpc = make$51(WS_METHODS.serverGetConfig, {
|
|
23285
23286
|
payload: Struct({}),
|
|
23286
23287
|
success: ServerConfig$1,
|
|
23287
23288
|
error: Union([
|
|
@@ -23290,7 +23291,7 @@ const WsServerGetConfigRpc = make$48(WS_METHODS.serverGetConfig, {
|
|
|
23290
23291
|
EnvironmentAuthorizationError
|
|
23291
23292
|
])
|
|
23292
23293
|
});
|
|
23293
|
-
const WsServerRefreshProvidersRpc = make$
|
|
23294
|
+
const WsServerRefreshProvidersRpc = make$51(WS_METHODS.serverRefreshProviders, {
|
|
23294
23295
|
payload: Struct({
|
|
23295
23296
|
/**
|
|
23296
23297
|
* When supplied, only refresh this specific provider instance. When
|
|
@@ -23302,202 +23303,202 @@ instanceId: optional$3(ProviderInstanceId) }),
|
|
|
23302
23303
|
success: ServerProviderUpdatedPayload,
|
|
23303
23304
|
error: EnvironmentAuthorizationError
|
|
23304
23305
|
});
|
|
23305
|
-
const WsServerUpdateProviderRpc = make$
|
|
23306
|
+
const WsServerUpdateProviderRpc = make$51(WS_METHODS.serverUpdateProvider, {
|
|
23306
23307
|
payload: ServerProviderUpdateInput,
|
|
23307
23308
|
success: ServerProviderUpdatedPayload,
|
|
23308
23309
|
error: Union([ServerProviderUpdateError, EnvironmentAuthorizationError])
|
|
23309
23310
|
});
|
|
23310
|
-
const WsServerUpdateServerRpc = make$
|
|
23311
|
+
const WsServerUpdateServerRpc = make$51(WS_METHODS.serverUpdateServer, {
|
|
23311
23312
|
payload: ServerSelfUpdateInput,
|
|
23312
23313
|
success: ServerSelfUpdateResult,
|
|
23313
23314
|
error: Union([ServerSelfUpdateError, EnvironmentAuthorizationError])
|
|
23314
23315
|
});
|
|
23315
|
-
const WsServerUpdateServerWithProgressRpc = make$
|
|
23316
|
+
const WsServerUpdateServerWithProgressRpc = make$51(WS_METHODS.serverUpdateServerWithProgress, {
|
|
23316
23317
|
payload: ServerSelfUpdateInput,
|
|
23317
23318
|
success: ServerSelfUpdateProgressEvent,
|
|
23318
23319
|
error: Union([ServerSelfUpdateError, EnvironmentAuthorizationError]),
|
|
23319
23320
|
stream: true
|
|
23320
23321
|
});
|
|
23321
|
-
const WsServerGetSettingsRpc = make$
|
|
23322
|
+
const WsServerGetSettingsRpc = make$51(WS_METHODS.serverGetSettings, {
|
|
23322
23323
|
payload: Struct({}),
|
|
23323
23324
|
success: ServerSettings,
|
|
23324
23325
|
error: Union([ServerSettingsError, EnvironmentAuthorizationError])
|
|
23325
23326
|
});
|
|
23326
|
-
const WsServerUpdateSettingsRpc = make$
|
|
23327
|
+
const WsServerUpdateSettingsRpc = make$51(WS_METHODS.serverUpdateSettings, {
|
|
23327
23328
|
payload: Struct({ patch: ServerSettingsPatch }),
|
|
23328
23329
|
success: ServerSettings,
|
|
23329
23330
|
error: Union([ServerSettingsError, EnvironmentAuthorizationError])
|
|
23330
23331
|
});
|
|
23331
|
-
const WsServerDiscoverSourceControlRpc = make$
|
|
23332
|
+
const WsServerDiscoverSourceControlRpc = make$51(WS_METHODS.serverDiscoverSourceControl, {
|
|
23332
23333
|
payload: Struct({}),
|
|
23333
23334
|
success: SourceControlDiscoveryResult,
|
|
23334
23335
|
error: EnvironmentAuthorizationError
|
|
23335
23336
|
});
|
|
23336
|
-
const WsServerGetTraceDiagnosticsRpc = make$
|
|
23337
|
+
const WsServerGetTraceDiagnosticsRpc = make$51(WS_METHODS.serverGetTraceDiagnostics, {
|
|
23337
23338
|
payload: Struct({}),
|
|
23338
23339
|
success: ServerTraceDiagnosticsResult,
|
|
23339
23340
|
error: EnvironmentAuthorizationError
|
|
23340
23341
|
});
|
|
23341
|
-
const WsServerGetProcessDiagnosticsRpc = make$
|
|
23342
|
+
const WsServerGetProcessDiagnosticsRpc = make$51(WS_METHODS.serverGetProcessDiagnostics, {
|
|
23342
23343
|
payload: Struct({}),
|
|
23343
23344
|
success: ServerProcessDiagnosticsResult,
|
|
23344
23345
|
error: EnvironmentAuthorizationError
|
|
23345
23346
|
});
|
|
23346
|
-
const WsServerGetProcessResourceHistoryRpc = make$
|
|
23347
|
+
const WsServerGetProcessResourceHistoryRpc = make$51(WS_METHODS.serverGetProcessResourceHistory, {
|
|
23347
23348
|
payload: ServerProcessResourceHistoryInput,
|
|
23348
23349
|
success: ServerProcessResourceHistoryResult,
|
|
23349
23350
|
error: EnvironmentAuthorizationError
|
|
23350
23351
|
});
|
|
23351
|
-
const WsServerGetResourceTelemetryHistoryRpc = make$
|
|
23352
|
+
const WsServerGetResourceTelemetryHistoryRpc = make$51(WS_METHODS.serverGetResourceTelemetryHistory, {
|
|
23352
23353
|
payload: ResourceTelemetryHistoryInput,
|
|
23353
23354
|
success: ResourceTelemetryHistory,
|
|
23354
23355
|
error: EnvironmentAuthorizationError
|
|
23355
23356
|
});
|
|
23356
|
-
const WsServerRetryResourceTelemetryRpc = make$
|
|
23357
|
+
const WsServerRetryResourceTelemetryRpc = make$51(WS_METHODS.serverRetryResourceTelemetry, {
|
|
23357
23358
|
payload: Struct({}),
|
|
23358
23359
|
success: ResourceTelemetryRetryResult,
|
|
23359
23360
|
error: EnvironmentAuthorizationError
|
|
23360
23361
|
});
|
|
23361
|
-
const WsServerSignalProcessRpc = make$
|
|
23362
|
+
const WsServerSignalProcessRpc = make$51(WS_METHODS.serverSignalProcess, {
|
|
23362
23363
|
payload: ServerSignalProcessInput,
|
|
23363
23364
|
success: ServerSignalProcessResult,
|
|
23364
23365
|
error: EnvironmentAuthorizationError
|
|
23365
23366
|
});
|
|
23366
|
-
const WsCloudGetRelayClientStatusRpc = make$
|
|
23367
|
+
const WsCloudGetRelayClientStatusRpc = make$51(WS_METHODS.cloudGetRelayClientStatus, {
|
|
23367
23368
|
payload: Struct({}),
|
|
23368
23369
|
success: RelayClientStatusSchema,
|
|
23369
23370
|
error: EnvironmentAuthorizationError
|
|
23370
23371
|
});
|
|
23371
|
-
const WsCloudInstallRelayClientRpc = make$
|
|
23372
|
+
const WsCloudInstallRelayClientRpc = make$51(WS_METHODS.cloudInstallRelayClient, {
|
|
23372
23373
|
payload: Struct({}),
|
|
23373
23374
|
success: RelayClientInstallProgressEventSchema,
|
|
23374
23375
|
error: Union([RelayClientInstallFailedError, EnvironmentAuthorizationError]),
|
|
23375
23376
|
stream: true
|
|
23376
23377
|
});
|
|
23377
|
-
const WsServerReportClientActivityRpc = make$
|
|
23378
|
+
const WsServerReportClientActivityRpc = make$51(WS_METHODS.serverReportClientActivity, {
|
|
23378
23379
|
payload: ClientActivityReportInput,
|
|
23379
23380
|
error: EnvironmentAuthorizationError
|
|
23380
23381
|
});
|
|
23381
|
-
const WsServerReportHostPowerStateRpc = make$
|
|
23382
|
+
const WsServerReportHostPowerStateRpc = make$51(WS_METHODS.serverReportHostPowerState, {
|
|
23382
23383
|
payload: HostPowerSnapshot,
|
|
23383
23384
|
error: EnvironmentAuthorizationError
|
|
23384
23385
|
});
|
|
23385
|
-
const WsServerGetBackgroundPolicyRpc = make$
|
|
23386
|
+
const WsServerGetBackgroundPolicyRpc = make$51(WS_METHODS.serverGetBackgroundPolicy, {
|
|
23386
23387
|
payload: Struct({}),
|
|
23387
23388
|
success: BackgroundPolicySnapshot,
|
|
23388
23389
|
error: EnvironmentAuthorizationError
|
|
23389
23390
|
});
|
|
23390
|
-
const WsSourceControlLookupRepositoryRpc = make$
|
|
23391
|
+
const WsSourceControlLookupRepositoryRpc = make$51(WS_METHODS.sourceControlLookupRepository, {
|
|
23391
23392
|
payload: SourceControlRepositoryLookupInput,
|
|
23392
23393
|
success: SourceControlRepositoryInfo,
|
|
23393
23394
|
error: Union([SourceControlRepositoryError, EnvironmentAuthorizationError])
|
|
23394
23395
|
});
|
|
23395
|
-
const WsSourceControlCloneRepositoryRpc = make$
|
|
23396
|
+
const WsSourceControlCloneRepositoryRpc = make$51(WS_METHODS.sourceControlCloneRepository, {
|
|
23396
23397
|
payload: SourceControlCloneRepositoryInput,
|
|
23397
23398
|
success: SourceControlCloneRepositoryResult,
|
|
23398
23399
|
error: Union([SourceControlRepositoryError, EnvironmentAuthorizationError])
|
|
23399
23400
|
});
|
|
23400
|
-
const WsSourceControlPublishRepositoryRpc = make$
|
|
23401
|
+
const WsSourceControlPublishRepositoryRpc = make$51(WS_METHODS.sourceControlPublishRepository, {
|
|
23401
23402
|
payload: SourceControlPublishRepositoryInput,
|
|
23402
23403
|
success: SourceControlPublishRepositoryResult,
|
|
23403
23404
|
error: Union([SourceControlRepositoryError, EnvironmentAuthorizationError])
|
|
23404
23405
|
});
|
|
23405
|
-
const WsProjectsSearchEntriesRpc = make$
|
|
23406
|
+
const WsProjectsSearchEntriesRpc = make$51(WS_METHODS.projectsSearchEntries, {
|
|
23406
23407
|
payload: ProjectSearchEntriesInput,
|
|
23407
23408
|
success: ProjectSearchEntriesResult,
|
|
23408
23409
|
error: Union([ProjectSearchEntriesError, EnvironmentAuthorizationError])
|
|
23409
23410
|
});
|
|
23410
|
-
const WsProjectsSearchContentsRpc = make$
|
|
23411
|
+
const WsProjectsSearchContentsRpc = make$51(WS_METHODS.projectsSearchContents, {
|
|
23411
23412
|
payload: ProjectSearchContentsInput,
|
|
23412
23413
|
success: ProjectSearchContentsResult,
|
|
23413
23414
|
error: Union([ProjectSearchContentsError, EnvironmentAuthorizationError])
|
|
23414
23415
|
});
|
|
23415
|
-
const WsProjectsListEntriesRpc = make$
|
|
23416
|
+
const WsProjectsListEntriesRpc = make$51(WS_METHODS.projectsListEntries, {
|
|
23416
23417
|
payload: ProjectListEntriesInput,
|
|
23417
23418
|
success: ProjectListEntriesResult,
|
|
23418
23419
|
error: Union([ProjectListEntriesError, EnvironmentAuthorizationError])
|
|
23419
23420
|
});
|
|
23420
|
-
const WsProjectsReadFileRpc = make$
|
|
23421
|
+
const WsProjectsReadFileRpc = make$51(WS_METHODS.projectsReadFile, {
|
|
23421
23422
|
payload: ProjectReadFileInput,
|
|
23422
23423
|
success: ProjectReadFileResult,
|
|
23423
23424
|
error: Union([ProjectReadFileError, EnvironmentAuthorizationError])
|
|
23424
23425
|
});
|
|
23425
|
-
const WsProjectsWriteFileRpc = make$
|
|
23426
|
+
const WsProjectsWriteFileRpc = make$51(WS_METHODS.projectsWriteFile, {
|
|
23426
23427
|
payload: ProjectWriteFileInput,
|
|
23427
23428
|
success: ProjectWriteFileResult,
|
|
23428
23429
|
error: Union([ProjectWriteFileError, EnvironmentAuthorizationError])
|
|
23429
23430
|
});
|
|
23430
|
-
const WsShellOpenInEditorRpc = make$
|
|
23431
|
+
const WsShellOpenInEditorRpc = make$51(WS_METHODS.shellOpenInEditor, {
|
|
23431
23432
|
payload: LaunchEditorInput,
|
|
23432
23433
|
error: Union([ExternalLauncherError, EnvironmentAuthorizationError])
|
|
23433
23434
|
});
|
|
23434
|
-
const WsFilesystemBrowseRpc = make$
|
|
23435
|
+
const WsFilesystemBrowseRpc = make$51(WS_METHODS.filesystemBrowse, {
|
|
23435
23436
|
payload: FilesystemBrowseInput,
|
|
23436
23437
|
success: FilesystemBrowseResult,
|
|
23437
23438
|
error: Union([FilesystemBrowseError, EnvironmentAuthorizationError])
|
|
23438
23439
|
});
|
|
23439
|
-
const WsAssetsCreateUrlRpc = make$
|
|
23440
|
+
const WsAssetsCreateUrlRpc = make$51(WS_METHODS.assetsCreateUrl, {
|
|
23440
23441
|
payload: AssetCreateUrlInput,
|
|
23441
23442
|
success: AssetCreateUrlResult,
|
|
23442
23443
|
error: Union([AssetAccessError, EnvironmentAuthorizationError])
|
|
23443
23444
|
});
|
|
23444
|
-
const WsSubscribeVcsStatusRpc = make$
|
|
23445
|
+
const WsSubscribeVcsStatusRpc = make$51(WS_METHODS.subscribeVcsStatus, {
|
|
23445
23446
|
payload: VcsStatusInput,
|
|
23446
23447
|
success: VcsStatusStreamEvent,
|
|
23447
23448
|
error: Union([GitManagerServiceError, EnvironmentAuthorizationError]),
|
|
23448
23449
|
stream: true
|
|
23449
23450
|
});
|
|
23450
|
-
const WsVcsPullRpc = make$
|
|
23451
|
+
const WsVcsPullRpc = make$51(WS_METHODS.vcsPull, {
|
|
23451
23452
|
payload: VcsPullInput,
|
|
23452
23453
|
success: VcsPullResult,
|
|
23453
23454
|
error: Union([GitCommandError, EnvironmentAuthorizationError])
|
|
23454
23455
|
});
|
|
23455
|
-
const WsVcsRefreshStatusRpc = make$
|
|
23456
|
+
const WsVcsRefreshStatusRpc = make$51(WS_METHODS.vcsRefreshStatus, {
|
|
23456
23457
|
payload: VcsStatusInput,
|
|
23457
23458
|
success: VcsStatusResult,
|
|
23458
23459
|
error: Union([GitManagerServiceError, EnvironmentAuthorizationError])
|
|
23459
23460
|
});
|
|
23460
|
-
const WsGitRunStackedActionRpc = make$
|
|
23461
|
+
const WsGitRunStackedActionRpc = make$51(WS_METHODS.gitRunStackedAction, {
|
|
23461
23462
|
payload: GitRunStackedActionInput,
|
|
23462
23463
|
success: GitActionProgressEvent,
|
|
23463
23464
|
error: Union([GitManagerServiceError, EnvironmentAuthorizationError]),
|
|
23464
23465
|
stream: true
|
|
23465
23466
|
});
|
|
23466
|
-
const WsGitResolvePullRequestRpc = make$
|
|
23467
|
+
const WsGitResolvePullRequestRpc = make$51(WS_METHODS.gitResolvePullRequest, {
|
|
23467
23468
|
payload: GitPullRequestRefInput,
|
|
23468
23469
|
success: GitResolvePullRequestResult,
|
|
23469
23470
|
error: Union([GitManagerServiceError, EnvironmentAuthorizationError])
|
|
23470
23471
|
});
|
|
23471
|
-
const WsGitPreparePullRequestThreadRpc = make$
|
|
23472
|
+
const WsGitPreparePullRequestThreadRpc = make$51(WS_METHODS.gitPreparePullRequestThread, {
|
|
23472
23473
|
payload: GitPreparePullRequestThreadInput,
|
|
23473
23474
|
success: GitPreparePullRequestThreadResult,
|
|
23474
23475
|
error: Union([GitManagerServiceError, EnvironmentAuthorizationError])
|
|
23475
23476
|
});
|
|
23476
|
-
const WsVcsListRefsRpc = make$
|
|
23477
|
+
const WsVcsListRefsRpc = make$51(WS_METHODS.vcsListRefs, {
|
|
23477
23478
|
payload: VcsListRefsInput,
|
|
23478
23479
|
success: VcsListRefsResult,
|
|
23479
23480
|
error: Union([GitCommandError, EnvironmentAuthorizationError])
|
|
23480
23481
|
});
|
|
23481
|
-
const WsVcsCreateWorktreeRpc = make$
|
|
23482
|
+
const WsVcsCreateWorktreeRpc = make$51(WS_METHODS.vcsCreateWorktree, {
|
|
23482
23483
|
payload: VcsCreateWorktreeInput,
|
|
23483
23484
|
success: VcsCreateWorktreeResult,
|
|
23484
23485
|
error: Union([GitCommandError, EnvironmentAuthorizationError])
|
|
23485
23486
|
});
|
|
23486
|
-
const WsVcsRemoveWorktreeRpc = make$
|
|
23487
|
+
const WsVcsRemoveWorktreeRpc = make$51(WS_METHODS.vcsRemoveWorktree, {
|
|
23487
23488
|
payload: VcsRemoveWorktreeInput,
|
|
23488
23489
|
error: Union([GitCommandError, EnvironmentAuthorizationError])
|
|
23489
23490
|
});
|
|
23490
|
-
const WsVcsCreateRefRpc = make$
|
|
23491
|
+
const WsVcsCreateRefRpc = make$51(WS_METHODS.vcsCreateRef, {
|
|
23491
23492
|
payload: VcsCreateRefInput,
|
|
23492
23493
|
success: VcsCreateRefResult,
|
|
23493
23494
|
error: Union([GitCommandError, EnvironmentAuthorizationError])
|
|
23494
23495
|
});
|
|
23495
|
-
const WsVcsSwitchRefRpc = make$
|
|
23496
|
+
const WsVcsSwitchRefRpc = make$51(WS_METHODS.vcsSwitchRef, {
|
|
23496
23497
|
payload: VcsSwitchRefInput,
|
|
23497
23498
|
success: VcsSwitchRefResult,
|
|
23498
23499
|
error: Union([GitCommandError, EnvironmentAuthorizationError])
|
|
23499
23500
|
});
|
|
23500
|
-
const WsVcsInitRpc = make$
|
|
23501
|
+
const WsVcsInitRpc = make$51(WS_METHODS.vcsInit, {
|
|
23501
23502
|
payload: VcsInitInput,
|
|
23502
23503
|
error: Union([VcsError, EnvironmentAuthorizationError])
|
|
23503
23504
|
});
|
|
@@ -23506,159 +23507,159 @@ const WsVcsInitRpc = make$48(WS_METHODS.vcsInit, {
|
|
|
23506
23507
|
* Not the persisted T3 Review model. Future review sessions should use
|
|
23507
23508
|
* review.open* + review.getSnapshot.
|
|
23508
23509
|
*/
|
|
23509
|
-
const WsReviewGetDiffPreviewRpc = make$
|
|
23510
|
+
const WsReviewGetDiffPreviewRpc = make$51(WS_METHODS.reviewGetDiffPreview, {
|
|
23510
23511
|
payload: ReviewDiffPreviewInput,
|
|
23511
23512
|
success: ReviewDiffPreviewResult,
|
|
23512
23513
|
error: Union([ReviewDiffPreviewError, EnvironmentAuthorizationError])
|
|
23513
23514
|
});
|
|
23514
|
-
const WsReviewGetDiffFileContentsRpc = make$
|
|
23515
|
+
const WsReviewGetDiffFileContentsRpc = make$51(WS_METHODS.reviewGetDiffFileContents, {
|
|
23515
23516
|
payload: ReviewDiffFileContentsInput,
|
|
23516
23517
|
success: ReviewDiffFileContentsResult,
|
|
23517
23518
|
error: Union([ReviewDiffPreviewError, EnvironmentAuthorizationError])
|
|
23518
23519
|
});
|
|
23519
|
-
const WsTerminalOpenRpc = make$
|
|
23520
|
+
const WsTerminalOpenRpc = make$51(WS_METHODS.terminalOpen, {
|
|
23520
23521
|
payload: TerminalOpenInput,
|
|
23521
23522
|
success: TerminalSessionSnapshot,
|
|
23522
23523
|
error: Union([TerminalError, EnvironmentAuthorizationError])
|
|
23523
23524
|
});
|
|
23524
|
-
const WsTerminalAttachRpc = make$
|
|
23525
|
+
const WsTerminalAttachRpc = make$51(WS_METHODS.terminalAttach, {
|
|
23525
23526
|
payload: TerminalAttachInput,
|
|
23526
23527
|
success: TerminalAttachStreamEvent,
|
|
23527
23528
|
error: Union([TerminalError, EnvironmentAuthorizationError]),
|
|
23528
23529
|
stream: true
|
|
23529
23530
|
});
|
|
23530
|
-
const WsTerminalWriteRpc = make$
|
|
23531
|
+
const WsTerminalWriteRpc = make$51(WS_METHODS.terminalWrite, {
|
|
23531
23532
|
payload: TerminalWriteInput,
|
|
23532
23533
|
error: Union([TerminalError, EnvironmentAuthorizationError])
|
|
23533
23534
|
});
|
|
23534
|
-
const WsTerminalResizeRpc = make$
|
|
23535
|
+
const WsTerminalResizeRpc = make$51(WS_METHODS.terminalResize, {
|
|
23535
23536
|
payload: TerminalResizeInput,
|
|
23536
23537
|
error: Union([TerminalError, EnvironmentAuthorizationError])
|
|
23537
23538
|
});
|
|
23538
|
-
const WsTerminalClearRpc = make$
|
|
23539
|
+
const WsTerminalClearRpc = make$51(WS_METHODS.terminalClear, {
|
|
23539
23540
|
payload: TerminalClearInput,
|
|
23540
23541
|
error: Union([TerminalError, EnvironmentAuthorizationError])
|
|
23541
23542
|
});
|
|
23542
|
-
const WsTerminalRestartRpc = make$
|
|
23543
|
+
const WsTerminalRestartRpc = make$51(WS_METHODS.terminalRestart, {
|
|
23543
23544
|
payload: TerminalRestartInput,
|
|
23544
23545
|
success: TerminalSessionSnapshot,
|
|
23545
23546
|
error: Union([TerminalError, EnvironmentAuthorizationError])
|
|
23546
23547
|
});
|
|
23547
|
-
const WsTerminalCloseRpc = make$
|
|
23548
|
+
const WsTerminalCloseRpc = make$51(WS_METHODS.terminalClose, {
|
|
23548
23549
|
payload: TerminalCloseInput,
|
|
23549
23550
|
error: Union([TerminalError, EnvironmentAuthorizationError])
|
|
23550
23551
|
});
|
|
23551
|
-
const WsPreviewOpenRpc = make$
|
|
23552
|
+
const WsPreviewOpenRpc = make$51(WS_METHODS.previewOpen, {
|
|
23552
23553
|
payload: PreviewOpenInput,
|
|
23553
23554
|
success: PreviewSessionSnapshot,
|
|
23554
23555
|
error: Union([PreviewError, EnvironmentAuthorizationError])
|
|
23555
23556
|
});
|
|
23556
|
-
const WsPreviewNavigateRpc = make$
|
|
23557
|
+
const WsPreviewNavigateRpc = make$51(WS_METHODS.previewNavigate, {
|
|
23557
23558
|
payload: PreviewNavigateInput,
|
|
23558
23559
|
success: PreviewSessionSnapshot,
|
|
23559
23560
|
error: Union([PreviewError, EnvironmentAuthorizationError])
|
|
23560
23561
|
});
|
|
23561
|
-
const WsPreviewResizeRpc = make$
|
|
23562
|
+
const WsPreviewResizeRpc = make$51(WS_METHODS.previewResize, {
|
|
23562
23563
|
payload: PreviewResizeInput,
|
|
23563
23564
|
success: PreviewSessionSnapshot,
|
|
23564
23565
|
error: Union([PreviewError, EnvironmentAuthorizationError])
|
|
23565
23566
|
});
|
|
23566
|
-
const WsPreviewRefreshRpc = make$
|
|
23567
|
+
const WsPreviewRefreshRpc = make$51(WS_METHODS.previewRefresh, {
|
|
23567
23568
|
payload: PreviewRefreshInput,
|
|
23568
23569
|
error: Union([PreviewError, EnvironmentAuthorizationError])
|
|
23569
23570
|
});
|
|
23570
|
-
const WsPreviewCloseRpc = make$
|
|
23571
|
+
const WsPreviewCloseRpc = make$51(WS_METHODS.previewClose, {
|
|
23571
23572
|
payload: PreviewCloseInput,
|
|
23572
23573
|
error: Union([PreviewError, EnvironmentAuthorizationError])
|
|
23573
23574
|
});
|
|
23574
|
-
const WsPreviewListRpc = make$
|
|
23575
|
+
const WsPreviewListRpc = make$51(WS_METHODS.previewList, {
|
|
23575
23576
|
payload: PreviewListInput,
|
|
23576
23577
|
success: PreviewListResult,
|
|
23577
23578
|
error: EnvironmentAuthorizationError
|
|
23578
23579
|
});
|
|
23579
|
-
const WsPreviewReportStatusRpc = make$
|
|
23580
|
+
const WsPreviewReportStatusRpc = make$51(WS_METHODS.previewReportStatus, {
|
|
23580
23581
|
payload: PreviewReportStatusInput,
|
|
23581
23582
|
error: Union([PreviewError, EnvironmentAuthorizationError])
|
|
23582
23583
|
});
|
|
23583
|
-
const WsPreviewAutomationConnectRpc = make$
|
|
23584
|
+
const WsPreviewAutomationConnectRpc = make$51(WS_METHODS.previewAutomationConnect, {
|
|
23584
23585
|
payload: PreviewAutomationHost,
|
|
23585
23586
|
success: PreviewAutomationStreamEvent,
|
|
23586
23587
|
error: Union([PreviewAutomationError, EnvironmentAuthorizationError]),
|
|
23587
23588
|
stream: true
|
|
23588
23589
|
});
|
|
23589
|
-
const WsPreviewAutomationRespondRpc = make$
|
|
23590
|
+
const WsPreviewAutomationRespondRpc = make$51(WS_METHODS.previewAutomationRespond, {
|
|
23590
23591
|
payload: PreviewAutomationResponse,
|
|
23591
23592
|
error: Union([PreviewAutomationError, EnvironmentAuthorizationError])
|
|
23592
23593
|
});
|
|
23593
|
-
const WsPreviewAutomationFocusHostRpc = make$
|
|
23594
|
+
const WsPreviewAutomationFocusHostRpc = make$51(WS_METHODS.previewAutomationFocusHost, {
|
|
23594
23595
|
payload: PreviewAutomationHostFocus,
|
|
23595
23596
|
error: EnvironmentAuthorizationError
|
|
23596
23597
|
});
|
|
23597
|
-
const WsSubscribePreviewEventsRpc = make$
|
|
23598
|
+
const WsSubscribePreviewEventsRpc = make$51(WS_METHODS.subscribePreviewEvents, {
|
|
23598
23599
|
payload: Struct({}),
|
|
23599
23600
|
success: PreviewEvent,
|
|
23600
23601
|
error: EnvironmentAuthorizationError,
|
|
23601
23602
|
stream: true
|
|
23602
23603
|
});
|
|
23603
|
-
const WsSubscribeDiscoveredLocalServersRpc = make$
|
|
23604
|
+
const WsSubscribeDiscoveredLocalServersRpc = make$51(WS_METHODS.subscribeDiscoveredLocalServers, {
|
|
23604
23605
|
payload: Struct({}),
|
|
23605
23606
|
success: DiscoveredLocalServerList,
|
|
23606
23607
|
error: EnvironmentAuthorizationError,
|
|
23607
23608
|
stream: true
|
|
23608
23609
|
});
|
|
23609
|
-
const WsOrchestrationDispatchCommandRpc = make$
|
|
23610
|
+
const WsOrchestrationDispatchCommandRpc = make$51(ORCHESTRATION_WS_METHODS.dispatchCommand, {
|
|
23610
23611
|
payload: ClientOrchestrationCommand,
|
|
23611
23612
|
success: OrchestrationRpcSchemas.dispatchCommand.output,
|
|
23612
23613
|
error: Union([OrchestrationDispatchCommandError, EnvironmentAuthorizationError])
|
|
23613
23614
|
});
|
|
23614
|
-
const WsOrchestrationGetWorkflowScriptRpc = make$
|
|
23615
|
+
const WsOrchestrationGetWorkflowScriptRpc = make$51(ORCHESTRATION_WS_METHODS.getWorkflowScript, {
|
|
23615
23616
|
payload: OrchestrationRpcSchemas.getWorkflowScript.input,
|
|
23616
23617
|
success: OrchestrationRpcSchemas.getWorkflowScript.output,
|
|
23617
23618
|
error: Union([OrchestrationGetWorkflowScriptError, EnvironmentAuthorizationError])
|
|
23618
23619
|
});
|
|
23619
|
-
const WsOrchestrationGetTurnDiffRpc = make$
|
|
23620
|
+
const WsOrchestrationGetTurnDiffRpc = make$51(ORCHESTRATION_WS_METHODS.getTurnDiff, {
|
|
23620
23621
|
payload: OrchestrationGetTurnDiffInput,
|
|
23621
23622
|
success: OrchestrationRpcSchemas.getTurnDiff.output,
|
|
23622
23623
|
error: Union([OrchestrationGetTurnDiffError, EnvironmentAuthorizationError])
|
|
23623
23624
|
});
|
|
23624
|
-
const WsOrchestrationGetFullThreadDiffRpc = make$
|
|
23625
|
+
const WsOrchestrationGetFullThreadDiffRpc = make$51(ORCHESTRATION_WS_METHODS.getFullThreadDiff, {
|
|
23625
23626
|
payload: OrchestrationGetFullThreadDiffInput,
|
|
23626
23627
|
success: OrchestrationRpcSchemas.getFullThreadDiff.output,
|
|
23627
23628
|
error: Union([OrchestrationGetFullThreadDiffError, EnvironmentAuthorizationError])
|
|
23628
23629
|
});
|
|
23629
|
-
const WsOrchestrationSearchThreadsRpc = make$
|
|
23630
|
+
const WsOrchestrationSearchThreadsRpc = make$51(ORCHESTRATION_WS_METHODS.searchThreads, {
|
|
23630
23631
|
payload: OrchestrationSearchThreadsInput,
|
|
23631
23632
|
success: OrchestrationRpcSchemas.searchThreads.output,
|
|
23632
23633
|
error: Union([OrchestrationSearchThreadsError, EnvironmentAuthorizationError])
|
|
23633
23634
|
});
|
|
23634
|
-
const WsOrchestrationGetArchivedShellSnapshotRpc = make$
|
|
23635
|
+
const WsOrchestrationGetArchivedShellSnapshotRpc = make$51(ORCHESTRATION_WS_METHODS.getArchivedShellSnapshot, {
|
|
23635
23636
|
payload: OrchestrationRpcSchemas.getArchivedShellSnapshot.input,
|
|
23636
23637
|
success: OrchestrationRpcSchemas.getArchivedShellSnapshot.output,
|
|
23637
23638
|
error: Union([OrchestrationGetSnapshotError, EnvironmentAuthorizationError])
|
|
23638
23639
|
});
|
|
23639
|
-
const WsOrchestrationSubscribeShellRpc = make$
|
|
23640
|
+
const WsOrchestrationSubscribeShellRpc = make$51(ORCHESTRATION_WS_METHODS.subscribeShell, {
|
|
23640
23641
|
payload: OrchestrationRpcSchemas.subscribeShell.input,
|
|
23641
23642
|
success: OrchestrationRpcSchemas.subscribeShell.output,
|
|
23642
23643
|
error: Union([OrchestrationGetSnapshotError, EnvironmentAuthorizationError]),
|
|
23643
23644
|
stream: true
|
|
23644
23645
|
});
|
|
23645
|
-
const WsOrchestrationSubscribeThreadRpc = make$
|
|
23646
|
+
const WsOrchestrationSubscribeThreadRpc = make$51(ORCHESTRATION_WS_METHODS.subscribeThread, {
|
|
23646
23647
|
payload: OrchestrationRpcSchemas.subscribeThread.input,
|
|
23647
23648
|
success: OrchestrationRpcSchemas.subscribeThread.output,
|
|
23648
23649
|
error: Union([OrchestrationGetSnapshotError, EnvironmentAuthorizationError]),
|
|
23649
23650
|
stream: true
|
|
23650
23651
|
});
|
|
23651
|
-
const WsRpcGroup = make$
|
|
23652
|
+
const WsRpcGroup = make$50(WsServerProbeRpc, WsServerGetConfigRpc, WsServerRefreshProvidersRpc, WsServerUpdateProviderRpc, WsServerUpdateServerRpc, WsServerUpdateServerWithProgressRpc, WsServerUpsertKeybindingRpc, WsServerRemoveKeybindingRpc, WsServerGetSettingsRpc, WsServerUpdateSettingsRpc, WsServerDiscoverSourceControlRpc, WsServerGetTraceDiagnosticsRpc, WsServerGetProcessDiagnosticsRpc, WsServerGetProcessResourceHistoryRpc, WsServerGetResourceTelemetryHistoryRpc, WsServerRetryResourceTelemetryRpc, WsServerSignalProcessRpc, WsServerReportClientActivityRpc, WsServerReportHostPowerStateRpc, WsServerGetBackgroundPolicyRpc, WsCloudGetRelayClientStatusRpc, WsCloudInstallRelayClientRpc, WsSourceControlLookupRepositoryRpc, WsSourceControlCloneRepositoryRpc, WsSourceControlPublishRepositoryRpc, WsProjectsListEntriesRpc, WsProjectsReadFileRpc, WsProjectsSearchContentsRpc, WsProjectsSearchEntriesRpc, WsProjectsWriteFileRpc, WsShellOpenInEditorRpc, WsFilesystemBrowseRpc, WsAssetsCreateUrlRpc, WsSubscribeVcsStatusRpc, WsVcsPullRpc, WsVcsRefreshStatusRpc, WsGitRunStackedActionRpc, WsGitResolvePullRequestRpc, WsGitPreparePullRequestThreadRpc, WsVcsListRefsRpc, WsVcsCreateWorktreeRpc, WsVcsRemoveWorktreeRpc, WsVcsCreateRefRpc, WsVcsSwitchRefRpc, WsVcsInitRpc, WsReviewGetDiffPreviewRpc, WsReviewGetDiffFileContentsRpc, WsTerminalOpenRpc, WsTerminalAttachRpc, WsTerminalWriteRpc, WsTerminalResizeRpc, WsTerminalClearRpc, WsTerminalRestartRpc, WsTerminalCloseRpc, make$51(WS_METHODS.subscribeTerminalEvents, {
|
|
23652
23653
|
payload: Struct({}),
|
|
23653
23654
|
success: TerminalEvent,
|
|
23654
23655
|
error: EnvironmentAuthorizationError,
|
|
23655
23656
|
stream: true
|
|
23656
|
-
}), make$
|
|
23657
|
+
}), make$51(WS_METHODS.subscribeTerminalMetadata, {
|
|
23657
23658
|
payload: Struct({}),
|
|
23658
23659
|
success: TerminalMetadataStreamEvent,
|
|
23659
23660
|
error: EnvironmentAuthorizationError,
|
|
23660
23661
|
stream: true
|
|
23661
|
-
}), WsPreviewOpenRpc, WsPreviewNavigateRpc, WsPreviewResizeRpc, WsPreviewRefreshRpc, WsPreviewCloseRpc, WsPreviewListRpc, WsPreviewReportStatusRpc, WsPreviewAutomationConnectRpc, WsPreviewAutomationRespondRpc, WsPreviewAutomationFocusHostRpc, WsSubscribePreviewEventsRpc, WsSubscribeDiscoveredLocalServersRpc, make$
|
|
23662
|
+
}), WsPreviewOpenRpc, WsPreviewNavigateRpc, WsPreviewResizeRpc, WsPreviewRefreshRpc, WsPreviewCloseRpc, WsPreviewListRpc, WsPreviewReportStatusRpc, WsPreviewAutomationConnectRpc, WsPreviewAutomationRespondRpc, WsPreviewAutomationFocusHostRpc, WsSubscribePreviewEventsRpc, WsSubscribeDiscoveredLocalServersRpc, make$51(WS_METHODS.subscribeServerConfig, {
|
|
23662
23663
|
payload: Struct({}),
|
|
23663
23664
|
success: ServerConfigStreamEvent,
|
|
23664
23665
|
error: Union([
|
|
@@ -23667,22 +23668,22 @@ const WsRpcGroup = make$47(WsServerProbeRpc, WsServerGetConfigRpc, WsServerRefre
|
|
|
23667
23668
|
EnvironmentAuthorizationError
|
|
23668
23669
|
]),
|
|
23669
23670
|
stream: true
|
|
23670
|
-
}), make$
|
|
23671
|
+
}), make$51(WS_METHODS.subscribeServerLifecycle, {
|
|
23671
23672
|
payload: Struct({}),
|
|
23672
23673
|
success: ServerLifecycleStreamEvent,
|
|
23673
23674
|
error: EnvironmentAuthorizationError,
|
|
23674
23675
|
stream: true
|
|
23675
|
-
}), make$
|
|
23676
|
+
}), make$51(WS_METHODS.subscribeAuthAccess, {
|
|
23676
23677
|
payload: Struct({}),
|
|
23677
23678
|
success: AuthAccessStreamEvent,
|
|
23678
23679
|
error: Union([AuthAccessStreamError, EnvironmentAuthorizationError]),
|
|
23679
23680
|
stream: true
|
|
23680
|
-
}), make$
|
|
23681
|
+
}), make$51(WS_METHODS.subscribeBackgroundPolicy, {
|
|
23681
23682
|
payload: Struct({}),
|
|
23682
23683
|
success: BackgroundPolicySnapshot,
|
|
23683
23684
|
error: EnvironmentAuthorizationError,
|
|
23684
23685
|
stream: true
|
|
23685
|
-
}), make$
|
|
23686
|
+
}), make$51(WS_METHODS.subscribeResourceTelemetry, {
|
|
23686
23687
|
payload: Struct({}),
|
|
23687
23688
|
success: ResourceTelemetrySnapshot,
|
|
23688
23689
|
error: EnvironmentAuthorizationError,
|
|
@@ -23750,8 +23751,8 @@ var ServerConfig = class extends Service$2()("t3/config/ServerConfig") {
|
|
|
23750
23751
|
/** @deprecated Import and use `layerTest` from this module. */
|
|
23751
23752
|
static layerTest = (cwd, baseDirOrPrefix) => layerTest$2(cwd, baseDirOrPrefix);
|
|
23752
23753
|
};
|
|
23753
|
-
const make$
|
|
23754
|
-
const layer$
|
|
23754
|
+
const make$49 = (config) => ServerConfig.of(config);
|
|
23755
|
+
const layer$39 = (config) => succeed$3(ServerConfig, make$49(config));
|
|
23755
23756
|
const deriveServerPaths = fn(function* (baseDir, devUrl, options = {}) {
|
|
23756
23757
|
const { join } = yield* Path;
|
|
23757
23758
|
const stateDir = join(baseDir, devUrl !== void 0 && !options.baseDirIsExplicit ? "dev" : "userdata");
|
|
@@ -23947,7 +23948,7 @@ function deriveAuthClientMetadata(input) {
|
|
|
23947
23948
|
//#endregion
|
|
23948
23949
|
//#region src/auth/EnvironmentAuthPolicy.ts
|
|
23949
23950
|
var EnvironmentAuthPolicy = class extends Service$2()("t3/auth/EnvironmentAuthPolicy") {};
|
|
23950
|
-
const layer$
|
|
23951
|
+
const layer$38 = effect(EnvironmentAuthPolicy, gen(function* () {
|
|
23951
23952
|
const config = yield* ServerConfig;
|
|
23952
23953
|
const isRemoteReachable = isRemoteReachableHost(config.host);
|
|
23953
23954
|
const policy = config.mode === "desktop" ? isRemoteReachable ? "remote-reachable" : "desktop-managed-local" : isRemoteReachable ? "remote-reachable" : "loopback-browser";
|
|
@@ -24159,7 +24160,7 @@ function toPersistenceSqlOrDecodeError$6(sqlOperation, decodeOperation, correlat
|
|
|
24159
24160
|
cause
|
|
24160
24161
|
});
|
|
24161
24162
|
}
|
|
24162
|
-
const layer$
|
|
24163
|
+
const layer$37 = effect(AuthPairingLinkRepository, gen(function* () {
|
|
24163
24164
|
const sql = yield* SqlClient;
|
|
24164
24165
|
const createPairingLinkRow = void_({
|
|
24165
24166
|
Request: CreateAuthPairingLinkInput,
|
|
@@ -24387,11 +24388,11 @@ const DEV_STARTUP_TTL_HOURS = hours(24);
|
|
|
24387
24388
|
const PAIRING_TOKEN_ALPHABET = "23456789ABCDEFGHJKLMNPQRSTUVWXYZ";
|
|
24388
24389
|
const PAIRING_TOKEN_LENGTH = 12;
|
|
24389
24390
|
const PAIRING_TOKEN_REJECTION_LIMIT = Math.floor(256 / 32) * 32;
|
|
24390
|
-
const layer$
|
|
24391
|
+
const layer$36 = effect(PairingGrantStore, gen(function* () {
|
|
24391
24392
|
const crypto = yield* Crypto;
|
|
24392
24393
|
const config = yield* ServerConfig;
|
|
24393
24394
|
const pairingLinks = yield* AuthPairingLinkRepository;
|
|
24394
|
-
const seededGrantsRef = yield* make$
|
|
24395
|
+
const seededGrantsRef = yield* make$63(/* @__PURE__ */ new Map());
|
|
24395
24396
|
const changesPubSub = yield* unbounded$1();
|
|
24396
24397
|
const generatePairingToken = gen(function* () {
|
|
24397
24398
|
let credential = "";
|
|
@@ -24422,18 +24423,18 @@ const layer$33 = effect(PairingGrantStore, gen(function* () {
|
|
|
24422
24423
|
id
|
|
24423
24424
|
}).pipe(asVoid);
|
|
24424
24425
|
if (config.desktopBootstrapToken) {
|
|
24425
|
-
const now
|
|
24426
|
+
const now = yield* now$1;
|
|
24426
24427
|
yield* seedGrant(config.desktopBootstrapToken, {
|
|
24427
24428
|
method: "desktop-bootstrap",
|
|
24428
24429
|
scopes: AuthAdministrativeScopes,
|
|
24429
24430
|
subject: "desktop-bootstrap",
|
|
24430
|
-
expiresAt: add$3(now
|
|
24431
|
+
expiresAt: add$3(now, { milliseconds: toMillis(DESKTOP_BOOTSTRAP_TTL_HOURS) }),
|
|
24431
24432
|
remainingUses: "unbounded"
|
|
24432
24433
|
});
|
|
24433
24434
|
}
|
|
24434
24435
|
const listActive = fn("PairingGrantStore.listActive")(function* () {
|
|
24435
|
-
const now
|
|
24436
|
-
return (yield* pairingLinks.listActive({ now
|
|
24436
|
+
const now = yield* now$1;
|
|
24437
|
+
return (yield* pairingLinks.listActive({ now })).map((row) => row.label ? {
|
|
24437
24438
|
id: row.id,
|
|
24438
24439
|
credential: row.credential,
|
|
24439
24440
|
scopes: row.scopes,
|
|
@@ -24451,7 +24452,7 @@ const layer$33 = effect(PairingGrantStore, gen(function* () {
|
|
|
24451
24452
|
});
|
|
24452
24453
|
}, mapError((cause) => new ActivePairingLinksLoadError({ cause })));
|
|
24453
24454
|
const revoke = fn("PairingGrantStore.revoke")(function* (id) {
|
|
24454
|
-
const revokedAt = yield* now;
|
|
24455
|
+
const revokedAt = yield* now$1;
|
|
24455
24456
|
const revoked = yield* pairingLinks.revoke({
|
|
24456
24457
|
id,
|
|
24457
24458
|
revokedAt
|
|
@@ -24470,8 +24471,8 @@ const layer$33 = effect(PairingGrantStore, gen(function* () {
|
|
|
24470
24471
|
const credential = yield* generatePairingToken;
|
|
24471
24472
|
const isDevStartupToken = config.devUrl !== void 0 && input?.purpose === "startup";
|
|
24472
24473
|
const ttl = input?.ttl ?? (isDevStartupToken ? DEV_STARTUP_TTL_HOURS : DEFAULT_ONE_TIME_TOKEN_TTL_MINUTES);
|
|
24473
|
-
const now
|
|
24474
|
-
const expiresAt = add$3(now
|
|
24474
|
+
const now = yield* now$1;
|
|
24475
|
+
const expiresAt = add$3(now, { milliseconds: toMillis(ttl) });
|
|
24475
24476
|
const issued = {
|
|
24476
24477
|
id,
|
|
24477
24478
|
credential,
|
|
@@ -24488,7 +24489,7 @@ const layer$33 = effect(PairingGrantStore, gen(function* () {
|
|
|
24488
24489
|
subject,
|
|
24489
24490
|
label: input?.label ?? null,
|
|
24490
24491
|
proofKeyThumbprint: input?.proofKeyThumbprint ?? null,
|
|
24491
|
-
createdAt: now
|
|
24492
|
+
createdAt: now,
|
|
24492
24493
|
expiresAt
|
|
24493
24494
|
}).pipe(mapError((cause) => new PairingCredentialIssueError({
|
|
24494
24495
|
pairingLinkId: id,
|
|
@@ -24502,13 +24503,13 @@ const layer$33 = effect(PairingGrantStore, gen(function* () {
|
|
|
24502
24503
|
scopes: input?.scopes ?? AuthStandardClientScopes,
|
|
24503
24504
|
subject: input?.subject ?? "one-time-token",
|
|
24504
24505
|
...input?.label ? { label: input.label } : {},
|
|
24505
|
-
createdAt: now
|
|
24506
|
+
createdAt: now,
|
|
24506
24507
|
expiresAt
|
|
24507
24508
|
});
|
|
24508
24509
|
return issued;
|
|
24509
24510
|
});
|
|
24510
24511
|
const consume = fn("PairingGrantStore.consume")(function* (credential, input) {
|
|
24511
|
-
const now
|
|
24512
|
+
const now = yield* now$1;
|
|
24512
24513
|
const seededResult = yield* modify$2(seededGrantsRef, (current) => {
|
|
24513
24514
|
const grant = current.get(credential);
|
|
24514
24515
|
if (!grant) return [{
|
|
@@ -24517,7 +24518,7 @@ const layer$33 = effect(PairingGrantStore, gen(function* () {
|
|
|
24517
24518
|
error: new UnknownBootstrapCredentialError({})
|
|
24518
24519
|
}, current];
|
|
24519
24520
|
const next = new Map(current);
|
|
24520
|
-
if (isGreaterThanOrEqualTo$1(now
|
|
24521
|
+
if (isGreaterThanOrEqualTo$1(now, grant.expiresAt)) {
|
|
24521
24522
|
next.delete(credential);
|
|
24522
24523
|
return [{
|
|
24523
24524
|
_tag: "error",
|
|
@@ -24553,8 +24554,8 @@ const layer$33 = effect(PairingGrantStore, gen(function* () {
|
|
|
24553
24554
|
const consumed = yield* pairingLinks.consumeAvailable({
|
|
24554
24555
|
credential,
|
|
24555
24556
|
proofKeyThumbprint: input?.proofKeyThumbprint ?? null,
|
|
24556
|
-
consumedAt: now
|
|
24557
|
-
now
|
|
24557
|
+
consumedAt: now,
|
|
24558
|
+
now
|
|
24558
24559
|
}).pipe(mapError((cause) => new BootstrapCredentialConsumeAvailableError({ cause })));
|
|
24559
24560
|
if (isSome(consumed)) {
|
|
24560
24561
|
yield* emitRemoved(consumed.value.id);
|
|
@@ -24571,7 +24572,7 @@ const layer$33 = effect(PairingGrantStore, gen(function* () {
|
|
|
24571
24572
|
if (isNone(matching)) return yield* new UnknownBootstrapCredentialError({});
|
|
24572
24573
|
if (matching.value.revokedAt !== null) return yield* new UnavailableBootstrapCredentialError({});
|
|
24573
24574
|
if (matching.value.consumedAt !== null) return yield* new UnknownBootstrapCredentialError({});
|
|
24574
|
-
if (isGreaterThanOrEqualTo$1(now
|
|
24575
|
+
if (isGreaterThanOrEqualTo$1(now, matching.value.expiresAt)) return yield* new ExpiredBootstrapCredentialError({});
|
|
24575
24576
|
if (matching.value.proofKeyThumbprint !== null && matching.value.proofKeyThumbprint !== input?.proofKeyThumbprint) return yield* new BootstrapCredentialProofKeyMismatchError({});
|
|
24576
24577
|
return yield* new UnavailableBootstrapCredentialError({});
|
|
24577
24578
|
});
|
|
@@ -24584,7 +24585,7 @@ const layer$33 = effect(PairingGrantStore, gen(function* () {
|
|
|
24584
24585
|
revoke,
|
|
24585
24586
|
consume
|
|
24586
24587
|
});
|
|
24587
|
-
})).pipe(provideMerge(layer$
|
|
24588
|
+
})).pipe(provideMerge(layer$37));
|
|
24588
24589
|
//#endregion
|
|
24589
24590
|
//#region src/auth/ServerSecretStore.ts
|
|
24590
24591
|
const secretStoreErrorContext = {
|
|
@@ -24650,7 +24651,7 @@ const isSecretStoreError = is(Union([
|
|
|
24650
24651
|
const isPlatformError = (value) => isTagged(value, "PlatformError");
|
|
24651
24652
|
const isSecretAlreadyExistsError = (error) => "cause" in error && isPlatformError(error.cause) && error.cause.reason._tag === "AlreadyExists";
|
|
24652
24653
|
var ServerSecretStore = class extends Service$2()("t3/auth/ServerSecretStore") {};
|
|
24653
|
-
const layer$
|
|
24654
|
+
const layer$35 = effect(ServerSecretStore, gen(function* () {
|
|
24654
24655
|
const crypto = yield* Crypto;
|
|
24655
24656
|
const fileSystem = yield* FileSystem;
|
|
24656
24657
|
const path = yield* Path;
|
|
@@ -24831,7 +24832,7 @@ function toPersistenceSqlOrDecodeError$5(sqlOperation, decodeOperation, correlat
|
|
|
24831
24832
|
cause
|
|
24832
24833
|
});
|
|
24833
24834
|
}
|
|
24834
|
-
const layer$
|
|
24835
|
+
const layer$34 = effect(AuthSessionRepository, gen(function* () {
|
|
24835
24836
|
const sql = yield* SqlClient;
|
|
24836
24837
|
const createSessionRow = void_({
|
|
24837
24838
|
Request: CreateAuthSessionInput,
|
|
@@ -25197,13 +25198,13 @@ function toAuthClientSession(input) {
|
|
|
25197
25198
|
current: false
|
|
25198
25199
|
};
|
|
25199
25200
|
}
|
|
25200
|
-
const layer$
|
|
25201
|
+
const layer$33 = effect(SessionStore, gen(function* () {
|
|
25201
25202
|
const crypto = yield* Crypto;
|
|
25202
25203
|
const serverConfig = yield* ServerConfig;
|
|
25203
25204
|
const secretStore = yield* ServerSecretStore;
|
|
25204
25205
|
const authSessions = yield* AuthSessionRepository;
|
|
25205
25206
|
const signingSecret = yield* secretStore.getOrCreateRandom(SIGNING_SECRET_NAME$1, 32);
|
|
25206
|
-
const connectedSessionsRef = yield* make$
|
|
25207
|
+
const connectedSessionsRef = yield* make$63(/* @__PURE__ */ new Map());
|
|
25207
25208
|
const changesPubSub = yield* unbounded$1();
|
|
25208
25209
|
const cookieName = resolveSessionCookieName({
|
|
25209
25210
|
mode: serverConfig.mode,
|
|
@@ -25241,7 +25242,7 @@ const layer$30 = effect(SessionStore, gen(function* () {
|
|
|
25241
25242
|
const wasDisconnected = !next.has(sessionId);
|
|
25242
25243
|
next.set(sessionId, (next.get(sessionId) ?? 0) + 1);
|
|
25243
25244
|
return [wasDisconnected, next];
|
|
25244
|
-
}).pipe(flatMap$1((wasDisconnected) => wasDisconnected ? now.pipe(flatMap$1((lastConnectedAt) => authSessions.setLastConnectedAt({
|
|
25245
|
+
}).pipe(flatMap$1((wasDisconnected) => wasDisconnected ? now$1.pipe(flatMap$1((lastConnectedAt) => authSessions.setLastConnectedAt({
|
|
25245
25246
|
sessionId,
|
|
25246
25247
|
lastConnectedAt
|
|
25247
25248
|
}))) : void_$1), flatMap$1(() => loadActiveSession(sessionId)), flatMap$1((session) => isSome(session) ? emitUpsert(session.value) : void_$1), catchCause((cause) => logError("Failed to publish connected-session auth update.").pipe(annotateLogs({
|
|
@@ -25261,7 +25262,7 @@ const layer$30 = effect(SessionStore, gen(function* () {
|
|
|
25261
25262
|
const encodeClaims = encodeEffect(fromJsonString(SessionClaims));
|
|
25262
25263
|
const issue = fn("SessionStore.issue")(function* (input) {
|
|
25263
25264
|
const sessionId = AuthSessionId.make(yield* crypto.randomUUIDv4.pipe(mapError((cause) => new SessionCredentialIssueError({ cause }))));
|
|
25264
|
-
const issuedAt = yield* now;
|
|
25265
|
+
const issuedAt = yield* now$1;
|
|
25265
25266
|
const expiresAt = add$3(issuedAt, { milliseconds: toMillis(input?.ttl ?? DEFAULT_SESSION_TTL) });
|
|
25266
25267
|
const claims = {
|
|
25267
25268
|
v: 1,
|
|
@@ -25329,8 +25330,8 @@ const layer$30 = effect(SessionStore, gen(function* () {
|
|
|
25329
25330
|
if (!encodedPayload || !signature) return yield* new MalformedSessionTokenError({});
|
|
25330
25331
|
if (!timingSafeEqualBase64Url(signature, signPayload(encodedPayload, signingSecret))) return yield* new InvalidSessionTokenSignatureError({});
|
|
25331
25332
|
const claims = yield* decodeSessionClaims(base64UrlDecodeUtf8(encodedPayload)).pipe(mapError((cause) => new InvalidSessionTokenPayloadError({ cause })));
|
|
25332
|
-
const observedAt = yield* now;
|
|
25333
|
-
const expiresAt = make$
|
|
25333
|
+
const observedAt = yield* now$1;
|
|
25334
|
+
const expiresAt = make$71(claims.exp);
|
|
25334
25335
|
if (isNone(expiresAt)) return yield* new InvalidSessionExpirationClaimError({
|
|
25335
25336
|
sessionId: claims.sid,
|
|
25336
25337
|
expirationClaim: claims.exp
|
|
@@ -25362,7 +25363,7 @@ const layer$30 = effect(SessionStore, gen(function* () {
|
|
|
25362
25363
|
});
|
|
25363
25364
|
const encodeWsClaims = encodeEffect(fromJsonString(WebSocketClaims));
|
|
25364
25365
|
const issueWebSocketToken = fn("SessionStore.issueWebSocketToken")(function* (sessionId, input) {
|
|
25365
|
-
const issuedAt = yield* now;
|
|
25366
|
+
const issuedAt = yield* now$1;
|
|
25366
25367
|
const expiresAt = add$3(issuedAt, { milliseconds: toMillis(input?.ttl ?? DEFAULT_WEBSOCKET_TOKEN_TTL) });
|
|
25367
25368
|
const claims = {
|
|
25368
25369
|
v: 1,
|
|
@@ -25389,8 +25390,8 @@ const layer$30 = effect(SessionStore, gen(function* () {
|
|
|
25389
25390
|
if (!encodedPayload || !signature) return yield* new MalformedWebSocketTokenError({});
|
|
25390
25391
|
if (!timingSafeEqualBase64Url(signature, signPayload(encodedPayload, signingSecret))) return yield* new InvalidWebSocketTokenSignatureError({});
|
|
25391
25392
|
const claims = yield* decodeWebSocketClaims(base64UrlDecodeUtf8(encodedPayload)).pipe(mapError((cause) => new InvalidWebSocketTokenPayloadError({ cause })));
|
|
25392
|
-
const observedAt = yield* now;
|
|
25393
|
-
const expiresAt = make$
|
|
25393
|
+
const observedAt = yield* now$1;
|
|
25394
|
+
const expiresAt = make$71(claims.exp);
|
|
25394
25395
|
if (isNone(expiresAt)) return yield* new InvalidSessionExpirationClaimError({
|
|
25395
25396
|
sessionId: claims.sid,
|
|
25396
25397
|
expirationClaim: claims.exp
|
|
@@ -25425,9 +25426,9 @@ const layer$30 = effect(SessionStore, gen(function* () {
|
|
|
25425
25426
|
};
|
|
25426
25427
|
});
|
|
25427
25428
|
const listActive = fn("SessionStore.listActive")(function* () {
|
|
25428
|
-
const now
|
|
25429
|
+
const now = yield* now$1;
|
|
25429
25430
|
const connectedSessions = yield* get$3(connectedSessionsRef);
|
|
25430
|
-
return (yield* authSessions.listActive({ now
|
|
25431
|
+
return (yield* authSessions.listActive({ now })).map((row) => toAuthClientSession({
|
|
25431
25432
|
sessionId: row.sessionId,
|
|
25432
25433
|
subject: row.subject,
|
|
25433
25434
|
scopes: row.scopes,
|
|
@@ -25440,7 +25441,7 @@ const layer$30 = effect(SessionStore, gen(function* () {
|
|
|
25440
25441
|
}));
|
|
25441
25442
|
}, mapError((cause) => new ActiveSessionsListError({ cause })));
|
|
25442
25443
|
const revoke = fn("SessionStore.revoke")(function* (sessionId) {
|
|
25443
|
-
const revokedAt = yield* now;
|
|
25444
|
+
const revokedAt = yield* now$1;
|
|
25444
25445
|
const revoked = yield* authSessions.revoke({
|
|
25445
25446
|
sessionId,
|
|
25446
25447
|
revokedAt
|
|
@@ -25459,7 +25460,7 @@ const layer$30 = effect(SessionStore, gen(function* () {
|
|
|
25459
25460
|
return revoked;
|
|
25460
25461
|
});
|
|
25461
25462
|
const revokeAllExcept = fn("SessionStore.revokeAllExcept")(function* (sessionId) {
|
|
25462
|
-
const revokedAt = yield* now;
|
|
25463
|
+
const revokedAt = yield* now$1;
|
|
25463
25464
|
const revokedSessionIds = yield* authSessions.revokeAllExcept({
|
|
25464
25465
|
currentSessionId: sessionId,
|
|
25465
25466
|
revokedAt
|
|
@@ -25495,7 +25496,7 @@ const layer$30 = effect(SessionStore, gen(function* () {
|
|
|
25495
25496
|
markConnected,
|
|
25496
25497
|
markDisconnected
|
|
25497
25498
|
});
|
|
25498
|
-
})).pipe(provideMerge(layer$
|
|
25499
|
+
})).pipe(provideMerge(layer$34));
|
|
25499
25500
|
//#endregion
|
|
25500
25501
|
//#region ../../node_modules/.pnpm/@noble+hashes@1.8.0/node_modules/@noble/hashes/esm/cryptoNode.js
|
|
25501
25502
|
/**
|
|
@@ -28246,12 +28247,12 @@ const verifyRequestDpopProof = (input) => gen(function* () {
|
|
|
28246
28247
|
const proof = input.request.headers.dpop;
|
|
28247
28248
|
const url = toURL(input.request);
|
|
28248
28249
|
if (isNone(url)) return yield* new ServerAuthInvalidCredentialError({ diagnostic: "Invalid DPoP request URL." });
|
|
28249
|
-
const now
|
|
28250
|
+
const now = yield* now$1;
|
|
28250
28251
|
const result = verifyDpopProof({
|
|
28251
28252
|
proof,
|
|
28252
28253
|
method: input.request.method,
|
|
28253
28254
|
url: url.value.href,
|
|
28254
|
-
nowEpochSeconds: Math.floor(now
|
|
28255
|
+
nowEpochSeconds: Math.floor(now.epochMilliseconds / 1e3),
|
|
28255
28256
|
...input.expectedThumbprint ? { expectedThumbprint: input.expectedThumbprint } : {},
|
|
28256
28257
|
...input.expectedAccessToken ? { expectedAccessToken: input.expectedAccessToken } : {}
|
|
28257
28258
|
});
|
|
@@ -28262,7 +28263,7 @@ const verifyRequestDpopProof = (input) => gen(function* () {
|
|
|
28262
28263
|
`thumbprint=${result.thumbprint}`,
|
|
28263
28264
|
`jti=${result.jti}`,
|
|
28264
28265
|
`iat=${result.iat}`,
|
|
28265
|
-
`consumedAt=${formatIso(now
|
|
28266
|
+
`consumedAt=${formatIso(now)}`
|
|
28266
28267
|
].join("\n"))).pipe(catchIf(isSecretStoreError, (error) => fail(mapDpopReplayStoreError(error))));
|
|
28267
28268
|
return result.thumbprint;
|
|
28268
28269
|
});
|
|
@@ -28281,7 +28282,7 @@ var MigrationError = class extends TaggedError("MigrationError") {};
|
|
|
28281
28282
|
* @category constructors
|
|
28282
28283
|
* @since 4.0.0
|
|
28283
28284
|
*/
|
|
28284
|
-
const make$
|
|
28285
|
+
const make$42 = ({ dumpSchema = () => void_$1 }) => ({ loader, schemaDirectory, table = "effect_sql_migrations" }) => gen(function* () {
|
|
28285
28286
|
const sql = yield* SqlClient;
|
|
28286
28287
|
const ensureMigrationsTable = sql.onDialectOrElse({
|
|
28287
28288
|
mssql: () => sql`IF OBJECT_ID(N'${sql.literal(table)}', N'U') IS NULL
|
|
@@ -28370,7 +28371,7 @@ const make$39 = ({ dumpSchema = () => void_$1 }) => ({ loader, schemaDirectory,
|
|
|
28370
28371
|
if (schemaDirectory && completed.length > 0) yield* dumpSchema(`${schemaDirectory}/_schema.sql`, table).pipe(catchCause((cause) => logInfo("Could not dump schema", cause)));
|
|
28371
28372
|
return completed;
|
|
28372
28373
|
});
|
|
28373
|
-
const migrationOrder = /*#__PURE__*/ make$
|
|
28374
|
+
const migrationOrder = /*#__PURE__*/ make$72(([a], [b]) => Number$2(a, b));
|
|
28374
28375
|
const isConstraintConflict = (error) => error.reason._tag === "ConstraintError" || error.reason._tag === "UniqueViolation";
|
|
28375
28376
|
/**
|
|
28376
28377
|
* Creates a migration loader from a record of migration effects keyed by
|
|
@@ -29937,7 +29938,7 @@ const makeMigrationLoader = (throughId) => fromRecord(Object.fromEntries(migrati
|
|
|
29937
29938
|
* Migrator run function - no schema dumping needed
|
|
29938
29939
|
* Uses the base Migrator.make without platform dependencies
|
|
29939
29940
|
*/
|
|
29940
|
-
const run = make$
|
|
29941
|
+
const run = make$42({});
|
|
29941
29942
|
/**
|
|
29942
29943
|
* Run all pending migrations.
|
|
29943
29944
|
*
|
|
@@ -29959,7 +29960,7 @@ effectDiscard(runMigrations());
|
|
|
29959
29960
|
//#region src/persistence/Layers/Sqlite.ts
|
|
29960
29961
|
const defaultSqliteClientLoaders = {
|
|
29961
29962
|
bun: () => import("@effect/sql-sqlite-bun/SqliteClient"),
|
|
29962
|
-
node: () => import("./NodeSqliteClient-
|
|
29963
|
+
node: () => import("./NodeSqliteClient-FfrElFAX.mjs")
|
|
29963
29964
|
};
|
|
29964
29965
|
const makeRuntimeSqliteLayer = fn("makeRuntimeSqliteLayer")(function* (config) {
|
|
29965
29966
|
const runtime = process.versions.bun !== void 0 ? "bun" : "node";
|
|
@@ -30184,7 +30185,7 @@ function parseDpopToken(request) {
|
|
|
30184
30185
|
const token = header.slice(5).trim();
|
|
30185
30186
|
return token.length > 0 ? token : null;
|
|
30186
30187
|
}
|
|
30187
|
-
const layer$
|
|
30188
|
+
const layer$32 = effect(EnvironmentAuth, gen(function* () {
|
|
30188
30189
|
const policy = yield* EnvironmentAuthPolicy;
|
|
30189
30190
|
const bootstrapCredentials = yield* PairingGrantStore;
|
|
30190
30191
|
const sessions = yield* SessionStore;
|
|
@@ -30261,7 +30262,7 @@ const layer$29 = effect(EnvironmentAuth, gen(function* () {
|
|
|
30261
30262
|
...grant.label ? { label: grant.label } : {}
|
|
30262
30263
|
}
|
|
30263
30264
|
}).pipe(mapError((cause) => new ServerAuthAuthenticatedAccessTokenIssueError({ cause })));
|
|
30264
|
-
})), flatMap$1((session) => now.pipe(map$4((now) => ({
|
|
30265
|
+
})), flatMap$1((session) => now$1.pipe(map$4((now) => ({
|
|
30265
30266
|
access_token: session.token,
|
|
30266
30267
|
issued_token_type: AuthAccessTokenType,
|
|
30267
30268
|
token_type: input?.proofKeyThumbprint ? "DPoP" : "Bearer",
|
|
@@ -30280,7 +30281,7 @@ const layer$29 = effect(EnvironmentAuth, gen(function* () {
|
|
|
30280
30281
|
expiresAt: issued.expiresAt
|
|
30281
30282
|
})));
|
|
30282
30283
|
const createPairingLink = fn("EnvironmentAuth.createPairingLink")(function* (input) {
|
|
30283
|
-
const createdAt = yield* now;
|
|
30284
|
+
const createdAt = yield* now$1;
|
|
30284
30285
|
const issued = yield* bootstrapCredentials.issueOneTimeToken({
|
|
30285
30286
|
scopes: input?.scopes ?? AuthStandardClientScopes,
|
|
30286
30287
|
subject: input?.subject ?? "one-time-token",
|
|
@@ -30392,9 +30393,9 @@ const layer$29 = effect(EnvironmentAuth, gen(function* () {
|
|
|
30392
30393
|
issueWebSocketTicket,
|
|
30393
30394
|
issueStartupPairingUrl
|
|
30394
30395
|
});
|
|
30395
|
-
})).pipe(provideMerge(layer$
|
|
30396
|
-
const storageLayer = mergeAll(layer$
|
|
30397
|
-
const runtimeLayer = layer$
|
|
30396
|
+
})).pipe(provideMerge(layer$36), provideMerge(layer$33), provideMerge(layer$38));
|
|
30397
|
+
const storageLayer = mergeAll(layer$35, layerConfig);
|
|
30398
|
+
const runtimeLayer = layer$32.pipe(provideMerge(storageLayer));
|
|
30398
30399
|
//#endregion
|
|
30399
30400
|
//#region src/cliAuthFormat.ts
|
|
30400
30401
|
const newline = "\n";
|
|
@@ -31791,7 +31792,7 @@ const runWithEnvironmentAuth = (flags, run, options) => gen(function* () {
|
|
|
31791
31792
|
const minimumLogLevel = options?.quietLogs ? "Error" : config.logLevel;
|
|
31792
31793
|
return yield* gen(function* () {
|
|
31793
31794
|
return yield* run(yield* EnvironmentAuth);
|
|
31794
|
-
}).pipe(provide$1(mergeAll(runtimeLayer).pipe(provide(layer$
|
|
31795
|
+
}).pipe(provide$1(mergeAll(runtimeLayer).pipe(provide(layer$39(config)), provide(succeed$3(MinimumLogLevel, minimumLogLevel)))));
|
|
31795
31796
|
});
|
|
31796
31797
|
const ttlFlag$1 = string("ttl").pipe(withSchema(DurationFromString), withDescription$1("TTL, for example `5m`, `1h`, `30d`, or `15 minutes`."), optional);
|
|
31797
31798
|
const jsonFlag = boolean("json").pipe(withDescription$1("Emit JSON instead of human-readable output."), withDefault(false));
|
|
@@ -31799,7 +31800,7 @@ const labelFlag$1 = string("label").pipe(withDescription$1("Optional human-reada
|
|
|
31799
31800
|
const subjectFlag = string("subject").pipe(withDescription$1("Optional session subject."), optional);
|
|
31800
31801
|
const baseUrlFlag = string("base-url").pipe(withDescription$1("Optional public base URL used to print a ready `/pair#token=...` link."), optional);
|
|
31801
31802
|
const tokenOnlyFlag = boolean("token-only").pipe(withDescription$1("Print only the issued bearer token."), withDefault(false));
|
|
31802
|
-
const pairingCreateCommand = make$
|
|
31803
|
+
const pairingCreateCommand = make$62("create", {
|
|
31803
31804
|
...authLocationFlags,
|
|
31804
31805
|
ttl: ttlFlag$1,
|
|
31805
31806
|
label: labelFlag$1,
|
|
@@ -31817,26 +31818,26 @@ const pairingCreateCommand = make$59("create", {
|
|
|
31817
31818
|
});
|
|
31818
31819
|
yield* log(output);
|
|
31819
31820
|
}), { quietLogs: flags.json })));
|
|
31820
|
-
const pairingListCommand = make$
|
|
31821
|
+
const pairingListCommand = make$62("list", {
|
|
31821
31822
|
...authLocationFlags,
|
|
31822
31823
|
json: jsonFlag
|
|
31823
31824
|
}).pipe(withDescription("List active client pairing tokens without revealing their secrets."), withHandler((flags) => runWithEnvironmentAuth(flags, (environmentAuth) => gen(function* () {
|
|
31824
31825
|
const pairingLinks = yield* environmentAuth.listPairingLinks({ excludeSubjects: [INTERNAL_ADMINISTRATIVE_BOOTSTRAP_SUBJECT] });
|
|
31825
31826
|
yield* log(formatPairingCredentialList(pairingLinks, { json: flags.json }));
|
|
31826
31827
|
}), { quietLogs: flags.json })));
|
|
31827
|
-
const pairingRevokeCommand = make$
|
|
31828
|
+
const pairingRevokeCommand = make$62("revoke", {
|
|
31828
31829
|
...authLocationFlags,
|
|
31829
31830
|
id: string$1("id").pipe(withDescription$2("Pairing credential id to revoke."))
|
|
31830
31831
|
}).pipe(withDescription("Revoke an active client pairing token."), withHandler((flags) => runWithEnvironmentAuth(flags, (environmentAuth) => gen(function* () {
|
|
31831
31832
|
const revoked = yield* environmentAuth.revokePairingLink(flags.id);
|
|
31832
31833
|
yield* log(revoked ? `Revoked pairing credential ${flags.id}.\n` : `No active pairing credential found for ${flags.id}.\n`);
|
|
31833
31834
|
}))));
|
|
31834
|
-
const pairingCommand = make$
|
|
31835
|
+
const pairingCommand = make$62("pairing").pipe(withDescription("Manage one-time client pairing tokens."), withSubcommands([
|
|
31835
31836
|
pairingCreateCommand,
|
|
31836
31837
|
pairingListCommand,
|
|
31837
31838
|
pairingRevokeCommand
|
|
31838
31839
|
]));
|
|
31839
|
-
const sessionIssueCommand = make$
|
|
31840
|
+
const sessionIssueCommand = make$62("issue", {
|
|
31840
31841
|
...authLocationFlags,
|
|
31841
31842
|
ttl: ttlFlag$1,
|
|
31842
31843
|
label: labelFlag$1,
|
|
@@ -31855,26 +31856,26 @@ const sessionIssueCommand = make$59("issue", {
|
|
|
31855
31856
|
tokenOnly: flags.tokenOnly
|
|
31856
31857
|
}));
|
|
31857
31858
|
}), { quietLogs: flags.json || flags.tokenOnly })));
|
|
31858
|
-
const sessionListCommand = make$
|
|
31859
|
+
const sessionListCommand = make$62("list", {
|
|
31859
31860
|
...authLocationFlags,
|
|
31860
31861
|
json: jsonFlag
|
|
31861
31862
|
}).pipe(withDescription("List active sessions without revealing bearer tokens."), withHandler((flags) => runWithEnvironmentAuth(flags, (environmentAuth) => gen(function* () {
|
|
31862
31863
|
const sessions = yield* environmentAuth.listSessions();
|
|
31863
31864
|
yield* log(formatSessionList(sessions, { json: flags.json }));
|
|
31864
31865
|
}), { quietLogs: flags.json })));
|
|
31865
|
-
const sessionRevokeCommand = make$
|
|
31866
|
+
const sessionRevokeCommand = make$62("revoke", {
|
|
31866
31867
|
...authLocationFlags,
|
|
31867
31868
|
sessionId: string$1("session-id").pipe(withDescription$2("Session id to revoke."), withSchema$1(AuthSessionId))
|
|
31868
31869
|
}).pipe(withDescription("Revoke an active session."), withHandler((flags) => runWithEnvironmentAuth(flags, (environmentAuth) => gen(function* () {
|
|
31869
31870
|
const revoked = yield* environmentAuth.revokeSession(flags.sessionId);
|
|
31870
31871
|
yield* log(revoked ? `Revoked session ${flags.sessionId}.\n` : `No active session found for ${flags.sessionId}.\n`);
|
|
31871
31872
|
}))));
|
|
31872
|
-
const sessionCommand = make$
|
|
31873
|
+
const sessionCommand = make$62("session").pipe(withDescription("Manage bearer sessions."), withSubcommands([
|
|
31873
31874
|
sessionIssueCommand,
|
|
31874
31875
|
sessionListCommand,
|
|
31875
31876
|
sessionRevokeCommand
|
|
31876
31877
|
]));
|
|
31877
|
-
const authCommand = make$
|
|
31878
|
+
const authCommand = make$62("auth").pipe(withDescription("Manage the local auth control plane for headless deployments."), withSubcommands([pairingCommand, sessionCommand]));
|
|
31878
31879
|
//#endregion
|
|
31879
31880
|
//#region ../t3-shared/src/devHome.ts
|
|
31880
31881
|
/**
|
|
@@ -32062,7 +32063,7 @@ const readTailscaleStatus = gen(function* () {
|
|
|
32062
32063
|
argumentCount: args.length
|
|
32063
32064
|
};
|
|
32064
32065
|
return yield* gen(function* () {
|
|
32065
|
-
const child = yield* spawner.spawn(make$
|
|
32066
|
+
const child = yield* spawner.spawn(make$79(executable, args)).pipe(mapError((cause) => new TailscaleCommandSpawnError({
|
|
32066
32067
|
...commandContext,
|
|
32067
32068
|
cause
|
|
32068
32069
|
})));
|
|
@@ -32106,7 +32107,7 @@ const runTailscaleCommand = (args, timeoutInput) => gen(function* () {
|
|
|
32106
32107
|
};
|
|
32107
32108
|
const timeout$1 = fromInputUnsafe(timeoutInput);
|
|
32108
32109
|
return yield* gen(function* () {
|
|
32109
|
-
const child = yield* spawner.spawn(make$
|
|
32110
|
+
const child = yield* spawner.spawn(make$79(executable, args)).pipe(mapError((cause) => new TailscaleCommandSpawnError({
|
|
32110
32111
|
...commandContext,
|
|
32111
32112
|
cause
|
|
32112
32113
|
})));
|
|
@@ -33121,7 +33122,7 @@ const decodePersistedServerRuntimeState = decodeUnknownEffect(fromJsonString(Per
|
|
|
33121
33122
|
const runtimeOriginForConfig = (config, port) => {
|
|
33122
33123
|
return `http://${config.host && !isWildcardHost(config.host) ? formatHostForUrl(config.host) : "127.0.0.1"}:${port}`;
|
|
33123
33124
|
};
|
|
33124
|
-
const makePersistedServerRuntimeState = (input) => map$4(now, (now) => ({
|
|
33125
|
+
const makePersistedServerRuntimeState = (input) => map$4(now$1, (now) => ({
|
|
33125
33126
|
version: 1,
|
|
33126
33127
|
pid: process.pid,
|
|
33127
33128
|
...input.config.host ? { host: input.config.host } : {},
|
|
@@ -33323,7 +33324,7 @@ const makePairServerConfig = fn(function* (input) {
|
|
|
33323
33324
|
const { baseDir, variant, state } = input.target;
|
|
33324
33325
|
const devUrl = state.devUrl !== void 0 ? new URL(state.devUrl) : void 0;
|
|
33325
33326
|
const derivedPaths = yield* deriveServerPaths(baseDir, variant === "dev" ? DEV_VARIANT_PLACEHOLDER_URL : void 0, {});
|
|
33326
|
-
return make$
|
|
33327
|
+
return make$49({
|
|
33327
33328
|
logLevel: input.logLevel,
|
|
33328
33329
|
traceMinLevel: "Info",
|
|
33329
33330
|
traceTimingEnabled: false,
|
|
@@ -33409,9 +33410,9 @@ const mintPairingLink = fn("pair.mintPairingLink")(function* (input) {
|
|
|
33409
33410
|
label: getOrElse(input.label, () => "t3 pair"),
|
|
33410
33411
|
...isSome(input.ttl) ? { ttl: input.ttl.value } : {}
|
|
33411
33412
|
});
|
|
33412
|
-
}).pipe(provide$1(runtimeLayer.pipe(provide(layer$
|
|
33413
|
+
}).pipe(provide$1(runtimeLayer.pipe(provide(layer$39(input.config)), provide(succeed$3(MinimumLogLevel, input.config.logLevel)))));
|
|
33413
33414
|
});
|
|
33414
|
-
const pairCommand = make$
|
|
33415
|
+
const pairCommand = make$62("pair", {
|
|
33415
33416
|
baseDir: baseDirFlag,
|
|
33416
33417
|
ttl: string("ttl").pipe(withSchema(DurationFromString), withDescription$1("Token TTL, for example `5m`, `1h`, or `15 minutes`. Defaults to 5 minutes."), optional),
|
|
33417
33418
|
label: string("label").pipe(withDescription$1("Optional label shown in the server's connections list."), optional),
|
|
@@ -33452,7 +33453,7 @@ const pairCommand = make$59("pair", {
|
|
|
33452
33453
|
expiresAt: issued.expiresAt,
|
|
33453
33454
|
notes
|
|
33454
33455
|
}));
|
|
33455
|
-
}).pipe(provide$1(layer$
|
|
33456
|
+
}).pipe(provide$1(layer$43))));
|
|
33456
33457
|
//#endregion
|
|
33457
33458
|
//#region ../../node_modules/.pnpm/effect@4.0.0-beta.103_patch_hash=a18f963109656ddbeb2a99ca45f942ecf54830986259eb01ce6a970421c9c6a9/node_modules/effect/dist/unstable/encoding/Sse.js
|
|
33458
33459
|
const SseErrorTypeId = "~effect/encoding/Sse/SseError";
|
|
@@ -33798,7 +33799,7 @@ const makeClient = (api, options) => gen(function* () {
|
|
|
33798
33799
|
const encodeQuery = map$3(endpoint.query, encodeUnknownEffect);
|
|
33799
33800
|
const middlewareKeys = Array.from(onEndpointOptions.middleware, (tag) => `${tag.key}/Client`);
|
|
33800
33801
|
const endpointFn = fnUntraced(function* (request) {
|
|
33801
|
-
let httpRequest = make$
|
|
33802
|
+
let httpRequest = make$64(endpoint.method)(endpoint.path);
|
|
33802
33803
|
if (request !== void 0) {
|
|
33803
33804
|
if (encodeParams !== void 0) {
|
|
33804
33805
|
const params = yield* encodeParams(request.params);
|
|
@@ -33841,7 +33842,7 @@ const makeClient = (api, options) => gen(function* () {
|
|
|
33841
33842
|
* @category constructors
|
|
33842
33843
|
* @since 4.0.0
|
|
33843
33844
|
*/
|
|
33844
|
-
const make$
|
|
33845
|
+
const make$40 = (api, options) => flatMap$1(HttpClient, (httpClient) => makeWith(api, {
|
|
33845
33846
|
...options,
|
|
33846
33847
|
httpClient: options?.transformClient ? options.transformClient(httpClient) : httpClient
|
|
33847
33848
|
}));
|
|
@@ -34947,7 +34948,7 @@ function projectEvent(model, event) {
|
|
|
34947
34948
|
}
|
|
34948
34949
|
//#endregion
|
|
34949
34950
|
//#region src/orchestration/decider.ts
|
|
34950
|
-
const nowIso$4 = map$4(now, formatIso);
|
|
34951
|
+
const nowIso$4 = map$4(now$1, formatIso);
|
|
34951
34952
|
const QUEUED_TURN_START_GRACE_MS = 120 * 1e3;
|
|
34952
34953
|
/**
|
|
34953
34954
|
* Blocked-on-you work derived from the thread's retained activities: an
|
|
@@ -35954,7 +35955,7 @@ const OrchestrationEngineLive = effect(OrchestrationEngineService, gen(function*
|
|
|
35954
35955
|
const projectionPipeline = yield* OrchestrationProjectionPipeline;
|
|
35955
35956
|
const projectionSnapshotQuery = yield* ProjectionSnapshotQuery;
|
|
35956
35957
|
const crypto = yield* Crypto;
|
|
35957
|
-
const nowIso = map$4(now, formatIso);
|
|
35958
|
+
const nowIso = map$4(now$1, formatIso);
|
|
35958
35959
|
let commandReadModel = createEmptyReadModel(yield* nowIso);
|
|
35959
35960
|
const commandQueue = yield* unbounded$2();
|
|
35960
35961
|
const eventPubSub = yield* unbounded$1();
|
|
@@ -36076,7 +36077,7 @@ const OrchestrationEngineLive = effect(OrchestrationEngineService, gen(function*
|
|
|
36076
36077
|
yield* logDebug("orchestration engine started").pipe(annotateLogs({ sequence: commandReadModel.snapshotSequence }));
|
|
36077
36078
|
const readEvents = (fromSequenceExclusive, limit) => eventStore.readFromSequence(fromSequenceExclusive, limit);
|
|
36078
36079
|
const dispatch = (command) => gen(function* () {
|
|
36079
|
-
const result = yield* make$
|
|
36080
|
+
const result = yield* make$73();
|
|
36080
36081
|
yield* offer$1(commandQueue, {
|
|
36081
36082
|
command,
|
|
36082
36083
|
result,
|
|
@@ -38506,7 +38507,7 @@ const TERMINAL_STATUSES = /* @__PURE__ */ new Set([
|
|
|
38506
38507
|
"interrupted"
|
|
38507
38508
|
]);
|
|
38508
38509
|
var ThreadBackgroundLivenessService = class extends Service$2()("t3/orchestration/ThreadBackgroundLiveness/ThreadBackgroundLivenessService") {};
|
|
38509
|
-
function make$
|
|
38510
|
+
function make$39() {
|
|
38510
38511
|
const stateByThreadId = /* @__PURE__ */ new Map();
|
|
38511
38512
|
const stateFor = (threadId) => {
|
|
38512
38513
|
const existing = stateByThreadId.get(threadId);
|
|
@@ -38556,7 +38557,7 @@ function make$36() {
|
|
|
38556
38557
|
}
|
|
38557
38558
|
};
|
|
38558
38559
|
}
|
|
38559
|
-
const layer$
|
|
38560
|
+
const layer$31 = effect(ThreadBackgroundLivenessService, sync(make$39));
|
|
38560
38561
|
//#endregion
|
|
38561
38562
|
//#region ../t3-shared/src/sourceControl.ts
|
|
38562
38563
|
function parseRemoteHost(remoteUrl) {
|
|
@@ -38856,7 +38857,7 @@ const runProcessCore = fn("processRunner.runProcessCore")(function* (spawner, in
|
|
|
38856
38857
|
env: input.env,
|
|
38857
38858
|
extendEnv
|
|
38858
38859
|
});
|
|
38859
|
-
const child = yield* spawner.spawn(make$
|
|
38860
|
+
const child = yield* spawner.spawn(make$79(spawnCommand.command, spawnCommand.args, {
|
|
38860
38861
|
...input.spawnCwd ?? input.cwd ? { cwd: input.spawnCwd ?? input.cwd } : {},
|
|
38861
38862
|
...input.env !== void 0 ? {
|
|
38862
38863
|
env: input.env,
|
|
@@ -38874,7 +38875,7 @@ const runProcessCore = fn("processRunner.runProcessCore")(function* (spawner, in
|
|
|
38874
38875
|
cause
|
|
38875
38876
|
})));
|
|
38876
38877
|
const stdin = input.stdin;
|
|
38877
|
-
const writeStdin = stdin === void 0 ? void_$1 : run$5(encodeText(make$
|
|
38878
|
+
const writeStdin = stdin === void 0 ? void_$1 : run$5(encodeText(make$74(stdin)), child.stdin).pipe(mapError((cause) => new ProcessStdinError({
|
|
38878
38879
|
command: input.command,
|
|
38879
38880
|
argumentCount: input.args.length,
|
|
38880
38881
|
cwd: input.cwd,
|
|
@@ -38924,7 +38925,7 @@ const runProcessCore = fn("processRunner.runProcessCore")(function* (spawner, in
|
|
|
38924
38925
|
stderrTruncated: stderr.truncated
|
|
38925
38926
|
};
|
|
38926
38927
|
});
|
|
38927
|
-
const layer$
|
|
38928
|
+
const layer$30 = effect(ProcessRunner, fn("ProcessRunner.make")(function* () {
|
|
38928
38929
|
const spawner = yield* ChildProcessSpawner;
|
|
38929
38930
|
const run = (input) => finalizeRunProcess(runProcessCore(spawner, input), input);
|
|
38930
38931
|
return ProcessRunner.of({ run });
|
|
@@ -39019,7 +39020,7 @@ const resolveRepositoryIdentityFromCacheKey = fn("RepositoryIdentityResolver.res
|
|
|
39019
39020
|
rootPath: cacheKey
|
|
39020
39021
|
}) : null;
|
|
39021
39022
|
});
|
|
39022
|
-
const layer$
|
|
39023
|
+
const layer$29 = effect(RepositoryIdentityResolver, fn("RepositoryIdentityResolver.make")(function* (options = {}) {
|
|
39023
39024
|
const processRunner = yield* ProcessRunner;
|
|
39024
39025
|
const repositoryIdentityCache = yield* makeWith$1((cacheKey) => resolveRepositoryIdentityFromCacheKey(cacheKey).pipe(provideService(ProcessRunner, processRunner)), {
|
|
39025
39026
|
capacity: options.cacheCapacity ?? DEFAULT_REPOSITORY_IDENTITY_CACHE_CAPACITY,
|
|
@@ -39033,7 +39034,7 @@ const layer$26 = effect(RepositoryIdentityResolver, fn("RepositoryIdentityResolv
|
|
|
39033
39034
|
return yield* get$7(repositoryIdentityCache, cacheKey);
|
|
39034
39035
|
});
|
|
39035
39036
|
return RepositoryIdentityResolver.of({ resolve });
|
|
39036
|
-
})()).pipe(provide(layer$
|
|
39037
|
+
})()).pipe(provide(layer$30));
|
|
39037
39038
|
//#endregion
|
|
39038
39039
|
//#region src/orchestration/Layers/ProjectionSnapshotQuery.ts
|
|
39039
39040
|
const decodeReadModel = decodeUnknownEffect(OrchestrationReadModel);
|
|
@@ -40469,7 +40470,7 @@ const OrchestrationInfrastructureLayerLive = mergeAll(effect(ProjectionSnapshotQ
|
|
|
40469
40470
|
getThreadDetailById,
|
|
40470
40471
|
getThreadDetailSnapshot
|
|
40471
40472
|
};
|
|
40472
|
-
})), mergeAll(OrchestrationEventStoreLive, OrchestrationCommandReceiptRepositoryLive), OrchestrationProjectionPipelineLive.pipe(provide(OrchestrationEventStoreLive))).pipe(provideMerge(layer$
|
|
40473
|
+
})), mergeAll(OrchestrationEventStoreLive, OrchestrationCommandReceiptRepositoryLive), OrchestrationProjectionPipelineLive.pipe(provide(OrchestrationEventStoreLive))).pipe(provideMerge(layer$31));
|
|
40473
40474
|
const OrchestrationLayerLive = mergeAll(OrchestrationInfrastructureLayerLive, OrchestrationEngineLive.pipe(provide(OrchestrationInfrastructureLayerLive)));
|
|
40474
40475
|
//#endregion
|
|
40475
40476
|
//#region ../t3-shared/src/keybindings.ts
|
|
@@ -40934,16 +40935,16 @@ function mergeWithDefaultKeybindings(custom) {
|
|
|
40934
40935
|
* Keybindings - Service tag for keybinding configuration operations.
|
|
40935
40936
|
*/
|
|
40936
40937
|
var Keybindings = class extends Service$2()("t3/keybindings") {};
|
|
40937
|
-
const layer$
|
|
40938
|
+
const layer$28 = effect(Keybindings, gen(function* () {
|
|
40938
40939
|
const { keybindingsConfigPath } = yield* ServerConfig;
|
|
40939
40940
|
const fs = yield* FileSystem;
|
|
40940
40941
|
const path = yield* Path;
|
|
40941
|
-
const upsertSemaphore = yield* make$
|
|
40942
|
+
const upsertSemaphore = yield* make$75(1);
|
|
40942
40943
|
const resolvedConfigCacheKey = "resolved";
|
|
40943
40944
|
const changesPubSub = yield* unbounded$1();
|
|
40944
|
-
const startedRef = yield* make$
|
|
40945
|
-
const startedDeferred = yield* make$
|
|
40946
|
-
const watcherScope = yield* make$
|
|
40945
|
+
const startedRef = yield* make$63(false);
|
|
40946
|
+
const startedDeferred = yield* make$73();
|
|
40947
|
+
const watcherScope = yield* make$76("sequential");
|
|
40947
40948
|
yield* addFinalizer(() => close(watcherScope, void_$2));
|
|
40948
40949
|
const emitChange = (configState) => publish(changesPubSub, configState).pipe(asVoid);
|
|
40949
40950
|
const readConfigExists = fs.exists(keybindingsConfigPath).pipe(mapError((cause) => new KeybindingsConfigError({
|
|
@@ -41043,7 +41044,7 @@ const layer$25 = effect(Keybindings, gen(function* () {
|
|
|
41043
41044
|
keybindings: mergeWithDefaultKeybindings(compileResolvedKeybindingsConfig(keybindings)),
|
|
41044
41045
|
issues
|
|
41045
41046
|
})));
|
|
41046
|
-
const resolvedConfigCache = yield* make$
|
|
41047
|
+
const resolvedConfigCache = yield* make$81({
|
|
41047
41048
|
capacity: 1,
|
|
41048
41049
|
lookup: () => loadConfigStateFromDisk
|
|
41049
41050
|
});
|
|
@@ -41386,7 +41387,7 @@ const resolveEditorLaunch = fn("resolveEditorLaunch")(function* (input) {
|
|
|
41386
41387
|
});
|
|
41387
41388
|
const launchAndUnref = fn("externalLauncher.launchAndUnref")(function* (launch, onError) {
|
|
41388
41389
|
const spawner = yield* ChildProcessSpawner;
|
|
41389
|
-
const command = make$
|
|
41390
|
+
const command = make$79(launch.command, launch.args, launch.options);
|
|
41390
41391
|
yield* spawner.spawn(command).pipe(flatMap$1((handle) => handle.unref), asVoid, scoped, mapError(onError));
|
|
41391
41392
|
});
|
|
41392
41393
|
const launchBrowser = fn("externalLauncher.launchBrowser")(function* (target) {
|
|
@@ -41423,7 +41424,7 @@ const launchEditorProcess = fn("externalLauncher.launchEditorProcess")(function*
|
|
|
41423
41424
|
cause
|
|
41424
41425
|
}));
|
|
41425
41426
|
});
|
|
41426
|
-
const layer$
|
|
41427
|
+
const layer$27 = effect(ExternalLauncher, gen(function* () {
|
|
41427
41428
|
const spawner = yield* ChildProcessSpawner;
|
|
41428
41429
|
const fileSystem = yield* FileSystem;
|
|
41429
41430
|
const path = yield* Path;
|
|
@@ -41451,9 +41452,9 @@ var OrchestrationReactor = class extends Service$2()("t3/orchestration/Services/
|
|
|
41451
41452
|
//#endregion
|
|
41452
41453
|
//#region src/serverLifecycleEvents.ts
|
|
41453
41454
|
var ServerLifecycleEvents = class extends Service$2()("t3/serverLifecycleEvents") {};
|
|
41454
|
-
const layer$
|
|
41455
|
+
const layer$26 = effect(ServerLifecycleEvents, gen(function* () {
|
|
41455
41456
|
const pubsub = yield* unbounded$1();
|
|
41456
|
-
const state = yield* make$
|
|
41457
|
+
const state = yield* make$63({
|
|
41457
41458
|
sequence: 0,
|
|
41458
41459
|
events: []
|
|
41459
41460
|
});
|
|
@@ -41530,7 +41531,7 @@ var ServerSettingsService = class extends Service$2()("t3/serverSettings/ServerS
|
|
|
41530
41531
|
const makeTest = (overrides = {}) => gen(function* () {
|
|
41531
41532
|
const { automaticGitFetchInterval, providerHealthRefreshInterval, ...overridesForMerge } = overrides;
|
|
41532
41533
|
const merged = deepMerge(DEFAULT_SERVER_SETTINGS, overridesForMerge);
|
|
41533
|
-
const currentSettingsRef = yield* make$
|
|
41534
|
+
const currentSettingsRef = yield* make$63(yield* normalizeServerSettings({
|
|
41534
41535
|
...merged,
|
|
41535
41536
|
...automaticGitFetchInterval !== void 0 ? { automaticGitFetchInterval } : {},
|
|
41536
41537
|
...providerHealthRefreshInterval !== void 0 ? { providerHealthRefreshInterval } : {}
|
|
@@ -41584,17 +41585,17 @@ function stripDefaultServerSettings(current, defaults) {
|
|
|
41584
41585
|
}
|
|
41585
41586
|
return Object.is(current, defaults) ? void 0 : current;
|
|
41586
41587
|
}
|
|
41587
|
-
const layer$
|
|
41588
|
+
const layer$25 = effect(ServerSettingsService, gen(function* () {
|
|
41588
41589
|
const { settingsPath } = yield* ServerConfig;
|
|
41589
41590
|
const fs = yield* FileSystem;
|
|
41590
41591
|
const pathService = yield* Path;
|
|
41591
41592
|
const secretStore = yield* ServerSecretStore;
|
|
41592
|
-
const writeSemaphore = yield* make$
|
|
41593
|
+
const writeSemaphore = yield* make$75(1);
|
|
41593
41594
|
const cacheKey = "settings";
|
|
41594
41595
|
const changesPubSub = yield* unbounded$1();
|
|
41595
|
-
const startedRef = yield* make$
|
|
41596
|
-
const startedDeferred = yield* make$
|
|
41597
|
-
const watcherScope = yield* make$
|
|
41596
|
+
const startedRef = yield* make$63(false);
|
|
41597
|
+
const startedDeferred = yield* make$73();
|
|
41598
|
+
const watcherScope = yield* make$76("sequential");
|
|
41598
41599
|
yield* addFinalizer(() => close(watcherScope, void_$2));
|
|
41599
41600
|
const emitChange = (settings) => publish(changesPubSub, settings).pipe(asVoid);
|
|
41600
41601
|
const readConfigExists = fs.exists(settingsPath).pipe(mapError((cause) => new ServerSettingsError({
|
|
@@ -41621,7 +41622,7 @@ const layer$22 = effect(ServerSettingsService, gen(function* () {
|
|
|
41621
41622
|
}
|
|
41622
41623
|
return decoded.value;
|
|
41623
41624
|
});
|
|
41624
|
-
const settingsCache = yield* make$
|
|
41625
|
+
const settingsCache = yield* make$81({
|
|
41625
41626
|
capacity: 1,
|
|
41626
41627
|
lookup: () => loadSettingsFromDisk
|
|
41627
41628
|
});
|
|
@@ -41981,16 +41982,16 @@ var AnalyticsService = class AnalyticsService extends Service$2()("t3/telemetry/
|
|
|
41981
41982
|
flush: void_$1
|
|
41982
41983
|
}));
|
|
41983
41984
|
};
|
|
41984
|
-
const layer$
|
|
41985
|
+
const layer$24 = effect(AnalyticsService, gen(function* () {
|
|
41985
41986
|
const telemetryConfig = yield* TelemetryEnvConfig;
|
|
41986
41987
|
const httpClient = yield* HttpClient;
|
|
41987
41988
|
const serverConfig = yield* ServerConfig;
|
|
41988
41989
|
const identifier = yield* getTelemetryIdentifier;
|
|
41989
|
-
const bufferRef = yield* make$
|
|
41990
|
+
const bufferRef = yield* make$63([]);
|
|
41990
41991
|
const clientType = serverConfig.mode === "desktop" ? "desktop-app" : "cli-web-client";
|
|
41991
41992
|
const hostPlatform = yield* HostProcessPlatform;
|
|
41992
41993
|
const hostArchitecture = yield* HostProcessArchitecture;
|
|
41993
|
-
const enqueueBufferedEvent = (event, properties) => flatMap$1(now, (now) => modify$2(bufferRef, (current) => {
|
|
41994
|
+
const enqueueBufferedEvent = (event, properties) => flatMap$1(now$1, (now) => modify$2(bufferRef, (current) => {
|
|
41994
41995
|
const appended = [...current, {
|
|
41995
41996
|
event,
|
|
41996
41997
|
...properties ? { properties } : {},
|
|
@@ -42186,7 +42187,7 @@ function platformArch(architecture) {
|
|
|
42186
42187
|
* state. It intentionally has no fallback Layer.succeed value: callers must
|
|
42187
42188
|
* provide the external platform services and a ServerConfig.
|
|
42188
42189
|
*/
|
|
42189
|
-
const layer$
|
|
42190
|
+
const layer$23 = effect(ServerEnvironment, gen(function* () {
|
|
42190
42191
|
const fileSystem = yield* FileSystem;
|
|
42191
42192
|
const path = yield* Path;
|
|
42192
42193
|
const serverConfig = yield* ServerConfig;
|
|
@@ -42240,7 +42241,7 @@ const layer$20 = effect(ServerEnvironment, gen(function* () {
|
|
|
42240
42241
|
getEnvironmentId: succeed$1(environmentId),
|
|
42241
42242
|
getDescriptor: succeed$1(descriptor)
|
|
42242
42243
|
});
|
|
42243
|
-
})).pipe(provide(layer$
|
|
42244
|
+
})).pipe(provide(layer$30));
|
|
42244
42245
|
//#endregion
|
|
42245
42246
|
//#region src/provider/Services/ProviderSessionReaper.ts
|
|
42246
42247
|
var ProviderSessionReaper = class extends Service$2()("t3/provider/Services/ProviderSessionReaper") {};
|
|
@@ -42254,7 +42255,7 @@ const forkParked = (effect) => gen(function* () {
|
|
|
42254
42255
|
yield* forkScoped(effect);
|
|
42255
42256
|
return;
|
|
42256
42257
|
}
|
|
42257
|
-
const parked = yield* make$
|
|
42258
|
+
const parked = yield* make$73();
|
|
42258
42259
|
yield* forkScoped(succeed$4(parked, void 0).pipe(andThen(activation), andThen(effect)));
|
|
42259
42260
|
yield* _await(parked);
|
|
42260
42261
|
});
|
|
@@ -42273,9 +42274,9 @@ var ServerRuntimeStartupError = class extends TaggedErrorClass()("ServerRuntimeS
|
|
|
42273
42274
|
var ServerRuntimeStartup = class extends Service$2()("t3/serverRuntimeStartup") {};
|
|
42274
42275
|
const settleQueuedCommand = (deferred, exit) => isSuccess(exit) ? succeed$4(deferred, exit.value) : failCause$2(deferred, exit.cause);
|
|
42275
42276
|
const makeCommandGate = gen(function* () {
|
|
42276
|
-
const commandReady = yield* make$
|
|
42277
|
+
const commandReady = yield* make$73();
|
|
42277
42278
|
const commandQueue = yield* unbounded$2();
|
|
42278
|
-
const commandReadinessState = yield* make$
|
|
42279
|
+
const commandReadinessState = yield* make$63("pending");
|
|
42279
42280
|
yield* forkScoped(forever(take$1(commandQueue).pipe(flatMap$1((command) => command.run))));
|
|
42280
42281
|
return {
|
|
42281
42282
|
awaitCommandReady: _await(commandReady),
|
|
@@ -42291,7 +42292,7 @@ const makeCommandGate = gen(function* () {
|
|
|
42291
42292
|
const readinessState = yield* get$3(commandReadinessState);
|
|
42292
42293
|
if (readinessState === "ready") return yield* effect;
|
|
42293
42294
|
if (readinessState !== "pending") return yield* readinessState;
|
|
42294
|
-
const result = yield* make$
|
|
42295
|
+
const result = yield* make$73();
|
|
42295
42296
|
yield* offer$1(commandQueue, { run: _await(commandReady).pipe(flatMap$1(() => effect), exit, flatMap$1((exit) => settleQueuedCommand(result, exit))) });
|
|
42296
42297
|
return yield* _await(result);
|
|
42297
42298
|
})
|
|
@@ -42335,7 +42336,7 @@ const resolveAutoBootstrapWelcomeTargets = gen(function* () {
|
|
|
42335
42336
|
let nextProjectId;
|
|
42336
42337
|
let nextProjectDefaultModelSelection;
|
|
42337
42338
|
if (isNone(existingProject)) {
|
|
42338
|
-
const createdAt = formatIso(yield* now);
|
|
42339
|
+
const createdAt = formatIso(yield* now$1);
|
|
42339
42340
|
nextProjectId = ProjectId.make(yield* randomUUID);
|
|
42340
42341
|
const bootstrapProjectTitle = path.basename(serverConfig.cwd) || "project";
|
|
42341
42342
|
nextProjectDefaultModelSelection = getAutoBootstrapDefaultModelSelection();
|
|
@@ -42354,7 +42355,7 @@ const resolveAutoBootstrapWelcomeTargets = gen(function* () {
|
|
|
42354
42355
|
}
|
|
42355
42356
|
const existingThreadId = yield* projectionReadModelQuery.getFirstActiveThreadIdByProjectId(nextProjectId);
|
|
42356
42357
|
if (isNone(existingThreadId)) {
|
|
42357
|
-
const createdAt = formatIso(yield* now);
|
|
42358
|
+
const createdAt = formatIso(yield* now$1);
|
|
42358
42359
|
const createdThreadId = ThreadId.make(yield* randomUUID);
|
|
42359
42360
|
yield* orchestrationEngine.dispatch({
|
|
42360
42361
|
type: "thread.create",
|
|
@@ -42394,7 +42395,7 @@ const maybeOpenBrowser = (target) => gen(function* () {
|
|
|
42394
42395
|
yield* (yield* ExternalLauncher).launchBrowser(target).pipe(catch_(() => logInfo("browser auto-open unavailable", { hint: `Open ${target} in your browser.` })));
|
|
42395
42396
|
});
|
|
42396
42397
|
const runStartupPhase = (phase, effect) => effect.pipe(annotateSpans({ "startup.phase": phase }), withSpan(`server.startup.${phase}`));
|
|
42397
|
-
const make$
|
|
42398
|
+
const make$30 = (options) => gen(function* () {
|
|
42398
42399
|
const serverConfig = yield* ServerConfig;
|
|
42399
42400
|
const keybindings = yield* Keybindings;
|
|
42400
42401
|
const orchestrationReactor = yield* OrchestrationReactor;
|
|
@@ -42404,8 +42405,8 @@ const make$27 = (options) => gen(function* () {
|
|
|
42404
42405
|
const serverEnvironment = yield* ServerEnvironment;
|
|
42405
42406
|
const crypto = yield* Crypto;
|
|
42406
42407
|
const commandGate = yield* makeCommandGate;
|
|
42407
|
-
const httpListening = yield* make$
|
|
42408
|
-
const reactorScope = yield* make$
|
|
42408
|
+
const httpListening = yield* make$73();
|
|
42409
|
+
const reactorScope = yield* make$76("sequential");
|
|
42409
42410
|
yield* addFinalizer(() => close(reactorScope, void_$2));
|
|
42410
42411
|
yield* forkScoped(exit(gen(function* () {
|
|
42411
42412
|
yield* logDebug("startup phase: starting keybindings runtime");
|
|
@@ -42480,7 +42481,7 @@ const make$27 = (options) => gen(function* () {
|
|
|
42480
42481
|
version: 1,
|
|
42481
42482
|
type: "ready",
|
|
42482
42483
|
payload: {
|
|
42483
|
-
at: formatIso(yield* now),
|
|
42484
|
+
at: formatIso(yield* now$1),
|
|
42484
42485
|
environment
|
|
42485
42486
|
}
|
|
42486
42487
|
}));
|
|
@@ -42508,7 +42509,7 @@ const make$27 = (options) => gen(function* () {
|
|
|
42508
42509
|
enqueueCommand: commandGate.enqueueCommand
|
|
42509
42510
|
};
|
|
42510
42511
|
});
|
|
42511
|
-
const layerWithOptions = (options) => effect(ServerRuntimeStartup, make$
|
|
42512
|
+
const layerWithOptions = (options) => effect(ServerRuntimeStartup, make$30(options));
|
|
42512
42513
|
layerWithOptions();
|
|
42513
42514
|
//#endregion
|
|
42514
42515
|
//#region src/workspace/WorkspacePaths.ts
|
|
@@ -42580,7 +42581,7 @@ function expandHomePath$2(input, path) {
|
|
|
42580
42581
|
if (input.startsWith("~/") || input.startsWith("~\\")) return path.join(NodeOS.homedir(), input.slice(2));
|
|
42581
42582
|
return input;
|
|
42582
42583
|
}
|
|
42583
|
-
const layer$
|
|
42584
|
+
const layer$21 = effect(WorkspacePaths, gen(function* () {
|
|
42584
42585
|
const fileSystem = yield* FileSystem;
|
|
42585
42586
|
const path = yield* Path;
|
|
42586
42587
|
const statWorkspaceRoot = fn("WorkspacePaths.statWorkspaceRoot")(function* (workspaceRoot, normalizedWorkspaceRoot, phase) {
|
|
@@ -42742,14 +42743,14 @@ const projectCommandUuid = Crypto.pipe(flatMap$1((crypto) => crypto.randomUUIDv4
|
|
|
42742
42743
|
operation: "generateProjectCommandId",
|
|
42743
42744
|
cause
|
|
42744
42745
|
})));
|
|
42745
|
-
const ProjectCliRuntimeLive = mergeAll(layer$
|
|
42746
|
+
const ProjectCliRuntimeLive = mergeAll(layer$21, OrchestrationLayerLive.pipe(provideMerge(layer$29), provideMerge(layerConfig)));
|
|
42746
42747
|
const PROJECT_CLI_LIVE_SERVER_TIMEOUT = seconds(1);
|
|
42747
42748
|
const withProjectCliSessionToken = (environmentAuth, run) => acquireUseRelease(environmentAuth.issueSession({
|
|
42748
42749
|
scopes: AuthAdministrativeScopes,
|
|
42749
42750
|
label: "t3 project cli"
|
|
42750
42751
|
}), (issued) => run(issued.token), (issued) => environmentAuth.revokeSession(issued.sessionId).pipe(ignore$1({ log: true })));
|
|
42751
42752
|
const withProjectCliLiveServerTimeout = (effect) => effect.pipe(timeout(PROJECT_CLI_LIVE_SERVER_TIMEOUT));
|
|
42752
|
-
const makeLiveServerClient = (origin) => make$
|
|
42753
|
+
const makeLiveServerClient = (origin) => make$40(EnvironmentHttpApi, { baseUrl: origin });
|
|
42753
42754
|
const normalizeWorkspaceRootForProjectCommand = fn("normalizeWorkspaceRootForProjectCommand")(function* (workspaceRoot) {
|
|
42754
42755
|
return yield* (yield* WorkspacePaths).normalizeWorkspaceRoot(workspaceRoot);
|
|
42755
42756
|
});
|
|
@@ -42832,7 +42833,7 @@ const runProjectMutation = fn("runProjectMutation")(function* (flags, run) {
|
|
|
42832
42833
|
});
|
|
42833
42834
|
yield* log(output);
|
|
42834
42835
|
}));
|
|
42835
|
-
const offlineRuntimeLayer = ProjectCliRuntimeLive.pipe(provide(layer$
|
|
42836
|
+
const offlineRuntimeLayer = ProjectCliRuntimeLive.pipe(provide(layer$39(config)), provide(succeed$3(MinimumLogLevel, minimumLogLevel)));
|
|
42836
42837
|
return yield* gen(function* () {
|
|
42837
42838
|
const snapshot = yield* getOfflineSnapshot();
|
|
42838
42839
|
const orchestrationEngine = yield* OrchestrationEngineService;
|
|
@@ -42843,9 +42844,9 @@ const runProjectMutation = fn("runProjectMutation")(function* (flags, run) {
|
|
|
42843
42844
|
});
|
|
42844
42845
|
yield* log(output);
|
|
42845
42846
|
}).pipe(provide$1(offlineRuntimeLayer));
|
|
42846
|
-
}).pipe(provide$1(mergeAll(runtimeLayer, layer$
|
|
42847
|
+
}).pipe(provide$1(mergeAll(runtimeLayer, layer$21).pipe(provideMerge(layer$43), provide(layer$39(config)), provide(succeed$3(MinimumLogLevel, minimumLogLevel)))));
|
|
42847
42848
|
});
|
|
42848
|
-
const projectAddCommand = make$
|
|
42849
|
+
const projectAddCommand = make$62("add", {
|
|
42849
42850
|
...projectLocationFlags,
|
|
42850
42851
|
workspaceRoot: string$1("path").pipe(withDescription$2("Workspace root to add as a project.")),
|
|
42851
42852
|
title: string("title").pipe(withDescription$1("Optional project title."), optional)
|
|
@@ -42866,11 +42867,11 @@ const projectAddCommand = make$59("add", {
|
|
|
42866
42867
|
title,
|
|
42867
42868
|
workspaceRoot,
|
|
42868
42869
|
defaultModelSelection: getAutoBootstrapDefaultModelSelection(),
|
|
42869
|
-
createdAt: formatIso(yield* now)
|
|
42870
|
+
createdAt: formatIso(yield* now$1)
|
|
42870
42871
|
});
|
|
42871
42872
|
return `Added project ${projectId} (${title}) at ${workspaceRoot}.`;
|
|
42872
42873
|
}))));
|
|
42873
|
-
const projectRemoveCommand = make$
|
|
42874
|
+
const projectRemoveCommand = make$62("remove", {
|
|
42874
42875
|
...projectLocationFlags,
|
|
42875
42876
|
project: string$1("project").pipe(withDescription$2("Project id or workspace root to remove.")),
|
|
42876
42877
|
force: boolean("force").pipe(withDescription$1("Delete the project and all of its threads."), withDefault(false))
|
|
@@ -42887,7 +42888,7 @@ const projectRemoveCommand = make$59("remove", {
|
|
|
42887
42888
|
});
|
|
42888
42889
|
return `Removed project ${project.id} (${project.title}).`;
|
|
42889
42890
|
}))));
|
|
42890
|
-
const projectRenameCommand = make$
|
|
42891
|
+
const projectRenameCommand = make$62("rename", {
|
|
42891
42892
|
...projectLocationFlags,
|
|
42892
42893
|
project: string$1("project").pipe(withDescription$2("Project id or workspace root to rename.")),
|
|
42893
42894
|
title: string$1("title").pipe(withDescription$2("New project title."))
|
|
@@ -42906,7 +42907,7 @@ const projectRenameCommand = make$59("rename", {
|
|
|
42906
42907
|
});
|
|
42907
42908
|
return `Renamed project ${project.id} to ${nextTitle}.`;
|
|
42908
42909
|
}))));
|
|
42909
|
-
const projectCommand = make$
|
|
42910
|
+
const projectCommand = make$62("project").pipe(withDescription("Manage projects."), withSubcommands([
|
|
42910
42911
|
projectAddCommand,
|
|
42911
42912
|
projectRemoveCommand,
|
|
42912
42913
|
projectRenameCommand
|
|
@@ -42969,7 +42970,7 @@ function acquireDaemonLock(stateDir) {
|
|
|
42969
42970
|
* @category layers
|
|
42970
42971
|
* @since 4.0.0
|
|
42971
42972
|
*/
|
|
42972
|
-
const layer$
|
|
42973
|
+
const layer$20 = (api, options) => use(fnUntraced(function* (router) {
|
|
42973
42974
|
const services = yield* context();
|
|
42974
42975
|
const routes = [];
|
|
42975
42976
|
const availableGroups = Array.from(services.mapUnsafe.keys()).filter((key) => key.startsWith("effect/httpapi/HttpApiGroup/"));
|
|
@@ -43022,19 +43023,19 @@ const HandlersTypeId = "~effect/httpapi/HttpApiBuilder/Handlers";
|
|
|
43022
43023
|
*/
|
|
43023
43024
|
const securityDecode = (self) => {
|
|
43024
43025
|
switch (self._tag) {
|
|
43025
|
-
case "Http": return map$4(HttpServerRequest, (request) => make$
|
|
43026
|
+
case "Http": return map$4(HttpServerRequest, (request) => make$67(getAuthorizationCredential(request.headers.authorization, self.scheme) ?? ""));
|
|
43026
43027
|
case "ApiKey": {
|
|
43027
43028
|
const key = self.in === "header" ? self.key.toLowerCase() : self.key;
|
|
43028
43029
|
const schema = Struct({ [key]: String$1 });
|
|
43029
43030
|
return match$2(self.in === "query" ? schemaSearchParams(schema) : self.in === "cookie" ? schemaCookies(schema) : schemaHeaders(schema), {
|
|
43030
|
-
onFailure: () => make$
|
|
43031
|
-
onSuccess: (match) => make$
|
|
43031
|
+
onFailure: () => make$67(""),
|
|
43032
|
+
onSuccess: (match) => make$67(match[key])
|
|
43032
43033
|
});
|
|
43033
43034
|
}
|
|
43034
43035
|
case "Basic": {
|
|
43035
43036
|
const empty = {
|
|
43036
43037
|
username: "",
|
|
43037
|
-
password: make$
|
|
43038
|
+
password: make$67("")
|
|
43038
43039
|
};
|
|
43039
43040
|
return map$4(HttpServerRequest, (request) => {
|
|
43040
43041
|
const encoded = getAuthorizationCredential(request.headers.authorization, basicScheme);
|
|
@@ -43045,7 +43046,7 @@ const securityDecode = (self) => {
|
|
|
43045
43046
|
if (separator === -1) return empty;
|
|
43046
43047
|
return {
|
|
43047
43048
|
username: decoded.slice(0, separator),
|
|
43048
|
-
password: make$
|
|
43049
|
+
password: make$67(decoded.slice(separator + 1))
|
|
43049
43050
|
};
|
|
43050
43051
|
});
|
|
43051
43052
|
}
|
|
@@ -43209,17 +43210,17 @@ const makeSecurityMiddleware = (key, service) => {
|
|
|
43209
43210
|
let lastResult;
|
|
43210
43211
|
for (let i = 0; i < entries.length; i++) {
|
|
43211
43212
|
const { decode, middleware } = entries[i];
|
|
43212
|
-
const result$
|
|
43213
|
+
const result$2 = yield* result(flatMap$1(decode, (credential) => middleware(handler, {
|
|
43213
43214
|
credential,
|
|
43214
43215
|
endpoint: options.endpoint,
|
|
43215
43216
|
group: options.group
|
|
43216
43217
|
})));
|
|
43217
|
-
if (isFailure$1(result$
|
|
43218
|
-
if (isHandlerError(result$
|
|
43219
|
-
lastResult = result$
|
|
43218
|
+
if (isFailure$1(result$2)) {
|
|
43219
|
+
if (isHandlerError(result$2.failure)) return yield* fail(result$2.failure.error);
|
|
43220
|
+
lastResult = result$2;
|
|
43220
43221
|
continue;
|
|
43221
43222
|
}
|
|
43222
|
-
return result$
|
|
43223
|
+
return result$2.success;
|
|
43223
43224
|
}
|
|
43224
43225
|
return yield* fromResult(lastResult);
|
|
43225
43226
|
});
|
|
@@ -43583,18 +43584,18 @@ function requireDesktopTelemetryWriteProgress(fd, remainingBytes, written) {
|
|
|
43583
43584
|
remainingBytes
|
|
43584
43585
|
}));
|
|
43585
43586
|
}
|
|
43586
|
-
const layer$
|
|
43587
|
+
const layer$19 = effect(DesktopTelemetryReceiver, fn("resourceTelemetry.desktopTelemetryReceiver.make")(function* () {
|
|
43587
43588
|
const config = yield* ServerConfig;
|
|
43588
43589
|
const serverSettings = yield* ServerSettingsService;
|
|
43589
|
-
const latest = yield* make$
|
|
43590
|
-
const receiverStartedAt = yield* now;
|
|
43591
|
-
const lastContactAtMs = yield* make$
|
|
43592
|
-
const snapshotStaleAfterMs = yield* make$
|
|
43590
|
+
const latest = yield* make$63(none());
|
|
43591
|
+
const receiverStartedAt = yield* now$1;
|
|
43592
|
+
const lastContactAtMs = yield* make$63(initialDesktopTelemetryContactAt(config.desktopTelemetryFd, toEpochMillis(receiverStartedAt)));
|
|
43593
|
+
const snapshotStaleAfterMs = yield* make$63(resolveDesktopTelemetrySnapshotStaleAfterMs(DEFAULT_HOST_POWER_ACTIVE_INTERVAL_MS, DEFAULT_HOST_POWER_IDLE_INTERVAL_MS));
|
|
43593
43594
|
const changes = yield* sliding(8);
|
|
43594
43595
|
const healthChanges = yield* sliding(4);
|
|
43595
|
-
const controlMutex = yield* make$
|
|
43596
|
-
const snapshotMutex = yield* make$
|
|
43597
|
-
const health = yield* make$
|
|
43596
|
+
const controlMutex = yield* make$75(1);
|
|
43597
|
+
const snapshotMutex = yield* make$75(1);
|
|
43598
|
+
const health = yield* make$63({
|
|
43598
43599
|
status: config.desktopTelemetryFd === void 0 ? "unavailable" : "starting",
|
|
43599
43600
|
lastSampleAt: none(),
|
|
43600
43601
|
lastError: config.desktopTelemetryFd === void 0 ? some(new DesktopTelemetryDescriptorUnavailable({ mode: config.mode }).message) : none()
|
|
@@ -43668,7 +43669,7 @@ const layer$16 = effect(DesktopTelemetryReceiver, fn("resourceTelemetry.desktopT
|
|
|
43668
43669
|
}));
|
|
43669
43670
|
return decodeMessage(value).pipe(mapError((cause) => new DesktopTelemetryDecodeFailed({ cause })));
|
|
43670
43671
|
}), mapError$1(normalizeReceiverError)).pipe(runForEach((message) => {
|
|
43671
|
-
const recordContact = now.pipe(flatMap$1((now) => set$2(lastContactAtMs, some(toEpochMillis(now)))));
|
|
43672
|
+
const recordContact = now$1.pipe(flatMap$1((now) => set$2(lastContactAtMs, some(toEpochMillis(now)))));
|
|
43672
43673
|
if (message.type === "desktopTelemetryHello") return recordContact.pipe(andThen(updateHealth((current) => ({
|
|
43673
43674
|
...current,
|
|
43674
43675
|
status: "healthy",
|
|
@@ -43686,7 +43687,7 @@ const layer$16 = effect(DesktopTelemetryReceiver, fn("resourceTelemetry.desktopT
|
|
|
43686
43687
|
lastError: some(error.message)
|
|
43687
43688
|
}))), forkScoped);
|
|
43688
43689
|
yield* forever(sleep(STALE_CHECK_INTERVAL).pipe(andThen(snapshotMutex.withPermits(1)(gen(function* () {
|
|
43689
|
-
const nowMs = toEpochMillis(yield* now);
|
|
43690
|
+
const nowMs = toEpochMillis(yield* now$1);
|
|
43690
43691
|
const staleAfterMs = yield* get$3(snapshotStaleAfterMs);
|
|
43691
43692
|
const staleSnapshot = yield* modify$2(latest, (current) => {
|
|
43692
43693
|
if (isNone(current) || current.value.power.stale || nowMs - current.value.sampledAtUnixMs < staleAfterMs) return [none(), current];
|
|
@@ -43760,8 +43761,8 @@ const makeUnknownSnapshot = (source, updatedAt) => ({
|
|
|
43760
43761
|
function samePowerState(left, right) {
|
|
43761
43762
|
return left.source === right.source && left.idle === right.idle && left.locked === right.locked && left.suspended === right.suspended && left.onBattery === right.onBattery && left.lowPowerMode === right.lowPowerMode && left.thermalState === right.thermalState && left.stale === right.stale;
|
|
43762
43763
|
}
|
|
43763
|
-
const make$
|
|
43764
|
-
const latestRef = yield* make$
|
|
43764
|
+
const make$27 = fn("background.hostPower.make")(function* (initialSnapshot) {
|
|
43765
|
+
const latestRef = yield* make$63(initialSnapshot ?? makeUnknownSnapshot("unknown", yield* now$1));
|
|
43765
43766
|
const changes = yield* sliding(1);
|
|
43766
43767
|
const report = (snapshot) => modify$2(latestRef, (current) => {
|
|
43767
43768
|
if (isLessThan$1(snapshot.updatedAt, current.updatedAt)) return [none(), current];
|
|
@@ -43776,12 +43777,12 @@ const make$24 = fn("background.hostPower.make")(function* (initialSnapshot) {
|
|
|
43776
43777
|
streamChanges: fromPubSub(changes)
|
|
43777
43778
|
});
|
|
43778
43779
|
});
|
|
43779
|
-
const layer$
|
|
43780
|
+
const layer$18 = effect(HostPowerMonitor, gen(function* () {
|
|
43780
43781
|
const desktopSubscription = yield* (yield* DesktopTelemetryReceiver).subscribe;
|
|
43781
43782
|
const initial = desktopSubscription.latest;
|
|
43782
43783
|
const monitor = yield* match$1(initial, {
|
|
43783
|
-
onNone: () => make$
|
|
43784
|
-
onSome: (snapshot) => make$
|
|
43784
|
+
onNone: () => make$27(),
|
|
43785
|
+
onSome: (snapshot) => make$27(snapshot.power)
|
|
43785
43786
|
});
|
|
43786
43787
|
yield* desktopSubscription.changes.pipe(map$8((snapshot) => snapshot.power), runForEach(monitor.report), forkScoped);
|
|
43787
43788
|
return monitor;
|
|
@@ -43871,34 +43872,34 @@ function computeSnapshot(input) {
|
|
|
43871
43872
|
updatedAt: input.updatedAt
|
|
43872
43873
|
};
|
|
43873
43874
|
}
|
|
43874
|
-
const layer$
|
|
43875
|
+
const layer$17 = effect(BackgroundPolicy, fn("background.policy.make")(function* () {
|
|
43875
43876
|
const hostPowerMonitor = yield* HostPowerMonitor;
|
|
43876
43877
|
const serverSettings = yield* ServerSettingsService;
|
|
43877
|
-
const leasesRef = yield* make$
|
|
43878
|
+
const leasesRef = yield* make$63(/* @__PURE__ */ new Map());
|
|
43878
43879
|
const changes = yield* sliding(1);
|
|
43879
|
-
const publishMutex = yield* make$
|
|
43880
|
+
const publishMutex = yield* make$75(1);
|
|
43880
43881
|
const backgroundActivitySettings = serverSettings.getSettings.pipe(map$4(resolveServerBackgroundActivitySettings), orElseSucceed(() => getBackgroundActivityPresetSettings("balanced")));
|
|
43881
43882
|
const snapshot = gen(function* () {
|
|
43882
|
-
const [hostPower, leases, now
|
|
43883
|
+
const [hostPower, leases, now, settings] = yield* all([
|
|
43883
43884
|
hostPowerMonitor.snapshot,
|
|
43884
43885
|
get$3(leasesRef),
|
|
43885
|
-
now,
|
|
43886
|
+
now$1,
|
|
43886
43887
|
backgroundActivitySettings
|
|
43887
43888
|
]);
|
|
43888
43889
|
return computeSnapshot({
|
|
43889
43890
|
hostPower,
|
|
43890
43891
|
leases,
|
|
43891
|
-
now
|
|
43892
|
+
now,
|
|
43892
43893
|
settings,
|
|
43893
|
-
updatedAt: now
|
|
43894
|
+
updatedAt: now
|
|
43894
43895
|
});
|
|
43895
43896
|
});
|
|
43896
43897
|
const publishSnapshotUnlocked = snapshot.pipe(flatMap$1((next) => publish(changes, next)));
|
|
43897
43898
|
const publishSnapshot = publishMutex.withPermits(1)(publishSnapshotUnlocked);
|
|
43898
43899
|
const reportClientActivity = (sessionId, rpcClientId, input) => publishMutex.withPermits(1)(gen(function* () {
|
|
43899
43900
|
const ttlMs = Math.min(Math.max(input.ttlMs ?? DEFAULT_LEASE_TTL_MS, 1e3), MAX_LEASE_TTL_MS);
|
|
43900
|
-
const now
|
|
43901
|
-
const expiresAt = add$3(now
|
|
43901
|
+
const now = yield* now$1;
|
|
43902
|
+
const expiresAt = add$3(now, { milliseconds: ttlMs });
|
|
43902
43903
|
const lease = {
|
|
43903
43904
|
sessionId,
|
|
43904
43905
|
rpcClientId,
|
|
@@ -43912,10 +43913,10 @@ const layer$14 = effect(BackgroundPolicy, fn("background.policy.make")(function*
|
|
|
43912
43913
|
...input.batteryState !== void 0 ? { batteryState: input.batteryState } : {},
|
|
43913
43914
|
...input.networkType !== void 0 ? { networkType: input.networkType } : {},
|
|
43914
43915
|
scopes: input.scopes,
|
|
43915
|
-
updatedAt: now
|
|
43916
|
+
updatedAt: now,
|
|
43916
43917
|
expiresAt
|
|
43917
43918
|
};
|
|
43918
|
-
yield* update$2(leasesRef, (leases) => upsertClientActivityLease(leases, lease, now
|
|
43919
|
+
yield* update$2(leasesRef, (leases) => upsertClientActivityLease(leases, lease, now));
|
|
43919
43920
|
yield* publishSnapshotUnlocked;
|
|
43920
43921
|
}));
|
|
43921
43922
|
const removeRpcClient = (sessionId, rpcClientId) => publishMutex.withPermits(1)(update$2(leasesRef, (leases) => {
|
|
@@ -43933,10 +43934,10 @@ const layer$14 = effect(BackgroundPolicy, fn("background.policy.make")(function*
|
|
|
43933
43934
|
yield* runForEach(hostPowerMonitor.streamChanges, () => publishSnapshot).pipe(forkScoped);
|
|
43934
43935
|
yield* runForEach(serverSettings.streamChanges, () => publishSnapshot).pipe(forkScoped);
|
|
43935
43936
|
yield* forever(sleep("15 seconds").pipe(andThen(publishMutex.withPermits(1)(gen(function* () {
|
|
43936
|
-
const now
|
|
43937
|
+
const now = yield* now$1;
|
|
43937
43938
|
yield* update$2(leasesRef, (leases) => {
|
|
43938
43939
|
const next = new Map(leases);
|
|
43939
|
-
for (const [key, lease] of next) if (!isLeaseActive(lease, now
|
|
43940
|
+
for (const [key, lease] of next) if (!isLeaseActive(lease, now)) next.delete(key);
|
|
43940
43941
|
return next;
|
|
43941
43942
|
});
|
|
43942
43943
|
yield* publishSnapshotUnlocked;
|
|
@@ -43964,8 +43965,8 @@ function nonNegativeInteger(value, fallback) {
|
|
|
43964
43965
|
if (!Number.isFinite(value)) return 0;
|
|
43965
43966
|
return Math.max(0, Math.round(value));
|
|
43966
43967
|
}
|
|
43967
|
-
const layer$
|
|
43968
|
-
const entries = yield* make$
|
|
43968
|
+
const layer$16 = effect(ResourceAttribution, fn("resourceTelemetry.resourceAttribution.make")(function* () {
|
|
43969
|
+
const entries = yield* make$63(/* @__PURE__ */ new Map());
|
|
43969
43970
|
const record = (input) => update$2(entries, (current) => {
|
|
43970
43971
|
const next = new Map(current);
|
|
43971
43972
|
const entryKey = key(input);
|
|
@@ -43984,7 +43985,7 @@ const layer$13 = effect(ResourceAttribution, fn("resourceTelemetry.resourceAttri
|
|
|
43984
43985
|
record,
|
|
43985
43986
|
snapshot: gen(function* () {
|
|
43986
43987
|
return {
|
|
43987
|
-
readAt: yield* now,
|
|
43988
|
+
readAt: yield* now$1,
|
|
43988
43989
|
entries: [...(yield* get$3(entries)).values()].toSorted((left, right) => right.logicalWriteBytes - left.logicalWriteBytes)
|
|
43989
43990
|
};
|
|
43990
43991
|
})
|
|
@@ -44101,7 +44102,7 @@ const layerFlusher = /*#__PURE__*/ sync$2(Flusher, () => {
|
|
|
44101
44102
|
* @category constructors
|
|
44102
44103
|
* @since 4.0.0
|
|
44103
44104
|
*/
|
|
44104
|
-
const make$
|
|
44105
|
+
const make$24 = /*#__PURE__*/ fnUntraced(function* (options) {
|
|
44105
44106
|
const services = yield* context();
|
|
44106
44107
|
const clock = get$5(services, Clock);
|
|
44107
44108
|
const scope = get$5(services, Scope);
|
|
@@ -44133,7 +44134,7 @@ const make$21 = /*#__PURE__*/ fnUntraced(function* (options) {
|
|
|
44133
44134
|
package: "@effect/opentelemetry",
|
|
44134
44135
|
module: options.label
|
|
44135
44136
|
}));
|
|
44136
|
-
const exportFibers = yield* make$
|
|
44137
|
+
const exportFibers = yield* make$65();
|
|
44137
44138
|
const runExportFork = yield* runtime(exportFibers)();
|
|
44138
44139
|
yield* (yield* Flusher).register(runExport);
|
|
44139
44140
|
yield* addFinalizer$1(scope, suspend(() => {
|
|
@@ -44171,7 +44172,7 @@ const make$21 = /*#__PURE__*/ fnUntraced(function* (options) {
|
|
|
44171
44172
|
* @category constructors
|
|
44172
44173
|
* @since 4.0.0
|
|
44173
44174
|
*/
|
|
44174
|
-
const make$
|
|
44175
|
+
const make$23 = (options) => {
|
|
44175
44176
|
const resourceAttributes = options.attributes ? entriesToAttributes(Object.entries(options.attributes)) : [];
|
|
44176
44177
|
resourceAttributes.push({
|
|
44177
44178
|
key: "service.name",
|
|
@@ -44218,7 +44219,7 @@ const fromConfig = /*#__PURE__*/ fnUntraced(function* (options) {
|
|
|
44218
44219
|
};
|
|
44219
44220
|
delete attributes["service.name"];
|
|
44220
44221
|
delete attributes["service.version"];
|
|
44221
|
-
return make$
|
|
44222
|
+
return make$23({
|
|
44222
44223
|
serviceName,
|
|
44223
44224
|
serviceVersion,
|
|
44224
44225
|
attributes
|
|
@@ -44337,7 +44338,7 @@ const layerJson$1 = /*#__PURE__*/ succeed$3(OtlpSerialization, {
|
|
|
44337
44338
|
* @category constructors
|
|
44338
44339
|
* @since 4.0.0
|
|
44339
44340
|
*/
|
|
44340
|
-
const make$
|
|
44341
|
+
const make$22 = /*#__PURE__*/ fnUntraced(function* (options) {
|
|
44341
44342
|
const clock = yield* Clock;
|
|
44342
44343
|
const serialization = yield* OtlpSerialization;
|
|
44343
44344
|
const startTimeNanos = yield* clock.currentTimeNanos;
|
|
@@ -44618,7 +44619,7 @@ const make$19 = /*#__PURE__*/ fnUntraced(function* (options) {
|
|
|
44618
44619
|
}]
|
|
44619
44620
|
}] });
|
|
44620
44621
|
};
|
|
44621
|
-
yield* make$
|
|
44622
|
+
yield* make$24({
|
|
44622
44623
|
label: "OtlpMetrics",
|
|
44623
44624
|
url: options.url,
|
|
44624
44625
|
headers: options.headers,
|
|
@@ -44634,7 +44635,7 @@ const make$19 = /*#__PURE__*/ fnUntraced(function* (options) {
|
|
|
44634
44635
|
* @category layers
|
|
44635
44636
|
* @since 4.0.0
|
|
44636
44637
|
*/
|
|
44637
|
-
const layer$
|
|
44638
|
+
const layer$15 = (options) => effectDiscard(make$22(options)).pipe(provideMerge(layerFlusher));
|
|
44638
44639
|
/** Creates a unique key for a metric including its attributes */
|
|
44639
44640
|
const makeMetricKey = (id, attributes) => {
|
|
44640
44641
|
if (attributes === void 0 || Object.keys(attributes).length === 0) return id;
|
|
@@ -44729,11 +44730,11 @@ const EAggregationTemporality = {
|
|
|
44729
44730
|
* @category constructors
|
|
44730
44731
|
* @since 4.0.0
|
|
44731
44732
|
*/
|
|
44732
|
-
const make$
|
|
44733
|
+
const make$21 = /*#__PURE__*/ fnUntraced(function* (options) {
|
|
44733
44734
|
const otelResource = yield* fromConfig(options.resource);
|
|
44734
44735
|
const serialization = yield* OtlpSerialization;
|
|
44735
44736
|
const scope = { name: serviceNameUnsafe(otelResource) };
|
|
44736
|
-
const exporter = yield* make$
|
|
44737
|
+
const exporter = yield* make$24({
|
|
44737
44738
|
label: "OtlpTracer",
|
|
44738
44739
|
url: options.url,
|
|
44739
44740
|
headers: options.headers,
|
|
@@ -44755,7 +44756,7 @@ const make$18 = /*#__PURE__*/ fnUntraced(function* (options) {
|
|
|
44755
44756
|
if (!span.sampled) return;
|
|
44756
44757
|
exporter.push(makeOtlpSpan(span));
|
|
44757
44758
|
}
|
|
44758
|
-
return make$
|
|
44759
|
+
return make$77({
|
|
44759
44760
|
span(options) {
|
|
44760
44761
|
return makeSpan({
|
|
44761
44762
|
...options,
|
|
@@ -45273,8 +45274,8 @@ const makeLocalFileTracer = fn("makeLocalFileTracer")(function* (options) {
|
|
|
45273
45274
|
batchWindowMs: options.batchWindowMs,
|
|
45274
45275
|
...options.onFlush ? { onFlush: options.onFlush } : {}
|
|
45275
45276
|
}));
|
|
45276
|
-
const delegate = options.delegate ?? make$
|
|
45277
|
-
return make$
|
|
45277
|
+
const delegate = options.delegate ?? make$77({ span: (spanOptions) => new NativeSpan(spanOptions) });
|
|
45278
|
+
return make$77({
|
|
45278
45279
|
span(spanOptions) {
|
|
45279
45280
|
return new LocalFileSpan(spanOptions, delegate.span(spanOptions), sink.push);
|
|
45280
45281
|
},
|
|
@@ -45440,7 +45441,7 @@ const logT3ProjectFileLoadError = (error) => logWarning$1(error).pipe(annotateLo
|
|
|
45440
45441
|
filePath: error.filePath,
|
|
45441
45442
|
errorTag: error._tag
|
|
45442
45443
|
}));
|
|
45443
|
-
const layer$
|
|
45444
|
+
const layer$14 = effect(T3ProjectFileLoader, gen(function* () {
|
|
45444
45445
|
const fileSystem = yield* FileSystem;
|
|
45445
45446
|
const path = yield* Path;
|
|
45446
45447
|
const load = fn("T3ProjectFileLoader.load")(function* (workspaceRoot) {
|
|
@@ -45531,7 +45532,7 @@ function extractIconHref(source) {
|
|
|
45531
45532
|
return null;
|
|
45532
45533
|
}
|
|
45533
45534
|
const optionOnNotFound$1 = (effect) => effect.pipe(map$4(some), catchTags({ PlatformError: (error) => error.reason._tag === "NotFound" ? succeed$1(none()) : fail(error) }));
|
|
45534
|
-
const layer$
|
|
45535
|
+
const layer$13 = effect(ProjectFaviconResolver, gen(function* () {
|
|
45535
45536
|
const fileSystem = yield* FileSystem;
|
|
45536
45537
|
const path = yield* Path;
|
|
45537
45538
|
const workspacePaths = yield* WorkspacePaths;
|
|
@@ -45873,10 +45874,10 @@ const resolveAsset = fn("AssetAccess.resolveAsset")(function* (token, relativePa
|
|
|
45873
45874
|
//#endregion
|
|
45874
45875
|
//#region src/observability/BrowserTraceCollector.ts
|
|
45875
45876
|
var BrowserTraceCollector = class extends Service$2()("t3/observability/BrowserTraceCollector") {};
|
|
45876
|
-
const make$
|
|
45877
|
+
const make$18 = (sink) => BrowserTraceCollector.of({ record: (records) => sync(() => {
|
|
45877
45878
|
for (const record of records) sink.push(record);
|
|
45878
45879
|
}) });
|
|
45879
|
-
const layer$
|
|
45880
|
+
const layer$12 = (sink) => succeed$3(BrowserTraceCollector, make$18(sink));
|
|
45880
45881
|
//#endregion
|
|
45881
45882
|
//#region src/auth/http.ts
|
|
45882
45883
|
const CREDENTIAL_RESPONSE_HEADERS = {
|
|
@@ -48793,7 +48794,7 @@ if (!(process.env.MSGPACKR_NATIVE_ACCELERATION_DISABLED !== void 0 && process.en
|
|
|
48793
48794
|
let extractor;
|
|
48794
48795
|
try {
|
|
48795
48796
|
if (typeof __require == "function") extractor = require_msgpackr_extract();
|
|
48796
|
-
else extractor = createRequire(import.meta.url)("msgpackr-extract");
|
|
48797
|
+
else extractor = createRequire$1(import.meta.url)("msgpackr-extract");
|
|
48797
48798
|
if (extractor) setExtractor(extractor.extractStrings);
|
|
48798
48799
|
} catch (error) {}
|
|
48799
48800
|
}
|
|
@@ -49426,7 +49427,7 @@ let clientIdCounter = 0;
|
|
|
49426
49427
|
* @category constructors
|
|
49427
49428
|
* @since 4.0.0
|
|
49428
49429
|
*/
|
|
49429
|
-
const make$
|
|
49430
|
+
const make$17 = /*#__PURE__*/ fnUntraced(function* (group, options) {
|
|
49430
49431
|
const clientId = clientIdCounter++;
|
|
49431
49432
|
const { run, send, supportsAck, supportsTransferables } = yield* Protocol$1;
|
|
49432
49433
|
const entries = /* @__PURE__ */ new Map();
|
|
@@ -49598,7 +49599,7 @@ const makeNoSerialization = /*#__PURE__*/ fnUntraced(function* (group, options)
|
|
|
49598
49599
|
const services = yield* context();
|
|
49599
49600
|
const scope = get$5(services, Scope);
|
|
49600
49601
|
const trackFiber = runIn(forkUnsafe(scope, "parallel"));
|
|
49601
|
-
const concurrencySemaphore = concurrency === "unbounded" ? void 0 : yield* make$
|
|
49602
|
+
const concurrencySemaphore = concurrency === "unbounded" ? void 0 : yield* make$75(concurrency);
|
|
49602
49603
|
const clients = /* @__PURE__ */ new Map();
|
|
49603
49604
|
let isShutdown = false;
|
|
49604
49605
|
const shutdownLatch = makeUnsafe$7(false);
|
|
@@ -49834,10 +49835,10 @@ const applyMiddleware = (context, handler, options) => {
|
|
|
49834
49835
|
* @category running
|
|
49835
49836
|
* @since 4.0.0
|
|
49836
49837
|
*/
|
|
49837
|
-
const make$
|
|
49838
|
+
const make$16 = /*#__PURE__*/ fnUntraced(function* (group, options) {
|
|
49838
49839
|
const { disconnects, end, run, send, supportsAck, supportsSpanPropagation, supportsTransferables } = yield* Protocol;
|
|
49839
49840
|
const services = yield* context();
|
|
49840
|
-
const scope = yield* make$
|
|
49841
|
+
const scope = yield* make$76();
|
|
49841
49842
|
const server = yield* makeNoSerialization(group, {
|
|
49842
49843
|
...options,
|
|
49843
49844
|
disableClientAcks: !supportsAck,
|
|
@@ -50025,12 +50026,12 @@ const makeProtocolWithHttpEffectWebsocket = /*#__PURE__*/ gen(function* () {
|
|
|
50025
50026
|
*/
|
|
50026
50027
|
const toHttpEffectWebsocket = /*#__PURE__*/ fnUntraced(function* (group, options) {
|
|
50027
50028
|
const { httpEffect, protocol } = yield* makeProtocolWithHttpEffectWebsocket;
|
|
50028
|
-
yield* make$
|
|
50029
|
+
yield* make$16(group, options).pipe(provideService(Protocol, protocol), forkScoped);
|
|
50029
50030
|
return httpEffect;
|
|
50030
50031
|
});
|
|
50031
50032
|
const makeSocketProtocol = /*#__PURE__*/ gen(function* () {
|
|
50032
50033
|
const serialization = yield* RpcSerialization;
|
|
50033
|
-
const disconnects = yield* make$
|
|
50034
|
+
const disconnects = yield* make$78();
|
|
50034
50035
|
let clientId = 0;
|
|
50035
50036
|
const clients = /* @__PURE__ */ new Map();
|
|
50036
50037
|
const clientIds = /* @__PURE__ */ new Set();
|
|
@@ -50105,8 +50106,8 @@ var ProviderRegistry = class extends Service$2()("t3/provider/Services/ProviderR
|
|
|
50105
50106
|
//#endregion
|
|
50106
50107
|
//#region src/provider/providerMaintenanceCommandCoordinator.ts
|
|
50107
50108
|
const makeProviderMaintenanceCommandCoordinator = fn("makeProviderMaintenanceCommandCoordinator")(function* (input) {
|
|
50108
|
-
const runningTargetsRef = yield* make$
|
|
50109
|
-
const locksRef = yield* make$
|
|
50109
|
+
const runningTargetsRef = yield* make$63(/* @__PURE__ */ new Set());
|
|
50110
|
+
const locksRef = yield* make$63(/* @__PURE__ */ new Map());
|
|
50110
50111
|
const acquireTarget = fn("acquireTarget")(function* (targetKey) {
|
|
50111
50112
|
return yield* modify$2(runningTargetsRef, (runningTargets) => {
|
|
50112
50113
|
if (runningTargets.has(targetKey)) return [false, runningTargets];
|
|
@@ -50123,7 +50124,7 @@ const makeProviderMaintenanceCommandCoordinator = fn("makeProviderMaintenanceCom
|
|
|
50123
50124
|
const getLock = fn("getProviderMaintenanceCommandLock")(function* (lockKey) {
|
|
50124
50125
|
const existing = (yield* get$3(locksRef)).get(lockKey);
|
|
50125
50126
|
if (existing) return existing;
|
|
50126
|
-
const lock = yield* make$
|
|
50127
|
+
const lock = yield* make$75(1);
|
|
50127
50128
|
return yield* modify$2(locksRef, (locks) => {
|
|
50128
50129
|
const current = locks.get(lockKey);
|
|
50129
50130
|
if (current) return [current, locks];
|
|
@@ -50449,11 +50450,11 @@ const resolveLatestProviderVersion = fn("resolveLatestProviderVersion")(function
|
|
|
50449
50450
|
if (!packageName) return null;
|
|
50450
50451
|
const latestVersionCache = yield* ProviderVersionCache;
|
|
50451
50452
|
const cached = latestVersionCache.get(packageName);
|
|
50452
|
-
const now
|
|
50453
|
-
if (cached && cached.expiresAt > now
|
|
50453
|
+
const now = toEpochMillis(yield* now$1);
|
|
50454
|
+
if (cached && cached.expiresAt > now) return cached.version;
|
|
50454
50455
|
const version = yield* fetchNpmLatestVersion(packageName);
|
|
50455
50456
|
latestVersionCache.set(packageName, {
|
|
50456
|
-
expiresAt: now
|
|
50457
|
+
expiresAt: now + LATEST_VERSION_CACHE_TTL_MS,
|
|
50457
50458
|
version
|
|
50458
50459
|
});
|
|
50459
50460
|
return version;
|
|
@@ -50476,7 +50477,7 @@ const enrichProviderSnapshotWithVersionAdvisory = fn("enrichProviderSnapshotWith
|
|
|
50476
50477
|
driver: snapshot.driver,
|
|
50477
50478
|
currentVersion: snapshot.version,
|
|
50478
50479
|
latestVersion,
|
|
50479
|
-
checkedAt: formatIso(yield* now),
|
|
50480
|
+
checkedAt: formatIso(yield* now$1),
|
|
50480
50481
|
maintenanceCapabilities: capabilities
|
|
50481
50482
|
})
|
|
50482
50483
|
};
|
|
@@ -50488,11 +50489,11 @@ const UPDATE_TIMEOUT_MS = 5 * 6e4;
|
|
|
50488
50489
|
const UPDATE_OUTPUT_MAX_BYTES = 1e4;
|
|
50489
50490
|
var ProviderMaintenanceRunner = class extends Service$2()("t3/provider/providerMaintenanceRunner") {};
|
|
50490
50491
|
var ProviderMaintenanceCommandError = class extends TaggedError("ProviderMaintenanceCommandError") {};
|
|
50491
|
-
const nowIso$3 = map$4(now, formatIso);
|
|
50492
|
+
const nowIso$3 = map$4(now$1, formatIso);
|
|
50492
50493
|
const runProviderMaintenanceCommandWithSpawner = fn("ProviderMaintenanceRunner.runCommand")(function* (input) {
|
|
50493
50494
|
return yield* fn("ProviderMaintenanceRunner.collectCommandResult")(function* () {
|
|
50494
50495
|
const resolved = yield* resolveSpawnCommand(input.command, input.args);
|
|
50495
|
-
const child = yield* input.spawner.spawn(make$
|
|
50496
|
+
const child = yield* input.spawner.spawn(make$79(resolved.command, resolved.args, { shell: resolved.shell })).pipe(mapError((cause) => new ProviderMaintenanceCommandError({
|
|
50496
50497
|
message: `Failed to run update command ${input.command}: ${cause.message}`,
|
|
50497
50498
|
cause
|
|
50498
50499
|
})));
|
|
@@ -50560,7 +50561,7 @@ function makeUpdateState(input) {
|
|
|
50560
50561
|
output: input.output ?? null
|
|
50561
50562
|
};
|
|
50562
50563
|
}
|
|
50563
|
-
const layer$
|
|
50564
|
+
const layer$11 = effect(ProviderMaintenanceRunner, fn("ProviderMaintenanceRunner.make")(function* () {
|
|
50564
50565
|
const providerRegistry = yield* ProviderRegistry;
|
|
50565
50566
|
const spawner = yield* ChildProcessSpawner;
|
|
50566
50567
|
const httpClient = yield* HttpClient;
|
|
@@ -50620,7 +50621,7 @@ const layer$8 = effect(ProviderMaintenanceRunner, fn("ProviderMaintenanceRunner.
|
|
|
50620
50621
|
})).pipe(asVoid);
|
|
50621
50622
|
const runProviderUpdate = fn("ProviderMaintenanceRunner.runProviderUpdate")(function* () {
|
|
50622
50623
|
const finish = (state) => setUpdateState(state).pipe(map$4((providers) => ({ providers })));
|
|
50623
|
-
const startedAtRef = yield* make$
|
|
50624
|
+
const startedAtRef = yield* make$63(null);
|
|
50624
50625
|
const runCommandAndVerify = fn("ProviderMaintenanceRunner.runCommandAndVerify")(function* () {
|
|
50625
50626
|
const startedAt = yield* nowIso$3;
|
|
50626
50627
|
yield* set$2(startedAtRef, startedAt);
|
|
@@ -50860,7 +50861,7 @@ const canonicalizeClientCommandTimestamps = (command, receivedAt) => {
|
|
|
50860
50861
|
};
|
|
50861
50862
|
};
|
|
50862
50863
|
const normalizeDispatchCommand = (command) => gen(function* () {
|
|
50863
|
-
const receivedAt = formatIso(yield* now);
|
|
50864
|
+
const receivedAt = formatIso(yield* now$1);
|
|
50864
50865
|
const canonicalCommand = canonicalizeClientCommandTimestamps(command, receivedAt);
|
|
50865
50866
|
const fileSystem = yield* FileSystem;
|
|
50866
50867
|
const path = yield* Path;
|
|
@@ -51192,7 +51193,7 @@ const waitForIndexReady = fn("WorkspaceSearchIndex.waitForIndexReady")(function*
|
|
|
51192
51193
|
timeout: WORKSPACE_INDEX_SCAN_TIMEOUT
|
|
51193
51194
|
});
|
|
51194
51195
|
});
|
|
51195
|
-
const make$
|
|
51196
|
+
const make$14 = fn("WorkspaceSearchIndex.make")(function* (cwd, variant = "paths") {
|
|
51196
51197
|
const finder = yield* acquireRelease(createFinder(cwd, variant), (finder) => try_({
|
|
51197
51198
|
try: () => finder.destroy(),
|
|
51198
51199
|
catch: (cause) => new WorkspaceSearchIndexDestroyFailed({
|
|
@@ -51321,12 +51322,12 @@ function parseWorkspaceSearchIndexKey(key) {
|
|
|
51321
51322
|
* idle cleanup; using a default cwd here would mix resources from different
|
|
51322
51323
|
* workspaces.
|
|
51323
51324
|
*/
|
|
51324
|
-
const layer$
|
|
51325
|
+
const layer$10 = (key) => {
|
|
51325
51326
|
const { cwd, variant } = parseWorkspaceSearchIndexKey(key);
|
|
51326
|
-
return effect(WorkspaceSearchIndex, make$
|
|
51327
|
+
return effect(WorkspaceSearchIndex, make$14(cwd, variant));
|
|
51327
51328
|
};
|
|
51328
51329
|
var WorkspaceSearchIndexMap = class extends Service()("t3/workspace/WorkspaceSearchIndexMap", {
|
|
51329
|
-
lookup: layer$
|
|
51330
|
+
lookup: layer$10,
|
|
51330
51331
|
idleTimeToLive: WORKSPACE_INDEX_IDLE_TTL
|
|
51331
51332
|
}) {};
|
|
51332
51333
|
//#endregion
|
|
@@ -51388,7 +51389,7 @@ const resolveBrowseTarget = fn("WorkspaceEntries.resolveBrowseTarget")(function*
|
|
|
51388
51389
|
if (!input.cwd) return yield* new WorkspaceEntriesCurrentProjectRequiredError({ partialPath: input.partialPath });
|
|
51389
51390
|
return path.resolve(expandHomePath$1(input.cwd, path), input.partialPath);
|
|
51390
51391
|
});
|
|
51391
|
-
const layer$
|
|
51392
|
+
const layer$9 = effect(WorkspaceEntries, gen(function* () {
|
|
51392
51393
|
const path = yield* Path;
|
|
51393
51394
|
const workspacePaths = yield* WorkspacePaths;
|
|
51394
51395
|
const workspaceSearchIndexes = yield* WorkspaceSearchIndexMap;
|
|
@@ -51541,7 +51542,7 @@ Union([
|
|
|
51541
51542
|
]);
|
|
51542
51543
|
/** Service tag for workspace file operations. */
|
|
51543
51544
|
var WorkspaceFileSystem = class extends Service$2()("t3/workspace/WorkspaceFileSystem") {};
|
|
51544
|
-
const layer$
|
|
51545
|
+
const layer$8 = effect(WorkspaceFileSystem, gen(function* () {
|
|
51545
51546
|
const fileSystem = yield* FileSystem;
|
|
51546
51547
|
const path = yield* Path;
|
|
51547
51548
|
const workspacePaths = yield* WorkspacePaths;
|
|
@@ -51674,6 +51675,605 @@ const layer$5 = effect(WorkspaceFileSystem, gen(function* () {
|
|
|
51674
51675
|
});
|
|
51675
51676
|
}));
|
|
51676
51677
|
//#endregion
|
|
51678
|
+
//#region src/workspace/GitWorkspace.ts
|
|
51679
|
+
const EMPTY_WORKING_TREE = {
|
|
51680
|
+
files: [],
|
|
51681
|
+
insertions: 0,
|
|
51682
|
+
deletions: 0
|
|
51683
|
+
};
|
|
51684
|
+
function parseGitStatus(output) {
|
|
51685
|
+
const records = output.split("\0").filter(Boolean);
|
|
51686
|
+
const branchRecord = records[0]?.startsWith("## ") ? records.shift().slice(3) : "";
|
|
51687
|
+
let refName = null;
|
|
51688
|
+
if (branchRecord.startsWith("No commits yet on ")) refName = branchRecord.slice(18).trim() || null;
|
|
51689
|
+
else if (!branchRecord.startsWith("HEAD ")) refName = branchRecord.split("...")[0]?.trim() || null;
|
|
51690
|
+
const aheadCount = Number(/ahead (\d+)/.exec(branchRecord)?.[1] ?? 0);
|
|
51691
|
+
const behindCount = Number(/behind (\d+)/.exec(branchRecord)?.[1] ?? 0);
|
|
51692
|
+
const files = [];
|
|
51693
|
+
for (let index = 0; index < records.length; index += 1) {
|
|
51694
|
+
const record = records[index];
|
|
51695
|
+
const path = record.length > 3 ? record.slice(3) : "";
|
|
51696
|
+
if (path) files.push(path);
|
|
51697
|
+
if (record[0] === "R" || record[1] === "R") index += 1;
|
|
51698
|
+
}
|
|
51699
|
+
return {
|
|
51700
|
+
refName,
|
|
51701
|
+
hasUpstream: branchRecord.includes("..."),
|
|
51702
|
+
aheadCount,
|
|
51703
|
+
behindCount,
|
|
51704
|
+
files
|
|
51705
|
+
};
|
|
51706
|
+
}
|
|
51707
|
+
function parseGitRefs(output, refKind, query = "", currentRef = null) {
|
|
51708
|
+
const normalizedQuery = query.toLowerCase();
|
|
51709
|
+
return output.split("\n").filter(Boolean).flatMap((line) => {
|
|
51710
|
+
const [fullName = "", name = "", head = "", worktreePath = ""] = line.split(" ");
|
|
51711
|
+
if (!name || fullName.endsWith("/HEAD") || !name.toLowerCase().includes(normalizedQuery)) return [];
|
|
51712
|
+
const isRemote = fullName.startsWith("refs/remotes/");
|
|
51713
|
+
if (refKind === "local" && isRemote) return [];
|
|
51714
|
+
if (refKind === "remote" && !isRemote) return [];
|
|
51715
|
+
const firstSlash = name.indexOf("/");
|
|
51716
|
+
return [{
|
|
51717
|
+
name,
|
|
51718
|
+
...isRemote ? {
|
|
51719
|
+
isRemote: true,
|
|
51720
|
+
remoteName: name.slice(0, firstSlash)
|
|
51721
|
+
} : {},
|
|
51722
|
+
current: head.trim() === "*" || name === currentRef,
|
|
51723
|
+
isDefault: false,
|
|
51724
|
+
worktreePath: worktreePath || null
|
|
51725
|
+
}];
|
|
51726
|
+
});
|
|
51727
|
+
}
|
|
51728
|
+
var GitWorkspace = class extends Service$2()("agentlink/workspace/GitWorkspace") {};
|
|
51729
|
+
const layer$7 = effect(GitWorkspace, gen(function* () {
|
|
51730
|
+
const runner = yield* ProcessRunner;
|
|
51731
|
+
const run = fn("GitWorkspace.run")(function* (cwd, operation, args, allowFailure = false) {
|
|
51732
|
+
const result = yield* runner.run({
|
|
51733
|
+
command: "git",
|
|
51734
|
+
args,
|
|
51735
|
+
cwd,
|
|
51736
|
+
timeout: "15 seconds",
|
|
51737
|
+
maxOutputBytes: 2 * 1024 * 1024,
|
|
51738
|
+
outputMode: "truncate"
|
|
51739
|
+
}).pipe(mapError((cause) => new GitCommandError({
|
|
51740
|
+
operation,
|
|
51741
|
+
command: "git",
|
|
51742
|
+
cwd,
|
|
51743
|
+
argumentCount: args.length,
|
|
51744
|
+
detail: cause.message,
|
|
51745
|
+
cause
|
|
51746
|
+
})));
|
|
51747
|
+
if (!allowFailure && result.code !== 0) return yield* new GitCommandError({
|
|
51748
|
+
operation,
|
|
51749
|
+
command: "git",
|
|
51750
|
+
cwd,
|
|
51751
|
+
argumentCount: args.length,
|
|
51752
|
+
exitCode: result.code ?? void 0,
|
|
51753
|
+
stdoutLength: result.stdout.length,
|
|
51754
|
+
stderrLength: result.stderr.length,
|
|
51755
|
+
outputLength: result.stdout.length + result.stderr.length,
|
|
51756
|
+
detail: result.stderr.trim() || result.stdout.trim() || "Git command failed."
|
|
51757
|
+
});
|
|
51758
|
+
return result;
|
|
51759
|
+
});
|
|
51760
|
+
const status = fn("GitWorkspace.status")(function* (cwd) {
|
|
51761
|
+
const repository = yield* run(cwd, "status.detect", ["rev-parse", "--is-inside-work-tree"], true);
|
|
51762
|
+
if (repository.code !== 0 || repository.stdout.trim() !== "true") return {
|
|
51763
|
+
isRepo: false,
|
|
51764
|
+
hasPrimaryRemote: false,
|
|
51765
|
+
isDefaultRef: false,
|
|
51766
|
+
refName: null,
|
|
51767
|
+
hasWorkingTreeChanges: false,
|
|
51768
|
+
workingTree: EMPTY_WORKING_TREE,
|
|
51769
|
+
hasUpstream: false,
|
|
51770
|
+
aheadCount: 0,
|
|
51771
|
+
behindCount: 0,
|
|
51772
|
+
aheadOfDefaultCount: 0,
|
|
51773
|
+
pr: null
|
|
51774
|
+
};
|
|
51775
|
+
const parsed = parseGitStatus((yield* run(cwd, "status", [
|
|
51776
|
+
"status",
|
|
51777
|
+
"--porcelain=v1",
|
|
51778
|
+
"-z",
|
|
51779
|
+
"--branch",
|
|
51780
|
+
"--untracked-files=normal"
|
|
51781
|
+
])).stdout);
|
|
51782
|
+
const [origin, defaultRef] = yield* all([run(cwd, "remote.origin", [
|
|
51783
|
+
"remote",
|
|
51784
|
+
"get-url",
|
|
51785
|
+
"origin"
|
|
51786
|
+
], true), run(cwd, "remote.default", [
|
|
51787
|
+
"symbolic-ref",
|
|
51788
|
+
"refs/remotes/origin/HEAD",
|
|
51789
|
+
"--short"
|
|
51790
|
+
], true)]);
|
|
51791
|
+
return {
|
|
51792
|
+
isRepo: true,
|
|
51793
|
+
hasPrimaryRemote: origin.code === 0,
|
|
51794
|
+
isDefaultRef: defaultRef.code === 0 && defaultRef.stdout.trim().replace(/^origin\//, "") === parsed.refName,
|
|
51795
|
+
refName: parsed.refName,
|
|
51796
|
+
hasWorkingTreeChanges: parsed.files.length > 0,
|
|
51797
|
+
workingTree: {
|
|
51798
|
+
files: parsed.files.map((path) => ({
|
|
51799
|
+
path,
|
|
51800
|
+
insertions: 0,
|
|
51801
|
+
deletions: 0
|
|
51802
|
+
})),
|
|
51803
|
+
insertions: 0,
|
|
51804
|
+
deletions: 0
|
|
51805
|
+
},
|
|
51806
|
+
hasUpstream: parsed.hasUpstream,
|
|
51807
|
+
aheadCount: parsed.aheadCount,
|
|
51808
|
+
behindCount: parsed.behindCount,
|
|
51809
|
+
aheadOfDefaultCount: 0,
|
|
51810
|
+
pr: null
|
|
51811
|
+
};
|
|
51812
|
+
});
|
|
51813
|
+
const listRefs = fn("GitWorkspace.listRefs")(function* (input) {
|
|
51814
|
+
const currentStatus = yield* status(input.cwd);
|
|
51815
|
+
if (!currentStatus.isRepo) return {
|
|
51816
|
+
refs: [],
|
|
51817
|
+
isRepo: false,
|
|
51818
|
+
hasPrimaryRemote: false,
|
|
51819
|
+
nextCursor: null,
|
|
51820
|
+
totalCount: 0
|
|
51821
|
+
};
|
|
51822
|
+
const refs = parseGitRefs((yield* run(input.cwd, "refs.list", [
|
|
51823
|
+
"for-each-ref",
|
|
51824
|
+
"--format=%(refname) %(refname:short) %(HEAD) %(worktreepath)",
|
|
51825
|
+
"refs/heads",
|
|
51826
|
+
"refs/remotes"
|
|
51827
|
+
])).stdout, input.refKind, input.query ?? "", currentStatus.refName);
|
|
51828
|
+
const cursor = input.cursor ?? 0;
|
|
51829
|
+
const limit = input.limit ?? 100;
|
|
51830
|
+
const page = refs.slice(cursor, cursor + limit);
|
|
51831
|
+
return {
|
|
51832
|
+
refs: page,
|
|
51833
|
+
isRepo: true,
|
|
51834
|
+
hasPrimaryRemote: currentStatus.hasPrimaryRemote,
|
|
51835
|
+
nextCursor: cursor + page.length < refs.length ? cursor + page.length : null,
|
|
51836
|
+
totalCount: refs.length
|
|
51837
|
+
};
|
|
51838
|
+
});
|
|
51839
|
+
const switchRef = fn("GitWorkspace.switchRef")(function* (input) {
|
|
51840
|
+
yield* run(input.cwd, "refs.switch", ["switch", input.refName]);
|
|
51841
|
+
return { refName: (yield* status(input.cwd)).refName };
|
|
51842
|
+
});
|
|
51843
|
+
return GitWorkspace.of({
|
|
51844
|
+
status,
|
|
51845
|
+
statusStream: (cwd) => fromEffectSchedule(status(cwd), spaced("3 seconds")).pipe(map$8((value) => ({
|
|
51846
|
+
_tag: "snapshot",
|
|
51847
|
+
local: {
|
|
51848
|
+
isRepo: value.isRepo,
|
|
51849
|
+
hasPrimaryRemote: value.hasPrimaryRemote,
|
|
51850
|
+
isDefaultRef: value.isDefaultRef,
|
|
51851
|
+
refName: value.refName,
|
|
51852
|
+
hasWorkingTreeChanges: value.hasWorkingTreeChanges,
|
|
51853
|
+
workingTree: value.workingTree
|
|
51854
|
+
},
|
|
51855
|
+
remote: value.isRepo ? {
|
|
51856
|
+
hasUpstream: value.hasUpstream,
|
|
51857
|
+
aheadCount: value.aheadCount,
|
|
51858
|
+
behindCount: value.behindCount,
|
|
51859
|
+
aheadOfDefaultCount: value.aheadOfDefaultCount,
|
|
51860
|
+
pr: value.pr
|
|
51861
|
+
} : null
|
|
51862
|
+
}))),
|
|
51863
|
+
listRefs,
|
|
51864
|
+
switchRef
|
|
51865
|
+
});
|
|
51866
|
+
})).pipe(provide(layer$30));
|
|
51867
|
+
//#endregion
|
|
51868
|
+
//#region src/terminal/PtyAdapter.ts
|
|
51869
|
+
/**
|
|
51870
|
+
* PtyAdapter - Terminal PTY adapter service contract.
|
|
51871
|
+
*
|
|
51872
|
+
* Defines the process primitives required by terminal session management
|
|
51873
|
+
* without binding to a specific PTY implementation.
|
|
51874
|
+
*
|
|
51875
|
+
* @module PtyAdapter
|
|
51876
|
+
*/
|
|
51877
|
+
/**
|
|
51878
|
+
* PtySpawnError - Error type for PTY spawn failures.
|
|
51879
|
+
*/
|
|
51880
|
+
var PtySpawnError = class extends TaggedErrorClass()("PtySpawnError", {
|
|
51881
|
+
adapter: String$1,
|
|
51882
|
+
shell: optional$3(String$1),
|
|
51883
|
+
attemptedShells: optional$3(ArraySchema(String$1)),
|
|
51884
|
+
cause: optional$3(Defect())
|
|
51885
|
+
}) {
|
|
51886
|
+
get message() {
|
|
51887
|
+
const shell = this.shell === void 0 ? "" : ` '${this.shell}'`;
|
|
51888
|
+
const attemptedShells = this.attemptedShells === void 0 || this.attemptedShells.length === 0 ? "" : ` Tried shells: ${this.attemptedShells.join(", ")}.`;
|
|
51889
|
+
return `Failed to spawn PTY process${shell} with ${this.adapter}.${attemptedShells}`;
|
|
51890
|
+
}
|
|
51891
|
+
};
|
|
51892
|
+
/**
|
|
51893
|
+
* PtyAdapter - Service tag for PTY process integration.
|
|
51894
|
+
*/
|
|
51895
|
+
var PtyAdapter = class extends Service$2()("t3/terminal/PtyAdapter") {};
|
|
51896
|
+
//#endregion
|
|
51897
|
+
//#region src/terminal/Manager.ts
|
|
51898
|
+
const DEFAULT_COLS = 120;
|
|
51899
|
+
const DEFAULT_ROWS = 30;
|
|
51900
|
+
var TerminalManager = class extends Service$2()("agentlink/terminal/TerminalManager") {};
|
|
51901
|
+
function sessionKey(threadId, terminalId) {
|
|
51902
|
+
return `${threadId}\0${terminalId}`;
|
|
51903
|
+
}
|
|
51904
|
+
function now() {
|
|
51905
|
+
return (/* @__PURE__ */ new Date()).toISOString();
|
|
51906
|
+
}
|
|
51907
|
+
function label(session) {
|
|
51908
|
+
return session.status === "running" ? "Terminal" : "Terminal (stopped)";
|
|
51909
|
+
}
|
|
51910
|
+
function snapshot(session) {
|
|
51911
|
+
return {
|
|
51912
|
+
threadId: session.threadId,
|
|
51913
|
+
terminalId: session.terminalId,
|
|
51914
|
+
cwd: session.cwd,
|
|
51915
|
+
worktreePath: session.worktreePath,
|
|
51916
|
+
status: session.status,
|
|
51917
|
+
pid: session.process?.pid ?? null,
|
|
51918
|
+
history: session.history,
|
|
51919
|
+
exitCode: session.exitCode,
|
|
51920
|
+
exitSignal: session.exitSignal,
|
|
51921
|
+
label: label(session),
|
|
51922
|
+
updatedAt: session.updatedAt,
|
|
51923
|
+
sequence: session.sequence
|
|
51924
|
+
};
|
|
51925
|
+
}
|
|
51926
|
+
function summary(session) {
|
|
51927
|
+
return {
|
|
51928
|
+
threadId: session.threadId,
|
|
51929
|
+
terminalId: session.terminalId,
|
|
51930
|
+
cwd: session.cwd,
|
|
51931
|
+
worktreePath: session.worktreePath,
|
|
51932
|
+
status: session.status,
|
|
51933
|
+
pid: session.process?.pid ?? null,
|
|
51934
|
+
exitCode: session.exitCode,
|
|
51935
|
+
exitSignal: session.exitSignal,
|
|
51936
|
+
hasRunningSubprocess: false,
|
|
51937
|
+
label: label(session),
|
|
51938
|
+
updatedAt: session.updatedAt
|
|
51939
|
+
};
|
|
51940
|
+
}
|
|
51941
|
+
function validateCwd(cwd) {
|
|
51942
|
+
return tryPromise({
|
|
51943
|
+
try: () => NodeFSP.stat(cwd),
|
|
51944
|
+
catch: (cause) => {
|
|
51945
|
+
return cause.code === "ENOENT" ? new TerminalCwdNotFoundError({ cwd }) : new TerminalCwdStatError({
|
|
51946
|
+
cwd,
|
|
51947
|
+
cause
|
|
51948
|
+
});
|
|
51949
|
+
}
|
|
51950
|
+
}).pipe(flatMap$1((stat) => stat.isDirectory() ? void_$1 : new TerminalCwdNotDirectoryError({ cwd })));
|
|
51951
|
+
}
|
|
51952
|
+
const layer$6 = effect(TerminalManager, gen(function* () {
|
|
51953
|
+
const pty = yield* PtyAdapter;
|
|
51954
|
+
const runFork = runForkWith(yield* context());
|
|
51955
|
+
const sessions = /* @__PURE__ */ new Map();
|
|
51956
|
+
const eventListeners = /* @__PURE__ */ new Set();
|
|
51957
|
+
const metadataListeners = /* @__PURE__ */ new Set();
|
|
51958
|
+
const attachListeners = /* @__PURE__ */ new Map();
|
|
51959
|
+
const publish = (event) => {
|
|
51960
|
+
if (eventListeners.size > 0) runFork(forEach(eventListeners, (listener) => listener(event), { discard: true }));
|
|
51961
|
+
if (event.type !== "started") {
|
|
51962
|
+
const listeners = attachListeners.get(sessionKey(event.threadId, event.terminalId));
|
|
51963
|
+
if (listeners && listeners.size > 0) runFork(forEach(listeners, (listener) => listener(event), { discard: true }));
|
|
51964
|
+
}
|
|
51965
|
+
};
|
|
51966
|
+
const publishMetadata = (event) => {
|
|
51967
|
+
if (metadataListeners.size > 0) runFork(forEach(metadataListeners, (listener) => listener(event), { discard: true }));
|
|
51968
|
+
};
|
|
51969
|
+
const touch = (session) => {
|
|
51970
|
+
session.updatedAt = now();
|
|
51971
|
+
session.sequence += 1;
|
|
51972
|
+
};
|
|
51973
|
+
const stop = (session) => {
|
|
51974
|
+
session.unsubscribeData?.();
|
|
51975
|
+
session.unsubscribeExit?.();
|
|
51976
|
+
session.unsubscribeData = null;
|
|
51977
|
+
session.unsubscribeExit = null;
|
|
51978
|
+
if (session.process) {
|
|
51979
|
+
try {
|
|
51980
|
+
session.process.kill();
|
|
51981
|
+
} catch {}
|
|
51982
|
+
session.process = null;
|
|
51983
|
+
}
|
|
51984
|
+
};
|
|
51985
|
+
const spawn = fn("TerminalManager.spawn")(function* (session) {
|
|
51986
|
+
session.status = "starting";
|
|
51987
|
+
session.exitCode = null;
|
|
51988
|
+
session.exitSignal = null;
|
|
51989
|
+
touch(session);
|
|
51990
|
+
const candidates = [
|
|
51991
|
+
process.env.SHELL,
|
|
51992
|
+
process.platform === "win32" ? process.env.ComSpec : void 0,
|
|
51993
|
+
process.platform === "win32" ? "powershell.exe" : "/bin/zsh",
|
|
51994
|
+
process.platform === "win32" ? "cmd.exe" : "/bin/bash",
|
|
51995
|
+
process.platform === "win32" ? void 0 : "/bin/sh"
|
|
51996
|
+
].filter((candidate) => Boolean(candidate));
|
|
51997
|
+
let lastError = null;
|
|
51998
|
+
let child = null;
|
|
51999
|
+
for (const shell of [...new Set(candidates)]) {
|
|
52000
|
+
const result$1 = yield* result(pty.spawn({
|
|
52001
|
+
shell,
|
|
52002
|
+
cwd: session.cwd,
|
|
52003
|
+
cols: session.cols,
|
|
52004
|
+
rows: session.rows,
|
|
52005
|
+
env: {
|
|
52006
|
+
...process.env,
|
|
52007
|
+
...session.env,
|
|
52008
|
+
TERM: "xterm-256color"
|
|
52009
|
+
}
|
|
52010
|
+
}));
|
|
52011
|
+
if (result$1._tag === "Success") {
|
|
52012
|
+
child = result$1.success;
|
|
52013
|
+
break;
|
|
52014
|
+
}
|
|
52015
|
+
lastError = result$1.failure;
|
|
52016
|
+
}
|
|
52017
|
+
if (!child) {
|
|
52018
|
+
session.status = "error";
|
|
52019
|
+
touch(session);
|
|
52020
|
+
publish({
|
|
52021
|
+
type: "error",
|
|
52022
|
+
threadId: session.threadId,
|
|
52023
|
+
terminalId: session.terminalId,
|
|
52024
|
+
sequence: session.sequence,
|
|
52025
|
+
message: lastError instanceof Error ? lastError.message : "Could not start terminal."
|
|
52026
|
+
});
|
|
52027
|
+
publishMetadata({
|
|
52028
|
+
type: "upsert",
|
|
52029
|
+
terminal: summary(session)
|
|
52030
|
+
});
|
|
52031
|
+
return;
|
|
52032
|
+
}
|
|
52033
|
+
session.process = child;
|
|
52034
|
+
session.status = "running";
|
|
52035
|
+
touch(session);
|
|
52036
|
+
const childPid = child.pid;
|
|
52037
|
+
session.unsubscribeData = child.onData((data) => {
|
|
52038
|
+
if (session.process?.pid !== childPid) return;
|
|
52039
|
+
session.history = `${session.history}${data}`.slice(-524288);
|
|
52040
|
+
touch(session);
|
|
52041
|
+
publish({
|
|
52042
|
+
type: "output",
|
|
52043
|
+
threadId: session.threadId,
|
|
52044
|
+
terminalId: session.terminalId,
|
|
52045
|
+
sequence: session.sequence,
|
|
52046
|
+
data
|
|
52047
|
+
});
|
|
52048
|
+
});
|
|
52049
|
+
session.unsubscribeExit = child.onExit((event) => {
|
|
52050
|
+
if (session.process?.pid !== childPid) return;
|
|
52051
|
+
session.unsubscribeData?.();
|
|
52052
|
+
session.unsubscribeData = null;
|
|
52053
|
+
session.unsubscribeExit = null;
|
|
52054
|
+
session.process = null;
|
|
52055
|
+
session.status = "exited";
|
|
52056
|
+
session.exitCode = event.exitCode;
|
|
52057
|
+
session.exitSignal = event.signal;
|
|
52058
|
+
touch(session);
|
|
52059
|
+
publish({
|
|
52060
|
+
type: "exited",
|
|
52061
|
+
threadId: session.threadId,
|
|
52062
|
+
terminalId: session.terminalId,
|
|
52063
|
+
sequence: session.sequence,
|
|
52064
|
+
exitCode: event.exitCode,
|
|
52065
|
+
exitSignal: event.signal
|
|
52066
|
+
});
|
|
52067
|
+
publishMetadata({
|
|
52068
|
+
type: "upsert",
|
|
52069
|
+
terminal: summary(session)
|
|
52070
|
+
});
|
|
52071
|
+
});
|
|
52072
|
+
publish({
|
|
52073
|
+
type: "started",
|
|
52074
|
+
threadId: session.threadId,
|
|
52075
|
+
terminalId: session.terminalId,
|
|
52076
|
+
sequence: session.sequence,
|
|
52077
|
+
snapshot: snapshot(session)
|
|
52078
|
+
});
|
|
52079
|
+
publishMetadata({
|
|
52080
|
+
type: "upsert",
|
|
52081
|
+
terminal: summary(session)
|
|
52082
|
+
});
|
|
52083
|
+
});
|
|
52084
|
+
const get = (threadId, terminalId) => sessions.get(sessionKey(threadId, terminalId));
|
|
52085
|
+
const open = fn("TerminalManager.open")(function* (input) {
|
|
52086
|
+
const existing = get(input.threadId, input.terminalId);
|
|
52087
|
+
if (existing) return snapshot(existing);
|
|
52088
|
+
yield* validateCwd(input.cwd);
|
|
52089
|
+
const session = {
|
|
52090
|
+
threadId: input.threadId,
|
|
52091
|
+
terminalId: input.terminalId,
|
|
52092
|
+
cwd: input.cwd,
|
|
52093
|
+
worktreePath: input.worktreePath ?? null,
|
|
52094
|
+
status: "starting",
|
|
52095
|
+
process: null,
|
|
52096
|
+
history: "",
|
|
52097
|
+
exitCode: null,
|
|
52098
|
+
exitSignal: null,
|
|
52099
|
+
updatedAt: now(),
|
|
52100
|
+
sequence: 0,
|
|
52101
|
+
cols: input.cols ?? DEFAULT_COLS,
|
|
52102
|
+
rows: input.rows ?? DEFAULT_ROWS,
|
|
52103
|
+
env: input.env,
|
|
52104
|
+
unsubscribeData: null,
|
|
52105
|
+
unsubscribeExit: null
|
|
52106
|
+
};
|
|
52107
|
+
sessions.set(sessionKey(input.threadId, input.terminalId), session);
|
|
52108
|
+
yield* spawn(session);
|
|
52109
|
+
return snapshot(session);
|
|
52110
|
+
});
|
|
52111
|
+
const restart = fn("TerminalManager.restart")(function* (input) {
|
|
52112
|
+
yield* validateCwd(input.cwd);
|
|
52113
|
+
const session = get(input.threadId, input.terminalId);
|
|
52114
|
+
if (!session) return yield* new TerminalSessionLookupError({
|
|
52115
|
+
threadId: input.threadId,
|
|
52116
|
+
terminalId: input.terminalId
|
|
52117
|
+
});
|
|
52118
|
+
stop(session);
|
|
52119
|
+
session.cwd = input.cwd;
|
|
52120
|
+
session.worktreePath = input.worktreePath ?? null;
|
|
52121
|
+
session.cols = input.cols;
|
|
52122
|
+
session.rows = input.rows;
|
|
52123
|
+
session.env = input.env;
|
|
52124
|
+
session.history = "";
|
|
52125
|
+
yield* spawn(session);
|
|
52126
|
+
publish({
|
|
52127
|
+
type: "restarted",
|
|
52128
|
+
threadId: session.threadId,
|
|
52129
|
+
terminalId: session.terminalId,
|
|
52130
|
+
sequence: session.sequence,
|
|
52131
|
+
snapshot: snapshot(session)
|
|
52132
|
+
});
|
|
52133
|
+
return snapshot(session);
|
|
52134
|
+
});
|
|
52135
|
+
const attachStream = fn("TerminalManager.attachStream")(function* (input, listener) {
|
|
52136
|
+
let session = get(input.threadId, input.terminalId);
|
|
52137
|
+
if (!session && input.cwd) {
|
|
52138
|
+
yield* open({
|
|
52139
|
+
threadId: input.threadId,
|
|
52140
|
+
terminalId: input.terminalId,
|
|
52141
|
+
cwd: input.cwd,
|
|
52142
|
+
worktreePath: input.worktreePath ?? null,
|
|
52143
|
+
cols: input.cols,
|
|
52144
|
+
rows: input.rows,
|
|
52145
|
+
env: input.env
|
|
52146
|
+
});
|
|
52147
|
+
session = get(input.threadId, input.terminalId);
|
|
52148
|
+
}
|
|
52149
|
+
if (!session) return yield* new TerminalSessionLookupError({
|
|
52150
|
+
threadId: input.threadId,
|
|
52151
|
+
terminalId: input.terminalId
|
|
52152
|
+
});
|
|
52153
|
+
if (input.restartIfNotRunning && session.status !== "running" && input.cwd) yield* restart({
|
|
52154
|
+
threadId: input.threadId,
|
|
52155
|
+
terminalId: input.terminalId,
|
|
52156
|
+
cwd: input.cwd,
|
|
52157
|
+
worktreePath: input.worktreePath ?? null,
|
|
52158
|
+
cols: input.cols ?? session.cols,
|
|
52159
|
+
rows: input.rows ?? session.rows,
|
|
52160
|
+
env: input.env
|
|
52161
|
+
});
|
|
52162
|
+
yield* listener({
|
|
52163
|
+
type: "snapshot",
|
|
52164
|
+
snapshot: snapshot(session)
|
|
52165
|
+
});
|
|
52166
|
+
const key = sessionKey(input.threadId, input.terminalId);
|
|
52167
|
+
const listeners = attachListeners.get(key) ?? /* @__PURE__ */ new Set();
|
|
52168
|
+
listeners.add(listener);
|
|
52169
|
+
attachListeners.set(key, listeners);
|
|
52170
|
+
return () => {
|
|
52171
|
+
listeners.delete(listener);
|
|
52172
|
+
if (listeners.size === 0) attachListeners.delete(key);
|
|
52173
|
+
};
|
|
52174
|
+
});
|
|
52175
|
+
const write = (input) => gen(function* () {
|
|
52176
|
+
const session = get(input.threadId, input.terminalId);
|
|
52177
|
+
if (!session) return yield* new TerminalSessionLookupError({
|
|
52178
|
+
threadId: input.threadId,
|
|
52179
|
+
terminalId: input.terminalId
|
|
52180
|
+
});
|
|
52181
|
+
if (!session.process || session.status !== "running") return yield* new TerminalNotRunningError({
|
|
52182
|
+
threadId: input.threadId,
|
|
52183
|
+
terminalId: input.terminalId
|
|
52184
|
+
});
|
|
52185
|
+
yield* try_({
|
|
52186
|
+
try: () => session.process.write(input.data),
|
|
52187
|
+
catch: (cause) => new TerminalWriteError({
|
|
52188
|
+
threadId: input.threadId,
|
|
52189
|
+
terminalId: input.terminalId,
|
|
52190
|
+
terminalPid: session.process.pid,
|
|
52191
|
+
cause
|
|
52192
|
+
})
|
|
52193
|
+
});
|
|
52194
|
+
});
|
|
52195
|
+
const resize = (input) => gen(function* () {
|
|
52196
|
+
const session = get(input.threadId, input.terminalId);
|
|
52197
|
+
if (!session) return yield* new TerminalSessionLookupError({
|
|
52198
|
+
threadId: input.threadId,
|
|
52199
|
+
terminalId: input.terminalId
|
|
52200
|
+
});
|
|
52201
|
+
if (!session.process || session.status !== "running") return yield* new TerminalNotRunningError({
|
|
52202
|
+
threadId: input.threadId,
|
|
52203
|
+
terminalId: input.terminalId
|
|
52204
|
+
});
|
|
52205
|
+
yield* try_({
|
|
52206
|
+
try: () => session.process.resize(input.cols, input.rows),
|
|
52207
|
+
catch: (cause) => new TerminalResizeError({
|
|
52208
|
+
threadId: input.threadId,
|
|
52209
|
+
terminalId: input.terminalId,
|
|
52210
|
+
terminalPid: session.process.pid,
|
|
52211
|
+
cols: input.cols,
|
|
52212
|
+
rows: input.rows,
|
|
52213
|
+
cause
|
|
52214
|
+
})
|
|
52215
|
+
});
|
|
52216
|
+
session.cols = input.cols;
|
|
52217
|
+
session.rows = input.rows;
|
|
52218
|
+
});
|
|
52219
|
+
const clear = (input) => gen(function* () {
|
|
52220
|
+
const session = get(input.threadId, input.terminalId);
|
|
52221
|
+
if (!session) return yield* new TerminalSessionLookupError({
|
|
52222
|
+
threadId: input.threadId,
|
|
52223
|
+
terminalId: input.terminalId
|
|
52224
|
+
});
|
|
52225
|
+
session.history = "";
|
|
52226
|
+
touch(session);
|
|
52227
|
+
publish({
|
|
52228
|
+
type: "cleared",
|
|
52229
|
+
threadId: session.threadId,
|
|
52230
|
+
terminalId: session.terminalId,
|
|
52231
|
+
sequence: session.sequence
|
|
52232
|
+
});
|
|
52233
|
+
});
|
|
52234
|
+
const close = (input) => sync(() => {
|
|
52235
|
+
const targets = [...sessions.values()].filter((session) => session.threadId === input.threadId && (input.terminalId === void 0 || session.terminalId === input.terminalId));
|
|
52236
|
+
for (const session of targets) {
|
|
52237
|
+
stop(session);
|
|
52238
|
+
sessions.delete(sessionKey(session.threadId, session.terminalId));
|
|
52239
|
+
attachListeners.delete(sessionKey(session.threadId, session.terminalId));
|
|
52240
|
+
touch(session);
|
|
52241
|
+
publish({
|
|
52242
|
+
type: "closed",
|
|
52243
|
+
threadId: session.threadId,
|
|
52244
|
+
terminalId: session.terminalId,
|
|
52245
|
+
sequence: session.sequence
|
|
52246
|
+
});
|
|
52247
|
+
publishMetadata({
|
|
52248
|
+
type: "remove",
|
|
52249
|
+
threadId: session.threadId,
|
|
52250
|
+
terminalId: session.terminalId
|
|
52251
|
+
});
|
|
52252
|
+
}
|
|
52253
|
+
});
|
|
52254
|
+
return TerminalManager.of({
|
|
52255
|
+
open,
|
|
52256
|
+
attachStream,
|
|
52257
|
+
write,
|
|
52258
|
+
resize,
|
|
52259
|
+
clear,
|
|
52260
|
+
restart,
|
|
52261
|
+
close,
|
|
52262
|
+
subscribe: (listener) => sync(() => {
|
|
52263
|
+
eventListeners.add(listener);
|
|
52264
|
+
return () => eventListeners.delete(listener);
|
|
52265
|
+
}),
|
|
52266
|
+
subscribeMetadata: (listener) => gen(function* () {
|
|
52267
|
+
yield* listener({
|
|
52268
|
+
type: "snapshot",
|
|
52269
|
+
terminals: [...sessions.values()].map(summary)
|
|
52270
|
+
});
|
|
52271
|
+
metadataListeners.add(listener);
|
|
52272
|
+
return () => metadataListeners.delete(listener);
|
|
52273
|
+
})
|
|
52274
|
+
});
|
|
52275
|
+
}));
|
|
52276
|
+
//#endregion
|
|
51677
52277
|
//#region src/auth/RpcAuthorization.ts
|
|
51678
52278
|
/**
|
|
51679
52279
|
* Keep authorization coverage coupled to the RPC group itself. Adding an RPC to
|
|
@@ -51772,7 +52372,7 @@ function requiredScopeForRpcMethod(method) {
|
|
|
51772
52372
|
//#endregion
|
|
51773
52373
|
//#region src/ws.ts
|
|
51774
52374
|
const isOrchestrationDispatchCommandError = is(OrchestrationDispatchCommandError);
|
|
51775
|
-
const nowIso$2 = map$4(now, formatIso);
|
|
52375
|
+
const nowIso$2 = map$4(now$1, formatIso);
|
|
51776
52376
|
const EDITOR_DISCOVERY_TIMEOUT = seconds(5);
|
|
51777
52377
|
const resolveAvailableEditorsForConfig = (discovery) => discovery.pipe(timeoutOption(EDITOR_DISCOVERY_TIMEOUT), map$4(getOrElse(() => [])));
|
|
51778
52378
|
function unexpectedCompatibilityError(error) {
|
|
@@ -51903,11 +52503,7 @@ const UNSUPPORTED_STREAM_METHODS = /* @__PURE__ */ new Set([
|
|
|
51903
52503
|
WS_METHODS.serverUpdateServerWithProgress,
|
|
51904
52504
|
WS_METHODS.subscribeDiscoveredLocalServers,
|
|
51905
52505
|
WS_METHODS.subscribePreviewEvents,
|
|
51906
|
-
WS_METHODS.subscribeResourceTelemetry
|
|
51907
|
-
WS_METHODS.subscribeTerminalEvents,
|
|
51908
|
-
WS_METHODS.subscribeTerminalMetadata,
|
|
51909
|
-
WS_METHODS.subscribeVcsStatus,
|
|
51910
|
-
WS_METHODS.terminalAttach
|
|
52506
|
+
WS_METHODS.subscribeResourceTelemetry
|
|
51911
52507
|
]);
|
|
51912
52508
|
/**
|
|
51913
52509
|
* Generic stub value: each usage below reads `unsupportedRpc<Tag>` with an
|
|
@@ -51931,6 +52527,8 @@ const wsRpcServices = gen(function* () {
|
|
|
51931
52527
|
startup: yield* ServerRuntimeStartup,
|
|
51932
52528
|
workspaceEntries: yield* WorkspaceEntries,
|
|
51933
52529
|
workspaceFileSystem: yield* WorkspaceFileSystem,
|
|
52530
|
+
gitWorkspace: yield* GitWorkspace,
|
|
52531
|
+
terminalManager: yield* TerminalManager,
|
|
51934
52532
|
serverEnvironment: yield* ServerEnvironment,
|
|
51935
52533
|
backgroundPolicy: yield* BackgroundPolicy,
|
|
51936
52534
|
serverAuth: yield* EnvironmentAuth,
|
|
@@ -51940,9 +52538,9 @@ const wsRpcServices = gen(function* () {
|
|
|
51940
52538
|
});
|
|
51941
52539
|
const makeWsRpcLayer = (currentSession) => WsRpcGroup.toLayer(gen(function* () {
|
|
51942
52540
|
const currentSessionId = currentSession.sessionId;
|
|
51943
|
-
const { crypto, projectionSnapshotQuery, orchestrationEngine, keybindings, externalLauncher, providerRegistry, config, lifecycleEvents, serverSettings, startup, workspaceEntries, workspaceFileSystem, serverEnvironment, backgroundPolicy, serverAuth, bootstrapCredentials, sessions } = yield* wsRpcServices;
|
|
52541
|
+
const { crypto, projectionSnapshotQuery, orchestrationEngine, keybindings, externalLauncher, providerRegistry, config, lifecycleEvents, serverSettings, startup, workspaceEntries, workspaceFileSystem, gitWorkspace, terminalManager, serverEnvironment, backgroundPolicy, serverAuth, bootstrapCredentials, sessions } = yield* wsRpcServices;
|
|
51944
52542
|
const providerMaintenanceRunner = yield* ProviderMaintenanceRunner;
|
|
51945
|
-
const rpcClientIds = yield* make$
|
|
52543
|
+
const rpcClientIds = yield* make$63(/* @__PURE__ */ new Set());
|
|
51946
52544
|
yield* addFinalizer(() => get$3(rpcClientIds).pipe(flatMap$1((clientIds) => forEach(clientIds, (clientId) => backgroundPolicy.removeRpcClient(currentSessionId, clientId), { discard: true })), ignore$1));
|
|
51947
52545
|
const authorizationError = (requiredScope) => new EnvironmentAuthorizationError({
|
|
51948
52546
|
message: `The authenticated token is missing required scope: ${requiredScope}.`,
|
|
@@ -52157,7 +52755,7 @@ const makeWsRpcLayer = (currentSession) => WsRpcGroup.toLayer(gen(function* () {
|
|
|
52157
52755
|
if (input.afterSequence !== void 0) {
|
|
52158
52756
|
const afterSequence = input.afterSequence;
|
|
52159
52757
|
const replayGap = (yield* orchestrationEngine.latestSequence) - afterSequence;
|
|
52160
|
-
if (replayGap < 0 || replayGap > SHELL_RESUME_MAX_GAP) return concat(make$
|
|
52758
|
+
if (replayGap < 0 || replayGap > SHELL_RESUME_MAX_GAP) return concat(make$74({
|
|
52161
52759
|
kind: "snapshot",
|
|
52162
52760
|
snapshot: yield* loadSnapshot
|
|
52163
52761
|
}), synchronizedThenLive);
|
|
@@ -52166,7 +52764,7 @@ const makeWsRpcLayer = (currentSession) => WsRpcGroup.toLayer(gen(function* () {
|
|
|
52166
52764
|
cause
|
|
52167
52765
|
}))), synchronizedThenLive);
|
|
52168
52766
|
}
|
|
52169
|
-
return concat(make$
|
|
52767
|
+
return concat(make$74({
|
|
52170
52768
|
kind: "snapshot",
|
|
52171
52769
|
snapshot: yield* loadSnapshot
|
|
52172
52770
|
}), synchronizedThenLive);
|
|
@@ -52204,7 +52802,7 @@ const makeWsRpcLayer = (currentSession) => WsRpcGroup.toLayer(gen(function* () {
|
|
|
52204
52802
|
cause: input.threadId
|
|
52205
52803
|
});
|
|
52206
52804
|
const afterSnapshot = input.requestCompletionMarker === true ? concat(fromEffect(offer$1(liveBuffer, { kind: "synchronized" })).pipe(drain), bufferedLiveStream) : bufferedLiveStream;
|
|
52207
|
-
return concat(make$
|
|
52805
|
+
return concat(make$74({
|
|
52208
52806
|
kind: "snapshot",
|
|
52209
52807
|
snapshot: projectThreadDetailSnapshot(snapshot.value)
|
|
52210
52808
|
}), afterSnapshot);
|
|
@@ -52308,7 +52906,7 @@ const makeWsRpcLayer = (currentSession) => WsRpcGroup.toLayer(gen(function* () {
|
|
|
52308
52906
|
})));
|
|
52309
52907
|
yield* providerRegistry.refresh().pipe(ignoreCause({ log: true }), forkScoped);
|
|
52310
52908
|
const liveUpdates = merge$2(keybindingsUpdates, merge$2(providerStatuses, settingsUpdates));
|
|
52311
|
-
return concat(make$
|
|
52909
|
+
return concat(make$74({
|
|
52312
52910
|
version: 1,
|
|
52313
52911
|
type: "snapshot",
|
|
52314
52912
|
config: yield* loadServerConfig
|
|
@@ -52322,9 +52920,9 @@ const makeWsRpcLayer = (currentSession) => WsRpcGroup.toLayer(gen(function* () {
|
|
|
52322
52920
|
}), { "rpc.aggregate": "server" }),
|
|
52323
52921
|
[WS_METHODS.subscribeAuthAccess]: (_input) => observeRpcStreamEffect$1(WS_METHODS.subscribeAuthAccess, gen(function* () {
|
|
52324
52922
|
const initialSnapshot = yield* loadAuthAccessSnapshot();
|
|
52325
|
-
const revisionRef = yield* make$
|
|
52923
|
+
const revisionRef = yield* make$63(1);
|
|
52326
52924
|
const liveEvents = merge$2(bootstrapCredentials.streamChanges, sessions.streamChanges).pipe(mapEffect$1((change) => updateAndGet(revisionRef, (revision) => revision + 1).pipe(map$4((revision) => toAuthAccessStreamEvent(change, revision, currentSessionId)))));
|
|
52327
|
-
return concat(make$
|
|
52925
|
+
return concat(make$74({
|
|
52328
52926
|
version: 1,
|
|
52329
52927
|
revision: 1,
|
|
52330
52928
|
type: "snapshot",
|
|
@@ -52363,28 +52961,28 @@ const makeWsRpcLayer = (currentSession) => WsRpcGroup.toLayer(gen(function* () {
|
|
|
52363
52961
|
[WS_METHODS.subscribeDiscoveredLocalServers]: unsupportedRpc,
|
|
52364
52962
|
[WS_METHODS.subscribePreviewEvents]: unsupportedRpc,
|
|
52365
52963
|
[WS_METHODS.subscribeResourceTelemetry]: unsupportedRpc,
|
|
52366
|
-
[WS_METHODS.subscribeTerminalEvents]:
|
|
52367
|
-
[WS_METHODS.subscribeTerminalMetadata]:
|
|
52368
|
-
[WS_METHODS.subscribeVcsStatus]:
|
|
52369
|
-
[WS_METHODS.terminalAttach]:
|
|
52370
|
-
[WS_METHODS.terminalClear]:
|
|
52371
|
-
[WS_METHODS.terminalClose]:
|
|
52372
|
-
[WS_METHODS.terminalOpen]:
|
|
52373
|
-
[WS_METHODS.terminalResize]:
|
|
52374
|
-
[WS_METHODS.terminalRestart]:
|
|
52375
|
-
[WS_METHODS.terminalWrite]:
|
|
52964
|
+
[WS_METHODS.subscribeTerminalEvents]: (_input) => observeRpcStream$1(WS_METHODS.subscribeTerminalEvents, callback$1((queue) => acquireRelease(terminalManager.subscribe((event) => offer$1(queue, event)), (unsubscribe) => sync(unsubscribe))), { "rpc.aggregate": "terminal" }),
|
|
52965
|
+
[WS_METHODS.subscribeTerminalMetadata]: (_input) => observeRpcStream$1(WS_METHODS.subscribeTerminalMetadata, callback$1((queue) => acquireRelease(terminalManager.subscribeMetadata((event) => offer$1(queue, event)), (unsubscribe) => sync(unsubscribe))), { "rpc.aggregate": "terminal" }),
|
|
52966
|
+
[WS_METHODS.subscribeVcsStatus]: (input) => observeRpcStream$1(WS_METHODS.subscribeVcsStatus, gitWorkspace.statusStream(input.cwd), { "rpc.aggregate": "vcs" }),
|
|
52967
|
+
[WS_METHODS.terminalAttach]: (input) => observeRpcStream$1(WS_METHODS.terminalAttach, callback$1((queue) => acquireRelease(terminalManager.attachStream(input, (event) => offer$1(queue, event)), (unsubscribe) => sync(unsubscribe))), { "rpc.aggregate": "terminal" }),
|
|
52968
|
+
[WS_METHODS.terminalClear]: (input) => observeRpcEffect$1(WS_METHODS.terminalClear, terminalManager.clear(input), { "rpc.aggregate": "terminal" }),
|
|
52969
|
+
[WS_METHODS.terminalClose]: (input) => observeRpcEffect$1(WS_METHODS.terminalClose, terminalManager.close(input), { "rpc.aggregate": "terminal" }),
|
|
52970
|
+
[WS_METHODS.terminalOpen]: (input) => observeRpcEffect$1(WS_METHODS.terminalOpen, terminalManager.open(input), { "rpc.aggregate": "terminal" }),
|
|
52971
|
+
[WS_METHODS.terminalResize]: (input) => observeRpcEffect$1(WS_METHODS.terminalResize, terminalManager.resize(input), { "rpc.aggregate": "terminal" }),
|
|
52972
|
+
[WS_METHODS.terminalRestart]: (input) => observeRpcEffect$1(WS_METHODS.terminalRestart, terminalManager.restart(input), { "rpc.aggregate": "terminal" }),
|
|
52973
|
+
[WS_METHODS.terminalWrite]: (input) => observeRpcEffect$1(WS_METHODS.terminalWrite, terminalManager.write(input), { "rpc.aggregate": "terminal" }),
|
|
52376
52974
|
[WS_METHODS.vcsCreateRef]: unsupportedRpc,
|
|
52377
52975
|
[WS_METHODS.vcsCreateWorktree]: unsupportedRpc,
|
|
52378
52976
|
[WS_METHODS.vcsInit]: unsupportedRpc,
|
|
52379
|
-
[WS_METHODS.vcsListRefs]:
|
|
52977
|
+
[WS_METHODS.vcsListRefs]: (input) => observeRpcEffect$1(WS_METHODS.vcsListRefs, gitWorkspace.listRefs(input), { "rpc.aggregate": "vcs" }),
|
|
52380
52978
|
[WS_METHODS.vcsPull]: unsupportedRpc,
|
|
52381
|
-
[WS_METHODS.vcsRefreshStatus]:
|
|
52979
|
+
[WS_METHODS.vcsRefreshStatus]: (input) => observeRpcEffect$1(WS_METHODS.vcsRefreshStatus, gitWorkspace.status(input.cwd), { "rpc.aggregate": "vcs" }),
|
|
52382
52980
|
[WS_METHODS.vcsRemoveWorktree]: unsupportedRpc,
|
|
52383
|
-
[WS_METHODS.vcsSwitchRef]:
|
|
52981
|
+
[WS_METHODS.vcsSwitchRef]: (input) => observeRpcEffect$1(WS_METHODS.vcsSwitchRef, gitWorkspace.switchRef(input), { "rpc.aggregate": "vcs" }),
|
|
52384
52982
|
[ORCHESTRATION_WS_METHODS.getFullThreadDiff]: unsupportedRpc,
|
|
52385
52983
|
[ORCHESTRATION_WS_METHODS.getTurnDiff]: unsupportedRpc,
|
|
52386
52984
|
[ORCHESTRATION_WS_METHODS.getWorkflowScript]: unsupportedRpc,
|
|
52387
|
-
[WS_METHODS.subscribeBackgroundPolicy]: (_input) => observeRpcStream$1(WS_METHODS.subscribeBackgroundPolicy, unwrap$1(map$4(backgroundPolicy.subscribe, ({ latest, changes }) => concat(make$
|
|
52985
|
+
[WS_METHODS.subscribeBackgroundPolicy]: (_input) => observeRpcStream$1(WS_METHODS.subscribeBackgroundPolicy, unwrap$1(map$4(backgroundPolicy.subscribe, ({ latest, changes }) => concat(make$74(latest), changes))), { "rpc.aggregate": "server" })
|
|
52388
52986
|
});
|
|
52389
52987
|
}));
|
|
52390
52988
|
const websocketRpcRouteLayer = unwrap(gen(function* () {
|
|
@@ -52393,7 +52991,7 @@ const websocketRpcRouteLayer = unwrap(gen(function* () {
|
|
|
52393
52991
|
const serverAuth = yield* EnvironmentAuth;
|
|
52394
52992
|
const sessions = yield* SessionStore;
|
|
52395
52993
|
const session = yield* serverAuth.authenticateWebSocketUpgrade(request).pipe(catchIf(isServerAuthCredentialError, (error) => failEnvironmentAuthInvalid(serverAuthCredentialReason(error))), catchIf(isServerAuthInternalError, (error) => failEnvironmentInternal("internal_error", error)));
|
|
52396
|
-
const rpcWebSocketHttpEffect = yield* toHttpEffectWebsocket(WsRpcGroup, { disableTracing: true }).pipe(provide$1(makeWsRpcLayer(session).pipe(provideMerge(layerJson), provide(layer$
|
|
52994
|
+
const rpcWebSocketHttpEffect = yield* toHttpEffectWebsocket(WsRpcGroup, { disableTracing: true }).pipe(provide$1(makeWsRpcLayer(session).pipe(provideMerge(layerJson), provide(layer$11))));
|
|
52397
52995
|
return yield* acquireUseRelease(sessions.markConnected(session.sessionId), () => rpcWebSocketHttpEffect, () => sessions.markDisconnected(session.sessionId));
|
|
52398
52996
|
}).pipe(catchTags({
|
|
52399
52997
|
EnvironmentAuthInvalidError: toResponse,
|
|
@@ -52549,7 +53147,7 @@ const ResponseDefectEncoded = (cause) => ({
|
|
|
52549
53147
|
});
|
|
52550
53148
|
const makeTunnelSocketProtocol = gen(function* () {
|
|
52551
53149
|
const serialization = yield* RpcSerialization;
|
|
52552
|
-
const disconnects = yield* make$
|
|
53150
|
+
const disconnects = yield* make$78();
|
|
52553
53151
|
let clientId = 0;
|
|
52554
53152
|
const clients = /* @__PURE__ */ new Map();
|
|
52555
53153
|
const clientIds = /* @__PURE__ */ new Set();
|
|
@@ -52631,7 +53229,7 @@ function encodeHttpTunnelResponseFrame(frame) {
|
|
|
52631
53229
|
}
|
|
52632
53230
|
const makeTunnelSocket = (input) => {
|
|
52633
53231
|
const runRaw = (handler, options) => scopedWith((scope) => gen(function* () {
|
|
52634
|
-
const fiberSet = yield* make$
|
|
53232
|
+
const fiberSet = yield* make$65().pipe(provide$2(scope));
|
|
52635
53233
|
const runFork = yield* runtime(fiberSet)();
|
|
52636
53234
|
const deliver = (frame) => {
|
|
52637
53235
|
const handled = handler(frame);
|
|
@@ -52642,7 +53240,7 @@ const makeTunnelSocket = (input) => {
|
|
|
52642
53240
|
if (options?.onOpen) yield* options.onOpen;
|
|
52643
53241
|
yield* _await(input.tunnel.closed).pipe(raceFirst(join$1(fiberSet)));
|
|
52644
53242
|
}));
|
|
52645
|
-
return make$
|
|
53243
|
+
return make$66({
|
|
52646
53244
|
runRaw,
|
|
52647
53245
|
writer: sync(() => (chunk) => sync(() => {
|
|
52648
53246
|
if (typeof chunk === "string") for (const part of chunkAgentLinkFrame(chunk)) input.sendEncrypted(JSON.stringify(utf8ToEnvelope(input.enckey, part)));
|
|
@@ -52721,8 +53319,8 @@ const runHubTunnel = (config) => gen(function* () {
|
|
|
52721
53319
|
subject: "hub-tunnel",
|
|
52722
53320
|
method: "bearer-access-token",
|
|
52723
53321
|
scopes: [...TUNNEL_SCOPES]
|
|
52724
|
-
}).pipe(provideMerge(layerJson), provide(layer$
|
|
52725
|
-
yield* make$
|
|
53322
|
+
}).pipe(provideMerge(layerJson), provide(layer$11))).pipe(provideContext(currentContext));
|
|
53323
|
+
yield* make$16(WsRpcGroup, { disableTracing: true }).pipe(provideService(Protocol, protocol), provideContext(rpcContext));
|
|
52726
53324
|
}).pipe(tapCause((cause) => logError("hub tunnel: RPC server failed", { cause: String(cause) }))));
|
|
52727
53325
|
yield* forkScoped(onSocket(socketAdapter));
|
|
52728
53326
|
if (!writeHub(JSON.stringify({
|
|
@@ -52805,7 +53403,7 @@ const runHubTunnel = (config) => gen(function* () {
|
|
|
52805
53403
|
if (lower === "authorization" || lower === "cookie") continue;
|
|
52806
53404
|
headers[lower] = value;
|
|
52807
53405
|
}
|
|
52808
|
-
let request = make$
|
|
53406
|
+
let request = make$64(requestFrame.method)(targetUrl).pipe(setHeaders(headers));
|
|
52809
53407
|
if (requestFrame.body !== null) request = setBody(uint8Array(Buffer.from(requestFrame.body, "base64")))(request);
|
|
52810
53408
|
const response = yield* httpClient.execute(request);
|
|
52811
53409
|
const responseBody = yield* response.arrayBuffer;
|
|
@@ -52858,7 +53456,7 @@ const runHubTunnel = (config) => gen(function* () {
|
|
|
52858
53456
|
const tunnelId = control.tunnelId;
|
|
52859
53457
|
if (tunnels.has(tunnelId)) return;
|
|
52860
53458
|
return gen(function* () {
|
|
52861
|
-
const closed = yield* make$
|
|
53459
|
+
const closed = yield* make$73();
|
|
52862
53460
|
const purpose = control.purpose === "http" ? "http" : "rpc";
|
|
52863
53461
|
const live = {
|
|
52864
53462
|
closed,
|
|
@@ -52912,7 +53510,7 @@ const runHubTunnel = (config) => gen(function* () {
|
|
|
52912
53510
|
while: (error) => !(SocketError.is(error) && error.reason._tag === "SocketCloseError" && (error.reason.code === 4401 || error.reason.code === 4403))
|
|
52913
53511
|
});
|
|
52914
53512
|
}).pipe(tapDefect((cause) => logError("hub tunnel: worker defect", { cause: String(cause) })), catchCause((cause) => logError("hub tunnel: worker failed", { cause: String(cause) })));
|
|
52915
|
-
const layer$
|
|
53513
|
+
const layer$5 = (config) => effectDiscard(forkScoped(runHubTunnel(config)));
|
|
52916
53514
|
//#endregion
|
|
52917
53515
|
//#region src/persistence/ProviderSessionRuntime.ts
|
|
52918
53516
|
/**
|
|
@@ -52971,7 +53569,7 @@ function toPersistenceSqlOrDecodeError(sqlOperation, decodeOperation, correlatio
|
|
|
52971
53569
|
cause
|
|
52972
53570
|
});
|
|
52973
53571
|
}
|
|
52974
|
-
const layer$
|
|
53572
|
+
const layer$4 = effect(ProviderSessionRuntimeRepository, gen(function* () {
|
|
52975
53573
|
const sql = yield* SqlClient;
|
|
52976
53574
|
const upsertRuntimeRow = void_({
|
|
52977
53575
|
Request: ProviderSessionRuntimeDbRowSchema,
|
|
@@ -53254,7 +53852,7 @@ const ProviderSessionDirectoryLive = effect(ProviderSessionDirectory, gen(functi
|
|
|
53254
53852
|
operation: "ProviderSessionDirectory.upsert",
|
|
53255
53853
|
issue: "threadId must be a non-empty string."
|
|
53256
53854
|
});
|
|
53257
|
-
const now
|
|
53855
|
+
const now = formatIso(yield* now$1);
|
|
53258
53856
|
const providerChanged = existingRuntime !== void 0 && existingRuntime.providerName !== binding.provider;
|
|
53259
53857
|
const providerInstanceId = binding.providerInstanceId ?? (!providerChanged ? existingRuntime?.providerInstanceId : null);
|
|
53260
53858
|
if (providerInstanceId === null || providerInstanceId === void 0) return yield* new ProviderValidationError({
|
|
@@ -53268,7 +53866,7 @@ const ProviderSessionDirectoryLive = effect(ProviderSessionDirectory, gen(functi
|
|
|
53268
53866
|
adapterKey: binding.adapterKey ?? (providerChanged ? binding.provider : existingRuntime?.adapterKey ?? binding.provider),
|
|
53269
53867
|
runtimeMode: binding.runtimeMode ?? existingRuntime?.runtimeMode ?? "full-access",
|
|
53270
53868
|
status: binding.status ?? existingRuntime?.status ?? "running",
|
|
53271
|
-
lastSeenAt: now
|
|
53869
|
+
lastSeenAt: now,
|
|
53272
53870
|
resumeCursor: binding.resumeCursor !== void 0 ? binding.resumeCursor : existingRuntime?.resumeCursor ?? null,
|
|
53273
53871
|
runtimePayload: mergeRuntimePayload(existingRuntime?.runtimePayload ?? null, binding.runtimePayload)
|
|
53274
53872
|
}).pipe(mapError(toPersistenceError("ProviderSessionDirectory.upsert:upsert")));
|
|
@@ -53661,7 +54259,7 @@ const makeEventNdjsonLogStore = fnUntraced(function* (filePath, options = {}) {
|
|
|
53661
54259
|
filePath: failure.filePath,
|
|
53662
54260
|
errorTag: errorTag(failure.cause)
|
|
53663
54261
|
});
|
|
53664
|
-
const stateRef = yield* make$
|
|
54262
|
+
const stateRef = yield* make$53({
|
|
53665
54263
|
pending: [],
|
|
53666
54264
|
pendingBytes: 0,
|
|
53667
54265
|
sinks: /* @__PURE__ */ new Map(),
|
|
@@ -53669,7 +54267,7 @@ const makeEventNdjsonLogStore = fnUntraced(function* (filePath, options = {}) {
|
|
|
53669
54267
|
closed: false,
|
|
53670
54268
|
lastRetentionAt: initializedAt
|
|
53671
54269
|
});
|
|
53672
|
-
const timerScope = yield* make$
|
|
54270
|
+
const timerScope = yield* make$76();
|
|
53673
54271
|
const flush = fnUntraced(function* (timerFired, close) {
|
|
53674
54272
|
const startedAt = yield* currentTimeMillis;
|
|
53675
54273
|
const result = yield* modifyEffect(stateRef, (state) => sync(() => drainPending({
|
|
@@ -53715,7 +54313,7 @@ const makeEventNdjsonLogStore = fnUntraced(function* (filePath, options = {}) {
|
|
|
53715
54313
|
if (!shouldPersist(stream, event)) return;
|
|
53716
54314
|
const payload = yield* serializeEvent(event);
|
|
53717
54315
|
if (payload === void 0) return;
|
|
53718
|
-
const line = `[${yield* now.pipe(map$4(formatIso))}] ${resolveStreamLabel(stream)}: ${payload}\n`;
|
|
54316
|
+
const line = `[${yield* now$1.pipe(map$4(formatIso))}] ${resolveStreamLabel(stream)}: ${payload}\n`;
|
|
53719
54317
|
const bytes = Buffer.byteLength(line);
|
|
53720
54318
|
if ((yield* modifyEffect(stateRef, (state) => {
|
|
53721
54319
|
if (state.closed) return succeed$1([{ flush: false }, state]);
|
|
@@ -53802,7 +54400,7 @@ const NoOpProviderEventLoggers = {
|
|
|
53802
54400
|
native: void 0,
|
|
53803
54401
|
canonical: void 0
|
|
53804
54402
|
};
|
|
53805
|
-
const layer$
|
|
54403
|
+
const layer$3 = effect(ProviderEventLoggers, gen(function* () {
|
|
53806
54404
|
const { providerEventLogPath } = yield* ServerConfig;
|
|
53807
54405
|
const attribution = yield* ResourceAttribution;
|
|
53808
54406
|
const store = yield* makeEventNdjsonLogStore(providerEventLogPath, { attribution }).pipe(catch_((error) => logWarning$1(error.message, { error }).pipe(annotateLogs({ scope: "provider-observability" }), as(void 0))));
|
|
@@ -53901,7 +54499,7 @@ const ProviderServiceLive = effect(ProviderService, fn("makeProviderService")(fu
|
|
|
53901
54499
|
const registry = yield* ProviderAdapterRegistry;
|
|
53902
54500
|
const directory = yield* ProviderSessionDirectory;
|
|
53903
54501
|
const runtimeEventPubSub = yield* unbounded$1();
|
|
53904
|
-
const nowIso = map$4(now, formatIso);
|
|
54502
|
+
const nowIso = map$4(now$1, formatIso);
|
|
53905
54503
|
const publishRuntimeEvent = (event) => succeed$1(event).pipe(tap((canonicalEvent) => canonicalEventLogger ? canonicalEventLogger.write(canonicalEvent, canonicalEvent.threadId) : void_$1), flatMap$1((canonicalEvent) => publish(runtimeEventPubSub, canonicalEvent)), asVoid);
|
|
53906
54504
|
const requireBindingInstanceId = (operation, payload) => payload.providerInstanceId !== void 0 ? succeed$1(payload.providerInstanceId) : fail(toValidationError(operation, payload.provider ? `Provider instance id is required for provider '${payload.provider}'.` : "Provider instance id is required."));
|
|
53907
54505
|
const upsertSessionBinding = (session, threadId, extra) => gen(function* () {
|
|
@@ -53920,7 +54518,7 @@ const ProviderServiceLive = effect(ProviderService, fn("makeProviderService")(fu
|
|
|
53920
54518
|
provider: canonicalEvent.provider,
|
|
53921
54519
|
eventType: canonicalEvent.type
|
|
53922
54520
|
}).pipe(andThen(publishRuntimeEvent(canonicalEvent)))));
|
|
53923
|
-
const subscribedAdapters = yield* make$
|
|
54521
|
+
const subscribedAdapters = yield* make$63(/* @__PURE__ */ new Map());
|
|
53924
54522
|
const getAdapterEntries = get$3(subscribedAdapters).pipe(map$4((map) => Array.from(map.entries())));
|
|
53925
54523
|
const reconcileInstanceSubscriptions = gen(function* () {
|
|
53926
54524
|
const previous = yield* get$3(subscribedAdapters);
|
|
@@ -54468,7 +55066,7 @@ const makeTextGenerationFromRegistry = (registry) => TextGeneration.of({
|
|
|
54468
55066
|
generateBranchName: (input) => resolveInstance(registry, "generateBranchName", input.modelSelection.instanceId).pipe(flatMap$1((textGeneration) => textGeneration.generateBranchName(input))),
|
|
54469
55067
|
generateThreadTitle: (input) => resolveInstance(registry, "generateThreadTitle", input.modelSelection.instanceId).pipe(flatMap$1((textGeneration) => textGeneration.generateThreadTitle(input)))
|
|
54470
55068
|
});
|
|
54471
|
-
const layer$
|
|
55069
|
+
const layer$2 = effect(TextGeneration, gen(function* () {
|
|
54472
55070
|
const registry = yield* ProviderInstanceRegistry;
|
|
54473
55071
|
return makeTextGenerationFromRegistry(registry);
|
|
54474
55072
|
}));
|
|
@@ -55737,7 +56335,7 @@ const probeClaudeCapabilities = (claudeSettings, environment, cwd) => {
|
|
|
55737
56335
|
const runClaudeCommand = fn("runClaudeCommand")(function* (claudeSettings, args, environment) {
|
|
55738
56336
|
const claudeEnvironment = yield* makeClaudeEnvironment(claudeSettings, environment);
|
|
55739
56337
|
const spawnCommand = yield* resolveSpawnCommand(claudeSettings.binaryPath, args, { env: claudeEnvironment });
|
|
55740
|
-
const command = make$
|
|
56338
|
+
const command = make$79(spawnCommand.command, spawnCommand.args, {
|
|
55741
56339
|
env: claudeEnvironment,
|
|
55742
56340
|
shell: spawnCommand.shell
|
|
55743
56341
|
});
|
|
@@ -55745,7 +56343,7 @@ const runClaudeCommand = fn("runClaudeCommand")(function* (claudeSettings, args,
|
|
|
55745
56343
|
});
|
|
55746
56344
|
const checkClaudeProviderStatus = fn("checkClaudeProviderStatus")(function* (claudeSettings, resolveCapabilities, environment, cwd) {
|
|
55747
56345
|
const resolvedEnvironment = environment ?? process.env;
|
|
55748
|
-
const checkedAt = formatIso(yield* now);
|
|
56346
|
+
const checkedAt = formatIso(yield* now$1);
|
|
55749
56347
|
const allModels = providerModelsFromSettings(BUILT_IN_MODELS, claudeSettings.customModels, DEFAULT_CLAUDE_MODEL_CAPABILITIES);
|
|
55750
56348
|
if (!claudeSettings.enabled) return buildServerProvider({
|
|
55751
56349
|
presentation: CLAUDE_PRESENTATION,
|
|
@@ -55857,7 +56455,7 @@ const checkClaudeProviderStatus = fn("checkClaudeProviderStatus")(function* (cla
|
|
|
55857
56455
|
}
|
|
55858
56456
|
});
|
|
55859
56457
|
});
|
|
55860
|
-
const nowIso$1 = map$4(now, formatIso);
|
|
56458
|
+
const nowIso$1 = map$4(now$1, formatIso);
|
|
55861
56459
|
const makePendingClaudeProvider = (claudeSettings) => gen(function* () {
|
|
55862
56460
|
const checkedAt = yield* nowIso$1;
|
|
55863
56461
|
const models = providerModelsFromSettings(BUILT_IN_MODELS, claudeSettings.customModels, DEFAULT_CLAUDE_MODEL_CAPABILITIES);
|
|
@@ -55954,11 +56552,11 @@ const makeClaudeTextGeneration = fn("makeClaudeTextGeneration")(function* (claud
|
|
|
55954
56552
|
...settingsJson ? ["--settings", settingsJson] : [],
|
|
55955
56553
|
"--dangerously-skip-permissions"
|
|
55956
56554
|
], { env: claudeEnvironment });
|
|
55957
|
-
const command = make$
|
|
56555
|
+
const command = make$79(spawnCommand.command, spawnCommand.args, {
|
|
55958
56556
|
env: claudeEnvironment,
|
|
55959
56557
|
cwd,
|
|
55960
56558
|
shell: spawnCommand.shell,
|
|
55961
|
-
stdin: { stream: encodeText(make$
|
|
56559
|
+
stdin: { stream: encodeText(make$74(prompt)) }
|
|
55962
56560
|
});
|
|
55963
56561
|
const child = yield* commandSpawner.spawn(command).pipe(mapError((cause) => normalizeCliError("claude", operation, cause, "Failed to spawn Claude CLI process")));
|
|
55964
56562
|
const [stdout, stderr, exitCode] = yield* all([
|
|
@@ -56922,7 +57520,7 @@ const makeClaudeAdapter = fn("makeClaudeAdapter")(function* (claudeSettings, opt
|
|
|
56922
57520
|
}));
|
|
56923
57521
|
const sessions = /* @__PURE__ */ new Map();
|
|
56924
57522
|
const runtimeEventQueue = yield* unbounded$2();
|
|
56925
|
-
const nowIso = map$4(now, formatIso);
|
|
57523
|
+
const nowIso = map$4(now$1, formatIso);
|
|
56926
57524
|
const randomUUIDv4 = crypto.randomUUIDv4.pipe(mapError((cause) => new ProviderAdapterRequestError({
|
|
56927
57525
|
provider: PROVIDER$2,
|
|
56928
57526
|
method: "crypto/randomUUIDv4",
|
|
@@ -58300,7 +58898,7 @@ const makeClaudeAdapter = fn("makeClaudeAdapter")(function* (claudeSettings, opt
|
|
|
58300
58898
|
const taskAgents = /* @__PURE__ */ new Map();
|
|
58301
58899
|
const workflowMemberFingerprints = /* @__PURE__ */ new Map();
|
|
58302
58900
|
const liveTaskIds = /* @__PURE__ */ new Set();
|
|
58303
|
-
const contextRef = yield* make$
|
|
58901
|
+
const contextRef = yield* make$63(void 0);
|
|
58304
58902
|
/**
|
|
58305
58903
|
* Handle AskUserQuestion tool calls by emitting a `user-input.requested`
|
|
58306
58904
|
* runtime event and waiting for the user to respond via `respondToUserInput`.
|
|
@@ -58317,7 +58915,7 @@ const makeClaudeAdapter = fn("makeClaudeAdapter")(function* (claudeSettings, opt
|
|
|
58317
58915
|
})) : [],
|
|
58318
58916
|
multiSelect: typeof q.multiSelect === "boolean" ? q.multiSelect : false
|
|
58319
58917
|
}));
|
|
58320
|
-
const answersDeferred = yield* make$
|
|
58918
|
+
const answersDeferred = yield* make$73();
|
|
58321
58919
|
let aborted = false;
|
|
58322
58920
|
const pendingInput = {
|
|
58323
58921
|
questions,
|
|
@@ -58413,7 +59011,7 @@ const makeClaudeAdapter = fn("makeClaudeAdapter")(function* (claudeSettings, opt
|
|
|
58413
59011
|
const requestId = ApprovalRequestId.make(yield* randomUUIDv4);
|
|
58414
59012
|
const requestType = classifyRequestType(toolName);
|
|
58415
59013
|
const detail = summarizeToolRequest(toolName, toolInput);
|
|
58416
|
-
const decisionDeferred = yield* make$
|
|
59014
|
+
const decisionDeferred = yield* make$73();
|
|
58417
59015
|
const pendingApproval = {
|
|
58418
59016
|
requestType,
|
|
58419
59017
|
detail,
|
|
@@ -58818,15 +59416,15 @@ const makeClaudeAdapter = fn("makeClaudeAdapter")(function* (claudeSettings, opt
|
|
|
58818
59416
|
const makeManagedServerProvider = fn("makeManagedServerProvider")(function* (input) {
|
|
58819
59417
|
const backgroundPolicy = yield* BackgroundPolicy;
|
|
58820
59418
|
const serverSettings = yield* ServerSettingsService;
|
|
58821
|
-
const refreshSemaphore = yield* make$
|
|
59419
|
+
const refreshSemaphore = yield* make$75(1);
|
|
58822
59420
|
const changesPubSub = yield* acquireRelease(unbounded$1(), shutdown$2);
|
|
58823
59421
|
const initialSettings = yield* input.getSettings;
|
|
58824
|
-
const snapshotStateRef = yield* make$
|
|
59422
|
+
const snapshotStateRef = yield* make$63({
|
|
58825
59423
|
snapshot: yield* input.initialSnapshot(initialSettings),
|
|
58826
59424
|
enrichmentGeneration: 0
|
|
58827
59425
|
});
|
|
58828
|
-
const settingsRef = yield* make$
|
|
58829
|
-
const enrichmentFiberRef = yield* make$
|
|
59426
|
+
const settingsRef = yield* make$63(initialSettings);
|
|
59427
|
+
const enrichmentFiberRef = yield* make$63(null);
|
|
58830
59428
|
const scope$1 = yield* scope;
|
|
58831
59429
|
const publishEnrichedSnapshot = fn("publishEnrichedSnapshot")(function* (generation, nextSnapshot) {
|
|
58832
59430
|
const snapshotToPublish = yield* modify$2(snapshotStateRef, (state) => {
|
|
@@ -59017,7 +59615,7 @@ const ClaudeDriver = {
|
|
|
59017
59615
|
...eventLoggers.native ? { nativeEventLogger: eventLoggers.native } : {}
|
|
59018
59616
|
});
|
|
59019
59617
|
const textGeneration = yield* makeClaudeTextGeneration(effectiveConfig, processEnv);
|
|
59020
|
-
const capabilitiesProbeCache = yield* make$
|
|
59618
|
+
const capabilitiesProbeCache = yield* make$81({
|
|
59021
59619
|
capacity: 1,
|
|
59022
59620
|
timeToLive: CAPABILITIES_PROBE_TTL,
|
|
59023
59621
|
lookup: () => probeClaudeCapabilities(effectiveConfig, processEnv, cwd).pipe(provideService(Path, path))
|
|
@@ -59153,14 +59751,14 @@ const makeCodexTextGeneration = fn("makeCodexTextGeneration")(function* (codexCo
|
|
|
59153
59751
|
...imagePaths.flatMap((imagePath) => ["--image", imagePath]),
|
|
59154
59752
|
"-"
|
|
59155
59753
|
], { env: resolvedEnvironment });
|
|
59156
|
-
const command = make$
|
|
59754
|
+
const command = make$79(spawnCommand.command, spawnCommand.args, {
|
|
59157
59755
|
env: {
|
|
59158
59756
|
...resolvedEnvironment,
|
|
59159
59757
|
...codexConfig.homePath ? { CODEX_HOME: expandHomePath(codexConfig.homePath) } : {}
|
|
59160
59758
|
},
|
|
59161
59759
|
cwd,
|
|
59162
59760
|
shell: spawnCommand.shell,
|
|
59163
|
-
stdin: { stream: encodeText(make$
|
|
59761
|
+
stdin: { stream: encodeText(make$74(prompt)) }
|
|
59164
59762
|
});
|
|
59165
59763
|
const child = yield* commandSpawner.spawn(command).pipe(mapError((cause) => normalizeCliError("codex", operation, cause, "Failed to spawn Codex CLI process")));
|
|
59166
59764
|
const [stdout, stderr, exitCode] = yield* all([
|
|
@@ -77113,10 +77711,10 @@ const makeCodexAppServerPatchedProtocol = fn("makeCodexAppServerPatchedProtocol"
|
|
|
77113
77711
|
const outgoing = yield* unbounded$2();
|
|
77114
77712
|
const incomingNotifications = yield* unbounded$2();
|
|
77115
77713
|
const incomingRequests = yield* unbounded$2();
|
|
77116
|
-
const pending = yield* make$
|
|
77117
|
-
const nextRequestId = yield* make$
|
|
77118
|
-
const remainder = yield* make$
|
|
77119
|
-
const terminationHandled = yield* make$
|
|
77714
|
+
const pending = yield* make$63(/* @__PURE__ */ new Map());
|
|
77715
|
+
const nextRequestId = yield* make$63(1);
|
|
77716
|
+
const remainder = yield* make$63("");
|
|
77717
|
+
const terminationHandled = yield* make$63(false);
|
|
77120
77718
|
const logProtocol = (event) => {
|
|
77121
77719
|
if (event.direction === "incoming" && !options.logIncoming) return void_$1;
|
|
77122
77720
|
if (event.direction === "outgoing" && !options.logOutgoing) return void_$1;
|
|
@@ -77215,7 +77813,7 @@ const makeCodexAppServerPatchedProtocol = fn("makeCodexAppServerPatchedProtocol"
|
|
|
77215
77813
|
yield* fromQueue(outgoing).pipe(run$5(options.stdio.stdout()), forkScoped);
|
|
77216
77814
|
const request = (method, payload) => gen(function* () {
|
|
77217
77815
|
const requestId = yield* modify$2(nextRequestId, (current) => [current, current + 1]);
|
|
77218
|
-
const deferred = yield* make$
|
|
77816
|
+
const deferred = yield* make$73();
|
|
77219
77817
|
yield* update$2(pending, (current) => new Map(current).set(String(requestId), {
|
|
77220
77818
|
deferred,
|
|
77221
77819
|
method
|
|
@@ -77243,7 +77841,7 @@ const makeCodexAppServerPatchedProtocol = fn("makeCodexAppServerPatchedProtocol"
|
|
|
77243
77841
|
//#endregion
|
|
77244
77842
|
//#region ../effect-codex-app-server/src/_internal/stdio.ts
|
|
77245
77843
|
const encoder$2 = new TextEncoder();
|
|
77246
|
-
const makeChildStdio$1 = (handle) => make$
|
|
77844
|
+
const makeChildStdio$1 = (handle) => make$80({
|
|
77247
77845
|
args: succeed$1([]),
|
|
77248
77846
|
stdin: handle.stdout,
|
|
77249
77847
|
stdout: () => mapInput(handle.stdin, (chunk) => typeof chunk === "string" ? encoder$2.encode(chunk) : chunk),
|
|
@@ -77254,7 +77852,7 @@ fn("makeInMemoryStdio")(function* () {
|
|
|
77254
77852
|
const output = yield* unbounded$2();
|
|
77255
77853
|
const decoder = new TextDecoder();
|
|
77256
77854
|
return {
|
|
77257
|
-
stdio: make$
|
|
77855
|
+
stdio: make$80({
|
|
77258
77856
|
args: succeed$1([]),
|
|
77259
77857
|
stdin: fromQueue(input),
|
|
77260
77858
|
stdout: () => forEach$1((chunk) => offer$1(output, typeof chunk === "string" ? chunk : decoder.decode(chunk, { stream: true }))),
|
|
@@ -77278,7 +77876,7 @@ const makeTerminationError$1 = (handle) => match$2(handle.exitCode, {
|
|
|
77278
77876
|
//#endregion
|
|
77279
77877
|
//#region ../effect-codex-app-server/src/client.ts
|
|
77280
77878
|
var CodexAppServerClient = class extends Service$2()("effect-codex-app-server/client/CodexAppServerClient") {};
|
|
77281
|
-
const make$
|
|
77879
|
+
const make$6 = fn("effect-codex-app-server/CodexAppServerClient.make")(function* (stdio, options = {}, terminationError) {
|
|
77282
77880
|
const requestHandlers = /* @__PURE__ */ new Map();
|
|
77283
77881
|
const notificationHandlers = /* @__PURE__ */ new Map();
|
|
77284
77882
|
let unknownRequestHandler;
|
|
@@ -77345,7 +77943,7 @@ const make$5 = fn("effect-codex-app-server/CodexAppServerClient.make")(function*
|
|
|
77345
77943
|
const layerChildProcess$1 = (handle, options = {}) => effect(CodexAppServerClient, makeChildProcessClient(handle, options));
|
|
77346
77944
|
const makeChildProcessClient = fn("effect-codex-app-server/CodexAppServerClient.makeChildProcessClient")(function* (handle, options) {
|
|
77347
77945
|
yield* runDrain(handle.stderr).pipe(ignore$1, forkScoped);
|
|
77348
|
-
return yield* make$
|
|
77946
|
+
return yield* make$6(makeChildStdio$1(handle), options, makeTerminationError$1(handle));
|
|
77349
77947
|
});
|
|
77350
77948
|
//#endregion
|
|
77351
77949
|
//#region src/provider/Layers/CodexProvider.ts
|
|
@@ -77541,7 +78139,7 @@ const probeCodexAppServerProvider = fn("probeCodexAppServerProvider")(function*
|
|
|
77541
78139
|
env: environment,
|
|
77542
78140
|
extendEnv: true
|
|
77543
78141
|
});
|
|
77544
|
-
const child = yield* spawner.spawn(make$
|
|
78142
|
+
const child = yield* spawner.spawn(make$79(spawnCommand.command, spawnCommand.args, {
|
|
77545
78143
|
cwd: input.cwd,
|
|
77546
78144
|
env: environment,
|
|
77547
78145
|
extendEnv: true,
|
|
@@ -77593,7 +78191,7 @@ const emptyCodexModelsFromSettings = (codexSettings) => {
|
|
|
77593
78191
|
}));
|
|
77594
78192
|
};
|
|
77595
78193
|
const makePendingCodexProvider = (codexSettings) => gen(function* () {
|
|
77596
|
-
const checkedAt = yield* map$4(now, formatIso);
|
|
78194
|
+
const checkedAt = yield* map$4(now$1, formatIso);
|
|
77597
78195
|
const models = emptyCodexModelsFromSettings(codexSettings);
|
|
77598
78196
|
if (!codexSettings.enabled) return buildServerProvider({
|
|
77599
78197
|
presentation: CODEX_PRESENTATION,
|
|
@@ -77649,7 +78247,7 @@ function accountProbeStatus(account) {
|
|
|
77649
78247
|
}
|
|
77650
78248
|
const checkCodexProviderStatus = fn("checkCodexProviderStatus")(function* (codexSettings, probe = probeCodexAppServerProvider, environment) {
|
|
77651
78249
|
const resolvedEnvironment = environment ?? process.env;
|
|
77652
|
-
const checkedAt = formatIso(yield* now);
|
|
78250
|
+
const checkedAt = formatIso(yield* now$1);
|
|
77653
78251
|
const emptyModels = emptyCodexModelsFromSettings(codexSettings);
|
|
77654
78252
|
if (!codexSettings.enabled) return buildServerProvider({
|
|
77655
78253
|
presentation: CODEX_PRESENTATION,
|
|
@@ -78219,7 +78817,7 @@ function currentProviderThreadId(session) {
|
|
|
78219
78817
|
}
|
|
78220
78818
|
function updateSession(sessionRef, updates) {
|
|
78221
78819
|
return gen(function* () {
|
|
78222
|
-
const updatedAt = formatIso(yield* now);
|
|
78820
|
+
const updatedAt = formatIso(yield* now$1);
|
|
78223
78821
|
yield* update$2(sessionRef, (session) => ({
|
|
78224
78822
|
...session,
|
|
78225
78823
|
...updates,
|
|
@@ -78241,14 +78839,14 @@ const makeCodexSessionRuntime = (options) => gen(function* () {
|
|
|
78241
78839
|
const runtimeScope = yield* Scope;
|
|
78242
78840
|
const crypto = yield* Crypto;
|
|
78243
78841
|
const events = yield* unbounded$2();
|
|
78244
|
-
const pendingApprovalsRef = yield* make$
|
|
78245
|
-
const approvalCorrelationsRef = yield* make$
|
|
78246
|
-
const pendingUserInputsRef = yield* make$
|
|
78247
|
-
const collabReceiverTurnsRef = yield* make$
|
|
78248
|
-
const collabChildAgentsRef = yield* make$
|
|
78842
|
+
const pendingApprovalsRef = yield* make$63(/* @__PURE__ */ new Map());
|
|
78843
|
+
const approvalCorrelationsRef = yield* make$63(/* @__PURE__ */ new Map());
|
|
78844
|
+
const pendingUserInputsRef = yield* make$63(/* @__PURE__ */ new Map());
|
|
78845
|
+
const collabReceiverTurnsRef = yield* make$63(/* @__PURE__ */ new Map());
|
|
78846
|
+
const collabChildAgentsRef = yield* make$63(/* @__PURE__ */ new Map());
|
|
78249
78847
|
/** Child provider-thread id → its currently running provider turn id. */
|
|
78250
|
-
const collabChildLiveTurnsRef = yield* make$
|
|
78251
|
-
const closedRef = yield* make$
|
|
78848
|
+
const collabChildLiveTurnsRef = yield* make$63(/* @__PURE__ */ new Map());
|
|
78849
|
+
const closedRef = yield* make$63(false);
|
|
78252
78850
|
const resolvedHomePath = options.homePath ? expandHomePath(options.homePath) : void 0;
|
|
78253
78851
|
const env = {
|
|
78254
78852
|
...options.environment,
|
|
@@ -78260,7 +78858,7 @@ const makeCodexSessionRuntime = (options) => gen(function* () {
|
|
|
78260
78858
|
env,
|
|
78261
78859
|
extendEnv
|
|
78262
78860
|
});
|
|
78263
|
-
const child = yield* spawner.spawn(make$
|
|
78861
|
+
const child = yield* spawner.spawn(make$79(spawnCommand.command, spawnCommand.args, {
|
|
78264
78862
|
cwd: options.cwd,
|
|
78265
78863
|
env,
|
|
78266
78864
|
extendEnv,
|
|
@@ -78273,13 +78871,13 @@ const makeCodexSessionRuntime = (options) => gen(function* () {
|
|
|
78273
78871
|
const clientContext = yield* layerChildProcess$1(child).pipe(build, provideService(Scope, runtimeScope));
|
|
78274
78872
|
const client = yield* service(CodexAppServerClient).pipe(provide$1(clientContext));
|
|
78275
78873
|
const serverNotifications = yield* unbounded$2();
|
|
78276
|
-
const nowIso = map$4(now, formatIso);
|
|
78874
|
+
const nowIso = map$4(now$1, formatIso);
|
|
78277
78875
|
const randomUUIDv4 = (purpose) => crypto.randomUUIDv4.pipe(mapError((cause) => new CodexAppServerIdentifierGenerationError({
|
|
78278
78876
|
purpose,
|
|
78279
78877
|
cause
|
|
78280
78878
|
})));
|
|
78281
78879
|
const sessionCreatedAt = yield* nowIso;
|
|
78282
|
-
const sessionRef = yield* make$
|
|
78880
|
+
const sessionRef = yield* make$63({
|
|
78283
78881
|
provider: PROVIDER$1,
|
|
78284
78882
|
...options.providerInstanceId ? { providerInstanceId: options.providerInstanceId } : {},
|
|
78285
78883
|
status: "connecting",
|
|
@@ -78607,7 +79205,7 @@ const makeCodexSessionRuntime = (options) => gen(function* () {
|
|
|
78607
79205
|
const requestId = ApprovalRequestId.make(yield* randomUUIDv4("command-approval-request"));
|
|
78608
79206
|
const turnId = TurnId.make(payload.turnId);
|
|
78609
79207
|
const itemId = ProviderItemId.make(payload.itemId);
|
|
78610
|
-
const decision = yield* make$
|
|
79208
|
+
const decision = yield* make$73();
|
|
78611
79209
|
yield* update$2(pendingApprovalsRef, (current) => {
|
|
78612
79210
|
const next = new Map(current);
|
|
78613
79211
|
next.set(requestId, {
|
|
@@ -78650,7 +79248,7 @@ const makeCodexSessionRuntime = (options) => gen(function* () {
|
|
|
78650
79248
|
const requestId = ApprovalRequestId.make(yield* randomUUIDv4("file-change-approval-request"));
|
|
78651
79249
|
const turnId = TurnId.make(payload.turnId);
|
|
78652
79250
|
const itemId = ProviderItemId.make(payload.itemId);
|
|
78653
|
-
const decision = yield* make$
|
|
79251
|
+
const decision = yield* make$73();
|
|
78654
79252
|
yield* update$2(pendingApprovalsRef, (current) => {
|
|
78655
79253
|
const next = new Map(current);
|
|
78656
79254
|
next.set(requestId, {
|
|
@@ -78693,7 +79291,7 @@ const makeCodexSessionRuntime = (options) => gen(function* () {
|
|
|
78693
79291
|
const requestId = ApprovalRequestId.make(yield* randomUUIDv4("user-input-request"));
|
|
78694
79292
|
const turnId = TurnId.make(payload.turnId);
|
|
78695
79293
|
const itemId = ProviderItemId.make(payload.itemId);
|
|
78696
|
-
const answers = yield* make$
|
|
79294
|
+
const answers = yield* make$73();
|
|
78697
79295
|
yield* update$2(pendingUserInputsRef, (current) => {
|
|
78698
79296
|
const next = new Map(current);
|
|
78699
79297
|
next.set(requestId, {
|
|
@@ -78726,7 +79324,7 @@ const makeCodexSessionRuntime = (options) => gen(function* () {
|
|
|
78726
79324
|
discard: true
|
|
78727
79325
|
});
|
|
78728
79326
|
yield* fromQueue(serverNotifications).pipe(runForEach(handleRawNotification), forkIn(runtimeScope));
|
|
78729
|
-
const stderrRemainderRef = yield* make$
|
|
79327
|
+
const stderrRemainderRef = yield* make$63("");
|
|
78730
79328
|
yield* child.stderr.pipe(decodeText(), runForEach((chunk) => modify$2(stderrRemainderRef, (current) => {
|
|
78731
79329
|
const lines = (current + chunk).split("\n");
|
|
78732
79330
|
const remainder = lines.pop() ?? "";
|
|
@@ -79912,7 +80510,7 @@ const makeCodexAdapter = fn("makeCodexAdapter")(function* (codexConfig, options)
|
|
|
79912
80510
|
...input.modelSelection?.instanceId === boundInstanceId ? { model: input.modelSelection.model } : {},
|
|
79913
80511
|
...serviceTier ? { serviceTier } : {}
|
|
79914
80512
|
};
|
|
79915
|
-
const sessionScope = yield* make$
|
|
80513
|
+
const sessionScope = yield* make$76("sequential");
|
|
79916
80514
|
let sessionScopeTransferred = false;
|
|
79917
80515
|
yield* addFinalizer(() => sessionScopeTransferred ? void_$1 : close(sessionScope, void_$2));
|
|
79918
80516
|
const runtime = yield* (options?.makeRuntime ?? makeCodexSessionRuntime)(runtimeInput).pipe(provideService(Scope, sessionScope), provideService(ChildProcessSpawner, childProcessSpawner), provideService(Crypto, crypto), mapError((cause) => new ProviderAdapterProcessError({
|
|
@@ -83682,9 +84280,9 @@ const makeAcpPatchedProtocol = fn("makeAcpPatchedProtocol")(function* (options)
|
|
|
83682
84280
|
const notificationQueue = yield* unbounded$2();
|
|
83683
84281
|
const disconnects = yield* unbounded$2();
|
|
83684
84282
|
const outgoing = yield* unbounded$2();
|
|
83685
|
-
const nextRequestId = yield* make$
|
|
83686
|
-
const terminationHandled = yield* make$
|
|
83687
|
-
const extPending = yield* make$
|
|
84283
|
+
const nextRequestId = yield* make$63(1);
|
|
84284
|
+
const terminationHandled = yield* make$63(false);
|
|
84285
|
+
const extPending = yield* make$63(/* @__PURE__ */ new Map());
|
|
83688
84286
|
const logProtocol = (event) => {
|
|
83689
84287
|
if (event.direction === "incoming" && !options.logIncoming) return void_$1;
|
|
83690
84288
|
if (event.direction === "outgoing" && !options.logOutgoing) return void_$1;
|
|
@@ -83902,7 +84500,7 @@ const makeAcpPatchedProtocol = fn("makeAcpPatchedProtocol")(function* (options)
|
|
|
83902
84500
|
},
|
|
83903
84501
|
request: fn("sendRequest")(function* (method, payload) {
|
|
83904
84502
|
const requestId = yield* modify$2(nextRequestId, (current) => [current, current + 1]);
|
|
83905
|
-
const deferred = yield* make$
|
|
84503
|
+
const deferred = yield* make$73();
|
|
83906
84504
|
yield* update$2(extPending, (pending) => new Map(pending).set(String(requestId), {
|
|
83907
84505
|
deferred,
|
|
83908
84506
|
method
|
|
@@ -83924,113 +84522,113 @@ function isProtocolError(value) {
|
|
|
83924
84522
|
}
|
|
83925
84523
|
//#endregion
|
|
83926
84524
|
//#region ../effect-acp/src/rpc.ts
|
|
83927
|
-
const InitializeRpc = make$
|
|
84525
|
+
const InitializeRpc = make$51(AGENT_METHODS.initialize, {
|
|
83928
84526
|
payload: InitializeRequest,
|
|
83929
84527
|
success: InitializeResponse,
|
|
83930
84528
|
error: Error$1
|
|
83931
84529
|
});
|
|
83932
|
-
const AuthenticateRpc = make$
|
|
84530
|
+
const AuthenticateRpc = make$51(AGENT_METHODS.authenticate, {
|
|
83933
84531
|
payload: AuthenticateRequest,
|
|
83934
84532
|
success: AuthenticateResponse,
|
|
83935
84533
|
error: Error$1
|
|
83936
84534
|
});
|
|
83937
|
-
const LogoutRpc = make$
|
|
84535
|
+
const LogoutRpc = make$51(AGENT_METHODS.logout, {
|
|
83938
84536
|
payload: LogoutRequest,
|
|
83939
84537
|
success: LogoutResponse,
|
|
83940
84538
|
error: Error$1
|
|
83941
84539
|
});
|
|
83942
|
-
const NewSessionRpc = make$
|
|
84540
|
+
const NewSessionRpc = make$51(AGENT_METHODS.session_new, {
|
|
83943
84541
|
payload: NewSessionRequest,
|
|
83944
84542
|
success: NewSessionResponse,
|
|
83945
84543
|
error: Error$1
|
|
83946
84544
|
});
|
|
83947
|
-
const LoadSessionRpc = make$
|
|
84545
|
+
const LoadSessionRpc = make$51(AGENT_METHODS.session_load, {
|
|
83948
84546
|
payload: LoadSessionRequest,
|
|
83949
84547
|
success: LoadSessionResponse,
|
|
83950
84548
|
error: Error$1
|
|
83951
84549
|
});
|
|
83952
|
-
const ListSessionsRpc = make$
|
|
84550
|
+
const ListSessionsRpc = make$51(AGENT_METHODS.session_list, {
|
|
83953
84551
|
payload: ListSessionsRequest,
|
|
83954
84552
|
success: ListSessionsResponse,
|
|
83955
84553
|
error: Error$1
|
|
83956
84554
|
});
|
|
83957
|
-
const ForkSessionRpc = make$
|
|
84555
|
+
const ForkSessionRpc = make$51(AGENT_METHODS.session_fork, {
|
|
83958
84556
|
payload: ForkSessionRequest,
|
|
83959
84557
|
success: ForkSessionResponse,
|
|
83960
84558
|
error: Error$1
|
|
83961
84559
|
});
|
|
83962
|
-
const ResumeSessionRpc = make$
|
|
84560
|
+
const ResumeSessionRpc = make$51(AGENT_METHODS.session_resume, {
|
|
83963
84561
|
payload: ResumeSessionRequest,
|
|
83964
84562
|
success: ResumeSessionResponse,
|
|
83965
84563
|
error: Error$1
|
|
83966
84564
|
});
|
|
83967
|
-
const CloseSessionRpc = make$
|
|
84565
|
+
const CloseSessionRpc = make$51(AGENT_METHODS.session_close, {
|
|
83968
84566
|
payload: CloseSessionRequest,
|
|
83969
84567
|
success: CloseSessionResponse,
|
|
83970
84568
|
error: Error$1
|
|
83971
84569
|
});
|
|
83972
|
-
const PromptRpc = make$
|
|
84570
|
+
const PromptRpc = make$51(AGENT_METHODS.session_prompt, {
|
|
83973
84571
|
payload: PromptRequest,
|
|
83974
84572
|
success: PromptResponse,
|
|
83975
84573
|
error: Error$1
|
|
83976
84574
|
});
|
|
83977
|
-
const SetSessionModelRpc = make$
|
|
84575
|
+
const SetSessionModelRpc = make$51(AGENT_METHODS.session_set_model, {
|
|
83978
84576
|
payload: SetSessionModelRequest,
|
|
83979
84577
|
success: SetSessionModelResponse,
|
|
83980
84578
|
error: Error$1
|
|
83981
84579
|
});
|
|
83982
|
-
const SetSessionConfigOptionRpc = make$
|
|
84580
|
+
const SetSessionConfigOptionRpc = make$51(AGENT_METHODS.session_set_config_option, {
|
|
83983
84581
|
payload: SetSessionConfigOptionRequest,
|
|
83984
84582
|
success: SetSessionConfigOptionResponse,
|
|
83985
84583
|
error: Error$1
|
|
83986
84584
|
});
|
|
83987
|
-
const ReadTextFileRpc = make$
|
|
84585
|
+
const ReadTextFileRpc = make$51(CLIENT_METHODS.fs_read_text_file, {
|
|
83988
84586
|
payload: ReadTextFileRequest,
|
|
83989
84587
|
success: ReadTextFileResponse,
|
|
83990
84588
|
error: Error$1
|
|
83991
84589
|
});
|
|
83992
|
-
const WriteTextFileRpc = make$
|
|
84590
|
+
const WriteTextFileRpc = make$51(CLIENT_METHODS.fs_write_text_file, {
|
|
83993
84591
|
payload: WriteTextFileRequest,
|
|
83994
84592
|
success: WriteTextFileResponse,
|
|
83995
84593
|
error: Error$1
|
|
83996
84594
|
});
|
|
83997
|
-
const RequestPermissionRpc = make$
|
|
84595
|
+
const RequestPermissionRpc = make$51(CLIENT_METHODS.session_request_permission, {
|
|
83998
84596
|
payload: RequestPermissionRequest,
|
|
83999
84597
|
success: RequestPermissionResponse,
|
|
84000
84598
|
error: Error$1
|
|
84001
84599
|
});
|
|
84002
|
-
const ElicitationRpc = make$
|
|
84600
|
+
const ElicitationRpc = make$51(CLIENT_METHODS.session_elicitation, {
|
|
84003
84601
|
payload: ElicitationRequest,
|
|
84004
84602
|
success: ElicitationResponse,
|
|
84005
84603
|
error: Error$1
|
|
84006
84604
|
});
|
|
84007
|
-
const CreateTerminalRpc = make$
|
|
84605
|
+
const CreateTerminalRpc = make$51(CLIENT_METHODS.terminal_create, {
|
|
84008
84606
|
payload: CreateTerminalRequest,
|
|
84009
84607
|
success: CreateTerminalResponse,
|
|
84010
84608
|
error: Error$1
|
|
84011
84609
|
});
|
|
84012
|
-
const TerminalOutputRpc = make$
|
|
84610
|
+
const TerminalOutputRpc = make$51(CLIENT_METHODS.terminal_output, {
|
|
84013
84611
|
payload: TerminalOutputRequest,
|
|
84014
84612
|
success: TerminalOutputResponse,
|
|
84015
84613
|
error: Error$1
|
|
84016
84614
|
});
|
|
84017
|
-
const ReleaseTerminalRpc = make$
|
|
84615
|
+
const ReleaseTerminalRpc = make$51(CLIENT_METHODS.terminal_release, {
|
|
84018
84616
|
payload: ReleaseTerminalRequest,
|
|
84019
84617
|
success: ReleaseTerminalResponse,
|
|
84020
84618
|
error: Error$1
|
|
84021
84619
|
});
|
|
84022
|
-
const WaitForTerminalExitRpc = make$
|
|
84620
|
+
const WaitForTerminalExitRpc = make$51(CLIENT_METHODS.terminal_wait_for_exit, {
|
|
84023
84621
|
payload: WaitForTerminalExitRequest,
|
|
84024
84622
|
success: WaitForTerminalExitResponse,
|
|
84025
84623
|
error: Error$1
|
|
84026
84624
|
});
|
|
84027
|
-
const KillTerminalRpc = make$
|
|
84625
|
+
const KillTerminalRpc = make$51(CLIENT_METHODS.terminal_kill, {
|
|
84028
84626
|
payload: KillTerminalRequest,
|
|
84029
84627
|
success: KillTerminalResponse,
|
|
84030
84628
|
error: Error$1
|
|
84031
84629
|
});
|
|
84032
|
-
const AgentRpcs = make$
|
|
84033
|
-
const ClientRpcs = make$
|
|
84630
|
+
const AgentRpcs = make$50(InitializeRpc, AuthenticateRpc, LogoutRpc, NewSessionRpc, LoadSessionRpc, ListSessionsRpc, ForkSessionRpc, ResumeSessionRpc, CloseSessionRpc, PromptRpc, SetSessionModelRpc, SetSessionConfigOptionRpc);
|
|
84631
|
+
const ClientRpcs = make$50(ReadTextFileRpc, WriteTextFileRpc, RequestPermissionRpc, ElicitationRpc, CreateTerminalRpc, TerminalOutputRpc, ReleaseTerminalRpc, WaitForTerminalExitRpc, KillTerminalRpc);
|
|
84034
84632
|
//#endregion
|
|
84035
84633
|
//#region ../effect-acp/src/_internal/shared.ts
|
|
84036
84634
|
const isError = is(Error$1);
|
|
@@ -84055,7 +84653,7 @@ ArraySchema(Unknown);
|
|
|
84055
84653
|
//#endregion
|
|
84056
84654
|
//#region ../effect-acp/src/_internal/stdio.ts
|
|
84057
84655
|
const encoder = new TextEncoder();
|
|
84058
|
-
const makeChildStdio = (handle) => make$
|
|
84656
|
+
const makeChildStdio = (handle) => make$80({
|
|
84059
84657
|
args: succeed$1([]),
|
|
84060
84658
|
stdin: handle.stdout,
|
|
84061
84659
|
stdout: () => mapInput(handle.stdin, (chunk) => typeof chunk === "string" ? encoder.encode(chunk) : chunk),
|
|
@@ -84066,7 +84664,7 @@ fn("makeInMemoryStdio")(function* () {
|
|
|
84066
84664
|
const output = yield* unbounded$2();
|
|
84067
84665
|
const decoder = new TextDecoder();
|
|
84068
84666
|
return {
|
|
84069
|
-
stdio: make$
|
|
84667
|
+
stdio: make$80({
|
|
84070
84668
|
args: succeed$1([]),
|
|
84071
84669
|
stdin: fromQueue(input),
|
|
84072
84670
|
stdout: () => forEach$1((chunk) => offer$1(output, typeof chunk === "string" ? chunk : decoder.decode(chunk, { stream: true }))),
|
|
@@ -84090,7 +84688,7 @@ const makeTerminationError = (handle) => match$2(handle.exitCode, {
|
|
|
84090
84688
|
//#endregion
|
|
84091
84689
|
//#region ../effect-acp/src/client.ts
|
|
84092
84690
|
var AcpClient = class extends Service$2()("effect-acp/client/AcpClient") {};
|
|
84093
|
-
const make$
|
|
84691
|
+
const make$5 = fn("effect-acp/AcpClient.make")(function* (stdio, options = {}, terminationError) {
|
|
84094
84692
|
const coreHandlers = {};
|
|
84095
84693
|
const notificationHandlers = {
|
|
84096
84694
|
sessionUpdate: {
|
|
@@ -84158,9 +84756,9 @@ const make$4 = fn("effect-acp/AcpClient.make")(function* (stdio, options = {}, t
|
|
|
84158
84756
|
[CLIENT_METHODS.terminal_kill]: (payload) => runHandler(coreHandlers.terminalKill, payload, CLIENT_METHODS.terminal_kill).pipe(map$4((result) => result ?? {})),
|
|
84159
84757
|
[CLIENT_METHODS.terminal_release]: (payload) => runHandler(coreHandlers.terminalRelease, payload, CLIENT_METHODS.terminal_release).pipe(map$4((result) => result ?? {}))
|
|
84160
84758
|
}));
|
|
84161
|
-
yield* make$
|
|
84759
|
+
yield* make$16(ClientRpcs).pipe(provideService(Protocol, transport.serverProtocol), provide$1(clientHandlerLayer), forkScoped);
|
|
84162
84760
|
let nextRpcRequestId = 2 ** 32;
|
|
84163
|
-
const rpc = yield* make$
|
|
84761
|
+
const rpc = yield* make$17(AgentRpcs, { generateRequestId: () => RequestId$2(nextRpcRequestId++) }).pipe(provideService(Protocol$1, transport.clientProtocol));
|
|
84164
84762
|
return AcpClient.of({
|
|
84165
84763
|
raw: {
|
|
84166
84764
|
notifications: transport.incoming,
|
|
@@ -84247,7 +84845,7 @@ const make$4 = fn("effect-acp/AcpClient.make")(function* (stdio, options = {}, t
|
|
|
84247
84845
|
const layerChildProcess = (handle, options = {}) => {
|
|
84248
84846
|
const stdio = makeChildStdio(handle);
|
|
84249
84847
|
const terminationError = makeTerminationError(handle);
|
|
84250
|
-
return effect(AcpClient, make$
|
|
84848
|
+
return effect(AcpClient, make$5(stdio, options, terminationError));
|
|
84251
84849
|
};
|
|
84252
84850
|
//#endregion
|
|
84253
84851
|
//#region src/provider/acp/AcpLocalToolHost.ts
|
|
@@ -84315,7 +84913,7 @@ const registerLocalToolHandlers = (input) => gen(function* () {
|
|
|
84315
84913
|
env,
|
|
84316
84914
|
extendEnv: true
|
|
84317
84915
|
} : {});
|
|
84318
|
-
const handle = yield* spawner.spawn(make$
|
|
84916
|
+
const handle = yield* spawner.spawn(make$79(spawnCommand.command, spawnCommand.args, {
|
|
84319
84917
|
cwd: request.cwd ?? input.cwd,
|
|
84320
84918
|
...hasEnv ? {
|
|
84321
84919
|
env,
|
|
@@ -84323,7 +84921,7 @@ const registerLocalToolHandlers = (input) => gen(function* () {
|
|
|
84323
84921
|
} : {},
|
|
84324
84922
|
shell: spawnCommand.shell
|
|
84325
84923
|
})).pipe(provideService(Scope, scope), mapError(() => internalError(`Failed to spawn ACP terminal command: ${request.command}`)));
|
|
84326
|
-
const exited = yield* make$
|
|
84924
|
+
const exited = yield* make$73();
|
|
84327
84925
|
const state = {
|
|
84328
84926
|
handle,
|
|
84329
84927
|
exited,
|
|
@@ -84850,23 +85448,23 @@ function formatConfigOptionValue(value) {
|
|
|
84850
85448
|
const defaultSessionLoadTimeout = seconds(90);
|
|
84851
85449
|
const defaultSessionLoadReplayIdleGap = seconds(2);
|
|
84852
85450
|
var AcpSessionRuntime = class extends Service$2()("t3/provider/acp/AcpSessionRuntime") {};
|
|
84853
|
-
const make$
|
|
85451
|
+
const make$4 = (options) => gen(function* () {
|
|
84854
85452
|
const crypto = yield* Crypto;
|
|
84855
85453
|
const spawner = yield* ChildProcessSpawner;
|
|
84856
85454
|
const runtimeScope = yield* Scope;
|
|
84857
85455
|
const eventQueue = yield* unbounded$2();
|
|
84858
|
-
const modeStateRef = yield* make$
|
|
84859
|
-
const toolCallsRef = yield* make$
|
|
85456
|
+
const modeStateRef = yield* make$63(void 0);
|
|
85457
|
+
const toolCallsRef = yield* make$63(/* @__PURE__ */ new Map());
|
|
84860
85458
|
const assistantItemRuntimeId = yield* crypto.randomUUIDv4.pipe(mapError((cause) => new AcpTransportError({
|
|
84861
85459
|
detail: "Failed to generate an ACP assistant item runtime identifier.",
|
|
84862
85460
|
cause
|
|
84863
85461
|
})));
|
|
84864
|
-
const assistantSegmentRef = yield* make$
|
|
84865
|
-
const configOptionsRef = yield* make$
|
|
84866
|
-
const startStateRef = yield* make$
|
|
84867
|
-
const promptSerializationSemaphore = yield* make$
|
|
84868
|
-
const activePromptFiberRef = yield* make$
|
|
84869
|
-
const sessionLoadGateRef = yield* make$
|
|
85462
|
+
const assistantSegmentRef = yield* make$63({ nextSegmentIndex: 0 });
|
|
85463
|
+
const configOptionsRef = yield* make$63(sessionConfigOptionsFromSetup(void 0));
|
|
85464
|
+
const startStateRef = yield* make$63({ _tag: "NotStarted" });
|
|
85465
|
+
const promptSerializationSemaphore = yield* make$75(1);
|
|
85466
|
+
const activePromptFiberRef = yield* make$63(none());
|
|
85467
|
+
const sessionLoadGateRef = yield* make$63(none());
|
|
84870
85468
|
const logRequest = (event) => options.requestLogger ? options.requestLogger(event) : void_$1;
|
|
84871
85469
|
const runLoggedRequest = (method, payload, effect) => logRequest({
|
|
84872
85470
|
method,
|
|
@@ -84887,7 +85485,7 @@ const make$3 = (options) => gen(function* () {
|
|
|
84887
85485
|
env: options.spawn.env,
|
|
84888
85486
|
extendEnv: true
|
|
84889
85487
|
} : {});
|
|
84890
|
-
const child = yield* spawner.spawn(make$
|
|
85488
|
+
const child = yield* spawner.spawn(make$79(spawnCommand.command, spawnCommand.args, {
|
|
84891
85489
|
...options.spawn.cwd ? { cwd: options.spawn.cwd } : {},
|
|
84892
85490
|
...options.spawn.env ? {
|
|
84893
85491
|
env: options.spawn.env,
|
|
@@ -85080,7 +85678,7 @@ const make$3 = (options) => gen(function* () {
|
|
|
85080
85678
|
};
|
|
85081
85679
|
});
|
|
85082
85680
|
const start = gen(function* () {
|
|
85083
|
-
const deferred = yield* make$
|
|
85681
|
+
const deferred = yield* make$73();
|
|
85084
85682
|
return yield* yield* modify$2(startStateRef, (state) => {
|
|
85085
85683
|
switch (state._tag) {
|
|
85086
85684
|
case "Started": return [succeed$1(state.result), state];
|
|
@@ -85114,7 +85712,7 @@ const make$3 = (options) => gen(function* () {
|
|
|
85114
85712
|
start: () => start,
|
|
85115
85713
|
getEvents: () => fromQueue(eventQueue),
|
|
85116
85714
|
drainEvents: gen(function* () {
|
|
85117
|
-
const acknowledge = yield* make$
|
|
85715
|
+
const acknowledge = yield* make$73();
|
|
85118
85716
|
yield* offer$1(eventQueue, {
|
|
85119
85717
|
_tag: "EventStreamBarrier",
|
|
85120
85718
|
acknowledge
|
|
@@ -85166,7 +85764,7 @@ const make$3 = (options) => gen(function* () {
|
|
|
85166
85764
|
notify: acp.raw.notify
|
|
85167
85765
|
};
|
|
85168
85766
|
});
|
|
85169
|
-
const layer = (options) => effect(AcpSessionRuntime, make$
|
|
85767
|
+
const layer$1 = (options) => effect(AcpSessionRuntime, make$4(options));
|
|
85170
85768
|
function sessionConfigOptionsFromSetup(response) {
|
|
85171
85769
|
return response?.configOptions ?? [];
|
|
85172
85770
|
}
|
|
@@ -85273,7 +85871,7 @@ function buildAcpAgentSpawnInput(descriptor, settings, cwd, environment) {
|
|
|
85273
85871
|
* never sent.
|
|
85274
85872
|
*/
|
|
85275
85873
|
const makeAcpAgentRuntime = (descriptor, input) => gen(function* () {
|
|
85276
|
-
const acpContext = yield* build(layer({
|
|
85874
|
+
const acpContext = yield* build(layer$1({
|
|
85277
85875
|
...input,
|
|
85278
85876
|
spawn: buildAcpAgentSpawnInput(descriptor, input.settings, input.cwd, input.environment),
|
|
85279
85877
|
authMethodId: "none",
|
|
@@ -85353,7 +85951,7 @@ const makeAcpAgentTextGeneration = (descriptor, settings, environment = process.
|
|
|
85353
85951
|
const path = yield* Path;
|
|
85354
85952
|
const runAcpAgentJson = ({ operation, cwd, prompt, outputSchemaJson, modelSelection }) => gen(function* () {
|
|
85355
85953
|
const resolvedModel = resolveAcpAgentModelId(descriptor, modelSelection.model);
|
|
85356
|
-
const outputRef = yield* make$
|
|
85954
|
+
const outputRef = yield* make$63("");
|
|
85357
85955
|
const runtime = yield* makeAcpAgentRuntime(descriptor, {
|
|
85358
85956
|
settings,
|
|
85359
85957
|
environment,
|
|
@@ -85702,7 +86300,7 @@ const makeAcpNativeLoggerFactory = fn("makeAcpNativeLoggerFactory")(function* ()
|
|
|
85702
86300
|
return (input) => {
|
|
85703
86301
|
const writeNativeAcpLog = (logInput) => gen(function* () {
|
|
85704
86302
|
if (!input.nativeEventLogger) return;
|
|
85705
|
-
const observedAt = formatIso(yield* now);
|
|
86303
|
+
const observedAt = formatIso(yield* now$1);
|
|
85706
86304
|
yield* input.nativeEventLogger.write({
|
|
85707
86305
|
observedAt,
|
|
85708
86306
|
event: {
|
|
@@ -85808,9 +86406,9 @@ function makeAcpAgentAdapter(descriptor, settings, options) {
|
|
|
85808
86406
|
const managedNativeEventLogger = options?.nativeEventLogger === void 0 ? nativeEventLogger : void 0;
|
|
85809
86407
|
const makeAcpNativeLoggers = yield* makeAcpNativeLoggerFactory();
|
|
85810
86408
|
const sessions = /* @__PURE__ */ new Map();
|
|
85811
|
-
const threadLocksRef = yield* make$
|
|
86409
|
+
const threadLocksRef = yield* make$53(/* @__PURE__ */ new Map());
|
|
85812
86410
|
const runtimeEventPubSub = yield* unbounded$1();
|
|
85813
|
-
const nowIso = map$4(now, formatIso);
|
|
86411
|
+
const nowIso = map$4(now$1, formatIso);
|
|
85814
86412
|
const randomUUIDv4 = crypto.randomUUIDv4.pipe(mapError((cause) => new ProviderAdapterRequestError({
|
|
85815
86413
|
provider: PROVIDER,
|
|
85816
86414
|
method: "crypto/randomUUIDv4",
|
|
@@ -85829,7 +86427,7 @@ function makeAcpAgentAdapter(descriptor, settings, options) {
|
|
|
85829
86427
|
const offerRuntimeEvent = (event) => publish(runtimeEventPubSub, event).pipe(asVoid);
|
|
85830
86428
|
const getThreadSemaphore = (threadId) => modifyEffect(threadLocksRef, (current) => {
|
|
85831
86429
|
return match$1(fromNullishOr(current.get(threadId)), {
|
|
85832
|
-
onNone: () => make$
|
|
86430
|
+
onNone: () => make$75(1).pipe(map$4((semaphore) => {
|
|
85833
86431
|
const next = new Map(current);
|
|
85834
86432
|
next.set(threadId, semaphore);
|
|
85835
86433
|
return [semaphore, next];
|
|
@@ -86012,7 +86610,7 @@ function makeAcpAgentAdapter(descriptor, settings, options) {
|
|
|
86012
86610
|
const existing = sessions.get(input.threadId);
|
|
86013
86611
|
if (existing && !existing.stopped) yield* stopSessionInternal(existing);
|
|
86014
86612
|
const pendingApprovals = /* @__PURE__ */ new Map();
|
|
86015
|
-
const sessionScope = yield* make$
|
|
86613
|
+
const sessionScope = yield* make$76("sequential");
|
|
86016
86614
|
let sessionScopeTransferred = false;
|
|
86017
86615
|
yield* addFinalizer(() => sessionScopeTransferred ? void_$1 : close(sessionScope, void_$2));
|
|
86018
86616
|
const resumeSessionId = resolveResumeSessionId(descriptor, input.resumeCursor);
|
|
@@ -86051,7 +86649,7 @@ function makeAcpAgentAdapter(descriptor, settings, options) {
|
|
|
86051
86649
|
const permissionRequest = parsePermissionRequest(params);
|
|
86052
86650
|
const requestId = ApprovalRequestId.make(yield* randomUUIDv4);
|
|
86053
86651
|
const runtimeRequestId = RuntimeRequestId.make(requestId);
|
|
86054
|
-
const decision = yield* make$
|
|
86652
|
+
const decision = yield* make$73();
|
|
86055
86653
|
const turnId = resolveSessionCallbackTurnId(sessions, input.threadId);
|
|
86056
86654
|
pendingApprovals.set(requestId, { decision });
|
|
86057
86655
|
yield* offerRuntimeEvent(makeAcpRequestOpenedEvent({
|
|
@@ -86308,10 +86906,10 @@ function makeAcpAgentAdapter(descriptor, settings, options) {
|
|
|
86308
86906
|
});
|
|
86309
86907
|
})));
|
|
86310
86908
|
}));
|
|
86311
|
-
const promptSettled = yield* make$
|
|
86312
|
-
const promptRpcSucceeded = yield* make$
|
|
86313
|
-
const promptResultRef = yield* make$
|
|
86314
|
-
const promptFailureMessageRef = yield* make$
|
|
86909
|
+
const promptSettled = yield* make$63(false);
|
|
86910
|
+
const promptRpcSucceeded = yield* make$63(false);
|
|
86911
|
+
const promptResultRef = yield* make$63(void 0);
|
|
86912
|
+
const promptFailureMessageRef = yield* make$63(void 0);
|
|
86315
86913
|
return yield* gen(function* () {
|
|
86316
86914
|
const result = yield* prepared.acp.prompt({ prompt: prepared.promptParts }).pipe(tap((promptResult) => all([set$2(promptRpcSucceeded, true), set$2(promptResultRef, promptResult)])), tapError((error) => set$2(promptFailureMessageRef, mapAcpToAdapterError(PROVIDER, input.threadId, "session/prompt", error).message).pipe(andThen(prepared.acp.drainEvents))), mapError((error) => mapAcpToAdapterError(PROVIDER, input.threadId, "session/prompt", error)));
|
|
86317
86915
|
return yield* withThreadLock(input.threadId, gen(function* () {
|
|
@@ -86538,7 +87136,7 @@ const VERSION_PROBE_TIMEOUT_MS = 4e3;
|
|
|
86538
87136
|
const ACP_MODEL_DISCOVERY_TIMEOUT_MS = 15e3;
|
|
86539
87137
|
function buildInitialAcpAgentProviderSnapshot(descriptor, settings) {
|
|
86540
87138
|
return gen(function* () {
|
|
86541
|
-
const checkedAt = yield* map$4(now, formatIso);
|
|
87139
|
+
const checkedAt = yield* map$4(now$1, formatIso);
|
|
86542
87140
|
const models = acpAgentModelsFromSettings(descriptor, settings.customModels);
|
|
86543
87141
|
if (!settings.enabled) return buildServerProvider({
|
|
86544
87142
|
presentation: descriptorPresentation(descriptor),
|
|
@@ -86611,13 +87209,13 @@ const discoverModelsViaAcp = (descriptor, settings, environment = process.env) =
|
|
|
86611
87209
|
const runVersionCommand = (descriptor, settings, environment = process.env) => gen(function* () {
|
|
86612
87210
|
const command = settings.binaryPath.trim() || descriptor.defaultBinary;
|
|
86613
87211
|
const spawnCommand = yield* resolveSpawnCommand(command, ["--version"], { env: environment });
|
|
86614
|
-
return yield* spawnAndCollect(command, make$
|
|
87212
|
+
return yield* spawnAndCollect(command, make$79(spawnCommand.command, spawnCommand.args, {
|
|
86615
87213
|
env: environment,
|
|
86616
87214
|
shell: spawnCommand.shell
|
|
86617
87215
|
}));
|
|
86618
87216
|
});
|
|
86619
87217
|
const checkAcpAgentProviderStatus = (descriptor, settings, environment = process.env) => gen(function* () {
|
|
86620
|
-
const checkedAt = formatIso(yield* now);
|
|
87218
|
+
const checkedAt = formatIso(yield* now$1);
|
|
86621
87219
|
const fallbackModels = acpAgentModelsFromSettings(descriptor, settings.customModels);
|
|
86622
87220
|
const presentation = descriptorPresentation(descriptor);
|
|
86623
87221
|
if (!settings.enabled) return buildServerProvider({
|
|
@@ -86976,7 +87574,7 @@ var ProviderInstanceRegistryMutator = class extends Service$2()("t3/provider/Ser
|
|
|
86976
87574
|
*
|
|
86977
87575
|
* @module unavailableProviderSnapshot
|
|
86978
87576
|
*/
|
|
86979
|
-
const nowIso = map$4(now, formatIso);
|
|
87577
|
+
const nowIso = map$4(now$1, formatIso);
|
|
86980
87578
|
/**
|
|
86981
87579
|
* Produce a `ServerProvider` snapshot representing a configured instance
|
|
86982
87580
|
* whose driver the running build does not implement. The result is safe
|
|
@@ -87097,7 +87695,7 @@ const buildEntry = (input) => gen(function* () {
|
|
|
87097
87695
|
};
|
|
87098
87696
|
}
|
|
87099
87697
|
const typedConfig = decodeResult.success;
|
|
87100
|
-
const childScope = yield* make$
|
|
87698
|
+
const childScope = yield* make$76();
|
|
87101
87699
|
yield* addFinalizer$1(parentScope, close(childScope, void_$2).pipe(ignore$1));
|
|
87102
87700
|
const createResult = yield* driver.create({
|
|
87103
87701
|
instanceId,
|
|
@@ -87218,8 +87816,8 @@ const makeProviderInstanceRegistry = (input) => gen(function* () {
|
|
|
87218
87816
|
const driversById = new Map(input.drivers.map((driver) => [driver.driverKind, driver]));
|
|
87219
87817
|
const parentScope = yield* Scope;
|
|
87220
87818
|
const driverContext = yield* context();
|
|
87221
|
-
const entries = yield* make$
|
|
87222
|
-
const unavailable = yield* make$
|
|
87819
|
+
const entries = yield* make$63(/* @__PURE__ */ new Map());
|
|
87820
|
+
const unavailable = yield* make$63(/* @__PURE__ */ new Map());
|
|
87223
87821
|
const changes = yield* unbounded$1();
|
|
87224
87822
|
yield* addFinalizer(() => shutdown$2(changes));
|
|
87225
87823
|
const reconcileWithR = makeReconcile({
|
|
@@ -87254,7 +87852,7 @@ const makeProviderInstanceRegistry = (input) => gen(function* () {
|
|
|
87254
87852
|
* changes. Tests that exercise the mutator directly can pair this Layer
|
|
87255
87853
|
* with a test-local `ServerSettingsService`.
|
|
87256
87854
|
*/
|
|
87257
|
-
const ProviderInstanceRegistryMutableLayer = (input) => effectContext(makeProviderInstanceRegistry(input).pipe(map$4(({ registry, mutator }) => make$
|
|
87855
|
+
const ProviderInstanceRegistryMutableLayer = (input) => effectContext(makeProviderInstanceRegistry(input).pipe(map$4(({ registry, mutator }) => make$68(ProviderInstanceRegistry, registry).pipe(add$2(ProviderInstanceRegistryMutator, mutator)))));
|
|
87258
87856
|
//#endregion
|
|
87259
87857
|
//#region src/provider/Layers/ProviderInstanceRegistryHydration.ts
|
|
87260
87858
|
/**
|
|
@@ -87489,7 +88087,7 @@ effect(RuntimeReceiptBus, makeRuntimeReceiptBusTest);
|
|
|
87489
88087
|
*/
|
|
87490
88088
|
const makeDrainableWorker = (process) => gen(function* () {
|
|
87491
88089
|
const queue = yield* acquireRelease(unbounded(), shutdown);
|
|
87492
|
-
const outstanding = yield* make$
|
|
88090
|
+
const outstanding = yield* make$52(0);
|
|
87493
88091
|
yield* take(queue).pipe(tap((a) => ensuring(process(a), update$1(outstanding, (n) => n - 1))), forever, forkScoped);
|
|
87494
88092
|
const drain = get$1(outstanding).pipe(tap((n) => n > 0 ? txRetry : void_$1), tx);
|
|
87495
88093
|
const enqueue = (element) => offer(queue, element).pipe(tap(() => update$1(outstanding, (n) => n + 1)), tx);
|
|
@@ -87957,22 +88555,22 @@ const ProviderRuntimeIngestionLive = effect(ProviderRuntimeIngestionService, gen
|
|
|
87957
88555
|
const projectionTurnRepository = yield* ProjectionTurnRepository;
|
|
87958
88556
|
const serverSettingsService = yield* ServerSettingsService;
|
|
87959
88557
|
const providerCommandId = (event, tag) => crypto.randomUUIDv4.pipe(map$4((uuid) => CommandId.make(`provider:${event.eventId}:${tag}:${uuid}`)));
|
|
87960
|
-
const turnMessageIdsByTurnKey = yield* make$
|
|
88558
|
+
const turnMessageIdsByTurnKey = yield* make$81({
|
|
87961
88559
|
capacity: TURN_MESSAGE_IDS_BY_TURN_CACHE_CAPACITY,
|
|
87962
88560
|
timeToLive: TURN_MESSAGE_IDS_BY_TURN_TTL,
|
|
87963
88561
|
lookup: () => succeed$1(/* @__PURE__ */ new Set())
|
|
87964
88562
|
});
|
|
87965
|
-
const bufferedAssistantTextByMessageId = yield* make$
|
|
88563
|
+
const bufferedAssistantTextByMessageId = yield* make$81({
|
|
87966
88564
|
capacity: BUFFERED_MESSAGE_TEXT_BY_MESSAGE_ID_CACHE_CAPACITY,
|
|
87967
88565
|
timeToLive: BUFFERED_MESSAGE_TEXT_BY_MESSAGE_ID_TTL,
|
|
87968
88566
|
lookup: () => succeed$1("")
|
|
87969
88567
|
});
|
|
87970
|
-
const assistantSegmentStateByTurnKey = yield* make$
|
|
88568
|
+
const assistantSegmentStateByTurnKey = yield* make$81({
|
|
87971
88569
|
capacity: TURN_MESSAGE_IDS_BY_TURN_CACHE_CAPACITY,
|
|
87972
88570
|
timeToLive: TURN_MESSAGE_IDS_BY_TURN_TTL,
|
|
87973
88571
|
lookup: () => die(/* @__PURE__ */ new Error("assistant segment state should be read through getOption before initialization"))
|
|
87974
88572
|
});
|
|
87975
|
-
const bufferedProposedPlanById = yield* make$
|
|
88573
|
+
const bufferedProposedPlanById = yield* make$81({
|
|
87976
88574
|
capacity: BUFFERED_PROPOSED_PLAN_BY_ID_CACHE_CAPACITY,
|
|
87977
88575
|
timeToLive: BUFFERED_PROPOSED_PLAN_BY_ID_TTL,
|
|
87978
88576
|
lookup: () => succeed$1({
|
|
@@ -87980,7 +88578,7 @@ const ProviderRuntimeIngestionLive = effect(ProviderRuntimeIngestionService, gen
|
|
|
87980
88578
|
createdAt: ""
|
|
87981
88579
|
})
|
|
87982
88580
|
});
|
|
87983
|
-
const taskDescriptionByTaskKey = yield* make$
|
|
88581
|
+
const taskDescriptionByTaskKey = yield* make$81({
|
|
87984
88582
|
capacity: TASK_DESCRIPTION_BY_TASK_CACHE_CAPACITY,
|
|
87985
88583
|
timeToLive: TASK_DESCRIPTION_BY_TASK_TTL,
|
|
87986
88584
|
lookup: () => succeed$1("")
|
|
@@ -88674,7 +89272,7 @@ const ProviderCommandReactorLive = effect(ProviderCommandReactor, gen(function*
|
|
|
88674
89272
|
const serverSettingsService = yield* ServerSettingsService;
|
|
88675
89273
|
const serverCommandId = (tag) => crypto.randomUUIDv4.pipe(map$4((uuid) => CommandId.make(`server:${tag}:${uuid}`)));
|
|
88676
89274
|
const serverEventId = () => crypto.randomUUIDv4.pipe(map$4(EventId.make));
|
|
88677
|
-
const handledTurnStartKeys = yield* make$
|
|
89275
|
+
const handledTurnStartKeys = yield* make$81({
|
|
88678
89276
|
capacity: HANDLED_TURN_START_KEY_MAX,
|
|
88679
89277
|
timeToLive: HANDLED_TURN_START_KEY_TTL,
|
|
88680
89278
|
lookup: () => succeed$1(true)
|
|
@@ -89483,7 +90081,7 @@ const ProviderRegistryLive = effect(ProviderRegistry, gen(function* () {
|
|
|
89483
90081
|
if (provider === void 0 || source === void 0) continue;
|
|
89484
90082
|
fallbackByInstance.set(source.instanceId, provider);
|
|
89485
90083
|
}
|
|
89486
|
-
const providersRef = yield* make$
|
|
90084
|
+
const providersRef = yield* make$63(yield* forEach(bootSources, (source) => gen(function* () {
|
|
89487
90085
|
const filePath = yield* resolveProviderStatusCachePath({
|
|
89488
90086
|
cacheDir: config.providerStatusCacheDir,
|
|
89489
90087
|
instanceId: source.instanceId
|
|
@@ -89506,9 +90104,9 @@ const ProviderRegistryLive = effect(ProviderRegistry, gen(function* () {
|
|
|
89506
90104
|
return succeed$1(hydrateCachedProvider(correlation));
|
|
89507
90105
|
}));
|
|
89508
90106
|
}), { concurrency: "unbounded" }).pipe(map$4((providers) => orderProviderSnapshots(providers.filter((provider) => provider !== void 0)))));
|
|
89509
|
-
const maintenanceActionStatesRef = yield* make$
|
|
89510
|
-
const liveSubsRef = yield* make$
|
|
89511
|
-
const syncSemaphore = yield* make$
|
|
90107
|
+
const maintenanceActionStatesRef = yield* make$63(/* @__PURE__ */ new Map());
|
|
90108
|
+
const liveSubsRef = yield* make$63(/* @__PURE__ */ new Map());
|
|
90109
|
+
const syncSemaphore = yield* make$75(1);
|
|
89512
90110
|
const getLiveSources = get$3(liveSubsRef).pipe(map$4((map) => Array.from(map.values(), buildSnapshotSource)));
|
|
89513
90111
|
const persistProvider = (provider) => gen(function* () {
|
|
89514
90112
|
const key = snapshotInstanceKey(provider);
|
|
@@ -89693,13 +90291,118 @@ const ProviderRegistryLive = effect(ProviderRegistry, gen(function* () {
|
|
|
89693
90291
|
};
|
|
89694
90292
|
}));
|
|
89695
90293
|
//#endregion
|
|
90294
|
+
//#region src/terminal/NodePtyAdapter.ts
|
|
90295
|
+
var NodePtyModuleLoadError = class extends TaggedErrorClass()("NodePtyModuleLoadError", {
|
|
90296
|
+
platform: String$1,
|
|
90297
|
+
architecture: String$1,
|
|
90298
|
+
cause: Defect()
|
|
90299
|
+
}) {
|
|
90300
|
+
get message() {
|
|
90301
|
+
return `Failed to load node-pty for ${this.platform}-${this.architecture}.`;
|
|
90302
|
+
}
|
|
90303
|
+
};
|
|
90304
|
+
let didEnsureSpawnHelperExecutable = false;
|
|
90305
|
+
const resolveNodePtySpawnHelperPath = gen(function* () {
|
|
90306
|
+
const requireForNodePty = NodeModule.createRequire(import.meta.url);
|
|
90307
|
+
const path = yield* Path;
|
|
90308
|
+
const fs = yield* FileSystem;
|
|
90309
|
+
const platform = yield* HostProcessPlatform;
|
|
90310
|
+
const architecture = yield* HostProcessArchitecture;
|
|
90311
|
+
const packageJsonPath = requireForNodePty.resolve("node-pty/package.json");
|
|
90312
|
+
const packageDir = path.dirname(packageJsonPath);
|
|
90313
|
+
const candidates = [
|
|
90314
|
+
path.join(packageDir, "build", "Release", "spawn-helper"),
|
|
90315
|
+
path.join(packageDir, "build", "Debug", "spawn-helper"),
|
|
90316
|
+
path.join(packageDir, "prebuilds", `${platform}-${architecture}`, "spawn-helper")
|
|
90317
|
+
];
|
|
90318
|
+
for (const candidate of candidates) if (yield* fs.exists(candidate)) return candidate;
|
|
90319
|
+
return null;
|
|
90320
|
+
}).pipe(orElseSucceed(() => null));
|
|
90321
|
+
const ensureNodePtySpawnHelperExecutable = fn(function* () {
|
|
90322
|
+
const fs = yield* FileSystem;
|
|
90323
|
+
if ((yield* HostProcessPlatform) === "win32") return;
|
|
90324
|
+
if (didEnsureSpawnHelperExecutable) return;
|
|
90325
|
+
const helperPath = yield* resolveNodePtySpawnHelperPath;
|
|
90326
|
+
if (!helperPath) return;
|
|
90327
|
+
didEnsureSpawnHelperExecutable = true;
|
|
90328
|
+
if (!(yield* fs.exists(helperPath))) return;
|
|
90329
|
+
yield* fs.chmod(helperPath, 493).pipe(orElseSucceed(() => void 0));
|
|
90330
|
+
});
|
|
90331
|
+
var NodePtyProcess = class {
|
|
90332
|
+
process;
|
|
90333
|
+
constructor(process) {
|
|
90334
|
+
this.process = process;
|
|
90335
|
+
}
|
|
90336
|
+
get pid() {
|
|
90337
|
+
return this.process.pid;
|
|
90338
|
+
}
|
|
90339
|
+
write(data) {
|
|
90340
|
+
this.process.write(data);
|
|
90341
|
+
}
|
|
90342
|
+
resize(cols, rows) {
|
|
90343
|
+
this.process.resize(cols, rows);
|
|
90344
|
+
}
|
|
90345
|
+
kill(signal) {
|
|
90346
|
+
this.process.kill(signal);
|
|
90347
|
+
}
|
|
90348
|
+
onData(callback) {
|
|
90349
|
+
const disposable = this.process.onData(callback);
|
|
90350
|
+
return () => {
|
|
90351
|
+
disposable.dispose();
|
|
90352
|
+
};
|
|
90353
|
+
}
|
|
90354
|
+
onExit(callback) {
|
|
90355
|
+
const disposable = this.process.onExit((event) => {
|
|
90356
|
+
callback({
|
|
90357
|
+
exitCode: event.exitCode,
|
|
90358
|
+
signal: event.signal ?? null
|
|
90359
|
+
});
|
|
90360
|
+
});
|
|
90361
|
+
return () => {
|
|
90362
|
+
disposable.dispose();
|
|
90363
|
+
};
|
|
90364
|
+
}
|
|
90365
|
+
};
|
|
90366
|
+
const layer = effect(PtyAdapter, fn("NodePtyAdapter.make")(function* (loadNodePtyModule = () => import("node-pty")) {
|
|
90367
|
+
const fs = yield* FileSystem;
|
|
90368
|
+
const path = yield* Path;
|
|
90369
|
+
const platform = yield* HostProcessPlatform;
|
|
90370
|
+
const architecture = yield* HostProcessArchitecture;
|
|
90371
|
+
const nodePty = yield* tryPromise({
|
|
90372
|
+
try: loadNodePtyModule,
|
|
90373
|
+
catch: (cause) => new NodePtyModuleLoadError({
|
|
90374
|
+
platform,
|
|
90375
|
+
architecture,
|
|
90376
|
+
cause
|
|
90377
|
+
})
|
|
90378
|
+
}).pipe(orDie);
|
|
90379
|
+
const ensureNodePtySpawnHelperExecutableCached = yield* cached(ensureNodePtySpawnHelperExecutable().pipe(provideService(FileSystem, fs), provideService(Path, path), provideService(HostProcessPlatform, platform), provideService(HostProcessArchitecture, architecture), orElseSucceed(() => void 0)));
|
|
90380
|
+
return PtyAdapter.of({ spawn: fn("NodePtyAdapter.spawn")(function* (input) {
|
|
90381
|
+
yield* ensureNodePtySpawnHelperExecutableCached;
|
|
90382
|
+
return new NodePtyProcess(yield* try_({
|
|
90383
|
+
try: () => nodePty.spawn(input.shell, input.args ?? [], {
|
|
90384
|
+
cwd: input.cwd,
|
|
90385
|
+
cols: input.cols,
|
|
90386
|
+
rows: input.rows,
|
|
90387
|
+
env: input.env,
|
|
90388
|
+
name: platform === "win32" ? "xterm-color" : "xterm-256color"
|
|
90389
|
+
}),
|
|
90390
|
+
catch: (cause) => new PtySpawnError({
|
|
90391
|
+
adapter: "node-pty",
|
|
90392
|
+
shell: input.shell,
|
|
90393
|
+
cause
|
|
90394
|
+
})
|
|
90395
|
+
}));
|
|
90396
|
+
}) });
|
|
90397
|
+
})());
|
|
90398
|
+
//#endregion
|
|
89696
90399
|
//#region ../t3-shared/src/httpObservability.ts
|
|
89697
90400
|
const httpHeaderRedactionLayer = effect(CurrentRedactedNames, map$4(CurrentRedactedNames, (names) => [...names, "dpop"]));
|
|
89698
90401
|
//#endregion
|
|
89699
90402
|
//#region src/serverLogger.ts
|
|
89700
90403
|
const ServerLoggerLive = gen(function* () {
|
|
89701
90404
|
const minimumLogLevelLayer = succeed$3(MinimumLogLevel, (yield* ServerConfig).logLevel);
|
|
89702
|
-
return mergeAll(layer$
|
|
90405
|
+
return mergeAll(layer$40([consolePretty(), tracerLogger], { mergeWithExisting: false }), minimumLogLevelLayer);
|
|
89703
90406
|
}).pipe(unwrap);
|
|
89704
90407
|
//#endregion
|
|
89705
90408
|
//#region src/observability/Layers/Observability.ts
|
|
@@ -89722,7 +90425,7 @@ const ObservabilityLive = unwrap(gen(function* () {
|
|
|
89722
90425
|
durationMs: stats.durationMs
|
|
89723
90426
|
})
|
|
89724
90427
|
});
|
|
89725
|
-
const delegate = config.otlpTracesUrl === void 0 ? void 0 : yield* make$
|
|
90428
|
+
const delegate = config.otlpTracesUrl === void 0 ? void 0 : yield* make$21({
|
|
89726
90429
|
url: config.otlpTracesUrl,
|
|
89727
90430
|
exportInterval: `${config.otlpExportIntervalMs} millis`,
|
|
89728
90431
|
resource: {
|
|
@@ -89740,9 +90443,9 @@ const ObservabilityLive = unwrap(gen(function* () {
|
|
|
89740
90443
|
batchWindowMs: config.traceBatchWindowMs,
|
|
89741
90444
|
sink,
|
|
89742
90445
|
...delegate ? { delegate } : {}
|
|
89743
|
-
})), layer$
|
|
90446
|
+
})), layer$12(sink));
|
|
89744
90447
|
})).pipe(provide(layerFlusher), provideMerge(otlpSerializationLayer));
|
|
89745
|
-
const metricsLayer = config.otlpMetricsUrl === void 0 ? empty$8 : layer$
|
|
90448
|
+
const metricsLayer = config.otlpMetricsUrl === void 0 ? empty$8 : layer$15({
|
|
89746
90449
|
url: config.otlpMetricsUrl,
|
|
89747
90450
|
exportInterval: `${config.otlpExportIntervalMs} millis`,
|
|
89748
90451
|
resource: {
|
|
@@ -89795,11 +90498,11 @@ const orchestrationHttpApiLayer = group(EnvironmentHttpApi, "orchestration", fnU
|
|
|
89795
90498
|
//#endregion
|
|
89796
90499
|
//#region src/server.ts
|
|
89797
90500
|
const HTTP_PREEMPTIVE_SHUTDOWN_GRACE_MS = 0;
|
|
89798
|
-
const ApplicationObservabilityLive = ObservabilityLive.pipe(provideMerge(layer$
|
|
89799
|
-
const ServerSettingsLayerLive = layer$
|
|
89800
|
-
const DesktopTelemetryReceiverLayerLive = layer$
|
|
89801
|
-
const HostPowerMonitorLayerLive = layer$
|
|
89802
|
-
const BackgroundLayerLive = layer$
|
|
90501
|
+
const ApplicationObservabilityLive = ObservabilityLive.pipe(provideMerge(layer$16));
|
|
90502
|
+
const ServerSettingsLayerLive = layer$25.pipe(provide(layer$35));
|
|
90503
|
+
const DesktopTelemetryReceiverLayerLive = layer$19.pipe(provideMerge(ServerSettingsLayerLive));
|
|
90504
|
+
const HostPowerMonitorLayerLive = layer$18.pipe(provide(DesktopTelemetryReceiverLayerLive));
|
|
90505
|
+
const BackgroundLayerLive = layer$17.pipe(provide(HostPowerMonitorLayerLive), provideMerge(ServerSettingsLayerLive));
|
|
89803
90506
|
const HttpServerLive = unwrap(gen(function* () {
|
|
89804
90507
|
const config = yield* ServerConfig;
|
|
89805
90508
|
if (typeof Bun !== "undefined") return (yield* promise(() => import("@effect/platform-bun/BunHttpServer"))).layer({
|
|
@@ -89812,7 +90515,7 @@ const HttpServerLive = unwrap(gen(function* () {
|
|
|
89812
90515
|
} }
|
|
89813
90516
|
});
|
|
89814
90517
|
else {
|
|
89815
|
-
const [NodeHttpServer, NodeHttp] = yield* all([promise(() => import("./NodeHttpServer-
|
|
90518
|
+
const [NodeHttpServer, NodeHttp] = yield* all([promise(() => import("./NodeHttpServer-D2VeYRw1.mjs")), promise(() => import("node:http"))]);
|
|
89816
90519
|
return NodeHttpServer.layer(NodeHttp.createServer, {
|
|
89817
90520
|
host: config.host ?? "127.0.0.1",
|
|
89818
90521
|
port: config.port,
|
|
@@ -89826,30 +90529,31 @@ const PlatformServicesLive = unwrap(gen(function* () {
|
|
|
89826
90529
|
const { layer } = yield* promise(() => import("@effect/platform-bun/BunServices"));
|
|
89827
90530
|
return layer;
|
|
89828
90531
|
} else {
|
|
89829
|
-
const { layer } = yield* promise(() => import("./NodeServices-
|
|
90532
|
+
const { layer } = yield* promise(() => import("./NodeServices-BtcL7AtO.mjs").then((n) => n.t));
|
|
89830
90533
|
return layer;
|
|
89831
90534
|
}
|
|
89832
90535
|
}));
|
|
89833
90536
|
const ReactorLayerLive = empty$8.pipe(provideMerge(OrchestrationReactorLive), provideMerge(ProviderRuntimeIngestionLive), provideMerge(ProviderCommandReactorLive), provideMerge(ThreadDeletionReactorLive), provideMerge(RuntimeReceiptBusLive));
|
|
89834
|
-
const ProviderSessionDirectoryLayerLive = ProviderSessionDirectoryLive.pipe(provide(layer$
|
|
90537
|
+
const ProviderSessionDirectoryLayerLive = ProviderSessionDirectoryLive.pipe(provide(layer$4));
|
|
89835
90538
|
const ProviderLayerLive = ProviderServiceLive.pipe(provide(ProviderAdapterRegistryLive), provideMerge(ProviderSessionDirectoryLayerLive));
|
|
89836
90539
|
const PersistenceLayerLive = empty$8.pipe(provideMerge(layerConfig));
|
|
89837
|
-
const WorkspaceEntriesLayerLive = layer$
|
|
89838
|
-
const WorkspaceLayerLive = mergeAll(layer$
|
|
89839
|
-
const
|
|
89840
|
-
const
|
|
90540
|
+
const WorkspaceEntriesLayerLive = layer$9.pipe(provide(layer$21));
|
|
90541
|
+
const WorkspaceLayerLive = mergeAll(layer$21, WorkspaceEntriesLayerLive, layer$8.pipe(provide(layer$21), provide(WorkspaceEntriesLayerLive)));
|
|
90542
|
+
const TerminalLayerLive = layer$6.pipe(provide(layer));
|
|
90543
|
+
const ProjectFaviconResolverLayerLive = layer$13.pipe(provide(layer$21), provide(layer$14));
|
|
90544
|
+
const AuthLayerLive = layer$32.pipe(provideMerge(PersistenceLayerLive), provide(layer$35));
|
|
89841
90545
|
const ProviderRuntimeLayerLive = ProviderSessionReaperLive.pipe(provideMerge(ProviderLayerLive), provideMerge(OrchestrationLayerLive));
|
|
89842
|
-
const RuntimeDependenciesLive = ReactorLayerLive.pipe(provideMerge(ServerSettingsLayerLive), provideMerge(ProviderRuntimeLayerLive), provideMerge(PersistenceLayerLive), provideMerge(layer$
|
|
90546
|
+
const RuntimeDependenciesLive = ReactorLayerLive.pipe(provideMerge(ServerSettingsLayerLive), provideMerge(ProviderRuntimeLayerLive), provideMerge(PersistenceLayerLive), provideMerge(layer$28), provideMerge(layer$2), provideMerge(ProviderRegistryLive), provideMerge(ProviderInstanceRegistryHydrationLive), provideMerge(layer$3), provideMerge(WorkspaceLayerLive), provideMerge(layer$7), provideMerge(TerminalLayerLive), provideMerge(ProjectFaviconResolverLayerLive), provideMerge(layer$29), provideMerge(layer$23), provideMerge(AuthLayerLive), provideMerge(layer$35)).pipe(provideMerge(BackgroundLayerLive), provideMerge(layer$24), provideMerge(layer$27), provideMerge(layer$26), provide(layer$42));
|
|
89843
90547
|
const commandReadinessLayer = middleware((httpEffect) => flatMap$1(ServerRuntimeStartup, (startup) => startup.awaitCommandReady.pipe(orDie, andThen(httpEffect))), { global: true });
|
|
89844
|
-
const makeRoutesLayer = mergeAll(layer$
|
|
90548
|
+
const makeRoutesLayer = mergeAll(layer$20(EnvironmentHttpApi).pipe(provide(authHttpApiLayer), provide(connectHttpApiLayer), provide(orchestrationHttpApiLayer), provide(serverEnvironmentHttpApiLayer), provide(environmentAuthenticatedAuthLayer)), otlpTracesProxyRouteLayer, assetRouteLayer, staticAndDevRouteLayer, websocketRpcRouteLayer).pipe(provide(commandReadinessLayer), provide(browserApiCorsLayer), provide(httpCompressionLayer));
|
|
89845
90549
|
const runServer = launch(unwrap(gen(function* () {
|
|
89846
90550
|
const config = yield* ServerConfig;
|
|
89847
|
-
const activation = yield* make$
|
|
90551
|
+
const activation = yield* make$73();
|
|
89848
90552
|
const awaitActivation = _await(activation);
|
|
89849
90553
|
const activationLayer = succeed$3(ServerActivation, awaitActivation);
|
|
89850
|
-
const runtimeStateParked = yield* make$
|
|
89851
|
-
const tailscaleParked = yield* make$
|
|
89852
|
-
const routesReady = yield* make$
|
|
90554
|
+
const runtimeStateParked = yield* make$73();
|
|
90555
|
+
const tailscaleParked = yield* make$73();
|
|
90556
|
+
const routesReady = yield* make$73();
|
|
89853
90557
|
yield* fixPath();
|
|
89854
90558
|
const httpListeningLayer = effectDiscard(gen(function* () {
|
|
89855
90559
|
yield* HttpServer;
|
|
@@ -89903,7 +90607,7 @@ const runServer = launch(unwrap(gen(function* () {
|
|
|
89903
90607
|
...config.tailscaleServeEnabled ? [_await(tailscaleParked)] : []
|
|
89904
90608
|
], { concurrency: "unbounded" }).pipe(asVoid)
|
|
89905
90609
|
}).pipe(provideMerge(RuntimeDependenciesLive));
|
|
89906
|
-
return mergeAll(serve(makeRoutesLayer, { disableLogger: !config.logWebSocketEvents }).pipe(tap$1(() => succeed$4(routesReady, void 0).pipe(orDie))), httpListeningLayer, runtimeStateLayer, tailscaleServeLayer, config.hubTunnel ? layer$
|
|
90610
|
+
return mergeAll(serve(makeRoutesLayer, { disableLogger: !config.logWebSocketEvents }).pipe(tap$1(() => succeed$4(routesReady, void 0).pipe(orDie))), httpListeningLayer, runtimeStateLayer, tailscaleServeLayer, config.hubTunnel ? layer$5(config.hubTunnel).pipe(provideMerge(runtimeServicesLive)) : empty$8).pipe(provideMerge(runtimeServicesLive), provide(activationLayer), provideMerge(HttpServerLive), provide(ApplicationObservabilityLive), provideMerge(layer$43), provideMerge(PlatformServicesLive));
|
|
89907
90611
|
})));
|
|
89908
90612
|
//#endregion
|
|
89909
90613
|
//#region src/cli/server.ts
|
|
@@ -89915,15 +90619,15 @@ const runServerCommand = (flags, options) => gen(function* () {
|
|
|
89915
90619
|
});
|
|
89916
90620
|
return yield* runServer.pipe(provideService(ServerConfig, config), ensuring(sync(releaseDaemonLock)));
|
|
89917
90621
|
});
|
|
89918
|
-
const startCommand = make$
|
|
89919
|
-
const serveCommand = make$
|
|
90622
|
+
const startCommand = make$62("start", { ...sharedServerCommandFlags }).pipe(withDescription("Run the T3 Code server."), withHandler((flags) => runServerCommand(flags)));
|
|
90623
|
+
const serveCommand = make$62("serve", { ...sharedServerCommandFlags }).pipe(withDescription("Run the T3 Code server without opening a browser."), withHandler((flags) => runServerCommand(flags, {
|
|
89920
90624
|
startupPresentation: "headless",
|
|
89921
90625
|
forceAutoBootstrapProjectFromCwd: false
|
|
89922
90626
|
})));
|
|
89923
90627
|
//#endregion
|
|
89924
90628
|
//#region src/bin.ts
|
|
89925
|
-
const CliRuntimeLayer = mergeAll(layer$
|
|
89926
|
-
const makeCli = () => make$
|
|
90629
|
+
const CliRuntimeLayer = mergeAll(layer$44, layer$42);
|
|
90630
|
+
const makeCli = () => make$62("t3", { ...sharedServerCommandFlags }).pipe(withDescription("Run the T3 Code server."), withHandler((flags) => runServerCommand(flags)), withSubcommands([
|
|
89927
90631
|
startCommand,
|
|
89928
90632
|
serveCommand,
|
|
89929
90633
|
pairCommand,
|