4.3 KiB
4.3 KiB
Internal Component Overview
Purpose
This document inventories Promptkit's implemented components for contributors. The architecture policy owns durable boundary and dependency rules. See the development guide for contributor workflow and validation.
Implemented Components
| Component | Implemented responsibility | References |
|---|---|---|
Root promptkit package |
Provides the supported engine facade, source and injection options, public request and result values, built-in profile construction, extension interfaces, value conversion, redacted formatting, and public error mapping. | Package GoDoc, engine assembly |
examples/go-library/prepare |
Demonstrates an offline downstream consumer using a prompt file, in-memory profile, inline input, and Prepare. It is not a public library package. |
Example program |
examples/go-library/run |
Demonstrates an offline downstream consumer using a prompt file, in-memory profile, inline input, an injected deterministic model client, and Run. It is not a public library package. |
Example program |
internal/backend |
Validates and defensively copies immutable OpenAI-compatible backend definitions, supplies the built-in OpenRouter definition, and owns the shared reserved request-field rule. | Backend registry |
internal/domain |
Defines internal framework values for requests, artifacts, prompt definitions, profiles, execution targets, rendering, generation, and validation. | Domain declarations |
internal/defaults |
Defines application-neutral framework constants and constructs the default execution target. It contains no CLI, server, or inbound HTTP limits. | Framework defaults |
internal/filecatalog |
Provides deterministic YAML discovery and path helpers for operating-system filesystems and fs.FS sources. |
File catalog |
internal/promptdef |
Loads strictly decoded, validated prompt definitions from filesystem and fs.FS sources, including version selection and contained file-backed message content. |
Framework formats, prompt-definition repository |
internal/profile |
Loads strictly decoded, validated execution profiles from filesystem and fs.FS sources and composes repositories with error-preserving fallback. |
Framework formats, profile repositories |
internal/profile/builtin |
Embeds the built-in execution profile catalog and combines it with an optional primary repository. | Built-in catalog, repository |
internal/prompt |
Renders prompt messages from Go templates with artifact, variable, session, and cache-control data. | Go-template renderer |
internal/artifact |
Resolves ordinary inline and unrestricted caller-selected file references into copied artifacts with metadata and hashes. | Internal sources and validation |
internal/validate |
Validates basic, JSON, and JSON Schema output using operating-system filesystem or fs.FS schema sources. |
Framework formats, internal sources and validation |
internal/llm |
Defines the internal generation boundary and implements outbound OpenAI-compatible chat requests, response decoding, authentication, and deadline handling. | Internal model client |
internal/usecase |
Coordinates preparation and execution across internal sources, rendering, artifact loading, generation, validation, and optional repair. | Internal runner |
The root package assembles these internal components without exposing their representations. Consumers depend only on the root facade.
Maintenance
Update this inventory as implementation adds packages or changes component responsibilities. List only implemented components; proposed package boundaries belong in temporary planning documents until their implementation lands.