@botonic/core 0.44.0 → 0.45.0-alpha.1

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 (60) hide show
  1. package/lib/cjs/core-bot.d.ts +1 -1
  2. package/lib/cjs/debug/inspector.d.ts +1 -1
  3. package/lib/cjs/debug/inspector.js +0 -2
  4. package/lib/cjs/debug/inspector.js.map +1 -1
  5. package/lib/cjs/handoff.d.ts +1 -1
  6. package/lib/cjs/handoff.js +2 -1
  7. package/lib/cjs/handoff.js.map +1 -1
  8. package/lib/cjs/hubtype-service.d.ts +3 -3
  9. package/lib/cjs/hubtype-service.js +25 -19
  10. package/lib/cjs/hubtype-service.js.map +1 -1
  11. package/lib/cjs/models/ai-agents.d.ts +13 -2
  12. package/lib/cjs/models/hubtype-analytics.d.ts +1 -1
  13. package/lib/cjs/plugins.d.ts +1 -1
  14. package/lib/cjs/pusher-utils.js +1 -1
  15. package/lib/cjs/pusher-utils.js.map +1 -1
  16. package/lib/cjs/routing/router-utils.d.ts +1 -1
  17. package/lib/cjs/routing/router-utils.js +15 -8
  18. package/lib/cjs/routing/router-utils.js.map +1 -1
  19. package/lib/cjs/routing/router.d.ts +1 -1
  20. package/lib/cjs/routing/router.js +31 -20
  21. package/lib/cjs/routing/router.js.map +1 -1
  22. package/lib/cjs/utils.d.ts +1 -1
  23. package/lib/cjs/utils.js +12 -8
  24. package/lib/cjs/utils.js.map +1 -1
  25. package/lib/esm/core-bot.d.ts +1 -1
  26. package/lib/esm/debug/inspector.d.ts +1 -1
  27. package/lib/esm/debug/inspector.js +0 -2
  28. package/lib/esm/debug/inspector.js.map +1 -1
  29. package/lib/esm/handoff.d.ts +1 -1
  30. package/lib/esm/handoff.js +2 -1
  31. package/lib/esm/handoff.js.map +1 -1
  32. package/lib/esm/hubtype-service.d.ts +3 -3
  33. package/lib/esm/hubtype-service.js +25 -19
  34. package/lib/esm/hubtype-service.js.map +1 -1
  35. package/lib/esm/models/ai-agents.d.ts +13 -2
  36. package/lib/esm/models/hubtype-analytics.d.ts +1 -1
  37. package/lib/esm/plugins.d.ts +1 -1
  38. package/lib/esm/pusher-utils.js +1 -1
  39. package/lib/esm/pusher-utils.js.map +1 -1
  40. package/lib/esm/routing/router-utils.d.ts +1 -1
  41. package/lib/esm/routing/router-utils.js +15 -8
  42. package/lib/esm/routing/router-utils.js.map +1 -1
  43. package/lib/esm/routing/router.d.ts +1 -1
  44. package/lib/esm/routing/router.js +31 -20
  45. package/lib/esm/routing/router.js.map +1 -1
  46. package/lib/esm/utils.d.ts +1 -1
  47. package/lib/esm/utils.js +12 -8
  48. package/lib/esm/utils.js.map +1 -1
  49. package/package.json +4 -7
  50. package/src/core-bot.ts +9 -9
  51. package/src/debug/inspector.ts +4 -6
  52. package/src/handoff.ts +6 -3
  53. package/src/hubtype-service.ts +34 -23
  54. package/src/models/ai-agents.ts +14 -1
  55. package/src/models/hubtype-analytics.ts +1 -1
  56. package/src/plugins.ts +1 -1
  57. package/src/pusher-utils.ts +1 -1
  58. package/src/routing/router-utils.ts +23 -9
  59. package/src/routing/router.ts +41 -24
  60. package/src/utils.ts +18 -9
package/src/utils.ts CHANGED
@@ -1,7 +1,7 @@
1
- import { PROVIDER, Session } from './models/legacy-types'
1
+ import { PROVIDER, type Session } from './models/legacy-types'
2
2
 
3
3
  export const isNode = (): boolean => {
4
- // @ts-ignore
4
+ // @ts-expect-error
5
5
  return typeof IS_NODE !== 'undefined'
6
6
  ? // @ts-ignore
7
7
  IS_NODE
@@ -11,7 +11,7 @@ export const isNode = (): boolean => {
11
11
  }
12
12
 
13
13
  export const isBrowser = (): boolean => {
14
- // @ts-ignore
14
+ // @ts-expect-error
15
15
  return typeof IS_BROWSER !== 'undefined'
16
16
  ? // @ts-ignore
17
17
  IS_BROWSER
@@ -38,7 +38,9 @@ export function isFunction(o: any): boolean {
38
38
  }
39
39
 
40
40
  export function cloneObject(object: any): any {
41
- if (!object) return {}
41
+ if (!object) {
42
+ return {}
43
+ }
42
44
  return { ...object }
43
45
  }
44
46
 
@@ -62,15 +64,22 @@ export const join = (...segments: string[]): string => {
62
64
  const part = parts[i]
63
65
  // Remove leading and trailing slashes
64
66
  // Also remove "." segments
65
- if (!part || part === '.') continue
67
+ if (!part || part === '.') {
68
+ continue
69
+ }
66
70
  // Interpret ".." to pop the last segment
67
- if (part === '..') newParts.pop()
71
+ if (part === '..') {
72
+ newParts.pop()
73
+ }
68
74
  // Push new path segments.
69
- else newParts.push(part)
75
+ else {
76
+ newParts.push(part)
77
+ }
70
78
  }
71
79
  // Preserve the initial slash if there was one.
72
- // @ts-ignore
73
- if (parts[0] === '') newParts.unshift('')
80
+ if (parts[0] === '') {
81
+ newParts.unshift('')
82
+ }
74
83
  // Turn back into a single string path.
75
84
  return newParts.join('/') || (newParts.length ? '/' : '.')
76
85
  }