@circuitwall/jarela 2.3.0 → 2.4.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.
Files changed (208) hide show
  1. package/.next/standalone/.next/BUILD_ID +1 -1
  2. package/.next/standalone/.next/app-path-routes-manifest.json +4 -4
  3. package/.next/standalone/.next/build-manifest.json +2 -2
  4. package/.next/standalone/.next/prerender-manifest.json +3 -3
  5. package/.next/standalone/.next/server/app/_global-error/page_client-reference-manifest.js +1 -1
  6. package/.next/standalone/.next/server/app/_global-error.html +1 -1
  7. package/.next/standalone/.next/server/app/_global-error.rsc +1 -1
  8. package/.next/standalone/.next/server/app/_global-error.segments/_full.segment.rsc +1 -1
  9. package/.next/standalone/.next/server/app/_global-error.segments/_global-error/__PAGE__.segment.rsc +1 -1
  10. package/.next/standalone/.next/server/app/_global-error.segments/_tree.segment.rsc +1 -1
  11. package/.next/standalone/.next/server/app/_not-found/page_client-reference-manifest.js +1 -1
  12. package/.next/standalone/.next/server/app/_not-found.html +2 -2
  13. package/.next/standalone/.next/server/app/_not-found.rsc +2 -2
  14. package/.next/standalone/.next/server/app/_not-found.segments/_full.segment.rsc +2 -2
  15. package/.next/standalone/.next/server/app/_not-found.segments/_index.segment.rsc +2 -2
  16. package/.next/standalone/.next/server/app/_not-found.segments/_not-found/__PAGE__.segment.rsc +1 -1
  17. package/.next/standalone/.next/server/app/_not-found.segments/_tree.segment.rsc +2 -2
  18. package/.next/standalone/.next/server/app/api/v1/access/[identity]/route.js +7 -0
  19. package/.next/standalone/.next/server/app/api/v1/access/route.js +7 -0
  20. package/.next/standalone/.next/server/app/api/v1/agents/[id]/compact/route.js +7 -0
  21. package/.next/standalone/.next/server/app/api/v1/agents/[id]/display-filters/route.js +17 -5
  22. package/.next/standalone/.next/server/app/api/v1/agents/[id]/route.js +7 -0
  23. package/.next/standalone/.next/server/app/api/v1/agents/[id]/thread/route.js +17 -5
  24. package/.next/standalone/.next/server/app/api/v1/agents/route.js +7 -0
  25. package/.next/standalone/.next/server/app/api/v1/allowed-sites/[hostname]/route.js +7 -0
  26. package/.next/standalone/.next/server/app/api/v1/allowed-sites/route.js +7 -0
  27. package/.next/standalone/.next/server/app/api/v1/artifacts/lifecycle/route.js +7 -0
  28. package/.next/standalone/.next/server/app/api/v1/bridges/[id]/chats/route.js +26 -32
  29. package/.next/standalone/.next/server/app/api/v1/bridges/[id]/chats/route.js.nft.json +1 -1
  30. package/.next/standalone/.next/server/app/api/v1/bridges/[id]/ignores/[remote_jid]/route.js +18 -7
  31. package/.next/standalone/.next/server/app/api/v1/bridges/[id]/ignores/route.js +18 -7
  32. package/.next/standalone/.next/server/app/api/v1/bridges/[id]/lookup/route.js +26 -32
  33. package/.next/standalone/.next/server/app/api/v1/bridges/[id]/lookup/route.js.nft.json +1 -1
  34. package/.next/standalone/.next/server/app/api/v1/bridges/[id]/pair/route.js +27 -33
  35. package/.next/standalone/.next/server/app/api/v1/bridges/[id]/pair/route.js.nft.json +1 -1
  36. package/.next/standalone/.next/server/app/api/v1/bridges/[id]/route.js +26 -32
  37. package/.next/standalone/.next/server/app/api/v1/bridges/[id]/route.js.nft.json +1 -1
  38. package/.next/standalone/.next/server/app/api/v1/bridges/[id]/routes/[route_id]/route.js +28 -12
  39. package/.next/standalone/.next/server/app/api/v1/bridges/[id]/routes/route.js +28 -12
  40. package/.next/standalone/.next/server/app/api/v1/bridges/[id]/status/route.js +26 -32
  41. package/.next/standalone/.next/server/app/api/v1/bridges/[id]/status/route.js.nft.json +1 -1
  42. package/.next/standalone/.next/server/app/api/v1/bridges/kinds/route.js +9 -2
  43. package/.next/standalone/.next/server/app/api/v1/bridges/kinds/route.js.nft.json +1 -1
  44. package/.next/standalone/.next/server/app/api/v1/bridges/route.js +19 -7
  45. package/.next/standalone/.next/server/app/api/v1/bridges/route.js.nft.json +1 -1
  46. package/.next/standalone/.next/server/app/api/v1/dashboard/metrics/route.js +17 -5
  47. package/.next/standalone/.next/server/app/api/v1/dashboard/pricing/route.js +7 -0
  48. package/.next/standalone/.next/server/app/api/v1/documents/search/route.js +7 -0
  49. package/.next/standalone/.next/server/app/api/v1/documents/settings/route.js +7 -0
  50. package/.next/standalone/.next/server/app/api/v1/env-sync/allowlist/route.js +7 -0
  51. package/.next/standalone/.next/server/app/api/v1/env-sync/route.js +7 -0
  52. package/.next/standalone/.next/server/app/api/v1/events/route.js +26 -32
  53. package/.next/standalone/.next/server/app/api/v1/events/route.js.nft.json +1 -1
  54. package/.next/standalone/.next/server/app/api/v1/extension/browser/activate/route.js +7 -0
  55. package/.next/standalone/.next/server/app/api/v1/extension/browser/foreground/route.js +7 -0
  56. package/.next/standalone/.next/server/app/api/v1/extension/browser/history/route.js +7 -0
  57. package/.next/standalone/.next/server/app/api/v1/extension/browser/poll/route.js +7 -0
  58. package/.next/standalone/.next/server/app/api/v1/extension/browser/progress/route.js +7 -0
  59. package/.next/standalone/.next/server/app/api/v1/extension/browser/result/route.js +7 -0
  60. package/.next/standalone/.next/server/app/api/v1/extension/browser/retry/route.js +7 -0
  61. package/.next/standalone/.next/server/app/api/v1/extension/browser/status/route.js +7 -0
  62. package/.next/standalone/.next/server/app/api/v1/extension/browser/tabs/route.js +7 -0
  63. package/.next/standalone/.next/server/app/api/v1/harnesses/[id]/route.js +7 -0
  64. package/.next/standalone/.next/server/app/api/v1/harnesses/default/route.js +7 -0
  65. package/.next/standalone/.next/server/app/api/v1/harnesses/route.js +7 -0
  66. package/.next/standalone/.next/server/app/api/v1/health/route.js +17 -5
  67. package/.next/standalone/.next/server/app/api/v1/integrations/[name]/route.js +7 -0
  68. package/.next/standalone/.next/server/app/api/v1/integrations/gmail/oauth/callback/route.js +7 -0
  69. package/.next/standalone/.next/server/app/api/v1/integrations/gmail/oauth/start/route.js +7 -0
  70. package/.next/standalone/.next/server/app/api/v1/integrations/gmail/oauth/status/route.js +7 -0
  71. package/.next/standalone/.next/server/app/api/v1/integrations/outlook/oauth/callback/route.js +7 -0
  72. package/.next/standalone/.next/server/app/api/v1/integrations/outlook/oauth/start/route.js +7 -0
  73. package/.next/standalone/.next/server/app/api/v1/integrations/outlook/oauth/status/route.js +7 -0
  74. package/.next/standalone/.next/server/app/api/v1/integrations/route.js +7 -0
  75. package/.next/standalone/.next/server/app/api/v1/lifecycle/adoption/route.js +17 -5
  76. package/.next/standalone/.next/server/app/api/v1/maps/embed/route.js +7 -0
  77. package/.next/standalone/.next/server/app/api/v1/mcp-servers/[name]/route.js +17 -5
  78. package/.next/standalone/.next/server/app/api/v1/mcp-servers/route.js +17 -5
  79. package/.next/standalone/.next/server/app/api/v1/memory/[namespace]/[key]/route.js +7 -0
  80. package/.next/standalone/.next/server/app/api/v1/memory/policy/route.js +7 -0
  81. package/.next/standalone/.next/server/app/api/v1/memory/route.js +7 -0
  82. package/.next/standalone/.next/server/app/api/v1/memory/search/route.js +7 -0
  83. package/.next/standalone/.next/server/app/api/v1/models/[name]/compact-threads/route.js +7 -0
  84. package/.next/standalone/.next/server/app/api/v1/models/[name]/route.js +7 -0
  85. package/.next/standalone/.next/server/app/api/v1/models/route.js +7 -0
  86. package/.next/standalone/.next/server/app/api/v1/pending-actions/[id]/approve/route.js +27 -12
  87. package/.next/standalone/.next/server/app/api/v1/profile/location/route.js +7 -0
  88. package/.next/standalone/.next/server/app/api/v1/profile/route.js +7 -0
  89. package/.next/standalone/.next/server/app/api/v1/providers/[provider]/models/route.js +7 -0
  90. package/.next/standalone/.next/server/app/api/v1/providers/[provider]/probe/route.js +7 -0
  91. package/.next/standalone/.next/server/app/api/v1/providers/github-copilot/auth/route.js +7 -0
  92. package/.next/standalone/.next/server/app/api/v1/providers/route.js +7 -0
  93. package/.next/standalone/.next/server/app/api/v1/proxy-config/route.js +7 -0
  94. package/.next/standalone/.next/server/app/api/v1/redaction/init/route.js +7 -0
  95. package/.next/standalone/.next/server/app/api/v1/redaction/route.js +7 -0
  96. package/.next/standalone/.next/server/app/api/v1/scheduled-tasks/[id]/route.js +17 -5
  97. package/.next/standalone/.next/server/app/api/v1/scheduled-tasks/route.js +7 -0
  98. package/.next/standalone/.next/server/app/api/v1/security/idle-timeout/route.js +7 -0
  99. package/.next/standalone/.next/server/app/api/v1/security/pin/route.js +7 -0
  100. package/.next/standalone/.next/server/app/api/v1/security/state/route.js +7 -0
  101. package/.next/standalone/.next/server/app/api/v1/security/unlock/route.js +7 -0
  102. package/.next/standalone/.next/server/app/api/v1/security/verify-pin/route.js +7 -0
  103. package/.next/standalone/.next/server/app/api/v1/skills/[id]/route.js +7 -0
  104. package/.next/standalone/.next/server/app/api/v1/skills/repos/[id]/route.js +7 -0
  105. package/.next/standalone/.next/server/app/api/v1/skills/repos/route.js +7 -0
  106. package/.next/standalone/.next/server/app/api/v1/skills/route.js +7 -0
  107. package/.next/standalone/.next/server/app/api/v1/tasks/[agent_id]/route.js +7 -0
  108. package/.next/standalone/.next/server/app/api/v1/tasks/route.js +7 -0
  109. package/.next/standalone/.next/server/app/api/v1/threads/[thread_id]/activity/route.js +7 -0
  110. package/.next/standalone/.next/server/app/api/v1/threads/[thread_id]/context-pin/route.js +12 -6
  111. package/.next/standalone/.next/server/app/api/v1/threads/[thread_id]/route.js +7 -0
  112. package/.next/standalone/.next/server/app/api/v1/threads/[thread_id]/run/route.js +0 -1
  113. package/.next/standalone/.next/server/app/api/v1/threads/route.js +17 -5
  114. package/.next/standalone/.next/server/app/api/v1/update/apply/route.js.nft.json +1 -1
  115. package/.next/standalone/.next/server/app/api/v1/voice/transcribe/route.js +17 -5
  116. package/.next/standalone/.next/server/app/api/v1/voice/tts/route.js +17 -5
  117. package/.next/standalone/.next/server/app/api/v1/watchers/[id]/route.js +17 -5
  118. package/.next/standalone/.next/server/app/page.js +322 -275
  119. package/.next/standalone/.next/server/app/page_client-reference-manifest.js +1 -1
  120. package/.next/standalone/.next/server/app/setup/page.js +8 -0
  121. package/.next/standalone/.next/server/app/setup/page_client-reference-manifest.js +1 -1
  122. package/.next/standalone/.next/server/app-paths-manifest.json +4 -4
  123. package/.next/standalone/.next/server/chunks/1388.js +106 -36
  124. package/.next/standalone/.next/server/chunks/2068.js +47 -10
  125. package/.next/standalone/.next/server/chunks/210.js +6 -6
  126. package/.next/standalone/.next/server/chunks/2447.js +10 -5
  127. package/.next/standalone/.next/server/chunks/2471.js +17 -17
  128. package/.next/standalone/.next/server/chunks/3042.js +10 -8
  129. package/.next/standalone/.next/server/chunks/{4540.js → 309.js} +104 -38
  130. package/.next/standalone/.next/server/chunks/{2350.js → 3272.js} +104 -37
  131. package/.next/standalone/.next/server/chunks/3399.js +525 -525
  132. package/.next/standalone/.next/server/chunks/3524.js +150 -67
  133. package/.next/standalone/.next/server/chunks/4189.js +1 -1
  134. package/.next/standalone/.next/server/chunks/4508.js +2 -2
  135. package/.next/standalone/.next/server/chunks/46.js +73 -28
  136. package/.next/standalone/.next/server/chunks/5908.js +63 -42
  137. package/.next/standalone/.next/server/chunks/6142.js +10 -2
  138. package/.next/standalone/.next/server/chunks/6649.js +1 -1
  139. package/.next/standalone/.next/server/chunks/8461.js +10 -8
  140. package/.next/standalone/.next/server/chunks/9032.js +5 -5
  141. package/.next/standalone/.next/server/chunks/9164.js +435 -176
  142. package/.next/standalone/.next/server/chunks/9304.js +51 -12
  143. package/.next/standalone/.next/server/chunks/{423.js → 9590.js} +66 -21
  144. package/.next/standalone/.next/server/middleware-build-manifest.js +2 -2
  145. package/.next/standalone/.next/server/middleware.js +71 -18
  146. package/.next/standalone/.next/server/pages/404.html +2 -2
  147. package/.next/standalone/.next/server/pages/500.html +1 -1
  148. package/.next/standalone/.next/server/preview-props.json +3 -3
  149. package/.next/standalone/.next/server/server-reference-manifest.json +1 -1
  150. package/.next/standalone/.next/static/chunks/app/{page-213a623b37226452.js → page-04748847c6ff866f.js} +171 -132
  151. package/.next/standalone/.next/static/css/{312542a5725ba0d5.css → 2669e8744cc8c212.css} +2 -2
  152. package/.next/standalone/docs/adoption/changesets.json +49 -0
  153. package/.next/standalone/package.json +1 -1
  154. package/CHANGELOG.md +19 -0
  155. package/app/api/v1/threads/[thread_id]/run/route.ts +0 -1
  156. package/components/chat/MessageBubble.tsx +12 -0
  157. package/components/integrations/NetworkSection.tsx +2 -2
  158. package/lib/agents/citation-checker.test.ts +40 -2
  159. package/lib/agents/citation-checker.ts +56 -11
  160. package/lib/agents/context-boundary.ts +5 -6
  161. package/lib/agents/instruction-edits.test.ts +120 -0
  162. package/lib/agents/instruction-edits.ts +65 -42
  163. package/lib/agents/prepare/request.ts +0 -2
  164. package/lib/agents/prepare/system-prompt.test.ts +10 -0
  165. package/lib/agents/prepare/system-prompt.ts +8 -2
  166. package/lib/agents/proposals.test.ts +76 -0
  167. package/lib/agents/proposals.ts +13 -5
  168. package/lib/agents/run-thread.auto-boundary.test.ts +125 -5
  169. package/lib/agents/run-thread.ts +24 -9
  170. package/lib/agents/sqlite-checkpoint-saver.test.ts +91 -0
  171. package/lib/agents/warm-summary-background.ts +22 -2
  172. package/lib/agents/warm-topics.test.ts +155 -1
  173. package/lib/agents/warm-topics.ts +27 -7
  174. package/lib/bridges/dispatcher.ts +1 -0
  175. package/lib/bridges/message-role.test.ts +81 -0
  176. package/lib/bridges/message-role.ts +23 -10
  177. package/lib/bridges/types.ts +6 -0
  178. package/lib/bridges/whatsapp-link.test.ts +32 -0
  179. package/lib/bridges/whatsapp-link.ts +21 -0
  180. package/lib/bridges/whatsapp.inbound.test.ts +239 -0
  181. package/lib/bridges/whatsapp.sender.test.ts +80 -1
  182. package/lib/bridges/whatsapp.ts +76 -38
  183. package/lib/pricing/snapshot.test.ts +70 -0
  184. package/lib/pricing/snapshot.ts +10 -2
  185. package/lib/proxy/dispatcher.test.ts +119 -1
  186. package/lib/proxy/dispatcher.ts +22 -9
  187. package/lib/stores/agent-configs.ts +10 -5
  188. package/lib/stores/bridges.test.ts +81 -0
  189. package/lib/stores/bridges.ts +9 -8
  190. package/lib/stores/proxy-config.test.ts +120 -0
  191. package/lib/stores/proxy-config.ts +22 -4
  192. package/lib/stores/threads.ts +12 -8
  193. package/lib/tools/communications/calendar.test.ts +43 -2
  194. package/lib/tools/communications/calendar.ts +2 -0
  195. package/lib/tools/communications/gmail.test.ts +51 -1
  196. package/lib/tools/communications/gmail.ts +44 -2
  197. package/lib/tools/communications/outlook-calendar.ts +2 -0
  198. package/lib/tools/communications/outlook.test.ts +33 -2
  199. package/lib/tools/communications/outlook.ts +2 -0
  200. package/lib/tools/filesystem/edit-match.test.ts +133 -0
  201. package/lib/tools/filesystem/edit-match.ts +7 -2
  202. package/lib/tools/support/result-refs.test.ts +131 -0
  203. package/lib/tools/support/result-refs.ts +41 -9
  204. package/lib/utils/source-link.test.ts +51 -0
  205. package/lib/utils/source-link.ts +45 -0
  206. package/package.json +1 -1
  207. /package/.next/standalone/.next/static/{bMRK5y3ruT7c3WtBfCQOG → hwujW4hR1b-r3k5WdMxZO}/_buildManifest.js +0 -0
  208. /package/.next/standalone/.next/static/{bMRK5y3ruT7c3WtBfCQOG → hwujW4hR1b-r3k5WdMxZO}/_ssgManifest.js +0 -0
@@ -945,12 +945,17 @@ function upsertAgentConfigTransaction(input) {
945
945
  const db = (0,_lib_db__WEBPACK_IMPORTED_MODULE_0__/* .getDb */ .Lf)();
946
946
  const existing = getAgentConfig(input.id);
947
947
  const created_at = existing?.created_at ?? t;
948
- const mbti = input.adaptive_mbti ?? toMbti(existing?.adaptive_mbti) ?? "INTJ";
948
+ const existingMbti = toMbti(existing?.adaptive_mbti);
949
+ const mbti = input.adaptive_mbti ?? existingMbti ?? "INTJ";
949
950
  const preset = _lib_agents_adaptive_persona_presets__WEBPACK_IMPORTED_MODULE_2__/* .MBTI_PRESETS */ .e[mbti];
950
- const strength = input.adaptive_persona_strength ?? preset.strength;
951
- const empathy = input.adaptive_empathy ?? preset.empathy;
952
- const expressiveness = input.adaptive_expressiveness ?? preset.expressiveness;
953
- const verbosity = input.adaptive_verbosity ?? preset.verbosity;
951
+ // Omitted sliders keep their tuned values; they only fall back to the
952
+ // preset when the type changes or the agent is new. Otherwise every
953
+ // partial update (approved proposals, tool edits) reset them.
954
+ const keepTuned = existing !== null && existing !== undefined && mbti === existingMbti;
955
+ const strength = input.adaptive_persona_strength ?? (keepTuned ? existing.adaptive_persona_strength : preset.strength);
956
+ const empathy = input.adaptive_empathy ?? (keepTuned ? existing.adaptive_empathy : preset.empathy);
957
+ const expressiveness = input.adaptive_expressiveness ?? (keepTuned ? existing.adaptive_expressiveness : preset.expressiveness);
958
+ const verbosity = input.adaptive_verbosity ?? (keepTuned ? existing.adaptive_verbosity : preset.verbosity);
954
959
  if (input.is_default) db.prepare("UPDATE agent_configs SET is_default=0").run();
955
960
  // harness_id: explicit `undefined` means "keep existing"; explicit `null`
956
961
  // means "use the global default". Empty string is normalised to null too,
@@ -1188,6 +1193,13 @@ module.exports = require("node:path");
1188
1193
 
1189
1194
  /***/ }),
1190
1195
 
1196
+ /***/ 77030:
1197
+ /***/ ((module) => {
1198
+
1199
+ module.exports = require("node:net");
1200
+
1201
+ /***/ }),
1202
+
1191
1203
  /***/ 77598:
1192
1204
  /***/ ((module) => {
1193
1205
 
@@ -875,6 +875,13 @@ module.exports = require("node:path");
875
875
 
876
876
  /***/ }),
877
877
 
878
+ /***/ 77030:
879
+ /***/ ((module) => {
880
+
881
+ module.exports = require("node:net");
882
+
883
+ /***/ }),
884
+
878
885
  /***/ 77598:
879
886
  /***/ ((module) => {
880
887
 
@@ -841,6 +841,13 @@ module.exports = require("node:path");
841
841
 
842
842
  /***/ }),
843
843
 
844
+ /***/ 77030:
845
+ /***/ ((module) => {
846
+
847
+ module.exports = require("node:net");
848
+
849
+ /***/ }),
850
+
844
851
  /***/ 77598:
845
852
  /***/ ((module) => {
846
853
 
@@ -737,6 +737,13 @@ module.exports = require("node:path");
737
737
 
738
738
  /***/ }),
739
739
 
740
+ /***/ 77030:
741
+ /***/ ((module) => {
742
+
743
+ module.exports = require("node:net");
744
+
745
+ /***/ }),
746
+
740
747
  /***/ 77598:
741
748
  /***/ ((module) => {
742
749
 
@@ -737,6 +737,13 @@ module.exports = require("node:path");
737
737
 
738
738
  /***/ }),
739
739
 
740
+ /***/ 77030:
741
+ /***/ ((module) => {
742
+
743
+ module.exports = require("node:net");
744
+
745
+ /***/ }),
746
+
740
747
  /***/ 77598:
741
748
  /***/ ((module) => {
742
749
 
@@ -688,6 +688,13 @@ module.exports = require("node:path");
688
688
 
689
689
  /***/ }),
690
690
 
691
+ /***/ 77030:
692
+ /***/ ((module) => {
693
+
694
+ module.exports = require("node:net");
695
+
696
+ /***/ }),
697
+
691
698
  /***/ 77598:
692
699
  /***/ ((module) => {
693
700
 
@@ -77,6 +77,8 @@ var agent_turn = __webpack_require__(62032);
77
77
  return (0,bridges/* findRoute */.$6)(bridge_id, remote_jid) ?? (0,bridges/* findRoute */.$6)(bridge_id, "*");
78
78
  }
79
79
 
80
+ // EXTERNAL MODULE: ./lib/utils/source-link.ts
81
+ var source_link = __webpack_require__(12262);
80
82
  ;// ./lib/bridges/message-role.ts
81
83
  /**
82
84
  * Cross-adapter framing for bridge inbound messages.
@@ -94,25 +96,8 @@ var agent_turn = __webpack_require__(62032);
94
96
  * sees. Adding a new adapter is a matter of mapping its platform-specific
95
97
  * "who sent this" signal onto `MessageRole`; the framing code does not need
96
98
  * to change.
97
- */ /**
98
- * Who sent the message from the agent's perspective.
99
- *
100
- * - `user`: the paired account holder themselves — typed on their phone,
101
- * in their browser, etc. The agent treats these as the user's own
102
- * reaction/input to the conversation. Useful as an intent signal but
103
- * NOT a direct command to the agent (the user is talking to the
104
- * counterpart, not the agent).
105
- *
106
- * - `counterpart`: another participant in the chat — 1:1 partner in a DM,
107
- * or another member in a group chat. The agent treats these as
108
- * conversation context the user has not yet reacted to. Not a request
109
- * directed at the agent.
110
- *
111
- * - `agent`: the agent's own prior output, surfaced inbound when the
112
- * adapter cannot suppress its echo (rare). Adapters with reliable
113
- * echo-filtering (e.g. WhatsApp's `sentIdsSet`) should never emit this
114
- * value; it exists for adapters where deduplication is best-effort.
115
- */ /**
99
+ */
100
+ /**
116
101
  * Build the prompt prefix the agent receives for one bridge-inbound message.
117
102
  *
118
103
  * Output shape:
@@ -126,6 +111,7 @@ var agent_turn = __webpack_require__(62032);
126
111
  * [message_role:user|counterpart|agent]
127
112
  * [sender_id:<id>]
128
113
  * [sender_name:<label>]
114
+ * ([chat_link:<https url>] when the platform has a permalink for the chat)
129
115
  * ([group_name:<label>] [participant_id:<id>] [participant_name:<label>] for groups)
130
116
  *
131
117
  * <raw text>
@@ -135,23 +121,29 @@ var agent_turn = __webpack_require__(62032);
135
121
  * convention. Both are stable across adapters.
136
122
  */ function formatBridgePrompt(input) {
137
123
  const note = roleNote(input.role, input.is_group, input.silent === true, input.event);
124
+ // Header values come from the platform (display names, group subjects) and
125
+ // are sender-controlled: a line break would forge extra headers or end the
126
+ // header block early, so every value is flattened onto one line.
127
+ const h = (value)=>String(value ?? "").replace(/[\r\n\u0085\u2028\u2029]+/g, " ");
138
128
  const lines = [
139
- `[bridge:${input.bridge_id}]`,
140
- `[chat_id:${input.chat_id}]`,
141
- `[chat_name:${input.chat_name}]`,
129
+ `[bridge:${h(input.bridge_id)}]`,
130
+ `[chat_id:${h(input.chat_id)}]`,
131
+ `[chat_name:${h(input.chat_name)}]`,
142
132
  `[chat_type:${input.is_group ? "group" : "dm"}]`,
143
133
  `[message_role:${input.role}]`,
144
- `[sender_id:${input.sender_id}]`,
145
- `[sender_name:${input.sender_name}]`
134
+ `[sender_id:${h(input.sender_id)}]`,
135
+ `[sender_name:${h(input.sender_name)}]`
146
136
  ];
137
+ const chatLink = (0,source_link/* httpsUrlOrNull */.N)(input.chat_link);
138
+ if (chatLink) lines.push(`[chat_link:${chatLink}]`);
147
139
  if (input.event) {
148
140
  lines.push(`[event_type:${input.event.type}]`);
149
- lines.push(`[event_subtype:${input.event.subtype}]`);
141
+ lines.push(`[event_subtype:${h(input.event.subtype)}]`);
150
142
  }
151
143
  if (input.is_group) {
152
- lines.push(`[group_name:${input.chat_name}]`);
153
- lines.push(`[participant_id:${input.sender_id}]`);
154
- lines.push(`[participant_name:${input.sender_name}]`);
144
+ lines.push(`[group_name:${h(input.chat_name)}]`);
145
+ lines.push(`[participant_id:${h(input.sender_id)}]`);
146
+ lines.push(`[participant_name:${h(input.sender_name)}]`);
155
147
  }
156
148
  return `${note}\n\n${lines.join("\n")}\n\n${input.text}`;
157
149
  }
@@ -166,7 +158,7 @@ function parseBridgePrompt(raw) {
166
158
  const lines = src.split("\n");
167
159
  let i = 0;
168
160
  for(; i < lines.length; i++){
169
- const line = lines[i];
161
+ const line = lines[i].replace(/\r$/, "");
170
162
  if (line === "") {
171
163
  i++;
172
164
  break;
@@ -185,6 +177,7 @@ function parseBridgePrompt(raw) {
185
177
  isGroup: headers.chat_type === "group",
186
178
  senderJid: senderId,
187
179
  senderName: headers.sender_name || senderId || "Unknown",
180
+ chatLink: httpsUrlOrNull(headers.chat_link),
188
181
  body: lines.slice(i).join("\n").trimEnd()
189
182
  };
190
183
  }
@@ -297,6 +290,7 @@ var automation_activity = __webpack_require__(26316);
297
290
  role: msg.role,
298
291
  sender_id: senderJid,
299
292
  sender_name: senderName,
293
+ chat_link: adapter.chatLink?.(msg.remote_jid) ?? null,
300
294
  text: msg.text,
301
295
  silent,
302
296
  event: msg.event
@@ -425,8 +419,8 @@ var automation_activity = __webpack_require__(26316);
425
419
  }
426
420
  }
427
421
 
428
- // EXTERNAL MODULE: ./lib/bridges/registry.ts + 4 modules
429
- var registry = __webpack_require__(44540);
422
+ // EXTERNAL MODULE: ./lib/bridges/registry.ts + 5 modules
423
+ var registry = __webpack_require__(70309);
430
424
  ;// ./lib/bridges/runtime.ts
431
425
  /**
432
426
  * Bridge lifecycle manager.
@@ -1553,7 +1547,7 @@ module.exports = import("@huggingface/transformers");;
1553
1547
  var __webpack_require__ = require("../../../../webpack-runtime.js");
1554
1548
  __webpack_require__.C(exports);
1555
1549
  var __webpack_exec__ = (moduleId) => (__webpack_require__(__webpack_require__.s = moduleId))
1556
- var __webpack_exports__ = __webpack_require__.X(0, [2970,7377,7981,513,6299,563,8808,7547,4992,46,3042,3566,2068,4377,1638,5585,9304,3524,3175,6142,540,4189,4955,5908,5120,1388,4540], () => (__webpack_exec__(36349)));
1550
+ var __webpack_exports__ = __webpack_require__.X(0, [2970,7377,7981,513,6299,563,8808,7547,4992,46,3042,3566,2068,4377,1638,5585,9304,3524,3175,6142,540,4189,4955,5908,5120,1388,309], () => (__webpack_exec__(36349)));
1557
1551
  module.exports = __webpack_exports__;
1558
1552
 
1559
1553
  })();