pcm-agents 0.3.0 → 0.3.2

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 (146) hide show
  1. package/LICENSE +21 -21
  2. package/dist/cjs/index-BFPEnLbS.js +195 -0
  3. package/dist/cjs/index-BFPEnLbS.js.map +1 -0
  4. package/dist/cjs/index.cjs.js +1 -1
  5. package/dist/cjs/loader.cjs.js +1 -1
  6. package/dist/cjs/my-component.cjs.entry.js +2 -2
  7. package/dist/cjs/my-component.cjs.entry.js.map +1 -1
  8. package/dist/cjs/my-component.entry.cjs.js.map +1 -1
  9. package/dist/cjs/pcm-agents.cjs.js +1 -1
  10. package/dist/cjs/pcm-app-chat-modal.pcm-chat-message.pcm-hr-chat-modal.pcm-jlpx-modal.pcm-mnms-modal.pcm-video-chat-modal.pcm-zygh-modal.entry.cjs.js.map +1 -0
  11. package/dist/cjs/pcm-app-chat-modal_7.cjs.entry.js +6560 -0
  12. package/dist/cjs/pcm-app-chat-modal_7.cjs.entry.js.map +1 -0
  13. package/dist/cjs/pcm-chat-modal.cjs.entry.js +17 -32
  14. package/dist/cjs/pcm-chat-modal.cjs.entry.js.map +1 -1
  15. package/dist/cjs/pcm-chat-modal.entry.cjs.js.map +1 -1
  16. package/dist/collection/collection-manifest.json +2 -0
  17. package/dist/collection/components/my-component/my-component.css +3 -3
  18. package/dist/collection/components/my-component/my-component.js +1 -1
  19. package/dist/collection/components/my-component/my-component.js.map +1 -1
  20. package/dist/collection/components/pcm-app-chat-modal/pcm-app-chat-modal.css +2 -1
  21. package/dist/collection/components/pcm-app-chat-modal/pcm-app-chat-modal.js +137 -159
  22. package/dist/collection/components/pcm-app-chat-modal/pcm-app-chat-modal.js.map +1 -1
  23. package/dist/collection/components/pcm-chat-message/pcm-chat-message.css +66 -12
  24. package/dist/collection/components/pcm-chat-message/pcm-chat-message.js +106 -13
  25. package/dist/collection/components/pcm-chat-message/pcm-chat-message.js.map +1 -1
  26. package/dist/collection/components/pcm-chat-modal/pcm-chat-modal.js +39 -34
  27. package/dist/collection/components/pcm-chat-modal/pcm-chat-modal.js.map +1 -1
  28. package/dist/collection/components/pcm-hr-chat-modal/pcm-hr-chat-modal.js +76 -105
  29. package/dist/collection/components/pcm-hr-chat-modal/pcm-hr-chat-modal.js.map +1 -1
  30. package/dist/collection/components/pcm-jlpx-modal/pcm-jlpx-modal.css +162 -0
  31. package/dist/collection/components/pcm-jlpx-modal/pcm-jlpx-modal.js +616 -0
  32. package/dist/collection/components/pcm-jlpx-modal/pcm-jlpx-modal.js.map +1 -0
  33. package/dist/collection/components/pcm-mnms-modal/pcm-mnms-modal.css +0 -79
  34. package/dist/collection/components/pcm-mnms-modal/pcm-mnms-modal.js +133 -81
  35. package/dist/collection/components/pcm-mnms-modal/pcm-mnms-modal.js.map +1 -1
  36. package/dist/collection/components/pcm-video-chat-modal/pcm-video-chat-modal.js +77 -101
  37. package/dist/collection/components/pcm-video-chat-modal/pcm-video-chat-modal.js.map +1 -1
  38. package/dist/collection/components/pcm-zygh-modal/pcm-zygh-modal.css +273 -0
  39. package/dist/collection/components/pcm-zygh-modal/pcm-zygh-modal.js +613 -0
  40. package/dist/collection/components/pcm-zygh-modal/pcm-zygh-modal.js.map +1 -0
  41. package/dist/collection/global/global.css +324 -0
  42. package/dist/collection/index.js.map +1 -1
  43. package/dist/collection/interfaces/chat.js.map +1 -1
  44. package/dist/collection/utils/utils.js +54 -113
  45. package/dist/collection/utils/utils.js.map +1 -1
  46. package/dist/components/index.js +1298 -11280
  47. package/dist/components/index.js.map +1 -1
  48. package/dist/components/my-component.js +2 -3
  49. package/dist/components/my-component.js.map +1 -1
  50. package/dist/components/{p-C4l_DOnx.js → p-BctfuDvG.js} +106 -147
  51. package/dist/components/p-BctfuDvG.js.map +1 -0
  52. package/dist/components/{p-D0s1Q-3O.js → p-LkDC0SN2.js} +343 -16
  53. package/dist/components/p-LkDC0SN2.js.map +1 -0
  54. package/dist/components/pcm-app-chat-modal.js +1 -1
  55. package/dist/components/pcm-chat-message.js +1 -1
  56. package/dist/components/pcm-chat-modal.js +19 -34
  57. package/dist/components/pcm-chat-modal.js.map +1 -1
  58. package/dist/components/pcm-hr-chat-modal.js +70 -100
  59. package/dist/components/pcm-hr-chat-modal.js.map +1 -1
  60. package/dist/components/pcm-jlpx-modal.d.ts +11 -0
  61. package/dist/components/pcm-jlpx-modal.js +339 -0
  62. package/dist/components/pcm-jlpx-modal.js.map +1 -0
  63. package/dist/components/pcm-mnms-modal.js +109 -57
  64. package/dist/components/pcm-mnms-modal.js.map +1 -1
  65. package/dist/components/pcm-video-chat-modal.js +74 -99
  66. package/dist/components/pcm-video-chat-modal.js.map +1 -1
  67. package/dist/components/pcm-zygh-modal.d.ts +11 -0
  68. package/dist/components/pcm-zygh-modal.js +330 -0
  69. package/dist/components/pcm-zygh-modal.js.map +1 -0
  70. package/dist/esm/index-nVjZGfA8.js +189 -0
  71. package/dist/esm/index-nVjZGfA8.js.map +1 -0
  72. package/dist/esm/index.js +1 -1
  73. package/dist/esm/loader.js +1 -1
  74. package/dist/esm/my-component.entry.js +2 -2
  75. package/dist/esm/my-component.entry.js.map +1 -1
  76. package/dist/esm/pcm-agents.js +1 -1
  77. package/dist/esm/pcm-app-chat-modal.pcm-chat-message.pcm-hr-chat-modal.pcm-jlpx-modal.pcm-mnms-modal.pcm-video-chat-modal.pcm-zygh-modal.entry.js.map +1 -0
  78. package/dist/esm/pcm-app-chat-modal_7.entry.js +6552 -0
  79. package/dist/esm/pcm-app-chat-modal_7.entry.js.map +1 -0
  80. package/dist/esm/pcm-chat-modal.entry.js +17 -32
  81. package/dist/esm/pcm-chat-modal.entry.js.map +1 -1
  82. package/dist/pcm-agents/index.esm.js +1 -1
  83. package/dist/pcm-agents/my-component.entry.esm.js.map +1 -1
  84. package/dist/pcm-agents/p-55417392.entry.js +2 -0
  85. package/dist/pcm-agents/p-55417392.entry.js.map +1 -0
  86. package/dist/pcm-agents/p-a698b59f.entry.js +2 -0
  87. package/dist/pcm-agents/p-a698b59f.entry.js.map +1 -0
  88. package/dist/pcm-agents/p-f3ca99b4.entry.js +2 -0
  89. package/dist/pcm-agents/p-f3ca99b4.entry.js.map +1 -0
  90. package/dist/pcm-agents/p-nVjZGfA8.js +2 -0
  91. package/dist/pcm-agents/p-nVjZGfA8.js.map +1 -0
  92. package/dist/pcm-agents/pcm-agents.esm.js +1 -1
  93. package/dist/pcm-agents/pcm-app-chat-modal.pcm-chat-message.pcm-hr-chat-modal.pcm-jlpx-modal.pcm-mnms-modal.pcm-video-chat-modal.pcm-zygh-modal.entry.esm.js.map +1 -0
  94. package/dist/pcm-agents/pcm-chat-modal.entry.esm.js.map +1 -1
  95. package/dist/types/components/pcm-app-chat-modal/pcm-app-chat-modal.d.ts +13 -8
  96. package/dist/types/components/pcm-chat-message/pcm-chat-message.d.ts +5 -0
  97. package/dist/types/components/pcm-chat-modal/pcm-chat-modal.d.ts +8 -8
  98. package/dist/types/components/pcm-hr-chat-modal/pcm-hr-chat-modal.d.ts +6 -12
  99. package/dist/types/components/pcm-jlpx-modal/pcm-jlpx-modal.d.ts +113 -0
  100. package/dist/types/components/pcm-mnms-modal/pcm-mnms-modal.d.ts +19 -20
  101. package/dist/types/components/pcm-video-chat-modal/pcm-video-chat-modal.d.ts +4 -4
  102. package/dist/types/components/pcm-zygh-modal/pcm-zygh-modal.d.ts +117 -0
  103. package/dist/types/components.d.ts +429 -80
  104. package/dist/types/interfaces/chat.d.ts +0 -4
  105. package/dist/types/utils/utils.d.ts +29 -83
  106. package/package.json +61 -60
  107. package/readme.md +307 -307
  108. package/dist/cjs/index-DfIUl99H.js +0 -11413
  109. package/dist/cjs/index-DfIUl99H.js.map +0 -1
  110. package/dist/cjs/pcm-app-chat-modal.pcm-chat-message.pcm-mnms-modal.entry.cjs.js.map +0 -1
  111. package/dist/cjs/pcm-app-chat-modal_3.cjs.entry.js +0 -3734
  112. package/dist/cjs/pcm-app-chat-modal_3.cjs.entry.js.map +0 -1
  113. package/dist/cjs/pcm-hr-chat-modal.cjs.entry.js +0 -1078
  114. package/dist/cjs/pcm-hr-chat-modal.cjs.entry.js.map +0 -1
  115. package/dist/cjs/pcm-hr-chat-modal.entry.cjs.js.map +0 -1
  116. package/dist/cjs/pcm-video-chat-modal.cjs.entry.js +0 -927
  117. package/dist/cjs/pcm-video-chat-modal.cjs.entry.js.map +0 -1
  118. package/dist/cjs/pcm-video-chat-modal.entry.cjs.js.map +0 -1
  119. package/dist/components/p-C4l_DOnx.js.map +0 -1
  120. package/dist/components/p-CgDy4pJp.js +0 -1244
  121. package/dist/components/p-CgDy4pJp.js.map +0 -1
  122. package/dist/components/p-D0s1Q-3O.js.map +0 -1
  123. package/dist/esm/index-B2EtEi7v.js +0 -11409
  124. package/dist/esm/index-B2EtEi7v.js.map +0 -1
  125. package/dist/esm/pcm-app-chat-modal.pcm-chat-message.pcm-mnms-modal.entry.js.map +0 -1
  126. package/dist/esm/pcm-app-chat-modal_3.entry.js +0 -3730
  127. package/dist/esm/pcm-app-chat-modal_3.entry.js.map +0 -1
  128. package/dist/esm/pcm-hr-chat-modal.entry.js +0 -1076
  129. package/dist/esm/pcm-hr-chat-modal.entry.js.map +0 -1
  130. package/dist/esm/pcm-video-chat-modal.entry.js +0 -925
  131. package/dist/esm/pcm-video-chat-modal.entry.js.map +0 -1
  132. package/dist/pcm-agents/p-0ddd5c47.entry.js +0 -2
  133. package/dist/pcm-agents/p-0ddd5c47.entry.js.map +0 -1
  134. package/dist/pcm-agents/p-5f624943.entry.js +0 -2
  135. package/dist/pcm-agents/p-5f624943.entry.js.map +0 -1
  136. package/dist/pcm-agents/p-6c07f155.entry.js +0 -2
  137. package/dist/pcm-agents/p-6c07f155.entry.js.map +0 -1
  138. package/dist/pcm-agents/p-9a1fb6ca.entry.js +0 -2
  139. package/dist/pcm-agents/p-9a1fb6ca.entry.js.map +0 -1
  140. package/dist/pcm-agents/p-B2EtEi7v.js +0 -146
  141. package/dist/pcm-agents/p-B2EtEi7v.js.map +0 -1
  142. package/dist/pcm-agents/p-e21bc169.entry.js +0 -2
  143. package/dist/pcm-agents/p-e21bc169.entry.js.map +0 -1
  144. package/dist/pcm-agents/pcm-app-chat-modal.pcm-chat-message.pcm-mnms-modal.entry.esm.js.map +0 -1
  145. package/dist/pcm-agents/pcm-hr-chat-modal.entry.esm.js.map +0 -1
  146. package/dist/pcm-agents/pcm-video-chat-modal.entry.esm.js.map +0 -1
@@ -23,10 +23,6 @@ export interface ChatMessage {
23
23
  * 是否正在流式输出
24
24
  */
25
25
  isStreaming?: boolean;
26
- /**
27
- * 机器人ID
28
- */
29
- bot_id?: string;
30
26
  /**
31
27
  * 输入参数
32
28
  */
@@ -1,3 +1,7 @@
1
+ /**
2
+ * API域名配置
3
+ */
4
+ export declare const API_DOMAIN = "https://pcm_api.ylzhaopin.com";
1
5
  export declare function format(first?: string, middle?: string, last?: string): string;
2
6
  export interface UserInputMessageType {
3
7
  message: string;
@@ -60,17 +64,27 @@ export interface HttpRequestConfig {
60
64
  headers?: Record<string, string>;
61
65
  params?: Record<string, any>;
62
66
  data?: any;
67
+ formData?: FormData;
63
68
  onMessage?: (data: any) => void;
64
69
  onError?: (error: any) => void;
65
70
  onComplete?: () => void;
66
71
  }
72
+ /**
73
+ * 统一的API响应接口
74
+ */
75
+ export interface ApiResponse<T = any> {
76
+ code: number;
77
+ message: string;
78
+ data?: T;
79
+ }
67
80
  /**
68
81
  * HTTP响应接口
69
82
  */
70
83
  export interface HttpResponse<T = any> {
71
- isOk: boolean;
84
+ success: boolean;
72
85
  data?: T;
73
86
  error?: any;
87
+ message?: string;
74
88
  }
75
89
  /**
76
90
  * 发送HTTP请求
@@ -79,92 +93,24 @@ export interface HttpResponse<T = any> {
79
93
  */
80
94
  export declare const sendHttpRequest: <T = any>(config: HttpRequestConfig) => Promise<HttpResponse<T>>;
81
95
  /**
82
- * COS上传配置接口
96
+ * 文件上传响应数据接口
83
97
  */
84
- export interface COSUploadConfig {
85
- SecretId: string;
86
- SecretKey: string;
87
- SecurityToken?: string;
88
- StartTime?: number;
89
- ExpiredTime?: number;
90
- Bucket: string;
91
- Region: string;
92
- Key: string;
93
- file: File;
94
- onProgress?: (progress: number) => void;
95
- onSuccess?: (result: COSUploadResult) => void;
96
- onError?: (error: any) => void;
97
- }
98
- /**
99
- * COS上传结果接口
100
- */
101
- export interface COSUploadResult {
102
- Location: string;
103
- Bucket: string;
104
- Key: string;
105
- ETag: string;
106
- FileSize: number;
107
- RequestId: string;
98
+ export interface FileUploadResponse {
99
+ /** 文件在对象存储中的唯一标识符 */
100
+ cos_key: string;
101
+ /** 文件名称 */
102
+ file_name: string;
103
+ /** 文件大小(带单位的字符串,如 "1.5MB") */
104
+ file_size: string;
105
+ /** 文件的预签名URL */
106
+ presigned_url: string;
107
+ /** 文件扩展名 */
108
+ ext: string;
108
109
  }
109
- /**
110
- * COS文件上传工具函数
111
- * @param config 上传配置
112
- * @returns Promise<COSUploadResult>
113
- */
114
- export declare const uploadToCOS: (config: COSUploadConfig) => Promise<COSUploadResult>;
115
- /**
116
- * 简单的文件类型检查工具
117
- * @param file 文件对象
118
- * @param allowedTypes 允许的文件类型数组
119
- * @returns boolean
120
- */
121
- export declare const checkFileType: (file: File, allowedTypes: string[]) => boolean;
122
- /**
123
- * 文件大小检查工具
124
- * @param file 文件对象
125
- * @param maxSize 最大文件大小(单位:MB)
126
- * @returns boolean
127
- */
128
- export declare const checkFileSize: (file: File, maxSize: number) => boolean;
129
- /**
130
- * COS认证信息接口
131
- */
132
- export interface COSAuthInfo {
133
- filename?: string;
134
- filetype?: string;
135
- filesize?: number;
136
- cos?: {
137
- region?: string;
138
- bucket?: string;
139
- cos_key?: string;
140
- };
141
- auth?: {
142
- expiredTime?: number;
143
- expiration?: string;
144
- requestId?: string;
145
- startTime?: number;
146
- credentials?: {
147
- sessionToken?: string;
148
- tmpSecretId?: string;
149
- tmpSecretKey?: string;
150
- };
151
- };
152
- }
153
- /**
154
- * 获取COS上传认证信息
155
- * @param file 文件对象
156
- * @param tags 可选的标签数组
157
- * @returns Promise<COSAuthInfo>
158
- */
159
- export declare const getCosAuthInfo: (file: File, tags?: string[]) => Promise<COSAuthInfo>;
160
110
  /**
161
111
  * 通过后端API上传文件
162
112
  * @param file 要上传的文件
113
+ * @param headers 可选的请求头
163
114
  * @returns Promise 包含上传结果
164
115
  */
165
- export declare const uploadFileToBackend: (file: File) => Promise<{
166
- id: string;
167
- name: string;
168
- size: number;
169
- type: string;
170
- }>;
116
+ export declare const uploadFileToBackend: (file: File, headers?: Record<string, string>) => Promise<FileUploadResponse>;
package/package.json CHANGED
@@ -1,60 +1,61 @@
1
- {
2
- "name": "pcm-agents",
3
- "version": "0.3.0",
4
- "description": "Stencil Component Starter",
5
- "main": "dist/index.cjs.js",
6
- "module": "dist/index.js",
7
- "types": "dist/types/index.d.ts",
8
- "collection": "dist/collection/collection-manifest.json",
9
- "collection:main": "dist/collection/index.js",
10
- "unpkg": "dist/pcm-agents/pcm-agents.esm.js",
11
- "exports": {
12
- ".": {
13
- "import": "./dist/pcm-agents/pcm-agents.esm.js",
14
- "require": "./dist/pcm-agents/pcm-agents.cjs.js"
15
- },
16
- "./dist/*": {
17
- "import": "./dist/*",
18
- "types": "./dist/*"
19
- },
20
- "./components/*": {
21
- "import": "./dist/components/*.js",
22
- "types": "./dist/components/*.d.ts"
23
- },
24
- "./loader": {
25
- "import": "./loader/index.js",
26
- "require": "./loader/index.cjs",
27
- "types": "./loader/index.d.ts"
28
- }
29
- },
30
- "repository": {
31
- "type": "git",
32
- "url": "https://github.com/stenciljs/component-starter.git"
33
- },
34
- "files": [
35
- "dist/",
36
- "loader/"
37
- ],
38
- "scripts": {
39
- "build": "stencil build",
40
- "dev": "stencil build --dev --watch --serve",
41
- "test": "stencil test --spec --e2e",
42
- "test.watch": "stencil test --spec --e2e --watchAll",
43
- "generate": "stencil generate"
44
- },
45
- "devDependencies": {
46
- "@stencil/core": "^4.27.1",
47
- "@types/jest": "^29.5.14",
48
- "@types/node": "^22.13.5",
49
- "jest": "^29.7.0",
50
- "jest-cli": "^29.7.0",
51
- "puppeteer": "^24.3.0"
52
- },
53
- "license": "MIT",
54
- "dependencies": {
55
- "@stencil/react-output-target": "^0.8.2",
56
- "@stencil/vue-output-target": "^0.10.7",
57
- "@types/marked": "^5.0.2",
58
- "marked": "^9.1.5"
59
- }
60
- }
1
+ {
2
+ "name": "pcm-agents",
3
+ "version": "0.3.2",
4
+ "description": "Components of pcm-agents",
5
+ "main": "dist/index.cjs.js",
6
+ "module": "dist/index.js",
7
+ "types": "dist/types/index.d.ts",
8
+ "collection": "dist/collection/collection-manifest.json",
9
+ "collection:main": "dist/collection/index.js",
10
+ "unpkg": "dist/pcm-agents/pcm-agents.esm.js",
11
+ "exports": {
12
+ ".": {
13
+ "import": "./dist/pcm-agents/pcm-agents.esm.js",
14
+ "require": "./dist/pcm-agents/pcm-agents.cjs.js"
15
+ },
16
+ "./dist/*": {
17
+ "import": "./dist/*",
18
+ "types": "./dist/*"
19
+ },
20
+ "./components/*": {
21
+ "import": "./dist/components/*.js",
22
+ "types": "./dist/components/*.d.ts"
23
+ },
24
+ "./loader": {
25
+ "import": "./loader/index.js",
26
+ "require": "./loader/index.cjs",
27
+ "types": "./loader/index.d.ts"
28
+ }
29
+ },
30
+ "repository": {
31
+ "type": "git",
32
+ "url": "https://github.com/stenciljs/component-starter.git"
33
+ },
34
+ "files": [
35
+ "dist/",
36
+ "loader/"
37
+ ],
38
+ "scripts": {
39
+ "build": "stencil build",
40
+ "dev": "stencil build --dev --watch --serve",
41
+ "test": "stencil test --spec --e2e",
42
+ "test.watch": "stencil test --spec --e2e --watchAll",
43
+ "generate": "stencil generate"
44
+ },
45
+ "devDependencies": {
46
+ "@stencil/core": "^4.27.1",
47
+ "@types/jest": "^29.5.14",
48
+ "@types/node": "^22.13.5",
49
+ "jest": "^29.7.0",
50
+ "jest-cli": "^29.7.0",
51
+ "puppeteer": "^24.3.0"
52
+ },
53
+ "license": "MIT",
54
+ "dependencies": {
55
+ "@stencil/react-output-target": "^0.8.2",
56
+ "@stencil/vue-output-target": "^0.10.7",
57
+ "@types/marked": "^5.0.2",
58
+ "marked": "^9.1.5",
59
+ "marked-extended-tables": "^2.0.1"
60
+ }
61
+ }