@apotech-os/support-kit 2.9.0 → 2.9.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.
- package/dist/index.cjs +3 -11
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +3 -11
- package/dist/index.js.map +1 -1
- package/dist/ui/index.cjs +295 -354
- package/dist/ui/index.cjs.map +1 -1
- package/dist/ui/index.js +295 -354
- package/dist/ui/index.js.map +1 -1
- package/package.json +3 -3
package/dist/ui/index.js
CHANGED
|
@@ -3225,11 +3225,7 @@ function PipelineNodesForm({
|
|
|
3225
3225
|
onPatch: (patch) => onChange(withStepFields(value, step.key, patch))
|
|
3226
3226
|
},
|
|
3227
3227
|
step.key
|
|
3228
|
-
)) })
|
|
3229
|
-
/* @__PURE__ */ jsxs("details", { children: [
|
|
3230
|
-
/* @__PURE__ */ jsx("summary", { className: "cursor-pointer text-sm font-medium", children: "Mode avanc\xE9 (JSON)" }),
|
|
3231
|
-
/* @__PURE__ */ jsx("div", { className: "mt-3", children: /* @__PURE__ */ jsx(NodesJsonField, { value, onChange, disabled: !canWrite }) })
|
|
3232
|
-
] })
|
|
3228
|
+
)) })
|
|
3233
3229
|
] });
|
|
3234
3230
|
}
|
|
3235
3231
|
function StepRow({
|
|
@@ -3489,69 +3485,6 @@ function useIds(stepKey) {
|
|
|
3489
3485
|
minConfidence: `${base2}-${stepKey}-min-confidence`
|
|
3490
3486
|
};
|
|
3491
3487
|
}
|
|
3492
|
-
function NodesJsonField({
|
|
3493
|
-
value,
|
|
3494
|
-
onChange,
|
|
3495
|
-
disabled
|
|
3496
|
-
}) {
|
|
3497
|
-
const id = useId();
|
|
3498
|
-
const serialized = stringify(value);
|
|
3499
|
-
const [text, setText] = useState(serialized);
|
|
3500
|
-
const [parseError, setParseError] = useState(null);
|
|
3501
|
-
const emittedRef = useRef(serialized);
|
|
3502
|
-
useEffect(() => {
|
|
3503
|
-
if (serialized === emittedRef.current) return;
|
|
3504
|
-
emittedRef.current = serialized;
|
|
3505
|
-
setText(serialized);
|
|
3506
|
-
setParseError(null);
|
|
3507
|
-
}, [serialized]);
|
|
3508
|
-
function handleChange(next) {
|
|
3509
|
-
setText(next);
|
|
3510
|
-
try {
|
|
3511
|
-
const parsed = JSON.parse(next);
|
|
3512
|
-
emittedRef.current = stringify(parsed);
|
|
3513
|
-
onChange(parsed);
|
|
3514
|
-
setParseError(null);
|
|
3515
|
-
} catch {
|
|
3516
|
-
setParseError("JSON invalide \u2014 la derni\xE8re valeur valide est conserv\xE9e tant que ce texte ne parse pas.");
|
|
3517
|
-
}
|
|
3518
|
-
}
|
|
3519
|
-
return /* @__PURE__ */ jsxs("div", { children: [
|
|
3520
|
-
/* @__PURE__ */ jsx("label", { htmlFor: id, className: "mb-1 block text-sm font-medium", children: "\xC9tapes du graphe (JSON)" }),
|
|
3521
|
-
/* @__PURE__ */ jsx(
|
|
3522
|
-
Textarea,
|
|
3523
|
-
{
|
|
3524
|
-
id,
|
|
3525
|
-
className: "font-mono text-xs",
|
|
3526
|
-
rows: 10,
|
|
3527
|
-
value: text,
|
|
3528
|
-
disabled,
|
|
3529
|
-
onChange: (e) => handleChange(e.target.value)
|
|
3530
|
-
}
|
|
3531
|
-
),
|
|
3532
|
-
parseError && /* @__PURE__ */ jsx("p", { className: "mt-1 text-sm text-destructive", children: parseError }),
|
|
3533
|
-
/* @__PURE__ */ jsxs("p", { className: "mt-1 text-xs text-muted-foreground", children: [
|
|
3534
|
-
"Chaque cl\xE9 optionnelle (",
|
|
3535
|
-
/* @__PURE__ */ jsx("code", { children: "escalate" }),
|
|
3536
|
-
", ",
|
|
3537
|
-
/* @__PURE__ */ jsx("code", { children: "draft" }),
|
|
3538
|
-
", ",
|
|
3539
|
-
/* @__PURE__ */ jsx("code", { children: "evaluate" }),
|
|
3540
|
-
",",
|
|
3541
|
-
" ",
|
|
3542
|
-
/* @__PURE__ */ jsx("code", { children: "revise" }),
|
|
3543
|
-
") accepte ",
|
|
3544
|
-
/* @__PURE__ */ jsx("code", { children: "null" }),
|
|
3545
|
-
" pour d\xE9sactiver l'\xE9tape (\xA73.6).",
|
|
3546
|
-
" ",
|
|
3547
|
-
/* @__PURE__ */ jsx("code", { children: "triage" }),
|
|
3548
|
-
" est obligatoire."
|
|
3549
|
-
] })
|
|
3550
|
-
] });
|
|
3551
|
-
}
|
|
3552
|
-
function stringify(value) {
|
|
3553
|
-
return JSON.stringify(value ?? null, null, 2);
|
|
3554
|
-
}
|
|
3555
3488
|
function usePromptCatalogue() {
|
|
3556
3489
|
const { appSlug } = useAppContext();
|
|
3557
3490
|
const api = useAppApi();
|
|
@@ -3706,325 +3639,333 @@ function SettingsPage() {
|
|
|
3706
3639
|
checked ? [.../* @__PURE__ */ new Set([...guardrailsActive, id])] : guardrailsActive.filter((g) => g !== id)
|
|
3707
3640
|
);
|
|
3708
3641
|
}
|
|
3709
|
-
return
|
|
3710
|
-
|
|
3711
|
-
|
|
3712
|
-
|
|
3713
|
-
|
|
3714
|
-
|
|
3715
|
-
|
|
3716
|
-
|
|
3717
|
-
|
|
3718
|
-
|
|
3719
|
-
|
|
3720
|
-
}
|
|
3721
|
-
),
|
|
3722
|
-
/* @__PURE__ */ jsx("p", { className: "mt-1 text-xs text-muted-foreground", children: "Cette application utilise la connexion Gorgias de l\u2019instance ; elle se r\xE8gle dans les int\xE9grations de la plateforme, pas ici." })
|
|
3723
|
-
] }),
|
|
3724
|
-
/* @__PURE__ */ jsxs("div", { children: [
|
|
3725
|
-
/* @__PURE__ */ jsx("label", { htmlFor: "sourceViewId", className: "mb-1 block text-sm font-medium", children: "Vue Gorgias source" }),
|
|
3726
|
-
views.length > 0 ? /* @__PURE__ */ jsx(
|
|
3727
|
-
Select,
|
|
3728
|
-
{
|
|
3729
|
-
"aria-label": "Vue Gorgias source",
|
|
3730
|
-
value: sourceViewId || void 0,
|
|
3731
|
-
onValueChange: (v) => set("sourceViewId", v),
|
|
3732
|
-
items: views.map((v) => ({ value: v.id, label: v.name })),
|
|
3733
|
-
disabled: !canWrite
|
|
3734
|
-
}
|
|
3735
|
-
) : /* @__PURE__ */ jsx(
|
|
3736
|
-
Input,
|
|
3737
|
-
{
|
|
3738
|
-
id: "sourceViewId",
|
|
3739
|
-
value: sourceViewId,
|
|
3740
|
-
onChange: (e) => set("sourceViewId", e.target.value),
|
|
3741
|
-
disabled: !canWrite
|
|
3742
|
-
}
|
|
3743
|
-
)
|
|
3744
|
-
] }),
|
|
3745
|
-
claimedView && claimedView.claimedByAppSlugs.length > 0 && /* @__PURE__ */ jsxs("p", { className: "text-sm text-status-pending", children: [
|
|
3746
|
-
"Cette vue est d\xE9j\xE0 utilis\xE9e par : ",
|
|
3747
|
-
claimedView.claimedByAppSlugs.join(", ")
|
|
3748
|
-
] }),
|
|
3749
|
-
claimUnverifiable && /* @__PURE__ */ jsx("p", { className: "text-sm text-muted-foreground", children: "Conflit avec une autre application : inv\xE9rifiable (droits administrateur plateforme requis pour lister les applications install\xE9es). Ce contr\xF4le est informatif \u2014 il ne bloque rien, mais ne peut pas garantir l'absence de conflit." }),
|
|
3750
|
-
sourceViewId === "" && /* @__PURE__ */ jsx("p", { className: "text-sm text-destructive", children: "Aucune vue Gorgias configur\xE9e \u2014 le triage ne peut pas d\xE9marrer tant que ce champ n'est pas renseign\xE9." })
|
|
3751
|
-
] }) }),
|
|
3752
|
-
sourceViewId === "" ? null : /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
3753
|
-
/* @__PURE__ */ jsx(Card, { id: "cadence", children: /* @__PURE__ */ jsxs(CardContent, { className: "space-y-3 p-4", children: [
|
|
3754
|
-
/* @__PURE__ */ jsx("h2", { className: "font-medium", children: "Cadence" }),
|
|
3755
|
-
/* @__PURE__ */ jsxs("div", { className: "flex items-center gap-2 text-sm", children: [
|
|
3756
|
-
/* @__PURE__ */ jsx(
|
|
3757
|
-
Switch,
|
|
3758
|
-
{
|
|
3759
|
-
"aria-label": "Triage activ\xE9",
|
|
3760
|
-
checked: bool(form.triageEnabled),
|
|
3761
|
-
onCheckedChange: (v) => set("triageEnabled", v),
|
|
3762
|
-
disabled: !canWrite
|
|
3763
|
-
}
|
|
3764
|
-
),
|
|
3765
|
-
"Triage activ\xE9"
|
|
3766
|
-
] }),
|
|
3767
|
-
/* @__PURE__ */ jsxs("div", { className: "flex items-center gap-2 text-sm", children: [
|
|
3768
|
-
/* @__PURE__ */ jsx(
|
|
3769
|
-
Switch,
|
|
3770
|
-
{
|
|
3771
|
-
"aria-label": "Mode d'essai",
|
|
3772
|
-
checked: bool(form.dryRun),
|
|
3773
|
-
onCheckedChange: (v) => set("dryRun", v),
|
|
3774
|
-
disabled: !canWrite
|
|
3775
|
-
}
|
|
3776
|
-
),
|
|
3777
|
-
"Mode d'essai \u2014 le triage tourne en entier, sans aucune \xE9criture Gorgias (ni r\xE9ponse, ni tag)"
|
|
3778
|
-
] }),
|
|
3779
|
-
/* @__PURE__ */ jsx(
|
|
3780
|
-
NumberField,
|
|
3781
|
-
{
|
|
3782
|
-
id: "batchLimit",
|
|
3783
|
-
label: "Taille de lot",
|
|
3784
|
-
value: num(form.batchLimit),
|
|
3785
|
-
onChange: (v) => set("batchLimit", v),
|
|
3786
|
-
disabled: !canWrite,
|
|
3787
|
-
min: 1,
|
|
3788
|
-
integer: true
|
|
3789
|
-
}
|
|
3790
|
-
),
|
|
3791
|
-
/* @__PURE__ */ jsx(
|
|
3792
|
-
NumberField,
|
|
3793
|
-
{
|
|
3794
|
-
id: "triageIntervalMinutes",
|
|
3795
|
-
label: "Intervalle de triage (minutes)",
|
|
3796
|
-
value: num(form.triageIntervalMinutes),
|
|
3797
|
-
onChange: (v) => set("triageIntervalMinutes", v),
|
|
3798
|
-
disabled: !canWrite,
|
|
3799
|
-
min: 1,
|
|
3800
|
-
integer: true
|
|
3801
|
-
}
|
|
3802
|
-
),
|
|
3803
|
-
/* @__PURE__ */ jsx(
|
|
3804
|
-
NumberField,
|
|
3805
|
-
{
|
|
3806
|
-
id: "responseTtlMinutes",
|
|
3807
|
-
label: "Dur\xE9e de vie des r\xE9ponses (minutes)",
|
|
3808
|
-
value: num(form.responseTtlMinutes),
|
|
3809
|
-
onChange: (v) => set("responseTtlMinutes", v),
|
|
3810
|
-
disabled: !canWrite,
|
|
3811
|
-
min: 1,
|
|
3812
|
-
integer: true
|
|
3813
|
-
}
|
|
3814
|
-
)
|
|
3815
|
-
] }) }),
|
|
3816
|
-
/* @__PURE__ */ jsx(Card, { id: "envoi", children: /* @__PURE__ */ jsxs(CardContent, { className: "space-y-3 p-4", children: [
|
|
3817
|
-
/* @__PURE__ */ jsx("h2", { className: "font-medium", children: "Envoi" }),
|
|
3818
|
-
/* @__PURE__ */ jsxs("div", { className: "flex items-center gap-2 text-sm", children: [
|
|
3819
|
-
/* @__PURE__ */ jsx(
|
|
3820
|
-
Switch,
|
|
3821
|
-
{
|
|
3822
|
-
"aria-label": "Envoi automatique",
|
|
3823
|
-
checked: bool(form.autoSendEnabled),
|
|
3824
|
-
onCheckedChange: (v) => set("autoSendEnabled", v),
|
|
3825
|
-
disabled: !canWrite
|
|
3826
|
-
}
|
|
3827
|
-
),
|
|
3828
|
-
"Envoi automatique"
|
|
3829
|
-
] }),
|
|
3642
|
+
return (
|
|
3643
|
+
// No PageHeader here, unlike every other page of this kit: this one is
|
|
3644
|
+
// mounted INSIDE the platform's own settings screen
|
|
3645
|
+
// (`app-settings-view.tsx`), which already prints the breadcrumb and an
|
|
3646
|
+
// `<h1>` carrying this page's title. A second « Paramètres » heading right
|
|
3647
|
+
// under the first said nothing the operator had not just read, and pushed
|
|
3648
|
+
// the one field that actually gates the app — the Gorgias source view —
|
|
3649
|
+
// further down the screen.
|
|
3650
|
+
/* @__PURE__ */ jsxs(PageShell, { className: "max-w-3xl", children: [
|
|
3651
|
+
/* @__PURE__ */ jsx(Card, { id: "source", children: /* @__PURE__ */ jsxs(CardContent, { className: "space-y-3 p-4", children: [
|
|
3652
|
+
/* @__PURE__ */ jsx("h2", { className: "font-medium", children: "Source" }),
|
|
3830
3653
|
/* @__PURE__ */ jsxs("div", { children: [
|
|
3831
|
-
/* @__PURE__ */ jsx("
|
|
3832
|
-
/* @__PURE__ */ jsx(
|
|
3833
|
-
Input,
|
|
3834
|
-
{
|
|
3835
|
-
id: "senderEmail",
|
|
3836
|
-
value: field(form.senderEmail),
|
|
3837
|
-
onChange: (e) => set("senderEmail", e.target.value),
|
|
3838
|
-
disabled: !canWrite
|
|
3839
|
-
}
|
|
3840
|
-
)
|
|
3841
|
-
] }),
|
|
3842
|
-
/* @__PURE__ */ jsxs("div", { className: "flex items-center gap-2 text-sm", children: [
|
|
3654
|
+
/* @__PURE__ */ jsx("span", { className: "mb-1 block text-sm font-medium", children: "Connexion Gorgias" }),
|
|
3843
3655
|
/* @__PURE__ */ jsx(
|
|
3844
|
-
|
|
3656
|
+
"p",
|
|
3845
3657
|
{
|
|
3846
|
-
"
|
|
3847
|
-
|
|
3848
|
-
onCheckedChange: (v) => set("requireHighTriageConfidence", v),
|
|
3849
|
-
disabled: !canWrite
|
|
3658
|
+
className: connection.tone === "error" ? "text-sm text-destructive" : connection.tone === "muted" ? "text-sm text-muted-foreground" : "text-sm",
|
|
3659
|
+
children: connection.text
|
|
3850
3660
|
}
|
|
3851
3661
|
),
|
|
3852
|
-
"
|
|
3662
|
+
/* @__PURE__ */ jsx("p", { className: "mt-1 text-xs text-muted-foreground", children: "Cette application utilise la connexion Gorgias de l\u2019instance ; elle se r\xE8gle dans les int\xE9grations de la plateforme, pas ici." })
|
|
3853
3663
|
] }),
|
|
3854
3664
|
/* @__PURE__ */ jsxs("div", { children: [
|
|
3855
|
-
/* @__PURE__ */ jsx("label", { htmlFor: "
|
|
3856
|
-
/* @__PURE__ */ jsx(
|
|
3665
|
+
/* @__PURE__ */ jsx("label", { htmlFor: "sourceViewId", className: "mb-1 block text-sm font-medium", children: "Vue Gorgias source" }),
|
|
3666
|
+
views.length > 0 ? /* @__PURE__ */ jsx(
|
|
3857
3667
|
Select,
|
|
3858
3668
|
{
|
|
3859
|
-
"aria-label": "
|
|
3860
|
-
value:
|
|
3861
|
-
onValueChange: (v) => set("
|
|
3862
|
-
items:
|
|
3669
|
+
"aria-label": "Vue Gorgias source",
|
|
3670
|
+
value: sourceViewId || void 0,
|
|
3671
|
+
onValueChange: (v) => set("sourceViewId", v),
|
|
3672
|
+
items: views.map((v) => ({ value: v.id, label: v.name })),
|
|
3863
3673
|
disabled: !canWrite
|
|
3864
3674
|
}
|
|
3865
|
-
)
|
|
3866
|
-
] })
|
|
3867
|
-
] }) }),
|
|
3868
|
-
/* @__PURE__ */ jsx(Card, { children: /* @__PURE__ */ jsxs(CardContent, { className: "space-y-3 p-4", children: [
|
|
3869
|
-
/* @__PURE__ */ jsx("h2", { className: "font-medium", children: "Tags d'audit" }),
|
|
3870
|
-
[
|
|
3871
|
-
["unknownTag", "Tag inconnu"],
|
|
3872
|
-
["handledTag", "Tag trait\xE9"],
|
|
3873
|
-
["escalationTag", "Tag d'escalade"],
|
|
3874
|
-
["needsHumanTag", "Tag besoin humain"],
|
|
3875
|
-
["autoRepliedTag", "Tag r\xE9pondu automatiquement"],
|
|
3876
|
-
["needsReviewTag", "Tag \xE0 revoir"],
|
|
3877
|
-
["followupTag", "Tag suivi requis"]
|
|
3878
|
-
].map(([key, label]) => /* @__PURE__ */ jsxs("div", { children: [
|
|
3879
|
-
/* @__PURE__ */ jsx("label", { htmlFor: key, className: "mb-1 block text-sm font-medium", children: label }),
|
|
3880
|
-
/* @__PURE__ */ jsx(Input, { id: key, value: field(form[key]), onChange: (e) => set(key, e.target.value), disabled: !canWrite })
|
|
3881
|
-
] }, key))
|
|
3882
|
-
] }) }),
|
|
3883
|
-
/* @__PURE__ */ jsx(Card, { id: "guardrails", children: /* @__PURE__ */ jsxs(CardContent, { className: "space-y-3 p-4", children: [
|
|
3884
|
-
/* @__PURE__ */ jsx("h2", { className: "font-medium", children: "Garde-fous" }),
|
|
3885
|
-
/* @__PURE__ */ jsxs("div", { children: [
|
|
3886
|
-
/* @__PURE__ */ jsx("p", { className: "mb-1 text-sm font-medium", children: "Garde-fous actifs" }),
|
|
3887
|
-
/* @__PURE__ */ jsx("div", { className: "grid grid-cols-2 gap-1", children: AGENT_GUARDRAILS.map((id) => /* @__PURE__ */ jsx(
|
|
3888
|
-
Checkbox,
|
|
3889
|
-
{
|
|
3890
|
-
label: guardrailHitLabel(id),
|
|
3891
|
-
checked: guardrailsActive.includes(id),
|
|
3892
|
-
onCheckedChange: (checked) => toggleGuardrail(id, checked),
|
|
3893
|
-
disabled: !canWrite
|
|
3894
|
-
},
|
|
3895
|
-
id
|
|
3896
|
-
)) })
|
|
3897
|
-
] }),
|
|
3898
|
-
/* @__PURE__ */ jsxs("div", { children: [
|
|
3899
|
-
/* @__PURE__ */ jsx("label", { htmlFor: "blocklist", className: "mb-1 block text-sm font-medium", children: "Liste de blocage" }),
|
|
3900
|
-
/* @__PURE__ */ jsx(
|
|
3901
|
-
Textarea,
|
|
3902
|
-
{
|
|
3903
|
-
id: "blocklist",
|
|
3904
|
-
value: list(form.blocklist),
|
|
3905
|
-
onChange: (e) => set("blocklist", parseList(e.target.value)),
|
|
3906
|
-
disabled: !canWrite
|
|
3907
|
-
}
|
|
3908
|
-
)
|
|
3909
|
-
] }),
|
|
3910
|
-
/* @__PURE__ */ jsxs("div", { children: [
|
|
3911
|
-
/* @__PURE__ */ jsx("label", { htmlFor: "noreplySenders", className: "mb-1 block text-sm font-medium", children: "Exp\xE9diteurs no-reply (s\xE9par\xE9s par des virgules)" }),
|
|
3912
|
-
/* @__PURE__ */ jsx(
|
|
3913
|
-
Textarea,
|
|
3914
|
-
{
|
|
3915
|
-
id: "noreplySenders",
|
|
3916
|
-
value: list(form.noreplySenders),
|
|
3917
|
-
onChange: (e) => set("noreplySenders", parseList(e.target.value)),
|
|
3918
|
-
disabled: !canWrite
|
|
3919
|
-
}
|
|
3920
|
-
)
|
|
3921
|
-
] })
|
|
3922
|
-
] }) }),
|
|
3923
|
-
/* @__PURE__ */ jsx(Card, { children: /* @__PURE__ */ jsxs(CardContent, { className: "space-y-3 p-4", children: [
|
|
3924
|
-
/* @__PURE__ */ jsx("h2", { className: "font-medium", children: "Prompts de style par canal" }),
|
|
3925
|
-
/* @__PURE__ */ jsxs("div", { children: [
|
|
3926
|
-
/* @__PURE__ */ jsx("label", { htmlFor: "channelPromptEmail", className: "mb-1 block text-sm font-medium", children: "Prompt de style \u2014 email" }),
|
|
3927
|
-
/* @__PURE__ */ jsx(
|
|
3675
|
+
) : /* @__PURE__ */ jsx(
|
|
3928
3676
|
Input,
|
|
3929
3677
|
{
|
|
3930
|
-
id: "
|
|
3931
|
-
value:
|
|
3932
|
-
onChange: (e) => set("
|
|
3678
|
+
id: "sourceViewId",
|
|
3679
|
+
value: sourceViewId,
|
|
3680
|
+
onChange: (e) => set("sourceViewId", e.target.value),
|
|
3933
3681
|
disabled: !canWrite
|
|
3934
3682
|
}
|
|
3935
3683
|
)
|
|
3936
3684
|
] }),
|
|
3937
|
-
/* @__PURE__ */ jsxs("
|
|
3938
|
-
|
|
3939
|
-
|
|
3940
|
-
|
|
3941
|
-
|
|
3942
|
-
|
|
3943
|
-
value: field(form.channelPromptWhatsapp),
|
|
3944
|
-
onChange: (e) => set("channelPromptWhatsapp", e.target.value),
|
|
3945
|
-
disabled: !canWrite
|
|
3946
|
-
}
|
|
3947
|
-
)
|
|
3948
|
-
] })
|
|
3685
|
+
claimedView && claimedView.claimedByAppSlugs.length > 0 && /* @__PURE__ */ jsxs("p", { className: "text-sm text-status-pending", children: [
|
|
3686
|
+
"Cette vue est d\xE9j\xE0 utilis\xE9e par : ",
|
|
3687
|
+
claimedView.claimedByAppSlugs.join(", ")
|
|
3688
|
+
] }),
|
|
3689
|
+
claimUnverifiable && /* @__PURE__ */ jsx("p", { className: "text-sm text-muted-foreground", children: "Conflit avec une autre application : inv\xE9rifiable (droits administrateur plateforme requis pour lister les applications install\xE9es). Ce contr\xF4le est informatif \u2014 il ne bloque rien, mais ne peut pas garantir l'absence de conflit." }),
|
|
3690
|
+
sourceViewId === "" && /* @__PURE__ */ jsx("p", { className: "text-sm text-destructive", children: "Aucune vue Gorgias configur\xE9e \u2014 le triage ne peut pas d\xE9marrer tant que ce champ n'est pas renseign\xE9." })
|
|
3949
3691
|
] }) }),
|
|
3950
|
-
|
|
3951
|
-
/* @__PURE__ */ jsx("
|
|
3952
|
-
|
|
3692
|
+
sourceViewId === "" ? null : /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
3693
|
+
/* @__PURE__ */ jsx(Card, { id: "cadence", children: /* @__PURE__ */ jsxs(CardContent, { className: "space-y-3 p-4", children: [
|
|
3694
|
+
/* @__PURE__ */ jsx("h2", { className: "font-medium", children: "Cadence" }),
|
|
3695
|
+
/* @__PURE__ */ jsxs("div", { className: "flex items-center gap-2 text-sm", children: [
|
|
3696
|
+
/* @__PURE__ */ jsx(
|
|
3697
|
+
Switch,
|
|
3698
|
+
{
|
|
3699
|
+
"aria-label": "Triage activ\xE9",
|
|
3700
|
+
checked: bool(form.triageEnabled),
|
|
3701
|
+
onCheckedChange: (v) => set("triageEnabled", v),
|
|
3702
|
+
disabled: !canWrite
|
|
3703
|
+
}
|
|
3704
|
+
),
|
|
3705
|
+
"Triage activ\xE9"
|
|
3706
|
+
] }),
|
|
3707
|
+
/* @__PURE__ */ jsxs("div", { className: "flex items-center gap-2 text-sm", children: [
|
|
3708
|
+
/* @__PURE__ */ jsx(
|
|
3709
|
+
Switch,
|
|
3710
|
+
{
|
|
3711
|
+
"aria-label": "Mode d'essai",
|
|
3712
|
+
checked: bool(form.dryRun),
|
|
3713
|
+
onCheckedChange: (v) => set("dryRun", v),
|
|
3714
|
+
disabled: !canWrite
|
|
3715
|
+
}
|
|
3716
|
+
),
|
|
3717
|
+
"Mode d'essai \u2014 le triage tourne en entier, sans aucune \xE9criture Gorgias (ni r\xE9ponse, ni tag)"
|
|
3718
|
+
] }),
|
|
3953
3719
|
/* @__PURE__ */ jsx(
|
|
3954
|
-
|
|
3720
|
+
NumberField,
|
|
3955
3721
|
{
|
|
3956
|
-
|
|
3957
|
-
|
|
3958
|
-
|
|
3722
|
+
id: "batchLimit",
|
|
3723
|
+
label: "Taille de lot",
|
|
3724
|
+
value: num(form.batchLimit),
|
|
3725
|
+
onChange: (v) => set("batchLimit", v),
|
|
3726
|
+
disabled: !canWrite,
|
|
3727
|
+
min: 1,
|
|
3728
|
+
integer: true
|
|
3959
3729
|
}
|
|
3960
3730
|
),
|
|
3961
|
-
"Renommage de sujet activ\xE9"
|
|
3962
|
-
] }),
|
|
3963
|
-
/* @__PURE__ */ jsxs("div", { children: [
|
|
3964
|
-
/* @__PURE__ */ jsx("label", { htmlFor: "renameFrom", className: "mb-1 block text-sm font-medium", children: "Renommage \u2014 motif \xE0 rep\xE9rer dans le sujet" }),
|
|
3965
3731
|
/* @__PURE__ */ jsx(
|
|
3966
|
-
|
|
3732
|
+
NumberField,
|
|
3967
3733
|
{
|
|
3968
|
-
id: "
|
|
3969
|
-
|
|
3970
|
-
|
|
3971
|
-
|
|
3734
|
+
id: "triageIntervalMinutes",
|
|
3735
|
+
label: "Intervalle de triage (minutes)",
|
|
3736
|
+
value: num(form.triageIntervalMinutes),
|
|
3737
|
+
onChange: (v) => set("triageIntervalMinutes", v),
|
|
3738
|
+
disabled: !canWrite,
|
|
3739
|
+
min: 1,
|
|
3740
|
+
integer: true
|
|
3972
3741
|
}
|
|
3973
|
-
)
|
|
3974
|
-
] }),
|
|
3975
|
-
/* @__PURE__ */ jsxs("div", { children: [
|
|
3976
|
-
/* @__PURE__ */ jsx("label", { htmlFor: "renameTo", className: "mb-1 block text-sm font-medium", children: "Renommage \u2014 sujet de remplacement" }),
|
|
3742
|
+
),
|
|
3977
3743
|
/* @__PURE__ */ jsx(
|
|
3978
|
-
|
|
3744
|
+
NumberField,
|
|
3979
3745
|
{
|
|
3980
|
-
id: "
|
|
3981
|
-
|
|
3982
|
-
|
|
3983
|
-
|
|
3746
|
+
id: "responseTtlMinutes",
|
|
3747
|
+
label: "Dur\xE9e de vie des r\xE9ponses (minutes)",
|
|
3748
|
+
value: num(form.responseTtlMinutes),
|
|
3749
|
+
onChange: (v) => set("responseTtlMinutes", v),
|
|
3750
|
+
disabled: !canWrite,
|
|
3751
|
+
min: 1,
|
|
3752
|
+
integer: true
|
|
3984
3753
|
}
|
|
3985
3754
|
)
|
|
3986
|
-
] }),
|
|
3987
|
-
/* @__PURE__ */
|
|
3988
|
-
/* @__PURE__ */ jsx("
|
|
3755
|
+
] }) }),
|
|
3756
|
+
/* @__PURE__ */ jsx(Card, { id: "envoi", children: /* @__PURE__ */ jsxs(CardContent, { className: "space-y-3 p-4", children: [
|
|
3757
|
+
/* @__PURE__ */ jsx("h2", { className: "font-medium", children: "Envoi" }),
|
|
3758
|
+
/* @__PURE__ */ jsxs("div", { className: "flex items-center gap-2 text-sm", children: [
|
|
3759
|
+
/* @__PURE__ */ jsx(
|
|
3760
|
+
Switch,
|
|
3761
|
+
{
|
|
3762
|
+
"aria-label": "Envoi automatique",
|
|
3763
|
+
checked: bool(form.autoSendEnabled),
|
|
3764
|
+
onCheckedChange: (v) => set("autoSendEnabled", v),
|
|
3765
|
+
disabled: !canWrite
|
|
3766
|
+
}
|
|
3767
|
+
),
|
|
3768
|
+
"Envoi automatique"
|
|
3769
|
+
] }),
|
|
3770
|
+
/* @__PURE__ */ jsxs("div", { children: [
|
|
3771
|
+
/* @__PURE__ */ jsx("label", { htmlFor: "senderEmail", className: "mb-1 block text-sm font-medium", children: "Adresse d'envoi" }),
|
|
3772
|
+
/* @__PURE__ */ jsx(
|
|
3773
|
+
Input,
|
|
3774
|
+
{
|
|
3775
|
+
id: "senderEmail",
|
|
3776
|
+
value: field(form.senderEmail),
|
|
3777
|
+
onChange: (e) => set("senderEmail", e.target.value),
|
|
3778
|
+
disabled: !canWrite
|
|
3779
|
+
}
|
|
3780
|
+
)
|
|
3781
|
+
] }),
|
|
3782
|
+
/* @__PURE__ */ jsxs("div", { className: "flex items-center gap-2 text-sm", children: [
|
|
3783
|
+
/* @__PURE__ */ jsx(
|
|
3784
|
+
Switch,
|
|
3785
|
+
{
|
|
3786
|
+
"aria-label": "Exiger une confiance de triage \xE9lev\xE9e",
|
|
3787
|
+
checked: bool(form.requireHighTriageConfidence),
|
|
3788
|
+
onCheckedChange: (v) => set("requireHighTriageConfidence", v),
|
|
3789
|
+
disabled: !canWrite
|
|
3790
|
+
}
|
|
3791
|
+
),
|
|
3792
|
+
"Exiger une confiance de triage \xE9lev\xE9e avant tout envoi automatique"
|
|
3793
|
+
] }),
|
|
3794
|
+
/* @__PURE__ */ jsxs("div", { children: [
|
|
3795
|
+
/* @__PURE__ */ jsx("label", { htmlFor: "whatsappMode", className: "mb-1 block text-sm font-medium", children: "Mode WhatsApp" }),
|
|
3796
|
+
/* @__PURE__ */ jsx(
|
|
3797
|
+
Select,
|
|
3798
|
+
{
|
|
3799
|
+
"aria-label": "Mode WhatsApp",
|
|
3800
|
+
value: field(form.whatsappMode) || void 0,
|
|
3801
|
+
onValueChange: (v) => set("whatsappMode", v),
|
|
3802
|
+
items: WHATSAPP_MODE_OPTIONS,
|
|
3803
|
+
disabled: !canWrite
|
|
3804
|
+
}
|
|
3805
|
+
)
|
|
3806
|
+
] })
|
|
3807
|
+
] }) }),
|
|
3808
|
+
/* @__PURE__ */ jsx(Card, { children: /* @__PURE__ */ jsxs(CardContent, { className: "space-y-3 p-4", children: [
|
|
3809
|
+
/* @__PURE__ */ jsx("h2", { className: "font-medium", children: "Tags d'audit" }),
|
|
3810
|
+
[
|
|
3811
|
+
["unknownTag", "Tag inconnu"],
|
|
3812
|
+
["handledTag", "Tag trait\xE9"],
|
|
3813
|
+
["escalationTag", "Tag d'escalade"],
|
|
3814
|
+
["needsHumanTag", "Tag besoin humain"],
|
|
3815
|
+
["autoRepliedTag", "Tag r\xE9pondu automatiquement"],
|
|
3816
|
+
["needsReviewTag", "Tag \xE0 revoir"],
|
|
3817
|
+
["followupTag", "Tag suivi requis"]
|
|
3818
|
+
].map(([key, label]) => /* @__PURE__ */ jsxs("div", { children: [
|
|
3819
|
+
/* @__PURE__ */ jsx("label", { htmlFor: key, className: "mb-1 block text-sm font-medium", children: label }),
|
|
3820
|
+
/* @__PURE__ */ jsx(Input, { id: key, value: field(form[key]), onChange: (e) => set(key, e.target.value), disabled: !canWrite })
|
|
3821
|
+
] }, key))
|
|
3822
|
+
] }) }),
|
|
3823
|
+
/* @__PURE__ */ jsx(Card, { id: "guardrails", children: /* @__PURE__ */ jsxs(CardContent, { className: "space-y-3 p-4", children: [
|
|
3824
|
+
/* @__PURE__ */ jsx("h2", { className: "font-medium", children: "Garde-fous" }),
|
|
3825
|
+
/* @__PURE__ */ jsxs("div", { children: [
|
|
3826
|
+
/* @__PURE__ */ jsx("p", { className: "mb-1 text-sm font-medium", children: "Garde-fous actifs" }),
|
|
3827
|
+
/* @__PURE__ */ jsx("div", { className: "grid grid-cols-2 gap-1", children: AGENT_GUARDRAILS.map((id) => /* @__PURE__ */ jsx(
|
|
3828
|
+
Checkbox,
|
|
3829
|
+
{
|
|
3830
|
+
label: guardrailHitLabel(id),
|
|
3831
|
+
checked: guardrailsActive.includes(id),
|
|
3832
|
+
onCheckedChange: (checked) => toggleGuardrail(id, checked),
|
|
3833
|
+
disabled: !canWrite
|
|
3834
|
+
},
|
|
3835
|
+
id
|
|
3836
|
+
)) })
|
|
3837
|
+
] }),
|
|
3838
|
+
/* @__PURE__ */ jsxs("div", { children: [
|
|
3839
|
+
/* @__PURE__ */ jsx("label", { htmlFor: "blocklist", className: "mb-1 block text-sm font-medium", children: "Liste de blocage" }),
|
|
3840
|
+
/* @__PURE__ */ jsx(
|
|
3841
|
+
Textarea,
|
|
3842
|
+
{
|
|
3843
|
+
id: "blocklist",
|
|
3844
|
+
value: list(form.blocklist),
|
|
3845
|
+
onChange: (e) => set("blocklist", parseList(e.target.value)),
|
|
3846
|
+
disabled: !canWrite
|
|
3847
|
+
}
|
|
3848
|
+
)
|
|
3849
|
+
] }),
|
|
3850
|
+
/* @__PURE__ */ jsxs("div", { children: [
|
|
3851
|
+
/* @__PURE__ */ jsx("label", { htmlFor: "noreplySenders", className: "mb-1 block text-sm font-medium", children: "Exp\xE9diteurs no-reply (s\xE9par\xE9s par des virgules)" }),
|
|
3852
|
+
/* @__PURE__ */ jsx(
|
|
3853
|
+
Textarea,
|
|
3854
|
+
{
|
|
3855
|
+
id: "noreplySenders",
|
|
3856
|
+
value: list(form.noreplySenders),
|
|
3857
|
+
onChange: (e) => set("noreplySenders", parseList(e.target.value)),
|
|
3858
|
+
disabled: !canWrite
|
|
3859
|
+
}
|
|
3860
|
+
)
|
|
3861
|
+
] })
|
|
3862
|
+
] }) }),
|
|
3863
|
+
/* @__PURE__ */ jsx(Card, { children: /* @__PURE__ */ jsxs(CardContent, { className: "space-y-3 p-4", children: [
|
|
3864
|
+
/* @__PURE__ */ jsx("h2", { className: "font-medium", children: "Prompts de style par canal" }),
|
|
3865
|
+
/* @__PURE__ */ jsxs("div", { children: [
|
|
3866
|
+
/* @__PURE__ */ jsx("label", { htmlFor: "channelPromptEmail", className: "mb-1 block text-sm font-medium", children: "Prompt de style \u2014 email" }),
|
|
3867
|
+
/* @__PURE__ */ jsx(
|
|
3868
|
+
Input,
|
|
3869
|
+
{
|
|
3870
|
+
id: "channelPromptEmail",
|
|
3871
|
+
value: field(form.channelPromptEmail),
|
|
3872
|
+
onChange: (e) => set("channelPromptEmail", e.target.value),
|
|
3873
|
+
disabled: !canWrite
|
|
3874
|
+
}
|
|
3875
|
+
)
|
|
3876
|
+
] }),
|
|
3877
|
+
/* @__PURE__ */ jsxs("div", { children: [
|
|
3878
|
+
/* @__PURE__ */ jsx("label", { htmlFor: "channelPromptWhatsapp", className: "mb-1 block text-sm font-medium", children: "Prompt de style \u2014 WhatsApp" }),
|
|
3879
|
+
/* @__PURE__ */ jsx(
|
|
3880
|
+
Input,
|
|
3881
|
+
{
|
|
3882
|
+
id: "channelPromptWhatsapp",
|
|
3883
|
+
value: field(form.channelPromptWhatsapp),
|
|
3884
|
+
onChange: (e) => set("channelPromptWhatsapp", e.target.value),
|
|
3885
|
+
disabled: !canWrite
|
|
3886
|
+
}
|
|
3887
|
+
)
|
|
3888
|
+
] })
|
|
3889
|
+
] }) }),
|
|
3890
|
+
/* @__PURE__ */ jsx(Card, { children: /* @__PURE__ */ jsxs(CardContent, { className: "space-y-3 p-4", children: [
|
|
3891
|
+
/* @__PURE__ */ jsx("h2", { className: "font-medium", children: "Divers" }),
|
|
3892
|
+
/* @__PURE__ */ jsxs("div", { className: "flex items-center gap-2 text-sm", children: [
|
|
3893
|
+
/* @__PURE__ */ jsx(
|
|
3894
|
+
Checkbox,
|
|
3895
|
+
{
|
|
3896
|
+
checked: bool(form.renameEnabled),
|
|
3897
|
+
onCheckedChange: (v) => set("renameEnabled", v === true),
|
|
3898
|
+
disabled: !canWrite
|
|
3899
|
+
}
|
|
3900
|
+
),
|
|
3901
|
+
"Renommage de sujet activ\xE9"
|
|
3902
|
+
] }),
|
|
3903
|
+
/* @__PURE__ */ jsxs("div", { children: [
|
|
3904
|
+
/* @__PURE__ */ jsx("label", { htmlFor: "renameFrom", className: "mb-1 block text-sm font-medium", children: "Renommage \u2014 motif \xE0 rep\xE9rer dans le sujet" }),
|
|
3905
|
+
/* @__PURE__ */ jsx(
|
|
3906
|
+
Input,
|
|
3907
|
+
{
|
|
3908
|
+
id: "renameFrom",
|
|
3909
|
+
value: field(form.renameFrom),
|
|
3910
|
+
onChange: (e) => set("renameFrom", e.target.value),
|
|
3911
|
+
disabled: !canWrite
|
|
3912
|
+
}
|
|
3913
|
+
)
|
|
3914
|
+
] }),
|
|
3915
|
+
/* @__PURE__ */ jsxs("div", { children: [
|
|
3916
|
+
/* @__PURE__ */ jsx("label", { htmlFor: "renameTo", className: "mb-1 block text-sm font-medium", children: "Renommage \u2014 sujet de remplacement" }),
|
|
3917
|
+
/* @__PURE__ */ jsx(
|
|
3918
|
+
Input,
|
|
3919
|
+
{
|
|
3920
|
+
id: "renameTo",
|
|
3921
|
+
value: field(form.renameTo),
|
|
3922
|
+
onChange: (e) => set("renameTo", e.target.value),
|
|
3923
|
+
disabled: !canWrite
|
|
3924
|
+
}
|
|
3925
|
+
)
|
|
3926
|
+
] }),
|
|
3927
|
+
/* @__PURE__ */ jsxs("div", { children: [
|
|
3928
|
+
/* @__PURE__ */ jsx("label", { htmlFor: "statsTimezone", className: "mb-1 block text-sm font-medium", children: "Fuseau horaire des statistiques" }),
|
|
3929
|
+
/* @__PURE__ */ jsx(
|
|
3930
|
+
Input,
|
|
3931
|
+
{
|
|
3932
|
+
id: "statsTimezone",
|
|
3933
|
+
value: field(form.statsTimezone),
|
|
3934
|
+
onChange: (e) => set("statsTimezone", e.target.value),
|
|
3935
|
+
disabled: !canWrite
|
|
3936
|
+
}
|
|
3937
|
+
)
|
|
3938
|
+
] })
|
|
3939
|
+
] }) }),
|
|
3940
|
+
/* @__PURE__ */ jsx(Card, { id: "pipeline-avance", children: /* @__PURE__ */ jsxs(CardContent, { className: "space-y-3 p-4", children: [
|
|
3941
|
+
/* @__PURE__ */ jsx("h2", { className: "font-medium", children: "Traitement automatique" }),
|
|
3989
3942
|
/* @__PURE__ */ jsx(
|
|
3990
|
-
|
|
3943
|
+
PipelineNodesForm,
|
|
3991
3944
|
{
|
|
3992
|
-
|
|
3993
|
-
|
|
3994
|
-
|
|
3995
|
-
|
|
3945
|
+
value: form.nodes,
|
|
3946
|
+
onChange: (v) => set("nodes", v),
|
|
3947
|
+
canWrite,
|
|
3948
|
+
issueMessage: nodesIssue ? settingsIssueLabel(nodesIssue.key, nodesIssue.message) : null,
|
|
3949
|
+
prompts: promptCatalogue.prompts,
|
|
3950
|
+
promptsLoading: promptCatalogue.isLoading
|
|
3996
3951
|
}
|
|
3997
|
-
)
|
|
3998
|
-
|
|
3999
|
-
|
|
4000
|
-
|
|
4001
|
-
|
|
4002
|
-
|
|
4003
|
-
|
|
4004
|
-
|
|
4005
|
-
|
|
4006
|
-
|
|
4007
|
-
|
|
4008
|
-
|
|
4009
|
-
|
|
4010
|
-
|
|
4011
|
-
|
|
4012
|
-
),
|
|
4013
|
-
promptCatalogue.error !== void 0 && /* @__PURE__ */ jsxs("p", { className: "text-sm text-destructive", children: [
|
|
4014
|
-
"Catalogue de prompts indisponible \u2014 ",
|
|
4015
|
-
describeApiError(promptCatalogue.error)
|
|
4016
|
-
] }),
|
|
4017
|
-
/* @__PURE__ */ jsx(Link, { href: `/espace/${appSlug}/graph-canvas`, children: "Visualiser dans Graphe" })
|
|
4018
|
-
] }) }),
|
|
4019
|
-
/* @__PURE__ */ jsx(Card, { children: /* @__PURE__ */ jsxs(CardContent, { className: "space-y-3 p-4", children: [
|
|
4020
|
-
/* @__PURE__ */ jsx("h2", { className: "font-medium", children: "Agents support" }),
|
|
4021
|
-
/* @__PURE__ */ jsx("p", { className: "text-sm text-muted-foreground", children: "Les agents support sont des utilisateurs plateforme \u2014 donnez-leur acc\xE8s \xE0 cette application depuis la gestion des membres." }),
|
|
4022
|
-
/* @__PURE__ */ jsx(Link, { href: "/parametres/membres", children: "G\xE9rer les acc\xE8s" })
|
|
4023
|
-
] }) }),
|
|
4024
|
-
summaryIssues.length > 0 && /* @__PURE__ */ jsx("div", { className: "rounded-md border border-status-pending bg-status-pending/10 p-3 text-sm", children: summaryIssues.map((issue) => /* @__PURE__ */ jsx("p", { children: settingsIssueLabel(issue.key, issue.message) }, issue.key)) }),
|
|
4025
|
-
canWrite && /* @__PURE__ */ jsx("div", { className: "flex justify-end", children: /* @__PURE__ */ jsx(Button, { onClick: () => void save(form), disabled: isSaving || issues.length > 0, children: isSaving ? "Enregistrement\u2026" : "Enregistrer" }) })
|
|
3952
|
+
),
|
|
3953
|
+
promptCatalogue.error !== void 0 && /* @__PURE__ */ jsxs("p", { className: "text-sm text-destructive", children: [
|
|
3954
|
+
"Catalogue de prompts indisponible \u2014 ",
|
|
3955
|
+
describeApiError(promptCatalogue.error)
|
|
3956
|
+
] }),
|
|
3957
|
+
/* @__PURE__ */ jsx(Link, { href: `/espace/${appSlug}/graph-canvas`, children: "Visualiser dans Graphe" })
|
|
3958
|
+
] }) }),
|
|
3959
|
+
/* @__PURE__ */ jsx(Card, { children: /* @__PURE__ */ jsxs(CardContent, { className: "space-y-3 p-4", children: [
|
|
3960
|
+
/* @__PURE__ */ jsx("h2", { className: "font-medium", children: "Agents support" }),
|
|
3961
|
+
/* @__PURE__ */ jsx("p", { className: "text-sm text-muted-foreground", children: "Les agents support sont des utilisateurs plateforme \u2014 donnez-leur acc\xE8s \xE0 cette application depuis la gestion des membres." }),
|
|
3962
|
+
/* @__PURE__ */ jsx(Link, { href: "/parametres/membres", children: "G\xE9rer les acc\xE8s" })
|
|
3963
|
+
] }) }),
|
|
3964
|
+
summaryIssues.length > 0 && /* @__PURE__ */ jsx("div", { className: "rounded-md border border-status-pending bg-status-pending/10 p-3 text-sm", children: summaryIssues.map((issue) => /* @__PURE__ */ jsx("p", { children: settingsIssueLabel(issue.key, issue.message) }, issue.key)) }),
|
|
3965
|
+
canWrite && /* @__PURE__ */ jsx("div", { className: "flex justify-end", children: /* @__PURE__ */ jsx(Button, { onClick: () => void save(form), disabled: isSaving || issues.length > 0, children: isSaving ? "Enregistrement\u2026" : "Enregistrer" }) })
|
|
3966
|
+
] })
|
|
4026
3967
|
] })
|
|
4027
|
-
|
|
3968
|
+
);
|
|
4028
3969
|
}
|
|
4029
3970
|
|
|
4030
3971
|
// src/ui/graph-canvas/reachability.ts
|