t3code-cli 0.5.1 → 0.6.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 +41 -16
- package/dist/Context-DueQ9iMH.js +4916 -0
- package/dist/Path-D8WPdPwR.js +11406 -0
- package/dist/Schema-DsQxYh6_.js +13581 -0
- package/dist/UrlParams-BA6gBvaY.js +205 -0
- package/dist/application.js +2 -0
- package/dist/auth.js +3 -0
- package/dist/base-dir-R12OMDso.js +20 -0
- package/dist/bin.js +236 -13526
- package/dist/chunk-B5meny8j.js +36 -0
- package/dist/cli.js +2 -0
- package/dist/config.js +4 -0
- package/dist/connection.js +15 -0
- package/dist/contracts.js +1 -0
- package/dist/error-B2t1bAP9.js +169 -0
- package/dist/error-BHRnjLux.js +15 -0
- package/dist/error-jwMt3VoW.js +54 -0
- package/dist/flags-CM7_iGdA.js +13371 -0
- package/dist/index.js +5 -12
- package/dist/layer-CfC5qZol.js +1508 -0
- package/dist/layer-DHhKS5jd.js +13 -0
- package/dist/layer-DIg0RxSO.js +1217 -0
- package/dist/layer-DUv99vsS.js +72 -0
- package/dist/layer-DvHnKBYj.js +29466 -0
- package/dist/layout.js +2 -0
- package/dist/orchestration.js +2 -0
- package/dist/rpc.js +2 -0
- package/dist/runtime.js +3 -0
- package/dist/scope-GycYiJ54.js +29 -0
- package/dist/scope.js +2 -0
- package/dist/service-CLmRO2Dp.js +8 -0
- package/dist/service-ybOWV9pL.js +5 -0
- package/dist/src/application/index.d.ts +3 -0
- package/dist/src/application/layer.d.ts +4 -4
- package/dist/src/application/projects.d.ts +1 -1
- package/dist/src/application/service.d.ts +1 -1
- package/dist/src/application/threads.d.ts +4 -4
- package/dist/src/auth/index.d.ts +10 -0
- package/dist/src/auth/local-base-dir.d.ts +5 -7
- package/dist/src/auth/local-token.d.ts +2 -2
- package/dist/src/auth/type.d.ts +1 -0
- package/dist/src/cli/flags.d.ts +15 -0
- package/dist/src/cli/index.d.ts +1 -0
- package/dist/src/cli/output-format.d.ts +9 -0
- package/dist/src/config/index.d.ts +5 -0
- package/dist/src/config/layer.d.ts +2 -0
- package/dist/src/config/service.d.ts +2 -0
- package/dist/src/connection/index.d.ts +5 -0
- package/dist/src/contracts/index.d.ts +1 -0
- package/dist/src/domain/helpers.d.ts +164 -32
- package/dist/src/index.d.ts +4 -28
- package/dist/src/layout/base-dir.d.ts +12 -0
- package/dist/src/layout/index.d.ts +1 -0
- package/dist/src/orchestration/index.d.ts +2 -0
- package/dist/src/rpc/index.d.ts +1 -0
- package/dist/src/runtime/index.d.ts +2 -0
- package/dist/src/runtime/layer.d.ts +11 -0
- package/dist/src/scope/index.d.ts +1 -0
- package/dist/src/scope/resolve.d.ts +19 -0
- package/dist/src/t3tools/index.d.ts +1 -0
- package/dist/src-KdbHqrex.js +8874 -0
- package/dist/t3tools.js +2 -0
- package/dist/transport-D3zBdZ1h.js +539 -0
- package/dist/url-SlsaG8nY.js +165 -0
- package/package.json +50 -1
- package/src/application/index.ts +3 -0
- package/src/application/service.ts +1 -1
- package/src/application/threads.ts +40 -11
- package/src/auth/index.ts +28 -0
- package/src/auth/layer.ts +13 -6
- package/src/auth/local-base-dir.ts +15 -19
- package/src/auth/local-origin.ts +4 -1
- package/src/auth/local-token.ts +4 -1
- package/src/auth/type.ts +1 -0
- package/src/bin.ts +1 -1
- package/src/cli/app.ts +6 -6
- package/src/cli/auth-format.ts +2 -0
- package/src/cli/auth.ts +19 -9
- package/src/cli/error.ts +7 -0
- package/src/cli/flags.ts +51 -0
- package/src/cli/index.ts +10 -0
- package/src/cli/{models.ts → model.ts} +5 -4
- package/src/cli/{projects.ts → project.ts} +8 -7
- package/src/cli/require.ts +31 -0
- package/src/cli/{threads.ts → thread.ts} +2 -2
- package/src/cli/threads/archive.ts +24 -8
- package/src/cli/threads/list.ts +12 -5
- package/src/cli/threads/messages.ts +20 -5
- package/src/cli/threads/send.ts +27 -23
- package/src/cli/threads/start.ts +22 -21
- package/src/cli/threads/wait.ts +22 -12
- package/src/config/index.ts +5 -0
- package/src/config/layer.ts +2 -0
- package/src/config/service.ts +2 -0
- package/src/connection/index.ts +9 -0
- package/src/contracts/index.ts +8 -0
- package/src/domain/helpers.ts +136 -16
- package/src/index.ts +4 -87
- package/src/layout/base-dir.ts +35 -0
- package/src/layout/index.ts +1 -0
- package/src/orchestration/index.ts +7 -0
- package/src/rpc/index.ts +1 -0
- package/src/runtime/index.ts +12 -0
- package/src/{runtime.ts → runtime/layer.ts} +15 -15
- package/src/scope/index.ts +6 -0
- package/src/scope/resolve.ts +62 -0
- package/src/t3tools/index.ts +1 -0
- package/dist/runtime-KQVRmRk-.js +0 -71499
- package/dist/src/connection.d.ts +0 -5
- package/dist/src/runtime.d.ts +0 -10
- package/src/connection.ts +0 -9
package/dist/layout.js
ADDED
package/dist/rpc.js
ADDED
package/dist/runtime.js
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import { a as T3AuthTransportLayer, c as T3LocalAuthTokenLayer, i as T3AuthPairingLayer, l as T3OrchestrationLayer, n as AuthAppLayer, o as T3LocalAuthLayer, r as T3AuthLayer, s as T3LocalAuthOriginLayer, t as AppLayer } from "./layer-DIg0RxSO.js";
|
|
2
|
+
import { t as NodeEnvironmentLive } from "./layer-DHhKS5jd.js";
|
|
3
|
+
export { AppLayer, AuthAppLayer, NodeEnvironmentLive, T3AuthLayer, T3AuthPairingLayer, T3AuthTransportLayer, T3LocalAuthLayer, T3LocalAuthOriginLayer, T3LocalAuthTokenLayer, T3OrchestrationLayer };
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
//#region src/scope/resolve.ts
|
|
2
|
+
function resolveProjectRef(input) {
|
|
3
|
+
if (input.value !== void 0 && input.value.length > 0) return input.value;
|
|
4
|
+
const fromRoot = input.env.T3CODE_PROJECT_ROOT;
|
|
5
|
+
if (fromRoot !== void 0 && fromRoot.length > 0) return fromRoot;
|
|
6
|
+
const fromId = input.env.T3CODE_PROJECT_ID;
|
|
7
|
+
if (fromId !== void 0 && fromId.length > 0) return fromId;
|
|
8
|
+
}
|
|
9
|
+
function resolveCommandProjectRef(input) {
|
|
10
|
+
const explicit = resolveProjectRef({
|
|
11
|
+
value: input.value,
|
|
12
|
+
env: input.env
|
|
13
|
+
});
|
|
14
|
+
if (explicit !== void 0) return explicit;
|
|
15
|
+
if (input.isLocal ?? false) return input.cwd;
|
|
16
|
+
}
|
|
17
|
+
function resolveWorktreePath(input) {
|
|
18
|
+
if (input.value !== void 0 && input.value.length > 0) return input.value;
|
|
19
|
+
const fromEnv = input.env.T3CODE_WORKTREE_PATH;
|
|
20
|
+
if (fromEnv !== void 0 && fromEnv.length > 0) return fromEnv;
|
|
21
|
+
return input.inferred;
|
|
22
|
+
}
|
|
23
|
+
function resolveThreadId(input) {
|
|
24
|
+
if (input.value !== void 0 && input.value.length > 0) return input.value;
|
|
25
|
+
const fromEnv = input.env.T3CODE_THREAD_ID;
|
|
26
|
+
if (fromEnv !== void 0 && fromEnv.length > 0) return fromEnv;
|
|
27
|
+
}
|
|
28
|
+
//#endregion
|
|
29
|
+
export { resolveWorktreePath as i, resolveProjectRef as n, resolveThreadId as r, resolveCommandProjectRef as t };
|
package/dist/scope.js
ADDED
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { n as Service } from "./Context-DueQ9iMH.js";
|
|
2
|
+
//#region src/config/service.ts
|
|
3
|
+
var T3Config = class extends Service()("t3cli/T3Config") {};
|
|
4
|
+
//#endregion
|
|
5
|
+
//#region src/environment/service.ts
|
|
6
|
+
var Environment = class extends Service()("t3cli/Environment") {};
|
|
7
|
+
//#endregion
|
|
8
|
+
export { T3Config as n, Environment as t };
|
|
@@ -87,7 +87,7 @@ export declare const makeT3Application: () => Effect.Effect<{
|
|
|
87
87
|
readonly hasPendingUserInput: boolean;
|
|
88
88
|
readonly hasActionableProposedPlan: boolean;
|
|
89
89
|
}[];
|
|
90
|
-
}, import("../rpc/error.ts").RpcError, never>;
|
|
90
|
+
}, import("../domain/error.ts").ProjectLookupError | import("../rpc/error.ts").RpcError, never>;
|
|
91
91
|
getThreadMessages: (threadId: string) => Effect.Effect<{
|
|
92
92
|
readonly id: string & import("effect/Brand").Brand<"ThreadId">;
|
|
93
93
|
readonly projectId: string & import("effect/Brand").Brand<"ProjectId">;
|
|
@@ -461,7 +461,7 @@ export declare const makeT3Application: () => Effect.Effect<{
|
|
|
461
461
|
readonly providerInstanceId?: (string & import("effect/Brand").Brand<"ProviderInstanceId">) | undefined;
|
|
462
462
|
} | null;
|
|
463
463
|
};
|
|
464
|
-
}, import("../domain/error.ts").ModelSelectionError | import("../domain/error.ts").ThreadSessionError | import("../rpc/error.ts").RpcError, never>;
|
|
464
|
+
}, import("../domain/error.ts").ProjectLookupError | import("../domain/error.ts").ModelSelectionError | import("../domain/error.ts").ThreadSessionError | import("../rpc/error.ts").RpcError, never>;
|
|
465
465
|
watchThread: (threadId: string) => import("effect/Stream").Stream<import("./service.ts").WaitEvent, import("../domain/error.ts").ThreadSessionError | import("../rpc/error.ts").RpcError, never>;
|
|
466
466
|
waitForThread: (threadId: string) => Effect.Effect<{
|
|
467
467
|
readonly id: string & import("effect/Brand").Brand<"ThreadId">;
|
|
@@ -772,5 +772,5 @@ export declare const makeT3Application: () => Effect.Effect<{
|
|
|
772
772
|
readonly output: string | null;
|
|
773
773
|
};
|
|
774
774
|
}[], import("../rpc/error.ts").RpcError, never>;
|
|
775
|
-
}, never, import("../
|
|
776
|
-
export declare const T3ApplicationLive: Layer.Layer<T3Application, never, import("../
|
|
775
|
+
}, never, import("../orchestration/service.ts").T3Orchestration | import("../environment/service.ts").Environment | import("effect/Path").Path | import("effect/Crypto").Crypto>;
|
|
776
|
+
export declare const T3ApplicationLive: Layer.Layer<T3Application, never, import("../orchestration/service.ts").T3Orchestration | import("../environment/service.ts").Environment | import("effect/Path").Path | import("effect/Crypto").Crypto>;
|
|
@@ -133,4 +133,4 @@ export declare const makeProjectApplication: () => Effect.Effect<{
|
|
|
133
133
|
} | null | undefined;
|
|
134
134
|
};
|
|
135
135
|
}, ProjectCreateVisibilityError | import("../rpc/error.ts").RpcError, never>;
|
|
136
|
-
}, never, Environment | Path.Path | Crypto.Crypto
|
|
136
|
+
}, never, T3Orchestration | Environment | Path.Path | Crypto.Crypto>;
|
|
@@ -4,7 +4,7 @@ import type * as Stream from "effect/Stream";
|
|
|
4
4
|
import type { DispatchResult, ModelSelection, OrchestrationMessage, OrchestrationProjectShell, OrchestrationShellSnapshot, OrchestrationThread, OrchestrationThreadShell, ServerProvider } from "#t3tools/contracts";
|
|
5
5
|
import type { ApplicationError } from "./error.ts";
|
|
6
6
|
export type StartThreadInput = {
|
|
7
|
-
readonly projectRef
|
|
7
|
+
readonly projectRef?: string;
|
|
8
8
|
readonly message: string;
|
|
9
9
|
readonly title?: string;
|
|
10
10
|
readonly provider?: string;
|
|
@@ -3,7 +3,7 @@ import * as Effect from "effect/Effect";
|
|
|
3
3
|
import * as Path from "effect/Path";
|
|
4
4
|
import { Environment } from "../environment/service.ts";
|
|
5
5
|
import { T3Orchestration } from "../orchestration/service.ts";
|
|
6
|
-
import { ThreadSessionError } from "../domain/error.ts";
|
|
6
|
+
import { ProjectLookupError, ThreadSessionError } from "../domain/error.ts";
|
|
7
7
|
import { type StartThreadInput } from "./service.ts";
|
|
8
8
|
import type { SendThreadInput } from "./service.ts";
|
|
9
9
|
export declare const makeThreadApplication: () => Effect.Effect<{
|
|
@@ -92,7 +92,7 @@ export declare const makeThreadApplication: () => Effect.Effect<{
|
|
|
92
92
|
readonly hasPendingUserInput: boolean;
|
|
93
93
|
readonly hasActionableProposedPlan: boolean;
|
|
94
94
|
}[];
|
|
95
|
-
}, import("../rpc/error.ts").RpcError, never>;
|
|
95
|
+
}, ProjectLookupError | import("../rpc/error.ts").RpcError, never>;
|
|
96
96
|
getThreadMessages: (threadId: string) => Effect.Effect<{
|
|
97
97
|
readonly id: string & import("effect/Brand").Brand<"ThreadId">;
|
|
98
98
|
readonly projectId: string & import("effect/Brand").Brand<"ProjectId">;
|
|
@@ -466,7 +466,7 @@ export declare const makeThreadApplication: () => Effect.Effect<{
|
|
|
466
466
|
readonly providerInstanceId?: (string & import("effect/Brand").Brand<"ProviderInstanceId">) | undefined;
|
|
467
467
|
} | null;
|
|
468
468
|
};
|
|
469
|
-
}, import("../domain/error.ts").ModelSelectionError | ThreadSessionError | import("../rpc/error.ts").RpcError, never>;
|
|
469
|
+
}, ProjectLookupError | import("../domain/error.ts").ModelSelectionError | ThreadSessionError | import("../rpc/error.ts").RpcError, never>;
|
|
470
470
|
watchThread: (threadId: string) => import("effect/Stream").Stream<import("./service.ts").WaitEvent, ThreadSessionError | import("../rpc/error.ts").RpcError, never>;
|
|
471
471
|
waitForThread: (threadId: string) => Effect.Effect<{
|
|
472
472
|
readonly id: string & import("effect/Brand").Brand<"ThreadId">;
|
|
@@ -560,4 +560,4 @@ export declare const makeThreadApplication: () => Effect.Effect<{
|
|
|
560
560
|
readonly providerInstanceId?: (string & import("effect/Brand").Brand<"ProviderInstanceId">) | undefined;
|
|
561
561
|
} | null;
|
|
562
562
|
}, ThreadSessionError | import("../rpc/error.ts").RpcError, never>;
|
|
563
|
-
}, never, Environment | Path.Path | Crypto.Crypto
|
|
563
|
+
}, never, T3Orchestration | Environment | Path.Path | Crypto.Crypto>;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
export { T3Auth } from "./service.ts";
|
|
2
|
+
export { T3AuthLive, makeT3Auth } from "./layer.ts";
|
|
3
|
+
export { T3LocalAuth, T3LocalAuthLive, makeT3LocalAuth } from "./local.ts";
|
|
4
|
+
export { T3LocalAuthOrigin, T3LocalAuthOriginLive, makeT3LocalAuthOrigin } from "./local-origin.ts";
|
|
5
|
+
export { T3LocalAuthToken, T3LocalAuthTokenLive, makeT3LocalAuthToken } from "./local-token.ts";
|
|
6
|
+
export { T3AuthPairing, T3AuthPairingLive, makeT3AuthPairing, parsePairingUrl } from "./pairing.ts";
|
|
7
|
+
export { AuthConfigError, AuthLocalDatabaseError, AuthLocalError, AuthLocalSecretError, AuthLocalSigningError, AuthPairingUrlError, AuthTransportError, } from "./error.ts";
|
|
8
|
+
export type { AuthError } from "./error.ts";
|
|
9
|
+
export type { AuthSessionState, AuthWebSocketTicketResult } from "./schema.ts";
|
|
10
|
+
export type { AuthConfigInput, AuthSessionRole, LocalAuthInput, LocalAuthOriginInput, LocalAuthResult, LocalAuthTokenInput, LocalAuthTokenResult, PairingUrl, PairResult, } from "./type.ts";
|
|
@@ -1,7 +1,5 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
export declare
|
|
4
|
-
readonly baseDir
|
|
5
|
-
|
|
6
|
-
readonly path: Path.Path;
|
|
7
|
-
}): string;
|
|
1
|
+
import * as Effect from "effect/Effect";
|
|
2
|
+
import { Environment } from "../environment/service.ts";
|
|
3
|
+
export declare const resolveLocalBaseDir: (input: {
|
|
4
|
+
readonly baseDir?: string | undefined;
|
|
5
|
+
}) => Effect.Effect<string, never, Environment | import("effect/Path").Path>;
|
|
@@ -21,6 +21,6 @@ export declare const makeT3LocalAuthToken: () => Effect.Effect<{
|
|
|
21
21
|
source: "local";
|
|
22
22
|
baseDir: string;
|
|
23
23
|
}, AuthLocalError, never>;
|
|
24
|
-
}, never, Environment | Path.Path | FileSystem.FileSystem | SqlClientFactory
|
|
25
|
-
export declare const T3LocalAuthTokenLive: Layer.Layer<T3LocalAuthToken, never, Environment | Path.Path | FileSystem.FileSystem | SqlClientFactory
|
|
24
|
+
}, never, Environment | Path.Path | Crypto.Crypto | FileSystem.FileSystem | SqlClientFactory>;
|
|
25
|
+
export declare const T3LocalAuthTokenLive: Layer.Layer<T3LocalAuthToken, never, Environment | Path.Path | Crypto.Crypto | FileSystem.FileSystem | SqlClientFactory>;
|
|
26
26
|
export {};
|
package/dist/src/auth/type.d.ts
CHANGED
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { Flag } from "effect/unstable/cli";
|
|
2
|
+
export declare const projectFlag: Flag.Flag<import("effect/Option").Option<string>>;
|
|
3
|
+
export declare const threadFlag: Flag.Flag<import("effect/Option").Option<string>>;
|
|
4
|
+
export declare const worktreeFlag: Flag.Flag<import("effect/Option").Option<string>>;
|
|
5
|
+
export declare const projectPathFlag: Flag.Flag<string>;
|
|
6
|
+
export declare const formatFlag: Flag.Flag<"auto" | "human" | "json">;
|
|
7
|
+
export declare const threadFormatFlag: Flag.Flag<"auto" | "human" | "json" | "ndjson">;
|
|
8
|
+
export declare const waitFormatFlag: Flag.Flag<"auto" | "human" | "ndjson">;
|
|
9
|
+
export declare const modelFlags: {
|
|
10
|
+
readonly option: Flag.Flag<import("effect/Option").Option<Record<string, string>>>;
|
|
11
|
+
readonly reasoningEffort: Flag.Flag<import("effect/Option").Option<string>>;
|
|
12
|
+
readonly effort: Flag.Flag<import("effect/Option").Option<string>>;
|
|
13
|
+
readonly fastMode: Flag.Flag<import("effect/Option").Option<boolean>>;
|
|
14
|
+
readonly thinking: Flag.Flag<import("effect/Option").Option<boolean>>;
|
|
15
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { formatFlag, modelFlags, projectFlag, projectPathFlag, threadFlag, threadFormatFlag, waitFormatFlag, worktreeFlag, } from "./flags.ts";
|
|
@@ -0,0 +1,9 @@
|
|
|
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;
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
export { T3Config } from "./service.ts";
|
|
2
|
+
export type { ResolvedConfig, StoredConfig } from "./service.ts";
|
|
3
|
+
export { T3ConfigLive, makeT3Config } from "./layer.ts";
|
|
4
|
+
export { ConfigError, UrlError } from "./error.ts";
|
|
5
|
+
export type { ConfigServiceError } from "./error.ts";
|
|
@@ -9,12 +9,14 @@ export declare const makeT3Config: () => Effect.Effect<{
|
|
|
9
9
|
readStored: () => Effect.Effect<{
|
|
10
10
|
readonly url?: string;
|
|
11
11
|
readonly token?: string;
|
|
12
|
+
readonly local?: boolean;
|
|
12
13
|
}, ConfigError, never>;
|
|
13
14
|
writeStored: (config: StoredConfig) => Effect.Effect<void, ConfigError, never>;
|
|
14
15
|
resolve: () => Effect.Effect<{
|
|
15
16
|
url: string;
|
|
16
17
|
token: string;
|
|
17
18
|
source: "config" | "env";
|
|
19
|
+
local: boolean;
|
|
18
20
|
}, import("./error.ts").UrlError | ConfigError, never>;
|
|
19
21
|
}, never, Environment | Path.Path | FileSystem.FileSystem>;
|
|
20
22
|
export declare const T3ConfigLive: Layer.Layer<T3Config, never, Environment | Path.Path | FileSystem.FileSystem>;
|
|
@@ -4,11 +4,13 @@ import type { ConfigError, ConfigServiceError } from "./error.ts";
|
|
|
4
4
|
export type StoredConfig = {
|
|
5
5
|
readonly url?: string;
|
|
6
6
|
readonly token?: string;
|
|
7
|
+
readonly local?: boolean;
|
|
7
8
|
};
|
|
8
9
|
export type ResolvedConfig = {
|
|
9
10
|
readonly url: string;
|
|
10
11
|
readonly token: string;
|
|
11
12
|
readonly source: "env" | "config";
|
|
13
|
+
readonly local: boolean;
|
|
12
14
|
};
|
|
13
15
|
declare const T3Config_base: Context.ServiceClass<T3Config, "t3cli/T3Config", {
|
|
14
16
|
readonly readStored: () => Effect.Effect<StoredConfig, ConfigError>;
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
export { T3CodeConnectionError } from "./error.ts";
|
|
2
|
+
export { T3CodeRpcLayer, makeT3CodeRpcLayer } from "./layer.ts";
|
|
3
|
+
export { T3CodeNodeRpcLayer } from "./node.ts";
|
|
4
|
+
export { T3CodeConnectionProvider, T3CodeConnectionProviderLive, makeT3CodeConnectionProvider, } from "./service.ts";
|
|
5
|
+
export type { T3CodeAuth, T3CodeConnection, T3CodeOrigin } from "./type.ts";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export type { OrchestrationMessage, OrchestrationProjectShell, OrchestrationShellSnapshot, OrchestrationThread, OrchestrationThreadShell, ServerProvider, } from "#t3tools/contracts";
|
|
@@ -1,38 +1,170 @@
|
|
|
1
|
-
import
|
|
1
|
+
import * as Effect from "effect/Effect";
|
|
2
|
+
import * as Path from "effect/Path";
|
|
2
3
|
import type { OrchestrationProjectShell, OrchestrationShellSnapshot } from "#t3tools/contracts";
|
|
3
|
-
export
|
|
4
|
-
readonly
|
|
5
|
-
readonly
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
readonly
|
|
4
|
+
export type ResolvedProjectScope = {
|
|
5
|
+
readonly project: OrchestrationProjectShell;
|
|
6
|
+
readonly inferredWorktreePath?: string;
|
|
7
|
+
};
|
|
8
|
+
export declare const resolveProjectScope: (snapshot: {
|
|
9
|
+
readonly snapshotSequence: number;
|
|
10
|
+
readonly projects: readonly {
|
|
11
|
+
readonly id: string & import("effect/Brand").Brand<"ProjectId">;
|
|
12
|
+
readonly title: string;
|
|
13
|
+
readonly workspaceRoot: string;
|
|
14
|
+
readonly defaultModelSelection: {
|
|
15
|
+
readonly instanceId: string & import("effect/Brand").Brand<"ProviderInstanceId">;
|
|
16
|
+
readonly model: string;
|
|
17
|
+
readonly options?: readonly {
|
|
18
|
+
readonly id: string;
|
|
19
|
+
readonly value: string | boolean;
|
|
20
|
+
}[];
|
|
21
|
+
} | null;
|
|
22
|
+
readonly scripts: readonly {
|
|
11
23
|
readonly id: string;
|
|
12
|
-
readonly
|
|
24
|
+
readonly name: string;
|
|
25
|
+
readonly command: string;
|
|
26
|
+
readonly icon: "play" | "test" | "lint" | "configure" | "build" | "debug";
|
|
27
|
+
readonly runOnWorktreeCreate: boolean;
|
|
13
28
|
}[];
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
readonly
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
29
|
+
readonly createdAt: string;
|
|
30
|
+
readonly updatedAt: string;
|
|
31
|
+
readonly repositoryIdentity?: {
|
|
32
|
+
readonly canonicalKey: string;
|
|
33
|
+
readonly locator: {
|
|
34
|
+
readonly source: "git-remote";
|
|
35
|
+
readonly remoteName: string;
|
|
36
|
+
readonly remoteUrl: string;
|
|
37
|
+
};
|
|
38
|
+
readonly rootPath?: string;
|
|
39
|
+
readonly displayName?: string;
|
|
40
|
+
readonly provider?: string;
|
|
41
|
+
readonly owner?: string;
|
|
42
|
+
readonly name?: string;
|
|
43
|
+
} | null | undefined;
|
|
21
44
|
}[];
|
|
22
|
-
readonly
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
readonly
|
|
26
|
-
readonly
|
|
27
|
-
readonly
|
|
28
|
-
readonly
|
|
29
|
-
readonly
|
|
45
|
+
readonly threads: readonly {
|
|
46
|
+
readonly id: string & import("effect/Brand").Brand<"ThreadId">;
|
|
47
|
+
readonly projectId: string & import("effect/Brand").Brand<"ProjectId">;
|
|
48
|
+
readonly title: string;
|
|
49
|
+
readonly modelSelection: {
|
|
50
|
+
readonly instanceId: string & import("effect/Brand").Brand<"ProviderInstanceId">;
|
|
51
|
+
readonly model: string;
|
|
52
|
+
readonly options?: readonly {
|
|
53
|
+
readonly id: string;
|
|
54
|
+
readonly value: string | boolean;
|
|
55
|
+
}[];
|
|
30
56
|
};
|
|
31
|
-
readonly
|
|
32
|
-
readonly
|
|
33
|
-
readonly
|
|
34
|
-
readonly
|
|
35
|
-
readonly
|
|
36
|
-
|
|
37
|
-
|
|
57
|
+
readonly runtimeMode: "approval-required" | "auto-accept-edits" | "full-access";
|
|
58
|
+
readonly interactionMode: "default" | "plan";
|
|
59
|
+
readonly branch: string | null;
|
|
60
|
+
readonly worktreePath: string | null;
|
|
61
|
+
readonly latestTurn: {
|
|
62
|
+
readonly turnId: string & import("effect/Brand").Brand<"TurnId">;
|
|
63
|
+
readonly state: "error" | "running" | "interrupted" | "completed";
|
|
64
|
+
readonly requestedAt: string;
|
|
65
|
+
readonly startedAt: string | null;
|
|
66
|
+
readonly completedAt: string | null;
|
|
67
|
+
readonly assistantMessageId: (string & import("effect/Brand").Brand<"MessageId">) | null;
|
|
68
|
+
readonly sourceProposedPlan?: {
|
|
69
|
+
readonly threadId: string & import("effect/Brand").Brand<"ThreadId">;
|
|
70
|
+
readonly planId: string;
|
|
71
|
+
} | undefined;
|
|
72
|
+
} | null;
|
|
73
|
+
readonly createdAt: string;
|
|
74
|
+
readonly updatedAt: string;
|
|
75
|
+
readonly archivedAt: string | null;
|
|
76
|
+
readonly session: {
|
|
77
|
+
readonly threadId: string & import("effect/Brand").Brand<"ThreadId">;
|
|
78
|
+
readonly status: "error" | "idle" | "starting" | "running" | "ready" | "interrupted" | "stopped";
|
|
79
|
+
readonly providerName: string | null;
|
|
80
|
+
readonly runtimeMode: "approval-required" | "auto-accept-edits" | "full-access";
|
|
81
|
+
readonly activeTurnId: (string & import("effect/Brand").Brand<"TurnId">) | null;
|
|
82
|
+
readonly lastError: string | null;
|
|
83
|
+
readonly updatedAt: string;
|
|
84
|
+
readonly providerInstanceId?: (string & import("effect/Brand").Brand<"ProviderInstanceId">) | undefined;
|
|
85
|
+
} | null;
|
|
86
|
+
readonly latestUserMessageAt: string | null;
|
|
87
|
+
readonly hasPendingApprovals: boolean;
|
|
88
|
+
readonly hasPendingUserInput: boolean;
|
|
89
|
+
readonly hasActionableProposedPlan: boolean;
|
|
90
|
+
}[];
|
|
91
|
+
readonly updatedAt: string;
|
|
92
|
+
}, input: {
|
|
93
|
+
readonly ref: string;
|
|
94
|
+
readonly cwd: string;
|
|
95
|
+
}) => Effect.Effect<{
|
|
96
|
+
project: {
|
|
97
|
+
readonly id: string & import("effect/Brand").Brand<"ProjectId">;
|
|
98
|
+
readonly title: string;
|
|
99
|
+
readonly workspaceRoot: string;
|
|
100
|
+
readonly defaultModelSelection: {
|
|
101
|
+
readonly instanceId: string & import("effect/Brand").Brand<"ProviderInstanceId">;
|
|
102
|
+
readonly model: string;
|
|
103
|
+
readonly options?: readonly {
|
|
104
|
+
readonly id: string;
|
|
105
|
+
readonly value: string | boolean;
|
|
106
|
+
}[];
|
|
107
|
+
} | null;
|
|
108
|
+
readonly scripts: readonly {
|
|
109
|
+
readonly id: string;
|
|
110
|
+
readonly name: string;
|
|
111
|
+
readonly command: string;
|
|
112
|
+
readonly icon: "play" | "test" | "lint" | "configure" | "build" | "debug";
|
|
113
|
+
readonly runOnWorktreeCreate: boolean;
|
|
114
|
+
}[];
|
|
115
|
+
readonly createdAt: string;
|
|
116
|
+
readonly updatedAt: string;
|
|
117
|
+
readonly repositoryIdentity?: {
|
|
118
|
+
readonly canonicalKey: string;
|
|
119
|
+
readonly locator: {
|
|
120
|
+
readonly source: "git-remote";
|
|
121
|
+
readonly remoteName: string;
|
|
122
|
+
readonly remoteUrl: string;
|
|
123
|
+
};
|
|
124
|
+
readonly rootPath?: string;
|
|
125
|
+
readonly displayName?: string;
|
|
126
|
+
readonly provider?: string;
|
|
127
|
+
readonly owner?: string;
|
|
128
|
+
readonly name?: string;
|
|
129
|
+
} | null | undefined;
|
|
130
|
+
};
|
|
131
|
+
inferredWorktreePath?: never;
|
|
132
|
+
} | {
|
|
133
|
+
project: {
|
|
134
|
+
readonly id: string & import("effect/Brand").Brand<"ProjectId">;
|
|
135
|
+
readonly title: string;
|
|
136
|
+
readonly workspaceRoot: string;
|
|
137
|
+
readonly defaultModelSelection: {
|
|
138
|
+
readonly instanceId: string & import("effect/Brand").Brand<"ProviderInstanceId">;
|
|
139
|
+
readonly model: string;
|
|
140
|
+
readonly options?: readonly {
|
|
141
|
+
readonly id: string;
|
|
142
|
+
readonly value: string | boolean;
|
|
143
|
+
}[];
|
|
144
|
+
} | null;
|
|
145
|
+
readonly scripts: readonly {
|
|
146
|
+
readonly id: string;
|
|
147
|
+
readonly name: string;
|
|
148
|
+
readonly command: string;
|
|
149
|
+
readonly icon: "play" | "test" | "lint" | "configure" | "build" | "debug";
|
|
150
|
+
readonly runOnWorktreeCreate: boolean;
|
|
151
|
+
}[];
|
|
152
|
+
readonly createdAt: string;
|
|
153
|
+
readonly updatedAt: string;
|
|
154
|
+
readonly repositoryIdentity?: {
|
|
155
|
+
readonly canonicalKey: string;
|
|
156
|
+
readonly locator: {
|
|
157
|
+
readonly source: "git-remote";
|
|
158
|
+
readonly remoteName: string;
|
|
159
|
+
readonly remoteUrl: string;
|
|
160
|
+
};
|
|
161
|
+
readonly rootPath?: string;
|
|
162
|
+
readonly displayName?: string;
|
|
163
|
+
readonly provider?: string;
|
|
164
|
+
readonly owner?: string;
|
|
165
|
+
readonly name?: string;
|
|
166
|
+
} | null | undefined;
|
|
167
|
+
};
|
|
168
|
+
inferredWorktreePath: string;
|
|
169
|
+
} | undefined, never, Path.Path>;
|
|
38
170
|
export declare function findProjectById(snapshot: OrchestrationShellSnapshot, projectId: string): OrchestrationProjectShell | null;
|
package/dist/src/index.d.ts
CHANGED
|
@@ -1,28 +1,4 @@
|
|
|
1
|
-
export { T3Application } from "./application/
|
|
2
|
-
export type { SendThreadInput, StartThreadInput, StartThreadPolicy, WaitEvent, } from "./application/
|
|
3
|
-
export type { ApplicationError } from "./application/
|
|
4
|
-
export {
|
|
5
|
-
export { T3AuthLive, makeT3Auth } from "./auth/layer.ts";
|
|
6
|
-
export { T3LocalAuth, T3LocalAuthLive, makeT3LocalAuth } from "./auth/local.ts";
|
|
7
|
-
export { T3LocalAuthOrigin, T3LocalAuthOriginLive, makeT3LocalAuthOrigin, } from "./auth/local-origin.ts";
|
|
8
|
-
export { T3LocalAuthToken, T3LocalAuthTokenLive, makeT3LocalAuthToken, } from "./auth/local-token.ts";
|
|
9
|
-
export { T3AuthPairing, T3AuthPairingLive, makeT3AuthPairing, parsePairingUrl, } from "./auth/pairing.ts";
|
|
10
|
-
export { AuthConfigError, AuthLocalDatabaseError, AuthLocalError, AuthLocalSecretError, AuthLocalSigningError, AuthPairingUrlError, AuthTransportError, } from "./auth/error.ts";
|
|
11
|
-
export type { AuthError } from "./auth/error.ts";
|
|
12
|
-
export type { AuthSessionState, AuthWebSocketTicketResult } from "./auth/schema.ts";
|
|
13
|
-
export type { AuthConfigInput, AuthSessionRole, LocalAuthInput, LocalAuthOriginInput, LocalAuthResult, LocalAuthTokenInput, LocalAuthTokenResult, PairingUrl, PairResult, } from "./auth/type.ts";
|
|
14
|
-
export { T3Config } from "./config/service.ts";
|
|
15
|
-
export type { ResolvedConfig, StoredConfig } from "./config/service.ts";
|
|
16
|
-
export { T3ConfigLive, makeT3Config } from "./config/layer.ts";
|
|
17
|
-
export { ConfigError, UrlError } from "./config/error.ts";
|
|
18
|
-
export type { ConfigServiceError } from "./config/error.ts";
|
|
19
|
-
export { makeT3CodeConnectionProvider, makeT3CodeRpcLayer, T3CodeConnectionProvider, T3CodeConnectionProviderLive, T3CodeNodeRpcLayer, T3CodeRpcLayer, T3CodeConnectionError, } from "./connection.ts";
|
|
20
|
-
export type { T3CodeAuth, T3CodeConnection, T3CodeOrigin } from "./connection.ts";
|
|
21
|
-
export { Environment } from "./environment/service.ts";
|
|
22
|
-
export type { EnvironmentShape } from "./environment/service.ts";
|
|
23
|
-
export { NodeEnvironmentLive } from "./environment/layer.ts";
|
|
24
|
-
export { AppLayer, AuthAppLayer, T3AuthLayer, T3AuthPairingLayer, T3AuthTransportLayer, T3LocalAuthLayer, T3LocalAuthOriginLayer, T3LocalAuthTokenLayer, } from "./runtime.ts";
|
|
25
|
-
export { SqlClientFactory } from "./sql/service.ts";
|
|
26
|
-
export type { SqlClientFactoryShape, SqliteClientConfig } from "./sql/service.ts";
|
|
27
|
-
export { NodeSqlClientFactoryLive, NodeSqliteClientLive, makeNodeSqliteClient, } from "./sql/node-sqlite-client.ts";
|
|
28
|
-
export type { OrchestrationMessage, OrchestrationProjectShell, OrchestrationShellSnapshot, OrchestrationThread, OrchestrationThreadShell, ServerProvider, } from "#t3tools/contracts";
|
|
1
|
+
export { T3Application } from "./application/index.ts";
|
|
2
|
+
export type { SendThreadInput, StartThreadInput, StartThreadPolicy, WaitEvent, } from "./application/index.ts";
|
|
3
|
+
export type { ApplicationError } from "./application/index.ts";
|
|
4
|
+
export { AppLayer, AuthAppLayer } from "./runtime/index.ts";
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import * as Effect from "effect/Effect";
|
|
2
|
+
import * as Path from "effect/Path";
|
|
3
|
+
export type T3Layout = {
|
|
4
|
+
readonly cwd: string;
|
|
5
|
+
readonly homeDir: string;
|
|
6
|
+
readonly t3codeHome?: string | undefined;
|
|
7
|
+
};
|
|
8
|
+
export declare function readT3LayoutFromNodeProcess(): T3Layout;
|
|
9
|
+
export declare const resolveT3BaseDir: (input: {
|
|
10
|
+
readonly layout: T3Layout;
|
|
11
|
+
readonly baseDir?: string | undefined;
|
|
12
|
+
}) => Effect.Effect<string, never, Path.Path>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { readT3LayoutFromNodeProcess, resolveT3BaseDir, type T3Layout } from "./base-dir.ts";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { RpcError, type OrchestrationError } from "./error.ts";
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import * as Layer from "effect/Layer";
|
|
2
|
+
import { T3Config } from "../config/service.ts";
|
|
3
|
+
export declare const T3AuthTransportLayer: Layer.Layer<import("../auth/transport.ts").T3AuthTransport, never, never>;
|
|
4
|
+
export declare const T3LocalAuthOriginLayer: Layer.Layer<import("../auth/local-origin.ts").T3LocalAuthOrigin, never, import("../environment/service.ts").Environment | import("effect/Path").Path | import("effect/FileSystem").FileSystem>;
|
|
5
|
+
export declare const T3LocalAuthTokenLayer: Layer.Layer<import("../auth/local-token.ts").T3LocalAuthToken, never, import("../environment/service.ts").Environment | import("effect/Path").Path | import("effect/Crypto").Crypto | import("effect/FileSystem").FileSystem>;
|
|
6
|
+
export declare const T3LocalAuthLayer: Layer.Layer<import("../auth/local.ts").T3LocalAuth, never, import("../environment/service.ts").Environment | import("effect/Path").Path | import("effect/Crypto").Crypto | import("effect/FileSystem").FileSystem>;
|
|
7
|
+
export declare const T3AuthPairingLayer: Layer.Layer<import("../auth/pairing.ts").T3AuthPairing, never, never>;
|
|
8
|
+
export declare const T3AuthLayer: Layer.Layer<import("../auth/service.ts").T3Auth, never, import("../environment/service.ts").Environment | import("effect/Path").Path | import("effect/Crypto").Crypto | import("effect/FileSystem").FileSystem>;
|
|
9
|
+
export declare const T3OrchestrationLayer: Layer.Layer<import("../orchestration/service.ts").T3Orchestration, never, import("../environment/service.ts").Environment | import("effect/Path").Path | import("effect/FileSystem").FileSystem>;
|
|
10
|
+
export declare const AuthAppLayer: Layer.Layer<T3Config | import("../auth/service.ts").T3Auth, never, import("../environment/service.ts").Environment | import("effect/Path").Path | import("effect/Crypto").Crypto | import("effect/FileSystem").FileSystem>;
|
|
11
|
+
export declare const AppLayer: Layer.Layer<import("../index.ts").T3Application | import("../orchestration/service.ts").T3Orchestration | T3Config | import("../auth/service.ts").T3Auth | import("../rpc/service.ts").T3Rpc, never, import("../environment/service.ts").Environment | import("effect/Path").Path | import("effect/Crypto").Crypto | import("effect/FileSystem").FileSystem>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { resolveCommandProjectRef, resolveProjectRef, resolveThreadId, resolveWorktreePath, } from "./resolve.ts";
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
export declare function resolveProjectRef(input: {
|
|
2
|
+
readonly value: string | undefined;
|
|
3
|
+
readonly env: Readonly<Record<string, string | undefined>>;
|
|
4
|
+
}): string | undefined;
|
|
5
|
+
export declare function resolveCommandProjectRef(input: {
|
|
6
|
+
readonly value: string | undefined;
|
|
7
|
+
readonly env: Readonly<Record<string, string | undefined>>;
|
|
8
|
+
readonly cwd: string;
|
|
9
|
+
readonly isLocal?: boolean;
|
|
10
|
+
}): string | undefined;
|
|
11
|
+
export declare function resolveWorktreePath(input: {
|
|
12
|
+
readonly value: string | undefined;
|
|
13
|
+
readonly env: Readonly<Record<string, string | undefined>>;
|
|
14
|
+
readonly inferred?: string;
|
|
15
|
+
}): string | undefined;
|
|
16
|
+
export declare function resolveThreadId(input: {
|
|
17
|
+
readonly value: string | undefined;
|
|
18
|
+
readonly env: Readonly<Record<string, string | undefined>>;
|
|
19
|
+
}): string | undefined;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "#t3tools/contracts";
|