@talkpilot/core-db 1.1.19 → 1.2.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.
@@ -8,12 +8,20 @@ export type InitiateCallForShortSlaConfig = {
8
8
  }[];
9
9
  flow_id?: string | string[];
10
10
  };
11
+ /** Per-tool LLM system prompt overrides. Falls back to hardcoded defaults when absent. */
12
+ export type Moked106ToolPrompts = {
13
+ findSubjectsSystemPrompt?: string;
14
+ findStreetsSystemPrompt?: string;
15
+ };
16
+ /** Feature flags and behavior config for the moked_106 municipal call-center product. */
11
17
  export type Moked106Config = {
12
18
  initiate_call_for_short_sla?: InitiateCallForShortSlaConfig;
13
19
  avoidSaveTickets?: boolean;
14
20
  withUploadImagesSms?: boolean;
15
21
  withNeedAttentionCalls?: boolean;
22
+ toolsPrompts?: Moked106ToolPrompts;
16
23
  };
24
+ /** Product config for the MIS */
17
25
  export type MunicipalProduct = {
18
26
  moked_106?: Moked106Config;
19
27
  cityName: string;
@@ -24,13 +32,12 @@ export type MunicipalProduct = {
24
32
  websiteUrl?: string;
25
33
  isProductionReady?: boolean;
26
34
  municipalDisplayName?: string;
27
- findSubjectsSystemPrompt?: string;
28
- findStreetsSystemPrompt?: string;
29
35
  };
30
36
  export type WebsiteTalkScheduler = {
31
37
  type: "cron";
32
38
  schedule: string;
33
39
  };
40
+ /** Product config for the websiteTalk */
34
41
  export type WebsiteTalkProduct = {
35
42
  logoUrl: string;
36
43
  companyName: string;
@@ -39,18 +46,19 @@ export type WebsiteTalkProduct = {
39
46
  defaultBaseUrl: string;
40
47
  scheduler?: WebsiteTalkScheduler;
41
48
  };
42
- export type Products = {
43
- municipal?: MunicipalProduct;
44
- clinics?: ClinicsProduct;
45
- websiteTalk?: WebsiteTalkProduct;
46
- [key: string]: unknown;
47
- };
49
+ /** Product config for the clinics scheduling integration. */
48
50
  export type ClinicsProduct = {
49
51
  api_key_secret_name: string;
50
52
  base_api_url: string;
51
53
  provider: "clinix" | (string & {});
52
54
  description?: string;
53
55
  };
56
+ export type Products = {
57
+ municipal?: MunicipalProduct;
58
+ clinics?: ClinicsProduct;
59
+ websiteTalk?: WebsiteTalkProduct;
60
+ [key: string]: unknown;
61
+ };
54
62
  export type ClientLanguageName = "Hebrew" | "English" | "Russian" | "French" | "Spanish" | (string & {});
55
63
  export type SendGridConfig = {
56
64
  emailTo: string[];
@@ -1 +1 @@
1
- {"version":3,"file":"clientsConfig.types.d.ts","sourceRoot":"","sources":["../../../src/talkpilot/clientsConfig/clientsConfig.types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,SAAS,CAAC;AAEjC,MAAM,MAAM,6BAA6B,GAAG;IAC1C,MAAM,EAAE,OAAO,CAAC;IAChB,SAAS,EAAE,MAAM,CAAC;IAClB,QAAQ,CAAC,EAAE;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,WAAW,EAAE,MAAM,CAAA;KAAE,EAAE,CAAC;IACnD,OAAO,CAAC,EAAE,MAAM,GAAG,MAAM,EAAE,CAAC;CAC7B,CAAC;AAEF,MAAM,MAAM,cAAc,GAAG;IAC3B,2BAA2B,CAAC,EAAE,6BAA6B,CAAC;IAC5D,gBAAgB,CAAC,EAAE,OAAO,CAAC;IAC3B,mBAAmB,CAAC,EAAE,OAAO,CAAC;IAC9B,sBAAsB,CAAC,EAAE,OAAO,CAAC;CAClC,CAAC;AAEF,MAAM,MAAM,gBAAgB,GAAG;IAC7B,SAAS,CAAC,EAAE,cAAc,CAAC;IAC3B,QAAQ,EAAE,MAAM,CAAC;IACjB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,QAAQ,EAAE,MAAM,CAAC;IACjB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,iBAAiB,CAAC,EAAE,OAAO,CAAC;IAC5B,oBAAoB,CAAC,EAAE,MAAM,CAAC;I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AkB,CAAC;IACjC,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC;CACxB,CAAC;AAEF,MAAM,MAAM,kBAAkB,GAC1B,QAAQ,GACR,SAAS,GACT,SAAS,GACT,QAAQ,GACR,SAAS,GACT,CAAC,MAAM,GAAG,EAAE,CAAC,CAAC;AAElB,MAAM,MAAM,cAAc,GAAG;IAC3B,OAAO,EAAE,MAAM,EAAE,CAAC;IAClB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,QAAQ,CAAC,EAAE,MAAM,CAAC;CACnB,CAAC;AAEF,MAAM,MAAM,SAAS,GAAG,EAAE,CAAC;AAE3B,MAAM,MAAM,cAAc,GAAG,EAAE,CAAC;AAEhC,MAAM,MAAM,oBAAoB,GAAG;IACjC,QAAQ,CAAC,EAAE,cAAc,CAAC;IAC1B,GAAG,CAAC,EAAE,SAAS,CAAC;IAChB,QAAQ,CAAC,EAAE,cAAc,CAAC;CAC3B,CAAC;AAEF,MAAM,MAAM,YAAY,CAAC,CAAC,SAAS,QAAQ,GAAG,QAAQ,IAAI;IACxD,QAAQ,EAAE,MAAM,CAAC;IACjB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,QAAQ,CAAC,EAAE,kBAAkB,CAAC;IAC9B,QAAQ,EAAE,CAAC,CAAC;IACZ,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,cAAc,CAAC,EAAE,oBAAoB,CAAC;CACvC,CAAC;AAEF,MAAM,MAAM,eAAe,CAAC,CAAC,SAAS,QAAQ,GAAG,QAAQ,IAAI,MAAM,CACjE,YAAY,CAAC,CAAC,CAAC,CAChB,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@talkpilot/core-db",
3
- "version": "1.1.19",
3
+ "version": "1.2.1",
4
4
  "description": "Core database package for centralized connections and ORM integration.",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
@@ -70,6 +70,87 @@ describe("db.clientsConfig", () => {
70
70
  expect(result).toBeNull();
71
71
  });
72
72
 
73
+ it("given moked_106 with both toolsPrompts when saved and retrieved then both prompts are persisted", async () => {
74
+ // Given
75
+ const clientId = "tools-prompts-both";
76
+ const clientConfig = createClientConfig({
77
+ clientId,
78
+ products: {
79
+ municipal: {
80
+ cityName: "ashdod",
81
+ timezone: "Asia/Jerusalem",
82
+ moked_106: {
83
+ toolsPrompts: {
84
+ findSubjectsSystemPrompt: "Custom subjects prompt",
85
+ findStreetsSystemPrompt: "Custom streets prompt",
86
+ },
87
+ },
88
+ },
89
+ },
90
+ });
91
+
92
+ // When
93
+ await createClientConfigDoc(clientConfig);
94
+ const result = await getClientConfig(clientId);
95
+
96
+ // Then
97
+ expect(result?.products.municipal?.moked_106?.toolsPrompts).toMatchObject({
98
+ findSubjectsSystemPrompt: "Custom subjects prompt",
99
+ findStreetsSystemPrompt: "Custom streets prompt",
100
+ });
101
+ });
102
+
103
+ it("given moked_106 with findSubjectsSystemPrompt only when saved and retrieved then findStreetsSystemPrompt is undefined", async () => {
104
+ // Given
105
+ const clientId = "tools-prompts-subjects-only";
106
+ const clientConfig = createClientConfig({
107
+ clientId,
108
+ products: {
109
+ municipal: {
110
+ cityName: "ashdod",
111
+ timezone: "Asia/Jerusalem",
112
+ moked_106: {
113
+ toolsPrompts: {
114
+ findSubjectsSystemPrompt: "Subjects only prompt",
115
+ },
116
+ },
117
+ },
118
+ },
119
+ });
120
+
121
+ // When
122
+ await createClientConfigDoc(clientConfig);
123
+ const result = await getClientConfig(clientId);
124
+
125
+ // Then
126
+ expect(result?.products.municipal?.moked_106?.toolsPrompts?.findSubjectsSystemPrompt).toBe("Subjects only prompt");
127
+ expect(result?.products.municipal?.moked_106?.toolsPrompts?.findStreetsSystemPrompt).toBeUndefined();
128
+ });
129
+
130
+ it("given moked_106 without toolsPrompts when saved and retrieved then toolsPrompts is undefined", async () => {
131
+ // Given
132
+ const clientId = "tools-prompts-absent";
133
+ const clientConfig = createClientConfig({
134
+ clientId,
135
+ products: {
136
+ municipal: {
137
+ cityName: "ashdod",
138
+ timezone: "Asia/Jerusalem",
139
+ moked_106: {
140
+ avoidSaveTickets: true,
141
+ },
142
+ },
143
+ },
144
+ });
145
+
146
+ // When
147
+ await createClientConfigDoc(clientConfig);
148
+ const result = await getClientConfig(clientId);
149
+
150
+ // Then
151
+ expect(result?.products.municipal?.moked_106?.toolsPrompts).toBeUndefined();
152
+ });
153
+
73
154
  it("should support communications config", async () => {
74
155
  const clientId = "communications-test";
75
156
  const clientConfig = createClientConfig({
@@ -1,5 +1,9 @@
1
1
  import { WithId } from "mongodb";
2
2
 
3
+ // ---------------------------------------------------------------------------
4
+ // Moked106 (MIS)
5
+ // ---------------------------------------------------------------------------
6
+
3
7
  export type InitiateCallForShortSlaConfig = {
4
8
  active: boolean;
5
9
  max_hours: number;
@@ -7,13 +11,22 @@ export type InitiateCallForShortSlaConfig = {
7
11
  flow_id?: string | string[];
8
12
  };
9
13
 
14
+ /** Per-tool LLM system prompt overrides. Falls back to hardcoded defaults when absent. */
15
+ export type Moked106ToolPrompts = {
16
+ findSubjectsSystemPrompt?: string;
17
+ findStreetsSystemPrompt?: string;
18
+ };
19
+
20
+ /** Feature flags and behavior config for the moked_106 municipal call-center product. */
10
21
  export type Moked106Config = {
11
22
  initiate_call_for_short_sla?: InitiateCallForShortSlaConfig;
12
23
  avoidSaveTickets?: boolean;
13
24
  withUploadImagesSms?: boolean;
14
25
  withNeedAttentionCalls?: boolean;
26
+ toolsPrompts?: Moked106ToolPrompts;
15
27
  };
16
28
 
29
+ /** Product config for the MIS */
17
30
  export type MunicipalProduct = {
18
31
  moked_106?: Moked106Config;
19
32
  cityName: string;
@@ -24,15 +37,18 @@ export type MunicipalProduct = {
24
37
  websiteUrl?: string;
25
38
  isProductionReady?: boolean;
26
39
  municipalDisplayName?: string;
27
- findSubjectsSystemPrompt?: string;
28
- findStreetsSystemPrompt?: string;
29
40
  };
30
41
 
42
+ // ---------------------------------------------------------------------------
43
+ // WebsiteTalk
44
+ // ---------------------------------------------------------------------------
45
+
31
46
  export type WebsiteTalkScheduler = {
32
47
  type: "cron";
33
48
  schedule: string;
34
49
  };
35
50
 
51
+ /** Product config for the websiteTalk */
36
52
  export type WebsiteTalkProduct = {
37
53
  logoUrl: string;
38
54
  companyName: string;
@@ -42,13 +58,11 @@ export type WebsiteTalkProduct = {
42
58
  scheduler?: WebsiteTalkScheduler;
43
59
  };
44
60
 
45
- export type Products = {
46
- municipal?: MunicipalProduct;
47
- clinics?: ClinicsProduct;
48
- websiteTalk?: WebsiteTalkProduct;
49
- [key: string]: unknown;
50
- };
61
+ // ---------------------------------------------------------------------------
62
+ // Clinics
63
+ // ---------------------------------------------------------------------------
51
64
 
65
+ /** Product config for the clinics scheduling integration. */
52
66
  export type ClinicsProduct = {
53
67
  api_key_secret_name: string;
54
68
  base_api_url: string;
@@ -56,6 +70,17 @@ export type ClinicsProduct = {
56
70
  description?: string;
57
71
  };
58
72
 
73
+ // ---------------------------------------------------------------------------
74
+ // Top Level Client config
75
+ // ---------------------------------------------------------------------------
76
+
77
+ export type Products = {
78
+ municipal?: MunicipalProduct;
79
+ clinics?: ClinicsProduct;
80
+ websiteTalk?: WebsiteTalkProduct;
81
+ [key: string]: unknown;
82
+ };
83
+
59
84
  export type ClientLanguageName =
60
85
  | "Hebrew"
61
86
  | "English"