pcm-agents 0.2.0 → 0.2.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 (26) hide show
  1. package/dist/cjs/pcm-chat-message.pcm-hr-chat-modal.entry.cjs.js.map +1 -1
  2. package/dist/cjs/pcm-chat-message_2.cjs.entry.js +51 -40
  3. package/dist/cjs/pcm-chat-message_2.cjs.entry.js.map +1 -1
  4. package/dist/collection/components/pcm-chat-message/pcm-chat-message.css +1281 -1270
  5. package/dist/collection/components/pcm-chat-message/pcm-chat-message.js +2 -6
  6. package/dist/collection/components/pcm-chat-message/pcm-chat-message.js.map +1 -1
  7. package/dist/collection/components/pcm-hr-chat-modal/pcm-hr-chat-modal.css +123 -105
  8. package/dist/collection/components/pcm-hr-chat-modal/pcm-hr-chat-modal.js +47 -32
  9. package/dist/collection/components/pcm-hr-chat-modal/pcm-hr-chat-modal.js.map +1 -1
  10. package/dist/components/{p-DA_FsPRT.js → p-D0s1Q-3O.js} +5 -9
  11. package/dist/components/p-D0s1Q-3O.js.map +1 -0
  12. package/dist/components/pcm-chat-message.js +1 -1
  13. package/dist/components/pcm-chat-modal.js +1 -1
  14. package/dist/components/pcm-hr-chat-modal.js +49 -34
  15. package/dist/components/pcm-hr-chat-modal.js.map +1 -1
  16. package/dist/esm/pcm-chat-message.pcm-hr-chat-modal.entry.js.map +1 -1
  17. package/dist/esm/pcm-chat-message_2.entry.js +51 -40
  18. package/dist/esm/pcm-chat-message_2.entry.js.map +1 -1
  19. package/dist/pcm-agents/p-f8a52c86.entry.js +2 -0
  20. package/dist/pcm-agents/p-f8a52c86.entry.js.map +1 -0
  21. package/dist/pcm-agents/pcm-agents.esm.js +1 -1
  22. package/dist/pcm-agents/pcm-chat-message.pcm-hr-chat-modal.entry.esm.js.map +1 -1
  23. package/package.json +1 -1
  24. package/dist/components/p-DA_FsPRT.js.map +0 -1
  25. package/dist/pcm-agents/p-1a7b8c97.entry.js +0 -2
  26. package/dist/pcm-agents/p-1a7b8c97.entry.js.map +0 -1
@@ -1,8 +1,8 @@
1
1
  import { p as proxyCustomElement, H, c as createEvent, h } from './p-CgDy4pJp.js';
2
2
  import { a as sendSSERequest, s as sendHttpRequest } from './index.js';
3
- import { d as defineCustomElement$2 } from './p-DA_FsPRT.js';
3
+ import { d as defineCustomElement$2 } from './p-D0s1Q-3O.js';
4
4
 
5
- const pcmHrChatModalCss = ":host{display:block}.modal-overlay{position:fixed;top:0;left:0;right:0;bottom:0;background-color:rgba(0, 0, 0, 0.5);display:flex;justify-content:center;align-items:center;overflow-y:auto;padding:20px;z-index:1000}.fullscreen-overlay{padding:0}.modal-container{background:white;border-radius:8px;width:100%;max-width:800px;display:flex;flex-direction:column;position:relative;margin:auto}.modal-container.fullscreen{width:100vw;max-width:none;height:100%;border-radius:0;margin:0}.pc-layout{width:80%;max-width:800px;min-width:320px;min-height:400px}.mobile-layout{width:100%;height:100%;border-radius:0}@media screen and (max-width: 768px){.pc-layout{width:95%;}.modal-overlay{padding:0}.modal-container.fullscreen{height:-webkit-fill-available;max-height:-webkit-fill-available;padding:env(safe-area-inset-top) 0 env(safe-area-inset-bottom)}.modal-container.mobile-layout{width:100%;height:100vh;max-height:100vh;min-height:100vh;border-radius:0;margin:0;display:flex;flex-direction:column}.chat-history{height:34vh;max-height:34vh;min-height:34vh;flex:0 0 auto;}.recording-section{flex:1 1 auto;height:auto;margin:0;padding:20px;display:flex;flex-direction:column;justify-content:center;align-items:center;background-color:#f5f5f5}.recording-container{width:320px;display:flex;flex-direction:column;align-items:center}.video-area{width:100%}.video-preview{width:100%;height:200px;position:relative;border:1px solid #ddd;border-radius:4px;overflow:hidden;background:#fff}.video-preview.placeholder{display:flex;justify-content:center;align-items:center;background:#f8f8f8}.waiting-message{background:#1890ff;padding:12px 20px;border-radius:24px;text-align:center;box-shadow:0 2px 8px rgba(0, 0, 0, 0.15);white-space:nowrap}.waiting-message.loading{background:#faad14}.waiting-message p{margin:0;font-size:16px;color:white;font-weight:500}.stop-recording-button{width:100%;padding:12px;font-size:16px;border-radius:4px;background:#f44336;color:white;border:none;cursor:pointer}.stop-recording-button:hover{background:#d32f2f}}.modal-header{display:flex;justify-content:space-between;align-items:center;padding:4px 16px;height:50px;border-bottom:1px solid #e8e8e8}.header-left{display:flex;align-items:center;gap:8px}.header-icon{width:24px;height:24px}.close-button{background:transparent;border:none;cursor:pointer;padding:8px;display:flex;align-items:center;justify-content:center;width:32px;height:32px;border-radius:4px}.close-button:hover{background-color:rgba(0, 0, 0, 0.04)}.close-button span{font-size:24px;line-height:1;color:#999}.close-button:hover span{color:#666}.chat-history{position:relative;flex:1;overflow-y:auto;padding:20px;scroll-behavior:smooth;max-height:25vh;height:25vh}.message-input{padding:16px;border-top:1px solid #eee;display:flex;gap:8px;align-items:center}.message-input input{flex:1;padding:8px 12px;border:1px solid #ddd;border-radius:4px;outline:none;transition:border-color 0.2s ease}.message-input input:focus{border-color:#bbb}.message{margin-bottom:16px;opacity:1;transition:opacity 0.3s ease}.message-content{max-width:70%;padding:8px 12px;border-radius:8px;word-break:break-word}.message-content p{margin:0;word-break:break-word}.user-message{display:flex;justify-content:flex-end}.agent-message{display:flex;justify-content:flex-start}.user-message .message-content{background-color:#007bff;color:white}.agent-message .message-content{background-color:#f1f1f1}.message-time{font-size:12px;color:#999;margin-top:4px;display:block}.send-button{background-color:#1890ff;color:white;border:none;border-radius:4px;padding:8px 16px;cursor:pointer;font-weight:500}.send-button:disabled{background-color:#ccc;cursor:not-allowed}.empty-state{display:flex;justify-content:center;align-items:center;height:100%;color:#999;text-align:center}.loading-container{position:absolute;top:0;left:0;right:0;bottom:0;display:flex;flex-direction:column;justify-content:center;align-items:center;background-color:rgba(255, 255, 255, 0.98);z-index:1;opacity:1;transition:opacity 0.3s ease}.loading-container p{margin-top:16px;color:#666;font-size:14px}.loading-spinner{width:40px;height:40px;border:3px solid #f3f3f3;border-top:3px solid #1890ff;border-radius:50%;animation:spin 1s linear infinite}@keyframes spin{0%{transform:rotate(0deg)}100%{transform:rotate(360deg)}}.messages-wrapper{width:100%;min-height:100%;display:flex;flex-direction:column;justify-content:flex-end}.messages-wrapper.has-overflow{justify-content:flex-start}.suggested-questions{display:flex;flex-direction:column;gap:8px;padding:16px}.suggested-question{display:flex;align-items:center;justify-content:space-between;padding:8px 12px;background-color:#f3f4f6;border-radius:4px;cursor:pointer;font-size:14px;color:#374151;transition:background-color 0.2s}.suggested-question:hover{background-color:#e5e7eb}.arrow-right{margin-left:8px}.loading-suggestions{display:flex;justify-content:center;padding:16px}.loading-spinner-small{width:20px;height:20px;border:2px solid #e5e7eb;border-top-color:#6b7280;border-radius:50%;animation:spin 1s linear infinite}.upload-button{background:transparent;border:none;cursor:pointer;padding:8px;display:flex;align-items:center;justify-content:center;color:#666;border-radius:4px;transition:background-color 0.2s}.upload-button:hover{background-color:rgba(0, 0, 0, 0.04)}.upload-button svg{width:20px;height:20px}.file-input{display:none}.selected-file{font-size:12px;color:#666;margin-left:8px;max-width:150px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.input-wrapper{flex:1;display:flex;align-items:center;border:1px solid #ddd;border-radius:4px;padding:0 4px;background:white}.input-wrapper input{border:none;flex:1;padding:8px;outline:none}.input-wrapper:focus-within{border-color:#bbb}.file-preview{padding:8px 16px;border-top:1px solid #eee;background-color:#f9f9f9}.file-info{display:flex;align-items:center;justify-content:space-between;padding:8px;background:white;border:1px solid #e8e8e8;border-radius:4px}.file-name{font-size:13px;color:#333;margin-right:8px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;max-width:calc(100% - 30px)}.remove-file{background:transparent;border:none;color:#999;cursor:pointer;padding:4px 8px;font-size:16px;line-height:1;border-radius:4px;transition:all 0.2s}.remove-file:hover{background-color:#f0f0f0;color:#666}.initial-upload{padding:2rem 1rem;display:flex;flex-direction:column;align-items:center;height:100%}.upload-section{max-width:600px;width:100%;text-align:center}.upload-area{border:2px dashed #ddd;border-radius:8px;padding:1rem;cursor:pointer;transition:all 0.3s ease}.upload-area:hover{border-color:#1890ff;background-color:rgba(24, 144, 255, 0.05)}.upload-placeholder{display:flex;flex-direction:column;align-items:center;color:#666}.upload-hint{font-size:0.8rem;color:#999;margin-top:0.5rem}.function-select{margin-top:2rem}.function-options{display:flex;flex-wrap:wrap;gap:1rem;justify-content:center;margin-top:1rem}.function-button{padding:0.5rem 1rem;border:1px solid #ddd;border-radius:4px;background:white;cursor:pointer;transition:all 0.3s ease}.function-button:hover{border-color:#1890ff;color:#1890ff}.function-button.selected{background:#1890ff;color:white;border-color:#1890ff}.submit-button{margin-bottom:1rem;padding:0.8rem 2rem;background:#1890ff;color:white;border:none;border-radius:4px;font-size:1rem;cursor:pointer;transition:all 0.3s ease}.submit-button:disabled{background:#ccc;cursor:not-allowed}.submit-button:hover:not(:disabled){background:#40a9ff}.category-select,.dimension-select{margin:20px 0}.category-options,.dimension-options{display:flex;flex-wrap:wrap;gap:10px;margin-top:10px}.category-button,.dimension-button{padding:8px 16px;border:1px solid #ddd;border-radius:20px;background:white;cursor:pointer;transition:all 0.3s}.category-button:hover,.dimension-button:hover{background:#f5f5f5}.category-button.selected{background:#1890ff;color:white;border-color:#1890ff}.dimension-button.selected{background:#52c41a;color:white;border-color:#52c41a}.recording-section{margin-top:10px;padding:10px;border-top:1px solid #eee;display:flex;flex-direction:column;align-items:center}.recording-section .video-preview{width:320px;height:200px;position:relative;margin-bottom:10px;border:1px solid #ddd;border-radius:4px;overflow:hidden}.recording-section video{width:100%;height:100%;object-fit:cover}.recording-status{position:absolute;bottom:10px;left:10px;background-color:rgba(0, 0, 0, 0.6);color:white;padding:4px 8px;border-radius:4px;display:flex;align-items:center;gap:5px;font-size:0.8rem;z-index:2}.recording-status .recording-dot{display:inline-block;width:10px;height:10px;background-color:red;border-radius:50%;margin-right:5px;animation:blink 1s infinite}.recording-status.warning{color:#ff4d4f;animation:blink 1s infinite}@keyframes blink{0%{opacity:1}50%{opacity:0.5}100%{opacity:1}}.recording-section .stop-recording-button{padding:8px 16px;background-color:#f44336;color:white;border:none;border-radius:4px;cursor:pointer;font-weight:bold}.recording-section .stop-recording-button:hover{background-color:#d32f2f}.fullscreen{width:100vw;border-radius:0;height:100vh;display:flex;flex-direction:column;overflow-y:auto}.recording-controls{display:flex;justify-content:center;align-items:center;margin-top:1rem;min-height:40px;}.recording-controls .waiting-message{text-align:center;color:white;font-size:1rem;background:#1890ff;padding:12px 20px;border-radius:24px;box-shadow:0 2px 8px rgba(0, 0, 0, 0.15)}.recording-controls .waiting-message.loading{background:#faad14}.recording-controls .waiting-message p{margin:0;font-size:16px;color:white;font-weight:500}.recording-controls .stop-recording-button{padding:8px 20px;background-color:#dc3545;color:white;border:none;border-radius:4px;cursor:pointer;font-size:1rem}.recording-controls .stop-recording-button:hover{background-color:#c82333}";
5
+ const pcmHrChatModalCss = ":host{display:block}.modal-overlay{position:fixed;top:0;left:0;right:0;bottom:0;background-color:rgba(0, 0, 0, 0.5);display:flex;justify-content:center;align-items:center;overflow-y:auto;padding:20px;z-index:1000}.fullscreen-overlay{padding:0}.modal-container{background:white;border-radius:8px;width:100%;max-width:800px;display:flex;flex-direction:column;position:relative;margin:auto}.modal-container.fullscreen{width:100vw;max-width:none;height:100%;border-radius:0;margin:0;display:flex;flex-direction:column;height:100vh;max-height:100vh}.modal-container.fullscreen>div:not(.modal-header):not(.initial-upload){display:flex;flex-direction:column;flex:1;overflow:hidden;height:100%}.pc-layout{width:80%;max-width:800px;min-width:320px;min-height:400px}.mobile-layout{width:100%;height:100%;border-radius:0}@media screen and (max-width: 768px){.pc-layout{width:95%;}.modal-overlay{padding:0}.modal-container.fullscreen{height:-webkit-fill-available;max-height:-webkit-fill-available;padding:env(safe-area-inset-top) 0 env(safe-area-inset-bottom)}.modal-container.mobile-layout{width:100%;height:100vh;max-height:100vh;min-height:100vh;border-radius:0;margin:0;display:flex;flex-direction:column}}.video-preview.placeholder{display:flex;justify-content:center;align-items:center;background:#EAEAEA}.placeholder-status{color:#00000066}.waiting-message p{margin:0;font-size:16px;color:white;font-weight:500}.recording-container{width:100%;display:flex;flex-direction:column;align-items:center}.video-area{width:100%;display:flex;flex-direction:column;align-items:center}.stop-recording-button{width:100%;height:100%;font-size:16px;background:#f44336;border-radius:6px;color:white;border:none;cursor:pointer}.stop-recording-button:hover{background:#d32f2f}.play-audio-container{width:100%;height:100%;display:flex;justify-content:center;align-items:center}.modal-header{display:flex;justify-content:space-between;align-items:center;padding:4px 16px;height:50px;border-bottom:1px solid #e8e8e8;flex-shrink:0;}.header-left{display:flex;align-items:center;gap:8px}.header-icon{width:24px;height:24px}.close-button{background:transparent;border:none;cursor:pointer;padding:8px;display:flex;align-items:center;justify-content:center;width:32px;height:32px;border-radius:4px}.close-button:hover{background-color:rgba(0, 0, 0, 0.04)}.close-button span{font-size:24px;line-height:1;color:#999}.close-button:hover span{color:#666}.chat-history{position:relative;flex:1;overflow-y:auto;padding:20px;scroll-behavior:smooth;min-height:200px;background:url(https://pcm-resource-1312611446.cos.ap-guangzhou.myqcloud.com/web/sdk/chat_bg.png);background-size:100%}.fullscreen .chat-history{height:auto;flex:1 1 auto}.message-input{padding:16px;border-top:1px solid #eee;display:flex;gap:8px;align-items:center}.message-input input{flex:1;padding:8px 12px;border:1px solid #ddd;border-radius:4px;outline:none;transition:border-color 0.2s ease}.message-input input:focus{border-color:#bbb}.message{margin-bottom:16px;opacity:1;transition:opacity 0.3s ease}.message-content{max-width:70%;padding:8px 12px;border-radius:8px;word-break:break-word}.message-content p{margin:0;word-break:break-word}.user-message{display:flex;justify-content:flex-end}.agent-message{display:flex;justify-content:flex-start}.user-message .message-content{background-color:#007bff;color:white}.agent-message .message-content{background-color:#f1f1f1}.message-time{font-size:12px;color:#999;margin-top:4px;display:block}.send-button{background-color:#1890ff;color:white;border:none;border-radius:4px;padding:8px 16px;cursor:pointer;font-weight:500}.send-button:disabled{background-color:#ccc;cursor:not-allowed}.empty-state{display:flex;justify-content:center;align-items:center;height:100%;color:#999;text-align:center}.loading-container{position:absolute;top:0;left:0;right:0;bottom:0;display:flex;flex-direction:column;justify-content:center;align-items:center;background-color:rgba(255, 255, 255, 0.98);z-index:1;opacity:1;transition:opacity 0.3s ease}.loading-container p{margin-top:16px;color:#666;font-size:14px}.loading-spinner{width:40px;height:40px;border:3px solid #f3f3f3;border-top:3px solid #1890ff;border-radius:50%;animation:spin 1s linear infinite}@keyframes spin{0%{transform:rotate(0deg)}100%{transform:rotate(360deg)}}.messages-wrapper{width:100%;min-height:100%;display:flex;flex-direction:column;justify-content:flex-end}.messages-wrapper.has-overflow{justify-content:flex-start}.suggested-questions{display:flex;flex-direction:column;gap:8px;padding:16px}.suggested-question{display:flex;align-items:center;justify-content:space-between;padding:8px 12px;background-color:#f3f4f6;border-radius:4px;cursor:pointer;font-size:14px;color:#374151;transition:background-color 0.2s}.suggested-question:hover{background-color:#e5e7eb}.arrow-right{margin-left:8px}.loading-suggestions{display:flex;justify-content:center;padding:16px}.loading-spinner-small{width:20px;height:20px;border:2px solid #e5e7eb;border-top-color:#6b7280;border-radius:50%;animation:spin 1s linear infinite}.upload-button{background:transparent;border:none;cursor:pointer;padding:8px;display:flex;align-items:center;justify-content:center;color:#666;border-radius:4px;transition:background-color 0.2s}.upload-button:hover{background-color:rgba(0, 0, 0, 0.04)}.upload-button svg{width:20px;height:20px}.file-input{display:none}.selected-file{font-size:12px;color:#666;margin-left:8px;max-width:150px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.input-wrapper{flex:1;display:flex;align-items:center;border:1px solid #ddd;border-radius:4px;padding:0 4px;background:white}.input-wrapper input{border:none;flex:1;padding:8px;outline:none}.input-wrapper:focus-within{border-color:#bbb}.file-preview{padding:8px 16px;border-top:1px solid #eee;background-color:#f9f9f9}.file-info{display:flex;align-items:center;justify-content:space-between;padding:8px;background:white;border:1px solid #e8e8e8;border-radius:4px}.file-name{font-size:13px;color:#333;margin-right:8px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;max-width:calc(100% - 30px)}.remove-file{background:transparent;border:none;color:#999;cursor:pointer;padding:4px 8px;font-size:16px;line-height:1;border-radius:4px;transition:all 0.2s}.remove-file:hover{background-color:#f0f0f0;color:#666}.initial-upload{padding:1rem 1rem;display:flex;flex-direction:column;align-items:center;height:100%}.upload-section{max-width:600px;width:100%;text-align:center}.upload-area{border:2px dashed #ddd;border-radius:8px;padding:1rem;cursor:pointer;transition:all 0.3s ease}.upload-area:hover{border-color:#1890ff;background-color:rgba(24, 144, 255, 0.05)}.upload-placeholder{display:flex;flex-direction:column;align-items:center;color:#666}.upload-hint{font-size:0.8rem;color:#999;margin-top:0.5rem}.function-select{margin-top:2rem}.function-options{display:flex;flex-wrap:wrap;gap:1rem;justify-content:center;margin-top:1rem}.function-button{padding:0.5rem 1rem;border:1px solid #ddd;border-radius:4px;background:white;cursor:pointer;transition:all 0.3s ease}.function-button:hover{border-color:#1890ff;color:#1890ff}.function-button.selected{background:#1890ff;color:white;border-color:#1890ff}.submit-button{margin-top:1rem;padding:0.8rem 2rem;background:#1890ff;color:white;border:none;border-radius:4px;font-size:1rem;cursor:pointer;transition:all 0.3s ease;width:95%}.submit-button:disabled{background:#ccc;cursor:not-allowed}.submit-button:hover:not(:disabled){background:#40a9ff}.category-select,.dimension-select{margin:30px 0}.category-options,.dimension-options{display:flex;flex-wrap:wrap;gap:10px;margin-top:10px}.category-button,.dimension-button{padding:12px 16px;border:1px solid #E5E5E5;border-radius:6px;background:white;cursor:pointer;transition:all 0.3s}.category-button:hover,.dimension-button:hover{background:#f5f5f5}.category-button.selected{background-image:linear-gradient(111deg, #4A9FFF 0%, #1058FF 100%);color:white}.dimension-button.selected{background-image:linear-gradient(111deg, #4A9FFF 0%, #1058FF 100%);color:white}.recording-section{border-top:1px solid #eee;display:flex;flex-direction:column;align-items:center;padding:20px;border-radius:14px 14px 0 0;flex:0 0 auto}.recording-section .video-preview{width:100%;height:200px;max-width:400px;position:relative;margin-bottom:10px;border:1px solid #ddd;border-radius:12px;overflow:hidden}.recording-section video{width:100%;height:100%;object-fit:cover}.recording-status{position:absolute;bottom:10px;left:10px;background-color:rgba(0, 0, 0, 0.6);color:white;padding:4px 8px;border-radius:4px;display:flex;align-items:center;gap:5px;font-size:0.8rem;z-index:2}.recording-status .recording-dot{display:inline-block;width:10px;height:10px;background-color:red;border-radius:50%;margin-right:5px;animation:blink 1s infinite}.recording-status.warning{color:#ff4d4f;animation:blink 1s infinite}@keyframes blink{0%{opacity:1}50%{opacity:0.5}100%{opacity:1}}.recording-section .stop-recording-button{background-color:#f44336;color:white;border:none;cursor:pointer;font-weight:bold}.recording-section .stop-recording-button:hover{background-color:#d32f2f}.fullscreen{width:100vw;border-radius:0;height:100vh;display:flex;flex-direction:column;overflow-y:auto}.recording-controls{margin-top:10px;height:53px;width:100%;max-width:400px;display:flex;justify-content:center}.recording-controls .waiting-message{text-align:center;color:white;font-size:1rem;background-image:linear-gradient(100deg, #4A9FFF 0%, #1058FF 100%);border-radius:6px;box-shadow:0 2px 8px rgba(0, 0, 0, 0.15);width:95%;display:flex;justify-content:center;align-items:center;cursor:pointer}.recording-controls .waiting-message.loading{background:#faad14}.recording-controls .waiting-message p{margin:0;font-size:16px;color:white;font-weight:500}.recording-controls .stop-recording-button{background-color:#dc3545;color:white;border:none;cursor:pointer;font-size:1rem}.recording-controls .stop-recording-button:hover{background-color:#c82333}.recording-controls .stop-recording-button.disabled{background:#ccc;cursor:not-allowed}.recording-controls .stop-recording-button.disabled:hover{background:#ccc}";
6
6
 
7
7
  const ChatHRModal = /*@__PURE__*/ proxyCustomElement(class ChatHRModal extends H {
8
8
  constructor() {
@@ -241,6 +241,7 @@ const ChatHRModal = /*@__PURE__*/ proxyCustomElement(class ChatHRModal extends H
241
241
  async sendMessageToAPI(message) {
242
242
  this.isLoading = true;
243
243
  let answer = '';
244
+ let llmText = ''; // 添加变量存储 LLMText
244
245
  const now = new Date();
245
246
  const time = `${now.getHours()}:${now.getMinutes().toString().padStart(2, '0')}`;
246
247
  // 如果消息为空但有文件,使用默认文本
@@ -317,6 +318,11 @@ const ChatHRModal = /*@__PURE__*/ proxyCustomElement(class ChatHRModal extends H
317
318
  this.conversationId = data.conversation_id;
318
319
  this.updateUrlWithConversationId(data.conversation_id);
319
320
  }
321
+ // 检查是否有 node_finished 事件和 LLMText
322
+ if (data.event === 'node_finished' && data.data.inputs && data.data.inputs.LLMText) {
323
+ llmText = data.data.inputs.LLMText;
324
+ console.log('获取到 LLMText:', llmText);
325
+ }
320
326
  if (data.event === 'message') {
321
327
  if (data.event === 'agent_message' || data.event === 'message') {
322
328
  if (data.answer) {
@@ -367,18 +373,22 @@ const ChatHRModal = /*@__PURE__*/ proxyCustomElement(class ChatHRModal extends H
367
373
  console.log(this.currentQuestionNumber);
368
374
  console.log(message);
369
375
  if (latestAIMessage && latestAIMessage.answer) {
370
- // 合成语音
371
- const audioUrl = await this.synthesizeAudio(latestAIMessage.answer);
372
- if (this.enableVoice) {
373
- // 自动播放语音
374
- await this.playAudio(audioUrl);
375
- // 自动播放模式下,播放完成后立即开始等待录制
376
- this.startWaitingToRecord();
377
- }
378
- else {
379
- // 只保存音频URL,不自动播放
380
- this.audioUrl = audioUrl;
381
- // 非自动播放模式下,不立即开始等待录制
376
+ // 优先使用 LLMText,如果没有则使用 answer
377
+ const textForSynthesis = llmText || latestAIMessage.answer;
378
+ if (textForSynthesis) {
379
+ // 合成语音
380
+ const audioUrl = await this.synthesizeAudio(textForSynthesis);
381
+ if (this.enableVoice) {
382
+ // 自动播放语音
383
+ await this.playAudio(audioUrl);
384
+ // 自动播放模式下,播放完成后立即开始等待录制
385
+ this.startWaitingToRecord();
386
+ }
387
+ else {
388
+ // 只保存音频URL,不自动播放
389
+ this.audioUrl = audioUrl;
390
+ // 非自动播放模式下,不立即开始等待录制
391
+ }
382
392
  }
383
393
  }
384
394
  }
@@ -1017,6 +1027,27 @@ const ChatHRModal = /*@__PURE__*/ proxyCustomElement(class ChatHRModal extends H
1017
1027
  'recording-status': true,
1018
1028
  'warning': this.showCountdownWarning
1019
1029
  } }, h("span", { class: "recording-dot" }), h("span", null, "\u5F55\u5236\u4E2D ", Math.floor(this.recordingTimeLeft / 60), ":", (this.recordingTimeLeft % 60).toString().padStart(2, '0'), this.showCountdownWarning && ` (即将自动完成)`))));
1030
+ // 渲染占位符状态信息
1031
+ const renderPlaceholderStatus = () => {
1032
+ // 正在播放音频
1033
+ if (this.isPlayingAudio) {
1034
+ return (h("div", { class: "placeholder-status" }, h("p", null, "\u6B63\u5728\u64AD\u653E\u95EE\u9898\uFF0C\u8BF7\u542C\u5B8C\u540E\u51C6\u5907\u56DE\u7B54...")));
1035
+ }
1036
+ // 正在上传视频
1037
+ if (this.isUploadingVideo) {
1038
+ return (h("div", { class: "placeholder-status" }, h("p", null, "\u6B63\u5728\u4E0A\u4F20\u89C6\u9891\uFF0C\u8BF7\u7A0D\u5019...")));
1039
+ }
1040
+ // 正在加载或等待AI回复
1041
+ if (this.isLoading || this.currentStreamingMessage) {
1042
+ return (h("div", { class: "placeholder-status" }, h("p", null, "\u8BF7\u7B49\u5F85\u9898\u76EE...")));
1043
+ }
1044
+ // 等待开始录制
1045
+ if (this.waitingToRecord) {
1046
+ return (h("div", { class: "placeholder-status" }, h("p", null, "\u8BF7\u51C6\u5907\u597D\uFF0C", this.waitingTimeLeft, "\u79D2\u540E\u5C06\u5F00\u59CB\u5F55\u5236\u60A8\u7684\u56DE\u7B54...")));
1047
+ }
1048
+ // 添加默认状态
1049
+ return (h("div", { class: "placeholder-status default-status" }, h("p", null, "\u51C6\u5907\u4E2D...")));
1050
+ };
1020
1051
  return (h("div", { class: overlayClass, style: modalStyle }, h("div", { class: containerClass }, this.isShowHeader && (h("div", { class: "modal-header" }, h("div", { class: "header-left" }, this.icon && h("img", { src: this.icon, class: "header-icon", alt: "\u5E94\u7528\u56FE\u6807" }), h("div", null, this.modalTitle)), this.isNeedClose && (h("button", { class: "close-button", onClick: this.handleClose }, h("span", null, "\u00D7"))))), this.showInitialUpload ? (h("div", { class: "initial-upload" }, h("div", { class: "upload-section" }, this.requireResume && (h(h.Fragment, null, h("h3", null, "\u5F00\u59CB\u524D\uFF0C\u8BF7\u4E0A\u4F20\u60A8\u7684\u7B80\u5386"), h("div", { class: "upload-area", onClick: this.handleUploadClick }, this.selectedFile ? (h("div", { class: "file-info" }, h("span", null, this.selectedFile.name), h("button", { class: "remove-file", onClick: (e) => {
1021
1052
  e.stopPropagation();
1022
1053
  this.clearSelectedFile();
@@ -1029,32 +1060,16 @@ const ChatHRModal = /*@__PURE__*/ proxyCustomElement(class ChatHRModal extends H
1029
1060
  }, onClick: () => this.handleDimensionSelect(dimension) }, dimension))))), h("button", { class: "submit-button", disabled: (this.requireResume && !this.selectedFile) ||
1030
1061
  !this.selectedJobCategory ||
1031
1062
  this.selectedDimensions.length === 0 ||
1032
- (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(h.Fragment, null, 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(h.Fragment, null, this.messages.map((message) => (h("div", { id: `message_${message.id}`, key: message.id }, h("pcm-chat-message", { message: message, onMessageChange: (event) => {
1063
+ (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) => {
1033
1064
  const updatedMessages = this.messages.map(msg => msg.id === message.id ? { ...msg, ...event.detail } : msg);
1034
1065
  this.messages = updatedMessages;
1035
- } })))), 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" }))), h("div", { class: "recording-controls" }, this.showRecordingUI ? (h("button", { class: "stop-recording-button", onClick: () => this.stopRecording() }, "\u5B8C\u6210\u56DE\u7B54")) : (h("div", { class: "waiting-message" }, (() => {
1036
- // 正在播放音频
1037
- if (this.isPlayingAudio) {
1038
- return h("p", null, "\u6B63\u5728\u64AD\u653E\u95EE\u9898\uFF0C\u8BF7\u542C\u5B8C\u540E\u51C6\u5907\u56DE\u7B54...");
1039
- }
1040
- // 正在上传视频
1041
- if (this.isUploadingVideo) {
1042
- return h("p", null, "\u6B63\u5728\u4E0A\u4F20\u89C6\u9891\uFF0C\u8BF7\u7A0D\u5019...");
1043
- }
1044
- // 正在加载或等待AI回复
1045
- if (this.isLoading || this.currentStreamingMessage) {
1046
- return h("p", null, "\u8BF7\u7B49\u5F85\u9898\u76EE...");
1047
- }
1048
- // 等待开始录制
1049
- if (this.waitingToRecord) {
1050
- return h("p", null, "\u8BF7\u51C6\u5907\u597D\uFF0C", this.waitingTimeLeft, "\u79D2\u540E\u5C06\u5F00\u59CB\u5F55\u5236\u60A8\u7684\u56DE\u7B54...");
1051
- }
1066
+ } })))), 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" }, (() => {
1052
1067
  // 显示播放按钮(当不自动播放且有音频URL时)
1053
1068
  if (!this.enableVoice && this.audioUrl && !this.isPlayingAudio) {
1054
1069
  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"))));
1055
1070
  }
1056
- // 默认状态
1057
- return h("p", null, "\u51C6\u5907\u4E2D...");
1071
+ // 其他状态下显示禁用的"完成回答"按钮
1072
+ return (h("button", { class: "stop-recording-button disabled", disabled: true }, "\u5B8C\u6210\u56DE\u7B54"));
1058
1073
  })()))))))))));
1059
1074
  }
1060
1075
  static get watchers() { return {