@parall/parall 1.57.1 → 1.58.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.
@@ -1 +1 @@
1
- {"version":3,"file":"gateway.d.ts","sourceRoot":"","sources":["../src/gateway.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AACzD,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,0BAA0B,CAAC;AAE9D,uGAAuG;AACvG,KAAK,qBAAqB,CAAC,CAAC,GAAG,OAAO,IAAI,WAAW,CAAC,aAAa,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC;AACnF,OAAO,EAUL,KAAK,eAAe,EAIrB,MAAM,oBAAoB,CAAC;AAqB5B,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,YAAY,CAAC;AAwMxD,wBAAgB,6BAA6B,CAAC,IAAI,EAAE;IAClD,IAAI,EAAE,aAAa,CAAC;IACpB,GAAG,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IAC7B,SAAS,EAAE,MAAM,CAAC;IAClB,WAAW,EAAE,MAAM,CAAC;IACpB,YAAY,EAAE,MAAM,CAAC;CACtB,GAAG,eAAe,CAwLlB;AAED,eAAO,MAAM,aAAa,EAAE,qBAAqB,CAAC,qBAAqB,CAmMtE,CAAC"}
1
+ {"version":3,"file":"gateway.d.ts","sourceRoot":"","sources":["../src/gateway.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AACzD,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,0BAA0B,CAAC;AAE9D,uGAAuG;AACvG,KAAK,qBAAqB,CAAC,CAAC,GAAG,OAAO,IAAI,WAAW,CAAC,aAAa,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC;AACnF,OAAO,EAUL,KAAK,eAAe,EAIrB,MAAM,oBAAoB,CAAC;AAqB5B,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,YAAY,CAAC;AA8LxD,wBAAgB,6BAA6B,CAAC,IAAI,EAAE;IAClD,IAAI,EAAE,aAAa,CAAC;IACpB,GAAG,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IAC7B,SAAS,EAAE,MAAM,CAAC;IAClB,WAAW,EAAE,MAAM,CAAC;IACpB,YAAY,EAAE,MAAM,CAAC;CACtB,GAAG,eAAe,CAwLlB;AAED,eAAO,MAAM,aAAa,EAAE,qBAAqB,CAAC,qBAAqB,CAmMtE,CAAC"}
package/dist/gateway.js CHANGED
@@ -44,11 +44,14 @@ async function getAgentMeWithLegacyFallback(client, orgId) {
44
44
  // reaches the very next turn without any restart.
45
45
  function buildInboundCtx(core, accountId, event, sessionKey, bodyForAgent, earlierEvents = []) {
46
46
  const inboundHistory = earlierEvents.length > 0 ? buildInboundHistory(earlierEvents) : undefined;
47
+ // The server frame is the whole text of the event (agent-core renders
48
+ // nothing); OpenClaw's inbound context gets it as the body.
49
+ const body = event.frame ?? '';
47
50
  return core.channel.reply.finalizeInboundContext({
48
- Body: event.body,
51
+ Body: body,
49
52
  BodyForAgent: bodyForAgent,
50
- RawBody: event.body,
51
- CommandBody: event.body,
53
+ RawBody: body,
54
+ CommandBody: body,
52
55
  // Attachment metadata is now in event.attachments (structured), not mediaFields
53
56
  ...(inboundHistory?.length ? { InboundHistory: inboundHistory } : {}),
54
57
  From: `parall:${event.senderId}`,
@@ -56,7 +59,7 @@ function buildInboundCtx(core, accountId, event, sessionKey, bodyForAgent, earli
56
59
  SessionKey: sessionKey,
57
60
  AccountId: accountId,
58
61
  ChatType: event.targetType ?? 'unknown',
59
- SenderName: event.senderName,
62
+ SenderName: event.senderId,
60
63
  SenderId: event.senderId,
61
64
  Provider: 'parall',
62
65
  Surface: 'parall',
@@ -68,24 +71,9 @@ function buildInboundCtx(core, accountId, event, sessionKey, bodyForAgent, earli
68
71
  });
69
72
  }
70
73
  function buildInboundHistory(events) {
71
- return events.map((event) => {
72
- const meta = [];
73
- meta.push(`[Message ID: ${event.messageId}]`);
74
- if (event.noReply)
75
- meta.push(`[Hint: no_reply]`);
76
- if (event.threadRootId)
77
- meta.push(`[Thread: ${event.threadRootId}]`);
78
- if (event.attachments?.length) {
79
- for (const att of event.attachments) {
80
- const safeMime = att.mimeType.replace(/[\r\n[\]|]/g, ' ').trim();
81
- meta.push(`[Attachment: prll://${att.id} | ${safeMime}]`);
82
- }
83
- }
84
- return {
85
- sender: event.senderName,
86
- body: meta.length > 0 ? `${meta.join(' ')}\n${event.body}` : event.body,
87
- };
88
- });
74
+ // Each earlier event is its own server frame (message ids, thread,
75
+ // attachments and hints are already inside it).
76
+ return events.map((event) => ({ sender: event.senderId, body: event.frame ?? '' }));
89
77
  }
90
78
  const OC_AUTH_TEXT = /unauthorized|401|403|invalid api key|authentication/i;
91
79
  const OC_CONTEXT_TEXT = /context (window|length)|prompt is too long|request too large|413/i;