wingbot 3.75.9-alpha.3 → 3.75.9-alpha.4

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": "wingbot",
3
- "version": "3.75.9-alpha.3",
3
+ "version": "3.75.9-alpha.4",
4
4
  "description": "Enterprise Messaging Bot Conversation Engine",
5
5
  "main": "index.js",
6
6
  "type": "commonjs",
@@ -166,20 +166,44 @@ class GlobalIntents {
166
166
  id, matcher = null, action: intentPath, local, title,
167
167
  entitiesSetState = {}, usedEntities, meta = {},
168
168
  classification = null, router = null,
169
- keepUserInInteractionsWithBounceAllowed
170
-
169
+ keepUserInInteractionsWithBounceAllowed,
170
+ localPath: prevLocalPath
171
171
  } = gi;
172
172
  const action = intentPath === '/*'
173
173
  ? pathContext.path
174
174
  : `${pathContext.path}${intentPath}`.replace(/^\/\*/, '');
175
175
 
176
+ let localPath;
177
+
178
+ if (prevLocalPath === '/') {
179
+ localPath = `${pathContext.path}`;
180
+ } else if (prevLocalPath) {
181
+ localPath = `${pathContext.path}${prevLocalPath}`;
182
+ } else {
183
+ localPath = action === pathContext.path
184
+ ? action.replace(/\/[^/]+$/, '')
185
+ : pathContext.path.replace(/\/[^/]+$/, '');
186
+
187
+ if (!localPath) {
188
+ localPath = '/';
189
+ }
190
+ }
191
+
192
+ // console.log('merge', {
193
+ // action,
194
+ // pathContextPath: pathContext.path,
195
+ // intentPath,
196
+ // prevLocalPath,
197
+ // localPath
198
+ // });
199
+
176
200
  target.set(id, {
177
201
  id,
178
202
  matcher,
179
203
  usedEntities,
180
204
  entitiesSetState,
181
205
  action,
182
- localPath: pathContext.path,
206
+ localPath,
183
207
  local,
184
208
  title,
185
209
  classification,
@@ -496,8 +496,10 @@ class LLMDispatcher {
496
496
  }
497
497
  }
498
498
 
499
+ const llmRouting = LLMRouter.prepareRouting(globalIntents);
500
+
499
501
  return {
500
- ...LLMRouter.prepareRouting(globalIntents),
502
+ ...llmRouting,
501
503
  nlpMatchers: Array.from(giMatchersByAction.values()),
502
504
  giByAction
503
505
  };
package/src/LLMRouter.js CHANGED
@@ -175,7 +175,7 @@ class LLMRouter {
175
175
  // Fail closed: any error in routing classification is treated
176
176
  // as "no context change" so the user's current flow continues.
177
177
  // Surfaces to Sentry via the host-configured logger.
178
- llm.log?.error('LLMRouter classification failed', e, {
178
+ llm.log.error('LLMRouter classification failed', e, {
179
179
  // userText,
180
180
  candidateActions: routing?.byAction
181
181
  ? Array.from(routing.byAction.keys())
@@ -1,11 +0,0 @@
1
- {
2
- "permissions": {
3
- "allow": [
4
- "Bash(npx mocha:*)",
5
- "Bash(npx tsc *)",
6
- "Bash(npm test *)",
7
- "Bash(node -e \"const p = require\\('./bot/plugins/BTMLLM'\\); console.log\\('factory type:', typeof p\\); console.log\\('factory name:', p.name\\);\")",
8
- "Bash(grep -n \"prompt\\\\`\\\\|tagged\\\\|render\\\\|compile\\\\|hbs\" /Users/ondrejveres/Wingbot/wingbot-llm/src/prompt.js)"
9
- ]
10
- }
11
- }