@ideascol/agents-generator-sdk 0.7.3 → 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-4e98343b9970cdc29452c95593033dcfc9074e11",
190
+ VERSION: "main-18ea61a3a4dd0d19d2d7aba58dce085c8bf2e17b",
191
191
  WITH_CREDENTIALS: false,
192
192
  CREDENTIALS: "include",
193
193
  TOKEN: undefined,
@@ -1959,6 +1959,20 @@ var init_AgentFoldersService = __esm(() => {
1959
1959
  init_request();
1960
1960
  });
1961
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
+
1962
1976
  // src/lib/clients/agents-generator/services/ConversationsService.ts
1963
1977
  class ConversationsService {
1964
1978
  static createConversation(requestBody) {
@@ -3107,6 +3121,7 @@ var init_agents_generator = __esm(() => {
3107
3121
  init_AdminWorkspacesService();
3108
3122
  init_AgentService();
3109
3123
  init_AgentFoldersService();
3124
+ init_AuthService();
3110
3125
  init_ConversationsService();
3111
3126
  init_CredentialsService();
3112
3127
  init_FileLibraryService();
@@ -3166,7 +3181,8 @@ class AgentClient {
3166
3181
  apiKeys: AdminApiKeysService,
3167
3182
  presence: PresenceService,
3168
3183
  schema: SchemaGeneratorService,
3169
- tokenUsage: TokenUsageService
3184
+ tokenUsage: TokenUsageService,
3185
+ auth: AuthService
3170
3186
  };
3171
3187
  this.public = {
3172
3188
  agents: PublicAgentsService,
@@ -3235,13 +3251,10 @@ var init_lib = __esm(() => {
3235
3251
  function processStream() {
3236
3252
  reader.read().then(({ done, value }) => {
3237
3253
  if (done) {
3238
- console.log("Stream completado");
3239
3254
  if (buffer.length > 0) {
3240
- console.log("Procesando buffer final:", buffer);
3241
3255
  if (isDirectTextMode) {
3242
3256
  fullMessage += buffer;
3243
3257
  if (callbacks.onMessage) {
3244
- console.log("Actualizando mensaje final (texto directo):", fullMessage);
3245
3258
  callbacks.onMessage(fullMessage);
3246
3259
  }
3247
3260
  } else {
@@ -3272,7 +3285,6 @@ var init_lib = __esm(() => {
3272
3285
  if (buffer.length > 0) {
3273
3286
  fullMessage += buffer;
3274
3287
  if (callbacks.onMessage) {
3275
- console.log("Actualizando mensaje final (buffer restante):", fullMessage);
3276
3288
  callbacks.onMessage(fullMessage);
3277
3289
  }
3278
3290
  }
@@ -3285,18 +3297,15 @@ var init_lib = __esm(() => {
3285
3297
  }
3286
3298
  const chunk = decoder.decode(value, { stream: true });
3287
3299
  buffer += chunk;
3288
- console.log("Chunk recibido:", chunk);
3289
3300
  let eventEnd = buffer.indexOf(`
3290
3301
 
3291
3302
  `);
3292
3303
  if (buffer.length > 50 && eventEnd === -1 && !isDirectTextMode) {
3293
3304
  isDirectTextMode = true;
3294
- console.log("Detectado modo texto directo");
3295
3305
  }
3296
3306
  if (isDirectTextMode) {
3297
3307
  fullMessage += chunk;
3298
3308
  if (callbacks.onMessage) {
3299
- console.log("Actualizando con texto directo:", fullMessage);
3300
3309
  callbacks.onMessage(fullMessage);
3301
3310
  }
3302
3311
  } else {
@@ -3307,7 +3316,6 @@ var init_lib = __esm(() => {
3307
3316
  const jsonStr = eventData.substring(6);
3308
3317
  try {
3309
3318
  const data = JSON.parse(jsonStr);
3310
- console.log("Evento SSE recibido:", data);
3311
3319
  if (data.type === "message" && data.content && callbacks.onMessage) {
3312
3320
  fullMessage = data.content;
3313
3321
  callbacks.onMessage(fullMessage);
@@ -3317,12 +3325,10 @@ var init_lib = __esm(() => {
3317
3325
  callbacks.onTransfer(data.transfer);
3318
3326
  }
3319
3327
  } catch (e) {
3320
- console.error("Error al parsear JSON del evento:", e);
3321
3328
  if (eventData.startsWith("data: ")) {
3322
3329
  const directContent = eventData.substring(6);
3323
3330
  fullMessage += directContent;
3324
3331
  if (callbacks.onMessage) {
3325
- console.log("Actualizando con texto SSE simple:", fullMessage);
3326
3332
  callbacks.onMessage(fullMessage);
3327
3333
  }
3328
3334
  } else {
@@ -3334,7 +3340,6 @@ var init_lib = __esm(() => {
3334
3340
  } else {
3335
3341
  fullMessage += eventData;
3336
3342
  if (callbacks.onMessage) {
3337
- console.log("Actualizando con evento no reconocido:", fullMessage);
3338
3343
  callbacks.onMessage(fullMessage);
3339
3344
  }
3340
3345
  }
@@ -3346,7 +3351,6 @@ var init_lib = __esm(() => {
3346
3351
  fullMessage += buffer;
3347
3352
  buffer = "";
3348
3353
  if (callbacks.onMessage) {
3349
- console.log("Actualizando con buffer residual:", fullMessage);
3350
3354
  callbacks.onMessage(fullMessage);
3351
3355
  }
3352
3356
  }
@@ -3439,6 +3443,7 @@ __export(exports_src, {
3439
3443
  CollaboratorRole: () => CollaboratorRole,
3440
3444
  CancelablePromise: () => CancelablePromise,
3441
3445
  CancelError: () => CancelError,
3446
+ AuthService: () => AuthService,
3442
3447
  ApiError: () => ApiError,
3443
3448
  AgentService: () => AgentService,
3444
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
+ };
@@ -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
+ }
@@ -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.3",
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
  }