@rodrigobeber/patoai-dtos 4.7.65 → 4.7.67
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/ai/core/agent-model-config.dto.d.ts +13 -0
- package/dist/ai/core/agent-model-config.dto.js +2 -0
- package/dist/ai/core/completion.enum.d.ts +7 -1
- package/dist/ai/core/completion.enum.js +8 -0
- package/dist/ai/core/index.d.ts +1 -0
- package/dist/ai/core/index.js +1 -0
- package/dist/billing/billing-agent-response.dto.d.ts +26 -0
- package/dist/billing/billing-agent-response.dto.js +7 -0
- package/dist/billing/billing-agent-usage.dto.d.ts +18 -0
- package/dist/billing/billing-agent-usage.dto.js +10 -0
- 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 +2 -1
- package/dist/billing/index.js +2 -1
- 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,13 @@
|
|
|
1
|
+
import { CompletionEnum } from "./completion.enum";
|
|
2
|
+
import { ProviderEnum } from "./provider.enum";
|
|
3
|
+
export interface AgentModelConfigRequestDto {
|
|
4
|
+
idCrew?: number | null;
|
|
5
|
+
cdType: CompletionEnum;
|
|
6
|
+
}
|
|
7
|
+
export interface AgentModelConfigDto {
|
|
8
|
+
provider: ProviderEnum;
|
|
9
|
+
model: string;
|
|
10
|
+
effort: string;
|
|
11
|
+
maxTokens: number;
|
|
12
|
+
temperature: number;
|
|
13
|
+
}
|
|
@@ -4,5 +4,11 @@ export declare enum CompletionEnum {
|
|
|
4
4
|
SUMMARY = "summary",
|
|
5
5
|
VOLUME_M3 = "volume-m3",
|
|
6
6
|
HANDOFF = "handoff",
|
|
7
|
-
SCHEDULE_CONFIRM = "schedule-confirm"
|
|
7
|
+
SCHEDULE_CONFIRM = "schedule-confirm",// julga a conversa e decide se o lead confirmou o agendamento
|
|
8
|
+
LAB_CHAT = "lab-chat",// assistente de prompt do Laboratório (F1/F2)
|
|
9
|
+
LAB_ANALYSIS = "lab-analysis",// análise profunda de conversas (F3)
|
|
10
|
+
SUPPORT = "support",// agente de suporte do painel
|
|
11
|
+
WIZARD_CHAT = "wizard-chat",// wizard de criação: conversa
|
|
12
|
+
WIZARD_GENERATE = "wizard-generate",// wizard: geração do agente
|
|
13
|
+
WIZARD_ASSIST = "wizard-assist"
|
|
8
14
|
}
|
|
@@ -9,4 +9,12 @@ var CompletionEnum;
|
|
|
9
9
|
CompletionEnum["VOLUME_M3"] = "volume-m3";
|
|
10
10
|
CompletionEnum["HANDOFF"] = "handoff";
|
|
11
11
|
CompletionEnum["SCHEDULE_CONFIRM"] = "schedule-confirm";
|
|
12
|
+
// Agentes INTERNOS de plataforma (modelo em base.completion + override crew.completion; credenciais
|
|
13
|
+
// são da PLATAFORMA, não de crew.provider). Ver AgentModelConfigDto / RPC ai.getModelConfig.
|
|
14
|
+
CompletionEnum["LAB_CHAT"] = "lab-chat";
|
|
15
|
+
CompletionEnum["LAB_ANALYSIS"] = "lab-analysis";
|
|
16
|
+
CompletionEnum["SUPPORT"] = "support";
|
|
17
|
+
CompletionEnum["WIZARD_CHAT"] = "wizard-chat";
|
|
18
|
+
CompletionEnum["WIZARD_GENERATE"] = "wizard-generate";
|
|
19
|
+
CompletionEnum["WIZARD_ASSIST"] = "wizard-assist";
|
|
12
20
|
})(CompletionEnum || (exports.CompletionEnum = CompletionEnum = {}));
|
package/dist/ai/core/index.d.ts
CHANGED
package/dist/ai/core/index.js
CHANGED
|
@@ -15,6 +15,7 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
|
15
15
|
};
|
|
16
16
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
17
|
__exportStar(require("./base64.dto"), exports);
|
|
18
|
+
__exportStar(require("./agent-model-config.dto"), exports);
|
|
18
19
|
__exportStar(require("./completion.enum"), exports);
|
|
19
20
|
__exportStar(require("./provider.dto"), exports);
|
|
20
21
|
__exportStar(require("./provider.enum"), exports);
|
|
@@ -0,0 +1,26 @@
|
|
|
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
|
+
}
|
|
20
|
+
export interface ConsumeAgentResponseResultDto {
|
|
21
|
+
ok: boolean;
|
|
22
|
+
nrResponses: number;
|
|
23
|
+
converted: boolean;
|
|
24
|
+
deduped?: boolean;
|
|
25
|
+
reason?: 'no_credits';
|
|
26
|
+
}
|
|
@@ -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 });
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
export interface BillingAgentLimitRequestDto {
|
|
2
|
+
idCrew: number;
|
|
3
|
+
cdAgent: string;
|
|
4
|
+
}
|
|
5
|
+
export interface BillingAgentLimitDto {
|
|
6
|
+
nrLimit: number;
|
|
7
|
+
cdWindow: string;
|
|
8
|
+
used: number;
|
|
9
|
+
remaining: number;
|
|
10
|
+
allowed: boolean;
|
|
11
|
+
}
|
|
12
|
+
export interface BillingConsumeAgentUsageRequestDto {
|
|
13
|
+
idCrew: number;
|
|
14
|
+
cdAgent: string;
|
|
15
|
+
}
|
|
16
|
+
export interface BillingConsumeAgentUsageDto {
|
|
17
|
+
used: number;
|
|
18
|
+
}
|
|
@@ -0,0 +1,10 @@
|
|
|
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
|
+
//
|
|
7
|
+
// Limite de uso GENÉRICO dos agentes internos de plataforma (lab-chat, lab-analysis, support, …),
|
|
8
|
+
// no billing. `cd_agent` identifica o agente; a janela (day|month) e o teto vêm de `billing.agent_limit`
|
|
9
|
+
// (linha id_crew=0 = default; id_crew>0 = exceção por-crew). Contador em `billing.agent_usage`.
|
|
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
|
@@ -2,4 +2,5 @@ export * from './billing-rest.dto';
|
|
|
2
2
|
export * from './billing-event.dto';
|
|
3
3
|
export * from './billing-consumption-report.dto';
|
|
4
4
|
export * from './billing-consumption-day-leads.dto';
|
|
5
|
-
export * from './billing-
|
|
5
|
+
export * from './billing-agent-usage.dto';
|
|
6
|
+
export * from './billing-agent-response.dto';
|
package/dist/billing/index.js
CHANGED
|
@@ -18,4 +18,5 @@ __exportStar(require("./billing-rest.dto"), exports);
|
|
|
18
18
|
__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
|
-
__exportStar(require("./billing-
|
|
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
|
+
}
|