renderify 0.0.1 → 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -0
- package/README.md +71 -0
- package/dist/renderify.cjs.js +95 -0
- package/dist/renderify.cjs.js.map +1 -0
- package/dist/renderify.d.mts +41 -0
- package/dist/renderify.d.ts +41 -0
- package/dist/renderify.esm.js +99 -0
- package/dist/renderify.esm.js.map +1 -0
- package/package.json +59 -8
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Web LLM
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
ADDED
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
# renderify
|
|
2
|
+
|
|
3
|
+

|
|
4
|
+

|
|
5
|
+

|
|
6
|
+
|
|
7
|
+
Official Renderify SDK entry package.
|
|
8
|
+
|
|
9
|
+
`renderify` is the recommended top-level package for application developers. It provides:
|
|
10
|
+
|
|
11
|
+
- A batteries-included app factory (`createRenderify` / `startRenderify`)
|
|
12
|
+
- One-shot helpers (`renderPromptOnce`, `renderPlanOnce`)
|
|
13
|
+
- Re-exports from `@renderify/core`
|
|
14
|
+
- Provider/runtime helpers from `@renderify/llm` and `@renderify/runtime`
|
|
15
|
+
|
|
16
|
+
## Install
|
|
17
|
+
|
|
18
|
+
```bash
|
|
19
|
+
pnpm add renderify
|
|
20
|
+
# or
|
|
21
|
+
npm i renderify
|
|
22
|
+
```
|
|
23
|
+
|
|
24
|
+
## Quick Start
|
|
25
|
+
|
|
26
|
+
```ts
|
|
27
|
+
import { startRenderify } from "renderify";
|
|
28
|
+
|
|
29
|
+
const { app } = await startRenderify({
|
|
30
|
+
llmProvider: "openai",
|
|
31
|
+
llmProviderOptions: {
|
|
32
|
+
apiKey: process.env.RENDERIFY_LLM_API_KEY,
|
|
33
|
+
},
|
|
34
|
+
});
|
|
35
|
+
|
|
36
|
+
const result = await app.renderPrompt("build a KPI dashboard");
|
|
37
|
+
console.log(result.html);
|
|
38
|
+
|
|
39
|
+
await app.stop();
|
|
40
|
+
```
|
|
41
|
+
|
|
42
|
+
## One-shot Prompt Rendering
|
|
43
|
+
|
|
44
|
+
```ts
|
|
45
|
+
import { renderPromptOnce } from "renderify";
|
|
46
|
+
|
|
47
|
+
const result = await renderPromptOnce("build a todo list", {
|
|
48
|
+
llmProvider: "openai",
|
|
49
|
+
llmProviderOptions: {
|
|
50
|
+
apiKey: process.env.RENDERIFY_LLM_API_KEY,
|
|
51
|
+
},
|
|
52
|
+
});
|
|
53
|
+
|
|
54
|
+
console.log(result.plan);
|
|
55
|
+
console.log(result.html);
|
|
56
|
+
```
|
|
57
|
+
|
|
58
|
+
## Main Exports
|
|
59
|
+
|
|
60
|
+
- `createRenderify(options)`
|
|
61
|
+
- `startRenderify(options)`
|
|
62
|
+
- `renderPromptOnce(prompt, options)`
|
|
63
|
+
- `renderPlanOnce(plan, options)`
|
|
64
|
+
- `renderPlanInBrowser(plan, options)`
|
|
65
|
+
- LLM registry/provider exports (`createLLMInterpreter`, `LLMProviderRegistry`, ...)
|
|
66
|
+
- Full `@renderify/core` API surface
|
|
67
|
+
|
|
68
|
+
## Notes
|
|
69
|
+
|
|
70
|
+
- Node.js `>=22` is required.
|
|
71
|
+
- For advanced split-package usage, you can still import `@renderify/core`, `@renderify/runtime`, `@renderify/security`, `@renderify/llm`, and `@renderify/ir` directly.
|
|
@@ -0,0 +1,95 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
+
var __export = (target, all) => {
|
|
7
|
+
for (var name in all)
|
|
8
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
9
|
+
};
|
|
10
|
+
var __copyProps = (to, from, except, desc) => {
|
|
11
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
12
|
+
for (let key of __getOwnPropNames(from))
|
|
13
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
14
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
15
|
+
}
|
|
16
|
+
return to;
|
|
17
|
+
};
|
|
18
|
+
var __reExport = (target, mod, secondTarget) => (__copyProps(target, mod, "default"), secondTarget && __copyProps(secondTarget, mod, "default"));
|
|
19
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
20
|
+
|
|
21
|
+
// src/index.ts
|
|
22
|
+
var src_exports = {};
|
|
23
|
+
__export(src_exports, {
|
|
24
|
+
AnthropicLLMInterpreter: () => import_llm.AnthropicLLMInterpreter,
|
|
25
|
+
GoogleLLMInterpreter: () => import_llm.GoogleLLMInterpreter,
|
|
26
|
+
LLMProviderRegistry: () => import_llm.LLMProviderRegistry,
|
|
27
|
+
OpenAILLMInterpreter: () => import_llm.OpenAILLMInterpreter,
|
|
28
|
+
anthropicLLMProvider: () => import_llm.anthropicLLMProvider,
|
|
29
|
+
createDefaultLLMProviderRegistry: () => import_llm.createDefaultLLMProviderRegistry,
|
|
30
|
+
createLLMInterpreter: () => import_llm.createLLMInterpreter,
|
|
31
|
+
createRenderify: () => createRenderify,
|
|
32
|
+
defaultLLMProviderRegistry: () => import_llm.defaultLLMProviderRegistry,
|
|
33
|
+
googleLLMProvider: () => import_llm.googleLLMProvider,
|
|
34
|
+
openaiLLMProvider: () => import_llm.openaiLLMProvider,
|
|
35
|
+
renderPlanInBrowser: () => import_runtime.renderPlanInBrowser,
|
|
36
|
+
renderPlanOnce: () => renderPlanOnce,
|
|
37
|
+
renderPromptOnce: () => renderPromptOnce,
|
|
38
|
+
startRenderify: () => startRenderify
|
|
39
|
+
});
|
|
40
|
+
module.exports = __toCommonJS(src_exports);
|
|
41
|
+
var import_core = require("@renderify/core");
|
|
42
|
+
var import_llm = require("@renderify/llm");
|
|
43
|
+
var import_runtime = require("@renderify/runtime");
|
|
44
|
+
var import_security = require("@renderify/security");
|
|
45
|
+
__reExport(src_exports, require("@renderify/core"), module.exports);
|
|
46
|
+
function createRenderify(options = {}) {
|
|
47
|
+
const dependencies = {
|
|
48
|
+
config: options.config ?? new import_core.DefaultRenderifyConfig(),
|
|
49
|
+
context: options.context ?? new import_core.DefaultContextManager(),
|
|
50
|
+
llm: options.llm ?? (0, import_llm.createLLMInterpreter)({
|
|
51
|
+
provider: options.llmProvider,
|
|
52
|
+
providerOptions: options.llmProviderOptions
|
|
53
|
+
}),
|
|
54
|
+
codegen: options.codegen ?? new import_core.DefaultCodeGenerator(),
|
|
55
|
+
runtime: options.runtime ?? new import_runtime.DefaultRuntimeManager({
|
|
56
|
+
moduleLoader: options.moduleLoader ?? new import_runtime.JspmModuleLoader(options.moduleLoaderOptions),
|
|
57
|
+
...options.runtimeOptions ?? {}
|
|
58
|
+
}),
|
|
59
|
+
security: options.security ?? new import_security.DefaultSecurityChecker(),
|
|
60
|
+
performance: options.performance ?? new import_core.DefaultPerformanceOptimizer(),
|
|
61
|
+
ui: options.ui ?? new import_core.DefaultUIRenderer(),
|
|
62
|
+
apiIntegration: options.apiIntegration ?? new import_core.DefaultApiIntegration(),
|
|
63
|
+
customization: options.customization ?? new import_core.DefaultCustomizationEngine()
|
|
64
|
+
};
|
|
65
|
+
return {
|
|
66
|
+
app: (0, import_core.createRenderifyApp)(dependencies),
|
|
67
|
+
dependencies
|
|
68
|
+
};
|
|
69
|
+
}
|
|
70
|
+
async function startRenderify(options = {}) {
|
|
71
|
+
const created = createRenderify(options);
|
|
72
|
+
await created.app.start();
|
|
73
|
+
return created;
|
|
74
|
+
}
|
|
75
|
+
async function renderPromptOnce(prompt, options = {}) {
|
|
76
|
+
const { render, ...createOptions } = options;
|
|
77
|
+
const { app } = createRenderify(createOptions);
|
|
78
|
+
await app.start();
|
|
79
|
+
try {
|
|
80
|
+
return await app.renderPrompt(prompt, render);
|
|
81
|
+
} finally {
|
|
82
|
+
await app.stop();
|
|
83
|
+
}
|
|
84
|
+
}
|
|
85
|
+
async function renderPlanOnce(plan, options = {}) {
|
|
86
|
+
const { render, ...createOptions } = options;
|
|
87
|
+
const { app } = createRenderify(createOptions);
|
|
88
|
+
await app.start();
|
|
89
|
+
try {
|
|
90
|
+
return await app.renderPlan(plan, render);
|
|
91
|
+
} finally {
|
|
92
|
+
await app.stop();
|
|
93
|
+
}
|
|
94
|
+
}
|
|
95
|
+
//# sourceMappingURL=renderify.cjs.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/index.ts"],"sourcesContent":["import {\n type ApiIntegration,\n type CodeGenerator,\n type ContextManager,\n type CustomizationEngine,\n createRenderifyApp,\n DefaultApiIntegration,\n DefaultCodeGenerator,\n DefaultContextManager,\n DefaultCustomizationEngine,\n DefaultPerformanceOptimizer,\n DefaultRenderifyConfig,\n DefaultUIRenderer,\n type LLMInterpreter,\n type PerformanceOptimizer,\n type RenderifyApp,\n type RenderifyConfig,\n type RenderifyCoreDependencies,\n type RenderPlanOptions,\n type RenderPlanResult,\n type RenderPromptOptions,\n type RenderPromptResult,\n type UIRenderer,\n} from \"@renderify/core\";\nimport type { RuntimePlan } from \"@renderify/ir\";\nimport {\n AnthropicLLMInterpreter,\n type AnthropicLLMInterpreterOptions,\n anthropicLLMProvider,\n createDefaultLLMProviderRegistry,\n createLLMInterpreter,\n defaultLLMProviderRegistry,\n GoogleLLMInterpreter,\n type GoogleLLMInterpreterOptions,\n googleLLMProvider,\n type LLMProviderDefinition,\n type LLMProviderName,\n LLMProviderRegistry,\n OpenAILLMInterpreter,\n type OpenAILLMInterpreterOptions,\n openaiLLMProvider,\n} from \"@renderify/llm\";\nimport {\n DefaultRuntimeManager,\n JspmModuleLoader,\n type JspmModuleLoaderOptions,\n type RuntimeManager,\n type RuntimeManagerOptions,\n renderPlanInBrowser,\n} from \"@renderify/runtime\";\nimport {\n DefaultSecurityChecker,\n type SecurityChecker,\n} from \"@renderify/security\";\n\nexport * from \"@renderify/core\";\nexport {\n AnthropicLLMInterpreter,\n GoogleLLMInterpreter,\n OpenAILLMInterpreter,\n anthropicLLMProvider,\n createDefaultLLMProviderRegistry,\n createLLMInterpreter,\n defaultLLMProviderRegistry,\n googleLLMProvider,\n LLMProviderRegistry,\n openaiLLMProvider,\n renderPlanInBrowser,\n};\nexport type {\n AnthropicLLMInterpreterOptions,\n GoogleLLMInterpreterOptions,\n LLMProviderDefinition,\n LLMProviderName,\n OpenAILLMInterpreterOptions,\n};\n\nexport interface CreateRenderifyOptions {\n config?: RenderifyConfig;\n context?: ContextManager;\n llm?: LLMInterpreter;\n codegen?: CodeGenerator;\n runtime?: RuntimeManager;\n security?: SecurityChecker;\n performance?: PerformanceOptimizer;\n ui?: UIRenderer;\n apiIntegration?: ApiIntegration;\n customization?: CustomizationEngine;\n llmProvider?: string;\n llmProviderOptions?: Record<string, unknown>;\n moduleLoader?: JspmModuleLoader;\n moduleLoaderOptions?: JspmModuleLoaderOptions;\n runtimeOptions?: RuntimeManagerOptions;\n}\n\nexport interface CreateRenderifyResult {\n app: RenderifyApp;\n dependencies: RenderifyCoreDependencies;\n}\n\nexport interface RenderPromptOnceOptions extends CreateRenderifyOptions {\n render?: RenderPromptOptions;\n}\n\nexport interface RenderPlanOnceOptions extends CreateRenderifyOptions {\n render?: RenderPlanOptions;\n}\n\nexport function createRenderify(\n options: CreateRenderifyOptions = {},\n): CreateRenderifyResult {\n const dependencies: RenderifyCoreDependencies = {\n config: options.config ?? new DefaultRenderifyConfig(),\n context: options.context ?? new DefaultContextManager(),\n llm:\n options.llm ??\n createLLMInterpreter({\n provider: options.llmProvider,\n providerOptions: options.llmProviderOptions,\n }),\n codegen: options.codegen ?? new DefaultCodeGenerator(),\n runtime:\n options.runtime ??\n new DefaultRuntimeManager({\n moduleLoader:\n options.moduleLoader ??\n new JspmModuleLoader(options.moduleLoaderOptions),\n ...(options.runtimeOptions ?? {}),\n }),\n security: options.security ?? new DefaultSecurityChecker(),\n performance: options.performance ?? new DefaultPerformanceOptimizer(),\n ui: options.ui ?? new DefaultUIRenderer(),\n apiIntegration: options.apiIntegration ?? new DefaultApiIntegration(),\n customization: options.customization ?? new DefaultCustomizationEngine(),\n };\n\n return {\n app: createRenderifyApp(dependencies),\n dependencies,\n };\n}\n\nexport async function startRenderify(\n options: CreateRenderifyOptions = {},\n): Promise<CreateRenderifyResult> {\n const created = createRenderify(options);\n await created.app.start();\n return created;\n}\n\nexport async function renderPromptOnce(\n prompt: string,\n options: RenderPromptOnceOptions = {},\n): Promise<RenderPromptResult> {\n const { render, ...createOptions } = options;\n const { app } = createRenderify(createOptions);\n\n await app.start();\n try {\n return await app.renderPrompt(prompt, render);\n } finally {\n await app.stop();\n }\n}\n\nexport async function renderPlanOnce(\n plan: RuntimePlan,\n options: RenderPlanOnceOptions = {},\n): Promise<RenderPlanResult> {\n const { render, ...createOptions } = options;\n const { app } = createRenderify(createOptions);\n\n await app.start();\n try {\n return await app.renderPlan(plan, render);\n } finally {\n await app.stop();\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,kBAuBO;AAEP,iBAgBO;AACP,qBAOO;AACP,sBAGO;AAEP,wBAAc,4BAvDd;AA4GO,SAAS,gBACd,UAAkC,CAAC,GACZ;AACvB,QAAM,eAA0C;AAAA,IAC9C,QAAQ,QAAQ,UAAU,IAAI,mCAAuB;AAAA,IACrD,SAAS,QAAQ,WAAW,IAAI,kCAAsB;AAAA,IACtD,KACE,QAAQ,WACR,iCAAqB;AAAA,MACnB,UAAU,QAAQ;AAAA,MAClB,iBAAiB,QAAQ;AAAA,IAC3B,CAAC;AAAA,IACH,SAAS,QAAQ,WAAW,IAAI,iCAAqB;AAAA,IACrD,SACE,QAAQ,WACR,IAAI,qCAAsB;AAAA,MACxB,cACE,QAAQ,gBACR,IAAI,gCAAiB,QAAQ,mBAAmB;AAAA,MAClD,GAAI,QAAQ,kBAAkB,CAAC;AAAA,IACjC,CAAC;AAAA,IACH,UAAU,QAAQ,YAAY,IAAI,uCAAuB;AAAA,IACzD,aAAa,QAAQ,eAAe,IAAI,wCAA4B;AAAA,IACpE,IAAI,QAAQ,MAAM,IAAI,8BAAkB;AAAA,IACxC,gBAAgB,QAAQ,kBAAkB,IAAI,kCAAsB;AAAA,IACpE,eAAe,QAAQ,iBAAiB,IAAI,uCAA2B;AAAA,EACzE;AAEA,SAAO;AAAA,IACL,SAAK,gCAAmB,YAAY;AAAA,IACpC;AAAA,EACF;AACF;AAEA,eAAsB,eACpB,UAAkC,CAAC,GACH;AAChC,QAAM,UAAU,gBAAgB,OAAO;AACvC,QAAM,QAAQ,IAAI,MAAM;AACxB,SAAO;AACT;AAEA,eAAsB,iBACpB,QACA,UAAmC,CAAC,GACP;AAC7B,QAAM,EAAE,QAAQ,GAAG,cAAc,IAAI;AACrC,QAAM,EAAE,IAAI,IAAI,gBAAgB,aAAa;AAE7C,QAAM,IAAI,MAAM;AAChB,MAAI;AACF,WAAO,MAAM,IAAI,aAAa,QAAQ,MAAM;AAAA,EAC9C,UAAE;AACA,UAAM,IAAI,KAAK;AAAA,EACjB;AACF;AAEA,eAAsB,eACpB,MACA,UAAiC,CAAC,GACP;AAC3B,QAAM,EAAE,QAAQ,GAAG,cAAc,IAAI;AACrC,QAAM,EAAE,IAAI,IAAI,gBAAgB,aAAa;AAE7C,QAAM,IAAI,MAAM;AAChB,MAAI;AACF,WAAO,MAAM,IAAI,WAAW,MAAM,MAAM;AAAA,EAC1C,UAAE;AACA,UAAM,IAAI,KAAK;AAAA,EACjB;AACF;","names":[]}
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import { RenderifyConfig, ContextManager, LLMInterpreter, CodeGenerator, PerformanceOptimizer, UIRenderer, ApiIntegration, CustomizationEngine, RenderifyApp, RenderifyCoreDependencies, RenderPlanOptions, RenderPromptOptions, RenderPlanResult, RenderPromptResult } from '@renderify/core';
|
|
2
|
+
export * from '@renderify/core';
|
|
3
|
+
import { RuntimePlan } from '@renderify/ir';
|
|
4
|
+
export { AnthropicLLMInterpreter, AnthropicLLMInterpreterOptions, GoogleLLMInterpreter, GoogleLLMInterpreterOptions, LLMProviderDefinition, LLMProviderName, LLMProviderRegistry, OpenAILLMInterpreter, OpenAILLMInterpreterOptions, anthropicLLMProvider, createDefaultLLMProviderRegistry, createLLMInterpreter, defaultLLMProviderRegistry, googleLLMProvider, openaiLLMProvider } from '@renderify/llm';
|
|
5
|
+
import { RuntimeManager, JspmModuleLoader, JspmModuleLoaderOptions, RuntimeManagerOptions } from '@renderify/runtime';
|
|
6
|
+
export { renderPlanInBrowser } from '@renderify/runtime';
|
|
7
|
+
import { SecurityChecker } from '@renderify/security';
|
|
8
|
+
|
|
9
|
+
interface CreateRenderifyOptions {
|
|
10
|
+
config?: RenderifyConfig;
|
|
11
|
+
context?: ContextManager;
|
|
12
|
+
llm?: LLMInterpreter;
|
|
13
|
+
codegen?: CodeGenerator;
|
|
14
|
+
runtime?: RuntimeManager;
|
|
15
|
+
security?: SecurityChecker;
|
|
16
|
+
performance?: PerformanceOptimizer;
|
|
17
|
+
ui?: UIRenderer;
|
|
18
|
+
apiIntegration?: ApiIntegration;
|
|
19
|
+
customization?: CustomizationEngine;
|
|
20
|
+
llmProvider?: string;
|
|
21
|
+
llmProviderOptions?: Record<string, unknown>;
|
|
22
|
+
moduleLoader?: JspmModuleLoader;
|
|
23
|
+
moduleLoaderOptions?: JspmModuleLoaderOptions;
|
|
24
|
+
runtimeOptions?: RuntimeManagerOptions;
|
|
25
|
+
}
|
|
26
|
+
interface CreateRenderifyResult {
|
|
27
|
+
app: RenderifyApp;
|
|
28
|
+
dependencies: RenderifyCoreDependencies;
|
|
29
|
+
}
|
|
30
|
+
interface RenderPromptOnceOptions extends CreateRenderifyOptions {
|
|
31
|
+
render?: RenderPromptOptions;
|
|
32
|
+
}
|
|
33
|
+
interface RenderPlanOnceOptions extends CreateRenderifyOptions {
|
|
34
|
+
render?: RenderPlanOptions;
|
|
35
|
+
}
|
|
36
|
+
declare function createRenderify(options?: CreateRenderifyOptions): CreateRenderifyResult;
|
|
37
|
+
declare function startRenderify(options?: CreateRenderifyOptions): Promise<CreateRenderifyResult>;
|
|
38
|
+
declare function renderPromptOnce(prompt: string, options?: RenderPromptOnceOptions): Promise<RenderPromptResult>;
|
|
39
|
+
declare function renderPlanOnce(plan: RuntimePlan, options?: RenderPlanOnceOptions): Promise<RenderPlanResult>;
|
|
40
|
+
|
|
41
|
+
export { type CreateRenderifyOptions, type CreateRenderifyResult, type RenderPlanOnceOptions, type RenderPromptOnceOptions, createRenderify, renderPlanOnce, renderPromptOnce, startRenderify };
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import { RenderifyConfig, ContextManager, LLMInterpreter, CodeGenerator, PerformanceOptimizer, UIRenderer, ApiIntegration, CustomizationEngine, RenderifyApp, RenderifyCoreDependencies, RenderPlanOptions, RenderPromptOptions, RenderPlanResult, RenderPromptResult } from '@renderify/core';
|
|
2
|
+
export * from '@renderify/core';
|
|
3
|
+
import { RuntimePlan } from '@renderify/ir';
|
|
4
|
+
export { AnthropicLLMInterpreter, AnthropicLLMInterpreterOptions, GoogleLLMInterpreter, GoogleLLMInterpreterOptions, LLMProviderDefinition, LLMProviderName, LLMProviderRegistry, OpenAILLMInterpreter, OpenAILLMInterpreterOptions, anthropicLLMProvider, createDefaultLLMProviderRegistry, createLLMInterpreter, defaultLLMProviderRegistry, googleLLMProvider, openaiLLMProvider } from '@renderify/llm';
|
|
5
|
+
import { RuntimeManager, JspmModuleLoader, JspmModuleLoaderOptions, RuntimeManagerOptions } from '@renderify/runtime';
|
|
6
|
+
export { renderPlanInBrowser } from '@renderify/runtime';
|
|
7
|
+
import { SecurityChecker } from '@renderify/security';
|
|
8
|
+
|
|
9
|
+
interface CreateRenderifyOptions {
|
|
10
|
+
config?: RenderifyConfig;
|
|
11
|
+
context?: ContextManager;
|
|
12
|
+
llm?: LLMInterpreter;
|
|
13
|
+
codegen?: CodeGenerator;
|
|
14
|
+
runtime?: RuntimeManager;
|
|
15
|
+
security?: SecurityChecker;
|
|
16
|
+
performance?: PerformanceOptimizer;
|
|
17
|
+
ui?: UIRenderer;
|
|
18
|
+
apiIntegration?: ApiIntegration;
|
|
19
|
+
customization?: CustomizationEngine;
|
|
20
|
+
llmProvider?: string;
|
|
21
|
+
llmProviderOptions?: Record<string, unknown>;
|
|
22
|
+
moduleLoader?: JspmModuleLoader;
|
|
23
|
+
moduleLoaderOptions?: JspmModuleLoaderOptions;
|
|
24
|
+
runtimeOptions?: RuntimeManagerOptions;
|
|
25
|
+
}
|
|
26
|
+
interface CreateRenderifyResult {
|
|
27
|
+
app: RenderifyApp;
|
|
28
|
+
dependencies: RenderifyCoreDependencies;
|
|
29
|
+
}
|
|
30
|
+
interface RenderPromptOnceOptions extends CreateRenderifyOptions {
|
|
31
|
+
render?: RenderPromptOptions;
|
|
32
|
+
}
|
|
33
|
+
interface RenderPlanOnceOptions extends CreateRenderifyOptions {
|
|
34
|
+
render?: RenderPlanOptions;
|
|
35
|
+
}
|
|
36
|
+
declare function createRenderify(options?: CreateRenderifyOptions): CreateRenderifyResult;
|
|
37
|
+
declare function startRenderify(options?: CreateRenderifyOptions): Promise<CreateRenderifyResult>;
|
|
38
|
+
declare function renderPromptOnce(prompt: string, options?: RenderPromptOnceOptions): Promise<RenderPromptResult>;
|
|
39
|
+
declare function renderPlanOnce(plan: RuntimePlan, options?: RenderPlanOnceOptions): Promise<RenderPlanResult>;
|
|
40
|
+
|
|
41
|
+
export { type CreateRenderifyOptions, type CreateRenderifyResult, type RenderPlanOnceOptions, type RenderPromptOnceOptions, createRenderify, renderPlanOnce, renderPromptOnce, startRenderify };
|
|
@@ -0,0 +1,99 @@
|
|
|
1
|
+
// src/index.ts
|
|
2
|
+
import {
|
|
3
|
+
createRenderifyApp,
|
|
4
|
+
DefaultApiIntegration,
|
|
5
|
+
DefaultCodeGenerator,
|
|
6
|
+
DefaultContextManager,
|
|
7
|
+
DefaultCustomizationEngine,
|
|
8
|
+
DefaultPerformanceOptimizer,
|
|
9
|
+
DefaultRenderifyConfig,
|
|
10
|
+
DefaultUIRenderer
|
|
11
|
+
} from "@renderify/core";
|
|
12
|
+
import {
|
|
13
|
+
AnthropicLLMInterpreter,
|
|
14
|
+
anthropicLLMProvider,
|
|
15
|
+
createDefaultLLMProviderRegistry,
|
|
16
|
+
createLLMInterpreter,
|
|
17
|
+
defaultLLMProviderRegistry,
|
|
18
|
+
GoogleLLMInterpreter,
|
|
19
|
+
googleLLMProvider,
|
|
20
|
+
LLMProviderRegistry,
|
|
21
|
+
OpenAILLMInterpreter,
|
|
22
|
+
openaiLLMProvider
|
|
23
|
+
} from "@renderify/llm";
|
|
24
|
+
import {
|
|
25
|
+
DefaultRuntimeManager,
|
|
26
|
+
JspmModuleLoader,
|
|
27
|
+
renderPlanInBrowser
|
|
28
|
+
} from "@renderify/runtime";
|
|
29
|
+
import {
|
|
30
|
+
DefaultSecurityChecker
|
|
31
|
+
} from "@renderify/security";
|
|
32
|
+
export * from "@renderify/core";
|
|
33
|
+
function createRenderify(options = {}) {
|
|
34
|
+
const dependencies = {
|
|
35
|
+
config: options.config ?? new DefaultRenderifyConfig(),
|
|
36
|
+
context: options.context ?? new DefaultContextManager(),
|
|
37
|
+
llm: options.llm ?? createLLMInterpreter({
|
|
38
|
+
provider: options.llmProvider,
|
|
39
|
+
providerOptions: options.llmProviderOptions
|
|
40
|
+
}),
|
|
41
|
+
codegen: options.codegen ?? new DefaultCodeGenerator(),
|
|
42
|
+
runtime: options.runtime ?? new DefaultRuntimeManager({
|
|
43
|
+
moduleLoader: options.moduleLoader ?? new JspmModuleLoader(options.moduleLoaderOptions),
|
|
44
|
+
...options.runtimeOptions ?? {}
|
|
45
|
+
}),
|
|
46
|
+
security: options.security ?? new DefaultSecurityChecker(),
|
|
47
|
+
performance: options.performance ?? new DefaultPerformanceOptimizer(),
|
|
48
|
+
ui: options.ui ?? new DefaultUIRenderer(),
|
|
49
|
+
apiIntegration: options.apiIntegration ?? new DefaultApiIntegration(),
|
|
50
|
+
customization: options.customization ?? new DefaultCustomizationEngine()
|
|
51
|
+
};
|
|
52
|
+
return {
|
|
53
|
+
app: createRenderifyApp(dependencies),
|
|
54
|
+
dependencies
|
|
55
|
+
};
|
|
56
|
+
}
|
|
57
|
+
async function startRenderify(options = {}) {
|
|
58
|
+
const created = createRenderify(options);
|
|
59
|
+
await created.app.start();
|
|
60
|
+
return created;
|
|
61
|
+
}
|
|
62
|
+
async function renderPromptOnce(prompt, options = {}) {
|
|
63
|
+
const { render, ...createOptions } = options;
|
|
64
|
+
const { app } = createRenderify(createOptions);
|
|
65
|
+
await app.start();
|
|
66
|
+
try {
|
|
67
|
+
return await app.renderPrompt(prompt, render);
|
|
68
|
+
} finally {
|
|
69
|
+
await app.stop();
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
async function renderPlanOnce(plan, options = {}) {
|
|
73
|
+
const { render, ...createOptions } = options;
|
|
74
|
+
const { app } = createRenderify(createOptions);
|
|
75
|
+
await app.start();
|
|
76
|
+
try {
|
|
77
|
+
return await app.renderPlan(plan, render);
|
|
78
|
+
} finally {
|
|
79
|
+
await app.stop();
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
export {
|
|
83
|
+
AnthropicLLMInterpreter,
|
|
84
|
+
GoogleLLMInterpreter,
|
|
85
|
+
LLMProviderRegistry,
|
|
86
|
+
OpenAILLMInterpreter,
|
|
87
|
+
anthropicLLMProvider,
|
|
88
|
+
createDefaultLLMProviderRegistry,
|
|
89
|
+
createLLMInterpreter,
|
|
90
|
+
createRenderify,
|
|
91
|
+
defaultLLMProviderRegistry,
|
|
92
|
+
googleLLMProvider,
|
|
93
|
+
openaiLLMProvider,
|
|
94
|
+
renderPlanInBrowser,
|
|
95
|
+
renderPlanOnce,
|
|
96
|
+
renderPromptOnce,
|
|
97
|
+
startRenderify
|
|
98
|
+
};
|
|
99
|
+
//# sourceMappingURL=renderify.esm.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/index.ts"],"sourcesContent":["import {\n type ApiIntegration,\n type CodeGenerator,\n type ContextManager,\n type CustomizationEngine,\n createRenderifyApp,\n DefaultApiIntegration,\n DefaultCodeGenerator,\n DefaultContextManager,\n DefaultCustomizationEngine,\n DefaultPerformanceOptimizer,\n DefaultRenderifyConfig,\n DefaultUIRenderer,\n type LLMInterpreter,\n type PerformanceOptimizer,\n type RenderifyApp,\n type RenderifyConfig,\n type RenderifyCoreDependencies,\n type RenderPlanOptions,\n type RenderPlanResult,\n type RenderPromptOptions,\n type RenderPromptResult,\n type UIRenderer,\n} from \"@renderify/core\";\nimport type { RuntimePlan } from \"@renderify/ir\";\nimport {\n AnthropicLLMInterpreter,\n type AnthropicLLMInterpreterOptions,\n anthropicLLMProvider,\n createDefaultLLMProviderRegistry,\n createLLMInterpreter,\n defaultLLMProviderRegistry,\n GoogleLLMInterpreter,\n type GoogleLLMInterpreterOptions,\n googleLLMProvider,\n type LLMProviderDefinition,\n type LLMProviderName,\n LLMProviderRegistry,\n OpenAILLMInterpreter,\n type OpenAILLMInterpreterOptions,\n openaiLLMProvider,\n} from \"@renderify/llm\";\nimport {\n DefaultRuntimeManager,\n JspmModuleLoader,\n type JspmModuleLoaderOptions,\n type RuntimeManager,\n type RuntimeManagerOptions,\n renderPlanInBrowser,\n} from \"@renderify/runtime\";\nimport {\n DefaultSecurityChecker,\n type SecurityChecker,\n} from \"@renderify/security\";\n\nexport * from \"@renderify/core\";\nexport {\n AnthropicLLMInterpreter,\n GoogleLLMInterpreter,\n OpenAILLMInterpreter,\n anthropicLLMProvider,\n createDefaultLLMProviderRegistry,\n createLLMInterpreter,\n defaultLLMProviderRegistry,\n googleLLMProvider,\n LLMProviderRegistry,\n openaiLLMProvider,\n renderPlanInBrowser,\n};\nexport type {\n AnthropicLLMInterpreterOptions,\n GoogleLLMInterpreterOptions,\n LLMProviderDefinition,\n LLMProviderName,\n OpenAILLMInterpreterOptions,\n};\n\nexport interface CreateRenderifyOptions {\n config?: RenderifyConfig;\n context?: ContextManager;\n llm?: LLMInterpreter;\n codegen?: CodeGenerator;\n runtime?: RuntimeManager;\n security?: SecurityChecker;\n performance?: PerformanceOptimizer;\n ui?: UIRenderer;\n apiIntegration?: ApiIntegration;\n customization?: CustomizationEngine;\n llmProvider?: string;\n llmProviderOptions?: Record<string, unknown>;\n moduleLoader?: JspmModuleLoader;\n moduleLoaderOptions?: JspmModuleLoaderOptions;\n runtimeOptions?: RuntimeManagerOptions;\n}\n\nexport interface CreateRenderifyResult {\n app: RenderifyApp;\n dependencies: RenderifyCoreDependencies;\n}\n\nexport interface RenderPromptOnceOptions extends CreateRenderifyOptions {\n render?: RenderPromptOptions;\n}\n\nexport interface RenderPlanOnceOptions extends CreateRenderifyOptions {\n render?: RenderPlanOptions;\n}\n\nexport function createRenderify(\n options: CreateRenderifyOptions = {},\n): CreateRenderifyResult {\n const dependencies: RenderifyCoreDependencies = {\n config: options.config ?? new DefaultRenderifyConfig(),\n context: options.context ?? new DefaultContextManager(),\n llm:\n options.llm ??\n createLLMInterpreter({\n provider: options.llmProvider,\n providerOptions: options.llmProviderOptions,\n }),\n codegen: options.codegen ?? new DefaultCodeGenerator(),\n runtime:\n options.runtime ??\n new DefaultRuntimeManager({\n moduleLoader:\n options.moduleLoader ??\n new JspmModuleLoader(options.moduleLoaderOptions),\n ...(options.runtimeOptions ?? {}),\n }),\n security: options.security ?? new DefaultSecurityChecker(),\n performance: options.performance ?? new DefaultPerformanceOptimizer(),\n ui: options.ui ?? new DefaultUIRenderer(),\n apiIntegration: options.apiIntegration ?? new DefaultApiIntegration(),\n customization: options.customization ?? new DefaultCustomizationEngine(),\n };\n\n return {\n app: createRenderifyApp(dependencies),\n dependencies,\n };\n}\n\nexport async function startRenderify(\n options: CreateRenderifyOptions = {},\n): Promise<CreateRenderifyResult> {\n const created = createRenderify(options);\n await created.app.start();\n return created;\n}\n\nexport async function renderPromptOnce(\n prompt: string,\n options: RenderPromptOnceOptions = {},\n): Promise<RenderPromptResult> {\n const { render, ...createOptions } = options;\n const { app } = createRenderify(createOptions);\n\n await app.start();\n try {\n return await app.renderPrompt(prompt, render);\n } finally {\n await app.stop();\n }\n}\n\nexport async function renderPlanOnce(\n plan: RuntimePlan,\n options: RenderPlanOnceOptions = {},\n): Promise<RenderPlanResult> {\n const { render, ...createOptions } = options;\n const { app } = createRenderify(createOptions);\n\n await app.start();\n try {\n return await app.renderPlan(plan, render);\n } finally {\n await app.stop();\n }\n}\n"],"mappings":";AAAA;AAAA,EAKE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OAWK;AAEP;AAAA,EACE;AAAA,EAEA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EAEA;AAAA,EAGA;AAAA,EACA;AAAA,EAEA;AAAA,OACK;AACP;AAAA,EACE;AAAA,EACA;AAAA,EAIA;AAAA,OACK;AACP;AAAA,EACE;AAAA,OAEK;AAEP,cAAc;AAqDP,SAAS,gBACd,UAAkC,CAAC,GACZ;AACvB,QAAM,eAA0C;AAAA,IAC9C,QAAQ,QAAQ,UAAU,IAAI,uBAAuB;AAAA,IACrD,SAAS,QAAQ,WAAW,IAAI,sBAAsB;AAAA,IACtD,KACE,QAAQ,OACR,qBAAqB;AAAA,MACnB,UAAU,QAAQ;AAAA,MAClB,iBAAiB,QAAQ;AAAA,IAC3B,CAAC;AAAA,IACH,SAAS,QAAQ,WAAW,IAAI,qBAAqB;AAAA,IACrD,SACE,QAAQ,WACR,IAAI,sBAAsB;AAAA,MACxB,cACE,QAAQ,gBACR,IAAI,iBAAiB,QAAQ,mBAAmB;AAAA,MAClD,GAAI,QAAQ,kBAAkB,CAAC;AAAA,IACjC,CAAC;AAAA,IACH,UAAU,QAAQ,YAAY,IAAI,uBAAuB;AAAA,IACzD,aAAa,QAAQ,eAAe,IAAI,4BAA4B;AAAA,IACpE,IAAI,QAAQ,MAAM,IAAI,kBAAkB;AAAA,IACxC,gBAAgB,QAAQ,kBAAkB,IAAI,sBAAsB;AAAA,IACpE,eAAe,QAAQ,iBAAiB,IAAI,2BAA2B;AAAA,EACzE;AAEA,SAAO;AAAA,IACL,KAAK,mBAAmB,YAAY;AAAA,IACpC;AAAA,EACF;AACF;AAEA,eAAsB,eACpB,UAAkC,CAAC,GACH;AAChC,QAAM,UAAU,gBAAgB,OAAO;AACvC,QAAM,QAAQ,IAAI,MAAM;AACxB,SAAO;AACT;AAEA,eAAsB,iBACpB,QACA,UAAmC,CAAC,GACP;AAC7B,QAAM,EAAE,QAAQ,GAAG,cAAc,IAAI;AACrC,QAAM,EAAE,IAAI,IAAI,gBAAgB,aAAa;AAE7C,QAAM,IAAI,MAAM;AAChB,MAAI;AACF,WAAO,MAAM,IAAI,aAAa,QAAQ,MAAM;AAAA,EAC9C,UAAE;AACA,UAAM,IAAI,KAAK;AAAA,EACjB;AACF;AAEA,eAAsB,eACpB,MACA,UAAiC,CAAC,GACP;AAC3B,QAAM,EAAE,QAAQ,GAAG,cAAc,IAAI;AACrC,QAAM,EAAE,IAAI,IAAI,gBAAgB,aAAa;AAE7C,QAAM,IAAI,MAAM;AAChB,MAAI;AACF,WAAO,MAAM,IAAI,WAAW,MAAM,MAAM;AAAA,EAC1C,UAAE;AACA,UAAM,IAAI,KAAK;AAAA,EACjB;AACF;","names":[]}
|
package/package.json
CHANGED
|
@@ -1,11 +1,62 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "renderify",
|
|
3
|
-
"version": "0.0
|
|
4
|
-
"description": "",
|
|
5
|
-
"main": "
|
|
6
|
-
"
|
|
7
|
-
|
|
3
|
+
"version": "0.1.0",
|
|
4
|
+
"description": "Official Renderify SDK facade",
|
|
5
|
+
"main": "dist/renderify.cjs.js",
|
|
6
|
+
"types": "dist/renderify.d.ts",
|
|
7
|
+
"module": "dist/renderify.esm.js",
|
|
8
|
+
"exports": {
|
|
9
|
+
".": {
|
|
10
|
+
"types": "./dist/renderify.d.ts",
|
|
11
|
+
"import": "./dist/renderify.esm.js",
|
|
12
|
+
"require": "./dist/renderify.cjs.js",
|
|
13
|
+
"default": "./dist/renderify.esm.js"
|
|
14
|
+
},
|
|
15
|
+
"./package.json": "./package.json"
|
|
16
|
+
},
|
|
17
|
+
"files": [
|
|
18
|
+
"dist"
|
|
19
|
+
],
|
|
20
|
+
"author": "unadlib",
|
|
21
|
+
"license": "MIT",
|
|
22
|
+
"keywords": [
|
|
23
|
+
"renderify",
|
|
24
|
+
"runtime",
|
|
25
|
+
"llm",
|
|
26
|
+
"ui",
|
|
27
|
+
"sdk",
|
|
28
|
+
"typescript"
|
|
29
|
+
],
|
|
30
|
+
"homepage": "https://github.com/webllm/renderify#readme",
|
|
31
|
+
"bugs": {
|
|
32
|
+
"url": "https://github.com/webllm/renderify/issues"
|
|
33
|
+
},
|
|
34
|
+
"repository": {
|
|
35
|
+
"type": "git",
|
|
36
|
+
"url": "https://github.com/webllm/renderify.git",
|
|
37
|
+
"directory": "packages/renderify"
|
|
38
|
+
},
|
|
39
|
+
"engines": {
|
|
40
|
+
"node": ">=22.0.0"
|
|
8
41
|
},
|
|
9
|
-
"
|
|
10
|
-
|
|
11
|
-
|
|
42
|
+
"publishConfig": {
|
|
43
|
+
"access": "public",
|
|
44
|
+
"provenance": true
|
|
45
|
+
},
|
|
46
|
+
"sideEffects": false,
|
|
47
|
+
"dependencies": {
|
|
48
|
+
"@renderify/core": "^0.1.0",
|
|
49
|
+
"@renderify/ir": "^0.1.0",
|
|
50
|
+
"@renderify/llm": "^0.1.0",
|
|
51
|
+
"@renderify/runtime": "^0.1.0",
|
|
52
|
+
"@renderify/security": "^0.1.0"
|
|
53
|
+
},
|
|
54
|
+
"scripts": {
|
|
55
|
+
"test": "echo \"Error: no test specified\" && exit 1",
|
|
56
|
+
"typecheck": "tsc -p tsconfig.json --pretty false --noEmit",
|
|
57
|
+
"lint": "biome lint src",
|
|
58
|
+
"clean": "rm -rf dist dist-types",
|
|
59
|
+
"build:repo": "tsup --config tsup.config.ts",
|
|
60
|
+
"watch:repo": "tsup --config tsup.config.ts --watch"
|
|
61
|
+
}
|
|
62
|
+
}
|