t3code-cli 0.10.0 → 0.12.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 +75 -11
- package/dist/application.js +2 -2
- package/dist/auth.js +1 -1
- package/dist/bin.js +86754 -2675
- package/dist/cli.js +15 -2
- package/dist/config.js +120 -2
- package/dist/connection.js +2 -12
- package/dist/index.js +1 -1
- package/dist/node.js +6 -0
- package/dist/orchestration.js +2 -2
- package/dist/rpc.js +2 -2
- package/dist/runtime.js +2 -2
- package/dist/shared.js +43850 -38040
- package/dist/src/application/actions.d.ts +25 -0
- package/dist/src/application/index.d.ts +3 -2
- package/dist/src/application/layer.d.ts +99 -842
- package/dist/src/application/model-selection.d.ts +17 -2
- package/dist/src/application/models.d.ts +1 -87
- package/dist/src/application/project-commands.d.ts +31 -2
- package/dist/src/application/projects.d.ts +15 -137
- package/dist/src/application/service.d.ts +147 -5
- package/dist/src/application/shell-sequence.d.ts +5 -4
- package/dist/src/application/terminals.d.ts +66 -0
- package/dist/src/application/thread-commands.d.ts +48 -1
- package/dist/src/application/thread-update.d.ts +8 -0
- package/dist/src/application/thread-wait.d.ts +4 -6
- package/dist/src/application/threads.d.ts +36 -14
- package/dist/src/auth/error.d.ts +2 -1
- package/dist/src/auth/index.d.ts +1 -1
- package/dist/src/auth/layer.d.ts +34 -6
- 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/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 +5 -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/index.d.ts +0 -1
- package/dist/src/contracts/index.d.ts +1 -1
- package/dist/src/domain/error.d.ts +27 -1
- package/dist/src/domain/helpers.d.ts +8 -2
- package/dist/src/domain/model-config.d.ts +30 -1
- package/dist/src/domain/thread-activities.d.ts +1 -1
- package/dist/src/domain/thread-lifecycle.d.ts +3 -2
- 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 -0
- package/dist/src/orchestration/index.d.ts +1 -1
- package/dist/src/orchestration/layer.d.ts +120 -829
- package/dist/src/orchestration/service.d.ts +2 -1
- package/dist/src/rpc/error.d.ts +5 -3
- package/dist/src/rpc/index.d.ts +5 -1
- package/dist/src/rpc/layer.d.ts +1166 -40
- package/dist/src/rpc/operation.d.ts +6280 -0
- package/dist/src/rpc/ws-group.d.ts +372 -27
- package/dist/src/runtime/index.d.ts +1 -2
- package/dist/src/runtime/layer.d.ts +12 -8
- package/dist/src/t3tools/index.d.ts +1 -1
- package/dist/t3tools.js +2 -2
- package/package.json +27 -19
- package/src/application/actions.test.ts +328 -0
- package/src/application/actions.ts +475 -0
- package/src/application/index.ts +32 -2
- package/src/application/layer.ts +43 -5
- package/src/application/model-selection.ts +70 -4
- package/src/application/models.ts +14 -14
- package/src/application/project-commands.ts +38 -5
- package/src/application/projects.ts +49 -20
- package/src/application/service.ts +275 -78
- package/src/application/shell-sequence.ts +6 -8
- package/src/application/terminals.ts +208 -0
- package/src/application/thread-commands.test.ts +43 -0
- package/src/application/thread-commands.ts +82 -1
- package/src/application/thread-update.ts +72 -0
- package/src/application/thread-wait.ts +47 -48
- package/src/application/threads.test.ts +172 -0
- package/src/application/threads.ts +128 -45
- package/src/auth/error.ts +2 -1
- 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/service.test.ts +200 -0
- package/src/auth/service.ts +27 -3
- package/src/auth/transport.ts +2 -2
- package/src/auth/type.ts +47 -1
- package/src/bin.ts +26 -6
- package/src/cli/action-format.ts +110 -0
- package/src/cli/action.ts +398 -0
- package/src/cli/app.ts +8 -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/error.ts +26 -3
- package/src/cli/extra-args.test.ts +32 -0
- package/src/cli/extra-args.ts +22 -0
- package/src/cli/flags.ts +26 -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/format/thread.test.ts +34 -0
- package/src/cli/format/thread.ts +185 -0
- package/src/cli/index.ts +20 -0
- package/src/cli/input/layer.ts +20 -0
- package/src/cli/input/service.ts +1 -0
- package/src/cli/interaction/confirm.ts +64 -0
- package/src/cli/interaction/self-action.ts +36 -0
- package/src/cli/message-input.ts +1 -1
- package/src/cli/model.ts +9 -5
- package/src/cli/project.ts +15 -8
- package/src/cli/projects/delete.ts +51 -0
- 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 +29 -0
- package/src/cli/terminal/create.ts +55 -0
- package/src/cli/terminal/destroy.ts +62 -0
- package/src/cli/terminal/encoding.test.ts +63 -0
- package/src/cli/terminal/encoding.ts +23 -0
- package/src/cli/terminal/error.ts +14 -0
- package/src/cli/terminal/io-node-layer.ts +82 -0
- package/src/cli/terminal/io-service.ts +25 -0
- package/src/cli/terminal/list.ts +36 -0
- 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 +99 -0
- package/src/cli/terminal/scope.ts +35 -0
- package/src/cli/terminal/shared.ts +250 -0
- package/src/cli/terminal/stream.ts +61 -0
- package/src/cli/terminal/wait.test.ts +148 -0
- package/src/cli/terminal/wait.ts +223 -0
- package/src/cli/terminal/write.test.ts +34 -0
- package/src/cli/terminal/write.ts +133 -0
- package/src/cli/terminal.ts +26 -0
- package/src/cli/thread.ts +8 -0
- package/src/cli/threads/approve.ts +11 -7
- package/src/cli/threads/archive.ts +23 -25
- package/src/cli/threads/callback.ts +6 -4
- package/src/cli/threads/delete.ts +67 -0
- package/src/cli/threads/interrupt.ts +57 -0
- package/src/cli/threads/list.test.ts +71 -0
- package/src/cli/threads/list.ts +25 -13
- package/src/cli/threads/messages.ts +11 -7
- package/src/cli/threads/respond.ts +11 -7
- package/src/cli/threads/send.ts +39 -9
- package/src/cli/threads/show.ts +11 -7
- package/src/cli/threads/start.ts +18 -13
- package/src/cli/threads/unarchive.ts +48 -0
- package/src/cli/threads/update.ts +155 -0
- 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/index.ts +0 -1
- package/src/contracts/index.ts +1 -1
- package/src/domain/error.ts +39 -1
- package/src/domain/helpers.test.ts +1 -1
- package/src/domain/helpers.ts +1 -1
- package/src/domain/model-config.ts +5 -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 +15 -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 -0
- package/src/orchestration/index.ts +1 -1
- package/src/orchestration/layer.ts +34 -86
- package/src/orchestration/service.ts +5 -1
- package/src/rpc/error.ts +12 -2
- package/src/rpc/index.ts +5 -1
- package/src/rpc/layer.ts +1 -1
- package/src/rpc/operation.ts +83 -0
- package/src/rpc/ws-group.ts +25 -1
- 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 +22 -11
- 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 -9
- 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 -785
- 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 -496
- 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 -7338
- package/dist/upstream-t3code/packages/contracts/src/project.d.ts +0 -45
- package/dist/upstream-t3code/packages/contracts/src/provider.d.ts +0 -130
- package/dist/upstream-t3code/packages/contracts/src/providerInstance.d.ts +0 -99
- package/dist/upstream-t3code/packages/contracts/src/providerRuntime.d.ts +0 -4450
- 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 -8710
- package/dist/upstream-t3code/packages/contracts/src/server.d.ts +0 -2336
- package/dist/upstream-t3code/packages/contracts/src/settings.d.ts +0 -292
- package/dist/upstream-t3code/packages/contracts/src/sourceControl.d.ts +0 -177
- package/dist/upstream-t3code/packages/contracts/src/terminal.d.ts +0 -333
- package/dist/upstream-t3code/packages/contracts/src/vcs.d.ts +0 -148
- package/src/cli/auth-format.ts +0 -45
- package/src/cli/model-format.ts +0 -18
- package/src/cli/output-format.ts +0 -41
- package/src/cli/project-format.ts +0 -11
- package/src/cli/thread-format.ts +0 -121
- 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,29 @@
|
|
|
1
|
+
import * as Context from "effect/Context";
|
|
2
|
+
import type * as Effect from "effect/Effect";
|
|
3
|
+
import type { CredentialCipherError } from "./error.ts";
|
|
4
|
+
export declare const credentialCipherNonceByteLength = 12;
|
|
5
|
+
export declare const credentialCipherTagByteLength = 16;
|
|
6
|
+
export type AesGcmEncryptInput = {
|
|
7
|
+
readonly key: Uint8Array;
|
|
8
|
+
readonly nonce: Uint8Array;
|
|
9
|
+
readonly plaintext: Uint8Array;
|
|
10
|
+
readonly additionalData: Uint8Array;
|
|
11
|
+
};
|
|
12
|
+
export type AesGcmDecryptInput = {
|
|
13
|
+
readonly key: Uint8Array;
|
|
14
|
+
readonly nonce: Uint8Array;
|
|
15
|
+
readonly ciphertext: Uint8Array;
|
|
16
|
+
readonly tag: Uint8Array;
|
|
17
|
+
readonly additionalData: Uint8Array;
|
|
18
|
+
};
|
|
19
|
+
export type AesGcmEncryptResult = {
|
|
20
|
+
readonly ciphertext: Uint8Array;
|
|
21
|
+
readonly tag: Uint8Array;
|
|
22
|
+
};
|
|
23
|
+
declare const T3CredentialCipher_base: Context.ServiceClass<T3CredentialCipher, "t3cli/T3CredentialCipher", {
|
|
24
|
+
readonly encrypt: (input: AesGcmEncryptInput) => Effect.Effect<AesGcmEncryptResult, CredentialCipherError>;
|
|
25
|
+
readonly decrypt: (input: AesGcmDecryptInput) => Effect.Effect<Uint8Array, CredentialCipherError>;
|
|
26
|
+
}>;
|
|
27
|
+
export declare class T3CredentialCipher extends T3CredentialCipher_base {
|
|
28
|
+
}
|
|
29
|
+
export {};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import * as Schema from "effect/Schema";
|
|
2
|
+
declare const CredentialCipherError_base: Schema.Class<CredentialCipherError, Schema.TaggedStruct<"CredentialCipherError", {
|
|
3
|
+
readonly operation: Schema.Literals<readonly ["encrypt", "decrypt"]>;
|
|
4
|
+
readonly cause: Schema.Defect;
|
|
5
|
+
}>, import("effect/Cause").YieldableError>;
|
|
6
|
+
export declare class CredentialCipherError extends CredentialCipherError_base {
|
|
7
|
+
}
|
|
8
|
+
export {};
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
export * as Service from "./service.ts";
|
|
2
|
+
export * as Cipher from "./cipher.ts";
|
|
3
|
+
export * as CipherNode from "./cipher-node.ts";
|
|
4
|
+
export * as CipherWeb from "./cipher-web.ts";
|
|
5
|
+
export { credentialTokenFromEnv } from "./env.ts";
|
|
6
|
+
export { CredentialCipherError } from "./error.ts";
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import * as Context from "effect/Context";
|
|
2
|
+
import * as Crypto from "effect/Crypto";
|
|
3
|
+
import * as Effect from "effect/Effect";
|
|
4
|
+
import * as FileSystem from "effect/FileSystem";
|
|
5
|
+
import * as Layer from "effect/Layer";
|
|
6
|
+
import * as Path from "effect/Path";
|
|
7
|
+
import { T3CredentialCipher } from "./cipher.ts";
|
|
8
|
+
import type { EncryptedToken } from "../persist/schema.ts";
|
|
9
|
+
import { ConfigError } from "../error.ts";
|
|
10
|
+
import { T3MasterKeyKeystoreFactory } from "../keystore/service.ts";
|
|
11
|
+
export type CredentialEncryptInput = {
|
|
12
|
+
readonly environmentName: string;
|
|
13
|
+
readonly url: string;
|
|
14
|
+
readonly local: boolean;
|
|
15
|
+
readonly token: string;
|
|
16
|
+
};
|
|
17
|
+
export type CredentialDecryptInput = {
|
|
18
|
+
readonly environmentName: string;
|
|
19
|
+
readonly url: string;
|
|
20
|
+
readonly local: boolean;
|
|
21
|
+
readonly token: EncryptedToken;
|
|
22
|
+
};
|
|
23
|
+
declare const T3CredentialCrypto_base: Context.ServiceClass<T3CredentialCrypto, "t3cli/T3CredentialCrypto", {
|
|
24
|
+
readonly encrypt: (input: CredentialEncryptInput) => Effect.Effect<EncryptedToken, ConfigError>;
|
|
25
|
+
readonly decrypt: (input: CredentialDecryptInput) => Effect.Effect<string, ConfigError>;
|
|
26
|
+
}>;
|
|
27
|
+
export declare class T3CredentialCrypto extends T3CredentialCrypto_base {
|
|
28
|
+
}
|
|
29
|
+
export declare const make: () => Effect.Effect<{
|
|
30
|
+
encrypt: (input: CredentialEncryptInput) => Effect.Effect<EncryptedToken, ConfigError>;
|
|
31
|
+
decrypt: (input: CredentialDecryptInput) => Effect.Effect<string, ConfigError>;
|
|
32
|
+
}, ConfigError, Path.Path | Crypto.Crypto | T3CredentialCipher | T3MasterKeyKeystoreFactory | FileSystem.FileSystem>;
|
|
33
|
+
export declare const layer: Layer.Layer<T3CredentialCrypto, ConfigError, Path.Path | Crypto.Crypto | T3CredentialCipher | T3MasterKeyKeystoreFactory | FileSystem.FileSystem>;
|
|
34
|
+
export {};
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
import * as Config from "effect/Config";
|
|
2
|
+
import * as Effect from "effect/Effect";
|
|
3
|
+
import * as Option from "effect/Option";
|
|
4
|
+
import type * as Redacted from "effect/Redacted";
|
|
5
|
+
export type T3CliEnvScope = {
|
|
6
|
+
readonly t3codeProjectRoot?: string | undefined;
|
|
7
|
+
readonly t3codeProjectId?: string | undefined;
|
|
8
|
+
readonly t3codeWorktreePath?: string | undefined;
|
|
9
|
+
readonly t3codeThreadId?: string | undefined;
|
|
10
|
+
};
|
|
11
|
+
export type T3CliEnvShape = {
|
|
12
|
+
readonly home: Option.Option<string>;
|
|
13
|
+
readonly xdgConfigHome: Option.Option<string>;
|
|
14
|
+
readonly t3cliEnv: Option.Option<string>;
|
|
15
|
+
readonly t3codeUrl: Option.Option<string>;
|
|
16
|
+
readonly t3codeToken: Option.Option<Redacted.Redacted>;
|
|
17
|
+
readonly t3codeHome: Option.Option<string>;
|
|
18
|
+
readonly term: Option.Option<string>;
|
|
19
|
+
readonly ci: boolean;
|
|
20
|
+
readonly codexCi: boolean;
|
|
21
|
+
readonly codexThreadId: boolean;
|
|
22
|
+
readonly t3cliAgent: boolean;
|
|
23
|
+
readonly scope: T3CliEnvScope;
|
|
24
|
+
};
|
|
25
|
+
export declare const T3CliEnvConfig: Config.Config<{
|
|
26
|
+
home: Option.Option<string>;
|
|
27
|
+
xdgConfigHome: Option.Option<string>;
|
|
28
|
+
t3cliEnv: Option.Option<string>;
|
|
29
|
+
t3codeUrl: Option.Option<string>;
|
|
30
|
+
t3codeToken: Option.Option<Redacted.Redacted<string>>;
|
|
31
|
+
t3codeHome: Option.Option<string>;
|
|
32
|
+
t3codeProjectRoot: Option.Option<string>;
|
|
33
|
+
t3codeProjectId: Option.Option<string>;
|
|
34
|
+
t3codeWorktreePath: Option.Option<string>;
|
|
35
|
+
t3codeThreadId: Option.Option<string>;
|
|
36
|
+
term: Option.Option<string>;
|
|
37
|
+
ci: boolean;
|
|
38
|
+
codexCi: boolean;
|
|
39
|
+
codexThreadId: boolean;
|
|
40
|
+
t3cliAgent: boolean;
|
|
41
|
+
}>;
|
|
42
|
+
export declare const loadT3CliEnv: Effect.Effect<{
|
|
43
|
+
home: Option.Option<string>;
|
|
44
|
+
xdgConfigHome: Option.Option<string>;
|
|
45
|
+
t3cliEnv: Option.Option<string>;
|
|
46
|
+
t3codeUrl: Option.Option<string>;
|
|
47
|
+
t3codeToken: Option.Option<Redacted.Redacted<string>>;
|
|
48
|
+
t3codeHome: Option.Option<string>;
|
|
49
|
+
term: Option.Option<string>;
|
|
50
|
+
ci: boolean;
|
|
51
|
+
codexCi: boolean;
|
|
52
|
+
codexThreadId: boolean;
|
|
53
|
+
t3cliAgent: boolean;
|
|
54
|
+
scope: T3CliEnvScope;
|
|
55
|
+
}, Config.ConfigError, never>;
|
|
@@ -5,7 +5,6 @@ export type T3Layout = {
|
|
|
5
5
|
readonly homeDir: string;
|
|
6
6
|
readonly t3codeHome?: string | undefined;
|
|
7
7
|
};
|
|
8
|
-
export declare function readT3LayoutFromNodeProcess(): T3Layout;
|
|
9
8
|
export declare const resolveT3BaseDir: (input: {
|
|
10
9
|
readonly layout: T3Layout;
|
|
11
10
|
readonly baseDir?: string | undefined;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { defaultEnvironmentNameForLocal, defaultEnvironmentNameFromUrl, migrateV1EnvironmentName, slugifyEnvironmentName, validateEnvironmentName, } from "./name.ts";
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import * as Effect from "effect/Effect";
|
|
2
|
+
import { ConfigError } from "../error.ts";
|
|
3
|
+
export declare function slugifyEnvironmentName(value: string): string;
|
|
4
|
+
export declare function validateEnvironmentName(name: string): Effect.Effect<void, never, never> | Effect.Effect<never, ConfigError, never>;
|
|
5
|
+
export declare function defaultEnvironmentNameFromUrl(url: string): Effect.Effect<string, ConfigError, never>;
|
|
6
|
+
export declare function defaultEnvironmentNameForLocal(): "local";
|
|
7
|
+
export declare function migrateV1EnvironmentName(input: {
|
|
8
|
+
readonly url?: string;
|
|
9
|
+
readonly local?: boolean;
|
|
10
|
+
}): Effect.Effect<string, ConfigError, never>;
|
|
@@ -1,18 +1,11 @@
|
|
|
1
|
-
import * as Cause from "effect/Cause";
|
|
2
1
|
import * as Schema from "effect/Schema";
|
|
3
2
|
import { PlatformError } from "effect/PlatformError";
|
|
4
|
-
declare const UrlError_base: Schema.Class<UrlError, Schema.TaggedStruct<"UrlError", {
|
|
5
|
-
readonly message: Schema.String;
|
|
6
|
-
readonly protocol: Schema.optionalKey<Schema.String>;
|
|
7
|
-
readonly cause: Schema.optionalKey<Schema.instanceOf<Cause.IllegalArgumentError, Cause.IllegalArgumentError>>;
|
|
8
|
-
}>, Cause.YieldableError>;
|
|
9
|
-
export declare class UrlError extends UrlError_base {
|
|
10
|
-
}
|
|
11
3
|
declare const ConfigError_base: Schema.Class<ConfigError, Schema.TaggedStruct<"ConfigError", {
|
|
12
4
|
readonly message: Schema.String;
|
|
13
|
-
readonly cause: Schema.optionalKey<Schema.Union<readonly [Schema.instanceOf<PlatformError, unknown>, Schema.instanceOf<Schema.SchemaError, unknown
|
|
14
|
-
}>, Cause.YieldableError>;
|
|
5
|
+
readonly cause: Schema.optionalKey<Schema.Union<readonly [Schema.instanceOf<PlatformError, unknown>, Schema.instanceOf<Schema.SchemaError, unknown>, Schema.Defect]>>;
|
|
6
|
+
}>, import("effect/Cause").YieldableError>;
|
|
15
7
|
export declare class ConfigError extends ConfigError_base {
|
|
16
8
|
}
|
|
17
|
-
export type ConfigServiceError = ConfigError
|
|
9
|
+
export type ConfigServiceError = ConfigError;
|
|
10
|
+
export declare function isPlatformNotFoundError(error: PlatformError): boolean;
|
|
18
11
|
export {};
|
|
@@ -1,5 +1,10 @@
|
|
|
1
|
-
export
|
|
2
|
-
export type { ResolvedConfig,
|
|
3
|
-
export {
|
|
4
|
-
export
|
|
5
|
-
export
|
|
1
|
+
export * as Config from "./config.ts";
|
|
2
|
+
export type { EncryptedConfig, EncryptedToken, EnvironmentSummary, ResolvedConfig, UpsertEnvironmentInput, } from "./types.ts";
|
|
3
|
+
export { ConfigError, type ConfigServiceError } from "./error.ts";
|
|
4
|
+
export * as Credential from "./credential/index.ts";
|
|
5
|
+
export * as Keystore from "./keystore/index.ts";
|
|
6
|
+
export * as Selection from "./selection/index.ts";
|
|
7
|
+
export * as Env from "./env/index.ts";
|
|
8
|
+
export * as Paths from "./paths/index.ts";
|
|
9
|
+
export * as Url from "./url/index.ts";
|
|
10
|
+
export * as EnvironmentName from "./environment-name/index.ts";
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import * as Schema from "effect/Schema";
|
|
2
|
+
declare const KeystoreUnavailableError_base: Schema.Class<KeystoreUnavailableError, Schema.TaggedStruct<"KeystoreUnavailableError", {
|
|
3
|
+
readonly reason: Schema.Literals<readonly ["module-not-found", "backend-unavailable"]>;
|
|
4
|
+
readonly cause: Schema.Defect;
|
|
5
|
+
}>, import("effect/Cause").YieldableError>;
|
|
6
|
+
export declare class KeystoreUnavailableError extends KeystoreUnavailableError_base {
|
|
7
|
+
}
|
|
8
|
+
export {};
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import * as Effect from "effect/Effect";
|
|
2
|
+
import * as FileSystem from "effect/FileSystem";
|
|
3
|
+
import * as Path from "effect/Path";
|
|
4
|
+
import { ConfigError } from "../error.ts";
|
|
5
|
+
import { type MasterKeyReadResult } from "./service.ts";
|
|
6
|
+
export declare const makeFileKeystore: () => Effect.Effect<{
|
|
7
|
+
read: () => Effect.Effect<MasterKeyReadResult, ConfigError>;
|
|
8
|
+
write: (key: Uint8Array) => Effect.Effect<void, ConfigError>;
|
|
9
|
+
}, ConfigError, Path.Path | FileSystem.FileSystem>;
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import * as Layer from "effect/Layer";
|
|
2
|
+
import { T3MasterKeyKeystoreFactory, type MasterKeyReadResult } from "./service.ts";
|
|
3
|
+
export declare function parseKeyringPassword(password: string | null): MasterKeyReadResult;
|
|
4
|
+
export declare const layerNode: Layer.Layer<T3MasterKeyKeystoreFactory, never, never>;
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import * as Context from "effect/Context";
|
|
2
|
+
import type * as Effect from "effect/Effect";
|
|
3
|
+
import type { ConfigError } from "../error.ts";
|
|
4
|
+
import type { KeystoreUnavailableError } from "./error.ts";
|
|
5
|
+
export declare const masterKeyByteLength = 32;
|
|
6
|
+
export type MasterKeyReadResult = {
|
|
7
|
+
readonly kind: "missing";
|
|
8
|
+
} | {
|
|
9
|
+
readonly kind: "present";
|
|
10
|
+
readonly key: Uint8Array;
|
|
11
|
+
} | {
|
|
12
|
+
readonly kind: "corrupt";
|
|
13
|
+
readonly message: string;
|
|
14
|
+
} | {
|
|
15
|
+
readonly kind: "unavailable";
|
|
16
|
+
readonly message: string;
|
|
17
|
+
};
|
|
18
|
+
export type MasterKeyKeystore = {
|
|
19
|
+
readonly read: () => Effect.Effect<MasterKeyReadResult, ConfigError>;
|
|
20
|
+
readonly write: (key: Uint8Array) => Effect.Effect<void, ConfigError | KeystoreUnavailableError>;
|
|
21
|
+
};
|
|
22
|
+
declare const T3MasterKeyKeystoreFactory_base: Context.ServiceClass<T3MasterKeyKeystoreFactory, "t3cli/T3MasterKeyKeystoreFactory", {
|
|
23
|
+
readonly make: () => Effect.Effect<MasterKeyKeystore, KeystoreUnavailableError>;
|
|
24
|
+
}>;
|
|
25
|
+
export declare class T3MasterKeyKeystoreFactory extends T3MasterKeyKeystoreFactory_base {
|
|
26
|
+
}
|
|
27
|
+
export declare function shouldUseFileKeystoreForRead(result: MasterKeyReadResult): result is {
|
|
28
|
+
readonly kind: "missing";
|
|
29
|
+
} | {
|
|
30
|
+
readonly kind: "unavailable";
|
|
31
|
+
readonly message: string;
|
|
32
|
+
};
|
|
33
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { resolveConfigFilePath, resolveKeyFilePath, resolveT3cliConfigDir } from "./paths.ts";
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import * as Effect from "effect/Effect";
|
|
2
|
+
import * as Path from "effect/Path";
|
|
3
|
+
import { ConfigError } from "../error.ts";
|
|
4
|
+
export declare const resolveT3cliConfigDir: () => Effect.Effect<string, ConfigError, Path.Path>;
|
|
5
|
+
export declare const resolveConfigFilePath: () => Effect.Effect<string, ConfigError, Path.Path>;
|
|
6
|
+
export declare const resolveKeyFilePath: () => Effect.Effect<string, ConfigError, Path.Path>;
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import * as Effect from "effect/Effect";
|
|
2
|
+
import * as FileSystem from "effect/FileSystem";
|
|
3
|
+
import { ConfigError } from "../error.ts";
|
|
4
|
+
export declare const hardenPrivateFileMode: (filePath: string, label: "config" | "credential key") => Effect.Effect<void, ConfigError, FileSystem.FileSystem>;
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
import * as Effect from "effect/Effect";
|
|
2
|
+
import { T3CredentialCrypto } from "../credential/service.ts";
|
|
3
|
+
import { ConfigError } from "../error.ts";
|
|
4
|
+
import type { EncryptedConfig } from "../types.ts";
|
|
5
|
+
export declare const emptyEncryptedConfig: () => EncryptedConfig;
|
|
6
|
+
export declare const readEncryptedConfigFromValue: (value: unknown) => Effect.Effect<{
|
|
7
|
+
config: {
|
|
8
|
+
readonly version: 2;
|
|
9
|
+
readonly environments: {
|
|
10
|
+
readonly [x: string]: {
|
|
11
|
+
readonly url: string;
|
|
12
|
+
readonly local: boolean;
|
|
13
|
+
readonly token: {
|
|
14
|
+
readonly kind: "encrypted";
|
|
15
|
+
readonly alg: "aes-256-gcm";
|
|
16
|
+
readonly key: "default";
|
|
17
|
+
readonly nonce: string;
|
|
18
|
+
readonly ciphertext: string;
|
|
19
|
+
readonly tag: string;
|
|
20
|
+
};
|
|
21
|
+
};
|
|
22
|
+
};
|
|
23
|
+
readonly default?: string;
|
|
24
|
+
};
|
|
25
|
+
migratedFromV1: false;
|
|
26
|
+
} | {
|
|
27
|
+
config: {
|
|
28
|
+
readonly version: 2;
|
|
29
|
+
readonly environments: {
|
|
30
|
+
readonly [x: string]: {
|
|
31
|
+
readonly url: string;
|
|
32
|
+
readonly local: boolean;
|
|
33
|
+
readonly token: {
|
|
34
|
+
readonly kind: "encrypted";
|
|
35
|
+
readonly alg: "aes-256-gcm";
|
|
36
|
+
readonly key: "default";
|
|
37
|
+
readonly nonce: string;
|
|
38
|
+
readonly ciphertext: string;
|
|
39
|
+
readonly tag: string;
|
|
40
|
+
};
|
|
41
|
+
};
|
|
42
|
+
};
|
|
43
|
+
readonly default?: string;
|
|
44
|
+
};
|
|
45
|
+
migratedFromV1: true;
|
|
46
|
+
}, ConfigError, T3CredentialCrypto>;
|
|
47
|
+
export declare const migrateV1FileToEncrypted: (config: {
|
|
48
|
+
readonly url?: string;
|
|
49
|
+
readonly token?: string;
|
|
50
|
+
readonly local?: boolean;
|
|
51
|
+
}) => Effect.Effect<{
|
|
52
|
+
readonly version: 2;
|
|
53
|
+
readonly environments: {
|
|
54
|
+
readonly [x: string]: {
|
|
55
|
+
readonly url: string;
|
|
56
|
+
readonly local: boolean;
|
|
57
|
+
readonly token: {
|
|
58
|
+
readonly kind: "encrypted";
|
|
59
|
+
readonly alg: "aes-256-gcm";
|
|
60
|
+
readonly key: "default";
|
|
61
|
+
readonly nonce: string;
|
|
62
|
+
readonly ciphertext: string;
|
|
63
|
+
readonly tag: string;
|
|
64
|
+
};
|
|
65
|
+
};
|
|
66
|
+
};
|
|
67
|
+
readonly default?: string;
|
|
68
|
+
}, ConfigError, T3CredentialCrypto>;
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import * as Effect from "effect/Effect";
|
|
2
|
+
import * as FileSystem from "effect/FileSystem";
|
|
3
|
+
import * as Path from "effect/Path";
|
|
4
|
+
import { ConfigError } from "../error.ts";
|
|
5
|
+
export declare const readEncryptedConfigFile: () => Effect.Effect<{
|
|
6
|
+
readonly version: 2;
|
|
7
|
+
readonly environments: {
|
|
8
|
+
readonly [x: string]: {
|
|
9
|
+
readonly url: string;
|
|
10
|
+
readonly local: boolean;
|
|
11
|
+
readonly token: {
|
|
12
|
+
readonly kind: "encrypted";
|
|
13
|
+
readonly alg: "aes-256-gcm";
|
|
14
|
+
readonly key: "default";
|
|
15
|
+
readonly nonce: string;
|
|
16
|
+
readonly ciphertext: string;
|
|
17
|
+
readonly tag: string;
|
|
18
|
+
};
|
|
19
|
+
};
|
|
20
|
+
};
|
|
21
|
+
readonly default?: string;
|
|
22
|
+
}, ConfigError, Path.Path | FileSystem.FileSystem | import("../credential/service.ts").T3CredentialCrypto>;
|
|
23
|
+
export declare const writeEncryptedConfigFile: (config: {
|
|
24
|
+
readonly version: 2;
|
|
25
|
+
readonly environments: {
|
|
26
|
+
readonly [x: string]: {
|
|
27
|
+
readonly url: string;
|
|
28
|
+
readonly local: boolean;
|
|
29
|
+
readonly token: {
|
|
30
|
+
readonly kind: "encrypted";
|
|
31
|
+
readonly alg: "aes-256-gcm";
|
|
32
|
+
readonly key: "default";
|
|
33
|
+
readonly nonce: string;
|
|
34
|
+
readonly ciphertext: string;
|
|
35
|
+
readonly tag: string;
|
|
36
|
+
};
|
|
37
|
+
};
|
|
38
|
+
};
|
|
39
|
+
readonly default?: string;
|
|
40
|
+
}) => Effect.Effect<void, ConfigError, Path.Path | FileSystem.FileSystem>;
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
import * as Schema from "effect/Schema";
|
|
2
|
+
export declare const EncryptedTokenSchema: Schema.Struct<{
|
|
3
|
+
readonly kind: Schema.Literal<"encrypted">;
|
|
4
|
+
readonly alg: Schema.Literal<"aes-256-gcm">;
|
|
5
|
+
readonly key: Schema.Literal<"default">;
|
|
6
|
+
readonly nonce: Schema.String;
|
|
7
|
+
readonly ciphertext: Schema.String;
|
|
8
|
+
readonly tag: Schema.String;
|
|
9
|
+
}>;
|
|
10
|
+
export declare const StoredEnvironmentFileSchema: Schema.Struct<{
|
|
11
|
+
readonly url: Schema.String;
|
|
12
|
+
readonly local: Schema.Boolean;
|
|
13
|
+
readonly token: Schema.Struct<{
|
|
14
|
+
readonly kind: Schema.Literal<"encrypted">;
|
|
15
|
+
readonly alg: Schema.Literal<"aes-256-gcm">;
|
|
16
|
+
readonly key: Schema.Literal<"default">;
|
|
17
|
+
readonly nonce: Schema.String;
|
|
18
|
+
readonly ciphertext: Schema.String;
|
|
19
|
+
readonly tag: Schema.String;
|
|
20
|
+
}>;
|
|
21
|
+
}>;
|
|
22
|
+
export declare const StoredConfigV2FileSchema: Schema.Struct<{
|
|
23
|
+
readonly version: Schema.Literal<2>;
|
|
24
|
+
readonly default: Schema.optionalKey<Schema.String>;
|
|
25
|
+
readonly environments: Schema.$Record<Schema.String, Schema.Struct<{
|
|
26
|
+
readonly url: Schema.String;
|
|
27
|
+
readonly local: Schema.Boolean;
|
|
28
|
+
readonly token: Schema.Struct<{
|
|
29
|
+
readonly kind: Schema.Literal<"encrypted">;
|
|
30
|
+
readonly alg: Schema.Literal<"aes-256-gcm">;
|
|
31
|
+
readonly key: Schema.Literal<"default">;
|
|
32
|
+
readonly nonce: Schema.String;
|
|
33
|
+
readonly ciphertext: Schema.String;
|
|
34
|
+
readonly tag: Schema.String;
|
|
35
|
+
}>;
|
|
36
|
+
}>>;
|
|
37
|
+
}>;
|
|
38
|
+
export declare const StoredConfigV1FileSchema: Schema.Struct<{
|
|
39
|
+
readonly url: Schema.optionalKey<Schema.String>;
|
|
40
|
+
readonly token: Schema.optionalKey<Schema.String>;
|
|
41
|
+
readonly local: Schema.optionalKey<Schema.Boolean>;
|
|
42
|
+
}>;
|
|
43
|
+
export type EncryptedToken = Schema.Schema.Type<typeof EncryptedTokenSchema>;
|
|
44
|
+
export type StoredEnvironmentFile = Schema.Schema.Type<typeof StoredEnvironmentFileSchema>;
|
|
45
|
+
export type StoredConfigV2File = Schema.Schema.Type<typeof StoredConfigV2FileSchema>;
|
|
46
|
+
export type StoredConfigV1File = Schema.Schema.Type<typeof StoredConfigV1FileSchema>;
|
|
47
|
+
export declare const StoredConfigV1FileJson: Schema.fromJsonString<Schema.Struct<{
|
|
48
|
+
readonly url: Schema.optionalKey<Schema.String>;
|
|
49
|
+
readonly token: Schema.optionalKey<Schema.String>;
|
|
50
|
+
readonly local: Schema.optionalKey<Schema.Boolean>;
|
|
51
|
+
}>>;
|
|
52
|
+
export declare const StoredConfigV2FileJson: Schema.fromJsonString<Schema.Struct<{
|
|
53
|
+
readonly version: Schema.Literal<2>;
|
|
54
|
+
readonly default: Schema.optionalKey<Schema.String>;
|
|
55
|
+
readonly environments: Schema.$Record<Schema.String, Schema.Struct<{
|
|
56
|
+
readonly url: Schema.String;
|
|
57
|
+
readonly local: Schema.Boolean;
|
|
58
|
+
readonly token: Schema.Struct<{
|
|
59
|
+
readonly kind: Schema.Literal<"encrypted">;
|
|
60
|
+
readonly alg: Schema.Literal<"aes-256-gcm">;
|
|
61
|
+
readonly key: Schema.Literal<"default">;
|
|
62
|
+
readonly nonce: Schema.String;
|
|
63
|
+
readonly ciphertext: Schema.String;
|
|
64
|
+
readonly tag: Schema.String;
|
|
65
|
+
}>;
|
|
66
|
+
}>>;
|
|
67
|
+
}>>;
|
|
68
|
+
export declare const UnknownConfigFileJson: Schema.UnknownFromJsonString;
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import * as Effect from "effect/Effect";
|
|
2
|
+
import { ConfigError } from "../error.ts";
|
|
3
|
+
import type { EncryptedConfig } from "../types.ts";
|
|
4
|
+
export type ResolveSelectionInput = {
|
|
5
|
+
readonly selectedEnvironment?: string | undefined;
|
|
6
|
+
readonly defaultEnvironment?: string | undefined;
|
|
7
|
+
};
|
|
8
|
+
export declare function selectEnvironmentName(input: ResolveSelectionInput): string | undefined;
|
|
9
|
+
export type ResolveCredentialInput = {
|
|
10
|
+
readonly envUrl?: string | undefined;
|
|
11
|
+
readonly envToken?: string | undefined;
|
|
12
|
+
};
|
|
13
|
+
export declare function validateCredentialEnvVars(input: ResolveCredentialInput): Effect.Effect<void, never, never> | Effect.Effect<never, ConfigError, never>;
|
|
14
|
+
export declare function resolveDefaultForUpsert(encrypted: EncryptedConfig, environmentName: string, makeDefault?: boolean): string | undefined;
|
|
15
|
+
export declare function summarizeEnvironments(encrypted: EncryptedConfig): {
|
|
16
|
+
name: string;
|
|
17
|
+
url: string;
|
|
18
|
+
local: boolean;
|
|
19
|
+
default: boolean;
|
|
20
|
+
}[];
|
|
21
|
+
export declare function buildResolvedConfigFromEnv(input: {
|
|
22
|
+
readonly envUrl: string;
|
|
23
|
+
readonly envToken: string;
|
|
24
|
+
}): Effect.Effect<{
|
|
25
|
+
url: string;
|
|
26
|
+
token: string;
|
|
27
|
+
source: "env";
|
|
28
|
+
local: false;
|
|
29
|
+
}, ConfigError, never>;
|
|
30
|
+
export declare function buildResolvedConfigFromStored(input: {
|
|
31
|
+
readonly selectedName: string;
|
|
32
|
+
readonly token: string;
|
|
33
|
+
readonly encrypted: EncryptedConfig;
|
|
34
|
+
}): Effect.Effect<{
|
|
35
|
+
url: string;
|
|
36
|
+
token: string;
|
|
37
|
+
source: "config";
|
|
38
|
+
local: boolean;
|
|
39
|
+
environment: string;
|
|
40
|
+
}, ConfigError, never>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * as Service from "./service.ts";
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import * as Context from "effect/Context";
|
|
2
|
+
import * as Effect from "effect/Effect";
|
|
3
|
+
import * as Layer from "effect/Layer";
|
|
4
|
+
declare const T3ConfigSelection_base: Context.ServiceClass<T3ConfigSelection, "t3cli/T3ConfigSelection", {
|
|
5
|
+
readonly getSelectedEnvironment: () => Effect.Effect<string | undefined>;
|
|
6
|
+
}>;
|
|
7
|
+
export declare class T3ConfigSelection extends T3ConfigSelection_base {
|
|
8
|
+
}
|
|
9
|
+
export declare const layer: Layer.Layer<T3ConfigSelection, import("effect/Config").ConfigError, never>;
|
|
10
|
+
export {};
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import type { EncryptedToken, StoredConfigV2File, StoredEnvironmentFile } from "./persist/schema.ts";
|
|
2
|
+
export type EncryptedEnvironment = StoredEnvironmentFile;
|
|
3
|
+
export type EncryptedConfig = StoredConfigV2File;
|
|
4
|
+
export type DecryptedEnvironment = {
|
|
5
|
+
readonly url: string;
|
|
6
|
+
readonly local: boolean;
|
|
7
|
+
readonly token: string;
|
|
8
|
+
};
|
|
9
|
+
export type DecryptedConfig = {
|
|
10
|
+
readonly version: 2;
|
|
11
|
+
readonly default?: string;
|
|
12
|
+
readonly environments: Readonly<Record<string, DecryptedEnvironment>>;
|
|
13
|
+
};
|
|
14
|
+
export type EnvironmentSummary = {
|
|
15
|
+
readonly name: string;
|
|
16
|
+
readonly url: string;
|
|
17
|
+
readonly local: boolean;
|
|
18
|
+
readonly default: boolean;
|
|
19
|
+
};
|
|
20
|
+
export type ResolvedConfig = {
|
|
21
|
+
readonly url: string;
|
|
22
|
+
readonly token: string;
|
|
23
|
+
readonly source: "env" | "config";
|
|
24
|
+
readonly local: boolean;
|
|
25
|
+
readonly environment?: string;
|
|
26
|
+
};
|
|
27
|
+
export type UpsertEnvironmentInput = {
|
|
28
|
+
readonly name: string;
|
|
29
|
+
readonly url: string;
|
|
30
|
+
readonly token: string;
|
|
31
|
+
readonly local: boolean;
|
|
32
|
+
readonly makeDefault?: boolean;
|
|
33
|
+
};
|
|
34
|
+
export type StoredConfig = DecryptedConfig;
|
|
35
|
+
export type StoredEnvironment = DecryptedEnvironment;
|
|
36
|
+
export type { EncryptedToken };
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import * as Cause from "effect/Cause";
|
|
2
|
+
import * as Schema from "effect/Schema";
|
|
3
|
+
declare const UrlError_base: Schema.Class<UrlError, Schema.TaggedStruct<"UrlError", {
|
|
4
|
+
readonly message: Schema.String;
|
|
5
|
+
readonly protocol: Schema.optionalKey<Schema.String>;
|
|
6
|
+
readonly cause: Schema.optionalKey<Schema.instanceOf<Cause.IllegalArgumentError, Cause.IllegalArgumentError>>;
|
|
7
|
+
}>, Cause.YieldableError>;
|
|
8
|
+
export declare class UrlError extends UrlError_base {
|
|
9
|
+
}
|
|
10
|
+
export {};
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
export { T3CodeConnectionError } from "./error.ts";
|
|
2
2
|
export { T3CodeRpcLayer, makeT3CodeRpcLayer } from "./layer.ts";
|
|
3
|
-
export { T3CodeNodeRpcLayer } from "./node.ts";
|
|
4
3
|
export { T3CodeConnectionProvider, T3CodeConnectionProviderLive, makeT3CodeConnectionProvider, } from "./service.ts";
|
|
5
4
|
export type { T3CodeAuth, T3CodeConnection, T3CodeOrigin } from "./type.ts";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export type { OrchestrationMessage, OrchestrationProjectShell, OrchestrationShellSnapshot, OrchestrationThread, OrchestrationThreadShell, ServerProvider, } from "
|
|
1
|
+
export type { OrchestrationMessage, OrchestrationProjectShell, OrchestrationShellSnapshot, OrchestrationThread, OrchestrationThreadShell, ServerProvider, } from "@t3tools/contracts";
|
|
@@ -21,11 +21,37 @@ declare const ThreadSessionError_base: Schema.Class<ThreadSessionError, Schema.T
|
|
|
21
21
|
}>, import("effect/Cause").YieldableError>;
|
|
22
22
|
export declare class ThreadSessionError extends ThreadSessionError_base {
|
|
23
23
|
}
|
|
24
|
+
declare const ThreadLookupError_base: Schema.Class<ThreadLookupError, Schema.TaggedStruct<"ThreadLookupError", {
|
|
25
|
+
readonly message: Schema.String;
|
|
26
|
+
readonly threadId: Schema.String;
|
|
27
|
+
}>, import("effect/Cause").YieldableError>;
|
|
28
|
+
export declare class ThreadLookupError extends ThreadLookupError_base {
|
|
29
|
+
}
|
|
24
30
|
declare const ProjectCreateVisibilityError_base: Schema.Class<ProjectCreateVisibilityError, Schema.TaggedStruct<"ProjectCreateVisibilityError", {
|
|
25
31
|
readonly message: Schema.String;
|
|
26
32
|
readonly projectId: Schema.String;
|
|
27
33
|
}>, import("effect/Cause").YieldableError>;
|
|
28
34
|
export declare class ProjectCreateVisibilityError extends ProjectCreateVisibilityError_base {
|
|
29
35
|
}
|
|
30
|
-
|
|
36
|
+
declare const TerminalLookupError_base: Schema.Class<TerminalLookupError, Schema.TaggedStruct<"TerminalLookupError", {
|
|
37
|
+
readonly message: Schema.String;
|
|
38
|
+
readonly threadId: Schema.String;
|
|
39
|
+
readonly terminalId: Schema.String;
|
|
40
|
+
}>, import("effect/Cause").YieldableError>;
|
|
41
|
+
export declare class TerminalLookupError extends TerminalLookupError_base {
|
|
42
|
+
}
|
|
43
|
+
declare const ProjectActionLookupError_base: Schema.Class<ProjectActionLookupError, Schema.TaggedStruct<"ProjectActionLookupError", {
|
|
44
|
+
readonly message: Schema.String;
|
|
45
|
+
readonly projectId: Schema.String;
|
|
46
|
+
readonly selector: Schema.String;
|
|
47
|
+
}>, import("effect/Cause").YieldableError>;
|
|
48
|
+
export declare class ProjectActionLookupError extends ProjectActionLookupError_base {
|
|
49
|
+
}
|
|
50
|
+
declare const ProjectActionValidationError_base: Schema.Class<ProjectActionValidationError, Schema.TaggedStruct<"ProjectActionValidationError", {
|
|
51
|
+
readonly message: Schema.String;
|
|
52
|
+
readonly projectId: Schema.String;
|
|
53
|
+
}>, import("effect/Cause").YieldableError>;
|
|
54
|
+
export declare class ProjectActionValidationError extends ProjectActionValidationError_base {
|
|
55
|
+
}
|
|
56
|
+
export type DomainError = ProjectLookupError | ModelSelectionError | ThreadEventError | ThreadSessionError | ThreadLookupError | ProjectCreateVisibilityError | TerminalLookupError | ProjectActionLookupError | ProjectActionValidationError;
|
|
31
57
|
export {};
|