@aintela/chat 0.4.20 → 0.4.21

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,5 +1,5 @@
1
1
  import { default as React } from 'react';
2
- import { AtQueryContext } from '../../utils/atMentions';
2
+ import { AtPersonQueryContext, AtQueryContext } from '../../utils/atMentions';
3
3
  import { PromptTriggerItem } from '../../utils/promptTriggers';
4
4
  import { PromptAnalysis, PromptResolution, SuggestItem } from '../../services/httpPromptAssistService';
5
5
  export type { PromptTriggerItem } from '../../utils/promptTriggers';
@@ -171,7 +171,7 @@ interface PromptV2Props {
171
171
  * surrounding text reads as "who travels", location-first otherwise — one anchor, no opaque relevance merge.
172
172
  * Return `@[Name](user:id)`-style values so the agent gets the passenger id without a lookup.
173
173
  */
174
- onAtPersonQuery?: (query: string) => Promise<PromptTriggerItem[]>;
174
+ onAtPersonQuery?: (query: string, context?: AtPersonQueryContext) => Promise<PromptTriggerItem[]>;
175
175
  /**
176
176
  * Live prompt-assist quick path (debounced ~300ms). Given the text + caret, the server
177
177
  * (Qwen next-word + NER) categorizes what's coming so the composer can auto-open the `@`
@@ -25,11 +25,17 @@ export interface AtQueryContext {
25
25
  * keeps places and airports below. Undefined when the host or the server predates the head. */
26
26
  hotelNameConfidence?: number;
27
27
  }
28
+ /** Context handed to the person source (2026-09-11) — the mirror of {@link AtQueryContext} for the other half. */
29
+ export interface AtPersonQueryContext {
30
+ /** This source's rows will LEAD the list (person-intent won). A blank query then wants a full page of the
31
+ * directory rather than the handful that fits under a place list — Ciro asked for a top 20. */
32
+ leading: boolean;
33
+ }
28
34
  export interface AtMentionFetchers {
29
35
  /** Location source (airports / cities — or hotel places when `context.vertical` says so, issue #876). */
30
36
  onAtQuery?: (query: string, context?: AtQueryContext) => Promise<PromptTriggerItem[]>;
31
37
  /** Person / passenger source (company directory). */
32
- onAtPersonQuery?: (query: string) => Promise<PromptTriggerItem[]>;
38
+ onAtPersonQuery?: (query: string, context?: AtPersonQueryContext) => Promise<PromptTriggerItem[]>;
33
39
  }
34
40
  export interface AtMentionOptions {
35
41
  /** Person-intent confidence from the analyze pass; orders the two sections. Default 0. */
@@ -18,6 +18,6 @@ export { swallowNextClick } from './swallowNextClick';
18
18
  export { detectTrigger, applyTriggerInsertion, findPlaceholder, placeholderAt, activatePlaceholder, advanceToPlaceholder, } from './promptTriggers';
19
19
  export type { TriggerChar, ActiveTrigger, TriggerInsertion, TemplatePlaceholder, MentionKind } from './promptTriggers';
20
20
  export { fetchAtMentions, isSectionStart } from './atMentions';
21
- export type { AtMentionItem, MentionGroup, AtMentionFetchers, AtMentionOptions, AtQueryContext, AtQueryVertical } from './atMentions';
21
+ export type { AtMentionItem, MentionGroup, AtMentionFetchers, AtMentionOptions, AtQueryContext, AtPersonQueryContext, AtQueryVertical } from './atMentions';
22
22
  export { toPredictionRows } from './predictionRows';
23
23
  export type { PredictionRow } from './predictionRows';
package/dist/utils.js CHANGED
@@ -2,7 +2,7 @@ var u = Object.defineProperty;
2
2
  var a = (e, t) => u(e, "name", { value: t, configurable: !0 });
3
3
  import { a as c, b as s } from "./environmentUtils-VZNTCzEE.js";
4
4
  import { A as k, D as U, g as x, c as M, d as V, e as G, f as R, i as H, r as W } from "./environmentUtils-VZNTCzEE.js";
5
- import { S as Y, a as Z, b as j, c as q, d as z, e as Q, f as $, g as J, h as X, i as ee, j as te, k as oe, l as ae, p as re, m as ie, s as ne, o as se, q as le, t as ce, r as de } from "./predictionRows-BDZtjaRZ.js";
5
+ import { S as Y, a as Z, b as j, c as q, d as z, e as Q, f as $, g as J, h as X, i as ee, j as te, k as oe, l as ae, p as re, m as ie, s as ne, o as se, q as le, t as ce, r as de } from "./predictionRows-CtyrlEUr.js";
6
6
  const m = "https://agent.tripapi.com.br", p = "http://localagent:8000", S = /* @__PURE__ */ a((e) => new URLSearchParams(e.location.search).get("local") === "true" ? p : c() ?? m, "getAgentBaseUrl"), f = "https://storage.googleapis.com/aibi_artifacts_bucket", I = /* @__PURE__ */ a(() => f, "getArtifactsBaseUrl"), n = {}, h = (n == null ? void 0 : n.VITE_CADDY) == "true";
7
7
  function w() {
8
8
  const e = h ? "http://wsserver.localhost" : "http://localhost:8000";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@aintela/chat",
3
- "version": "0.4.20",
3
+ "version": "0.4.21",
4
4
  "type": "module",
5
5
  "publishConfig": {
6
6
  "access": "public"