@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.
- package/.next/standalone/.next/BUILD_ID +1 -1
- package/.next/standalone/.next/app-path-routes-manifest.json +4 -4
- package/.next/standalone/.next/build-manifest.json +2 -2
- package/.next/standalone/.next/prerender-manifest.json +3 -3
- package/.next/standalone/.next/server/app/_global-error/page_client-reference-manifest.js +1 -1
- package/.next/standalone/.next/server/app/_global-error.html +1 -1
- package/.next/standalone/.next/server/app/_global-error.rsc +1 -1
- package/.next/standalone/.next/server/app/_global-error.segments/_full.segment.rsc +1 -1
- package/.next/standalone/.next/server/app/_global-error.segments/_global-error/__PAGE__.segment.rsc +1 -1
- package/.next/standalone/.next/server/app/_global-error.segments/_tree.segment.rsc +1 -1
- package/.next/standalone/.next/server/app/_not-found/page_client-reference-manifest.js +1 -1
- package/.next/standalone/.next/server/app/_not-found.html +2 -2
- package/.next/standalone/.next/server/app/_not-found.rsc +2 -2
- package/.next/standalone/.next/server/app/_not-found.segments/_full.segment.rsc +2 -2
- package/.next/standalone/.next/server/app/_not-found.segments/_index.segment.rsc +2 -2
- package/.next/standalone/.next/server/app/_not-found.segments/_not-found/__PAGE__.segment.rsc +1 -1
- package/.next/standalone/.next/server/app/_not-found.segments/_tree.segment.rsc +2 -2
- package/.next/standalone/.next/server/app/api/v1/access/[identity]/route.js +7 -0
- package/.next/standalone/.next/server/app/api/v1/access/route.js +7 -0
- package/.next/standalone/.next/server/app/api/v1/agents/[id]/compact/route.js +7 -0
- package/.next/standalone/.next/server/app/api/v1/agents/[id]/display-filters/route.js +17 -5
- package/.next/standalone/.next/server/app/api/v1/agents/[id]/route.js +7 -0
- package/.next/standalone/.next/server/app/api/v1/agents/[id]/thread/route.js +17 -5
- package/.next/standalone/.next/server/app/api/v1/agents/route.js +7 -0
- package/.next/standalone/.next/server/app/api/v1/allowed-sites/[hostname]/route.js +7 -0
- package/.next/standalone/.next/server/app/api/v1/allowed-sites/route.js +7 -0
- package/.next/standalone/.next/server/app/api/v1/artifacts/lifecycle/route.js +7 -0
- package/.next/standalone/.next/server/app/api/v1/bridges/[id]/chats/route.js +26 -32
- package/.next/standalone/.next/server/app/api/v1/bridges/[id]/chats/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/api/v1/bridges/[id]/ignores/[remote_jid]/route.js +18 -7
- package/.next/standalone/.next/server/app/api/v1/bridges/[id]/ignores/route.js +18 -7
- package/.next/standalone/.next/server/app/api/v1/bridges/[id]/lookup/route.js +26 -32
- package/.next/standalone/.next/server/app/api/v1/bridges/[id]/lookup/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/api/v1/bridges/[id]/pair/route.js +27 -33
- package/.next/standalone/.next/server/app/api/v1/bridges/[id]/pair/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/api/v1/bridges/[id]/route.js +26 -32
- package/.next/standalone/.next/server/app/api/v1/bridges/[id]/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/api/v1/bridges/[id]/routes/[route_id]/route.js +28 -12
- package/.next/standalone/.next/server/app/api/v1/bridges/[id]/routes/route.js +28 -12
- package/.next/standalone/.next/server/app/api/v1/bridges/[id]/status/route.js +26 -32
- package/.next/standalone/.next/server/app/api/v1/bridges/[id]/status/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/api/v1/bridges/kinds/route.js +9 -2
- package/.next/standalone/.next/server/app/api/v1/bridges/kinds/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/api/v1/bridges/route.js +19 -7
- package/.next/standalone/.next/server/app/api/v1/bridges/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/api/v1/dashboard/metrics/route.js +17 -5
- package/.next/standalone/.next/server/app/api/v1/dashboard/pricing/route.js +7 -0
- package/.next/standalone/.next/server/app/api/v1/documents/search/route.js +7 -0
- package/.next/standalone/.next/server/app/api/v1/documents/settings/route.js +7 -0
- package/.next/standalone/.next/server/app/api/v1/env-sync/allowlist/route.js +7 -0
- package/.next/standalone/.next/server/app/api/v1/env-sync/route.js +7 -0
- package/.next/standalone/.next/server/app/api/v1/events/route.js +26 -32
- package/.next/standalone/.next/server/app/api/v1/events/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/api/v1/extension/browser/activate/route.js +7 -0
- package/.next/standalone/.next/server/app/api/v1/extension/browser/foreground/route.js +7 -0
- package/.next/standalone/.next/server/app/api/v1/extension/browser/history/route.js +7 -0
- package/.next/standalone/.next/server/app/api/v1/extension/browser/poll/route.js +7 -0
- package/.next/standalone/.next/server/app/api/v1/extension/browser/progress/route.js +7 -0
- package/.next/standalone/.next/server/app/api/v1/extension/browser/result/route.js +7 -0
- package/.next/standalone/.next/server/app/api/v1/extension/browser/retry/route.js +7 -0
- package/.next/standalone/.next/server/app/api/v1/extension/browser/status/route.js +7 -0
- package/.next/standalone/.next/server/app/api/v1/extension/browser/tabs/route.js +7 -0
- package/.next/standalone/.next/server/app/api/v1/harnesses/[id]/route.js +7 -0
- package/.next/standalone/.next/server/app/api/v1/harnesses/default/route.js +7 -0
- package/.next/standalone/.next/server/app/api/v1/harnesses/route.js +7 -0
- package/.next/standalone/.next/server/app/api/v1/health/route.js +17 -5
- package/.next/standalone/.next/server/app/api/v1/integrations/[name]/route.js +7 -0
- package/.next/standalone/.next/server/app/api/v1/integrations/gmail/oauth/callback/route.js +7 -0
- package/.next/standalone/.next/server/app/api/v1/integrations/gmail/oauth/start/route.js +7 -0
- package/.next/standalone/.next/server/app/api/v1/integrations/gmail/oauth/status/route.js +7 -0
- package/.next/standalone/.next/server/app/api/v1/integrations/outlook/oauth/callback/route.js +7 -0
- package/.next/standalone/.next/server/app/api/v1/integrations/outlook/oauth/start/route.js +7 -0
- package/.next/standalone/.next/server/app/api/v1/integrations/outlook/oauth/status/route.js +7 -0
- package/.next/standalone/.next/server/app/api/v1/integrations/route.js +7 -0
- package/.next/standalone/.next/server/app/api/v1/lifecycle/adoption/route.js +17 -5
- package/.next/standalone/.next/server/app/api/v1/maps/embed/route.js +7 -0
- package/.next/standalone/.next/server/app/api/v1/mcp-servers/[name]/route.js +17 -5
- package/.next/standalone/.next/server/app/api/v1/mcp-servers/route.js +17 -5
- package/.next/standalone/.next/server/app/api/v1/memory/[namespace]/[key]/route.js +7 -0
- package/.next/standalone/.next/server/app/api/v1/memory/policy/route.js +7 -0
- package/.next/standalone/.next/server/app/api/v1/memory/route.js +7 -0
- package/.next/standalone/.next/server/app/api/v1/memory/search/route.js +7 -0
- package/.next/standalone/.next/server/app/api/v1/models/[name]/compact-threads/route.js +7 -0
- package/.next/standalone/.next/server/app/api/v1/models/[name]/route.js +7 -0
- package/.next/standalone/.next/server/app/api/v1/models/route.js +7 -0
- package/.next/standalone/.next/server/app/api/v1/pending-actions/[id]/approve/route.js +27 -12
- package/.next/standalone/.next/server/app/api/v1/profile/location/route.js +7 -0
- package/.next/standalone/.next/server/app/api/v1/profile/route.js +7 -0
- package/.next/standalone/.next/server/app/api/v1/providers/[provider]/models/route.js +7 -0
- package/.next/standalone/.next/server/app/api/v1/providers/[provider]/probe/route.js +7 -0
- package/.next/standalone/.next/server/app/api/v1/providers/github-copilot/auth/route.js +7 -0
- package/.next/standalone/.next/server/app/api/v1/providers/route.js +7 -0
- package/.next/standalone/.next/server/app/api/v1/proxy-config/route.js +7 -0
- package/.next/standalone/.next/server/app/api/v1/redaction/init/route.js +7 -0
- package/.next/standalone/.next/server/app/api/v1/redaction/route.js +7 -0
- package/.next/standalone/.next/server/app/api/v1/scheduled-tasks/[id]/route.js +17 -5
- package/.next/standalone/.next/server/app/api/v1/scheduled-tasks/route.js +7 -0
- package/.next/standalone/.next/server/app/api/v1/security/idle-timeout/route.js +7 -0
- package/.next/standalone/.next/server/app/api/v1/security/pin/route.js +7 -0
- package/.next/standalone/.next/server/app/api/v1/security/state/route.js +7 -0
- package/.next/standalone/.next/server/app/api/v1/security/unlock/route.js +7 -0
- package/.next/standalone/.next/server/app/api/v1/security/verify-pin/route.js +7 -0
- package/.next/standalone/.next/server/app/api/v1/skills/[id]/route.js +7 -0
- package/.next/standalone/.next/server/app/api/v1/skills/repos/[id]/route.js +7 -0
- package/.next/standalone/.next/server/app/api/v1/skills/repos/route.js +7 -0
- package/.next/standalone/.next/server/app/api/v1/skills/route.js +7 -0
- package/.next/standalone/.next/server/app/api/v1/tasks/[agent_id]/route.js +7 -0
- package/.next/standalone/.next/server/app/api/v1/tasks/route.js +7 -0
- package/.next/standalone/.next/server/app/api/v1/threads/[thread_id]/activity/route.js +7 -0
- package/.next/standalone/.next/server/app/api/v1/threads/[thread_id]/context-pin/route.js +12 -6
- package/.next/standalone/.next/server/app/api/v1/threads/[thread_id]/route.js +7 -0
- package/.next/standalone/.next/server/app/api/v1/threads/[thread_id]/run/route.js +0 -1
- package/.next/standalone/.next/server/app/api/v1/threads/route.js +17 -5
- package/.next/standalone/.next/server/app/api/v1/update/apply/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/api/v1/voice/transcribe/route.js +17 -5
- package/.next/standalone/.next/server/app/api/v1/voice/tts/route.js +17 -5
- package/.next/standalone/.next/server/app/api/v1/watchers/[id]/route.js +17 -5
- package/.next/standalone/.next/server/app/page.js +322 -275
- package/.next/standalone/.next/server/app/page_client-reference-manifest.js +1 -1
- package/.next/standalone/.next/server/app/setup/page.js +8 -0
- package/.next/standalone/.next/server/app/setup/page_client-reference-manifest.js +1 -1
- package/.next/standalone/.next/server/app-paths-manifest.json +4 -4
- package/.next/standalone/.next/server/chunks/1388.js +106 -36
- package/.next/standalone/.next/server/chunks/2068.js +47 -10
- package/.next/standalone/.next/server/chunks/210.js +6 -6
- package/.next/standalone/.next/server/chunks/2447.js +10 -5
- package/.next/standalone/.next/server/chunks/2471.js +17 -17
- package/.next/standalone/.next/server/chunks/3042.js +10 -8
- package/.next/standalone/.next/server/chunks/{4540.js → 309.js} +104 -38
- package/.next/standalone/.next/server/chunks/{2350.js → 3272.js} +104 -37
- package/.next/standalone/.next/server/chunks/3399.js +525 -525
- package/.next/standalone/.next/server/chunks/3524.js +150 -67
- package/.next/standalone/.next/server/chunks/4189.js +1 -1
- package/.next/standalone/.next/server/chunks/4508.js +2 -2
- package/.next/standalone/.next/server/chunks/46.js +73 -28
- package/.next/standalone/.next/server/chunks/5908.js +63 -42
- package/.next/standalone/.next/server/chunks/6142.js +10 -2
- package/.next/standalone/.next/server/chunks/6649.js +1 -1
- package/.next/standalone/.next/server/chunks/8461.js +10 -8
- package/.next/standalone/.next/server/chunks/9032.js +5 -5
- package/.next/standalone/.next/server/chunks/9164.js +435 -176
- package/.next/standalone/.next/server/chunks/9304.js +51 -12
- package/.next/standalone/.next/server/chunks/{423.js → 9590.js} +66 -21
- package/.next/standalone/.next/server/middleware-build-manifest.js +2 -2
- package/.next/standalone/.next/server/middleware.js +71 -18
- package/.next/standalone/.next/server/pages/404.html +2 -2
- package/.next/standalone/.next/server/pages/500.html +1 -1
- package/.next/standalone/.next/server/preview-props.json +3 -3
- package/.next/standalone/.next/server/server-reference-manifest.json +1 -1
- package/.next/standalone/.next/static/chunks/app/{page-213a623b37226452.js → page-04748847c6ff866f.js} +171 -132
- package/.next/standalone/.next/static/css/{312542a5725ba0d5.css → 2669e8744cc8c212.css} +2 -2
- package/.next/standalone/docs/adoption/changesets.json +49 -0
- package/.next/standalone/package.json +1 -1
- package/CHANGELOG.md +19 -0
- package/app/api/v1/threads/[thread_id]/run/route.ts +0 -1
- package/components/chat/MessageBubble.tsx +12 -0
- package/components/integrations/NetworkSection.tsx +2 -2
- package/lib/agents/citation-checker.test.ts +40 -2
- package/lib/agents/citation-checker.ts +56 -11
- package/lib/agents/context-boundary.ts +5 -6
- package/lib/agents/instruction-edits.test.ts +120 -0
- package/lib/agents/instruction-edits.ts +65 -42
- package/lib/agents/prepare/request.ts +0 -2
- package/lib/agents/prepare/system-prompt.test.ts +10 -0
- package/lib/agents/prepare/system-prompt.ts +8 -2
- package/lib/agents/proposals.test.ts +76 -0
- package/lib/agents/proposals.ts +13 -5
- package/lib/agents/run-thread.auto-boundary.test.ts +125 -5
- package/lib/agents/run-thread.ts +24 -9
- package/lib/agents/sqlite-checkpoint-saver.test.ts +91 -0
- package/lib/agents/warm-summary-background.ts +22 -2
- package/lib/agents/warm-topics.test.ts +155 -1
- package/lib/agents/warm-topics.ts +27 -7
- package/lib/bridges/dispatcher.ts +1 -0
- package/lib/bridges/message-role.test.ts +81 -0
- package/lib/bridges/message-role.ts +23 -10
- package/lib/bridges/types.ts +6 -0
- package/lib/bridges/whatsapp-link.test.ts +32 -0
- package/lib/bridges/whatsapp-link.ts +21 -0
- package/lib/bridges/whatsapp.inbound.test.ts +239 -0
- package/lib/bridges/whatsapp.sender.test.ts +80 -1
- package/lib/bridges/whatsapp.ts +76 -38
- package/lib/pricing/snapshot.test.ts +70 -0
- package/lib/pricing/snapshot.ts +10 -2
- package/lib/proxy/dispatcher.test.ts +119 -1
- package/lib/proxy/dispatcher.ts +22 -9
- package/lib/stores/agent-configs.ts +10 -5
- package/lib/stores/bridges.test.ts +81 -0
- package/lib/stores/bridges.ts +9 -8
- package/lib/stores/proxy-config.test.ts +120 -0
- package/lib/stores/proxy-config.ts +22 -4
- package/lib/stores/threads.ts +12 -8
- package/lib/tools/communications/calendar.test.ts +43 -2
- package/lib/tools/communications/calendar.ts +2 -0
- package/lib/tools/communications/gmail.test.ts +51 -1
- package/lib/tools/communications/gmail.ts +44 -2
- package/lib/tools/communications/outlook-calendar.ts +2 -0
- package/lib/tools/communications/outlook.test.ts +33 -2
- package/lib/tools/communications/outlook.ts +2 -0
- package/lib/tools/filesystem/edit-match.test.ts +133 -0
- package/lib/tools/filesystem/edit-match.ts +7 -2
- package/lib/tools/support/result-refs.test.ts +131 -0
- package/lib/tools/support/result-refs.ts +41 -9
- package/lib/utils/source-link.test.ts +51 -0
- package/lib/utils/source-link.ts +45 -0
- package/package.json +1 -1
- /package/.next/standalone/.next/static/{bMRK5y3ruT7c3WtBfCQOG → hwujW4hR1b-r3k5WdMxZO}/_buildManifest.js +0 -0
- /package/.next/standalone/.next/static/{bMRK5y3ruT7c3WtBfCQOG → hwujW4hR1b-r3k5WdMxZO}/_ssgManifest.js +0 -0
|
@@ -346,12 +346,17 @@ function upsertAgentConfigTransaction(input) {
|
|
|
346
346
|
const db = (0,_lib_db__WEBPACK_IMPORTED_MODULE_0__/* .getDb */ .Lf)();
|
|
347
347
|
const existing = getAgentConfig(input.id);
|
|
348
348
|
const created_at = existing?.created_at ?? t;
|
|
349
|
-
const
|
|
349
|
+
const existingMbti = toMbti(existing?.adaptive_mbti);
|
|
350
|
+
const mbti = input.adaptive_mbti ?? existingMbti ?? "INTJ";
|
|
350
351
|
const preset = _lib_agents_adaptive_persona_presets__WEBPACK_IMPORTED_MODULE_2__/* .MBTI_PRESETS */ .e[mbti];
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
const
|
|
352
|
+
// Omitted sliders keep their tuned values; they only fall back to the
|
|
353
|
+
// preset when the type changes or the agent is new. Otherwise every
|
|
354
|
+
// partial update (approved proposals, tool edits) reset them.
|
|
355
|
+
const keepTuned = existing !== null && existing !== undefined && mbti === existingMbti;
|
|
356
|
+
const strength = input.adaptive_persona_strength ?? (keepTuned ? existing.adaptive_persona_strength : preset.strength);
|
|
357
|
+
const empathy = input.adaptive_empathy ?? (keepTuned ? existing.adaptive_empathy : preset.empathy);
|
|
358
|
+
const expressiveness = input.adaptive_expressiveness ?? (keepTuned ? existing.adaptive_expressiveness : preset.expressiveness);
|
|
359
|
+
const verbosity = input.adaptive_verbosity ?? (keepTuned ? existing.adaptive_verbosity : preset.verbosity);
|
|
355
360
|
if (input.is_default) db.prepare("UPDATE agent_configs SET is_default=0").run();
|
|
356
361
|
// harness_id: explicit `undefined` means "keep existing"; explicit `null`
|
|
357
362
|
// means "use the global default". Empty string is normalised to null too,
|
|
@@ -1083,6 +1088,13 @@ module.exports = require("node:path");
|
|
|
1083
1088
|
|
|
1084
1089
|
/***/ }),
|
|
1085
1090
|
|
|
1091
|
+
/***/ 77030:
|
|
1092
|
+
/***/ ((module) => {
|
|
1093
|
+
|
|
1094
|
+
module.exports = require("node:net");
|
|
1095
|
+
|
|
1096
|
+
/***/ }),
|
|
1097
|
+
|
|
1086
1098
|
/***/ 77598:
|
|
1087
1099
|
/***/ ((module) => {
|
|
1088
1100
|
|
|
@@ -297,12 +297,17 @@ function upsertAgentConfigTransaction(input) {
|
|
|
297
297
|
const db = (0,_lib_db__WEBPACK_IMPORTED_MODULE_0__/* .getDb */ .Lf)();
|
|
298
298
|
const existing = getAgentConfig(input.id);
|
|
299
299
|
const created_at = existing?.created_at ?? t;
|
|
300
|
-
const
|
|
300
|
+
const existingMbti = toMbti(existing?.adaptive_mbti);
|
|
301
|
+
const mbti = input.adaptive_mbti ?? existingMbti ?? "INTJ";
|
|
301
302
|
const preset = _lib_agents_adaptive_persona_presets__WEBPACK_IMPORTED_MODULE_2__/* .MBTI_PRESETS */ .e[mbti];
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
const
|
|
303
|
+
// Omitted sliders keep their tuned values; they only fall back to the
|
|
304
|
+
// preset when the type changes or the agent is new. Otherwise every
|
|
305
|
+
// partial update (approved proposals, tool edits) reset them.
|
|
306
|
+
const keepTuned = existing !== null && existing !== undefined && mbti === existingMbti;
|
|
307
|
+
const strength = input.adaptive_persona_strength ?? (keepTuned ? existing.adaptive_persona_strength : preset.strength);
|
|
308
|
+
const empathy = input.adaptive_empathy ?? (keepTuned ? existing.adaptive_empathy : preset.empathy);
|
|
309
|
+
const expressiveness = input.adaptive_expressiveness ?? (keepTuned ? existing.adaptive_expressiveness : preset.expressiveness);
|
|
310
|
+
const verbosity = input.adaptive_verbosity ?? (keepTuned ? existing.adaptive_verbosity : preset.verbosity);
|
|
306
311
|
if (input.is_default) db.prepare("UPDATE agent_configs SET is_default=0").run();
|
|
307
312
|
// harness_id: explicit `undefined` means "keep existing"; explicit `null`
|
|
308
313
|
// means "use the global default". Empty string is normalised to null too,
|
|
@@ -984,6 +989,13 @@ module.exports = require("node:path");
|
|
|
984
989
|
|
|
985
990
|
/***/ }),
|
|
986
991
|
|
|
992
|
+
/***/ 77030:
|
|
993
|
+
/***/ ((module) => {
|
|
994
|
+
|
|
995
|
+
module.exports = require("node:net");
|
|
996
|
+
|
|
997
|
+
/***/ }),
|
|
998
|
+
|
|
987
999
|
/***/ 77598:
|
|
988
1000
|
/***/ ((module) => {
|
|
989
1001
|
|
|
@@ -84,6 +84,8 @@ var agent_turn = __webpack_require__(62032);
|
|
|
84
84
|
return (0,bridges/* findRoute */.$6)(bridge_id, remote_jid) ?? (0,bridges/* findRoute */.$6)(bridge_id, "*");
|
|
85
85
|
}
|
|
86
86
|
|
|
87
|
+
// EXTERNAL MODULE: ./lib/utils/source-link.ts
|
|
88
|
+
var source_link = __webpack_require__(12262);
|
|
87
89
|
;// ./lib/bridges/message-role.ts
|
|
88
90
|
/**
|
|
89
91
|
* Cross-adapter framing for bridge inbound messages.
|
|
@@ -101,25 +103,8 @@ var agent_turn = __webpack_require__(62032);
|
|
|
101
103
|
* sees. Adding a new adapter is a matter of mapping its platform-specific
|
|
102
104
|
* "who sent this" signal onto `MessageRole`; the framing code does not need
|
|
103
105
|
* to change.
|
|
104
|
-
*/
|
|
105
|
-
|
|
106
|
-
*
|
|
107
|
-
* - `user`: the paired account holder themselves — typed on their phone,
|
|
108
|
-
* in their browser, etc. The agent treats these as the user's own
|
|
109
|
-
* reaction/input to the conversation. Useful as an intent signal but
|
|
110
|
-
* NOT a direct command to the agent (the user is talking to the
|
|
111
|
-
* counterpart, not the agent).
|
|
112
|
-
*
|
|
113
|
-
* - `counterpart`: another participant in the chat — 1:1 partner in a DM,
|
|
114
|
-
* or another member in a group chat. The agent treats these as
|
|
115
|
-
* conversation context the user has not yet reacted to. Not a request
|
|
116
|
-
* directed at the agent.
|
|
117
|
-
*
|
|
118
|
-
* - `agent`: the agent's own prior output, surfaced inbound when the
|
|
119
|
-
* adapter cannot suppress its echo (rare). Adapters with reliable
|
|
120
|
-
* echo-filtering (e.g. WhatsApp's `sentIdsSet`) should never emit this
|
|
121
|
-
* value; it exists for adapters where deduplication is best-effort.
|
|
122
|
-
*/ /**
|
|
106
|
+
*/
|
|
107
|
+
/**
|
|
123
108
|
* Build the prompt prefix the agent receives for one bridge-inbound message.
|
|
124
109
|
*
|
|
125
110
|
* Output shape:
|
|
@@ -133,6 +118,7 @@ var agent_turn = __webpack_require__(62032);
|
|
|
133
118
|
* [message_role:user|counterpart|agent]
|
|
134
119
|
* [sender_id:<id>]
|
|
135
120
|
* [sender_name:<label>]
|
|
121
|
+
* ([chat_link:<https url>] when the platform has a permalink for the chat)
|
|
136
122
|
* ([group_name:<label>] [participant_id:<id>] [participant_name:<label>] for groups)
|
|
137
123
|
*
|
|
138
124
|
* <raw text>
|
|
@@ -142,23 +128,29 @@ var agent_turn = __webpack_require__(62032);
|
|
|
142
128
|
* convention. Both are stable across adapters.
|
|
143
129
|
*/ function formatBridgePrompt(input) {
|
|
144
130
|
const note = roleNote(input.role, input.is_group, input.silent === true, input.event);
|
|
131
|
+
// Header values come from the platform (display names, group subjects) and
|
|
132
|
+
// are sender-controlled: a line break would forge extra headers or end the
|
|
133
|
+
// header block early, so every value is flattened onto one line.
|
|
134
|
+
const h = (value)=>String(value ?? "").replace(/[\r\n\u0085\u2028\u2029]+/g, " ");
|
|
145
135
|
const lines = [
|
|
146
|
-
`[bridge:${input.bridge_id}]`,
|
|
147
|
-
`[chat_id:${input.chat_id}]`,
|
|
148
|
-
`[chat_name:${input.chat_name}]`,
|
|
136
|
+
`[bridge:${h(input.bridge_id)}]`,
|
|
137
|
+
`[chat_id:${h(input.chat_id)}]`,
|
|
138
|
+
`[chat_name:${h(input.chat_name)}]`,
|
|
149
139
|
`[chat_type:${input.is_group ? "group" : "dm"}]`,
|
|
150
140
|
`[message_role:${input.role}]`,
|
|
151
|
-
`[sender_id:${input.sender_id}]`,
|
|
152
|
-
`[sender_name:${input.sender_name}]`
|
|
141
|
+
`[sender_id:${h(input.sender_id)}]`,
|
|
142
|
+
`[sender_name:${h(input.sender_name)}]`
|
|
153
143
|
];
|
|
144
|
+
const chatLink = (0,source_link/* httpsUrlOrNull */.N)(input.chat_link);
|
|
145
|
+
if (chatLink) lines.push(`[chat_link:${chatLink}]`);
|
|
154
146
|
if (input.event) {
|
|
155
147
|
lines.push(`[event_type:${input.event.type}]`);
|
|
156
|
-
lines.push(`[event_subtype:${input.event.subtype}]`);
|
|
148
|
+
lines.push(`[event_subtype:${h(input.event.subtype)}]`);
|
|
157
149
|
}
|
|
158
150
|
if (input.is_group) {
|
|
159
|
-
lines.push(`[group_name:${input.chat_name}]`);
|
|
160
|
-
lines.push(`[participant_id:${input.sender_id}]`);
|
|
161
|
-
lines.push(`[participant_name:${input.sender_name}]`);
|
|
151
|
+
lines.push(`[group_name:${h(input.chat_name)}]`);
|
|
152
|
+
lines.push(`[participant_id:${h(input.sender_id)}]`);
|
|
153
|
+
lines.push(`[participant_name:${h(input.sender_name)}]`);
|
|
162
154
|
}
|
|
163
155
|
return `${note}\n\n${lines.join("\n")}\n\n${input.text}`;
|
|
164
156
|
}
|
|
@@ -173,7 +165,7 @@ function parseBridgePrompt(raw) {
|
|
|
173
165
|
const lines = src.split("\n");
|
|
174
166
|
let i = 0;
|
|
175
167
|
for(; i < lines.length; i++){
|
|
176
|
-
const line = lines[i];
|
|
168
|
+
const line = lines[i].replace(/\r$/, "");
|
|
177
169
|
if (line === "") {
|
|
178
170
|
i++;
|
|
179
171
|
break;
|
|
@@ -192,6 +184,7 @@ function parseBridgePrompt(raw) {
|
|
|
192
184
|
isGroup: headers.chat_type === "group",
|
|
193
185
|
senderJid: senderId,
|
|
194
186
|
senderName: headers.sender_name || senderId || "Unknown",
|
|
187
|
+
chatLink: httpsUrlOrNull(headers.chat_link),
|
|
195
188
|
body: lines.slice(i).join("\n").trimEnd()
|
|
196
189
|
};
|
|
197
190
|
}
|
|
@@ -304,6 +297,7 @@ var automation_activity = __webpack_require__(26316);
|
|
|
304
297
|
role: msg.role,
|
|
305
298
|
sender_id: senderJid,
|
|
306
299
|
sender_name: senderName,
|
|
300
|
+
chat_link: adapter.chatLink?.(msg.remote_jid) ?? null,
|
|
307
301
|
text: msg.text,
|
|
308
302
|
silent,
|
|
309
303
|
event: msg.event
|
|
@@ -432,8 +426,8 @@ var automation_activity = __webpack_require__(26316);
|
|
|
432
426
|
}
|
|
433
427
|
}
|
|
434
428
|
|
|
435
|
-
// EXTERNAL MODULE: ./lib/bridges/registry.ts +
|
|
436
|
-
var registry = __webpack_require__(
|
|
429
|
+
// EXTERNAL MODULE: ./lib/bridges/registry.ts + 5 modules
|
|
430
|
+
var registry = __webpack_require__(70309);
|
|
437
431
|
;// ./lib/bridges/runtime.ts
|
|
438
432
|
/**
|
|
439
433
|
* Bridge lifecycle manager.
|
|
@@ -1380,7 +1374,7 @@ module.exports = import("@huggingface/transformers");;
|
|
|
1380
1374
|
var __webpack_require__ = require("../../../../../../webpack-runtime.js");
|
|
1381
1375
|
__webpack_require__.C(exports);
|
|
1382
1376
|
var __webpack_exec__ = (moduleId) => (__webpack_require__(__webpack_require__.s = moduleId))
|
|
1383
|
-
var __webpack_exports__ = __webpack_require__.X(0, [2970,7377,1813,7981,513,6299,563,8808,7547,4992,46,3042,3566,2068,4377,1638,5585,9304,3524,3175,6142,540,4189,4955,5908,5120,1388,
|
|
1377
|
+
var __webpack_exports__ = __webpack_require__.X(0, [2970,7377,1813,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__(55691)));
|
|
1384
1378
|
module.exports = __webpack_exports__;
|
|
1385
1379
|
|
|
1386
1380
|
})();
|