@njuptlzf/agent-chat-protocol 0.2.0 → 0.3.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.d.ts +38 -1
- package/dist/index.js +3 -1
- package/package.json +42 -42
- package/src/index.ts +37 -1
package/dist/index.d.ts
CHANGED
|
@@ -513,17 +513,42 @@ export interface PersonaUi {
|
|
|
513
513
|
policyNote?: string;
|
|
514
514
|
/** 空态快捷问法。 */
|
|
515
515
|
suggestions?: string[];
|
|
516
|
+
/**
|
|
517
|
+
* 轮次结束后「下一步建议」的生效模式,覆盖全局 `branding.ui.followUp.mode`。
|
|
518
|
+
* 注意:全局 `off` 是硬地板,人格不能把全局关闭重新打开。
|
|
519
|
+
*/
|
|
520
|
+
followUpMode?: "off" | "static" | "llm";
|
|
516
521
|
}
|
|
517
522
|
/**
|
|
518
523
|
* `PersonaUi` 的展示字段(顺序即页面顺序)。manifest 加载与运行时配置校验共用这一份,
|
|
519
524
|
* 避免两处各写一份清单后漂移——漂移的表现是「页面能存、manifest 读不懂」。
|
|
525
|
+
* 注意:加字段要同步 3 处——本清单 + `loadPersonaUi` 的循环外专用块 + `parseUi`
|
|
526
|
+
* 的专用分支与其泛型 cast,见人格配置面设计稿 §17。
|
|
520
527
|
*/
|
|
521
|
-
export declare const PERSONA_UI_FIELDS: readonly ["label", "icon", "tag", "hint", "welcome", "policyNote", "suggestions"];
|
|
528
|
+
export declare const PERSONA_UI_FIELDS: readonly ["label", "icon", "tag", "hint", "welcome", "policyNote", "suggestions", "followUpMode"];
|
|
529
|
+
/** 一轮对话结束后展示的「下一步建议」配置。 */
|
|
530
|
+
interface BrandingFollowUp {
|
|
531
|
+
mode?: "off" | "static" | "llm";
|
|
532
|
+
/** 建议条数,默认 3。 */
|
|
533
|
+
count?: number;
|
|
534
|
+
/** static 模式的内容,也是生成失败时的回落。 */
|
|
535
|
+
static?: string[];
|
|
536
|
+
/** 覆盖内置的生成指令。 */
|
|
537
|
+
systemPrompt?: string;
|
|
538
|
+
maxMessages?: number;
|
|
539
|
+
timeoutMs?: number;
|
|
540
|
+
}
|
|
541
|
+
/** 视觉件与交互件的配置值。键是平台定义的语义槽名,不是组件名。 */
|
|
542
|
+
interface BrandingUi {
|
|
543
|
+
icons?: Record<string, string>;
|
|
544
|
+
followUp?: BrandingFollowUp;
|
|
545
|
+
}
|
|
522
546
|
/** What the UI needs to re-skin itself for a product. Served by GET /api/branding. */
|
|
523
547
|
export interface Branding {
|
|
524
548
|
title: string;
|
|
525
549
|
logo?: string;
|
|
526
550
|
welcome?: string;
|
|
551
|
+
/** 空态快捷问法;与 `ui.followUp`(轮次结束后的下一步)语义不同。 */
|
|
527
552
|
suggestions?: string[];
|
|
528
553
|
/**
|
|
529
554
|
* CSS custom properties injected on the app root, overriding the design
|
|
@@ -532,6 +557,8 @@ export interface Branding {
|
|
|
532
557
|
* from pre-token bundles is still honoured as a legacy alias.
|
|
533
558
|
*/
|
|
534
559
|
theme?: Record<string, string>;
|
|
560
|
+
/** 图标值 + 下一步建议配置;改这里不用改代码、不用重建前端。 */
|
|
561
|
+
ui?: BrandingUi;
|
|
535
562
|
}
|
|
536
563
|
/**
|
|
537
564
|
* A selectable quality tier as shown to the user. Deliberately carries no model
|
|
@@ -858,6 +885,15 @@ export interface ProductManifest {
|
|
|
858
885
|
routes?: string;
|
|
859
886
|
assembly?: string;
|
|
860
887
|
};
|
|
888
|
+
/**
|
|
889
|
+
* 准出声明:本产品实际使用的平台能力 ID 列表(机器可读声明面,唯一权威)。
|
|
890
|
+
* **运行时 no-op**——loadProduct 不校验、内核行为完全不受影响;合法性、
|
|
891
|
+
* 与 manifest/代码痕迹的双向对账、按声明跑测试门禁,全部由
|
|
892
|
+
* `agentchat-integrate check` 执行(注册表见平台仓 docs/specs/能力注册表.md)。
|
|
893
|
+
* 恒开能力(chat / auth-quota / branding / audit / admin-plane)不写在这里——
|
|
894
|
+
* 写了反而会被 check 判 FAIL。空列表合法:表示除恒开面外什么增量能力都没用。
|
|
895
|
+
*/
|
|
896
|
+
capabilities?: string[];
|
|
861
897
|
/**
|
|
862
898
|
* Usage-based billing in integer cents (-8). When present (and the server
|
|
863
899
|
* wires a BillingStore), a chat run needs a positive balance up front and
|
|
@@ -888,3 +924,4 @@ export interface ProductManifest {
|
|
|
888
924
|
}>;
|
|
889
925
|
};
|
|
890
926
|
}
|
|
927
|
+
export {};
|
package/dist/index.js
CHANGED
|
@@ -15,5 +15,7 @@ export const DEFAULT_PERSONA_ID = "default";
|
|
|
15
15
|
/**
|
|
16
16
|
* `PersonaUi` 的展示字段(顺序即页面顺序)。manifest 加载与运行时配置校验共用这一份,
|
|
17
17
|
* 避免两处各写一份清单后漂移——漂移的表现是「页面能存、manifest 读不懂」。
|
|
18
|
+
* 注意:加字段要同步 3 处——本清单 + `loadPersonaUi` 的循环外专用块 + `parseUi`
|
|
19
|
+
* 的专用分支与其泛型 cast,见人格配置面设计稿 §17。
|
|
18
20
|
*/
|
|
19
|
-
export const PERSONA_UI_FIELDS = ["label", "icon", "tag", "hint", "welcome", "policyNote", "suggestions"];
|
|
21
|
+
export const PERSONA_UI_FIELDS = ["label", "icon", "tag", "hint", "welcome", "policyNote", "suggestions", "followUpMode"];
|
package/package.json
CHANGED
|
@@ -1,42 +1,42 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "@njuptlzf/agent-chat-protocol",
|
|
3
|
-
"version": "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
|
-
}
|
|
1
|
+
{
|
|
2
|
+
"name": "@njuptlzf/agent-chat-protocol",
|
|
3
|
+
"version": "0.3.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
|
+
}
|
package/src/index.ts
CHANGED
|
@@ -474,17 +474,42 @@ export interface PersonaUi {
|
|
|
474
474
|
policyNote?: string;
|
|
475
475
|
/** 空态快捷问法。 */
|
|
476
476
|
suggestions?: string[];
|
|
477
|
+
/**
|
|
478
|
+
* 轮次结束后「下一步建议」的生效模式,覆盖全局 `branding.ui.followUp.mode`。
|
|
479
|
+
* 注意:全局 `off` 是硬地板,人格不能把全局关闭重新打开。
|
|
480
|
+
*/
|
|
481
|
+
followUpMode?: "off" | "static" | "llm";
|
|
477
482
|
}
|
|
478
483
|
/**
|
|
479
484
|
* `PersonaUi` 的展示字段(顺序即页面顺序)。manifest 加载与运行时配置校验共用这一份,
|
|
480
485
|
* 避免两处各写一份清单后漂移——漂移的表现是「页面能存、manifest 读不懂」。
|
|
486
|
+
* 注意:加字段要同步 3 处——本清单 + `loadPersonaUi` 的循环外专用块 + `parseUi`
|
|
487
|
+
* 的专用分支与其泛型 cast,见人格配置面设计稿 §17。
|
|
481
488
|
*/
|
|
482
|
-
export const PERSONA_UI_FIELDS = ["label", "icon", "tag", "hint", "welcome", "policyNote", "suggestions"] as const;
|
|
489
|
+
export const PERSONA_UI_FIELDS = ["label", "icon", "tag", "hint", "welcome", "policyNote", "suggestions", "followUpMode"] as const;
|
|
490
|
+
/** 一轮对话结束后展示的「下一步建议」配置。 */
|
|
491
|
+
interface BrandingFollowUp {
|
|
492
|
+
mode?: "off" | "static" | "llm";
|
|
493
|
+
/** 建议条数,默认 3。 */
|
|
494
|
+
count?: number;
|
|
495
|
+
/** static 模式的内容,也是生成失败时的回落。 */
|
|
496
|
+
static?: string[];
|
|
497
|
+
/** 覆盖内置的生成指令。 */
|
|
498
|
+
systemPrompt?: string;
|
|
499
|
+
maxMessages?: number;
|
|
500
|
+
timeoutMs?: number;
|
|
501
|
+
}
|
|
502
|
+
/** 视觉件与交互件的配置值。键是平台定义的语义槽名,不是组件名。 */
|
|
503
|
+
interface BrandingUi {
|
|
504
|
+
icons?: Record<string, string>;
|
|
505
|
+
followUp?: BrandingFollowUp;
|
|
506
|
+
}
|
|
483
507
|
/** What the UI needs to re-skin itself for a product. Served by GET /api/branding. */
|
|
484
508
|
export interface Branding {
|
|
485
509
|
title: string;
|
|
486
510
|
logo?: string;
|
|
487
511
|
welcome?: string;
|
|
512
|
+
/** 空态快捷问法;与 `ui.followUp`(轮次结束后的下一步)语义不同。 */
|
|
488
513
|
suggestions?: string[];
|
|
489
514
|
/**
|
|
490
515
|
* CSS custom properties injected on the app root, overriding the design
|
|
@@ -493,6 +518,8 @@ export interface Branding {
|
|
|
493
518
|
* from pre-token bundles is still honoured as a legacy alias.
|
|
494
519
|
*/
|
|
495
520
|
theme?: Record<string, string>;
|
|
521
|
+
/** 图标值 + 下一步建议配置;改这里不用改代码、不用重建前端。 */
|
|
522
|
+
ui?: BrandingUi;
|
|
496
523
|
}
|
|
497
524
|
/**
|
|
498
525
|
* A selectable quality tier as shown to the user. Deliberately carries no model
|
|
@@ -802,6 +829,15 @@ export interface ProductManifest {
|
|
|
802
829
|
* 信任级别与 `tools.inline` / `agent.extensions` 相同——都是仓库内代码。
|
|
803
830
|
*/
|
|
804
831
|
server?: { routes?: string; assembly?: string };
|
|
832
|
+
/**
|
|
833
|
+
* 准出声明:本产品实际使用的平台能力 ID 列表(机器可读声明面,唯一权威)。
|
|
834
|
+
* **运行时 no-op**——loadProduct 不校验、内核行为完全不受影响;合法性、
|
|
835
|
+
* 与 manifest/代码痕迹的双向对账、按声明跑测试门禁,全部由
|
|
836
|
+
* `agentchat-integrate check` 执行(注册表见平台仓 docs/specs/能力注册表.md)。
|
|
837
|
+
* 恒开能力(chat / auth-quota / branding / audit / admin-plane)不写在这里——
|
|
838
|
+
* 写了反而会被 check 判 FAIL。空列表合法:表示除恒开面外什么增量能力都没用。
|
|
839
|
+
*/
|
|
840
|
+
capabilities?: string[];
|
|
805
841
|
/**
|
|
806
842
|
* Usage-based billing in integer cents (-8). When present (and the server
|
|
807
843
|
* wires a BillingStore), a chat run needs a positive balance up front and
|