linco-connect 1.0.6 → 1.0.7

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "linco-connect",
3
- "version": "1.0.6",
3
+ "version": "1.0.7",
4
4
  "description": "自研 IM 桥接多 Agent 服务",
5
5
  "main": "server.js",
6
6
  "bin": {
@@ -644,13 +644,17 @@ function updateCodexSessionStats(session, params = {}) {
644
644
  updateAgentSessionHistory(session);
645
645
  }
646
646
 
647
+ function isCodexAssistantMessageType(type) {
648
+ return ['agentMessage', 'agent_message', 'message'].includes(type);
649
+ }
650
+
647
651
  function extractFinalText(params) {
648
652
  if (typeof params.text === 'string') return params.text;
649
653
  if (typeof params.delta === 'string') return params.delta;
650
654
  if (Array.isArray(params.content)) {
651
655
  return params.content.map(item => typeof item === 'string' ? item : item?.text || '').join('');
652
656
  }
653
- if (params.item?.type === 'agent_message' && typeof params.item.text === 'string') {
657
+ if (isCodexAssistantMessageType(params.item?.type) && typeof params.item.text === 'string') {
654
658
  return params.item.text;
655
659
  }
656
660
  return '';
@@ -865,7 +869,7 @@ function extractText(event) {
865
869
  if (Array.isArray(event.content)) {
866
870
  return event.content.map(item => typeof item === 'string' ? item : item?.text || '').join('');
867
871
  }
868
- if (typeof event.item?.text === 'string' && ['agent_message', 'message'].includes(event.item.type)) {
872
+ if (typeof event.item?.text === 'string' && isCodexAssistantMessageType(event.item.type)) {
869
873
  return event.item.text;
870
874
  }
871
875
  if (event.item?.type === 'message' && Array.isArray(event.item.content)) {