Skip to content

Define PromptSession data model with @dataclass for structured history tracking #63

@banagale

Description

@banagale

Description:
\ Python @dataclass models to formalize FileKitty's internal prompt state and history structure. These models replace the ad hoc history logic in the PyQt version and will form the basis for future JSON serialization and Swift interoperability.

In-scope models:

  • PromptComponent: represents text, file, or variable-based input
  • PromptDataBlock: used for structured file-related context (e.g. selected paths, summaries)
  • SessionState: captures a snapshot of prompt components and output
    • Includes output_text and output_token_estimate fields
  • PromptSession: holds session metadata, timeline of states, and undo/redo logic

Stub-only models (declared but unused in runtime):

  • PromptTemplate
  • PromptVariable
  • PromptExecution

Acceptance Criteria:

  • All models are defined in filekitty/core/history_model.py
  • Unit tests cover: push_state, undo, redo, current_state, JSON round-trip
  • PromptDataBlock is usable for representing file tree summaries
  • Stub models are clearly marked for future use and not referenced by core logic

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions