Skip to content

Commit b6c854d

Browse files
refactor(codex): keep app-server client internals private
1 parent eced382 commit b6c854d

3 files changed

Lines changed: 10 additions & 16 deletions

File tree

‎packages/effect-codex-app-server/src/_internal/shared.ts‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import * as CodexError from "../errors.ts";
55

66
export const JsonRpcId = Schema.Union([Schema.Number, Schema.String]);
77

8-
export const JsonRpcError = Schema.Struct({
8+
const JsonRpcError = Schema.Struct({
99
code: Schema.Number,
1010
message: Schema.String,
1111
data: Schema.optional(Schema.Unknown),

‎packages/effect-codex-app-server/src/client.ts‎

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ type ServerNotificationHandler = (
8484
payload: unknown,
8585
) => Effect.Effect<void, CodexError.CodexAppServerError>;
8686

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* (
8888
stdio: Stdio.Stdio,
8989
options: CodexAppServerClientOptions = {},
9090
terminationError?: Effect.Effect<CodexError.CodexAppServerError>,
@@ -250,11 +250,6 @@ export const make = Effect.fn("effect-codex-app-server/CodexAppServerClient.make
250250
});
251251
});
252252

253-
export const layer = (
254-
stdio: Stdio.Stdio,
255-
options: CodexAppServerClientOptions = {},
256-
): Layer.Layer<CodexAppServerClient> => Layer.effect(CodexAppServerClient, make(stdio, options));
257-
258253
export const layerChildProcess = (
259254
handle: ChildProcessSpawner.ChildProcessHandle,
260255
options: CodexAppServerClientOptions = {},

‎packages/effect-codex-app-server/src/errors.ts‎

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,15 @@
11
import * as Schema from "effect/Schema";
22
import type * as SchemaIssue from "effect/SchemaIssue";
33

4-
export const CodexAppServerRequestOperation = Schema.Literals([
4+
const CodexAppServerRequestOperation = Schema.Literals([
55
"decode-payload",
66
"encode-payload",
77
"handle-request",
88
"receive-response",
99
]);
10-
export type CodexAppServerRequestOperation = typeof CodexAppServerRequestOperation.Type;
10+
type CodexAppServerRequestOperation = typeof CodexAppServerRequestOperation.Type;
1111

12-
export const CodexAppServerSchemaIssueKind = Schema.Literals([
12+
const CodexAppServerSchemaIssueKind = Schema.Literals([
1313
"Filter",
1414
"Encoding",
1515
"Pointer",
@@ -22,9 +22,9 @@ export const CodexAppServerSchemaIssueKind = Schema.Literals([
2222
"Forbidden",
2323
"OneOf",
2424
]);
25-
export type CodexAppServerSchemaIssueKind = typeof CodexAppServerSchemaIssueKind.Type;
25+
type CodexAppServerSchemaIssueKind = typeof CodexAppServerSchemaIssueKind.Type;
2626

27-
export interface CodexAppServerSchemaIssueDiagnostics {
27+
interface CodexAppServerSchemaIssueDiagnostics {
2828
readonly issueCount: number;
2929
readonly issueKinds: ReadonlyArray<CodexAppServerSchemaIssueKind>;
3030
readonly maximumPathDepth: number;
@@ -62,7 +62,7 @@ const schemaIssueDiagnostics = (root: SchemaIssue.Issue): CodexAppServerSchemaIs
6262
};
6363
};
6464

65-
export const CodexAppServerPayloadKind = Schema.Literals([
65+
const CodexAppServerPayloadKind = Schema.Literals([
6666
"null",
6767
"array",
6868
"string",
@@ -74,7 +74,7 @@ export const CodexAppServerPayloadKind = Schema.Literals([
7474
"function",
7575
"undefined",
7676
]);
77-
export type CodexAppServerPayloadKind = typeof CodexAppServerPayloadKind.Type;
77+
type CodexAppServerPayloadKind = typeof CodexAppServerPayloadKind.Type;
7878

7979
const payloadKind = (payload: unknown): CodexAppServerPayloadKind => {
8080
if (payload === null) return "null";
@@ -84,8 +84,7 @@ const payloadKind = (payload: unknown): CodexAppServerPayloadKind => {
8484

8585
const protocolMessageFields = ["id", "method", "params", "result", "error"] as const;
8686

87-
export const CodexAppServerProtocolMessageField = Schema.Literals(protocolMessageFields);
88-
export type CodexAppServerProtocolMessageField = typeof CodexAppServerProtocolMessageField.Type;
87+
const CodexAppServerProtocolMessageField = Schema.Literals(protocolMessageFields);
8988

9089
export interface CodexAppServerRequestDiagnostics {
9190
readonly method?: string;

0 commit comments

Comments
 (0)