@dolfinhos/studio 0.1.0 → 0.3.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.cjs +468 -155
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +67 -3
- package/dist/index.d.ts +67 -3
- package/dist/index.js +464 -153
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.d.cts
CHANGED
|
@@ -142,6 +142,42 @@ interface Fact {
|
|
|
142
142
|
createdAt: string;
|
|
143
143
|
createdBy: Actor | null;
|
|
144
144
|
}
|
|
145
|
+
/** Provedor de IA e se a empresa já cadastrou a chave (só o final dela vem do servidor). */
|
|
146
|
+
interface ProviderCredential {
|
|
147
|
+
name: string;
|
|
148
|
+
label: string;
|
|
149
|
+
description?: string;
|
|
150
|
+
/** O que acontece com a empresa sem chave (definido pela aplicação). */
|
|
151
|
+
whenMissing?: string;
|
|
152
|
+
configured: boolean;
|
|
153
|
+
last4?: string;
|
|
154
|
+
updatedAt?: string;
|
|
155
|
+
updatedBy?: string;
|
|
156
|
+
}
|
|
157
|
+
/** O que a empresa usa de IA: papéis, provedores, a escolha dela e o que está valendo. */
|
|
158
|
+
interface ModelsOverview {
|
|
159
|
+
roles: Array<{
|
|
160
|
+
name: string;
|
|
161
|
+
label: string;
|
|
162
|
+
description?: string;
|
|
163
|
+
}>;
|
|
164
|
+
providers: Array<{
|
|
165
|
+
name: string;
|
|
166
|
+
label: string;
|
|
167
|
+
description?: string;
|
|
168
|
+
configured: boolean;
|
|
169
|
+
defaults?: Record<string, string>;
|
|
170
|
+
}>;
|
|
171
|
+
chosen: {
|
|
172
|
+
provider: string;
|
|
173
|
+
models: Record<string, string>;
|
|
174
|
+
} | null;
|
|
175
|
+
active: {
|
|
176
|
+
provider: string;
|
|
177
|
+
models: Record<string, string>;
|
|
178
|
+
source: 'empresa' | 'plataforma';
|
|
179
|
+
} | null;
|
|
180
|
+
}
|
|
145
181
|
declare class StudioError extends Error {
|
|
146
182
|
readonly status: number;
|
|
147
183
|
constructor(message: string, status: number);
|
|
@@ -189,6 +225,26 @@ declare function createStudioClient(options?: StudioClientOptions): {
|
|
|
189
225
|
forget: (id: string) => Promise<{
|
|
190
226
|
ok: true;
|
|
191
227
|
}>;
|
|
228
|
+
credentials: () => Promise<ProviderCredential[]>;
|
|
229
|
+
saveCredential: (name: string, value: string) => Promise<ProviderCredential>;
|
|
230
|
+
removeCredential: (name: string) => Promise<{
|
|
231
|
+
ok: true;
|
|
232
|
+
}>;
|
|
233
|
+
models: () => Promise<ModelsOverview>;
|
|
234
|
+
availableModels: (provider: string) => Promise<{
|
|
235
|
+
id: string;
|
|
236
|
+
label?: string;
|
|
237
|
+
}[]>;
|
|
238
|
+
chooseModels: (choice: {
|
|
239
|
+
provider: string;
|
|
240
|
+
models: Record<string, string>;
|
|
241
|
+
}) => Promise<{
|
|
242
|
+
provider: string;
|
|
243
|
+
models: Record<string, string>;
|
|
244
|
+
}>;
|
|
245
|
+
resetModels: () => Promise<{
|
|
246
|
+
ok: true;
|
|
247
|
+
}>;
|
|
192
248
|
};
|
|
193
249
|
type StudioClient = ReturnType<typeof createStudioClient>;
|
|
194
250
|
interface StudioLabels {
|
|
@@ -252,6 +308,14 @@ declare function BehaviorSettings({ currency }: {
|
|
|
252
308
|
currency?: string | null;
|
|
253
309
|
}): react.JSX.Element;
|
|
254
310
|
|
|
311
|
+
/** As chaves de API que esta empresa usa nos provedores de IA. Cada empresa paga o próprio uso. */
|
|
312
|
+
declare function ProviderKeys(): react.JSX.Element;
|
|
313
|
+
/**
|
|
314
|
+
* O modelo de IA da empresa: a chave de cada provedor (DeepSeek, Claude,
|
|
315
|
+
* ChatGPT…), qual deles está em uso e o modelo de cada papel.
|
|
316
|
+
*/
|
|
317
|
+
declare function ModelSettings(): react.JSX.Element;
|
|
318
|
+
|
|
255
319
|
/** Documentos que o assistente e o bot consultam: perguntas frequentes, políticas, explicações. */
|
|
256
320
|
declare function KnowledgeBase(): react.JSX.Element;
|
|
257
321
|
|
|
@@ -262,7 +326,7 @@ declare function MyMemory({ subject }: {
|
|
|
262
326
|
subject: Pick<FactSubject, 'type' | 'id'>;
|
|
263
327
|
}): react.JSX.Element;
|
|
264
328
|
|
|
265
|
-
type StudioSection = 'approvals' | 'behavior' | 'automations' | 'knowledge' | 'memory' | 'usage' | 'audit';
|
|
329
|
+
type StudioSection = 'approvals' | 'behavior' | 'automations' | 'knowledge' | 'memory' | 'usage' | 'keys' | 'audit';
|
|
266
330
|
interface DolfinhosStudioProps {
|
|
267
331
|
/** Quais abas mostrar, nesta ordem. Padrão: todas. */
|
|
268
332
|
sections?: StudioSection[];
|
|
@@ -297,5 +361,5 @@ interface StudioProviderProps extends StudioClientOptions {
|
|
|
297
361
|
*/
|
|
298
362
|
declare function StudioProvider({ children, endpoint, headers, fetch, labels, locale, navigate }: StudioProviderProps): react.JSX.Element;
|
|
299
363
|
|
|
300
|
-
export { ApprovalsInbox, AuditLog, AutomationsEditor, BehaviorSettings, DolfinhosStudio, KnowledgeBase, MemoryBrowser, MyMemory, StudioContextProvider, StudioError, StudioProvider, UsageReport, createStudioClient, useResource, useStudio };
|
|
301
|
-
export type { Actor, ApprovalItem, ApprovalsInboxProps, Audience, AuditRecord, Automation, Capability, DolfinhosStudioProps, EventInfo, Fact, FactSubject, Kind, KnowledgeDoc, KnowledgeHit, Mode, PendingApproval, Risk, Rule, Settings, StudioClient, StudioClientOptions, StudioLabels, StudioProviderProps, StudioSection, UsageSummary, UsageTotals };
|
|
364
|
+
export { ApprovalsInbox, AuditLog, AutomationsEditor, BehaviorSettings, DolfinhosStudio, KnowledgeBase, MemoryBrowser, ModelSettings, MyMemory, ProviderKeys, StudioContextProvider, StudioError, StudioProvider, UsageReport, createStudioClient, useResource, useStudio };
|
|
365
|
+
export type { Actor, ApprovalItem, ApprovalsInboxProps, Audience, AuditRecord, Automation, Capability, DolfinhosStudioProps, EventInfo, Fact, FactSubject, Kind, KnowledgeDoc, KnowledgeHit, Mode, ModelsOverview, PendingApproval, ProviderCredential, Risk, Rule, Settings, StudioClient, StudioClientOptions, StudioLabels, StudioProviderProps, StudioSection, UsageSummary, UsageTotals };
|
package/dist/index.d.ts
CHANGED
|
@@ -142,6 +142,42 @@ interface Fact {
|
|
|
142
142
|
createdAt: string;
|
|
143
143
|
createdBy: Actor | null;
|
|
144
144
|
}
|
|
145
|
+
/** Provedor de IA e se a empresa já cadastrou a chave (só o final dela vem do servidor). */
|
|
146
|
+
interface ProviderCredential {
|
|
147
|
+
name: string;
|
|
148
|
+
label: string;
|
|
149
|
+
description?: string;
|
|
150
|
+
/** O que acontece com a empresa sem chave (definido pela aplicação). */
|
|
151
|
+
whenMissing?: string;
|
|
152
|
+
configured: boolean;
|
|
153
|
+
last4?: string;
|
|
154
|
+
updatedAt?: string;
|
|
155
|
+
updatedBy?: string;
|
|
156
|
+
}
|
|
157
|
+
/** O que a empresa usa de IA: papéis, provedores, a escolha dela e o que está valendo. */
|
|
158
|
+
interface ModelsOverview {
|
|
159
|
+
roles: Array<{
|
|
160
|
+
name: string;
|
|
161
|
+
label: string;
|
|
162
|
+
description?: string;
|
|
163
|
+
}>;
|
|
164
|
+
providers: Array<{
|
|
165
|
+
name: string;
|
|
166
|
+
label: string;
|
|
167
|
+
description?: string;
|
|
168
|
+
configured: boolean;
|
|
169
|
+
defaults?: Record<string, string>;
|
|
170
|
+
}>;
|
|
171
|
+
chosen: {
|
|
172
|
+
provider: string;
|
|
173
|
+
models: Record<string, string>;
|
|
174
|
+
} | null;
|
|
175
|
+
active: {
|
|
176
|
+
provider: string;
|
|
177
|
+
models: Record<string, string>;
|
|
178
|
+
source: 'empresa' | 'plataforma';
|
|
179
|
+
} | null;
|
|
180
|
+
}
|
|
145
181
|
declare class StudioError extends Error {
|
|
146
182
|
readonly status: number;
|
|
147
183
|
constructor(message: string, status: number);
|
|
@@ -189,6 +225,26 @@ declare function createStudioClient(options?: StudioClientOptions): {
|
|
|
189
225
|
forget: (id: string) => Promise<{
|
|
190
226
|
ok: true;
|
|
191
227
|
}>;
|
|
228
|
+
credentials: () => Promise<ProviderCredential[]>;
|
|
229
|
+
saveCredential: (name: string, value: string) => Promise<ProviderCredential>;
|
|
230
|
+
removeCredential: (name: string) => Promise<{
|
|
231
|
+
ok: true;
|
|
232
|
+
}>;
|
|
233
|
+
models: () => Promise<ModelsOverview>;
|
|
234
|
+
availableModels: (provider: string) => Promise<{
|
|
235
|
+
id: string;
|
|
236
|
+
label?: string;
|
|
237
|
+
}[]>;
|
|
238
|
+
chooseModels: (choice: {
|
|
239
|
+
provider: string;
|
|
240
|
+
models: Record<string, string>;
|
|
241
|
+
}) => Promise<{
|
|
242
|
+
provider: string;
|
|
243
|
+
models: Record<string, string>;
|
|
244
|
+
}>;
|
|
245
|
+
resetModels: () => Promise<{
|
|
246
|
+
ok: true;
|
|
247
|
+
}>;
|
|
192
248
|
};
|
|
193
249
|
type StudioClient = ReturnType<typeof createStudioClient>;
|
|
194
250
|
interface StudioLabels {
|
|
@@ -252,6 +308,14 @@ declare function BehaviorSettings({ currency }: {
|
|
|
252
308
|
currency?: string | null;
|
|
253
309
|
}): react.JSX.Element;
|
|
254
310
|
|
|
311
|
+
/** As chaves de API que esta empresa usa nos provedores de IA. Cada empresa paga o próprio uso. */
|
|
312
|
+
declare function ProviderKeys(): react.JSX.Element;
|
|
313
|
+
/**
|
|
314
|
+
* O modelo de IA da empresa: a chave de cada provedor (DeepSeek, Claude,
|
|
315
|
+
* ChatGPT…), qual deles está em uso e o modelo de cada papel.
|
|
316
|
+
*/
|
|
317
|
+
declare function ModelSettings(): react.JSX.Element;
|
|
318
|
+
|
|
255
319
|
/** Documentos que o assistente e o bot consultam: perguntas frequentes, políticas, explicações. */
|
|
256
320
|
declare function KnowledgeBase(): react.JSX.Element;
|
|
257
321
|
|
|
@@ -262,7 +326,7 @@ declare function MyMemory({ subject }: {
|
|
|
262
326
|
subject: Pick<FactSubject, 'type' | 'id'>;
|
|
263
327
|
}): react.JSX.Element;
|
|
264
328
|
|
|
265
|
-
type StudioSection = 'approvals' | 'behavior' | 'automations' | 'knowledge' | 'memory' | 'usage' | 'audit';
|
|
329
|
+
type StudioSection = 'approvals' | 'behavior' | 'automations' | 'knowledge' | 'memory' | 'usage' | 'keys' | 'audit';
|
|
266
330
|
interface DolfinhosStudioProps {
|
|
267
331
|
/** Quais abas mostrar, nesta ordem. Padrão: todas. */
|
|
268
332
|
sections?: StudioSection[];
|
|
@@ -297,5 +361,5 @@ interface StudioProviderProps extends StudioClientOptions {
|
|
|
297
361
|
*/
|
|
298
362
|
declare function StudioProvider({ children, endpoint, headers, fetch, labels, locale, navigate }: StudioProviderProps): react.JSX.Element;
|
|
299
363
|
|
|
300
|
-
export { ApprovalsInbox, AuditLog, AutomationsEditor, BehaviorSettings, DolfinhosStudio, KnowledgeBase, MemoryBrowser, MyMemory, StudioContextProvider, StudioError, StudioProvider, UsageReport, createStudioClient, useResource, useStudio };
|
|
301
|
-
export type { Actor, ApprovalItem, ApprovalsInboxProps, Audience, AuditRecord, Automation, Capability, DolfinhosStudioProps, EventInfo, Fact, FactSubject, Kind, KnowledgeDoc, KnowledgeHit, Mode, PendingApproval, Risk, Rule, Settings, StudioClient, StudioClientOptions, StudioLabels, StudioProviderProps, StudioSection, UsageSummary, UsageTotals };
|
|
364
|
+
export { ApprovalsInbox, AuditLog, AutomationsEditor, BehaviorSettings, DolfinhosStudio, KnowledgeBase, MemoryBrowser, ModelSettings, MyMemory, ProviderKeys, StudioContextProvider, StudioError, StudioProvider, UsageReport, createStudioClient, useResource, useStudio };
|
|
365
|
+
export type { Actor, ApprovalItem, ApprovalsInboxProps, Audience, AuditRecord, Automation, Capability, DolfinhosStudioProps, EventInfo, Fact, FactSubject, Kind, KnowledgeDoc, KnowledgeHit, Mode, ModelsOverview, PendingApproval, ProviderCredential, Risk, Rule, Settings, StudioClient, StudioClientOptions, StudioLabels, StudioProviderProps, StudioSection, UsageSummary, UsageTotals };
|