alink-cli 0.8.7 → 0.8.9
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/README.md +2 -0
- package/dist/bin.mjs +146 -38
- package/dist/bin.mjs.map +1 -1
- package/dist/daemon.js +3 -0
- package/dist/ui.js +11 -6
- package/package.json +2 -2
package/README.md
CHANGED
package/dist/bin.mjs
CHANGED
|
@@ -1,16 +1,18 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
|
|
3
|
-
import { $ as make$62, 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, 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$63, Yt as StatusCodeError, Z as awaitEmpty, Zt as empty$2, _ as get$3, _n as fromInput, _t as mergeCookies, a as layer$40, 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$60, yn as toRecord, yt as redirect, zt as make$61 } from "./NodeSocket-08w4osAf.mjs";
|
|
4
|
-
import { $ as decodeUnknownExit, $c as combine$1, $d as isNotNull, $i as makeUnsafe$7, $l as fromInput$2, $o as service, $s as taggedEnum, $t as Union$1, $u as empty$5, A as StructWithRest, Ac as die$2, Ad as getStackTraceLimit, Ai as makeUnsafe$5, Al as fnUntraced$1, An as encodeBase64, Ao as never, Ar as mapError$1, As as withTracerEnabled, At as suspend$1, Au as reduce, B as Union, Ba as catch_, Bc as die$1, Bd as NodeInspectSymbol, Bn as now, Bo as provideContext, Br as run$5, Bt as value, C as Number$1, Ca as annotateCurrentSpan, Cc as make$73, Cd as match$1, Ci as fromTransform, Cn as parseJson, Cr as fromSubscription, Cs as void_$1, Ct as isTrimmed, Cu as fromIterable, D as String$1, Da as as, Dc as TracerEnabled, Dd as make$69, Dn as decodeBase64String, Do as matchCauseEffect, Dr as map$8, Dt as mutable, Du as map$5, E as Record, Ea as annotateSpans, Ec as MinimumLogLevel, Ed as Number$2, Ei as pipeTo, Eo as match$2, Er as make$71, Es as withFiber$1, Et as makeFilter, Fa as catchFilter, Fc as isDeferred, Fd as isEffect$1, Fn as isGreaterThan$1, Fo as option, Fs as timer, Ft as toJsonSchemaDocument, Fu as map$7, G as annotateKey, Ga as die, Gc as isSuccess, Gd as equals, Gi as unbounded$2, Gl as Tracer, Gn as InvalidValue$1, Go as retry, Gr as runForEach, Gs as parse$2, Gt as toJsonSchemaMultiDocument, Gu as isFailure$1, H as UnknownFromJsonString$1, Ha as context, Hc as failCause$4, Hd as format, Hi as sliding$1, Hl as MinimumTraceLevel, Hn as toEpochMillis, Ho as raceFirst, Hr as runDrain, Hs as spaced, Ht as toMultiDocumentOpenApi3_1, Hu as failVoid, I as URLFromString, Ia as catchIf, Id as withFiber, Ii as make$75, In as isGreaterThanOrEqualTo$1, Io as orDie, Ir as pipeThroughChannel, Is as update$3, It as toType, J as decodeEffect, Ja as exit, Jc as void_$2, Ji as sliding, Jn as Path, Jo as runPromiseWith, Js as currentTimeMillis, Ju as succeed$2, K as brand, Kc as match$3, Ki as publish, Kl as externalSpan, Ko as runFork, Kr as runForEachArray, Ks as round, Kt as escapeToken, Ku as isSuccess$1, L as Uint8Array$1, La as catchReason, Lc as make$70, Ld as assignProperty, Li as offer$1, Ll as sync$1, Ln as isLessThan$1, Lo as orElseSucceed, Ls as withAttributes, Lt as withConstructorDefault, M as TaggedStruct, Ma as catchCause, Mc as fail$3, Md as Prototype, Mi as end, Mn as encodeHex, Mo as onExit, Ms as zipWith, Mt as toCodecJson, Mu as sort, N as TemplateLiteral, Na as catchDefect, Nc as failCause$2, Nd as PipeInspectableProto, Nn as add$3, Ns as counter, Nt as toCodecJsonAST, O as StringFromUriComponent, Oa as asSome, Oc as TracerTimingEnabled, Oi as splitLines, On as decodeBase64Url, Or as mapArrayEffect, Os as withParentSpan, Ot as optional$3, Ou as match, Pi as failCause$3, Pl as reportCauseUnsafe, Pn as formatIso, Po as onInterrupt, Pr as onExit$1, Ps as snapshotUnsafe, Pt as toCodecStringTree, Q as decodeUnknownEffect, Qa as flatMap$1, Qd as hasProperty, Ql as format$1, Qo as scopedWith, Qs as TaggedError, Qt as isSchemaError, Qu as add$2, R as Undefined, Ra as catchTag, Ri as offerAll, Rl as tracerLogger$1, Rn as make$68, Ro as promise, Rr as provideContext$1, Rs as addDelay, Rt as withDecodingDefault, S as NullOr, Sa as andThen, Sc as forkUnsafe, Sd as map$6, Sl as CurrentLoggers$1, Sn as onSome, So as map$4, Ss as useSpan, St as isSchema, Su as flatMapNullishOr, T as OptionFromNullOr, Ta as annotateLogsScoped, Tc as provide$2, Td as some, Ti as mapEffect$2, Tn as stringifyJson, Tr as isStream, Ts as withErrorReporting, Tt as make$67, Tu as isReadonlyArrayNonEmpty, U as Void, Ua as contextWith, Uc as interrupt$3, Ui as take$1, Ul as NativeSpan, Un as toUtc, Uo as repeat, Ur as runFold, Us as catchDone, Ut as apply, Uu as getOrThrow, V as Unknown, Vc as fail$4, Vd as toJson, Vi as shutdown$1, Vn as toDate, Vo as provideService, Vr as runCollect, Vs as passthrough, Vt as VALID_OPEN_API_COMPONENTS_SCHEMAS_KEY_REGEXP, Vu as fail$1, W as annotate$2, Wa as currentParentSpan, Wc as isFailure, Wi as takeAll, Wl as ParentSpan, Wn as Forbidden$1, Wo as result, Wr as runFoldEffect, Ws as isDoneCause, Wt as toRepresentations, Wu as getOrUndefined$2, X as decodeSync, Xa as failCause$1, Xc as NoSuchElementError, Xi as unbounded$1, Xn as FileSystem, Xo as scope, Xr as takeWhile, Xu as Reference, Y as decodeExit, Ya as fail, Yi as subscribe, Ys as currentTimeNanos, Z as decodeTo, Za as filterOrFail, Zc as StackTrace, Zd as compose$1, Zl as days, Zo as scoped, Zr as toAsyncIterable, Zs as TaggedClass, Zt as SchemaError, Zu as Service$2, _a as Transaction, _c as Scope, _d as getOrElse, _f as pipe, _l as pretty, _n as Transformation, _o as logError, _s as tx, _t as isMaxLength, _u as filter$1, a as Class, aa as runIn, ac as effectDiscard, ad as make$65, an as isLiteral, ao as forkChild, ar as debounce, as as suspend, at as encodeUnknownExit, au as max, b as NonEmptyString, ba as addFinalizer, bc as close, bd as isNone, bi as decodeText$1, bn as transformOrFail, bo as logWarning$1, br as fromPubSub, bt as isNonEmpty, bu as findFirstIndex, c as Defect, ca as empty$6, cc as launch, cd as omit, cf as compose, ci as invalidate, cl as hasInterruptsOnly, cn as isOptional, co as fromResult, cr as drain, cs as tapCause, ct as instanceOf, cu as nanos, d as ErrorClass, da as size$2, dc as provideMerge, dd as filter, df as constUndefined, dl as isCause, dn as isVoid, do as ignoreCause, ds as tapErrorTag, dt as isFinite, ea as await_, ec as CurrentMemoMap, ed as get$5, ef as isNotUndefined, eo as flatten$1, et as decodeUnknownOption, eu as fromInputUnsafe, f as Exit, fa as toArray, fc as succeed$3, fd as firstSomeOf, ff as constVoid, fl as isFailReason, fn as resolveAt, fo as interrupt$1, fr as fail$5, fs as timeout, ft as isGreaterThan, fu as zero, g as Literals, gc as unwrap, gd as fromUndefinedOr, gf as identity, gi as forEach$1, gl as map$9, go as logDebug, gr as fromAsyncIterable, gs as try_, gt as isLessThanOrEqualTo, gu as ensure, h as Literal, hc as tap$1, hd as fromNullishOr, hi as drain$1, hn as toEncoded, ho as log$1, hr as flatMap$2, hs as tryPromise, ht as isLessThan, hu as empty$4, i as Cause, ia as join$
|
|
3
|
+
import { $ as make$62, 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$63, Yt as StatusCodeError, Z as awaitEmpty, Zt as empty$2, _ as get$3, _n as fromInput, _t as mergeCookies, a as layer$40, 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$60, yn as toRecord, yt as redirect, zt as make$61 } from "./NodeSocket-08w4osAf.mjs";
|
|
4
|
+
import { $ as decodeUnknownExit, $c as combine$1, $d as isNotNull, $i as makeUnsafe$7, $l as fromInput$2, $o as service, $s as taggedEnum, $t as Union$1, $u as empty$5, A as StructWithRest, Ac as die$2, Ad as getStackTraceLimit, Ai as makeUnsafe$5, Al as fnUntraced$1, An as encodeBase64, Ao as never, Ar as mapError$1, As as withTracerEnabled, At as suspend$1, Au as reduce, B as Union, Ba as catch_, Bc as die$1, Bd as NodeInspectSymbol, Bn as now, Bo as provideContext, Br as run$5, Bt as value, C as Number$1, Ca as annotateCurrentSpan, Cc as make$73, Cd as match$1, Ci as fromTransform, Cn as parseJson, Cr as fromSubscription, Cs as void_$1, Ct as isTrimmed, Cu as fromIterable, D as String$1, Da as as, Dc as TracerEnabled, Dd as make$69, Dn as decodeBase64String, Do as matchCauseEffect, Dr as map$8, Dt as mutable, Du as map$5, E as Record, Ea as annotateSpans, Ec as MinimumLogLevel, Ed as Number$2, Ei as pipeTo, Eo as match$2, Er as make$71, Es as withFiber$1, Et as makeFilter, Fa as catchFilter, Fc as isDeferred, Fd as isEffect$1, Fn as isGreaterThan$1, Fo as option, Fs as timer, Ft as toJsonSchemaDocument, Fu as map$7, G as annotateKey, Ga as die, Gc as isSuccess, Gd as equals, Gi as unbounded$2, Gl as Tracer, Gn as InvalidValue$1, Go as retry, Gr as runForEach, Gs as parse$2, Gt as toJsonSchemaMultiDocument, Gu as isFailure$1, H as UnknownFromJsonString$1, Ha as context, Hc as failCause$4, Hd as format, Hi as sliding$1, Hl as MinimumTraceLevel, Hn as toEpochMillis, Ho as raceFirst, Hr as runDrain, Hs as spaced, Ht as toMultiDocumentOpenApi3_1, Hu as failVoid, I as URLFromString, Ia as catchIf, Id as withFiber, Ii as make$75, In as isGreaterThanOrEqualTo$1, Io as orDie, Ir as pipeThroughChannel, Is as update$3, It as toType, J as decodeEffect, Ja as exit, Jc as void_$2, Ji as sliding, Jn as Path, Jo as runPromiseWith, Js as currentTimeMillis, Ju as succeed$2, K as brand, Kc as match$3, Ki as publish, Kl as externalSpan, Ko as runFork, Kr as runForEachArray, Ks as round, Kt as escapeToken, Ku as isSuccess$1, L as Uint8Array$1, La as catchReason, Lc as make$70, Ld as assignProperty, Li as offer$1, Ll as sync$1, Ln as isLessThan$1, Lo as orElseSucceed, Ls as withAttributes, Lt as withConstructorDefault, M as TaggedStruct, Ma as catchCause, Mc as fail$3, Md as Prototype, Mi as end, Mn as encodeHex, Mo as onExit, Ms as zipWith, Mt as toCodecJson, Mu as sort, N as TemplateLiteral, Na as catchDefect, Nc as failCause$2, Nd as PipeInspectableProto, Nn as add$3, Ns as counter, Nt as toCodecJsonAST, O as StringFromUriComponent, Oa as asSome, Oc as TracerTimingEnabled, Oi as splitLines, On as decodeBase64Url, Or as mapArrayEffect, Os as withParentSpan, Ot as optional$3, Ou as match, Pi as failCause$3, Pl as reportCauseUnsafe, Pn as formatIso, Po as onInterrupt, Pr as onExit$1, Ps as snapshotUnsafe, Pt as toCodecStringTree, Q as decodeUnknownEffect, Qa as flatMap$1, Qd as hasProperty, Ql as format$1, Qo as scopedWith, Qs as TaggedError, Qt as isSchemaError, Qu as add$2, R as Undefined, Ra as catchTag, Ri as offerAll, Rl as tracerLogger$1, Rn as make$68, Ro as promise, Rr as provideContext$1, Rs as addDelay, Rt as withDecodingDefault, S as NullOr, Sa as andThen, Sc as forkUnsafe, Sd as map$6, Sl as CurrentLoggers$1, Sn as onSome, So as map$4, Ss as useSpan, St as isSchema, Su as flatMapNullishOr, T as OptionFromNullOr, Ta as annotateLogsScoped, Tc as provide$2, Td as some, Ti as mapEffect$2, Tn as stringifyJson, Tr as isStream, Ts as withErrorReporting, Tt as make$67, Tu as isReadonlyArrayNonEmpty, U as Void, Ua as contextWith, Uc as interrupt$3, Ui as take$1, Ul as NativeSpan, Un as toUtc, Uo as repeat, Ur as runFold, Us as catchDone, Ut as apply, Uu as getOrThrow, V as Unknown, Vc as fail$4, Vd as toJson, Vi as shutdown$1, Vn as toDate, Vo as provideService, Vr as runCollect, Vs as passthrough, Vt as VALID_OPEN_API_COMPONENTS_SCHEMAS_KEY_REGEXP, Vu as fail$1, W as annotate$2, Wa as currentParentSpan, Wc as isFailure, Wi as takeAll, Wl as ParentSpan, Wn as Forbidden$1, Wo as result, Wr as runFoldEffect, Ws as isDoneCause, Wt as toRepresentations, Wu as getOrUndefined$2, X as decodeSync, Xa as failCause$1, Xc as NoSuchElementError, Xi as unbounded$1, Xn as FileSystem, Xo as scope, Xr as takeWhile, Xu as Reference, Y as decodeExit, Ya as fail, Yi as subscribe, Ys as currentTimeNanos, Z as decodeTo, Za as filterOrFail, Zc as StackTrace, Zd as compose$1, Zl as days, Zo as scoped, Zr as toAsyncIterable, Zs as TaggedClass, Zt as SchemaError, Zu as Service$2, _a as Transaction, _c as Scope, _d as getOrElse, _f as pipe, _l as pretty, _n as Transformation, _o as logError, _s as tx, _t as isMaxLength, _u as filter$1, a as Class, aa as runIn, ac as effectDiscard, ad as make$65, an as isLiteral, ao as forkChild, ar as debounce, as as suspend, at as encodeUnknownExit, au as max, b as NonEmptyString, ba as addFinalizer, bc as close, bd as isNone, bi as decodeText$1, bn as transformOrFail, bo as logWarning$1, br as fromPubSub, bt as isNonEmpty, bu as findFirstIndex, c as Defect, ca as empty$6, cc as launch, cd as omit, cf as compose, ci as invalidate, cl as hasInterruptsOnly, cn as isOptional, co as fromResult, cr as drain, cs as tapCause, ct as instanceOf, cu as nanos, d as ErrorClass, da as size$2, dc as provideMerge, dd as filter, df as constUndefined, dl as isCause, dn as isVoid, do as ignoreCause, ds as tapErrorTag, dt as isFinite, ea as await_, ec as CurrentMemoMap, ed as get$5, ef as isNotUndefined, eo as flatten$1, et as decodeUnknownOption, eu as fromInputUnsafe, f as Exit, fa as toArray, fc as succeed$3, fd as firstSomeOf, ff as constVoid, fl as isFailReason, fn as resolveAt, fo as interrupt$1, fr as fail$5, fs as timeout, ft as isGreaterThan, fu as zero, g as Literals, gc as unwrap, gd as fromUndefinedOr, gf as identity, gi as forEach$1, gl as map$9, go as logDebug, gr as fromAsyncIterable, gs as try_, gt as isLessThanOrEqualTo, gu as ensure, h as Literal, hc as tap$1, hd as fromNullishOr, hi as drain$1, hn as toEncoded, ho as log$1, hr as flatMap$2, hs as tryPromise, ht as isLessThan, hu as empty$4, i as Cause, ia as join$2, ic as effectContext, id as getUnsafe$1, if as isTagged, il as findErrorOption, in as isDeclaration, io as forever, ir as concat, is as succeedSome, it as encodeUnknownEffect, j as TaggedErrorClass, ja as callback, jd as setStackTraceLimit, ji as bounded, jn as encodeBase64Url, jo as onError, jr as merge$2, js as yieldNow, jt as tag, ju as reverse, k as Struct, ka as asVoid, kc as _await, ki as make$72, kn as decodeBase64UrlString, ko as matchEffect, kr as mapEffect$1, ks as withSpan, kt as optionalKey, l as Duration, la as head, lc as mergeAll, ld as contains, lf as constFalse, li as make$66, ll as interrupt$2, ln as isSuspend, lo as gen, lr as empty$7, ls as tapDefect, lt as is, lu as seconds, m as Int, ma as PlatformError, mc as sync$2, md as flatten, mf as dual, mn as resolveIdentifier, mo as isEffect, mr as filter$2, mt as isInt, n as ArraySchema, na as interrupt$4, nc as buildWithMemoMap, nd as getOrElse$1, nf as isObject$1, ni as unwrap$1, nl as fail$2, nn as getAST, no as fnUntraced, nr as catchCause$1, ns as succeed$1, nt as encodeEffect, o as DateTimeUtc, oa as append$1, oc as empty$8, od as makeUnsafe$4, oi as get$6, ol as hasDies, on as isNull, oo as forkIn, or as decodeText, os as sync, ot as fieldsAssign, ou as millis, p as Finite, pc as succeedContext, pd as flatMap$3, pf as constant, pn as resolveDescription, po as interruptible, pr as failCause$5, ps as timeoutOption, pt as isGreaterThanOrEqualTo, pu as allocate, q as declare, qa as ensuring, qi as shutdown$2, ql as make$74, qn as makeFormatterDefault, qo as runForkWith, qs as Clock, qt as assign, r as Boolean$1, rc as effect, rd as getOrUndefined$1, rf as isString, ri as withSpan$1, rn as getLastEncoding, ro as forEach, rr as changes, rs as succeedNone, rt as encodeSync, s as DateTimeUtcFromString, sa as drop$1, sd as merge$1, sf as cast, si as has, sl as hasInterrupts, sn as isObjects, so as forkScoped, ss as tap, st as fromJsonString, su as minutes, t as Any, ta as getCurrent, tc as build, td as getOption, tf as isNullish, ti as transformPull, to as fn, ts as sleep, tt as encode$1, tu as hours, u as DurationFromMillis, ua as isEmpty$2, uc as provide, ud as exists, uf as constTrue, ul as interruptors, un as isUnion, uo as ignore$1, ur as encodeText, us as tapError, ut as isBetween, uu as toMillis, v as Never, va as acquireRelease, vc as addFinalizer$1, vd as getOrNull, vf as pipeArguments, vl as prettyErrors, vo as logFatal, vr as fromEffect, vs as txRetry, vt as isMaxProperties, vu as filterMap, w as Option, wa as annotateLogs, wc as makeUnsafe$8, wd as none, wl as consolePretty$1, wo as mapError, wr as groupedWithin, ws as whileLoop, wu as isArrayNonEmpty, x as Null, xa as all, xc as closeUnsafe, xd as isSome, xi as filterArray, xl as ConsoleRef, xn as trim, xo as makeSpanScoped, xr as fromQueue, xs as updateContext, xt as isPattern, xu as findLast, y as NonEmptyArray, ya as acquireUseRelease, yc as addFinalizerExit, yd as getOrUndefined, yi as mapInput, yl as squash, yn as transform$1, yo as logInfo, yr as fromIterable$1, ys as uninterruptible, yt as isMinLength, yu as findFirst, z as UndefinedOr, za as catchTags, zc as succeed$4, zi as offerUnsafe, zn as makeUnsafe$6, zo as provide$1, zr as provideService$1, zs as forever$1, zt as make$64 } from "./Schema-B3i-HrZQ.mjs";
|
|
5
5
|
import { a as isQuitError, g as ChildProcessSpawner, h as make$76, i as Terminal$1, l as Crypto, n as layer$41, o as Stdio, r as QuitError, s as make$77, u as fromReadable } from "./NodeServices-DDZTiw5K.mjs";
|
|
6
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-Bj2ZPCsP.mjs";
|
|
7
7
|
import { c as getOption$1, d as make$78, f as makeWith$1, l as invalidate$1, n as SqlClient, p as set$4, s as get$7, u as keys } from "./SqlClient-DcM69ZvI.mjs";
|
|
8
8
|
import * as NodeChildProcess from "node:child_process";
|
|
9
9
|
import * as NodeCrypto from "node:crypto";
|
|
10
|
-
import { createCipheriv, createDecipheriv, hkdfSync, randomBytes } from "node:crypto";
|
|
10
|
+
import { createCipheriv, createDecipheriv, hkdfSync, randomBytes, randomUUID } from "node:crypto";
|
|
11
11
|
import * as NodeFS from "node:fs";
|
|
12
|
+
import { closeSync, mkdirSync, openSync, readFileSync, rmSync, writeSync } from "node:fs";
|
|
12
13
|
import * as NodeOS from "node:os";
|
|
13
14
|
import * as NodePath from "node:path";
|
|
15
|
+
import { join } from "node:path";
|
|
14
16
|
import { fileURLToPath } from "node:url";
|
|
15
17
|
import * as NodeReadline from "node:readline";
|
|
16
18
|
import { parse } from "yaml";
|
|
@@ -33275,7 +33277,7 @@ const probeEnvironmentDescriptor = (baseUrl) => gen(function* () {
|
|
|
33275
33277
|
descriptor: yield* filterStatusOk(response).pipe(flatMap$1(schemaBodyJson(ExecutionEnvironmentDescriptor)), mapError(() => ({ _tag: "not-a-t3-server" })))
|
|
33276
33278
|
};
|
|
33277
33279
|
}).pipe(catch_((outcome) => succeed$1(outcome)));
|
|
33278
|
-
const isProcessAlive = (pid) => {
|
|
33280
|
+
const isProcessAlive$1 = (pid) => {
|
|
33279
33281
|
try {
|
|
33280
33282
|
process.kill(pid, 0);
|
|
33281
33283
|
return true;
|
|
@@ -33298,7 +33300,7 @@ const discoverPairTarget = fn("pair.discoverPairTarget")(function* (explicitBase
|
|
|
33298
33300
|
checkedStatePaths.push(statePath);
|
|
33299
33301
|
const state = yield* readPersistedServerRuntimeState(statePath);
|
|
33300
33302
|
if (isNone(state)) continue;
|
|
33301
|
-
if (!isProcessAlive(state.value.pid)) continue;
|
|
33303
|
+
if (!isProcessAlive$1(state.value.pid)) continue;
|
|
33302
33304
|
const probed = yield* probeEnvironmentDescriptor(state.value.origin);
|
|
33303
33305
|
if (probed._tag !== "descriptor") continue;
|
|
33304
33306
|
return {
|
|
@@ -42910,6 +42912,56 @@ const projectCommand = make$59("project").pipe(withDescription("Manage projects.
|
|
|
42910
42912
|
projectRenameCommand
|
|
42911
42913
|
]));
|
|
42912
42914
|
//#endregion
|
|
42915
|
+
//#region src/daemonLock.ts
|
|
42916
|
+
const LOCK_FILE = "daemon.lock";
|
|
42917
|
+
function isProcessAlive(pid) {
|
|
42918
|
+
try {
|
|
42919
|
+
process.kill(pid, 0);
|
|
42920
|
+
return true;
|
|
42921
|
+
} catch (error) {
|
|
42922
|
+
return error.code === "EPERM";
|
|
42923
|
+
}
|
|
42924
|
+
}
|
|
42925
|
+
function readLock(path) {
|
|
42926
|
+
try {
|
|
42927
|
+
const record = JSON.parse(readFileSync(path, "utf8"));
|
|
42928
|
+
const pid = typeof record.pid === "number" ? record.pid : -1;
|
|
42929
|
+
return Number.isInteger(pid) && pid > 0 && typeof record.token === "string" ? {
|
|
42930
|
+
pid,
|
|
42931
|
+
token: record.token
|
|
42932
|
+
} : void 0;
|
|
42933
|
+
} catch {
|
|
42934
|
+
return;
|
|
42935
|
+
}
|
|
42936
|
+
}
|
|
42937
|
+
function acquireDaemonLock(stateDir) {
|
|
42938
|
+
mkdirSync(stateDir, { recursive: true });
|
|
42939
|
+
const path = join(stateDir, LOCK_FILE);
|
|
42940
|
+
const token = randomUUID();
|
|
42941
|
+
for (;;) try {
|
|
42942
|
+
const fd = openSync(path, "wx", 384);
|
|
42943
|
+
writeSync(fd, JSON.stringify({
|
|
42944
|
+
pid: process.pid,
|
|
42945
|
+
token
|
|
42946
|
+
}));
|
|
42947
|
+
let released = false;
|
|
42948
|
+
return () => {
|
|
42949
|
+
if (released) return;
|
|
42950
|
+
released = true;
|
|
42951
|
+
try {
|
|
42952
|
+
if (readLock(path)?.token === token) rmSync(path, { force: true });
|
|
42953
|
+
} finally {
|
|
42954
|
+
closeSync(fd);
|
|
42955
|
+
}
|
|
42956
|
+
};
|
|
42957
|
+
} catch (error) {
|
|
42958
|
+
if (error.code !== "EEXIST") throw error;
|
|
42959
|
+
const owner = readLock(path);
|
|
42960
|
+
if (owner && isProcessAlive(owner.pid)) throw new Error(`已有 AgentLink daemon 正在运行(pid ${owner.pid})。请先停止它再启动。`);
|
|
42961
|
+
rmSync(path, { force: true });
|
|
42962
|
+
}
|
|
42963
|
+
}
|
|
42964
|
+
//#endregion
|
|
42913
42965
|
//#region ../../node_modules/.pnpm/effect@4.0.0-beta.103_patch_hash=a18f963109656ddbeb2a99ca45f942ecf54830986259eb01ce6a970421c9c6a9/node_modules/effect/dist/unstable/httpapi/HttpApiBuilder.js
|
|
42914
42966
|
/**
|
|
42915
42967
|
* Registers an `HttpApi` with a `HttpRouter`.
|
|
@@ -51832,28 +51884,33 @@ const UNSUPPORTED_STREAM_METHODS = /* @__PURE__ */ new Set([
|
|
|
51832
51884
|
* failing `Effect` otherwise.
|
|
51833
51885
|
*/
|
|
51834
51886
|
const unsupportedRpc = (() => ((method) => UNSUPPORTED_STREAM_METHODS.has(method) ? fail$5(new UnsupportedRpcError({ method })) : new UnsupportedRpcError({ method })))();
|
|
51887
|
+
const wsRpcServices = gen(function* () {
|
|
51888
|
+
return {
|
|
51889
|
+
crypto: yield* Crypto,
|
|
51890
|
+
projectionSnapshotQuery: yield* ProjectionSnapshotQuery,
|
|
51891
|
+
orchestrationEngine: yield* OrchestrationEngineService,
|
|
51892
|
+
keybindings: yield* Keybindings,
|
|
51893
|
+
externalLauncher: yield* ExternalLauncher,
|
|
51894
|
+
providerRegistry: yield* ProviderRegistry,
|
|
51895
|
+
config: yield* ServerConfig,
|
|
51896
|
+
lifecycleEvents: yield* ServerLifecycleEvents,
|
|
51897
|
+
serverSettings: yield* ServerSettingsService,
|
|
51898
|
+
startup: yield* ServerRuntimeStartup,
|
|
51899
|
+
workspaceEntries: yield* WorkspaceEntries,
|
|
51900
|
+
workspaceFileSystem: yield* WorkspaceFileSystem,
|
|
51901
|
+
serverEnvironment: yield* ServerEnvironment,
|
|
51902
|
+
backgroundPolicy: yield* BackgroundPolicy,
|
|
51903
|
+
serverAuth: yield* EnvironmentAuth,
|
|
51904
|
+
bootstrapCredentials: yield* PairingGrantStore,
|
|
51905
|
+
sessions: yield* SessionStore
|
|
51906
|
+
};
|
|
51907
|
+
});
|
|
51835
51908
|
const makeWsRpcLayer = (currentSession) => WsRpcGroup.toLayer(gen(function* () {
|
|
51836
51909
|
const currentSessionId = currentSession.sessionId;
|
|
51837
|
-
const crypto = yield*
|
|
51838
|
-
const projectionSnapshotQuery = yield* ProjectionSnapshotQuery;
|
|
51839
|
-
const orchestrationEngine = yield* OrchestrationEngineService;
|
|
51840
|
-
const keybindings = yield* Keybindings;
|
|
51841
|
-
const externalLauncher = yield* ExternalLauncher;
|
|
51842
|
-
const providerRegistry = yield* ProviderRegistry;
|
|
51910
|
+
const { crypto, projectionSnapshotQuery, orchestrationEngine, keybindings, externalLauncher, providerRegistry, config, lifecycleEvents, serverSettings, startup, workspaceEntries, workspaceFileSystem, serverEnvironment, backgroundPolicy, serverAuth, bootstrapCredentials, sessions } = yield* wsRpcServices;
|
|
51843
51911
|
const providerMaintenanceRunner = yield* ProviderMaintenanceRunner;
|
|
51844
|
-
const config = yield* ServerConfig;
|
|
51845
|
-
const lifecycleEvents = yield* ServerLifecycleEvents;
|
|
51846
|
-
const serverSettings = yield* ServerSettingsService;
|
|
51847
|
-
const startup = yield* ServerRuntimeStartup;
|
|
51848
|
-
const workspaceEntries = yield* WorkspaceEntries;
|
|
51849
|
-
const workspaceFileSystem = yield* WorkspaceFileSystem;
|
|
51850
|
-
const serverEnvironment = yield* ServerEnvironment;
|
|
51851
|
-
const backgroundPolicy = yield* BackgroundPolicy;
|
|
51852
51912
|
const rpcClientIds = yield* make$60(/* @__PURE__ */ new Set());
|
|
51853
51913
|
yield* addFinalizer(() => get$3(rpcClientIds).pipe(flatMap$1((clientIds) => forEach(clientIds, (clientId) => backgroundPolicy.removeRpcClient(currentSessionId, clientId), { discard: true })), ignore$1));
|
|
51854
|
-
const serverAuth = yield* EnvironmentAuth;
|
|
51855
|
-
const bootstrapCredentials = yield* PairingGrantStore;
|
|
51856
|
-
const sessions = yield* SessionStore;
|
|
51857
51914
|
const authorizationError = (requiredScope) => new EnvironmentAuthorizationError({
|
|
51858
51915
|
message: `The authenticated token is missing required scope: ${requiredScope}.`,
|
|
51859
51916
|
requiredScope
|
|
@@ -52350,6 +52407,36 @@ function isEnvelope(value) {
|
|
|
52350
52407
|
//#endregion
|
|
52351
52408
|
//#region src/tunnel/bridge.ts
|
|
52352
52409
|
const TUNNEL_SCOPES = [AuthOrchestrationReadScope, AuthOrchestrationOperateScope];
|
|
52410
|
+
function machineIdFromToken(token) {
|
|
52411
|
+
const parts = token.split(".");
|
|
52412
|
+
if (parts.length !== 3 || parts[0] !== "al1" || !parts[1]) return null;
|
|
52413
|
+
try {
|
|
52414
|
+
const payload = JSON.parse(Buffer.from(parts[1], "base64url").toString("utf8"));
|
|
52415
|
+
return typeof payload.mid === "string" && payload.mid.length > 0 ? payload.mid : null;
|
|
52416
|
+
} catch {
|
|
52417
|
+
return null;
|
|
52418
|
+
}
|
|
52419
|
+
}
|
|
52420
|
+
function hubHttpUrl(hub) {
|
|
52421
|
+
const url = new URL(hub);
|
|
52422
|
+
url.protocol = url.protocol === "wss:" ? "https:" : "http:";
|
|
52423
|
+
url.pathname = "";
|
|
52424
|
+
url.search = "";
|
|
52425
|
+
url.hash = "";
|
|
52426
|
+
return url.toString().replace(/\/$/, "");
|
|
52427
|
+
}
|
|
52428
|
+
const uploadHubEnckey = (config) => gen(function* () {
|
|
52429
|
+
const machineId = machineIdFromToken(config.machineToken);
|
|
52430
|
+
if (!machineId) return yield* fail(/* @__PURE__ */ new Error("machine id is missing from the machine token"));
|
|
52431
|
+
const httpClient = yield* HttpClient;
|
|
52432
|
+
const request = yield* post$1(`${hubHttpUrl(config.hubUrl)}/api/machines/${encodeURIComponent(machineId)}/enckey`).pipe(setHeaders({
|
|
52433
|
+
authorization: `Bearer ${config.machineToken}`,
|
|
52434
|
+
"content-type": "application/json",
|
|
52435
|
+
"x-requested-with": "agentlink"
|
|
52436
|
+
}), bodyJson({ enckey: config.enckey }));
|
|
52437
|
+
yield* filterStatusOk(yield* httpClient.execute(request));
|
|
52438
|
+
return machineId;
|
|
52439
|
+
});
|
|
52353
52440
|
const hubFrameDecoder = new TextDecoder();
|
|
52354
52441
|
const ResponseDefectEncoded = (cause) => ({
|
|
52355
52442
|
_tag: "Defect",
|
|
@@ -52451,7 +52538,7 @@ const makeTunnelSocket = (input) => {
|
|
|
52451
52538
|
input.tunnel.onDecryptedFrame = deliver;
|
|
52452
52539
|
for (const frame of input.tunnel.pendingFrames.splice(0)) deliver(frame);
|
|
52453
52540
|
if (options?.onOpen) yield* options.onOpen;
|
|
52454
|
-
yield* _await(input.tunnel.closed).pipe(raceFirst(join(fiberSet)));
|
|
52541
|
+
yield* _await(input.tunnel.closed).pipe(raceFirst(join$1(fiberSet)));
|
|
52455
52542
|
}));
|
|
52456
52543
|
return make$63({
|
|
52457
52544
|
runRaw,
|
|
@@ -52463,11 +52550,25 @@ const makeTunnelSocket = (input) => {
|
|
|
52463
52550
|
const runHubTunnel = (config) => gen(function* () {
|
|
52464
52551
|
const serverAuth = yield* EnvironmentAuth;
|
|
52465
52552
|
const sessionsStore = yield* SessionStore;
|
|
52553
|
+
const serverConfig = yield* ServerConfig;
|
|
52554
|
+
const httpClient = yield* HttpClient;
|
|
52555
|
+
yield* wsRpcServices.pipe(asVoid);
|
|
52556
|
+
yield* ChildProcessSpawner;
|
|
52466
52557
|
yield* retry(gen(function* () {
|
|
52467
52558
|
yield* logInfo("hub tunnel: connection effect entered");
|
|
52468
52559
|
const url = `${config.hubUrl.replace(/\/+$/, "")}/daemon-tunnel?token=${encodeURIComponent(config.machineToken)}&v=1`;
|
|
52469
52560
|
yield* logInfo("hub tunnel: connecting", { hubUrl: config.hubUrl });
|
|
52470
52561
|
const socket = yield* makeWebSocket(url).pipe(provide$1(layerWebSocketConstructor));
|
|
52562
|
+
const upload = gen(function* () {
|
|
52563
|
+
const machineId = machineIdFromToken(config.machineToken);
|
|
52564
|
+
if (!machineId) {
|
|
52565
|
+
yield* logWarning$1("[daemon] enckey upload skipped: machine id missing from token");
|
|
52566
|
+
return;
|
|
52567
|
+
}
|
|
52568
|
+
yield* logInfo(`[daemon] uploading enckey for machine ${machineId}...`);
|
|
52569
|
+
yield* uploadHubEnckey(config);
|
|
52570
|
+
yield* logInfo("[daemon] enckey uploaded to hub for cross-device recovery");
|
|
52571
|
+
}).pipe(provideService(HttpClient, httpClient), catch_((error) => logError(`[daemon] enckey upload failed: ${String(error)}`)), asVoid);
|
|
52471
52572
|
yield* addFinalizer((exit) => logInfo("hub tunnel: connection scope closing", { exit: String(exit) }));
|
|
52472
52573
|
const tunnels = /* @__PURE__ */ new Map();
|
|
52473
52574
|
const dropTunnel = (tunnelId) => {
|
|
@@ -52511,12 +52612,16 @@ const runHubTunnel = (config) => gen(function* () {
|
|
|
52511
52612
|
}
|
|
52512
52613
|
});
|
|
52513
52614
|
const { protocol, onSocket } = yield* makeTunnelSocketProtocol.pipe(provide$1(layerJson));
|
|
52514
|
-
yield*
|
|
52515
|
-
|
|
52516
|
-
|
|
52517
|
-
|
|
52518
|
-
|
|
52519
|
-
|
|
52615
|
+
yield* forkScoped(gen(function* () {
|
|
52616
|
+
const currentContext = yield* context();
|
|
52617
|
+
const rpcContext = yield* build(makeWsRpcLayer({
|
|
52618
|
+
sessionId: issued.sessionId,
|
|
52619
|
+
subject: "hub-tunnel",
|
|
52620
|
+
method: "bearer-access-token",
|
|
52621
|
+
scopes: [...TUNNEL_SCOPES]
|
|
52622
|
+
}).pipe(provideMerge(layerJson), provide(layer$8))).pipe(provideContext(currentContext));
|
|
52623
|
+
yield* make$13(WsRpcGroup, { disableTracing: true }).pipe(provideService(Protocol, protocol), provideContext(rpcContext));
|
|
52624
|
+
}).pipe(tapCause((cause) => logError("hub tunnel: RPC server failed", { cause: String(cause) }))));
|
|
52520
52625
|
yield* forkScoped(onSocket(socketAdapter));
|
|
52521
52626
|
if (!writeHub(JSON.stringify({
|
|
52522
52627
|
type: "tunnel_open",
|
|
@@ -52549,8 +52654,6 @@ const runHubTunnel = (config) => gen(function* () {
|
|
|
52549
52654
|
});
|
|
52550
52655
|
yield* addFinalizer(() => sessionsStore.markDisconnected(issued.sessionId).pipe(andThen(serverAuth.revokeSession(issued.sessionId)), ignore$1));
|
|
52551
52656
|
yield* sessionsStore.markConnected(issued.sessionId);
|
|
52552
|
-
const serverConfig = yield* ServerConfig;
|
|
52553
|
-
const httpClient = yield* HttpClient;
|
|
52554
52657
|
const localBaseUrl = `http://127.0.0.1:${serverConfig.port}`;
|
|
52555
52658
|
const sendEncrypted = (frame) => {
|
|
52556
52659
|
try {
|
|
@@ -52630,7 +52733,7 @@ const runHubTunnel = (config) => gen(function* () {
|
|
|
52630
52733
|
purpose: live.purpose
|
|
52631
52734
|
});
|
|
52632
52735
|
yield* _await(live.closed);
|
|
52633
|
-
}).pipe(catch_((error) => logWarning$1("hub tunnel: attach failed", {
|
|
52736
|
+
}).pipe(provideService(HttpClient, httpClient), catch_((error) => logWarning$1("hub tunnel: attach failed", {
|
|
52634
52737
|
tunnelId,
|
|
52635
52738
|
error
|
|
52636
52739
|
})));
|
|
@@ -52657,7 +52760,8 @@ const runHubTunnel = (config) => gen(function* () {
|
|
|
52657
52760
|
onDecryptedFrame: null
|
|
52658
52761
|
};
|
|
52659
52762
|
tunnels.set(tunnelId, live);
|
|
52660
|
-
|
|
52763
|
+
if (purpose === "http") yield* forkScoped(scoped(attachHttpTunnel(tunnelId, live)));
|
|
52764
|
+
else yield* forkScoped(scoped(attachRpcTunnel(tunnelId, live)));
|
|
52661
52765
|
});
|
|
52662
52766
|
}
|
|
52663
52767
|
if (control.type === "tunnel_close" && typeof control.tunnelId === "string") dropTunnel(control.tunnelId);
|
|
@@ -52685,7 +52789,7 @@ const runHubTunnel = (config) => gen(function* () {
|
|
|
52685
52789
|
else dropTunnel(framed.tunnelId);
|
|
52686
52790
|
return;
|
|
52687
52791
|
}
|
|
52688
|
-
}, { onOpen: logInfo("hub tunnel: connected to hub") }).pipe(tapDefect((cause) => logWarning$1("hub tunnel: hub socket defect", { cause: String(cause) })));
|
|
52792
|
+
}, { onOpen: logInfo("hub tunnel: connected to hub").pipe(tap(() => sync(() => void runFork(upload)))) }).pipe(tapDefect((cause) => logWarning$1("hub tunnel: hub socket defect", { cause: String(cause) })));
|
|
52689
52793
|
yield* logWarning$1("hub tunnel: hub connection closed");
|
|
52690
52794
|
}).pipe(scoped, tapError((error) => logWarning$1("hub tunnel: connection error", { error }))), {
|
|
52691
52795
|
schedule: spaced("2 seconds"),
|
|
@@ -84673,7 +84777,7 @@ const make$3 = (options) => gen(function* () {
|
|
|
84673
84777
|
status: "started"
|
|
84674
84778
|
});
|
|
84675
84779
|
const idleFiber = yield* waitForSessionLoadReplayIdle({ gateRef: sessionLoadGateRef }).pipe(forkIn(runtimeScope));
|
|
84676
|
-
return yield* raceFirst(acp.agent.loadSession(loadPayload), join$
|
|
84780
|
+
return yield* raceFirst(acp.agent.loadSession(loadPayload), join$2(idleFiber)).pipe(ensuring(interrupt$4(idleFiber).pipe(ignore$1)), timeoutOption(sessionLoadTimeout), flatMap$1((result) => match$1(result, {
|
|
84677
84781
|
onNone: () => fail(new AcpTransportError({
|
|
84678
84782
|
operation: "call-rpc",
|
|
84679
84783
|
method: "session/load",
|
|
@@ -84768,7 +84872,7 @@ const make$3 = (options) => gen(function* () {
|
|
|
84768
84872
|
const cancelledResponse = { stopReason: "cancelled" };
|
|
84769
84873
|
const promptRpcFiber = yield* runLoggedRequest("session/prompt", requestPayload, acp.agent.prompt(requestPayload)).pipe(forkIn(runtimeScope));
|
|
84770
84874
|
yield* set$2(activePromptFiberRef, some(promptRpcFiber));
|
|
84771
|
-
return yield* join$
|
|
84875
|
+
return yield* join$2(promptRpcFiber).pipe(catchCause((cause) => hasInterruptsOnly(cause) ? succeed$1(cancelledResponse) : failCause$1(cause)), ensuring(gen(function* () {
|
|
84772
84876
|
yield* interrupt$4(promptRpcFiber).pipe(ignore$1);
|
|
84773
84877
|
yield* set$2(activePromptFiberRef, none());
|
|
84774
84878
|
})), tap(() => closeActiveAssistantSegment({
|
|
@@ -89531,13 +89635,17 @@ const runServer = launch(unwrap(gen(function* () {
|
|
|
89531
89635
|
...config.tailscaleServeEnabled ? [_await(tailscaleParked)] : []
|
|
89532
89636
|
], { concurrency: "unbounded" }).pipe(asVoid)
|
|
89533
89637
|
}).pipe(provideMerge(RuntimeDependenciesLive));
|
|
89534
|
-
return mergeAll(serve(makeRoutesLayer, { disableLogger: !config.logWebSocketEvents }).pipe(tap$1(() => succeed$4(routesReady, void 0).pipe(orDie))), httpListeningLayer, runtimeStateLayer, tailscaleServeLayer, config.hubTunnel ? layer$4(config.hubTunnel) : empty$8).pipe(provideMerge(runtimeServicesLive), provide(activationLayer), provideMerge(HttpServerLive), provide(ApplicationObservabilityLive), provideMerge(layer$40), provideMerge(PlatformServicesLive));
|
|
89638
|
+
return mergeAll(serve(makeRoutesLayer, { disableLogger: !config.logWebSocketEvents }).pipe(tap$1(() => succeed$4(routesReady, void 0).pipe(orDie))), httpListeningLayer, runtimeStateLayer, tailscaleServeLayer, config.hubTunnel ? layer$4(config.hubTunnel).pipe(provideMerge(runtimeServicesLive)) : empty$8).pipe(provideMerge(runtimeServicesLive), provide(activationLayer), provideMerge(HttpServerLive), provide(ApplicationObservabilityLive), provideMerge(layer$40), provideMerge(PlatformServicesLive));
|
|
89535
89639
|
})));
|
|
89536
89640
|
//#endregion
|
|
89537
89641
|
//#region src/cli/server.ts
|
|
89538
89642
|
const runServerCommand = (flags, options) => gen(function* () {
|
|
89539
89643
|
const config = yield* resolveServerConfig(flags, yield* LogLevel, options);
|
|
89540
|
-
|
|
89644
|
+
const releaseDaemonLock = yield* try_({
|
|
89645
|
+
try: () => acquireDaemonLock(config.stateDir),
|
|
89646
|
+
catch: (error) => error instanceof Error ? error : new Error(String(error))
|
|
89647
|
+
});
|
|
89648
|
+
return yield* runServer.pipe(provideService(ServerConfig, config), ensuring(sync(releaseDaemonLock)));
|
|
89541
89649
|
});
|
|
89542
89650
|
const startCommand = make$59("start", { ...sharedServerCommandFlags }).pipe(withDescription("Run the T3 Code server."), withHandler((flags) => runServerCommand(flags)));
|
|
89543
89651
|
const serveCommand = make$59("serve", { ...sharedServerCommandFlags }).pipe(withDescription("Run the T3 Code server without opening a browser."), withHandler((flags) => runServerCommand(flags, {
|