@njuptlzf/agent-chat-server 0.1.1 → 0.1.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/package.json +58 -58
- package/scripts/agentchat-integrate.mjs +8 -2
package/package.json
CHANGED
|
@@ -1,58 +1,58 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "@njuptlzf/agent-chat-server",
|
|
3
|
-
"version": "0.1.
|
|
4
|
-
"description": "agentChat platform kernel: sessions, authz, billing, audit, model/MCP/persona config planes, and the product-directory loader.",
|
|
5
|
-
"type": "module",
|
|
6
|
-
"license": "Apache-2.0",
|
|
7
|
-
"main": "./src/index.ts",
|
|
8
|
-
"types": "./src/index.ts",
|
|
9
|
-
"bin": {
|
|
10
|
-
"agentchat-integrate": "./scripts/agentchat-integrate.mjs"
|
|
11
|
-
},
|
|
12
|
-
"exports": {
|
|
13
|
-
".": {
|
|
14
|
-
"types": "./src/index.ts",
|
|
15
|
-
"default": "./src/index.ts"
|
|
16
|
-
},
|
|
17
|
-
"./main": "./src/main.ts",
|
|
18
|
-
"./testing": {
|
|
19
|
-
"types": "./src/testing.ts",
|
|
20
|
-
"default": "./src/testing.ts"
|
|
21
|
-
},
|
|
22
|
-
"./package.json": "./package.json"
|
|
23
|
-
},
|
|
24
|
-
"files": [
|
|
25
|
-
"src",
|
|
26
|
-
"scripts/agentchat-integrate.mjs"
|
|
27
|
-
],
|
|
28
|
-
"repository": {
|
|
29
|
-
"type": "git",
|
|
30
|
-
"url": "git+https://github.com/njuptlzf/agent-chat.git",
|
|
31
|
-
"directory": "packages/server"
|
|
32
|
-
},
|
|
33
|
-
"bugs": {
|
|
34
|
-
"url": "https://github.com/njuptlzf/agent-chat/issues"
|
|
35
|
-
},
|
|
36
|
-
"homepage": "https://github.com/njuptlzf/agent-chat#readme",
|
|
37
|
-
"keywords": [
|
|
38
|
-
"agent-chat",
|
|
39
|
-
"chat-server",
|
|
40
|
-
"authz",
|
|
41
|
-
"billing",
|
|
42
|
-
"audit"
|
|
43
|
-
],
|
|
44
|
-
"engines": {
|
|
45
|
-
"node": ">=22.13"
|
|
46
|
-
},
|
|
47
|
-
"publishConfig": {
|
|
48
|
-
"access": "public"
|
|
49
|
-
},
|
|
50
|
-
"dependencies": {
|
|
51
|
-
"@njuptlzf/agent-chat-protocol": "^0.1.0",
|
|
52
|
-
"@earendil-works/pi-coding-agent": "1.2.0",
|
|
53
|
-
"casbin": "^5.51.1",
|
|
54
|
-
"typebox": "^1.3.27",
|
|
55
|
-
"yaml": "^2.8.0",
|
|
56
|
-
"pi-scoped-memory": "^0.2.0"
|
|
57
|
-
}
|
|
58
|
-
}
|
|
1
|
+
{
|
|
2
|
+
"name": "@njuptlzf/agent-chat-server",
|
|
3
|
+
"version": "0.1.2",
|
|
4
|
+
"description": "agentChat platform kernel: sessions, authz, billing, audit, model/MCP/persona config planes, and the product-directory loader.",
|
|
5
|
+
"type": "module",
|
|
6
|
+
"license": "Apache-2.0",
|
|
7
|
+
"main": "./src/index.ts",
|
|
8
|
+
"types": "./src/index.ts",
|
|
9
|
+
"bin": {
|
|
10
|
+
"agentchat-integrate": "./scripts/agentchat-integrate.mjs"
|
|
11
|
+
},
|
|
12
|
+
"exports": {
|
|
13
|
+
".": {
|
|
14
|
+
"types": "./src/index.ts",
|
|
15
|
+
"default": "./src/index.ts"
|
|
16
|
+
},
|
|
17
|
+
"./main": "./src/main.ts",
|
|
18
|
+
"./testing": {
|
|
19
|
+
"types": "./src/testing.ts",
|
|
20
|
+
"default": "./src/testing.ts"
|
|
21
|
+
},
|
|
22
|
+
"./package.json": "./package.json"
|
|
23
|
+
},
|
|
24
|
+
"files": [
|
|
25
|
+
"src",
|
|
26
|
+
"scripts/agentchat-integrate.mjs"
|
|
27
|
+
],
|
|
28
|
+
"repository": {
|
|
29
|
+
"type": "git",
|
|
30
|
+
"url": "git+https://github.com/njuptlzf/agent-chat.git",
|
|
31
|
+
"directory": "packages/server"
|
|
32
|
+
},
|
|
33
|
+
"bugs": {
|
|
34
|
+
"url": "https://github.com/njuptlzf/agent-chat/issues"
|
|
35
|
+
},
|
|
36
|
+
"homepage": "https://github.com/njuptlzf/agent-chat#readme",
|
|
37
|
+
"keywords": [
|
|
38
|
+
"agent-chat",
|
|
39
|
+
"chat-server",
|
|
40
|
+
"authz",
|
|
41
|
+
"billing",
|
|
42
|
+
"audit"
|
|
43
|
+
],
|
|
44
|
+
"engines": {
|
|
45
|
+
"node": ">=22.13"
|
|
46
|
+
},
|
|
47
|
+
"publishConfig": {
|
|
48
|
+
"access": "public"
|
|
49
|
+
},
|
|
50
|
+
"dependencies": {
|
|
51
|
+
"@njuptlzf/agent-chat-protocol": "^0.1.0",
|
|
52
|
+
"@earendil-works/pi-coding-agent": "1.2.0",
|
|
53
|
+
"casbin": "^5.51.1",
|
|
54
|
+
"typebox": "^1.3.27",
|
|
55
|
+
"yaml": "^2.8.0",
|
|
56
|
+
"pi-scoped-memory": "^0.2.0"
|
|
57
|
+
}
|
|
58
|
+
}
|
|
@@ -18,7 +18,7 @@ import { spawnSync } from "node:child_process";
|
|
|
18
18
|
import { pathToFileURL } from "node:url";
|
|
19
19
|
import process from "node:process";
|
|
20
20
|
|
|
21
|
-
const CLI_VERSION = "0.1.
|
|
21
|
+
const CLI_VERSION = "0.1.2";
|
|
22
22
|
const MIN_SERVER = "0.1.1";
|
|
23
23
|
const PKG = {
|
|
24
24
|
protocol: "@njuptlzf/agent-chat-protocol",
|
|
@@ -444,7 +444,13 @@ function checkAppDef(add, dir) {
|
|
|
444
444
|
}
|
|
445
445
|
if (def) {
|
|
446
446
|
for (const field of ["home", "chatRoute", "routes", "navItems", "page"]) {
|
|
447
|
-
|
|
447
|
+
// 两种合法写法都要认:冒号属性(`navItems: () => [...]`)与 ES 简写
|
|
448
|
+
// (`navItems,`,值来自模块作用域的 const)。只用冒号正则会把简写误判成
|
|
449
|
+
// 「缺字段」——真实产品就这么写,属于假红。
|
|
450
|
+
// 简写只认行首,避免把 `import { guard, navItems, ROUTES }` 当成已声明。
|
|
451
|
+
const declared =
|
|
452
|
+
new RegExp(`\\b${field}\\s*:`).test(def) || new RegExp(`^\\s*${field}\\s*(?:,|\\}|$)`, "m").test(def);
|
|
453
|
+
if (!declared) problems.push(`app-def 缺 ${field}`);
|
|
448
454
|
}
|
|
449
455
|
const block = def.match(/routes:\s*\{([\s\S]*?)\}/);
|
|
450
456
|
if (block) {
|