@webinson/peer-core 0.1.973 → 0.1.975
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 +1 -1
- package/dist/bin.mjs +7 -5
- package/dist/{binCli-CJdI8Zct.mjs → binCli-CwrAHPco.mjs} +475 -86
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -16,4 +16,4 @@ peer core serve --detach # or let the editor start it on demand
|
|
|
16
16
|
`peer core status` says who runs Peer here; `peer core stop` stops Peer Core. The Peer desktop app,
|
|
17
17
|
when it starts, takes coordination over. Any other `peer <command>` goes to the running Peer.
|
|
18
18
|
|
|
19
|
-
Version 0.1.
|
|
19
|
+
Version 0.1.975 of Peer Local (https://github.com/SemanS/peer-app, branch `peer`), based on T3 Code.
|
package/dist/bin.mjs
CHANGED
|
@@ -43,7 +43,7 @@ if (isEntrypoint({
|
|
|
43
43
|
if (npmPeerBin) {
|
|
44
44
|
const coreBin = /^peer-core/.test(NodePath.basename(process.argv[1] ?? ""));
|
|
45
45
|
const [first, ...rest] = process.argv.slice(2);
|
|
46
|
-
const args = first === "core" ? rest : coreBin || first !== void 0 && (/* @__PURE__ */ new Set([
|
|
46
|
+
const args = first === "--help" || first === "-h" || first === "help" ? ["--help"] : first === "core" ? rest : coreBin || first !== void 0 && (/* @__PURE__ */ new Set([
|
|
47
47
|
"login",
|
|
48
48
|
"join",
|
|
49
49
|
"logout",
|
|
@@ -54,7 +54,9 @@ if (isEntrypoint({
|
|
|
54
54
|
"hooks",
|
|
55
55
|
"bind",
|
|
56
56
|
"tasks",
|
|
57
|
-
"take"
|
|
57
|
+
"take",
|
|
58
|
+
"create",
|
|
59
|
+
"invite"
|
|
58
60
|
])).has(first) ? [first ?? "status", ...rest] : [
|
|
59
61
|
"run",
|
|
60
62
|
"--",
|
|
@@ -64,7 +66,7 @@ if (isEntrypoint({
|
|
|
64
66
|
process.argv = [
|
|
65
67
|
process.argv[0],
|
|
66
68
|
NodeFS.realpathSync(process.argv[1]),
|
|
67
|
-
"
|
|
69
|
+
"core",
|
|
68
70
|
...args
|
|
69
71
|
];
|
|
70
72
|
}
|
|
@@ -75,8 +77,8 @@ if (isEntrypoint({
|
|
|
75
77
|
} else {
|
|
76
78
|
const { attachConsoleStdin } = await import("./consoleStdin-DO-vIhyg.mjs");
|
|
77
79
|
attachConsoleStdin();
|
|
78
|
-
const { runCli } = await import("./binCli-
|
|
79
|
-
runCli();
|
|
80
|
+
const { runCli } = await import("./binCli-CwrAHPco.mjs");
|
|
81
|
+
runCli(npmPeerBin ? "peer" : "t3");
|
|
80
82
|
}
|
|
81
83
|
}
|
|
82
84
|
//#endregion
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
import { i as __toESM, n as __exportAll, r as __require, t as __commonJSMin } from "./rolldown-runtime-1CwlsFOK.mjs";
|
|
4
4
|
import { $r as isEmpty, A as NullOr, Ar as fromInput$1, B as String$6, C as Literals$2, Cn as inetAddressFromIpString, Cr as Forbidden$1, Ct as decodeUnknownSync, Di as toEpochMillis, E as Never, Ei as toDate, En as unixPathAddress, Et as encodeSync, Fi as Class, Gt as isNonEmpty, H as Struct, Hr as merge, I as Record, Ir as CurrentRedactedNames, J as TrueLiterals, Jr as value, Jt as isSchemaError, Li as TaggedClass, Nr as toRecord, Nt as is, On as assign, Ot as encodeUnknownEffect, Ri as TaggedError$1, Rr as fromInput, S as Literal, Tt as encodeEffect, W as TaggedError, Xr as empty, Y as Tuple, Yn as isNull, Z as URLFromString, Zr as expireCookie, _ as Finite, _i as makeUnsafe, a as BooleanLiterals, ai as decodeString, bt as decodeUnknownExit, c as DateTimeUtc, d as Duration, di as formatIso, dn as toCodecStringTree, dr as transformEffect, fi as isGreaterThan, ft as declare, g as FalseLiterals, gi as make$65, gn as toType, ht as decodeExit, ii as decode, ir as toEncoded, j as Number$2, jr as redactUrl, jt as fromJsonString, k as Null, ki as toUtc, l as DateTimeUtcFromString, li as add, ln as toCodecArrayFromSingle, mi as isLessThan, mt as decodeEffect, n as ArraySchema, ni as set, nn as optional$3, nt as Union, o as Cause, oi as encode, pi as isGreaterThanOrEqualTo, pn as toEquivalence, qr as make$64, qt as isSchema, r as Boolean$4, ri as toSetCookieHeaders, rn as optionalKey, rt as Unknown, si as Equivalence, ti as parseHeader, u as Defect, un as toCodecJson, v as FiniteFromString, vt as decodeTo, wr as InvalidValue$1, xt as decodeUnknownOption, y as Int$5, yi as now, yt as decodeUnknownEffect, z as SchemaError, zi as taggedEnum, zr as fromRecordUnsafe } from "./Schema-Eq619wkO.mjs";
|
|
5
|
-
import { $ as forEach, $i as hasInterrupts, $t as runPromise, Ai as isSuccess, Ar as empty$3, As as findFirst, At as matchEffect, B as filter
|
|
5
|
+
import { $ as forEach, $i as hasInterrupts, $t as runPromise, Ai as isSuccess, Ar as empty$3, As as findFirst, At as matchEffect, B as filter, Bc as Number$3, Bn as withTracerEnabled, Bo as fromInput$2, Br as tap$1, Bt as promise, C as catchTag, Cc as getOrElse, Cn as tryPromise, Cu as dual, D as context, Dc as isNone, Dl as assignProperty, Dr as effect, Ds as ensure, Dt as match$2, Ec as getOrUndefined, Es as empty$1, Et as mapErrorEager, Eu as memoize, F as exit, Fc as orElse, Fl as equals, Fn as withErrorReporting, Fr as provideMerge, G as findFirst$1, Gi as fail$4, Gr as close, Gs as match$1, Hi as combine$1, Hn as zip, Ho as hours, Hr as Scope, Ht as provideContext, I as fail$2, Ic as some, In as withFiber$1, Ir as succeed$3, It as option, Ji as findErrorOption, Jl as compose, Jr as forkUnsafe, Kt as raceFirst, L as failCause, Lc as toArray, Lt as orDie, M as die, Mc as map$4, Mn as void_, Mo as encode$1, Mr as merge$1, Ms as findLast, Mt as onError, Nc as match, Ni as void_$1, Nr as mergeAll, Ns as flatMapNullishOr, Nt as onExit, On as uninterruptible, Oo as Tracer, Or as effectContext, Os as filter$2, Ot as matchCauseEffect, Ou as pipe, P as ensuring, Pc as none$1, Pr as provide$1, Qa as fnUntraced, Qo as minutes$1, Qr as CurrentLogAnnotations, Qt as runForkWith, Rn as withParentSpan, Ro as days, Rt as orElseSucceed, S as catchReason, Sc as fromUndefinedOr, Sn as timeoutOrElse, Ss as Prototype, St as map$3, T as catch_, Tc as getOrThrow$1, To as MinimumTraceLevel, Tt as mapError, Tu as identity, Ui as die$1, Un as zipWith, Uo as infinity, Ur as addFinalizer, Ut as provideService, Vn as yieldNow, Vo as fromInputUnsafe, Vr as unwrap, Vt as provide, W as filterOrFail, Wr as addFinalizerExit, Ws as map$5, X as fn, Xi as fromReasons, Xo as millis, Xt as retry, Yl as hasProperty, Yr as make$69, Ys as sort, Yt as result, Z as fnUntraced$1, Zo as min, Zr as provide$2, Zt as runFork, _ as catchCauseIf, _c as firstSomeOf, _i as make$68, _o as sync, _s as getUnsafe, a as all, ac as getOrUndefined$1, ai as UnhandledLogLevel, an as scoped, as as toMinutes, b as catchFilter, ba as ConsoleRef, bi as succeed$4, bn as timeout, bs as merge$2, bt as logWithLevel, c as annotateLogs, cc as isSuccess$1, ci as done, cl as isEffect, cn as serviceOption, cr as jittered, cs as Reference, ct as ignore, d as asSome, di as failCause$1, dl as withFiber, dn as succeedNone, ds as empty$2, dt as interruptible, du as isTagged, ea as hasInterruptsOnly, ei as CurrentLogSpans, en as runPromiseWith, et as forever, f as asVoid, fc as succeed$2, fn as succeedSome, fr as spaced, ft as isEffect$1, g as catchCause, ga as prettyErrors, gc as filter$1, gn as tapCause, gt as logError, gu as cast, h as callback, ha as pretty, hc as exists$1, hi as isDone, hl as Class$1, hn as tap, hr as upTo, ht as logDebug, i as addFinalizer$1, ic as getOrThrow, ii as TracerTimingEnabled, in as scope, is as toMillis, it as forkScoped, j as delay, ji as match$3, jr as launch, js as findFirstIndex, jt as never, ju as pipeArguments, k as currentParentSpan, ka as consolePretty$1, kc as isSome, ki as isFailure, kr as effectDiscard, ks as filterMap, l as annotateLogsScoped, ln as sleep$1, lr as modifyDelay, ls as Service, lt as ignoreCause, mc as contains, mn as sync$1, mt as log$1, n as acquireRelease, nc as failVoid, ni as MinimumLogLevel, nn as runSyncExit, ns as sum, nt as forkDetach, o as andThen, oc as isFailure$1, oi as _await, ot as fromResult, ou as isObject, p as cached, pn as suspend, q as flatMap$1, qc as make$67, qs as reduce, qt as repeat, r as acquireUseRelease, ri as TracerEnabled, rn as runSyncWith, ro as loggerMake, rr as exponential, rt as forkIn, ru as isNotUndefined, s as annotateCurrentSpan, si as die$2, ss as zero, st as gen$1, tc as fail$3, tn as runSync, ts as seconds, tu as isNotNull, u as as, ui as fail$5, un as succeed$1, us as add$1, ut as interrupt, v as catchDefect, va as squash, vc as flatMap$2, vi as makeUnsafe$1, vl as format, vn as tapError, vo as tracerLogger$1, vs as make$66, vt as logInfo, w as catchTags, wc as getOrNull, wn as try_, wr as build, wu as flow, x as catchIf, xa as CurrentLoggers$1, xc as fromNullishOr, xn as timeoutOption, xs as omit, xu as constVoid, yc as flatten, ys as makeUnsafe$2, yt as logWarning, zn as withSpan, zo as format$1, zr as sync$2, zs as isReadonlyArrayNonEmpty, zt as partition } from "./Effect-DXlc4A9S.mjs";
|
|
6
6
|
import { $ as SecretRequests, $a as make$79, $c as projectThreadProjectionForWire, $d as PREVIEW_STREAM_HOST_SETUP_CLOSE_CODE, $f as DESKTOP_UPDATE_RESTART_MARKER_FILE, $g as isWithHeadersValue, $h as setHeaders$1, $i as layer$151, $l as layer$98, $m as makeConfig, $n as codexAuthorizationRequest, $o as layer$101, $r as firstNonEmptyLine, $s as decodeRuntimeConfig, $t as layer$122, $u as PREVIEW_AUTOMATION_SERVER_OPERATIONS, A as layer$184, A_ as RuntimeRequestId, Aa as layerFromStores, Ac as none$2, Ad as EDITORS$1, Af as URL$1, Ag as AuthOrchestrationReadScope, Ah as removeHeader, Ai as restartContinuationNote, Al as bufferLiveStream, Am as get, An as layer$132, Ao as coordSocketPath, Ap as ORCHESTRATION_V2_WS_METHODS, Ar as NoOpProviderEventLoggers, As as DesktopTelemetryReceiver, At as RELAY_HOOK_DELIVERY_TYP, Au as resolveSpawnCommand, B as coreLayer, Ba as forkParked, Bc as buildBoundedThreadProjection, Bd as ClaudeSettings, Bf as make$80, Bg as EnvironmentAuthorizationError, Bh as TypeId$4, Bi as historyCost, Bl as SERVICE_STOP_MARKER_FILE, Bm as compression$1, Bn as layer$162, Bo as withRelayClientTracing, Bp as isOrchestrationV2WorkActive, Br as PtyAdapter, Bs as toArrayBuffer, Bt as ThreadTranscriptTooLargeError, Bu as newestCliReleaseVersion, C as stateStream, C_ as PositiveInt, Ca as layer$117, Cc as parsePersistedServerObservabilitySettings, Cd as OrchestrationSearchThreadsError, Cf as ConfigError, Cg as AuthFilesystemWriteScope, Ch as file, Ci as isRestartContinuationSource, Cl as EventStoreV2, Cm as use, Cn as layer$171, Co as run$4, Cp as RelayHookDeliveryProofPayload, Cr as hostPreviewMimeTypeFromExtension, Cs as layerIdentity, Ct as idFromName, Cu as collectUint8StreamText, D as PreviewAutomationBroker, D_ as ProviderTurnId, Da as deriveThreadFromProviderThread, Dc as fromLenientJson, Dd as EnvironmentThemeId, Df as Port, Dg as AuthMcpRegistrationError, Dh as mergeCookies, Di as neverStarted, Dl as layer$108, Dm as filterStatusOk$1, Dn as ProviderRegistry, Do as mergeProviderInstanceEnvironment, Dp as RelayProtectedError, Dr as endOrphanedNativeSubagent, Ds as layer$200, Dt as RELAY_HEALTH_REQUEST_TYP, Du as readEnvironmentFromLoginShell, E as layer$197, E_ as ProviderThreadId, Ea as IdAllocatorV2, Ec as fromJsonStringPretty, Ed as EnvironmentThemeFile, Ef as NonEmptyString, Eg as AuthMcpClientAccess, Eh as jsonUnsafe, Ei as mergeRestartCancelledBackgroundWork, El as OrchestrationEventStore, Em as HttpClient, En as layer$168, Eo as resolveCodexHomeLayout, Ep as RelayOkResponse, Er as makeUnavailableUsageLimits, Es as ServiceLauncherClient, Et as getOrCreateEnvironmentKeyPairFromSecretStore, Eu as mergePathEntries, F as issueAttachmentUploadUrl, F_ as encode$2, Fa as PROCESS_BOUND_EFFECT_TYPES, Fc as ProjectionStoreV2, Fd as ExternalLauncherUnsupportedEditorError, Ff as schema, Fg as AuthSettingsWriteScope, Fh as text$1, Fi as attachmentTokenAllowance, Fl as layer$94, Fm as update, Fn as layer$153, Fo as EXIT_STATUS, Fp as OrchestrationV2GetThreadProjectionError, Fr as layerJson, Fs as layer$144, Ft as normalizeRelayIssuer, Fu as ChildProcessSpawner, G as peerPlugins, Ga as layer$106, Gc as createDeterministicAttachmentId, Gd as DEFAULT_SERVER_SETTINGS, Gg as getResponseEncodingSchema, Gh as bodyJsonUnsafe, Gi as layer$129, Gl as serviceStateActiveVersion, Gm as schemaCookies, Gn as layer$191, Go as PreviewBrowserLibrariesError, Gp as ProjectListEntriesError, Gr as layer$137, Gs as CLOUD_LINK_REVOKED, Gt as layer$128, Gu as RpcScopeAuthorization, H as rpcLayer, Ha as layerFromApplicationReceipts, Hc as PENDING_ATTACHMENT_THREAD_SEGMENT, Hd as DATABASE_COMPACTION_RECOMMENDED_BYTES, Hf as set$3, Hg as authScopeRequiredResponse, Hh as schemaBodyJson, Hi as renderHistory, Hl as decodeServiceLauncherChildMessage, Hm as HttpServerRequest, Hn as layer$157, Ho as APPARMOR_PROFILE_PATH, Hp as ToolActivityNativeAppReference, Hr as layer$190, Hs as CLOUD_ENDPOINT_CONFIRMED_ORIGIN, Ht as layerWithLegacyImporter, Hu as layer$99, I as storeAttachmentUpload, I_ as snapshotUnsafe, Ia as REPLAY_SAFE_EFFECT_TYPES_AFTER_PROCESS_LOSS, Ic as layer$96, Id as ExternalLauncherUnsupportedTargetError, If as withDefault$2, Ig as AuthSourceControlWriteScope, Ih as uint8Array$1, Ii as contextUsageForHandoff, Il as readOnly, Im as updateAndGet, In as PortDiscovery, Io as make$76, Ip as OrchestrationV2ProviderSessionJson, Ir as AcpRegistryCatalog, Is as redactServerSettingsForClient, It as signRelayJwt, Iu as CLI_RELEASE_BASE_URL_ENV, J as WEBHOOK_ROUTE_PREFIX, Ja as checkoutKind, Jc as parseBase64DataUrl, Jd as ServerSettingsPatch, Jf as resolveBrowserProfiles, Jg as getWithHeadersAnnotation, Jh as del, Ji as layer$119, Jl as ensurePinnedRuntimeInstalled, Jm as toURL, Jn as layer$160, Jo as diagnoseLaunchFailure, Jp as ProjectReadFileError, Jr as BUILT_IN_SOURCE_CONTROL_DRIVERS, Js as PUBLISH_AGENT_ACTIVITY_SECRET, Jt as layerFromProjectStore, Ju as WsT3RpcGroup, K as ScheduledTaskService, Ka as realpathOrSelf$2, Kc as parseAttachmentFileExtension, Kd as ServerSettings, Kg as getStatusErrorSchema, Kh as bodyStream, Ki as CheckpointServiceV2, Kl as serviceStateHasPendingUpdate, Km as schemaHeaders, Kn as layer$192, Ko as PreviewBrowserSandboxError, Kp as ProjectMutation, Kr as SourceControlProviderRegistry, Ks as CLOUD_MINT_PUBLIC_KEY, Kt as layer$131, Ku as WS_METHODS, L as validateAttachmentUploadToken, L_ as update$1, La as layer$111, Lc as InvalidThreadHistoryCursorError, Ld as ProviderSetupError, Lf as SourceError, Lg as AuthStandardClientScopes, Lh as urlParams, Li as handoffBudget, Ll as SERVICE_LAUNCHER_CONTEXT_ENV, Lm as appendPreResponseHandler, Ln as layer$176, Lo as RelayClientTracer, Lp as OrchestrationV2SearchThreadError, Lr as layerFromHost, Ls as decode$2, Lt as verifyRelayJwt, Lu as CLI_RELEASE_CHANNELS, M as launchThread, M_ as TurnItemId, Ma as ProjectStoreV2, Mc as NetService, Md as ExternalLauncherCommandNotFoundError, Mf as map$6, Mg as AuthProvidersManageScope, Mh as setHeader, Mi as ContextHandoffServiceV2, Ml as findAll, Mm as make$71, Mn as layer$177, Mo as readOwner, Mp as OrchestrationV2AppThreadJson, Mr as Protocol, Ms as writeAllToFileDescriptor, Mt as RELAY_MANAGED_TUNNEL_RECOVERY_TYP, Mu as setWindowsPath, N as ATTACHMENT_UPLOAD_ROUTE_PREFIX, N_ as decode$1, Na as layer$110, Nc as layer$180, Nd as ExternalLauncherEditorSpawnError, Nf as mapEffect$1, Ng as AuthRelayReadScope, Nh as setHeaders, Ni as layer$120, Nl as findOneOption, Nm as modify, Nn as NativeTelemetryClient, No as requestHandover, Np as OrchestrationV2DispatchCommandError, Nr as make$81, Ns as subscribeBeforeSnapshot, Nt as RELAY_MINT_REQUEST_TYP, Nu as withPathDirectoryListings, O as layer$198, O_ as RpcClientId, Oa as layer$115, Oc as layerResourceAttributes, Od as ServerProviderUpdateError, Of as Redacted, Og as AuthMcpTokenError, Oh as raw$1, Oi as pendingRestartCancelledBackgroundWork, Ol as PersistenceDecodeError, Om as mapRequest, On as layer$185, Oo as expandHomePath$1, Op as fromApi, Or as endRunlessRootTurns, Os as runServicePreflight, Ot as RELAY_HEALTH_RESPONSE_TYP, Ou as readPathFromLaunchctl, P as deletePendingAttachment, P_ as decodeString$1, Pa as EffectOutboxV2, Pc as ProjectionStoreThreadNotFoundError, Pd as ExternalLauncherUnknownEditorError, Pf as option$1, Pg as AuthRelayWriteScope, Ph as stream$2, Pi as DEFAULT_HANDOFF_TOKEN_CAP, Pl as void_$2, Pm as set$2, Pn as layer$152, Po as waitForSocketGone, Pp as OrchestrationV2GetShellSnapshotError, Pr as makeProtocolWithHttpEffectWebsocket, Ps as ServerSettingsService, Pt as RELAY_MINT_RESPONSE_TYP, Pu as make$72, Q as layer$138, Qa as workspaceNameForRef, Qc as projectDomainEventForWire, Qd as FILL_PREVIEW_VIEWPORT, Qf as DesktopBrowserEvent, Qg as isWithHeaders, Qh as setHeader$1, Qi as layer$150, Ql as ProcessRunner, Qm as limitsServices, Qn as makeCodexChatGptAuth, Qo as layer$103, Qp as DEFAULT_PROVIDER_INTERACTION_MODE, Qr as detailFromCause, Qs as decodeConfirmedOrigin, Qt as CommandOutputHub, Qu as UsageReadError, R as PreviewManager, R_ as withAttributes, Ra as layerPruneWorker, Rc as THREAD_HISTORY_PAGE_POLICY, Rd as ProviderUploadFeedbackError, Rf as get$1, Rg as AuthTerminalOperateScope, Rh as filterStatusOk, Ri as handoffTokenCapConfig, Rl as SERVICE_RESTART_PENDING_FILE, Rm as toHandled, Rn as deriveProviderInstanceConfigMap, Ro as layer$104, Rp as OrchestrationV2ThreadLaunchError, Rr as toAcpRegistryOperationError, Rs as fromReadable, Rt as makeDrainableWorker, Ru as cliReleaseChannelOf, S as layer$179, S_ as PortSchema, Sa as ThreadCommandExecutor, Sc as version, Sd as FilesystemBrowseError, Sf as Boolean$5, Sg as AuthFilesystemReadScope, Sh as empty$4, Si as isAwaitedWork, Sl as sourceControlRepositorySelector, Sm as serve, Sn as GitWorkflowService, So as parseOriginUrlFromGitConfig, Sp as RelayEnvironmentLinkResponse, Sr as audioMimeTypeFromExtension, Ss as layer$182, St as PeerWorkspaces, Su as modelSelectionsEqual, T as PreviewBrowser, T_ as ProviderSessionId, Ta as layer$113, Tc as decodeJsonResult, Td as GitCommandError, Tf as LogLevel$1, Tg as AuthMcpApprovalError, Th as isHttpServerResponse, Ti as isRestartNoteSource, Tl as layerFromOrchestrationEventStore, Tm as make$75, Tn as GitManager, To as withoutCredentials, Tp as RelayManagedEndpointRecoveryResponse, Tr as isWorkspacePreviewEntryPath, Ts as layer$199, Tt as layer$183, Tu as listLoginShellCandidates, U as PeerAdapters, Ua as layer$109, Uc as attachmentRelativePath, Ud as DEFAULT_AUTOMATIC_GIT_FETCH_INTERVAL, Uf as nextIntBetween, Ug as authScopeResponse, Uh as bearerToken, Ui as selectHistory, Ul as isExactServiceVersion, Um as ParsedSearchParams, Un as layer$155, Uo as DEBIAN_PACKAGES, Up as UsageLimitSourceError, Ur as withWorkspaceLease, Us as CLOUD_ENDPOINT_RUNTIME_CONFIG, Ut as withCreationProvenance, Uu as CLIENT_GUARDED_RPC_SCOPES, V as layer$105, Va as forkParkedFiber, Vc as decodeThreadHistoryCursor, Vd as CodexSettings, Vf as makeWith, Vg as ServerAuthSessionMethod, Vh as inspect$1, Vi as latestNativeContextUsage, Vl as compareExactServiceVersions, Vm as fromHeaders, Vn as BackgroundPolicy, Vo as APPARMOR_PROFILE, Vp as latestProviderTurnForAttempt, Vr as PtySpawnError, Vs as toUint8Array, Vt as isTerminalRunStatus, Vu as RequestInit, W as PeerPluginRegistry, Wa as PeerState, Wc as chatAttachmentStableKey, Wd as DEFAULT_PROVIDER_HEALTH_REFRESH_INTERVAL, Wf as BUILT_IN_BROWSER_PROFILES, Wg as getResponseEncoding, Wh as bodyJson, Wi as isNativeMaintenanceCommand, Wl as parseServiceState, Wm as TypeId$6, Wn as BUILT_IN_USAGE_DRIVERS, Wo as NO_SANDBOX_SIGNATURE, Wp as OrchestrationProjectShell, Wr as TextGeneration, Ws as CLOUD_LINKED_USER_ID, Wt as OrchestratorV2, Wu as clientRpcRequiredScopes, X as relayHookBaseUrl, Xa as invalidateJjAvailability, Xc as projectComposerContextForProvider, Xd as requiredScopesForServerSettingsPatch, Xf as DesktopAppActivationResponse, Xg as isStreamSchema, Xh as make$82, Xi as layer$175, Xl as pinnedRuntimePaths, Xm as TypeId$5, Xn as sameUsageLimitCommandCoverage, Xo as sandboxBlocked, Xp as ProjectSearchEntriesError, Xr as GitHubCredentials, Xs as RELAY_ISSUER_SECRET, Xt as ProviderSessionManagerV2, Xu as PEER_LOCAL_WORKSPACE, Y as layer$136, Ya as resolveJjRepoPaths, Yc as runRanAfter, Yd as requiredScopesForProjectMutation, Yf as DesktopAppActivationErrorCode, Yg as isNoContent, Yh as get$2, Yi as CheckpointStore, Yl as pinnedRuntimeCommand, Ym as MultipartError, Yn as layer$161, Yo as missingLibraries, Yp as ProjectSearchContentsError, Yr as layer$149, Ys as RELAY_ENVIRONMENT_CREDENTIAL_SECRET, Yt as layer$121, Yu as PEER_RPC_SCOPES, Z as Scheduler, Za as resolveWorkspaceRefName, Zc as normalizeProjectPathForComparison, Zd as resolveProviderInstanceEnabled, Zf as DesktopBrowserCommand, Zg as isStreamUint8Array, Zh as post, Zi as VcsDriverRegistry, Zl as pinnedRuntimeVersionsDir, Zm as isPersistedFile, Zn as withUsageLimitsCommands, Zo as sandboxDisabled, Zp as ProjectWriteFileError, Zr as layer$167, Zs as RELAY_URL_SECRET, Zt as layer$123, Zu as Service$1, _ as layer$195, __ as DpopFailureReason, _a as ProjectFaviconResolver, _c as ensureServerDirectories, _d as AgentSessionImportProjectChangedError, _f as map$7, _g as AuthAccessWriteScope, _h as symbol, _i as isUndeliveredMailboxSteer, _l as threadPullRequestKeysEqual, _m as RouteContext, _n as layer$164, _o as withMetrics, _p as EnvironmentScopeRequiredError, _r as layer$158, _s as resolveSessionCookieName, _t as listClients, _u as fromConfig, a_ as ProviderDriverKind, aa as isCheckpointRestoreIsolated, ac as resolveCliCommand, ad as AssetPreviewTypeValidationError, af as KeybindingsConfig, ag as layer$102, ah as SocketError, al as injectMcpAppThemeBootstrap, am as VcsUnsupportedOperationError, an as layer$127, ao as managedWorktreesDirectories, ap as EnvironmentCloudEndpointUnavailableError, ar as codexPlanLabel, as as aexists, at as userFacingDispatchErrorMessage, au as DEFAULT_SIGNAL_EXPORT, b as DEVICE_HUB_ROUTE_PREFIX, b_ as MessageId, ba as WorkspacePaths, bc as otlpResource, bd as AgentSessionScanError, bf as isSqlError, bg as AuthEnvironmentMaintainScope, bh as make$73, bi as cancelledRosterTaskWork, bl as siblingPullRequestUrl, bm as middleware, bn as layer$116, bo as normalizeGitRemoteUrl, bp as RelayCloudMintCredentialProofPayload, br as WORKSPACE_BROWSER_PREVIEW_EXTENSIONS, bs as ServerEnvironment, bt as mcpClient, bu as layerFlusher, c_ as defaultInstanceIdForDriver, ca as ProjectConflictError, cc as ServerSecretStore, cd as AssetProjectFaviconResolutionError, cf as getCurrentVersion, cg as stream$1, ch as WebSocketConstructor, ci as layer$201, cl as compileResolvedKeybindingRule, cm as OrchestrationGetTurnDiffResult, cn as WorkspaceEntries, co as VcsProcess, cp as EnvironmentHttpCommonError, cr as EMPTY_TOTALS, cs as clean, ct as ProjectCloneTracker, cu as causeErrorTag, d_ as ClientConnectionMethod, da as layer$114, dc as layer$97, dd as AssetWorkspaceAssetNotFoundError, df as isQuitError, dg as ExecutionEnvironmentDescriptor, dh as ClientAbort, di as ProviderContinuationRequests, dl as parseKeybindingShortcut, dm as PersistChatAttachmentsError, dn as isProjectFaviconPath, do as metricAttributes, dp as EnvironmentHttpInternalServerError, dr as readContainedWorkflowFile, ds as toBytes, dt as layer$172, du as makeLocalFileTracer, e_ as hasBody, ea as JjVcsDriver, ec as encodeConfirmedOriginJson, ed as SERVER_BROWSER_AUTOMATION_CLIENT_ID, ef as PREVIEW_VIEWPORT_PRESET_IDS, eg as isHttpClientError, eh as toPersisted, ei as PullRequestProviderError, el as MAX_TOOL_OUTPUT_IMAGE_BASE64_LENGTH, em as RuntimeMode, en as RunExecutionServiceV2, eo as exactStringPattern, ep as DesktopBackendBootstrap, er as codexCallbackUrl, es as sha256, et as layer$135, eu as enrichProviderSnapshotWithVersionAdvisory, f_ as ClientDeviceType, fa as ProjectEnrichmentService, fc as writeFileStringAtomically, fd as AssetWorkspaceContextNotFoundError, ff as changes, fg as ORCHESTRATION_PROTOCOL_HEADER, fh as HttpServerError, fi as layer$130, fl as BUILT_IN_THEME_IDS, fm as isSecurity, fn as VcsStatusBroadcaster, fo as orchestrationEffectClaimsTotal, fp as EnvironmentHttpUnauthorizedError, fr as BUNDLED_MODEL_MANIFEST, fs as base64UrlDecodeUtf8, ft as WorktreeSetupTracker, fu as makeTraceSink, g as PullRequestReviewGuideService, g_ as CommandId, ga as make$84, gc as deriveServerPaths, gd as AssetWorkspaceRootNormalizationError, gf as Stdio, gg as AuthAccessTokenType, gh as causeResponse, gi as isBufferedProviderNotification, gl as threadPullRequestKeyOf, gm as normalize, gn as layer$163, go as webhookDeliveriesTotal, gp as EnvironmentResourceNotFoundError, gr as resolveProviderCompatibility, gs as resolveLegacySessionCookieName, gt as layer$107, gu as entriesToAttributes, h_ as ClientWebDeployment, ha as layer$140, hc as ServerConfig, hd as AssetWorkspaceResolutionError, hf as set$1, hg as AuthAccessStreamError, hh as ServeError, hi as ProviderInstanceRegistry, hl as normalizeThreadPullRequestKey, hm as getSuccessSchemas, hn as PullRequestService, ho as rpcRequestsTotal, hp as EnvironmentRequestInvalidError, hr as layerModelCatalog, hs as isRemoteReachableHost, ht as ensureShim, hu as OtlpSerialization, i as layer$194, i_ as DEFAULT_MODEL_BY_PROVIDER, ia as SHARED_WORKSPACE_RESTORE_MESSAGE, ic as readRelayConnection, id as AssetGitHubMediaUrlValidationError, if as KeybindingRule, ig as layer$147, ih as CloseEvent, ii as agentScopeCommand, il as injectMcpAppCookieBootstrap, im as VcsRepositoryDetectionError, in as RunFinalizationService, io as makeIsManagedWorktreePath, ip as EnvironmentAuthenticatedPrincipal, ir as CodexInstallation, is as abytes$1, it as layer$134, iu as layer$189, j as dispatchCommand, j_ as ThreadId, ja as layer$112, jc as resolveSignalEndpoint, jd as ExternalLauncherBrowserSpawnError, jf as all$1, jg as AuthPreviewOperateScope, jh as setBody, ji as reportLabel, jl as makeLiveStreamBudget, jm as getAndSet, jn as TerminalManager, jo as coreLaunchCommand, jp as OrchestrationGetWorkflowScriptError, jr as ProviderEventLoggers, js as layer$154, jt as RELAY_LINK_PROOF_TYP, ju as resolveWindowsEnvironment, k as ThreadSearch, k_ as RunId, ka as EventSinkV2, kc as load, kd as environmentThemeFileHasColors, kf as String$7, kg as AuthOrchestrationOperateScope, kh as redirect, ki as restartCancelledBackgroundWorkNote, kl as PersistenceSqlError, km as withScope, kn as ProjectSetupScriptRunner, ko as PeerBrokerKind, kp as toRouterPath, kr as PluginMcpServers, ks as layer$156, kt as RELAY_HOOK_DELIVERY_HEADER, ku as resolveCommandPath, l_ as AuthSessionId, la as ProjectOperationError, lc as isSecretAlreadyExistsError, ld as AssetSigningKeyLoadError, lf as QuitError, lg as uint8Array, lh as fromWebSocket, li as ContextHandoffBudgetError, ll as compileResolvedKeybindingsConfig, lm as ChatAttachmentId, ln as layer$181, lo as layer$146, lp as EnvironmentHttpConflictError, lr as claudeUsageResponseToLimits, ls as concatBytes$1, lt as layer$173, lu as decodeOtlpTraceRecords, m_ as ClientSurface, ma as RepositoryIdentityResolver, mc as RuntimeMode$1, md as AssetWorkspacePathValidationError, mf as make$78, mg as AuthAccessReadScope, mh as ResponseError, mi as ProviderAdapterTurnStartError, ml as legacyThreadPullRequestKey, mm as getErrorSchemas, mn as layerAutoPullPolicy, mo as rpcRequestDuration, mp as EnvironmentOperationForbiddenError, mr as layer$187, ms as deriveAuthClientMetadata, mt as McpClients, mu as make$83, n as McpClientAuthenticator, n_ as AcpRegistryOperationError, na as isGitImport, nc as isAgentActivityPublishingEnabledValue, nd as AssetAttachmentNotFoundError, nf as PreviewStreamHostSetup, ng as ignore$1, nh as make$74, ni as layer$193, nl as toolOutputImages, nm as PullRequestOperationError, nn as layer$124, no as jjCommand, np as EnvironmentAuthInvalidError, nr as isLoopbackHost$1, ns as sha512, nt as threadHasQueuedTurnStart, nu as resolveLatestProviderVersion, o_ as ProviderInstanceId, oa as PeerHubClient, oc as resolveHostCliCommand, od as AssetProjectFaviconInspectionError, of as KeybindingsConfigError, og as layerWeak, oh as SocketOpenError, oi as McpAppModelContext, ol as mcpAppToolCallableByApp, om as OrchestrationGetFullThreadDiffError, on as layerObserver, oo as GitVcsDriver, op as EnvironmentHttpApi, or as codexRateLimitsToLimits, os as ahash, ot as ManagedProjectFolders, ou as OtlpHeadersFromString, p_ as ClientOs, pa as layer$139, pc as DEFAULT_PORT, pd as AssetWorkspaceContextResolutionError, pf as get$3, pg as ORCHESTRATION_PROTOCOL_QUERY_PARAM, ph as RequestParseError, pi as layerFromProviderInstanceRegistry, pl as UNPUBLISHABLE_THEME_IDS, pm as getSlotParseOptions, pn as layer$174, po as orchestrationEffectQueueWait, pp as EnvironmentInternalError, pr as ModelManifest, ps as base64UrlEncode, pt as layer$169, pu as RotatingFileSink, q as ScheduledTaskWebhookOrigin, qa as remoteOf, qc as resolveAttachmentPathById, qd as ServerSettingsError, qf as findBrowserProfile, qg as getStatusSuccessSchema, qh as bodyUrlParams, qi as checkpointRefForScopeOrdinal, ql as PinnedRuntimeInstallError, qm as schemaSearchParams, qn as layer$159, qo as SETUP_SUBCOMMAND, qp as ProjectMutationError, qr as layer$148, qs as HOLD_WEBHOOKS_WHILE_OFFLINE_SECRET, qt as RuntimePolicyV2, qu as WsRpcGroup, r_ as DEFAULT_MODEL, ra as parseTurnDiffFilesFromNumstat, rc as readHoldWebhooksWhileOffline, rd as AssetCreateUrlInput, rf as PreviewViewportSetting, rg as isIgnored, rh as Path, ri as AgentScope, rl as MCP_APP_MAX_HTML_BYTES, rm as pullRequestHostOf, rn as selectInheritedBackgroundTurnItems, ro as isFilesystemRoot, rp as EnvironmentAuthenticatedAuth, rr as normalizePreviewUrl, rs as Hash, rt as ThreadLaunchService, ru as ProviderLatestVersions, s_ as ProviderInstanceMutation, sa as pluginMcpServers, sc as resolveRootCliCommand, sd as AssetProjectFaviconNotFoundError, sf as ResolvedKeybindingRule, sg as raw, sh as WebSocket$1, si as layer$125, sl as DEFAULT_KEYBINDINGS, sm as OrchestrationGetTurnDiffError, sn as layer$126, so as layer$118, sp as EnvironmentHttpBadRequestError, sr as layer$188, ss as anumber, st as layer$133, su as OtlpProtocol, t_ as encoder, ta as layer$145, tc as encodeEndpointRuntimeConfigJson, td as McpAppRequestError, tf as PreviewClearProfileError, tg as TypeId$7, th as decodeField, ti as AnalyticsService, tl as mcpAppFromToolItem, tm as PullRequestLinkedThreadsResult, tn as canRouteRelatedSubagent, to as colocatedGitCommand, tp as RelayClientInstallFailedError, tr as providerAuthReturnUrl, ts as sha384, tt as make$85, tu as makeTargetedProviderUpdateAction, u_ as CheckpointId, ua as ProjectService, uc as isSecretStoreError, ud as AssetWorkspaceAssetInspectionError, uf as Terminal, ug as FileSystem, uh as makeWebSocket$1, ui as makeProviderFailure, ul as mergeWithDefaultKeybindings, um as PROVIDER_SEND_TURN_MAX_FILE_BYTES, un as PROJECT_FAVICON_FALLBACK_MARKER, uo as increment, up as EnvironmentHttpForbiddenError, ur as makeEventNdjsonLogStore, us as randomBytes, ut as SourceControlRepositoryService, uu as layerOtlpSerialization, v as pullRequestSyncKey, v_ as EventId, va as layer$141, vc as layer$100, vd as AgentSessionImportProjectNotFoundError, vf as SqlClient, vg as AuthClientMetadataDeviceType, vh as toResponse, vi as awaitingProviderThreadId, vl as visibleThreadPullRequests, vm as add$2, vn as layer$166, vo as resolveProjectSettings, vp as RelayApi, vr as AntigravityInstallation, vs as signPayload, vt as userBases, vu as serviceNameUnsafe, w as remoteSshDeviceHosts, w_ as ProjectId, wa as LegacyV1ThreadImporter, wc as resolveServerBackgroundActivitySettings, wd as OrchestrationDispatchCommandError, wf as Int$6, wg as AuthGrantScope, wh as html, wi as isRestartNoteContinuation, wl as layer$95, wm as HttpServer, wn as layer$170, wo as matchRepositories, wp as RelayManagedEndpointRecoveryRegistrationResponse, wr as isWorkspaceImagePreviewPath, ws as ServerSelfUpdate, wt as AgentAwarenessRelay, wu as isCommandAvailable, x as DeviceService, x_ as NonNegativeInt, xa as layer$142, xc as resolveStaticDir, xd as AgentSessionSource, xf as Crypto, xg as AuthEnvironmentScopes, xh as getType, xi as cancelledTurnItemWork, xl as canonicalRepositoryKey, xm as route, xn as layerAnalytics, xo as parseGitHubRepositoryNameWithOwnerFromRemoteUrl, xp as RelayEnvironmentLinkChallengeResponse, xr as WORKSPACE_IMAGE_PREVIEW_EXTENSIONS, xs as ServerEnvironmentIdentity, xt as PeerCoordination, xu as make$70, y as layer$196, y_ as IsoDateTime, ya as layer$143, yc as make$77, yd as AgentSessionImportSource, yf as SpanPropagationEnabled, yg as AuthDiagnosticsReadScope, yh as HttpPlatform, yi as cancelledBeforeStart, yl as parseChangeRequestUrl, ym as cors, yn as layer$165, yo as resolveWorktreeCleanup, yp as RelayCloudEnvironmentHealthProofPayload, yr as formatThreadTitleContext, ys as timingSafeEqualBase64Url, yt as MCP_CLIENTS, yu as unknownToAttributeValue, z as layer$178, z_ as bytes, za as ServerActivation, zc as THREAD_HISTORY_SNAPSHOT_ROW_LIMIT, zd as AntigravitySettings, zf as invalidate, zg as AuthTerminalReadScope, zh as MaxBodySize, zi as historicalMessage, zl as SERVICE_STATE_FILE, zm as TracerDisabledWhen, zn as layer$186, zo as withLocalTracing, zp as OrchestrationV2ThreadShell, zr as AcpRegistryRuntimeCoordinator, zs as pipeThroughDuplex, zt as ThreadManagementService, zu as cliReleaseIndexPageUrl } from "./McpHttpServer-BdwjWM7Y.mjs";
|
|
7
7
|
import { a as monotonicTimeNanos, i as currentTimeNanos, r as currentTimeMillis, t as Clock } from "./Clock-B88OfuDl.mjs";
|
|
8
8
|
import { A as fromEffect, Bt as zipLatestWith, Dn as unbounded$1, Dt as tap$2, F as fromPull, Fn as unbounded, G as mapAccum, H as isStream, Hn as interrupt$1, I as fromQueue, J as mapError$1, Jn as runIn, K as mapArrayEffect, Kn as join$1, M as fromIterable, Mn as sliding, Mt as toPull, N as fromIteratorSucceed, Nn as subscribe, On as publish, P as fromPubSub, R as fromSubscription, Rn as makeUnsafe$3, Rt as unfold, S as filterMap$1, Sn as shutdown, St as switchMap, T as flattenIterable, Tn as take, U as make$87, Vn as getCurrent, W as map$8, Y as merge$3, Yn as Order, Z as mkString, Zn as round, _n as offer, b as filter$3, bt as succeed$5, c as changesWith, d as decodeText, dt as runFold, et as orDie$1, fn as fail$7, g as encodeText, gn as make$88, gt as runHead, h as empty$5, i as catchCause$1, in as make$86, it as provideContext$1, jn as shutdown$1, l as concat, lt as runCollect, m as drop, mt as runForEachArray, nt as pipeThroughChannel, pn as failCause$2, pt as runForEach, q as mapEffect$2, r as callback$1, s as changes$1, sn as clear, u as debounce, un as end, v as fail$6, vn as offerAll, w as flatMap$3, wn as sliding$1, wt as takeUntil, x as filterEffect, xt as suspend$1, yn as offerUnsafe, yt as splitLines, z as groupedWithin, zn as awaitAll, zt as unwrap$1 } from "./mcpResponsePayloads-Be_jYC4_.mjs";
|
|
@@ -1886,6 +1886,65 @@ const Date$1 = (options) => {
|
|
|
1886
1886
|
});
|
|
1887
1887
|
};
|
|
1888
1888
|
/**
|
|
1889
|
+
* Creates a file-system selection prompt and returns the selected path.
|
|
1890
|
+
*
|
|
1891
|
+
* **Details**
|
|
1892
|
+
*
|
|
1893
|
+
* The prompt can be configured to select files, directories, or either path
|
|
1894
|
+
* type.
|
|
1895
|
+
*
|
|
1896
|
+
* You can also type to filter the listed entries. Every printable character is
|
|
1897
|
+
* appended to the filter query, so navigation is bound to the arrow keys,
|
|
1898
|
+
* `tab`, and the `Ctrl+P` / `Ctrl+N` chords used by `readline` and `fzf`
|
|
1899
|
+
* (`Ctrl+K` also moves up). `Ctrl+U` clears the query.
|
|
1900
|
+
*
|
|
1901
|
+
* @stability unstable
|
|
1902
|
+
* @category constructors
|
|
1903
|
+
* @since 4.0.0
|
|
1904
|
+
*/
|
|
1905
|
+
const File = (options = {}) => {
|
|
1906
|
+
const opts = {
|
|
1907
|
+
...options,
|
|
1908
|
+
type: options.type ?? "file",
|
|
1909
|
+
message: options.message ?? `Choose a file`,
|
|
1910
|
+
startingPath: fromUndefinedOr(options.startingPath),
|
|
1911
|
+
default: fromUndefinedOr(options.default),
|
|
1912
|
+
maxPerPage: options.maxPerPage ?? 10,
|
|
1913
|
+
filter: options.filter ?? (() => succeed$1(true))
|
|
1914
|
+
};
|
|
1915
|
+
const initialState = gen$1(function* () {
|
|
1916
|
+
const currentPath = yield* resolveCurrentPath(none$1(), opts);
|
|
1917
|
+
const path = yield* Path;
|
|
1918
|
+
const defaultPath = map$4(opts.default, (defaultValue) => path.resolve(currentPath, defaultValue));
|
|
1919
|
+
const initialPath = match(defaultPath, {
|
|
1920
|
+
onNone: () => currentPath,
|
|
1921
|
+
onSome: (defaultPath) => path.dirname(defaultPath)
|
|
1922
|
+
});
|
|
1923
|
+
const files = yield* getFileList(initialPath, opts);
|
|
1924
|
+
const cursor = match(defaultPath, {
|
|
1925
|
+
onNone: () => 0,
|
|
1926
|
+
onSome: (defaultPath) => {
|
|
1927
|
+
const index = files.indexOf(path.basename(defaultPath));
|
|
1928
|
+
return index === -1 ? 0 : index;
|
|
1929
|
+
}
|
|
1930
|
+
});
|
|
1931
|
+
const confirm = FileConfirm.Hide();
|
|
1932
|
+
return {
|
|
1933
|
+
cursor,
|
|
1934
|
+
files,
|
|
1935
|
+
allFiles: files,
|
|
1936
|
+
query: "",
|
|
1937
|
+
path: map$4(defaultPath, path.dirname),
|
|
1938
|
+
confirm
|
|
1939
|
+
};
|
|
1940
|
+
});
|
|
1941
|
+
return Custom(initialState, {
|
|
1942
|
+
render: handleFileRender(opts),
|
|
1943
|
+
process: handleFileProcess(opts),
|
|
1944
|
+
clear: handleFileClear(opts)
|
|
1945
|
+
});
|
|
1946
|
+
};
|
|
1947
|
+
/**
|
|
1889
1948
|
* Composes prompts by using the output of this prompt to create the next prompt.
|
|
1890
1949
|
*
|
|
1891
1950
|
* @stability unstable
|
|
@@ -2194,7 +2253,7 @@ const eraseText = (text, columns) => {
|
|
|
2194
2253
|
};
|
|
2195
2254
|
const lines = (prompt, columns) => {
|
|
2196
2255
|
const lines = prompt.split(NEWLINE_REGEXP);
|
|
2197
|
-
return columns === 0 ? lines.length : pipe(map$
|
|
2256
|
+
return columns === 0 ? lines.length : pipe(map$5(lines, (line) => Math.ceil(line.length / columns)), reduce(0, (left, right) => left + right));
|
|
2198
2257
|
};
|
|
2199
2258
|
const clearOutputWithError = (outputText, columns, errorText) => {
|
|
2200
2259
|
if (errorText !== void 0 && errorText.length > 0) return cursorDown(lines(errorText, columns)) + eraseText(`\n${errorText}`, columns) + eraseText(outputText, columns);
|
|
@@ -2252,7 +2311,7 @@ const handleDateClear = (options) => {
|
|
|
2252
2311
|
const resetCurrentLine = eraseLine + "\x1B[G";
|
|
2253
2312
|
const parts = reduce(state.dateParts, "", (doc, part) => doc + part.toString());
|
|
2254
2313
|
const promptText = renderPrompt(parts, options.message, figures.prefix, figures.pointerSmall, figures, { plain: true });
|
|
2255
|
-
const errorText = isSome(state.error) ? match(state.error.value.split(NEWLINE_REGEXP), {
|
|
2314
|
+
const errorText = isSome(state.error) ? match$1(state.error.value.split(NEWLINE_REGEXP), {
|
|
2256
2315
|
onEmpty: () => "",
|
|
2257
2316
|
onNonEmpty: (errorLines) => separateSymbol(figures.pointerSmall, errorLines.join("\n"))
|
|
2258
2317
|
}) : "";
|
|
@@ -2264,7 +2323,7 @@ const renderDateError = (state, pointer, theme) => {
|
|
|
2264
2323
|
const errorLines = state.error.value.split(NEWLINE_REGEXP);
|
|
2265
2324
|
if (isReadonlyArrayNonEmpty(errorLines)) {
|
|
2266
2325
|
const prefix = annotateSymbol(theme, pointer, theme.errorColor);
|
|
2267
|
-
const lines = map$
|
|
2326
|
+
const lines = map$5(errorLines, (str) => annotateErrorLine(theme, str));
|
|
2268
2327
|
return "\x1B[s\n" + separateSymbol(prefix, lines.join("\n")) + "\x1B[u";
|
|
2269
2328
|
}
|
|
2270
2329
|
}
|
|
@@ -2330,7 +2389,7 @@ const processDateCursorRight = (state) => {
|
|
|
2330
2389
|
};
|
|
2331
2390
|
const processDateNext = (state) => {
|
|
2332
2391
|
const next = state.dateParts[state.cursor].nextPart();
|
|
2333
|
-
const cursor = match
|
|
2392
|
+
const cursor = match(next, {
|
|
2334
2393
|
onNone: () => state.dateParts.findIndex((part) => !part.isToken()),
|
|
2335
2394
|
onSome: (next) => state.dateParts.indexOf(next)
|
|
2336
2395
|
});
|
|
@@ -2664,6 +2723,73 @@ var Meridiem = class extends DatePart {
|
|
|
2664
2723
|
return /A/.test(this.token) ? meridiem.toUpperCase() : meridiem;
|
|
2665
2724
|
}
|
|
2666
2725
|
};
|
|
2726
|
+
const CONFIRM_MESSAGE = "The selected directory contains files. Would you like to traverse the selected directory?";
|
|
2727
|
+
const FILE_FILTER_LABEL = "filter";
|
|
2728
|
+
const FILE_FILTER_PLACEHOLDER = "type to filter";
|
|
2729
|
+
const FILE_EMPTY_MESSAGE = "No matches";
|
|
2730
|
+
const FileConfirm = /*#__PURE__*/ taggedEnum();
|
|
2731
|
+
const showConfirmation = /*#__PURE__*/ FileConfirm.$is("Show");
|
|
2732
|
+
const resolveCurrentPath = (path, options) => {
|
|
2733
|
+
if (isSome(path)) return succeed$1(path.value);
|
|
2734
|
+
if (isSome(options.startingPath)) {
|
|
2735
|
+
const startingPath = options.startingPath.value;
|
|
2736
|
+
return flatMap$1(FileSystem, (fs) => orDie(fs.exists(startingPath)).pipe(flatMap$1((exists) => exists ? void_ : die(`The provided starting path '${startingPath}' does not exist`)), as(startingPath)));
|
|
2737
|
+
}
|
|
2738
|
+
return sync$1(() => process.cwd());
|
|
2739
|
+
};
|
|
2740
|
+
const getFileList = /*#__PURE__*/ fnUntraced$1(function* (directory, options) {
|
|
2741
|
+
const fs = yield* FileSystem;
|
|
2742
|
+
const path = yield* Path;
|
|
2743
|
+
const files = yield* orDie(fs.readDirectory(directory)).pipe(map$3((files) => ["..", ...files]));
|
|
2744
|
+
return yield* filter(files, (file) => {
|
|
2745
|
+
const result = options.filter(file);
|
|
2746
|
+
const userDefinedFilter = isEffect$1(result) ? result : succeed$1(result);
|
|
2747
|
+
const directoryFilter = options.type === "directory" ? map$3(orDie(fs.stat(path.join(directory, file))), (info) => info.type === "Directory") : succeed$1(true);
|
|
2748
|
+
return zipWith(userDefinedFilter, directoryFilter, (a, b) => a && b);
|
|
2749
|
+
}, { concurrency: files.length });
|
|
2750
|
+
});
|
|
2751
|
+
const filterFiles = (files, query) => {
|
|
2752
|
+
if (query.length === 0) return files;
|
|
2753
|
+
const normalizedQuery = query.toLowerCase();
|
|
2754
|
+
const filtered = [];
|
|
2755
|
+
for (let index = 0; index < files.length; index++) if (files[index].toLowerCase().includes(normalizedQuery)) filtered.push(files[index]);
|
|
2756
|
+
return filtered;
|
|
2757
|
+
};
|
|
2758
|
+
const updateFileState = (state, query, allFiles = state.allFiles) => {
|
|
2759
|
+
const files = filterFiles(allFiles, query);
|
|
2760
|
+
if (files.length === 0) return {
|
|
2761
|
+
...state,
|
|
2762
|
+
query,
|
|
2763
|
+
allFiles,
|
|
2764
|
+
files,
|
|
2765
|
+
cursor: 0
|
|
2766
|
+
};
|
|
2767
|
+
const selected = state.files[state.cursor];
|
|
2768
|
+
const cursor = selected === void 0 ? 0 : files.indexOf(selected);
|
|
2769
|
+
return {
|
|
2770
|
+
...state,
|
|
2771
|
+
query,
|
|
2772
|
+
allFiles,
|
|
2773
|
+
files,
|
|
2774
|
+
cursor: cursor === -1 ? 0 : cursor
|
|
2775
|
+
};
|
|
2776
|
+
};
|
|
2777
|
+
const handleFileClear = (options) => {
|
|
2778
|
+
return fnUntraced$1(function* (state, _) {
|
|
2779
|
+
const columns = yield* (yield* Terminal).columns;
|
|
2780
|
+
const path = yield* Path;
|
|
2781
|
+
const figures = yield* getTheme(options);
|
|
2782
|
+
const currentPath = yield* resolveCurrentPath(state.path, options);
|
|
2783
|
+
const selectedPath = state.files[state.cursor];
|
|
2784
|
+
const resolvedPath = selectedPath === void 0 ? currentPath : path.resolve(currentPath, selectedPath);
|
|
2785
|
+
const resolvedPathText = separateSymbol(figures.pointerSmall, resolvedPath);
|
|
2786
|
+
const isConfirming = showConfirmation(state.confirm);
|
|
2787
|
+
const promptText = isConfirming ? renderPrompt("(Y/n)", CONFIRM_MESSAGE, figures.prefix, figures.pointerSmall, figures, { plain: true }) : renderPrompt(renderFileFilter(state, figures, { plain: true }), options.message, figures.tick, figures.ellipsis, figures, { plain: true });
|
|
2788
|
+
const filesText = isConfirming ? "" : renderFiles(state, state.files, figures, options, { plain: true });
|
|
2789
|
+
const outputText = isConfirming ? `${promptText}\n${resolvedPathText}` : `${promptText}\n${resolvedPathText}\n${filesText}`;
|
|
2790
|
+
return eraseText(outputText, columns) + (eraseLine + "\x1B[G");
|
|
2791
|
+
});
|
|
2792
|
+
};
|
|
2667
2793
|
const renderPrompt = (confirm, message, leadingSymbol, trailingSymbol, theme, options) => {
|
|
2668
2794
|
const prefix = leadingSymbol.length === 0 ? "" : leadingSymbol + " ";
|
|
2669
2795
|
const renderLine = (line) => {
|
|
@@ -2673,21 +2799,187 @@ const renderPrompt = (confirm, message, leadingSymbol, trailingSymbol, theme, op
|
|
|
2673
2799
|
else if (trailingSymbol.length > 0) output += " ";
|
|
2674
2800
|
return output;
|
|
2675
2801
|
};
|
|
2676
|
-
return match(message.split(NEWLINE_REGEXP), {
|
|
2802
|
+
return match$1(message.split(NEWLINE_REGEXP), {
|
|
2677
2803
|
onEmpty: () => renderLine(""),
|
|
2678
2804
|
onNonEmpty: (promptLines) => {
|
|
2679
|
-
const lines = options?.plain === true ? promptLines : map$
|
|
2805
|
+
const lines = options?.plain === true ? promptLines : map$5(promptLines, (line) => annotate(theme.colors, line, bold));
|
|
2680
2806
|
return renderLine(lines.join("\n"));
|
|
2681
2807
|
}
|
|
2682
2808
|
});
|
|
2683
2809
|
};
|
|
2810
|
+
const renderPrefix = (state, toDisplay, currentIndex, length, figures, renderOptions) => {
|
|
2811
|
+
const prefix = renderPagingPrefix(figures, currentIndex === toDisplay.startIndex && toDisplay.startIndex > 0, currentIndex === toDisplay.endIndex - 1 && toDisplay.endIndex < length);
|
|
2812
|
+
if (state.cursor === currentIndex) return renderOptions?.plain === true ? figures.pointer + prefix : annotateSymbol(figures, figures.pointer, figures.primaryColor) + prefix;
|
|
2813
|
+
return prefix + " ".repeat(figures.pointer.length);
|
|
2814
|
+
};
|
|
2815
|
+
const renderFileName = (file, isSelected, theme, renderOptions) => {
|
|
2816
|
+
if (renderOptions?.plain === true) return file;
|
|
2817
|
+
return isSelected ? annotate(theme.colors, file, combine(underlined, theme.primaryColor)) : file;
|
|
2818
|
+
};
|
|
2819
|
+
const renderFileFilter = (state, theme, renderOptions) => {
|
|
2820
|
+
const filterValue = state.query.length === 0 ? renderOptions?.plain === true ? FILE_FILTER_PLACEHOLDER : annotate(theme.colors, FILE_FILTER_PLACEHOLDER, theme.mutedColor) : renderOptions?.plain === true ? state.query : annotate(theme.colors, state.query, combine(underlined, theme.primaryColor));
|
|
2821
|
+
return `[${FILE_FILTER_LABEL}: ${filterValue}]`;
|
|
2822
|
+
};
|
|
2823
|
+
const renderFiles = (state, files, figures, options, renderOptions) => {
|
|
2824
|
+
const length = files.length;
|
|
2825
|
+
if (length === 0) return renderOptions?.plain === true ? FILE_EMPTY_MESSAGE : annotate(figures.colors, FILE_EMPTY_MESSAGE, figures.mutedColor);
|
|
2826
|
+
const toDisplay = entriesToDisplay(state.cursor, length, options.maxPerPage);
|
|
2827
|
+
const documents = [];
|
|
2828
|
+
for (let index = toDisplay.startIndex; index < toDisplay.endIndex; index++) {
|
|
2829
|
+
const isSelected = state.cursor === index;
|
|
2830
|
+
const prefix = renderPrefix(state, toDisplay, index, length, figures, renderOptions);
|
|
2831
|
+
const fileName = renderFileName(files[index], isSelected, figures, renderOptions);
|
|
2832
|
+
documents.push(prefix + fileName);
|
|
2833
|
+
}
|
|
2834
|
+
return documents.join("\n");
|
|
2835
|
+
};
|
|
2836
|
+
const renderFileNextFrame = /*#__PURE__*/ fnUntraced$1(function* (state, options) {
|
|
2837
|
+
const path = yield* Path;
|
|
2838
|
+
const figures = yield* getTheme(options);
|
|
2839
|
+
const currentPath = yield* resolveCurrentPath(state.path, options);
|
|
2840
|
+
const selectedPath = state.files[state.cursor];
|
|
2841
|
+
const resolvedPath = selectedPath === void 0 ? currentPath : path.resolve(currentPath, selectedPath);
|
|
2842
|
+
const resolvedPathMsg = annotate(figures.colors, separateSymbol(figures.pointerSmall, resolvedPath), figures.mutedColor);
|
|
2843
|
+
if (showConfirmation(state.confirm)) {
|
|
2844
|
+
const leadingSymbol = annotateSymbol(figures, figures.prefix, figures.primaryColor);
|
|
2845
|
+
const trailingSymbol = annotateSymbol(figures, figures.pointerSmall, figures.mutedColor);
|
|
2846
|
+
const confirm = annotate(figures.colors, "(Y/n)", figures.mutedColor);
|
|
2847
|
+
const promptMsg = renderPrompt(confirm, CONFIRM_MESSAGE, leadingSymbol, trailingSymbol, figures);
|
|
2848
|
+
return cursorHide + promptMsg + "\n" + resolvedPathMsg;
|
|
2849
|
+
}
|
|
2850
|
+
const leadingSymbol = annotateSymbol(figures, figures.tick, figures.successColor);
|
|
2851
|
+
const trailingSymbol = annotateSymbol(figures, figures.ellipsis, figures.mutedColor);
|
|
2852
|
+
const promptMsg = renderPrompt(renderFileFilter(state, figures), options.message, leadingSymbol, trailingSymbol, figures);
|
|
2853
|
+
const files = renderFiles(state, state.files, figures, options);
|
|
2854
|
+
return cursorHide + promptMsg + "\n" + resolvedPathMsg + "\n" + files;
|
|
2855
|
+
});
|
|
2856
|
+
const renderFileSubmission = /*#__PURE__*/ fnUntraced$1(function* (state, value, options) {
|
|
2857
|
+
const figures = yield* getTheme(options);
|
|
2858
|
+
const leadingSymbol = annotateSymbol(figures, figures.tick, figures.successColor);
|
|
2859
|
+
const trailingSymbol = annotateSymbol(figures, figures.ellipsis, figures.mutedColor);
|
|
2860
|
+
return renderPrompt(renderFileFilter(state, figures), options.message, leadingSymbol, trailingSymbol, figures) + " " + annotate(figures.colors, value, figures.submittedColor) + "\n";
|
|
2861
|
+
});
|
|
2862
|
+
const handleFileRender = (options) => {
|
|
2863
|
+
return (state, action) => {
|
|
2864
|
+
return Action$1.$match(action, {
|
|
2865
|
+
Beep: () => succeed$1(renderBeep),
|
|
2866
|
+
NextFrame: ({ state }) => renderFileNextFrame(state, options),
|
|
2867
|
+
Submit: ({ value }) => renderFileSubmission(state, value, options)
|
|
2868
|
+
});
|
|
2869
|
+
};
|
|
2870
|
+
};
|
|
2871
|
+
const processFileCursorUp = (state) => {
|
|
2872
|
+
if (state.files.length === 0) return succeed$1(Action$1.Beep());
|
|
2873
|
+
const cursor = state.cursor - 1;
|
|
2874
|
+
return succeed$1(Action$1.NextFrame({ state: {
|
|
2875
|
+
...state,
|
|
2876
|
+
cursor: cursor < 0 ? state.files.length - 1 : cursor
|
|
2877
|
+
} }));
|
|
2878
|
+
};
|
|
2879
|
+
const processFileCursorDown = (state) => {
|
|
2880
|
+
if (state.files.length === 0) return succeed$1(Action$1.Beep());
|
|
2881
|
+
return succeed$1(Action$1.NextFrame({ state: {
|
|
2882
|
+
...state,
|
|
2883
|
+
cursor: (state.cursor + 1) % state.files.length
|
|
2884
|
+
} }));
|
|
2885
|
+
};
|
|
2886
|
+
const processFileBackspace = (state) => {
|
|
2887
|
+
if (state.query.length === 0) return succeed$1(Action$1.Beep());
|
|
2888
|
+
const query = state.query.slice(0, state.query.length - 1);
|
|
2889
|
+
return succeed$1(Action$1.NextFrame({ state: updateFileState(state, query) }));
|
|
2890
|
+
};
|
|
2891
|
+
const processFileClear = (state) => succeed$1(Action$1.NextFrame({ state: updateFileState(state, "") }));
|
|
2892
|
+
const processFileInput = (input, state) => {
|
|
2893
|
+
if (input.length === 0) return succeed$1(Action$1.Beep());
|
|
2894
|
+
const query = state.query + input;
|
|
2895
|
+
return succeed$1(Action$1.NextFrame({ state: updateFileState(state, query) }));
|
|
2896
|
+
};
|
|
2897
|
+
const processSelection = /*#__PURE__*/ fnUntraced$1(function* (state, options) {
|
|
2898
|
+
if (state.files.length === 0) return Action$1.Beep();
|
|
2899
|
+
const fs = yield* FileSystem;
|
|
2900
|
+
const path = yield* Path;
|
|
2901
|
+
const currentPath = yield* resolveCurrentPath(state.path, options);
|
|
2902
|
+
const selectedPath = state.files[state.cursor];
|
|
2903
|
+
const resolvedPath = path.resolve(currentPath, selectedPath);
|
|
2904
|
+
if ((yield* orDie(fs.stat(resolvedPath))).type === "Directory") {
|
|
2905
|
+
const files = yield* getFileList(resolvedPath, options);
|
|
2906
|
+
const filesWithoutParent = files.filter((file) => file !== "..");
|
|
2907
|
+
if (options.type === "directory" || options.type === "either") return filesWithoutParent.length === 0 ? Action$1.Submit({ value: resolvedPath }) : Action$1.NextFrame({ state: {
|
|
2908
|
+
...state,
|
|
2909
|
+
confirm: FileConfirm.Show()
|
|
2910
|
+
} });
|
|
2911
|
+
return Action$1.NextFrame({ state: {
|
|
2912
|
+
cursor: 0,
|
|
2913
|
+
files,
|
|
2914
|
+
allFiles: files,
|
|
2915
|
+
query: "",
|
|
2916
|
+
path: some(resolvedPath),
|
|
2917
|
+
confirm: FileConfirm.Hide()
|
|
2918
|
+
} });
|
|
2919
|
+
}
|
|
2920
|
+
return Action$1.Submit({ value: resolvedPath });
|
|
2921
|
+
});
|
|
2922
|
+
const handleFileProcess = (options) => {
|
|
2923
|
+
return fnUntraced$1(function* (input, state) {
|
|
2924
|
+
if (input.key.ctrl) switch (input.key.name) {
|
|
2925
|
+
case "u":
|
|
2926
|
+
if (showConfirmation(state.confirm)) return Action$1.Beep();
|
|
2927
|
+
return yield* processFileClear(state);
|
|
2928
|
+
case "p":
|
|
2929
|
+
case "k": return yield* processFileCursorUp(state);
|
|
2930
|
+
case "n": return yield* processFileCursorDown(state);
|
|
2931
|
+
default: return Action$1.Beep();
|
|
2932
|
+
}
|
|
2933
|
+
switch (input.key.name) {
|
|
2934
|
+
case "up": return yield* processFileCursorUp(state);
|
|
2935
|
+
case "down":
|
|
2936
|
+
case "tab": return yield* processFileCursorDown(state);
|
|
2937
|
+
case "backspace":
|
|
2938
|
+
if (showConfirmation(state.confirm)) return Action$1.Beep();
|
|
2939
|
+
return yield* processFileBackspace(state);
|
|
2940
|
+
case "enter":
|
|
2941
|
+
case "return": return yield* processSelection(state, options);
|
|
2942
|
+
case "y":
|
|
2943
|
+
case "t":
|
|
2944
|
+
if (showConfirmation(state.confirm)) {
|
|
2945
|
+
const path = yield* Path;
|
|
2946
|
+
const currentPath = yield* resolveCurrentPath(state.path, options);
|
|
2947
|
+
const selectedPath = state.files[state.cursor];
|
|
2948
|
+
const resolvedPath = path.resolve(currentPath, selectedPath);
|
|
2949
|
+
const files = yield* getFileList(resolvedPath, options);
|
|
2950
|
+
return Action$1.NextFrame({ state: {
|
|
2951
|
+
cursor: 0,
|
|
2952
|
+
files,
|
|
2953
|
+
allFiles: files,
|
|
2954
|
+
query: "",
|
|
2955
|
+
path: some(resolvedPath),
|
|
2956
|
+
confirm: FileConfirm.Hide()
|
|
2957
|
+
} });
|
|
2958
|
+
}
|
|
2959
|
+
return yield* processFileInput(getOrElse(input.input, () => ""), state);
|
|
2960
|
+
case "n":
|
|
2961
|
+
case "f":
|
|
2962
|
+
if (showConfirmation(state.confirm)) {
|
|
2963
|
+
const path = yield* Path;
|
|
2964
|
+
const currentPath = yield* resolveCurrentPath(state.path, options);
|
|
2965
|
+
const selectedPath = state.files[state.cursor];
|
|
2966
|
+
const resolvedPath = path.resolve(currentPath, selectedPath);
|
|
2967
|
+
return Action$1.Submit({ value: resolvedPath });
|
|
2968
|
+
}
|
|
2969
|
+
return yield* processFileInput(getOrElse(input.input, () => ""), state);
|
|
2970
|
+
default:
|
|
2971
|
+
if (showConfirmation(state.confirm)) return Action$1.Beep();
|
|
2972
|
+
return yield* processFileInput(getOrElse(input.input, () => ""), state);
|
|
2973
|
+
}
|
|
2974
|
+
});
|
|
2975
|
+
};
|
|
2684
2976
|
const renderMultiSelectError = (state, pointer, theme, renderOptions) => {
|
|
2685
|
-
if (isSome(state.error)) return match(state.error.value.split(NEWLINE_REGEXP), {
|
|
2977
|
+
if (isSome(state.error)) return match$1(state.error.value.split(NEWLINE_REGEXP), {
|
|
2686
2978
|
onEmpty: () => "",
|
|
2687
2979
|
onNonEmpty: (errorLines) => {
|
|
2688
2980
|
if (renderOptions?.plain === true) return separateSymbol(pointer, errorLines.join("\n"));
|
|
2689
2981
|
const prefix = annotateSymbol(theme, pointer, theme.errorColor);
|
|
2690
|
-
const lines = map$
|
|
2982
|
+
const lines = map$5(errorLines, (str) => annotateErrorLine(theme, str));
|
|
2691
2983
|
return "\x1B[s\n" + separateSymbol(prefix, lines.join("\n")) + "\x1B[u";
|
|
2692
2984
|
}
|
|
2693
2985
|
});
|
|
@@ -2854,12 +3146,12 @@ const renderNumberInput = (state, submitted, theme, renderOptions) => {
|
|
|
2854
3146
|
return annotate(theme.colors, value, annotation);
|
|
2855
3147
|
};
|
|
2856
3148
|
const renderNumberError = (state, pointer, theme, renderOptions) => {
|
|
2857
|
-
if (isSome(state.error)) return match(state.error.value.split(NEWLINE_REGEXP), {
|
|
3149
|
+
if (isSome(state.error)) return match$1(state.error.value.split(NEWLINE_REGEXP), {
|
|
2858
3150
|
onEmpty: () => "",
|
|
2859
3151
|
onNonEmpty: (errorLines) => {
|
|
2860
3152
|
if (renderOptions?.plain === true) return separateSymbol(pointer, errorLines.join("\n"));
|
|
2861
3153
|
const prefix = annotateSymbol(theme, pointer, theme.errorColor);
|
|
2862
|
-
const lines = map$
|
|
3154
|
+
const lines = map$5(errorLines, (str) => annotateErrorLine(theme, str));
|
|
2863
3155
|
return "\x1B[s\n" + separateSymbol(prefix, lines.join("\n")) + "\x1B[u";
|
|
2864
3156
|
}
|
|
2865
3157
|
});
|
|
@@ -3131,12 +3423,12 @@ const renderTextInput = (nextState, options, theme, submitted, renderOptions) =>
|
|
|
3131
3423
|
}
|
|
3132
3424
|
};
|
|
3133
3425
|
const renderTextError = (nextState, pointer, theme, renderOptions) => {
|
|
3134
|
-
if (isSome(nextState.error)) return match(nextState.error.value.split(NEWLINE_REGEXP), {
|
|
3426
|
+
if (isSome(nextState.error)) return match$1(nextState.error.value.split(NEWLINE_REGEXP), {
|
|
3135
3427
|
onEmpty: () => "",
|
|
3136
3428
|
onNonEmpty: (errorLines) => {
|
|
3137
3429
|
if (renderOptions?.plain === true) return separateSymbol(pointer, errorLines.join("\n"));
|
|
3138
3430
|
const prefix = annotateSymbol(theme, pointer, theme.errorColor);
|
|
3139
|
-
const lines = map$
|
|
3431
|
+
const lines = map$5(errorLines, (str) => annotateErrorLine(theme, str));
|
|
3140
3432
|
return "\x1B[s\n" + separateSymbol(prefix, lines.join("\n")) + "\x1B[u";
|
|
3141
3433
|
}
|
|
3142
3434
|
});
|
|
@@ -3829,7 +4121,7 @@ const optional$2 = (param) => {
|
|
|
3829
4121
|
*/
|
|
3830
4122
|
const withDefault$1 = /*#__PURE__*/ dual(2, (self, defaultValue) => {
|
|
3831
4123
|
if (!isEffect$1(defaultValue)) return map$1(optional$2(self), getOrElse(() => defaultValue));
|
|
3832
|
-
return mapEffect(optional$2(self), match
|
|
4124
|
+
return mapEffect(optional$2(self), match({
|
|
3833
4125
|
onNone: () => defaultValue,
|
|
3834
4126
|
onSome: succeed$1
|
|
3835
4127
|
}));
|
|
@@ -4745,7 +5037,7 @@ const makeCommand = (options) => {
|
|
|
4745
5037
|
if (visible.length === 0) continue;
|
|
4746
5038
|
subcommandDocs.push({
|
|
4747
5039
|
group: group.group,
|
|
4748
|
-
commands: map$
|
|
5040
|
+
commands: map$5(visible, (subcommand) => ({
|
|
4749
5041
|
name: subcommand.name,
|
|
4750
5042
|
alias: subcommand.alias,
|
|
4751
5043
|
shortDescription: subcommand.shortDescription,
|
|
@@ -4803,7 +5095,7 @@ const toFlagDoc = (single, metadata) => {
|
|
|
4803
5095
|
const appendChoiceKeys = (description, choiceKeys) => {
|
|
4804
5096
|
if (choiceKeys === void 0 || choiceKeys.length === 0) return description;
|
|
4805
5097
|
const choiceSuffix = `(choices: ${choiceKeys.join(", ")})`;
|
|
4806
|
-
return match
|
|
5098
|
+
return match(description, {
|
|
4807
5099
|
onNone: () => some(choiceSuffix),
|
|
4808
5100
|
onSome: (value) => some(`${value} ${choiceSuffix}`)
|
|
4809
5101
|
});
|
|
@@ -6638,7 +6930,7 @@ const suggest = (input, candidates) => {
|
|
|
6638
6930
|
/**
|
|
6639
6931
|
* @internal
|
|
6640
6932
|
*/
|
|
6641
|
-
const getCommandPath = (parsedInput) => match
|
|
6933
|
+
const getCommandPath = (parsedInput) => match(parsedInput.subcommand, {
|
|
6642
6934
|
onNone: () => [],
|
|
6643
6935
|
onSome: (subcommand) => [subcommand.name, ...getCommandPath(subcommand.parsedInput)]
|
|
6644
6936
|
});
|
|
@@ -7977,7 +8269,7 @@ const runWith = (command, config) => {
|
|
|
7977
8269
|
const [, value] = yield* flag.flag.parse(emptyArgs);
|
|
7978
8270
|
program = provideService(program, flag, value);
|
|
7979
8271
|
}
|
|
7980
|
-
const services = match
|
|
8272
|
+
const services = match(logLevel, {
|
|
7981
8273
|
onNone: () => empty$2(),
|
|
7982
8274
|
onSome: (level) => make$66(MinimumLogLevel, level)
|
|
7983
8275
|
});
|
|
@@ -10850,13 +11142,13 @@ const make$56 = gen$1(function* () {
|
|
|
10850
11142
|
`
|
|
10851
11143
|
});
|
|
10852
11144
|
const create = (input) => createPairingLinkRow(input).pipe(mapError(toPersistenceSqlOrDecodeError$2("AuthPairingLinkRepository.create:query", "AuthPairingLinkRepository.create:encodeRequest", { pairingLinkId: input.id })));
|
|
10853
|
-
const consumeAvailable = (input) => consumeAvailablePairingLinkRow(input).pipe(mapError(toPersistenceSqlOrDecodeError$2("AuthPairingLinkRepository.consumeAvailable:query", "AuthPairingLinkRepository.consumeAvailable:decodeRow")), flatMap$1((rowOption) => match
|
|
11145
|
+
const consumeAvailable = (input) => consumeAvailablePairingLinkRow(input).pipe(mapError(toPersistenceSqlOrDecodeError$2("AuthPairingLinkRepository.consumeAvailable:query", "AuthPairingLinkRepository.consumeAvailable:decodeRow")), flatMap$1((rowOption) => match(rowOption, {
|
|
10854
11146
|
onNone: () => succeedNone,
|
|
10855
11147
|
onSome: (row) => decodeAuthPairingLinkDbRow(row).pipe(mapError((cause) => PersistenceDecodeError.fromSchemaError("AuthPairingLinkRepository.consumeAvailable:decodeRow", cause, { pairingLinkId: row.id })), asSome)
|
|
10856
11148
|
})));
|
|
10857
11149
|
const listActive = (input) => listActivePairingLinkRows(input).pipe(mapError(toPersistenceSqlOrDecodeError$2("AuthPairingLinkRepository.listActive:query", "AuthPairingLinkRepository.listActive:decodeRows")), flatMap$1((rows) => forEach(rows, (row) => decodeAuthPairingLinkDbRow(row).pipe(mapError((cause) => PersistenceDecodeError.fromSchemaError("AuthPairingLinkRepository.listActive:decodeRows", cause, { pairingLinkId: row.id }))))));
|
|
10858
11150
|
const revoke = (input) => revokePairingLinkRow(input).pipe(mapError(toPersistenceSqlOrDecodeError$2("AuthPairingLinkRepository.revoke:query", "AuthPairingLinkRepository.revoke:decodeRows", { pairingLinkId: input.id })), map$3((rows) => rows.length > 0));
|
|
10859
|
-
const getByCredential = (input) => getPairingLinkRowByCredential(input).pipe(mapError(toPersistenceSqlOrDecodeError$2("AuthPairingLinkRepository.getByCredential:query", "AuthPairingLinkRepository.getByCredential:decodeRow")), flatMap$1((rowOption) => match
|
|
11151
|
+
const getByCredential = (input) => getPairingLinkRowByCredential(input).pipe(mapError(toPersistenceSqlOrDecodeError$2("AuthPairingLinkRepository.getByCredential:query", "AuthPairingLinkRepository.getByCredential:decodeRow")), flatMap$1((rowOption) => match(rowOption, {
|
|
10860
11152
|
onNone: () => succeedNone,
|
|
10861
11153
|
onSome: (row) => decodeAuthPairingLinkDbRow(row).pipe(mapError((cause) => PersistenceDecodeError.fromSchemaError("AuthPairingLinkRepository.getByCredential:decodeRow", cause, { pairingLinkId: row.id })), asSome)
|
|
10862
11154
|
})));
|
|
@@ -11453,7 +11745,7 @@ const make$54 = gen$1(function* () {
|
|
|
11453
11745
|
const create = (input) => createSessionRow(input).pipe(mapError(toPersistenceSqlOrDecodeError$1("AuthSessionRepository.create:query", "AuthSessionRepository.create:encodeRequest", { sessionId: input.sessionId })));
|
|
11454
11746
|
const createReplacingActive = (input) => sql.withTransaction(revokeActiveSessionsForReplacement(input).pipe(flatMap$1((revokedRows) => createSessionRow(input.session).pipe(as(revokedRows.map((row) => row.sessionId)))))).pipe(mapError(toPersistenceSqlOrDecodeError$1("AuthSessionRepository.createReplacingActive:query", "AuthSessionRepository.createReplacingActive:encodeRequest", { sessionId: input.session.sessionId })));
|
|
11455
11747
|
const createIfAbsent = (input) => createSessionRowIfAbsent(input).pipe(mapError(toPersistenceSqlOrDecodeError$1("AuthSessionRepository.createIfAbsent:query", "AuthSessionRepository.createIfAbsent:encodeRequest", { sessionId: input.sessionId })));
|
|
11456
|
-
const getById = (input) => getSessionRowById(input).pipe(mapError(toPersistenceSqlOrDecodeError$1("AuthSessionRepository.getById:query", "AuthSessionRepository.getById:decodeRow", { sessionId: input.sessionId })), flatMap$1((rowOption) => match
|
|
11748
|
+
const getById = (input) => getSessionRowById(input).pipe(mapError(toPersistenceSqlOrDecodeError$1("AuthSessionRepository.getById:query", "AuthSessionRepository.getById:decodeRow", { sessionId: input.sessionId })), flatMap$1((rowOption) => match(rowOption, {
|
|
11457
11749
|
onNone: () => succeedNone,
|
|
11458
11750
|
onSome: (row) => decodeAuthSessionDbRow(row).pipe(mapError((cause) => PersistenceDecodeError.fromSchemaError("AuthSessionRepository.getById:decodeRow", cause, { sessionId: input.sessionId })), map$3((decodedRow) => some(toAuthSessionRecord(decodedRow))))
|
|
11459
11751
|
})));
|
|
@@ -14289,7 +14581,7 @@ const make$52 = ({ dumpSchema = () => void_ }) => ({ loader, schemaDirectory, ta
|
|
|
14289
14581
|
migration_id,
|
|
14290
14582
|
name
|
|
14291
14583
|
})))}`.withoutTransform;
|
|
14292
|
-
const latestMigration = map$3(sql`SELECT migration_id, name, created_at FROM ${sql(table)} ORDER BY migration_id DESC`.withoutTransform, (_) => map$
|
|
14584
|
+
const latestMigration = map$3(sql`SELECT migration_id, name, created_at FROM ${sql(table)} ORDER BY migration_id DESC`.withoutTransform, (_) => map$4(fromNullishOr(_[0]), ({ created_at, migration_id, name }) => ({
|
|
14293
14585
|
id: migration_id,
|
|
14294
14586
|
name,
|
|
14295
14587
|
createdAt: created_at
|
|
@@ -14314,7 +14606,7 @@ const make$52 = ({ dumpSchema = () => void_ }) => ({ loader, schemaDirectory, ta
|
|
|
14314
14606
|
pg: () => sql`LOCK TABLE ${sql(table)} IN ACCESS EXCLUSIVE MODE`,
|
|
14315
14607
|
orElse: () => void_
|
|
14316
14608
|
});
|
|
14317
|
-
const [latestMigrationId, current] = yield* all([map$3(latestMigration, match
|
|
14609
|
+
const [latestMigrationId, current] = yield* all([map$3(latestMigration, match({
|
|
14318
14610
|
onNone: () => 0,
|
|
14319
14611
|
onSome: (_) => _.id
|
|
14320
14612
|
})), loader]);
|
|
@@ -14337,7 +14629,7 @@ const make$52 = ({ dumpSchema = () => void_ }) => ({ loader, schemaDirectory, ta
|
|
|
14337
14629
|
message: "Migrations already running"
|
|
14338
14630
|
}) : error));
|
|
14339
14631
|
yield* forEach(required, ([id, name, effect]) => logDebug(`Running migration`).pipe(flatMap$1(() => runMigration(id, name, effect)), annotateLogs("migration_id", String(id)), annotateLogs("migration_name", name), withSpan(`Migrator ${id}_${name}`)), { discard: true });
|
|
14340
|
-
yield* pipe(latestMigration, flatMap$1(match
|
|
14632
|
+
yield* pipe(latestMigration, flatMap$1(match({
|
|
14341
14633
|
onNone: () => logDebug(`Migrations complete`),
|
|
14342
14634
|
onSome: (_) => logDebug(`Migrations complete`).pipe(annotateLogs("latest_migration_id", _.id.toString()), annotateLogs("latest_migration_name", _.name))
|
|
14343
14635
|
})));
|
|
@@ -14362,7 +14654,7 @@ const isConstraintConflict = (error) => error.reason._tag === "ConstraintError"
|
|
|
14362
14654
|
* @category loaders
|
|
14363
14655
|
* @since 4.0.0
|
|
14364
14656
|
*/
|
|
14365
|
-
const fromRecord = (migrations) => pipe(Object.keys(migrations), flatMapNullishOr((_) => _.match(/^(\d+)_(.+)$/)), map$
|
|
14657
|
+
const fromRecord = (migrations) => pipe(Object.keys(migrations), flatMapNullishOr((_) => _.match(/^(\d+)_(.+)$/)), map$5(([key, id, name]) => [
|
|
14366
14658
|
Number(id),
|
|
14367
14659
|
name,
|
|
14368
14660
|
succeed$1(migrations[key])
|
|
@@ -18397,7 +18689,7 @@ const EnvServerConfig = all$1({
|
|
|
18397
18689
|
tailscaleServeEnabled: Boolean$5("T3CODE_TAILSCALE_SERVE").pipe(option$1, map$6(getOrUndefined)),
|
|
18398
18690
|
tailscaleServePort: Port("T3CODE_TAILSCALE_SERVE_PORT").pipe(option$1, map$6(getOrUndefined))
|
|
18399
18691
|
});
|
|
18400
|
-
const DevAuthTokenConfig = Redacted("T3CODE_DEV_AUTH_TOKEN").pipe(map$6((token) => make$64(value(token).trim())), mapEffect$1((token) => value(token).length === 0 || value(token).length >= 32 ? succeed$1(token) : fail$2(new ConfigError(new SchemaError(new InvalidValue$1({ message: "T3CODE_DEV_AUTH_TOKEN must contain at least 32 characters." }))))), option$1, map$6(filter((token) => value(token).length > 0)), map$6(getOrUndefined));
|
|
18692
|
+
const DevAuthTokenConfig = Redacted("T3CODE_DEV_AUTH_TOKEN").pipe(map$6((token) => make$64(value(token).trim())), mapEffect$1((token) => value(token).length === 0 || value(token).length >= 32 ? succeed$1(token) : fail$2(new ConfigError(new SchemaError(new InvalidValue$1({ message: "T3CODE_DEV_AUTH_TOKEN must contain at least 32 characters." }))))), option$1, map$6(filter$1((token) => value(token).length > 0)), map$6(getOrUndefined));
|
|
18401
18693
|
const authLocationFlags = {
|
|
18402
18694
|
baseDir: baseDirFlag,
|
|
18403
18695
|
devUrl: devUrlFlag
|
|
@@ -18451,7 +18743,7 @@ const resolveServerConfig = (flags, cliLogLevel, options) => gen$1(function* ()
|
|
|
18451
18743
|
const bootstrapEnvelope = bootstrapFd !== void 0 ? yield* readBootstrapEnvelope(DesktopBackendBootstrap, bootstrapFd) : none$1();
|
|
18452
18744
|
const bootstrap = getOrUndefined(bootstrapEnvelope);
|
|
18453
18745
|
const mode = getOrElse(resolveOptionPrecedence(normalizedFlags.mode, fromUndefinedOr(env.mode), fromUndefinedOr(bootstrap?.mode)), () => "web");
|
|
18454
|
-
const port = yield* match
|
|
18746
|
+
const port = yield* match(resolveOptionPrecedence(normalizedFlags.port, fromUndefinedOr(env.port), fromUndefinedOr(bootstrap?.port)), {
|
|
18455
18747
|
onSome: (value) => succeed$1(value),
|
|
18456
18748
|
onNone: () => {
|
|
18457
18749
|
if (mode === "desktop") return succeed$1(DEFAULT_PORT);
|
|
@@ -18460,7 +18752,7 @@ const resolveServerConfig = (flags, cliLogLevel, options) => gen$1(function* ()
|
|
|
18460
18752
|
});
|
|
18461
18753
|
const devUrl = getOrElse(resolveOptionPrecedence(normalizedFlags.devUrl, fromUndefinedOr(env.devUrl)), () => void 0);
|
|
18462
18754
|
const devAuthToken = mode === "web" && devUrl !== void 0 ? yield* DevAuthTokenConfig : void 0;
|
|
18463
|
-
const explicitBaseDir = resolveOptionPrecedence(normalizedFlags.baseDir, fromUndefinedOr(env.t3Home)).pipe(filter((value) => value.trim().length > 0));
|
|
18755
|
+
const explicitBaseDir = resolveOptionPrecedence(normalizedFlags.baseDir, fromUndefinedOr(env.t3Home)).pipe(filter$1((value) => value.trim().length > 0));
|
|
18464
18756
|
const baseDir = yield* resolveBaseDir(getOrUndefined(resolveOptionPrecedence(explicitBaseDir, fromUndefinedOr(bootstrap?.t3Home))));
|
|
18465
18757
|
const rawCwd = getOrElse(normalizedFlags.cwd, () => process.cwd());
|
|
18466
18758
|
const cwd = path.resolve(yield* expandHomePath(rawCwd.trim()));
|
|
@@ -24454,7 +24746,7 @@ const DETACHED_IGNORE_STDIO_OPTIONS = {
|
|
|
24454
24746
|
stdout: "ignore",
|
|
24455
24747
|
stderr: "ignore"
|
|
24456
24748
|
};
|
|
24457
|
-
const compactEnv = (input) => Object.fromEntries(Object.entries(input).flatMap(([key, value]) => match
|
|
24749
|
+
const compactEnv = (input) => Object.fromEntries(Object.entries(input).flatMap(([key, value]) => match(value, {
|
|
24458
24750
|
onNone: () => [],
|
|
24459
24751
|
onSome: (resolved) => [[key, resolved]]
|
|
24460
24752
|
})));
|
|
@@ -24497,12 +24789,12 @@ function resolveCommandEditorArgs(editor, target) {
|
|
|
24497
24789
|
switch (editor.launchStyle) {
|
|
24498
24790
|
case "direct-path": return [target];
|
|
24499
24791
|
case "goto": return isSome(parsedTarget) ? ["--goto", target] : [target];
|
|
24500
|
-
case "line-column": return match
|
|
24792
|
+
case "line-column": return match(parsedTarget, {
|
|
24501
24793
|
onNone: () => [target],
|
|
24502
24794
|
onSome: ({ path, line, column }) => [
|
|
24503
24795
|
"--line",
|
|
24504
24796
|
line,
|
|
24505
|
-
...match
|
|
24797
|
+
...match(column, {
|
|
24506
24798
|
onNone: () => [],
|
|
24507
24799
|
onSome: (value) => ["--column", value]
|
|
24508
24800
|
}),
|
|
@@ -26076,7 +26368,7 @@ const probeTailscaleHttpsEndpoint = (input) => gen$1(function* () {
|
|
|
26076
26368
|
const request = get$2(url.toString());
|
|
26077
26369
|
return yield* client.execute(request);
|
|
26078
26370
|
}).pipe(timeoutOption(input.timeout ?? TAILSCALE_PROBE_TIMEOUT));
|
|
26079
|
-
return match
|
|
26371
|
+
return match(response, {
|
|
26080
26372
|
onNone: () => false,
|
|
26081
26373
|
onSome: (httpResponse) => httpResponse.status >= 200 && httpResponse.status < 300
|
|
26082
26374
|
});
|
|
@@ -27004,10 +27296,10 @@ const layer$76 = effect(ProjectService, gen$1(function* () {
|
|
|
27004
27296
|
cause
|
|
27005
27297
|
})
|
|
27006
27298
|
});
|
|
27007
|
-
const getById = (projectId) => all.pipe(map$3((projects) => map$
|
|
27299
|
+
const getById = (projectId) => all.pipe(map$3((projects) => map$4(fromUndefinedOr(projects.find((project) => project.id === projectId)), toProject)));
|
|
27008
27300
|
const getByWorkspaceRoot = (workspaceRoot) => all.pipe(map$3((projects) => {
|
|
27009
27301
|
const root = realpathOrSelf$1(workspaceRoot);
|
|
27010
|
-
return map$
|
|
27302
|
+
return map$4(fromUndefinedOr(projects.find((project) => project.workspaceRoot === root)), toProject);
|
|
27011
27303
|
}));
|
|
27012
27304
|
const listShells = (options) => all.pipe(map$3((projects) => projects.filter((project) => options?.projectIds === void 0 || options.projectIds.includes(ProjectId.make(project.id))).map(toShell)));
|
|
27013
27305
|
return ProjectService.of({
|
|
@@ -27612,6 +27904,14 @@ const editorChoices = (detected) => [
|
|
|
27612
27904
|
];
|
|
27613
27905
|
//#endregion
|
|
27614
27906
|
//#region src/cli/peerCoreMenu.ts
|
|
27907
|
+
/**
|
|
27908
|
+
* `peer core create`, `peer core invite`, and the menu `peer core login` opens on a terminal: what
|
|
27909
|
+
* a signed-in person can do next (accept an invitation or a founding, create a workspace, share
|
|
27910
|
+
* this folder, invite someone, connect an editor), asked until they are done. Every step is one
|
|
27911
|
+
* of the commands, so a script does the same without the menu.
|
|
27912
|
+
*
|
|
27913
|
+
* @module cli/peerCoreMenu
|
|
27914
|
+
*/
|
|
27615
27915
|
/** Who may invite to a workspace: its owners and admins (a project's lead does it in the app). */
|
|
27616
27916
|
const inviter = (role) => role === "owner" || role === "admin";
|
|
27617
27917
|
/** `peer core create <name> [--slug <slug>]`: a workspace whose owner is the signed-in person. */
|
|
@@ -27649,6 +27949,53 @@ const invite = (input, status, io) => gen$1(function* () {
|
|
|
27649
27949
|
yield* io.say(failed === void 0 || failed === null ? `The invitation is mailed; ${email} joins with its link, or with peer core join ${slug} once signed in.` : `The mail failed (${failed}); ${email} can still sign in and run peer core join ${slug}.`);
|
|
27650
27950
|
return result;
|
|
27651
27951
|
});
|
|
27952
|
+
/** Where people keep clones, under the home directory; each looked into two levels deep. */
|
|
27953
|
+
const REPOSITORY_ROOTS = [
|
|
27954
|
+
"code",
|
|
27955
|
+
"Code",
|
|
27956
|
+
"projects",
|
|
27957
|
+
"Projects",
|
|
27958
|
+
"src",
|
|
27959
|
+
"dev",
|
|
27960
|
+
"Developer",
|
|
27961
|
+
"git",
|
|
27962
|
+
"repos",
|
|
27963
|
+
"work",
|
|
27964
|
+
"Documents/GitHub",
|
|
27965
|
+
"Desktop",
|
|
27966
|
+
".superset/projects",
|
|
27967
|
+
".t3/projects",
|
|
27968
|
+
".peer/projects"
|
|
27969
|
+
];
|
|
27970
|
+
const SKIPPED = /* @__PURE__ */ new Set([
|
|
27971
|
+
"node_modules",
|
|
27972
|
+
"dist",
|
|
27973
|
+
"build",
|
|
27974
|
+
"target",
|
|
27975
|
+
"vendor",
|
|
27976
|
+
"Library"
|
|
27977
|
+
]);
|
|
27978
|
+
/**
|
|
27979
|
+
* The Git or Jujutsu repositories under the usual folders of `home`, the most recently touched
|
|
27980
|
+
* first, at most `limit`: what "Share a project from this computer" offers before browsing.
|
|
27981
|
+
*/
|
|
27982
|
+
async function findRepositories(home, limit = 25) {
|
|
27983
|
+
const found = /* @__PURE__ */ new Map();
|
|
27984
|
+
const look = async (dir, depth) => {
|
|
27985
|
+
const entries = await NodeFSP.readdir(dir, { withFileTypes: true }).catch(() => []);
|
|
27986
|
+
const marker = entries.find((e) => e.name === ".git" || e.name === ".jj");
|
|
27987
|
+
if (marker !== void 0) {
|
|
27988
|
+
const stat = await NodeFSP.stat(NodePath.join(dir, marker.name)).catch(() => null);
|
|
27989
|
+
found.set(dir, stat?.mtimeMs ?? 0);
|
|
27990
|
+
return;
|
|
27991
|
+
}
|
|
27992
|
+
if (depth === 0) return;
|
|
27993
|
+
await Promise.all(entries.filter((e) => e.isDirectory() && !e.name.startsWith(".") && !SKIPPED.has(e.name)).map((e) => look(NodePath.join(dir, e.name), depth - 1)));
|
|
27994
|
+
};
|
|
27995
|
+
const roots = await Promise.all(REPOSITORY_ROOTS.map((root) => NodeFSP.realpath(NodePath.join(home, root)).catch(() => null)));
|
|
27996
|
+
await Promise.all([...new Set(roots.filter((root) => root !== null))].map((root) => look(root, 2)));
|
|
27997
|
+
return [...found.entries()].sort((a, b) => b[1] - a[1]).slice(0, limit).map(([dir]) => dir);
|
|
27998
|
+
}
|
|
27652
27999
|
/**
|
|
27653
28000
|
* What the menu offers now: what waits for the person first (invitations, foundings, a domain
|
|
27654
28001
|
* match), then sharing `folder` when it is a repository no workspace has, inviting where they may,
|
|
@@ -27678,6 +28025,10 @@ const menuItems = (status, folder) => [
|
|
|
27678
28025
|
folder
|
|
27679
28026
|
}
|
|
27680
28027
|
}],
|
|
28028
|
+
...status.workspaces.length === 0 ? [] : [{
|
|
28029
|
+
title: "Share a project from this computer…",
|
|
28030
|
+
value: { kind: "browse" }
|
|
28031
|
+
}],
|
|
27681
28032
|
...status.workspaces.filter((w) => inviter(w.role)).map((w) => ({
|
|
27682
28033
|
title: `Invite someone to ${w.name} (${w.slug})`,
|
|
27683
28034
|
value: {
|
|
@@ -27717,6 +28068,26 @@ const menu = (ask, steps, io) => gen$1(function* () {
|
|
|
27717
28068
|
case "domain": return yield* steps.join(item.slug);
|
|
27718
28069
|
case "founding": return yield* steps.founding(item.slug);
|
|
27719
28070
|
case "share": return yield* steps.share(item.folder);
|
|
28071
|
+
case "browse": {
|
|
28072
|
+
const found = yield* steps.repositories;
|
|
28073
|
+
const picked = yield* ask.choose(found.length === 0 ? "No repositories found in the usual folders" : "Which project?", [
|
|
28074
|
+
...found.map((dir) => ({
|
|
28075
|
+
title: dir,
|
|
28076
|
+
value: dir
|
|
28077
|
+
})),
|
|
28078
|
+
{
|
|
28079
|
+
title: "Browse folders…",
|
|
28080
|
+
value: "browse"
|
|
28081
|
+
},
|
|
28082
|
+
{
|
|
28083
|
+
title: "Type a path…",
|
|
28084
|
+
value: "type"
|
|
28085
|
+
}
|
|
28086
|
+
]);
|
|
28087
|
+
const folder = picked === "browse" ? yield* ask.folder("The project's folder (Enter, then y opens a folder, n chooses it)") : picked === "type" ? yield* ask.text("The project's folder (a path)") : picked;
|
|
28088
|
+
if (folder !== null && folder.trim() !== "") yield* steps.share(folder.trim());
|
|
28089
|
+
return;
|
|
28090
|
+
}
|
|
27720
28091
|
case "editor": return yield* steps.editor;
|
|
27721
28092
|
case "create": {
|
|
27722
28093
|
const name = yield* ask.text("The workspace's name");
|
|
@@ -28221,6 +28592,11 @@ const menuAsk = {
|
|
|
28221
28592
|
title,
|
|
28222
28593
|
value: title
|
|
28223
28594
|
}))
|
|
28595
|
+
})).pipe(orElseSucceed(() => null)),
|
|
28596
|
+
folder: (message) => run$3(File({
|
|
28597
|
+
type: "directory",
|
|
28598
|
+
message,
|
|
28599
|
+
startingPath: NodeOS.homedir()
|
|
28224
28600
|
})).pipe(orElseSucceed(() => null))
|
|
28225
28601
|
};
|
|
28226
28602
|
/** A Hub's refusal as the CLI prints it; other failures unchanged. */
|
|
@@ -28241,11 +28617,20 @@ const runMenu = (stateDir) => gen$1(function* () {
|
|
|
28241
28617
|
join: (slug) => join({ target: slug }, terminalIo).pipe(flatMap$1((joined) => sayNextStep(joined, terminalIo)), hubFailure),
|
|
28242
28618
|
founding: (slug) => workspaces.acceptFounding({ slug }).pipe(andThen(log(`Accepted: ${slug}. You are its owner.`)), hubFailure),
|
|
28243
28619
|
create: (name) => create({ name }, terminalIo).pipe(asVoid, hubFailure),
|
|
28244
|
-
|
|
28620
|
+
repositories: gen$1(function* () {
|
|
28621
|
+
const found = yield* promise(() => findRepositories(NodeOS.homedir()));
|
|
28622
|
+
const open = [];
|
|
28623
|
+
for (const dir of found) {
|
|
28624
|
+
const place = yield* state.placeOf(dir, { bindByRemote: false });
|
|
28625
|
+
if (place === null || place.workspace === "@local") open.push(dir);
|
|
28626
|
+
}
|
|
28627
|
+
return open;
|
|
28628
|
+
}),
|
|
28629
|
+
share: (path) => shareFolder(path.replace(/^~(?=$|\/)/, NodeOS.homedir()), process.cwd()).pipe(flatMap$1(({ folder }) => share({
|
|
28245
28630
|
folder,
|
|
28246
28631
|
named: true,
|
|
28247
28632
|
yes: false
|
|
28248
|
-
}, shareAsk, terminalIo, registerIn(stateDir))
|
|
28633
|
+
}, shareAsk, terminalIo, registerIn(stateDir))), hubFailure),
|
|
28249
28634
|
invite: (input) => status.pipe(flatMap$1((now) => invite(input, now, terminalIo)), asVoid, hubFailure),
|
|
28250
28635
|
editor: gen$1(function* () {
|
|
28251
28636
|
const editor = yield* shareAsk.choose("Connect which editor?", editorChoices(yield* detectedEditors));
|
|
@@ -28526,14 +28911,14 @@ const hooksGroup = make$62("hooks").pipe(withDescription("Peer's hooks in Claude
|
|
|
28526
28911
|
const runCommand = make$62("run", {
|
|
28527
28912
|
...authLocationFlags,
|
|
28528
28913
|
words: String$2("command").pipe(withDescription$2("A peer command and its arguments (after --)."), variadic({ min: 1 }))
|
|
28529
|
-
}).pipe(withDescription("Internal: run a peer command through the running Peer."), withHandler((flags) => gen$1(function* () {
|
|
28914
|
+
}).pipe(withDescription("Internal: run a peer command through the running Peer."), unlisted, withHandler((flags) => gen$1(function* () {
|
|
28530
28915
|
const config = yield* resolveConfig(flags);
|
|
28531
28916
|
const [command, ...args] = flags.words;
|
|
28532
28917
|
if (command === void 0 || !/^[A-Za-z0-9_.-]+$/.test(command)) return yield* fail(`peer: ${command ?? ""} is not a peer command.`);
|
|
28533
28918
|
if ((yield* ownerOf(config.stateDir)) === null) return yield* fail("peer: Peer is not running. Start it with peer core serve, or open the Peer app.");
|
|
28534
28919
|
return yield* forward(config.stateDir, command, args, process.cwd());
|
|
28535
28920
|
})));
|
|
28536
|
-
const makePeerCommand = (name) => make$62(name).pipe(withDescription(name === "peer" ? "Peer's coordination without the Peer app (Peer Core; also peer core …)."
|
|
28921
|
+
const makePeerCommand = (name) => make$62(name).pipe(withDescription(name === "peer-core" ? "The former name of t3 peer, kept for shims written before it." : "Peer's coordination without the Peer app (Peer Core; also peer core …)."), withSubcommands([
|
|
28537
28922
|
serveCommand$1,
|
|
28538
28923
|
stopCommand,
|
|
28539
28924
|
statusCommand,
|
|
@@ -28554,6 +28939,8 @@ const makePeerCommand = (name) => make$62(name).pipe(withDescription(name === "p
|
|
|
28554
28939
|
const peerCommand = makePeerCommand("peer");
|
|
28555
28940
|
/** Shims from the previous build run `<launch> peer-core serve --detach`. */
|
|
28556
28941
|
const peerCoreCommand = makePeerCommand("peer-core");
|
|
28942
|
+
/** The npm package's `peer core …`, under a root of its own so help names `peer core`, not `t3 peer`. */
|
|
28943
|
+
const npmCoreCommand = makePeerCommand("core");
|
|
28557
28944
|
//#endregion
|
|
28558
28945
|
//#region src/serverOwnership.ts
|
|
28559
28946
|
var ServerAlreadyRunningError = class extends TaggedError()("ServerAlreadyRunningError", { stateDir: String$6 }) {
|
|
@@ -29068,7 +29455,7 @@ const make$43 = gen$1(function* () {
|
|
|
29068
29455
|
});
|
|
29069
29456
|
const upsert = (runtime, options) => (options?.onConflict === "ignore" ? insertRuntimeRow(runtime) : upsertRuntimeRow(runtime)).pipe(mapError(toPersistenceSqlOrDecodeError("ProviderSessionRuntimeRepository.upsert:query", "ProviderSessionRuntimeRepository.upsert:encodeRequest", { threadId: runtime.threadId })));
|
|
29070
29457
|
const recordImportedTranscript = (input) => recordImportedTranscriptRow(input).pipe(mapError(toPersistenceSqlOrDecodeError("ProviderSessionRuntimeRepository.recordImportedTranscript:query", "ProviderSessionRuntimeRepository.recordImportedTranscript:encodeRequest", { threadId: input.threadId })));
|
|
29071
|
-
const getByThreadId = (input) => getRuntimeRowByThreadId(input).pipe(mapError(toPersistenceSqlOrDecodeError("ProviderSessionRuntimeRepository.getByThreadId:query", "ProviderSessionRuntimeRepository.getByThreadId:decodeRow", { threadId: input.threadId })), flatMap$1((runtimeRowOption) => match
|
|
29458
|
+
const getByThreadId = (input) => getRuntimeRowByThreadId(input).pipe(mapError(toPersistenceSqlOrDecodeError("ProviderSessionRuntimeRepository.getByThreadId:query", "ProviderSessionRuntimeRepository.getByThreadId:decodeRow", { threadId: input.threadId })), flatMap$1((runtimeRowOption) => match(runtimeRowOption, {
|
|
29072
29459
|
onNone: () => succeedNone,
|
|
29073
29460
|
onSome: (row) => decodeRuntimeRow(row).pipe(mapError((cause) => PersistenceDecodeError.fromSchemaError("ProviderSessionRuntimeRepository.getByThreadId:decodeRow", cause, { threadId: input.threadId })), asSome)
|
|
29074
29461
|
})));
|
|
@@ -30886,16 +31273,16 @@ function transcriptIdentity(filePath, stats) {
|
|
|
30886
31273
|
return {
|
|
30887
31274
|
filePath,
|
|
30888
31275
|
size: Number(stats.size),
|
|
30889
|
-
mtimeMs: match
|
|
31276
|
+
mtimeMs: match(stats.mtime, {
|
|
30890
31277
|
onNone: () => null,
|
|
30891
31278
|
onSome: (date) => date.getTime()
|
|
30892
31279
|
}),
|
|
30893
31280
|
device: Number(stats.dev),
|
|
30894
|
-
inode: match
|
|
31281
|
+
inode: match(stats.ino, {
|
|
30895
31282
|
onNone: () => null,
|
|
30896
31283
|
onSome: Number
|
|
30897
31284
|
}),
|
|
30898
|
-
birthtimeMs: match
|
|
31285
|
+
birthtimeMs: match(stats.birthtime, {
|
|
30899
31286
|
onNone: () => null,
|
|
30900
31287
|
onSome: (date) => date.getTime()
|
|
30901
31288
|
})
|
|
@@ -31577,7 +31964,7 @@ const make$41 = gen$1(function* () {
|
|
|
31577
31964
|
const project = yield* projects.getById(input.projectId).pipe(mapError((cause) => new AgentSessionScanError({
|
|
31578
31965
|
operation: "read-projects",
|
|
31579
31966
|
cause
|
|
31580
|
-
})), flatMap$1(match
|
|
31967
|
+
})), flatMap$1(match({
|
|
31581
31968
|
onNone: () => fail$2(new AgentSessionImportProjectNotFoundError({ projectId: input.projectId })),
|
|
31582
31969
|
onSome: succeed$1
|
|
31583
31970
|
})));
|
|
@@ -33573,7 +33960,7 @@ const layerWithOptions$1 = (options = {}) => effect(OrchestrationEffectWorkerV2,
|
|
|
33573
33960
|
const workerId = options.workerId ?? `orchestration-v2:${process.pid}`;
|
|
33574
33961
|
const leaseDurationMs = Math.max(1, options.leaseDurationMs ?? 3e4);
|
|
33575
33962
|
const maxAttempts = Math.max(1, options.maxAttempts ?? 5);
|
|
33576
|
-
const wasCancelled = (effectId) => outbox.get(effectId).pipe(map$3(match
|
|
33963
|
+
const wasCancelled = (effectId) => outbox.get(effectId).pipe(map$3(match({
|
|
33577
33964
|
onNone: () => false,
|
|
33578
33965
|
onSome: (effect) => effect.status === "cancelled"
|
|
33579
33966
|
})));
|
|
@@ -33722,7 +34109,7 @@ const runDaemonWithOptions = (options = {}) => scoped(gen$1(function* () {
|
|
|
33722
34109
|
}
|
|
33723
34110
|
const nextClaimableAt = yield* worker.nextClaimableAt.pipe(catchCause((cause) => logWarning("Failed to read the next orchestration effect deadline", cause).pipe(as(none$1()))));
|
|
33724
34111
|
const now$10 = toEpochMillis(yield* now);
|
|
33725
|
-
const sleepMs = match
|
|
34112
|
+
const sleepMs = match(nextClaimableAt, {
|
|
33726
34113
|
onNone: () => livenessPollIntervalMs,
|
|
33727
34114
|
onSome: (availableAt) => {
|
|
33728
34115
|
const untilAvailable = toEpochMillis(availableAt) - now$10;
|
|
@@ -35188,7 +35575,7 @@ const make$36 = gen$1(function* () {
|
|
|
35188
35575
|
ancestor = pathKey(path.dirname(ancestor));
|
|
35189
35576
|
referencedAncestors.add(ancestor);
|
|
35190
35577
|
}
|
|
35191
|
-
const projectRoots = (yield* forEach(yield* filter
|
|
35578
|
+
const projectRoots = (yield* forEach(yield* filter(projects, (project) => fs.exists(path.resolve(project.workspaceRoot)).pipe(orElseSucceed(() => true))), (project) => {
|
|
35192
35579
|
const resolved = path.resolve(project.workspaceRoot);
|
|
35193
35580
|
return fs.realPath(resolved).pipe(orElseSucceed(() => resolved), map$3((realPath) => [resolved, realPath]));
|
|
35194
35581
|
})).flat();
|
|
@@ -36112,7 +36499,7 @@ const QUIET_REREAD_MS = 6e5;
|
|
|
36112
36499
|
*/
|
|
36113
36500
|
const FINGERPRINT_REREAD_MS = 18e5;
|
|
36114
36501
|
const isProviderError = is(PullRequestProviderError);
|
|
36115
|
-
const isRateLimited = (cause) => match
|
|
36502
|
+
const isRateLimited = (cause) => match(findErrorOption(cause), {
|
|
36116
36503
|
onNone: () => false,
|
|
36117
36504
|
onSome: (error) => error._tag === "PullRequestOperationError" && isProviderError(error.cause) && error.cause.reason === "rate-limited"
|
|
36118
36505
|
});
|
|
@@ -39591,7 +39978,7 @@ const runProviderMaintenanceCommandWithSpawner = fn("ProviderMaintenanceRunner.r
|
|
|
39591
39978
|
stdoutTruncated: stdout.truncated,
|
|
39592
39979
|
stderrTruncated: stderr.truncated
|
|
39593
39980
|
};
|
|
39594
|
-
})().pipe(scoped, timeoutOption(millis(UPDATE_TIMEOUT_MS)), map$3((result) => match
|
|
39981
|
+
})().pipe(scoped, timeoutOption(millis(UPDATE_TIMEOUT_MS)), map$3((result) => match(result, {
|
|
39595
39982
|
onSome: (value) => value,
|
|
39596
39983
|
onNone: () => ({
|
|
39597
39984
|
stdout: "",
|
|
@@ -44765,26 +45152,26 @@ function aggregate(processes, counters) {
|
|
|
44765
45152
|
};
|
|
44766
45153
|
}
|
|
44767
45154
|
function mergeProcesses(input) {
|
|
44768
|
-
const nativeProcesses = match
|
|
45155
|
+
const nativeProcesses = match(input.nativeSnapshot, {
|
|
44769
45156
|
onNone: () => [],
|
|
44770
45157
|
onSome: (snapshot) => snapshot.processes
|
|
44771
45158
|
});
|
|
44772
|
-
const electronMetrics = match
|
|
45159
|
+
const electronMetrics = match(input.desktopSnapshot, {
|
|
44773
45160
|
onNone: () => [],
|
|
44774
45161
|
onSome: (snapshot) => snapshot.electronProcesses
|
|
44775
45162
|
});
|
|
44776
|
-
const sampledAtMs = match
|
|
44777
|
-
onNone: () => match
|
|
45163
|
+
const sampledAtMs = match(input.nativeSnapshot, {
|
|
45164
|
+
onNone: () => match(input.desktopSnapshot, {
|
|
44778
45165
|
onNone: () => input.fallbackSampledAtMs,
|
|
44779
45166
|
onSome: (snapshot) => snapshot.sampledAtUnixMs
|
|
44780
45167
|
}),
|
|
44781
|
-
onSome: (native) => match
|
|
45168
|
+
onSome: (native) => match(input.desktopSnapshot, {
|
|
44782
45169
|
onNone: () => native.sampledAtUnixMs,
|
|
44783
45170
|
onSome: (desktop) => Math.max(native.sampledAtUnixMs, desktop.sampledAtUnixMs)
|
|
44784
45171
|
})
|
|
44785
45172
|
});
|
|
44786
|
-
const nativeSampledAtMs = map$
|
|
44787
|
-
const desktopSampledAtMs = map$
|
|
45173
|
+
const nativeSampledAtMs = map$4(input.nativeSnapshot, (snapshot) => snapshot.sampledAtUnixMs);
|
|
45174
|
+
const desktopSampledAtMs = map$4(input.desktopSnapshot, (snapshot) => snapshot.sampledAtUnixMs);
|
|
44788
45175
|
const nativeProcessPids = new Set(nativeProcesses.map((process) => process.pid));
|
|
44789
45176
|
const nativeByPid = new Map(nativeProcesses.map((process) => [process.pid, process]));
|
|
44790
45177
|
const metricsByPid = /* @__PURE__ */ new Map();
|
|
@@ -45034,7 +45421,7 @@ function buildResourceTelemetryHistory(input) {
|
|
|
45034
45421
|
for (const snapshot of snapshots) {
|
|
45035
45422
|
const deltaWindowFraction = previousSnapshotAtMs !== void 0 && previousSnapshotAtMs < windowStartMs && snapshot.sampledAtUnixMs > previousSnapshotAtMs ? Math.max(0, Math.min(1, (snapshot.sampledAtUnixMs - windowStartMs) / (snapshot.sampledAtUnixMs - previousSnapshotAtMs))) : 1;
|
|
45036
45423
|
previousSnapshotAtMs = snapshot.sampledAtUnixMs;
|
|
45037
|
-
const recordedExternalProcesses = snapshot.externalProcesses ?? match
|
|
45424
|
+
const recordedExternalProcesses = snapshot.externalProcesses ?? match(input.desktopSnapshot, {
|
|
45038
45425
|
onNone: () => [],
|
|
45039
45426
|
onSome: (desktopSnapshot) => [{
|
|
45040
45427
|
pid: desktopSnapshot.electronPid,
|
|
@@ -45152,22 +45539,22 @@ function buildHealth(input) {
|
|
|
45152
45539
|
lastSampleAt: input.desktop.lastSampleAt,
|
|
45153
45540
|
lastError: input.desktop.lastError
|
|
45154
45541
|
},
|
|
45155
|
-
sidecarVersion: map$
|
|
45156
|
-
sidecarPid: map$
|
|
45542
|
+
sidecarVersion: map$4(input.native.hello, (hello) => hello.sidecarVersion),
|
|
45543
|
+
sidecarPid: map$4(input.native.hello, (hello) => hello.sidecarPid),
|
|
45157
45544
|
restartCount: input.native.restartCount,
|
|
45158
|
-
collectionDurationMicros: match
|
|
45545
|
+
collectionDurationMicros: match(input.nativeSnapshot, {
|
|
45159
45546
|
onNone: () => 0,
|
|
45160
45547
|
onSome: (snapshot) => snapshot.collectionDurationMicros
|
|
45161
45548
|
}),
|
|
45162
|
-
scannedProcessCount: match
|
|
45549
|
+
scannedProcessCount: match(input.nativeSnapshot, {
|
|
45163
45550
|
onNone: () => 0,
|
|
45164
45551
|
onSome: (snapshot) => snapshot.scannedProcessCount
|
|
45165
45552
|
}),
|
|
45166
|
-
retainedProcessCount: match
|
|
45553
|
+
retainedProcessCount: match(input.nativeSnapshot, {
|
|
45167
45554
|
onNone: () => 0,
|
|
45168
45555
|
onSome: (snapshot) => snapshot.retainedProcessCount
|
|
45169
45556
|
}),
|
|
45170
|
-
inaccessibleProcessCount: match
|
|
45557
|
+
inaccessibleProcessCount: match(input.nativeSnapshot, {
|
|
45171
45558
|
onNone: () => 0,
|
|
45172
45559
|
onSome: (snapshot) => snapshot.inaccessibleProcessCount
|
|
45173
45560
|
})
|
|
@@ -45198,7 +45585,7 @@ const make$15 = fn("resourceTelemetry.resourceTelemetry.make")(function* () {
|
|
|
45198
45585
|
const initialAttribution = yield* attribution.snapshot;
|
|
45199
45586
|
const initialMerge = mergeProcesses({
|
|
45200
45587
|
serverPid: process.pid,
|
|
45201
|
-
sidecarPid: map$
|
|
45588
|
+
sidecarPid: map$4(initialNativeHealth.hello, (hello) => hello.sidecarPid),
|
|
45202
45589
|
fallbackSampledAtMs: toEpochMillis(initialReadAt),
|
|
45203
45590
|
nativeSnapshot: none$1(),
|
|
45204
45591
|
desktopSnapshot: initialDesktop,
|
|
@@ -45211,7 +45598,7 @@ const make$15 = fn("resourceTelemetry.resourceTelemetry.make")(function* () {
|
|
|
45211
45598
|
sampleIntervalMs: initialNativeHealth.sampleIntervalMs,
|
|
45212
45599
|
processes: initialMerge.processes,
|
|
45213
45600
|
groups: initialMerge.groups,
|
|
45214
|
-
power: match
|
|
45601
|
+
power: match(initialDesktop, {
|
|
45215
45602
|
onNone: () => unknownPower(initialReadAt),
|
|
45216
45603
|
onSome: (desktop) => desktop.power
|
|
45217
45604
|
}),
|
|
@@ -45262,19 +45649,19 @@ const make$15 = fn("resourceTelemetry.resourceTelemetry.make")(function* () {
|
|
|
45262
45649
|
const nativeSnapshot = incomingNativeSnapshot ? some(incomingNativeSnapshot.snapshot) : current.nativeSnapshot;
|
|
45263
45650
|
const desktopSnapshot = input.desktopSnapshot ? some(input.desktopSnapshot) : current.desktopSnapshot;
|
|
45264
45651
|
const [desktopHealth, attributionSnapshot] = yield* all([desktopReceiver.health, attribution.snapshot]);
|
|
45265
|
-
const recordedElectronRoots = match
|
|
45652
|
+
const recordedElectronRoots = match(nativeSnapshot, {
|
|
45266
45653
|
onNone: () => [],
|
|
45267
45654
|
onSome: (snapshot) => snapshot.externalProcesses ?? []
|
|
45268
45655
|
});
|
|
45269
45656
|
const electronRootPids = new Set(recordedElectronRoots.map((process) => process.pid));
|
|
45270
|
-
match
|
|
45657
|
+
match(desktopSnapshot, {
|
|
45271
45658
|
onNone: () => void 0,
|
|
45272
45659
|
onSome: (desktop) => electronRootPids.add(desktop.electronPid)
|
|
45273
45660
|
});
|
|
45274
45661
|
const electronRootStartTimes = new Map(recordedElectronRoots.flatMap((process) => process.startTimeMs === void 0 ? [] : [[process.pid, process.startTimeMs]]));
|
|
45275
45662
|
const merged = mergeProcesses({
|
|
45276
45663
|
serverPid: process.pid,
|
|
45277
|
-
sidecarPid: map$
|
|
45664
|
+
sidecarPid: map$4(nativeHealth.hello, (hello) => hello.sidecarPid),
|
|
45278
45665
|
fallbackSampledAtMs: toEpochMillis(current.latest.readAt),
|
|
45279
45666
|
nativeSnapshot,
|
|
45280
45667
|
desktopSnapshot,
|
|
@@ -45290,11 +45677,11 @@ const make$15 = fn("resourceTelemetry.resourceTelemetry.make")(function* () {
|
|
|
45290
45677
|
sampleIntervalMs: nativeHealth.sampleIntervalMs,
|
|
45291
45678
|
processes: merged.processes,
|
|
45292
45679
|
groups: merged.groups,
|
|
45293
|
-
power: match
|
|
45680
|
+
power: match(desktopSnapshot, {
|
|
45294
45681
|
onNone: () => unknownPower(readAt),
|
|
45295
45682
|
onSome: (desktop) => desktop.power
|
|
45296
45683
|
}),
|
|
45297
|
-
speedLimitPercent: match
|
|
45684
|
+
speedLimitPercent: match(desktopSnapshot, {
|
|
45298
45685
|
onNone: () => none$1(),
|
|
45299
45686
|
onSome: (desktop) => desktop.speedLimitPercent
|
|
45300
45687
|
}),
|
|
@@ -45385,7 +45772,7 @@ const make$15 = fn("resourceTelemetry.resourceTelemetry.make")(function* () {
|
|
|
45385
45772
|
bucketMs: normalizedInput.bucketMs,
|
|
45386
45773
|
sampleIntervalMs: nativeHealth.sampleIntervalMs,
|
|
45387
45774
|
serverPid: process.pid,
|
|
45388
|
-
sidecarPid: map$
|
|
45775
|
+
sidecarPid: map$4(nativeHealth.hello, (hello) => hello.sidecarPid),
|
|
45389
45776
|
desktopSnapshot: current.desktopSnapshot,
|
|
45390
45777
|
snapshots: isSuccess$1(historyResult) ? historyResult.success : [],
|
|
45391
45778
|
health: buildHealth({
|
|
@@ -45465,7 +45852,7 @@ const make$14 = fn("makeProcessDiagnostics")(function* () {
|
|
|
45465
45852
|
totalRssBytes: processes.reduce((total, entry) => total + entry.rssBytes, 0),
|
|
45466
45853
|
totalCpuPercent: processes.reduce((total, entry) => total + entry.cpuPercent, 0),
|
|
45467
45854
|
processes,
|
|
45468
|
-
error: map$
|
|
45855
|
+
error: map$4(snapshot.health.native.lastError, (message) => ({ message }))
|
|
45469
45856
|
};
|
|
45470
45857
|
}));
|
|
45471
45858
|
const signal = fn("ProcessDiagnostics.signal")(function* (input) {
|
|
@@ -45566,7 +45953,7 @@ const make$13 = fn("makeProcessResourceMonitor")(function* () {
|
|
|
45566
45953
|
maxProcessCount: bucket.maxProcessCount
|
|
45567
45954
|
})),
|
|
45568
45955
|
topProcesses,
|
|
45569
|
-
error: history.health.native.lastError.pipe(map$
|
|
45956
|
+
error: history.health.native.lastError.pipe(map$4((message) => ({
|
|
45570
45957
|
failureTag: "ProcessDiagnosticsQueryFailedError",
|
|
45571
45958
|
message
|
|
45572
45959
|
})))
|
|
@@ -48168,7 +48555,7 @@ const subscribeOrchestrationV2Shell = fn("ws.orchestrationV2.subscribeShell")(fu
|
|
|
48168
48555
|
projectId: stored.aggregateId
|
|
48169
48556
|
};
|
|
48170
48557
|
const project = yield* projectService.getShell(stored.aggregateId);
|
|
48171
|
-
return match
|
|
48558
|
+
return match(project, {
|
|
48172
48559
|
onNone: () => ({
|
|
48173
48560
|
kind: "project.removed",
|
|
48174
48561
|
sequence: stored.sequence,
|
|
@@ -48356,7 +48743,7 @@ const layerWsRpc = (currentSession, clientOrigin, clientAnalyticsProps, previewA
|
|
|
48356
48743
|
message: `Project ${projectId} is unavailable.`,
|
|
48357
48744
|
cause
|
|
48358
48745
|
})));
|
|
48359
|
-
return yield* match
|
|
48746
|
+
return yield* match(project, {
|
|
48360
48747
|
onNone: () => fail$2(new AcpRegistryOperationError({
|
|
48361
48748
|
reason: "project_not_found",
|
|
48362
48749
|
message: `Project ${projectId} was not found.`
|
|
@@ -48608,7 +48995,7 @@ const layerWsRpc = (currentSession, clientOrigin, clientAnalyticsProps, previewA
|
|
|
48608
48995
|
threadSnapshotPagination: true,
|
|
48609
48996
|
threadFind: true,
|
|
48610
48997
|
threadFindProgressive: true,
|
|
48611
|
-
...match
|
|
48998
|
+
...match(scratchWorkspaceRoot, {
|
|
48612
48999
|
onNone: () => ({}),
|
|
48613
49000
|
onSome: (root) => ({ scratchWorkspaceRoot: root })
|
|
48614
49001
|
}),
|
|
@@ -50708,7 +51095,7 @@ const desktopUpdateRestartPending = gen$1(function* () {
|
|
|
50708
51095
|
if (isNone(marker)) return false;
|
|
50709
51096
|
yield* fs.remove(markerPath).pipe(ignore);
|
|
50710
51097
|
const now = yield* currentTimeMillis;
|
|
50711
|
-
return match
|
|
51098
|
+
return match(marker.value.mtime, {
|
|
50712
51099
|
onNone: () => false,
|
|
50713
51100
|
onSome: (writtenAt) => now - writtenAt.getTime() < toMillis(DESKTOP_UPDATE_RESTART_MARKER_TTL)
|
|
50714
51101
|
});
|
|
@@ -51022,7 +51409,7 @@ const make$3 = gen$1(function* () {
|
|
|
51022
51409
|
try: () => parseManagedEndpointLocalOrigin(localOrigin),
|
|
51023
51410
|
catch: () => new CloudLinkOriginInvalidError({ origin: "local" })
|
|
51024
51411
|
});
|
|
51025
|
-
const token = yield* cliTokenManager.getExisting.pipe(flatMap$1(match
|
|
51412
|
+
const token = yield* cliTokenManager.getExisting.pipe(flatMap$1(match({
|
|
51026
51413
|
onNone: () => fail$2(new CloudLinkAuthorizationMissingError({})),
|
|
51027
51414
|
onSome: succeed$1
|
|
51028
51415
|
})));
|
|
@@ -51358,11 +51745,11 @@ const make$3 = gen$1(function* () {
|
|
|
51358
51745
|
yield* savePreference(PUBLISH_AGENT_ACTIVITY_SECRET, input.publishAgentActivity);
|
|
51359
51746
|
if (input.holdWebhooksWhileOffline !== void 0) {
|
|
51360
51747
|
const next = input.holdWebhooksWhileOffline;
|
|
51361
|
-
const previous = match
|
|
51748
|
+
const previous = match(previousHold, {
|
|
51362
51749
|
onNone: () => false,
|
|
51363
51750
|
onSome: (bytes) => bytesToString(bytes) === "true"
|
|
51364
51751
|
});
|
|
51365
|
-
yield* pushHoldWebhooksWhileOffline(next).pipe(andThen(savePreference(HOLD_WEBHOOKS_WHILE_OFFLINE_SECRET, next).pipe(tapError(() => previous === next ? void_ : pushHoldWebhooksWhileOffline(previous).pipe(catch_(rollbackFailed))))), tapError(() => match
|
|
51752
|
+
yield* pushHoldWebhooksWhileOffline(next).pipe(andThen(savePreference(HOLD_WEBHOOKS_WHILE_OFFLINE_SECRET, next).pipe(tapError(() => previous === next ? void_ : pushHoldWebhooksWhileOffline(previous).pipe(catch_(rollbackFailed))))), tapError(() => match(previousActivity, {
|
|
51366
51753
|
onNone: () => secrets.remove(PUBLISH_AGENT_ACTIVITY_SECRET),
|
|
51367
51754
|
onSome: (bytes) => secrets.set(PUBLISH_AGENT_ACTIVITY_SECRET, bytes)
|
|
51368
51755
|
}).pipe(catch_(rollbackFailed))));
|
|
@@ -51556,7 +51943,7 @@ const layer$8 = effectDiscard(forkParked(pruneExpiredReplayMarkers().pipe(catch_
|
|
|
51556
51943
|
/** Covers the relay's 24-hour hold plus a margin. */
|
|
51557
51944
|
const MAX_PROOF_AGE_SECONDS = 9e4;
|
|
51558
51945
|
const decodePayload = decodeUnknownOption(RelayHookDeliveryProofPayload);
|
|
51559
|
-
const text = (bytes) => map$
|
|
51946
|
+
const text = (bytes) => map$4(bytes, (value) => new TextDecoder().decode(value));
|
|
51560
51947
|
var RelayDeliveryProof = class extends Service()("t3/scheduledTasks/RelayDeliveryProof") {};
|
|
51561
51948
|
const make$2 = gen$1(function* () {
|
|
51562
51949
|
const secrets = yield* ServerSecretStore;
|
|
@@ -51693,7 +52080,7 @@ const CODE_CHALLENGE_PATTERN = /^[A-Za-z0-9_-]{43}$/;
|
|
|
51693
52080
|
const CODE_VERIFIER_PATTERN = /^[A-Za-z0-9\-._~]{43,128}$/;
|
|
51694
52081
|
const MCP_OAUTH_SCOPES = [AuthOrchestrationReadScope, AuthOrchestrationOperateScope];
|
|
51695
52082
|
const requestUrls$1 = (request) => {
|
|
51696
|
-
const origin = match
|
|
52083
|
+
const origin = match(toURL(request), {
|
|
51697
52084
|
onNone: () => "http://localhost",
|
|
51698
52085
|
onSome: (url) => url.origin
|
|
51699
52086
|
});
|
|
@@ -51808,7 +52195,7 @@ const make$1 = gen$1(function* () {
|
|
|
51808
52195
|
} catch {
|
|
51809
52196
|
return;
|
|
51810
52197
|
}
|
|
51811
|
-
return getOrUndefined(decodeClientIdPayload(json).pipe(map$
|
|
52198
|
+
return getOrUndefined(decodeClientIdPayload(json).pipe(map$4((payload) => ({
|
|
51812
52199
|
clientId,
|
|
51813
52200
|
name: payload.n,
|
|
51814
52201
|
redirectUris: payload.r
|
|
@@ -54126,7 +54513,7 @@ var ThemeTargetMissingError = class extends TaggedError()("ThemeTargetMissingErr
|
|
|
54126
54513
|
};
|
|
54127
54514
|
const envT3Home = String$7("T3CODE_HOME").pipe(option$1);
|
|
54128
54515
|
const resolveThemePaths = fn(function* (explicitBaseDir) {
|
|
54129
|
-
const envHome = filter(yield* envT3Home, (value) => value.trim().length > 0);
|
|
54516
|
+
const envHome = filter$1(yield* envT3Home, (value) => value.trim().length > 0);
|
|
54130
54517
|
const configuredBaseDir = orElse(explicitBaseDir, () => envHome);
|
|
54131
54518
|
const baseDir = yield* resolveBaseDir(getOrUndefined(configuredBaseDir));
|
|
54132
54519
|
const derivedPaths = yield* deriveServerPaths(baseDir, void 0, { baseDirIsExplicit: isSome(configuredBaseDir) });
|
|
@@ -54872,10 +55259,12 @@ const makeCli = ({ cloudEnabled = hasCloudPublicConfig } = {}) => make$62("t3",
|
|
|
54872
55259
|
cloudEnabled ? connectCommand : connectUnavailableCommand
|
|
54873
55260
|
]));
|
|
54874
55261
|
const cli = makeCli();
|
|
54875
|
-
|
|
54876
|
-
|
|
55262
|
+
/** The npm package's `peer` bin: only `peer core …`, its help named so. */
|
|
55263
|
+
const npmPeerCli = make$62("peer").pipe(withDescription("Peer's coordination for coding agents, without the Peer app."), withSubcommands([npmCoreCommand]));
|
|
55264
|
+
function runCli(root = "t3") {
|
|
55265
|
+
(root === "peer" ? run$1(npmPeerCli, { version }) : run$1(cli, { version })).pipe(scoped, provide(layerCliRuntime), runMain);
|
|
54877
55266
|
}
|
|
54878
55267
|
//#endregion
|
|
54879
55268
|
export { runCli };
|
|
54880
55269
|
|
|
54881
|
-
//# sourceMappingURL=binCli-
|
|
55270
|
+
//# sourceMappingURL=binCli-CwrAHPco.mjs.map
|