@rodrigobeber/patoai-dtos 4.7.66 → 4.7.68
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/billing/billing-agent-response.dto.d.ts +27 -0
- package/dist/billing/billing-agent-response.dto.js +7 -0
- package/dist/billing/billing-agent-usage.dto.js +5 -1
- package/dist/billing/billing-consumption-day-leads.dto.d.ts +2 -0
- package/dist/billing/billing-consumption-report.dto.d.ts +6 -0
- package/dist/billing/index.d.ts +1 -0
- package/dist/billing/index.js +1 -0
- package/dist/support/index.d.ts +2 -0
- package/dist/support/index.js +2 -0
- package/dist/support/support-agent-balance.dto.d.ts +9 -0
- package/dist/support/support-agent-balance.dto.js +2 -0
- package/dist/support/support-lab-analyze.dto.d.ts +30 -1
- package/dist/support/support-lab-ask.dto.d.ts +11 -2
- package/dist/support/support-lab-session.dto.d.ts +28 -0
- package/dist/support/support-lab-session.dto.js +2 -0
- package/package.json +1 -1
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
export type InternalAgentCode = 'support' | 'sandbox' | 'lab-chat' | 'lab-analysis';
|
|
2
|
+
export interface AgentResponseBalanceRequestDto {
|
|
3
|
+
idCrew: number;
|
|
4
|
+
cdAgent: string;
|
|
5
|
+
}
|
|
6
|
+
export interface AgentResponseBalanceDto {
|
|
7
|
+
idCrew: number;
|
|
8
|
+
cdAgent: string;
|
|
9
|
+
nrResponses: number;
|
|
10
|
+
nrCredits: number;
|
|
11
|
+
responsesPerCredit: number;
|
|
12
|
+
canConsume: boolean;
|
|
13
|
+
unlimited?: boolean;
|
|
14
|
+
}
|
|
15
|
+
export interface ConsumeAgentResponseDto {
|
|
16
|
+
idCrew: number;
|
|
17
|
+
cdAgent: string;
|
|
18
|
+
turnKey: string;
|
|
19
|
+
idAccount?: number;
|
|
20
|
+
}
|
|
21
|
+
export interface ConsumeAgentResponseResultDto {
|
|
22
|
+
ok: boolean;
|
|
23
|
+
nrResponses: number;
|
|
24
|
+
converted: boolean;
|
|
25
|
+
deduped?: boolean;
|
|
26
|
+
reason?: 'no_credits';
|
|
27
|
+
}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
// Metering UNIFICADO dos agentes internos (support, sandbox, lab-chat, lab-analysis). Um único lastro:
|
|
3
|
+
// o crédito de conversa. Cada agente tem um saldo prepago de "respostas" (billing.agent_response_balance);
|
|
4
|
+
// quando zera, 1 crédito é convertido automaticamente em N respostas (taxa em billing.agent_rate, default
|
|
5
|
+
// id_crew=0 + exceção por-crew). Ledger idempotente por turnKey (billing.agent_response_consumption).
|
|
6
|
+
// Substitui getTestBalance/consumeTestResponse (sandbox) e getAgentLimit/consumeAgentUsage (cotas).
|
|
7
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
@@ -1,6 +1,10 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
+
// @deprecated Cotas (teto diário/mensal) dos agentes internos. Substituídas pelo metering unificado
|
|
3
|
+
// (billing-agent-response.dto.ts): o crédito É o limite, sem tetos. O support parou de chamar
|
|
4
|
+
// getAgentLimit/consumeAgentUsage; estes tipos e as tabelas agent_limit/agent_usage caem no Contract (V20).
|
|
5
|
+
// Mantido 1 deploy para não quebrar consumidores antigos durante o rollout.
|
|
6
|
+
//
|
|
2
7
|
// Limite de uso GENÉRICO dos agentes internos de plataforma (lab-chat, lab-analysis, support, …),
|
|
3
8
|
// no billing. `cd_agent` identifica o agente; a janela (day|month) e o teto vêm de `billing.agent_limit`
|
|
4
9
|
// (linha id_crew=0 = default; id_crew>0 = exceção por-crew). Contador em `billing.agent_usage`.
|
|
5
|
-
// Substitui a antiga cota específica de análise (billing.lab_analysis_usage), removida.
|
|
6
10
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
@@ -1,3 +1,8 @@
|
|
|
1
|
+
export interface BillingAgentConversionDto {
|
|
2
|
+
cdAgent: string;
|
|
3
|
+
credits: number;
|
|
4
|
+
responses: number;
|
|
5
|
+
}
|
|
1
6
|
export interface BillingConsumptionDayDto {
|
|
2
7
|
date: string;
|
|
3
8
|
consumed: number;
|
|
@@ -25,6 +30,7 @@ export interface BillingConsumptionPeriodDto {
|
|
|
25
30
|
paymentDate: string | null;
|
|
26
31
|
invoiceUrl: string | null;
|
|
27
32
|
dailyBreakdown: BillingConsumptionDayDto[];
|
|
33
|
+
agentConversions?: BillingAgentConversionDto[];
|
|
28
34
|
}
|
|
29
35
|
export interface BillingConsumptionReportDto {
|
|
30
36
|
periods: BillingConsumptionPeriodDto[];
|
package/dist/billing/index.d.ts
CHANGED
package/dist/billing/index.js
CHANGED
|
@@ -19,3 +19,4 @@ __exportStar(require("./billing-event.dto"), exports);
|
|
|
19
19
|
__exportStar(require("./billing-consumption-report.dto"), exports);
|
|
20
20
|
__exportStar(require("./billing-consumption-day-leads.dto"), exports);
|
|
21
21
|
__exportStar(require("./billing-agent-usage.dto"), exports);
|
|
22
|
+
__exportStar(require("./billing-agent-response.dto"), exports);
|
package/dist/support/index.d.ts
CHANGED
package/dist/support/index.js
CHANGED
|
@@ -27,3 +27,5 @@ __exportStar(require("./support-lab-analyze.dto"), exports);
|
|
|
27
27
|
__exportStar(require("./support-sample.dto"), exports);
|
|
28
28
|
__exportStar(require("./support-funnel.dto"), exports);
|
|
29
29
|
__exportStar(require("./support-insight-access.dto"), exports);
|
|
30
|
+
__exportStar(require("./support-agent-balance.dto"), exports);
|
|
31
|
+
__exportStar(require("./support-lab-session.dto"), exports);
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { InternalAgentCode } from "../billing/billing-agent-response.dto";
|
|
2
|
+
export interface SupportAgentBalanceDto {
|
|
3
|
+
cdAgent: InternalAgentCode;
|
|
4
|
+
unlimited: boolean;
|
|
5
|
+
remainingResponses?: number;
|
|
6
|
+
responsesPerCredit?: number;
|
|
7
|
+
credits?: number;
|
|
8
|
+
creditsAvailable?: boolean;
|
|
9
|
+
}
|
|
@@ -1,25 +1,54 @@
|
|
|
1
1
|
import { SupportLabProposalDto } from "./support-lab-ask.dto";
|
|
2
|
+
import { SupportAgentBalanceDto } from "./support-agent-balance.dto";
|
|
2
3
|
export interface SupportLabAnalyzeDto {
|
|
3
4
|
idCrew: number;
|
|
4
5
|
startDate?: string;
|
|
5
6
|
endDate?: string;
|
|
6
7
|
stageIds?: number[];
|
|
8
|
+
threadIds?: string[];
|
|
7
9
|
sampleSize?: number;
|
|
8
10
|
}
|
|
11
|
+
export interface SupportLabPendingAnalysisDto {
|
|
12
|
+
id: string;
|
|
13
|
+
status: 'pending' | 'running' | 'done';
|
|
14
|
+
startDate: string;
|
|
15
|
+
endDate: string;
|
|
16
|
+
stageIds?: number[];
|
|
17
|
+
threadIds?: string[];
|
|
18
|
+
sampleSize: number;
|
|
19
|
+
costCredits: number;
|
|
20
|
+
unlimited?: boolean;
|
|
21
|
+
}
|
|
22
|
+
export interface SupportLabAnalysisConfirmDto {
|
|
23
|
+
idPending: string;
|
|
24
|
+
}
|
|
9
25
|
export interface SupportLabAnalysisMetaDto {
|
|
10
26
|
sampled: number;
|
|
11
27
|
buckets: Record<string, number>;
|
|
12
|
-
remainingThisMonth: number;
|
|
13
28
|
model: string;
|
|
29
|
+
periodLabel?: string;
|
|
30
|
+
remainingThisMonth?: number;
|
|
14
31
|
}
|
|
15
32
|
export interface SupportLabAnalysisDto {
|
|
16
33
|
report: string;
|
|
17
34
|
proposals?: SupportLabProposalDto[];
|
|
18
35
|
meta: SupportLabAnalysisMetaDto;
|
|
36
|
+
idSession?: string;
|
|
37
|
+
balance?: SupportAgentBalanceDto;
|
|
38
|
+
}
|
|
39
|
+
export interface SupportLabStatusDto {
|
|
40
|
+
allowed: boolean;
|
|
41
|
+
unlimited: boolean;
|
|
42
|
+
balance?: SupportAgentBalanceDto;
|
|
19
43
|
}
|
|
44
|
+
/**
|
|
45
|
+
* @deprecated Substituído por SupportLabStatusDto (papel) + SupportAgentBalanceDto (saldo). O campo
|
|
46
|
+
* `remaining` vazava Number.MAX_SAFE_INTEGER para contas DEV. Mantido 1 deploy p/ o frontend antigo.
|
|
47
|
+
*/
|
|
20
48
|
export interface SupportInsightStatusDto {
|
|
21
49
|
allowed: boolean;
|
|
22
50
|
used: number;
|
|
23
51
|
limit: number;
|
|
24
52
|
remaining: number;
|
|
53
|
+
unlimited?: boolean;
|
|
25
54
|
}
|
|
@@ -1,11 +1,16 @@
|
|
|
1
1
|
import { SupportMessageDto } from "./support-message.dto";
|
|
2
|
+
import { SupportAgentBalanceDto } from "./support-agent-balance.dto";
|
|
3
|
+
import { SupportLabPendingAnalysisDto } from "./support-lab-analyze.dto";
|
|
2
4
|
export interface SupportLabFocusDto {
|
|
3
5
|
idStage?: number;
|
|
4
6
|
runType?: string;
|
|
5
7
|
}
|
|
6
8
|
export interface SupportLabAskDto {
|
|
7
9
|
idCrew: number;
|
|
8
|
-
|
|
10
|
+
idSession?: string;
|
|
11
|
+
message?: SupportMessageDto;
|
|
12
|
+
/** @deprecated compat 1 deploy: frontend antigo manda o histórico inteiro (modo stateless) */
|
|
13
|
+
messages?: SupportMessageDto[];
|
|
9
14
|
currentPage?: string;
|
|
10
15
|
focus?: SupportLabFocusDto;
|
|
11
16
|
userRole?: string;
|
|
@@ -24,6 +29,10 @@ export interface SupportLabProposalDto {
|
|
|
24
29
|
}
|
|
25
30
|
export interface SupportLabAnswerDto {
|
|
26
31
|
content: string;
|
|
27
|
-
|
|
32
|
+
idSession?: string;
|
|
28
33
|
proposals?: SupportLabProposalDto[];
|
|
34
|
+
pendingAnalysis?: SupportLabPendingAnalysisDto;
|
|
35
|
+
balance?: SupportAgentBalanceDto;
|
|
36
|
+
/** @deprecated cotas removidas; usar `balance` */
|
|
37
|
+
remainingToday?: number;
|
|
29
38
|
}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { SupportLabProposalDto } from "./support-lab-ask.dto";
|
|
2
|
+
import { SupportLabAnalysisMetaDto, SupportLabPendingAnalysisDto } from "./support-lab-analyze.dto";
|
|
3
|
+
export type SupportLabMessageKind = 'chat' | 'analysis-report' | 'analysis-pending';
|
|
4
|
+
export interface SupportLabSessionSummaryDto {
|
|
5
|
+
id: string;
|
|
6
|
+
idCrew: number;
|
|
7
|
+
dsTitle: string | null;
|
|
8
|
+
nrMessages: number;
|
|
9
|
+
dtCreated: string;
|
|
10
|
+
dtUpdated: string;
|
|
11
|
+
}
|
|
12
|
+
export interface SupportLabSessionMessageDto {
|
|
13
|
+
id: number;
|
|
14
|
+
role: 'user' | 'assistant';
|
|
15
|
+
kind: SupportLabMessageKind;
|
|
16
|
+
text: string;
|
|
17
|
+
images?: string[];
|
|
18
|
+
proposals?: SupportLabProposalDto[];
|
|
19
|
+
pendingAnalysis?: SupportLabPendingAnalysisDto;
|
|
20
|
+
analysisMeta?: SupportLabAnalysisMetaDto;
|
|
21
|
+
dtCreated: string;
|
|
22
|
+
}
|
|
23
|
+
export interface SupportLabSessionDto extends SupportLabSessionSummaryDto {
|
|
24
|
+
messages: SupportLabSessionMessageDto[];
|
|
25
|
+
}
|
|
26
|
+
export interface SupportLabSessionRenameDto {
|
|
27
|
+
dsTitle: string;
|
|
28
|
+
}
|