@apotech-os/support-kit 2.8.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/ui/index.js CHANGED
@@ -1,4 +1,4 @@
1
- import { GENERATED_RESPONSE_STATUSES, EVALUATION_VERDICTS, WHATSAPP_MODES, validateSettings, AGENT_GUARDRAILS, toCategory, toTriageDecision, toAgent, toGeneratedResponse, isGeneratedResponseStatus, toCategoryGroup, toResponseComparison, toDiffAnalysis, NODE_NAMES, settingsToProfile, hasNoDraftNode, guardrailBucket, computeWordDiff, DEFAULT_LLM_PROVIDER, isSendableVerdict, DEFAULT_MAX_TOOL_CALLS, DEFAULT_MIN_CONFIDENCE, DEFAULT_ESCALATION_ENABLED } from '../chunk-47QWWJBP.js';
1
+ import { GENERATED_RESPONSE_STATUSES, EVALUATION_VERDICTS, WHATSAPP_MODES, validateSettings, AGENT_GUARDRAILS, toCategory, toTriageDecision, toAgent, toGeneratedResponse, isGeneratedResponseStatus, toCategoryGroup, toResponseComparison, toDiffAnalysis, NODE_NAMES, settingsToProfile, hasNoDraftNode, guardrailBucket, computeWordDiff, DEFAULT_LLM_PROVIDER, isSendableVerdict, DEFAULT_MAX_TOOL_CALLS, DEFAULT_MIN_CONFIDENCE, DEFAULT_ESCALATION_ENABLED } from '../chunk-CVYJU4SV.js';
2
2
  import { useState, useMemo, useRef, useEffect, useCallback, useId } from 'react';
3
3
  import { useAppContext, useAppSettings, Card, CardContent, Button, Link, KpiCard, BarChart, StackedBarChart, DataTable, Select, useAppApi, useToast, Badge, FunnelChart, Spinner, LineChart, Input, Switch, Checkbox, Textarea, cn, SidePanel, CopyButton, Modal, Tooltip, AppInvokeError } from '@apotech-os/ui-sdk';
4
4
  import { jsxs, jsx, Fragment } from 'react/jsx-runtime';
@@ -836,6 +836,7 @@ function idempotencyKeyFor(operation, payload) {
836
836
  var SETTINGS_ISSUE_LABELS = {
837
837
  sourceViewId: "Vue Gorgias source requise \u2014 choisissez la vue que cette app poss\xE8de.",
838
838
  nodes: "nodes.triage doit \xEAtre configur\xE9 \u2014 une \xE9tape de triage \xE0 null ne triagerait rien.",
839
+ nodePrompt: "Chaque \xE9tape active doit d\xE9signer un prompt Langfuse \u2014 sans prompt, l'\xE9tape n'a rien \xE0 dire au mod\xE8le.",
839
840
  senderEmail: "Adresse d'envoi requise quand l'envoi automatique est actif (sauf en mode WhatsApp \xAB auto_reply \xBB)."
840
841
  };
841
842
  function settingsIssueLabel(key, fallback) {
@@ -3068,6 +3069,25 @@ function stepBoolean(step, field2, fallback) {
3068
3069
  const value = step?.[field2];
3069
3070
  return typeof value === "boolean" ? value : fallback;
3070
3071
  }
3072
+ function stepUsesAgentPrompt(key) {
3073
+ return key === "draft";
3074
+ }
3075
+ var DEFAULT_PROMPT_LABEL = "production";
3076
+ function stepPromptName(step) {
3077
+ return readPromptField(step, "name");
3078
+ }
3079
+ function stepPromptLabel(step) {
3080
+ return readPromptField(step, "label") || DEFAULT_PROMPT_LABEL;
3081
+ }
3082
+ function readPromptField(step, field2) {
3083
+ const prompt = step?.prompt;
3084
+ if (typeof prompt !== "object" || prompt === null) return "";
3085
+ const value = prompt[field2];
3086
+ return typeof value === "string" ? value : "";
3087
+ }
3088
+ function promptPatch(name, label) {
3089
+ return { prompt: { name, label } };
3090
+ }
3071
3091
  function stepReasoning(step) {
3072
3092
  const value = step?.reasoning;
3073
3093
  return REASONING_EFFORTS.some((effort) => effort.value === value) ? value : "off";
@@ -3147,7 +3167,14 @@ function applyPreset(value, preset, restore) {
3147
3167
  return next;
3148
3168
  }
3149
3169
  var PERCENT = 100;
3150
- function PipelineNodesForm({ value, onChange, canWrite, issueMessage }) {
3170
+ function PipelineNodesForm({
3171
+ value,
3172
+ onChange,
3173
+ canWrite,
3174
+ issueMessage,
3175
+ prompts,
3176
+ promptsLoading = false
3177
+ }) {
3151
3178
  const [remembered, setRemembered] = useState({});
3152
3179
  useEffect(() => {
3153
3180
  setRemembered((prev) => {
@@ -3192,15 +3219,13 @@ function PipelineNodesForm({ value, onChange, canWrite, issueMessage }) {
3192
3219
  value,
3193
3220
  canWrite,
3194
3221
  issueMessage: step.key === "triage" ? issueMessage : null,
3222
+ prompts,
3223
+ promptsLoading,
3195
3224
  onToggle: (on) => toggleStep(step.key, on),
3196
3225
  onPatch: (patch) => onChange(withStepFields(value, step.key, patch))
3197
3226
  },
3198
3227
  step.key
3199
- )) }),
3200
- /* @__PURE__ */ jsxs("details", { children: [
3201
- /* @__PURE__ */ jsx("summary", { className: "cursor-pointer text-sm font-medium", children: "Mode avanc\xE9 (JSON)" }),
3202
- /* @__PURE__ */ jsx("div", { className: "mt-3", children: /* @__PURE__ */ jsx(NodesJsonField, { value, onChange, disabled: !canWrite }) })
3203
- ] })
3228
+ )) })
3204
3229
  ] });
3205
3230
  }
3206
3231
  function StepRow({
@@ -3208,11 +3233,14 @@ function StepRow({
3208
3233
  value,
3209
3234
  canWrite,
3210
3235
  issueMessage,
3236
+ prompts,
3237
+ promptsLoading,
3211
3238
  onToggle,
3212
3239
  onPatch
3213
3240
  }) {
3214
3241
  const enabled = isStepEnabled(value, step.key);
3215
3242
  const blockedReason = stepBlockedReason(value, step.key);
3243
+ const promptFieldId = useId();
3216
3244
  const triageLocked = step.key === "triage" && enabled;
3217
3245
  const editable = canWrite && !blockedReason && !triageLocked;
3218
3246
  const toggle = /* @__PURE__ */ jsx(
@@ -3237,6 +3265,21 @@ function StepRow({
3237
3265
  ] }),
3238
3266
  blockedReason && /* @__PURE__ */ jsx("p", { className: "text-sm text-muted-foreground", children: blockedReason }),
3239
3267
  issueMessage && !enabled && /* @__PURE__ */ jsx("p", { className: "text-sm text-destructive", children: issueMessage }),
3268
+ enabled && // In the row itself, NOT behind « Options »: this is the one field
3269
+ // without which the step cannot run at all, so it is stated where the
3270
+ // step is, next to its own switch.
3271
+ /* @__PURE__ */ jsx("div", { className: "rounded-md bg-muted/40 p-3", children: /* @__PURE__ */ jsx(
3272
+ StepPromptField,
3273
+ {
3274
+ step,
3275
+ settings: readStep(value, step.key),
3276
+ disabled: !canWrite || blockedReason !== null,
3277
+ prompts,
3278
+ promptsLoading,
3279
+ id: promptFieldId,
3280
+ onPatch
3281
+ }
3282
+ ) }),
3240
3283
  enabled && /* @__PURE__ */ jsxs("details", { children: [
3241
3284
  /* @__PURE__ */ jsx("summary", { className: "cursor-pointer text-sm text-muted-foreground", children: "Options" }),
3242
3285
  /* @__PURE__ */ jsx("div", { className: "mt-3 grid gap-4 rounded-md bg-muted/40 p-3 sm:grid-cols-2", children: /* @__PURE__ */ jsx(
@@ -3375,6 +3418,63 @@ function StepOptions({
3375
3418
  ] })
3376
3419
  ] });
3377
3420
  }
3421
+ function StepPromptField({
3422
+ step,
3423
+ settings,
3424
+ disabled,
3425
+ prompts,
3426
+ promptsLoading,
3427
+ id,
3428
+ onPatch
3429
+ }) {
3430
+ if (stepUsesAgentPrompt(step.key)) {
3431
+ return /* @__PURE__ */ jsx("p", { className: "text-sm text-muted-foreground", children: "Le prompt de cette \xE9tape est celui de l'agent qui r\xE9dige \u2014 il se choisit sur la page Agents." });
3432
+ }
3433
+ const name = stepPromptName(settings);
3434
+ const label = stepPromptLabel(settings);
3435
+ const known = prompts.find((entry) => entry.name === name);
3436
+ const orphaned = name !== "" && !known && !promptsLoading;
3437
+ const labels = known?.labels.length ? known.labels : [DEFAULT_PROMPT_LABEL];
3438
+ return /* @__PURE__ */ jsxs(Fragment, { children: [
3439
+ /* @__PURE__ */ jsx("label", { htmlFor: id, className: "mb-1 block text-sm font-medium", children: "Prompt Langfuse" }),
3440
+ /* @__PURE__ */ jsxs("div", { className: "grid gap-2 sm:grid-cols-2", children: [
3441
+ /* @__PURE__ */ jsx(
3442
+ Select,
3443
+ {
3444
+ "aria-label": `Prompt \u2014 ${step.label}`,
3445
+ value: known ? name : void 0,
3446
+ onValueChange: (next) => onPatch(promptPatch(next, DEFAULT_PROMPT_LABEL)),
3447
+ items: [
3448
+ ...orphaned ? [{ value: name, label: `${name} \u2014 introuvable dans Langfuse` }] : [],
3449
+ ...prompts.map((entry) => ({ value: entry.name, label: entry.name }))
3450
+ ],
3451
+ disabled: disabled || promptsLoading
3452
+ }
3453
+ ),
3454
+ /* @__PURE__ */ jsx(
3455
+ Select,
3456
+ {
3457
+ "aria-label": `Version du prompt \u2014 ${step.label}`,
3458
+ value: labels.includes(label) ? label : void 0,
3459
+ onValueChange: (next) => onPatch(promptPatch(name, next)),
3460
+ items: labels.map((entry) => ({ value: entry, label: entry })),
3461
+ disabled: disabled || promptsLoading || name === ""
3462
+ }
3463
+ )
3464
+ ] }),
3465
+ name === "" && !promptsLoading && /* @__PURE__ */ jsx("p", { className: "mt-1 text-sm text-destructive", children: "Aucun prompt choisi \u2014 cette \xE9tape ne peut pas s'ex\xE9cuter tant qu'elle n'en d\xE9signe pas un." }),
3466
+ orphaned && /* @__PURE__ */ jsxs("p", { className: "mt-1 text-sm text-destructive", children: [
3467
+ "\xAB ",
3468
+ name,
3469
+ " \xBB n'est pas dans le catalogue de cette app \u2014 le prochain traitement \xE9chouera tant que ce prompt n'est pas r\xE9tabli ou remplac\xE9."
3470
+ ] }),
3471
+ /* @__PURE__ */ jsxs("p", { className: "mt-1 text-xs text-muted-foreground", children: [
3472
+ "Le label suit les promotions faites dans Langfuse : promouvoir une nouvelle version sous \xAB ",
3473
+ label,
3474
+ " \xBB la met en service sans repasser ici."
3475
+ ] })
3476
+ ] });
3477
+ }
3378
3478
  function useIds(stepKey) {
3379
3479
  const base2 = useId();
3380
3480
  return {
@@ -3385,68 +3485,36 @@ function useIds(stepKey) {
3385
3485
  minConfidence: `${base2}-${stepKey}-min-confidence`
3386
3486
  };
3387
3487
  }
3388
- function NodesJsonField({
3389
- value,
3390
- onChange,
3391
- disabled
3392
- }) {
3393
- const id = useId();
3394
- const serialized = stringify(value);
3395
- const [text, setText] = useState(serialized);
3396
- const [parseError, setParseError] = useState(null);
3397
- const emittedRef = useRef(serialized);
3488
+ function usePromptCatalogue() {
3489
+ const { appSlug } = useAppContext();
3490
+ const api = useAppApi();
3491
+ const [prompts, setPrompts] = useState([]);
3492
+ const [isLoading, setIsLoading] = useState(true);
3493
+ const [error, setError] = useState(void 0);
3494
+ const clientRef = useRef(api);
3495
+ clientRef.current = api;
3496
+ const requestIdRef = useRef(0);
3497
+ const isMountedRef = useRef(true);
3398
3498
  useEffect(() => {
3399
- if (serialized === emittedRef.current) return;
3400
- emittedRef.current = serialized;
3401
- setText(serialized);
3402
- setParseError(null);
3403
- }, [serialized]);
3404
- function handleChange(next) {
3405
- setText(next);
3406
- try {
3407
- const parsed = JSON.parse(next);
3408
- emittedRef.current = stringify(parsed);
3409
- onChange(parsed);
3410
- setParseError(null);
3411
- } catch {
3412
- setParseError("JSON invalide \u2014 la derni\xE8re valeur valide est conserv\xE9e tant que ce texte ne parse pas.");
3413
- }
3414
- }
3415
- return /* @__PURE__ */ jsxs("div", { children: [
3416
- /* @__PURE__ */ jsx("label", { htmlFor: id, className: "mb-1 block text-sm font-medium", children: "\xC9tapes du graphe (JSON)" }),
3417
- /* @__PURE__ */ jsx(
3418
- Textarea,
3419
- {
3420
- id,
3421
- className: "font-mono text-xs",
3422
- rows: 10,
3423
- value: text,
3424
- disabled,
3425
- onChange: (e) => handleChange(e.target.value)
3426
- }
3427
- ),
3428
- parseError && /* @__PURE__ */ jsx("p", { className: "mt-1 text-sm text-destructive", children: parseError }),
3429
- /* @__PURE__ */ jsxs("p", { className: "mt-1 text-xs text-muted-foreground", children: [
3430
- "Chaque cl\xE9 optionnelle (",
3431
- /* @__PURE__ */ jsx("code", { children: "escalate" }),
3432
- ", ",
3433
- /* @__PURE__ */ jsx("code", { children: "draft" }),
3434
- ", ",
3435
- /* @__PURE__ */ jsx("code", { children: "evaluate" }),
3436
- ",",
3437
- " ",
3438
- /* @__PURE__ */ jsx("code", { children: "revise" }),
3439
- ") accepte ",
3440
- /* @__PURE__ */ jsx("code", { children: "null" }),
3441
- " pour d\xE9sactiver l'\xE9tape (\xA73.6).",
3442
- " ",
3443
- /* @__PURE__ */ jsx("code", { children: "triage" }),
3444
- " est obligatoire."
3445
- ] })
3446
- ] });
3447
- }
3448
- function stringify(value) {
3449
- return JSON.stringify(value ?? null, null, 2);
3499
+ isMountedRef.current = true;
3500
+ const requestId = ++requestIdRef.current;
3501
+ setIsLoading(true);
3502
+ void clientRef.current.get(`/data/apps/${appSlug}/prompts`).then((catalogue) => {
3503
+ if (requestId !== requestIdRef.current || !isMountedRef.current) return;
3504
+ setPrompts(catalogue);
3505
+ setError(void 0);
3506
+ }).catch((err) => {
3507
+ if (requestId !== requestIdRef.current || !isMountedRef.current) return;
3508
+ setError(err);
3509
+ }).finally(() => {
3510
+ if (requestId !== requestIdRef.current || !isMountedRef.current) return;
3511
+ setIsLoading(false);
3512
+ });
3513
+ return () => {
3514
+ isMountedRef.current = false;
3515
+ };
3516
+ }, [appSlug]);
3517
+ return { prompts, isLoading, error };
3450
3518
  }
3451
3519
  var WHATSAPP_MODE_LABELS = {
3452
3520
  escalate_only: "Escalade uniquement",
@@ -3502,6 +3570,7 @@ function SettingsPage() {
3502
3570
  const [uncheckedAppSlugs, setUncheckedAppSlugs] = useState([]);
3503
3571
  const [installedAppsUnavailable, setInstalledAppsUnavailable] = useState(false);
3504
3572
  const [connections, setConnections] = useState(void 0);
3573
+ const promptCatalogue = usePromptCatalogue();
3505
3574
  const formInitializedRef = useRef(false);
3506
3575
  useEffect(() => {
3507
3576
  if (settings && !formInitializedRef.current) {
@@ -3570,319 +3639,333 @@ function SettingsPage() {
3570
3639
  checked ? [.../* @__PURE__ */ new Set([...guardrailsActive, id])] : guardrailsActive.filter((g) => g !== id)
3571
3640
  );
3572
3641
  }
3573
- return /* @__PURE__ */ jsxs(PageShell, { className: "max-w-3xl", children: [
3574
- /* @__PURE__ */ jsx(PageHeader, { title: "Param\xE8tres", description: "Configuration du pipeline de support." }),
3575
- /* @__PURE__ */ jsx(Card, { id: "source", children: /* @__PURE__ */ jsxs(CardContent, { className: "space-y-3 p-4", children: [
3576
- /* @__PURE__ */ jsx("h2", { className: "font-medium", children: "Source" }),
3577
- /* @__PURE__ */ jsxs("div", { children: [
3578
- /* @__PURE__ */ jsx("span", { className: "mb-1 block text-sm font-medium", children: "Connexion Gorgias" }),
3579
- /* @__PURE__ */ jsx(
3580
- "p",
3581
- {
3582
- className: connection.tone === "error" ? "text-sm text-destructive" : connection.tone === "muted" ? "text-sm text-muted-foreground" : "text-sm",
3583
- children: connection.text
3584
- }
3585
- ),
3586
- /* @__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." })
3587
- ] }),
3588
- /* @__PURE__ */ jsxs("div", { children: [
3589
- /* @__PURE__ */ jsx("label", { htmlFor: "sourceViewId", className: "mb-1 block text-sm font-medium", children: "Vue Gorgias source" }),
3590
- views.length > 0 ? /* @__PURE__ */ jsx(
3591
- Select,
3592
- {
3593
- "aria-label": "Vue Gorgias source",
3594
- value: sourceViewId || void 0,
3595
- onValueChange: (v) => set("sourceViewId", v),
3596
- items: views.map((v) => ({ value: v.id, label: v.name })),
3597
- disabled: !canWrite
3598
- }
3599
- ) : /* @__PURE__ */ jsx(
3600
- Input,
3601
- {
3602
- id: "sourceViewId",
3603
- value: sourceViewId,
3604
- onChange: (e) => set("sourceViewId", e.target.value),
3605
- disabled: !canWrite
3606
- }
3607
- )
3608
- ] }),
3609
- claimedView && claimedView.claimedByAppSlugs.length > 0 && /* @__PURE__ */ jsxs("p", { className: "text-sm text-status-pending", children: [
3610
- "Cette vue est d\xE9j\xE0 utilis\xE9e par : ",
3611
- claimedView.claimedByAppSlugs.join(", ")
3612
- ] }),
3613
- 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." }),
3614
- 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." })
3615
- ] }) }),
3616
- sourceViewId === "" ? null : /* @__PURE__ */ jsxs(Fragment, { children: [
3617
- /* @__PURE__ */ jsx(Card, { id: "cadence", children: /* @__PURE__ */ jsxs(CardContent, { className: "space-y-3 p-4", children: [
3618
- /* @__PURE__ */ jsx("h2", { className: "font-medium", children: "Cadence" }),
3619
- /* @__PURE__ */ jsxs("div", { className: "flex items-center gap-2 text-sm", children: [
3620
- /* @__PURE__ */ jsx(
3621
- Switch,
3622
- {
3623
- "aria-label": "Triage activ\xE9",
3624
- checked: bool(form.triageEnabled),
3625
- onCheckedChange: (v) => set("triageEnabled", v),
3626
- disabled: !canWrite
3627
- }
3628
- ),
3629
- "Triage activ\xE9"
3630
- ] }),
3631
- /* @__PURE__ */ jsxs("div", { className: "flex items-center gap-2 text-sm", children: [
3632
- /* @__PURE__ */ jsx(
3633
- Switch,
3634
- {
3635
- "aria-label": "Mode d'essai",
3636
- checked: bool(form.dryRun),
3637
- onCheckedChange: (v) => set("dryRun", v),
3638
- disabled: !canWrite
3639
- }
3640
- ),
3641
- "Mode d'essai \u2014 le triage tourne en entier, sans aucune \xE9criture Gorgias (ni r\xE9ponse, ni tag)"
3642
- ] }),
3643
- /* @__PURE__ */ jsx(
3644
- NumberField,
3645
- {
3646
- id: "batchLimit",
3647
- label: "Taille de lot",
3648
- value: num(form.batchLimit),
3649
- onChange: (v) => set("batchLimit", v),
3650
- disabled: !canWrite,
3651
- min: 1,
3652
- integer: true
3653
- }
3654
- ),
3655
- /* @__PURE__ */ jsx(
3656
- NumberField,
3657
- {
3658
- id: "triageIntervalMinutes",
3659
- label: "Intervalle de triage (minutes)",
3660
- value: num(form.triageIntervalMinutes),
3661
- onChange: (v) => set("triageIntervalMinutes", v),
3662
- disabled: !canWrite,
3663
- min: 1,
3664
- integer: true
3665
- }
3666
- ),
3667
- /* @__PURE__ */ jsx(
3668
- NumberField,
3669
- {
3670
- id: "responseTtlMinutes",
3671
- label: "Dur\xE9e de vie des r\xE9ponses (minutes)",
3672
- value: num(form.responseTtlMinutes),
3673
- onChange: (v) => set("responseTtlMinutes", v),
3674
- disabled: !canWrite,
3675
- min: 1,
3676
- integer: true
3677
- }
3678
- )
3679
- ] }) }),
3680
- /* @__PURE__ */ jsx(Card, { id: "envoi", children: /* @__PURE__ */ jsxs(CardContent, { className: "space-y-3 p-4", children: [
3681
- /* @__PURE__ */ jsx("h2", { className: "font-medium", children: "Envoi" }),
3682
- /* @__PURE__ */ jsxs("div", { className: "flex items-center gap-2 text-sm", children: [
3683
- /* @__PURE__ */ jsx(
3684
- Switch,
3685
- {
3686
- "aria-label": "Envoi automatique",
3687
- checked: bool(form.autoSendEnabled),
3688
- onCheckedChange: (v) => set("autoSendEnabled", v),
3689
- disabled: !canWrite
3690
- }
3691
- ),
3692
- "Envoi automatique"
3693
- ] }),
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" }),
3694
3653
  /* @__PURE__ */ jsxs("div", { children: [
3695
- /* @__PURE__ */ jsx("label", { htmlFor: "senderEmail", className: "mb-1 block text-sm font-medium", children: "Adresse d'envoi" }),
3654
+ /* @__PURE__ */ jsx("span", { className: "mb-1 block text-sm font-medium", children: "Connexion Gorgias" }),
3696
3655
  /* @__PURE__ */ jsx(
3697
- Input,
3656
+ "p",
3698
3657
  {
3699
- id: "senderEmail",
3700
- value: field(form.senderEmail),
3701
- onChange: (e) => set("senderEmail", e.target.value),
3702
- disabled: !canWrite
3703
- }
3704
- )
3705
- ] }),
3706
- /* @__PURE__ */ jsxs("div", { className: "flex items-center gap-2 text-sm", children: [
3707
- /* @__PURE__ */ jsx(
3708
- Switch,
3709
- {
3710
- "aria-label": "Exiger une confiance de triage \xE9lev\xE9e",
3711
- checked: bool(form.requireHighTriageConfidence),
3712
- onCheckedChange: (v) => set("requireHighTriageConfidence", v),
3713
- 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
3714
3660
  }
3715
3661
  ),
3716
- "Exiger une confiance de triage \xE9lev\xE9e avant tout envoi automatique"
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." })
3717
3663
  ] }),
3718
3664
  /* @__PURE__ */ jsxs("div", { children: [
3719
- /* @__PURE__ */ jsx("label", { htmlFor: "whatsappMode", className: "mb-1 block text-sm font-medium", children: "Mode WhatsApp" }),
3720
- /* @__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(
3721
3667
  Select,
3722
3668
  {
3723
- "aria-label": "Mode WhatsApp",
3724
- value: field(form.whatsappMode) || void 0,
3725
- onValueChange: (v) => set("whatsappMode", v),
3726
- items: WHATSAPP_MODE_OPTIONS,
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 })),
3727
3673
  disabled: !canWrite
3728
3674
  }
3729
- )
3730
- ] })
3731
- ] }) }),
3732
- /* @__PURE__ */ jsx(Card, { children: /* @__PURE__ */ jsxs(CardContent, { className: "space-y-3 p-4", children: [
3733
- /* @__PURE__ */ jsx("h2", { className: "font-medium", children: "Tags d'audit" }),
3734
- [
3735
- ["unknownTag", "Tag inconnu"],
3736
- ["handledTag", "Tag trait\xE9"],
3737
- ["escalationTag", "Tag d'escalade"],
3738
- ["needsHumanTag", "Tag besoin humain"],
3739
- ["autoRepliedTag", "Tag r\xE9pondu automatiquement"],
3740
- ["needsReviewTag", "Tag \xE0 revoir"],
3741
- ["followupTag", "Tag suivi requis"]
3742
- ].map(([key, label]) => /* @__PURE__ */ jsxs("div", { children: [
3743
- /* @__PURE__ */ jsx("label", { htmlFor: key, className: "mb-1 block text-sm font-medium", children: label }),
3744
- /* @__PURE__ */ jsx(Input, { id: key, value: field(form[key]), onChange: (e) => set(key, e.target.value), disabled: !canWrite })
3745
- ] }, key))
3746
- ] }) }),
3747
- /* @__PURE__ */ jsx(Card, { id: "guardrails", children: /* @__PURE__ */ jsxs(CardContent, { className: "space-y-3 p-4", children: [
3748
- /* @__PURE__ */ jsx("h2", { className: "font-medium", children: "Garde-fous" }),
3749
- /* @__PURE__ */ jsxs("div", { children: [
3750
- /* @__PURE__ */ jsx("p", { className: "mb-1 text-sm font-medium", children: "Garde-fous actifs" }),
3751
- /* @__PURE__ */ jsx("div", { className: "grid grid-cols-2 gap-1", children: AGENT_GUARDRAILS.map((id) => /* @__PURE__ */ jsx(
3752
- Checkbox,
3753
- {
3754
- label: guardrailHitLabel(id),
3755
- checked: guardrailsActive.includes(id),
3756
- onCheckedChange: (checked) => toggleGuardrail(id, checked),
3757
- disabled: !canWrite
3758
- },
3759
- id
3760
- )) })
3761
- ] }),
3762
- /* @__PURE__ */ jsxs("div", { children: [
3763
- /* @__PURE__ */ jsx("label", { htmlFor: "blocklist", className: "mb-1 block text-sm font-medium", children: "Liste de blocage" }),
3764
- /* @__PURE__ */ jsx(
3765
- Textarea,
3766
- {
3767
- id: "blocklist",
3768
- value: list(form.blocklist),
3769
- onChange: (e) => set("blocklist", parseList(e.target.value)),
3770
- disabled: !canWrite
3771
- }
3772
- )
3773
- ] }),
3774
- /* @__PURE__ */ jsxs("div", { children: [
3775
- /* @__PURE__ */ jsx("label", { htmlFor: "noreplySenders", className: "mb-1 block text-sm font-medium", children: "Exp\xE9diteurs no-reply (s\xE9par\xE9s par des virgules)" }),
3776
- /* @__PURE__ */ jsx(
3777
- Textarea,
3778
- {
3779
- id: "noreplySenders",
3780
- value: list(form.noreplySenders),
3781
- onChange: (e) => set("noreplySenders", parseList(e.target.value)),
3782
- disabled: !canWrite
3783
- }
3784
- )
3785
- ] })
3786
- ] }) }),
3787
- /* @__PURE__ */ jsx(Card, { children: /* @__PURE__ */ jsxs(CardContent, { className: "space-y-3 p-4", children: [
3788
- /* @__PURE__ */ jsx("h2", { className: "font-medium", children: "Prompts de style par canal" }),
3789
- /* @__PURE__ */ jsxs("div", { children: [
3790
- /* @__PURE__ */ jsx("label", { htmlFor: "channelPromptEmail", className: "mb-1 block text-sm font-medium", children: "Prompt de style \u2014 email" }),
3791
- /* @__PURE__ */ jsx(
3675
+ ) : /* @__PURE__ */ jsx(
3792
3676
  Input,
3793
3677
  {
3794
- id: "channelPromptEmail",
3795
- value: field(form.channelPromptEmail),
3796
- onChange: (e) => set("channelPromptEmail", e.target.value),
3678
+ id: "sourceViewId",
3679
+ value: sourceViewId,
3680
+ onChange: (e) => set("sourceViewId", e.target.value),
3797
3681
  disabled: !canWrite
3798
3682
  }
3799
3683
  )
3800
3684
  ] }),
3801
- /* @__PURE__ */ jsxs("div", { children: [
3802
- /* @__PURE__ */ jsx("label", { htmlFor: "channelPromptWhatsapp", className: "mb-1 block text-sm font-medium", children: "Prompt de style \u2014 WhatsApp" }),
3803
- /* @__PURE__ */ jsx(
3804
- Input,
3805
- {
3806
- id: "channelPromptWhatsapp",
3807
- value: field(form.channelPromptWhatsapp),
3808
- onChange: (e) => set("channelPromptWhatsapp", e.target.value),
3809
- disabled: !canWrite
3810
- }
3811
- )
3812
- ] })
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." })
3813
3691
  ] }) }),
3814
- /* @__PURE__ */ jsx(Card, { children: /* @__PURE__ */ jsxs(CardContent, { className: "space-y-3 p-4", children: [
3815
- /* @__PURE__ */ jsx("h2", { className: "font-medium", children: "Divers" }),
3816
- /* @__PURE__ */ jsxs("div", { className: "flex items-center gap-2 text-sm", children: [
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
+ ] }),
3817
3719
  /* @__PURE__ */ jsx(
3818
- Checkbox,
3720
+ NumberField,
3819
3721
  {
3820
- checked: bool(form.renameEnabled),
3821
- onCheckedChange: (v) => set("renameEnabled", v === true),
3822
- disabled: !canWrite
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
3823
3729
  }
3824
3730
  ),
3825
- "Renommage de sujet activ\xE9"
3826
- ] }),
3827
- /* @__PURE__ */ jsxs("div", { children: [
3828
- /* @__PURE__ */ jsx("label", { htmlFor: "renameFrom", className: "mb-1 block text-sm font-medium", children: "Renommage \u2014 motif \xE0 rep\xE9rer dans le sujet" }),
3829
3731
  /* @__PURE__ */ jsx(
3830
- Input,
3732
+ NumberField,
3831
3733
  {
3832
- id: "renameFrom",
3833
- value: field(form.renameFrom),
3834
- onChange: (e) => set("renameFrom", e.target.value),
3835
- disabled: !canWrite
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
3836
3741
  }
3837
- )
3838
- ] }),
3839
- /* @__PURE__ */ jsxs("div", { children: [
3840
- /* @__PURE__ */ jsx("label", { htmlFor: "renameTo", className: "mb-1 block text-sm font-medium", children: "Renommage \u2014 sujet de remplacement" }),
3742
+ ),
3841
3743
  /* @__PURE__ */ jsx(
3842
- Input,
3744
+ NumberField,
3843
3745
  {
3844
- id: "renameTo",
3845
- value: field(form.renameTo),
3846
- onChange: (e) => set("renameTo", e.target.value),
3847
- disabled: !canWrite
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
3848
3753
  }
3849
3754
  )
3850
- ] }),
3851
- /* @__PURE__ */ jsxs("div", { children: [
3852
- /* @__PURE__ */ jsx("label", { htmlFor: "statsTimezone", className: "mb-1 block text-sm font-medium", children: "Fuseau horaire des statistiques" }),
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" }),
3853
3942
  /* @__PURE__ */ jsx(
3854
- Input,
3943
+ PipelineNodesForm,
3855
3944
  {
3856
- id: "statsTimezone",
3857
- value: field(form.statsTimezone),
3858
- onChange: (e) => set("statsTimezone", e.target.value),
3859
- disabled: !canWrite
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
3860
3951
  }
3861
- )
3862
- ] })
3863
- ] }) }),
3864
- /* @__PURE__ */ jsx(Card, { id: "pipeline-avance", children: /* @__PURE__ */ jsxs(CardContent, { className: "space-y-3 p-4", children: [
3865
- /* @__PURE__ */ jsx("h2", { className: "font-medium", children: "Traitement automatique" }),
3866
- /* @__PURE__ */ jsx(
3867
- PipelineNodesForm,
3868
- {
3869
- value: form.nodes,
3870
- onChange: (v) => set("nodes", v),
3871
- canWrite,
3872
- issueMessage: nodesIssue ? settingsIssueLabel(nodesIssue.key, nodesIssue.message) : null
3873
- }
3874
- ),
3875
- /* @__PURE__ */ jsx(Link, { href: `/espace/${appSlug}/graph-canvas`, children: "Visualiser dans Graphe" })
3876
- ] }) }),
3877
- /* @__PURE__ */ jsx(Card, { children: /* @__PURE__ */ jsxs(CardContent, { className: "space-y-3 p-4", children: [
3878
- /* @__PURE__ */ jsx("h2", { className: "font-medium", children: "Agents support" }),
3879
- /* @__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." }),
3880
- /* @__PURE__ */ jsx(Link, { href: "/parametres/membres", children: "G\xE9rer les acc\xE8s" })
3881
- ] }) }),
3882
- 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)) }),
3883
- 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
+ ] })
3884
3967
  ] })
3885
- ] });
3968
+ );
3886
3969
  }
3887
3970
 
3888
3971
  // src/ui/graph-canvas/reachability.ts