session-todo.ts 821 B

12345678910111213141516171819202122232425
  1. export * as SessionTodo from "./session-todo"
  2. import { Schema } from "effect"
  3. import { define, inventory } from "./event"
  4. import { SessionID } from "./session-id"
  5. export const Info = Schema.Struct({
  6. content: Schema.String.annotate({ description: "Brief description of the task" }),
  7. status: Schema.String.annotate({
  8. description: "Current status of the task: pending, in_progress, completed, cancelled",
  9. }),
  10. priority: Schema.String.annotate({
  11. description: "Priority level of the task: high, medium, low",
  12. }),
  13. }).annotate({ identifier: "Todo" })
  14. export interface Info extends Schema.Schema.Type<typeof Info> {}
  15. const Updated = define({
  16. type: "todo.updated",
  17. schema: {
  18. sessionID: SessionID,
  19. todos: Schema.Array(Info),
  20. },
  21. })
  22. export const Event = { Updated, Definitions: inventory(Updated) }