@fluxo-dev/api-client-base 26.2.5 → 26.3.1

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.
Files changed (27) hide show
  1. package/index.cjs.js +2405 -1616
  2. package/package.json +2 -2
  3. package/src/lib/ai/ai.service.d.ts +160 -145
  4. package/src/lib/ai/index.d.ts +1 -1
  5. package/src/lib/ai/models/index.d.ts +566 -12
  6. package/src/lib/communication/mail-template/email-template.service.d.ts +3 -1
  7. package/src/lib/communication/mail-template/models/email-template-catalog-entry.d.ts +9 -0
  8. package/src/lib/communication/mail-template/models/email-template-type.d.ts +2 -1
  9. package/src/lib/communication/mail-template/models/email-template.d.ts +3 -0
  10. package/src/lib/communication/mail-template/models/index.d.ts +1 -0
  11. package/src/lib/configuration/configuration.service.d.ts +7 -1
  12. package/src/lib/configuration/models/index.d.ts +1 -0
  13. package/src/lib/configuration/models/module-variable.d.ts +23 -0
  14. package/src/lib/fluxo-client.d.ts +3 -3
  15. package/src/lib/fluxo-state-dispatcher.d.ts +3 -0
  16. package/src/lib/ai/models/agent.d.ts +0 -21
  17. package/src/lib/ai/models/create-agent.d.ts +0 -6
  18. package/src/lib/ai/models/create-llm-settings.d.ts +0 -17
  19. package/src/lib/ai/models/create-mcp-server.d.ts +0 -22
  20. package/src/lib/ai/models/create-orchestration.d.ts +0 -9
  21. package/src/lib/ai/models/llm-settings.d.ts +0 -25
  22. package/src/lib/ai/models/mcp-server.d.ts +0 -38
  23. package/src/lib/ai/models/orchestration.d.ts +0 -27
  24. package/src/lib/ai/models/update-agent.d.ts +0 -6
  25. package/src/lib/ai/models/update-llm-settings.d.ts +0 -10
  26. package/src/lib/ai/models/update-mcp-server.d.ts +0 -20
  27. package/src/lib/ai/models/update-orchestration.d.ts +0 -9
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@fluxo-dev/api-client-base",
3
- "version": "26.2.5",
3
+ "version": "26.3.1",
4
4
  "type": "commonjs",
5
5
  "peerDependencies": {
6
6
  "react": "^18.3.1",
@@ -8,7 +8,7 @@
8
8
  "react-router-dom": "^6.11.2",
9
9
  "react-redux": "^8.0.5",
10
10
  "@reduxjs/toolkit": "^1.9.1",
11
- "@fluxo-dev/state": "^26.2.5"
11
+ "@fluxo-dev/state": "^26.3.1"
12
12
  },
13
13
  "main": "./index.cjs.js",
14
14
  "types": "./index.cjs.d.ts"
@@ -1,148 +1,163 @@
1
- import { CreateLLMSettingsCommand, LLMSettingsDto, UpdateLLMSettingsCommand, AgentDto, CreateAgentCommand, UpdateAgentCommand, CreateAgentOrchestrationCommand, AgentOrchestrationDto, UpdateAgentOrchestrationCommand, McpServerConfigurationDto, CreateMcpServerCommand, UpdateMcpServerCommand } from './models';
1
+ import { LlmConfigDto, CreateLlmConfigCommand, UpdateLlmConfigCommand, AiAgentDto, CreateAgentCommand, UpdateAgentCommand, UpdateAgentToolsCommand, AiToolDto, AiWorkflowDto, CreateAiWorkflowCommand, UpdateAiWorkflowCommand, UpdateAiWorkflowAgentsCommand, ChatTargetDto, StartConversationCommand, StartConversationResult, ChatConversationSummaryDto, ChatConversationDetailDto, RenameConversationCommand, UpdateConversationTagsCommand, SetActiveLeafCommand, AiChatAttachmentDto, AiPromptTemplateDto, CreateAiPromptTemplateCommand, UpdateAiPromptTemplateCommand, UpdateAgentMcpServersCommand, McpServerConfigurationDto, CreateMcpServerCommand, UpdateMcpServerCommand, McpServerTestResultDto, AvailableToolDto, AvailableSkillDto, AiSkillDto, AiSkillFileContentDto, CreateAiSkillCommand, UpdateAiSkillCommand, TestSkillScriptCommand, AiSkillScriptTestResultDto, UpdateAgentSkillsCommand } from './models';
2
2
  export declare class AiService {
3
- /**
4
- * ========================================
5
- * LLM SETTINGS METHODS
6
- * ========================================
7
- */
8
- /**
9
- * Lista tutte le configurazioni LLM
10
- */
11
- getAllLLMSettings(): Promise<LLMSettingsDto[]>;
12
- /**
13
- * Ottieni una configurazione specifica
14
- */
15
- getLLMSettingsById(id: string): Promise<LLMSettingsDto>;
16
- /**
17
- * Crea una nuova configurazione LLM
18
- */
19
- createLLMSettings(command: CreateLLMSettingsCommand): Promise<LLMSettingsDto>;
20
- /**
21
- * Aggiorna una configurazione esistente
22
- */
23
- updateLLMSettings(id: string, command: UpdateLLMSettingsCommand): Promise<LLMSettingsDto>;
24
- /**
25
- * Attiva una configurazione
26
- */
27
- activateLLMSettings(id: string): Promise<LLMSettingsDto>;
28
- /**
29
- * Disattiva una configurazione
30
- */
31
- deactivateLLMSettings(id: string): Promise<LLMSettingsDto>;
32
- /**
33
- * Elimina una configurazione
34
- */
35
- deleteLLMSettings(id: string): Promise<void>;
36
- /**
37
- * ========================================
38
- * AGENT METHODS
39
- * ========================================
40
- */
41
- /**
42
- * Lista tutti gli agenti
43
- */
44
- getAllAgents(): Promise<AgentDto[]>;
45
- /**
46
- * Ottieni un agente specifico
47
- */
48
- getAgentById(id: string): Promise<AgentDto>;
49
- /**
50
- * Crea un nuovo agente
51
- */
52
- createAgent(command: CreateAgentCommand): Promise<AgentDto>;
53
- /**
54
- * Aggiorna un agente esistente
55
- */
56
- updateAgent(id: string, command: UpdateAgentCommand): Promise<AgentDto>;
57
- /**
58
- * Attiva un agente
59
- */
60
- activateAgent(id: string): Promise<AgentDto>;
61
- /**
62
- * Disattiva un agente
63
- */
64
- deactivateAgent(id: string): Promise<AgentDto>;
65
- /**
66
- * Elimina un agente
67
- */
68
- deleteAgent(id: string): Promise<void>;
69
- /**
70
- * ========================================
71
- * ORCHESTRATION METHODS
72
- * ========================================
73
- */
74
- /**
75
- * Lista tutte le orchestrazioni
76
- */
77
- getAllOrchestrations(): Promise<AgentOrchestrationDto[]>;
78
- /**
79
- * Ottieni un'orchestrazione specifica
80
- */
81
- getOrchestrationById(id: string): Promise<AgentOrchestrationDto>;
82
- /**
83
- * Crea una nuova orchestrazione
84
- */
85
- createOrchestration(command: CreateAgentOrchestrationCommand): Promise<AgentOrchestrationDto>;
86
- /**
87
- * Aggiorna un'orchestrazione esistente
88
- */
89
- updateOrchestration(id: string, command: UpdateAgentOrchestrationCommand): Promise<AgentOrchestrationDto>;
90
- /**
91
- * Attiva un'orchestrazione
92
- */
93
- activateOrchestration(id: string): Promise<AgentOrchestrationDto>;
94
- /**
95
- * Disattiva un'orchestrazione
96
- */
97
- deactivateOrchestration(id: string): Promise<AgentOrchestrationDto>;
98
- /**
99
- * Elimina un'orchestrazione
100
- */
101
- deleteOrchestration(id: string): Promise<void>;
102
- /**
103
- * ========================================
104
- * MCP SERVER METHODS
105
- * ========================================
106
- */
107
- /**
108
- * Lista tutti i server MCP
109
- */
110
- getAllMcpServers(): Promise<McpServerConfigurationDto[]>;
111
- /**
112
- * Ottieni un server MCP specifico
113
- */
114
- getMcpServerById(id: string): Promise<McpServerConfigurationDto>;
115
- /**
116
- * Crea un nuovo server MCP
117
- */
3
+ getLlmConfigs(): Promise<LlmConfigDto[]>;
4
+ getLlmConfig(id: number): Promise<LlmConfigDto>;
5
+ createLlmConfig(command: CreateLlmConfigCommand): Promise<LlmConfigDto>;
6
+ updateLlmConfig(id: number, command: UpdateLlmConfigCommand): Promise<LlmConfigDto>;
7
+ deleteLlmConfig(id: number): Promise<void>;
8
+ getAgents(): Promise<AiAgentDto[]>;
9
+ getAgent(id: number): Promise<AiAgentDto>;
10
+ createAgent(command: CreateAgentCommand): Promise<AiAgentDto>;
11
+ updateAgent(id: number, command: UpdateAgentCommand): Promise<AiAgentDto>;
12
+ deleteAgent(id: number): Promise<void>;
13
+ updateAgentTools(id: number, command: UpdateAgentToolsCommand): Promise<void>;
14
+ /** Replace the set of MCP servers linked to an agent. Empty array detaches all. */
15
+ updateAgentMcpServers(id: number, command: UpdateAgentMcpServersCommand): Promise<void>;
16
+ /** Replace the set of skills linked to an agent. Empty array detaches all. */
17
+ updateAgentSkills(id: number, command: UpdateAgentSkillsCommand): Promise<void>;
18
+ /**
19
+ * Live snapshot of the tools the agent can invoke right now (native + MCP).
20
+ * The FE uses this to render origin badges and to group the `/tools` modal.
21
+ */
22
+ getAvailableTools(id: number): Promise<AvailableToolDto[]>;
23
+ /**
24
+ * Live snapshot of the skills currently linked to the agent. Used by the chat
25
+ * UI to attribute synthetic skill tool_calls (`load_skill`,
26
+ * `read_skill_resource`, `run_skill_script`) to a row, and to render the
27
+ * "Skill" group in the `/tools` modal.
28
+ */
29
+ getAvailableSkills(id: number): Promise<AvailableSkillDto[]>;
30
+ getTools(): Promise<AiToolDto[]>;
31
+ getTool(id: string): Promise<AiToolDto>;
32
+ getAiWorkflows(): Promise<AiWorkflowDto[]>;
33
+ getAiWorkflow(id: number): Promise<AiWorkflowDto>;
34
+ createAiWorkflow(command: CreateAiWorkflowCommand): Promise<AiWorkflowDto>;
35
+ updateAiWorkflow(id: number, command: UpdateAiWorkflowCommand): Promise<AiWorkflowDto>;
36
+ deleteAiWorkflow(id: number): Promise<void>;
37
+ updateAiWorkflowAgents(id: number, command: UpdateAiWorkflowAgentsCommand): Promise<void>;
38
+ /** Lista degli agenti/workflow pubblici con cui l'utente può aprire una chat. */
39
+ getChatTargets(): Promise<ChatTargetDto[]>;
40
+ /** Pre-crea una conversazione e restituisce le coordinate AG-UI (`threadId` + `aguiUrl`). */
41
+ startConversation(command: StartConversationCommand): Promise<StartConversationResult>;
42
+ /** Tutte le conversazioni dell'utente ordinate per ultima attività (più recente prima). */
43
+ getConversations(): Promise<ChatConversationSummaryDto[]>;
44
+ /**
45
+ * Conversation metadata + active-branch chain (root → leaf). Each message carries its
46
+ * sibling externalIds for the branch navigator. Not paginated: a single branch chain is
47
+ * bounded — typically a few dozen messages.
48
+ */
49
+ getConversation(id: string): Promise<ChatConversationDetailDto>;
50
+ /** Rinomina la conversazione. Il backend non ritorna body. */
51
+ renameConversation(id: string, command: RenameConversationCommand): Promise<void>;
52
+ /**
53
+ * Replace ALL tags on a conversation. Backend lowercases + de-duplicates + trims;
54
+ * pass an empty array to remove every tag.
55
+ */
56
+ updateConversationTags(id: string, command: UpdateConversationTagsCommand): Promise<void>;
57
+ /**
58
+ * Download the conversation as a Blob in the requested format. The blob's MIME
59
+ * type matches the server's Content-Type (`text/markdown` or `application/json`).
60
+ * The caller is expected to wire this to a hidden `<a download>` to trigger the
61
+ * browser save dialog — see the conversation menu in ConversationList.tsx.
62
+ *
63
+ * The shared HttpClient interceptor unwraps axios's `response.data`, so with
64
+ * `responseType: 'blob'` we get the Blob directly. The `as` cast is just to
65
+ * satisfy TS — axios's generic ties the return to `AxiosResponse<Blob>` even
66
+ * after the interceptor has re-typed it.
67
+ */
68
+ exportConversation(id: string, format: 'md' | 'json'): Promise<Blob>;
69
+ /**
70
+ * Switch del branch attivo. Dopo questa chiamata, `getConversation` ritorna la chain del
71
+ * nuovo leaf e il prossimo turn si aggancia a quel ramo. Il frontend dovrebbe ricaricare
72
+ * la conversazione subito dopo per riflettere lo stato.
73
+ */
74
+ setActiveLeaf(id: string, command: SetActiveLeafCommand): Promise<void>;
75
+ /** Elimina conversazione e tutti i messaggi associati. */
76
+ deleteConversation(id: string): Promise<void>;
77
+ /**
78
+ * Carica un file come attachment, ritornando la metadata persistita (incluso l'id che
79
+ * va poi passato via header `X-Fluxo-Attachment-Ids` al prossimo turn AGUI).
80
+ * L'attachment resta "orphan" finché non viene linkato a un user msg dal dispatcher.
81
+ */
82
+ uploadAttachment(conversationId: string, file: File): Promise<AiChatAttachmentDto>;
83
+ /**
84
+ * Elimina un attachment orphan (uploaded ma non ancora associato a un turn inviato).
85
+ * Il backend rifiuta con 409 se l'attachment è già stato linkato a un messaggio.
86
+ */
87
+ deleteAttachment(conversationId: string, attachmentId: number): Promise<void>;
88
+ /**
89
+ * List every attachment in the conversation, newest first. Includes both user
90
+ * uploads and files harvested from skill script `cwd`s. Used by the chat header's
91
+ * 📎 drawer to show "Allegati prodotti" (skill outputs) alongside inputs.
92
+ *
93
+ * Returns an empty array if the conversation has no attachments OR if the caller
94
+ * doesn't own it (backend returns 404 — caller treats it as "no access, no list").
95
+ */
96
+ listConversationAttachments(conversationId: string): Promise<AiChatAttachmentDto[]>;
97
+ /**
98
+ * Risolve una URL relativa di attachment (es. ContentUrl ritornato dal DTO) in URL
99
+ * assoluta + headers di autenticazione, pronta per essere usata come `src` di `<img>`
100
+ * o come destinazione di un fetch manuale.
101
+ */
102
+ resolveAttachmentUrl(contentUrl: string): {
103
+ url: string;
104
+ headers: Record<string, string>;
105
+ };
106
+ /** List every skill (org-wide), ordered most-recent UpdatedAt first. */
107
+ getSkills(): Promise<AiSkillDto[]>;
108
+ getSkill(id: number): Promise<AiSkillDto>;
109
+ createSkill(command: CreateAiSkillCommand): Promise<AiSkillDto>;
110
+ updateSkill(id: number, command: UpdateAiSkillCommand): Promise<AiSkillDto>;
111
+ deleteSkill(id: number): Promise<void>;
112
+ /**
113
+ * Import a skill from an agentskills.io-shaped archive (`.zip` / `.tar.gz` /
114
+ * `.tgz`). The BE parses `SKILL.md` (frontmatter → name/description, body →
115
+ * instructions) and dumps the entire tree (every other file) into
116
+ * `AiSkillFile` rows preserving relative paths — including binary assets
117
+ * and nested helpers used by Python packages like Anthropic's pptx skill.
118
+ * Returns the newly created skill DTO. Throws (4xx propagated as `message`)
119
+ * if the archive is malformed or fails validation.
120
+ */
121
+ importSkill(file: File): Promise<AiSkillDto>;
122
+ /**
123
+ * Fetch the bytes (base64 in `content`) of one supporting file attached to
124
+ * a skill. Separate from `getSkill` because skill imports can carry tens of
125
+ * MB of nested files — pulling them on every editor render would be wasteful.
126
+ * The editor "Additional files" section calls this when the admin clicks a
127
+ * row to inspect a specific file's content.
128
+ */
129
+ getSkillFileContent(skillId: number, fileId: number): Promise<AiSkillFileContentDto>;
130
+ /**
131
+ * Run a script with admin-provided mock args. Never throws — failure is
132
+ * surfaced as `success: false` with a sanitised `error` message. Used by the
133
+ * "Test script" inline panel in the skill editor.
134
+ */
135
+ testSkillScript(skillId: number, scriptId: number, command: TestSkillScriptCommand): Promise<AiSkillScriptTestResultDto>;
136
+ /** List every MCP server visible to the org, ordered alphabetically by name. */
137
+ getMcpServers(): Promise<McpServerConfigurationDto[]>;
138
+ getMcpServer(id: number): Promise<McpServerConfigurationDto>;
118
139
  createMcpServer(command: CreateMcpServerCommand): Promise<McpServerConfigurationDto>;
119
- /**
120
- * Aggiorna un server MCP esistente
121
- */
122
- updateMcpServer(id: string, command: UpdateMcpServerCommand): Promise<McpServerConfigurationDto>;
123
- /**
124
- * Attiva un server MCP
125
- */
126
- activateMcpServer(id: string): Promise<McpServerConfigurationDto>;
127
- /**
128
- * Disattiva un server MCP
129
- */
130
- deactivateMcpServer(id: string): Promise<McpServerConfigurationDto>;
131
- /**
132
- * Elimina un server MCP
133
- */
134
- deleteMcpServer(id: string): Promise<void>;
135
- /**
136
- * ========================================
137
- * AGENT-MCP ASSOCIATION METHODS
138
- * ========================================
139
- */
140
- /**
141
- * Associa un server MCP ad un agente
142
- */
143
- associateMcpServerToAgent(agentId: string, mcpServerId: string): Promise<AgentDto>;
144
- /**
145
- * Rimuovi l'associazione tra un server MCP e un agente
146
- */
147
- dissociateMcpServerFromAgent(agentId: string, mcpServerId: string): Promise<AgentDto>;
140
+ updateMcpServer(id: number, command: UpdateMcpServerCommand): Promise<McpServerConfigurationDto>;
141
+ deleteMcpServer(id: number): Promise<void>;
142
+ /**
143
+ * Try the server's transport and list its tools, then dispose the transient client.
144
+ * Never throws — failures are reported via `McpServerTestResultDto.error`.
145
+ */
146
+ testMcpServer(id: number): Promise<McpServerTestResultDto>;
147
+ /** Manually invalidate the pool's cached tool snapshot for a server. */
148
+ refreshMcpServer(id: number): Promise<void>;
149
+ /** Org-wide library of reusable templates. Ordered by most-recent UpdatedAt. */
150
+ getPromptTemplates(): Promise<AiPromptTemplateDto[]>;
151
+ getPromptTemplate(id: number): Promise<AiPromptTemplateDto>;
152
+ createPromptTemplate(command: CreateAiPromptTemplateCommand): Promise<AiPromptTemplateDto>;
153
+ updatePromptTemplate(id: number, command: UpdateAiPromptTemplateCommand): Promise<AiPromptTemplateDto>;
154
+ deletePromptTemplate(id: number): Promise<void>;
155
+ /**
156
+ * Trasforma l'`aguiUrl` (relativo, ritornato dal backend) in URL assoluto
157
+ * + headers di autenticazione, pronti per `HttpAgent` di AG-UI / CopilotKit.
158
+ */
159
+ resolveAguiUrl(aguiUrl: string): {
160
+ url: string;
161
+ headers: Record<string, string>;
162
+ };
148
163
  }
@@ -1,2 +1,2 @@
1
+ export * from './models/index';
1
2
  export * from './ai.service';
2
- export * from './models';