@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.
- package/index.cjs.js +2405 -1616
- package/package.json +2 -2
- package/src/lib/ai/ai.service.d.ts +160 -145
- package/src/lib/ai/index.d.ts +1 -1
- package/src/lib/ai/models/index.d.ts +566 -12
- package/src/lib/communication/mail-template/email-template.service.d.ts +3 -1
- package/src/lib/communication/mail-template/models/email-template-catalog-entry.d.ts +9 -0
- package/src/lib/communication/mail-template/models/email-template-type.d.ts +2 -1
- package/src/lib/communication/mail-template/models/email-template.d.ts +3 -0
- package/src/lib/communication/mail-template/models/index.d.ts +1 -0
- package/src/lib/configuration/configuration.service.d.ts +7 -1
- package/src/lib/configuration/models/index.d.ts +1 -0
- package/src/lib/configuration/models/module-variable.d.ts +23 -0
- package/src/lib/fluxo-client.d.ts +3 -3
- package/src/lib/fluxo-state-dispatcher.d.ts +3 -0
- package/src/lib/ai/models/agent.d.ts +0 -21
- package/src/lib/ai/models/create-agent.d.ts +0 -6
- package/src/lib/ai/models/create-llm-settings.d.ts +0 -17
- package/src/lib/ai/models/create-mcp-server.d.ts +0 -22
- package/src/lib/ai/models/create-orchestration.d.ts +0 -9
- package/src/lib/ai/models/llm-settings.d.ts +0 -25
- package/src/lib/ai/models/mcp-server.d.ts +0 -38
- package/src/lib/ai/models/orchestration.d.ts +0 -27
- package/src/lib/ai/models/update-agent.d.ts +0 -6
- package/src/lib/ai/models/update-llm-settings.d.ts +0 -10
- package/src/lib/ai/models/update-mcp-server.d.ts +0 -20
- 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.
|
|
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.
|
|
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 {
|
|
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
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
/**
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
*
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
*
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
*
|
|
55
|
-
*/
|
|
56
|
-
|
|
57
|
-
/**
|
|
58
|
-
*
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
*
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
*
|
|
67
|
-
*/
|
|
68
|
-
|
|
69
|
-
/**
|
|
70
|
-
*
|
|
71
|
-
*
|
|
72
|
-
*
|
|
73
|
-
*/
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
*
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
*
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
*
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
*
|
|
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
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
*
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
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
|
}
|
package/src/lib/ai/index.d.ts
CHANGED