Skip to content

fix(sessions): replace z.unknown() with typed sessionOutput schema#40

Open
Ysh204 wants to merge 1 commit into
tempoxyz:mainfrom
Ysh204:fix/session-output-schema
Open

fix(sessions): replace z.unknown() with typed sessionOutput schema#40
Ysh204 wants to merge 1 commit into
tempoxyz:mainfrom
Ysh204:fix/session-output-schema

Conversation

@Ysh204

@Ysh204 Ysh204 commented Jun 29, 2026

Copy link
Copy Markdown

Summary

Currently, sessionsListOutput defines session records as z.array(z.unknown()), so the generated schema exposed through --schema does not describe the structure of session objects.

This PR introduces a strongly typed sessionOutput Zod schema matching the objects returned by sessionItem() in src/commands/sessions.ts.

Changes

  • Add a typed sessionOutput schema covering:

    • channel_id
    • network
    • origin
    • symbol
    • deposit
    • spent
    • remaining
    • status
    • remaining_secs
    • created_at
    • last_used_at
  • Replace z.array(z.unknown()) with z.array(sessionOutput) in sessionsListOutput

  • Add a regression test verifying the generated schema exposes the expected session properties

Testing

pnpm test

Test Files  7 passed (7)
Tests       107 passed (107)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant