Changelog¶
All notable changes to this project will be documented here.
[0.7.3] — 2026-08-10¶
Added¶
- Variable Names Introspection:
PromptNode.variable_namesreturns the sorted names of a prompt's variables, andPromptNamespace.variable_namesreturns the union of variable names across every prompt in a namespace (including nested sub-namespaces). Makes it easy to discover what variables a prompt or a whole folder of prompts expects.
[0.7.2] — 2026-08-10¶
Fixed¶
- Dotted Filename Namespaces: Markdown files whose names contain dots (e.g.
main.sub_agents_instructions.md) are no longer mangled into underscores (main_sub_agents_instructions). Dotted filenames now express namespaces exactly like dotted TOML headers, sodp.main.sub_agents_instructionsworks andauto_exportround-trips without producing duplicate mangled prompts.
[0.7.0] — 2026-08-10¶
Fixed¶
- Nested TOML Namespaces: A single nested TOML prompt (e.g.
[default.main.system_prompt]) loaded from a directory is no longer renamed to the file stem — themain.system_promptnamespace is preserved.
Changed¶
- Examples Updated:
examples/run_all.pynow references the actualgemini/analyzer.mdpath and renders with theAnalysisSchemadictionary.
[0.6.0] — 2026-08-01¶
Added¶
- Inner Folder Prompt Resolution: Prompts in nested folders (e.g.
gemini/analyzer.md) are now accessible as namespaces (prompts.gemini.analyzer) and can be referenced from within other prompts using the namespace-prefixed name. - Unusual Variable Name Rendering: Non-identifier variable names (e.g.
app:access_policy,hello world) in templates now render correctly. Invalid or unusual Jinja tags are preserved as-is instead of raising a syntax error.
Fixed¶
- Caller File Exclusion: The frame-skipping logic used to prevent self-loading/infinite loops was simplified to check the whole
dynapromptpackage directory instead of a fixed internal-file list.
[0.5.0] — 2026-07-18¶
Added¶
- Automatic Cache Cleanup:
DynaPromptnow tracks every__pycache__directory created when loading external.pyschema/variable files viaimportlib. These are removed automatically whencleanup()is called. .dynapromptFolder Cleanup: Any.dynapromptdirectory found inside a scanned settings root is removed during cleanup, preventing stale artefacts from accumulating across runs.cleanup()Method: Explicit cleanup API — callprompts.cleanup()at any point to remove all ephemeral cache directories created since the last load.- Context-Manager Support:
DynaPromptnow implements__enter__/__exit__, so cleanup runs automatically when used as a context manager: reload()now cleans up first: Callingreload()triggerscleanup()before resetting the internal state, ensuring no stale cache directories linger between reloads.
[0.4.0] — 2026-05-22¶
Added¶
- Nested Prompt Support: Prompts can now be included inside other prompts using the
{{prompt_name}}syntax. - Recursion Protection: Implemented a render stack to prevent circular references between prompts (e.g., A includes B, B includes A). Detected loops are replaced with a safe warning message instead of a
RecursionError. - Enhanced Variable Registry: The directory scanner now skips internal and hidden directories (like
.venv,.git,__pycache__) by default to prevent self-loading orImportError.
Fixed¶
- Synchronous Rendering Compatibility: Fixed a bug where
enable_async=Truein Jinja2 was causing synchronousrender()calls to return coroutines instead of text. Sync and Async rendering now utilize separate pre-compiled templates. - Auto-Render Lifecycle: Refactored
auto_renderto use a "silent" internal render. This ensures variables and schemas are rendered during initialization without triggering lifecycle hooks twice. - Schema Context Injection: Global schemas (from shared
.pyor.jsonfiles) are now automatically injected into all prompt contexts, including nested prompts.
[0.3.6] — 2026-05-11¶
Added¶
- Dot-Notation Variables: Variables in
PromptNodecan now be accessed directly using dot notation (e.g.,node.variables.MyVariable). - Pydantic Auto-Detection: DynaPrompt now automatically detects if a Pydantic schema is passed in the variables and referenced in the template. If so, it automatically assigns it as the
response_schemafor the prompt, eliminating the need to explicitly define it in the markdown frontmatter in most cases.
[0.3.5] — 2026-05-11¶
Fixed¶
- Python Variable Stability: Fixed a crash (
TypeError: cannot pickle 'module' object) when loading Python files that contain standard imports (e.g.import math). Modules are now automatically excluded from the variable registry.
[0.3.4] — 2026-05-11¶
Added¶
templateProperty Alias:PromptNodenow supports.templateas a more intuitive alias for the raw.textattribute.
Fixed¶
- Auto-Render Locking: Fixed a regression where enabling
auto_renderwould "lock" the template and prevent subsequent overrides in.render()calls.
[0.3.3] — 2026-05-11¶
Fixed¶
- Infinite Loop Protection: Automatically detects and excludes the caller script from the scanning process, preventing infinite recursion when using
.as a settings directory. - Python Module Loading: Directory scanning now automatically skips
__init__.pyfiles to avoid relative import errors in package-style prompt directories.
Added¶
- Introspection Methods:
keys(),__iter__, and.promptsproperty onDynaPromptfor easier exploration of loaded prompts.
[0.3.0] — 2026-05-10¶
Added¶
- Async Rendering:
async_render()andasync_rerender()onPromptNodefor non-blocking I/O in FastAPI and async agents. - Async Hooks:
@async_hookabledecorator for asynchronous lifecycle hooks. - Prompt Hashing: Every
RenderedPromptnow includes aprompt_hash(SHA-256) for audit logs and LangSmith observability. - Debug Trace:
prompts.debug_trace("key")to visualize the full merge hierarchy and identify which environment/file provided specific values. - Python Variable Templates: Templates can be extracted from Python files using the
template = "file.py:variable"syntax.
Fixed¶
- Dotted TOML Headers: Nested TOML headers like
[default.gemini.analyzer]were parsed as nested dicts instead of flat prompt namespaces. - Missing File Alerts: Explicit
UserWarningwhen a requested settings file doesn't exist.
Changed¶
- README Overhaul: Completely redesigned with side-by-side "before/after" comparisons, YAML frontmatter guides, and advanced examples.
- Jinja2 Environment: Enabled
enable_async=Trueglobally for transparent sync/async rendering.
[0.2.0] — 2026-05-08¶
Added¶
structure_modeParameter: Enables building nested namespaces from directory structures (e.g.,prompts.folder.file). Defaults toTrue.auto_exportVisibility: Improved documentation for theauto_exportfeature which mirrors the prompt tree topyprompts.toml.- Enhanced Metadata: Expanded PyPI keywords and Trove classifiers for better discoverability.
Changed¶
auto_renderDefault: NowTrueby default. Variables within templates are automatically rendered during initialization.- Modernized Test Suite: Refactored legacy test scripts into a clean
pytestsuite usingtmp_pathfixtures.
Fixed¶
- CI Workflow: Fixed an "Invalid action input" error in GitHub Actions by updating Codecov to v5.
[0.1.3] — 2026-05-04¶
Initial public release with lazy-loading, environment support, and Pydantic schema integration.