@petercatai/whisker-client 2.0.0 → 3.0.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.
Files changed (3) hide show
  1. package/dist/api.d.ts +498 -16
  2. package/dist/api.js +70 -4
  3. package/package.json +1 -1
package/dist/api.d.ts CHANGED
@@ -206,7 +206,10 @@ export declare enum IKnowledgeTypeEnum {
206
206
  Json = "json",
207
207
  Docx = "docx",
208
208
  Pdf = "pdf",
209
+ Powerpoint = "powerpoint",
210
+ Webpage = "webpage",
209
211
  Qa = "qa",
212
+ Folder = "folder",
210
213
  Yuquedoc = "yuquedoc",
211
214
  YuqueBook = "yuque_book",
212
215
  GithubRepo = "github_repo",
@@ -251,12 +254,26 @@ export declare enum IKnowledgeSourceEnum {
251
254
  GithubFile = "github_file",
252
255
  UserInputText = "user_input_text",
253
256
  CloudStorageText = "cloud_storage_text",
257
+ CloudStorageFile = "cloud_storage_file",
254
258
  CloudStorageImage = "cloud_storage_image",
259
+ Os = "os",
255
260
  Yuque = "yuque",
256
261
  YuquePersonalDoc = "yuque_personal_doc",
257
262
  YuquePersonalNote = "yuque_personal_note",
258
263
  HituNodePackage = "hitu_node_package"
259
264
  }
265
+ /** CliChangeOp */
266
+ export declare enum ICliChangeOp {
267
+ Add = "add",
268
+ Modify = "modify",
269
+ Delete = "delete"
270
+ }
271
+ /** CliApplyStatus */
272
+ export declare enum ICliApplyStatus {
273
+ Applied = "applied",
274
+ Skipped = "skipped",
275
+ Failed = "failed"
276
+ }
260
277
  /** Action */
261
278
  export declare enum IAction {
262
279
  Create = "create",
@@ -1130,6 +1147,96 @@ export interface ICleanupHistoryResponse {
1130
1147
  */
1131
1148
  before_time: string;
1132
1149
  }
1150
+ /** CliApplyRequest */
1151
+ export interface ICliApplyRequest {
1152
+ /** Space Id */
1153
+ space_id: string;
1154
+ /** Expected Snapshot Token */
1155
+ expected_snapshot_token?: string | null;
1156
+ /**
1157
+ * Force
1158
+ * @default false
1159
+ */
1160
+ force?: boolean;
1161
+ /** Entries */
1162
+ entries: ICliChangesetEntry[];
1163
+ }
1164
+ /** CliApplyResponse */
1165
+ export interface ICliApplyResponse {
1166
+ /** Space Id */
1167
+ space_id: string;
1168
+ /** Expected Snapshot Token */
1169
+ expected_snapshot_token?: string | null;
1170
+ /** Snapshot Token Before */
1171
+ snapshot_token_before: string;
1172
+ /** Snapshot Token After */
1173
+ snapshot_token_after: string;
1174
+ /**
1175
+ * Version Conflict
1176
+ * @default false
1177
+ */
1178
+ version_conflict?: boolean;
1179
+ /**
1180
+ * Applied
1181
+ * @default 0
1182
+ */
1183
+ applied?: number;
1184
+ /**
1185
+ * Skipped
1186
+ * @default 0
1187
+ */
1188
+ skipped?: number;
1189
+ /**
1190
+ * Failed
1191
+ * @default 0
1192
+ */
1193
+ failed?: number;
1194
+ /** Results */
1195
+ results: ICliApplyResultItem[];
1196
+ }
1197
+ /** CliApplyResultItem */
1198
+ export interface ICliApplyResultItem {
1199
+ /** Path */
1200
+ path: string;
1201
+ op: ICliChangeOp;
1202
+ status: ICliApplyStatus;
1203
+ /** Knowledge Id */
1204
+ knowledge_id?: string | null;
1205
+ /** Knowledge Name */
1206
+ knowledge_name?: string | null;
1207
+ /** Knowledge Type */
1208
+ knowledge_type?: string | null;
1209
+ /** Message */
1210
+ message?: string | null;
1211
+ }
1212
+ /** CliChangesetEntry */
1213
+ export interface ICliChangesetEntry {
1214
+ op: ICliChangeOp;
1215
+ /** Path */
1216
+ path: string;
1217
+ /** Knowledge Id */
1218
+ knowledge_id?: string | null;
1219
+ /** Knowledge Name */
1220
+ knowledge_name?: string | null;
1221
+ /** Knowledge Type */
1222
+ knowledge_type?: string | null;
1223
+ /** Source Type */
1224
+ source_type?: string | null;
1225
+ /** Source Config */
1226
+ source_config?: Record<string, any>;
1227
+ /** Embedding Model Name */
1228
+ embedding_model_name?: string | null;
1229
+ /** Split Config */
1230
+ split_config?: Record<string, any>;
1231
+ /** Metadata */
1232
+ metadata?: Record<string, any>;
1233
+ /** File Sha */
1234
+ file_sha?: string | null;
1235
+ /** File Size */
1236
+ file_size?: number | null;
1237
+ /** Parent Id */
1238
+ parent_id?: string | null;
1239
+ }
1133
1240
  /** Condition */
1134
1241
  export interface ICondition {
1135
1242
  /** Field */
@@ -1185,6 +1292,90 @@ export interface IFilterGroup {
1185
1292
  /** Conditions */
1186
1293
  conditions: (ICondition | IFilterGroup)[];
1187
1294
  }
1295
+ /** FolderCreate */
1296
+ export interface IFolderCreate {
1297
+ /**
1298
+ * Space Id
1299
+ * the space of knowledge, example: petercat bot id, github repo name
1300
+ */
1301
+ space_id: string;
1302
+ /**
1303
+ * Knowledge Type
1304
+ * folder knowledge type
1305
+ * @default "folder"
1306
+ */
1307
+ knowledge_type?: "folder";
1308
+ /**
1309
+ * Knowledge Name
1310
+ * name of the knowledge resource
1311
+ * @maxLength 255
1312
+ */
1313
+ knowledge_name: string;
1314
+ /**
1315
+ * Metadata
1316
+ * additional metadata, user can update it
1317
+ * @default {}
1318
+ */
1319
+ metadata?: Record<string, any>;
1320
+ /**
1321
+ * Source Type
1322
+ * folder source type
1323
+ * @default "os"
1324
+ */
1325
+ source_type?: "os";
1326
+ /**
1327
+ * Embedding Model Name
1328
+ * name of the embedding model. you can set any other model if target embedding service registered
1329
+ */
1330
+ embedding_model_name: string;
1331
+ /**
1332
+ * File Sha
1333
+ * SHA of the file
1334
+ */
1335
+ file_sha?: string | null;
1336
+ /**
1337
+ * File Size
1338
+ * size of the file
1339
+ */
1340
+ file_size?: number | null;
1341
+ /**
1342
+ * Parent Id
1343
+ * parent id of the knowledge
1344
+ */
1345
+ parent_id?: string | null;
1346
+ /** folder source config */
1347
+ source_config: IFolderSourceConfig;
1348
+ /**
1349
+ * folder split config
1350
+ * @default {"type":"folder"}
1351
+ */
1352
+ split_config?: IFolderSplitConfig;
1353
+ }
1354
+ /**
1355
+ * FolderSourceConfig
1356
+ * 文件夹来源配置
1357
+ *
1358
+ * 路径必须是绝对路径,以 / 开头,不允许相对路径。
1359
+ */
1360
+ export interface IFolderSourceConfig {
1361
+ /**
1362
+ * Path
1363
+ * 文件夹绝对路径,必须以 / 开头,如 /docs/api/
1364
+ * @default "/"
1365
+ */
1366
+ path?: string;
1367
+ }
1368
+ /**
1369
+ * FolderSplitConfig
1370
+ * 文件夹分块配置(空配置,folder 不分块)
1371
+ */
1372
+ export interface IFolderSplitConfig {
1373
+ /**
1374
+ * Type
1375
+ * @default "folder"
1376
+ */
1377
+ type?: "folder";
1378
+ }
1188
1379
  /**
1189
1380
  * GeaGraphSplitConfig
1190
1381
  * JSON document split configuration
@@ -1698,7 +1889,7 @@ export interface IKnowledgeInput {
1698
1889
  * Source Config
1699
1890
  * source config of the knowledge
1700
1891
  */
1701
- source_config: IGithubRepoSourceConfig | IGithubFileSourceConfig | IS3SourceConfig | IOpenUrlSourceConfig | ITextSourceConfig | IOpenIdSourceConfig | IYuqueSourceConfig | IYuquePersonalDocSourceConfig | IYuquePersonalNoteSourceConfig | INodePackageSourceConfig;
1892
+ source_config: IGithubRepoSourceConfig | IGithubFileSourceConfig | IS3SourceConfig | IOpenUrlSourceConfig | ITextSourceConfig | IOpenIdSourceConfig | IYuqueSourceConfig | IYuquePersonalDocSourceConfig | IYuquePersonalNoteSourceConfig | INodePackageSourceConfig | IFolderSourceConfig;
1702
1893
  /**
1703
1894
  * Embedding Model Name
1704
1895
  * name of the embedding model. you can set any other model if target embedding service registered
@@ -1708,7 +1899,7 @@ export interface IKnowledgeInput {
1708
1899
  * Split Config
1709
1900
  * configuration for splitting the knowledge
1710
1901
  */
1711
- split_config: IBaseCharSplitConfig | IMarkdownSplitConfig | ITextSplitConfig | IJSONSplitConfig | IPDFSplitConfig | IYuqueSplitConfig | IGeaGraphSplitConfig | IGithubRepoParseConfig | IBaseCodeSplitConfig | IImageSplitConfig | INodePackageParseConfig | IMemorySplitConfig;
1902
+ split_config: IMarkdownSplitConfig | ITextSplitConfig | IJSONSplitConfig | IPDFSplitConfig | IYuqueSplitConfig | IGeaGraphSplitConfig | IGithubRepoParseConfig | IBaseCodeSplitConfig | IImageSplitConfig | INodePackageParseConfig | IMemorySplitConfig | IFolderSplitConfig | IBaseCharSplitConfig;
1712
1903
  /**
1713
1904
  * File Sha
1714
1905
  * SHA of the file
@@ -1784,7 +1975,7 @@ export interface IKnowledgeOutput {
1784
1975
  * Source Config
1785
1976
  * source config of the knowledge
1786
1977
  */
1787
- source_config: IGithubRepoSourceConfig | IGithubFileSourceConfig | IS3SourceConfig | IOpenUrlSourceConfig | ITextSourceConfig | IOpenIdSourceConfig | IYuqueSourceConfig | IYuquePersonalDocSourceConfig | IYuquePersonalNoteSourceConfig | INodePackageSourceConfig;
1978
+ source_config: IGithubRepoSourceConfig | IGithubFileSourceConfig | IS3SourceConfig | IOpenUrlSourceConfig | ITextSourceConfig | IOpenIdSourceConfig | IYuqueSourceConfig | IYuquePersonalDocSourceConfig | IYuquePersonalNoteSourceConfig | INodePackageSourceConfig | IFolderSourceConfig;
1788
1979
  /**
1789
1980
  * Embedding Model Name
1790
1981
  * name of the embedding model. you can set any other model if target embedding service registered
@@ -1794,7 +1985,7 @@ export interface IKnowledgeOutput {
1794
1985
  * Split Config
1795
1986
  * configuration for splitting the knowledge
1796
1987
  */
1797
- split_config: IBaseCharSplitConfig | IMarkdownSplitConfig | ITextSplitConfig | IJSONSplitConfig | IPDFSplitConfig | IYuqueSplitConfig | IGeaGraphSplitConfig | IGithubRepoParseConfig | IBaseCodeSplitConfig | IImageSplitConfig | INodePackageParseConfig | IMemorySplitConfig;
1988
+ split_config: IMarkdownSplitConfig | ITextSplitConfig | IJSONSplitConfig | IPDFSplitConfig | IYuqueSplitConfig | IGeaGraphSplitConfig | IGithubRepoParseConfig | IBaseCodeSplitConfig | IImageSplitConfig | INodePackageParseConfig | IMemorySplitConfig | IFolderSplitConfig | IBaseCharSplitConfig;
1798
1989
  /**
1799
1990
  * File Sha
1800
1991
  * SHA of the file
@@ -2036,7 +2227,7 @@ export interface IKnowledgeResponse {
2036
2227
  * Source Config
2037
2228
  * source config of the knowledge
2038
2229
  */
2039
- source_config: IGithubRepoSourceConfig | IGithubFileSourceConfig | IS3SourceConfig | IOpenUrlSourceConfig | ITextSourceConfig | IOpenIdSourceConfig | IYuqueSourceConfig | IYuquePersonalDocSourceConfig | IYuquePersonalNoteSourceConfig | INodePackageSourceConfig;
2230
+ source_config: IGithubRepoSourceConfig | IGithubFileSourceConfig | IS3SourceConfig | IOpenUrlSourceConfig | ITextSourceConfig | IOpenIdSourceConfig | IYuqueSourceConfig | IYuquePersonalDocSourceConfig | IYuquePersonalNoteSourceConfig | INodePackageSourceConfig | IFolderSourceConfig;
2040
2231
  /**
2041
2232
  * Embedding Model Name
2042
2233
  * name of the embedding model. you can set any other model if target embedding service registered
@@ -2046,7 +2237,7 @@ export interface IKnowledgeResponse {
2046
2237
  * Split Config
2047
2238
  * configuration for splitting the knowledge
2048
2239
  */
2049
- split_config: IBaseCharSplitConfig | IMarkdownSplitConfig | ITextSplitConfig | IJSONSplitConfig | IPDFSplitConfig | IYuqueSplitConfig | IGeaGraphSplitConfig | IGithubRepoParseConfig | IBaseCodeSplitConfig | IImageSplitConfig | INodePackageParseConfig | IMemorySplitConfig;
2240
+ split_config: IMarkdownSplitConfig | ITextSplitConfig | IJSONSplitConfig | IPDFSplitConfig | IYuqueSplitConfig | IGeaGraphSplitConfig | IGithubRepoParseConfig | IBaseCodeSplitConfig | IImageSplitConfig | INodePackageParseConfig | IMemorySplitConfig | IFolderSplitConfig | IBaseCharSplitConfig;
2050
2241
  /**
2051
2242
  * File Sha
2052
2243
  * SHA of the file
@@ -2570,6 +2761,16 @@ export interface IMemoryUpdate {
2570
2761
  */
2571
2762
  metadata?: Record<string, any> | null;
2572
2763
  }
2764
+ /**
2765
+ * MoveKnowledgeRequest
2766
+ * 移动知识请求
2767
+ */
2768
+ export interface IMoveKnowledgeRequest {
2769
+ /** Knowledge Ids */
2770
+ knowledge_ids: string[];
2771
+ /** Target Folder Id */
2772
+ target_folder_id?: string | null;
2773
+ }
2573
2774
  /** NodePackageParseConfig */
2574
2775
  export interface INodePackageParseConfig {
2575
2776
  /**
@@ -2620,7 +2821,10 @@ export interface IOpenUrlSourceConfig {
2620
2821
  */
2621
2822
  auth_info?: string | Record<string, any> | null;
2622
2823
  }
2623
- /** PDFCreate */
2824
+ /**
2825
+ * PDFCreate
2826
+ * PDF 文档创建 DTO - 通过 markitdown 转换为 Markdown 后处理
2827
+ */
2624
2828
  export interface IPDFCreate {
2625
2829
  /**
2626
2830
  * Space Id
@@ -2656,12 +2860,12 @@ export interface IPDFCreate {
2656
2860
  * File Sha
2657
2861
  * SHA of the file
2658
2862
  */
2659
- file_sha: string;
2863
+ file_sha?: string | null;
2660
2864
  /**
2661
2865
  * File Size
2662
2866
  * Byte size of the file
2663
2867
  */
2664
- file_size: number;
2868
+ file_size?: number | null;
2665
2869
  /**
2666
2870
  * Parent Id
2667
2871
  * parent id of the knowledge
@@ -2672,8 +2876,8 @@ export interface IPDFCreate {
2672
2876
  * source config of the knowledge
2673
2877
  */
2674
2878
  source_config: IOpenUrlSourceConfig | IOpenIdSourceConfig | IS3SourceConfig;
2675
- /** split config of the knowledge */
2676
- split_config: IPDFSplitConfig;
2879
+ /** split config of the knowledge (markdown after markitdown conversion) */
2880
+ split_config: IMarkdownSplitConfig;
2677
2881
  }
2678
2882
  /**
2679
2883
  * PDFSplitConfig
@@ -3434,6 +3638,64 @@ export interface IPermission {
3434
3638
  /** Conditions */
3435
3639
  conditions?: Record<string, any> | null;
3436
3640
  }
3641
+ /**
3642
+ * PowerPointCreate
3643
+ * PowerPoint 文档创建 DTO - 通过 markitdown 转换为 Markdown 后处理
3644
+ */
3645
+ export interface IPowerPointCreate {
3646
+ /**
3647
+ * Space Id
3648
+ * the space of knowledge, example: petercat bot id, github repo name
3649
+ */
3650
+ space_id: string;
3651
+ /**
3652
+ * Knowledge Type
3653
+ * type of knowledge resource
3654
+ * @default "powerpoint"
3655
+ */
3656
+ knowledge_type?: "powerpoint";
3657
+ /**
3658
+ * Knowledge Name
3659
+ * name of the knowledge resource
3660
+ * @maxLength 255
3661
+ */
3662
+ knowledge_name: string;
3663
+ /**
3664
+ * Metadata
3665
+ * additional metadata, user can update it
3666
+ * @default {}
3667
+ */
3668
+ metadata?: Record<string, any>;
3669
+ /** source type */
3670
+ source_type: IKnowledgeSourceEnum;
3671
+ /**
3672
+ * Embedding Model Name
3673
+ * name of the embedding model. you can set any other model if target embedding service registered
3674
+ */
3675
+ embedding_model_name: string;
3676
+ /**
3677
+ * File Sha
3678
+ * SHA of the file
3679
+ */
3680
+ file_sha: string;
3681
+ /**
3682
+ * File Size
3683
+ * Byte size of the file
3684
+ */
3685
+ file_size: number;
3686
+ /**
3687
+ * Parent Id
3688
+ * parent id of the knowledge
3689
+ */
3690
+ parent_id?: string | null;
3691
+ /**
3692
+ * Source Config
3693
+ * source config of the knowledge
3694
+ */
3695
+ source_config: IOpenUrlSourceConfig | IOpenIdSourceConfig | IS3SourceConfig;
3696
+ /** split config of the knowledge (markdown after markitdown conversion) */
3697
+ split_config: IMarkdownSplitConfig;
3698
+ }
3437
3699
  /** QACreate */
3438
3700
  export interface IQACreate {
3439
3701
  /**
@@ -3622,6 +3884,14 @@ export interface IResponseModelCleanupHistoryResponse {
3622
3884
  /** Message */
3623
3885
  message?: string | null;
3624
3886
  }
3887
+ /** ResponseModel[CliApplyResponse] */
3888
+ export interface IResponseModelCliApplyResponse {
3889
+ /** Success */
3890
+ success: boolean;
3891
+ data?: ICliApplyResponse | null;
3892
+ /** Message */
3893
+ message?: string | null;
3894
+ }
3625
3895
  /** ResponseModel[Dict[str, Any]] */
3626
3896
  export interface IResponseModelDictStrAny {
3627
3897
  /** Success */
@@ -3698,6 +3968,15 @@ export interface IResponseModelListArtifactIndex {
3698
3968
  /** Message */
3699
3969
  message?: string | null;
3700
3970
  }
3971
+ /** ResponseModel[List[Dict[str, Any]]] */
3972
+ export interface IResponseModelListDictStrAny {
3973
+ /** Success */
3974
+ success: boolean;
3975
+ /** Data */
3976
+ data?: Record<string, any>[] | null;
3977
+ /** Message */
3978
+ message?: string | null;
3979
+ }
3701
3980
  /** ResponseModel[List[Knowledge]] */
3702
3981
  export interface IResponseModelListKnowledge {
3703
3982
  /** Success */
@@ -3965,6 +4244,22 @@ export interface IResponseModelStatusStatisticsPageResponseTask {
3965
4244
  /** Message */
3966
4245
  message?: string | null;
3967
4246
  }
4247
+ /** ResponseModel[SyncMaterializeData] */
4248
+ export interface IResponseModelSyncMaterializeData {
4249
+ /** Success */
4250
+ success: boolean;
4251
+ data?: ISyncMaterializeData | null;
4252
+ /** Message */
4253
+ message?: string | null;
4254
+ }
4255
+ /** ResponseModel[SyncSnapshotData] */
4256
+ export interface IResponseModelSyncSnapshotData {
4257
+ /** Success */
4258
+ success: boolean;
4259
+ data?: ISyncSnapshotData | null;
4260
+ /** Message */
4261
+ message?: string | null;
4262
+ }
3968
4263
  /** ResponseModel[Tag] */
3969
4264
  export interface IResponseModelTag {
3970
4265
  /** Success */
@@ -4707,6 +5002,77 @@ export interface IStatusStatisticsPageResponseTask {
4707
5002
  */
4708
5003
  deleted?: number;
4709
5004
  }
5005
+ /** SyncMaterializeData */
5006
+ export interface ISyncMaterializeData {
5007
+ /** Space Id */
5008
+ space_id: string;
5009
+ /** Items */
5010
+ items: ISyncMaterializeItem[];
5011
+ }
5012
+ /** SyncMaterializeItem */
5013
+ export interface ISyncMaterializeItem {
5014
+ /** Knowledge Id */
5015
+ knowledge_id: string;
5016
+ /** Knowledge Name */
5017
+ knowledge_name: string;
5018
+ /** Knowledge Type */
5019
+ knowledge_type: string;
5020
+ /** Source Type */
5021
+ source_type: string;
5022
+ /** File Sha */
5023
+ file_sha?: string | null;
5024
+ /** File Size */
5025
+ file_size?: number | null;
5026
+ /** Parent Id */
5027
+ parent_id?: string | null;
5028
+ /** Metadata */
5029
+ metadata?: Record<string, any>;
5030
+ /** Text Content */
5031
+ text_content?: string | null;
5032
+ /** File Url */
5033
+ file_url?: string | null;
5034
+ /** Source Locator */
5035
+ source_locator?: Record<string, any> | null;
5036
+ /** Materialize Error */
5037
+ materialize_error?: string | null;
5038
+ }
5039
+ /** SyncMaterializeRequest */
5040
+ export interface ISyncMaterializeRequest {
5041
+ /** Space Id */
5042
+ space_id: string;
5043
+ /** Knowledge Ids */
5044
+ knowledge_ids?: string[];
5045
+ }
5046
+ /** SyncSnapshotData */
5047
+ export interface ISyncSnapshotData {
5048
+ /** Space Id */
5049
+ space_id: string;
5050
+ /** Snapshot Token */
5051
+ snapshot_token: string;
5052
+ /** Items */
5053
+ items: ISyncSnapshotItem[];
5054
+ }
5055
+ /** SyncSnapshotItem */
5056
+ export interface ISyncSnapshotItem {
5057
+ /** Knowledge Id */
5058
+ knowledge_id: string;
5059
+ /** Knowledge Name */
5060
+ knowledge_name: string;
5061
+ /** Knowledge Type */
5062
+ knowledge_type: string;
5063
+ /** Source Type */
5064
+ source_type: string;
5065
+ /** File Sha */
5066
+ file_sha?: string | null;
5067
+ /** File Size */
5068
+ file_size?: number | null;
5069
+ /** Updated At */
5070
+ updated_at?: string | null;
5071
+ /** Metadata Digest */
5072
+ metadata_digest?: string | null;
5073
+ /** Parent Id */
5074
+ parent_id?: string | null;
5075
+ }
4710
5076
  /** Tag */
4711
5077
  export interface ITag {
4712
5078
  /**
@@ -5385,6 +5751,61 @@ export interface IWebhookTestResponse {
5385
5751
  /** Error */
5386
5752
  error: string | null;
5387
5753
  }
5754
+ /**
5755
+ * WebpageCreate
5756
+ * 网页 URL 创建 DTO - 通过 markdown.new 转换为 Markdown 后处理
5757
+ */
5758
+ export interface IWebpageCreate {
5759
+ /**
5760
+ * Space Id
5761
+ * the space of knowledge, example: petercat bot id, github repo name
5762
+ */
5763
+ space_id: string;
5764
+ /**
5765
+ * Knowledge Type
5766
+ * type of knowledge resource
5767
+ * @default "webpage"
5768
+ */
5769
+ knowledge_type?: "webpage";
5770
+ /**
5771
+ * Knowledge Name
5772
+ * name of the knowledge resource
5773
+ * @maxLength 255
5774
+ */
5775
+ knowledge_name: string;
5776
+ /**
5777
+ * Metadata
5778
+ * additional metadata, user can update it
5779
+ * @default {}
5780
+ */
5781
+ metadata?: Record<string, any>;
5782
+ /** source type */
5783
+ source_type: IKnowledgeSourceEnum;
5784
+ /**
5785
+ * Embedding Model Name
5786
+ * name of the embedding model. you can set any other model if target embedding service registered
5787
+ */
5788
+ embedding_model_name: string;
5789
+ /**
5790
+ * File Sha
5791
+ * SHA of the file
5792
+ */
5793
+ file_sha?: string | null;
5794
+ /**
5795
+ * File Size
5796
+ * size of the file
5797
+ */
5798
+ file_size?: number | null;
5799
+ /**
5800
+ * Parent Id
5801
+ * parent id of the knowledge
5802
+ */
5803
+ parent_id?: string | null;
5804
+ /** source config of the knowledge (webpage URL) */
5805
+ source_config: IOpenUrlSourceConfig;
5806
+ /** split config of the knowledge (markdown after markdown.new conversion) */
5807
+ split_config: IMarkdownSplitConfig;
5808
+ }
5388
5809
  /**
5389
5810
  * WohuProductSpace
5390
5811
  * 产品空间响应模型
@@ -5665,7 +6086,7 @@ export declare class Api<SecurityDataType extends unknown> extends HttpClient<Se
5665
6086
  * @summary Add Knowledge
5666
6087
  * @request POST:/api/knowledge/add
5667
6088
  */
5668
- addKnowledge: (data: (ITextCreate | IImageCreate | IJSONCreate | IMarkdownCreate | IPDFCreate | IGithubRepoCreate | IQACreate | IYuqueCreate | IHituNodePackageCreate | IHituNodePackageElementCreate)[], params?: RequestParams) => Promise<HttpResponse<IResponseModelListKnowledge, void | IHTTPValidationError>>;
6089
+ addKnowledge: (data: (ITextCreate | IImageCreate | IJSONCreate | IMarkdownCreate | IPDFCreate | IPowerPointCreate | IWebpageCreate | IGithubRepoCreate | IQACreate | IYuqueCreate | IHituNodePackageCreate | IHituNodePackageElementCreate | IFolderCreate)[], params?: RequestParams) => Promise<HttpResponse<IResponseModelListKnowledge, void | IHTTPValidationError>>;
5669
6090
  /**
5670
6091
  * @description 更新知识(全量更新) 更新知识的完整信息,支持以下字段变更: - 元数据(metadata)变更:同步更新对应 chunk 的 metadata - 启用状态(enabled)变更:同步更新对应 chunk 的启用状态 - 嵌入模型/分片配置/来源配置变更:自动触发重新入库任务 注意:knowledge_type、source_type 等核心字段不可变更。 Args: knowledge: 完整的知识对象,需包含 knowledge_id Returns: 更新后的知识对象(auth_info 字段已脱敏)
5671
6092
  *
@@ -5733,7 +6154,7 @@ export declare class Api<SecurityDataType extends unknown> extends HttpClient<Se
5733
6154
  knowledge_id: string;
5734
6155
  }, params?: RequestParams) => Promise<HttpResponse<IResponseModelKnowledge, void | IHTTPValidationError>>;
5735
6156
  /**
5736
- * @description 删除知识 级联删除知识及其关联数据: - 删除 MySQL 中的知识记录和相关任务 - 删除向量数据库中的所有 chunk 数据 - 清除所属 Space 的总结时间标记(下次总结时将进行全量总结) Args: knowledge_id: 要删除的知识ID Raises: 404: 知识不存在
6157
+ * @description 删除知识 如果删除的是 folder 类型,会自动级联删除所有子孙节点。 级联删除知识及其关联数据: - 删除 MySQL 中的知识记录和相关任务 - 删除向量数据库中的所有 chunk 数据 - 清除所属 Space 的总结时间标记(下次总结时将进行全量总结) Args: knowledge_id: 要删除的知识ID Raises: 404: 知识不存在
5737
6158
  *
5738
6159
  * @tags knowledge
5739
6160
  * @name DeleteKnowledge
@@ -5752,7 +6173,7 @@ export declare class Api<SecurityDataType extends unknown> extends HttpClient<Se
5752
6173
  * @summary Get Embedding Models List
5753
6174
  * @request GET:/api/knowledge/embedding/models
5754
6175
  */
5755
- getEmbeddingModelsList: (params?: RequestParams) => Promise<HttpResponse<any, void | IHTTPValidationError>>;
6176
+ getEmbeddingModelsList: (params?: RequestParams) => Promise<HttpResponse<IResponseModelListDictStrAny, void | IHTTPValidationError>>;
5756
6177
  /**
5757
6178
  * @description 根据名称批量查询知识 在指定 Space 下,根据知识名称列表批量查询知识详情。 适用于已知知识名称需要获取完整信息的场景。 Args: body.space_id: 空间ID body.knowledge_names: 知识名称列表 Returns: 符合条件的知识列表(auth_info 字段已脱敏)
5758
6179
  *
@@ -5801,6 +6222,35 @@ export declare class Api<SecurityDataType extends unknown> extends HttpClient<Se
5801
6222
  * @request POST:/api/knowledge/refresh/by_conditions
5802
6223
  */
5803
6224
  refreshKnowledgeByConditions: (data: IKnowledgeRefreshByConditionsRequest, params?: RequestParams) => Promise<HttpResponse<IResponseModelKnowledgeRefreshResult, void | IHTTPValidationError>>;
6225
+ /**
6226
+ * @description 获取目录树结构 获取指定空间下的文件夹树形结构,返回嵌套的树形数据。 自动检测并处理循环引用。 Args: space_id: 空间ID root_id: 根节点ID,None 表示从空间根目录开始 Returns: 嵌套的树形结构,包含 items 列表
6227
+ *
6228
+ * @tags knowledge
6229
+ * @name GetFolderTree
6230
+ * @summary Get Folder Tree
6231
+ * @request GET:/api/knowledge/folder/tree
6232
+ */
6233
+ getFolderTree: (query: {
6234
+ /**
6235
+ * Space Id
6236
+ * 空间ID
6237
+ */
6238
+ space_id: string;
6239
+ /**
6240
+ * Root Id
6241
+ * 根节点ID,None 表示从空间根目录开始
6242
+ */
6243
+ root_id?: string | null;
6244
+ }, params?: RequestParams) => Promise<HttpResponse<IResponseModelDictStrAny, void | IHTTPValidationError>>;
6245
+ /**
6246
+ * @description 移动知识到指定文件夹下 将指定的知识批量移动到目标文件夹。如果目标文件夹不存在或不是文件夹类型, 将抛出异常。不支持将文件夹移动到自身或其子文件夹下。 Args: body.knowledge_ids: 要移动的知识ID列表 body.target_folder_id: 目标文件夹ID,None 表示移动到根目录 Returns: 成功时返回 None
6247
+ *
6248
+ * @tags knowledge
6249
+ * @name MoveKnowledgeToFolder
6250
+ * @summary Move Knowledge To Folder
6251
+ * @request POST:/api/knowledge/folder/move
6252
+ */
6253
+ moveKnowledgeToFolder: (data: IMoveKnowledgeRequest, params?: RequestParams) => Promise<HttpResponse<IResponseModelNoneType, void | IHTTPValidationError>>;
5804
6254
  };
5805
6255
  knowledgeIndex: {
5806
6256
  /**
@@ -6054,7 +6504,7 @@ export declare class Api<SecurityDataType extends unknown> extends HttpClient<Se
6054
6504
  page_size?: number;
6055
6505
  }, params?: RequestParams) => Promise<HttpResponse<IResponseModelPageResponseTenant, void | IHTTPValidationError>>;
6056
6506
  /**
6057
- * @description 获取当前租户信息 通过请求头中的认证信息(secret_key)获取当前租户的详细信息。 无需传入任何参数,系统自动从认证上下文中识别租户身份。 Returns: 当前认证租户的详细信息(secret_key 字段已脱敏)
6507
+ * @description 获取当前租户信息 Returns: 当前租户的详细信息(secret_key 字段已脱敏)
6058
6508
  *
6059
6509
  * @tags tenant
6060
6510
  * @name GetTenant
@@ -6796,7 +7246,7 @@ export declare class Api<SecurityDataType extends unknown> extends HttpClient<Se
6796
7246
  };
6797
7247
  file: {
6798
7248
  /**
6799
- * @description 上传文件到 AFTS 存储 这是一个开放接口,无需权限校验。上传的文件会被存储到 AFTS(Ant File Transfer Service)。 文件路径生成规则: - 使用日期做分隔:{year}/{month}/{day}/ - 随机码作为路径层级:{random_code}/ - 文件名保持原样:{filename} - 最终格式:2026/03/01/abc123def456/image.png 设计意图: - 文件名保持原样,方便识别和管理 - 随机码作为路径层级,增加不可预测性 - 文件可读,但路径不可猜测 Args: file: 上传的文件 Returns: FileUploadResponse: 包含文件 ID、URL、路径等信息
7249
+ * @description 上传文件到 AFTS 存储 需要 FILE 资源的 CREATE 权限。上传的文件会被存储到 AFTS(Ant File Transfer Service)。 文件路径生成规则: - tenant_id 作为根路径:{tenant_id}/ - 使用日期做分隔:{year}/{month}/{day}/ - 随机码作为路径层级:{random_code}/ - 文件名保持原样:{filename} - 最终格式:tenant_xxx/2026/03/01/abc123def456/image.png 设计意图: - tenant_id 追踪文件归属 - 文件名保持原样,方便识别和管理 - 随机码作为路径层级,增加不可预测性 - 文件可读,但路径不可猜测 Args: file: 上传的文件 Returns: FileUploadResponse: 包含文件 ID、URL、路径等信息
6800
7250
  *
6801
7251
  * @tags file
6802
7252
  * @name UploadFile
@@ -6805,6 +7255,38 @@ export declare class Api<SecurityDataType extends unknown> extends HttpClient<Se
6805
7255
  */
6806
7256
  uploadFile: (data: IBodyUploadFile, params?: RequestParams) => Promise<HttpResponse<IResponseModelFileUploadResponse, void | IHTTPValidationError>>;
6807
7257
  };
7258
+ cli: {
7259
+ /**
7260
+ * No description
7261
+ *
7262
+ * @tags cli_sync
7263
+ * @name CliSyncSnapshot
7264
+ * @summary Get Sync Snapshot
7265
+ * @request GET:/api/cli/sync/snapshot
7266
+ */
7267
+ cliSyncSnapshot: (query: {
7268
+ /** Space Id */
7269
+ space_id: string;
7270
+ }, params?: RequestParams) => Promise<HttpResponse<IResponseModelSyncSnapshotData, void | IHTTPValidationError>>;
7271
+ /**
7272
+ * No description
7273
+ *
7274
+ * @tags cli_sync
7275
+ * @name CliSyncMaterialize
7276
+ * @summary Materialize Sync Knowledge
7277
+ * @request POST:/api/cli/sync/materialize
7278
+ */
7279
+ cliSyncMaterialize: (data: ISyncMaterializeRequest, params?: RequestParams) => Promise<HttpResponse<IResponseModelSyncMaterializeData, void | IHTTPValidationError>>;
7280
+ /**
7281
+ * No description
7282
+ *
7283
+ * @tags cli_sync
7284
+ * @name CliSyncApply
7285
+ * @summary Apply Sync Changeset
7286
+ * @request POST:/api/cli/sync/apply
7287
+ */
7288
+ cliSyncApply: (data: ICliApplyRequest, params?: RequestParams) => Promise<HttpResponse<IResponseModelCliApplyResponse, void | IHTTPValidationError>>;
7289
+ };
6808
7290
  healthChecker: {
6809
7291
  /**
6810
7292
  * No description
package/dist/api.js CHANGED
@@ -22,7 +22,7 @@ var __rest = (this && this.__rest) || function (s, e) {
22
22
  return t;
23
23
  };
24
24
  Object.defineProperty(exports, "__esModule", { value: true });
25
- exports.Api = exports.HttpClient = exports.ContentType = exports.IAction = exports.IKnowledgeSourceEnum = exports.IKnowledgeTypeEnum = exports.ILanguage = exports.IMemoryStatusEnum = exports.IMemoryTypeEnum = exports.IOperator = exports.IResource = exports.ISchedulerCronTimezone = exports.ISchedulerIntervalType = exports.ISchedulerJobStatus = exports.ISchedulerJobType = exports.ISchedulerRunResult = exports.ISchedulerTargetType = exports.ITagObjectType = exports.ITaskStatus = exports.ITextKnowledgeContentUpdateStatusEnum = exports.IWebhookDeliveryStatus = exports.IWebhookEventType = exports.IWebhookOutboxStatus = exports.IWebhookSubscriptionStatus = void 0;
25
+ exports.Api = exports.HttpClient = exports.ContentType = exports.IAction = exports.ICliApplyStatus = exports.ICliChangeOp = exports.IKnowledgeSourceEnum = exports.IKnowledgeTypeEnum = exports.ILanguage = exports.IMemoryStatusEnum = exports.IMemoryTypeEnum = exports.IOperator = exports.IResource = exports.ISchedulerCronTimezone = exports.ISchedulerIntervalType = exports.ISchedulerJobStatus = exports.ISchedulerJobType = exports.ISchedulerRunResult = exports.ISchedulerTargetType = exports.ITagObjectType = exports.ITaskStatus = exports.ITextKnowledgeContentUpdateStatusEnum = exports.IWebhookDeliveryStatus = exports.IWebhookEventType = exports.IWebhookOutboxStatus = exports.IWebhookSubscriptionStatus = void 0;
26
26
  /**
27
27
  * WebhookSubscriptionStatus
28
28
  * Webhook订阅状态
@@ -250,7 +250,10 @@ var IKnowledgeTypeEnum;
250
250
  IKnowledgeTypeEnum["Json"] = "json";
251
251
  IKnowledgeTypeEnum["Docx"] = "docx";
252
252
  IKnowledgeTypeEnum["Pdf"] = "pdf";
253
+ IKnowledgeTypeEnum["Powerpoint"] = "powerpoint";
254
+ IKnowledgeTypeEnum["Webpage"] = "webpage";
253
255
  IKnowledgeTypeEnum["Qa"] = "qa";
256
+ IKnowledgeTypeEnum["Folder"] = "folder";
254
257
  IKnowledgeTypeEnum["Yuquedoc"] = "yuquedoc";
255
258
  IKnowledgeTypeEnum["YuqueBook"] = "yuque_book";
256
259
  IKnowledgeTypeEnum["GithubRepo"] = "github_repo";
@@ -296,12 +299,28 @@ var IKnowledgeSourceEnum;
296
299
  IKnowledgeSourceEnum["GithubFile"] = "github_file";
297
300
  IKnowledgeSourceEnum["UserInputText"] = "user_input_text";
298
301
  IKnowledgeSourceEnum["CloudStorageText"] = "cloud_storage_text";
302
+ IKnowledgeSourceEnum["CloudStorageFile"] = "cloud_storage_file";
299
303
  IKnowledgeSourceEnum["CloudStorageImage"] = "cloud_storage_image";
304
+ IKnowledgeSourceEnum["Os"] = "os";
300
305
  IKnowledgeSourceEnum["Yuque"] = "yuque";
301
306
  IKnowledgeSourceEnum["YuquePersonalDoc"] = "yuque_personal_doc";
302
307
  IKnowledgeSourceEnum["YuquePersonalNote"] = "yuque_personal_note";
303
308
  IKnowledgeSourceEnum["HituNodePackage"] = "hitu_node_package";
304
309
  })(IKnowledgeSourceEnum || (exports.IKnowledgeSourceEnum = IKnowledgeSourceEnum = {}));
310
+ /** CliChangeOp */
311
+ var ICliChangeOp;
312
+ (function (ICliChangeOp) {
313
+ ICliChangeOp["Add"] = "add";
314
+ ICliChangeOp["Modify"] = "modify";
315
+ ICliChangeOp["Delete"] = "delete";
316
+ })(ICliChangeOp || (exports.ICliChangeOp = ICliChangeOp = {}));
317
+ /** CliApplyStatus */
318
+ var ICliApplyStatus;
319
+ (function (ICliApplyStatus) {
320
+ ICliApplyStatus["Applied"] = "applied";
321
+ ICliApplyStatus["Skipped"] = "skipped";
322
+ ICliApplyStatus["Failed"] = "failed";
323
+ })(ICliApplyStatus || (exports.ICliApplyStatus = ICliApplyStatus = {}));
305
324
  /** Action */
306
325
  var IAction;
307
326
  (function (IAction) {
@@ -555,7 +574,7 @@ class Api extends HttpClient {
555
574
  */
556
575
  getKnowledgeById: (query, params = {}) => this.request(Object.assign({ path: `/api/knowledge/detail`, method: "GET", query: query, format: "json" }, params)),
557
576
  /**
558
- * @description 删除知识 级联删除知识及其关联数据: - 删除 MySQL 中的知识记录和相关任务 - 删除向量数据库中的所有 chunk 数据 - 清除所属 Space 的总结时间标记(下次总结时将进行全量总结) Args: knowledge_id: 要删除的知识ID Raises: 404: 知识不存在
577
+ * @description 删除知识 如果删除的是 folder 类型,会自动级联删除所有子孙节点。 级联删除知识及其关联数据: - 删除 MySQL 中的知识记录和相关任务 - 删除向量数据库中的所有 chunk 数据 - 清除所属 Space 的总结时间标记(下次总结时将进行全量总结) Args: knowledge_id: 要删除的知识ID Raises: 404: 知识不存在
559
578
  *
560
579
  * @tags knowledge
561
580
  * @name DeleteKnowledge
@@ -617,6 +636,24 @@ class Api extends HttpClient {
617
636
  * @request POST:/api/knowledge/refresh/by_conditions
618
637
  */
619
638
  refreshKnowledgeByConditions: (data, params = {}) => this.request(Object.assign({ path: `/api/knowledge/refresh/by_conditions`, method: "POST", body: data, type: ContentType.Json, format: "json" }, params)),
639
+ /**
640
+ * @description 获取目录树结构 获取指定空间下的文件夹树形结构,返回嵌套的树形数据。 自动检测并处理循环引用。 Args: space_id: 空间ID root_id: 根节点ID,None 表示从空间根目录开始 Returns: 嵌套的树形结构,包含 items 列表
641
+ *
642
+ * @tags knowledge
643
+ * @name GetFolderTree
644
+ * @summary Get Folder Tree
645
+ * @request GET:/api/knowledge/folder/tree
646
+ */
647
+ getFolderTree: (query, params = {}) => this.request(Object.assign({ path: `/api/knowledge/folder/tree`, method: "GET", query: query, format: "json" }, params)),
648
+ /**
649
+ * @description 移动知识到指定文件夹下 将指定的知识批量移动到目标文件夹。如果目标文件夹不存在或不是文件夹类型, 将抛出异常。不支持将文件夹移动到自身或其子文件夹下。 Args: body.knowledge_ids: 要移动的知识ID列表 body.target_folder_id: 目标文件夹ID,None 表示移动到根目录 Returns: 成功时返回 None
650
+ *
651
+ * @tags knowledge
652
+ * @name MoveKnowledgeToFolder
653
+ * @summary Move Knowledge To Folder
654
+ * @request POST:/api/knowledge/folder/move
655
+ */
656
+ moveKnowledgeToFolder: (data, params = {}) => this.request(Object.assign({ path: `/api/knowledge/folder/move`, method: "POST", body: data, type: ContentType.Json, format: "json" }, params)),
620
657
  };
621
658
  this.knowledgeIndex = {
622
659
  /**
@@ -853,7 +890,7 @@ class Api extends HttpClient {
853
890
  */
854
891
  getTenantList: (query, params = {}) => this.request(Object.assign({ path: `/api/tenant/list`, method: "GET", query: query, format: "json" }, params)),
855
892
  /**
856
- * @description 获取当前租户信息 通过请求头中的认证信息(secret_key)获取当前租户的详细信息。 无需传入任何参数,系统自动从认证上下文中识别租户身份。 Returns: 当前认证租户的详细信息(secret_key 字段已脱敏)
893
+ * @description 获取当前租户信息 Returns: 当前租户的详细信息(secret_key 字段已脱敏)
857
894
  *
858
895
  * @tags tenant
859
896
  * @name GetTenant
@@ -1566,7 +1603,7 @@ class Api extends HttpClient {
1566
1603
  };
1567
1604
  this.file = {
1568
1605
  /**
1569
- * @description 上传文件到 AFTS 存储 这是一个开放接口,无需权限校验。上传的文件会被存储到 AFTS(Ant File Transfer Service)。 文件路径生成规则: - 使用日期做分隔:{year}/{month}/{day}/ - 随机码作为路径层级:{random_code}/ - 文件名保持原样:{filename} - 最终格式:2026/03/01/abc123def456/image.png 设计意图: - 文件名保持原样,方便识别和管理 - 随机码作为路径层级,增加不可预测性 - 文件可读,但路径不可猜测 Args: file: 上传的文件 Returns: FileUploadResponse: 包含文件 ID、URL、路径等信息
1606
+ * @description 上传文件到 AFTS 存储 需要 FILE 资源的 CREATE 权限。上传的文件会被存储到 AFTS(Ant File Transfer Service)。 文件路径生成规则: - tenant_id 作为根路径:{tenant_id}/ - 使用日期做分隔:{year}/{month}/{day}/ - 随机码作为路径层级:{random_code}/ - 文件名保持原样:{filename} - 最终格式:tenant_xxx/2026/03/01/abc123def456/image.png 设计意图: - tenant_id 追踪文件归属 - 文件名保持原样,方便识别和管理 - 随机码作为路径层级,增加不可预测性 - 文件可读,但路径不可猜测 Args: file: 上传的文件 Returns: FileUploadResponse: 包含文件 ID、URL、路径等信息
1570
1607
  *
1571
1608
  * @tags file
1572
1609
  * @name UploadFile
@@ -1575,6 +1612,35 @@ class Api extends HttpClient {
1575
1612
  */
1576
1613
  uploadFile: (data, params = {}) => this.request(Object.assign({ path: `/api/file/upload`, method: "POST", body: data, type: ContentType.FormData, format: "json" }, params)),
1577
1614
  };
1615
+ this.cli = {
1616
+ /**
1617
+ * No description
1618
+ *
1619
+ * @tags cli_sync
1620
+ * @name CliSyncSnapshot
1621
+ * @summary Get Sync Snapshot
1622
+ * @request GET:/api/cli/sync/snapshot
1623
+ */
1624
+ cliSyncSnapshot: (query, params = {}) => this.request(Object.assign({ path: `/api/cli/sync/snapshot`, method: "GET", query: query, format: "json" }, params)),
1625
+ /**
1626
+ * No description
1627
+ *
1628
+ * @tags cli_sync
1629
+ * @name CliSyncMaterialize
1630
+ * @summary Materialize Sync Knowledge
1631
+ * @request POST:/api/cli/sync/materialize
1632
+ */
1633
+ cliSyncMaterialize: (data, params = {}) => this.request(Object.assign({ path: `/api/cli/sync/materialize`, method: "POST", body: data, type: ContentType.Json, format: "json" }, params)),
1634
+ /**
1635
+ * No description
1636
+ *
1637
+ * @tags cli_sync
1638
+ * @name CliSyncApply
1639
+ * @summary Apply Sync Changeset
1640
+ * @request POST:/api/cli/sync/apply
1641
+ */
1642
+ cliSyncApply: (data, params = {}) => this.request(Object.assign({ path: `/api/cli/sync/apply`, method: "POST", body: data, type: ContentType.Json, format: "json" }, params)),
1643
+ };
1578
1644
  this.healthChecker = {
1579
1645
  /**
1580
1646
  * No description
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@petercatai/whisker-client",
3
- "version": "2.0.0",
3
+ "version": "3.0.0",
4
4
  "description": "Generated API client (Production)",
5
5
  "main": "dist/api.js",
6
6
  "types": "dist/api.d.ts",