@polyweave/smart-templates (1.0.3)
Published 2026-07-11 00:57:57 +00:00 by Dvorak
Installation
@polyweave:registry=https://hub.kl1.tenere.ai/api/packages/Polyweave/npm/npm install @polyweave/smart-templates@1.0.3"@polyweave/smart-templates": "1.0.3"About this package
smart-templates
Smart template strings with validation and prompt formatting.
Synopsis
import { createTemplateRegistryDuplex, smartTemplateString } from '@polyweave/smart-templates';
const registry = createTemplateRegistryDuplex();
const rendered = smartTemplateString('Hello {{ name }}!', { name: 'World' });
Install
npm install @polyweave/smart-templates
API
createTemplateRegistryDuplex()
Creates a duplex adapter for template registry operations.
createTemplateClient(registry)
Creates a client for template rendering and validation.
smartTemplateString(input, variables)
Renders a smart template string with variable substitution and validation.
validation
Template validation utilities for schema and format checking.
jsonSchema
JSON Schema generation and validation for templates.
templateNodes
Template AST node manipulation and traversal.
formatters
Built-in formatters for template variable rendering.
createTemplateTreeStoreDuplex(store), createTemplateRestStoreDuplex(store), createTemplateWebSocketStoreDuplex(store)
Template store adapters for tree, REST, and WebSocket backends.
createTemplateCacheDuplex(cache)
Template caching adapter with invalidation support.
Tests
npm test
Requirements
Node.js 18 or later. ESM only.
License
MIT
Dependencies
Development Dependencies
| ID | Version |
|---|---|
| @rigor/core | * |
Peer Dependencies
| ID | Version |
|---|---|
| @polyweave/core | * |
Keywords
polyweave
templates
prompt
validation
formatting