Skip to content

Releases

v0.1.0a8

Choose a tag to compare

@3lv27 3lv27 released this 04 Dec 12:04

Full Changelog: v0.1.0a7...v0.1.0a8

v0.1.0a7

Choose a tag to compare

@3lv27 3lv27 released this 04 Dec 11:56

Full Changelog: v0.1.0a6...v0.1.0a7

v0.1.0a6

Choose a tag to compare

@3lv27 3lv27 released this 15 Nov 18:05

Full Changelog: v0.1.0a5...v0.1.0a6

v0.1.0a5

Choose a tag to compare

@3lv27 3lv27 released this 15 Nov 11:45

Full Changelog: v0.1.0a4...v0.1.0a5

v0.1.0a4

Choose a tag to compare

@3lv27 3lv27 released this 14 Nov 12:45
fbafc74

What's Changed

Full Changelog: v0.1.0a3...v0.1.0a4

v0.1.0a3 - Type-Safe Phase Workflows with Auto-Rendering

Choose a tag to compare

@3lv27 3lv27 released this 12 Nov 12:28
2c014d6

🎯 v0.1.0a3 - Type-Safe Phase Workflows with Auto-Rendering

This release brings significant DX improvements to phase-based workflows, with full Enum support and automatic phase tracking.

🚀 What's New

Auto-Rendering with Current Phase

No more manual phase tracking! Context.render() now automatically uses the current phase from state:

# Before (v0.1.0a2)
ctx.render(phase=state.phase())  # Manual phase passing

# After (v0.1.0a3)
ctx.render()  # Automatic! ✨
Cleaner State Initialization
New current_phase parameter for cleaner state setup:
# Before
state = State(
    initial={"session": {"phase": "intake"}},
    phases=Phases
)

# After
state = State(current_phase="intake", phases=Phases)  # Much cleaner!
Full Enum Support for Type Safety
Complete Enum support across the entire phase API:
class Phases(str, Enum):
    INTAKE = "intake"
    ASSESSMENT = "assessment"

# Now works everywhere:
ctx.phase(Phases.INTAKE).configure(
    transitions_to=[Phases.ASSESSMENT]  # ✅ Type-safe!
)
ctx.advance_phase(Phases.ASSESSMENT)  # ✅ IDE autocomplete

✨ Key Features
✅ Auto-rendering: ctx.render() uses current phase automatically
✅ Type-safe transitions: transitions_to=[Phases.NEXT] with full Enum support
✅ Cleaner API: State(current_phase="init") instead of nested dicts
✅ Better validation: Immediate errors with actionable messages
✅ Backward compatible: Strings still work everywhere

🎨 Developer Experience
New method: ctx.current_phase() to check current phase
Enhanced validation: Clear error messages with fix suggestions
IDE support: Full autocomplete for Enum-based workflows
Token counting: ctx.token_count() respects current phase

🔧 Breaking Changes
Context.render() now auto-uses state.phase() when no phase specified:
Impact: Low - explicit phase= parameter still works
Migration: Remove manual phase=state.phase() calls (optional)

📦 What's Included
67 tests passing (14 new deep integration tests)
New examples:
multi_phase_workflow.py - Updated with Enum patterns
gemini_phase_workflow.py - Production-ready Gemini workflow
Validated formats: TEXT, OpenAI, Anthropic, Gemini (fully tested)

🧪 Production Ready
Comprehensive testing validates:
✅ All render formats (including Gemini generation_config)
✅ Phase transitions and validation
✅ Enum/string consistency
✅ Edge cases and error handling
✅ Memory integration
✅ Token counting with phases

📚 Examples
Basic Phase Workflow
from kontxt import Context, State, SystemPrompt, Format
from enum import Enum

class Phases(str, Enum):
    TRIAGE = "triage"
    RESOLUTION = "resolution"

# Initialize
state = State(current_phase=Phases.TRIAGE, phases=Phases)
ctx = Context(state=state)

# Configure
ctx.phase(Phases.TRIAGE).configure(
    instructions="Gather information",
    transitions_to=[Phases.RESOLUTION]  # Type-safe!
)

# Use
ctx.add_user_message("Help!")
payload = ctx.render(format=Format.GEMINI)  # Auto-uses TRIAGE phase

# Advance
ctx.advance_phase(Phases.RESOLUTION)  # Validated!

🔗 Resources
Full Changelog: [CHANGELOG.md](vscode-webview://17f13ik0iikphc9stt4ur2fr0gs0tsfttlvaki3376otqmgg1vj3/CHANGELOG.md)
Examples: [examples/](vscode-webview://17f13ik0iikphc9stt4ur2fr0gs0tsfttlvaki3376otqmgg1vj3/examples/)
Documentation: Coming soon

🙏 Feedback Welcome
This is an alpha release. Please report issues or suggestions!

v0.1.0a2 - Type Safety Fixes & CI Pipeline

Choose a tag to compare

@3lv27 3lv27 released this 12 Nov 10:42

v0.1.0a2 (2025-01-12)

Fixed

  • Type checking: Fixed all mypy type errors across the codebase
    • Fixed deepcopy type compatibility in State.__init__() (state.py:43)
    • Fixed return type annotations in BudgetManager.enforce() (budget.py)
    • Fixed type assignments in Context methods (context.py)
  • Linting: Auto-fixed 18 ruff linting errors (unused imports, f-strings without placeholders)
  • CI Pipeline: Added missing twine dependency and fixed build job configuration

Changed

  • CI/CD: Added uv sync --all-extras to build job to ensure dev dependencies are installed
  • Dependencies: Added twine>=5.0 to dev dependencies for package metadata validation

Internal

  • All 43 tests passing
  • Clean mypy type checking (0 errors)
  • Clean ruff linting (0 errors)
  • Package builds successfully and passes twine validation

This release focuses on code quality improvements and CI/CD reliability. No API changes or breaking changes from v0.1.0a1.