t3code-cli 0.12.0 → 0.14.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +87 -1
- package/dist/application.d.ts +2 -0
- package/dist/application.js +1 -1
- package/dist/auth.d.ts +50 -0
- package/dist/auth.js +1 -1
- package/dist/bin.d.ts +1 -0
- package/dist/bin.js +392 -630
- package/dist/cli.d.ts +66 -0
- package/dist/cli.js +1 -1
- package/dist/client-runtime/authorization.d.ts +2 -0
- package/dist/client-runtime/authorization.js +2 -0
- package/dist/client-runtime/connection.d.ts +2 -0
- package/dist/client-runtime/connection.js +2 -0
- package/dist/client-runtime/environment.d.ts +57 -0
- package/dist/client-runtime/environment.js +2 -0
- package/dist/client-runtime/errors.d.ts +28 -0
- package/dist/client-runtime/errors.js +35 -0
- package/dist/client-runtime/operations/projects.d.ts +2 -0
- package/dist/client-runtime/operations/projects.js +2 -0
- package/dist/client-runtime/operations.d.ts +2 -0
- package/dist/client-runtime/operations.js +2 -0
- package/dist/client-runtime/platform.d.ts +26 -0
- package/dist/client-runtime/platform.js +74 -0
- package/dist/client-runtime/relay.d.ts +121 -0
- package/dist/client-runtime/relay.js +245 -0
- package/dist/client-runtime/rpc.d.ts +2 -0
- package/dist/client-runtime/rpc.js +2 -0
- package/dist/client-runtime/state/assets.d.ts +40 -0
- package/dist/client-runtime/state/assets.js +53 -0
- package/dist/client-runtime/state/auth.d.ts +98 -0
- package/dist/client-runtime/state/auth.js +48 -0
- package/dist/client-runtime/state/connections.d.ts +2 -0
- package/dist/client-runtime/state/connections.js +52 -0
- package/dist/client-runtime/state/entities.d.ts +33 -0
- package/dist/client-runtime/state/entities.js +2 -0
- package/dist/client-runtime/state/filesystem.d.ts +42 -0
- package/dist/client-runtime/state/filesystem.js +48 -0
- package/dist/client-runtime/state/git.d.ts +43 -0
- package/dist/client-runtime/state/git.js +18 -0
- package/dist/client-runtime/state/models.d.ts +2 -0
- package/dist/client-runtime/state/models.js +2 -0
- package/dist/client-runtime/state/orchestration.d.ts +128 -0
- package/dist/client-runtime/state/orchestration.js +20 -0
- package/dist/client-runtime/state/presentation.d.ts +277 -0
- package/dist/client-runtime/state/presentation.js +34 -0
- package/dist/client-runtime/state/preview.d.ts +447 -0
- package/dist/client-runtime/state/preview.js +103 -0
- package/dist/client-runtime/state/project-grouping.d.ts +26 -0
- package/dist/client-runtime/state/project-grouping.js +73 -0
- package/dist/client-runtime/state/projects.d.ts +192 -0
- package/dist/client-runtime/state/projects.js +2 -0
- package/dist/client-runtime/state/relay.d.ts +10 -0
- package/dist/client-runtime/state/relay.js +19 -0
- package/dist/client-runtime/state/review.d.ts +28 -0
- package/dist/client-runtime/state/review.js +11 -0
- package/dist/client-runtime/state/runtime.d.ts +2 -0
- package/dist/client-runtime/state/runtime.js +2 -0
- package/dist/client-runtime/state/server.d.ts +1495 -0
- package/dist/client-runtime/state/server.js +207 -0
- package/dist/client-runtime/state/session.d.ts +532 -0
- package/dist/client-runtime/state/session.js +21 -0
- package/dist/client-runtime/state/shell.d.ts +529 -0
- package/dist/client-runtime/state/shell.js +2 -0
- package/dist/client-runtime/state/source-control.d.ts +92 -0
- package/dist/client-runtime/state/source-control.js +36 -0
- package/dist/client-runtime/state/terminal.d.ts +237 -0
- package/dist/client-runtime/state/terminal.js +173 -0
- package/dist/client-runtime/state/thread-settled.d.ts +104 -0
- package/dist/client-runtime/state/thread-settled.js +157 -0
- package/dist/client-runtime/state/thread-sort.d.ts +23 -0
- package/dist/client-runtime/state/thread-sort.js +47 -0
- package/dist/client-runtime/state/threads.d.ts +538 -0
- package/dist/client-runtime/state/threads.js +934 -0
- package/dist/client-runtime/state/vcs.d.ts +442 -0
- package/dist/client-runtime/state/vcs.js +756 -0
- package/dist/config.d.ts +84 -0
- package/dist/config.js +1 -1
- package/dist/connection.d.ts +7 -0
- package/dist/connection.js +1 -1
- package/dist/contracts.d.ts +2 -0
- package/dist/contracts.js +2 -1
- package/dist/index.d.ts +2 -0
- package/dist/index.js +1 -1
- package/dist/node.d.ts +6 -0
- package/dist/node.js +1 -1
- package/dist/orchestration.d.ts +1420 -0
- package/dist/orchestration.js +1 -1
- package/dist/preview.d.ts +2 -0
- package/dist/preview.js +2 -0
- package/dist/rolldown-runtime.js +1 -1
- package/dist/rpc.d.ts +6043 -0
- package/dist/rpc.js +1 -1
- package/dist/runtime.d.ts +2 -0
- package/dist/runtime.js +2 -2
- package/dist/shared/DrainableWorker.d.ts +28 -0
- package/dist/shared/DrainableWorker.js +24 -0
- package/dist/shared/KeyedCoalescingWorker.d.ts +13 -0
- package/dist/shared/KeyedCoalescingWorker.js +89 -0
- package/dist/shared/Net.d.ts +43 -0
- package/dist/shared/Net.js +126 -0
- package/dist/shared/String.d.ts +4 -0
- package/dist/shared/String.js +8 -0
- package/dist/shared/Struct.d.ts +5 -0
- package/dist/shared/Struct.js +2 -0
- package/dist/shared/advertisedEndpoint.d.ts +2 -0
- package/dist/shared/advertisedEndpoint.js +2 -0
- package/dist/shared/agentAwareness.d.ts +27 -0
- package/dist/shared/agentAwareness.js +54 -0
- package/dist/shared/backgroundActivitySettings.d.ts +23 -0
- package/dist/shared/backgroundActivitySettings.js +2 -0
- package/dist/shared/chatList.d.ts +12 -0
- package/dist/shared/chatList.js +14 -0
- package/dist/shared/cliArgs.d.ts +33 -0
- package/dist/shared/cliArgs.js +103 -0
- package/dist/shared/composerInlineTokens.d.ts +20 -0
- package/dist/shared/composerInlineTokens.js +72 -0
- package/dist/shared/composerTrigger.d.ts +26 -0
- package/dist/shared/composerTrigger.js +97 -0
- package/dist/shared/connectAuth.d.ts +58 -0
- package/dist/shared/connectAuth.js +89 -0
- package/dist/shared/devHome.d.ts +21 -0
- package/dist/shared/devHome.js +65 -0
- package/dist/shared/devProxy.d.ts +15 -0
- package/dist/shared/devProxy.js +22 -0
- package/dist/shared/dpop.d.ts +32 -0
- package/dist/shared/dpop.js +2724 -0
- package/dist/shared/dpopCommon.d.ts +2 -0
- package/dist/shared/dpopCommon.js +2 -0
- package/dist/shared/filePreview.d.ts +8 -0
- package/dist/shared/filePreview.js +31 -0
- package/dist/shared/git.d.ts +41 -0
- package/dist/shared/git.js +2 -0
- package/dist/shared/hostProcess.d.ts +13 -0
- package/dist/shared/hostProcess.js +2 -0
- package/dist/shared/httpObservability.d.ts +5 -0
- package/dist/shared/httpObservability.js +2 -0
- package/dist/shared/httpReadiness.d.ts +38 -0
- package/dist/shared/httpReadiness.js +110 -0
- package/dist/shared/keybindings.d.ts +35 -0
- package/dist/shared/keybindings.js +330 -0
- package/dist/shared/logging.d.ts +39 -0
- package/dist/shared/logging.js +2 -0
- package/dist/shared/model.d.ts +44 -0
- package/dist/shared/model.js +2 -0
- package/dist/shared/oauthScope.d.ts +23 -0
- package/dist/shared/oauthScope.js +2 -0
- package/dist/shared/observability.d.ts +105 -0
- package/dist/shared/observability.js +346 -0
- package/dist/shared/orchestrationTiming.d.ts +16 -0
- package/dist/shared/orchestrationTiming.js +32 -0
- package/dist/shared/path.d.ts +2 -0
- package/dist/shared/path.js +2 -0
- package/dist/shared/preview.d.ts +35 -0
- package/dist/shared/preview.js +103 -0
- package/dist/shared/previewViewport.d.ts +16 -0
- package/dist/shared/previewViewport.js +159 -0
- package/dist/shared/projectFavicon.d.ts +5 -0
- package/dist/shared/projectFavicon.js +13 -0
- package/dist/shared/projectScripts.d.ts +19 -0
- package/dist/shared/projectScripts.js +18 -0
- package/dist/shared/qrCode.d.ts +87 -0
- package/dist/shared/qrCode.js +870 -0
- package/dist/shared/relayAuth.d.ts +27 -0
- package/dist/shared/relayAuth.js +83 -0
- package/dist/shared/relayClient.d.ts +58 -0
- package/dist/shared/relayClient.js +245 -0
- package/dist/shared/relayJwt.d.ts +39 -0
- package/dist/shared/relayJwt.js +2 -0
- package/dist/shared/relaySigning.d.ts +4 -0
- package/dist/shared/relaySigning.js +2 -0
- package/dist/shared/relayTracing.d.ts +25 -0
- package/dist/shared/relayTracing.js +2 -0
- package/dist/shared/relayUrl.d.ts +5 -0
- package/dist/shared/relayUrl.js +2 -0
- package/dist/shared/remote.d.ts +57 -0
- package/dist/shared/remote.js +2 -0
- package/dist/shared/schemaJson.d.ts +35 -0
- package/dist/shared/schemaJson.js +2 -0
- package/dist/shared/schemaYaml.d.ts +86 -0
- package/dist/shared/schemaYaml.js +99 -0
- package/dist/shared/searchRanking.d.ts +30 -0
- package/dist/shared/searchRanking.js +99 -0
- package/dist/shared/semver.d.ts +23 -0
- package/dist/shared/semver.js +124 -0
- package/dist/shared/serverSettings.d.ts +19 -0
- package/dist/shared/serverSettings.js +103 -0
- package/dist/shared/shell.d.ts +51 -0
- package/dist/shared/shell.js +408 -0
- package/dist/shared/sourceControl.d.ts +26 -0
- package/dist/shared/sourceControl.js +2 -0
- package/dist/shared/t3ProjectFile.d.ts +27 -0
- package/dist/shared/t3ProjectFile.js +25 -0
- package/dist/shared/terminalLabels.d.ts +16 -0
- package/dist/shared/terminalLabels.js +28 -0
- package/dist/shared/toolActivity.d.ts +16 -0
- package/dist/shared/toolActivity.js +159 -0
- package/dist/shared.d.ts +43036 -0
- package/dist/shared.js +36722 -13117
- package/dist/t3tools.d.ts +2 -0
- package/dist/t3tools.js +2 -2
- package/package.json +46 -27
- package/src/application/thread-wait.ts +4 -0
- package/src/auth/error.ts +2 -8
- package/src/auth/index.ts +2 -0
- package/src/auth/pairing.ts +8 -5
- package/src/auth/remote-error.ts +17 -0
- package/src/auth/service.ts +2 -1
- package/src/auth/transport.ts +49 -114
- package/src/auth/type.ts +6 -0
- package/src/cli/auth.ts +7 -1
- package/src/connection/error.ts +4 -1
- package/src/connection/layer.ts +5 -2
- package/src/connection/prepared.ts +83 -0
- package/src/contracts/index.ts +8 -0
- package/src/orchestration/layer.ts +38 -1
- package/src/orchestration/service.ts +5 -0
- package/src/preview/index.ts +11 -0
- package/src/preview/service.ts +52 -0
- package/src/rpc/error.ts +11 -16
- package/src/rpc/index.ts +3 -2
- package/src/rpc/layer.ts +18 -51
- package/src/rpc/operation.ts +21 -6
- package/src/rpc/service.ts +2 -1
- package/src/rpc/session.ts +168 -0
- package/src/rpc/ws-group.ts +18 -26
- package/src/runtime/index.ts +1 -0
- package/src/runtime/layer.ts +11 -3
- package/src/sql/node-sqlite-client.ts +3 -0
- package/dist/src/application/actions.d.ts +0 -25
- package/dist/src/application/error.d.ts +0 -3
- package/dist/src/application/index.d.ts +0 -4
- package/dist/src/application/layer.d.ts +0 -117
- package/dist/src/application/model-selection.d.ts +0 -34
- package/dist/src/application/models.d.ts +0 -8
- package/dist/src/application/project-commands.d.ts +0 -44
- package/dist/src/application/projects.d.ts +0 -23
- package/dist/src/application/service.d.ts +0 -243
- package/dist/src/application/shell-sequence.d.ts +0 -101
- package/dist/src/application/terminals.d.ts +0 -66
- package/dist/src/application/thread-commands.d.ts +0 -157
- package/dist/src/application/thread-update.d.ts +0 -8
- package/dist/src/application/thread-wait.d.ts +0 -111
- package/dist/src/application/threads.d.ts +0 -685
- package/dist/src/auth/error.d.ts +0 -51
- package/dist/src/auth/index.d.ts +0 -10
- package/dist/src/auth/layer.d.ts +0 -53
- package/dist/src/auth/local-base-dir.d.ts +0 -8
- package/dist/src/auth/local-origin.d.ts +0 -18
- package/dist/src/auth/local-token.d.ts +0 -26
- package/dist/src/auth/local.d.ts +0 -24
- package/dist/src/auth/pairing.d.ts +0 -22
- package/dist/src/auth/schema.d.ts +0 -58
- package/dist/src/auth/service.d.ts +0 -27
- package/dist/src/auth/transport.d.ts +0 -22
- package/dist/src/auth/type.d.ts +0 -83
- package/dist/src/cli/env/flag.d.ts +0 -2
- package/dist/src/cli/env/index.d.ts +0 -2
- package/dist/src/cli/env/selection-layer.d.ts +0 -3
- package/dist/src/cli/flags.d.ts +0 -20
- package/dist/src/cli/format/index.d.ts +0 -1
- package/dist/src/cli/format/output.d.ts +0 -12
- package/dist/src/cli/index.d.ts +0 -5
- package/dist/src/cli/runtime/index.d.ts +0 -1
- package/dist/src/cli/runtime/service.d.ts +0 -16
- package/dist/src/cli/scope/index.d.ts +0 -1
- package/dist/src/cli/scope/resolve.d.ts +0 -20
- package/dist/src/cli-path/layer.d.ts +0 -3
- package/dist/src/cli-path/service.d.ts +0 -8
- package/dist/src/config/config.d.ts +0 -49
- package/dist/src/config/credential/cipher-node.d.ts +0 -3
- package/dist/src/config/credential/cipher-web.d.ts +0 -3
- package/dist/src/config/credential/cipher.d.ts +0 -29
- package/dist/src/config/credential/env.d.ts +0 -3
- package/dist/src/config/credential/error.d.ts +0 -8
- package/dist/src/config/credential/index.d.ts +0 -6
- package/dist/src/config/credential/service.d.ts +0 -34
- package/dist/src/config/env/env.d.ts +0 -55
- package/dist/src/config/env/index.d.ts +0 -2
- package/dist/src/config/env/layout.d.ts +0 -11
- package/dist/src/config/environment-name/index.d.ts +0 -1
- package/dist/src/config/environment-name/name.d.ts +0 -10
- package/dist/src/config/error.d.ts +0 -11
- package/dist/src/config/index.d.ts +0 -10
- package/dist/src/config/keystore/error.d.ts +0 -8
- package/dist/src/config/keystore/file.d.ts +0 -9
- package/dist/src/config/keystore/index.d.ts +0 -4
- package/dist/src/config/keystore/keyring-node.d.ts +0 -4
- package/dist/src/config/keystore/service.d.ts +0 -33
- package/dist/src/config/paths/index.d.ts +0 -1
- package/dist/src/config/paths/paths.d.ts +0 -6
- package/dist/src/config/persist/file-mode.d.ts +0 -4
- package/dist/src/config/persist/migration.d.ts +0 -68
- package/dist/src/config/persist/persist.d.ts +0 -40
- package/dist/src/config/persist/schema.d.ts +0 -68
- package/dist/src/config/resolve/resolve.d.ts +0 -40
- package/dist/src/config/selection/index.d.ts +0 -1
- package/dist/src/config/selection/resolve.d.ts +0 -4
- package/dist/src/config/selection/service.d.ts +0 -10
- package/dist/src/config/types.d.ts +0 -36
- package/dist/src/config/url/error.d.ts +0 -10
- package/dist/src/config/url/index.d.ts +0 -2
- package/dist/src/config/url/url.d.ts +0 -6
- package/dist/src/connection/error.d.ts +0 -8
- package/dist/src/connection/index.d.ts +0 -4
- package/dist/src/connection/layer.d.ts +0 -3
- package/dist/src/connection/service.d.ts +0 -13
- package/dist/src/connection/type.d.ts +0 -10
- package/dist/src/contracts/index.d.ts +0 -1
- package/dist/src/domain/error.d.ts +0 -57
- package/dist/src/domain/helpers.d.ts +0 -184
- package/dist/src/domain/model-config.d.ts +0 -325
- package/dist/src/domain/thread-activities.d.ts +0 -14
- package/dist/src/domain/thread-lifecycle.d.ts +0 -125
- package/dist/src/index.d.ts +0 -3
- package/dist/src/node/connection.d.ts +0 -2
- package/dist/src/node/index.d.ts +0 -1
- package/dist/src/orchestration/index.d.ts +0 -2
- package/dist/src/orchestration/layer.d.ts +0 -1634
- package/dist/src/orchestration/service.d.ts +0 -28
- package/dist/src/rpc/error.d.ts +0 -18
- package/dist/src/rpc/index.d.ts +0 -5
- package/dist/src/rpc/layer.d.ts +0 -6271
- package/dist/src/rpc/operation.d.ts +0 -6280
- package/dist/src/rpc/service.d.ts +0 -15
- package/dist/src/rpc/ws-group.d.ts +0 -2725
- package/dist/src/runtime/index.d.ts +0 -1
- package/dist/src/runtime/layer.d.ts +0 -15
- package/dist/src/sql/node-sqlite-client.d.ts +0 -10
- package/dist/src/sql/service.d.ts +0 -17
- package/dist/src/t3tools/index.d.ts +0 -1
package/dist/bin.js
CHANGED
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import { a as __toESM, i as __require, t as __commonJSMin } from "./rolldown-runtime.js";
|
|
3
|
-
import { $
|
|
3
|
+
import { $D as flatMap, $E as runDrain, $O as mergeAll, $T as Struct, $k as hasProperty, $w as extractSingleParams, AE as Size, AO as tapError, AT as isTrueValue, Ak as empty$1, BD as andThen, BE as filter, Bk as isSome, Bw as toImpl, CC as T3Config, CD as BadArgument, CE as make$6, CO as scoped, CT as magenta, Ck as isSuccess, DE as FileDescriptor, DO as suspend, DT as getTypeName, EE as TypeId$2, EO as succeed, ET as getChoiceKeys, Es as layerNode$1, Ew as T3Application, FD as value$2, FT as UnrecognizedOption, Fk as getOrElse, Fn as BaseAppLayer, Fw as getGlobalFlagsForCommandTree, GE as isStream, Gw as optional$2, HD as as, HT as isQuitError, Hk as match, Hw as boolean, ID as makeRunMain, IT as isCliError, Iw as getHelpForCommandPath, JD as catchTags, Jw as withDescription$1, KD as catchFilter, KE as map$1, Kw as string$2, LD as acquireRelease, LE as decodeText, LO as uninterruptible, Lw as TypeId$3, ME as make$8, MO as timeoutOrElse, MT as InvalidValue, Mk as flatMap$1, Mw as LogLevel, NE as callback$1, NO as tryPromise, NT as ShowHelp, Nb as ProviderUserInputAnswers, Nk as fromNullishOr, Ns as latestAssistantMessage, Nw as Wizard, OE as FileSystem, OO as sync, OT as isBoolean, Ok as Reference, PO as try_, PT as UnknownSubcommand, Pk as fromUndefinedOr, Ps as threadStatus, Pw as getGlobalFlagsForCommandPath, QD as fail, QE as run$2, QO as effect, QT as String$1, Qw as argumentKind, RD as addFinalizer, RO as void_, Rk as getOrUndefined, Rw as checkForDuplicateFlags, SC as layer$12, SD as unbounded, SE as ProcessId, SO as runFork, ST as green, Sk as isResult, Sw as resolveOutputFormat, TD as systemError, TE as Path$1, TT as white, UD as asVoid, UE as fromIterable, UT as make$11, Uk as none, Uw as choice, VT as Terminal, Vw as parseConfig, WD as callback, WE as fromQueue, Wk as some, Ww as integer$1, XD as effectify, Xw as error, YD as catch_, YE as merge, Yw as Formatter, Zw as log, _C as resolveThreadId, _D as make$10, _E as fdName, _T as toggle, aA as isUndefined, aD as succeed$5, aO as gen, aT as mapEffect$1, ak as _await, aw as formatFlag, bC as ThreadSessionError, bD as shutdown, bE as ChildProcessSpawner, bO as provideService, bT as bold, bw as isAgentEnvironment, cA as pipe, cD as transduce, cT as variadic$1, ck as make$13, cw as projectPathFlag, dD as make$9, dE as optionalKey, dO as mapError, dT as float, dw as threadFlag, eA as isNotNull, eD as runFold, eE as TaggedErrorClass, eO as fn, ek as provide, fC as CliPath, fD as drain, fO as match$1, fT as integer, fk as succeed$1, fw as threadFormatFlag, gD as failCauseUnsafe, gE as fromWritable, gO as orDie, gT as text, gw as canRenderLiveTerminal, hC as resolveCommandProjectRef, hD as endUnsafe, hE as fromReadable, hT as select, hw as yesFlag, iE as decodeUnknownEffect, iO as forkScoped, iT as isParam, ik as MinimumLogLevel, iw as forceFlag, jE as WatchBackend, jk as make$12, js as layer$13, jw as BuiltIns, kE as FileTypeId, kT as isFalseValue, kk as Service, ks as layerNode, lA as pipeArguments, lD as unwrap, lT as confirm, lk as makeUnsafe, lw as replaceFlag, mC as T3Auth, mE as make$7, mT as run$3, mw as worktreeFlag, nA as isNullish, nD as runHead, nO as forEach, nT as getUnderlyingSingleOrThrow, nk as succeed$2, oA as dual, oE as decodeUnknownSync, oO as ignore, oT as optional$1, ok as doneUnsafe, ow as modelFlags, pC as cliEnvironmentSetting, pD as isSink, pE as Crypto, pO as matchEffect, pT as password, pw as waitFormatFlag, qD as catchTag, qO as fail$1, qT as Literal, qw as withDefault, rD as runLast, rT as isFlagParam, rk as sync$1, rw as envNameFlag, sA as identity$1, sD as tap, sE as fromJsonString, sO as interrupt, sT as string$1, sk as isDone, sw as projectFlag, tA as isNotUndefined, tD as runForEach, tO as fnUntraced, tT as getParamMetadata, tk as provideMerge, uD as get$1, uO as map, uT as date, uk as succeed$4, uw as selfActionForceFlag, vC as resolveWorktreePath, vD as offer, vE as make$5, vO as provide$1, vT as annotate, wD as badArgument, wE as makeHandle, wO as serviceOption, wT as red, wk as succeed$3, ww as loadT3CliEnv, xC as CliRuntime, xE as ExitCode, xO as result$1, xT as cyanBright, xw as isInteractiveHumanTerminal, yC as ProjectLookupError, yD as offerUnsafe, yE as parseFdName, yO as provideContext, yT as blackBright, yk as fail$2, zE as empty, zk as isNone, zw as makeCommand } from "./shared.js";
|
|
4
4
|
import * as OS from "node:os";
|
|
5
5
|
import os, { homedir } from "node:os";
|
|
6
6
|
import * as NodeChildProcess from "node:child_process";
|
|
7
|
+
import { PassThrough } from "node:stream";
|
|
7
8
|
import * as NodeCrypto from "node:crypto";
|
|
8
9
|
import * as NFS from "node:fs";
|
|
9
10
|
import * as Path from "node:path";
|
|
@@ -13,35 +14,14 @@ import * as readline from "node:readline";
|
|
|
13
14
|
import process$1 from "node:process";
|
|
14
15
|
import tty from "node:tty";
|
|
15
16
|
//#endregion
|
|
16
|
-
//#region node_modules/.pnpm/@effect+platform-node@4.0.0-beta.
|
|
17
|
+
//#region node_modules/.pnpm/@effect+platform-node@4.0.0-beta.102_patch_hash=cae7efcda6fd29f4db2efd357cb7dc6c41cb6ad_5ec7f92fdb36a12db81428ea9ead6984/node_modules/@effect/platform-node/dist/NodeRuntime.js
|
|
17
18
|
/**
|
|
18
|
-
* Node.js process runner for
|
|
19
|
-
* edge.
|
|
19
|
+
* Node.js process runner for Effect programs.
|
|
20
20
|
*
|
|
21
|
-
* This module
|
|
22
|
-
*
|
|
23
|
-
*
|
|
24
|
-
*
|
|
25
|
-
*
|
|
26
|
-
* **Mental model**
|
|
27
|
-
*
|
|
28
|
-
* `runMain` is the last call in `main.ts`: build the effect, provide the layers
|
|
29
|
-
* it needs, then hand the self-contained program to this module. The function
|
|
30
|
-
* does not provide Node services itself; use `NodeServices.layer` or narrower
|
|
31
|
-
* platform layers before launching.
|
|
32
|
-
*
|
|
33
|
-
* **Common tasks**
|
|
34
|
-
*
|
|
35
|
-
* - Run a CLI command or script and let failures become process failures.
|
|
36
|
-
* - Keep a server or worker fiber alive as the process main program.
|
|
37
|
-
* - Override teardown or disable automatic error reporting at the boundary.
|
|
38
|
-
*
|
|
39
|
-
* **Gotchas**
|
|
40
|
-
*
|
|
41
|
-
* `SIGINT` and `SIGTERM` interrupt the main fiber so scoped finalizers can run.
|
|
42
|
-
* Clean success lets the event loop drain naturally, while signal-triggered
|
|
43
|
-
* interruption or a non-zero teardown code exits the process. Keep long-lived
|
|
44
|
-
* resources in Effect scopes and avoid finalizers that never complete.
|
|
21
|
+
* This module exports `runMain`, which runs one Effect as the main process
|
|
22
|
+
* fiber in Node.js. It reuses the shared Node runtime runner, including its
|
|
23
|
+
* error reporting, `SIGINT` / `SIGTERM` interruption, and optional teardown
|
|
24
|
+
* behavior.
|
|
45
25
|
*
|
|
46
26
|
* @since 4.0.0
|
|
47
27
|
*/
|
|
@@ -86,325 +66,7 @@ const runMain = /* @__PURE__ */ makeRunMain(({ fiber, teardown }) => {
|
|
|
86
66
|
process.on("SIGTERM", onSigint);
|
|
87
67
|
});
|
|
88
68
|
//#endregion
|
|
89
|
-
//#region node_modules/.pnpm
|
|
90
|
-
/**
|
|
91
|
-
* Service contract and helpers for running child processes through Effect.
|
|
92
|
-
*
|
|
93
|
-
* This module defines the {@link ChildProcessSpawner} service used by child
|
|
94
|
-
* process commands to start operating-system processes. A spawner turns a
|
|
95
|
-
* command description into a {@link ChildProcessHandle}, which exposes scoped
|
|
96
|
-
* lifecycle operations: write to stdin, stream stdout and stderr, wait for the
|
|
97
|
-
* exit code, kill the process, inspect whether it is still running, and
|
|
98
|
-
* temporarily unreference it from the parent process.
|
|
99
|
-
*
|
|
100
|
-
* Use this module when implementing a platform-specific process backend or
|
|
101
|
-
* when code needs direct access to the process service. Most applications build
|
|
102
|
-
* commands with the `ChildProcess` module; this service is the lower-level
|
|
103
|
-
* execution boundary and also provides convenience methods for collecting exit
|
|
104
|
-
* codes, strings, and output lines. The {@link make} constructor derives those
|
|
105
|
-
* helpers from one primitive `spawn` implementation, so adapters only need to
|
|
106
|
-
* supply process creation.
|
|
107
|
-
*
|
|
108
|
-
* @since 4.0.0
|
|
109
|
-
*/
|
|
110
|
-
/**
|
|
111
|
-
* Constructs branded child process `ExitCode` values.
|
|
112
|
-
*
|
|
113
|
-
* @category constructors
|
|
114
|
-
* @since 4.0.0
|
|
115
|
-
*/
|
|
116
|
-
const ExitCode = /*#__PURE__*/ nominal();
|
|
117
|
-
/**
|
|
118
|
-
* Constructs branded child process `ProcessId` values.
|
|
119
|
-
*
|
|
120
|
-
* @category constructors
|
|
121
|
-
* @since 4.0.0
|
|
122
|
-
*/
|
|
123
|
-
const ProcessId = /*#__PURE__*/ nominal();
|
|
124
|
-
const HandleTypeId = "~effect/ChildProcessSpawner/ChildProcessHandle";
|
|
125
|
-
const HandleProto = {
|
|
126
|
-
[HandleTypeId]: HandleTypeId,
|
|
127
|
-
...BaseProto,
|
|
128
|
-
toJSON() {
|
|
129
|
-
return {
|
|
130
|
-
_id: "ChildProcessHandle",
|
|
131
|
-
pid: this.pid
|
|
132
|
-
};
|
|
133
|
-
}
|
|
134
|
-
};
|
|
135
|
-
/**
|
|
136
|
-
* Constructs a new `ChildProcessHandle`.
|
|
137
|
-
*
|
|
138
|
-
* @category constructors
|
|
139
|
-
* @since 4.0.0
|
|
140
|
-
*/
|
|
141
|
-
const makeHandle = (params) => Object.assign(Object.create(HandleProto), params);
|
|
142
|
-
/**
|
|
143
|
-
* Creates a `ChildProcessSpawner` service from a `spawn` function, deriving
|
|
144
|
-
* helpers for exit codes and output collection from that implementation.
|
|
145
|
-
*
|
|
146
|
-
* @category models
|
|
147
|
-
* @since 4.0.0
|
|
148
|
-
*/
|
|
149
|
-
const make$6 = (spawn) => {
|
|
150
|
-
const streamString = (command, options) => spawn(command).pipe(map((handle) => decodeText(options?.includeStderr === true ? handle.all : handle.stdout)), unwrap);
|
|
151
|
-
const streamLines = (command, options) => splitLines(streamString(command, options));
|
|
152
|
-
return ChildProcessSpawner.of({
|
|
153
|
-
spawn,
|
|
154
|
-
exitCode: (command) => scoped(flatMap(spawn(command), (handle) => handle.exitCode)),
|
|
155
|
-
streamString,
|
|
156
|
-
streamLines,
|
|
157
|
-
lines: (command, options) => runCollect(streamLines(command, options)),
|
|
158
|
-
string: (command, options) => mkString(streamString(command, options))
|
|
159
|
-
});
|
|
160
|
-
};
|
|
161
|
-
/**
|
|
162
|
-
* Service tag for child process spawning.
|
|
163
|
-
*
|
|
164
|
-
* @category services
|
|
165
|
-
* @since 4.0.0
|
|
166
|
-
*/
|
|
167
|
-
var ChildProcessSpawner = class extends Service()("effect/process/ChildProcessSpawner") {};
|
|
168
|
-
//#endregion
|
|
169
|
-
//#region node_modules/.pnpm/effect@4.0.0-beta.78/node_modules/effect/dist/unstable/process/ChildProcess.js
|
|
170
|
-
/**
|
|
171
|
-
* An Effect-native module for working with child processes.
|
|
172
|
-
*
|
|
173
|
-
* This module uses an AST-based approach where commands are built first
|
|
174
|
-
* using `make` and `pipeTo`, then executed using `spawn`.
|
|
175
|
-
*
|
|
176
|
-
* **Example** (Spawning and piping commands)
|
|
177
|
-
*
|
|
178
|
-
* ```ts
|
|
179
|
-
* import { Effect, Stream } from "effect"
|
|
180
|
-
* import { NodeServices } from "@effect/platform-node"
|
|
181
|
-
* import { ChildProcess } from "effect/unstable/process"
|
|
182
|
-
*
|
|
183
|
-
* // Build a command
|
|
184
|
-
* const command = ChildProcess.make`echo "hello world"`
|
|
185
|
-
*
|
|
186
|
-
* // Spawn and collect output
|
|
187
|
-
* const program = Effect.gen(function*() {
|
|
188
|
-
* // You can `yield*` a command, which calls `ChildProcess.spawn`
|
|
189
|
-
* const handle = yield* command
|
|
190
|
-
* const chunks = yield* Stream.runCollect(handle.stdout)
|
|
191
|
-
* const exitCode = yield* handle.exitCode
|
|
192
|
-
* return { chunks, exitCode }
|
|
193
|
-
* }).pipe(Effect.scoped, Effect.provide(NodeServices.layer))
|
|
194
|
-
*
|
|
195
|
-
* // With options
|
|
196
|
-
* const withOptions = ChildProcess.make({ cwd: "/tmp" })`ls -la`
|
|
197
|
-
*
|
|
198
|
-
* // Piping commands
|
|
199
|
-
* const pipeline = ChildProcess.make`cat package.json`.pipe(
|
|
200
|
-
* ChildProcess.pipeTo(ChildProcess.make`grep name`)
|
|
201
|
-
* )
|
|
202
|
-
*
|
|
203
|
-
* // Spawn the pipeline
|
|
204
|
-
* const pipelineProgram = Effect.gen(function*() {
|
|
205
|
-
* const handle = yield* pipeline
|
|
206
|
-
* const chunks = yield* Stream.runCollect(handle.stdout)
|
|
207
|
-
* return chunks
|
|
208
|
-
* }).pipe(Effect.scoped, Effect.provide(NodeServices.layer))
|
|
209
|
-
* ```
|
|
210
|
-
*
|
|
211
|
-
* @since 4.0.0
|
|
212
|
-
*/
|
|
213
|
-
const TypeId$2 = "~effect/unstable/process/ChildProcess";
|
|
214
|
-
const Proto = {
|
|
215
|
-
.../*#__PURE__*/ Prototype({
|
|
216
|
-
label: "Command",
|
|
217
|
-
evaluate(fiber) {
|
|
218
|
-
return getUnsafe(fiber.context, ChildProcessSpawner).spawn(this);
|
|
219
|
-
}
|
|
220
|
-
}),
|
|
221
|
-
[TypeId$2]: TypeId$2
|
|
222
|
-
};
|
|
223
|
-
const makeStandardCommand = (command, args, options) => Object.assign(Object.create(Proto), {
|
|
224
|
-
_tag: "StandardCommand",
|
|
225
|
-
command,
|
|
226
|
-
args,
|
|
227
|
-
options
|
|
228
|
-
});
|
|
229
|
-
/**
|
|
230
|
-
* Create a command from a template literal, options + template, or array form.
|
|
231
|
-
*
|
|
232
|
-
* **Details**
|
|
233
|
-
*
|
|
234
|
-
* This function supports three calling conventions:
|
|
235
|
-
* 1. Template literal: `make\`npm run build\``
|
|
236
|
-
* 2. Options + template literal: `make({ cwd: "/app" })\`npm run build\``
|
|
237
|
-
* 3. Array form: `make("npm", ["run", "build"], options?)`
|
|
238
|
-
*
|
|
239
|
-
* Template literals are not parsed until execution time, allowing parsing
|
|
240
|
-
* errors to flow through Effect's error channel.
|
|
241
|
-
*
|
|
242
|
-
* **Example** (Creating commands)
|
|
243
|
-
*
|
|
244
|
-
* ```ts
|
|
245
|
-
* import { ChildProcess } from "effect/unstable/process"
|
|
246
|
-
*
|
|
247
|
-
* // Template literal form
|
|
248
|
-
* const cmd1 = ChildProcess.make`echo "hello"`
|
|
249
|
-
*
|
|
250
|
-
* // With options
|
|
251
|
-
* const cmd2 = ChildProcess.make({ cwd: "/tmp" })`ls -la`
|
|
252
|
-
*
|
|
253
|
-
* // Array form
|
|
254
|
-
* const cmd3 = ChildProcess.make("git", ["status"])
|
|
255
|
-
* ```
|
|
256
|
-
*
|
|
257
|
-
* @category constructors
|
|
258
|
-
* @since 4.0.0
|
|
259
|
-
*/
|
|
260
|
-
const make$5 = function make(...args) {
|
|
261
|
-
if (isTemplateString(args[0])) {
|
|
262
|
-
const [templates, ...expressions] = args;
|
|
263
|
-
const tokens = parseTemplates(templates, expressions);
|
|
264
|
-
return makeStandardCommand(tokens[0] ?? "", tokens.slice(1), {});
|
|
265
|
-
}
|
|
266
|
-
if (typeof args[0] === "object" && !Array.isArray(args[0]) && !isTemplateString(args[0])) {
|
|
267
|
-
const options = args[0];
|
|
268
|
-
return function(templates, ...expressions) {
|
|
269
|
-
const tokens = parseTemplates(templates, expressions);
|
|
270
|
-
return makeStandardCommand(tokens[0] ?? "", tokens.slice(1), options);
|
|
271
|
-
};
|
|
272
|
-
}
|
|
273
|
-
if (typeof args[0] === "string" && !Array.isArray(args[1])) {
|
|
274
|
-
const [command, options = {}] = args;
|
|
275
|
-
return makeStandardCommand(command, [], options);
|
|
276
|
-
}
|
|
277
|
-
const [command, cmdArgs = [], options = {}] = args;
|
|
278
|
-
return makeStandardCommand(command, cmdArgs, options);
|
|
279
|
-
};
|
|
280
|
-
const isTemplateString = (u) => Array.isArray(u) && "raw" in u && Array.isArray(u.raw);
|
|
281
|
-
/**
|
|
282
|
-
* Parses an fd name like "fd3" to its numeric index.
|
|
283
|
-
* Returns undefined if the name is invalid.
|
|
284
|
-
*
|
|
285
|
-
* @category converting
|
|
286
|
-
* @since 4.0.0
|
|
287
|
-
*/
|
|
288
|
-
const parseFdName = (name) => {
|
|
289
|
-
const match = /^fd(\d+)$/.exec(name);
|
|
290
|
-
if (match === null) return void 0;
|
|
291
|
-
const fd = parseInt(match[1], 10);
|
|
292
|
-
return fd >= 3 ? fd : void 0;
|
|
293
|
-
};
|
|
294
|
-
/**
|
|
295
|
-
* Create an fd name from its numeric index.
|
|
296
|
-
*
|
|
297
|
-
* @category converting
|
|
298
|
-
* @since 4.0.0
|
|
299
|
-
*/
|
|
300
|
-
const fdName = (fd) => `fd${fd}`;
|
|
301
|
-
const parseTemplates = (templates, expressions) => {
|
|
302
|
-
let tokens = [];
|
|
303
|
-
for (const [index, template] of templates.entries()) tokens = parseTemplate(templates, expressions, tokens, template, index);
|
|
304
|
-
return tokens;
|
|
305
|
-
};
|
|
306
|
-
const parseTemplate = (templates, expressions, prevTokens, template, index) => {
|
|
307
|
-
const rawTemplate = templates.raw[index];
|
|
308
|
-
if (rawTemplate === void 0) throw new Error(`Invalid backslash sequence: ${templates.raw[index]}`);
|
|
309
|
-
const { hasLeadingWhitespace, hasTrailingWhitespace, tokens } = splitByWhitespaces(template, rawTemplate);
|
|
310
|
-
const nextTokens = concatTokens(prevTokens, tokens, hasLeadingWhitespace);
|
|
311
|
-
if (index === expressions.length) return nextTokens;
|
|
312
|
-
const expression = expressions[index];
|
|
313
|
-
return concatTokens(nextTokens, Array.isArray(expression) ? expression.map((expression) => parseExpression(expression)) : [parseExpression(expression)], hasTrailingWhitespace);
|
|
314
|
-
};
|
|
315
|
-
/**
|
|
316
|
-
* Convert valid expressions defined in a template string command (i.e. using
|
|
317
|
-
* `${expression}` into strings.
|
|
318
|
-
*/
|
|
319
|
-
const parseExpression = (expression) => {
|
|
320
|
-
if (typeof expression === "string") return expression;
|
|
321
|
-
return String(expression);
|
|
322
|
-
};
|
|
323
|
-
const DELIMITERS = /*#__PURE__*/ new Set([
|
|
324
|
-
" ",
|
|
325
|
-
" ",
|
|
326
|
-
"\r",
|
|
327
|
-
"\n"
|
|
328
|
-
]);
|
|
329
|
-
/**
|
|
330
|
-
* Number of characters in backslash escape sequences: \0 \xXX or \uXXXX
|
|
331
|
-
* \cX is allowed in RegExps but not in strings
|
|
332
|
-
* Octal sequences are not allowed in strict mode
|
|
333
|
-
*/
|
|
334
|
-
const ESCAPE_LENGTH = {
|
|
335
|
-
x: 3,
|
|
336
|
-
u: 5
|
|
337
|
-
};
|
|
338
|
-
/**
|
|
339
|
-
* Splits a template string by whitespace while also properly handling escape
|
|
340
|
-
* sequences.
|
|
341
|
-
*
|
|
342
|
-
* As an example, let's review the following valid commands:
|
|
343
|
-
*
|
|
344
|
-
* ```ts
|
|
345
|
-
* ChildProcess.exec`echo foo\n bar`
|
|
346
|
-
* // We should run `["echo", "foo\n", "bar"]`
|
|
347
|
-
*
|
|
348
|
-
* ChildProcess.exec`echo foo
|
|
349
|
-
* bar`
|
|
350
|
-
* // We should run `["echo", "foo", "bar]`
|
|
351
|
-
* ```
|
|
352
|
-
*
|
|
353
|
-
* The problem is that when we evaluate the template string for both of the above
|
|
354
|
-
* commands, we will end up with the same string "echo foo\n bar".
|
|
355
|
-
*
|
|
356
|
-
* What we really want is to include the escaped character in the arguments for
|
|
357
|
-
* the first command, since it was written explicitly by the user.
|
|
358
|
-
*
|
|
359
|
-
* This is why also having access to the raw template string is useful - in a
|
|
360
|
-
* template string, there are two representations of the same string:
|
|
361
|
-
* 1. `template` - The processed string (escape sequences are evaluated).
|
|
362
|
-
* 2. `template.raw` - The raw string (escape sequences are literal).
|
|
363
|
-
*/
|
|
364
|
-
const splitByWhitespaces = (template, rawTemplate) => {
|
|
365
|
-
if (rawTemplate.length === 0) return {
|
|
366
|
-
tokens: [],
|
|
367
|
-
hasLeadingWhitespace: false,
|
|
368
|
-
hasTrailingWhitespace: false
|
|
369
|
-
};
|
|
370
|
-
const hasLeadingWhitespace = DELIMITERS.has(rawTemplate[0]);
|
|
371
|
-
const tokens = [];
|
|
372
|
-
let templateCursor = 0;
|
|
373
|
-
for (let templateIndex = 0, rawIndex = 0; templateIndex < template.length; templateIndex += 1, rawIndex += 1) {
|
|
374
|
-
const rawCharacter = rawTemplate[rawIndex];
|
|
375
|
-
if (DELIMITERS.has(rawCharacter)) {
|
|
376
|
-
if (templateCursor !== templateIndex) tokens.push(template.slice(templateCursor, templateIndex));
|
|
377
|
-
templateCursor = templateIndex + 1;
|
|
378
|
-
} else if (rawCharacter === "\\") {
|
|
379
|
-
const nextRawCharacter = rawTemplate[rawIndex + 1];
|
|
380
|
-
if (nextRawCharacter === "\n") {
|
|
381
|
-
templateIndex -= 1;
|
|
382
|
-
rawIndex += 1;
|
|
383
|
-
} else if (nextRawCharacter === "u" && rawTemplate[rawIndex + 2] === "{") rawIndex = rawTemplate.indexOf("}", rawIndex + 3);
|
|
384
|
-
else rawIndex += ESCAPE_LENGTH[nextRawCharacter] ?? 1;
|
|
385
|
-
}
|
|
386
|
-
}
|
|
387
|
-
const hasTrailingWhitespace = templateCursor === template.length;
|
|
388
|
-
if (!hasTrailingWhitespace) tokens.push(template.slice(templateCursor));
|
|
389
|
-
return {
|
|
390
|
-
tokens,
|
|
391
|
-
hasLeadingWhitespace,
|
|
392
|
-
hasTrailingWhitespace
|
|
393
|
-
};
|
|
394
|
-
};
|
|
395
|
-
/**
|
|
396
|
-
* Concatenates two separate sets of string tokens together.
|
|
397
|
-
*
|
|
398
|
-
* If either set is empty or `isSeparated=false`, the last element of `prevTokens`
|
|
399
|
-
* and the first element of `nextTokens` will be joined into a single token.
|
|
400
|
-
*/
|
|
401
|
-
const concatTokens = (prevTokens, nextTokens, isSeparated) => isSeparated || prevTokens.length === 0 || nextTokens.length === 0 ? [...prevTokens, ...nextTokens] : [
|
|
402
|
-
...prevTokens.slice(0, -1),
|
|
403
|
-
`${prevTokens.at(-1)}${nextTokens.at(0)}`,
|
|
404
|
-
...nextTokens.slice(1)
|
|
405
|
-
];
|
|
406
|
-
//#endregion
|
|
407
|
-
//#region node_modules/.pnpm/@effect+platform-node-shared@4.0.0-beta.78_effect@4.0.0-beta.78/node_modules/@effect/platform-node-shared/dist/internal/utils.js
|
|
69
|
+
//#region node_modules/.pnpm/@effect+platform-node-shared@4.0.0-beta.102_effect@4.0.0-beta.102_patch_hash=71215759e1_3273714b76c575f5c82a5a72c5bb5418/node_modules/@effect/platform-node-shared/dist/internal/utils.js
|
|
408
70
|
/** @internal */
|
|
409
71
|
const handleErrnoException = (module, method) => (err, [path]) => {
|
|
410
72
|
let reason = "Unknown";
|
|
@@ -441,7 +103,7 @@ const handleErrnoException = (module, method) => (err, [path]) => {
|
|
|
441
103
|
});
|
|
442
104
|
};
|
|
443
105
|
//#endregion
|
|
444
|
-
//#region node_modules/.pnpm/@effect+platform-node-shared@4.0.0-beta.
|
|
106
|
+
//#region node_modules/.pnpm/@effect+platform-node-shared@4.0.0-beta.102_effect@4.0.0-beta.102_patch_hash=71215759e1_3273714b76c575f5c82a5a72c5bb5418/node_modules/@effect/platform-node-shared/dist/NodeChildProcessSpawner.js
|
|
445
107
|
const toError = (error) => error instanceof globalThis.Error ? error : new globalThis.Error(String(error));
|
|
446
108
|
const toPlatformError = (method, error, command) => {
|
|
447
109
|
const { commands } = flattenCommand(command);
|
|
@@ -541,16 +203,21 @@ const layer$11 = /*#__PURE__*/ effect(ChildProcessSpawner, /* @__PURE__ */ gen(f
|
|
|
541
203
|
evaluate: () => nodeStream,
|
|
542
204
|
onError: (error) => toPlatformError(`fromWritable(fd${fd})`, toError(error), command)
|
|
543
205
|
});
|
|
544
|
-
if (config.stream) yield* forkScoped(run$
|
|
206
|
+
if (config.stream) yield* forkScoped(run$2(config.stream, sink));
|
|
545
207
|
inputSinks.set(fd, sink);
|
|
546
208
|
break;
|
|
547
209
|
}
|
|
548
210
|
case "output": {
|
|
549
211
|
let stream = empty;
|
|
550
|
-
if (nodeStream && "read" in nodeStream)
|
|
551
|
-
|
|
552
|
-
|
|
553
|
-
|
|
212
|
+
if (nodeStream && "read" in nodeStream) {
|
|
213
|
+
const passThrough = new PassThrough();
|
|
214
|
+
nodeStream.on("error", (error) => passThrough.destroy(error));
|
|
215
|
+
nodeStream.pipe(passThrough);
|
|
216
|
+
stream = fromReadable({
|
|
217
|
+
evaluate: () => passThrough,
|
|
218
|
+
onError: (error) => toPlatformError(`fromReadable(fd${fd})`, toError(error), command)
|
|
219
|
+
});
|
|
220
|
+
}
|
|
554
221
|
if (config.sink) stream = transduce(stream, config.sink);
|
|
555
222
|
outputStreams.set(fd, stream);
|
|
556
223
|
break;
|
|
@@ -570,18 +237,28 @@ const layer$11 = /*#__PURE__*/ effect(ChildProcessSpawner, /* @__PURE__ */ gen(f
|
|
|
570
237
|
endOnDone: config.endOnDone,
|
|
571
238
|
encoding: config.encoding
|
|
572
239
|
});
|
|
573
|
-
if (isStream(config.stream)) return as(forkScoped(run$
|
|
240
|
+
if (isStream(config.stream)) return as(forkScoped(run$2(config.stream, sink)), sink);
|
|
574
241
|
return succeed(sink);
|
|
575
242
|
});
|
|
576
243
|
const setupChildOutputStreams = (command, childProcess, stdoutConfig, stderrConfig) => {
|
|
577
|
-
let stdout = childProcess.stdout ?
|
|
578
|
-
|
|
579
|
-
|
|
580
|
-
|
|
581
|
-
|
|
582
|
-
|
|
583
|
-
|
|
584
|
-
|
|
244
|
+
let stdout = childProcess.stdout ? (() => {
|
|
245
|
+
const passThrough = new PassThrough();
|
|
246
|
+
childProcess.stdout.on("error", (error) => passThrough.destroy(error));
|
|
247
|
+
childProcess.stdout.pipe(passThrough);
|
|
248
|
+
return fromReadable({
|
|
249
|
+
evaluate: () => passThrough,
|
|
250
|
+
onError: (error) => toPlatformError("fromReadable(stdout)", toError(error), command)
|
|
251
|
+
});
|
|
252
|
+
})() : empty;
|
|
253
|
+
let stderr = childProcess.stderr ? (() => {
|
|
254
|
+
const passThrough = new PassThrough();
|
|
255
|
+
childProcess.stderr.on("error", (error) => passThrough.destroy(error));
|
|
256
|
+
childProcess.stderr.pipe(passThrough);
|
|
257
|
+
return fromReadable({
|
|
258
|
+
evaluate: () => passThrough,
|
|
259
|
+
onError: (error) => toPlatformError("fromReadable(stderr)", toError(error), command)
|
|
260
|
+
});
|
|
261
|
+
})() : empty;
|
|
585
262
|
if (isSink(stdoutConfig.stream)) stdout = transduce(stdout, stdoutConfig.stream);
|
|
586
263
|
if (isSink(stderrConfig.stream)) stderr = transduce(stderr, stderrConfig.stream);
|
|
587
264
|
const all = merge(stdout, stderr);
|
|
@@ -631,7 +308,10 @@ const layer$11 = /*#__PURE__*/ effect(ChildProcessSpawner, /* @__PURE__ */ gen(f
|
|
|
631
308
|
} catch {}
|
|
632
309
|
};
|
|
633
310
|
const killProcess = (command, childProcess, signal) => suspend(() => {
|
|
634
|
-
if (!childProcess.kill(signal))
|
|
311
|
+
if (!childProcess.kill(signal)) {
|
|
312
|
+
const error = new globalThis.Error("Failed to kill child process");
|
|
313
|
+
return fail(toPlatformError("kill", error, command));
|
|
314
|
+
}
|
|
635
315
|
return void_;
|
|
636
316
|
});
|
|
637
317
|
const withTimeout = (childProcess, command, options) => (kill) => {
|
|
@@ -666,11 +346,13 @@ const layer$11 = /*#__PURE__*/ effect(ChildProcessSpawner, /* @__PURE__ */ gen(f
|
|
|
666
346
|
const stderrConfig = resolveOutputOption(cmd.options, "stderr");
|
|
667
347
|
const resolvedAdditionalFds = resolveAdditionalFds(cmd.options);
|
|
668
348
|
let isReferenced = true;
|
|
669
|
-
|
|
349
|
+
const cwd = yield* resolveWorkingDirectory(cmd.options);
|
|
350
|
+
const env = resolveEnvironment(cmd.options);
|
|
351
|
+
const stdio = buildStdioArray(stdinConfig, stdoutConfig, stderrConfig, resolvedAdditionalFds);
|
|
670
352
|
const [childProcess, exitSignal] = yield* acquireRelease(spawn(cmd, {
|
|
671
|
-
cwd
|
|
672
|
-
env
|
|
673
|
-
stdio
|
|
353
|
+
cwd,
|
|
354
|
+
env,
|
|
355
|
+
stdio,
|
|
674
356
|
detached: cmd.options.detached ?? process.platform !== "win32",
|
|
675
357
|
shell: cmd.options.shell
|
|
676
358
|
}), fnUntraced(function* ([childProcess, exitSignal]) {
|
|
@@ -682,24 +364,22 @@ const layer$11 = /*#__PURE__*/ effect(ChildProcessSpawner, /* @__PURE__ */ gen(f
|
|
|
682
364
|
return yield* void_;
|
|
683
365
|
}
|
|
684
366
|
if (!isReferenced) return yield* void_;
|
|
685
|
-
return yield* killWithTimeout((command, childProcess, signal) =>
|
|
367
|
+
return yield* killWithTimeout((command, childProcess, signal) => killProcessGroup(command, childProcess, signal).pipe(catch_(() => killProcess(command, childProcess, signal)), andThen(_await(exitSignal)))).pipe(ignore);
|
|
686
368
|
}));
|
|
687
369
|
const pid = ProcessId(childProcess.pid);
|
|
688
370
|
childProcess.on("exit", (code) => {
|
|
689
|
-
if (
|
|
371
|
+
if (code !== 0 && isNotNull(code)) killProcessGroupOnExit(childProcess, cmd.options.killSignal ?? "SIGTERM");
|
|
690
372
|
});
|
|
691
373
|
const reref = sync(() => {
|
|
692
374
|
if (!isReferenced) {
|
|
693
375
|
childProcess.ref();
|
|
694
376
|
isReferenced = true;
|
|
695
|
-
cleanupOnNonZeroExit = false;
|
|
696
377
|
}
|
|
697
378
|
});
|
|
698
379
|
const unref = sync(() => {
|
|
699
380
|
if (isReferenced) {
|
|
700
381
|
childProcess.unref();
|
|
701
382
|
isReferenced = false;
|
|
702
|
-
cleanupOnNonZeroExit = true;
|
|
703
383
|
}
|
|
704
384
|
return reref;
|
|
705
385
|
});
|
|
@@ -709,10 +389,11 @@ const layer$11 = /*#__PURE__*/ effect(ChildProcessSpawner, /* @__PURE__ */ gen(f
|
|
|
709
389
|
const isRunning = map(isDone(exitSignal), (done) => !done);
|
|
710
390
|
const exitCode = flatMap(_await(exitSignal), ([code, signal]) => {
|
|
711
391
|
if (isNotNull(code)) return succeed(ExitCode(code));
|
|
712
|
-
|
|
392
|
+
const error = new globalThis.Error(`Process interrupted due to receipt of signal: '${signal}'`);
|
|
393
|
+
return fail(toPlatformError("exitCode", error, cmd));
|
|
713
394
|
});
|
|
714
395
|
const kill = (options) => {
|
|
715
|
-
return withTimeout(childProcess, cmd, options)((command, childProcess, signal) =>
|
|
396
|
+
return withTimeout(childProcess, cmd, options)((command, childProcess, signal) => killProcessGroup(command, childProcess, signal).pipe(catch_(() => killProcess(command, childProcess, signal)), andThen(_await(exitSignal)))).pipe(asVoid);
|
|
716
397
|
};
|
|
717
398
|
return makeHandle({
|
|
718
399
|
pid,
|
|
@@ -824,29 +505,14 @@ const flattenCommand = (command) => {
|
|
|
824
505
|
};
|
|
825
506
|
};
|
|
826
507
|
//#endregion
|
|
827
|
-
//#region node_modules/.pnpm/@effect+platform-node-shared@4.0.0-beta.
|
|
508
|
+
//#region node_modules/.pnpm/@effect+platform-node-shared@4.0.0-beta.102_effect@4.0.0-beta.102_patch_hash=71215759e1_3273714b76c575f5c82a5a72c5bb5418/node_modules/@effect/platform-node-shared/dist/NodeCrypto.js
|
|
828
509
|
/**
|
|
829
|
-
*
|
|
830
|
-
* Node-compatible `node:crypto` APIs. It exports {@link make} as the concrete
|
|
831
|
-
* service value and {@link layer} for providing that service to programs that
|
|
832
|
-
* need cryptographic random bytes, UUID generation, random values, or SHA
|
|
833
|
-
* digests over `Uint8Array` input.
|
|
510
|
+
* Node-compatible implementation of Effect's `Crypto` service.
|
|
834
511
|
*
|
|
835
|
-
*
|
|
836
|
-
*
|
|
837
|
-
*
|
|
838
|
-
*
|
|
839
|
-
* construction
|
|
840
|
-
* - Compute SHA-1, SHA-256, SHA-384, or SHA-512 digests through
|
|
841
|
-
* `effect/Crypto` after the layer is provided
|
|
842
|
-
*
|
|
843
|
-
* **Gotchas**
|
|
844
|
-
*
|
|
845
|
-
* - Random bytes come from `node:crypto.randomBytes`
|
|
846
|
-
* - Digests use `node:crypto.createHash`; hash failures become platform
|
|
847
|
-
* errors
|
|
848
|
-
* - SHA-1 is included for interoperability with existing protocols, not for
|
|
849
|
-
* new security-sensitive designs
|
|
512
|
+
* This module builds the service from `node:crypto`, using `randomBytes` for
|
|
513
|
+
* random data and `createHash` for supported digest algorithms. It exports
|
|
514
|
+
* `make` as the concrete service value and `layer` for providing it through
|
|
515
|
+
* Effect context.
|
|
850
516
|
*
|
|
851
517
|
* @since 1.0.0
|
|
852
518
|
*/
|
|
@@ -869,7 +535,7 @@ const digest = (algorithm, data) => try_({
|
|
|
869
535
|
})
|
|
870
536
|
});
|
|
871
537
|
//#endregion
|
|
872
|
-
//#region node_modules/.pnpm/@effect+platform-node@4.0.0-beta.
|
|
538
|
+
//#region node_modules/.pnpm/@effect+platform-node@4.0.0-beta.102_patch_hash=cae7efcda6fd29f4db2efd357cb7dc6c41cb6ad_5ec7f92fdb36a12db81428ea9ead6984/node_modules/@effect/platform-node/dist/NodeCrypto.js
|
|
873
539
|
/**
|
|
874
540
|
* The `NodeCrypto` module provides the Node.js `Crypto` service layer for
|
|
875
541
|
* Effect programs. Provide {@link layer} at the edge of a Node application,
|
|
@@ -894,7 +560,7 @@ const layer$9 = /* @__PURE__ */ succeed$2(Crypto, /* @__PURE__ */ make$7({
|
|
|
894
560
|
digest
|
|
895
561
|
}));
|
|
896
562
|
//#endregion
|
|
897
|
-
//#region node_modules/.pnpm/@effect+platform-node-shared@4.0.0-beta.
|
|
563
|
+
//#region node_modules/.pnpm/@effect+platform-node-shared@4.0.0-beta.102_effect@4.0.0-beta.102_patch_hash=71215759e1_3273714b76c575f5c82a5a72c5bb5418/node_modules/@effect/platform-node-shared/dist/NodeFileSystem.js
|
|
898
564
|
/**
|
|
899
565
|
* Shared Node-compatible implementation of Effect's `FileSystem` service.
|
|
900
566
|
*
|
|
@@ -904,29 +570,6 @@ const layer$9 = /* @__PURE__ */ succeed$2(Crypto, /* @__PURE__ */ make$7({
|
|
|
904
570
|
* links, metadata, temporary files and directories, and file watching through
|
|
905
571
|
* the shared `FileSystem` service.
|
|
906
572
|
*
|
|
907
|
-
* **Mental model**
|
|
908
|
-
*
|
|
909
|
-
* {@link layer} installs a process-backed `FileSystem` service. Each operation
|
|
910
|
-
* delegates to the corresponding Node filesystem API, then maps Node failures
|
|
911
|
-
* into `PlatformError` values and invalid arguments into `BadArgument` failures.
|
|
912
|
-
* Paths keep Node's normal behavior: relative paths resolve from the current
|
|
913
|
-
* working directory and platform path rules still apply.
|
|
914
|
-
*
|
|
915
|
-
* **Common tasks**
|
|
916
|
-
*
|
|
917
|
-
* Provide {@link layer} at the Node runtime boundary, then depend on the
|
|
918
|
-
* `FileSystem` service from application code. Use the service for ordinary
|
|
919
|
-
* reads and writes, directory management, metadata inspection, links, temporary
|
|
920
|
-
* resources, and file watching without importing Node's `fs` APIs directly.
|
|
921
|
-
*
|
|
922
|
-
* **Gotchas**
|
|
923
|
-
*
|
|
924
|
-
* Open files are scoped resources with tracked read and write positions; append
|
|
925
|
-
* mode lets the operating system choose the write offset. File watching follows
|
|
926
|
-
* `node:fs.watch` semantics unless a custom watch backend is supplied, so
|
|
927
|
-
* recursive support, event coalescing, and reported paths vary by runtime and
|
|
928
|
-
* platform.
|
|
929
|
-
*
|
|
930
573
|
* @since 4.0.0
|
|
931
574
|
*/
|
|
932
575
|
const handleBadArgument = (method) => (err) => badArgument({
|
|
@@ -963,6 +606,13 @@ const chown = /*#__PURE__*/ (() => {
|
|
|
963
606
|
const nodeChown = /*#__PURE__*/ effectify(NFS.chown, /*#__PURE__*/ handleErrnoException("FileSystem", "chown"), /*#__PURE__*/ handleBadArgument("chown"));
|
|
964
607
|
return (path, uid, gid) => nodeChown(path, uid, gid);
|
|
965
608
|
})();
|
|
609
|
+
const glob = /*#__PURE__*/ (() => {
|
|
610
|
+
const nodeGlob = /*#__PURE__*/ effectify(NFS.glob, /*#__PURE__*/ handleErrnoException("FileSystem", "glob"), /*#__PURE__*/ handleBadArgument("glob"));
|
|
611
|
+
return (pattern, options) => nodeGlob(pattern, {
|
|
612
|
+
cwd: options?.root,
|
|
613
|
+
exclude: options?.exclude
|
|
614
|
+
});
|
|
615
|
+
})();
|
|
966
616
|
const link$2 = /*#__PURE__*/ (() => {
|
|
967
617
|
const nodeLink = /*#__PURE__*/ effectify(NFS.link, /*#__PURE__*/ handleErrnoException("FileSystem", "link"), /*#__PURE__*/ handleBadArgument("link"));
|
|
968
618
|
return (existingPath, newPath) => nodeLink(existingPath, newPath);
|
|
@@ -1113,7 +763,7 @@ const makeTempFileFactory = (method) => {
|
|
|
1113
763
|
const directory = yield* makeDirectory(options);
|
|
1114
764
|
const random = NodeCrypto.randomBytes(6).toString("hex");
|
|
1115
765
|
const name = Path.join(directory, options?.suffix ? `${random}${options.suffix}` : random);
|
|
1116
|
-
yield* writeFile(name, new Uint8Array(0));
|
|
766
|
+
yield* writeFile(name, /* @__PURE__ */ new Uint8Array(0));
|
|
1117
767
|
return name;
|
|
1118
768
|
});
|
|
1119
769
|
};
|
|
@@ -1240,6 +890,7 @@ const makeFileSystem = /*#__PURE__*/ map(/*#__PURE__*/ serviceOption(WatchBacken
|
|
|
1240
890
|
chown,
|
|
1241
891
|
copy,
|
|
1242
892
|
copyFile,
|
|
893
|
+
glob,
|
|
1243
894
|
link: link$2,
|
|
1244
895
|
makeDirectory,
|
|
1245
896
|
makeTempDirectory,
|
|
@@ -1263,7 +914,7 @@ const makeFileSystem = /*#__PURE__*/ map(/*#__PURE__*/ serviceOption(WatchBacken
|
|
|
1263
914
|
writeFile
|
|
1264
915
|
}));
|
|
1265
916
|
//#endregion
|
|
1266
|
-
//#region node_modules/.pnpm/@effect+platform-node@4.0.0-beta.
|
|
917
|
+
//#region node_modules/.pnpm/@effect+platform-node@4.0.0-beta.102_patch_hash=cae7efcda6fd29f4db2efd357cb7dc6c41cb6ad_5ec7f92fdb36a12db81428ea9ead6984/node_modules/@effect/platform-node/dist/NodeFileSystem.js
|
|
1267
918
|
/**
|
|
1268
919
|
* Node.js `FileSystem` layer for programs that perform real filesystem I/O.
|
|
1269
920
|
*
|
|
@@ -1272,24 +923,6 @@ const makeFileSystem = /*#__PURE__*/ map(/*#__PURE__*/ serviceOption(WatchBacken
|
|
|
1272
923
|
* links, temporary paths, and path watching. Effects still call the service from
|
|
1273
924
|
* `effect/FileSystem`; this module only chooses the Node implementation.
|
|
1274
925
|
*
|
|
1275
|
-
* **Mental model**
|
|
1276
|
-
*
|
|
1277
|
-
* Provide `NodeFileSystem.layer` at the process boundary when filesystem
|
|
1278
|
-
* effects should touch the host filesystem. Use `NodeServices.layer` instead
|
|
1279
|
-
* when the same program also needs the standard Node path, stdio, terminal,
|
|
1280
|
-
* crypto, and child process services. Tests that need isolation can provide a
|
|
1281
|
-
* different `FileSystem` layer without changing the code that performs the
|
|
1282
|
-
* reads and writes.
|
|
1283
|
-
*
|
|
1284
|
-
* **Gotchas**
|
|
1285
|
-
*
|
|
1286
|
-
* Paths are interpreted by Node, so relative paths resolve against the current
|
|
1287
|
-
* working directory and platform-specific path rules apply. Filesystem failures
|
|
1288
|
-
* are reported through Effect platform errors rather than thrown exceptions.
|
|
1289
|
-
* File watching uses `FileSystem.WatchBackend` when one is available; otherwise
|
|
1290
|
-
* it follows `node:fs.watch`, whose recursive support, event batching, and
|
|
1291
|
-
* reported path names vary across operating systems.
|
|
1292
|
-
*
|
|
1293
926
|
* @since 4.0.0
|
|
1294
927
|
*/
|
|
1295
928
|
/**
|
|
@@ -1300,30 +933,14 @@ const makeFileSystem = /*#__PURE__*/ map(/*#__PURE__*/ serviceOption(WatchBacken
|
|
|
1300
933
|
*/
|
|
1301
934
|
const layer$7 = /* @__PURE__ */ effect(FileSystem)(makeFileSystem);
|
|
1302
935
|
//#endregion
|
|
1303
|
-
//#region node_modules/.pnpm/@effect+platform-node-shared@4.0.0-beta.
|
|
936
|
+
//#region node_modules/.pnpm/@effect+platform-node-shared@4.0.0-beta.102_effect@4.0.0-beta.102_patch_hash=71215759e1_3273714b76c575f5c82a5a72c5bb5418/node_modules/@effect/platform-node-shared/dist/NodePath.js
|
|
1304
937
|
/**
|
|
1305
938
|
* Node-backed provider for Effect's `Path` service.
|
|
1306
939
|
*
|
|
1307
|
-
* This module turns Node's `node:path` and `node:url` APIs into `
|
|
1308
|
-
*
|
|
1309
|
-
*
|
|
1310
|
-
*
|
|
1311
|
-
* URL conversion.
|
|
1312
|
-
*
|
|
1313
|
-
* **Mental model**
|
|
1314
|
-
*
|
|
1315
|
-
* `layer` follows the platform semantics of the current Node runtime. The
|
|
1316
|
-
* `layerPosix` and `layerWin32` variants pin the syntax rules to POSIX or
|
|
1317
|
-
* Windows, which is useful for deterministic parsing, formatting, and tests.
|
|
1318
|
-
* All three layers include `fromFileUrl` and `toFileUrl` behavior backed by
|
|
1319
|
-
* Node's URL conversion functions.
|
|
1320
|
-
*
|
|
1321
|
-
* **Gotchas**
|
|
1322
|
-
*
|
|
1323
|
-
* Path operations are syntactic: they normalize separators, roots, drive
|
|
1324
|
-
* letters, UNC segments, extensions, and relative segments without checking the
|
|
1325
|
-
* filesystem. File URL conversion follows Node's validation and encoding
|
|
1326
|
-
* rules, and invalid conversions fail with `BadArgument`.
|
|
940
|
+
* This module turns Node's `node:path` and `node:url` APIs into `Path` layers.
|
|
941
|
+
* `layer` uses the host platform path implementation, while `layerPosix` and
|
|
942
|
+
* `layerWin32` provide fixed POSIX and Windows variants. All three layers also
|
|
943
|
+
* include helpers for converting between file paths and file URLs.
|
|
1327
944
|
*
|
|
1328
945
|
* @since 4.0.0
|
|
1329
946
|
*/
|
|
@@ -1346,34 +963,14 @@ const toFileUrl = (path) => try_({
|
|
|
1346
963
|
({ ...Path.posix });
|
|
1347
964
|
({ ...Path.win32 });
|
|
1348
965
|
//#endregion
|
|
1349
|
-
//#region node_modules/.pnpm/@effect+platform-node@4.0.0-beta.
|
|
966
|
+
//#region node_modules/.pnpm/@effect+platform-node@4.0.0-beta.102_patch_hash=cae7efcda6fd29f4db2efd357cb7dc6c41cb6ad_5ec7f92fdb36a12db81428ea9ead6984/node_modules/@effect/platform-node/dist/NodePath.js
|
|
1350
967
|
/**
|
|
1351
968
|
* Node.js layers for Effect's `Path` service.
|
|
1352
969
|
*
|
|
1353
|
-
* This module
|
|
1354
|
-
* platform-independent `Path` service
|
|
1355
|
-
*
|
|
1356
|
-
*
|
|
1357
|
-
*
|
|
1358
|
-
* **Mental model**
|
|
1359
|
-
*
|
|
1360
|
-
* `Path` is a syntactic service: it manipulates strings and `file:` URLs. It
|
|
1361
|
-
* does not read the filesystem, check permissions, or validate that paths
|
|
1362
|
-
* exist. The selected layer decides which separator, drive-letter, UNC, and URL
|
|
1363
|
-
* conversion rules are used.
|
|
1364
|
-
*
|
|
1365
|
-
* **Common tasks**
|
|
1366
|
-
*
|
|
1367
|
-
* Use `layer` for host-platform Node semantics, `layerPosix` for stable POSIX
|
|
1368
|
-
* behavior, and `layerWin32` for stable Windows behavior. `NodeServices.layer`
|
|
1369
|
-
* already includes `layer`, so import this module directly when a program wants
|
|
1370
|
-
* only path support or a platform-specific variant.
|
|
1371
|
-
*
|
|
1372
|
-
* **Gotchas**
|
|
1373
|
-
*
|
|
1374
|
-
* Results that are correct on one platform may not be portable to another.
|
|
1375
|
-
* `fromFileUrl` and `toFileUrl` use Node's `node:url` conversion rules and
|
|
1376
|
-
* report invalid conversions as `BadArgument` failures.
|
|
970
|
+
* This module provides the default, POSIX, and Windows variants of the
|
|
971
|
+
* platform-independent `Path` service by reusing the shared Node path
|
|
972
|
+
* implementation. The provided path services include Node file URL conversion
|
|
973
|
+
* behavior.
|
|
1377
974
|
*
|
|
1378
975
|
* @since 4.0.0
|
|
1379
976
|
*/
|
|
@@ -1385,42 +982,23 @@ const toFileUrl = (path) => try_({
|
|
|
1385
982
|
* @since 4.0.0
|
|
1386
983
|
*/
|
|
1387
984
|
const layer$5 = /* @__PURE__ */ succeed$2(Path$1)({
|
|
1388
|
-
[TypeId$
|
|
985
|
+
[TypeId$2]: TypeId$2,
|
|
1389
986
|
...Path,
|
|
1390
987
|
fromFileUrl,
|
|
1391
988
|
toFileUrl
|
|
1392
989
|
});
|
|
1393
990
|
//#endregion
|
|
1394
|
-
//#region node_modules/.pnpm/effect@4.0.0-beta.
|
|
991
|
+
//#region node_modules/.pnpm/effect@4.0.0-beta.102_patch_hash=71215759e1ac0a7f65d7b75d816986687ae6c3a6cba02d928d184ca71790d488/node_modules/effect/dist/Stdio.js
|
|
1395
992
|
/**
|
|
1396
|
-
* Service contract for
|
|
1397
|
-
*
|
|
1398
|
-
*
|
|
1399
|
-
* `Stdio` lets command-line programs depend on standard I/O through the Effect
|
|
993
|
+
* Service contract for command-line arguments and standard input, output, and
|
|
994
|
+
* error output. It lets programs depend on standard I/O through the Effect
|
|
1400
995
|
* environment instead of reading from or writing to global process handles
|
|
1401
|
-
* directly.
|
|
1402
|
-
* `Sink`s that accept strings or bytes, and stdin as a byte `Stream`.
|
|
996
|
+
* directly.
|
|
1403
997
|
*
|
|
1404
|
-
*
|
|
1405
|
-
*
|
|
1406
|
-
*
|
|
1407
|
-
*
|
|
1408
|
-
* implementations, while tests can use `Stdio.layerTest` to replace only the
|
|
1409
|
-
* fields that matter for a scenario and keep the rest inert.
|
|
1410
|
-
*
|
|
1411
|
-
* **Common tasks**
|
|
1412
|
-
*
|
|
1413
|
-
* - Read command-line arguments from the service's `args` effect.
|
|
1414
|
-
* - Write text or bytes by running values into the service's `stdout()` or
|
|
1415
|
-
* `stderr()` sinks.
|
|
1416
|
-
* - Consume `stdin` as a stream of `Uint8Array` chunks.
|
|
1417
|
-
* - Build deterministic tests with `Stdio.layerTest`.
|
|
1418
|
-
*
|
|
1419
|
-
* **Gotchas**
|
|
1420
|
-
*
|
|
1421
|
-
* Standard I/O is a platform capability. Reads and writes can fail with
|
|
1422
|
-
* `PlatformError`, so handle failures in the Effect error channel instead of
|
|
1423
|
-
* assuming the process streams are always available.
|
|
998
|
+
* The service exposes arguments as an `Effect`, stdout and stderr as `Sink`s
|
|
999
|
+
* that accept strings or bytes, and stdin as a byte `Stream`. This module also
|
|
1000
|
+
* provides a constructor for service values and a small test layer with
|
|
1001
|
+
* overridable defaults.
|
|
1424
1002
|
*
|
|
1425
1003
|
* @since 4.0.0
|
|
1426
1004
|
*/
|
|
@@ -1475,31 +1053,14 @@ const make$2 = (options) => ({
|
|
|
1475
1053
|
...options
|
|
1476
1054
|
});
|
|
1477
1055
|
//#endregion
|
|
1478
|
-
//#region node_modules/.pnpm/@effect+platform-node@4.0.0-beta.
|
|
1056
|
+
//#region node_modules/.pnpm/@effect+platform-node@4.0.0-beta.102_patch_hash=cae7efcda6fd29f4db2efd357cb7dc6c41cb6ad_5ec7f92fdb36a12db81428ea9ead6984/node_modules/@effect/platform-node/dist/NodeStdio.js
|
|
1479
1057
|
/**
|
|
1480
1058
|
* Node.js `Stdio` layer for the current process.
|
|
1481
1059
|
*
|
|
1482
|
-
* The exported layer
|
|
1483
|
-
*
|
|
1484
|
-
* `process.
|
|
1485
|
-
* `process.stderr`.
|
|
1486
|
-
* runners, and tests that intentionally communicate through the host process.
|
|
1487
|
-
*
|
|
1488
|
-
* **Mental model**
|
|
1489
|
-
*
|
|
1490
|
-
* Effects should depend on `Stdio`; this module decides that the backing
|
|
1491
|
-
* streams are the global Node process handles. Provide `NodeStdio.layer` when a
|
|
1492
|
-
* program only needs standard input and output, or `NodeServices.layer` when the
|
|
1493
|
-
* same entrypoint also needs the other default Node services.
|
|
1494
|
-
*
|
|
1495
|
-
* **Gotchas**
|
|
1496
|
-
*
|
|
1497
|
-
* The process stdio streams are shared resources. The layer leaves stdin open
|
|
1498
|
-
* and does not end stdout or stderr by default, avoiding accidental closure of
|
|
1499
|
-
* handles that other code in the same process may still use. Stdio might be a
|
|
1500
|
-
* pipe, file, or TTY; terminal-specific behavior such as raw mode, echo, color
|
|
1501
|
-
* detection, and cursor movement belongs with terminal APIs rather than this
|
|
1502
|
-
* service.
|
|
1060
|
+
* The exported layer reuses the shared Node stdio implementation. It satisfies
|
|
1061
|
+
* the platform-independent `Stdio` service by reading command-line arguments
|
|
1062
|
+
* from `process.argv`, consuming input from `process.stdin`, and writing output
|
|
1063
|
+
* streams to `process.stdout` and `process.stderr`.
|
|
1503
1064
|
*
|
|
1504
1065
|
* @since 4.0.0
|
|
1505
1066
|
*/
|
|
@@ -1612,7 +1173,7 @@ function defaultShouldQuit(input) {
|
|
|
1612
1173
|
return input.key.ctrl && (input.key.name === "c" || input.key.name === "d");
|
|
1613
1174
|
}
|
|
1614
1175
|
//#endregion
|
|
1615
|
-
//#region node_modules/.pnpm/@effect+platform-node@4.0.0-beta.
|
|
1176
|
+
//#region node_modules/.pnpm/@effect+platform-node@4.0.0-beta.102_patch_hash=cae7efcda6fd29f4db2efd357cb7dc6c41cb6ad_5ec7f92fdb36a12db81428ea9ead6984/node_modules/@effect/platform-node/dist/NodeServices.js
|
|
1616
1177
|
/**
|
|
1617
1178
|
* Provides the default Node implementations for child process spawning,
|
|
1618
1179
|
* filesystem, path, stdio, and terminal services.
|
|
@@ -1622,7 +1183,7 @@ function defaultShouldQuit(input) {
|
|
|
1622
1183
|
*/
|
|
1623
1184
|
const layer = /*#__PURE__*/ provideMerge(layer$11, /*#__PURE__*/ mergeAll(layer$7, layer$9, layer$5, layer$3, layer$2));
|
|
1624
1185
|
//#endregion
|
|
1625
|
-
//#region node_modules/.pnpm/effect@4.0.0-beta.
|
|
1186
|
+
//#region node_modules/.pnpm/effect@4.0.0-beta.102_patch_hash=71215759e1ac0a7f65d7b75d816986687ae6c3a6cba02d928d184ca71790d488/node_modules/effect/dist/unstable/cli/Argument.js
|
|
1626
1187
|
/**
|
|
1627
1188
|
* Creates a positional string argument.
|
|
1628
1189
|
*
|
|
@@ -1706,7 +1267,34 @@ const variadic = /*#__PURE__*/ dual((args) => isParam(args[0]), (self, options)
|
|
|
1706
1267
|
*/
|
|
1707
1268
|
const mapEffect = /*#__PURE__*/ dual(2, (self, f) => mapEffect$1(self, f));
|
|
1708
1269
|
//#endregion
|
|
1709
|
-
//#region node_modules/.pnpm/effect@4.0.0-beta.
|
|
1270
|
+
//#region node_modules/.pnpm/effect@4.0.0-beta.102_patch_hash=71215759e1ac0a7f65d7b75d816986687ae6c3a6cba02d928d184ca71790d488/node_modules/effect/dist/unstable/cli/CliConfig.js
|
|
1271
|
+
/**
|
|
1272
|
+
* Configuration for Effect CLI command execution.
|
|
1273
|
+
*
|
|
1274
|
+
* @since 4.0.0
|
|
1275
|
+
*/
|
|
1276
|
+
/**
|
|
1277
|
+
* Context reference for configuration shared by CLI parsing, help generation,
|
|
1278
|
+
* and command execution.
|
|
1279
|
+
*
|
|
1280
|
+
* **When to use**
|
|
1281
|
+
*
|
|
1282
|
+
* Use when you need to customize runner-wide CLI behavior, such as which
|
|
1283
|
+
* built-in global flags are available.
|
|
1284
|
+
*
|
|
1285
|
+
* @category services
|
|
1286
|
+
* @since 4.0.0
|
|
1287
|
+
*/
|
|
1288
|
+
var CliConfig = class extends Reference("effect/unstable/cli/CliConfig", { defaultValue: () => defaults }) {};
|
|
1289
|
+
/**
|
|
1290
|
+
* Default CLI configuration containing every built-in global flag.
|
|
1291
|
+
*
|
|
1292
|
+
* @category defaults
|
|
1293
|
+
* @since 4.0.0
|
|
1294
|
+
*/
|
|
1295
|
+
const defaults = { builtIns: BuiltIns };
|
|
1296
|
+
//#endregion
|
|
1297
|
+
//#region node_modules/.pnpm/effect@4.0.0-beta.102_patch_hash=71215759e1ac0a7f65d7b75d816986687ae6c3a6cba02d928d184ca71790d488/node_modules/effect/dist/unstable/cli/internal/lexer.js
|
|
1710
1298
|
/** @internal */
|
|
1711
1299
|
function lex(argv) {
|
|
1712
1300
|
const endIndex = argv.indexOf("--");
|
|
@@ -1757,7 +1345,7 @@ const lexTokens = (args) => {
|
|
|
1757
1345
|
return tokens;
|
|
1758
1346
|
};
|
|
1759
1347
|
//#endregion
|
|
1760
|
-
//#region node_modules/.pnpm/effect@4.0.0-beta.
|
|
1348
|
+
//#region node_modules/.pnpm/effect@4.0.0-beta.102_patch_hash=71215759e1ac0a7f65d7b75d816986687ae6c3a6cba02d928d184ca71790d488/node_modules/effect/dist/unstable/cli/internal/auto-suggest.js
|
|
1761
1349
|
/**
|
|
1762
1350
|
* Simple Levenshtein distance implementation (small N, no perf worries)
|
|
1763
1351
|
*/
|
|
@@ -1785,7 +1373,7 @@ const suggest = (input, candidates) => {
|
|
|
1785
1373
|
return distances.filter(([d]) => d === minDistance).map(([, c]) => c);
|
|
1786
1374
|
};
|
|
1787
1375
|
//#endregion
|
|
1788
|
-
//#region node_modules/.pnpm/effect@4.0.0-beta.
|
|
1376
|
+
//#region node_modules/.pnpm/effect@4.0.0-beta.102_patch_hash=71215759e1ac0a7f65d7b75d816986687ae6c3a6cba02d928d184ca71790d488/node_modules/effect/dist/unstable/cli/internal/parser.js
|
|
1789
1377
|
/**
|
|
1790
1378
|
* Parsing Pipeline for CLI Commands
|
|
1791
1379
|
* ==================================
|
|
@@ -1827,23 +1415,25 @@ const parseArgs = (lexResult, command, commandPath = []) => gen(function* () {
|
|
|
1827
1415
|
const inheritedFlagParams = commandImpl.contextConfig.flags.flatMap(extractSingleParams).filter(isFlagParam);
|
|
1828
1416
|
const inheritedFlagRegistry = createFlagRegistry(inheritedFlagParams);
|
|
1829
1417
|
const inheritedNames = new Set(inheritedFlagParams.map((param) => param.name));
|
|
1830
|
-
const
|
|
1418
|
+
const context = {
|
|
1831
1419
|
command,
|
|
1832
1420
|
commandPath: newCommandPath,
|
|
1833
1421
|
flagRegistry,
|
|
1834
1422
|
inheritedFlagRegistry,
|
|
1835
1423
|
localFlagNames: flagParams.filter((param) => !inheritedNames.has(param.name)).map((param) => param.name)
|
|
1836
|
-
}
|
|
1424
|
+
};
|
|
1425
|
+
const result = scanCommandLevel(tokens, context);
|
|
1837
1426
|
if (result._tag === "Leaf") return {
|
|
1838
1427
|
flags: result.flags,
|
|
1839
1428
|
arguments: [...result.arguments, ...afterEndOfOptions],
|
|
1840
1429
|
subcommand: none(),
|
|
1841
1430
|
...result.errors.length > 0 && { errors: result.errors }
|
|
1842
1431
|
};
|
|
1843
|
-
const
|
|
1432
|
+
const subLex = {
|
|
1844
1433
|
tokens: result.childTokens,
|
|
1845
1434
|
trailingOperands: []
|
|
1846
|
-
}
|
|
1435
|
+
};
|
|
1436
|
+
const subParsed = yield* parseArgs(subLex, result.sub, newCommandPath);
|
|
1847
1437
|
const allErrors = [...result.errors, ...subParsed.errors ?? []];
|
|
1848
1438
|
return {
|
|
1849
1439
|
flags: result.flags,
|
|
@@ -1946,6 +1536,15 @@ const invalidNegatedFlagValue = (token, spec, value) => new InvalidValue({
|
|
|
1946
1536
|
expected: `omit the value and use ${token.raw} by itself to set --${spec.name} to false`,
|
|
1947
1537
|
kind: "flag"
|
|
1948
1538
|
});
|
|
1539
|
+
const missingFlagValue = (spec) => {
|
|
1540
|
+
const choices = getChoiceKeys(spec.primitiveType);
|
|
1541
|
+
return new InvalidValue({
|
|
1542
|
+
option: spec.name,
|
|
1543
|
+
value: "",
|
|
1544
|
+
expected: choices === void 0 ? spec.typeName ?? getTypeName(spec.primitiveType) : choices.join(" | "),
|
|
1545
|
+
kind: "flag"
|
|
1546
|
+
});
|
|
1547
|
+
};
|
|
1949
1548
|
/**
|
|
1950
1549
|
* Checks whether a token is a boolean literal value.
|
|
1951
1550
|
* Recognizes: true/false, yes/no, on/off, 1/0
|
|
@@ -2018,8 +1617,8 @@ const consumeFlagValueWithTokens = (cursor, token, spec, negated = false) => {
|
|
|
2018
1617
|
};
|
|
2019
1618
|
}
|
|
2020
1619
|
return {
|
|
2021
|
-
_tag: "
|
|
2022
|
-
|
|
1620
|
+
_tag: "Error",
|
|
1621
|
+
error: missingFlagValue(spec),
|
|
2023
1622
|
tokens: []
|
|
2024
1623
|
};
|
|
2025
1624
|
};
|
|
@@ -2302,7 +1901,167 @@ const scanCommandLevel = (tokens, context) => {
|
|
|
2302
1901
|
return toLeafResult(state);
|
|
2303
1902
|
};
|
|
2304
1903
|
//#endregion
|
|
2305
|
-
//#region node_modules/.pnpm/effect@4.0.0-beta.
|
|
1904
|
+
//#region node_modules/.pnpm/effect@4.0.0-beta.102_patch_hash=71215759e1ac0a7f65d7b75d816986687ae6c3a6cba02d928d184ca71790d488/node_modules/effect/dist/unstable/cli/internal/wizard.js
|
|
1905
|
+
const run$1 = /*#__PURE__*/ fnUntraced(function* (command, options) {
|
|
1906
|
+
const commandPath = options?.commandPath ?? [command.name];
|
|
1907
|
+
const selected = getCommandAtPath(command, commandPath);
|
|
1908
|
+
const commandLine = [...options?.prefix ?? commandPath];
|
|
1909
|
+
yield* logCurrentCommand(commandLine);
|
|
1910
|
+
yield* promptCommand(selected, commandLine, selected === command ? "ROOT" : selected.name);
|
|
1911
|
+
return commandLine;
|
|
1912
|
+
});
|
|
1913
|
+
const getCommandAtPath = (command, commandPath) => {
|
|
1914
|
+
let current = command;
|
|
1915
|
+
for (const name of commandPath.slice(1)) {
|
|
1916
|
+
const child = current.subcommands.flatMap((group) => group.commands).find((candidate) => candidate.name === name || candidate.alias === name);
|
|
1917
|
+
if (child === void 0) break;
|
|
1918
|
+
current = child;
|
|
1919
|
+
}
|
|
1920
|
+
return current;
|
|
1921
|
+
};
|
|
1922
|
+
const promptCommand = /*#__PURE__*/ fnUntraced(function* (command, commandLine, sectionName) {
|
|
1923
|
+
const impl = toImpl(command);
|
|
1924
|
+
const visibleSubcommands = command.subcommands.flatMap((group) => group.commands.filter((child) => !child.hidden));
|
|
1925
|
+
const config = visibleSubcommands.length === 0 ? impl.config : impl.contextConfig;
|
|
1926
|
+
if (config.flags.length > 0) {
|
|
1927
|
+
yield* log(renderSection(sectionName, "FLAGS"));
|
|
1928
|
+
for (const param of config.flags) commandLine.push(...yield* promptParam(param));
|
|
1929
|
+
if (config.arguments.length > 0 || visibleSubcommands.length > 0) yield* logCurrentCommand(commandLine);
|
|
1930
|
+
}
|
|
1931
|
+
if (config.arguments.length > 0) {
|
|
1932
|
+
yield* log(renderSection(sectionName, "ARGUMENTS"));
|
|
1933
|
+
for (const param of config.arguments) commandLine.push(...yield* promptParam(param));
|
|
1934
|
+
if (visibleSubcommands.length > 0) yield* logCurrentCommand(commandLine);
|
|
1935
|
+
}
|
|
1936
|
+
if (visibleSubcommands.length === 0) return;
|
|
1937
|
+
const child = yield* run$3(select({
|
|
1938
|
+
message: "Command",
|
|
1939
|
+
choices: visibleSubcommands.map((command) => ({
|
|
1940
|
+
title: command.name,
|
|
1941
|
+
value: command,
|
|
1942
|
+
...command.shortDescription !== void 0 ? { description: command.shortDescription } : command.description !== void 0 ? { description: command.description } : {}
|
|
1943
|
+
}))
|
|
1944
|
+
}));
|
|
1945
|
+
yield* log();
|
|
1946
|
+
commandLine.push(child.name);
|
|
1947
|
+
if (hasWizardSteps(child)) yield* logCurrentCommand(commandLine);
|
|
1948
|
+
yield* promptCommand(child, commandLine, child.name);
|
|
1949
|
+
});
|
|
1950
|
+
const hasWizardSteps = (command) => {
|
|
1951
|
+
return command.subcommands.some((group) => group.commands.some((child) => !child.hidden)) || toImpl(command).config.orderedParams.length > 0;
|
|
1952
|
+
};
|
|
1953
|
+
const promptParam = /*#__PURE__*/ fnUntraced(function* (param) {
|
|
1954
|
+
const single = getUnderlyingSingleOrThrow(param);
|
|
1955
|
+
const metadata = getParamMetadata(param);
|
|
1956
|
+
if (metadata.isOptional) {
|
|
1957
|
+
if (!(yield* run$3(confirm({
|
|
1958
|
+
message: `Set ${renderParamLabel(single)}?`,
|
|
1959
|
+
initial: false
|
|
1960
|
+
})))) {
|
|
1961
|
+
yield* log();
|
|
1962
|
+
return [];
|
|
1963
|
+
}
|
|
1964
|
+
}
|
|
1965
|
+
const count = !metadata.isVariadic ? 1 : yield* run$3(integer({
|
|
1966
|
+
message: `${renderParamLabel(single)} count`,
|
|
1967
|
+
default: getOrElse(metadata.variadicMin, () => 0),
|
|
1968
|
+
min: getOrElse(metadata.variadicMin, () => 0),
|
|
1969
|
+
...isSome(metadata.variadicMax) ? { max: metadata.variadicMax.value } : {}
|
|
1970
|
+
}));
|
|
1971
|
+
const values = [];
|
|
1972
|
+
for (let i = 0; i < count; i++) values.push(yield* promptSingle(single));
|
|
1973
|
+
const parsed = single.kind === "flag" ? {
|
|
1974
|
+
flags: { [single.name]: values },
|
|
1975
|
+
arguments: []
|
|
1976
|
+
} : {
|
|
1977
|
+
flags: {},
|
|
1978
|
+
arguments: values
|
|
1979
|
+
};
|
|
1980
|
+
yield* param.parse(parsed);
|
|
1981
|
+
yield* log();
|
|
1982
|
+
if (single.kind === "argument") return values;
|
|
1983
|
+
return values.flatMap((value) => [`--${single.name}`, value]);
|
|
1984
|
+
});
|
|
1985
|
+
const promptSingle = (single) => {
|
|
1986
|
+
const message = renderParamMessage(single);
|
|
1987
|
+
switch (single.primitiveType._tag) {
|
|
1988
|
+
case "Boolean": return map(run$3(confirm({
|
|
1989
|
+
message,
|
|
1990
|
+
label: {
|
|
1991
|
+
confirm: "true",
|
|
1992
|
+
deny: "false"
|
|
1993
|
+
},
|
|
1994
|
+
placeholder: {
|
|
1995
|
+
defaultConfirm: "(T/f)",
|
|
1996
|
+
defaultDeny: "(t/F)"
|
|
1997
|
+
}
|
|
1998
|
+
})), String);
|
|
1999
|
+
case "Choice": return run$3(select({
|
|
2000
|
+
message,
|
|
2001
|
+
choices: (getChoiceKeys(single.primitiveType) ?? []).map((choice) => ({
|
|
2002
|
+
title: choice,
|
|
2003
|
+
value: choice
|
|
2004
|
+
}))
|
|
2005
|
+
}));
|
|
2006
|
+
case "Date": return map(run$3(date({ message })), (date) => date.toISOString());
|
|
2007
|
+
case "Float": return map(run$3(float({ message })), String);
|
|
2008
|
+
case "Integer": return map(run$3(integer({ message })), String);
|
|
2009
|
+
case "Redacted": return map(run$3(password({ message })), value$2);
|
|
2010
|
+
default: return run$3(text({ message }));
|
|
2011
|
+
}
|
|
2012
|
+
};
|
|
2013
|
+
const formatName = (single) => single.kind === "flag" ? `--${single.name}` : single.name;
|
|
2014
|
+
const renderParamMessage = (single) => renderParamLabel(single);
|
|
2015
|
+
const renderParamLabel = (single) => {
|
|
2016
|
+
const description = getOrUndefined(single.description)?.trim();
|
|
2017
|
+
const label = single.kind === "flag" && description !== void 0 && description.length <= 32 ? description : humanize(single.name);
|
|
2018
|
+
return single.kind === "flag" ? `${label} (${formatName(single)})` : label;
|
|
2019
|
+
};
|
|
2020
|
+
const humanize = (name) => {
|
|
2021
|
+
const words = name.split(/[-_]+/).filter((word) => word.length > 0);
|
|
2022
|
+
if (words.length === 0) return name;
|
|
2023
|
+
return [words[0][0].toUpperCase() + words[0].slice(1), ...words.slice(1)].join(" ");
|
|
2024
|
+
};
|
|
2025
|
+
const logCurrentCommand = (commandLine) => log(renderCommandBlock("Current command", commandLine, magenta));
|
|
2026
|
+
const renderSection = (commandName, section) => `${annotate(commandName.toUpperCase(), bold, cyanBright)} ${annotate("·", blackBright)} ${annotate(section, bold, white)}`;
|
|
2027
|
+
const renderIntroduction = (name, version, summary) => {
|
|
2028
|
+
return [
|
|
2029
|
+
`${annotate(name, bold, cyanBright)} ${annotate(`v${version}`, white)} ${annotate("· Command wizard", bold, white)}`,
|
|
2030
|
+
...summary === void 0 || summary.length === 0 ? [] : [summary],
|
|
2031
|
+
annotate("Build a command interactively. Press Ctrl+C to cancel.", blackBright),
|
|
2032
|
+
""
|
|
2033
|
+
].join("\n");
|
|
2034
|
+
};
|
|
2035
|
+
const renderCompletion = (commandLine) => renderCommandBlock("Command ready", commandLine, cyanBright, green);
|
|
2036
|
+
const renderQuit = () => `\n${annotate("Wizard cancelled.", red)}`;
|
|
2037
|
+
const renderCommandBlock = (label, commandLine, commandColor, labelColor = white) => {
|
|
2038
|
+
const lines = wrapCommand(commandLine);
|
|
2039
|
+
return [
|
|
2040
|
+
annotate(label, bold, labelColor),
|
|
2041
|
+
...lines.map((line) => annotate(line, commandColor)),
|
|
2042
|
+
""
|
|
2043
|
+
].join("\n");
|
|
2044
|
+
};
|
|
2045
|
+
const wrapCommand = (commandLine) => {
|
|
2046
|
+
const width = 88;
|
|
2047
|
+
const firstIndent = " $ ";
|
|
2048
|
+
const continuationIndent = " ";
|
|
2049
|
+
const args = commandLine.map(formatShellArg);
|
|
2050
|
+
const lines = [];
|
|
2051
|
+
let current = firstIndent;
|
|
2052
|
+
for (const arg of args) {
|
|
2053
|
+
const separator = current === firstIndent || current === continuationIndent ? "" : " ";
|
|
2054
|
+
if (current.length + separator.length + arg.length > width && current !== firstIndent) {
|
|
2055
|
+
lines.push(`${current} \\`);
|
|
2056
|
+
current = `${continuationIndent}${arg}`;
|
|
2057
|
+
} else current += `${separator}${arg}`;
|
|
2058
|
+
}
|
|
2059
|
+
if (current !== firstIndent) lines.push(current);
|
|
2060
|
+
return lines;
|
|
2061
|
+
};
|
|
2062
|
+
const formatShellArg = (arg) => /^[A-Za-z0-9_./:@%+=,-]+$/.test(arg) ? arg : `'${arg.replaceAll("'", `'"'"'`)}'`;
|
|
2063
|
+
//#endregion
|
|
2064
|
+
//#region node_modules/.pnpm/effect@4.0.0-beta.102_patch_hash=71215759e1ac0a7f65d7b75d816986687ae6c3a6cba02d928d184ca71790d488/node_modules/effect/dist/unstable/cli/Command.js
|
|
2306
2065
|
/**
|
|
2307
2066
|
* Returns `true` if the provided value is a `Command`.
|
|
2308
2067
|
*
|
|
@@ -2314,7 +2073,7 @@ const scanCommandLevel = (tokens, context) => {
|
|
|
2314
2073
|
* @category guards
|
|
2315
2074
|
* @since 4.0.0
|
|
2316
2075
|
*/
|
|
2317
|
-
const isCommand = (u) => hasProperty(u, TypeId$
|
|
2076
|
+
const isCommand = (u) => hasProperty(u, TypeId$3);
|
|
2318
2077
|
/**
|
|
2319
2078
|
* Creates a `Command` from a name, an optional configuration, and an optional
|
|
2320
2079
|
* handler.
|
|
@@ -2466,10 +2225,13 @@ const withSubcommands = /*#__PURE__*/ dual(2, (self, subcommands) => {
|
|
|
2466
2225
|
if (!sub) return yield* impl.parse(raw);
|
|
2467
2226
|
const context = yield* impl.parseContext(raw);
|
|
2468
2227
|
const result = yield* sub.parse(raw.subcommand.value.parsedInput);
|
|
2469
|
-
return
|
|
2470
|
-
|
|
2471
|
-
|
|
2472
|
-
|
|
2228
|
+
return {
|
|
2229
|
+
...context,
|
|
2230
|
+
[SubcommandStateSymbol]: {
|
|
2231
|
+
name: sub.name,
|
|
2232
|
+
result
|
|
2233
|
+
}
|
|
2234
|
+
};
|
|
2473
2235
|
});
|
|
2474
2236
|
const handle = fnUntraced(function* (input, path) {
|
|
2475
2237
|
const selectedSubcommand = input[SubcommandStateSymbol];
|
|
@@ -2512,7 +2274,7 @@ const withSubcommands = /*#__PURE__*/ dual(2, (self, subcommands) => {
|
|
|
2512
2274
|
*/
|
|
2513
2275
|
const withGlobalFlags = /*#__PURE__*/ dual(2, (self, globalFlags) => {
|
|
2514
2276
|
const impl = toImpl(self);
|
|
2515
|
-
const next = Array.from(new Set([...impl.globalFlags, ...globalFlags]));
|
|
2277
|
+
const next = Array.from(/* @__PURE__ */ new Set([...impl.globalFlags, ...globalFlags]));
|
|
2516
2278
|
return makeCommand({
|
|
2517
2279
|
...impl,
|
|
2518
2280
|
globalFlags: next
|
|
@@ -2572,8 +2334,9 @@ const getOutOfScopeGlobalFlagErrors = (allFlags, activeFlags, flagMap, commandPa
|
|
|
2572
2334
|
return errors;
|
|
2573
2335
|
};
|
|
2574
2336
|
const showHelp = (command, error$1) => gen(function* () {
|
|
2337
|
+
const { builtIns } = yield* CliConfig;
|
|
2575
2338
|
const formatter = yield* Formatter;
|
|
2576
|
-
const helpDoc = yield* getHelpForCommandPath(command, error$1.commandPath,
|
|
2339
|
+
const helpDoc = yield* getHelpForCommandPath(command, error$1.commandPath, builtIns);
|
|
2577
2340
|
yield* log(formatter.formatHelpDoc(helpDoc));
|
|
2578
2341
|
if (error$1.errors.length > 0) yield* error(formatter.formatErrors(error$1.errors));
|
|
2579
2342
|
});
|
|
@@ -2655,9 +2418,12 @@ const run = /*#__PURE__*/ dual(2, (command, config) => Stdio.use(({ args }) => f
|
|
|
2655
2418
|
const runWith = (command, config) => {
|
|
2656
2419
|
const commandImpl = toImpl(command);
|
|
2657
2420
|
return fnUntraced(function* (args) {
|
|
2421
|
+
const { builtIns } = yield* CliConfig;
|
|
2658
2422
|
const { tokens, trailingOperands } = lex(args);
|
|
2659
|
-
const allFlags = getGlobalFlagsForCommandTree(command,
|
|
2660
|
-
const
|
|
2423
|
+
const allFlags = getGlobalFlagsForCommandTree(command, builtIns);
|
|
2424
|
+
const allFlagParams = allFlags.flatMap((f) => extractSingleParams(f.flag));
|
|
2425
|
+
const globalRegistry = createFlagRegistry(allFlagParams.filter(isFlagParam));
|
|
2426
|
+
const { flagMap, remainder, errors: globalFlagErrors } = consumeGlobalFlags(tokens, command, globalRegistry);
|
|
2661
2427
|
const emptyArgs = {
|
|
2662
2428
|
flags: flagMap,
|
|
2663
2429
|
arguments: []
|
|
@@ -2668,11 +2434,12 @@ const runWith = (command, config) => {
|
|
|
2668
2434
|
}, command);
|
|
2669
2435
|
const commandPath = [command.name, ...getCommandPath(parsedArgs)];
|
|
2670
2436
|
const handlerCtx = {
|
|
2437
|
+
builtIns,
|
|
2671
2438
|
command,
|
|
2672
2439
|
commandPath,
|
|
2673
2440
|
version: config.version
|
|
2674
2441
|
};
|
|
2675
|
-
const activeFlags = getGlobalFlagsForCommandPath(command, commandPath,
|
|
2442
|
+
const activeFlags = getGlobalFlagsForCommandPath(command, commandPath, builtIns);
|
|
2676
2443
|
const outOfScopeErrors = getOutOfScopeGlobalFlagErrors(allFlags, activeFlags, flagMap, commandPath);
|
|
2677
2444
|
if (outOfScopeErrors.length > 0 || globalFlagErrors.length > 0) {
|
|
2678
2445
|
const parseErrors = parsedArgs.errors ?? [];
|
|
@@ -2692,6 +2459,24 @@ const runWith = (command, config) => {
|
|
|
2692
2459
|
return entries !== void 0 && entries.length > 0;
|
|
2693
2460
|
})) continue;
|
|
2694
2461
|
const [, value] = yield* flag.flag.parse(emptyArgs);
|
|
2462
|
+
if (flag === Wizard) return yield* gen(function* () {
|
|
2463
|
+
yield* log(renderIntroduction(command.name, config.version, command.description));
|
|
2464
|
+
const prefix = [command.name, ...args.filter((arg) => arg !== "--wizard" && !arg.startsWith("--wizard="))];
|
|
2465
|
+
const wizardArgs = yield* run$1(command, {
|
|
2466
|
+
commandPath,
|
|
2467
|
+
prefix
|
|
2468
|
+
});
|
|
2469
|
+
yield* log(renderCompletion(wizardArgs));
|
|
2470
|
+
if (yield* run$3(toggle({
|
|
2471
|
+
message: "Run this command?",
|
|
2472
|
+
initial: true,
|
|
2473
|
+
active: "yes",
|
|
2474
|
+
inactive: "no"
|
|
2475
|
+
}))) {
|
|
2476
|
+
yield* log();
|
|
2477
|
+
yield* runWith(command, config)(wizardArgs.slice(1));
|
|
2478
|
+
}
|
|
2479
|
+
}).pipe(catchTag("QuitError", () => log(renderQuit())));
|
|
2695
2480
|
yield* flag.run(value, handlerCtx);
|
|
2696
2481
|
return;
|
|
2697
2482
|
}
|
|
@@ -2705,13 +2490,13 @@ const runWith = (command, config) => {
|
|
|
2705
2490
|
errors: [parseResult.failure]
|
|
2706
2491
|
});
|
|
2707
2492
|
let program = commandImpl.handle(parseResult.success, [command.name]);
|
|
2493
|
+
const logLevel = activeFlags.includes(LogLevel) ? (yield* LogLevel.flag.parse(emptyArgs))[1] : none();
|
|
2494
|
+
program = provideService(program, LogLevel, logLevel);
|
|
2708
2495
|
for (const flag of activeFlags) {
|
|
2709
|
-
if (flag._tag !== "Setting") continue;
|
|
2496
|
+
if (flag._tag !== "Setting" || flag === LogLevel) continue;
|
|
2710
2497
|
const [, value] = yield* flag.flag.parse(emptyArgs);
|
|
2711
2498
|
program = provideService(program, flag, value);
|
|
2712
2499
|
}
|
|
2713
|
-
const [, logLevel] = yield* LogLevel.flag.parse(emptyArgs);
|
|
2714
|
-
program = provideService(program, LogLevel, logLevel);
|
|
2715
2500
|
const services = match(logLevel, {
|
|
2716
2501
|
onNone: () => empty$1(),
|
|
2717
2502
|
onSome: (level) => make$12(MinimumLogLevel, level)
|
|
@@ -65042,7 +64827,7 @@ var require_templates = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
65042
64827
|
const STYLE_REGEX = /(?:^|\.)(\w+)(?:\(([^)]*)\))?/g;
|
|
65043
64828
|
const STRING_REGEX = /^(['"])((?:\\.|(?!\1)[^\\])*)\1$/;
|
|
65044
64829
|
const ESCAPE_REGEX = /\\(u(?:[a-f\d]{4}|{[a-f\d]{1,6}})|x[a-f\d]{2}|.)|([^\\])/gi;
|
|
65045
|
-
const ESCAPES = new Map([
|
|
64830
|
+
const ESCAPES = /* @__PURE__ */ new Map([
|
|
65046
64831
|
["n", "\n"],
|
|
65047
64832
|
["r", "\r"],
|
|
65048
64833
|
["t", " "],
|
|
@@ -84241,7 +84026,7 @@ var require_char_regex = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
84241
84026
|
//#endregion
|
|
84242
84027
|
//#region node_modules/.pnpm/unicode-emoji-modifier-base@1.0.0/node_modules/unicode-emoji-modifier-base/index.js
|
|
84243
84028
|
var require_unicode_emoji_modifier_base = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
84244
|
-
module.exports = new Set([
|
|
84029
|
+
module.exports = /* @__PURE__ */ new Set([
|
|
84245
84030
|
9757,
|
|
84246
84031
|
9977,
|
|
84247
84032
|
9994,
|
|
@@ -84331,7 +84116,7 @@ var require_unicode_emoji_modifier_base = /* @__PURE__ */ __commonJSMin(((export
|
|
|
84331
84116
|
//#region node_modules/.pnpm/skin-tone@2.0.0/node_modules/skin-tone/index.js
|
|
84332
84117
|
var require_skin_tone = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
84333
84118
|
const emojiModifierBase = require_unicode_emoji_modifier_base();
|
|
84334
|
-
const skinTones = new Map([
|
|
84119
|
+
const skinTones = /* @__PURE__ */ new Map([
|
|
84335
84120
|
["none", ""],
|
|
84336
84121
|
["white", "🏻"],
|
|
84337
84122
|
["creamWhite", "🏼"],
|
|
@@ -84493,7 +84278,9 @@ var COLON_REPLACER = "*#COLON|*";
|
|
|
84493
84278
|
var COLON_REPLACER_REGEXP = new RegExp(escapeRegExp(COLON_REPLACER), "g");
|
|
84494
84279
|
var TAB_ALLOWED_CHARACTERS = [" "];
|
|
84495
84280
|
var ANSI_REGEXP = ansiRegex();
|
|
84496
|
-
var HARD_RETURN = "\r"
|
|
84281
|
+
var HARD_RETURN = "\r";
|
|
84282
|
+
var HARD_RETURN_RE = new RegExp(HARD_RETURN);
|
|
84283
|
+
var HARD_RETURN_GFM_RE = new RegExp(HARD_RETURN + "|<br />");
|
|
84497
84284
|
var defaultOptions = {
|
|
84498
84285
|
code: chalk.yellow,
|
|
84499
84286
|
blockquote: chalk.gray.italic,
|
|
@@ -85609,21 +85396,22 @@ function eastAsianWidth(codePoint, { ambiguousAsWide = false } = {}) {
|
|
|
85609
85396
|
return 1;
|
|
85610
85397
|
}
|
|
85611
85398
|
//#endregion
|
|
85612
|
-
//#region node_modules/.pnpm/string-width@8.2.
|
|
85399
|
+
//#region node_modules/.pnpm/string-width@8.2.2/node_modules/string-width/index.js
|
|
85613
85400
|
/**
|
|
85614
85401
|
Logic:
|
|
85615
85402
|
- Segment graphemes to match how terminals render clusters.
|
|
85616
85403
|
- Width rules:
|
|
85617
|
-
1. Skip non-printing clusters (Default_Ignorable, Control, pure Mark, lone Surrogates). Tabs are ignored by design.
|
|
85404
|
+
1. Skip non-printing clusters (Default_Ignorable, Control, pure nonspacing/enclosing Mark, lone Surrogates). Tabs are ignored by design.
|
|
85618
85405
|
2. RGI emoji clusters (\p{RGI_Emoji}) are double-width.
|
|
85619
85406
|
3. Minimally-qualified/unqualified emoji clusters (ZWJ sequences with 2+ Extended_Pictographic, or keycap sequences) are double-width.
|
|
85620
85407
|
4. Hangul jamo collapse each standard modern Hangul L+V or L+V+T syllable piece to width 2.
|
|
85621
85408
|
Unmatched repeated leading/vowel/trailing jamo stay additive because that matches how the terminals we target render them.
|
|
85622
|
-
5. Otherwise use East Asian Width of the cluster's first visible code point, and add widths for trailing Halfwidth/Fullwidth Forms within the same cluster (e.g., dakuten/handakuten/prolonged sound mark).
|
|
85409
|
+
5. Otherwise use East Asian Width of the cluster's first visible code point, and add widths for trailing spacing marks and Halfwidth/Fullwidth Forms within the same cluster (e.g., dakuten/handakuten/prolonged sound mark).
|
|
85623
85410
|
*/
|
|
85624
85411
|
const segmenter$1 = new Intl.Segmenter();
|
|
85625
|
-
const zeroWidthClusterRegex = /^(?:\p{Default_Ignorable_Code_Point}|\p{Control}|\p{Format}|\p{
|
|
85626
|
-
const leadingNonPrintingRegex = /^[\p{Default_Ignorable_Code_Point}\p{Control}\p{Format}\p{
|
|
85412
|
+
const zeroWidthClusterRegex = /^(?:\p{Default_Ignorable_Code_Point}|\p{Control}|\p{Format}|\p{Nonspacing_Mark}|\p{Enclosing_Mark}|\p{Surrogate})+$/v;
|
|
85413
|
+
const leadingNonPrintingRegex = /^[\p{Default_Ignorable_Code_Point}\p{Control}\p{Format}\p{Nonspacing_Mark}\p{Enclosing_Mark}\p{Surrogate}]+/v;
|
|
85414
|
+
const spacingMarkRegex = /\p{Spacing_Mark}/v;
|
|
85627
85415
|
const rgiEmojiRegex = /^\p{RGI_Emoji}$/v;
|
|
85628
85416
|
const unqualifiedKeycapRegex = /^[\d#*]\u20E3$/;
|
|
85629
85417
|
const extendedPictographicRegex = /\p{Extended_Pictographic}/gu;
|
|
@@ -85678,7 +85466,7 @@ function hangulClusterWidth(visibleSegment, eastAsianWidthOptions) {
|
|
|
85678
85466
|
}
|
|
85679
85467
|
return width;
|
|
85680
85468
|
}
|
|
85681
|
-
function
|
|
85469
|
+
function trailingWidth(visibleSegment, eastAsianWidthOptions) {
|
|
85682
85470
|
let extra = 0;
|
|
85683
85471
|
let first = true;
|
|
85684
85472
|
for (const character of visibleSegment) {
|
|
@@ -85686,7 +85474,7 @@ function trailingHalfwidthWidth(visibleSegment, eastAsianWidthOptions) {
|
|
|
85686
85474
|
first = false;
|
|
85687
85475
|
continue;
|
|
85688
85476
|
}
|
|
85689
|
-
if (character >= "" && character <= "") extra += eastAsianWidth(character.codePointAt(0), eastAsianWidthOptions);
|
|
85477
|
+
if (spacingMarkRegex.test(character) || character >= "" && character <= "") extra += eastAsianWidth(character.codePointAt(0), eastAsianWidthOptions);
|
|
85690
85478
|
}
|
|
85691
85479
|
return extra;
|
|
85692
85480
|
}
|
|
@@ -85713,7 +85501,7 @@ function stringWidth(input, options = {}) {
|
|
|
85713
85501
|
}
|
|
85714
85502
|
const codePoint = visibleSegment.codePointAt(0);
|
|
85715
85503
|
width += eastAsianWidth(codePoint, eastAsianWidthOptions);
|
|
85716
|
-
width +=
|
|
85504
|
+
width += trailingWidth(visibleSegment, eastAsianWidthOptions);
|
|
85717
85505
|
}
|
|
85718
85506
|
return width;
|
|
85719
85507
|
}
|
|
@@ -85885,7 +85673,7 @@ const ansiStyles = assembleStyles();
|
|
|
85885
85673
|
//#region node_modules/.pnpm/wrap-ansi@10.0.0/node_modules/wrap-ansi/index.js
|
|
85886
85674
|
const ANSI_ESCAPE = "\x1B";
|
|
85887
85675
|
const ANSI_ESCAPE_CSI = "";
|
|
85888
|
-
const ESCAPES = new Set([ANSI_ESCAPE, ANSI_ESCAPE_CSI]);
|
|
85676
|
+
const ESCAPES = /* @__PURE__ */ new Set([ANSI_ESCAPE, ANSI_ESCAPE_CSI]);
|
|
85889
85677
|
const ANSI_ESCAPE_BELL = "\x07";
|
|
85890
85678
|
const ANSI_CSI = "[";
|
|
85891
85679
|
const ANSI_OSC = "]";
|
|
@@ -86379,7 +86167,7 @@ const requireDestructiveConfirmation = fn("requireDestructiveConfirmation")(func
|
|
|
86379
86167
|
yield* fail(new DestructiveConfirmationRequiredError({ message: "destructive action requires --yes in non-interactive mode" }));
|
|
86380
86168
|
return;
|
|
86381
86169
|
}
|
|
86382
|
-
if (yield* run$
|
|
86170
|
+
if (yield* run$3(confirm({
|
|
86383
86171
|
message: input.message,
|
|
86384
86172
|
initial: false
|
|
86385
86173
|
}))) return;
|
|
@@ -86391,7 +86179,7 @@ const requireEnvironmentReplaceConfirmation = fn("requireEnvironmentReplaceConfi
|
|
|
86391
86179
|
yield* fail(new DestructiveConfirmationRequiredError({ message: `environment '${input.name}' already exists: pass --replace` }));
|
|
86392
86180
|
return;
|
|
86393
86181
|
}
|
|
86394
|
-
if (yield* run$
|
|
86182
|
+
if (yield* run$3(confirm({
|
|
86395
86183
|
message: `Environment '${input.name}' already exists. Replace?`,
|
|
86396
86184
|
initial: false
|
|
86397
86185
|
}))) return;
|
|
@@ -86532,50 +86320,16 @@ const result = (self) => {
|
|
|
86532
86320
|
};
|
|
86533
86321
|
};
|
|
86534
86322
|
//#endregion
|
|
86535
|
-
//#region node_modules/.pnpm/effect@4.0.0-beta.
|
|
86323
|
+
//#region node_modules/.pnpm/effect@4.0.0-beta.102_patch_hash=71215759e1ac0a7f65d7b75d816986687ae6c3a6cba02d928d184ca71790d488/node_modules/effect/dist/Match.js
|
|
86536
86324
|
/**
|
|
86537
|
-
*
|
|
86538
|
-
*
|
|
86539
|
-
* `Match` turns branching logic into a matcher that is built from ordered
|
|
86540
|
-
* cases and finished with an explicit finalizer. Use `Match.type` to define a
|
|
86541
|
-
* reusable matcher for a type, or `Match.value` to classify one value
|
|
86542
|
-
* immediately. Cases can match literal values, predicates, object patterns,
|
|
86543
|
-
* discriminators, tags, or negated patterns.
|
|
86325
|
+
* Builds pattern matchers for TypeScript values.
|
|
86544
86326
|
*
|
|
86545
|
-
*
|
|
86546
|
-
*
|
|
86547
|
-
*
|
|
86548
|
-
*
|
|
86549
|
-
*
|
|
86550
|
-
*
|
|
86551
|
-
* `Match.exhaustive` is only available when every remaining case has been
|
|
86552
|
-
* handled.
|
|
86553
|
-
*
|
|
86554
|
-
* **Common tasks**
|
|
86555
|
-
*
|
|
86556
|
-
* - Use `Match.type<Union>()` when a branch table should be reusable and
|
|
86557
|
-
* exhaustiveness-checked.
|
|
86558
|
-
* - Use `Match.value(value)` when a single value should be matched immediately.
|
|
86559
|
-
* - Use `Match.tag`, `Match.tags`, or `Match.discriminator` for discriminated
|
|
86560
|
-
* unions and domain objects with tag fields.
|
|
86561
|
-
* - Use `Match.orElse`, `Match.option`, or `Match.result` when unmatched input
|
|
86562
|
-
* should be handled explicitly instead of requiring full exhaustiveness.
|
|
86563
|
-
*
|
|
86564
|
-
* **Example** (Matching a tagged union)
|
|
86565
|
-
*
|
|
86566
|
-
* ```ts
|
|
86567
|
-
* import { Match } from "effect"
|
|
86568
|
-
*
|
|
86569
|
-
* type Event =
|
|
86570
|
-
* | { readonly _tag: "UserCreated"; readonly id: string }
|
|
86571
|
-
* | { readonly _tag: "UserDeleted"; readonly id: string }
|
|
86572
|
-
*
|
|
86573
|
-
* const describe = Match.type<Event>().pipe(
|
|
86574
|
-
* Match.tag("UserCreated", (event) => `created ${event.id}`),
|
|
86575
|
-
* Match.tag("UserDeleted", (event) => `deleted ${event.id}`),
|
|
86576
|
-
* Match.exhaustive
|
|
86577
|
-
* )
|
|
86578
|
-
* ```
|
|
86327
|
+
* `Match` lets you add ordered cases and then finish them with a result,
|
|
86328
|
+
* fallback, `Option`, or exhaustive check. Use `Match.type` to define a
|
|
86329
|
+
* reusable matcher for a type, or `Match.value` to match one value immediately.
|
|
86330
|
+
* Cases can match literal values, predicates, object shapes, tags, negated
|
|
86331
|
+
* patterns, and common checks such as strings, numbers, records, and class
|
|
86332
|
+
* instances.
|
|
86579
86333
|
*
|
|
86580
86334
|
* @since 4.0.0
|
|
86581
86335
|
*/
|
|
@@ -86639,7 +86393,7 @@ const value = value$1;
|
|
|
86639
86393
|
* pattern matches, the associated function is executed and the matched input is
|
|
86640
86394
|
* removed from the remaining cases tracked by the matcher.
|
|
86641
86395
|
*
|
|
86642
|
-
* **Example** (Matching with
|
|
86396
|
+
* **Example** (Matching with values and predicates)
|
|
86643
86397
|
*
|
|
86644
86398
|
* ```ts
|
|
86645
86399
|
* import { Match } from "effect"
|
|
@@ -86689,7 +86443,7 @@ const when = when$1;
|
|
|
86689
86443
|
* `"_tag"` as their discriminator field. Use {@link discriminator} for a
|
|
86690
86444
|
* different discriminator field.
|
|
86691
86445
|
*
|
|
86692
|
-
* **Example** (Matching a
|
|
86446
|
+
* **Example** (Matching a discriminated union by tag)
|
|
86693
86447
|
*
|
|
86694
86448
|
* ```ts
|
|
86695
86449
|
* import { Match } from "effect"
|
|
@@ -86735,7 +86489,7 @@ const tag = tag$1;
|
|
|
86735
86489
|
* `default` clause in a `switch` statement or the final `else` in an `if-else`
|
|
86736
86490
|
* chain.
|
|
86737
86491
|
*
|
|
86738
|
-
* **Example** (Providing a
|
|
86492
|
+
* **Example** (Providing a default value when no patterns match)
|
|
86739
86493
|
*
|
|
86740
86494
|
* ```ts
|
|
86741
86495
|
* import { Match } from "effect"
|
|
@@ -87321,10 +87075,17 @@ const pairCommand = make("pair", {
|
|
|
87321
87075
|
const t3CliEnv = yield* loadT3CliEnv;
|
|
87322
87076
|
const output = yield* T3Output;
|
|
87323
87077
|
const resolvedFormat = resolveOutputFormat(format, cliRuntime, t3CliEnv, "json");
|
|
87324
|
-
const result = yield* auth.pair(
|
|
87078
|
+
const result = yield* auth.pair({
|
|
87079
|
+
pairingUrl: url,
|
|
87080
|
+
clientMetadata: {
|
|
87081
|
+
label: "t3cli",
|
|
87082
|
+
deviceType: "bot"
|
|
87083
|
+
}
|
|
87084
|
+
});
|
|
87085
|
+
const fallbackName = yield* auth.defaultNameFromUrl(result.url);
|
|
87325
87086
|
const environmentName = yield* persistAuthEnvironment({
|
|
87326
87087
|
explicitName: name,
|
|
87327
|
-
fallbackName
|
|
87088
|
+
fallbackName,
|
|
87328
87089
|
url: result.url,
|
|
87329
87090
|
token: result.token,
|
|
87330
87091
|
local,
|
|
@@ -87360,9 +87121,10 @@ const localCommand = make("local", {
|
|
|
87360
87121
|
...isSome(baseDir) ? { baseDir: baseDir.value } : {},
|
|
87361
87122
|
...isSome(origin) ? { origin: origin.value } : {}
|
|
87362
87123
|
});
|
|
87124
|
+
const fallbackName = yield* auth.defaultNameForLocal();
|
|
87363
87125
|
const environmentName = yield* persistAuthEnvironment({
|
|
87364
87126
|
explicitName: name,
|
|
87365
|
-
fallbackName
|
|
87127
|
+
fallbackName,
|
|
87366
87128
|
url: result.url,
|
|
87367
87129
|
token: result.token,
|
|
87368
87130
|
local: true,
|
|
@@ -87628,7 +87390,7 @@ const readTerminalCommand = make("read", {
|
|
|
87628
87390
|
terminalId: string("terminal-id"),
|
|
87629
87391
|
history: boolean("history"),
|
|
87630
87392
|
follow: boolean("follow"),
|
|
87631
|
-
fromSequence: integer("from-sequence").pipe(optional$2),
|
|
87393
|
+
fromSequence: integer$1("from-sequence").pipe(optional$2),
|
|
87632
87394
|
format: choice("format", ["json", "ndjson"]).pipe(withDefault("json")),
|
|
87633
87395
|
...extraArgsConfig
|
|
87634
87396
|
}, ({ thread, terminalId, history, follow, fromSequence, format }) => gen(function* () {
|
|
@@ -87666,7 +87428,7 @@ const readTerminalCommand = make("read", {
|
|
|
87666
87428
|
const streamTerminalCommand = make("stream", {
|
|
87667
87429
|
thread: threadFlag,
|
|
87668
87430
|
terminalId: string("terminal-id"),
|
|
87669
|
-
fromSequence: integer("from-sequence").pipe(optional$2),
|
|
87431
|
+
fromSequence: integer$1("from-sequence").pipe(optional$2),
|
|
87670
87432
|
format: choice("format", ["ndjson"]).pipe(withDefault("ndjson")),
|
|
87671
87433
|
...extraArgsConfig
|
|
87672
87434
|
}, ({ thread, terminalId, fromSequence }) => gen(function* () {
|
|
@@ -88935,7 +88697,7 @@ const startThreadCommand = make("start", {
|
|
|
88935
88697
|
//#region src/cli/threads/messages.ts
|
|
88936
88698
|
const getThreadTranscriptCommand = make("transcript", {
|
|
88937
88699
|
thread: threadFlag,
|
|
88938
|
-
limit: integer("limit").pipe(withDefault(20)),
|
|
88700
|
+
limit: integer$1("limit").pipe(withDefault(20)),
|
|
88939
88701
|
full: boolean("full"),
|
|
88940
88702
|
format: formatFlag,
|
|
88941
88703
|
...extraArgsConfig
|
|
@@ -89019,7 +88781,7 @@ const T3InputLive = effect(T3Input, fn("makeT3Input")(function* () {
|
|
|
89019
88781
|
})) }));
|
|
89020
88782
|
}),
|
|
89021
88783
|
readStdinBinary: fn("T3InputLive.readStdinBinary")(function* () {
|
|
89022
|
-
return yield* stdio.stdin.pipe(runFold(() => new Uint8Array(0), (acc, chunk) => {
|
|
88784
|
+
return yield* stdio.stdin.pipe(runFold(() => /* @__PURE__ */ new Uint8Array(0), (acc, chunk) => {
|
|
89023
88785
|
const merged = new Uint8Array(acc.length + chunk.length);
|
|
89024
88786
|
merged.set(acc);
|
|
89025
88787
|
merged.set(chunk, acc.length);
|
|
@@ -89044,7 +88806,7 @@ var OutputError = class extends TaggedErrorClass()("OutputError", {
|
|
|
89044
88806
|
const T3OutputLive = effect(T3Output, fn("makeT3Output")(function* () {
|
|
89045
88807
|
const stdio = yield* Stdio;
|
|
89046
88808
|
const writeStdout = fn("T3OutputLive.writeStdout")(function* (text) {
|
|
89047
|
-
yield* succeed$5(text).pipe(run$
|
|
88809
|
+
yield* succeed$5(text).pipe(run$2(stdio.stdout()), catchTags({ PlatformError: (error) => fail(new OutputError({
|
|
89048
88810
|
message: "failed to write output",
|
|
89049
88811
|
cause: error
|
|
89050
88812
|
})) }));
|
|
@@ -89052,7 +88814,7 @@ const T3OutputLive = effect(T3Output, fn("makeT3Output")(function* () {
|
|
|
89052
88814
|
return {
|
|
89053
88815
|
writeStdout,
|
|
89054
88816
|
writeStderr: fn("T3OutputLive.writeStderr")(function* (text) {
|
|
89055
|
-
yield* succeed$5(text).pipe(run$
|
|
88817
|
+
yield* succeed$5(text).pipe(run$2(stdio.stderr()), catchTags({ PlatformError: (error) => fail(new OutputError({
|
|
89056
88818
|
message: "failed to write output",
|
|
89057
88819
|
cause: error
|
|
89058
88820
|
})) }));
|
|
@@ -89131,7 +88893,7 @@ var T3Version = class extends Service()("t3cli/T3Version") {};
|
|
|
89131
88893
|
//#endregion
|
|
89132
88894
|
//#region src/version/layer.ts
|
|
89133
88895
|
const PackageJsonSchema = fromJsonString(Struct({ version: String$1 }));
|
|
89134
|
-
const T3VersionBundledLive = sync$1(T3Version, () => ({ version: "0.
|
|
88896
|
+
const T3VersionBundledLive = sync$1(T3Version, () => ({ version: "0.14.0" }));
|
|
89135
88897
|
effect(T3Version, gen(function* () {
|
|
89136
88898
|
const packageJson = yield* (yield* FileSystem).readFileString(fileURLToPath(new URL("../../package.json", import.meta.url)));
|
|
89137
88899
|
return { version: (yield* decodeUnknownEffect(PackageJsonSchema)(packageJson)).version };
|