| Python module (OpenHosta/src/OpenHosta) | JS parity | Notes |
|---|---|---|
| core/meta_prompt.py | ✅ Implemented in src/OpenHosta/core/metaPrompt.ts using nunjucks |
Provides MetaPrompt, EMULATE_META_PROMPT, USER_CALL_META_PROMPT equivalents |
| core/logger.py | ✅ Implemented in src/OpenHosta/core/logger.ts |
Adds printLastPrompt, printLastDecoding with hosta_inspection contract |
| core/config.py | 🟡 Partial in src/OpenHosta/core/config.ts |
Default model/pipeline wiring + .env loader done; depends on placeholder model/pipeline behavior |
| core/type_converter.py | 🟡 Partial in src/OpenHosta/core/typeConverter.ts |
Runtime TypeDescriptor DSL + JSON schema serialization present; JS lacks Python's dataclass/Pydantic/enum reflection and uses manual descriptors |
| core/analizer.py | 🟡 Partial in src/OpenHosta/core/analyzer.ts |
setHostaSignature, hostaAnalyze, and encoding helpers exist; no frame-introspection, args only update when callers pass HostaAnalyzeOptions |
| core/inspection.py | 🔄 Missing | Frame walking, get_hosta_inspection, and closure-aware cache are not yet ported—JS currently has no way to derive metadata at call time |
| core/pydantic_proxy.py | 🔄 Missing | Needs strategy for reconstructing Pydantic/Zod models and exporting definitions when templates ask for them |
| models/OpenAICompatible.py | 🟡 Skeleton in src/OpenHosta/models/OpenAICompatibleModel.ts |
Holds model metadata/API params; API calls & inspection logs still TODO |
| models/base_model.py | 🔄 Missing | Need async executor pooling, capability flags, api_call/get_response_content contracts |
| pipelines/simple_pipeline.py | 🟡 Skeleton in src/OpenHosta/pipelines/simplePipeline.ts |
Structure + prompt references exist; push/pull logic not yet ported |
| exec/ask.py | 🔄 Missing | JS has no direct ask() helper for single-shot prompts or image attachments |
| exec/emulate.py | 🔄 Missing | Function emulation loop (inspection → pipeline → model) needs port plus retry/rate-limit handling |
| exec/closure.py | 🔄 Missing | Closure factory and type guessing hooks absent; dependent on inspection + pipeline parity |
| asynchrone/init.py | 🔄 Missing | Async façade (ask/emulate/closure/test) not exposed in JS package |
| semantics/operators.py | 🔄 Missing | test/test_async wrappers around closures still to build |
| utils/errors.py | 🔄 Missing | Custom exception hierarchy (RequestError, RateLimitError, etc.) not mirrored in JS |
| utils/import_handler.py | 🔄 Missing | Capability probes (is_pydantic_available, is_torch_available) need JS equivalents |
- Templating engine: The Python version relies on Jinja2; the JS port uses Nunjucks (official Jinja2 port). Feature parity is high but not perfect—filters/extensions implemented only on the client must be re-created via custom Nunjucks environment configuration. Any advanced Jinja behaviors (async filters, sandboxing) may need bespoke adapters.
- Rendering signature: Python exposes both
*argsand**kwargswhen callingTemplate.render. In JS we can only accept a single context object (Record<string, unknown>). Callers that relied on positional argument unpacking will need to pass a single dictionary. - Whitespace handling: We emulate
textwrap.dedentand the double-blank-line cleanup performed in Python. Edge cases where Python preserved leading/trailing blank lines may still differ slightly; tests should be added once more prompts are ported. - Environment overrides: Python forwards
*args/**kargstojinja2.Template. The JS port instead accepts an optionalenv(anunjucks.Environment). Additional template-level toggles must be provided via that environment instance until we see concrete use cases. - Inspection hooks: Python functions receive rich objects via attributes. The TS helpers (
printLastPrompt,printLastDecoding) rely on duck typing and will log fallback messages when the expected methods are missing; stricter typings may emerge once models/pipelines are ported. - Core config & defaults:
.envdiscovery matches Python, but the default pipeline/model are placeholders. They accept metadata and API parameters yet do not execute remote calls; the structure is in place so the rest of the system can attach behavior later. - Type conversion & analysis: Python relies on actual runtime types (
typing, enums, dataclasses, pydantic). JS exposes aTypeDescriptorDSL andsetHostaSignatureso callers can describe shapes manually until AST-based inspection is ported. Automatic extraction of annotations/docstrings still to come. - Pipeline execution:
OneTurnConversationPipelinecurrently throws forpush/pull. The scaffolding ensures config references remain consistent while we translate the full encode/analyse flow. - Inspection lifecycle: Python's
core/inspection.pystores per-functionhosta_inspection, refreshes frames, and powersemulate/closure/test. None of that exists in TS, socore/analyzercannot gather live args without manual metadata. - Model surface & errors: The JS
OpenAICompatibleModellacks HTTP transport, rate-limit retries, andModelCapabilitiessetup frommodels/base_model.py, so higher layers cannot make real API calls or log consumption/errors like Python'sRequestError/RateLimitError. - Execution helpers: Python exposes synchronous/async
ask,emulate,closure, and semantic operators (wrapping pipelines, auto image serialization, and return-type enforcement). JS currently has no equivalent entry points, making it impossible to exercise the pipeline even once. - Utility glue: Availability flags (
utils/import_handler.py) and structured exceptions are missing, so future modules (pydantic proxy, PIL detection, etc.) cannot share a common capability registry or error contract.
- Stabilize MetaPrompt API
- Flesh out unit tests comparing Python & TS outputs for representative prompts (JSON mode, conditionals, whitespace).
- Decide whether to expose helpers for registering filters/tests so higher layers can stay declarative.
- Inspection & analyzer integration
- Port
core/inspection.py(frame walking,get_hosta_inspection,get_last_frame) and connect it with the existing TS analyzer helpers. - Mirror
utils.errors.pyso inspection failures raise deterministic error types that match Python’s behaviour.
- Port
- Pipeline & execution surface
- Complete
OneTurnConversationPipeline.push/pull, including encode/decode, PIL image resizing, and logging. - Implement
exec/emulate,exec/closure,exec/ask, plusasynchroneandsemanticswrappers so the library exposes the same high-level API as Python.
- Complete
- Model & validation layer
- Port
models/base_model.pycontracts (async executor, capability flags,get_response_content,get_thinking_and_data_sections). - Finish
OpenAICompatibleModelwith real HTTP calls, retries, and response parsing; build a TS equivalent ofcore/pydantic_proxy.py(likely via Zod) so schemas can still be emitted.
- Port
- Type conversion automation
- Extend
core/typeConverter.tsso enums, dataclasses, and descriptor metadata can be derived automatically once inspection runs. - Revisit how
.envoverrides register filters/tests on the pipeline, mirroring Python’s dynamic config updates.
- Extend
- Ecosystem alignment
- Document any Python-only behaviors we cannot reproduce in JS (dynamic imports,
inspectlimitations) and keep migration recipes for prompts/config files in sync across both stacks.
- Document any Python-only behaviors we cannot reproduce in JS (dynamic imports,
Maintaining this table for every milestone will help the Python and JS implementations evolve together without divergence.