@ideascol/agents-generator-sdk 0.7.2 → 0.7.4
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/bin/cli.js +3325 -242
- package/dist/commands/agentsCommand.d.ts +1 -1
- package/dist/commands/chatCommand.d.ts +6 -0
- package/dist/commands/conversationsCommand.d.ts +1 -1
- package/dist/commands/rootCommand.d.ts +1 -1
- package/dist/index.js +49 -14
- package/dist/lib/clients/agents-generator/index.d.ts +2 -0
- package/dist/lib/clients/agents-generator/models/WhoamiResponse.d.ts +9 -0
- package/dist/lib/clients/agents-generator/services/AdminCredentialsService.d.ts +9 -0
- package/dist/lib/clients/agents-generator/services/AuthService.d.ts +11 -0
- package/dist/lib/clients/agents-generator/services/CredentialsService.d.ts +9 -0
- package/dist/lib/config.d.ts +34 -0
- package/dist/lib/index.d.ts +2 -1
- package/package.json +2 -2
package/dist/index.js
CHANGED
|
@@ -187,7 +187,7 @@ var OpenAPI;
|
|
|
187
187
|
var init_OpenAPI = __esm(() => {
|
|
188
188
|
OpenAPI = {
|
|
189
189
|
BASE: "",
|
|
190
|
-
VERSION: "main-
|
|
190
|
+
VERSION: "main-18ea61a3a4dd0d19d2d7aba58dce085c8bf2e17b",
|
|
191
191
|
WITH_CREDENTIALS: false,
|
|
192
192
|
CREDENTIALS: "include",
|
|
193
193
|
TOKEN: undefined,
|
|
@@ -982,6 +982,21 @@ class AdminCredentialsService {
|
|
|
982
982
|
}
|
|
983
983
|
});
|
|
984
984
|
}
|
|
985
|
+
static testCredential(credentialId, workspaceId) {
|
|
986
|
+
return request(OpenAPI, {
|
|
987
|
+
method: "POST",
|
|
988
|
+
url: "/credentials/{credential_id}/test",
|
|
989
|
+
path: {
|
|
990
|
+
credential_id: credentialId
|
|
991
|
+
},
|
|
992
|
+
query: {
|
|
993
|
+
workspace_id: workspaceId
|
|
994
|
+
},
|
|
995
|
+
errors: {
|
|
996
|
+
422: `Validation Error`
|
|
997
|
+
}
|
|
998
|
+
});
|
|
999
|
+
}
|
|
985
1000
|
static getCredentialDecrypted(credentialId, workspaceId) {
|
|
986
1001
|
return request(OpenAPI, {
|
|
987
1002
|
method: "GET",
|
|
@@ -1944,6 +1959,20 @@ var init_AgentFoldersService = __esm(() => {
|
|
|
1944
1959
|
init_request();
|
|
1945
1960
|
});
|
|
1946
1961
|
|
|
1962
|
+
// src/lib/clients/agents-generator/services/AuthService.ts
|
|
1963
|
+
class AuthService {
|
|
1964
|
+
static whoami() {
|
|
1965
|
+
return request(OpenAPI, {
|
|
1966
|
+
method: "GET",
|
|
1967
|
+
url: "/auth/whoami"
|
|
1968
|
+
});
|
|
1969
|
+
}
|
|
1970
|
+
}
|
|
1971
|
+
var init_AuthService = __esm(() => {
|
|
1972
|
+
init_OpenAPI();
|
|
1973
|
+
init_request();
|
|
1974
|
+
});
|
|
1975
|
+
|
|
1947
1976
|
// src/lib/clients/agents-generator/services/ConversationsService.ts
|
|
1948
1977
|
class ConversationsService {
|
|
1949
1978
|
static createConversation(requestBody) {
|
|
@@ -2126,6 +2155,21 @@ class CredentialsService {
|
|
|
2126
2155
|
}
|
|
2127
2156
|
});
|
|
2128
2157
|
}
|
|
2158
|
+
static testCredential(credentialId, workspaceId) {
|
|
2159
|
+
return request(OpenAPI, {
|
|
2160
|
+
method: "POST",
|
|
2161
|
+
url: "/credentials/{credential_id}/test",
|
|
2162
|
+
path: {
|
|
2163
|
+
credential_id: credentialId
|
|
2164
|
+
},
|
|
2165
|
+
query: {
|
|
2166
|
+
workspace_id: workspaceId
|
|
2167
|
+
},
|
|
2168
|
+
errors: {
|
|
2169
|
+
422: `Validation Error`
|
|
2170
|
+
}
|
|
2171
|
+
});
|
|
2172
|
+
}
|
|
2129
2173
|
static getCredentialDecrypted(credentialId, workspaceId) {
|
|
2130
2174
|
return request(OpenAPI, {
|
|
2131
2175
|
method: "GET",
|
|
@@ -3077,6 +3121,7 @@ var init_agents_generator = __esm(() => {
|
|
|
3077
3121
|
init_AdminWorkspacesService();
|
|
3078
3122
|
init_AgentService();
|
|
3079
3123
|
init_AgentFoldersService();
|
|
3124
|
+
init_AuthService();
|
|
3080
3125
|
init_ConversationsService();
|
|
3081
3126
|
init_CredentialsService();
|
|
3082
3127
|
init_FileLibraryService();
|
|
@@ -3136,7 +3181,8 @@ class AgentClient {
|
|
|
3136
3181
|
apiKeys: AdminApiKeysService,
|
|
3137
3182
|
presence: PresenceService,
|
|
3138
3183
|
schema: SchemaGeneratorService,
|
|
3139
|
-
tokenUsage: TokenUsageService
|
|
3184
|
+
tokenUsage: TokenUsageService,
|
|
3185
|
+
auth: AuthService
|
|
3140
3186
|
};
|
|
3141
3187
|
this.public = {
|
|
3142
3188
|
agents: PublicAgentsService,
|
|
@@ -3205,13 +3251,10 @@ var init_lib = __esm(() => {
|
|
|
3205
3251
|
function processStream() {
|
|
3206
3252
|
reader.read().then(({ done, value }) => {
|
|
3207
3253
|
if (done) {
|
|
3208
|
-
console.log("Stream completado");
|
|
3209
3254
|
if (buffer.length > 0) {
|
|
3210
|
-
console.log("Procesando buffer final:", buffer);
|
|
3211
3255
|
if (isDirectTextMode) {
|
|
3212
3256
|
fullMessage += buffer;
|
|
3213
3257
|
if (callbacks.onMessage) {
|
|
3214
|
-
console.log("Actualizando mensaje final (texto directo):", fullMessage);
|
|
3215
3258
|
callbacks.onMessage(fullMessage);
|
|
3216
3259
|
}
|
|
3217
3260
|
} else {
|
|
@@ -3242,7 +3285,6 @@ var init_lib = __esm(() => {
|
|
|
3242
3285
|
if (buffer.length > 0) {
|
|
3243
3286
|
fullMessage += buffer;
|
|
3244
3287
|
if (callbacks.onMessage) {
|
|
3245
|
-
console.log("Actualizando mensaje final (buffer restante):", fullMessage);
|
|
3246
3288
|
callbacks.onMessage(fullMessage);
|
|
3247
3289
|
}
|
|
3248
3290
|
}
|
|
@@ -3255,18 +3297,15 @@ var init_lib = __esm(() => {
|
|
|
3255
3297
|
}
|
|
3256
3298
|
const chunk = decoder.decode(value, { stream: true });
|
|
3257
3299
|
buffer += chunk;
|
|
3258
|
-
console.log("Chunk recibido:", chunk);
|
|
3259
3300
|
let eventEnd = buffer.indexOf(`
|
|
3260
3301
|
|
|
3261
3302
|
`);
|
|
3262
3303
|
if (buffer.length > 50 && eventEnd === -1 && !isDirectTextMode) {
|
|
3263
3304
|
isDirectTextMode = true;
|
|
3264
|
-
console.log("Detectado modo texto directo");
|
|
3265
3305
|
}
|
|
3266
3306
|
if (isDirectTextMode) {
|
|
3267
3307
|
fullMessage += chunk;
|
|
3268
3308
|
if (callbacks.onMessage) {
|
|
3269
|
-
console.log("Actualizando con texto directo:", fullMessage);
|
|
3270
3309
|
callbacks.onMessage(fullMessage);
|
|
3271
3310
|
}
|
|
3272
3311
|
} else {
|
|
@@ -3277,7 +3316,6 @@ var init_lib = __esm(() => {
|
|
|
3277
3316
|
const jsonStr = eventData.substring(6);
|
|
3278
3317
|
try {
|
|
3279
3318
|
const data = JSON.parse(jsonStr);
|
|
3280
|
-
console.log("Evento SSE recibido:", data);
|
|
3281
3319
|
if (data.type === "message" && data.content && callbacks.onMessage) {
|
|
3282
3320
|
fullMessage = data.content;
|
|
3283
3321
|
callbacks.onMessage(fullMessage);
|
|
@@ -3287,12 +3325,10 @@ var init_lib = __esm(() => {
|
|
|
3287
3325
|
callbacks.onTransfer(data.transfer);
|
|
3288
3326
|
}
|
|
3289
3327
|
} catch (e) {
|
|
3290
|
-
console.error("Error al parsear JSON del evento:", e);
|
|
3291
3328
|
if (eventData.startsWith("data: ")) {
|
|
3292
3329
|
const directContent = eventData.substring(6);
|
|
3293
3330
|
fullMessage += directContent;
|
|
3294
3331
|
if (callbacks.onMessage) {
|
|
3295
|
-
console.log("Actualizando con texto SSE simple:", fullMessage);
|
|
3296
3332
|
callbacks.onMessage(fullMessage);
|
|
3297
3333
|
}
|
|
3298
3334
|
} else {
|
|
@@ -3304,7 +3340,6 @@ var init_lib = __esm(() => {
|
|
|
3304
3340
|
} else {
|
|
3305
3341
|
fullMessage += eventData;
|
|
3306
3342
|
if (callbacks.onMessage) {
|
|
3307
|
-
console.log("Actualizando con evento no reconocido:", fullMessage);
|
|
3308
3343
|
callbacks.onMessage(fullMessage);
|
|
3309
3344
|
}
|
|
3310
3345
|
}
|
|
@@ -3316,7 +3351,6 @@ var init_lib = __esm(() => {
|
|
|
3316
3351
|
fullMessage += buffer;
|
|
3317
3352
|
buffer = "";
|
|
3318
3353
|
if (callbacks.onMessage) {
|
|
3319
|
-
console.log("Actualizando con buffer residual:", fullMessage);
|
|
3320
3354
|
callbacks.onMessage(fullMessage);
|
|
3321
3355
|
}
|
|
3322
3356
|
}
|
|
@@ -3409,6 +3443,7 @@ __export(exports_src, {
|
|
|
3409
3443
|
CollaboratorRole: () => CollaboratorRole,
|
|
3410
3444
|
CancelablePromise: () => CancelablePromise,
|
|
3411
3445
|
CancelError: () => CancelError,
|
|
3446
|
+
AuthService: () => AuthService,
|
|
3412
3447
|
ApiError: () => ApiError,
|
|
3413
3448
|
AgentService: () => AgentService,
|
|
3414
3449
|
AgentFoldersService: () => AgentFoldersService,
|
|
@@ -70,6 +70,7 @@ export type { VectorStoreSearchResponse } from './models/VectorStoreSearchRespon
|
|
|
70
70
|
export type { VectorStoreSearchResult } from './models/VectorStoreSearchResult';
|
|
71
71
|
export type { WebhookConfigCreate } from './models/WebhookConfigCreate';
|
|
72
72
|
export type { WebhookConfigUpdate } from './models/WebhookConfigUpdate';
|
|
73
|
+
export type { WhoamiResponse } from './models/WhoamiResponse';
|
|
73
74
|
export type { WorkspaceCollaboratorCreate } from './models/WorkspaceCollaboratorCreate';
|
|
74
75
|
export type { WorkspaceCollaboratorResponse } from './models/WorkspaceCollaboratorResponse';
|
|
75
76
|
export type { WorkspaceCollaboratorUpdate } from './models/WorkspaceCollaboratorUpdate';
|
|
@@ -90,6 +91,7 @@ export { AdminWebhookConfigsService } from './services/AdminWebhookConfigsServic
|
|
|
90
91
|
export { AdminWorkspacesService } from './services/AdminWorkspacesService';
|
|
91
92
|
export { AgentService } from './services/AgentService';
|
|
92
93
|
export { AgentFoldersService } from './services/AgentFoldersService';
|
|
94
|
+
export { AuthService } from './services/AuthService';
|
|
93
95
|
export { ConversationsService } from './services/ConversationsService';
|
|
94
96
|
export { CredentialsService } from './services/CredentialsService';
|
|
95
97
|
export { FileLibraryService } from './services/FileLibraryService';
|
|
@@ -47,6 +47,15 @@ export declare class AdminCredentialsService {
|
|
|
47
47
|
* @throws ApiError
|
|
48
48
|
*/
|
|
49
49
|
static deleteCredential(credentialId: string, workspaceId?: (string | null)): CancelablePromise<Record<string, any>>;
|
|
50
|
+
/**
|
|
51
|
+
* Test Credential
|
|
52
|
+
* Test a credential by validating it against the provider API - only admin and owner roles
|
|
53
|
+
* @param credentialId
|
|
54
|
+
* @param workspaceId
|
|
55
|
+
* @returns any Successful Response
|
|
56
|
+
* @throws ApiError
|
|
57
|
+
*/
|
|
58
|
+
static testCredential(credentialId: string, workspaceId?: (string | null)): CancelablePromise<Record<string, any>>;
|
|
50
59
|
/**
|
|
51
60
|
* Get Credential Decrypted
|
|
52
61
|
* Get a credential with decrypted value
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { WhoamiResponse } from '../models/WhoamiResponse';
|
|
2
|
+
import type { CancelablePromise } from '../core/CancelablePromise';
|
|
3
|
+
export declare class AuthService {
|
|
4
|
+
/**
|
|
5
|
+
* Whoami
|
|
6
|
+
* Validate the provided Bearer token and return identity and workspace info.
|
|
7
|
+
* @returns WhoamiResponse Successful Response
|
|
8
|
+
* @throws ApiError
|
|
9
|
+
*/
|
|
10
|
+
static whoami(): CancelablePromise<WhoamiResponse>;
|
|
11
|
+
}
|
|
@@ -47,6 +47,15 @@ export declare class CredentialsService {
|
|
|
47
47
|
* @throws ApiError
|
|
48
48
|
*/
|
|
49
49
|
static deleteCredential(credentialId: string, workspaceId?: (string | null)): CancelablePromise<Record<string, any>>;
|
|
50
|
+
/**
|
|
51
|
+
* Test Credential
|
|
52
|
+
* Test a credential by validating it against the provider API - only admin and owner roles
|
|
53
|
+
* @param credentialId
|
|
54
|
+
* @param workspaceId
|
|
55
|
+
* @returns any Successful Response
|
|
56
|
+
* @throws ApiError
|
|
57
|
+
*/
|
|
58
|
+
static testCredential(credentialId: string, workspaceId?: (string | null)): CancelablePromise<Record<string, any>>;
|
|
50
59
|
/**
|
|
51
60
|
* Get Credential Decrypted
|
|
52
61
|
* Get a credential with decrypted value
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Decode a raw config value that may be a base64-encoded object from cli-maker.
|
|
3
|
+
* This handles the case where a field was previously stored as ParamType.Password
|
|
4
|
+
* and later changed to ParamType.Text.
|
|
5
|
+
*/
|
|
6
|
+
export declare function decodeConfigValue(value: unknown): string | undefined;
|
|
7
|
+
/**
|
|
8
|
+
* Configuration interface for agents-generator SDK
|
|
9
|
+
*/
|
|
10
|
+
export interface AppConfig {
|
|
11
|
+
apiKey: string;
|
|
12
|
+
apiUrl: string;
|
|
13
|
+
}
|
|
14
|
+
/**
|
|
15
|
+
* Load the full application configuration from setup config.
|
|
16
|
+
* Uses cli.loadConfig() which prompts for passphrase once for all encrypted fields.
|
|
17
|
+
*/
|
|
18
|
+
export declare function loadAppConfig(): Promise<AppConfig>;
|
|
19
|
+
/**
|
|
20
|
+
* Get the API key from config (will prompt for passphrase)
|
|
21
|
+
*/
|
|
22
|
+
export declare function getApiKey(): Promise<string>;
|
|
23
|
+
/**
|
|
24
|
+
* Get the API URL from config (will prompt for passphrase if api_key is encrypted)
|
|
25
|
+
*/
|
|
26
|
+
export declare function getApiUrl(): Promise<string>;
|
|
27
|
+
/**
|
|
28
|
+
* Get default configuration (no setup required)
|
|
29
|
+
*/
|
|
30
|
+
export declare function getDefaultConfig(): Omit<AppConfig, 'apiKey'>;
|
|
31
|
+
/**
|
|
32
|
+
* Returns the config file path used by cli-maker.
|
|
33
|
+
*/
|
|
34
|
+
export declare function getConfigFilePath(): string;
|
package/dist/lib/index.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { ApiError, CancelablePromise, CancelError, ConversationsService, MessageCreate, OpenAPI, AgentService, McpServersService, RootService, FileLibraryService, CredentialsService, AdminAgentsService, PublicAgentsService, PublicConversationsService, AdminConversationsService, AdminCredentialsService, AdminFileLibraryService, AdminMcpServersService, AdminWorkspacesService, WorkspaceCollaboratorsService, AdminApiKeysService, PresenceService, ModelsService, SchemaGeneratorService, TokenUsageService } from "./clients/agents-generator";
|
|
1
|
+
import { ApiError, CancelablePromise, CancelError, ConversationsService, MessageCreate, OpenAPI, AgentService, McpServersService, RootService, FileLibraryService, CredentialsService, AdminAgentsService, PublicAgentsService, PublicConversationsService, AdminConversationsService, AdminCredentialsService, AdminFileLibraryService, AdminMcpServersService, AdminWorkspacesService, WorkspaceCollaboratorsService, AdminApiKeysService, PresenceService, ModelsService, SchemaGeneratorService, TokenUsageService, AuthService } from "./clients/agents-generator";
|
|
2
2
|
export * from "./clients/agents-generator";
|
|
3
3
|
export interface StreamEvent {
|
|
4
4
|
type: string;
|
|
@@ -57,6 +57,7 @@ export declare class AgentClient {
|
|
|
57
57
|
presence: typeof PresenceService;
|
|
58
58
|
schema: typeof SchemaGeneratorService;
|
|
59
59
|
tokenUsage: typeof TokenUsageService;
|
|
60
|
+
auth: typeof AuthService;
|
|
60
61
|
};
|
|
61
62
|
public: {
|
|
62
63
|
agents: typeof PublicAgentsService;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ideascol/agents-generator-sdk",
|
|
3
|
-
"version": "0.7.
|
|
3
|
+
"version": "0.7.4",
|
|
4
4
|
"main": "dist/index.js",
|
|
5
5
|
"scripts": {
|
|
6
6
|
"test": "bun test",
|
|
@@ -32,6 +32,6 @@
|
|
|
32
32
|
"typescript": "^5.8.3"
|
|
33
33
|
},
|
|
34
34
|
"dependencies": {
|
|
35
|
-
"@ideascol/cli-maker": "^1.
|
|
35
|
+
"@ideascol/cli-maker": "^1.12.0"
|
|
36
36
|
}
|
|
37
37
|
}
|