Get related types for a class #18

Open
opened 2026-01-05 21:14:51 +00:00 by mprihoda · 0 comments
mprihoda commented 2026-01-05 21:14:51 +00:00 (Migrated from github.com)

Problem

Agent understands one type but doesn't know the ecosystem around it:

  • What types are commonly used with ZIO?
  • What are the companion types for Resource?
  • What subtypes does this trait have?

Proposed Solution

{
  "name": "get_related_types",
  "description": "Find types related to a given class",
  "input": {
    "coordinates": "Maven/Coursier coordinates",
    "className": "Fully qualified class name",
    "scalaVersion": "optional"
  }
}

Example:

get_related_types("dev.zio::zio:2.1.0", "zio.ZIO")

Returns:

## Types Related to zio.ZIO

**Hierarchy:**
- Extends: Nothing
- Extended by: Task, UIO, RIO, URIO, IO

**Companion Types:**
- `ZLayer` - Dependency injection
- `ZStream` - Streaming variant
- `ZChannel` - Pull-based streams
- `Fiber` - Concurrent execution handle

**Commonly Used With:**
- `Runtime` - Execution environment
- `Scope` - Resource management
- `Exit` - Computation result
- `Cause` - Error representation

**Type Aliases:**
- `Task[A] = ZIO[Any, Throwable, A]`
- `UIO[A] = ZIO[Any, Nothing, A]`
- `RIO[R, A] = ZIO[R, Throwable, A]`

**Key Typeclasses:**
- `zio.Async[ZIO[R, E, _]]`
- `zio.Concurrent[ZIO[R, E, _]]`

Implementation

  • Parse inheritance from TASTy/Scaladoc
  • Analyze method signatures for commonly co-occurring types
  • Parse companion object for related factory methods
  • Look for type aliases in package

Value for Agent

  • Understands the "constellation" around a type
  • Knows what to look up next
  • Discovers type aliases (Task, UIO, etc.)

Acceptance Criteria

  • Show inheritance hierarchy (extends/extended by)
  • List companion types from same package
  • Show type aliases if present
  • Identify commonly used together types
## Problem Agent understands one type but doesn't know the ecosystem around it: - What types are commonly used with `ZIO`? - What are the companion types for `Resource`? - What subtypes does this trait have? ## Proposed Solution ### New Tool: `get_related_types` ```json { "name": "get_related_types", "description": "Find types related to a given class", "input": { "coordinates": "Maven/Coursier coordinates", "className": "Fully qualified class name", "scalaVersion": "optional" } } ``` **Example:** ``` get_related_types("dev.zio::zio:2.1.0", "zio.ZIO") ``` **Returns:** ```markdown ## Types Related to zio.ZIO **Hierarchy:** - Extends: Nothing - Extended by: Task, UIO, RIO, URIO, IO **Companion Types:** - `ZLayer` - Dependency injection - `ZStream` - Streaming variant - `ZChannel` - Pull-based streams - `Fiber` - Concurrent execution handle **Commonly Used With:** - `Runtime` - Execution environment - `Scope` - Resource management - `Exit` - Computation result - `Cause` - Error representation **Type Aliases:** - `Task[A] = ZIO[Any, Throwable, A]` - `UIO[A] = ZIO[Any, Nothing, A]` - `RIO[R, A] = ZIO[R, Throwable, A]` **Key Typeclasses:** - `zio.Async[ZIO[R, E, _]]` - `zio.Concurrent[ZIO[R, E, _]]` ``` ## Implementation - Parse inheritance from TASTy/Scaladoc - Analyze method signatures for commonly co-occurring types - Parse companion object for related factory methods - Look for type aliases in package ## Value for Agent - Understands the "constellation" around a type - Knows what to look up next - Discovers type aliases (Task, UIO, etc.) ## Acceptance Criteria - [ ] Show inheritance hierarchy (extends/extended by) - [ ] List companion types from same package - [ ] Show type aliases if present - [ ] Identify commonly used together types
Sign in to join this conversation.
No description provided.