The best way to control Claude Code, Codex and more from any computer or phone
Mirrored from https://github.com/Camo67/t3code.git
Synced Nov 24, 09:00 UTC
refactor(codex): keep app-server client internals private (#10035)
Julius Marminge committed
Sep 5, 2026 at 01:38 UTC
62e4ae400555e62a42d5cb401d744ba6dd0b401b
3 files changed
+10
-16
packages/effect-codex-app-server/src/_internal/shared.ts
+1
-1
@@ -5,7 +5,7 @@ import * as CodexError from "../errors.ts";
5
6
export const JsonRpcId = Schema.Union([Schema.Number, Schema.String]);
7
8
-export const JsonRpcError = Schema.Struct({
8
+const JsonRpcError = Schema.Struct({
9
code: Schema.Number,
10
message: Schema.String,
11
data: Schema.optional(Schema.Unknown),
packages/effect-codex-app-server/src/client.ts
+1
-6
@@ -84,7 +84,7 @@ type ServerNotificationHandler = (
84
payload: unknown,
85
) => Effect.Effect<void, CodexError.CodexAppServerError>;
86
87
-export const make = Effect.fn("effect-codex-app-server/CodexAppServerClient.make")(function* (
87
+const make = Effect.fn("effect-codex-app-server/CodexAppServerClient.make")(function* (
88
stdio: Stdio.Stdio,
89
options: CodexAppServerClientOptions = {},
90
terminationError?: Effect.Effect<CodexError.CodexAppServerError>,
@@ -250,11 +250,6 @@ export const make = Effect.fn("effect-codex-app-server/CodexAppServerClient.make
250
});
251
});
252
253
-export const layer = (
254
- stdio: Stdio.Stdio,
255
- options: CodexAppServerClientOptions = {},
256
-): Layer.Layer<CodexAppServerClient> => Layer.effect(CodexAppServerClient, make(stdio, options));
257
-
253
export const layerChildProcess = (
254
handle: ChildProcessSpawner.ChildProcessHandle,
255
options: CodexAppServerClientOptions = {},
packages/effect-codex-app-server/src/errors.ts
+8
-9
@@ -1,15 +1,15 @@
1
import * as Schema from "effect/Schema";
2
import type * as SchemaIssue from "effect/SchemaIssue";
3
4
-export const CodexAppServerRequestOperation = Schema.Literals([
4
+const CodexAppServerRequestOperation = Schema.Literals([
5
"decode-payload",
6
"encode-payload",
7
"handle-request",
8
"receive-response",
9
]);
10
-export type CodexAppServerRequestOperation = typeof CodexAppServerRequestOperation.Type;
10
+type CodexAppServerRequestOperation = typeof CodexAppServerRequestOperation.Type;
11
12
-export const CodexAppServerSchemaIssueKind = Schema.Literals([
12
+const CodexAppServerSchemaIssueKind = Schema.Literals([
13
"Filter",
14
"Encoding",
15
"Pointer",
@@ -22,9 +22,9 @@ export const CodexAppServerSchemaIssueKind = Schema.Literals([
22
"Forbidden",
23
"OneOf",
24
]);
25
-export type CodexAppServerSchemaIssueKind = typeof CodexAppServerSchemaIssueKind.Type;
25
+type CodexAppServerSchemaIssueKind = typeof CodexAppServerSchemaIssueKind.Type;
26
27
-export interface CodexAppServerSchemaIssueDiagnostics {
27
+interface CodexAppServerSchemaIssueDiagnostics {
28
readonly issueCount: number;
29
readonly issueKinds: ReadonlyArray<CodexAppServerSchemaIssueKind>;
30
readonly maximumPathDepth: number;
@@ -62,7 +62,7 @@ const schemaIssueDiagnostics = (root: SchemaIssue.Issue): CodexAppServerSchemaIs
62
};
63
};
64
65
-export const CodexAppServerPayloadKind = Schema.Literals([
65
+const CodexAppServerPayloadKind = Schema.Literals([
66
"null",
67
"array",
68
"string",
@@ -74,7 +74,7 @@ export const CodexAppServerPayloadKind = Schema.Literals([
74
"function",
75
"undefined",
76
]);
77
-export type CodexAppServerPayloadKind = typeof CodexAppServerPayloadKind.Type;
77
+type CodexAppServerPayloadKind = typeof CodexAppServerPayloadKind.Type;
78
79
const payloadKind = (payload: unknown): CodexAppServerPayloadKind => {
80
if (payload === null) return "null";
@@ -84,8 +84,7 @@ const payloadKind = (payload: unknown): CodexAppServerPayloadKind => {
84
85
const protocolMessageFields = ["id", "method", "params", "result", "error"] as const;
86
87
-export const CodexAppServerProtocolMessageField = Schema.Literals(protocolMessageFields);
88
-export type CodexAppServerProtocolMessageField = typeof CodexAppServerProtocolMessageField.Type;
87
+const CodexAppServerProtocolMessageField = Schema.Literals(protocolMessageFields);
88
89
export interface CodexAppServerRequestDiagnostics {
90
readonly method?: string;