Skip to content

Commit 9791111

Browse files
juliusmarmingecodex
andcommitted
Resolve remaining TSGo suggestions
Co-authored-by: codex <[email protected]>
1 parent fbe1d62 commit 9791111

9 files changed

Lines changed: 276 additions & 289 deletions

File tree

‎apps/server/src/orchestration/http.ts‎

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -58,8 +58,10 @@ export const orchestrationSnapshotRouteLayer = HttpRouter.add(
5858
status: 200,
5959
});
6060
}).pipe(
61-
Effect.catchTag("OrchestrationDispatchCommandError", respondToOrchestrationHttpError),
62-
Effect.catchTag("OrchestrationGetSnapshotError", respondToOrchestrationHttpError),
61+
Effect.catchTags({
62+
OrchestrationDispatchCommandError: respondToOrchestrationHttpError,
63+
OrchestrationGetSnapshotError: respondToOrchestrationHttpError,
64+
}),
6365
),
6466
);
6567

‎apps/server/src/persistence/Layers/AuthSessions.ts‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ const AuthSessionDbRow = Schema.Struct({
4040
revokedAt: Schema.NullOr(Schema.DateTimeUtcFromString),
4141
});
4242

43-
function toAuthSessionRecord(row: typeof AuthSessionDbRow.Type): typeof AuthSessionRecord.Type {
43+
function toAuthSessionRecord(row: typeof AuthSessionDbRow.Type): AuthSessionRecord {
4444
return {
4545
sessionId: row.sessionId,
4646
subject: row.subject,

‎apps/server/src/provider/Layers/CursorAdapter.ts‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,7 @@ export interface CursorAdapterLiveOptions {
9797
* Selections are honored when `modelSelection.instanceId` matches this value.
9898
* Defaults to the legacy built-in instance id (`cursor`).
9999
*/
100-
readonly instanceId?: typeof ProviderInstanceId.Type;
100+
readonly instanceId?: ProviderInstanceId;
101101
/**
102102
* Optional per-session settings resolver. When provided the adapter yields
103103
* this effect at the start of every session and uses the result instead of

‎apps/server/src/provider/Layers/OpenCodeProvider.ts‎

Lines changed: 19 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -408,35 +408,25 @@ export const checkOpenCodeProviderStatus = Effect.fn("checkOpenCodeProviderStatu
408408
const inventoryExit = yield* Effect.exit(
409409
Effect.scoped(
410410
Effect.gen(function* () {
411-
const server = yield* openCodeRuntime
412-
.connectToOpenCodeServer({
413-
binaryPath: openCodeSettings.binaryPath,
414-
serverUrl: openCodeSettings.serverUrl,
415-
environment,
416-
})
417-
.pipe(
418-
Effect.mapError(
419-
(cause) =>
420-
new OpenCodeProbeError({ cause, detail: openCodeRuntimeErrorDetail(cause) }),
421-
),
422-
);
423-
return yield* openCodeRuntime
424-
.loadOpenCodeInventory(
425-
openCodeRuntime.createOpenCodeSdkClient({
426-
baseUrl: server.url,
427-
directory: cwd,
428-
...(isExternalServer && openCodeSettings.serverPassword
429-
? { serverPassword: openCodeSettings.serverPassword }
430-
: {}),
431-
}),
432-
)
433-
.pipe(
434-
Effect.mapError(
435-
(cause) =>
436-
new OpenCodeProbeError({ cause, detail: openCodeRuntimeErrorDetail(cause) }),
437-
),
438-
);
439-
}),
411+
const server = yield* openCodeRuntime.connectToOpenCodeServer({
412+
binaryPath: openCodeSettings.binaryPath,
413+
serverUrl: openCodeSettings.serverUrl,
414+
environment,
415+
});
416+
return yield* openCodeRuntime.loadOpenCodeInventory(
417+
openCodeRuntime.createOpenCodeSdkClient({
418+
baseUrl: server.url,
419+
directory: cwd,
420+
...(isExternalServer && openCodeSettings.serverPassword
421+
? { serverPassword: openCodeSettings.serverPassword }
422+
: {}),
423+
}),
424+
);
425+
}).pipe(
426+
Effect.mapError(
427+
(cause) => new OpenCodeProbeError({ cause, detail: openCodeRuntimeErrorDetail(cause) }),
428+
),
429+
),
440430
),
441431
);
442432
if (inventoryExit._tag === "Failure") {

‎packages/effect-acp/scripts/generate.ts‎

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -146,7 +146,7 @@ function collectSchemaEntries(
146146
return entries;
147147
}
148148

149-
function normalizeNullableTypes(value: typeof Schema.Json.Type): typeof Schema.Json.Type {
149+
function normalizeNullableTypes(value: Schema.Json): Schema.Json {
150150
if (Array.isArray(value)) {
151151
return value.map(normalizeNullableTypes);
152152
}
@@ -158,10 +158,7 @@ function normalizeNullableTypes(value: typeof Schema.Json.Type): typeof Schema.J
158158
key,
159159
normalizeNullableTypes(child),
160160
]);
161-
const normalizedObject = Object.fromEntries(normalizedEntries) as Record<
162-
string,
163-
typeof Schema.Json.Type
164-
>;
161+
const normalizedObject = Object.fromEntries(normalizedEntries) as Record<string, Schema.Json>;
165162
const typeValue = normalizedObject.type;
166163

167164
if (!Array.isArray(typeValue)) {
@@ -179,7 +176,7 @@ function normalizeNullableTypes(value: typeof Schema.Json.Type): typeof Schema.J
179176
}
180177
const nonNullType = nonNullTypes[0]!;
181178

182-
const nextObject: Record<string, typeof Schema.Json.Type> = {};
179+
const nextObject: Record<string, Schema.Json> = {};
183180
for (const [key, child] of Object.entries(normalizedObject)) {
184181
if (key !== "type") {
185182
nextObject[key] = child;

‎packages/effect-acp/src/protocol.ts‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,12 +29,12 @@ export type AcpIncomingNotification =
2929
| {
3030
readonly _tag: "SessionUpdate";
3131
readonly method: typeof CLIENT_METHODS.session_update;
32-
readonly params: typeof AcpSchema.SessionNotification.Type;
32+
readonly params: AcpSchema.SessionNotification;
3333
}
3434
| {
3535
readonly _tag: "ElicitationComplete";
3636
readonly method: typeof CLIENT_METHODS.session_elicitation_complete;
37-
readonly params: typeof AcpSchema.ElicitationCompleteNotification.Type;
37+
readonly params: AcpSchema.ElicitationCompleteNotification;
3838
}
3939
| {
4040
readonly _tag: "ExtNotification";

‎packages/effect-codex-app-server/scripts/generate.ts‎

Lines changed: 12 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ class GeneratorError extends Schema.TaggedErrorClass<GeneratorError>()("Generato
7070
}
7171
}
7272

73-
const ManualSchemas: Record<string, typeof Schema.Json.Type> = {
73+
const ManualSchemas: Record<string, Schema.Json> = {
7474
GetAuthStatusParams: {
7575
type: "object",
7676
title: "GetAuthStatusParams",
@@ -218,7 +218,7 @@ function collectSchemaEntries(
218218
return entries;
219219
}
220220

221-
function normalizeNullableTypes(value: typeof Schema.Json.Type): typeof Schema.Json.Type {
221+
function normalizeNullableTypes(value: Schema.Json): Schema.Json {
222222
if (Array.isArray(value)) {
223223
return value.map(normalizeNullableTypes);
224224
}
@@ -230,10 +230,7 @@ function normalizeNullableTypes(value: typeof Schema.Json.Type): typeof Schema.J
230230
key,
231231
normalizeNullableTypes(child),
232232
]);
233-
const normalizedObject = Object.fromEntries(normalizedEntries) as Record<
234-
string,
235-
typeof Schema.Json.Type
236-
>;
233+
const normalizedObject = Object.fromEntries(normalizedEntries) as Record<string, Schema.Json>;
237234
const typeValue = normalizedObject.type;
238235

239236
if (!Array.isArray(typeValue)) {
@@ -251,7 +248,7 @@ function normalizeNullableTypes(value: typeof Schema.Json.Type): typeof Schema.J
251248
}
252249
const nonNullType = nonNullTypes[0]!;
253250

254-
const nextObject: Record<string, typeof Schema.Json.Type> = {};
251+
const nextObject: Record<string, Schema.Json> = {};
255252
for (const [key, child] of Object.entries(normalizedObject)) {
256253
if (key !== "type") {
257254
nextObject[key] = child;
@@ -269,7 +266,7 @@ function normalizeNullableTypes(value: typeof Schema.Json.Type): typeof Schema.J
269266
};
270267
}
271268

272-
function stripNullDefaults(value: typeof Schema.Json.Type): typeof Schema.Json.Type {
269+
function stripNullDefaults(value: Schema.Json): Schema.Json {
273270
if (Array.isArray(value)) {
274271
return value.map(stripNullDefaults);
275272
}
@@ -281,7 +278,7 @@ function stripNullDefaults(value: typeof Schema.Json.Type): typeof Schema.Json.T
281278
Object.entries(value)
282279
.filter(([key, child]) => !(key === "default" && child === null))
283280
.map(([key, child]) => [key, stripNullDefaults(child)]),
284-
) as typeof Schema.Json.Type;
281+
) as Schema.Json;
285282
}
286283

287284
function toPascalCaseMethod(method: string) {
@@ -417,7 +414,7 @@ function renderSchemaMap(
417414
}
418415

419416
function renderSchemaTypeReference(schemaName: string) {
420-
return schemaName === "undefined" ? "undefined" : `typeof CodexSchema.${schemaName}.Type`;
417+
return schemaName === "undefined" ? "undefined" : `CodexSchema.${schemaName}`;
421418
}
422419

423420
function exportNameForPath(filePath: string): string {
@@ -468,11 +465,11 @@ function buildJsonSchemaFiles(
468465
}
469466

470467
function rewriteExternalRefs(
471-
value: typeof Schema.Json.Type,
468+
value: Schema.Json,
472469
localDefinitionNames: ReadonlyMap<string, string>,
473470
currentNamespace: string | undefined,
474471
exportNameByQualifiedName: ReadonlyMap<string, string>,
475-
): typeof Schema.Json.Type {
472+
): Schema.Json {
476473
if (Array.isArray(value)) {
477474
return value.map((entry) =>
478475
rewriteExternalRefs(entry, localDefinitionNames, currentNamespace, exportNameByQualifiedName),
@@ -522,7 +519,7 @@ function rewriteExternalRefs(
522519
),
523520
];
524521
}),
525-
) as typeof Schema.Json.Type;
522+
) as Schema.Json;
526523
}
527524

528525
const generateFiles = Effect.fn("generateFiles")(function* () {
@@ -543,7 +540,7 @@ const generateFiles = Effect.fn("generateFiles")(function* () {
543540
const exportNameByQualifiedName = new Map(
544541
jsonSchemaFiles.map((file) => [file.qualifiedName, file.exportName]),
545542
);
546-
const aggregateSchemas: Record<string, typeof Schema.Json.Type> = {};
543+
const aggregateSchemas: Record<string, Schema.Json> = {};
547544

548545
for (const file of jsonSchemaFiles) {
549546
const raw = yield* fetchText(file.downloadUrl);
@@ -568,7 +565,7 @@ const generateFiles = Effect.fn("generateFiles")(function* () {
568565
);
569566
}
570567

571-
const topLevelSchema: Record<string, typeof Schema.Json.Type> = {};
568+
const topLevelSchema: Record<string, Schema.Json> = {};
572569
for (const [key, value] of Object.entries(parsed)) {
573570
if (key !== "definitions") {
574571
topLevelSchema[key] = value;

0 commit comments

Comments
 (0)