@njuptlzf/agent-chat-protocol 0.1.0 → 0.2.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.
package/dist/index.js ADDED
@@ -0,0 +1,19 @@
1
+ /**
2
+ * Wire protocol between the agent server and any chat UI.
3
+ *
4
+ * This file is the only contract the UI depends on. pi's own event shapes stay
5
+ * behind the server-side adapter, so upgrading pi never breaks a client.
6
+ * Bump PROTOCOL_VERSION on any breaking change.
7
+ */
8
+ export const PROTOCOL_VERSION = 7;
9
+ /**
10
+ * 产品**没有**声明 `agent.defaultPersona` 时用的兜底 id。
11
+ * core 只发明这一个 id(其余全部来自产品 manifest);它同时是配额/流水里
12
+ * 「默认助手那本账」的键。
13
+ */
14
+ export const DEFAULT_PERSONA_ID = "default";
15
+ /**
16
+ * `PersonaUi` 的展示字段(顺序即页面顺序)。manifest 加载与运行时配置校验共用这一份,
17
+ * 避免两处各写一份清单后漂移——漂移的表现是「页面能存、manifest 读不懂」。
18
+ */
19
+ export const PERSONA_UI_FIELDS = ["label", "icon", "tag", "hint", "welcome", "policyNote", "suggestions"];
package/package.json CHANGED
@@ -1,40 +1,42 @@
1
- {
2
- "name": "@njuptlzf/agent-chat-protocol",
3
- "version": "0.1.0",
4
- "description": "Wire protocol between the agentChat server and any chat UI: event, request/response and config types. Shapes only — no business semantics.",
5
- "type": "module",
6
- "license": "Apache-2.0",
7
- "main": "./src/index.ts",
8
- "types": "./src/index.ts",
9
- "exports": {
10
- ".": {
11
- "types": "./src/index.ts",
12
- "default": "./src/index.ts"
13
- },
14
- "./package.json": "./package.json"
15
- },
16
- "files": [
17
- "src"
18
- ],
19
- "repository": {
20
- "type": "git",
21
- "url": "git+https://github.com/njuptlzf/agent-chat.git",
22
- "directory": "packages/protocol"
23
- },
24
- "bugs": {
25
- "url": "https://github.com/njuptlzf/agent-chat/issues"
26
- },
27
- "homepage": "https://github.com/njuptlzf/agent-chat#readme",
28
- "keywords": [
29
- "agent-chat",
30
- "protocol",
31
- "chat",
32
- "sse"
33
- ],
34
- "engines": {
35
- "node": ">=22.13"
36
- },
37
- "publishConfig": {
38
- "access": "public"
39
- }
40
- }
1
+ {
2
+ "name": "@njuptlzf/agent-chat-protocol",
3
+ "version": "0.2.0",
4
+ "description": "Wire protocol between the agentChat server and any chat UI: event, request/response and config types. Shapes only — no business semantics.",
5
+ "type": "module",
6
+ "license": "Apache-2.0",
7
+ "main": "./dist/index.js",
8
+ "types": "./dist/index.d.ts",
9
+ "exports": {
10
+ ".": {
11
+ "agent-chat-source": "./src/index.ts",
12
+ "types": "./dist/index.d.ts",
13
+ "default": "./dist/index.js"
14
+ },
15
+ "./package.json": "./package.json"
16
+ },
17
+ "files": [
18
+ "dist",
19
+ "src"
20
+ ],
21
+ "repository": {
22
+ "type": "git",
23
+ "url": "git+https://github.com/njuptlzf/agent-chat.git",
24
+ "directory": "packages/protocol"
25
+ },
26
+ "bugs": {
27
+ "url": "https://github.com/njuptlzf/agent-chat/issues"
28
+ },
29
+ "homepage": "https://github.com/njuptlzf/agent-chat#readme",
30
+ "keywords": [
31
+ "agent-chat",
32
+ "protocol",
33
+ "chat",
34
+ "sse"
35
+ ],
36
+ "engines": {
37
+ "node": ">=22.13"
38
+ },
39
+ "publishConfig": {
40
+ "access": "public"
41
+ }
42
+ }