t3code-cli 0.11.0 → 0.13.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 +42 -10
- package/dist/application.js +2 -2
- package/dist/auth.js +1 -1
- package/dist/bin.js +85549 -2668
- package/dist/cli.js +15 -2
- package/dist/config.js +120 -2
- package/dist/connection.js +2 -2
- package/dist/index.js +1 -1
- package/dist/node.js +6 -2
- package/dist/orchestration.js +2 -2
- package/dist/rolldown-runtime.js +1 -1
- package/dist/rpc.js +1 -1
- package/dist/runtime.js +2 -2
- package/dist/shared.js +23313 -8022
- package/dist/src/application/actions.d.ts +25 -0
- package/dist/src/application/index.d.ts +3 -3
- package/dist/src/application/layer.d.ts +66 -50
- package/dist/src/application/model-selection.d.ts +2 -2
- package/dist/src/application/models.d.ts +1 -1
- package/dist/src/application/project-commands.d.ts +23 -3
- package/dist/src/application/projects.d.ts +7 -7
- package/dist/src/application/service.d.ts +65 -2
- package/dist/src/application/shell-sequence.d.ts +25 -19
- package/dist/src/application/terminals.d.ts +8 -8
- package/dist/src/application/thread-commands.d.ts +19 -19
- package/dist/src/application/thread-update.d.ts +1 -1
- package/dist/src/application/thread-wait.d.ts +19 -15
- package/dist/src/application/threads.d.ts +134 -108
- package/dist/src/auth/error.d.ts +3 -3
- package/dist/src/auth/index.d.ts +1 -1
- package/dist/src/auth/layer.d.ts +36 -8
- package/dist/src/auth/local-base-dir.d.ts +5 -2
- package/dist/src/auth/local-origin.d.ts +3 -3
- package/dist/src/auth/local-token.d.ts +3 -3
- package/dist/src/auth/remote-error.d.ts +3 -0
- package/dist/src/auth/service.d.ts +15 -3
- package/dist/src/auth/type.d.ts +40 -1
- package/dist/src/cli/env/flag.d.ts +2 -0
- package/dist/src/cli/env/index.d.ts +2 -0
- package/dist/src/cli/env/selection-layer.d.ts +3 -0
- package/dist/src/cli/flags.d.ts +2 -0
- package/dist/src/cli/format/index.d.ts +1 -0
- package/dist/src/cli/format/output.d.ts +12 -0
- package/dist/src/cli/index.d.ts +4 -0
- package/dist/src/cli/runtime/index.d.ts +1 -0
- package/dist/src/cli/runtime/service.d.ts +16 -0
- package/dist/src/{scope → cli/scope}/resolve.d.ts +5 -4
- package/dist/src/config/config.d.ts +49 -0
- package/dist/src/config/credential/cipher-node.d.ts +3 -0
- package/dist/src/config/credential/cipher-web.d.ts +3 -0
- package/dist/src/config/credential/cipher.d.ts +29 -0
- package/dist/src/config/credential/env.d.ts +3 -0
- package/dist/src/config/credential/error.d.ts +8 -0
- package/dist/src/config/credential/index.d.ts +6 -0
- package/dist/src/config/credential/service.d.ts +34 -0
- package/dist/src/config/env/env.d.ts +55 -0
- package/dist/src/config/env/index.d.ts +2 -0
- package/dist/src/{layout/base-dir.d.ts → config/env/layout.d.ts} +0 -1
- package/dist/src/config/environment-name/index.d.ts +1 -0
- package/dist/src/config/environment-name/name.d.ts +10 -0
- package/dist/src/config/error.d.ts +4 -11
- package/dist/src/config/index.d.ts +10 -5
- package/dist/src/config/keystore/error.d.ts +8 -0
- package/dist/src/config/keystore/file.d.ts +9 -0
- package/dist/src/config/keystore/index.d.ts +4 -0
- package/dist/src/config/keystore/keyring-node.d.ts +4 -0
- package/dist/src/config/keystore/service.d.ts +33 -0
- package/dist/src/config/paths/index.d.ts +1 -0
- package/dist/src/config/paths/paths.d.ts +6 -0
- package/dist/src/config/persist/file-mode.d.ts +4 -0
- package/dist/src/config/persist/migration.d.ts +68 -0
- package/dist/src/config/persist/persist.d.ts +40 -0
- package/dist/src/config/persist/schema.d.ts +68 -0
- package/dist/src/config/resolve/resolve.d.ts +40 -0
- package/dist/src/config/selection/index.d.ts +1 -0
- package/dist/src/config/selection/resolve.d.ts +4 -0
- package/dist/src/config/selection/service.d.ts +10 -0
- package/dist/src/config/types.d.ts +36 -0
- package/dist/src/config/url/error.d.ts +10 -0
- package/dist/src/config/url/index.d.ts +2 -0
- package/dist/src/connection/error.d.ts +3 -1
- package/dist/src/connection/index.d.ts +0 -1
- package/dist/src/connection/prepared.d.ts +14 -0
- package/dist/src/contracts/index.d.ts +1 -1
- package/dist/src/domain/error.d.ts +14 -1
- package/dist/src/domain/helpers.d.ts +53 -43
- package/dist/src/domain/model-config.d.ts +92 -84
- package/dist/src/domain/thread-activities.d.ts +1 -1
- package/dist/src/domain/thread-lifecycle.d.ts +24 -20
- package/dist/src/index.d.ts +1 -2
- package/dist/src/{connection/node.d.ts → node/connection.d.ts} +1 -1
- package/dist/src/node/index.d.ts +1 -2
- package/dist/src/orchestration/index.d.ts +0 -1
- package/dist/src/orchestration/layer.d.ts +321 -390
- package/dist/src/orchestration/service.d.ts +1 -1
- package/dist/src/rpc/error.d.ts +4 -6
- package/dist/src/rpc/layer.d.ts +2036 -1917
- package/dist/src/rpc/operation.d.ts +4 -5732
- package/dist/src/rpc/service.d.ts +1 -1
- package/dist/src/rpc/session.d.ts +22 -0
- package/dist/src/rpc/ws-group.d.ts +456 -1032
- package/dist/src/runtime/index.d.ts +1 -2
- package/dist/src/runtime/layer.d.ts +12 -8
- package/dist/src/sql/node-sqlite-client.d.ts +1 -1
- package/dist/src/t3tools/index.d.ts +1 -1
- package/dist/t3tools.js +2 -2
- package/package.json +30 -25
- package/src/application/actions.test.ts +328 -0
- package/src/application/actions.ts +475 -0
- package/src/application/index.ts +9 -5
- package/src/application/layer.ts +9 -0
- package/src/application/model-selection.ts +2 -2
- package/src/application/project-commands.ts +23 -5
- package/src/application/projects.ts +6 -7
- package/src/application/service.ts +79 -1
- package/src/application/shell-sequence.ts +1 -1
- package/src/application/terminals.ts +2 -1
- package/src/application/thread-commands.ts +1 -1
- package/src/application/thread-update.ts +1 -1
- package/src/application/thread-wait.ts +5 -1
- package/src/application/threads.test.ts +9 -3
- package/src/application/threads.ts +6 -6
- package/src/auth/error.ts +4 -9
- package/src/auth/index.ts +7 -0
- package/src/auth/layer.test-utils.ts +34 -0
- package/src/auth/layer.ts +116 -34
- package/src/auth/local-base-dir.ts +13 -6
- package/src/auth/local-origin.ts +10 -7
- package/src/auth/local-token.ts +28 -23
- package/src/auth/remote-error.ts +17 -0
- package/src/auth/service.test.ts +200 -0
- package/src/auth/service.ts +27 -3
- package/src/auth/transport.ts +45 -114
- package/src/auth/type.ts +47 -1
- package/src/bin.ts +24 -6
- package/src/cli/action-format.ts +110 -0
- package/src/cli/action.ts +398 -0
- package/src/cli/app.ts +6 -0
- package/src/cli/auth.ts +76 -23
- package/src/cli/env/flag.ts +8 -0
- package/src/cli/env/index.ts +2 -0
- package/src/cli/env/selection-layer.test.ts +49 -0
- package/src/cli/env/selection-layer.ts +27 -0
- package/src/cli/env.ts +107 -0
- package/src/cli/extra-args.test.ts +32 -0
- package/src/cli/extra-args.ts +22 -0
- package/src/cli/flags.ts +11 -1
- package/src/cli/format/auth.ts +92 -0
- package/src/cli/format/human.ts +131 -0
- package/src/cli/format/index.ts +12 -0
- package/src/cli/format/model.ts +29 -0
- package/src/cli/format/output.ts +51 -0
- package/src/cli/format/project.ts +32 -0
- package/src/cli/format/terminal.ts +87 -0
- package/src/cli/{thread-format.test.ts → format/thread.test.ts} +6 -4
- package/src/cli/format/thread.ts +185 -0
- package/src/cli/index.ts +20 -0
- package/src/cli/interaction/confirm.ts +64 -0
- package/src/cli/{self-action.ts → interaction/self-action.ts} +8 -6
- package/src/cli/message-input.ts +1 -1
- package/src/cli/model.ts +9 -5
- package/src/cli/project.ts +13 -7
- package/src/cli/projects/delete.ts +13 -12
- package/src/cli/require.ts +9 -7
- package/src/cli/runtime/index.ts +1 -0
- package/src/cli/runtime/service.ts +28 -0
- package/src/{scope → cli/scope}/resolve.ts +11 -9
- package/src/cli/terminal/attach.ts +3 -6
- package/src/cli/terminal/create.ts +10 -9
- package/src/cli/terminal/destroy.ts +13 -11
- package/src/cli/terminal/list.ts +10 -9
- package/src/cli/terminal/read.test-utils.ts +48 -0
- package/src/cli/terminal/read.test.ts +35 -0
- package/src/cli/terminal/read.ts +3 -6
- package/src/cli/terminal/scope.ts +10 -5
- package/src/cli/terminal/shared.ts +1 -1
- package/src/cli/terminal/stream.ts +3 -6
- package/src/cli/terminal/wait.test.ts +5 -3
- package/src/cli/terminal/wait.ts +10 -9
- package/src/cli/terminal/write.test.ts +34 -0
- package/src/cli/terminal/write.ts +10 -9
- package/src/cli/threads/approve.ts +11 -7
- package/src/cli/threads/archive.ts +14 -9
- package/src/cli/threads/callback.ts +6 -4
- package/src/cli/threads/delete.ts +17 -11
- package/src/cli/threads/interrupt.ts +14 -9
- package/src/cli/threads/list.test.ts +5 -3
- package/src/cli/threads/list.ts +10 -10
- package/src/cli/threads/messages.ts +11 -7
- package/src/cli/threads/respond.ts +11 -7
- package/src/cli/threads/send.ts +19 -9
- package/src/cli/threads/show.ts +11 -7
- package/src/cli/threads/start.ts +18 -13
- package/src/cli/threads/unarchive.ts +11 -7
- package/src/cli/threads/update.ts +14 -9
- package/src/cli/threads/wait.ts +11 -7
- package/src/cli/wait-events.ts +1 -1
- package/src/config/config.ts +260 -0
- package/src/config/credential/cipher-node.ts +40 -0
- package/src/config/credential/cipher-web.ts +82 -0
- package/src/config/credential/cipher.ts +39 -0
- package/src/config/credential/env.ts +13 -0
- package/src/config/credential/error.ts +9 -0
- package/src/config/credential/index.ts +6 -0
- package/src/config/credential/service.test-utils.ts +25 -0
- package/src/config/credential/service.test.ts +116 -0
- package/src/config/credential/service.ts +205 -0
- package/src/config/env/env.test-utils.ts +14 -0
- package/src/config/env/env.ts +81 -0
- package/src/config/env/index.ts +2 -0
- package/src/{layout/base-dir.ts → config/env/layout.ts} +0 -9
- package/src/config/environment-name/index.ts +7 -0
- package/src/config/environment-name/name.test.ts +66 -0
- package/src/config/environment-name/name.ts +49 -0
- package/src/config/error.ts +6 -8
- package/src/config/index.ts +16 -5
- package/src/config/keystore/error.ts +9 -0
- package/src/config/keystore/file.ts +96 -0
- package/src/config/keystore/index.ts +4 -0
- package/src/config/keystore/keyring-node.test.ts +12 -0
- package/src/config/keystore/keyring-node.ts +100 -0
- package/src/config/keystore/service.test-utils.ts +15 -0
- package/src/config/keystore/service.test.ts +18 -0
- package/src/config/keystore/service.ts +29 -0
- package/src/config/layer.test-utils.ts +45 -0
- package/src/config/layer.test.ts +209 -0
- package/src/config/paths/index.ts +1 -0
- package/src/config/paths/paths.ts +36 -0
- package/src/config/persist/file-mode.ts +21 -0
- package/src/config/persist/migration.test.ts +71 -0
- package/src/config/persist/migration.ts +82 -0
- package/src/config/persist/persist.test.ts +113 -0
- package/src/config/persist/persist.ts +65 -0
- package/src/config/persist/schema.ts +37 -0
- package/src/config/platform.test-utils.ts +20 -0
- package/src/config/resolve/resolve.test-utils.ts +20 -0
- package/src/config/resolve/resolve.test.ts +137 -0
- package/src/config/resolve/resolve.ts +104 -0
- package/src/config/selection/index.ts +1 -0
- package/src/config/selection/resolve.ts +14 -0
- package/src/config/selection/service.ts +29 -0
- package/src/config/temp-home.test-utils.ts +7 -0
- package/src/config/types.ts +49 -0
- package/src/config/url/error.ts +8 -0
- package/src/config/url/index.ts +7 -0
- package/src/config/url/url.test.ts +31 -0
- package/src/connection/error.ts +4 -1
- package/src/connection/index.ts +0 -1
- package/src/connection/layer.ts +5 -2
- package/src/connection/prepared.ts +83 -0
- package/src/contracts/index.ts +1 -1
- package/src/domain/error.ts +20 -1
- package/src/domain/helpers.test.ts +1 -1
- package/src/domain/helpers.ts +1 -1
- package/src/domain/model-config.ts +1 -1
- package/src/domain/thread-activities.test.ts +1 -1
- package/src/domain/thread-activities.ts +1 -1
- package/src/domain/thread-lifecycle.test.ts +1 -1
- package/src/domain/thread-lifecycle.ts +1 -1
- package/src/effect.test-utils.ts +25 -0
- package/src/index.ts +1 -1
- package/src/{connection/node.ts → node/connection.ts} +1 -1
- package/src/node/index.ts +1 -2
- package/src/orchestration/index.ts +0 -1
- package/src/orchestration/layer.ts +3 -2
- package/src/orchestration/service.ts +1 -1
- package/src/rpc/error.ts +10 -17
- package/src/rpc/layer.ts +17 -51
- package/src/rpc/operation.ts +16 -2
- package/src/rpc/service.ts +2 -1
- package/src/rpc/session.ts +168 -0
- package/src/rpc/ws-group.ts +13 -27
- package/src/runtime/index.ts +2 -1
- package/src/runtime/layer.test-utils.ts +32 -0
- package/src/runtime/layer.test.ts +66 -0
- package/src/runtime/layer.ts +21 -12
- package/src/t3tools/index.ts +1 -1
- package/src/types/marked-terminal.d.ts +11 -0
- package/dist/layout.js +0 -2
- package/dist/scope.js +0 -2
- package/dist/src/cli/output-format.d.ts +0 -11
- package/dist/src/config/layer.d.ts +0 -22
- package/dist/src/config/service.d.ts +0 -22
- package/dist/src/environment/layer.d.ts +0 -3
- package/dist/src/environment/service.d.ts +0 -12
- package/dist/src/layout/index.d.ts +0 -1
- package/dist/upstream-t3code/packages/contracts/src/auth.d.ts +0 -441
- package/dist/upstream-t3code/packages/contracts/src/baseSchemas.d.ts +0 -38
- package/dist/upstream-t3code/packages/contracts/src/desktopBootstrap.d.ts +0 -14
- package/dist/upstream-t3code/packages/contracts/src/editor.d.ts +0 -124
- package/dist/upstream-t3code/packages/contracts/src/environment.d.ts +0 -64
- package/dist/upstream-t3code/packages/contracts/src/environmentHttp.d.ts +0 -762
- package/dist/upstream-t3code/packages/contracts/src/filesystem.d.ts +0 -26
- package/dist/upstream-t3code/packages/contracts/src/git.d.ts +0 -500
- package/dist/upstream-t3code/packages/contracts/src/index.d.ts +0 -25
- package/dist/upstream-t3code/packages/contracts/src/ipc.d.ts +0 -490
- package/dist/upstream-t3code/packages/contracts/src/keybindings.d.ts +0 -133
- package/dist/upstream-t3code/packages/contracts/src/model.d.ts +0 -112
- package/dist/upstream-t3code/packages/contracts/src/orchestration.d.ts +0 -6682
- package/dist/upstream-t3code/packages/contracts/src/project.d.ts +0 -45
- package/dist/upstream-t3code/packages/contracts/src/provider.d.ts +0 -116
- package/dist/upstream-t3code/packages/contracts/src/providerInstance.d.ts +0 -99
- package/dist/upstream-t3code/packages/contracts/src/providerRuntime.d.ts +0 -4276
- package/dist/upstream-t3code/packages/contracts/src/relay.d.ts +0 -1262
- package/dist/upstream-t3code/packages/contracts/src/relayClient.d.ts +0 -48
- package/dist/upstream-t3code/packages/contracts/src/remoteAccess.d.ts +0 -45
- package/dist/upstream-t3code/packages/contracts/src/review.d.ts +0 -37
- package/dist/upstream-t3code/packages/contracts/src/rpc.d.ts +0 -8218
- package/dist/upstream-t3code/packages/contracts/src/server.d.ts +0 -2291
- package/dist/upstream-t3code/packages/contracts/src/settings.d.ts +0 -271
- package/dist/upstream-t3code/packages/contracts/src/sourceControl.d.ts +0 -177
- package/dist/upstream-t3code/packages/contracts/src/terminal.d.ts +0 -330
- package/dist/upstream-t3code/packages/contracts/src/vcs.d.ts +0 -148
- package/src/cli/auth-format.ts +0 -45
- package/src/cli/confirm.ts +0 -31
- package/src/cli/model-format.ts +0 -18
- package/src/cli/output-format.ts +0 -45
- package/src/cli/project-format.ts +0 -18
- package/src/cli/terminal/commands.test.ts +0 -101
- package/src/cli/terminal-format.ts +0 -167
- package/src/cli/thread-format.ts +0 -128
- package/src/config/layer.ts +0 -105
- package/src/config/service.ts +0 -26
- package/src/environment/layer.ts +0 -12
- package/src/environment/service.ts +0 -13
- package/src/layout/index.ts +0 -1
- /package/dist/src/{scope → cli/scope}/index.d.ts +0 -0
- /package/dist/src/config/{url.d.ts → url/url.d.ts} +0 -0
- /package/src/{scope → cli/scope}/index.ts +0 -0
- /package/src/config/{url.ts → url/url.ts} +0 -0
|
@@ -0,0 +1,168 @@
|
|
|
1
|
+
import {
|
|
2
|
+
ConnectionBlockedError,
|
|
3
|
+
type ConnectionAttemptError,
|
|
4
|
+
ConnectionTransientError,
|
|
5
|
+
type PreparedConnection,
|
|
6
|
+
} from "@t3tools/client-runtime/connection";
|
|
7
|
+
import { WS_METHODS } from "@t3tools/contracts";
|
|
8
|
+
import * as Context from "effect/Context";
|
|
9
|
+
import * as Deferred from "effect/Deferred";
|
|
10
|
+
import * as Effect from "effect/Effect";
|
|
11
|
+
import * as Layer from "effect/Layer";
|
|
12
|
+
import * as Schedule from "effect/Schedule";
|
|
13
|
+
import type * as Scope from "effect/Scope";
|
|
14
|
+
import * as RpcClient from "effect/unstable/rpc/RpcClient";
|
|
15
|
+
import * as RpcSerialization from "effect/unstable/rpc/RpcSerialization";
|
|
16
|
+
import * as Socket from "effect/unstable/socket/Socket";
|
|
17
|
+
|
|
18
|
+
import type { WsClient as CliWsClient } from "./service.ts";
|
|
19
|
+
import type { CliServerConfig } from "./ws-group.ts";
|
|
20
|
+
import { CliWsRpcGroup } from "./ws-group.ts";
|
|
21
|
+
|
|
22
|
+
interface T3RpcSession {
|
|
23
|
+
readonly client: CliWsClient;
|
|
24
|
+
readonly initialConfig: Effect.Effect<CliServerConfig, ConnectionAttemptError>;
|
|
25
|
+
readonly ready: Effect.Effect<void, ConnectionAttemptError>;
|
|
26
|
+
readonly probe: Effect.Effect<void, ConnectionAttemptError>;
|
|
27
|
+
readonly closed: Effect.Effect<never, ConnectionTransientError>;
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
export class T3RpcSessionFactory extends Context.Service<
|
|
31
|
+
T3RpcSessionFactory,
|
|
32
|
+
{
|
|
33
|
+
readonly connect: (
|
|
34
|
+
connection: PreparedConnection,
|
|
35
|
+
) => Effect.Effect<T3RpcSession, ConnectionAttemptError, Scope.Scope>;
|
|
36
|
+
}
|
|
37
|
+
>()("t3cli/T3RpcSessionFactory") {}
|
|
38
|
+
|
|
39
|
+
type SessionRpcError =
|
|
40
|
+
| Effect.Error<ReturnType<CliWsClient[typeof WS_METHODS.serverGetConfig]>>
|
|
41
|
+
| Effect.Error<ReturnType<CliWsClient[typeof WS_METHODS.serverProbe]>>;
|
|
42
|
+
|
|
43
|
+
const makeClient = RpcClient.make(CliWsRpcGroup);
|
|
44
|
+
|
|
45
|
+
const makeT3RpcSessionFactory = Effect.fn("makeT3RpcSessionFactory")(function* () {
|
|
46
|
+
const webSocketConstructor = yield* Socket.WebSocketConstructor;
|
|
47
|
+
|
|
48
|
+
const connect: T3RpcSessionFactory["Service"]["connect"] = Effect.fnUntraced(function* (
|
|
49
|
+
connection: PreparedConnection,
|
|
50
|
+
) {
|
|
51
|
+
yield* Effect.annotateCurrentSpan({
|
|
52
|
+
"connection.environment.id": connection.environmentId,
|
|
53
|
+
});
|
|
54
|
+
|
|
55
|
+
const connected = yield* Deferred.make<void>();
|
|
56
|
+
const disconnected = yield* Deferred.make<never, ConnectionTransientError>();
|
|
57
|
+
const hooks = RpcClient.ConnectionHooks.of({
|
|
58
|
+
onConnect: Deferred.succeed(connected, undefined).pipe(Effect.asVoid),
|
|
59
|
+
onDisconnect: Deferred.isDone(connected).pipe(
|
|
60
|
+
Effect.flatMap((wasConnected) =>
|
|
61
|
+
Deferred.fail(
|
|
62
|
+
disconnected,
|
|
63
|
+
new ConnectionTransientError({
|
|
64
|
+
reason: "transport",
|
|
65
|
+
detail: wasConnected
|
|
66
|
+
? `${connection.label} disconnected.`
|
|
67
|
+
: `${connection.label} could not establish a WebSocket connection.`,
|
|
68
|
+
}),
|
|
69
|
+
),
|
|
70
|
+
),
|
|
71
|
+
Effect.asVoid,
|
|
72
|
+
),
|
|
73
|
+
});
|
|
74
|
+
const socketLayer = Socket.layerWebSocket(connection.socketUrl, {
|
|
75
|
+
openTimeout: "15 seconds",
|
|
76
|
+
}).pipe(Layer.provide(Layer.succeed(Socket.WebSocketConstructor, webSocketConstructor)));
|
|
77
|
+
const protocolLayer = Layer.effect(
|
|
78
|
+
RpcClient.Protocol,
|
|
79
|
+
RpcClient.makeProtocolSocket({
|
|
80
|
+
retryTransientErrors: false,
|
|
81
|
+
retryPolicy: Schedule.recurs(0),
|
|
82
|
+
}),
|
|
83
|
+
).pipe(
|
|
84
|
+
Layer.provide(
|
|
85
|
+
Layer.mergeAll(
|
|
86
|
+
socketLayer,
|
|
87
|
+
RpcSerialization.layerJson,
|
|
88
|
+
Layer.succeed(RpcClient.ConnectionHooks, hooks),
|
|
89
|
+
),
|
|
90
|
+
),
|
|
91
|
+
);
|
|
92
|
+
const protocolContext = yield* Layer.build(protocolLayer).pipe(
|
|
93
|
+
Effect.withSpan("environment.websocket.connect"),
|
|
94
|
+
);
|
|
95
|
+
const client = yield* makeClient.pipe(Effect.provide(protocolContext));
|
|
96
|
+
const initialConfig = yield* Effect.cached(
|
|
97
|
+
client[WS_METHODS.serverGetConfig]({}).pipe(
|
|
98
|
+
catchSessionRpcErrors,
|
|
99
|
+
Effect.withSpan("environment.initialSync"),
|
|
100
|
+
),
|
|
101
|
+
);
|
|
102
|
+
const probe = initialConfig.pipe(
|
|
103
|
+
Effect.flatMap((config) =>
|
|
104
|
+
Effect.gen(function* () {
|
|
105
|
+
if (config.environment.capabilities.connectionProbe) {
|
|
106
|
+
return yield* client[WS_METHODS.serverProbe]({});
|
|
107
|
+
}
|
|
108
|
+
return yield* client[WS_METHODS.serverGetConfig]({});
|
|
109
|
+
}).pipe(catchSessionRpcErrors),
|
|
110
|
+
),
|
|
111
|
+
Effect.asVoid,
|
|
112
|
+
Effect.withSpan("clientRuntime.connection.rpcSession.probe"),
|
|
113
|
+
);
|
|
114
|
+
|
|
115
|
+
return {
|
|
116
|
+
client,
|
|
117
|
+
initialConfig,
|
|
118
|
+
ready: Deferred.await(connected).pipe(
|
|
119
|
+
Effect.andThen(initialConfig),
|
|
120
|
+
Effect.asVoid,
|
|
121
|
+
Effect.raceFirst(Deferred.await(disconnected)),
|
|
122
|
+
),
|
|
123
|
+
probe,
|
|
124
|
+
closed: Deferred.await(disconnected),
|
|
125
|
+
} satisfies T3RpcSession;
|
|
126
|
+
});
|
|
127
|
+
|
|
128
|
+
return T3RpcSessionFactory.of({ connect });
|
|
129
|
+
});
|
|
130
|
+
|
|
131
|
+
export const T3RpcSessionFactoryLive = Layer.effect(T3RpcSessionFactory, makeT3RpcSessionFactory());
|
|
132
|
+
|
|
133
|
+
function catchSessionRpcErrors<A, R>(
|
|
134
|
+
effect: Effect.Effect<A, SessionRpcError, R>,
|
|
135
|
+
): Effect.Effect<A, ConnectionAttemptError, R> {
|
|
136
|
+
return effect.pipe(
|
|
137
|
+
Effect.catchTags({
|
|
138
|
+
EnvironmentAuthorizationError: (error) =>
|
|
139
|
+
Effect.fail(
|
|
140
|
+
new ConnectionBlockedError({
|
|
141
|
+
reason: "permission",
|
|
142
|
+
detail: error.message,
|
|
143
|
+
}),
|
|
144
|
+
),
|
|
145
|
+
KeybindingsConfigParseError: (error) =>
|
|
146
|
+
Effect.fail(
|
|
147
|
+
new ConnectionTransientError({
|
|
148
|
+
reason: "remote-unavailable",
|
|
149
|
+
detail: error.message,
|
|
150
|
+
}),
|
|
151
|
+
),
|
|
152
|
+
ServerSettingsError: (error) =>
|
|
153
|
+
Effect.fail(
|
|
154
|
+
new ConnectionTransientError({
|
|
155
|
+
reason: "remote-unavailable",
|
|
156
|
+
detail: error.message,
|
|
157
|
+
}),
|
|
158
|
+
),
|
|
159
|
+
RpcClientError: (error) =>
|
|
160
|
+
Effect.fail(
|
|
161
|
+
new ConnectionTransientError({
|
|
162
|
+
reason: "transport",
|
|
163
|
+
detail: error.message,
|
|
164
|
+
}),
|
|
165
|
+
),
|
|
166
|
+
}),
|
|
167
|
+
);
|
|
168
|
+
}
|
package/src/rpc/ws-group.ts
CHANGED
|
@@ -1,16 +1,14 @@
|
|
|
1
1
|
import {
|
|
2
2
|
EnvironmentAuthorizationError,
|
|
3
3
|
KeybindingsConfigError,
|
|
4
|
-
OrchestrationDispatchCommandError,
|
|
5
|
-
OrchestrationGetSnapshotError,
|
|
6
|
-
ServerConfig,
|
|
7
4
|
ServerProviders,
|
|
8
5
|
ServerSettingsError,
|
|
9
|
-
TerminalCwdError,
|
|
10
|
-
TerminalHistoryError,
|
|
11
|
-
TerminalNotRunningError,
|
|
12
|
-
TerminalSessionLookupError,
|
|
13
6
|
WS_METHODS,
|
|
7
|
+
WsOrchestrationDispatchCommandRpc,
|
|
8
|
+
WsOrchestrationGetArchivedShellSnapshotRpc,
|
|
9
|
+
WsOrchestrationSubscribeShellRpc,
|
|
10
|
+
WsOrchestrationSubscribeThreadRpc,
|
|
11
|
+
WsServerProbeRpc,
|
|
14
12
|
WsSubscribeTerminalEventsRpc,
|
|
15
13
|
WsSubscribeTerminalMetadataRpc,
|
|
16
14
|
WsTerminalAttachRpc,
|
|
@@ -18,20 +16,18 @@ import {
|
|
|
18
16
|
WsTerminalOpenRpc,
|
|
19
17
|
WsTerminalResizeRpc,
|
|
20
18
|
WsTerminalWriteRpc,
|
|
21
|
-
|
|
22
|
-
WsOrchestrationGetArchivedShellSnapshotRpc,
|
|
23
|
-
WsOrchestrationSubscribeShellRpc,
|
|
24
|
-
WsOrchestrationSubscribeThreadRpc,
|
|
25
|
-
} from "#t3tools/contracts";
|
|
19
|
+
} from "@t3tools/contracts";
|
|
26
20
|
import * as Schema from "effect/Schema";
|
|
27
21
|
import { Rpc, RpcGroup } from "effect/unstable/rpc";
|
|
28
22
|
|
|
29
|
-
export const
|
|
23
|
+
export const CliServerConfig = Schema.Struct({
|
|
24
|
+
environment: Schema.Struct({
|
|
25
|
+
capabilities: Schema.Struct({
|
|
26
|
+
connectionProbe: Schema.Boolean,
|
|
27
|
+
}),
|
|
28
|
+
}),
|
|
30
29
|
providers: ServerProviders,
|
|
31
30
|
});
|
|
32
|
-
export type FallbackServerConfig = typeof FallbackServerConfig.Type;
|
|
33
|
-
|
|
34
|
-
export const CliServerConfig = Schema.Union([ServerConfig, FallbackServerConfig]);
|
|
35
31
|
export type CliServerConfig = typeof CliServerConfig.Type;
|
|
36
32
|
|
|
37
33
|
export const WsServerGetConfigRpc = Rpc.make(WS_METHODS.serverGetConfig, {
|
|
@@ -52,16 +48,6 @@ export const CliWsRpcGroup = RpcGroup.make(
|
|
|
52
48
|
WsOrchestrationGetArchivedShellSnapshotRpc,
|
|
53
49
|
WsOrchestrationSubscribeShellRpc,
|
|
54
50
|
WsOrchestrationSubscribeThreadRpc,
|
|
51
|
+
WsServerProbeRpc,
|
|
55
52
|
WsServerGetConfigRpc,
|
|
56
53
|
);
|
|
57
|
-
|
|
58
|
-
export type CliRpcRequestError =
|
|
59
|
-
| EnvironmentAuthorizationError
|
|
60
|
-
| KeybindingsConfigError
|
|
61
|
-
| OrchestrationDispatchCommandError
|
|
62
|
-
| OrchestrationGetSnapshotError
|
|
63
|
-
| TerminalCwdError
|
|
64
|
-
| TerminalHistoryError
|
|
65
|
-
| TerminalNotRunningError
|
|
66
|
-
| TerminalSessionLookupError
|
|
67
|
-
| ServerSettingsError;
|
package/src/runtime/index.ts
CHANGED
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
export {
|
|
2
2
|
AppLayer,
|
|
3
3
|
AuthAppLayer,
|
|
4
|
+
BaseAppLayer,
|
|
5
|
+
BaseAuthAppLayer,
|
|
4
6
|
T3AuthLayer,
|
|
5
7
|
T3AuthPairingLayer,
|
|
6
8
|
T3AuthTransportLayer,
|
|
@@ -9,4 +11,3 @@ export {
|
|
|
9
11
|
T3LocalAuthTokenLayer,
|
|
10
12
|
T3OrchestrationLayer,
|
|
11
13
|
} from "./layer.ts";
|
|
12
|
-
export { NodeEnvironmentLive } from "../environment/layer.ts";
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import * as Layer from "effect/Layer";
|
|
2
|
+
|
|
3
|
+
import * as CliSelection from "../cli/env/selection-layer.ts";
|
|
4
|
+
import * as CliRuntime from "../cli/runtime/service.ts";
|
|
5
|
+
import * as Config from "../config/config.ts";
|
|
6
|
+
import * as Credential from "../config/credential/service.ts";
|
|
7
|
+
import * as CredentialCipherNode from "../config/credential/cipher-node.ts";
|
|
8
|
+
import { ConfigPlatformLayer } from "../config/platform.test-utils.ts";
|
|
9
|
+
import { t3CliEnvConfigLayer } from "../config/env/env.test-utils.ts";
|
|
10
|
+
import * as Keystore from "../config/keystore/service.test-utils.ts";
|
|
11
|
+
|
|
12
|
+
export function cliConfigRoutingLayerTest(homeDir: string) {
|
|
13
|
+
const cliRuntimeLayer = CliRuntime.CliRuntime.layerTest({ cwd: homeDir });
|
|
14
|
+
const configLayer = t3CliEnvConfigLayer(homeDir, { T3CLI_ENV: "home" });
|
|
15
|
+
const platformEnvLayer = Layer.mergeAll(cliRuntimeLayer, configLayer);
|
|
16
|
+
|
|
17
|
+
return Layer.mergeAll(
|
|
18
|
+
ConfigPlatformLayer,
|
|
19
|
+
platformEnvLayer,
|
|
20
|
+
Config.layer.pipe(
|
|
21
|
+
Layer.provide(Credential.layer),
|
|
22
|
+
Layer.provide(
|
|
23
|
+
Layer.mergeAll(
|
|
24
|
+
platformEnvLayer,
|
|
25
|
+
CliSelection.layer.pipe(Layer.provide(platformEnvLayer)),
|
|
26
|
+
CredentialCipherNode.layerNode,
|
|
27
|
+
Keystore.unavailableKeystoreFactoryLayer,
|
|
28
|
+
),
|
|
29
|
+
),
|
|
30
|
+
),
|
|
31
|
+
);
|
|
32
|
+
}
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
import "vite-plus/test/config";
|
|
2
|
+
|
|
3
|
+
import * as Effect from "effect/Effect";
|
|
4
|
+
import * as Ref from "effect/Ref";
|
|
5
|
+
import * as NodeServices from "@effect/platform-node/NodeServices";
|
|
6
|
+
import { assert, describe, it } from "@effect/vitest";
|
|
7
|
+
import { Command } from "effect/unstable/cli";
|
|
8
|
+
|
|
9
|
+
import { cliEnvironmentSetting } from "../cli/env/flag.ts";
|
|
10
|
+
import type { ResolvedConfig } from "../config/types.ts";
|
|
11
|
+
import { T3Config } from "../config/config.ts";
|
|
12
|
+
import { makeTempHomeScoped } from "../config/temp-home.test-utils.ts";
|
|
13
|
+
import { cliConfigRoutingLayerTest } from "./layer.test-utils.ts";
|
|
14
|
+
|
|
15
|
+
describe("CLI config routing", () => {
|
|
16
|
+
it.effect(
|
|
17
|
+
"routes --environment through Command.run to T3Config.resolve ahead of default and T3CLI_ENV",
|
|
18
|
+
() =>
|
|
19
|
+
Effect.gen(function* () {
|
|
20
|
+
return yield* makeTempHomeScoped("t3cli-runtime-");
|
|
21
|
+
}).pipe(
|
|
22
|
+
Effect.flatMap((homeDir) => {
|
|
23
|
+
const testLayer = cliConfigRoutingLayerTest(homeDir);
|
|
24
|
+
return Effect.gen(function* () {
|
|
25
|
+
const resolvedRef = yield* Ref.make<ResolvedConfig | undefined>(undefined);
|
|
26
|
+
const resolveProbeCommand = Command.make("resolve-probe", {}, () =>
|
|
27
|
+
Effect.gen(function* () {
|
|
28
|
+
const config = yield* T3Config;
|
|
29
|
+
const resolved = yield* config.resolve();
|
|
30
|
+
yield* Ref.set(resolvedRef, resolved);
|
|
31
|
+
}),
|
|
32
|
+
).pipe(Command.withGlobalFlags([cliEnvironmentSetting]));
|
|
33
|
+
const runResolveProbe = Command.runWith(resolveProbeCommand, { version: "0.0.0-test" });
|
|
34
|
+
|
|
35
|
+
yield* Effect.gen(function* () {
|
|
36
|
+
const config = yield* T3Config;
|
|
37
|
+
yield* config.upsertEnvironment({
|
|
38
|
+
name: "home",
|
|
39
|
+
url: "https://home.example",
|
|
40
|
+
token: "home-token",
|
|
41
|
+
local: false,
|
|
42
|
+
});
|
|
43
|
+
yield* config.upsertEnvironment({
|
|
44
|
+
name: "work",
|
|
45
|
+
url: "https://work.example",
|
|
46
|
+
token: "work-token",
|
|
47
|
+
local: false,
|
|
48
|
+
});
|
|
49
|
+
}).pipe(Effect.provide(testLayer));
|
|
50
|
+
|
|
51
|
+
yield* runResolveProbe(["--environment", "work"]).pipe(Effect.provide(testLayer));
|
|
52
|
+
|
|
53
|
+
const resolved = yield* Ref.get(resolvedRef);
|
|
54
|
+
assert.isDefined(resolved);
|
|
55
|
+
assert.equal(resolved.source, "config");
|
|
56
|
+
if (resolved.source === "config") {
|
|
57
|
+
assert.equal(resolved.environment, "work");
|
|
58
|
+
assert.equal(resolved.token, "work-token");
|
|
59
|
+
}
|
|
60
|
+
});
|
|
61
|
+
}),
|
|
62
|
+
Effect.provide(NodeServices.layer),
|
|
63
|
+
Effect.scoped,
|
|
64
|
+
),
|
|
65
|
+
);
|
|
66
|
+
});
|
package/src/runtime/layer.ts
CHANGED
|
@@ -10,16 +10,20 @@ import { T3LocalAuthOriginLive } from "../auth/local-origin.ts";
|
|
|
10
10
|
import { T3LocalAuthTokenLive } from "../auth/local-token.ts";
|
|
11
11
|
import { T3AuthPairingLive } from "../auth/pairing.ts";
|
|
12
12
|
import { T3AuthTransportLive } from "../auth/transport.ts";
|
|
13
|
-
import
|
|
14
|
-
import
|
|
13
|
+
import * as Config from "../config/config.ts";
|
|
14
|
+
import * as Credential from "../config/credential/service.ts";
|
|
15
|
+
import * as Selection from "../config/selection/service.ts";
|
|
15
16
|
import { T3CodeConnectionError } from "../connection/error.ts";
|
|
17
|
+
import { T3PreparedConnectionProviderLive } from "../connection/prepared.ts";
|
|
16
18
|
import { T3CodeConnectionProvider, makeT3CodeConnectionProvider } from "../connection/service.ts";
|
|
17
19
|
import { T3OrchestrationLive } from "../orchestration/layer.ts";
|
|
18
20
|
import { T3RpcLive } from "../rpc/layer.ts";
|
|
19
21
|
import { T3RpcOperationsLive } from "../rpc/operation.ts";
|
|
22
|
+
import { T3RpcSessionFactoryLive } from "../rpc/session.ts";
|
|
20
23
|
import { NodeSqlClientFactoryLive } from "../sql/node-sqlite-client.ts";
|
|
21
24
|
import { NodeCliPathLayer } from "../cli-path/layer.ts";
|
|
22
25
|
|
|
26
|
+
export const T3ConfigLayer = Config.layer.pipe(Layer.provide(Credential.layer));
|
|
23
27
|
export const T3AuthTransportLayer = T3AuthTransportLive.pipe(
|
|
24
28
|
Layer.provide(NodeHttpClient.layerUndici),
|
|
25
29
|
);
|
|
@@ -33,13 +37,13 @@ export const T3LocalAuthLayer = T3LocalAuthLive.pipe(
|
|
|
33
37
|
export const T3AuthPairingLayer = T3AuthPairingLive.pipe(Layer.provide(T3AuthTransportLayer));
|
|
34
38
|
export const T3AuthLayer = T3AuthLive.pipe(
|
|
35
39
|
Layer.provide(
|
|
36
|
-
Layer.mergeAll(
|
|
40
|
+
Layer.mergeAll(T3ConfigLayer, T3AuthTransportLayer, T3LocalAuthLayer, T3AuthPairingLayer),
|
|
37
41
|
),
|
|
38
42
|
);
|
|
39
43
|
const T3ConfigConnectionProviderLayer = Layer.effect(
|
|
40
44
|
T3CodeConnectionProvider,
|
|
41
45
|
Effect.gen(function* () {
|
|
42
|
-
const config = yield* T3Config;
|
|
46
|
+
const config = yield* Config.T3Config;
|
|
43
47
|
return makeT3CodeConnectionProvider(
|
|
44
48
|
config.resolve().pipe(
|
|
45
49
|
Effect.map((resolved) => ({
|
|
@@ -56,14 +60,15 @@ const T3ConfigConnectionProviderLayer = Layer.effect(
|
|
|
56
60
|
),
|
|
57
61
|
);
|
|
58
62
|
}),
|
|
59
|
-
).pipe(Layer.provide(
|
|
63
|
+
).pipe(Layer.provide(T3ConfigLayer));
|
|
60
64
|
|
|
61
65
|
const T3RpcLayer = T3RpcLive.pipe(
|
|
62
66
|
Layer.provide(
|
|
63
67
|
Layer.mergeAll(
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
68
|
+
T3PreparedConnectionProviderLive.pipe(
|
|
69
|
+
Layer.provide(Layer.mergeAll(T3ConfigConnectionProviderLayer, NodeHttpClient.layerUndici)),
|
|
70
|
+
),
|
|
71
|
+
T3RpcSessionFactoryLive.pipe(Layer.provide(NodeSocket.layerWebSocketConstructor)),
|
|
67
72
|
),
|
|
68
73
|
),
|
|
69
74
|
);
|
|
@@ -73,10 +78,8 @@ const T3ApplicationLayer = T3ApplicationLive.pipe(
|
|
|
73
78
|
Layer.provide(Layer.mergeAll(T3RpcOperationsLayer, T3OrchestrationLayer)),
|
|
74
79
|
);
|
|
75
80
|
|
|
76
|
-
export const
|
|
77
|
-
|
|
78
|
-
export const AppLayer = Layer.mergeAll(
|
|
79
|
-
T3ConfigLive,
|
|
81
|
+
export const BaseAppLayer = Layer.mergeAll(
|
|
82
|
+
T3ConfigLayer,
|
|
80
83
|
T3AuthLayer,
|
|
81
84
|
T3RpcLayer,
|
|
82
85
|
T3RpcOperationsLayer,
|
|
@@ -84,3 +87,9 @@ export const AppLayer = Layer.mergeAll(
|
|
|
84
87
|
T3ApplicationLayer,
|
|
85
88
|
NodeCliPathLayer,
|
|
86
89
|
);
|
|
90
|
+
|
|
91
|
+
export const BaseAuthAppLayer = Layer.mergeAll(T3ConfigLayer, T3AuthLayer);
|
|
92
|
+
|
|
93
|
+
export const AuthAppLayer = BaseAuthAppLayer.pipe(Layer.provideMerge(Selection.layer));
|
|
94
|
+
|
|
95
|
+
export const AppLayer = BaseAppLayer.pipe(Layer.provideMerge(Selection.layer));
|
package/src/t3tools/index.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export * from "
|
|
1
|
+
export * from "@t3tools/contracts";
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
declare module "marked-terminal" {
|
|
2
|
+
import type { MarkedExtension } from "marked";
|
|
3
|
+
|
|
4
|
+
export type TerminalRendererOptions = {
|
|
5
|
+
readonly reflowText?: boolean;
|
|
6
|
+
readonly showSectionPrefix?: boolean;
|
|
7
|
+
readonly width?: number;
|
|
8
|
+
};
|
|
9
|
+
|
|
10
|
+
export function markedTerminal(options?: TerminalRendererOptions): MarkedExtension;
|
|
11
|
+
}
|
package/dist/layout.js
DELETED
package/dist/scope.js
DELETED
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import type { EnvironmentShape } from "../environment/service.ts";
|
|
2
|
-
export declare const humanJsonFormatChoices: readonly ["auto", "human", "json"];
|
|
3
|
-
export declare const humanNdjsonFormatChoices: readonly ["auto", "human", "ndjson"];
|
|
4
|
-
export declare const humanJsonNdjsonFormatChoices: readonly ["auto", "human", "json", "ndjson"];
|
|
5
|
-
export type HumanJsonFormat = (typeof humanJsonFormatChoices)[number];
|
|
6
|
-
export type HumanNdjsonFormat = (typeof humanNdjsonFormatChoices)[number];
|
|
7
|
-
export type HumanJsonNdjsonFormat = (typeof humanJsonNdjsonFormatChoices)[number];
|
|
8
|
-
export declare function resolveOutputFormat<T extends "json" | "ndjson">(format: "auto" | "human" | T, environment: EnvironmentShape, nonHumanFormat: T): "human" | T;
|
|
9
|
-
export declare function canRenderLiveTerminal(environment: EnvironmentShape): boolean;
|
|
10
|
-
export declare function isInteractiveHumanTerminal(environment: EnvironmentShape): boolean;
|
|
11
|
-
export declare function isAgentEnvironment(environment: EnvironmentShape): boolean;
|
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
import * as Effect from "effect/Effect";
|
|
2
|
-
import * as FileSystem from "effect/FileSystem";
|
|
3
|
-
import * as Layer from "effect/Layer";
|
|
4
|
-
import * as Path from "effect/Path";
|
|
5
|
-
import { Environment } from "../environment/service.ts";
|
|
6
|
-
import { ConfigError } from "./error.ts";
|
|
7
|
-
import { T3Config, type StoredConfig } from "./service.ts";
|
|
8
|
-
export declare const makeT3Config: () => Effect.Effect<{
|
|
9
|
-
readStored: () => Effect.Effect<{
|
|
10
|
-
readonly url?: string;
|
|
11
|
-
readonly token?: string;
|
|
12
|
-
readonly local?: boolean;
|
|
13
|
-
}, ConfigError, never>;
|
|
14
|
-
writeStored: (config: StoredConfig) => Effect.Effect<void, ConfigError, never>;
|
|
15
|
-
resolve: () => Effect.Effect<{
|
|
16
|
-
url: string;
|
|
17
|
-
token: string;
|
|
18
|
-
source: "config" | "env";
|
|
19
|
-
local: boolean;
|
|
20
|
-
}, import("./error.ts").UrlError | ConfigError, never>;
|
|
21
|
-
}, never, Environment | Path.Path | FileSystem.FileSystem>;
|
|
22
|
-
export declare const T3ConfigLive: Layer.Layer<T3Config, never, Environment | Path.Path | FileSystem.FileSystem>;
|
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
import * as Context from "effect/Context";
|
|
2
|
-
import type * as Effect from "effect/Effect";
|
|
3
|
-
import type { ConfigError, ConfigServiceError } from "./error.ts";
|
|
4
|
-
export type StoredConfig = {
|
|
5
|
-
readonly url?: string;
|
|
6
|
-
readonly token?: string;
|
|
7
|
-
readonly local?: boolean;
|
|
8
|
-
};
|
|
9
|
-
export type ResolvedConfig = {
|
|
10
|
-
readonly url: string;
|
|
11
|
-
readonly token: string;
|
|
12
|
-
readonly source: "env" | "config";
|
|
13
|
-
readonly local: boolean;
|
|
14
|
-
};
|
|
15
|
-
declare const T3Config_base: Context.ServiceClass<T3Config, "t3cli/T3Config", {
|
|
16
|
-
readonly readStored: () => Effect.Effect<StoredConfig, ConfigError>;
|
|
17
|
-
readonly writeStored: (config: StoredConfig) => Effect.Effect<void, ConfigError>;
|
|
18
|
-
readonly resolve: () => Effect.Effect<ResolvedConfig, ConfigServiceError>;
|
|
19
|
-
}>;
|
|
20
|
-
export declare class T3Config extends T3Config_base {
|
|
21
|
-
}
|
|
22
|
-
export {};
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import * as Context from "effect/Context";
|
|
2
|
-
export type EnvironmentShape = {
|
|
3
|
-
readonly cwd: string;
|
|
4
|
-
readonly homeDir: string;
|
|
5
|
-
readonly env: Readonly<Record<string, string | undefined>>;
|
|
6
|
-
readonly stdoutIsTTY: boolean;
|
|
7
|
-
readonly stderrIsTTY: boolean;
|
|
8
|
-
};
|
|
9
|
-
declare const Environment_base: Context.ServiceClass<Environment, "t3cli/Environment", EnvironmentShape>;
|
|
10
|
-
export declare class Environment extends Environment_base {
|
|
11
|
-
}
|
|
12
|
-
export {};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export { readT3LayoutFromNodeProcess, resolveT3BaseDir, type T3Layout } from "./base-dir.ts";
|