@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.
@@ -1,3 +1,3 @@
1
1
  import { Command } from '@ideascol/cli-maker';
2
- declare let commandAgents: Command;
2
+ declare const commandAgents: Command;
3
3
  export default commandAgents;
@@ -0,0 +1,6 @@
1
+ import type { CLI, Command } from '@ideascol/cli-maker';
2
+ /**
3
+ * Factory that creates the chat command. Receives the CLI instance
4
+ * to read config values and start the interactive session.
5
+ */
6
+ export declare function createChatCommand(cliInstance: CLI): Command;
@@ -1,3 +1,3 @@
1
1
  import { Command } from '@ideascol/cli-maker';
2
- declare let commandConversations: Command;
2
+ declare const commandConversations: Command;
3
3
  export default commandConversations;
@@ -1,3 +1,3 @@
1
1
  import { Command } from '@ideascol/cli-maker';
2
- declare let rootCommand: Command;
2
+ declare const rootCommand: Command;
3
3
  export default rootCommand;
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-8acda2a920b73ea6f20e54f68ace024752e2d8ff",
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';
@@ -0,0 +1,9 @@
1
+ export type WhoamiResponse = {
2
+ auth_type: string;
3
+ user_id: string;
4
+ email?: (string | null);
5
+ workspace_id?: (string | null);
6
+ workspace_name?: (string | null);
7
+ api_key_id?: (string | null);
8
+ api_key_name?: (string | null);
9
+ };
@@ -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;
@@ -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.2",
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.6.2"
35
+ "@ideascol/cli-maker": "^1.12.0"
36
36
  }
37
37
  }