@apotech-os/support-kit 2.9.1 → 3.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/{chunk-CVYJU4SV.js → chunk-KCPVWKUY.js} +7 -13
- package/dist/chunk-KCPVWKUY.js.map +1 -0
- package/dist/index.cjs +45 -30
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +23 -24
- package/dist/index.d.ts +23 -24
- package/dist/index.js +43 -21
- package/dist/index.js.map +1 -1
- package/dist/ui/index.cjs +579 -422
- package/dist/ui/index.cjs.map +1 -1
- package/dist/ui/index.js +410 -253
- package/dist/ui/index.js.map +1 -1
- package/package.json +5 -5
- package/dist/chunk-CVYJU4SV.js.map +0 -1
package/dist/index.d.cts
CHANGED
|
@@ -305,6 +305,13 @@ interface ReviseNodeConfig {
|
|
|
305
305
|
provider: string;
|
|
306
306
|
reasoning: ReasoningEffort;
|
|
307
307
|
}
|
|
308
|
+
/**
|
|
309
|
+
* The steps with a Langfuse prompt of their own — every LLM step except
|
|
310
|
+
* `revise`, which re-runs the writer with a fixed correction turn
|
|
311
|
+
* (`graph/revise.ts`) and so speaks with `prompts.draft`, never a prompt of
|
|
312
|
+
* its own.
|
|
313
|
+
*/
|
|
314
|
+
type PromptTableKey = Exclude<NodeKey, 'revise'>;
|
|
308
315
|
interface AgentProfile {
|
|
309
316
|
/** 'customer' | 'partner' | 'social' … — the tenant identifier. */
|
|
310
317
|
key: string;
|
|
@@ -344,7 +351,7 @@ interface AgentProfile {
|
|
|
344
351
|
evaluate: EvaluateNodeConfig | null;
|
|
345
352
|
revise: ReviseNodeConfig | null;
|
|
346
353
|
};
|
|
347
|
-
prompts: Record<
|
|
354
|
+
prompts: Record<PromptTableKey, PromptRef>;
|
|
348
355
|
/** Tool names resolved against the registry (§6.2). */
|
|
349
356
|
tools: string[];
|
|
350
357
|
guardrails: {
|
|
@@ -1528,13 +1535,11 @@ type PromptSlot = (typeof PROMPT_SLOTS)[number];
|
|
|
1528
1535
|
* are two `PromptSlot`s nothing ever reads a fallback for (they resolve by
|
|
1529
1536
|
* bare NAME off the settings fields' own defaults, never through a
|
|
1530
1537
|
* `PromptRef.fallback`), so accepting them here silently drops whatever a
|
|
1531
|
-
* caller sets. `revise` is
|
|
1532
|
-
*
|
|
1533
|
-
*
|
|
1534
|
-
* outage with a cold cache, the one resolved prompt §3.7's level 3 leaves
|
|
1535
|
-
* unreachable.
|
|
1538
|
+
* caller sets. `revise` is NOT a key either: that step re-runs the writer
|
|
1539
|
+
* with a fixed correction turn (`graph/revise.ts`), so it resolves no
|
|
1540
|
+
* prompt of its own to fall back for.
|
|
1536
1541
|
*/
|
|
1537
|
-
type PromptFallbackSlot = Exclude<PromptSlot, 'shared/style-email' | 'shared/style-whatsapp'
|
|
1542
|
+
type PromptFallbackSlot = Exclude<PromptSlot, 'shared/style-email' | 'shared/style-whatsapp'>;
|
|
1538
1543
|
interface PromptNameConfig {
|
|
1539
1544
|
/**
|
|
1540
1545
|
* Required, not defaulted (H3, T25 review): §4's checklist for a new
|
|
@@ -1551,7 +1556,7 @@ interface PromptNameConfig {
|
|
|
1551
1556
|
/**
|
|
1552
1557
|
* §3.2's `config.defaults.prompts` — the level-3 in-code fallback TEXT
|
|
1553
1558
|
* (`PromptRef.fallback`, §3.7 point 3) a caller can override per slot,
|
|
1554
|
-
* read by `buildPromptsTable` (triage/escalation/evaluation
|
|
1559
|
+
* read by `buildPromptsTable` (triage/escalation/evaluation) and
|
|
1555
1560
|
* by `suggest-prompt`/`run-diff-analysis`'s own meta-prompt constants
|
|
1556
1561
|
* (`suggest`/`diff-analysis`). Typed as `PromptFallbackSlot`, not
|
|
1557
1562
|
* `PromptSlot` (M7): the accepted key set must match what is actually
|
|
@@ -1563,15 +1568,6 @@ interface PromptNameConfig {
|
|
|
1563
1568
|
}
|
|
1564
1569
|
/** Resolve one slot to its Langfuse prompt name for a given `buildSupportPipeline` config. */
|
|
1565
1570
|
declare function resolvePromptName(slot: PromptSlot, config: PromptNameConfig): string;
|
|
1566
|
-
/**
|
|
1567
|
-
* `revise` has no `PROMPT_SLOTS` entry (see the module doc — it is not one
|
|
1568
|
-
* of the seven §3.7 slots) but resolves via the exact same
|
|
1569
|
-
* `promptNames?.revise ?? <prefix>revise` pattern the other slots use. One
|
|
1570
|
-
* function so `buildPromptsTable` (the graph's own consumer) and
|
|
1571
|
-
* `mergeRole`'s `role.prompts` allowlist (T25) cannot drift apart on how
|
|
1572
|
-
* that name is computed.
|
|
1573
|
-
*/
|
|
1574
|
-
declare function resolveReviseName(config: PromptNameConfig): string;
|
|
1575
1571
|
|
|
1576
1572
|
/**
|
|
1577
1573
|
* `category` (ex-`Category`) — spec §3.4.
|
|
@@ -1881,11 +1877,14 @@ interface SupportKitNodeSettings {
|
|
|
1881
1877
|
escalationEnabled?: boolean;
|
|
1882
1878
|
}
|
|
1883
1879
|
/**
|
|
1884
|
-
*
|
|
1880
|
+
* The two steps with no `prompt` of their own. `draft` speaks with the
|
|
1885
1881
|
* resolved agent's voice, so its Langfuse binding lives on the `agent`
|
|
1886
1882
|
* record (§3.4, `functions/records.ts`'s `draftPromptRefFor`) and is chosen
|
|
1887
|
-
* per agent on the AgentsPage, not per install on the SettingsPage.
|
|
1888
|
-
* `
|
|
1883
|
+
* per agent on the AgentsPage, not per install on the SettingsPage.
|
|
1884
|
+
* `revise` re-runs that same writer against the judge's objection
|
|
1885
|
+
* (`graph/nodes/revise.ts`), so it too has only the writer's prompt to
|
|
1886
|
+
* speak with — a `prompt` key on either would be written by an operator
|
|
1887
|
+
* and read by nobody.
|
|
1889
1888
|
*/
|
|
1890
1889
|
type SupportKitDraftNodeSettings = Omit<SupportKitNodeSettings, 'prompt'>;
|
|
1891
1890
|
/**
|
|
@@ -1905,7 +1904,7 @@ interface SupportKitSettings {
|
|
|
1905
1904
|
escalate?: SupportKitNodeSettings | null;
|
|
1906
1905
|
draft?: SupportKitDraftNodeSettings | null;
|
|
1907
1906
|
evaluate?: SupportKitNodeSettings | null;
|
|
1908
|
-
revise?:
|
|
1907
|
+
revise?: SupportKitDraftNodeSettings | null;
|
|
1909
1908
|
};
|
|
1910
1909
|
unknownTag: string;
|
|
1911
1910
|
handledTag: string;
|
|
@@ -1929,7 +1928,7 @@ interface SupportKitSettings {
|
|
|
1929
1928
|
renameTo: string;
|
|
1930
1929
|
statsTimezone: string;
|
|
1931
1930
|
}
|
|
1932
|
-
declare function settingsToProfile(settings: SupportKitSettings, prompts: Record<
|
|
1931
|
+
declare function settingsToProfile(settings: SupportKitSettings, prompts: Record<PromptTableKey, PromptRef>): AgentProfile;
|
|
1933
1932
|
|
|
1934
1933
|
/**
|
|
1935
1934
|
* `SupportKitFunctionConfig` — what each of the four T22 manifest fragments
|
|
@@ -1986,7 +1985,7 @@ interface SupportPipelineConfig extends SupportKitFunctionConfig {
|
|
|
1986
1985
|
* one changes.
|
|
1987
1986
|
*
|
|
1988
1987
|
* `defaults.prompts` is wired to its real consumers: `buildPromptsTable`
|
|
1989
|
-
* (triage/escalate/evaluate
|
|
1988
|
+
* (triage/escalate/evaluate's `PromptRef.fallback`) and
|
|
1990
1989
|
* `suggest-prompt`/`run-diff-analysis`'s own meta-prompt fallback.
|
|
1991
1990
|
*
|
|
1992
1991
|
* `defaults.channel` (DECISION 3, T25 — see the migration progress
|
|
@@ -2066,4 +2065,4 @@ interface SupportPipelineFragments {
|
|
|
2066
2065
|
}
|
|
2067
2066
|
declare function buildSupportPipeline(config: SupportPipelineConfig): SupportPipelineFragments;
|
|
2068
2067
|
|
|
2069
|
-
export { AGENT_GUARDRAILS, AGENT_STATUSES, AGENT_TOOLS, 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, DEFAULT_CHANNEL_PROMPT_EMAIL, DEFAULT_CHANNEL_PROMPT_WHATSAPP, DEFAULT_LLM_PROVIDER, DEFAULT_PROFILE_KEY, DEFAULT_WHATSAPP_MODE, 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, 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 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 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, isEvaluationVerdict, isGeneratedResponseStatus, isJudgemeConversation, isJudgemeTicket, isSendable, isSendableVerdict, isTerminalStatus, isTicketClosed, isWhatsappChevronNote, isWhatsappTicket, lastCustomerMessage, needsRevision, openTicketKeyFor, parseReferences, pipelineStateRecord, promptCacheRecord, reclaimStalledSend, requiresFollowup, resolvePromptName,
|
|
2068
|
+
export { AGENT_GUARDRAILS, AGENT_STATUSES, AGENT_TOOLS, 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, DEFAULT_CHANNEL_PROMPT_EMAIL, DEFAULT_CHANNEL_PROMPT_WHATSAPP, DEFAULT_LLM_PROVIDER, DEFAULT_PROFILE_KEY, DEFAULT_WHATSAPP_MODE, 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, 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 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, isEvaluationVerdict, isGeneratedResponseStatus, isJudgemeConversation, isJudgemeTicket, isSendable, isSendableVerdict, isTerminalStatus, isTicketClosed, isWhatsappChevronNote, isWhatsappTicket, lastCustomerMessage, needsRevision, openTicketKeyFor, parseReferences, pipelineStateRecord, promptCacheRecord, reclaimStalledSend, requiresFollowup, resolvePromptName, runGuardrails, runTicket, settingsToProfile, stopOptOut, targetRefFor, validateSettings, verifyReply, whatsappModeFromLegacyBoolean };
|
package/dist/index.d.ts
CHANGED
|
@@ -305,6 +305,13 @@ interface ReviseNodeConfig {
|
|
|
305
305
|
provider: string;
|
|
306
306
|
reasoning: ReasoningEffort;
|
|
307
307
|
}
|
|
308
|
+
/**
|
|
309
|
+
* The steps with a Langfuse prompt of their own — every LLM step except
|
|
310
|
+
* `revise`, which re-runs the writer with a fixed correction turn
|
|
311
|
+
* (`graph/revise.ts`) and so speaks with `prompts.draft`, never a prompt of
|
|
312
|
+
* its own.
|
|
313
|
+
*/
|
|
314
|
+
type PromptTableKey = Exclude<NodeKey, 'revise'>;
|
|
308
315
|
interface AgentProfile {
|
|
309
316
|
/** 'customer' | 'partner' | 'social' … — the tenant identifier. */
|
|
310
317
|
key: string;
|
|
@@ -344,7 +351,7 @@ interface AgentProfile {
|
|
|
344
351
|
evaluate: EvaluateNodeConfig | null;
|
|
345
352
|
revise: ReviseNodeConfig | null;
|
|
346
353
|
};
|
|
347
|
-
prompts: Record<
|
|
354
|
+
prompts: Record<PromptTableKey, PromptRef>;
|
|
348
355
|
/** Tool names resolved against the registry (§6.2). */
|
|
349
356
|
tools: string[];
|
|
350
357
|
guardrails: {
|
|
@@ -1528,13 +1535,11 @@ type PromptSlot = (typeof PROMPT_SLOTS)[number];
|
|
|
1528
1535
|
* are two `PromptSlot`s nothing ever reads a fallback for (they resolve by
|
|
1529
1536
|
* bare NAME off the settings fields' own defaults, never through a
|
|
1530
1537
|
* `PromptRef.fallback`), so accepting them here silently drops whatever a
|
|
1531
|
-
* caller sets. `revise` is
|
|
1532
|
-
*
|
|
1533
|
-
*
|
|
1534
|
-
* outage with a cold cache, the one resolved prompt §3.7's level 3 leaves
|
|
1535
|
-
* unreachable.
|
|
1538
|
+
* caller sets. `revise` is NOT a key either: that step re-runs the writer
|
|
1539
|
+
* with a fixed correction turn (`graph/revise.ts`), so it resolves no
|
|
1540
|
+
* prompt of its own to fall back for.
|
|
1536
1541
|
*/
|
|
1537
|
-
type PromptFallbackSlot = Exclude<PromptSlot, 'shared/style-email' | 'shared/style-whatsapp'
|
|
1542
|
+
type PromptFallbackSlot = Exclude<PromptSlot, 'shared/style-email' | 'shared/style-whatsapp'>;
|
|
1538
1543
|
interface PromptNameConfig {
|
|
1539
1544
|
/**
|
|
1540
1545
|
* Required, not defaulted (H3, T25 review): §4's checklist for a new
|
|
@@ -1551,7 +1556,7 @@ interface PromptNameConfig {
|
|
|
1551
1556
|
/**
|
|
1552
1557
|
* §3.2's `config.defaults.prompts` — the level-3 in-code fallback TEXT
|
|
1553
1558
|
* (`PromptRef.fallback`, §3.7 point 3) a caller can override per slot,
|
|
1554
|
-
* read by `buildPromptsTable` (triage/escalation/evaluation
|
|
1559
|
+
* read by `buildPromptsTable` (triage/escalation/evaluation) and
|
|
1555
1560
|
* by `suggest-prompt`/`run-diff-analysis`'s own meta-prompt constants
|
|
1556
1561
|
* (`suggest`/`diff-analysis`). Typed as `PromptFallbackSlot`, not
|
|
1557
1562
|
* `PromptSlot` (M7): the accepted key set must match what is actually
|
|
@@ -1563,15 +1568,6 @@ interface PromptNameConfig {
|
|
|
1563
1568
|
}
|
|
1564
1569
|
/** Resolve one slot to its Langfuse prompt name for a given `buildSupportPipeline` config. */
|
|
1565
1570
|
declare function resolvePromptName(slot: PromptSlot, config: PromptNameConfig): string;
|
|
1566
|
-
/**
|
|
1567
|
-
* `revise` has no `PROMPT_SLOTS` entry (see the module doc — it is not one
|
|
1568
|
-
* of the seven §3.7 slots) but resolves via the exact same
|
|
1569
|
-
* `promptNames?.revise ?? <prefix>revise` pattern the other slots use. One
|
|
1570
|
-
* function so `buildPromptsTable` (the graph's own consumer) and
|
|
1571
|
-
* `mergeRole`'s `role.prompts` allowlist (T25) cannot drift apart on how
|
|
1572
|
-
* that name is computed.
|
|
1573
|
-
*/
|
|
1574
|
-
declare function resolveReviseName(config: PromptNameConfig): string;
|
|
1575
1571
|
|
|
1576
1572
|
/**
|
|
1577
1573
|
* `category` (ex-`Category`) — spec §3.4.
|
|
@@ -1881,11 +1877,14 @@ interface SupportKitNodeSettings {
|
|
|
1881
1877
|
escalationEnabled?: boolean;
|
|
1882
1878
|
}
|
|
1883
1879
|
/**
|
|
1884
|
-
*
|
|
1880
|
+
* The two steps with no `prompt` of their own. `draft` speaks with the
|
|
1885
1881
|
* resolved agent's voice, so its Langfuse binding lives on the `agent`
|
|
1886
1882
|
* record (§3.4, `functions/records.ts`'s `draftPromptRefFor`) and is chosen
|
|
1887
|
-
* per agent on the AgentsPage, not per install on the SettingsPage.
|
|
1888
|
-
* `
|
|
1883
|
+
* per agent on the AgentsPage, not per install on the SettingsPage.
|
|
1884
|
+
* `revise` re-runs that same writer against the judge's objection
|
|
1885
|
+
* (`graph/nodes/revise.ts`), so it too has only the writer's prompt to
|
|
1886
|
+
* speak with — a `prompt` key on either would be written by an operator
|
|
1887
|
+
* and read by nobody.
|
|
1889
1888
|
*/
|
|
1890
1889
|
type SupportKitDraftNodeSettings = Omit<SupportKitNodeSettings, 'prompt'>;
|
|
1891
1890
|
/**
|
|
@@ -1905,7 +1904,7 @@ interface SupportKitSettings {
|
|
|
1905
1904
|
escalate?: SupportKitNodeSettings | null;
|
|
1906
1905
|
draft?: SupportKitDraftNodeSettings | null;
|
|
1907
1906
|
evaluate?: SupportKitNodeSettings | null;
|
|
1908
|
-
revise?:
|
|
1907
|
+
revise?: SupportKitDraftNodeSettings | null;
|
|
1909
1908
|
};
|
|
1910
1909
|
unknownTag: string;
|
|
1911
1910
|
handledTag: string;
|
|
@@ -1929,7 +1928,7 @@ interface SupportKitSettings {
|
|
|
1929
1928
|
renameTo: string;
|
|
1930
1929
|
statsTimezone: string;
|
|
1931
1930
|
}
|
|
1932
|
-
declare function settingsToProfile(settings: SupportKitSettings, prompts: Record<
|
|
1931
|
+
declare function settingsToProfile(settings: SupportKitSettings, prompts: Record<PromptTableKey, PromptRef>): AgentProfile;
|
|
1933
1932
|
|
|
1934
1933
|
/**
|
|
1935
1934
|
* `SupportKitFunctionConfig` — what each of the four T22 manifest fragments
|
|
@@ -1986,7 +1985,7 @@ interface SupportPipelineConfig extends SupportKitFunctionConfig {
|
|
|
1986
1985
|
* one changes.
|
|
1987
1986
|
*
|
|
1988
1987
|
* `defaults.prompts` is wired to its real consumers: `buildPromptsTable`
|
|
1989
|
-
* (triage/escalate/evaluate
|
|
1988
|
+
* (triage/escalate/evaluate's `PromptRef.fallback`) and
|
|
1990
1989
|
* `suggest-prompt`/`run-diff-analysis`'s own meta-prompt fallback.
|
|
1991
1990
|
*
|
|
1992
1991
|
* `defaults.channel` (DECISION 3, T25 — see the migration progress
|
|
@@ -2066,4 +2065,4 @@ interface SupportPipelineFragments {
|
|
|
2066
2065
|
}
|
|
2067
2066
|
declare function buildSupportPipeline(config: SupportPipelineConfig): SupportPipelineFragments;
|
|
2068
2067
|
|
|
2069
|
-
export { AGENT_GUARDRAILS, AGENT_STATUSES, AGENT_TOOLS, 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, DEFAULT_CHANNEL_PROMPT_EMAIL, DEFAULT_CHANNEL_PROMPT_WHATSAPP, DEFAULT_LLM_PROVIDER, DEFAULT_PROFILE_KEY, DEFAULT_WHATSAPP_MODE, 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, 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 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 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, isEvaluationVerdict, isGeneratedResponseStatus, isJudgemeConversation, isJudgemeTicket, isSendable, isSendableVerdict, isTerminalStatus, isTicketClosed, isWhatsappChevronNote, isWhatsappTicket, lastCustomerMessage, needsRevision, openTicketKeyFor, parseReferences, pipelineStateRecord, promptCacheRecord, reclaimStalledSend, requiresFollowup, resolvePromptName,
|
|
2068
|
+
export { AGENT_GUARDRAILS, AGENT_STATUSES, AGENT_TOOLS, 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, DEFAULT_CHANNEL_PROMPT_EMAIL, DEFAULT_CHANNEL_PROMPT_WHATSAPP, DEFAULT_LLM_PROVIDER, DEFAULT_PROFILE_KEY, DEFAULT_WHATSAPP_MODE, 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, 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 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, isEvaluationVerdict, isGeneratedResponseStatus, isJudgemeConversation, isJudgemeTicket, isSendable, isSendableVerdict, isTerminalStatus, isTicketClosed, isWhatsappChevronNote, isWhatsappTicket, lastCustomerMessage, needsRevision, openTicketKeyFor, parseReferences, pipelineStateRecord, promptCacheRecord, reclaimStalledSend, requiresFollowup, resolvePromptName, runGuardrails, runTicket, settingsToProfile, stopOptOut, targetRefFor, validateSettings, verifyReply, whatsappModeFromLegacyBoolean };
|
package/dist/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { CATEGORY_GROUP_FIELD_NAME_UID, CATEGORY_GROUP_FIELD_ORDER_UID, PIPELINE_STATE_FIELD_SINGLETON_KEY_UID, PIPELINE_STATE_FIELD_SOURCE_VIEW_ID_UID, PIPELINE_STATE_FIELD_LAST_TRIAGE_AT_UID, PIPELINE_STATE_FIELD_LAST_SWEEP_AT_UID, PROMPT_CACHE_FIELD_PROMPT_KEY_UID, PROMPT_CACHE_FIELD_CONTENT_UID, PROMPT_CACHE_FIELD_VERSION_UID, PROMPT_CACHE_FIELD_LABEL_UID, PROMPT_CACHE_FIELD_CONFIG_UID, CATEGORY_GROUP_INDEX_NAME_UID, CATEGORY_GROUP_OBJECT_UID, PIPELINE_STATE_INDEX_SINGLETON_KEY_UID, PIPELINE_STATE_OBJECT_UID, PROMPT_CACHE_INDEX_PROMPT_KEY_UID, PROMPT_CACHE_OBJECT_UID, CATEGORY_INDEX_TAG_NAME_UID, CATEGORY_INDEX_NAME_UID, CATEGORY_INDEX_ORDER_UID, CATEGORY_FIELD_NAME_UID, CATEGORY_FIELD_TAG_NAME_UID, CATEGORY_FIELD_ORDER_UID, CATEGORY_FIELD_GROUP_ID_UID, CATEGORY_FIELD_AGENT_ID_UID, CATEGORY_FIELD_EXTRA_TAGS_UID, CATEGORY_FIELD_DESCRIPTION_UID, CATEGORY_FIELD_EXAMPLES_UID, CATEGORY_FIELD_FAST_RESPONSE_ENABLED_UID, CATEGORY_FIELD_AUTO_REPLY_ENABLED_UID, CATEGORY_OBJECT_UID, TRIAGE_DECISION_INDEX_TICKET_ID_UID, TRIAGE_DECISION_INDEX_DECIDED_AT_UID, TRIAGE_DECISION_INDEX_ESCALATED_UID, TRIAGE_DECISION_FIELD_TICKET_ID_UID, TRIAGE_DECISION_FIELD_DECIDED_AT_UID, TRIAGE_DECISION_FIELD_CATEGORY_ID_UID, TRIAGE_DECISION_FIELD_TAG_UID, TRIAGE_DECISION_FIELD_CONFIDENCE_UID, TRIAGE_DECISION_FIELD_REASONING_UID, TRIAGE_DECISION_FIELD_CONVERSATION_OVER_UID, TRIAGE_DECISION_FIELD_ESCALATED_UID, TRIAGE_DECISION_FIELD_ESCALATION_CONFIDENCE_UID, TRIAGE_DECISION_FIELD_ESCALATION_REASONING_UID, TRIAGE_DECISION_FIELD_STATUS_UID, TRIAGE_DECISION_FIELD_ERROR_UID, TRIAGE_DECISION_FIELD_RUN_ID_UID, TRIAGE_DECISION_FIELD_SUBJECT_RENAMED_UID, TRIAGE_DECISION_OBJECT_UID, GENERATED_RESPONSE_INDEX_TICKET_ID_UID, GENERATED_RESPONSE_INDEX_OPEN_TICKET_KEY_UID, GENERATED_RESPONSE_INDEX_STATUS_UID, GENERATED_RESPONSE_INDEX_TRIAGE_DECISION_ID_UID, GENERATED_RESPONSE_INDEX_GENERATED_AT_UID, GENERATED_RESPONSE_INDEX_EXPIRES_AT_UID, GENERATED_RESPONSE_FIELD_TICKET_ID_UID, GENERATED_RESPONSE_FIELD_OPEN_TICKET_KEY_UID, GENERATED_RESPONSE_STATUSES, GENERATED_RESPONSE_FIELD_STATUS_UID, GENERATED_RESPONSE_FIELD_TRIAGE_DECISION_ID_UID, GENERATED_RESPONSE_FIELD_CATEGORY_ID_UID, GENERATED_RESPONSE_FIELD_AGENT_ID_UID, GENERATED_RESPONSE_FIELD_CHANNEL_UID, GENERATED_RESPONSE_FIELD_RESPONSE_TEXT_UID, GENERATED_RESPONSE_FIELD_SOURCES_UID, GENERATED_RESPONSE_FIELD_TRACED_INPUT_UID, GENERATED_RESPONSE_FIELD_VERDICT_UID, GENERATED_RESPONSE_FIELD_GUARDRAIL_HITS_UID, GENERATED_RESPONSE_FIELD_AUTO_SEND_DECISION_UID, GENERATED_RESPONSE_FIELD_FOLLOWUP_REQUIRED_UID, GENERATED_RESPONSE_FIELD_SERVED_COUNT_UID, GENERATED_RESPONSE_FIELD_SERVED_TO_UID, GENERATED_RESPONSE_FIELD_GENERATED_AT_UID, GENERATED_RESPONSE_FIELD_EXPIRES_AT_UID, GENERATED_RESPONSE_FIELD_SENT_AT_UID, GENERATED_RESPONSE_FIELD_SENT_MESSAGE_ID_UID, GENERATED_RESPONSE_FIELD_LANGFUSE_TRACE_ID_UID, GENERATED_RESPONSE_FIELD_LANGFUSE_OBSERVATION_ID_UID, GENERATED_RESPONSE_FIELD_PROMPT_NAME_UID, GENERATED_RESPONSE_FIELD_PROMPT_VERSION_UID, GENERATED_RESPONSE_FIELD_ERROR_UID, GENERATED_RESPONSE_FIELD_GENERATED_MESSAGE_COUNT_UID, GENERATED_RESPONSE_FIELD_GENERATED_LAST_MESSAGE_AT_UID, GENERATED_RESPONSE_FIELD_SENDING_AT_UID, GENERATED_RESPONSE_OBJECT_UID, RESPONSE_COMPARISON_INDEX_CAPTURED_AT_UID, RESPONSE_COMPARISON_INDEX_TICKET_ID_UID, RESPONSE_COMPARISON_FIELD_GENERATED_TEXT_UID, RESPONSE_COMPARISON_FIELD_SENT_TEXT_UID, RESPONSE_COMPARISON_FIELD_CAPTURED_AT_UID, RESPONSE_COMPARISON_FIELD_TICKET_ID_UID, RESPONSE_COMPARISON_FIELD_TICKET_URL_UID, RESPONSE_COMPARISON_FIELD_AGENT_ID_UID, RESPONSE_COMPARISON_FIELD_LANGFUSE_TRACE_ID_UID, RESPONSE_COMPARISON_FIELD_LANGFUSE_OBSERVATION_ID_UID, RESPONSE_COMPARISON_FIELD_PROMPT_NAME_UID, RESPONSE_COMPARISON_FIELD_PROMPT_VERSION_UID, RESPONSE_COMPARISON_FIELD_CONVERSATION_MESSAGES_UID, RESPONSE_COMPARISON_FIELD_DIFF_UID, RESPONSE_COMPARISON_OBJECT_UID, EVALUATION_FIELD_AGENT_ID_UID, EVALUATION_FIELD_SATISFIED_UID, EVALUATION_FIELD_MESSAGES_UID, EVALUATION_FIELD_TICKET_URL_UID, EVALUATION_FIELD_LANGFUSE_TRACE_ID_UID, EVALUATION_FIELD_LANGFUSE_OBSERVATION_ID_UID, EVALUATION_FIELD_SUPPORT_USER_KEY_ID_UID, EVALUATION_OBJECT_UID, DIFF_ANALYSIS_INDEX_UNIQUE_KEY_UID, DIFF_ANALYSIS_FIELD_AGENT_ID_UID, DIFF_ANALYSIS_FIELD_PROMPT_NAME_UID, DIFF_ANALYSIS_FIELD_PROMPT_VERSION_UID, DIFF_ANALYSIS_FIELD_POINTS_UID, DIFF_ANALYSIS_FIELD_UNIQUE_KEY_UID, DIFF_ANALYSIS_OBJECT_UID, agentRecord, SUPPORT_KIT_SETTINGS_FIELDS, MissingPromptError, validateSettings, toCategory, toAgent, resolveDraftAgent, settingsToProfile, buildPromptsTable, draftPromptRefFor, runTicket, assertTransition, openTicketKeyFor, act, initialState, applyOutcomeTags, listCategories, toCategoryReferential, resolvePromptName, DEFAULT_LLM_PROVIDER, toCategoryGroup, toGeneratedResponse, NODE_NAMES, reclaimStalledSend, applySignature, isGeneratedResponseStatus, isEvaluationVerdict, requiresFollowup, computeWordDiff, findCategoryByTag, isWhatsappTicket, isConversationOver, isFallbackClassification, hasNoDraftNode, hasCustomerAttachment, isTicketClosed, isWhatsappChevronNote } from './chunk-
|
|
2
|
-
export { AGENT_GUARDRAILS, AGENT_STATUSES, AGENT_TOOLS, CANDIDATE_MIN_LENGTH, DEFAULT_CHANNEL_PROMPT_EMAIL, DEFAULT_CHANNEL_PROMPT_WHATSAPP, DEFAULT_LLM_PROVIDER, DEFAULT_PROFILE_KEY, DEFAULT_WHATSAPP_MODE, EVALUATION_VERDICTS, GENERATED_RESPONSE_STATUSES, InvalidStatusTransitionError, MissingPromptError, NODE_NAMES, PROMPT_SLOTS, REASONING_MAX_LEN, STOP_PHRASES, SUPPORT_KIT_SETTINGS_FIELDS, UNCERTAINTY_MARKERS, WHATSAPP_MODES, WHATSAPP_NOTE_CHEVRON, agentRecord, assertTransition, canTransition, channelPreGates, firstCustomerMessage, guardrailBucket, hasCustomerAttachment, initialState, isAutoSendEligible, isAutomatedSenderEmail, isAutomatedSenderTicket, isEvaluationVerdict, isGeneratedResponseStatus, isJudgemeConversation, isJudgemeTicket, isSendable, isSendableVerdict, isTerminalStatus, isTicketClosed, isWhatsappChevronNote, isWhatsappTicket, lastCustomerMessage, needsRevision, openTicketKeyFor, reclaimStalledSend, requiresFollowup, resolvePromptName,
|
|
1
|
+
import { CATEGORY_GROUP_FIELD_NAME_UID, CATEGORY_GROUP_FIELD_ORDER_UID, PIPELINE_STATE_FIELD_SINGLETON_KEY_UID, PIPELINE_STATE_FIELD_SOURCE_VIEW_ID_UID, PIPELINE_STATE_FIELD_LAST_TRIAGE_AT_UID, PIPELINE_STATE_FIELD_LAST_SWEEP_AT_UID, PROMPT_CACHE_FIELD_PROMPT_KEY_UID, PROMPT_CACHE_FIELD_CONTENT_UID, PROMPT_CACHE_FIELD_VERSION_UID, PROMPT_CACHE_FIELD_LABEL_UID, PROMPT_CACHE_FIELD_CONFIG_UID, CATEGORY_GROUP_INDEX_NAME_UID, CATEGORY_GROUP_OBJECT_UID, PIPELINE_STATE_INDEX_SINGLETON_KEY_UID, PIPELINE_STATE_OBJECT_UID, PROMPT_CACHE_INDEX_PROMPT_KEY_UID, PROMPT_CACHE_OBJECT_UID, CATEGORY_INDEX_TAG_NAME_UID, CATEGORY_INDEX_NAME_UID, CATEGORY_INDEX_ORDER_UID, CATEGORY_FIELD_NAME_UID, CATEGORY_FIELD_TAG_NAME_UID, CATEGORY_FIELD_ORDER_UID, CATEGORY_FIELD_GROUP_ID_UID, CATEGORY_FIELD_AGENT_ID_UID, CATEGORY_FIELD_EXTRA_TAGS_UID, CATEGORY_FIELD_DESCRIPTION_UID, CATEGORY_FIELD_EXAMPLES_UID, CATEGORY_FIELD_FAST_RESPONSE_ENABLED_UID, CATEGORY_FIELD_AUTO_REPLY_ENABLED_UID, CATEGORY_OBJECT_UID, TRIAGE_DECISION_INDEX_TICKET_ID_UID, TRIAGE_DECISION_INDEX_DECIDED_AT_UID, TRIAGE_DECISION_INDEX_ESCALATED_UID, TRIAGE_DECISION_FIELD_TICKET_ID_UID, TRIAGE_DECISION_FIELD_DECIDED_AT_UID, TRIAGE_DECISION_FIELD_CATEGORY_ID_UID, TRIAGE_DECISION_FIELD_TAG_UID, TRIAGE_DECISION_FIELD_CONFIDENCE_UID, TRIAGE_DECISION_FIELD_REASONING_UID, TRIAGE_DECISION_FIELD_CONVERSATION_OVER_UID, TRIAGE_DECISION_FIELD_ESCALATED_UID, TRIAGE_DECISION_FIELD_ESCALATION_CONFIDENCE_UID, TRIAGE_DECISION_FIELD_ESCALATION_REASONING_UID, TRIAGE_DECISION_FIELD_STATUS_UID, TRIAGE_DECISION_FIELD_ERROR_UID, TRIAGE_DECISION_FIELD_RUN_ID_UID, TRIAGE_DECISION_FIELD_SUBJECT_RENAMED_UID, TRIAGE_DECISION_OBJECT_UID, GENERATED_RESPONSE_INDEX_TICKET_ID_UID, GENERATED_RESPONSE_INDEX_OPEN_TICKET_KEY_UID, GENERATED_RESPONSE_INDEX_STATUS_UID, GENERATED_RESPONSE_INDEX_TRIAGE_DECISION_ID_UID, GENERATED_RESPONSE_INDEX_GENERATED_AT_UID, GENERATED_RESPONSE_INDEX_EXPIRES_AT_UID, GENERATED_RESPONSE_FIELD_TICKET_ID_UID, GENERATED_RESPONSE_FIELD_OPEN_TICKET_KEY_UID, GENERATED_RESPONSE_STATUSES, GENERATED_RESPONSE_FIELD_STATUS_UID, GENERATED_RESPONSE_FIELD_TRIAGE_DECISION_ID_UID, GENERATED_RESPONSE_FIELD_CATEGORY_ID_UID, GENERATED_RESPONSE_FIELD_AGENT_ID_UID, GENERATED_RESPONSE_FIELD_CHANNEL_UID, GENERATED_RESPONSE_FIELD_RESPONSE_TEXT_UID, GENERATED_RESPONSE_FIELD_SOURCES_UID, GENERATED_RESPONSE_FIELD_TRACED_INPUT_UID, GENERATED_RESPONSE_FIELD_VERDICT_UID, GENERATED_RESPONSE_FIELD_GUARDRAIL_HITS_UID, GENERATED_RESPONSE_FIELD_AUTO_SEND_DECISION_UID, GENERATED_RESPONSE_FIELD_FOLLOWUP_REQUIRED_UID, GENERATED_RESPONSE_FIELD_SERVED_COUNT_UID, GENERATED_RESPONSE_FIELD_SERVED_TO_UID, GENERATED_RESPONSE_FIELD_GENERATED_AT_UID, GENERATED_RESPONSE_FIELD_EXPIRES_AT_UID, GENERATED_RESPONSE_FIELD_SENT_AT_UID, GENERATED_RESPONSE_FIELD_SENT_MESSAGE_ID_UID, GENERATED_RESPONSE_FIELD_LANGFUSE_TRACE_ID_UID, GENERATED_RESPONSE_FIELD_LANGFUSE_OBSERVATION_ID_UID, GENERATED_RESPONSE_FIELD_PROMPT_NAME_UID, GENERATED_RESPONSE_FIELD_PROMPT_VERSION_UID, GENERATED_RESPONSE_FIELD_ERROR_UID, GENERATED_RESPONSE_FIELD_GENERATED_MESSAGE_COUNT_UID, GENERATED_RESPONSE_FIELD_GENERATED_LAST_MESSAGE_AT_UID, GENERATED_RESPONSE_FIELD_SENDING_AT_UID, GENERATED_RESPONSE_OBJECT_UID, RESPONSE_COMPARISON_INDEX_CAPTURED_AT_UID, RESPONSE_COMPARISON_INDEX_TICKET_ID_UID, RESPONSE_COMPARISON_FIELD_GENERATED_TEXT_UID, RESPONSE_COMPARISON_FIELD_SENT_TEXT_UID, RESPONSE_COMPARISON_FIELD_CAPTURED_AT_UID, RESPONSE_COMPARISON_FIELD_TICKET_ID_UID, RESPONSE_COMPARISON_FIELD_TICKET_URL_UID, RESPONSE_COMPARISON_FIELD_AGENT_ID_UID, RESPONSE_COMPARISON_FIELD_LANGFUSE_TRACE_ID_UID, RESPONSE_COMPARISON_FIELD_LANGFUSE_OBSERVATION_ID_UID, RESPONSE_COMPARISON_FIELD_PROMPT_NAME_UID, RESPONSE_COMPARISON_FIELD_PROMPT_VERSION_UID, RESPONSE_COMPARISON_FIELD_CONVERSATION_MESSAGES_UID, RESPONSE_COMPARISON_FIELD_DIFF_UID, RESPONSE_COMPARISON_OBJECT_UID, EVALUATION_FIELD_AGENT_ID_UID, EVALUATION_FIELD_SATISFIED_UID, EVALUATION_FIELD_MESSAGES_UID, EVALUATION_FIELD_TICKET_URL_UID, EVALUATION_FIELD_LANGFUSE_TRACE_ID_UID, EVALUATION_FIELD_LANGFUSE_OBSERVATION_ID_UID, EVALUATION_FIELD_SUPPORT_USER_KEY_ID_UID, EVALUATION_OBJECT_UID, DIFF_ANALYSIS_INDEX_UNIQUE_KEY_UID, DIFF_ANALYSIS_FIELD_AGENT_ID_UID, DIFF_ANALYSIS_FIELD_PROMPT_NAME_UID, DIFF_ANALYSIS_FIELD_PROMPT_VERSION_UID, DIFF_ANALYSIS_FIELD_POINTS_UID, DIFF_ANALYSIS_FIELD_UNIQUE_KEY_UID, DIFF_ANALYSIS_OBJECT_UID, agentRecord, SUPPORT_KIT_SETTINGS_FIELDS, MissingPromptError, validateSettings, toCategory, toAgent, resolveDraftAgent, settingsToProfile, buildPromptsTable, draftPromptRefFor, runTicket, assertTransition, openTicketKeyFor, act, initialState, applyOutcomeTags, listCategories, toCategoryReferential, resolvePromptName, DEFAULT_LLM_PROVIDER, toCategoryGroup, toGeneratedResponse, NODE_NAMES, reclaimStalledSend, applySignature, isGeneratedResponseStatus, isEvaluationVerdict, requiresFollowup, computeWordDiff, findCategoryByTag, isWhatsappTicket, isConversationOver, isFallbackClassification, hasNoDraftNode, hasCustomerAttachment, isTicketClosed, isWhatsappChevronNote } from './chunk-KCPVWKUY.js';
|
|
2
|
+
export { AGENT_GUARDRAILS, AGENT_STATUSES, AGENT_TOOLS, CANDIDATE_MIN_LENGTH, DEFAULT_CHANNEL_PROMPT_EMAIL, DEFAULT_CHANNEL_PROMPT_WHATSAPP, DEFAULT_LLM_PROVIDER, DEFAULT_PROFILE_KEY, DEFAULT_WHATSAPP_MODE, EVALUATION_VERDICTS, GENERATED_RESPONSE_STATUSES, InvalidStatusTransitionError, MissingPromptError, NODE_NAMES, PROMPT_SLOTS, REASONING_MAX_LEN, STOP_PHRASES, SUPPORT_KIT_SETTINGS_FIELDS, UNCERTAINTY_MARKERS, WHATSAPP_MODES, WHATSAPP_NOTE_CHEVRON, agentRecord, assertTransition, canTransition, channelPreGates, firstCustomerMessage, guardrailBucket, hasCustomerAttachment, initialState, isAutoSendEligible, isAutomatedSenderEmail, isAutomatedSenderTicket, isEvaluationVerdict, isGeneratedResponseStatus, isJudgemeConversation, isJudgemeTicket, isSendable, isSendableVerdict, isTerminalStatus, isTicketClosed, isWhatsappChevronNote, isWhatsappTicket, lastCustomerMessage, needsRevision, openTicketKeyFor, reclaimStalledSend, requiresFollowup, resolvePromptName, runGuardrails, runTicket, settingsToProfile, stopOptOut, validateSettings, verifyReply, whatsappModeFromLegacyBoolean } from './chunk-KCPVWKUY.js';
|
|
3
3
|
import { FieldType, APPROVAL_DECIDED_EVENT, AppApiError } from '@apotech-os/app-kit';
|
|
4
4
|
import { createHash } from 'node:crypto';
|
|
5
5
|
|
|
@@ -2142,6 +2142,8 @@ var CREATE_AGENT_INPUT_NAME_UID = "0cb57453-7b02-49ce-875b-7ff079a5810d";
|
|
|
2142
2142
|
var CREATE_AGENT_INPUT_MODEL_ID_UID = "f19f1c10-3145-482b-8c1d-6fd3576596ff";
|
|
2143
2143
|
var CREATE_AGENT_INPUT_PROVIDER_UID = "0dd94db4-f31a-4cd2-b030-1b1a4da5b43e";
|
|
2144
2144
|
var CREATE_AGENT_INPUT_SYSTEM_PROMPT_SNAPSHOT_UID = "d50f3810-b6fe-4c90-b69b-3e36ba502cdb";
|
|
2145
|
+
var CREATE_AGENT_INPUT_PROMPT_NAME_UID = "102d412a-3299-42a2-ac62-6f7c4155508d";
|
|
2146
|
+
var CREATE_AGENT_INPUT_PROMPT_LABEL_UID = "04f8eeba-2d0b-4814-8009-a4a3d1530760";
|
|
2145
2147
|
var SET_DEFAULT_AGENT_INPUT_AGENT_ID_UID = "0686c615-63f8-49a1-b3c7-3542bac76cd6";
|
|
2146
2148
|
var EXT_CHAT_INPUT_MESSAGES_UID = "874e4408-74c0-4188-b923-a0791da4d096";
|
|
2147
2149
|
var EXT_CHAT_INPUT_MODEL_ID_UID = "d63f05b1-165d-45e0-9300-cabe5e22fa42";
|
|
@@ -2965,6 +2967,20 @@ function buildCreateAgentFunctionDef(config) {
|
|
|
2965
2967
|
type: FieldType.TEXT,
|
|
2966
2968
|
label: "System prompt snapshot",
|
|
2967
2969
|
isNullable: true
|
|
2970
|
+
},
|
|
2971
|
+
{
|
|
2972
|
+
universalIdentifier: CREATE_AGENT_INPUT_PROMPT_NAME_UID,
|
|
2973
|
+
name: "promptName",
|
|
2974
|
+
type: FieldType.TEXT,
|
|
2975
|
+
label: "Prompt name",
|
|
2976
|
+
isNullable: true
|
|
2977
|
+
},
|
|
2978
|
+
{
|
|
2979
|
+
universalIdentifier: CREATE_AGENT_INPUT_PROMPT_LABEL_UID,
|
|
2980
|
+
name: "promptLabel",
|
|
2981
|
+
type: FieldType.TEXT,
|
|
2982
|
+
label: "Prompt label",
|
|
2983
|
+
isNullable: true
|
|
2968
2984
|
}
|
|
2969
2985
|
]
|
|
2970
2986
|
};
|
|
@@ -2977,14 +2993,19 @@ async function createAgentHandler(ctx, input) {
|
|
|
2977
2993
|
if (!name) throw new ctx.NonRetriableError("name is required");
|
|
2978
2994
|
const modelId = input?.modelId?.trim();
|
|
2979
2995
|
if (!modelId) throw new ctx.NonRetriableError("modelId is required");
|
|
2980
|
-
const
|
|
2996
|
+
const base = {
|
|
2981
2997
|
name,
|
|
2982
2998
|
modelId,
|
|
2983
2999
|
provider: input.provider?.trim() || DEFAULT_LLM_PROVIDER,
|
|
2984
3000
|
status: "available",
|
|
2985
|
-
|
|
2986
|
-
...input.
|
|
2987
|
-
}
|
|
3001
|
+
...input.systemPromptSnapshot?.trim() ? { systemPromptSnapshot: input.systemPromptSnapshot.trim() } : {},
|
|
3002
|
+
...input.promptLabel?.trim() ? { promptLabel: input.promptLabel.trim() } : {}
|
|
3003
|
+
};
|
|
3004
|
+
const promptName = input.promptName?.trim();
|
|
3005
|
+
if (promptName) {
|
|
3006
|
+
return toAgent(await ctx.api.create("agent", { ...base, promptName }));
|
|
3007
|
+
}
|
|
3008
|
+
const created = await ctx.api.create("agent", { ...base, promptName: PENDING_PROMPT_NAME });
|
|
2988
3009
|
const withPromptName = await ctx.api.update("agent", created.id, { promptName: `agent/${created.id}` });
|
|
2989
3010
|
return toAgent(withPromptName);
|
|
2990
3011
|
}
|
|
@@ -3095,22 +3116,23 @@ function createSyncAgentPromptSnapshotHandler() {
|
|
|
3095
3116
|
async function syncAgentPromptSnapshotHandler(ctx, input) {
|
|
3096
3117
|
const promptName = input?.promptName?.trim();
|
|
3097
3118
|
if (!promptName) throw new ctx.NonRetriableError("promptName is required");
|
|
3098
|
-
const page = await ctx.api.list("agent", { filter: { promptName }
|
|
3099
|
-
|
|
3100
|
-
|
|
3101
|
-
|
|
3102
|
-
|
|
3103
|
-
|
|
3104
|
-
|
|
3105
|
-
|
|
3106
|
-
|
|
3107
|
-
|
|
3108
|
-
|
|
3109
|
-
|
|
3110
|
-
|
|
3111
|
-
|
|
3112
|
-
|
|
3119
|
+
const page = await ctx.api.list("agent", { filter: { promptName } });
|
|
3120
|
+
let updated = false;
|
|
3121
|
+
for (const record of page.items) {
|
|
3122
|
+
const agent = toAgent(record);
|
|
3123
|
+
try {
|
|
3124
|
+
const ref = agent.promptVersion !== null ? { version: agent.promptVersion } : { label: agent.promptLabel ?? "production" };
|
|
3125
|
+
const detail = await ctx.api.prompts.get(promptName, { ...ref, resolve: false });
|
|
3126
|
+
if (detail.content === agent.systemPromptSnapshot) continue;
|
|
3127
|
+
await ctx.api.update("agent", agent.id, { systemPromptSnapshot: detail.content });
|
|
3128
|
+
updated = true;
|
|
3129
|
+
} catch (error) {
|
|
3130
|
+
ctx.logger.warn(
|
|
3131
|
+
`sync-agent-prompt-snapshot: could not refresh "${promptName}" for agent ${agent.id} \u2014 GET /models keeps serving the previous snapshot (${String(error)})`
|
|
3132
|
+
);
|
|
3133
|
+
}
|
|
3113
3134
|
}
|
|
3135
|
+
return { updated };
|
|
3114
3136
|
}
|
|
3115
3137
|
|
|
3116
3138
|
// src/functions/ext-models.ts
|