@crestal/nation-sdk 0.1.28 → 0.1.30

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/api.ts CHANGED
@@ -4,7 +4,7 @@
4
4
  * Nation IntentKit API
5
5
  * API for Nation IntentKit services
6
6
  *
7
- * The version of the OpenAPI document: 0.1.28
7
+ * The version of the OpenAPI document: 0.1.30
8
8
  *
9
9
  *
10
10
  * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
@@ -386,6 +386,74 @@ export interface AgentExample {
386
386
  */
387
387
  'prompt': string;
388
388
  }
389
+ /**
390
+ * Request model for agent generation.
391
+ * @export
392
+ * @interface AgentGenerateRequest
393
+ */
394
+ export interface AgentGenerateRequest {
395
+ /**
396
+ * Natural language description of the agent\'s desired capabilities
397
+ * @type {string}
398
+ * @memberof AgentGenerateRequest
399
+ */
400
+ 'prompt': string;
401
+ /**
402
+ *
403
+ * @type {AgentUpdate}
404
+ * @memberof AgentGenerateRequest
405
+ */
406
+ 'existing_agent'?: AgentUpdate | null;
407
+ /**
408
+ *
409
+ * @type {string}
410
+ * @memberof AgentGenerateRequest
411
+ */
412
+ 'project_id'?: string | null;
413
+ }
414
+ /**
415
+ * Response model for agent generation.
416
+ * @export
417
+ * @interface AgentGenerateResponse
418
+ */
419
+ export interface AgentGenerateResponse {
420
+ /**
421
+ * The generated agent schema
422
+ * @type {object}
423
+ * @memberof AgentGenerateResponse
424
+ */
425
+ 'agent': object;
426
+ /**
427
+ * Project ID for this conversation session
428
+ * @type {string}
429
+ * @memberof AgentGenerateResponse
430
+ */
431
+ 'project_id': string;
432
+ /**
433
+ * Human-readable summary of the generated agent
434
+ * @type {string}
435
+ * @memberof AgentGenerateResponse
436
+ */
437
+ 'summary': string;
438
+ /**
439
+ * Generated tags for the agent as ID objects: [{\'id\': 1}, {\'id\': 2}]
440
+ * @type {Array<{ [key: string]: number; }>}
441
+ * @memberof AgentGenerateResponse
442
+ */
443
+ 'tags'?: Array<{ [key: string]: number; }>;
444
+ /**
445
+ * List of autonomous tasks generated for the agent
446
+ * @type {Array<object>}
447
+ * @memberof AgentGenerateResponse
448
+ */
449
+ 'autonomous_tasks'?: Array<object>;
450
+ /**
451
+ * List of skills that were activated based on the prompt
452
+ * @type {Array<string>}
453
+ * @memberof AgentGenerateResponse
454
+ */
455
+ 'activated_skills'?: Array<string>;
456
+ }
389
457
  /**
390
458
  * Paginated response model for agents list. Contains a list of agents, a flag indicating if more items are available, and a cursor for pagination.
391
459
  * @export
@@ -2208,6 +2276,74 @@ export type EventType = typeof EventType[keyof typeof EventType];
2208
2276
  */
2209
2277
  export interface FeePercentage {
2210
2278
  }
2279
+ /**
2280
+ * Response model for single generation detail.
2281
+ * @export
2282
+ * @interface GenerationDetailResponse
2283
+ */
2284
+ export interface GenerationDetailResponse {
2285
+ /**
2286
+ * Project ID
2287
+ * @type {string}
2288
+ * @memberof GenerationDetailResponse
2289
+ */
2290
+ 'project_id': string;
2291
+ /**
2292
+ *
2293
+ * @type {string}
2294
+ * @memberof GenerationDetailResponse
2295
+ */
2296
+ 'user_id'?: string | null;
2297
+ /**
2298
+ *
2299
+ * @type {string}
2300
+ * @memberof GenerationDetailResponse
2301
+ */
2302
+ 'created_at'?: string | null;
2303
+ /**
2304
+ *
2305
+ * @type {string}
2306
+ * @memberof GenerationDetailResponse
2307
+ */
2308
+ 'last_activity'?: string | null;
2309
+ /**
2310
+ * Number of messages in conversation
2311
+ * @type {number}
2312
+ * @memberof GenerationDetailResponse
2313
+ */
2314
+ 'message_count': number;
2315
+ /**
2316
+ *
2317
+ * @type {object}
2318
+ * @memberof GenerationDetailResponse
2319
+ */
2320
+ 'last_message'?: object | null;
2321
+ /**
2322
+ *
2323
+ * @type {object}
2324
+ * @memberof GenerationDetailResponse
2325
+ */
2326
+ 'first_message'?: object | null;
2327
+ /**
2328
+ * Full conversation history
2329
+ * @type {Array<object>}
2330
+ * @memberof GenerationDetailResponse
2331
+ */
2332
+ 'conversation_history': Array<object>;
2333
+ }
2334
+ /**
2335
+ * Response model for generations list.
2336
+ * @export
2337
+ * @interface GenerationsListResponse
2338
+ */
2339
+ export interface GenerationsListResponse {
2340
+ /**
2341
+ * List of recent projects with their conversation history
2342
+ * @type {Array<object>}
2343
+ * @memberof GenerationsListResponse
2344
+ */
2345
+ 'projects': Array<object>;
2346
+ }
2211
2347
  /**
2212
2348
  *
2213
2349
  * @export
@@ -2514,6 +2650,25 @@ export const TransactionType = {
2514
2650
  export type TransactionType = typeof TransactionType[keyof typeof TransactionType];
2515
2651
 
2516
2652
 
2653
+ /**
2654
+ *
2655
+ * @export
2656
+ * @interface TwitterAuthResponse
2657
+ */
2658
+ export interface TwitterAuthResponse {
2659
+ /**
2660
+ *
2661
+ * @type {string}
2662
+ * @memberof TwitterAuthResponse
2663
+ */
2664
+ 'agent_id': string;
2665
+ /**
2666
+ *
2667
+ * @type {string}
2668
+ * @memberof TwitterAuthResponse
2669
+ */
2670
+ 'url': string;
2671
+ }
2517
2672
  /**
2518
2673
  * Type of upstream transaction.
2519
2674
  * @export
@@ -4607,6 +4762,267 @@ export class CreditApi extends BaseAPI {
4607
4762
 
4608
4763
 
4609
4764
 
4765
+ /**
4766
+ * GeneratorApi - axios parameter creator
4767
+ * @export
4768
+ */
4769
+ export const GeneratorApiAxiosParamCreator = function (configuration?: Configuration) {
4770
+ return {
4771
+ /**
4772
+ * Generate an agent schema from a natural language prompt. Converts plain English descriptions into complete, validated agent configurations. Automatically identifies required skills, sets up configurations, detects autonomous task patterns, and ensures everything works correctly with intelligent error correction. **Autonomous Task Detection:** The API can automatically detect scheduling patterns in prompts like: - \"Buy 0.1 ETH every hour\" → Creates 60-minute autonomous task with CDP trade skill - \"Check portfolio daily\" → Creates 24-hour autonomous task with portfolio skills - \"Post tweet every 30 minutes\" → Creates 30-minute autonomous task with Twitter skill **Request Body:** * `prompt` - Natural language description of the agent\'s desired capabilities and schedule * `existing_agent` - Optional existing agent to update (preserves current setup while adding capabilities) * `user_id` - Required user ID for logging and rate limiting * `project_id` - Optional project ID for conversation history **Returns:** * `AgentGenerateResponse` - Contains agent schema, autonomous tasks, activated skills, project ID, and summary **Response Fields:** * `agent` - Complete agent schema with skills and autonomous configurations * `autonomous_tasks` - List of autonomous tasks detected and configured * `activated_skills` - List of skills that were activated based on the prompt * `project_id` - Project ID for conversation tracking * `summary` - Human-readable summary of the generated agent * `tags` - Generated tags for categorization **Raises:** * `HTTPException`: - 400: Invalid request (missing user_id, invalid prompt format or length) - 500: Agent generation failed after retries
4773
+ * @summary Generate Agent from Natural Language Prompt
4774
+ * @param {AgentGenerateRequest} agentGenerateRequest
4775
+ * @param {*} [options] Override http request option.
4776
+ * @throws {RequiredError}
4777
+ */
4778
+ generateAgentGeneratorAgentGeneratePost: async (agentGenerateRequest: AgentGenerateRequest, options: RawAxiosRequestConfig = {}): Promise<RequestArgs> => {
4779
+ // verify required parameter 'agentGenerateRequest' is not null or undefined
4780
+ assertParamExists('generateAgentGeneratorAgentGeneratePost', 'agentGenerateRequest', agentGenerateRequest)
4781
+ const localVarPath = `/generator/agent/generate`;
4782
+ // use dummy base URL string because the URL constructor only accepts absolute URLs.
4783
+ const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
4784
+ let baseOptions;
4785
+ if (configuration) {
4786
+ baseOptions = configuration.baseOptions;
4787
+ }
4788
+
4789
+ const localVarRequestOptions = { method: 'POST', ...baseOptions, ...options};
4790
+ const localVarHeaderParameter = {} as any;
4791
+ const localVarQueryParameter = {} as any;
4792
+
4793
+ // authentication HTTPBearer required
4794
+ // http bearer authentication required
4795
+ await setBearerAuthToObject(localVarHeaderParameter, configuration)
4796
+
4797
+
4798
+
4799
+ localVarHeaderParameter['Content-Type'] = 'application/json';
4800
+
4801
+ setSearchParams(localVarUrlObj, localVarQueryParameter);
4802
+ let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
4803
+ localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers};
4804
+ localVarRequestOptions.data = serializeDataIfNeeded(agentGenerateRequest, localVarRequestOptions, configuration)
4805
+
4806
+ return {
4807
+ url: toPathString(localVarUrlObj),
4808
+ options: localVarRequestOptions,
4809
+ };
4810
+ },
4811
+ /**
4812
+ * Get specific project conversation history. **Path Parameters:** * `project_id` - Project ID to get conversation history for **Query Parameters:** * `user_id` - Optional user ID for access validation **Returns:** * `GenerationDetailResponse` - Contains full conversation history for the project **Raises:** * `HTTPException`: - 404: Project not found or access denied - 500: Failed to retrieve generation detail
4813
+ * @summary Get Generation Detail by Project ID
4814
+ * @param {string} projectId
4815
+ * @param {*} [options] Override http request option.
4816
+ * @throws {RequiredError}
4817
+ */
4818
+ getGenerationDetailGeneratorAgentGenerationsProjectIdGet: async (projectId: string, options: RawAxiosRequestConfig = {}): Promise<RequestArgs> => {
4819
+ // verify required parameter 'projectId' is not null or undefined
4820
+ assertParamExists('getGenerationDetailGeneratorAgentGenerationsProjectIdGet', 'projectId', projectId)
4821
+ const localVarPath = `/generator/agent/generations/{project_id}`
4822
+ .replace(`{${"project_id"}}`, encodeURIComponent(String(projectId)));
4823
+ // use dummy base URL string because the URL constructor only accepts absolute URLs.
4824
+ const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
4825
+ let baseOptions;
4826
+ if (configuration) {
4827
+ baseOptions = configuration.baseOptions;
4828
+ }
4829
+
4830
+ const localVarRequestOptions = { method: 'GET', ...baseOptions, ...options};
4831
+ const localVarHeaderParameter = {} as any;
4832
+ const localVarQueryParameter = {} as any;
4833
+
4834
+ // authentication HTTPBearer required
4835
+ // http bearer authentication required
4836
+ await setBearerAuthToObject(localVarHeaderParameter, configuration)
4837
+
4838
+
4839
+
4840
+ setSearchParams(localVarUrlObj, localVarQueryParameter);
4841
+ let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
4842
+ localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers};
4843
+
4844
+ return {
4845
+ url: toPathString(localVarUrlObj),
4846
+ options: localVarRequestOptions,
4847
+ };
4848
+ },
4849
+ /**
4850
+ * Get all projects/generations for a user. **Query Parameters:** * `user_id` - Optional user ID to filter projects * `limit` - Maximum number of recent projects to return (default: 50, max: 100) **Returns:** * `GenerationsListResponse` - Contains list of projects with their conversation history **Raises:** * `HTTPException`: - 400: Invalid parameters - 500: Failed to retrieve generations
4851
+ * @summary Get Generations List by User
4852
+ * @param {number} [limit]
4853
+ * @param {*} [options] Override http request option.
4854
+ * @throws {RequiredError}
4855
+ */
4856
+ getGenerationsGeneratorAgentGenerationsGet: async (limit?: number, options: RawAxiosRequestConfig = {}): Promise<RequestArgs> => {
4857
+ const localVarPath = `/generator/agent/generations`;
4858
+ // use dummy base URL string because the URL constructor only accepts absolute URLs.
4859
+ const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
4860
+ let baseOptions;
4861
+ if (configuration) {
4862
+ baseOptions = configuration.baseOptions;
4863
+ }
4864
+
4865
+ const localVarRequestOptions = { method: 'GET', ...baseOptions, ...options};
4866
+ const localVarHeaderParameter = {} as any;
4867
+ const localVarQueryParameter = {} as any;
4868
+
4869
+ // authentication HTTPBearer required
4870
+ // http bearer authentication required
4871
+ await setBearerAuthToObject(localVarHeaderParameter, configuration)
4872
+
4873
+ if (limit !== undefined) {
4874
+ localVarQueryParameter['limit'] = limit;
4875
+ }
4876
+
4877
+
4878
+
4879
+ setSearchParams(localVarUrlObj, localVarQueryParameter);
4880
+ let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
4881
+ localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers};
4882
+
4883
+ return {
4884
+ url: toPathString(localVarUrlObj),
4885
+ options: localVarRequestOptions,
4886
+ };
4887
+ },
4888
+ }
4889
+ };
4890
+
4891
+ /**
4892
+ * GeneratorApi - functional programming interface
4893
+ * @export
4894
+ */
4895
+ export const GeneratorApiFp = function(configuration?: Configuration) {
4896
+ const localVarAxiosParamCreator = GeneratorApiAxiosParamCreator(configuration)
4897
+ return {
4898
+ /**
4899
+ * Generate an agent schema from a natural language prompt. Converts plain English descriptions into complete, validated agent configurations. Automatically identifies required skills, sets up configurations, detects autonomous task patterns, and ensures everything works correctly with intelligent error correction. **Autonomous Task Detection:** The API can automatically detect scheduling patterns in prompts like: - \"Buy 0.1 ETH every hour\" → Creates 60-minute autonomous task with CDP trade skill - \"Check portfolio daily\" → Creates 24-hour autonomous task with portfolio skills - \"Post tweet every 30 minutes\" → Creates 30-minute autonomous task with Twitter skill **Request Body:** * `prompt` - Natural language description of the agent\'s desired capabilities and schedule * `existing_agent` - Optional existing agent to update (preserves current setup while adding capabilities) * `user_id` - Required user ID for logging and rate limiting * `project_id` - Optional project ID for conversation history **Returns:** * `AgentGenerateResponse` - Contains agent schema, autonomous tasks, activated skills, project ID, and summary **Response Fields:** * `agent` - Complete agent schema with skills and autonomous configurations * `autonomous_tasks` - List of autonomous tasks detected and configured * `activated_skills` - List of skills that were activated based on the prompt * `project_id` - Project ID for conversation tracking * `summary` - Human-readable summary of the generated agent * `tags` - Generated tags for categorization **Raises:** * `HTTPException`: - 400: Invalid request (missing user_id, invalid prompt format or length) - 500: Agent generation failed after retries
4900
+ * @summary Generate Agent from Natural Language Prompt
4901
+ * @param {AgentGenerateRequest} agentGenerateRequest
4902
+ * @param {*} [options] Override http request option.
4903
+ * @throws {RequiredError}
4904
+ */
4905
+ async generateAgentGeneratorAgentGeneratePost(agentGenerateRequest: AgentGenerateRequest, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<AgentGenerateResponse>> {
4906
+ const localVarAxiosArgs = await localVarAxiosParamCreator.generateAgentGeneratorAgentGeneratePost(agentGenerateRequest, options);
4907
+ const localVarOperationServerIndex = configuration?.serverIndex ?? 0;
4908
+ const localVarOperationServerBasePath = operationServerMap['GeneratorApi.generateAgentGeneratorAgentGeneratePost']?.[localVarOperationServerIndex]?.url;
4909
+ return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath);
4910
+ },
4911
+ /**
4912
+ * Get specific project conversation history. **Path Parameters:** * `project_id` - Project ID to get conversation history for **Query Parameters:** * `user_id` - Optional user ID for access validation **Returns:** * `GenerationDetailResponse` - Contains full conversation history for the project **Raises:** * `HTTPException`: - 404: Project not found or access denied - 500: Failed to retrieve generation detail
4913
+ * @summary Get Generation Detail by Project ID
4914
+ * @param {string} projectId
4915
+ * @param {*} [options] Override http request option.
4916
+ * @throws {RequiredError}
4917
+ */
4918
+ async getGenerationDetailGeneratorAgentGenerationsProjectIdGet(projectId: string, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<GenerationDetailResponse>> {
4919
+ const localVarAxiosArgs = await localVarAxiosParamCreator.getGenerationDetailGeneratorAgentGenerationsProjectIdGet(projectId, options);
4920
+ const localVarOperationServerIndex = configuration?.serverIndex ?? 0;
4921
+ const localVarOperationServerBasePath = operationServerMap['GeneratorApi.getGenerationDetailGeneratorAgentGenerationsProjectIdGet']?.[localVarOperationServerIndex]?.url;
4922
+ return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath);
4923
+ },
4924
+ /**
4925
+ * Get all projects/generations for a user. **Query Parameters:** * `user_id` - Optional user ID to filter projects * `limit` - Maximum number of recent projects to return (default: 50, max: 100) **Returns:** * `GenerationsListResponse` - Contains list of projects with their conversation history **Raises:** * `HTTPException`: - 400: Invalid parameters - 500: Failed to retrieve generations
4926
+ * @summary Get Generations List by User
4927
+ * @param {number} [limit]
4928
+ * @param {*} [options] Override http request option.
4929
+ * @throws {RequiredError}
4930
+ */
4931
+ async getGenerationsGeneratorAgentGenerationsGet(limit?: number, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<GenerationsListResponse>> {
4932
+ const localVarAxiosArgs = await localVarAxiosParamCreator.getGenerationsGeneratorAgentGenerationsGet(limit, options);
4933
+ const localVarOperationServerIndex = configuration?.serverIndex ?? 0;
4934
+ const localVarOperationServerBasePath = operationServerMap['GeneratorApi.getGenerationsGeneratorAgentGenerationsGet']?.[localVarOperationServerIndex]?.url;
4935
+ return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath);
4936
+ },
4937
+ }
4938
+ };
4939
+
4940
+ /**
4941
+ * GeneratorApi - factory interface
4942
+ * @export
4943
+ */
4944
+ export const GeneratorApiFactory = function (configuration?: Configuration, basePath?: string, axios?: AxiosInstance) {
4945
+ const localVarFp = GeneratorApiFp(configuration)
4946
+ return {
4947
+ /**
4948
+ * Generate an agent schema from a natural language prompt. Converts plain English descriptions into complete, validated agent configurations. Automatically identifies required skills, sets up configurations, detects autonomous task patterns, and ensures everything works correctly with intelligent error correction. **Autonomous Task Detection:** The API can automatically detect scheduling patterns in prompts like: - \"Buy 0.1 ETH every hour\" → Creates 60-minute autonomous task with CDP trade skill - \"Check portfolio daily\" → Creates 24-hour autonomous task with portfolio skills - \"Post tweet every 30 minutes\" → Creates 30-minute autonomous task with Twitter skill **Request Body:** * `prompt` - Natural language description of the agent\'s desired capabilities and schedule * `existing_agent` - Optional existing agent to update (preserves current setup while adding capabilities) * `user_id` - Required user ID for logging and rate limiting * `project_id` - Optional project ID for conversation history **Returns:** * `AgentGenerateResponse` - Contains agent schema, autonomous tasks, activated skills, project ID, and summary **Response Fields:** * `agent` - Complete agent schema with skills and autonomous configurations * `autonomous_tasks` - List of autonomous tasks detected and configured * `activated_skills` - List of skills that were activated based on the prompt * `project_id` - Project ID for conversation tracking * `summary` - Human-readable summary of the generated agent * `tags` - Generated tags for categorization **Raises:** * `HTTPException`: - 400: Invalid request (missing user_id, invalid prompt format or length) - 500: Agent generation failed after retries
4949
+ * @summary Generate Agent from Natural Language Prompt
4950
+ * @param {AgentGenerateRequest} agentGenerateRequest
4951
+ * @param {*} [options] Override http request option.
4952
+ * @throws {RequiredError}
4953
+ */
4954
+ generateAgentGeneratorAgentGeneratePost(agentGenerateRequest: AgentGenerateRequest, options?: RawAxiosRequestConfig): AxiosPromise<AgentGenerateResponse> {
4955
+ return localVarFp.generateAgentGeneratorAgentGeneratePost(agentGenerateRequest, options).then((request) => request(axios, basePath));
4956
+ },
4957
+ /**
4958
+ * Get specific project conversation history. **Path Parameters:** * `project_id` - Project ID to get conversation history for **Query Parameters:** * `user_id` - Optional user ID for access validation **Returns:** * `GenerationDetailResponse` - Contains full conversation history for the project **Raises:** * `HTTPException`: - 404: Project not found or access denied - 500: Failed to retrieve generation detail
4959
+ * @summary Get Generation Detail by Project ID
4960
+ * @param {string} projectId
4961
+ * @param {*} [options] Override http request option.
4962
+ * @throws {RequiredError}
4963
+ */
4964
+ getGenerationDetailGeneratorAgentGenerationsProjectIdGet(projectId: string, options?: RawAxiosRequestConfig): AxiosPromise<GenerationDetailResponse> {
4965
+ return localVarFp.getGenerationDetailGeneratorAgentGenerationsProjectIdGet(projectId, options).then((request) => request(axios, basePath));
4966
+ },
4967
+ /**
4968
+ * Get all projects/generations for a user. **Query Parameters:** * `user_id` - Optional user ID to filter projects * `limit` - Maximum number of recent projects to return (default: 50, max: 100) **Returns:** * `GenerationsListResponse` - Contains list of projects with their conversation history **Raises:** * `HTTPException`: - 400: Invalid parameters - 500: Failed to retrieve generations
4969
+ * @summary Get Generations List by User
4970
+ * @param {number} [limit]
4971
+ * @param {*} [options] Override http request option.
4972
+ * @throws {RequiredError}
4973
+ */
4974
+ getGenerationsGeneratorAgentGenerationsGet(limit?: number, options?: RawAxiosRequestConfig): AxiosPromise<GenerationsListResponse> {
4975
+ return localVarFp.getGenerationsGeneratorAgentGenerationsGet(limit, options).then((request) => request(axios, basePath));
4976
+ },
4977
+ };
4978
+ };
4979
+
4980
+ /**
4981
+ * GeneratorApi - object-oriented interface
4982
+ * @export
4983
+ * @class GeneratorApi
4984
+ * @extends {BaseAPI}
4985
+ */
4986
+ export class GeneratorApi extends BaseAPI {
4987
+ /**
4988
+ * Generate an agent schema from a natural language prompt. Converts plain English descriptions into complete, validated agent configurations. Automatically identifies required skills, sets up configurations, detects autonomous task patterns, and ensures everything works correctly with intelligent error correction. **Autonomous Task Detection:** The API can automatically detect scheduling patterns in prompts like: - \"Buy 0.1 ETH every hour\" → Creates 60-minute autonomous task with CDP trade skill - \"Check portfolio daily\" → Creates 24-hour autonomous task with portfolio skills - \"Post tweet every 30 minutes\" → Creates 30-minute autonomous task with Twitter skill **Request Body:** * `prompt` - Natural language description of the agent\'s desired capabilities and schedule * `existing_agent` - Optional existing agent to update (preserves current setup while adding capabilities) * `user_id` - Required user ID for logging and rate limiting * `project_id` - Optional project ID for conversation history **Returns:** * `AgentGenerateResponse` - Contains agent schema, autonomous tasks, activated skills, project ID, and summary **Response Fields:** * `agent` - Complete agent schema with skills and autonomous configurations * `autonomous_tasks` - List of autonomous tasks detected and configured * `activated_skills` - List of skills that were activated based on the prompt * `project_id` - Project ID for conversation tracking * `summary` - Human-readable summary of the generated agent * `tags` - Generated tags for categorization **Raises:** * `HTTPException`: - 400: Invalid request (missing user_id, invalid prompt format or length) - 500: Agent generation failed after retries
4989
+ * @summary Generate Agent from Natural Language Prompt
4990
+ * @param {AgentGenerateRequest} agentGenerateRequest
4991
+ * @param {*} [options] Override http request option.
4992
+ * @throws {RequiredError}
4993
+ * @memberof GeneratorApi
4994
+ */
4995
+ public generateAgentGeneratorAgentGeneratePost(agentGenerateRequest: AgentGenerateRequest, options?: RawAxiosRequestConfig) {
4996
+ return GeneratorApiFp(this.configuration).generateAgentGeneratorAgentGeneratePost(agentGenerateRequest, options).then((request) => request(this.axios, this.basePath));
4997
+ }
4998
+
4999
+ /**
5000
+ * Get specific project conversation history. **Path Parameters:** * `project_id` - Project ID to get conversation history for **Query Parameters:** * `user_id` - Optional user ID for access validation **Returns:** * `GenerationDetailResponse` - Contains full conversation history for the project **Raises:** * `HTTPException`: - 404: Project not found or access denied - 500: Failed to retrieve generation detail
5001
+ * @summary Get Generation Detail by Project ID
5002
+ * @param {string} projectId
5003
+ * @param {*} [options] Override http request option.
5004
+ * @throws {RequiredError}
5005
+ * @memberof GeneratorApi
5006
+ */
5007
+ public getGenerationDetailGeneratorAgentGenerationsProjectIdGet(projectId: string, options?: RawAxiosRequestConfig) {
5008
+ return GeneratorApiFp(this.configuration).getGenerationDetailGeneratorAgentGenerationsProjectIdGet(projectId, options).then((request) => request(this.axios, this.basePath));
5009
+ }
5010
+
5011
+ /**
5012
+ * Get all projects/generations for a user. **Query Parameters:** * `user_id` - Optional user ID to filter projects * `limit` - Maximum number of recent projects to return (default: 50, max: 100) **Returns:** * `GenerationsListResponse` - Contains list of projects with their conversation history **Raises:** * `HTTPException`: - 400: Invalid parameters - 500: Failed to retrieve generations
5013
+ * @summary Get Generations List by User
5014
+ * @param {number} [limit]
5015
+ * @param {*} [options] Override http request option.
5016
+ * @throws {RequiredError}
5017
+ * @memberof GeneratorApi
5018
+ */
5019
+ public getGenerationsGeneratorAgentGenerationsGet(limit?: number, options?: RawAxiosRequestConfig) {
5020
+ return GeneratorApiFp(this.configuration).getGenerationsGeneratorAgentGenerationsGet(limit, options).then((request) => request(this.axios, this.basePath));
5021
+ }
5022
+ }
5023
+
5024
+
5025
+
4610
5026
  /**
4611
5027
  * HealthApi - axios parameter creator
4612
5028
  * @export
@@ -5085,6 +5501,219 @@ export class MetadataApi extends BaseAPI {
5085
5501
 
5086
5502
 
5087
5503
 
5504
+ /**
5505
+ * OAuthApi - axios parameter creator
5506
+ * @export
5507
+ */
5508
+ export const OAuthApiAxiosParamCreator = function (configuration?: Configuration) {
5509
+ return {
5510
+ /**
5511
+ * Get Twitter OAuth2 authorization URL. **Query Parameters:** * `agent_id` - ID of the agent to authenticate * `redirect_uri` - DApp URI to redirect to after authorization from agentkit to DApp **Returns:** * Object containing agent_id and authorization URL
5512
+ * @summary Get Twitter Auth Url
5513
+ * @param {string} agentId
5514
+ * @param {string} redirectUri
5515
+ * @param {*} [options] Override http request option.
5516
+ * @throws {RequiredError}
5517
+ */
5518
+ getTwitterAuthUrlOauthTwitterGet: async (agentId: string, redirectUri: string, options: RawAxiosRequestConfig = {}): Promise<RequestArgs> => {
5519
+ // verify required parameter 'agentId' is not null or undefined
5520
+ assertParamExists('getTwitterAuthUrlOauthTwitterGet', 'agentId', agentId)
5521
+ // verify required parameter 'redirectUri' is not null or undefined
5522
+ assertParamExists('getTwitterAuthUrlOauthTwitterGet', 'redirectUri', redirectUri)
5523
+ const localVarPath = `/oauth/twitter`;
5524
+ // use dummy base URL string because the URL constructor only accepts absolute URLs.
5525
+ const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
5526
+ let baseOptions;
5527
+ if (configuration) {
5528
+ baseOptions = configuration.baseOptions;
5529
+ }
5530
+
5531
+ const localVarRequestOptions = { method: 'GET', ...baseOptions, ...options};
5532
+ const localVarHeaderParameter = {} as any;
5533
+ const localVarQueryParameter = {} as any;
5534
+
5535
+ // authentication HTTPBearer required
5536
+ // http bearer authentication required
5537
+ await setBearerAuthToObject(localVarHeaderParameter, configuration)
5538
+
5539
+ if (agentId !== undefined) {
5540
+ localVarQueryParameter['agent_id'] = agentId;
5541
+ }
5542
+
5543
+ if (redirectUri !== undefined) {
5544
+ localVarQueryParameter['redirect_uri'] = redirectUri;
5545
+ }
5546
+
5547
+
5548
+
5549
+ setSearchParams(localVarUrlObj, localVarQueryParameter);
5550
+ let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
5551
+ localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers};
5552
+
5553
+ return {
5554
+ url: toPathString(localVarUrlObj),
5555
+ options: localVarRequestOptions,
5556
+ };
5557
+ },
5558
+ /**
5559
+ * Handle Twitter OAuth2 callback. This endpoint is called by Twitter after the user authorizes the application. It exchanges the authorization code for access and refresh tokens, then stores them in the database. **Query Parameters:** * `state` - URL-encoded state containing agent_id and redirect_uri * `code` - Authorization code from Twitter * `error` - Error message from Twitter (optional) **Returns:** * JSONResponse or RedirectResponse depending on redirect_uri
5560
+ * @summary Twitter Oauth Callback
5561
+ * @param {string} state
5562
+ * @param {string | null} [code]
5563
+ * @param {string | null} [error]
5564
+ * @param {*} [options] Override http request option.
5565
+ * @throws {RequiredError}
5566
+ */
5567
+ twitterOauthCallbackOauthTwitterCallbackGet: async (state: string, code?: string | null, error?: string | null, options: RawAxiosRequestConfig = {}): Promise<RequestArgs> => {
5568
+ // verify required parameter 'state' is not null or undefined
5569
+ assertParamExists('twitterOauthCallbackOauthTwitterCallbackGet', 'state', state)
5570
+ const localVarPath = `/oauth/twitter/callback`;
5571
+ // use dummy base URL string because the URL constructor only accepts absolute URLs.
5572
+ const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
5573
+ let baseOptions;
5574
+ if (configuration) {
5575
+ baseOptions = configuration.baseOptions;
5576
+ }
5577
+
5578
+ const localVarRequestOptions = { method: 'GET', ...baseOptions, ...options};
5579
+ const localVarHeaderParameter = {} as any;
5580
+ const localVarQueryParameter = {} as any;
5581
+
5582
+ if (state !== undefined) {
5583
+ localVarQueryParameter['state'] = state;
5584
+ }
5585
+
5586
+ if (code !== undefined) {
5587
+ localVarQueryParameter['code'] = code;
5588
+ }
5589
+
5590
+ if (error !== undefined) {
5591
+ localVarQueryParameter['error'] = error;
5592
+ }
5593
+
5594
+
5595
+
5596
+ setSearchParams(localVarUrlObj, localVarQueryParameter);
5597
+ let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
5598
+ localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers};
5599
+
5600
+ return {
5601
+ url: toPathString(localVarUrlObj),
5602
+ options: localVarRequestOptions,
5603
+ };
5604
+ },
5605
+ }
5606
+ };
5607
+
5608
+ /**
5609
+ * OAuthApi - functional programming interface
5610
+ * @export
5611
+ */
5612
+ export const OAuthApiFp = function(configuration?: Configuration) {
5613
+ const localVarAxiosParamCreator = OAuthApiAxiosParamCreator(configuration)
5614
+ return {
5615
+ /**
5616
+ * Get Twitter OAuth2 authorization URL. **Query Parameters:** * `agent_id` - ID of the agent to authenticate * `redirect_uri` - DApp URI to redirect to after authorization from agentkit to DApp **Returns:** * Object containing agent_id and authorization URL
5617
+ * @summary Get Twitter Auth Url
5618
+ * @param {string} agentId
5619
+ * @param {string} redirectUri
5620
+ * @param {*} [options] Override http request option.
5621
+ * @throws {RequiredError}
5622
+ */
5623
+ async getTwitterAuthUrlOauthTwitterGet(agentId: string, redirectUri: string, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<TwitterAuthResponse>> {
5624
+ const localVarAxiosArgs = await localVarAxiosParamCreator.getTwitterAuthUrlOauthTwitterGet(agentId, redirectUri, options);
5625
+ const localVarOperationServerIndex = configuration?.serverIndex ?? 0;
5626
+ const localVarOperationServerBasePath = operationServerMap['OAuthApi.getTwitterAuthUrlOauthTwitterGet']?.[localVarOperationServerIndex]?.url;
5627
+ return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath);
5628
+ },
5629
+ /**
5630
+ * Handle Twitter OAuth2 callback. This endpoint is called by Twitter after the user authorizes the application. It exchanges the authorization code for access and refresh tokens, then stores them in the database. **Query Parameters:** * `state` - URL-encoded state containing agent_id and redirect_uri * `code` - Authorization code from Twitter * `error` - Error message from Twitter (optional) **Returns:** * JSONResponse or RedirectResponse depending on redirect_uri
5631
+ * @summary Twitter Oauth Callback
5632
+ * @param {string} state
5633
+ * @param {string | null} [code]
5634
+ * @param {string | null} [error]
5635
+ * @param {*} [options] Override http request option.
5636
+ * @throws {RequiredError}
5637
+ */
5638
+ async twitterOauthCallbackOauthTwitterCallbackGet(state: string, code?: string | null, error?: string | null, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<any>> {
5639
+ const localVarAxiosArgs = await localVarAxiosParamCreator.twitterOauthCallbackOauthTwitterCallbackGet(state, code, error, options);
5640
+ const localVarOperationServerIndex = configuration?.serverIndex ?? 0;
5641
+ const localVarOperationServerBasePath = operationServerMap['OAuthApi.twitterOauthCallbackOauthTwitterCallbackGet']?.[localVarOperationServerIndex]?.url;
5642
+ return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath);
5643
+ },
5644
+ }
5645
+ };
5646
+
5647
+ /**
5648
+ * OAuthApi - factory interface
5649
+ * @export
5650
+ */
5651
+ export const OAuthApiFactory = function (configuration?: Configuration, basePath?: string, axios?: AxiosInstance) {
5652
+ const localVarFp = OAuthApiFp(configuration)
5653
+ return {
5654
+ /**
5655
+ * Get Twitter OAuth2 authorization URL. **Query Parameters:** * `agent_id` - ID of the agent to authenticate * `redirect_uri` - DApp URI to redirect to after authorization from agentkit to DApp **Returns:** * Object containing agent_id and authorization URL
5656
+ * @summary Get Twitter Auth Url
5657
+ * @param {string} agentId
5658
+ * @param {string} redirectUri
5659
+ * @param {*} [options] Override http request option.
5660
+ * @throws {RequiredError}
5661
+ */
5662
+ getTwitterAuthUrlOauthTwitterGet(agentId: string, redirectUri: string, options?: RawAxiosRequestConfig): AxiosPromise<TwitterAuthResponse> {
5663
+ return localVarFp.getTwitterAuthUrlOauthTwitterGet(agentId, redirectUri, options).then((request) => request(axios, basePath));
5664
+ },
5665
+ /**
5666
+ * Handle Twitter OAuth2 callback. This endpoint is called by Twitter after the user authorizes the application. It exchanges the authorization code for access and refresh tokens, then stores them in the database. **Query Parameters:** * `state` - URL-encoded state containing agent_id and redirect_uri * `code` - Authorization code from Twitter * `error` - Error message from Twitter (optional) **Returns:** * JSONResponse or RedirectResponse depending on redirect_uri
5667
+ * @summary Twitter Oauth Callback
5668
+ * @param {string} state
5669
+ * @param {string | null} [code]
5670
+ * @param {string | null} [error]
5671
+ * @param {*} [options] Override http request option.
5672
+ * @throws {RequiredError}
5673
+ */
5674
+ twitterOauthCallbackOauthTwitterCallbackGet(state: string, code?: string | null, error?: string | null, options?: RawAxiosRequestConfig): AxiosPromise<any> {
5675
+ return localVarFp.twitterOauthCallbackOauthTwitterCallbackGet(state, code, error, options).then((request) => request(axios, basePath));
5676
+ },
5677
+ };
5678
+ };
5679
+
5680
+ /**
5681
+ * OAuthApi - object-oriented interface
5682
+ * @export
5683
+ * @class OAuthApi
5684
+ * @extends {BaseAPI}
5685
+ */
5686
+ export class OAuthApi extends BaseAPI {
5687
+ /**
5688
+ * Get Twitter OAuth2 authorization URL. **Query Parameters:** * `agent_id` - ID of the agent to authenticate * `redirect_uri` - DApp URI to redirect to after authorization from agentkit to DApp **Returns:** * Object containing agent_id and authorization URL
5689
+ * @summary Get Twitter Auth Url
5690
+ * @param {string} agentId
5691
+ * @param {string} redirectUri
5692
+ * @param {*} [options] Override http request option.
5693
+ * @throws {RequiredError}
5694
+ * @memberof OAuthApi
5695
+ */
5696
+ public getTwitterAuthUrlOauthTwitterGet(agentId: string, redirectUri: string, options?: RawAxiosRequestConfig) {
5697
+ return OAuthApiFp(this.configuration).getTwitterAuthUrlOauthTwitterGet(agentId, redirectUri, options).then((request) => request(this.axios, this.basePath));
5698
+ }
5699
+
5700
+ /**
5701
+ * Handle Twitter OAuth2 callback. This endpoint is called by Twitter after the user authorizes the application. It exchanges the authorization code for access and refresh tokens, then stores them in the database. **Query Parameters:** * `state` - URL-encoded state containing agent_id and redirect_uri * `code` - Authorization code from Twitter * `error` - Error message from Twitter (optional) **Returns:** * JSONResponse or RedirectResponse depending on redirect_uri
5702
+ * @summary Twitter Oauth Callback
5703
+ * @param {string} state
5704
+ * @param {string | null} [code]
5705
+ * @param {string | null} [error]
5706
+ * @param {*} [options] Override http request option.
5707
+ * @throws {RequiredError}
5708
+ * @memberof OAuthApi
5709
+ */
5710
+ public twitterOauthCallbackOauthTwitterCallbackGet(state: string, code?: string | null, error?: string | null, options?: RawAxiosRequestConfig) {
5711
+ return OAuthApiFp(this.configuration).twitterOauthCallbackOauthTwitterCallbackGet(state, code, error, options).then((request) => request(this.axios, this.basePath));
5712
+ }
5713
+ }
5714
+
5715
+
5716
+
5088
5717
  /**
5089
5718
  * UserApi - axios parameter creator
5090
5719
  * @export