pcm-agents 0.2.2 → 0.2.4

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 (28) hide show
  1. package/dist/cjs/loader.cjs.js +1 -1
  2. package/dist/cjs/pcm-agents.cjs.js +1 -1
  3. package/dist/cjs/pcm-chat-message.pcm-hr-chat-modal.entry.cjs.js.map +1 -1
  4. package/dist/cjs/pcm-chat-message_2.cjs.entry.js +23 -19
  5. package/dist/cjs/pcm-chat-message_2.cjs.entry.js.map +1 -1
  6. package/dist/collection/components/pcm-hr-chat-modal/pcm-hr-chat-modal.css +34 -1
  7. package/dist/collection/components/pcm-hr-chat-modal/pcm-hr-chat-modal.js +58 -33
  8. package/dist/collection/components/pcm-hr-chat-modal/pcm-hr-chat-modal.js.map +1 -1
  9. package/dist/components/pcm-hr-chat-modal.js +26 -21
  10. package/dist/components/pcm-hr-chat-modal.js.map +1 -1
  11. package/dist/esm/loader.js +1 -1
  12. package/dist/esm/pcm-agents.js +1 -1
  13. package/dist/esm/pcm-chat-message.pcm-hr-chat-modal.entry.js.map +1 -1
  14. package/dist/esm/pcm-chat-message_2.entry.js +23 -19
  15. package/dist/esm/pcm-chat-message_2.entry.js.map +1 -1
  16. package/dist/pcm-agents/app-globals-DQuL1Twl.js.map +1 -0
  17. package/dist/pcm-agents/index-Csq0E9fM.js.map +1 -0
  18. package/dist/pcm-agents/index.esm.js.map +1 -1
  19. package/dist/pcm-agents/{p-f8a52c86.entry.js → p-ed58d206.entry.js} +2 -2
  20. package/dist/pcm-agents/p-ed58d206.entry.js.map +1 -0
  21. package/dist/pcm-agents/pcm-agents.esm.js +1 -1
  22. package/dist/pcm-agents/pcm-agents.esm.js.map +1 -1
  23. package/dist/pcm-agents/pcm-chat-message.pcm-hr-chat-modal.entry.esm.js.map +1 -1
  24. package/dist/pcm-agents/utils-CxmVTYHl.js.map +1 -0
  25. package/dist/types/components/pcm-hr-chat-modal/pcm-hr-chat-modal.d.ts +12 -6
  26. package/dist/types/components.d.ts +16 -8
  27. package/package.json +1 -1
  28. package/dist/pcm-agents/p-f8a52c86.entry.js.map +0 -1
@@ -682,7 +682,7 @@
682
682
  /* 修改 recording-status 样式 */
683
683
  .recording-status {
684
684
  position: absolute;
685
- bottom: 10px;
685
+ top: 10px;
686
686
  left: 10px;
687
687
  background-color: rgba(0, 0, 0, 0.6);
688
688
  color: white;
@@ -799,4 +799,37 @@
799
799
 
800
800
  .recording-controls .stop-recording-button.disabled:hover {
801
801
  background: #ccc;
802
+ }
803
+
804
+ /* 添加进度条和数字进度的样式 */
805
+ .progress-container {
806
+ display: flex;
807
+ justify-content: space-between;
808
+ align-items: center;
809
+ width: 100%;
810
+ max-width: 400px;
811
+ margin-top: 10px;
812
+ padding: 0 5px;
813
+ }
814
+
815
+ .progress-bar-container {
816
+ height: 4px;
817
+ background-color: #E5E5E5;
818
+ border-radius: 2px;
819
+ overflow: hidden;
820
+ margin-right: 10px;
821
+ width: 75px;
822
+ }
823
+
824
+ .progress-bar {
825
+ height: 100%;
826
+ background-image: linear-gradient(111deg, #4A9FFF 0%, #1058FF 100%);
827
+ border-radius: 2px;
828
+ transition: width 0.3s ease;
829
+ }
830
+
831
+ .progress-text {
832
+ font-size: 14px;
833
+ color: #666;
834
+ white-space: nowrap;
802
835
  }
@@ -133,9 +133,9 @@ export class ChatHRModal {
133
133
  countdownWarningTime = 30;
134
134
  showCountdownWarning = false;
135
135
  /**
136
- * 用户邮箱
136
+ * 接收报告的邮箱地址
137
137
  */
138
- email = '';
138
+ toEmail = '';
139
139
  /**
140
140
  * 是否以全屏模式打开
141
141
  */
@@ -150,10 +150,6 @@ export class ChatHRModal {
150
150
  isPlayingAudio = false;
151
151
  audioUrl = null;
152
152
  audioElement = null;
153
- /**
154
- * 欢迎提示语,如果不提供则不显示提示
155
- */
156
- welcomeMessage;
157
153
  /**
158
154
  * 录制错误事件
159
155
  */
@@ -166,6 +162,16 @@ export class ChatHRModal {
166
162
  * 是否播放语音问题
167
163
  */
168
164
  enableVoice = true;
165
+ /**
166
+ * 是否显示题干内容
167
+ * 1: 显示题干内容
168
+ * 0: 不显示题干内容
169
+ */
170
+ displayContentStatus = "1";
171
+ /**
172
+ * 用户ID
173
+ */
174
+ userId = '';
169
175
  handleClose = () => {
170
176
  this.isOpen = false;
171
177
  this.stopRecording();
@@ -237,7 +243,7 @@ export class ChatHRModal {
237
243
  const lastAIMessage = this.messages.length > 0 ? this.messages[this.messages.length - 1] : null;
238
244
  // 保存AI提问和用户回答
239
245
  if (lastAIMessage && this.conversationId && message !== "下一题") {
240
- this.saveAnswer(this.conversationId, '1234567890', lastAIMessage.answer, // AI的提问作为question
246
+ this.saveAnswer(this.conversationId, lastAIMessage.answer, // AI的提问作为question
241
247
  queryText // 用户的输入作为answer
242
248
  );
243
249
  }
@@ -280,12 +286,13 @@ export class ChatHRModal {
280
286
  response_mode: 'streaming',
281
287
  conversation_id: this.conversationId,
282
288
  query: queryText,
283
- user: '1234567890'
289
+ user: this.userId // 使用传入的 userId
284
290
  };
285
291
  requestData.inputs = {
286
292
  job_info: this.selectedJobCategory,
287
293
  dimensional_info: this.selectedDimensions.join(','),
288
- email: this.email,
294
+ email: this.toEmail,
295
+ display_content_status: this.displayContentStatus
289
296
  };
290
297
  // 如果有上传的文件,添加到inputs参数
291
298
  if (this.uploadedFileInfo.length > 0) {
@@ -384,7 +391,7 @@ export class ChatHRModal {
384
391
  });
385
392
  }
386
393
  // 添加保存答案的方法
387
- async saveAnswer(conversationId, user, question, answer) {
394
+ async saveAnswer(conversationId, question, answer) {
388
395
  try {
389
396
  await sendHttpRequest({
390
397
  url: 'https://pcm_api.ylzhaopin.com/agents/hr_competition/answer',
@@ -394,7 +401,7 @@ export class ChatHRModal {
394
401
  },
395
402
  data: {
396
403
  conversation_id: conversationId,
397
- user: user,
404
+ user: this.userId, // 使用传入的 userId
398
405
  question: question,
399
406
  answer: answer
400
407
  },
@@ -456,7 +463,6 @@ export class ChatHRModal {
456
463
  data: {
457
464
  conversation_id: this.conversationId,
458
465
  bot_id: this.botId,
459
- user: '1234567890',
460
466
  limit: 20
461
467
  },
462
468
  onMessage: (data) => {
@@ -510,10 +516,6 @@ export class ChatHRModal {
510
516
  if (this.conversationId) {
511
517
  await this.loadHistoryMessages();
512
518
  }
513
- else if (this.welcomeMessage) {
514
- // 如果是新会话且提供了欢迎提示语,则显示
515
- alert(this.welcomeMessage);
516
- }
517
519
  }
518
520
  }
519
521
  handleJobCategorySelect = (category) => {
@@ -875,7 +877,7 @@ export class ChatHRModal {
875
877
  },
876
878
  data: {
877
879
  conversation_id: this.conversationId,
878
- user: '1234567890',
880
+ user: this.userId, // 使用传入的 userId
879
881
  question: lastAIMessage.answer,
880
882
  file_url: cosKey
881
883
  },
@@ -1052,7 +1054,9 @@ export class ChatHRModal {
1052
1054
  (this.requireResume && this.isUploading), onClick: this.handleInitialSubmit }, this.requireResume && this.isUploading ? '上传中...' : '开始面试')), this.requireResume && (h("input", { type: "file", class: "file-input", onChange: this.handleFileChange, accept: ".pdf,.doc,.docx,.txt" })))) : (h("div", { style: { height: '100%' } }, h("div", { class: "chat-history", onScroll: this.handleScroll }, this.isLoadingHistory ? (h("div", { class: "loading-container" }, h("div", { class: "loading-spinner" }), h("p", null, "\u52A0\u8F7D\u5386\u53F2\u6D88\u606F\u4E2D..."))) : (h("div", null, this.messages.map((message) => (h("div", { id: `message_${message.id}`, key: message.id }, h("pcm-chat-message", { message: message, onMessageChange: (event) => {
1053
1055
  const updatedMessages = this.messages.map(msg => msg.id === message.id ? { ...msg, ...event.detail } : msg);
1054
1056
  this.messages = updatedMessages;
1055
- } })))), this.currentStreamingMessage && (h("div", { id: `message_${this.currentStreamingMessage.id}` }, h("pcm-chat-message", { message: this.currentStreamingMessage }))), this.messages.length === 0 && !this.currentStreamingMessage && (h("div", { class: "empty-state" }, h("p", null, "\u8BF7\u4E0A\u4F20\u7B80\u5386\u5F00\u59CB\u9762\u8BD5")))))), h("div", { class: "recording-section" }, h("div", { class: "recording-container" }, h("div", { class: "video-area" }, this.showRecordingUI ? (renderVideoPreview()) : (h("div", { class: "video-preview placeholder" }, renderPlaceholderStatus()))), h("div", { class: "recording-controls" }, this.showRecordingUI ? (h("button", { class: "stop-recording-button", onClick: () => this.stopRecording() }, "\u5B8C\u6210\u672C\u9898\u56DE\u7B54")) : (h("div", { class: "waiting-message" }, (() => {
1057
+ } })))), this.currentStreamingMessage && (h("div", { id: `message_${this.currentStreamingMessage.id}` }, h("pcm-chat-message", { message: this.currentStreamingMessage }))), this.messages.length === 0 && !this.currentStreamingMessage && (h("div", { class: "empty-state" }, h("p", null, "\u8BF7\u4E0A\u4F20\u7B80\u5386\u5F00\u59CB\u9762\u8BD5")))))), h("div", { class: "recording-section" }, h("div", { class: "recording-container" }, h("div", { class: "video-area" }, this.showRecordingUI ? (renderVideoPreview()) : (h("div", { class: "video-preview placeholder" }, renderPlaceholderStatus()))), h("div", { class: "progress-container" }, h("div", { class: "progress-bar-container" }, h("div", { class: "progress-bar", style: {
1058
+ width: `${Math.max(0, this.currentQuestionNumber - 1) / this.totalQuestions * 100}%`
1059
+ } })), h("div", { class: "progress-text" }, "\u5DF2\u5B8C\u6210", Math.max(0, this.currentQuestionNumber - 1), "/", this.totalQuestions)), h("div", { class: "recording-controls" }, this.showRecordingUI ? (h("button", { class: "stop-recording-button", onClick: () => this.stopRecording() }, "\u5B8C\u6210\u672C\u9898\u56DE\u7B54")) : (h("div", { class: "waiting-message" }, (() => {
1056
1060
  // 显示播放按钮(当不自动播放且有音频URL时)
1057
1061
  if (!this.enableVoice && this.audioUrl && !this.isPlayingAudio) {
1058
1062
  return (h("div", { class: "play-audio-container", onClick: this.handlePlayAudio }, h("p", null, h("svg", { viewBox: "0 0 24 24", width: "24", height: "24", fill: "currentColor", style: { verticalAlign: 'middle', marginRight: '8px' } }, h("path", { d: "M8 5v14l11-7z" })), h("span", { style: { verticalAlign: 'middle' } }, "\u64AD\u653E\u9898\u76EE"))));
@@ -1332,7 +1336,7 @@ export class ChatHRModal {
1332
1336
  "reflect": false,
1333
1337
  "defaultValue": "30"
1334
1338
  },
1335
- "email": {
1339
+ "toEmail": {
1336
1340
  "type": "string",
1337
1341
  "mutable": false,
1338
1342
  "complexType": {
@@ -1344,11 +1348,11 @@ export class ChatHRModal {
1344
1348
  "optional": false,
1345
1349
  "docs": {
1346
1350
  "tags": [],
1347
- "text": "\u7528\u6237\u90AE\u7BB1"
1351
+ "text": "\u63A5\u6536\u62A5\u544A\u7684\u90AE\u7BB1\u5730\u5740"
1348
1352
  },
1349
1353
  "getter": false,
1350
1354
  "setter": false,
1351
- "attribute": "email",
1355
+ "attribute": "to-email",
1352
1356
  "reflect": false,
1353
1357
  "defaultValue": "''"
1354
1358
  },
@@ -1392,7 +1396,27 @@ export class ChatHRModal {
1392
1396
  "reflect": false,
1393
1397
  "defaultValue": "false"
1394
1398
  },
1395
- "welcomeMessage": {
1399
+ "enableVoice": {
1400
+ "type": "boolean",
1401
+ "mutable": false,
1402
+ "complexType": {
1403
+ "original": "boolean",
1404
+ "resolved": "boolean",
1405
+ "references": {}
1406
+ },
1407
+ "required": false,
1408
+ "optional": false,
1409
+ "docs": {
1410
+ "tags": [],
1411
+ "text": "\u662F\u5426\u64AD\u653E\u8BED\u97F3\u95EE\u9898"
1412
+ },
1413
+ "getter": false,
1414
+ "setter": false,
1415
+ "attribute": "enable-voice",
1416
+ "reflect": false,
1417
+ "defaultValue": "true"
1418
+ },
1419
+ "displayContentStatus": {
1396
1420
  "type": "string",
1397
1421
  "mutable": false,
1398
1422
  "complexType": {
@@ -1401,35 +1425,36 @@ export class ChatHRModal {
1401
1425
  "references": {}
1402
1426
  },
1403
1427
  "required": false,
1404
- "optional": true,
1428
+ "optional": false,
1405
1429
  "docs": {
1406
1430
  "tags": [],
1407
- "text": "\u6B22\u8FCE\u63D0\u793A\u8BED\uFF0C\u5982\u679C\u4E0D\u63D0\u4F9B\u5219\u4E0D\u663E\u793A\u63D0\u793A"
1431
+ "text": "\u662F\u5426\u663E\u793A\u9898\u5E72\u5185\u5BB9\r\n1: \u663E\u793A\u9898\u5E72\u5185\u5BB9\r\n0: \u4E0D\u663E\u793A\u9898\u5E72\u5185\u5BB9"
1408
1432
  },
1409
1433
  "getter": false,
1410
1434
  "setter": false,
1411
- "attribute": "welcome-message",
1412
- "reflect": false
1435
+ "attribute": "display-content-status",
1436
+ "reflect": false,
1437
+ "defaultValue": "\"1\""
1413
1438
  },
1414
- "enableVoice": {
1415
- "type": "boolean",
1439
+ "userId": {
1440
+ "type": "string",
1416
1441
  "mutable": false,
1417
1442
  "complexType": {
1418
- "original": "boolean",
1419
- "resolved": "boolean",
1443
+ "original": "string",
1444
+ "resolved": "string",
1420
1445
  "references": {}
1421
1446
  },
1422
1447
  "required": false,
1423
1448
  "optional": false,
1424
1449
  "docs": {
1425
1450
  "tags": [],
1426
- "text": "\u662F\u5426\u64AD\u653E\u8BED\u97F3\u95EE\u9898"
1451
+ "text": "\u7528\u6237ID"
1427
1452
  },
1428
1453
  "getter": false,
1429
1454
  "setter": false,
1430
- "attribute": "enable-voice",
1455
+ "attribute": "user-id",
1431
1456
  "reflect": false,
1432
- "defaultValue": "true"
1457
+ "defaultValue": "''"
1433
1458
  }
1434
1459
  };
1435
1460
  }