@reminix/http-adapter 0.1.3 → 0.1.4

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/dist/cli.js CHANGED
@@ -431,16 +431,16 @@ __name(createMockKnowledgeBase, "createMockKnowledgeBase");
431
431
  // src/cli.ts
432
432
  import { parseArgs } from "util";
433
433
  import { extname as extname2 } from "path";
434
- import { createRequire } from "module";
435
- function tryRegisterTsx() {
434
+ async function tryRegisterTsx() {
436
435
  try {
437
- const require2 = createRequire(import.meta.url);
438
- const { register } = require2("tsx");
439
- register();
440
- return true;
436
+ const tsx = await import("tsx");
437
+ if (tsx && typeof tsx.register === "function") {
438
+ tsx.register();
439
+ return true;
440
+ }
441
441
  } catch {
442
- return false;
443
442
  }
443
+ return false;
444
444
  }
445
445
  __name(tryRegisterTsx, "tryRegisterTsx");
446
446
  function parseCliArgs() {
@@ -488,7 +488,7 @@ async function main() {
488
488
  const isTypeScript = ext === ".ts" || ext === ".tsx";
489
489
  const needsTsx = options.loader === "tsx" || isTypeScript && !options.loader;
490
490
  if (needsTsx) {
491
- const registered = tryRegisterTsx();
491
+ const registered = await tryRegisterTsx();
492
492
  if (!registered) {
493
493
  console.error('Error: TypeScript support requires "tsx" to be installed.');
494
494
  console.error("");
package/dist/cli.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/server.ts","../src/loader.ts","../src/registry.ts","../src/converter.ts","../src/cli.ts"],"sourcesContent":["/**\n * HTTP server for Reminix handlers\n */\n\nimport { createServer, IncomingMessage, ServerResponse } from 'http';\nimport { loadHandler, isFile } from './loader';\nimport { discoverRegistry } from './registry';\nimport { convertHttpToRequest, convertResponseToHttp, convertErrorToHttp } from './converter';\nimport type { Context, AgentHandler, ToolHandler } from '@reminix/sdk';\n\nexport interface ServerOptions {\n port?: number;\n host?: string;\n context?: (req: IncomingMessage) => Promise<Context> | Context;\n}\n\n/**\n * Start HTTP server for handler\n */\nexport async function startServer(handlerPath: string, options: ServerOptions = {}): Promise<void> {\n const port = options.port || 3000;\n const host = options.host || 'localhost';\n\n // Load handler or discover registry\n let agents: Record<string, AgentHandler> = {};\n let tools: Record<string, ToolHandler> = {};\n let prompts: Record<string, unknown> = {};\n\n if (isFile(handlerPath)) {\n // Single file handler\n const loaded = await loadHandler(handlerPath);\n agents = loaded.agents || {};\n tools = loaded.tools || {};\n prompts = loaded.prompts || {};\n } else {\n // Directory - auto-discover\n const registry = await discoverRegistry(handlerPath);\n agents = registry.agents;\n tools = registry.tools;\n prompts = registry.prompts;\n }\n\n // Create HTTP server\n const server = createServer(async (req: IncomingMessage, res: ServerResponse) => {\n try {\n // Set CORS headers\n res.setHeader('Access-Control-Allow-Origin', '*');\n res.setHeader('Access-Control-Allow-Methods', 'GET, POST, PUT, DELETE, OPTIONS');\n res.setHeader('Access-Control-Allow-Headers', 'Content-Type');\n\n // Handle OPTIONS request\n if (req.method === 'OPTIONS') {\n res.writeHead(200);\n res.end();\n return;\n }\n\n // Parse URL to determine route\n const url = new URL(req.url || '/', `http://${req.headers.host || 'localhost'}`);\n const pathParts = url.pathname.split('/').filter(Boolean);\n\n // Route: /agents/:agentId/invoke\n if (pathParts[0] === 'agents' && pathParts[2] === 'invoke') {\n const agentId = pathParts[1];\n const agent = agents[agentId];\n\n if (!agent) {\n res.writeHead(404, { 'Content-Type': 'application/json' });\n res.end(JSON.stringify({ error: `Agent not found: ${agentId}` }));\n return;\n }\n\n // Get context (provided by orchestrator or default)\n const context = options.context ? await options.context(req) : createDefaultContext(req);\n\n // Convert HTTP request to handler request\n const handlerReq = await convertHttpToRequest(req);\n\n // Call agent handler\n const handlerRes = await agent(context, handlerReq);\n\n // Convert handler response to HTTP response\n convertResponseToHttp(handlerRes, res);\n return;\n }\n\n // Route: /tools/:toolId/invoke\n if (pathParts[0] === 'tools' && pathParts[2] === 'invoke') {\n const toolId = pathParts[1];\n const tool = tools[toolId];\n\n if (!tool) {\n res.writeHead(404, { 'Content-Type': 'application/json' });\n res.end(JSON.stringify({ error: `Tool not found: ${toolId}` }));\n return;\n }\n\n // Get context\n const context = options.context ? await options.context(req) : createDefaultContext(req);\n\n // Convert HTTP request to handler request\n const handlerReq = await convertHttpToRequest(req);\n\n // Call tool handler\n const handlerRes = await tool(context, handlerReq);\n\n // Convert handler response to HTTP response\n convertResponseToHttp(handlerRes, res);\n return;\n }\n\n // Route: /health (health check)\n if (pathParts[0] === 'health' || url.pathname === '/') {\n res.writeHead(200, { 'Content-Type': 'application/json' });\n res.end(\n JSON.stringify({\n status: 'ok',\n agents: Object.keys(agents),\n tools: Object.keys(tools),\n prompts: Object.keys(prompts),\n })\n );\n return;\n }\n\n // 404 for unknown routes\n res.writeHead(404, { 'Content-Type': 'application/json' });\n res.end(JSON.stringify({ error: 'Not found' }));\n } catch (error) {\n convertErrorToHttp(error as Error, res);\n }\n });\n\n // Start server\n server.listen(port, host, () => {\n console.log(`Reminix HTTP adapter listening on http://${host}:${port}`);\n console.log(`Agents: ${Object.keys(agents).join(', ') || 'none'}`);\n console.log(`Tools: ${Object.keys(tools).join(', ') || 'none'}`);\n });\n\n // Handle server errors\n server.on('error', (error: Error) => {\n console.error('Server error:', error);\n });\n}\n\n/**\n * Create default context (for development)\n * In production, this would come from the orchestrator\n */\nfunction createDefaultContext(req: IncomingMessage): Context {\n // Extract chatId from headers or query params\n const chatId =\n req.headers['x-chat-id'] ||\n new URL(req.url || '/', `http://${req.headers.host || 'localhost'}`).searchParams.get(\n 'chatId'\n ) ||\n 'default-chat';\n\n // Return a minimal context (orchestrator will provide full context in production)\n return {\n chatId: chatId as string,\n memory: createMockMemoryStore(),\n knowledgeBase: createMockKnowledgeBase(),\n } as Context;\n}\n\n/**\n * Mock memory store for development\n */\nfunction createMockMemoryStore() {\n const store = new Map<string, unknown>();\n return {\n get: async (key: string) => store.get(key),\n set: async (key: string, value: unknown) => {\n store.set(key, value);\n },\n delete: async (key: string) => {\n store.delete(key);\n },\n clear: async () => {\n store.clear();\n },\n };\n}\n\n/**\n * Mock knowledge base for development\n */\nfunction createMockKnowledgeBase() {\n return {\n search: async (_query: string) => [],\n add: async (_content: string) => {},\n delete: async (_id: string) => {},\n };\n}\n","/**\n * Load handler from file\n */\n\nimport { pathToFileURL } from 'url';\nimport { statSync } from 'fs';\nimport type { AgentHandler, ToolHandler } from '@reminix/sdk';\n\nexport interface LoadedHandler {\n agents?: Record<string, AgentHandler>;\n tools?: Record<string, ToolHandler>;\n prompts?: Record<string, unknown>;\n}\n\n/**\n * Load handler from a file path\n * Supports both TypeScript (.ts) and JavaScript (.js) files\n */\nexport async function loadHandler(handlerPath: string): Promise<LoadedHandler> {\n try {\n // Convert file path to file URL for ES modules\n const fileUrl = pathToFileURL(handlerPath).href;\n\n // Dynamic import of the handler module\n const module = await import(fileUrl);\n\n // Extract agents, tools, and prompts\n const loaded: LoadedHandler = {};\n\n if (module.agents) {\n loaded.agents = module.agents;\n }\n\n if (module.tools) {\n loaded.tools = module.tools;\n }\n\n if (module.prompts) {\n loaded.prompts = module.prompts;\n }\n\n // Validate that at least one export exists\n if (!loaded.agents && !loaded.tools && !loaded.prompts) {\n throw new Error(\n `Handler file \"${handlerPath}\" must export at least one of: agents, tools, or prompts`\n );\n }\n\n return loaded;\n } catch (error) {\n if (error instanceof Error) {\n throw new Error(`Failed to load handler from \"${handlerPath}\": ${error.message}`);\n }\n throw error;\n }\n}\n\n/**\n * Check if a path is a file (not a directory)\n */\nexport function isFile(path: string): boolean {\n try {\n const stats = statSync(path);\n return stats.isFile();\n } catch {\n return false;\n }\n}\n","/**\n * Registry for auto-discovering agents, tools, and prompts from directories\n */\n\nimport { readdir, stat } from 'fs/promises';\nimport { join, extname, basename } from 'path';\nimport { pathToFileURL } from 'url';\nimport { loadHandler } from './loader';\nimport type { AgentHandler, ToolHandler } from '@reminix/sdk';\n\nexport interface Registry {\n agents: Record<string, AgentHandler>;\n tools: Record<string, ToolHandler>;\n prompts: Record<string, unknown>;\n}\n\n/**\n * Auto-discover and load handlers from a directory structure\n *\n * Expected structure:\n * handler/\n * agents/\n * chatbot.ts\n * assistant.ts\n * tools/\n * search.ts\n * prompts/\n * system.ts\n */\nexport async function discoverRegistry(handlerPath: string): Promise<Registry> {\n const registry: Registry = {\n agents: {},\n tools: {},\n prompts: {},\n };\n\n try {\n // Check if path exists and is a directory\n const stats = await stat(handlerPath);\n if (!stats.isDirectory()) {\n throw new Error(`Handler path must be a directory: ${handlerPath}`);\n }\n\n // Discover agents\n const agentsPath = join(handlerPath, 'agents');\n try {\n const agentsStats = await stat(agentsPath);\n if (agentsStats.isDirectory()) {\n const agents = await loadDirectory(agentsPath);\n // Filter to only AgentHandler types\n for (const [key, value] of Object.entries(agents)) {\n if (typeof value === 'function') {\n registry.agents[key] = value as AgentHandler;\n }\n }\n }\n } catch {\n // agents/ directory doesn't exist, skip\n }\n\n // Discover tools\n const toolsPath = join(handlerPath, 'tools');\n try {\n const toolsStats = await stat(toolsPath);\n if (toolsStats.isDirectory()) {\n const tools = await loadDirectory(toolsPath);\n // Filter to only ToolHandler types\n for (const [key, value] of Object.entries(tools)) {\n if (typeof value === 'function') {\n registry.tools[key] = value as ToolHandler;\n }\n }\n }\n } catch {\n // tools/ directory doesn't exist, skip\n }\n\n // Discover prompts\n const promptsPath = join(handlerPath, 'prompts');\n try {\n const promptsStats = await stat(promptsPath);\n if (promptsStats.isDirectory()) {\n const prompts = await loadDirectory(promptsPath);\n registry.prompts = prompts;\n }\n } catch {\n // prompts/ directory doesn't exist, skip\n }\n\n // Validate that at least something was discovered\n if (\n Object.keys(registry.agents).length === 0 &&\n Object.keys(registry.tools).length === 0 &&\n Object.keys(registry.prompts).length === 0\n ) {\n throw new Error(`No agents, tools, or prompts found in directory: ${handlerPath}`);\n }\n\n return registry;\n } catch (error) {\n if (error instanceof Error) {\n throw new Error(`Failed to discover registry from \"${handlerPath}\": ${error.message}`);\n }\n throw error;\n }\n}\n\n/**\n * Load all handler files from a directory\n * Filename (without extension) becomes the key in the registry\n */\nasync function loadDirectory(\n dirPath: string\n): Promise<Record<string, AgentHandler | ToolHandler | unknown>> {\n const handlers: Record<string, AgentHandler | ToolHandler | unknown> = {};\n\n try {\n const entries = await readdir(dirPath);\n\n for (const entry of entries) {\n const fullPath = join(dirPath, entry);\n const stats = await stat(fullPath);\n\n // Skip if not a file\n if (!stats.isFile()) {\n continue;\n }\n\n // Only process TypeScript/JavaScript files\n const ext = extname(entry);\n if (ext !== '.ts' && ext !== '.js' && ext !== '.mjs') {\n continue;\n }\n\n // Extract the key from filename (without extension)\n const key = entry.replace(ext, '');\n\n try {\n // Try loading as a handler file (expects agents/tools/prompts exports)\n const loaded = await loadHandler(fullPath);\n\n // Merge agents, tools, and prompts into the registry\n if (loaded.agents) {\n const agentKeys = Object.keys(loaded.agents);\n if (agentKeys.length === 1) {\n handlers[key] = loaded.agents[agentKeys[0]];\n } else {\n for (const agentKey of agentKeys) {\n handlers[`${key}.${agentKey}`] = loaded.agents[agentKey];\n }\n }\n }\n\n if (loaded.tools) {\n const toolKeys = Object.keys(loaded.tools);\n if (toolKeys.length === 1) {\n handlers[key] = loaded.tools[toolKeys[0]];\n } else {\n for (const toolKey of toolKeys) {\n handlers[`${key}.${toolKey}`] = loaded.tools[toolKey];\n }\n }\n }\n\n if (loaded.prompts) {\n const promptKeys = Object.keys(loaded.prompts);\n if (promptKeys.length === 1) {\n handlers[key] = loaded.prompts[promptKeys[0]];\n } else {\n for (const promptKey of promptKeys) {\n handlers[`${key}.${promptKey}`] = loaded.prompts[promptKey];\n }\n }\n }\n } catch {\n // If loadHandler fails, try loading as direct export\n // This handles files that export functions directly (e.g., export const chatbot)\n try {\n const fileUrl = pathToFileURL(fullPath).href;\n const module = await import(fileUrl);\n\n // Determine type based on directory name\n const dirName = basename(dirPath);\n\n // Check for direct exports matching the directory type\n if (dirName === 'agents') {\n // Look for exported function with same name as file, or any exported function\n const exportedFunction = module[key] || module.default;\n if (typeof exportedFunction === 'function') {\n handlers[key] = exportedFunction;\n }\n } else if (dirName === 'tools') {\n const exportedFunction = module[key] || module.default;\n if (typeof exportedFunction === 'function') {\n handlers[key] = exportedFunction;\n }\n } else if (dirName === 'prompts') {\n // For prompts, accept any export (function, object, string, etc.)\n // Try to get export with same name as file, or default, or any named export\n const exportedValue = module[key] || module.default;\n if (exportedValue !== undefined) {\n handlers[key] = exportedValue;\n } else {\n // Check if module has any exports (excluding default module properties)\n const moduleKeys = Object.keys(module).filter(\n (k) => k !== 'default' && !k.startsWith('__')\n );\n if (moduleKeys.length > 0) {\n // Use the first export, or the module itself if it's a simple object\n handlers[key] = module[moduleKeys[0]] || module;\n }\n }\n }\n } catch {\n // Skip this file if both methods fail\n continue;\n }\n }\n }\n\n return handlers;\n } catch (error) {\n if (error instanceof Error) {\n throw new Error(`Failed to load directory \"${dirPath}\": ${error.message}`);\n }\n throw error;\n }\n}\n","/**\n * Convert between HTTP and Handler formats\n */\n\nimport type { IncomingMessage, ServerResponse } from 'http';\nimport type { Request as HandlerRequest, Response as HandlerResponse, Message } from '@reminix/sdk';\n\n/**\n * Convert HTTP request to Handler Request\n * Extracts messages from HTTP request body\n */\nexport async function convertHttpToRequest(httpReq: IncomingMessage): Promise<HandlerRequest> {\n try {\n // Read request body\n const body = await readRequestBody(httpReq);\n\n // Parse JSON body\n let parsedBody: Record<string, unknown> = {};\n if (body) {\n try {\n parsedBody = JSON.parse(body) as Record<string, unknown>;\n } catch {\n // If not JSON, treat as text\n parsedBody = { content: body };\n }\n }\n\n // Extract messages from body\n // Expected format: { messages: Message[] } or { message: Message } or just Message[]\n let messages: Message[] = [];\n\n if (Array.isArray(parsedBody)) {\n // Body is array of messages\n messages = parsedBody as Message[];\n } else if (parsedBody.messages && Array.isArray(parsedBody.messages)) {\n // Body has messages array\n messages = parsedBody.messages as Message[];\n } else if (parsedBody.message) {\n // Body has single message\n messages = [parsedBody.message as Message];\n } else if (parsedBody.content || parsedBody.role) {\n // Body is a single message object\n messages = [parsedBody as unknown as Message];\n }\n\n // Extract metadata from query params and headers\n const metadata: Record<string, unknown> = {\n method: httpReq.method,\n url: httpReq.url,\n headers: httpReq.headers,\n };\n\n // Add query params to metadata\n if (httpReq.url) {\n const url = new URL(httpReq.url, `http://${httpReq.headers.host || 'localhost'}`);\n const queryParams: Record<string, string> = {};\n url.searchParams.forEach((value, key) => {\n queryParams[key] = value;\n });\n if (Object.keys(queryParams).length > 0) {\n metadata.query = queryParams;\n }\n }\n\n // Merge any additional metadata from body\n if (parsedBody.metadata) {\n Object.assign(metadata, parsedBody.metadata);\n }\n\n return {\n messages,\n metadata,\n };\n } catch (error) {\n if (error instanceof Error) {\n throw new Error(`Failed to convert HTTP request: ${error.message}`);\n }\n throw error;\n }\n}\n\n/**\n * Convert Handler Response to HTTP response\n */\nexport function convertResponseToHttp(handlerRes: HandlerResponse, httpRes: ServerResponse): void {\n try {\n // Set status code (default 200)\n const statusCode =\n typeof handlerRes.metadata?.statusCode === 'number' ? handlerRes.metadata.statusCode : 200;\n httpRes.statusCode = statusCode;\n\n // Set headers\n const headers =\n (handlerRes.metadata?.headers as Record<string, unknown> | undefined) ||\n ({} as Record<string, unknown>);\n headers['Content-Type'] =\n (typeof headers['Content-Type'] === 'string' ? headers['Content-Type'] : undefined) ||\n 'application/json';\n\n for (const [key, value] of Object.entries(headers)) {\n if (typeof value === 'string') {\n httpRes.setHeader(key, value);\n }\n }\n\n // Prepare response body\n const responseBody = {\n messages: handlerRes.messages,\n ...(handlerRes.metadata && { metadata: handlerRes.metadata }),\n ...(handlerRes.toolCalls && { toolCalls: handlerRes.toolCalls }),\n ...(handlerRes.stateUpdates && { stateUpdates: handlerRes.stateUpdates }),\n };\n\n // Send response\n httpRes.end(JSON.stringify(responseBody));\n } catch (error) {\n if (error instanceof Error) {\n httpRes.statusCode = 500;\n httpRes.setHeader('Content-Type', 'application/json');\n httpRes.end(JSON.stringify({ error: error.message }));\n }\n }\n}\n\n/**\n * Read request body from IncomingMessage\n */\nasync function readRequestBody(req: IncomingMessage): Promise<string> {\n return new Promise((resolve, reject) => {\n let body = '';\n\n req.on('data', (chunk) => {\n body += chunk.toString();\n });\n\n req.on('end', () => {\n resolve(body);\n });\n\n req.on('error', (error) => {\n reject(error);\n });\n });\n}\n\n/**\n * Convert error to HTTP error response\n */\nexport function convertErrorToHttp(error: Error, httpRes: ServerResponse): void {\n httpRes.statusCode = 500;\n httpRes.setHeader('Content-Type', 'application/json');\n httpRes.end(\n JSON.stringify({\n error: error.message,\n ...(process.env.NODE_ENV === 'development' && { stack: error.stack }),\n })\n );\n}\n","/**\n * CLI entry point for Reminix HTTP adapter\n *\n * Usage:\n * npx @reminix/http-adapter serve <handler-path> [options]\n * tsx src/cli.ts serve <handler-path> [options]\n */\n\nimport { startServer, type ServerOptions } from './server';\nimport { parseArgs } from 'util';\nimport { extname } from 'path';\nimport { createRequire } from 'module';\n\n/**\n * Try to register tsx loader for TypeScript support\n * Returns true if successful, false if tsx is not available\n */\nfunction tryRegisterTsx(): boolean {\n try {\n const require = createRequire(import.meta.url);\n const { register } = require('tsx');\n register();\n return true;\n } catch {\n return false;\n }\n}\n\ninterface CliOptions {\n port?: number;\n host?: string;\n handlerPath: string;\n loader?: string;\n}\n\nfunction parseCliArgs(): CliOptions {\n const args = process.argv.slice(2);\n\n if (args.length === 0 || args[0] !== 'serve') {\n console.error('Usage: reminix-http-adapter serve <handler-path> [options]');\n console.error('');\n console.error('Options:');\n console.error(' --port <number> Port to listen on (default: 3000)');\n console.error(' --host <string> Host to listen on (default: localhost)');\n console.error(' --loader <name> Loader to use for TypeScript support (e.g., tsx)');\n console.error('');\n console.error('Examples:');\n console.error(' npx @reminix/http-adapter serve ./my-handler.ts');\n console.error(' npx @reminix/http-adapter serve ./my-handler.ts --loader tsx');\n console.error(' npx @reminix/http-adapter serve ./my-handler --port 8080');\n process.exit(1);\n }\n\n const handlerPath = args[1];\n if (!handlerPath) {\n console.error('Error: handler-path is required');\n process.exit(1);\n }\n\n const { values } = parseArgs({\n args: args.slice(2),\n options: {\n port: { type: 'string' },\n host: { type: 'string' },\n loader: { type: 'string' },\n },\n });\n\n const options: CliOptions = {\n handlerPath,\n port: values.port ? parseInt(values.port, 10) : undefined,\n host: values.host,\n loader: values.loader,\n };\n\n return options;\n}\n\nasync function main() {\n try {\n const options = parseCliArgs();\n\n // Check if TypeScript support is needed\n const ext = extname(options.handlerPath).toLowerCase();\n const isTypeScript = ext === '.ts' || ext === '.tsx';\n const needsTsx = options.loader === 'tsx' || (isTypeScript && !options.loader);\n\n // Register tsx loader if needed\n if (needsTsx) {\n const registered = tryRegisterTsx();\n if (!registered) {\n console.error('Error: TypeScript support requires \"tsx\" to be installed.');\n console.error('');\n console.error('To install tsx:');\n console.error(' npm install -g tsx');\n console.error(' # or locally:');\n console.error(' npm install tsx');\n console.error('');\n console.error('Then run:');\n console.error(` npx @reminix/http-adapter serve ${options.handlerPath} --loader tsx`);\n console.error('');\n console.error('Alternatively, use Node.js with --import flag (Node 20.6+):');\n console.error(\n ` node --import tsx node_modules/@reminix/http-adapter/dist/cli.js serve ${options.handlerPath}`\n );\n process.exit(1);\n }\n }\n\n const serverOptions: ServerOptions = {\n port: options.port,\n host: options.host,\n };\n\n await startServer(options.handlerPath, serverOptions);\n } catch (error) {\n console.error('Error starting server:', error);\n process.exit(1);\n }\n}\n\n// Run if called directly\nmain();\n"],"mappings":";;;;;AAIA,SAAS,oBAAqD;;;ACA9D,SAAS,qBAAqB;AAC9B,SAAS,gBAAgB;AAazB,eAAsB,YAAY,aAA6C;AAC7E,MAAI;AAEF,UAAM,UAAU,cAAc,WAAW,EAAE;AAG3C,UAAM,SAAS,MAAM,OAAO;AAG5B,UAAM,SAAwB,CAAC;AAE/B,QAAI,OAAO,QAAQ;AACjB,aAAO,SAAS,OAAO;AAAA,IACzB;AAEA,QAAI,OAAO,OAAO;AAChB,aAAO,QAAQ,OAAO;AAAA,IACxB;AAEA,QAAI,OAAO,SAAS;AAClB,aAAO,UAAU,OAAO;AAAA,IAC1B;AAGA,QAAI,CAAC,OAAO,UAAU,C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gBAAQ,MAAM,EAAE;AAChB,gBAAQ,MAAM,iBAAiB;AAC/B,gBAAQ,MAAM,sBAAsB;AACpC,gBAAQ,MAAM,iBAAiB;AAC/B,gBAAQ,MAAM,mBAAmB;AACjC,gBAAQ,MAAM,EAAE;AAChB,gBAAQ,MAAM,WAAW;AACzB,gBAAQ,MAAM,qCAAqC,QAAQ,WAAW,eAAe;AACrF,gBAAQ,MAAM,EAAE;AAChB,gBAAQ,MAAM,6DAA6D;AAC3E,gBAAQ;AAAA,UACN,4EAA4E,QAAQ,WAAW;AAAA,QACjG;AACA,gBAAQ,KAAK,CAAC;AAAA,MAChB;AAAA,IACF;AAEA,UAAM,gBAA+B;AAAA,MACnC,MAAM,QAAQ;AAAA,MACd,MAAM,QAAQ;AAAA,IAChB;AAEA,UAAM,YAAY,QAAQ,aAAa,aAAa;AAAA,EACtD,SAAS,OAAO;AACd,YAAQ,MAAM,0BAA0B,KAAK;AAC7C,YAAQ,KAAK,CAAC;AAAA,EAChB;AACF;AAzCe;AA4Cf,KAAK;","names":["pathToFileURL","pathToFileURL","extname","require","extname"]}
1
+ {"version":3,"sources":["../src/server.ts","../src/loader.ts","../src/registry.ts","../src/converter.ts","../src/cli.ts"],"sourcesContent":["/**\n * HTTP server for Reminix handlers\n */\n\nimport { createServer, IncomingMessage, ServerResponse } from 'http';\nimport { loadHandler, isFile } from './loader';\nimport { discoverRegistry } from './registry';\nimport { convertHttpToRequest, convertResponseToHttp, convertErrorToHttp } from './converter';\nimport type { Context, AgentHandler, ToolHandler } from '@reminix/sdk';\n\nexport interface ServerOptions {\n port?: number;\n host?: string;\n context?: (req: IncomingMessage) => Promise<Context> | Context;\n}\n\n/**\n * Start HTTP server for handler\n */\nexport async function startServer(handlerPath: string, options: ServerOptions = {}): Promise<void> {\n const port = options.port || 3000;\n const host = options.host || 'localhost';\n\n // Load handler or discover registry\n let agents: Record<string, AgentHandler> = {};\n let tools: Record<string, ToolHandler> = {};\n let prompts: Record<string, unknown> = {};\n\n if (isFile(handlerPath)) {\n // Single file handler\n const loaded = await loadHandler(handlerPath);\n agents = loaded.agents || {};\n tools = loaded.tools || {};\n prompts = loaded.prompts || {};\n } else {\n // Directory - auto-discover\n const registry = await discoverRegistry(handlerPath);\n agents = registry.agents;\n tools = registry.tools;\n prompts = registry.prompts;\n }\n\n // Create HTTP server\n const server = createServer(async (req: IncomingMessage, res: ServerResponse) => {\n try {\n // Set CORS headers\n res.setHeader('Access-Control-Allow-Origin', '*');\n res.setHeader('Access-Control-Allow-Methods', 'GET, POST, PUT, DELETE, OPTIONS');\n res.setHeader('Access-Control-Allow-Headers', 'Content-Type');\n\n // Handle OPTIONS request\n if (req.method === 'OPTIONS') {\n res.writeHead(200);\n res.end();\n return;\n }\n\n // Parse URL to determine route\n const url = new URL(req.url || '/', `http://${req.headers.host || 'localhost'}`);\n const pathParts = url.pathname.split('/').filter(Boolean);\n\n // Route: /agents/:agentId/invoke\n if (pathParts[0] === 'agents' && pathParts[2] === 'invoke') {\n const agentId = pathParts[1];\n const agent = agents[agentId];\n\n if (!agent) {\n res.writeHead(404, { 'Content-Type': 'application/json' });\n res.end(JSON.stringify({ error: `Agent not found: ${agentId}` }));\n return;\n }\n\n // Get context (provided by orchestrator or default)\n const context = options.context ? await options.context(req) : createDefaultContext(req);\n\n // Convert HTTP request to handler request\n const handlerReq = await convertHttpToRequest(req);\n\n // Call agent handler\n const handlerRes = await agent(context, handlerReq);\n\n // Convert handler response to HTTP response\n convertResponseToHttp(handlerRes, res);\n return;\n }\n\n // Route: /tools/:toolId/invoke\n if (pathParts[0] === 'tools' && pathParts[2] === 'invoke') {\n const toolId = pathParts[1];\n const tool = tools[toolId];\n\n if (!tool) {\n res.writeHead(404, { 'Content-Type': 'application/json' });\n res.end(JSON.stringify({ error: `Tool not found: ${toolId}` }));\n return;\n }\n\n // Get context\n const context = options.context ? await options.context(req) : createDefaultContext(req);\n\n // Convert HTTP request to handler request\n const handlerReq = await convertHttpToRequest(req);\n\n // Call tool handler\n const handlerRes = await tool(context, handlerReq);\n\n // Convert handler response to HTTP response\n convertResponseToHttp(handlerRes, res);\n return;\n }\n\n // Route: /health (health check)\n if (pathParts[0] === 'health' || url.pathname === '/') {\n res.writeHead(200, { 'Content-Type': 'application/json' });\n res.end(\n JSON.stringify({\n status: 'ok',\n agents: Object.keys(agents),\n tools: Object.keys(tools),\n prompts: Object.keys(prompts),\n })\n );\n return;\n }\n\n // 404 for unknown routes\n res.writeHead(404, { 'Content-Type': 'application/json' });\n res.end(JSON.stringify({ error: 'Not found' }));\n } catch (error) {\n convertErrorToHttp(error as Error, res);\n }\n });\n\n // Start server\n server.listen(port, host, () => {\n console.log(`Reminix HTTP adapter listening on http://${host}:${port}`);\n console.log(`Agents: ${Object.keys(agents).join(', ') || 'none'}`);\n console.log(`Tools: ${Object.keys(tools).join(', ') || 'none'}`);\n });\n\n // Handle server errors\n server.on('error', (error: Error) => {\n console.error('Server error:', error);\n });\n}\n\n/**\n * Create default context (for development)\n * In production, this would come from the orchestrator\n */\nfunction createDefaultContext(req: IncomingMessage): Context {\n // Extract chatId from headers or query params\n const chatId =\n req.headers['x-chat-id'] ||\n new URL(req.url || '/', `http://${req.headers.host || 'localhost'}`).searchParams.get(\n 'chatId'\n ) ||\n 'default-chat';\n\n // Return a minimal context (orchestrator will provide full context in production)\n return {\n chatId: chatId as string,\n memory: createMockMemoryStore(),\n knowledgeBase: createMockKnowledgeBase(),\n } as Context;\n}\n\n/**\n * Mock memory store for development\n */\nfunction createMockMemoryStore() {\n const store = new Map<string, unknown>();\n return {\n get: async (key: string) => store.get(key),\n set: async (key: string, value: unknown) => {\n store.set(key, value);\n },\n delete: async (key: string) => {\n store.delete(key);\n },\n clear: async () => {\n store.clear();\n },\n };\n}\n\n/**\n * Mock knowledge base for development\n */\nfunction createMockKnowledgeBase() {\n return {\n search: async (_query: string) => [],\n add: async (_content: string) => {},\n delete: async (_id: string) => {},\n };\n}\n","/**\n * Load handler from file\n */\n\nimport { pathToFileURL } from 'url';\nimport { statSync } from 'fs';\nimport type { AgentHandler, ToolHandler } from '@reminix/sdk';\n\nexport interface LoadedHandler {\n agents?: Record<string, AgentHandler>;\n tools?: Record<string, ToolHandler>;\n prompts?: Record<string, unknown>;\n}\n\n/**\n * Load handler from a file path\n * Supports both TypeScript (.ts) and JavaScript (.js) files\n */\nexport async function loadHandler(handlerPath: string): Promise<LoadedHandler> {\n try {\n // Convert file path to file URL for ES modules\n const fileUrl = pathToFileURL(handlerPath).href;\n\n // Dynamic import of the handler module\n const module = await import(fileUrl);\n\n // Extract agents, tools, and prompts\n const loaded: LoadedHandler = {};\n\n if (module.agents) {\n loaded.agents = module.agents;\n }\n\n if (module.tools) {\n loaded.tools = module.tools;\n }\n\n if (module.prompts) {\n loaded.prompts = module.prompts;\n }\n\n // Validate that at least one export exists\n if (!loaded.agents && !loaded.tools && !loaded.prompts) {\n throw new Error(\n `Handler file \"${handlerPath}\" must export at least one of: agents, tools, or prompts`\n );\n }\n\n return loaded;\n } catch (error) {\n if (error instanceof Error) {\n throw new Error(`Failed to load handler from \"${handlerPath}\": ${error.message}`);\n }\n throw error;\n }\n}\n\n/**\n * Check if a path is a file (not a directory)\n */\nexport function isFile(path: string): boolean {\n try {\n const stats = statSync(path);\n return stats.isFile();\n } catch {\n return false;\n }\n}\n","/**\n * Registry for auto-discovering agents, tools, and prompts from directories\n */\n\nimport { readdir, stat } from 'fs/promises';\nimport { join, extname, basename } from 'path';\nimport { pathToFileURL } from 'url';\nimport { loadHandler } from './loader';\nimport type { AgentHandler, ToolHandler } from '@reminix/sdk';\n\nexport interface Registry {\n agents: Record<string, AgentHandler>;\n tools: Record<string, ToolHandler>;\n prompts: Record<string, unknown>;\n}\n\n/**\n * Auto-discover and load handlers from a directory structure\n *\n * Expected structure:\n * handler/\n * agents/\n * chatbot.ts\n * assistant.ts\n * tools/\n * search.ts\n * prompts/\n * system.ts\n */\nexport async function discoverRegistry(handlerPath: string): Promise<Registry> {\n const registry: Registry = {\n agents: {},\n tools: {},\n prompts: {},\n };\n\n try {\n // Check if path exists and is a directory\n const stats = await stat(handlerPath);\n if (!stats.isDirectory()) {\n throw new Error(`Handler path must be a directory: ${handlerPath}`);\n }\n\n // Discover agents\n const agentsPath = join(handlerPath, 'agents');\n try {\n const agentsStats = await stat(agentsPath);\n if (agentsStats.isDirectory()) {\n const agents = await loadDirectory(agentsPath);\n // Filter to only AgentHandler types\n for (const [key, value] of Object.entries(agents)) {\n if (typeof value === 'function') {\n registry.agents[key] = value as AgentHandler;\n }\n }\n }\n } catch {\n // agents/ directory doesn't exist, skip\n }\n\n // Discover tools\n const toolsPath = join(handlerPath, 'tools');\n try {\n const toolsStats = await stat(toolsPath);\n if (toolsStats.isDirectory()) {\n const tools = await loadDirectory(toolsPath);\n // Filter to only ToolHandler types\n for (const [key, value] of Object.entries(tools)) {\n if (typeof value === 'function') {\n registry.tools[key] = value as ToolHandler;\n }\n }\n }\n } catch {\n // tools/ directory doesn't exist, skip\n }\n\n // Discover prompts\n const promptsPath = join(handlerPath, 'prompts');\n try {\n const promptsStats = await stat(promptsPath);\n if (promptsStats.isDirectory()) {\n const prompts = await loadDirectory(promptsPath);\n registry.prompts = prompts;\n }\n } catch {\n // prompts/ directory doesn't exist, skip\n }\n\n // Validate that at least something was discovered\n if (\n Object.keys(registry.agents).length === 0 &&\n Object.keys(registry.tools).length === 0 &&\n Object.keys(registry.prompts).length === 0\n ) {\n throw new Error(`No agents, tools, or prompts found in directory: ${handlerPath}`);\n }\n\n return registry;\n } catch (error) {\n if (error instanceof Error) {\n throw new Error(`Failed to discover registry from \"${handlerPath}\": ${error.message}`);\n }\n throw error;\n }\n}\n\n/**\n * Load all handler files from a directory\n * Filename (without extension) becomes the key in the registry\n */\nasync function loadDirectory(\n dirPath: string\n): Promise<Record<string, AgentHandler | ToolHandler | unknown>> {\n const handlers: Record<string, AgentHandler | ToolHandler | unknown> = {};\n\n try {\n const entries = await readdir(dirPath);\n\n for (const entry of entries) {\n const fullPath = join(dirPath, entry);\n const stats = await stat(fullPath);\n\n // Skip if not a file\n if (!stats.isFile()) {\n continue;\n }\n\n // Only process TypeScript/JavaScript files\n const ext = extname(entry);\n if (ext !== '.ts' && ext !== '.js' && ext !== '.mjs') {\n continue;\n }\n\n // Extract the key from filename (without extension)\n const key = entry.replace(ext, '');\n\n try {\n // Try loading as a handler file (expects agents/tools/prompts exports)\n const loaded = await loadHandler(fullPath);\n\n // Merge agents, tools, and prompts into the registry\n if (loaded.agents) {\n const agentKeys = Object.keys(loaded.agents);\n if (agentKeys.length === 1) {\n handlers[key] = loaded.agents[agentKeys[0]];\n } else {\n for (const agentKey of agentKeys) {\n handlers[`${key}.${agentKey}`] = loaded.agents[agentKey];\n }\n }\n }\n\n if (loaded.tools) {\n const toolKeys = Object.keys(loaded.tools);\n if (toolKeys.length === 1) {\n handlers[key] = loaded.tools[toolKeys[0]];\n } else {\n for (const toolKey of toolKeys) {\n handlers[`${key}.${toolKey}`] = loaded.tools[toolKey];\n }\n }\n }\n\n if (loaded.prompts) {\n const promptKeys = Object.keys(loaded.prompts);\n if (promptKeys.length === 1) {\n handlers[key] = loaded.prompts[promptKeys[0]];\n } else {\n for (const promptKey of promptKeys) {\n handlers[`${key}.${promptKey}`] = loaded.prompts[promptKey];\n }\n }\n }\n } catch {\n // If loadHandler fails, try loading as direct export\n // This handles files that export functions directly (e.g., export const chatbot)\n try {\n const fileUrl = pathToFileURL(fullPath).href;\n const module = await import(fileUrl);\n\n // Determine type based on directory name\n const dirName = basename(dirPath);\n\n // Check for direct exports matching the directory type\n if (dirName === 'agents') {\n // Look for exported function with same name as file, or any exported function\n const exportedFunction = module[key] || module.default;\n if (typeof exportedFunction === 'function') {\n handlers[key] = exportedFunction;\n }\n } else if (dirName === 'tools') {\n const exportedFunction = module[key] || module.default;\n if (typeof exportedFunction === 'function') {\n handlers[key] = exportedFunction;\n }\n } else if (dirName === 'prompts') {\n // For prompts, accept any export (function, object, string, etc.)\n // Try to get export with same name as file, or default, or any named export\n const exportedValue = module[key] || module.default;\n if (exportedValue !== undefined) {\n handlers[key] = exportedValue;\n } else {\n // Check if module has any exports (excluding default module properties)\n const moduleKeys = Object.keys(module).filter(\n (k) => k !== 'default' && !k.startsWith('__')\n );\n if (moduleKeys.length > 0) {\n // Use the first export, or the module itself if it's a simple object\n handlers[key] = module[moduleKeys[0]] || module;\n }\n }\n }\n } catch {\n // Skip this file if both methods fail\n continue;\n }\n }\n }\n\n return handlers;\n } catch (error) {\n if (error instanceof Error) {\n throw new Error(`Failed to load directory \"${dirPath}\": ${error.message}`);\n }\n throw error;\n }\n}\n","/**\n * Convert between HTTP and Handler formats\n */\n\nimport type { IncomingMessage, ServerResponse } from 'http';\nimport type { Request as HandlerRequest, Response as HandlerResponse, Message } from '@reminix/sdk';\n\n/**\n * Convert HTTP request to Handler Request\n * Extracts messages from HTTP request body\n */\nexport async function convertHttpToRequest(httpReq: IncomingMessage): Promise<HandlerRequest> {\n try {\n // Read request body\n const body = await readRequestBody(httpReq);\n\n // Parse JSON body\n let parsedBody: Record<string, unknown> = {};\n if (body) {\n try {\n parsedBody = JSON.parse(body) as Record<string, unknown>;\n } catch {\n // If not JSON, treat as text\n parsedBody = { content: body };\n }\n }\n\n // Extract messages from body\n // Expected format: { messages: Message[] } or { message: Message } or just Message[]\n let messages: Message[] = [];\n\n if (Array.isArray(parsedBody)) {\n // Body is array of messages\n messages = parsedBody as Message[];\n } else if (parsedBody.messages && Array.isArray(parsedBody.messages)) {\n // Body has messages array\n messages = parsedBody.messages as Message[];\n } else if (parsedBody.message) {\n // Body has single message\n messages = [parsedBody.message as Message];\n } else if (parsedBody.content || parsedBody.role) {\n // Body is a single message object\n messages = [parsedBody as unknown as Message];\n }\n\n // Extract metadata from query params and headers\n const metadata: Record<string, unknown> = {\n method: httpReq.method,\n url: httpReq.url,\n headers: httpReq.headers,\n };\n\n // Add query params to metadata\n if (httpReq.url) {\n const url = new URL(httpReq.url, `http://${httpReq.headers.host || 'localhost'}`);\n const queryParams: Record<string, string> = {};\n url.searchParams.forEach((value, key) => {\n queryParams[key] = value;\n });\n if (Object.keys(queryParams).length > 0) {\n metadata.query = queryParams;\n }\n }\n\n // Merge any additional metadata from body\n if (parsedBody.metadata) {\n Object.assign(metadata, parsedBody.metadata);\n }\n\n return {\n messages,\n metadata,\n };\n } catch (error) {\n if (error instanceof Error) {\n throw new Error(`Failed to convert HTTP request: ${error.message}`);\n }\n throw error;\n }\n}\n\n/**\n * Convert Handler Response to HTTP response\n */\nexport function convertResponseToHttp(handlerRes: HandlerResponse, httpRes: ServerResponse): void {\n try {\n // Set status code (default 200)\n const statusCode =\n typeof handlerRes.metadata?.statusCode === 'number' ? handlerRes.metadata.statusCode : 200;\n httpRes.statusCode = statusCode;\n\n // Set headers\n const headers =\n (handlerRes.metadata?.headers as Record<string, unknown> | undefined) ||\n ({} as Record<string, unknown>);\n headers['Content-Type'] =\n (typeof headers['Content-Type'] === 'string' ? headers['Content-Type'] : undefined) ||\n 'application/json';\n\n for (const [key, value] of Object.entries(headers)) {\n if (typeof value === 'string') {\n httpRes.setHeader(key, value);\n }\n }\n\n // Prepare response body\n const responseBody = {\n messages: handlerRes.messages,\n ...(handlerRes.metadata && { metadata: handlerRes.metadata }),\n ...(handlerRes.toolCalls && { toolCalls: handlerRes.toolCalls }),\n ...(handlerRes.stateUpdates && { stateUpdates: handlerRes.stateUpdates }),\n };\n\n // Send response\n httpRes.end(JSON.stringify(responseBody));\n } catch (error) {\n if (error instanceof Error) {\n httpRes.statusCode = 500;\n httpRes.setHeader('Content-Type', 'application/json');\n httpRes.end(JSON.stringify({ error: error.message }));\n }\n }\n}\n\n/**\n * Read request body from IncomingMessage\n */\nasync function readRequestBody(req: IncomingMessage): Promise<string> {\n return new Promise((resolve, reject) => {\n let body = '';\n\n req.on('data', (chunk) => {\n body += chunk.toString();\n });\n\n req.on('end', () => {\n resolve(body);\n });\n\n req.on('error', (error) => {\n reject(error);\n });\n });\n}\n\n/**\n * Convert error to HTTP error response\n */\nexport function convertErrorToHttp(error: Error, httpRes: ServerResponse): void {\n httpRes.statusCode = 500;\n httpRes.setHeader('Content-Type', 'application/json');\n httpRes.end(\n JSON.stringify({\n error: error.message,\n ...(process.env.NODE_ENV === 'development' && { stack: error.stack }),\n })\n );\n}\n","/**\n * CLI entry point for Reminix HTTP adapter\n *\n * Usage:\n * npx @reminix/http-adapter serve <handler-path> [options]\n * tsx src/cli.ts serve <handler-path> [options]\n */\n\nimport { startServer, type ServerOptions } from './server';\nimport { parseArgs } from 'util';\nimport { extname } from 'path';\n\n/**\n * Try to register tsx loader for TypeScript support\n * Uses dynamic import which respects Node's module resolution including global packages\n * Returns true if successful, false if tsx is not available\n */\nasync function tryRegisterTsx(): Promise<boolean> {\n try {\n // Use dynamic import which works with both local and globally installed packages\n // This respects Node's module resolution algorithm\n // @ts-expect-error - tsx is an optional runtime dependency, not available at compile time\n const tsx = await import('tsx');\n if (tsx && typeof tsx.register === 'function') {\n tsx.register();\n return true;\n }\n } catch {\n // tsx not available\n }\n return false;\n}\n\ninterface CliOptions {\n port?: number;\n host?: string;\n handlerPath: string;\n loader?: string;\n}\n\nfunction parseCliArgs(): CliOptions {\n const args = process.argv.slice(2);\n\n if (args.length === 0 || args[0] !== 'serve') {\n console.error('Usage: reminix-http-adapter serve <handler-path> [options]');\n console.error('');\n console.error('Options:');\n console.error(' --port <number> Port to listen on (default: 3000)');\n console.error(' --host <string> Host to listen on (default: localhost)');\n console.error(' --loader <name> Loader to use for TypeScript support (e.g., tsx)');\n console.error('');\n console.error('Examples:');\n console.error(' npx @reminix/http-adapter serve ./my-handler.ts');\n console.error(' npx @reminix/http-adapter serve ./my-handler.ts --loader tsx');\n console.error(' npx @reminix/http-adapter serve ./my-handler --port 8080');\n process.exit(1);\n }\n\n const handlerPath = args[1];\n if (!handlerPath) {\n console.error('Error: handler-path is required');\n process.exit(1);\n }\n\n const { values } = parseArgs({\n args: args.slice(2),\n options: {\n port: { type: 'string' },\n host: { type: 'string' },\n loader: { type: 'string' },\n },\n });\n\n const options: CliOptions = {\n handlerPath,\n port: values.port ? parseInt(values.port, 10) : undefined,\n host: values.host,\n loader: values.loader,\n };\n\n return options;\n}\n\nasync function main() {\n try {\n const options = parseCliArgs();\n\n // Check if TypeScript support is needed\n const ext = extname(options.handlerPath).toLowerCase();\n const isTypeScript = ext === '.ts' || ext === '.tsx';\n const needsTsx = options.loader === 'tsx' || (isTypeScript && !options.loader);\n\n // Register tsx loader if needed\n if (needsTsx) {\n const registered = await tryRegisterTsx();\n if (!registered) {\n console.error('Error: TypeScript support requires \"tsx\" to be installed.');\n console.error('');\n console.error('To install tsx:');\n console.error(' npm install -g tsx');\n console.error(' # or locally:');\n console.error(' npm install tsx');\n console.error('');\n console.error('Then run:');\n console.error(` npx @reminix/http-adapter serve ${options.handlerPath} --loader tsx`);\n console.error('');\n console.error('Alternatively, use Node.js with --import flag (Node 20.6+):');\n console.error(\n ` node --import tsx node_modules/@reminix/http-adapter/dist/cli.js serve ${options.handlerPath}`\n );\n process.exit(1);\n }\n }\n\n const serverOptions: ServerOptions = {\n port: options.port,\n host: options.host,\n };\n\n await startServer(options.handlerPath, serverOptions);\n } catch (error) {\n console.error('Error starting server:', error);\n process.exit(1);\n }\n}\n\n// Run if called directly\nmain();\n"],"mappings":";;;;;AAIA,SAAS,oBAAqD;;;ACA9D,SAAS,qBAAqB;AAC9B,SAAS,gBAAgB;AAazB,eAAsB,YAAY,aAA6C;AAC7E,MAAI;AAEF,UAAM,UAAU,cAAc,WAAW,EAAE;AAG3C,UAAM,SAAS,MAAM,OAAO;AAG5B,UAAM,SAAwB,CAAC;AAE/B,QAAI,OAAO,QAAQ;AACjB,aAAO,SAAS,OAAO;AAAA,IACzB;AAEA,QAAI,OAAO,OAAO;AAChB,aAAO,QAAQ,OAAO;AAAA,IACxB;AAEA,QAAI,OAAO,SAAS;AAClB,aAAO,UAAU,OAAO;AAAA,IAC1B;AAGA,QAAI,CAAC,OAAO,UAAU,CAAC,OAAO,SAAS,CAAC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AAChB,gBAAQ,MAAM,iBAAiB;AAC/B,gBAAQ,MAAM,sBAAsB;AACpC,gBAAQ,MAAM,iBAAiB;AAC/B,gBAAQ,MAAM,mBAAmB;AACjC,gBAAQ,MAAM,EAAE;AAChB,gBAAQ,MAAM,WAAW;AACzB,gBAAQ,MAAM,qCAAqC,QAAQ,WAAW,eAAe;AACrF,gBAAQ,MAAM,EAAE;AAChB,gBAAQ,MAAM,6DAA6D;AAC3E,gBAAQ;AAAA,UACN,4EAA4E,QAAQ,WAAW;AAAA,QACjG;AACA,gBAAQ,KAAK,CAAC;AAAA,MAChB;AAAA,IACF;AAEA,UAAM,gBAA+B;AAAA,MACnC,MAAM,QAAQ;AAAA,MACd,MAAM,QAAQ;AAAA,IAChB;AAEA,UAAM,YAAY,QAAQ,aAAa,aAAa;AAAA,EACtD,SAAS,OAAO;AACd,YAAQ,MAAM,0BAA0B,KAAK;AAC7C,YAAQ,KAAK,CAAC;AAAA,EAChB;AACF;AAzCe;AA4Cf,KAAK;","names":["pathToFileURL","pathToFileURL","extname","extname"]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@reminix/http-adapter",
3
- "version": "0.1.3",
3
+ "version": "0.1.4",
4
4
  "type": "module",
5
5
  "description": "Reminix HTTP adapter for running handlers",
6
6
  "main": "./dist/index.js",
@@ -33,7 +33,7 @@
33
33
  },
34
34
  "homepage": "https://github.com/reminix-ai/reminix-typescript",
35
35
  "dependencies": {
36
- "@reminix/sdk": "0.1.3"
36
+ "@reminix/sdk": "0.1.4"
37
37
  },
38
38
  "devDependencies": {
39
39
  "@types/node": "^25.0.3",