@tbox.cn/app-agent-sdk-server 1.0.0-alpha.12 → 1.0.0-alpha.14
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/chunk-NPVS6HQT.js +1 -0
- package/dist/config.d.ts +18 -15
- package/dist/config.js +1 -1
- package/dist/server/index.d.ts +8 -3
- package/dist/server/index.js +33 -33
- package/package.json +5 -5
- package/dist/chunk-V4AW6UBY.js +0 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{z as e}from"zod";var n=e.object({enableImageUpload:e.boolean().default(!0).describe("出厂能力:图片上传,默认开启;只有用户明确要求时才改为 false"),enableVideoUpload:e.boolean().default(!0).describe("出厂能力:视频上传,默认开启;只有用户明确要求时才改为 false"),enableTTS:e.boolean().default(!0).describe("出厂能力:语音播报,默认开启;关闭需在交付说明里声明"),enableVoiceInput:e.boolean().default(!0).describe("出厂能力:语音输入,默认开启;只有用户明确要求时才可关闭"),defaultInputMode:e.enum(["TEXT","VOICE"]).default("TEXT"),quickCommands:e.array(e.object({label:e.string().describe("展示文案"),query:e.string().describe("点击后发送给智能体的用户消息")}).passthrough()).default([]),input:e.object({minRows:e.number().int().min(1).max(4).default(1).describe("空输入框占几行;出厂 1,只有用户明确要求时才改"),maxRows:e.number().int().min(1).max(8).default(4).describe("自动长高的上限行数;超过后框内滚动")}).default({}).describe("输入框行数与长高上限"),welcome:e.object({title:e.string(),subtitle:e.string().optional()}).optional(),retryOnError:e.boolean().default(!0)}),o={enableImageUpload:{id:"input.image",title:"图片上传",change:"declared",control:"media-add"},enableVideoUpload:{id:"input.video",title:"视频上传",change:"declared",control:"media-add"},enableTTS:{id:"output.tts",title:"语音播报",change:"declared"},enableVoiceInput:{id:"input.voice",title:"语音输入",change:"user-intent",control:"voice-toggle"},"input.minRows":{id:"input.rows",title:"输入框行数",change:"user-intent"}},l=e.strictObject({instructions:e.array(e.string()).min(1).describe("必填;逐行拼接的业务提示词,拼接后不得全为空白;不替代平台规则"),memoryInstructions:e.array(e.string()).min(1).optional().describe("装配长期记忆时追加的业务提示词;在场时拼接后不得全为空白")}),t=e.union([e.boolean(),e.literal("auto"),e.record(e.string(),e.unknown())]),a=e.union([e.boolean(),e.literal("auto")]),r=e.object({modelName:e.string().min(1).optional().describe("模型路由名;缺席时使用 APP_AI_MODEL_NAME"),thinking:t.optional().describe("true/false 控制思考;auto 不注入;对象作为网关兼容请求字段,禁止凭证"),parallelToolCalls:a.optional().describe("true/false 控制并行工具调用;auto 使用网关默认"),contentTagHygiene:e.object({off:e.array(e.enum(["think","tool-call-text"])).optional(),extraTags:e.array(e.object({name:e.string().regex(/^[a-zA-Z][a-zA-Z0-9_-]{0,31}$/),family:e.enum(["think","tool-call-text"])})).max(16).optional()}).optional()});export{n as a,o as b,l as c,t as d,a as e,r as f};
|
package/dist/config.d.ts
CHANGED
|
@@ -18,16 +18,19 @@ declare const chatConfigSchema: z.ZodObject<{
|
|
|
18
18
|
label: z.ZodString;
|
|
19
19
|
query: z.ZodString;
|
|
20
20
|
}, z.ZodTypeAny, "passthrough">>, "many">>;
|
|
21
|
-
/**
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
21
|
+
/**
|
|
22
|
+
* 输入框行数:出厂单行,随内容在上限内自动长高。
|
|
23
|
+
* minRows ≠ 1 属于偏离出厂,由交付摘要记录并在说明里给出依据。
|
|
24
|
+
*/
|
|
25
|
+
input: z.ZodDefault<z.ZodObject<{
|
|
26
|
+
minRows: z.ZodDefault<z.ZodNumber>;
|
|
27
|
+
maxRows: z.ZodDefault<z.ZodNumber>;
|
|
25
28
|
}, "strip", z.ZodTypeAny, {
|
|
26
|
-
|
|
27
|
-
|
|
29
|
+
minRows: number;
|
|
30
|
+
maxRows: number;
|
|
28
31
|
}, {
|
|
29
|
-
|
|
30
|
-
|
|
32
|
+
minRows?: number | undefined;
|
|
33
|
+
maxRows?: number | undefined;
|
|
31
34
|
}>>;
|
|
32
35
|
/** 空会话欢迎区(无 home 槽时渲染) */
|
|
33
36
|
welcome: z.ZodOptional<z.ZodObject<{
|
|
@@ -52,11 +55,11 @@ declare const chatConfigSchema: z.ZodObject<{
|
|
|
52
55
|
label: z.ZodString;
|
|
53
56
|
query: z.ZodString;
|
|
54
57
|
}, z.ZodTypeAny, "passthrough">[];
|
|
58
|
+
input: {
|
|
59
|
+
minRows: number;
|
|
60
|
+
maxRows: number;
|
|
61
|
+
};
|
|
55
62
|
retryOnError: boolean;
|
|
56
|
-
identity?: {
|
|
57
|
-
name: string;
|
|
58
|
-
tagline?: string | undefined;
|
|
59
|
-
} | undefined;
|
|
60
63
|
welcome?: {
|
|
61
64
|
title: string;
|
|
62
65
|
subtitle?: string | undefined;
|
|
@@ -71,9 +74,9 @@ declare const chatConfigSchema: z.ZodObject<{
|
|
|
71
74
|
label: z.ZodString;
|
|
72
75
|
query: z.ZodString;
|
|
73
76
|
}, z.ZodTypeAny, "passthrough">[] | undefined;
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
+
input?: {
|
|
78
|
+
minRows?: number | undefined;
|
|
79
|
+
maxRows?: number | undefined;
|
|
77
80
|
} | undefined;
|
|
78
81
|
welcome?: {
|
|
79
82
|
title: string;
|
package/dist/config.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a,b,c,d,e,f}from"./chunk-
|
|
1
|
+
import{a,b,c,d,e,f}from"./chunk-NPVS6HQT.js";export{c as agentPromptFileSchema,b as chatCapabilities,a as chatConfigSchema,f as llmProviderFileSchema,e as parallelSchema,d as thinkingSchema};
|
package/dist/server/index.d.ts
CHANGED
|
@@ -2013,19 +2013,24 @@ declare function defineTool<TSchema extends z.ZodTypeAny, TOutput>(options: Defi
|
|
|
2013
2013
|
* 动作结果构造器:把「本卡状态变了用 update、另一类结果用 card、只要一句提示用 notice」
|
|
2014
2014
|
* 从配方里的判据变成签名——`update` / `card` 都要求对应的卡片声明,提示文字不混进两者。
|
|
2015
2015
|
*
|
|
2016
|
+
* 视图卡(defineViewCard)的入参对称:出卡(cardOfView)收领域数据,更新/出结果卡同样收领域数据,
|
|
2017
|
+
* 工具与动作两端写同一种值,不必在动作里手动 `card.view(...)`。传视图 JSON 仍然可用(向后兼容)。
|
|
2018
|
+
*
|
|
2016
2019
|
* 直接返回对象字面量仍然合法,由门禁的同源校验兜底。
|
|
2017
2020
|
*/
|
|
2018
2021
|
|
|
2019
|
-
/** 原地刷新被点击的卡片;`data`
|
|
2022
|
+
/** 原地刷新被点击的卡片;`data` 收领域数据(视图卡)或该卡 schema 的值。
|
|
2020
2023
|
*
|
|
2021
2024
|
* @agentApi card-action
|
|
2022
2025
|
*/
|
|
2023
2026
|
declare function updateResult<S extends z.ZodTypeAny>(_meta: CardMeta<S>, data: z.input<S>): CardActionResult;
|
|
2024
|
-
|
|
2027
|
+
declare function updateResult<T>(meta: ViewCardMeta<T>, data: T | CardView): CardActionResult;
|
|
2028
|
+
/** 出一张结果卡;`cardType` 取自已声明的卡片,`data` 收领域数据(视图卡)或该卡 schema 的值。
|
|
2025
2029
|
*
|
|
2026
2030
|
* @agentApi card-action
|
|
2027
2031
|
*/
|
|
2028
2032
|
declare function cardResult<S extends z.ZodTypeAny>(meta: CardMeta<S>, data: z.input<S>): CardActionResult;
|
|
2033
|
+
declare function cardResult<T>(meta: ViewCardMeta<T>, data: T | CardView): CardActionResult;
|
|
2029
2034
|
/** 只给一句提示(没有 update / card 时才会下发到界面)。
|
|
2030
2035
|
*
|
|
2031
2036
|
* @agentApi card-action
|
|
@@ -2131,7 +2136,7 @@ interface LoadedChatConfig {
|
|
|
2131
2136
|
}
|
|
2132
2137
|
declare function loadChatConfig(configDir: string): LoadedChatConfig;
|
|
2133
2138
|
/** LoadedChatConfig → WS HELLO chatConfig(闭合形状,typecheck 恒守护):
|
|
2134
|
-
* query→prompt
|
|
2139
|
+
* query→prompt 映射、可选图标与 settings 五键显式投影,其余扩展字段留在服务端。
|
|
2135
2140
|
* 纯函数零日志(build-app-image smoke canary 断言启动日志无 WARN [app-config])。 */
|
|
2136
2141
|
declare function toWsChatConfig(cfg: LoadedChatConfig): HelloAckChatConfig;
|
|
2137
2142
|
|