@tbox.cn/app-agent-sdk-server 0.3.3 → 1.0.0-alpha.1
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-2M4P57DG.js +1 -0
- package/dist/config.d.ts +108 -0
- package/dist/config.js +1 -0
- package/dist/server/index.d.ts +0 -12
- package/dist/server/index.js +31 -31
- package/package.json +9 -5
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{z as e}from"zod";var n=e.object({enableImageUpload:e.boolean().default(!0),enableVideoUpload:e.boolean().default(!0),enableTTS:e.boolean().default(!0),enableVoiceInput:e.boolean().default(!0),defaultInputMode:e.enum(["TEXT","VOICE"]).default("TEXT"),quickCommands:e.array(e.object({label:e.string().describe("展示文案"),query:e.string().describe("点击后发送给智能体的用户消息")}).passthrough()).default([])}),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())]),o=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:o.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,l as b,t as c,o as d,r as e};
|
package/dist/config.d.ts
ADDED
|
@@ -0,0 +1,108 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
|
|
3
|
+
/** Pure configuration contracts: no filesystem, logger or agent/runtime initialization. */
|
|
4
|
+
|
|
5
|
+
declare const chatConfigSchema: z.ZodObject<{
|
|
6
|
+
enableImageUpload: z.ZodDefault<z.ZodBoolean>;
|
|
7
|
+
enableVideoUpload: z.ZodDefault<z.ZodBoolean>;
|
|
8
|
+
enableTTS: z.ZodDefault<z.ZodBoolean>;
|
|
9
|
+
enableVoiceInput: z.ZodDefault<z.ZodBoolean>;
|
|
10
|
+
defaultInputMode: z.ZodDefault<z.ZodEnum<["TEXT", "VOICE"]>>;
|
|
11
|
+
quickCommands: z.ZodDefault<z.ZodArray<z.ZodObject<{
|
|
12
|
+
label: z.ZodString;
|
|
13
|
+
query: z.ZodString;
|
|
14
|
+
}, "passthrough", z.ZodTypeAny, z.objectOutputType<{
|
|
15
|
+
label: z.ZodString;
|
|
16
|
+
query: z.ZodString;
|
|
17
|
+
}, z.ZodTypeAny, "passthrough">, z.objectInputType<{
|
|
18
|
+
label: z.ZodString;
|
|
19
|
+
query: z.ZodString;
|
|
20
|
+
}, z.ZodTypeAny, "passthrough">>, "many">>;
|
|
21
|
+
}, "strip", z.ZodTypeAny, {
|
|
22
|
+
enableImageUpload: boolean;
|
|
23
|
+
enableVideoUpload: boolean;
|
|
24
|
+
enableTTS: boolean;
|
|
25
|
+
enableVoiceInput: boolean;
|
|
26
|
+
defaultInputMode: "TEXT" | "VOICE";
|
|
27
|
+
quickCommands: z.objectOutputType<{
|
|
28
|
+
label: z.ZodString;
|
|
29
|
+
query: z.ZodString;
|
|
30
|
+
}, z.ZodTypeAny, "passthrough">[];
|
|
31
|
+
}, {
|
|
32
|
+
enableImageUpload?: boolean | undefined;
|
|
33
|
+
enableVideoUpload?: boolean | undefined;
|
|
34
|
+
enableTTS?: boolean | undefined;
|
|
35
|
+
enableVoiceInput?: boolean | undefined;
|
|
36
|
+
defaultInputMode?: "TEXT" | "VOICE" | undefined;
|
|
37
|
+
quickCommands?: z.objectInputType<{
|
|
38
|
+
label: z.ZodString;
|
|
39
|
+
query: z.ZodString;
|
|
40
|
+
}, z.ZodTypeAny, "passthrough">[] | undefined;
|
|
41
|
+
}>;
|
|
42
|
+
declare const agentPromptFileSchema: z.ZodObject<{
|
|
43
|
+
instructions: z.ZodArray<z.ZodString, "many">;
|
|
44
|
+
memoryInstructions: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
45
|
+
}, "strict", z.ZodTypeAny, {
|
|
46
|
+
instructions: string[];
|
|
47
|
+
memoryInstructions?: string[] | undefined;
|
|
48
|
+
}, {
|
|
49
|
+
instructions: string[];
|
|
50
|
+
memoryInstructions?: string[] | undefined;
|
|
51
|
+
}>;
|
|
52
|
+
declare const thinkingSchema: z.ZodUnion<[z.ZodBoolean, z.ZodLiteral<"auto">, z.ZodRecord<z.ZodString, z.ZodUnknown>]>;
|
|
53
|
+
declare const parallelSchema: z.ZodUnion<[z.ZodBoolean, z.ZodLiteral<"auto">]>;
|
|
54
|
+
/** Discovery schema shares field validators with the fail-soft loader; individual invalid fields are ignored at runtime. */
|
|
55
|
+
declare const llmProviderFileSchema: z.ZodObject<{
|
|
56
|
+
modelName: z.ZodOptional<z.ZodString>;
|
|
57
|
+
thinking: z.ZodOptional<z.ZodUnion<[z.ZodBoolean, z.ZodLiteral<"auto">, z.ZodRecord<z.ZodString, z.ZodUnknown>]>>;
|
|
58
|
+
parallelToolCalls: z.ZodOptional<z.ZodUnion<[z.ZodBoolean, z.ZodLiteral<"auto">]>>;
|
|
59
|
+
contentTagHygiene: z.ZodOptional<z.ZodObject<{
|
|
60
|
+
off: z.ZodOptional<z.ZodArray<z.ZodEnum<["think", "tool-call-text"]>, "many">>;
|
|
61
|
+
extraTags: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
62
|
+
name: z.ZodString;
|
|
63
|
+
family: z.ZodEnum<["think", "tool-call-text"]>;
|
|
64
|
+
}, "strip", z.ZodTypeAny, {
|
|
65
|
+
name: string;
|
|
66
|
+
family: "think" | "tool-call-text";
|
|
67
|
+
}, {
|
|
68
|
+
name: string;
|
|
69
|
+
family: "think" | "tool-call-text";
|
|
70
|
+
}>, "many">>;
|
|
71
|
+
}, "strip", z.ZodTypeAny, {
|
|
72
|
+
off?: ("think" | "tool-call-text")[] | undefined;
|
|
73
|
+
extraTags?: {
|
|
74
|
+
name: string;
|
|
75
|
+
family: "think" | "tool-call-text";
|
|
76
|
+
}[] | undefined;
|
|
77
|
+
}, {
|
|
78
|
+
off?: ("think" | "tool-call-text")[] | undefined;
|
|
79
|
+
extraTags?: {
|
|
80
|
+
name: string;
|
|
81
|
+
family: "think" | "tool-call-text";
|
|
82
|
+
}[] | undefined;
|
|
83
|
+
}>>;
|
|
84
|
+
}, "strip", z.ZodTypeAny, {
|
|
85
|
+
modelName?: string | undefined;
|
|
86
|
+
thinking?: boolean | "auto" | Record<string, unknown> | undefined;
|
|
87
|
+
parallelToolCalls?: boolean | "auto" | undefined;
|
|
88
|
+
contentTagHygiene?: {
|
|
89
|
+
off?: ("think" | "tool-call-text")[] | undefined;
|
|
90
|
+
extraTags?: {
|
|
91
|
+
name: string;
|
|
92
|
+
family: "think" | "tool-call-text";
|
|
93
|
+
}[] | undefined;
|
|
94
|
+
} | undefined;
|
|
95
|
+
}, {
|
|
96
|
+
modelName?: string | undefined;
|
|
97
|
+
thinking?: boolean | "auto" | Record<string, unknown> | undefined;
|
|
98
|
+
parallelToolCalls?: boolean | "auto" | undefined;
|
|
99
|
+
contentTagHygiene?: {
|
|
100
|
+
off?: ("think" | "tool-call-text")[] | undefined;
|
|
101
|
+
extraTags?: {
|
|
102
|
+
name: string;
|
|
103
|
+
family: "think" | "tool-call-text";
|
|
104
|
+
}[] | undefined;
|
|
105
|
+
} | undefined;
|
|
106
|
+
}>;
|
|
107
|
+
|
|
108
|
+
export { agentPromptFileSchema, chatConfigSchema, llmProviderFileSchema, parallelSchema, thinkingSchema };
|
package/dist/config.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{a,b,c,d,e}from"./chunk-2M4P57DG.js";export{b as agentPromptFileSchema,a as chatConfigSchema,e as llmProviderFileSchema,d as parallelSchema,c as thinkingSchema};
|
package/dist/server/index.d.ts
CHANGED
|
@@ -118,18 +118,6 @@ declare function loadLocalSkills(dir: string): Promise<LocalSkill[]>;
|
|
|
118
118
|
* references 内存化(__referenceContents),运行期零文件系统暴露。
|
|
119
119
|
*/
|
|
120
120
|
declare function toMastraSkill(skill: LocalSkill): SkillInput;
|
|
121
|
-
/**
|
|
122
|
-
* 模块包级文件 skill 加载(009 模块文件化能力,底层下沉):
|
|
123
|
-
* 包名解析定位模块包根 → 包根/skills 目录(SKILL.md 格式,复用 loadLocalSkills)。
|
|
124
|
-
* dev / dist / 发布态 / 应用 bundle 形态路径恒等(单一策略,零包名形态约定):
|
|
125
|
-
* - createRequire 以调用方文件为基准向上解析消费方 node_modules——
|
|
126
|
-
* dev(workspace link)、模块 dist、应用 build dist(bundle 内联后仍从 bundle
|
|
127
|
-
* 位置向上解析)、发布态(node_modules 内模块位置)均命中;
|
|
128
|
-
* - 前置:目标模块 package.json exports 须含 `"./package.json"`(标准惯例,
|
|
129
|
-
* doctor pack-exports 兼容;codegen 展开与本地骨架已默认保留)。
|
|
130
|
-
* - 恒 resolve(失败降级 [] + 可行动诊断 warn,不 throw):模块顶层 await 调用时
|
|
131
|
-
* 不会因加载失败中断应用启动链。
|
|
132
|
-
*/
|
|
133
121
|
declare function loadModuleSkills(packageName: string, importMetaUrl: string): Promise<LocalSkill[]>;
|
|
134
122
|
|
|
135
123
|
/** 默认文件 URL 前缀(可被 createChatEngine 的 fileUrlPrefix 覆盖) */
|