@apotech-os/support-kit 7.0.1 → 8.0.0
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 +19 -16
- package/dist/{chunk-QCRCRNYE.js → chunk-2UHFKGMI.js} +22 -3
- package/dist/chunk-2UHFKGMI.js.map +1 -0
- package/dist/index.cjs +79 -141
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +81 -143
- package/dist/index.js.map +1 -1
- package/dist/ui/index.cjs +203 -143
- package/dist/ui/index.cjs.map +1 -1
- package/dist/ui/index.js +186 -145
- package/dist/ui/index.js.map +1 -1
- package/package.json +11 -11
- package/dist/chunk-QCRCRNYE.js.map +0 -1
package/dist/ui/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { EVALUATION_VERDICTS, WHATSAPP_MODES, validateSettings, AGENT_GUARDRAILS, toCategory, DEFAULT_MIN_CONFIDENCE, DEFAULT_ESCALATION_ENABLED, toAuditTags, toAgent, toGeneratedResponse, toResponseComparison, toTriageDecision, isGeneratedResponseStatus, isInvalidatableStatus, toCategoryGroup, NODE_NAMES, settingsToProfile, hasNoDraftNode, outcomeTags, DEFAULT_LLM_PROVIDER, computeWordDiff, requiresFollowup, isSendableVerdict, DEFAULT_MAX_TOOL_CALLS } from '../chunk-
|
|
1
|
+
import { EVALUATION_VERDICTS, WHATSAPP_MODES, validateSettings, AGENT_GUARDRAILS, toCategory, DEFAULT_MIN_CONFIDENCE, DEFAULT_ESCALATION_ENABLED, toAuditTags, toAgent, toGeneratedResponse, toResponseComparison, toTriageDecision, isGeneratedResponseStatus, isInvalidatableStatus, toCategoryGroup, followupIntegrationName, FOLLOWUP_WEBHOOK_TRIGGER, followupWebhookPath, FOLLOWUP_WEBHOOK_FORM, NODE_NAMES, settingsToProfile, hasNoDraftNode, outcomeTags, DEFAULT_LLM_PROVIDER, computeWordDiff, requiresFollowup, isSendableVerdict, DEFAULT_MAX_TOOL_CALLS } from '../chunk-2UHFKGMI.js';
|
|
2
2
|
import { forwardRef, useState, useMemo, useEffect, useRef, useCallback, useId } from 'react';
|
|
3
3
|
import { Textarea, cn, useAppContext, useAppSettings, DateRangeCompare, Link, Card, CardHeader, CardTitle, CardContent, AreaChart, StackedBarChart, Badge, useAppApi, useToast, Button, Select, DataTable, Spinner, Switch, Input, Checkbox, comparisonRange, SidePanel, Modal, Tooltip, buttonVariants, AppInvokeError, CopyButton, relativeDelta, Table, TableHeader, TableRow, TableHead, TableBody, TableCell, downloadBlob } from '@apotech-os/ui-sdk';
|
|
4
4
|
import { jsxs, jsx, Fragment } from 'react/jsx-runtime';
|
|
@@ -4001,156 +4001,85 @@ function SourceViewField({ views, value, onChange, disabled }) {
|
|
|
4001
4001
|
}
|
|
4002
4002
|
);
|
|
4003
4003
|
}
|
|
4004
|
-
var STATUS_BADGE = {
|
|
4005
|
-
passed: { label: "OK", variant: "success" },
|
|
4006
|
-
stopped: { label: "Arr\xEAt", variant: "danger" },
|
|
4007
|
-
// A pre-gate that could not read its field. Never shown by the diagnostic
|
|
4008
|
-
// (it evaluates no payload) but rendered honestly if it ever appears, rather
|
|
4009
|
-
// than falling through to a blank badge.
|
|
4010
|
-
muted: { label: "Muet", variant: "warning" },
|
|
4011
|
-
skipped: { label: "Non \xE9valu\xE9", variant: "neutral" }
|
|
4012
|
-
};
|
|
4013
4004
|
function FollowupWebhookCard({ scopeTag, onScopeTagChange, canWrite }) {
|
|
4014
|
-
const
|
|
4015
|
-
const toast = useToast();
|
|
4005
|
+
const { appSlug } = useAppContext();
|
|
4016
4006
|
const scopeId = useId();
|
|
4017
|
-
|
|
4018
|
-
|
|
4019
|
-
|
|
4020
|
-
|
|
4021
|
-
|
|
4022
|
-
|
|
4023
|
-
|
|
4024
|
-
|
|
4025
|
-
|
|
4026
|
-
|
|
4027
|
-
|
|
4028
|
-
|
|
4029
|
-
|
|
4030
|
-
|
|
4031
|
-
|
|
4032
|
-
|
|
4033
|
-
|
|
4034
|
-
|
|
4035
|
-
|
|
4036
|
-
|
|
4037
|
-
|
|
4038
|
-
|
|
4039
|
-
|
|
4040
|
-
|
|
4041
|
-
}
|
|
4042
|
-
|
|
4043
|
-
|
|
4044
|
-
|
|
4045
|
-
|
|
4046
|
-
|
|
4047
|
-
|
|
4048
|
-
return /* @__PURE__ */ jsxs(Card, { id: "webhook-suite", children: [
|
|
4049
|
-
/* @__PURE__ */ jsxs(CardContent, { className: "space-y-4 p-4", children: [
|
|
4050
|
-
/* @__PURE__ */ jsxs("div", { children: [
|
|
4051
|
-
/* @__PURE__ */ jsx("h2", { className: "font-medium", children: "R\xE9ponses aux messages suivants" }),
|
|
4052
|
-
/* @__PURE__ */ jsx("p", { className: "text-xs text-muted-foreground", children: "Quand un client r\xE9pond sur un ticket d\xE9j\xE0 trait\xE9, l'agent peut g\xE9n\xE9rer une nouvelle r\xE9ponse. Chaque cat\xE9gorie d\xE9cide si elle suit le fil (page Cat\xE9gories)." })
|
|
4053
|
-
] }),
|
|
4054
|
-
/* @__PURE__ */ jsxs("div", { children: [
|
|
4055
|
-
/* @__PURE__ */ jsx("label", { htmlFor: scopeId, className: "mb-1 block text-sm font-medium", children: "Tag de p\xE9rim\xE8tre webhook" }),
|
|
4056
|
-
/* @__PURE__ */ jsx(
|
|
4057
|
-
Input,
|
|
4058
|
-
{
|
|
4059
|
-
id: scopeId,
|
|
4060
|
-
value: scopeTag,
|
|
4061
|
-
onChange: (e) => onScopeTagChange(e.target.value),
|
|
4062
|
-
placeholder: "wai/triaged",
|
|
4063
|
-
disabled: !canWrite
|
|
4064
|
-
}
|
|
4065
|
-
),
|
|
4066
|
-
/* @__PURE__ */ jsxs("p", { className: "mt-1 text-xs text-muted-foreground", children: [
|
|
4067
|
-
"Le ticket doit d\xE9j\xE0 porter ce tag pour qu'un message suivant soit trait\xE9 \u2014 typiquement le tag \xAB trait\xE9 \xBB pos\xE9 par le premier passage. ",
|
|
4068
|
-
/* @__PURE__ */ jsx("strong", { children: "Vide = aucun message suivant trait\xE9" }),
|
|
4069
|
-
" (c'est aussi le kill-switch). Deux apps sur le m\xEAme compte Gorgias doivent y mettre des valeurs ",
|
|
4070
|
-
/* @__PURE__ */ jsx("strong", { children: "distinctes" }),
|
|
4071
|
-
", sinon chacune r\xE9pondrait sur les tickets de l'autre."
|
|
4072
|
-
] })
|
|
4007
|
+
return /* @__PURE__ */ jsx(Card, { id: "webhook-suite", children: /* @__PURE__ */ jsxs(CardContent, { className: "space-y-4 p-4", children: [
|
|
4008
|
+
/* @__PURE__ */ jsxs("div", { children: [
|
|
4009
|
+
/* @__PURE__ */ jsx("h2", { className: "font-medium", children: "R\xE9ponses aux messages suivants" }),
|
|
4010
|
+
/* @__PURE__ */ jsx("p", { className: "text-xs text-muted-foreground", children: "Quand un client r\xE9pond sur un ticket d\xE9j\xE0 trait\xE9, l'agent peut g\xE9n\xE9rer une nouvelle r\xE9ponse. Chaque cat\xE9gorie d\xE9cide si elle suit le fil (page Cat\xE9gories)." })
|
|
4011
|
+
] }),
|
|
4012
|
+
/* @__PURE__ */ jsxs("div", { children: [
|
|
4013
|
+
/* @__PURE__ */ jsx("label", { htmlFor: scopeId, className: "mb-1 block text-sm font-medium", children: "Tag de p\xE9rim\xE8tre webhook" }),
|
|
4014
|
+
/* @__PURE__ */ jsx(
|
|
4015
|
+
Input,
|
|
4016
|
+
{
|
|
4017
|
+
id: scopeId,
|
|
4018
|
+
value: scopeTag,
|
|
4019
|
+
onChange: (e) => onScopeTagChange(e.target.value),
|
|
4020
|
+
placeholder: "wai/triaged",
|
|
4021
|
+
disabled: !canWrite
|
|
4022
|
+
}
|
|
4023
|
+
),
|
|
4024
|
+
/* @__PURE__ */ jsxs("p", { className: "mt-1 text-xs text-muted-foreground", children: [
|
|
4025
|
+
"Le ticket doit d\xE9j\xE0 porter ce tag pour qu'un message suivant soit trait\xE9 \u2014 typiquement le tag \xAB trait\xE9 \xBB pos\xE9 par le premier passage. ",
|
|
4026
|
+
/* @__PURE__ */ jsx("strong", { children: "Vide = aucun message suivant trait\xE9" }),
|
|
4027
|
+
" (c'est aussi le kill-switch). Deux apps sur le m\xEAme compte Gorgias doivent y mettre des valeurs ",
|
|
4028
|
+
/* @__PURE__ */ jsx("strong", { children: "distinctes" }),
|
|
4029
|
+
", sinon chacune r\xE9pondrait sur les tickets de l'autre."
|
|
4030
|
+
] })
|
|
4031
|
+
] }),
|
|
4032
|
+
/* @__PURE__ */ jsxs("div", { className: "space-y-2 border-t pt-4", children: [
|
|
4033
|
+
/* @__PURE__ */ jsx("p", { className: "text-sm font-medium", children: "Int\xE9gration Gorgias (installation manuelle)" }),
|
|
4034
|
+
/* @__PURE__ */ jsxs("p", { className: "text-xs text-muted-foreground", children: [
|
|
4035
|
+
"\xC0 cr\xE9er une fois dans Gorgias, sous ",
|
|
4036
|
+
/* @__PURE__ */ jsx("em", { children: "Settings \u203A Integrations \u203A HTTP" }),
|
|
4037
|
+
". Rien n'est install\xE9 depuis cette page : l'app n'\xE9crit rien sur le compte Gorgias."
|
|
4073
4038
|
] }),
|
|
4074
|
-
/* @__PURE__ */ jsxs("
|
|
4075
|
-
/* @__PURE__ */ jsx(
|
|
4076
|
-
/* @__PURE__ */
|
|
4077
|
-
|
|
4078
|
-
|
|
4079
|
-
"
|
|
4080
|
-
|
|
4081
|
-
/* @__PURE__ */ jsx("code", { children: "wopilo_app_\u2026" }),
|
|
4082
|
-
"), puis installez l'int\xE9gration. L'op\xE9ration est idempotente : re-cliquer la met \xE0 jour."
|
|
4039
|
+
/* @__PURE__ */ jsxs("dl", { className: "space-y-1 text-xs", children: [
|
|
4040
|
+
/* @__PURE__ */ jsx(RecipeRow, { label: "Nom", children: followupIntegrationName(appSlug) }),
|
|
4041
|
+
/* @__PURE__ */ jsx(RecipeRow, { label: "D\xE9clencheur", children: FOLLOWUP_WEBHOOK_TRIGGER }),
|
|
4042
|
+
/* @__PURE__ */ jsx(RecipeRow, { label: "M\xE9thode", children: "POST" }),
|
|
4043
|
+
/* @__PURE__ */ jsxs(RecipeRow, { label: "URL", children: [
|
|
4044
|
+
"<PUBLIC_BASE_URL>",
|
|
4045
|
+
followupWebhookPath(appSlug)
|
|
4083
4046
|
] }),
|
|
4084
|
-
|
|
4085
|
-
|
|
4086
|
-
|
|
4087
|
-
"
|
|
4088
|
-
" ",
|
|
4089
|
-
/* @__PURE__ */ jsx("code", { children: setup.url }),
|
|
4090
|
-
"."
|
|
4047
|
+
/* @__PURE__ */ jsxs(RecipeRow, { label: "En-t\xEAte", children: [
|
|
4048
|
+
"Authorization: Bearer <cl\xE9 d'application ",
|
|
4049
|
+
/* @__PURE__ */ jsx("code", { children: "wopilo_app_\u2026" }),
|
|
4050
|
+
">"
|
|
4091
4051
|
] })
|
|
4092
4052
|
] }),
|
|
4093
|
-
/* @__PURE__ */ jsxs("
|
|
4094
|
-
/* @__PURE__ */ jsx("
|
|
4095
|
-
|
|
4096
|
-
|
|
4097
|
-
|
|
4098
|
-
|
|
4099
|
-
|
|
4100
|
-
|
|
4101
|
-
|
|
4102
|
-
|
|
4103
|
-
|
|
4104
|
-
|
|
4105
|
-
|
|
4106
|
-
|
|
4107
|
-
|
|
4108
|
-
|
|
4109
|
-
/* @__PURE__ */ jsx("
|
|
4110
|
-
|
|
4111
|
-
|
|
4112
|
-
|
|
4113
|
-
] }),
|
|
4114
|
-
|
|
4115
|
-
"Traitement d\xE9clench\xE9. Run \xE0 suivre : ",
|
|
4116
|
-
/* @__PURE__ */ jsx("code", { children: test.runId }),
|
|
4117
|
-
"."
|
|
4118
|
-
] }),
|
|
4119
|
-
test?.mode === "diagnostic" && /* @__PURE__ */ jsxs("div", { className: "space-y-2", children: [
|
|
4120
|
-
/* @__PURE__ */ jsx("p", { className: "text-sm font-medium", children: test.stoppedAt === null ? `Ticket ${test.ticketId} : il aurait re\xE7u une r\xE9ponse de suite.` : `Ticket ${test.ticketId} : arr\xEAt en ${test.stoppedAt}.` }),
|
|
4121
|
-
/* @__PURE__ */ jsx("ul", { className: "space-y-1", children: test.gates.map((gate) => /* @__PURE__ */ jsxs("li", { className: "flex items-start gap-2 text-xs", children: [
|
|
4122
|
-
/* @__PURE__ */ jsx(Badge, { variant: STATUS_BADGE[gate.status].variant, children: STATUS_BADGE[gate.status].label }),
|
|
4123
|
-
/* @__PURE__ */ jsxs("span", { children: [
|
|
4124
|
-
/* @__PURE__ */ jsxs("span", { className: "font-medium", children: [
|
|
4125
|
-
gate.gate,
|
|
4126
|
-
" \u2014 ",
|
|
4127
|
-
gate.label
|
|
4128
|
-
] }),
|
|
4129
|
-
/* @__PURE__ */ jsx("br", {}),
|
|
4130
|
-
/* @__PURE__ */ jsx("span", { className: "text-muted-foreground", children: gate.detail })
|
|
4131
|
-
] })
|
|
4132
|
-
] }, gate.gate)) })
|
|
4133
|
-
] })
|
|
4053
|
+
/* @__PURE__ */ jsxs("p", { className: "text-xs text-muted-foreground", children: [
|
|
4054
|
+
/* @__PURE__ */ jsx("code", { children: "PUBLIC_BASE_URL" }),
|
|
4055
|
+
" est l'origine publique de l'",
|
|
4056
|
+
/* @__PURE__ */ jsx("strong", { children: "API" }),
|
|
4057
|
+
" \u2014 pas forc\xE9ment celle de cette interface, que l'instance peut servir depuis un autre domaine (",
|
|
4058
|
+
/* @__PURE__ */ jsx("code", { children: "WEB_APP_URL" }),
|
|
4059
|
+
"). En cas de doute, c'est la valeur r\xE9gl\xE9e c\xF4t\xE9 instance qui fait foi : une URL construite sur la mauvaise origine renvoie 404 \xE0 chaque appel Gorgias, sans message d'erreur nulle part."
|
|
4060
|
+
] }),
|
|
4061
|
+
/* @__PURE__ */ jsxs("p", { className: "text-xs text-muted-foreground", children: [
|
|
4062
|
+
"La cl\xE9 est une cl\xE9 d'application de cette app, cr\xE9\xE9e dans la plateforme puis coll\xE9e telle quelle dans l'en-t\xEAte. Elle porte le r\xF4le manifeste complet de l'app (voir",
|
|
4063
|
+
" ",
|
|
4064
|
+
/* @__PURE__ */ jsx("code", { children: "docs/app-platform/gorgias-callback-authentication.md" }),
|
|
4065
|
+
" \xA75)."
|
|
4066
|
+
] }),
|
|
4067
|
+
/* @__PURE__ */ jsxs("div", { children: [
|
|
4068
|
+
/* @__PURE__ */ jsx("p", { className: "mb-1 text-xs font-medium", children: "Champs du corps (onglet \xAB Body \xBB, un par ligne)" }),
|
|
4069
|
+
/* @__PURE__ */ jsx("ul", { className: "space-y-0.5 font-mono text-xs text-muted-foreground", children: Object.entries(FOLLOWUP_WEBHOOK_FORM).map(([key, value]) => /* @__PURE__ */ jsxs("li", { children: [
|
|
4070
|
+
key,
|
|
4071
|
+
" = ",
|
|
4072
|
+
value
|
|
4073
|
+
] }, key)) }),
|
|
4074
|
+
/* @__PURE__ */ jsx("p", { className: "mt-1 text-xs text-muted-foreground", children: "Les quatre derniers champs ne sont pas document\xE9s par Gorgias : s'ils ne se r\xE9solvent pas, le traitement relit simplement le ticket et continue. Rien ne casse s'ils manquent." })
|
|
4134
4075
|
] })
|
|
4135
|
-
] })
|
|
4136
|
-
|
|
4137
|
-
|
|
4138
|
-
|
|
4139
|
-
|
|
4140
|
-
|
|
4141
|
-
|
|
4142
|
-
ticket.trim(),
|
|
4143
|
-
" va \xEAtre trait\xE9 comme un vrai message suivant : g\xE9n\xE9ration, garde-fous, et",
|
|
4144
|
-
" ",
|
|
4145
|
-
/* @__PURE__ */ jsx("strong", { children: "envoi r\xE9el au client" }),
|
|
4146
|
-
" si sa cat\xE9gorie est en r\xE9ponse automatique. \xC0 r\xE9server \xE0 un ticket de test."
|
|
4147
|
-
] }),
|
|
4148
|
-
confirmLabel: "Lancer",
|
|
4149
|
-
busyLabel: "D\xE9clenchement\u2026",
|
|
4150
|
-
onConfirm: () => runTest("run"),
|
|
4151
|
-
onCancel: () => setConfirmingRealRun(false)
|
|
4152
|
-
}
|
|
4153
|
-
)
|
|
4076
|
+
] })
|
|
4077
|
+
] }) });
|
|
4078
|
+
}
|
|
4079
|
+
function RecipeRow({ label, children }) {
|
|
4080
|
+
return /* @__PURE__ */ jsxs("div", { className: "flex gap-2", children: [
|
|
4081
|
+
/* @__PURE__ */ jsx("dt", { className: "w-24 shrink-0 text-muted-foreground", children: label }),
|
|
4082
|
+
/* @__PURE__ */ jsx("dd", { className: "break-all font-mono", children })
|
|
4154
4083
|
] });
|
|
4155
4084
|
}
|
|
4156
4085
|
var WHATSAPP_MODE_LABELS = {
|
|
@@ -6208,6 +6137,116 @@ function DryRunResultView({ result, langfuseConfig, knownTags, tagSettings }) {
|
|
|
6208
6137
|
] })
|
|
6209
6138
|
] });
|
|
6210
6139
|
}
|
|
6140
|
+
var STATUS_BADGE = {
|
|
6141
|
+
passed: { label: "OK", variant: "success" },
|
|
6142
|
+
stopped: { label: "Arr\xEAt", variant: "danger" },
|
|
6143
|
+
// A pre-gate that could not read its field. Never shown by the diagnostic
|
|
6144
|
+
// (it evaluates no payload) but rendered honestly if it ever appears, rather
|
|
6145
|
+
// than falling through to a blank badge.
|
|
6146
|
+
muted: { label: "Muet", variant: "warning" },
|
|
6147
|
+
skipped: { label: "Non \xE9valu\xE9", variant: "neutral" }
|
|
6148
|
+
};
|
|
6149
|
+
function FollowupWebhookCard2() {
|
|
6150
|
+
const api = useAppApi();
|
|
6151
|
+
const toast = useToast();
|
|
6152
|
+
const ticketId = useId();
|
|
6153
|
+
const [ticket, setTicket] = useState("");
|
|
6154
|
+
const [test, setTest] = useState(null);
|
|
6155
|
+
const [isTesting, setIsTesting] = useState(false);
|
|
6156
|
+
const [confirmingRealRun, setConfirmingRealRun] = useState(false);
|
|
6157
|
+
async function runTest(mode) {
|
|
6158
|
+
setIsTesting(true);
|
|
6159
|
+
setTest(null);
|
|
6160
|
+
try {
|
|
6161
|
+
setTest(await api.invoke("test-gorgias-webhook", { ticketId: ticket.trim(), mode }));
|
|
6162
|
+
} catch (err) {
|
|
6163
|
+
toast({ title: "\xC9chec du test", description: describeInvokeError(err), variant: "error" });
|
|
6164
|
+
} finally {
|
|
6165
|
+
setIsTesting(false);
|
|
6166
|
+
setConfirmingRealRun(false);
|
|
6167
|
+
}
|
|
6168
|
+
}
|
|
6169
|
+
const disabled = !ticket.trim() || isTesting;
|
|
6170
|
+
return /* @__PURE__ */ jsxs(Card, { id: "webhook-suite", children: [
|
|
6171
|
+
/* @__PURE__ */ jsxs(CardContent, { className: "space-y-3 p-4", children: [
|
|
6172
|
+
/* @__PURE__ */ jsxs("div", { children: [
|
|
6173
|
+
/* @__PURE__ */ jsx("h2", { className: "font-medium", children: "R\xE9ponses aux messages suivants" }),
|
|
6174
|
+
/* @__PURE__ */ jsx("p", { className: "text-xs text-muted-foreground", children: "Rejoue sur un ticket r\xE9el ce que ferait le webhook Gorgias quand un client r\xE9pond sur un ticket d\xE9j\xE0 trait\xE9. Le tag de p\xE9rim\xE8tre et les cat\xE9gories se r\xE8glent dans Param\xE8tres." })
|
|
6175
|
+
] }),
|
|
6176
|
+
/* @__PURE__ */ jsxs("div", { className: "space-y-2 border-t pt-3", children: [
|
|
6177
|
+
/* @__PURE__ */ jsx("label", { htmlFor: ticketId, className: "block text-sm font-medium", children: "Ticket \xE0 tester" }),
|
|
6178
|
+
/* @__PURE__ */ jsxs("div", { className: "flex flex-wrap items-center gap-2", children: [
|
|
6179
|
+
/* @__PURE__ */ jsx(
|
|
6180
|
+
Input,
|
|
6181
|
+
{
|
|
6182
|
+
id: ticketId,
|
|
6183
|
+
value: ticket,
|
|
6184
|
+
onChange: (e) => setTicket(e.target.value),
|
|
6185
|
+
placeholder: "1534712154",
|
|
6186
|
+
className: "max-w-48"
|
|
6187
|
+
}
|
|
6188
|
+
),
|
|
6189
|
+
/* @__PURE__ */ jsx(Button, { type: "button", variant: "outline", onClick: () => void runTest("diagnostic"), disabled, children: "Diagnostic" }),
|
|
6190
|
+
/* @__PURE__ */ jsx(Button, { type: "button", variant: "outline", onClick: () => void runTest("generate"), disabled, children: "G\xE9n\xE9rer sans envoyer" }),
|
|
6191
|
+
/* @__PURE__ */ jsx(Button, { type: "button", variant: "outline", onClick: () => setConfirmingRealRun(true), disabled, children: "Ex\xE9cution r\xE9elle" })
|
|
6192
|
+
] }),
|
|
6193
|
+
/* @__PURE__ */ jsxs("p", { className: "text-xs text-muted-foreground", children: [
|
|
6194
|
+
"Le diagnostic \xE9value les m\xEAmes conditions que le webhook, sans aucun effet de bord.",
|
|
6195
|
+
" ",
|
|
6196
|
+
/* @__PURE__ */ jsx("strong", { children: "G\xE9n\xE9rer sans envoyer" }),
|
|
6197
|
+
" produit la r\xE9ponse compl\xE8te \u2014 m\xEAme si la cat\xE9gorie n'a pas activ\xE9 les r\xE9ponses aux messages suivants \u2014 et ne l'envoie jamais ; elle se lit dans la fiche du ticket. L'ex\xE9cution r\xE9elle d\xE9clenche le vrai traitement."
|
|
6198
|
+
] }),
|
|
6199
|
+
isTesting && /* @__PURE__ */ jsxs("div", { className: "flex items-center gap-2 text-sm text-muted-foreground", children: [
|
|
6200
|
+
/* @__PURE__ */ jsx(Spinner, {}),
|
|
6201
|
+
" Test en cours\u2026"
|
|
6202
|
+
] }),
|
|
6203
|
+
test?.mode === "generate" && /* @__PURE__ */ jsxs("p", { className: "text-sm", children: [
|
|
6204
|
+
"G\xE9n\xE9ration d\xE9clench\xE9e, sans envoi. Run \xE0 suivre : ",
|
|
6205
|
+
/* @__PURE__ */ jsx("code", { children: test.runId }),
|
|
6206
|
+
"."
|
|
6207
|
+
] }),
|
|
6208
|
+
test?.mode === "run" && /* @__PURE__ */ jsxs("p", { className: "text-sm", children: [
|
|
6209
|
+
"Traitement d\xE9clench\xE9. Run \xE0 suivre : ",
|
|
6210
|
+
/* @__PURE__ */ jsx("code", { children: test.runId }),
|
|
6211
|
+
"."
|
|
6212
|
+
] }),
|
|
6213
|
+
test?.mode === "diagnostic" && /* @__PURE__ */ jsxs("div", { className: "space-y-2", children: [
|
|
6214
|
+
/* @__PURE__ */ jsx("p", { className: "text-sm font-medium", children: test.stoppedAt === null ? `Ticket ${test.ticketId} : il aurait re\xE7u une r\xE9ponse de suite.` : `Ticket ${test.ticketId} : arr\xEAt en ${test.stoppedAt}.` }),
|
|
6215
|
+
/* @__PURE__ */ jsx("ul", { className: "space-y-1", children: test.gates.map((gate) => /* @__PURE__ */ jsxs("li", { className: "flex items-start gap-2 text-xs", children: [
|
|
6216
|
+
/* @__PURE__ */ jsx(Badge, { variant: STATUS_BADGE[gate.status].variant, children: STATUS_BADGE[gate.status].label }),
|
|
6217
|
+
/* @__PURE__ */ jsxs("span", { children: [
|
|
6218
|
+
/* @__PURE__ */ jsxs("span", { className: "font-medium", children: [
|
|
6219
|
+
gate.gate,
|
|
6220
|
+
" \u2014 ",
|
|
6221
|
+
gate.label
|
|
6222
|
+
] }),
|
|
6223
|
+
/* @__PURE__ */ jsx("br", {}),
|
|
6224
|
+
/* @__PURE__ */ jsx("span", { className: "text-muted-foreground", children: gate.detail })
|
|
6225
|
+
] })
|
|
6226
|
+
] }, gate.gate)) })
|
|
6227
|
+
] })
|
|
6228
|
+
] })
|
|
6229
|
+
] }),
|
|
6230
|
+
confirmingRealRun && /* @__PURE__ */ jsx(
|
|
6231
|
+
ConfirmModal,
|
|
6232
|
+
{
|
|
6233
|
+
title: "Lancer le traitement r\xE9el ?",
|
|
6234
|
+
description: /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
6235
|
+
"Le ticket ",
|
|
6236
|
+
ticket.trim(),
|
|
6237
|
+
" va \xEAtre trait\xE9 comme un vrai message suivant : g\xE9n\xE9ration, garde-fous, et",
|
|
6238
|
+
" ",
|
|
6239
|
+
/* @__PURE__ */ jsx("strong", { children: "envoi r\xE9el au client" }),
|
|
6240
|
+
" si sa cat\xE9gorie est en r\xE9ponse automatique. Pour tout voir sans rien envoyer, utilisez \xAB G\xE9n\xE9rer sans envoyer \xBB."
|
|
6241
|
+
] }),
|
|
6242
|
+
confirmLabel: "Lancer",
|
|
6243
|
+
busyLabel: "D\xE9clenchement\u2026",
|
|
6244
|
+
onConfirm: () => runTest("run"),
|
|
6245
|
+
onCancel: () => setConfirmingRealRun(false)
|
|
6246
|
+
}
|
|
6247
|
+
)
|
|
6248
|
+
] });
|
|
6249
|
+
}
|
|
6211
6250
|
var TRI_STATE_OPTIONS = [
|
|
6212
6251
|
{ value: "", label: "R\xE9glages actuels" },
|
|
6213
6252
|
{ value: "on", label: "Forcer actif" },
|
|
@@ -6395,9 +6434,11 @@ function TestControls() {
|
|
|
6395
6434
|
function TestPage() {
|
|
6396
6435
|
const { role } = useAppContext();
|
|
6397
6436
|
const canRun = canWriteForRole(role);
|
|
6437
|
+
const canTestFollowup = role === "ADMIN";
|
|
6398
6438
|
return /* @__PURE__ */ jsxs(PageShell, { children: [
|
|
6399
6439
|
/* @__PURE__ */ jsx(PageHeader, { title: "Banc de test", description: "Rejoue le graphe sans jamais agir sur un vrai ticket (\xA70)." }),
|
|
6400
|
-
!canRun ? /* @__PURE__ */ jsx("p", { className: "text-sm text-muted-foreground", children: "Acc\xE8s en lecture seule \u2014 lancer un test n\xE9cessite le r\xF4le EDITOR (chaque ex\xE9cution consomme du budget LLM)." }) : /* @__PURE__ */ jsx(TestControls, {})
|
|
6440
|
+
!canRun ? /* @__PURE__ */ jsx("p", { className: "text-sm text-muted-foreground", children: "Acc\xE8s en lecture seule \u2014 lancer un test n\xE9cessite le r\xF4le EDITOR (chaque ex\xE9cution consomme du budget LLM)." }) : /* @__PURE__ */ jsx(TestControls, {}),
|
|
6441
|
+
canTestFollowup && /* @__PURE__ */ jsx(FollowupWebhookCard2, {})
|
|
6401
6442
|
] });
|
|
6402
6443
|
}
|
|
6403
6444
|
function ExperimentStatusBadge({ experiment }) {
|