ai-ax 0.4.0 → 0.4.2
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/server.d.ts +2 -1
- package/dist/server.js +1 -1
- package/package.json +9 -5
package/dist/server.d.ts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { Grant } from "./types.js";
|
|
2
2
|
import { Call } from "./action.js";
|
|
3
|
+
import { BINDING } from "./const.js";
|
|
3
4
|
import { YServer } from "y-partyserver";
|
|
4
5
|
//#region src/server.d.ts
|
|
5
6
|
declare class AiaxServer extends YServer {
|
|
@@ -10,4 +11,4 @@ declare class AiaxServer extends YServer {
|
|
|
10
11
|
onRequest(request: Request): Promise<Response>;
|
|
11
12
|
}
|
|
12
13
|
//#endregion
|
|
13
|
-
export { AiaxServer, type Grant };
|
|
14
|
+
export { AiaxServer, BINDING, type Grant };
|
package/dist/server.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import"./const.js";import{actions as
|
|
1
|
+
import{BINDING as e}from"./const.js";import{actions as t,bind as n,init as r}from"./action.js";import{YServer as i}from"y-partyserver";var a=class extends i{wrap=e=>e();call=r(this.document,e=>this.wrap(e));grantOf(e){return{sub:e.headers.get(`x-user-sub`)??``,path:decodeURIComponent(e.headers.get(`x-user-path`)??``)}}async onAct(e,t){}async onRequest(e){if(n(this.document),e.method!==`POST`)return new Response(`Not Found`,{status:404});let{name:r,input:i}=await e.json();return t.get(r)?.side===`client`?Response.json({ok:!0,result:await this.call(r,i)}):(await this.onAct(this.grantOf(e),e),Response.json({ok:!0,result:await this.wrap(()=>this.call(r,i))}))}};export{a as AiaxServer,e as BINDING};
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "ai-ax",
|
|
3
3
|
"author": "tseijp",
|
|
4
|
-
"version": "0.4.
|
|
4
|
+
"version": "0.4.2",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"description": "AI Agent Experience (AI/AX) library for Hono + Cloudflare. One act surface for both human UI/UX and LLM MCP tools, with authentication, authorization, realtime sync and Claude API relay.",
|
|
7
7
|
"keywords": [
|
|
@@ -34,14 +34,18 @@
|
|
|
34
34
|
"types": "./dist/action.d.ts",
|
|
35
35
|
"default": "./dist/action.js"
|
|
36
36
|
},
|
|
37
|
-
"./server": {
|
|
38
|
-
"types": "./dist/server.d.ts",
|
|
39
|
-
"default": "./dist/server.js"
|
|
40
|
-
},
|
|
41
37
|
"./client": {
|
|
42
38
|
"types": "./dist/client.d.ts",
|
|
43
39
|
"default": "./dist/client.js"
|
|
44
40
|
},
|
|
41
|
+
"./const": {
|
|
42
|
+
"types": "./dist/const.d.ts",
|
|
43
|
+
"default": "./dist/const.js"
|
|
44
|
+
},
|
|
45
|
+
"./server": {
|
|
46
|
+
"types": "./dist/server.d.ts",
|
|
47
|
+
"default": "./dist/server.js"
|
|
48
|
+
},
|
|
45
49
|
"./src": {
|
|
46
50
|
"types": "./src/index.ts",
|
|
47
51
|
"default": "./src/index.ts"
|