Polyweave

@polyweave/smart-templates (1.0.1)

Published 2026-07-10 19:55:35 +00:00 by Dvorak

Installation

@polyweave:registry=https://hub.kl1.tenere.ai/api/packages/Polyweave/npm/
npm install @polyweave/smart-templates@1.0.1
"@polyweave/smart-templates": "1.0.1"

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
Details
npm
2026-07-10 19:55:35 +00:00
354
John Dvorak
SEE LICENSE IN LICENSE
12 KiB
Assets (1)
Versions (4) View all
1.0.6 2026-07-11
1.0.3 2026-07-11
1.0.2 2026-07-11
1.0.1 2026-07-10