File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -159,15 +159,15 @@ Schema at source.
159159These are the highest-priority next targets. Each is a small, self-contained
160160schema module with a clear domain.
161161
162- - [ ] ` src/control-plane/schema.ts `
163- - [ ] ` src/permission/schema.ts `
164- - [ ] ` src/project/schema.ts `
162+ - [x ] ` src/control-plane/schema.ts `
163+ - [x ] ` src/permission/schema.ts `
164+ - [x ] ` src/project/schema.ts `
165165- [x] ` src/provider/schema.ts `
166- - [ ] ` src/pty/schema.ts `
167- - [ ] ` src/question/schema.ts `
168- - [ ] ` src/session/schema.ts `
169- - [ ] ` src/sync/schema.ts `
170- - [ ] ` src/tool/schema.ts `
166+ - [x ] ` src/pty/schema.ts `
167+ - [x ] ` src/question/schema.ts `
168+ - [x ] ` src/session/schema.ts `
169+ - [x ] ` src/sync/schema.ts `
170+ - [x ] ` src/tool/schema.ts `
171171
172172### Session domain
173173
Original file line number Diff line number Diff line change 11import { Schema } from "effect"
2- import z from "zod"
32
43import { Identifier } from "@/id/id"
5- import { ZodOverride } from "@/util/effect-zod"
4+ import { zod , ZodOverride } from "@/util/effect-zod"
65import { withStatics } from "@/util/schema"
76
87const workspaceIdSchema = Schema . String . annotate ( { [ ZodOverride ] : Identifier . schema ( "workspace" ) } ) . pipe (
@@ -14,6 +13,6 @@ export type WorkspaceID = typeof workspaceIdSchema.Type
1413export const WorkspaceID = workspaceIdSchema . pipe (
1514 withStatics ( ( schema : typeof workspaceIdSchema ) => ( {
1615 ascending : ( id ?: string ) => schema . make ( Identifier . ascending ( "workspace" , id ) ) ,
17- zod : Identifier . schema ( "workspace" ) . pipe ( z . custom < WorkspaceID > ( ) ) ,
16+ zod : zod ( schema ) ,
1817 } ) ) ,
1918)
Original file line number Diff line number Diff line change 11import { Schema } from "effect"
2- import z from "zod"
32
43import { Identifier } from "@/id/id"
5- import { ZodOverride } from "@/util/effect-zod"
4+ import { zod , ZodOverride } from "@/util/effect-zod"
65import { Newtype } from "@/util/schema"
76
87export class PermissionID extends Newtype < PermissionID > ( ) (
@@ -13,5 +12,5 @@ export class PermissionID extends Newtype<PermissionID>()(
1312 return this . make ( Identifier . ascending ( "permission" , id ) )
1413 }
1514
16- static readonly zod = Identifier . schema ( "permission" ) as unknown as z . ZodType < PermissionID >
15+ static readonly zod = zod ( this )
1716}
Original file line number Diff line number Diff line change 11import { Schema } from "effect"
2- import z from "zod"
32
3+ import { zod } from "@/util/effect-zod"
44import { withStatics } from "@/util/schema"
55
66const projectIdSchema = Schema . String . pipe ( Schema . brand ( "ProjectID" ) )
@@ -10,6 +10,6 @@ export type ProjectID = typeof projectIdSchema.Type
1010export const ProjectID = projectIdSchema . pipe (
1111 withStatics ( ( schema : typeof projectIdSchema ) => ( {
1212 global : schema . make ( "global" ) ,
13- zod : z . string ( ) . pipe ( z . custom < ProjectID > ( ) ) ,
13+ zod : zod ( schema ) ,
1414 } ) ) ,
1515)
Original file line number Diff line number Diff line change 11import { Schema } from "effect"
2- import z from "zod"
32
43import { Identifier } from "@/id/id"
5- import { ZodOverride } from "@/util/effect-zod"
4+ import { zod , ZodOverride } from "@/util/effect-zod"
65import { withStatics } from "@/util/schema"
76
87const ptyIdSchema = Schema . String . annotate ( { [ ZodOverride ] : Identifier . schema ( "pty" ) } ) . pipe ( Schema . brand ( "PtyID" ) )
@@ -12,6 +11,6 @@ export type PtyID = typeof ptyIdSchema.Type
1211export const PtyID = ptyIdSchema . pipe (
1312 withStatics ( ( schema : typeof ptyIdSchema ) => ( {
1413 ascending : ( id ?: string ) => schema . make ( Identifier . ascending ( "pty" , id ) ) ,
15- zod : Identifier . schema ( "pty" ) . pipe ( z . custom < PtyID > ( ) ) ,
14+ zod : zod ( schema ) ,
1615 } ) ) ,
1716)
Original file line number Diff line number Diff line change 11import { Schema } from "effect"
2- import z from "zod"
32
43import { Identifier } from "@/id/id"
5- import { ZodOverride } from "@/util/effect-zod"
4+ import { zod , ZodOverride } from "@/util/effect-zod"
65import { Newtype } from "@/util/schema"
76
87export class QuestionID extends Newtype < QuestionID > ( ) (
@@ -13,5 +12,5 @@ export class QuestionID extends Newtype<QuestionID>()(
1312 return this . make ( Identifier . ascending ( "question" , id ) )
1413 }
1514
16- static readonly zod = Identifier . schema ( "question" ) as unknown as z . ZodType < QuestionID >
15+ static readonly zod = zod ( this )
1716}
Original file line number Diff line number Diff line change 11import { Schema } from "effect"
2- import z from "zod"
32
43import { Identifier } from "@/id/id"
5- import { ZodOverride } from "@/util/effect-zod"
4+ import { zod , ZodOverride } from "@/util/effect-zod"
65import { withStatics } from "@/util/schema"
76
87export const SessionID = Schema . String . annotate ( { [ ZodOverride ] : Identifier . schema ( "session" ) } ) . pipe (
98 Schema . brand ( "SessionID" ) ,
109 withStatics ( ( s ) => ( {
1110 descending : ( id ?: string ) => s . make ( Identifier . descending ( "session" , id ) ) ,
12- zod : Identifier . schema ( "session" ) . pipe ( z . custom < Schema . Schema . Type < typeof s > > ( ) ) ,
11+ zod : zod ( s ) ,
1312 } ) ) ,
1413)
1514
@@ -19,7 +18,7 @@ export const MessageID = Schema.String.annotate({ [ZodOverride]: Identifier.sche
1918 Schema . brand ( "MessageID" ) ,
2019 withStatics ( ( s ) => ( {
2120 ascending : ( id ?: string ) => s . make ( Identifier . ascending ( "message" , id ) ) ,
22- zod : Identifier . schema ( "message" ) . pipe ( z . custom < Schema . Schema . Type < typeof s > > ( ) ) ,
21+ zod : zod ( s ) ,
2322 } ) ) ,
2423)
2524
@@ -29,7 +28,7 @@ export const PartID = Schema.String.annotate({ [ZodOverride]: Identifier.schema(
2928 Schema . brand ( "PartID" ) ,
3029 withStatics ( ( s ) => ( {
3130 ascending : ( id ?: string ) => s . make ( Identifier . ascending ( "part" , id ) ) ,
32- zod : Identifier . schema ( "part" ) . pipe ( z . custom < Schema . Schema . Type < typeof s > > ( ) ) ,
31+ zod : zod ( s ) ,
3332 } ) ) ,
3433)
3534
Original file line number Diff line number Diff line change 11import { Schema } from "effect"
2- import z from "zod"
32
43import { Identifier } from "@/id/id"
5- import { ZodOverride } from "@/util/effect-zod"
4+ import { zod , ZodOverride } from "@/util/effect-zod"
65import { withStatics } from "@/util/schema"
76
87export const EventID = Schema . String . annotate ( { [ ZodOverride ] : Identifier . schema ( "event" ) } ) . pipe (
98 Schema . brand ( "EventID" ) ,
109 withStatics ( ( s ) => ( {
1110 ascending : ( id ?: string ) => s . make ( Identifier . ascending ( "event" , id ) ) ,
12- zod : Identifier . schema ( "event" ) . pipe ( z . custom < Schema . Schema . Type < typeof s > > ( ) ) ,
11+ zod : zod ( s ) ,
1312 } ) ) ,
1413)
Original file line number Diff line number Diff line change 11import { Schema } from "effect"
2- import z from "zod"
32
43import { Identifier } from "@/id/id"
5- import { ZodOverride } from "@/util/effect-zod"
4+ import { zod , ZodOverride } from "@/util/effect-zod"
65import { withStatics } from "@/util/schema"
76
87const toolIdSchema = Schema . String . annotate ( { [ ZodOverride ] : Identifier . schema ( "tool" ) } ) . pipe ( Schema . brand ( "ToolID" ) )
@@ -12,6 +11,6 @@ export type ToolID = typeof toolIdSchema.Type
1211export const ToolID = toolIdSchema . pipe (
1312 withStatics ( ( schema : typeof toolIdSchema ) => ( {
1413 ascending : ( id ?: string ) => schema . make ( Identifier . ascending ( "tool" , id ) ) ,
15- zod : Identifier . schema ( "tool" ) . pipe ( z . custom < ToolID > ( ) ) ,
14+ zod : zod ( schema ) ,
1615 } ) ) ,
1716)
You can’t perform that action at this time.
0 commit comments