@qcobro/common 1.46.0 → 1.46.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.
@@ -1,20 +1,29 @@
1
1
  import { z } from "zod";
2
2
  /**
3
3
  * The structured analysis an LLM must return for a gestión transcript. Mirrors the
4
- * `ai*` fields on `AccountContactLog`; text fields are written in the call's language,
5
- * `aiSentiment` is always one of the fixed enum values.
4
+ * `ai*` fields on `AccountContactLog`, all of which are nullable columns.
5
+ *
6
+ * `aiSummary` is the one required field: every gestión that reaches the generator has a
7
+ * non-empty transcript, the model can always summarize it, and downstream it doubles as
8
+ * the "already analyzed" cache marker (`generateGestionInsight`). The other four are
9
+ * `.nullable()` because a real conversation often does not yield them — no reason for the
10
+ * debt is ever stated, the call never reaches a result, no next step is implied, and a
11
+ * one-sided contact (voicemail, bounced thread) carries no sentiment. The model returns
12
+ * `null` for those, matching the DB columns and every consumer (which already guard).
13
+ * Text fields are written in the call's language; `aiSentiment`, when present, is one of
14
+ * the fixed enum values.
6
15
  */
7
16
  export declare const gestionInsightSchema: z.ZodObject<{
8
17
  aiSummary: z.ZodString;
9
- aiSentiment: z.ZodEnum<{
18
+ aiSentiment: z.ZodNullable<z.ZodEnum<{
10
19
  POSITIVE: "POSITIVE";
11
20
  NEUTRAL: "NEUTRAL";
12
21
  NEGATIVE: "NEGATIVE";
13
22
  HOSTILE: "HOSTILE";
14
- }>;
15
- aiDebtReason: z.ZodString;
16
- aiResult: z.ZodString;
17
- aiNextStep: z.ZodString;
23
+ }>>;
24
+ aiDebtReason: z.ZodNullable<z.ZodString>;
25
+ aiResult: z.ZodNullable<z.ZodString>;
26
+ aiNextStep: z.ZodNullable<z.ZodString>;
18
27
  }, z.core.$strip>;
19
28
  export type GestionInsight = z.infer<typeof gestionInsightSchema>;
20
29
  /** Input to the generate-insight operation — the gestión (contact-log) id. */
@@ -1 +1 @@
1
- {"version":3,"file":"insight.d.ts","sourceRoot":"","sources":["../../src/schemas/insight.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAGxB;;;;GAIG;AACH,eAAO,MAAM,oBAAoB;;;;;;;;;;;iBAM/B,CAAC;AACH,MAAM,MAAM,cAAc,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,oBAAoB,CAAC,CAAC;AAElE,8EAA8E;AAC9E,eAAO,MAAM,0BAA0B;;iBAAsC,CAAC;AAC9E,MAAM,MAAM,oBAAoB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,0BAA0B,CAAC,CAAC"}
1
+ {"version":3,"file":"insight.d.ts","sourceRoot":"","sources":["../../src/schemas/insight.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAGxB;;;;;;;;;;;;;GAaG;AACH,eAAO,MAAM,oBAAoB;;;;;;;;;;;iBAM/B,CAAC;AACH,MAAM,MAAM,cAAc,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,oBAAoB,CAAC,CAAC;AAElE,8EAA8E;AAC9E,eAAO,MAAM,0BAA0B;;iBAAsC,CAAC;AAC9E,MAAM,MAAM,oBAAoB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,0BAA0B,CAAC,CAAC"}
@@ -2,15 +2,24 @@ import { z } from "zod";
2
2
  import { aiSentimentSchema } from "./contactLog.js";
3
3
  /**
4
4
  * The structured analysis an LLM must return for a gestión transcript. Mirrors the
5
- * `ai*` fields on `AccountContactLog`; text fields are written in the call's language,
6
- * `aiSentiment` is always one of the fixed enum values.
5
+ * `ai*` fields on `AccountContactLog`, all of which are nullable columns.
6
+ *
7
+ * `aiSummary` is the one required field: every gestión that reaches the generator has a
8
+ * non-empty transcript, the model can always summarize it, and downstream it doubles as
9
+ * the "already analyzed" cache marker (`generateGestionInsight`). The other four are
10
+ * `.nullable()` because a real conversation often does not yield them — no reason for the
11
+ * debt is ever stated, the call never reaches a result, no next step is implied, and a
12
+ * one-sided contact (voicemail, bounced thread) carries no sentiment. The model returns
13
+ * `null` for those, matching the DB columns and every consumer (which already guard).
14
+ * Text fields are written in the call's language; `aiSentiment`, when present, is one of
15
+ * the fixed enum values.
7
16
  */
8
17
  export const gestionInsightSchema = z.object({
9
18
  aiSummary: z.string().min(1),
10
- aiSentiment: aiSentimentSchema,
11
- aiDebtReason: z.string().min(1),
12
- aiResult: z.string().min(1),
13
- aiNextStep: z.string().min(1)
19
+ aiSentiment: aiSentimentSchema.nullable(),
20
+ aiDebtReason: z.string().min(1).nullable(),
21
+ aiResult: z.string().min(1).nullable(),
22
+ aiNextStep: z.string().min(1).nullable()
14
23
  });
15
24
  /** Input to the generate-insight operation — the gestión (contact-log) id. */
16
25
  export const generateInsightInputSchema = z.object({ id: z.string().min(1) });
@@ -1 +1 @@
1
- {"version":3,"file":"insight.js","sourceRoot":"","sources":["../../src/schemas/insight.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,iBAAiB,EAAE,MAAM,iBAAiB,CAAC;AAEpD;;;;GAIG;AACH,MAAM,CAAC,MAAM,oBAAoB,GAAG,CAAC,CAAC,MAAM,CAAC;IAC3C,SAAS,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC;IAC5B,WAAW,EAAE,iBAAiB;IAC9B,YAAY,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC;IAC/B,QAAQ,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC;IAC3B,UAAU,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC;CAC9B,CAAC,CAAC;AAGH,8EAA8E;AAC9E,MAAM,CAAC,MAAM,0BAA0B,GAAG,CAAC,CAAC,MAAM,CAAC,EAAE,EAAE,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC"}
1
+ {"version":3,"file":"insight.js","sourceRoot":"","sources":["../../src/schemas/insight.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,iBAAiB,EAAE,MAAM,iBAAiB,CAAC;AAEpD;;;;;;;;;;;;;GAaG;AACH,MAAM,CAAC,MAAM,oBAAoB,GAAG,CAAC,CAAC,MAAM,CAAC;IAC3C,SAAS,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC;IAC5B,WAAW,EAAE,iBAAiB,CAAC,QAAQ,EAAE;IACzC,YAAY,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,QAAQ,EAAE;IAC1C,QAAQ,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,QAAQ,EAAE;IACtC,UAAU,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,QAAQ,EAAE;CACzC,CAAC,CAAC;AAGH,8EAA8E;AAC9E,MAAM,CAAC,MAAM,0BAA0B,GAAG,CAAC,CAAC,MAAM,CAAC,EAAE,EAAE,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@qcobro/common",
3
- "version": "1.46.0",
3
+ "version": "1.46.1",
4
4
  "type": "module",
5
5
  "files": [
6
6
  "dist"