@janux/server 0.2.0 → 0.2.1

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.
Files changed (2) hide show
  1. package/package.json +2 -2
  2. package/src/server.ts +5 -0
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@janux/server",
3
- "version": "0.2.0",
3
+ "version": "0.2.1",
4
4
  "description": "Janux fullstack server: SSR, api() RPC endpoints that double as agent tools, manifest service and MCP surface.",
5
5
  "repository": {
6
6
  "type": "git",
@@ -17,7 +17,7 @@
17
17
  ".": "./src/index.ts"
18
18
  },
19
19
  "dependencies": {
20
- "janux": "0.1.0",
20
+ "janux": "0.2.1",
21
21
  "web-bot-auth": "^0.1.3"
22
22
  },
23
23
  "homepage": "https://github.com/aralroca/Janux#readme",
package/src/server.ts CHANGED
@@ -8,6 +8,8 @@ import { buildLlmsTxt, expandPattern, type LlmsTxtConfig, type LlmsTxtTool } fro
8
8
 
9
9
  export interface AgentMount {
10
10
  handle(req: Request, deps: AgentDeps): Promise<Response>;
11
+ /** One-turn LLM proxy for browser-side agent loops (`serverLlm()` from `@janux/agent/local`). */
12
+ handleLlm?(req: Request): Promise<Response>;
11
13
  }
12
14
 
13
15
  export interface AgentDeps {
@@ -219,6 +221,9 @@ export function createJanuxServer(options: ServerOptions = {}) {
219
221
  if (pathname === '/_janux/manifest') {
220
222
  return json(await manifestFor(url.searchParams.get('path') ?? '/', await resolveCtx(req)));
221
223
  }
224
+ if (pathname === '/_janux/llm' && options.agent?.handleLlm) {
225
+ return options.agent.handleLlm(req);
226
+ }
222
227
  if (pathname === '/_janux/agent' && options.agent) {
223
228
  const ctx = await ctxWithAgent(req);
224
229