@agifyai/leadify-mcp 9.7.1 → 9.7.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/README.md
CHANGED
|
@@ -643,3 +643,14 @@ avec l'application, ses écritures enregistrées et sa vérification visuelle.
|
|
|
643
643
|
La publication suit `publish.yml` après fusion : registre npm, archive de version
|
|
644
644
|
explicite et découverte dans un processus neuf doivent être vérifiés séparément.
|
|
645
645
|
Une conversation Louise déjà ouverte peut conserver un ancien catalogue.
|
|
646
|
+
|
|
647
|
+
La décision accepte aussi `agent_cycle_id`, facultatif : transmettre uniquement
|
|
648
|
+
l’identifiant réel du cycle courant (1 à 200 caractères, sans espaces ni caractères
|
|
649
|
+
de contrôle). Il devient `agentCycleId` côté serveur ; absent, il reste absent.
|
|
650
|
+
Les lectures des messages conservent `decision.agentCycleId` et, dans chaque
|
|
651
|
+
tentative, `triggerRunId`, `reconciliationRunId` et `reconciliationErrorCode`.
|
|
652
|
+
Une valeur absente ou nulle ne prouve aucune exécution ; ces références ne
|
|
653
|
+
changent pas l’état du message et n’exposent pas l’enveloppe fournisseur brute.
|
|
654
|
+
|
|
655
|
+
Pour un signal daté, `signal_upsert.date_evidence` fournit le passage source qui
|
|
656
|
+
établit `date`. Le serveur conserve cette preuve ; une date sans preuve est refusée.
|
|
@@ -40,10 +40,10 @@ export function projectOutreachMessage(data) {
|
|
|
40
40
|
const m = object(data);
|
|
41
41
|
const result = pick(m, ["id", "organizationId", "programId", "decisionId", "senderId", "conversationId", "channel", "action", "recipient", "subject", "body", "expectedInboundId", "providerThreadId", "accountKey", "technicalParts", "state", "revision", "reasonCode", "expiresAt", "notBefore", "sentAt", "providerMessageId", "createdAt", "updatedAt"]);
|
|
42
42
|
if (m.decision)
|
|
43
|
-
result.decision = pick(m.decision, ["id", "personId", "leadId", "requestKey", "purpose", "reason", "sources", "contextVersion", "authorizationRevision", "contextReadAt", "receipt", "createdAt"]);
|
|
43
|
+
result.decision = pick(m.decision, ["id", "agentCycleId", "personId", "leadId", "requestKey", "purpose", "reason", "sources", "contextVersion", "authorizationRevision", "contextReadAt", "receipt", "createdAt"]);
|
|
44
44
|
if (Array.isArray(m.attempts))
|
|
45
45
|
result.attempts = m.attempts.map(a => {
|
|
46
|
-
const attempt = pick(a, ["id", "ordinal", "startedAt", "providerBarrierAt", "finishedAt", "outcome", "providerMessageId", "errorCode", "lastReconciledAt", "reconciliationResult"]);
|
|
46
|
+
const attempt = pick(a, ["id", "ordinal", "startedAt", "providerBarrierAt", "finishedAt", "outcome", "providerMessageId", "errorCode", "lastReconciledAt", "reconciliationResult", "triggerRunId", "reconciliationRunId", "reconciliationErrorCode"]);
|
|
47
47
|
const receipt = object(object(object(a).providerRequest).receipt);
|
|
48
48
|
const safeReceipt = Object.fromEntries([["providerMessageId", receipt.id], ["providerThreadId", receipt.threadId]].filter(([, value]) => typeof value === "string"));
|
|
49
49
|
if (Object.keys(safeReceipt).length)
|
|
@@ -294,6 +294,7 @@ export declare const message: z.ZodEffects<z.ZodObject<{
|
|
|
294
294
|
};
|
|
295
295
|
}>;
|
|
296
296
|
export declare const decision: z.ZodEffects<z.ZodObject<{
|
|
297
|
+
agent_cycle_id: z.ZodOptional<z.ZodString>;
|
|
297
298
|
request_key: z.ZodString;
|
|
298
299
|
lead_id: z.ZodString;
|
|
299
300
|
person_id: z.ZodString;
|
|
@@ -493,6 +494,7 @@ export declare const decision: z.ZodEffects<z.ZodObject<{
|
|
|
493
494
|
unsubscribe: string;
|
|
494
495
|
};
|
|
495
496
|
}[];
|
|
497
|
+
agent_cycle_id?: string | undefined;
|
|
496
498
|
}, {
|
|
497
499
|
request_key: string;
|
|
498
500
|
lead_id: string;
|
|
@@ -535,6 +537,7 @@ export declare const decision: z.ZodEffects<z.ZodObject<{
|
|
|
535
537
|
unsubscribe: string;
|
|
536
538
|
};
|
|
537
539
|
}[];
|
|
540
|
+
agent_cycle_id?: string | undefined;
|
|
538
541
|
}>, {
|
|
539
542
|
request_key: string;
|
|
540
543
|
lead_id: string;
|
|
@@ -577,6 +580,7 @@ export declare const decision: z.ZodEffects<z.ZodObject<{
|
|
|
577
580
|
unsubscribe: string;
|
|
578
581
|
};
|
|
579
582
|
}[];
|
|
583
|
+
agent_cycle_id?: string | undefined;
|
|
580
584
|
}, {
|
|
581
585
|
request_key: string;
|
|
582
586
|
lead_id: string;
|
|
@@ -619,6 +623,7 @@ export declare const decision: z.ZodEffects<z.ZodObject<{
|
|
|
619
623
|
unsubscribe: string;
|
|
620
624
|
};
|
|
621
625
|
}[];
|
|
626
|
+
agent_cycle_id?: string | undefined;
|
|
622
627
|
}>;
|
|
623
628
|
export declare const querySchema: z.ZodObject<{
|
|
624
629
|
recipe: z.ZodOptional<z.ZodEnum<["never_contacted", "followup_due", "channel_gap", "replies_to_handle"]>>;
|
|
@@ -842,6 +847,7 @@ export declare const querySchema: z.ZodObject<{
|
|
|
842
847
|
}>;
|
|
843
848
|
export declare const submitSchema: z.ZodObject<{
|
|
844
849
|
decisions: z.ZodArray<z.ZodEffects<z.ZodObject<{
|
|
850
|
+
agent_cycle_id: z.ZodOptional<z.ZodString>;
|
|
845
851
|
request_key: z.ZodString;
|
|
846
852
|
lead_id: z.ZodString;
|
|
847
853
|
person_id: z.ZodString;
|
|
@@ -1041,6 +1047,7 @@ export declare const submitSchema: z.ZodObject<{
|
|
|
1041
1047
|
unsubscribe: string;
|
|
1042
1048
|
};
|
|
1043
1049
|
}[];
|
|
1050
|
+
agent_cycle_id?: string | undefined;
|
|
1044
1051
|
}, {
|
|
1045
1052
|
request_key: string;
|
|
1046
1053
|
lead_id: string;
|
|
@@ -1083,6 +1090,7 @@ export declare const submitSchema: z.ZodObject<{
|
|
|
1083
1090
|
unsubscribe: string;
|
|
1084
1091
|
};
|
|
1085
1092
|
}[];
|
|
1093
|
+
agent_cycle_id?: string | undefined;
|
|
1086
1094
|
}>, {
|
|
1087
1095
|
request_key: string;
|
|
1088
1096
|
lead_id: string;
|
|
@@ -1125,6 +1133,7 @@ export declare const submitSchema: z.ZodObject<{
|
|
|
1125
1133
|
unsubscribe: string;
|
|
1126
1134
|
};
|
|
1127
1135
|
}[];
|
|
1136
|
+
agent_cycle_id?: string | undefined;
|
|
1128
1137
|
}, {
|
|
1129
1138
|
request_key: string;
|
|
1130
1139
|
lead_id: string;
|
|
@@ -1167,6 +1176,7 @@ export declare const submitSchema: z.ZodObject<{
|
|
|
1167
1176
|
unsubscribe: string;
|
|
1168
1177
|
};
|
|
1169
1178
|
}[];
|
|
1179
|
+
agent_cycle_id?: string | undefined;
|
|
1170
1180
|
}>, "many">;
|
|
1171
1181
|
organization_id: z.ZodString;
|
|
1172
1182
|
program_id: z.ZodString;
|
|
@@ -1215,6 +1225,7 @@ export declare const submitSchema: z.ZodObject<{
|
|
|
1215
1225
|
unsubscribe: string;
|
|
1216
1226
|
};
|
|
1217
1227
|
}[];
|
|
1228
|
+
agent_cycle_id?: string | undefined;
|
|
1218
1229
|
}[];
|
|
1219
1230
|
}, {
|
|
1220
1231
|
organization_id: string;
|
|
@@ -1261,11 +1272,12 @@ export declare const submitSchema: z.ZodObject<{
|
|
|
1261
1272
|
unsubscribe: string;
|
|
1262
1273
|
};
|
|
1263
1274
|
}[];
|
|
1275
|
+
agent_cycle_id?: string | undefined;
|
|
1264
1276
|
}[];
|
|
1265
1277
|
}>;
|
|
1266
|
-
export declare const acknowledgeSchema: z.
|
|
1278
|
+
export declare const acknowledgeSchema: z.ZodObject<{
|
|
1267
1279
|
cursor: z.ZodString;
|
|
1268
|
-
receipts: z.ZodArray<z.ZodObject<{
|
|
1280
|
+
receipts: z.ZodEffects<z.ZodArray<z.ZodObject<{
|
|
1269
1281
|
change_id: z.ZodEffects<z.ZodString, string, string>;
|
|
1270
1282
|
status: z.ZodEnum<["PROCESSED", "DISMISSED"]>;
|
|
1271
1283
|
reason: z.ZodString;
|
|
@@ -1277,28 +1289,18 @@ export declare const acknowledgeSchema: z.ZodEffects<z.ZodObject<{
|
|
|
1277
1289
|
status: "PROCESSED" | "DISMISSED";
|
|
1278
1290
|
reason: string;
|
|
1279
1291
|
change_id: string;
|
|
1280
|
-
}>, "many"
|
|
1281
|
-
organization_id: z.ZodString;
|
|
1282
|
-
program_id: z.ZodString;
|
|
1283
|
-
}, "strict", z.ZodTypeAny, {
|
|
1284
|
-
cursor: string;
|
|
1285
|
-
organization_id: string;
|
|
1286
|
-
program_id: string;
|
|
1287
|
-
receipts: {
|
|
1292
|
+
}>, "many">, {
|
|
1288
1293
|
status: "PROCESSED" | "DISMISSED";
|
|
1289
1294
|
reason: string;
|
|
1290
1295
|
change_id: string;
|
|
1291
|
-
}[]
|
|
1292
|
-
}, {
|
|
1293
|
-
cursor: string;
|
|
1294
|
-
organization_id: string;
|
|
1295
|
-
program_id: string;
|
|
1296
|
-
receipts: {
|
|
1296
|
+
}[], {
|
|
1297
1297
|
status: "PROCESSED" | "DISMISSED";
|
|
1298
1298
|
reason: string;
|
|
1299
1299
|
change_id: string;
|
|
1300
|
-
}[]
|
|
1301
|
-
|
|
1300
|
+
}[]>;
|
|
1301
|
+
organization_id: z.ZodString;
|
|
1302
|
+
program_id: z.ZodString;
|
|
1303
|
+
}, "strict", z.ZodTypeAny, {
|
|
1302
1304
|
cursor: string;
|
|
1303
1305
|
organization_id: string;
|
|
1304
1306
|
program_id: string;
|
|
@@ -1391,4 +1393,5 @@ export declare function decisionBody(d: z.infer<typeof decision>): {
|
|
|
1391
1393
|
unsubscribe: string;
|
|
1392
1394
|
};
|
|
1393
1395
|
}[];
|
|
1396
|
+
agentCycleId?: string | undefined;
|
|
1394
1397
|
};
|
|
@@ -52,6 +52,7 @@ export const message = z.object({
|
|
|
52
52
|
issue(["body"], "Renseignez le texte du message.");
|
|
53
53
|
});
|
|
54
54
|
export const decision = z.object({
|
|
55
|
+
agent_cycle_id: z.string().min(1).max(200).regex(/^[^\s\u0000-\u001f\u007f]+$/).optional().describe("Exact existing agent cycle identifier; omit when unavailable, never invent one."),
|
|
55
56
|
request_key: z.string().min(1).max(200), lead_id: identifier, person_id: identifier,
|
|
56
57
|
purpose: z.enum(["FIRST_CONTACT", "FOLLOW_UP", "REPLY"]), reason: z.string().min(1).max(2000),
|
|
57
58
|
sources: z.array(z.object({ label: exactText.min(1), url: z.string().url().max(20000) }).strict()).max(20),
|
|
@@ -75,8 +76,8 @@ export const querySchema = z.object({ ...scope, recipe: z.enum(["never_contacted
|
|
|
75
76
|
export const submitSchema = z.object({ ...scope, decisions: z.array(decision).min(1).max(20) }).strict();
|
|
76
77
|
export const acknowledgeSchema = z.object({ ...scope, cursor: z.string().min(1).max(2000),
|
|
77
78
|
receipts: z.array(z.object({ change_id: z.string().regex(/^[1-9]\d{0,18}$/).refine(v => /^[1-9]\d{0,18}$/.test(v) && BigInt(v) <= 9223372036854775807n),
|
|
78
|
-
status: z.enum(["PROCESSED", "DISMISSED"]), reason: z.string().trim().min(1).max(2000) }).strict()).min(1).max(100),
|
|
79
|
-
}).strict()
|
|
79
|
+
status: z.enum(["PROCESSED", "DISMISSED"]), reason: z.string().trim().min(1).max(2000) }).strict()).min(1).max(100).refine(receipts => new Set(receipts.map(r => r.change_id)).size === receipts.length, "Chaque changement doit être indiqué une seule fois."),
|
|
80
|
+
}).strict();
|
|
80
81
|
export function queryBody(v) {
|
|
81
82
|
const f = v.filters;
|
|
82
83
|
return { recipe: v.recipe, limit: v.limit, cursor: v.cursor, filters: {
|
|
@@ -86,7 +87,7 @@ export function queryBody(v) {
|
|
|
86
87
|
} };
|
|
87
88
|
}
|
|
88
89
|
export function decisionBody(d) {
|
|
89
|
-
return { requestKey: d.request_key, leadId: d.lead_id, personId: d.person_id, purpose: d.purpose, reason: d.reason, sources: d.sources,
|
|
90
|
+
return { ...(d.agent_cycle_id !== undefined ? { agentCycleId: d.agent_cycle_id } : {}), requestKey: d.request_key, leadId: d.lead_id, personId: d.person_id, purpose: d.purpose, reason: d.reason, sources: d.sources,
|
|
90
91
|
context: { contractVersion: d.context.contract_version, contextVersion: d.context.context_version, factsVersion: d.context.facts_version,
|
|
91
92
|
readAt: d.context.read_at, versions: d.context.versions }, authorizationRevision: d.authorization_revision,
|
|
92
93
|
messages: d.messages.map(m => ({ channel: m.channel, action: m.action, senderId: m.sender_id, accountKey: m.account_key,
|
package/dist/tools/signals.js
CHANGED
|
@@ -87,7 +87,8 @@ export function registerSignalTools(server) {
|
|
|
87
87
|
.optional()
|
|
88
88
|
.describe("Date the business event actually occurred (≠ insertion date). Partial or full " +
|
|
89
89
|
"ISO 8601: 'YYYY' / 'YYYY-MM' / 'YYYY-MM-DD' / datetime. Use the finest " +
|
|
90
|
-
"precision you can reliably determine."),
|
|
90
|
+
"precision you can reliably determine. When provided, date_evidence is required."),
|
|
91
|
+
date_evidence: z.string().optional().describe("Source passage or factual evidence establishing the event date. Required and non-empty when date is provided; never infer a date from insertion time."),
|
|
91
92
|
source: z
|
|
92
93
|
.string()
|
|
93
94
|
.optional()
|
|
@@ -101,7 +102,7 @@ export function registerSignalTools(server) {
|
|
|
101
102
|
reason: reasonParam,
|
|
102
103
|
},
|
|
103
104
|
annotations: { idempotentHint: true },
|
|
104
|
-
}, async ({ id, lead_id, level, title, content, ai_summary, date, source, agent_source, source_url, reason, }) => {
|
|
105
|
+
}, async ({ id, lead_id, level, title, content, ai_summary, date, date_evidence, source, agent_source, source_url, reason, }) => {
|
|
105
106
|
const capError = capExceeded();
|
|
106
107
|
if (capError)
|
|
107
108
|
return capError;
|
|
@@ -121,6 +122,8 @@ export function registerSignalTools(server) {
|
|
|
121
122
|
body.aiSummary = ai_summary;
|
|
122
123
|
if (date !== undefined)
|
|
123
124
|
body.date = date;
|
|
125
|
+
if (date_evidence !== undefined)
|
|
126
|
+
body.dateEvidence = date_evidence;
|
|
124
127
|
if (source !== undefined)
|
|
125
128
|
body.source = source;
|
|
126
129
|
if (agent_source !== undefined)
|