@lokascript/compilation-service 2.0.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.
@@ -0,0 +1,46 @@
1
+ import { Hono } from 'hono';
2
+ import { C as CompilationService } from './service-891L1MYk.cjs';
3
+
4
+ /**
5
+ * HTTP/Edge Wrapper for CompilationService
6
+ *
7
+ * Thin Hono server exposing CompilationService over HTTP.
8
+ * Works on Node, Deno, Bun, and Cloudflare Workers.
9
+ *
10
+ * Usage:
11
+ * import { createApp } from '@lokascript/compilation-service/http';
12
+ * const app = createApp();
13
+ * // Use with any Hono-compatible server
14
+ *
15
+ * import { serve } from '@lokascript/compilation-service/http';
16
+ * serve({ port: 3001 }); // Starts Node server
17
+ */
18
+
19
+ interface HttpOptions {
20
+ /** API key for authentication (optional — skips /health) */
21
+ apiKey?: string;
22
+ /** CORS origin (default '*') */
23
+ corsOrigin?: string;
24
+ /** Port for serve() (default 3001) */
25
+ port?: number;
26
+ /** Pre-created service instance (skips lazy init) */
27
+ service?: CompilationService;
28
+ /** Enable production middleware (body limit, timeout, logger) */
29
+ production?: boolean;
30
+ /** Max request body in bytes (default 50KB, requires production: true) */
31
+ maxBodyBytes?: number;
32
+ /** Request timeout in ms (default 10000, requires production: true) */
33
+ timeoutMs?: number;
34
+ }
35
+ /**
36
+ * Create a Hono app wrapping CompilationService.
37
+ * Testable without starting a server — use `app.request()`.
38
+ */
39
+ declare function createApp(options?: HttpOptions): Hono;
40
+ /**
41
+ * Start a Node HTTP server with the compilation service.
42
+ * Convenience for CLI usage; for production, use createApp() with your server.
43
+ */
44
+ declare function serve(options?: HttpOptions): Promise<void>;
45
+
46
+ export { type HttpOptions, createApp, serve };
package/dist/http.d.ts ADDED
@@ -0,0 +1,46 @@
1
+ import { Hono } from 'hono';
2
+ import { C as CompilationService } from './service-891L1MYk.js';
3
+
4
+ /**
5
+ * HTTP/Edge Wrapper for CompilationService
6
+ *
7
+ * Thin Hono server exposing CompilationService over HTTP.
8
+ * Works on Node, Deno, Bun, and Cloudflare Workers.
9
+ *
10
+ * Usage:
11
+ * import { createApp } from '@lokascript/compilation-service/http';
12
+ * const app = createApp();
13
+ * // Use with any Hono-compatible server
14
+ *
15
+ * import { serve } from '@lokascript/compilation-service/http';
16
+ * serve({ port: 3001 }); // Starts Node server
17
+ */
18
+
19
+ interface HttpOptions {
20
+ /** API key for authentication (optional — skips /health) */
21
+ apiKey?: string;
22
+ /** CORS origin (default '*') */
23
+ corsOrigin?: string;
24
+ /** Port for serve() (default 3001) */
25
+ port?: number;
26
+ /** Pre-created service instance (skips lazy init) */
27
+ service?: CompilationService;
28
+ /** Enable production middleware (body limit, timeout, logger) */
29
+ production?: boolean;
30
+ /** Max request body in bytes (default 50KB, requires production: true) */
31
+ maxBodyBytes?: number;
32
+ /** Request timeout in ms (default 10000, requires production: true) */
33
+ timeoutMs?: number;
34
+ }
35
+ /**
36
+ * Create a Hono app wrapping CompilationService.
37
+ * Testable without starting a server — use `app.request()`.
38
+ */
39
+ declare function createApp(options?: HttpOptions): Hono;
40
+ /**
41
+ * Start a Node HTTP server with the compilation service.
42
+ * Convenience for CLI usage; for production, use createApp() with your server.
43
+ */
44
+ declare function serve(options?: HttpOptions): Promise<void>;
45
+
46
+ export { type HttpOptions, createApp, serve };
package/dist/http.js ADDED
@@ -0,0 +1,202 @@
1
+ import {
2
+ CompilationService
3
+ } from "./chunk-ODJIDVMN.js";
4
+ import "./chunk-HMLY7DHA.js";
5
+
6
+ // src/http.ts
7
+ import { Hono } from "hono";
8
+ import { cors } from "hono/cors";
9
+
10
+ // src/middleware/body-limit.ts
11
+ function bodyLimit(maxBytes = 50 * 1024) {
12
+ return async (c, next) => {
13
+ const contentLength = c.req.header("Content-Length");
14
+ if (contentLength && parseInt(contentLength, 10) > maxBytes) {
15
+ return c.json(
16
+ {
17
+ ok: false,
18
+ diagnostics: [
19
+ {
20
+ severity: "error",
21
+ code: "PAYLOAD_TOO_LARGE",
22
+ message: `Request body exceeds ${maxBytes} bytes`
23
+ }
24
+ ]
25
+ },
26
+ 413
27
+ );
28
+ }
29
+ return next();
30
+ };
31
+ }
32
+
33
+ // src/middleware/timeout.ts
34
+ function timeout(ms = 1e4) {
35
+ return async (c, next) => {
36
+ const controller = new AbortController();
37
+ const timer = setTimeout(() => controller.abort(), ms);
38
+ try {
39
+ const result = await Promise.race([
40
+ next(),
41
+ new Promise((_, reject) => {
42
+ controller.signal.addEventListener("abort", () => {
43
+ reject(new Error("Request timeout"));
44
+ });
45
+ })
46
+ ]);
47
+ return result;
48
+ } catch (err) {
49
+ if (err instanceof Error && err.message === "Request timeout") {
50
+ return c.json(
51
+ {
52
+ ok: false,
53
+ diagnostics: [
54
+ {
55
+ severity: "error",
56
+ code: "REQUEST_TIMEOUT",
57
+ message: `Request timed out after ${ms}ms`
58
+ }
59
+ ]
60
+ },
61
+ 504
62
+ );
63
+ }
64
+ throw err;
65
+ } finally {
66
+ clearTimeout(timer);
67
+ }
68
+ };
69
+ }
70
+
71
+ // src/middleware/logger.ts
72
+ function structuredLogger() {
73
+ return async (c, next) => {
74
+ const start = Date.now();
75
+ await next();
76
+ const durationMs = Date.now() - start;
77
+ const entry = {
78
+ timestamp: (/* @__PURE__ */ new Date()).toISOString(),
79
+ method: c.req.method,
80
+ path: new URL(c.req.url).pathname,
81
+ status: c.res.status,
82
+ durationMs
83
+ };
84
+ console.log(JSON.stringify(entry));
85
+ };
86
+ }
87
+
88
+ // src/http.ts
89
+ function createApp(options = {}) {
90
+ const app = new Hono();
91
+ let service = options.service ?? null;
92
+ let initPromise = null;
93
+ async function getService() {
94
+ if (service) return service;
95
+ if (!initPromise) {
96
+ initPromise = CompilationService.create().then((s) => {
97
+ service = s;
98
+ return s;
99
+ });
100
+ }
101
+ return initPromise;
102
+ }
103
+ app.use("*", cors({ origin: options.corsOrigin ?? "*" }));
104
+ if (options.production) {
105
+ app.use("*", bodyLimit(options.maxBodyBytes));
106
+ app.use("*", timeout(options.timeoutMs));
107
+ app.use("*", structuredLogger());
108
+ }
109
+ if (options.apiKey) {
110
+ app.use("*", async (c, next) => {
111
+ if (new URL(c.req.url).pathname === "/health") {
112
+ return next();
113
+ }
114
+ const auth = c.req.header("Authorization");
115
+ if (auth !== `Bearer ${options.apiKey}`) {
116
+ return c.json({ ok: false, error: "Unauthorized" }, 401);
117
+ }
118
+ return next();
119
+ });
120
+ }
121
+ app.get("/health", async (c) => {
122
+ const ready = service !== null;
123
+ const base = { ok: true, version: "1.4.0", ready, uptime: process.uptime() };
124
+ if (ready) {
125
+ return c.json({ ...base, cache: service.getCacheStats() });
126
+ }
127
+ return c.json(base);
128
+ });
129
+ app.post("/compile", async (c) => {
130
+ const svc = await getService();
131
+ const body = await c.req.json();
132
+ const result = svc.compile(body);
133
+ return c.json(result, result.ok ? 200 : 422);
134
+ });
135
+ app.post("/validate", async (c) => {
136
+ const svc = await getService();
137
+ const body = await c.req.json();
138
+ const result = svc.validate(body);
139
+ return c.json(result, result.ok ? 200 : 422);
140
+ });
141
+ app.post("/translate", async (c) => {
142
+ const svc = await getService();
143
+ const body = await c.req.json();
144
+ const result = svc.translate(body);
145
+ return c.json(result, result.ok ? 200 : 422);
146
+ });
147
+ app.post("/generate-tests", async (c) => {
148
+ const svc = await getService();
149
+ const body = await c.req.json();
150
+ const result = svc.generateTests(body);
151
+ return c.json(result, result.ok ? 200 : 422);
152
+ });
153
+ app.post("/generate-component", async (c) => {
154
+ const svc = await getService();
155
+ const body = await c.req.json();
156
+ const result = svc.generateComponent(body);
157
+ return c.json(result, result.ok ? 200 : 422);
158
+ });
159
+ app.post("/diff", async (c) => {
160
+ const svc = await getService();
161
+ const body = await c.req.json();
162
+ const result = svc.diff(body);
163
+ return c.json(result, result.ok ? 200 : 422);
164
+ });
165
+ app.get("/cache/stats", async (c) => {
166
+ const svc = await getService();
167
+ return c.json(svc.getCacheStats());
168
+ });
169
+ app.delete("/cache", async (c) => {
170
+ const svc = await getService();
171
+ svc.clearCache();
172
+ return c.json({ ok: true });
173
+ });
174
+ app.onError((err, c) => {
175
+ return c.json(
176
+ {
177
+ ok: false,
178
+ diagnostics: [
179
+ {
180
+ severity: "error",
181
+ code: "INTERNAL_ERROR",
182
+ message: err instanceof Error ? err.message : String(err)
183
+ }
184
+ ]
185
+ },
186
+ 500
187
+ );
188
+ });
189
+ return app;
190
+ }
191
+ async function serve(options = {}) {
192
+ const { serve: honoServe } = await import("@hono/node-server");
193
+ const app = createApp(options);
194
+ const port = options.port ?? 3001;
195
+ honoServe({ fetch: app.fetch, port });
196
+ console.log(`LokaScript Compilation Service listening on http://localhost:${port}`);
197
+ }
198
+ export {
199
+ createApp,
200
+ serve
201
+ };
202
+ //# sourceMappingURL=http.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/http.ts","../src/middleware/body-limit.ts","../src/middleware/timeout.ts","../src/middleware/logger.ts"],"sourcesContent":["/**\n * HTTP/Edge Wrapper for CompilationService\n *\n * Thin Hono server exposing CompilationService over HTTP.\n * Works on Node, Deno, Bun, and Cloudflare Workers.\n *\n * Usage:\n * import { createApp } from '@lokascript/compilation-service/http';\n * const app = createApp();\n * // Use with any Hono-compatible server\n *\n * import { serve } from '@lokascript/compilation-service/http';\n * serve({ port: 3001 }); // Starts Node server\n */\n\nimport { Hono } from 'hono';\nimport { cors } from 'hono/cors';\nimport { CompilationService } from './service.js';\nimport type {\n CompileRequest,\n TranslateRequest,\n TestRequest,\n ComponentRequest,\n DiffRequest,\n} from './types.js';\nimport { bodyLimit } from './middleware/body-limit.js';\nimport { timeout } from './middleware/timeout.js';\nimport { structuredLogger } from './middleware/logger.js';\n\n// =============================================================================\n// Types\n// =============================================================================\n\nexport interface HttpOptions {\n /** API key for authentication (optional — skips /health) */\n apiKey?: string;\n /** CORS origin (default '*') */\n corsOrigin?: string;\n /** Port for serve() (default 3001) */\n port?: number;\n /** Pre-created service instance (skips lazy init) */\n service?: CompilationService;\n /** Enable production middleware (body limit, timeout, logger) */\n production?: boolean;\n /** Max request body in bytes (default 50KB, requires production: true) */\n maxBodyBytes?: number;\n /** Request timeout in ms (default 10000, requires production: true) */\n timeoutMs?: number;\n}\n\n// =============================================================================\n// App Factory\n// =============================================================================\n\n/**\n * Create a Hono app wrapping CompilationService.\n * Testable without starting a server — use `app.request()`.\n */\nexport function createApp(options: HttpOptions = {}): Hono {\n const app = new Hono();\n\n // Lazy-init service on first request\n let service: CompilationService | null = options.service ?? null;\n let initPromise: Promise<CompilationService> | null = null;\n\n async function getService(): Promise<CompilationService> {\n if (service) return service;\n if (!initPromise) {\n initPromise = CompilationService.create().then(s => {\n service = s;\n return s;\n });\n }\n return initPromise;\n }\n\n // --- Middleware ---\n\n app.use('*', cors({ origin: options.corsOrigin ?? '*' }));\n\n // Production middleware (body limit, timeout, structured logging)\n if (options.production) {\n app.use('*', bodyLimit(options.maxBodyBytes));\n app.use('*', timeout(options.timeoutMs));\n app.use('*', structuredLogger());\n }\n\n // API key auth (optional)\n if (options.apiKey) {\n app.use('*', async (c, next) => {\n // Skip auth for health check\n if (new URL(c.req.url).pathname === '/health') {\n return next();\n }\n const auth = c.req.header('Authorization');\n if (auth !== `Bearer ${options.apiKey}`) {\n return c.json({ ok: false, error: 'Unauthorized' }, 401);\n }\n return next();\n });\n }\n\n // --- Routes ---\n\n app.get('/health', async c => {\n const ready = service !== null;\n const base = { ok: true, version: '1.4.0', ready, uptime: process.uptime() };\n if (ready) {\n return c.json({ ...base, cache: service!.getCacheStats() });\n }\n return c.json(base);\n });\n\n app.post('/compile', async c => {\n const svc = await getService();\n const body = await c.req.json<CompileRequest>();\n const result = svc.compile(body);\n return c.json(result, result.ok ? 200 : 422);\n });\n\n app.post('/validate', async c => {\n const svc = await getService();\n const body = await c.req.json<CompileRequest>();\n const result = svc.validate(body);\n return c.json(result, result.ok ? 200 : 422);\n });\n\n app.post('/translate', async c => {\n const svc = await getService();\n const body = await c.req.json<TranslateRequest>();\n const result = svc.translate(body);\n return c.json(result, result.ok ? 200 : 422);\n });\n\n app.post('/generate-tests', async c => {\n const svc = await getService();\n const body = await c.req.json<TestRequest>();\n const result = svc.generateTests(body);\n return c.json(result, result.ok ? 200 : 422);\n });\n\n app.post('/generate-component', async c => {\n const svc = await getService();\n const body = await c.req.json<ComponentRequest>();\n const result = svc.generateComponent(body);\n return c.json(result, result.ok ? 200 : 422);\n });\n\n app.post('/diff', async c => {\n const svc = await getService();\n const body = await c.req.json<DiffRequest>();\n const result = svc.diff(body);\n return c.json(result, result.ok ? 200 : 422);\n });\n\n app.get('/cache/stats', async c => {\n const svc = await getService();\n return c.json(svc.getCacheStats());\n });\n\n app.delete('/cache', async c => {\n const svc = await getService();\n svc.clearCache();\n return c.json({ ok: true });\n });\n\n // --- Error handler ---\n\n app.onError((err, c) => {\n return c.json(\n {\n ok: false,\n diagnostics: [\n {\n severity: 'error',\n code: 'INTERNAL_ERROR',\n message: err instanceof Error ? err.message : String(err),\n },\n ],\n },\n 500\n );\n });\n\n return app;\n}\n\n// =============================================================================\n// Node Server\n// =============================================================================\n\n/**\n * Start a Node HTTP server with the compilation service.\n * Convenience for CLI usage; for production, use createApp() with your server.\n */\nexport async function serve(options: HttpOptions = {}): Promise<void> {\n const { serve: honoServe } = await import('@hono/node-server');\n const app = createApp(options);\n const port = options.port ?? 3001;\n\n honoServe({ fetch: app.fetch, port });\n console.log(`LokaScript Compilation Service listening on http://localhost:${port}`);\n}\n","/**\n * Body Limit Middleware\n *\n * Rejects requests with Content-Length exceeding the configured limit.\n * Returns 413 Payload Too Large.\n */\n\nimport type { MiddlewareHandler } from 'hono';\n\nexport function bodyLimit(maxBytes: number = 50 * 1024): MiddlewareHandler {\n return async (c, next) => {\n const contentLength = c.req.header('Content-Length');\n if (contentLength && parseInt(contentLength, 10) > maxBytes) {\n return c.json(\n {\n ok: false,\n diagnostics: [\n {\n severity: 'error',\n code: 'PAYLOAD_TOO_LARGE',\n message: `Request body exceeds ${maxBytes} bytes`,\n },\n ],\n },\n 413\n );\n }\n return next();\n };\n}\n","/**\n * Timeout Middleware\n *\n * Aborts request processing after the configured duration.\n * Returns 504 Gateway Timeout.\n */\n\nimport type { MiddlewareHandler } from 'hono';\n\nexport function timeout(ms: number = 10_000): MiddlewareHandler {\n return async (c, next) => {\n const controller = new AbortController();\n const timer = setTimeout(() => controller.abort(), ms);\n\n try {\n const result = await Promise.race([\n next(),\n new Promise<never>((_, reject) => {\n controller.signal.addEventListener('abort', () => {\n reject(new Error('Request timeout'));\n });\n }),\n ]);\n return result;\n } catch (err) {\n if (err instanceof Error && err.message === 'Request timeout') {\n return c.json(\n {\n ok: false,\n diagnostics: [\n {\n severity: 'error',\n code: 'REQUEST_TIMEOUT',\n message: `Request timed out after ${ms}ms`,\n },\n ],\n },\n 504\n );\n }\n throw err;\n } finally {\n clearTimeout(timer);\n }\n };\n}\n","/**\n * Structured Logger Middleware\n *\n * Emits JSON log lines to stdout for each request.\n * Format: { timestamp, method, path, status, durationMs }\n */\n\nimport type { MiddlewareHandler } from 'hono';\n\nexport interface LogEntry {\n timestamp: string;\n method: string;\n path: string;\n status: number;\n durationMs: number;\n}\n\nexport function structuredLogger(): MiddlewareHandler {\n return async (c, next) => {\n const start = Date.now();\n await next();\n const durationMs = Date.now() - start;\n\n const entry: LogEntry = {\n timestamp: new Date().toISOString(),\n method: c.req.method,\n path: new URL(c.req.url).pathname,\n status: c.res.status,\n durationMs,\n };\n\n console.log(JSON.stringify(entry));\n };\n}\n"],"mappings":";;;;;;AAeA,SAAS,YAAY;AACrB,SAAS,YAAY;;;ACPd,SAAS,UAAU,WAAmB,KAAK,MAAyB;AACzE,SAAO,OAAO,GAAG,SAAS;AACxB,UAAM,gBAAgB,EAAE,IAAI,OAAO,gBAAgB;AACnD,QAAI,iBAAiB,SAAS,eAAe,EAAE,IAAI,UAAU;AAC3D,aAAO,EAAE;AAAA,QACP;AAAA,UACE,IAAI;AAAA,UACJ,aAAa;AAAA,YACX;AAAA,cACE,UAAU;AAAA,cACV,MAAM;AAAA,cACN,SAAS,wBAAwB,QAA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