Skip to content

Fixes to some wrong types definitions#5

Merged
javisperez merged 4 commits intomainfrom
fix-wrong-types
Mar 31, 2026
Merged

Fixes to some wrong types definitions#5
javisperez merged 4 commits intomainfrom
fix-wrong-types

Conversation

@javisperez
Copy link
Copy Markdown
Collaborator

This pull request refactors and unifies the TypeScript types for Kitfile artifact layers, introducing a new LayerBase interface to provide consistent path and description fields across all artifact types. The documentation and code are updated for clarity, extensibility, and improved type safety.

Type system improvements:

  • Introduced a new LayerBase interface that defines common fields (path and optional description) for all Kitfile artifact layer types, and updated all artifact interfaces (Model, Dataset, Code, Doc, Prompt) to extend this base for consistency. [1] [2] [3]

  • Refactored the Model, Dataset, Code, Doc, and Prompt interfaces to remove redundant fields and ensure they inherit shared properties from LayerBase. Added new optional fields (e.g., framework, version for Model) and updated the type of parameters for flexibility. [1] [2]

  • Updated the ModelPart interface to include an optional name property and removed unused fields for clarity. [1] [2]

Documentation updates:

  • Revised the docs/types.md documentation to describe the new LayerBase interface, show inheritance in artifact types, and update property tables for accuracy and completeness. [1] [2]

Internal type alignment:

  • Renamed LayerInfo to LayerIdentity for clarity, and updated internal Kitfile types to use the new naming and structure. Ensured that composite model parts (parts) are properly typed in internal representations.

Other:

  • Bumped the package version from 0.0.3 to 0.0.4 in package.json.

Signed-off-by: Javis Pérez <javis@jozu.com>
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR refactors the public Kitfile TypeScript types to unify shared layer fields via a new LayerBase interface, and updates the type documentation accordingly to improve consistency and extensibility.

Changes:

  • Introduces LayerBase and refactors Model, Dataset, Code, Doc, and Prompt to extend it.
  • Updates internal Kitfile layer identity naming (LayerInfoLayerIdentity) and adjusts model parts typing.
  • Updates docs/types.md and bumps package version to 0.0.4.

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 3 comments.

File Description
src/types/kitfile.ts Adds LayerBase, refactors layer interfaces, and renames internal layer identity type.
docs/types.md Documents LayerBase and updates Kitfile artifact type definitions/tables.
package.json Version bump to 0.0.4.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread src/types/kitfile.ts
Comment thread docs/types.md
Comment thread src/types/kitfile.ts Outdated
Signed-off-by: Javis Pérez <javis@jozu.com>
Signed-off-by: Javis Pérez <javis@jozu.com>
Copy link
Copy Markdown
Contributor

@amisevsk amisevsk left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM.

LayerBase is kind of a mixed abstraction, as technically not all layers include a description (modelpart layers), so it's introduced as a base interface for all layer types but then it's not used for modelpart layer types.

Signed-off-by: Javis Pérez <javis@jozu.com>
@javisperez javisperez merged commit 6002c08 into main Mar 31, 2026
2 checks passed
@javisperez javisperez deleted the fix-wrong-types branch March 31, 2026 15:57
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.

3 participants