@baishuyun/ai-feat-utils 1.1.0 → 1.1.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/array.d.ts +3 -0
- package/dist/array.d.ts.map +1 -0
- package/dist/attachment.d.ts +2 -0
- package/dist/attachment.d.ts.map +1 -0
- package/dist/condition.d.ts +9 -0
- package/dist/condition.d.ts.map +1 -0
- package/dist/constants.d.ts +2 -0
- package/dist/constants.d.ts.map +1 -0
- package/dist/field-json.d.ts +6 -0
- package/dist/field-json.d.ts.map +1 -0
- package/dist/form-structure.d.ts +4 -0
- package/dist/form-structure.d.ts.map +1 -0
- package/dist/iconfont.d.ts +13 -0
- package/dist/iconfont.d.ts.map +1 -0
- package/dist/index.d.ts +12 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/part.d.ts +12 -0
- package/dist/part.d.ts.map +1 -0
- package/dist/prompt-parser.d.ts +3 -0
- package/dist/prompt-parser.d.ts.map +1 -0
- package/dist/text-part.d.ts +2 -0
- package/dist/text-part.d.ts.map +1 -0
- package/dist/value-normalizer.d.ts +2 -0
- package/dist/value-normalizer.d.ts.map +1 -0
- package/package.json +3 -3
package/dist/array.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"array.d.ts","sourceRoot":"","sources":["../src/array.ts"],"names":[],"mappings":"AAAA,wBAAgB,uBAAuB,CAAC,CAAC,EACvC,GAAG,EAAE,CAAC,EAAE,EACR,QAAQ,EAAE,CAAC,IAAI,EAAE,CAAC,KAAK,OAAO,EAC9B,QAAQ,SAAI,GACX,CAAC,CAAC,GAAG,CAAC,EAAE,CAAC,EAAE,CA6Bb;AAED,wBAAgB,OAAO,CAAC,GAAG,EAAE,KAAK,CAAC,OAAO,CAAC,GAAG,KAAK,CAAC,OAAO,CAAC,CAW3D"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"attachment.d.ts","sourceRoot":"","sources":["../src/attachment.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,gBAAgB,GAAI,KAAK,MAAM,EAAE,kBAAuB,KAAG,OAAO,CAAC,MAAM,CAalF,CAAC"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { FieldType, IAgentHelper, IFormValues, relationalOperator, ICondition } from '@baishuyun/types';
|
|
2
|
+
export declare const OPERATOR_LABEL_MAP: Record<relationalOperator, string>;
|
|
3
|
+
export declare const FIELD_TYPE_OPERATOR_MAP: Record<FieldType, relationalOperator[]>;
|
|
4
|
+
export declare function getAvailableOperators(fieldType?: FieldType): relationalOperator[];
|
|
5
|
+
export declare function getDefaultOperator(fieldType?: FieldType): relationalOperator;
|
|
6
|
+
export declare function isHelperCondMet(helper: IAgentHelper, formValues: IFormValues): boolean;
|
|
7
|
+
export declare function conditionStringify2bsCondition(cond: ICondition): string;
|
|
8
|
+
export declare function bsConditionParse2Condition(str: string): ICondition;
|
|
9
|
+
//# sourceMappingURL=condition.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"condition.d.ts","sourceRoot":"","sources":["../src/condition.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,SAAS,EACT,YAAY,EACZ,WAAW,EAEX,kBAAkB,EAClB,UAAU,EAGX,MAAM,kBAAkB,CAAC;AAE1B,eAAO,MAAM,kBAAkB,EAAE,MAAM,CAAC,kBAAkB,EAAE,MAAM,CAejE,CAAC;AAEF,eAAO,MAAM,uBAAuB,EAAE,MAAM,CAAC,SAAS,EAAE,kBAAkB,EAAE,CAwD3E,CAAC;AA+BF,wBAAgB,qBAAqB,CAAC,SAAS,CAAC,EAAE,SAAS,GAAG,kBAAkB,EAAE,CAGjF;AAED,wBAAgB,kBAAkB,CAAC,SAAS,CAAC,EAAE,SAAS,GAAG,kBAAkB,CAG5E;AAmHD,wBAAgB,eAAe,CAAC,MAAM,EAAE,YAAY,EAAE,UAAU,EAAE,WAAW,GAAG,OAAO,CActF;AAwCD,wBAAgB,8BAA8B,CAAC,IAAI,EAAE,UAAU,GAAG,MAAM,CAoBvE;AAED,wBAAgB,0BAA0B,CAAC,GAAG,EAAE,MAAM,GAAG,UAAU,CA4BlE"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../src/constants.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,oBAAoB,KAAK,CAAC"}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { IFilledField } from '@baishuyun/types';
|
|
2
|
+
export declare const createPartTypeChecker: (type: string) => (part: any) => boolean;
|
|
3
|
+
export declare const createGetFieldJsonInfo: (type: string) => (part: any) => IFilledField | null;
|
|
4
|
+
export declare const createFieldPartsExtractor: (isTarget: (part: any) => boolean) => (part: any) => any[];
|
|
5
|
+
export declare const safeParseJson: (jsonString: string) => any | null;
|
|
6
|
+
//# sourceMappingURL=field-json.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"field-json.d.ts","sourceRoot":"","sources":["../src/field-json.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,kBAAkB,CAAC;AAGhD,eAAO,MAAM,qBAAqB,GAC/B,MAAM,MAAM,MACZ,MAAM,GAAG,KAAG,OAGZ,CAAC;AAEJ,eAAO,MAAM,sBAAsB,GAChC,MAAM,MAAM,MACZ,MAAM,GAAG,KAAG,YAAY,GAAG,IAM3B,CAAC;AAEJ,eAAO,MAAM,yBAAyB,GACnC,UAAU,CAAC,IAAI,EAAE,GAAG,KAAK,OAAO,MAChC,MAAM,GAAG,KAAG,GAAG,EAIf,CAAC;AAEJ,eAAO,MAAM,aAAa,GAAI,YAAY,MAAM,KAAG,GAAG,GAAG,IAOxD,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"form-structure.d.ts","sourceRoot":"","sources":["../src/form-structure.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,EAAE,MAAM,kBAAkB,CAAC;AAErD,eAAO,MAAM,qBAAqB,gBAWhC,CAAC;AAEH,eAAO,MAAM,oBAAoB,GAAI,eAAe,KAAK,CAAC,MAAM,CAAC,aAYhE,CAAC"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Look up the unicode hex string for an icon by its font_class name.
|
|
3
|
+
* Returns undefined if the icon name is not found.
|
|
4
|
+
*
|
|
5
|
+
* @param name - The icon font_class name (e.g. "search", "edit", "ai")
|
|
6
|
+
* @returns The unicode hex string (e.g. "e952"), or undefined
|
|
7
|
+
*
|
|
8
|
+
* @example
|
|
9
|
+
* getIconUnicode("search") // "e952"
|
|
10
|
+
* getIconUnicode("ai") // "ea59"
|
|
11
|
+
*/
|
|
12
|
+
export declare function getIconUnicode(name: string): string | undefined;
|
|
13
|
+
//# sourceMappingURL=iconfont.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"iconfont.d.ts","sourceRoot":"","sources":["../src/iconfont.ts"],"names":[],"mappings":"AA+YA;;;;;;;;;;GAUG;AACH,wBAAgB,cAAc,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,GAAG,SAAS,CAG/D"}
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
export { extractTextPartMeta } from './text-part';
|
|
2
|
+
export * from './part';
|
|
3
|
+
export { valueNormalizer } from './value-normalizer';
|
|
4
|
+
export { GetSafeFormStructure, WHITE_LIST_FIELDS_SET } from './form-structure';
|
|
5
|
+
export { createPartTypeChecker, createGetFieldJsonInfo, createFieldPartsExtractor, safeParseJson, } from './field-json';
|
|
6
|
+
export { DATA_COUNT_PER_BATCH } from './constants';
|
|
7
|
+
export { imageUrlToBase64 } from './attachment';
|
|
8
|
+
export { OPERATOR_LABEL_MAP, FIELD_TYPE_OPERATOR_MAP, getAvailableOperators, getDefaultOperator, isHelperCondMet, conditionStringify2bsCondition, bsConditionParse2Condition, } from './condition';
|
|
9
|
+
export * from './array';
|
|
10
|
+
export { getIconUnicode } from './iconfont';
|
|
11
|
+
export { promptParser } from './prompt-parser';
|
|
12
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,mBAAmB,EAAE,MAAM,aAAa,CAAC;AAClD,cAAc,QAAQ,CAAC;AAEvB,OAAO,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAC;AACrD,OAAO,EAAE,oBAAoB,EAAE,qBAAqB,EAAE,MAAM,kBAAkB,CAAC;AAC/E,OAAO,EACL,qBAAqB,EACrB,sBAAsB,EACtB,yBAAyB,EACzB,aAAa,GACd,MAAM,cAAc,CAAC;AACtB,OAAO,EAAE,oBAAoB,EAAE,MAAM,aAAa,CAAC;AAEnD,OAAO,EAAE,gBAAgB,EAAE,MAAM,cAAc,CAAC;AAEhD,OAAO,EACL,kBAAkB,EAClB,uBAAuB,EACvB,qBAAqB,EACrB,kBAAkB,EAClB,eAAe,EACf,8BAA8B,EAC9B,0BAA0B,GAC3B,MAAM,aAAa,CAAC;AAErB,cAAc,SAAS,CAAC;AAExB,OAAO,EAAE,cAAc,EAAE,MAAM,YAAY,CAAC;AAE5C,OAAO,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC"}
|
package/dist/part.d.ts
ADDED
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { IQueryResult } from '@baishuyun/types';
|
|
2
|
+
export declare const IsErrorPart: (part: any) => boolean;
|
|
3
|
+
export declare const IsFakeMsgPart: (part: any) => boolean;
|
|
4
|
+
export declare const IsFilePart: (part: any) => boolean;
|
|
5
|
+
export declare const IsQueryResultPart: (part: any) => boolean;
|
|
6
|
+
export declare const GetQueryResult: (part: any) => IQueryResult | null;
|
|
7
|
+
export declare const IsFileGroupPart: (part: any) => boolean;
|
|
8
|
+
export declare const IsLoadingPart: (part: any) => boolean;
|
|
9
|
+
export declare const GetLoadingMsg: (part: any) => string;
|
|
10
|
+
export declare const GetPartErrMsg: (part: any) => string;
|
|
11
|
+
export declare const getMetaErrorMsg: (part: any) => string;
|
|
12
|
+
//# sourceMappingURL=part.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"part.d.ts","sourceRoot":"","sources":["../src/part.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,kBAAkB,CAAC;AAGhD,eAAO,MAAM,WAAW,GAAI,MAAM,GAAG,KAAG,OAOvC,CAAC;AAEF,eAAO,MAAM,aAAa,GAAI,MAAM,GAAG,KAAG,OAGzC,CAAC;AAEF,eAAO,MAAM,UAAU,GAAI,MAAM,GAAG,KAAG,OAEtC,CAAC;AAEF,eAAO,MAAM,iBAAiB,GAAI,MAAM,GAAG,KAAG,OAG7C,CAAC;AAEF,eAAO,MAAM,cAAc,GAAI,MAAM,GAAG,KAAG,YAAY,GAAG,IAczD,CAAC;AAEF,eAAO,MAAM,eAAe,GAAI,MAAM,GAAG,YAaxC,CAAC;AAEF,eAAO,MAAM,aAAa,GAAI,MAAM,GAAG,KAAG,OAGzC,CAAC;AAEF,eAAO,MAAM,aAAa,GAAI,MAAM,GAAG,KAAG,MAOzC,CAAC;AAEF,eAAO,MAAM,aAAa,GAAI,MAAM,GAAG,KAAG,MAWzC,CAAC;AAEF,eAAO,MAAM,eAAe,GAAI,MAAM,GAAG,KAAG,MAO3C,CAAC"}
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import { IField, IValueFormHuman } from '@baishuyun/types';
|
|
2
|
+
export declare const promptParser: (originStrWithFieldNameTpl: string, formStructure: Array<IField>, widgetValueGetter: (name: string) => IValueFormHuman) => IValueFormHuman;
|
|
3
|
+
//# sourceMappingURL=prompt-parser.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"prompt-parser.d.ts","sourceRoot":"","sources":["../src/prompt-parser.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,eAAe,EAAE,MAAM,kBAAkB,CAAC;AAK3D,eAAO,MAAM,YAAY,GACvB,2BAA2B,MAAM,EACjC,eAAe,KAAK,CAAC,MAAM,CAAC,EAC5B,mBAAmB,CAAC,IAAI,EAAE,MAAM,KAAK,eAAe,KACnD,eAuCF,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"text-part.d.ts","sourceRoot":"","sources":["../src/text-part.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,mBAAmB,GAAI,MAAM,GAAG,QAyB5C,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"value-normalizer.d.ts","sourceRoot":"","sources":["../src/value-normalizer.ts"],"names":[],"mappings":"AAwBA,eAAO,MAAM,eAAe,GAAI,OAAO,MAAM,GAAG,MAAM,EAAE,KAAG,MAW1D,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@baishuyun/ai-feat-utils",
|
|
3
|
-
"version": "1.1.
|
|
3
|
+
"version": "1.1.1",
|
|
4
4
|
"description": "Shared utility functions for AI feature plugins",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "dist/ai-feat-utils.js",
|
|
@@ -16,14 +16,14 @@
|
|
|
16
16
|
"dist/**/*"
|
|
17
17
|
],
|
|
18
18
|
"dependencies": {
|
|
19
|
-
"@baishuyun/types": "2.1.
|
|
19
|
+
"@baishuyun/types": "2.1.1"
|
|
20
20
|
},
|
|
21
21
|
"devDependencies": {
|
|
22
22
|
"rimraf": "^6.1.2",
|
|
23
23
|
"typescript": "^5.5.0",
|
|
24
24
|
"vite": "^5.1.4",
|
|
25
25
|
"vite-plugin-dts": "^4.5.4",
|
|
26
|
-
"@baishuyun/typescript-config": "1.1.
|
|
26
|
+
"@baishuyun/typescript-config": "1.1.1"
|
|
27
27
|
},
|
|
28
28
|
"keywords": [],
|
|
29
29
|
"author": "",
|