File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 11import { Schema } from "effect"
22
33import { Identifier } from "@/id/id"
4- import { zod } from "@opencode-ai/core/effect-zod"
54import { Newtype } from "@opencode-ai/core/schema"
65
76export class PermissionID extends Newtype < PermissionID > ( ) (
@@ -11,6 +10,4 @@ export class PermissionID extends Newtype<PermissionID>()(
1110 static ascending ( id ?: string ) : PermissionID {
1211 return this . make ( Identifier . ascending ( "permission" , id ) )
1312 }
14-
15- static readonly zod = zod ( this )
1613}
Original file line number Diff line number Diff line change 11import { Schema } from "effect"
22
3- import { zod } from "@opencode-ai/core/effect-zod"
43import { withStatics } from "@opencode-ai/core/schema"
54
65const projectIdSchema = Schema . String . pipe ( Schema . brand ( "ProjectID" ) )
@@ -10,6 +9,5 @@ export type ProjectID = typeof projectIdSchema.Type
109export const ProjectID = projectIdSchema . pipe (
1110 withStatics ( ( schema : typeof projectIdSchema ) => ( {
1211 global : schema . make ( "global" ) ,
13- zod : zod ( schema ) ,
1412 } ) ) ,
1513)
Original file line number Diff line number Diff line change 11import { Schema } from "effect"
22
33import { Identifier } from "@/id/id"
4- import { zod } from "@opencode-ai/core/effect-zod"
54import { withStatics } from "@opencode-ai/core/schema"
65
76const ptyIdSchema = Schema . String . check ( Schema . isStartsWith ( "pty" ) ) . pipe ( Schema . brand ( "PtyID" ) )
@@ -11,6 +10,5 @@ export type PtyID = typeof ptyIdSchema.Type
1110export const PtyID = ptyIdSchema . pipe (
1211 withStatics ( ( schema : typeof ptyIdSchema ) => ( {
1312 ascending : ( id ?: string ) => schema . make ( Identifier . ascending ( "pty" , id ) ) ,
14- zod : zod ( schema ) ,
1513 } ) ) ,
1614)
Original file line number Diff line number Diff line change 11import { Schema } from "effect"
22
33import { Identifier } from "@/id/id"
4- import { zod } from "@opencode-ai/core/effect-zod"
54import { Newtype } from "@opencode-ai/core/schema"
65
76export class QuestionID extends Newtype < QuestionID > ( ) ( "QuestionID" , Schema . String . check ( Schema . isStartsWith ( "que" ) ) ) {
87 static ascending ( id ?: string ) : QuestionID {
98 return this . make ( Identifier . ascending ( "question" , id ) )
109 }
11-
12- static readonly zod = zod ( this )
1310}
Original file line number Diff line number Diff line change 11import { Schema } from "effect"
22
33import { Identifier } from "@/id/id"
4- import { zod } from "@opencode-ai/core/effect-zod"
54import { withStatics } from "@opencode-ai/core/schema"
65
76export const EventID = Schema . String . check ( Schema . isStartsWith ( "evt" ) ) . pipe (
87 Schema . brand ( "EventID" ) ,
98 withStatics ( ( s ) => ( {
109 ascending : ( id ?: string ) => s . make ( Identifier . ascending ( "event" , id ) ) ,
11- zod : zod ( s ) ,
1210 } ) ) ,
1311)
Original file line number Diff line number Diff line change @@ -27,7 +27,7 @@ const sessionID = Schema.decodeUnknownSync(SessionID)("ses_01J5Y5H0AH4Q4NXJ6P4C3
2727const sessionIDChild = Schema . decodeUnknownSync ( SessionID ) ( "ses_01J5Y5H0AH4Q4NXJ6P4C3P5V2L" )
2828const messageID = Schema . decodeUnknownSync ( MessageID ) ( "msg_01J5Y5H0AH4Q4NXJ6P4C3P5V2M" )
2929const partID = Schema . decodeUnknownSync ( PartID ) ( "prt_01J5Y5H0AH4Q4NXJ6P4C3P5V2N" )
30- const projectID = ProjectID . zod . parse ( "proj-alpha" )
30+ const projectID = ProjectID . make ( "proj-alpha" )
3131const workspaceID = Schema . decodeUnknownSync ( WorkspaceID ) ( "wrk-primary" )
3232
3333function decodeUnknown < S extends Schema . Top > ( schema : S ) {
You can’t perform that action at this time.
0 commit comments