@apotech-os/support-kit 8.4.0 → 9.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/dist/index.d.cts CHANGED
@@ -53,6 +53,20 @@ interface Conversation {
53
53
  * match and divergence alone stays blind to it.
54
54
  */
55
55
  lastAgentReplyAt: Date | null;
56
+ /**
57
+ * Channels Gorgias reports this ticket can be answered on (`reply_options`).
58
+ * Empty on a payload written before the capture existed — which reads as
59
+ * "no channel path", the safe side.
60
+ */
61
+ answerableChannels: string[];
62
+ /**
63
+ * The customer's address on `sourceChannel` (`customer.channels[]`): an
64
+ * Instagram or Facebook id, never an email — that one lives in
65
+ * `customer.email`, because the email path has always had it.
66
+ */
67
+ customerChannelAddress: string | null;
68
+ /** Our own address on `sourceChannel`, read off the inbound message's `source.to`. */
69
+ accountChannelAddress: string | null;
56
70
  /**
57
71
  * True when a CUSTOMER message carries an attachment. Agent messages and
58
72
  * internal notes do not count — an agent attaching a document must not hold
@@ -177,6 +191,52 @@ type WhatsappMode = (typeof WHATSAPP_MODES)[number];
177
191
  * the string literal.
178
192
  */
179
193
  declare const DEFAULT_WHATSAPP_MODE: WhatsappMode;
194
+ /**
195
+ * The Gorgias channels a ticket can arrive on, as `Conversation.sourceChannel`
196
+ * reports them (`isWhatsappTicket(raw) ? 'whatsapp' : raw.channel`).
197
+ *
198
+ * Exists so an operator can say WHERE auto-send applies instead of
199
+ * discovering the answer in a hold — `act` used to decide publication with a
200
+ * binary (WhatsApp, or else email) in a world that has more than two
201
+ * channels.
202
+ *
203
+ * Census of a live Gorgias account, 28/09/2026, 3 000 most recent tickets
204
+ * (count / of which carry an email address):
205
+ * instagram-comment 1858/0 · email 643/643 · instagram-direct-message
206
+ * 202/0 · whatsapp 141/133 · phone 113/86 · chat 19/19 ·
207
+ * instagram-mention 13/0 · facebook 7/0 · facebook-messenger 2/0 ·
208
+ * instagram-ad-comment 1/0 · internal-note 1/1.
209
+ *
210
+ * Listed in that order, so the Réglages checkboxes read in the order an
211
+ * operator meets them. `sms` and `contact-form` are Gorgias channels this
212
+ * account has never seen; they are kept because an allowlist that omits a
213
+ * channel turns it into a silent non-send — the very failure the census was
214
+ * run to avoid, after a first draft of this list missed `instagram-comment`
215
+ * (41 % of the account's volume).
216
+ *
217
+ * A channel this list does not name is deliberately NOT restricted — see
218
+ * `isAutoSendChannel` in `verdict/policy.ts`. The list can only take away
219
+ * what an operator can see and give back.
220
+ */
221
+ declare const SUPPORT_CHANNELS: readonly ["email", "whatsapp", "phone", "chat", "sms", "contact-form", "instagram-direct-message", "instagram-comment", "instagram-mention", "instagram-ad-comment", "facebook", "facebook-messenger"];
222
+ type SupportChannel = (typeof SUPPORT_CHANNELS)[number];
223
+ /**
224
+ * Exactly the channels that were auto-sending BEFORE this setting existed —
225
+ * every one that reaches a customer through the email path, plus WhatsApp.
226
+ *
227
+ * Two defaults were wrong before this one. `['email', 'whatsapp']` would
228
+ * have switched off `chat` (census: 19/19 carry an address) and `phone`
229
+ * (86/113), both auto-sending in production (tickets 597912560, 597887833).
230
+ * The whole catalogue would have been right while no social channel COULD
231
+ * publish — but `domain/publication.ts` now gives Instagram and Facebook a
232
+ * real path, so leaving them checked would start auto-replying there the day
233
+ * this deploys, on a payload shape nobody has validated against the live API
234
+ * (`replyOnChannel`'s own doc).
235
+ *
236
+ * So the social channels ship OFF. Turning one on is an operator's explicit
237
+ * act, after a test ticket has proved the send works.
238
+ */
239
+ declare const DEFAULT_AUTO_SEND_CHANNELS: SupportChannel[];
180
240
  /**
181
241
  * Iso-behaviour mapping (§9.1) from the old boolean to the new mode:
182
242
  * `true → escalate_only`, `false → draft_only`. `auto_reply` is never
@@ -329,6 +389,8 @@ interface AgentProfile {
329
389
  senderEmail: string | null;
330
390
  minConfidence: number;
331
391
  requireHighTriage: boolean;
392
+ /** Where auto-send applies (`SUPPORT_CHANNELS`). An allowlist: a channel absent from it never sends. */
393
+ channels: string[];
332
394
  };
333
395
  rename: {
334
396
  enabled: boolean;
@@ -391,6 +453,19 @@ type OutboundReply = {
391
453
  bodyText: string;
392
454
  /** Forwarded to channels that support it, as defence in depth only — see guarantee below. */
393
455
  idempotencyKey: string;
456
+ } | {
457
+ /** A reply on the ticket's OWN channel — Instagram DM, Facebook Messenger. */
458
+ mode: 'channel';
459
+ channel: string;
460
+ bodyText: string;
461
+ bodyHtml: string;
462
+ /** The customer's address on that channel, not an email (`domain/publication.ts`). */
463
+ toAddress: string;
464
+ /** The brand's own address on that channel. */
465
+ fromAddress: string;
466
+ receiverName: string | null;
467
+ /** Forwarded to channels that support it, as defence in depth only — see guarantee below. */
468
+ idempotencyKey: string;
394
469
  };
395
470
  interface ReplyPort {
396
471
  /**
@@ -786,6 +861,48 @@ interface Verdict {
786
861
  observationId?: string | null;
787
862
  }
788
863
 
864
+ /**
865
+ * HOW a reply can be published on a conversation — the one question `act`
866
+ * used to answer with a binary (WhatsApp, or else email).
867
+ *
868
+ * That binary sent every Instagram and Facebook thread down the email
869
+ * branch, where the contact has no address, and killed it there
870
+ * (`customer_email_missing`, tickets 597737746/597892224). The mistake was
871
+ * not the missing address: it was treating "an email address" as the
872
+ * universal recipient. A Gorgias ticket says otherwise — it carries
873
+ * `reply_options`, naming the channels it can be answered on, and the
874
+ * customer carries one address PER channel (an Instagram id, a Facebook id,
875
+ * an email).
876
+ *
877
+ * So the address requirement belongs to the EMAIL path alone, and every
878
+ * other channel is publishable exactly when Gorgias says it is and both
879
+ * endpoints of the conversation are known.
880
+ */
881
+
882
+ /**
883
+ * - `whatsapp_note` — the chevron-prefixed internal note the WhatsApp bridge
884
+ * forwards; needs no recipient address of any kind.
885
+ * - `email` — an outbound email; needs the customer's email address.
886
+ * - `channel` — a reply posted on the ticket's own channel (Instagram DM,
887
+ * Facebook Messenger…), addressed by the two channel ids.
888
+ */
889
+ type PublicationMode = 'whatsapp_note' | 'email' | 'channel';
890
+ /**
891
+ * The mode a reply would go out on, or `null` when this conversation cannot
892
+ * be answered automatically at all.
893
+ *
894
+ * Order matters and is deliberately conservative:
895
+ * 1. WhatsApp keeps its note path, unchanged.
896
+ * 2. A customer WITH an email address keeps the email path, unchanged —
897
+ * that is how `chat` and `phone` tickets have been auto-answering all
898
+ * along (census 28/09/2026: chat 19/19 and phone 86/113 carry one), and
899
+ * this is not the change to start rerouting them.
900
+ * 3. Only then, a channel Gorgias declares answerable and whose two
901
+ * endpoints are known. This is the new path, and the only one it opens
902
+ * is for contacts that had no address at all.
903
+ */
904
+ declare function publicationMode(conversation: Conversation | null): PublicationMode | null;
905
+
789
906
  /**
790
907
  * `origin` — which pass of the pipeline produced a `triage-decision` /
791
908
  * `generated-response` row (spec-gorgias-followup-webhook-v1 §7.2).
@@ -849,6 +966,8 @@ declare const OUTCOMES: readonly ["sent", "ready", "needs_human", "guardrail_hol
849
966
  type Outcome = (typeof OUTCOMES)[number] | null;
850
967
  /** `outcome` reaches the UI as untrusted JSONB — parse at that boundary. */
851
968
  declare function isOutcome(value: unknown): value is NonNullable<Outcome>;
969
+ /** Why a run that could otherwise have sent did not. `null` when the question never arose. */
970
+ type IneligibleReason = 'no_publication_path' | null;
852
971
  interface TicketRunState {
853
972
  conversation: Conversation | null;
854
973
  classification: Classification | null;
@@ -857,6 +976,15 @@ interface TicketRunState {
857
976
  verdict: Verdict | null;
858
977
  reviseCount: 0 | 1;
859
978
  guardrailHits: string[];
979
+ /**
980
+ * Why auto-send was inapplicable, when the run knew a FACT the stored
981
+ * settings cannot express (28/09/2026). Today's only value: nothing could
982
+ * have published a reply on this conversation — Gorgias did not declare
983
+ * the channel answerable, or an email-mode contact had no address. The
984
+ * ticket timeline reads it rather than re-deriving it, because nothing it
985
+ * can see says what a customer's addresses were six weeks ago.
986
+ */
987
+ ineligibleReason: IneligibleReason;
860
988
  proposedActions: ProposedAction[];
861
989
  outcome: Outcome;
862
990
  }
@@ -1097,6 +1225,24 @@ declare const STOP_PHRASES: ReadonlySet<string>;
1097
1225
  */
1098
1226
  declare const AGENT_GUARDRAILS: readonly ["whatsapp", "whatsapp_stop", "not_customer_turn", "judgeme", "noreply_sender", "triage_not_high", "escalated", "blocklist", "attachment", "short_answer", "uncertainty_marker", "evaluation_missing"];
1099
1227
  type GuardrailId = (typeof AGENT_GUARDRAILS)[number];
1228
+ /**
1229
+ * The OTHER half of the catalogue: `act`'s send-time anti-collision checks
1230
+ * (I8), which land in the same `guardrailHits` as the list above but are
1231
+ * NEVER profile-configurable — hence a separate constant rather than more
1232
+ * entries in `AGENT_GUARDRAILS`, whose whole contract is "what a tenant can
1233
+ * toggle" (see that list's own doc, which draws this line explicitly).
1234
+ *
1235
+ * Declared here anyway, and not left as bare literals in `act.ts`, because
1236
+ * two readers need the names: `ui/tickets/guardrail-labels.ts` (a hit with
1237
+ * no label renders as a raw identifier to an operator) and
1238
+ * `ui/test/verdict-summary.ts` (which splits collision hits from content
1239
+ * hits). Both used to carry their own copy; a sixth check added to `act`
1240
+ * silently missed them.
1241
+ *
1242
+ * Order matches `act`'s own evaluation order, which I8 freezes.
1243
+ */
1244
+ declare const COLLISION_GUARDRAILS: readonly ["customer_email_missing", "ticket_closed", "agent_replied", "diverged", "run_deadline"];
1245
+ type CollisionGuardrailId = (typeof COLLISION_GUARDRAILS)[number];
1100
1246
 
1101
1247
  /**
1102
1248
  * Superset-compatible with `@wopilo/gorgias-client`'s `RawGorgiasTicketPayload`
@@ -1126,20 +1272,58 @@ interface RawTicketMessage {
1126
1272
  stripped_html?: string | null;
1127
1273
  attachments?: unknown[];
1128
1274
  created_datetime?: string | null;
1129
- /** See `isInternalNoteChannel` below (B2). */
1275
+ /**
1276
+ * `type` feeds `isInternalNoteChannel` (B2). `to` is read for one thing
1277
+ * only: OUR address on a social channel, which appears nowhere else in the
1278
+ * payload — the inbound message is addressed to the brand's own channel id
1279
+ * (`domain/publication.ts`).
1280
+ */
1130
1281
  source?: {
1131
1282
  type?: string;
1283
+ to?: Array<{
1284
+ address?: string | null;
1285
+ }> | null;
1132
1286
  } | null;
1133
1287
  }
1288
+ /** One of `customer.channels[]` — the customer's address on a given channel. */
1289
+ interface RawTicketCustomerChannel {
1290
+ type?: string | null;
1291
+ address?: string | null;
1292
+ preferred?: boolean;
1293
+ }
1134
1294
  interface RawTicket {
1135
1295
  channel?: string | null;
1136
1296
  subject?: string | null;
1137
1297
  status?: string | null;
1138
1298
  customer?: {
1139
1299
  email?: string | null;
1300
+ channels?: RawTicketCustomerChannel[] | null;
1140
1301
  } | null;
1302
+ /**
1303
+ * Gorgias' own answer to "where can this ticket be replied to", keyed by
1304
+ * channel. Authoritative and per-ticket, which is why nothing here guesses
1305
+ * it from the channel name (`domain/publication.ts`).
1306
+ */
1307
+ reply_options?: Record<string, {
1308
+ answerable?: boolean;
1309
+ } | null> | null;
1141
1310
  messages?: RawTicketMessage[];
1142
1311
  }
1312
+ /** Channels `reply_options` marks answerable. Empty when the payload has no such key. */
1313
+ declare function answerableChannels(raw: RawTicket | null | undefined): string[];
1314
+ /**
1315
+ * The customer's address on `channel`, preferring the entry Gorgias marks
1316
+ * `preferred` — a contact can carry several (an Instagram DM id AND an
1317
+ * Instagram handle, on the same ticket).
1318
+ */
1319
+ declare function customerChannelAddress(raw: RawTicket | null | undefined, channel: string | null): string | null;
1320
+ /**
1321
+ * Our own address on `channel`: the destination of the customer's own
1322
+ * message. Read off the FIRST inbound message on that channel — the brand's
1323
+ * channel id does not change mid-thread, and a later agent message would
1324
+ * have it as the sender instead.
1325
+ */
1326
+ declare function accountChannelAddress(raw: RawTicket | null | undefined, channel: string | null): string | null;
1143
1327
  declare const WHATSAPP_NOTE_CHEVRON = ">";
1144
1328
  /**
1145
1329
  * True for a `from_agent` internal note whose body starts with the
@@ -1221,6 +1405,46 @@ declare function runGuardrails(input: RunGuardrailsInput): string[];
1221
1405
  */
1222
1406
  declare function guardrailBucket(hit: string): string;
1223
1407
 
1408
+ interface ReconstructHoldInput {
1409
+ /** The conversation as the run saw it when it drafted — rebuilt from the record's own `tracedInput` and generation-time snapshot. */
1410
+ generatedFrom: Conversation;
1411
+ /** The conversation as `act` would have re-read it, rebuilt from the Gorgias ticket truncated at the instant the run ended. */
1412
+ atSend: Conversation;
1413
+ /** The triage-decision this response was written under. */
1414
+ classification: Classification | null;
1415
+ /** The text the run drafted — `generated-response.responseText`. */
1416
+ draftText: string;
1417
+ /** Today's settings, as a profile. The approximation this module's own doc warns about. */
1418
+ profile: Pick<AgentProfile, 'guardrails' | 'autoSend'>;
1419
+ /** When the run ended, for `act`'s agent-reply window. `null` falls back to generation time. */
1420
+ queuedAt: Date | null;
1421
+ }
1422
+ /**
1423
+ * The hits the run would have recorded, in the order it would have recorded
1424
+ * them. Empty means "cannot be explained from what survives" — an honest
1425
+ * result the caller must report as unknown, not as "no guardrail fired".
1426
+ */
1427
+ declare function reconstructGuardrailHits(input: ReconstructHoldInput): string[];
1428
+ /** The three moving facts `act`'s re-read would have seen, as of one instant. */
1429
+ interface RawTicketFactsAt {
1430
+ messageCount: number;
1431
+ lastMessageAt: Date | null;
1432
+ lastAgentReplyAt: Date | null;
1433
+ }
1434
+ /**
1435
+ * What a Gorgias ticket looked like at `instant` — the only way to ask what
1436
+ * `act`'s fresh re-read saw, months later, from a payload that has kept
1437
+ * growing since.
1438
+ *
1439
+ * Messages are dropped by `created_datetime`, then the ticket is handed to
1440
+ * the SAME counting and agent-reply rules the live mapping uses
1441
+ * (`adapters/conversation-mapping.ts`), so a reconstruction cannot disagree
1442
+ * with production about what counts as a message. A message with no
1443
+ * timestamp at all is kept: it predates nothing we can prove, and keeping it
1444
+ * errs toward finding a hold rather than inventing a clean run.
1445
+ */
1446
+ declare function rawTicketFactsAt(raw: RawTicket, instant: Date): RawTicketFactsAt;
1447
+
1224
1448
  /**
1225
1449
  * A judged candidate reply, as produced by the evaluation agent (agent 4).
1226
1450
  * @deprecated Legacy `verifyReply` vocabulary — see this module's header
@@ -1448,12 +1672,23 @@ declare function isSendable(verdict: Verdict | null, profile: AgentProfile): boo
1448
1672
  * from `guardrail_hold`+tag to `ready`+no tag — losing the tag is a bigger
1449
1673
  * behaviour change than the one this predicate closes.
1450
1674
  *
1451
- * Whatsapp spec §4.4: `autoSend.senderEmail` is required in EMAIL mode only
1452
- * — a WhatsApp note has no "from" email address to send with. The sender
1453
- * exemption below is scoped to `whatsappMode === 'auto_reply'` specifically
1454
- * — the ONE mode where a WhatsApp note is actually the reply that would go
1455
- * out — NOT to every WhatsApp ticket, to keep `escalate_only` iso-behaviour
1456
- * to the byte.
1675
+ * Whatsapp spec §4.4: `autoSend.senderEmail` is the address an email goes
1676
+ * out FROM, so the EMAIL path is the only one that needs it — asked of
1677
+ * `publicationMode` rather than re-derived from the channel here, so the
1678
+ * requirement follows the one decision that names the path.
1679
+ *
1680
+ * That answer also covers the conversation no path can reach at all
1681
+ * (`publicationMode` → `null`), which deliberately does NOT need a sender:
1682
+ * failing eligibility on it here would skip the `guardrails` node entirely,
1683
+ * and `hasPublicationPath` below exists precisely so that question is asked
1684
+ * after they have had their say.
1685
+ *
1686
+ * Reading the mode replaces an exemption scoped to `whatsappMode ===
1687
+ * 'auto_reply'`, which kept a sender-less tenant's `escalate_only` WhatsApp
1688
+ * tickets OUT of the guardrails — they ended `ready` with no tag, where the
1689
+ * `whatsapp` guardrail would have held them for a human. That hit is the
1690
+ * audit trail §5.1 asks for; a missing email address was never a reason to
1691
+ * lose it.
1457
1692
  */
1458
1693
  declare function isAutoSendEligible(state: TicketRunState, deps: Pick<NodeDeps, 'profile' | 'category'>): boolean;
1459
1694
  /**
@@ -1927,7 +2162,7 @@ declare function validateSettings(settings: Record<string, unknown>): SettingsVa
1927
2162
  * written in French straight away — unlike `validateSettings`' own, they are
1928
2163
  * never logged, never returned by a handler, and so need no translation layer.
1929
2164
  */
1930
- type SettingsWarningKey = 'appScopeTagVetoesFollowups' | 'appScopeTagCollision' | 'scopeTagMismatch';
2165
+ type SettingsWarningKey = 'appScopeTagVetoesFollowups' | 'appScopeTagCollision' | 'scopeTagMismatch' | 'noAutoSendChannels';
1931
2166
  interface SettingsWarning {
1932
2167
  key: SettingsWarningKey;
1933
2168
  /** Operator-facing French, safe to show as-is. */
@@ -2048,6 +2283,8 @@ interface SupportKitSettings {
2048
2283
  appScopeTag: string;
2049
2284
  autoSendEnabled: boolean;
2050
2285
  senderEmail: string;
2286
+ /** Optional: apps deployed before the field existed have no value stored. */
2287
+ autoSendChannels?: string[];
2051
2288
  requireHighTriageConfidence: boolean;
2052
2289
  whatsappMode: WhatsappMode;
2053
2290
  responseTtlMinutes: number;
@@ -2207,4 +2444,4 @@ interface SupportPipelineFragments {
2207
2444
  }
2208
2445
  declare function buildSupportPipeline(config: SupportPipelineConfig): SupportPipelineFragments;
2209
2446
 
2210
- export { AGENT_GUARDRAILS, AGENT_STATUSES, AGENT_TOOLS, ATTACHMENT_MARKER_ONLY, type ActionDecision, type AgentProfile, type AgentStatus, type AuditTags, type AutoReplyGuardSettings, type Budget, CANDIDATE_MIN_LENGTH, type CatalogueTool, type CategoryPolicy, type CategoryReferentialEntry, type ChannelKind, type ChatMessage, type Classification, type ClockPort, type CompletionRequest, type CompletionResult, type Conversation, type ConversationPort, type ConversationRef, type CostLedger, type CustomerInfo, DECISION_ORIGINS, DEFAULT_CHANNEL_PROMPT_EMAIL, DEFAULT_CHANNEL_PROMPT_WHATSAPP, DEFAULT_DECISION_ORIGIN, DEFAULT_LLM_PROVIDER, DEFAULT_PROFILE_KEY, DEFAULT_WHATSAPP_MODE, type DecisionOrigin, type Draft, type DraftAttribution, type DraftNodeConfig, EVALUATION_VERDICTS, type EscalateNodeConfig, type EvaluateNodeConfig, type EvaluationVerdict, GENERATED_RESPONSE_STATUSES, type GeneratedResponseStatus, type GuardrailId, InvalidStatusTransitionError, type JsonSchema, type JudgedReply, type KnowledgeHit, type LlmPort, type Message, MissingPromptError, NODE_NAMES, type Node, type NodeCost, type NodeDeps, type NodeKey, type NodeName, type NodeStep, ORIGIN_DESCRIPTION, OUTCOMES, type OrderSummary, type OutboundReply, type Outcome, PROMPT_SLOTS, type PlatformPromptReader, type PortName, type PromptCacheEntry, type PromptCachePort, type PromptDegradedEvent, type PromptNameConfig, type PromptPort, type PromptRef, type PromptReference, type PromptResolverDeps, type PromptSlot, type PromptTableKey, type ProposedAction, REASONING_MAX_LEN, type RawPrompt, type RawPromptConfig, type RawTicket, type ReasoningEffort, type RecordDef, type ReplyPort, type ResolvedPrompt, type ResumeFrom, type ReviseNodeConfig, type RunGuardrailsInput, type RunStamp, type RunTicketOptions, type RunUntil, STOP_PHRASES, SUPPORT_KIT_SETTINGS_FIELDS, type SettingsIssueKey, type SettingsValidationIssue, type SettingsWarning, type SettingsWarningKey, type SimilarTicket, type SourceDescriptor, type StatePort, type SupportKitNodeSettings, type SupportKitSettings, type SupportPipelineConfig, type SupportPipelineFragments, type TicketRunState, type ToolCallRecord, type ToolCallRequest, type ToolContext, type ToolPolicy, type ToolSpec, type TrackingSummary, type TriageNodeConfig, UNCERTAINTY_MARKERS, type Usage, type Verdict, type VerifyReplyInput, type VerifyReplyResult, WHATSAPP_MODES, WHATSAPP_NOTE_CHEVRON, type WhatsappMode, agentRecord, assertTransition, buildCategoryRecord, buildDiffAnalysisRecord, buildEvaluationRecord, buildGeneratedResponseRecord, buildResponseComparisonRecord, buildSupportKitRecords, buildSupportPipeline, buildTriageDecisionRecord, canTransition, categoryGroupRecord, channelPreGates, createBudget, createPromptResolver, diffAnalysisUniqueKey, firstCustomerMessage, guardrailBucket, hasCustomerAttachment, hasReferences, initialState, isAutoSendEligible, isAutomatedSenderEmail, isAutomatedSenderTicket, isCustomerTurnWithWords, isDecisionOrigin, isEvaluationVerdict, isGeneratedResponseStatus, isJudgemeConversation, isJudgemeTicket, isOutcome, isSendable, isSendableVerdict, isTerminalStatus, isTicketClosed, isWhatsappChevronNote, isWhatsappTicket, lastCustomerMessage, needsRevision, openTicketKeyFor, parseReferences, pipelineStateRecord, promptCacheRecord, reclaimStalledSend, requiresFollowup, resolvePromptName, runGuardrails, runTicket, settingsToProfile, settingsWarnings, stopOptOut, targetRefFor, toDecisionOrigin, validateSettings, verifyReply, whatsappModeFromLegacyBoolean };
2447
+ export { AGENT_GUARDRAILS, AGENT_STATUSES, AGENT_TOOLS, ATTACHMENT_MARKER_ONLY, type ActionDecision, type AgentProfile, type AgentStatus, type AuditTags, type AutoReplyGuardSettings, type Budget, CANDIDATE_MIN_LENGTH, COLLISION_GUARDRAILS, type CatalogueTool, type CategoryPolicy, type CategoryReferentialEntry, type ChannelKind, type ChatMessage, type Classification, type ClockPort, type CollisionGuardrailId, type CompletionRequest, type CompletionResult, type Conversation, type ConversationPort, type ConversationRef, type CostLedger, type CustomerInfo, DECISION_ORIGINS, DEFAULT_AUTO_SEND_CHANNELS, DEFAULT_CHANNEL_PROMPT_EMAIL, DEFAULT_CHANNEL_PROMPT_WHATSAPP, DEFAULT_DECISION_ORIGIN, DEFAULT_LLM_PROVIDER, DEFAULT_PROFILE_KEY, DEFAULT_WHATSAPP_MODE, type DecisionOrigin, type Draft, type DraftAttribution, type DraftNodeConfig, EVALUATION_VERDICTS, type EscalateNodeConfig, type EvaluateNodeConfig, type EvaluationVerdict, GENERATED_RESPONSE_STATUSES, type GeneratedResponseStatus, type GuardrailId, type IneligibleReason, InvalidStatusTransitionError, type JsonSchema, type JudgedReply, type KnowledgeHit, type LlmPort, type Message, MissingPromptError, NODE_NAMES, type Node, type NodeCost, type NodeDeps, type NodeKey, type NodeName, type NodeStep, ORIGIN_DESCRIPTION, OUTCOMES, type OrderSummary, type OutboundReply, type Outcome, PROMPT_SLOTS, type PlatformPromptReader, type PortName, type PromptCacheEntry, type PromptCachePort, type PromptDegradedEvent, type PromptNameConfig, type PromptPort, type PromptRef, type PromptReference, type PromptResolverDeps, type PromptSlot, type PromptTableKey, type ProposedAction, type PublicationMode, REASONING_MAX_LEN, type RawPrompt, type RawPromptConfig, type RawTicket, type RawTicketFactsAt, type ReasoningEffort, type ReconstructHoldInput, type RecordDef, type ReplyPort, type ResolvedPrompt, type ResumeFrom, type ReviseNodeConfig, type RunGuardrailsInput, type RunStamp, type RunTicketOptions, type RunUntil, STOP_PHRASES, SUPPORT_CHANNELS, SUPPORT_KIT_SETTINGS_FIELDS, type SettingsIssueKey, type SettingsValidationIssue, type SettingsWarning, type SettingsWarningKey, type SimilarTicket, type SourceDescriptor, type StatePort, type SupportChannel, type SupportKitNodeSettings, type SupportKitSettings, type SupportPipelineConfig, type SupportPipelineFragments, type TicketRunState, type ToolCallRecord, type ToolCallRequest, type ToolContext, type ToolPolicy, type ToolSpec, type TrackingSummary, type TriageNodeConfig, UNCERTAINTY_MARKERS, type Usage, type Verdict, type VerifyReplyInput, type VerifyReplyResult, WHATSAPP_MODES, WHATSAPP_NOTE_CHEVRON, type WhatsappMode, accountChannelAddress, agentRecord, answerableChannels, assertTransition, buildCategoryRecord, buildDiffAnalysisRecord, buildEvaluationRecord, buildGeneratedResponseRecord, buildResponseComparisonRecord, buildSupportKitRecords, buildSupportPipeline, buildTriageDecisionRecord, canTransition, categoryGroupRecord, channelPreGates, createBudget, createPromptResolver, customerChannelAddress, diffAnalysisUniqueKey, firstCustomerMessage, guardrailBucket, hasCustomerAttachment, hasReferences, initialState, isAutoSendEligible, isAutomatedSenderEmail, isAutomatedSenderTicket, isCustomerTurnWithWords, isDecisionOrigin, isEvaluationVerdict, isGeneratedResponseStatus, isJudgemeConversation, isJudgemeTicket, isOutcome, isSendable, isSendableVerdict, isTerminalStatus, isTicketClosed, isWhatsappChevronNote, isWhatsappTicket, lastCustomerMessage, needsRevision, openTicketKeyFor, parseReferences, pipelineStateRecord, promptCacheRecord, publicationMode, rawTicketFactsAt, reclaimStalledSend, reconstructGuardrailHits, requiresFollowup, resolvePromptName, runGuardrails, runTicket, settingsToProfile, settingsWarnings, stopOptOut, targetRefFor, toDecisionOrigin, validateSettings, verifyReply, whatsappModeFromLegacyBoolean };