@servicetitan/titan-chatbot-api 7.1.0 → 7.1.2

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": "@servicetitan/titan-chatbot-api",
3
- "version": "7.1.0",
3
+ "version": "7.1.2",
4
4
  "description": "Chatbot client API package",
5
5
  "repository": {
6
6
  "type": "git",
@@ -17,7 +17,7 @@
17
17
  "push:local": "yalc push"
18
18
  },
19
19
  "dependencies": {
20
- "@servicetitan/titan-chat-ui-common": "^7.1.0",
20
+ "@servicetitan/titan-chat-ui-common": "^7.1.2",
21
21
  "lodash": "^4.18.1",
22
22
  "nanoid": "^5.1.5"
23
23
  },
@@ -42,5 +42,5 @@
42
42
  "cli": {
43
43
  "webpack": false
44
44
  },
45
- "gitHead": "3850a8bab63c7fa6d23fcfb2a40fa1a1416a3b13"
45
+ "gitHead": "ddacea8f1d7e9ffce602d24554aeb306e61a40e2"
46
46
  }
@@ -257,10 +257,8 @@ export const mockWorkflowStep = (overrides?: Partial<Models.IWorkflowStep>): Mod
257
257
  ...overrides,
258
258
  });
259
259
 
260
- export const mockWorkflowConfirmation = (
261
- overrides?: Partial<Models.IWorkflowConfirmation>
262
- ): Models.WorkflowConfirmation =>
263
- new Models.WorkflowConfirmation({
260
+ export const mockWorkflowPlan = (overrides?: Partial<Models.IWorkflowPlan>): Models.WorkflowPlan =>
261
+ new Models.WorkflowPlan({
264
262
  displayName: 'Workflow Display Name',
265
263
  estimatedRuntimeSec: 60,
266
264
  inputs: [mockUserInput()],
@@ -26,8 +26,8 @@ export {
26
26
  ExportHistoryMessage,
27
27
  AgentOption,
28
28
  IAgentOption,
29
- WorkflowConfirmation,
30
- IWorkflowConfirmation,
29
+ WorkflowPlan,
30
+ IWorkflowPlan,
31
31
  WorkflowStep,
32
32
  IWorkflowStep,
33
33
  UserInput,
@@ -871,13 +871,13 @@ export class BotMessage extends Message implements IBotMessage {
871
871
  /** Ordered list of relevant Knowledge Base links. */
872
872
  declare scoredUrls?: ScoredUrl[] | undefined;
873
873
  /** A value indicating one of the conditions:
874
- - N - "none" or "normal", a successful response
875
- - A - "agent", user wants to talk to a support agent
876
- - C - "conversation", user attempted to continue a conversation in a single-turn message
877
- - OI - "offensive input"
878
- - AA - "agentic approval", the bot is waiting for the user to approve or cancel a pending action
879
- - BI - "bifurcation", the bot is offering the user a choice (see TitanChatbot.Host.API.Models.BotMessage.AgentOptions)
880
- Client may handle these conditions in different ways. */
874
+ - N - "none" or "normal", a successful response
875
+ - A - "agent", user wants to talk to a support agent
876
+ - C - "conversation", user attempted to continue a conversation in a single-turn message
877
+ - OI - "offensive input"
878
+ - AA - "agentic approval", the bot is waiting for the user to approve or cancel a pending action
879
+ - BI - "bifurcation", the bot is offering the user a choice (see TitanChatbot.Host.API.Models.BotMessage.AgentOptions)
880
+ Client may handle these conditions in different ways. */
881
881
  declare guardFlag: string;
882
882
  /** Whether the answer is guardrailed, meaning TitanChatbot.Host.API.Models.BotMessage.GuardFlag is anything but "N". */
883
883
  declare isGuardrailed: boolean;
@@ -891,7 +891,7 @@ Client may handle these conditions in different ways. */
891
891
  declare confidenceScore?: number | undefined;
892
892
  /** When the bot offers the user a discrete choice (e.g. "do it for me" vs "show me how"), the available options. */
893
893
  declare agentOptions?: AgentOption[] | undefined;
894
- declare workflowConfirmation?: WorkflowConfirmation;
894
+ declare workflowPlan?: WorkflowPlan;
895
895
 
896
896
  constructor(data?: IBotMessage) {
897
897
  super(data);
@@ -917,8 +917,8 @@ Client may handle these conditions in different ways. */
917
917
  for (let item of _data['agentOptions'])
918
918
  this.agentOptions!.push(AgentOption.fromJS(item));
919
919
  }
920
- this.workflowConfirmation = _data['workflowConfirmation']
921
- ? WorkflowConfirmation.fromJS(_data['workflowConfirmation'])
920
+ this.workflowPlan = _data['workflowPlan']
921
+ ? WorkflowPlan.fromJS(_data['workflowPlan'])
922
922
  : <any>undefined;
923
923
  }
924
924
  }
@@ -947,9 +947,7 @@ Client may handle these conditions in different ways. */
947
947
  data['agentOptions'] = [];
948
948
  for (let item of this.agentOptions) data['agentOptions'].push(item.toJSON());
949
949
  }
950
- data['workflowConfirmation'] = this.workflowConfirmation
951
- ? this.workflowConfirmation.toJSON()
952
- : <any>undefined;
950
+ data['workflowPlan'] = this.workflowPlan ? this.workflowPlan.toJSON() : <any>undefined;
953
951
  super.toJSON(data);
954
952
  return data;
955
953
  }
@@ -962,13 +960,13 @@ export interface IBotMessage extends IMessage {
962
960
  /** Ordered list of relevant Knowledge Base links. */
963
961
  scoredUrls?: ScoredUrl[] | undefined;
964
962
  /** A value indicating one of the conditions:
965
- - N - "none" or "normal", a successful response
966
- - A - "agent", user wants to talk to a support agent
967
- - C - "conversation", user attempted to continue a conversation in a single-turn message
968
- - OI - "offensive input"
969
- - AA - "agentic approval", the bot is waiting for the user to approve or cancel a pending action
970
- - BI - "bifurcation", the bot is offering the user a choice (see TitanChatbot.Host.API.Models.BotMessage.AgentOptions)
971
- Client may handle these conditions in different ways. */
963
+ - N - "none" or "normal", a successful response
964
+ - A - "agent", user wants to talk to a support agent
965
+ - C - "conversation", user attempted to continue a conversation in a single-turn message
966
+ - OI - "offensive input"
967
+ - AA - "agentic approval", the bot is waiting for the user to approve or cancel a pending action
968
+ - BI - "bifurcation", the bot is offering the user a choice (see TitanChatbot.Host.API.Models.BotMessage.AgentOptions)
969
+ Client may handle these conditions in different ways. */
972
970
  guardFlag: string;
973
971
  /** Whether the answer is guardrailed, meaning TitanChatbot.Host.API.Models.BotMessage.GuardFlag is anything but "N". */
974
972
  isGuardrailed: boolean;
@@ -982,7 +980,7 @@ Client may handle these conditions in different ways. */
982
980
  confidenceScore?: number | undefined;
983
981
  /** When the bot offers the user a discrete choice (e.g. "do it for me" vs "show me how"), the available options. */
984
982
  agentOptions?: AgentOption[] | undefined;
985
- workflowConfirmation?: WorkflowConfirmation;
983
+ workflowPlan?: WorkflowPlan;
986
984
  }
987
985
 
988
986
  export enum Experience {
@@ -1547,8 +1545,8 @@ export interface ISummarizeResponse {
1547
1545
 
1548
1546
  /** One user-provided input collected for the workflow. */
1549
1547
  export class UserInput implements IUserInput {
1550
- label?: string | undefined;
1551
- value?: string | undefined;
1548
+ label!: string;
1549
+ value!: string;
1552
1550
 
1553
1551
  constructor(data?: IUserInput) {
1554
1552
  if (data) {
@@ -1582,8 +1580,8 @@ export class UserInput implements IUserInput {
1582
1580
 
1583
1581
  /** One user-provided input collected for the workflow. */
1584
1582
  export interface IUserInput {
1585
- label?: string | undefined;
1586
- value?: string | undefined;
1583
+ label: string;
1584
+ value: string;
1587
1585
  }
1588
1586
 
1589
1587
  /** User request message. */
@@ -1653,18 +1651,21 @@ export interface IUserMessage extends IMessage {
1653
1651
  }
1654
1652
 
1655
1653
  /** Pre-execution plan for an agentic UI workflow. */
1656
- export class WorkflowConfirmation implements IWorkflowConfirmation {
1657
- displayName?: string | undefined;
1658
- estimatedRuntimeSec?: number;
1654
+ export class WorkflowPlan implements IWorkflowPlan {
1655
+ displayName!: string;
1656
+ estimatedRuntimeSec!: number;
1659
1657
  inputs?: UserInput[] | undefined;
1660
- steps?: WorkflowStep[] | undefined;
1658
+ steps!: WorkflowStep[];
1661
1659
 
1662
- constructor(data?: IWorkflowConfirmation) {
1660
+ constructor(data?: IWorkflowPlan) {
1663
1661
  if (data) {
1664
1662
  for (var property in data) {
1665
1663
  if (data.hasOwnProperty(property)) (<any>this)[property] = (<any>data)[property];
1666
1664
  }
1667
1665
  }
1666
+ if (!data) {
1667
+ this.steps = [];
1668
+ }
1668
1669
  }
1669
1670
 
1670
1671
  init(_data?: any) {
@@ -1682,9 +1683,9 @@ export class WorkflowConfirmation implements IWorkflowConfirmation {
1682
1683
  }
1683
1684
  }
1684
1685
 
1685
- static fromJS(data: any): WorkflowConfirmation {
1686
+ static fromJS(data: any): WorkflowPlan {
1686
1687
  data = typeof data === 'object' ? data : {};
1687
- let result = new WorkflowConfirmation();
1688
+ let result = new WorkflowPlan();
1688
1689
  result.init(data);
1689
1690
  return result;
1690
1691
  }
@@ -1706,17 +1707,17 @@ export class WorkflowConfirmation implements IWorkflowConfirmation {
1706
1707
  }
1707
1708
 
1708
1709
  /** Pre-execution plan for an agentic UI workflow. */
1709
- export interface IWorkflowConfirmation {
1710
- displayName?: string | undefined;
1711
- estimatedRuntimeSec?: number;
1710
+ export interface IWorkflowPlan {
1711
+ displayName: string;
1712
+ estimatedRuntimeSec: number;
1712
1713
  inputs?: UserInput[] | undefined;
1713
- steps?: WorkflowStep[] | undefined;
1714
+ steps: WorkflowStep[];
1714
1715
  }
1715
1716
 
1716
1717
  /** One step in the workflow's execution plan. `PageUrl` is set on navigation steps only. */
1717
1718
  export class WorkflowStep implements IWorkflowStep {
1718
- number?: number;
1719
- description?: string | undefined;
1719
+ number!: number;
1720
+ description!: string;
1720
1721
  pageUrl?: string | undefined;
1721
1722
 
1722
1723
  constructor(data?: IWorkflowStep) {
@@ -1753,8 +1754,8 @@ export class WorkflowStep implements IWorkflowStep {
1753
1754
 
1754
1755
  /** One step in the workflow's execution plan. `PageUrl` is set on navigation steps only. */
1755
1756
  export interface IWorkflowStep {
1756
- number?: number;
1757
- description?: string | undefined;
1757
+ number: number;
1758
+ description: string;
1758
1759
  pageUrl?: string | undefined;
1759
1760
  }
1760
1761