@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/dist/api.js CHANGED
@@ -5,7 +5,7 @@
5
5
  * Nation IntentKit API
6
6
  * API for Nation IntentKit services
7
7
  *
8
- * The version of the OpenAPI document: 0.1.28
8
+ * The version of the OpenAPI document: 0.1.30
9
9
  *
10
10
  *
11
11
  * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
@@ -84,7 +84,8 @@ var __spreadArray = (this && this.__spreadArray) || function (to, from, pack) {
84
84
  return to.concat(ar || Array.prototype.slice.call(from));
85
85
  };
86
86
  Object.defineProperty(exports, "__esModule", { value: true });
87
- exports.UserApi = exports.UserApiFactory = exports.UserApiFp = exports.UserApiAxiosParamCreator = exports.MetadataApi = exports.MetadataApiFactory = exports.MetadataApiFp = exports.MetadataApiAxiosParamCreator = exports.HealthApi = exports.HealthApiFactory = exports.HealthApiFp = exports.HealthApiAxiosParamCreator = exports.CreditApi = exports.CreditApiFactory = exports.CreditApiFp = exports.CreditApiAxiosParamCreator = exports.ChatApi = exports.ChatApiFactory = exports.ChatApiFp = exports.ChatApiAxiosParamCreator = exports.AgentApi = exports.AgentApiFactory = exports.AgentApiFp = exports.AgentApiAxiosParamCreator = exports.UpstreamType = exports.TransactionType = exports.OwnerType = exports.LLMProvider = exports.EventType = exports.Direction = exports.CreditType = exports.CreditDebit = exports.ChatMessageAttachmentType = exports.AuthorType = exports.AgentUpdateCdpNetworkIdEnum = exports.AgentUpdateNetworkIdEnum = exports.AgentUpdateWalletProviderEnum = exports.AgentUpdateShortTermMemoryStrategyEnum = exports.AgentUpdateModeEnum = exports.AgentSortOption = exports.AgentResponseWalletProviderEnum = exports.AgentResponseModeEnum = exports.AgentCdpNetworkIdEnum = exports.AgentNetworkIdEnum = exports.AgentWalletProviderEnum = exports.AgentShortTermMemoryStrategyEnum = exports.AgentModeEnum = void 0;
87
+ exports.OAuthApiFactory = exports.OAuthApiFp = exports.OAuthApiAxiosParamCreator = exports.MetadataApi = exports.MetadataApiFactory = exports.MetadataApiFp = exports.MetadataApiAxiosParamCreator = exports.HealthApi = exports.HealthApiFactory = exports.HealthApiFp = exports.HealthApiAxiosParamCreator = exports.GeneratorApi = exports.GeneratorApiFactory = exports.GeneratorApiFp = exports.GeneratorApiAxiosParamCreator = exports.CreditApi = exports.CreditApiFactory = exports.CreditApiFp = exports.CreditApiAxiosParamCreator = exports.ChatApi = exports.ChatApiFactory = exports.ChatApiFp = exports.ChatApiAxiosParamCreator = exports.AgentApi = exports.AgentApiFactory = exports.AgentApiFp = exports.AgentApiAxiosParamCreator = exports.UpstreamType = exports.TransactionType = exports.OwnerType = exports.LLMProvider = exports.EventType = exports.Direction = exports.CreditType = exports.CreditDebit = exports.ChatMessageAttachmentType = exports.AuthorType = exports.AgentUpdateCdpNetworkIdEnum = exports.AgentUpdateNetworkIdEnum = exports.AgentUpdateWalletProviderEnum = exports.AgentUpdateShortTermMemoryStrategyEnum = exports.AgentUpdateModeEnum = exports.AgentSortOption = exports.AgentResponseWalletProviderEnum = exports.AgentResponseModeEnum = exports.AgentCdpNetworkIdEnum = exports.AgentNetworkIdEnum = exports.AgentWalletProviderEnum = exports.AgentShortTermMemoryStrategyEnum = exports.AgentModeEnum = void 0;
88
+ exports.UserApi = exports.UserApiFactory = exports.UserApiFp = exports.UserApiAxiosParamCreator = exports.OAuthApi = void 0;
88
89
  var axios_1 = require("axios");
89
90
  // Some imports not used depending on template conditions
90
91
  // @ts-ignore
@@ -2782,6 +2783,327 @@ var CreditApi = /** @class */ (function (_super) {
2782
2783
  return CreditApi;
2783
2784
  }(base_1.BaseAPI));
2784
2785
  exports.CreditApi = CreditApi;
2786
+ /**
2787
+ * GeneratorApi - axios parameter creator
2788
+ * @export
2789
+ */
2790
+ var GeneratorApiAxiosParamCreator = function (configuration) {
2791
+ var _this = this;
2792
+ return {
2793
+ /**
2794
+ * 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
2795
+ * @summary Generate Agent from Natural Language Prompt
2796
+ * @param {AgentGenerateRequest} agentGenerateRequest
2797
+ * @param {*} [options] Override http request option.
2798
+ * @throws {RequiredError}
2799
+ */
2800
+ generateAgentGeneratorAgentGeneratePost: function (agentGenerateRequest_1) {
2801
+ var args_1 = [];
2802
+ for (var _i = 1; _i < arguments.length; _i++) {
2803
+ args_1[_i - 1] = arguments[_i];
2804
+ }
2805
+ return __awaiter(_this, __spreadArray([agentGenerateRequest_1], args_1, true), void 0, function (agentGenerateRequest, options) {
2806
+ var localVarPath, localVarUrlObj, baseOptions, localVarRequestOptions, localVarHeaderParameter, localVarQueryParameter, headersFromBaseOptions;
2807
+ if (options === void 0) { options = {}; }
2808
+ return __generator(this, function (_a) {
2809
+ switch (_a.label) {
2810
+ case 0:
2811
+ // verify required parameter 'agentGenerateRequest' is not null or undefined
2812
+ (0, common_1.assertParamExists)('generateAgentGeneratorAgentGeneratePost', 'agentGenerateRequest', agentGenerateRequest);
2813
+ localVarPath = "/generator/agent/generate";
2814
+ localVarUrlObj = new URL(localVarPath, common_1.DUMMY_BASE_URL);
2815
+ if (configuration) {
2816
+ baseOptions = configuration.baseOptions;
2817
+ }
2818
+ localVarRequestOptions = __assign(__assign({ method: 'POST' }, baseOptions), options);
2819
+ localVarHeaderParameter = {};
2820
+ localVarQueryParameter = {};
2821
+ // authentication HTTPBearer required
2822
+ // http bearer authentication required
2823
+ return [4 /*yield*/, (0, common_1.setBearerAuthToObject)(localVarHeaderParameter, configuration)];
2824
+ case 1:
2825
+ // authentication HTTPBearer required
2826
+ // http bearer authentication required
2827
+ _a.sent();
2828
+ localVarHeaderParameter['Content-Type'] = 'application/json';
2829
+ (0, common_1.setSearchParams)(localVarUrlObj, localVarQueryParameter);
2830
+ headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
2831
+ localVarRequestOptions.headers = __assign(__assign(__assign({}, localVarHeaderParameter), headersFromBaseOptions), options.headers);
2832
+ localVarRequestOptions.data = (0, common_1.serializeDataIfNeeded)(agentGenerateRequest, localVarRequestOptions, configuration);
2833
+ return [2 /*return*/, {
2834
+ url: (0, common_1.toPathString)(localVarUrlObj),
2835
+ options: localVarRequestOptions,
2836
+ }];
2837
+ }
2838
+ });
2839
+ });
2840
+ },
2841
+ /**
2842
+ * 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
2843
+ * @summary Get Generation Detail by Project ID
2844
+ * @param {string} projectId
2845
+ * @param {*} [options] Override http request option.
2846
+ * @throws {RequiredError}
2847
+ */
2848
+ getGenerationDetailGeneratorAgentGenerationsProjectIdGet: function (projectId_1) {
2849
+ var args_1 = [];
2850
+ for (var _i = 1; _i < arguments.length; _i++) {
2851
+ args_1[_i - 1] = arguments[_i];
2852
+ }
2853
+ return __awaiter(_this, __spreadArray([projectId_1], args_1, true), void 0, function (projectId, options) {
2854
+ var localVarPath, localVarUrlObj, baseOptions, localVarRequestOptions, localVarHeaderParameter, localVarQueryParameter, headersFromBaseOptions;
2855
+ if (options === void 0) { options = {}; }
2856
+ return __generator(this, function (_a) {
2857
+ switch (_a.label) {
2858
+ case 0:
2859
+ // verify required parameter 'projectId' is not null or undefined
2860
+ (0, common_1.assertParamExists)('getGenerationDetailGeneratorAgentGenerationsProjectIdGet', 'projectId', projectId);
2861
+ localVarPath = "/generator/agent/generations/{project_id}"
2862
+ .replace("{".concat("project_id", "}"), encodeURIComponent(String(projectId)));
2863
+ localVarUrlObj = new URL(localVarPath, common_1.DUMMY_BASE_URL);
2864
+ if (configuration) {
2865
+ baseOptions = configuration.baseOptions;
2866
+ }
2867
+ localVarRequestOptions = __assign(__assign({ method: 'GET' }, baseOptions), options);
2868
+ localVarHeaderParameter = {};
2869
+ localVarQueryParameter = {};
2870
+ // authentication HTTPBearer required
2871
+ // http bearer authentication required
2872
+ return [4 /*yield*/, (0, common_1.setBearerAuthToObject)(localVarHeaderParameter, configuration)];
2873
+ case 1:
2874
+ // authentication HTTPBearer required
2875
+ // http bearer authentication required
2876
+ _a.sent();
2877
+ (0, common_1.setSearchParams)(localVarUrlObj, localVarQueryParameter);
2878
+ headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
2879
+ localVarRequestOptions.headers = __assign(__assign(__assign({}, localVarHeaderParameter), headersFromBaseOptions), options.headers);
2880
+ return [2 /*return*/, {
2881
+ url: (0, common_1.toPathString)(localVarUrlObj),
2882
+ options: localVarRequestOptions,
2883
+ }];
2884
+ }
2885
+ });
2886
+ });
2887
+ },
2888
+ /**
2889
+ * 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
2890
+ * @summary Get Generations List by User
2891
+ * @param {number} [limit]
2892
+ * @param {*} [options] Override http request option.
2893
+ * @throws {RequiredError}
2894
+ */
2895
+ getGenerationsGeneratorAgentGenerationsGet: function (limit_1) {
2896
+ var args_1 = [];
2897
+ for (var _i = 1; _i < arguments.length; _i++) {
2898
+ args_1[_i - 1] = arguments[_i];
2899
+ }
2900
+ return __awaiter(_this, __spreadArray([limit_1], args_1, true), void 0, function (limit, options) {
2901
+ var localVarPath, localVarUrlObj, baseOptions, localVarRequestOptions, localVarHeaderParameter, localVarQueryParameter, headersFromBaseOptions;
2902
+ if (options === void 0) { options = {}; }
2903
+ return __generator(this, function (_a) {
2904
+ switch (_a.label) {
2905
+ case 0:
2906
+ localVarPath = "/generator/agent/generations";
2907
+ localVarUrlObj = new URL(localVarPath, common_1.DUMMY_BASE_URL);
2908
+ if (configuration) {
2909
+ baseOptions = configuration.baseOptions;
2910
+ }
2911
+ localVarRequestOptions = __assign(__assign({ method: 'GET' }, baseOptions), options);
2912
+ localVarHeaderParameter = {};
2913
+ localVarQueryParameter = {};
2914
+ // authentication HTTPBearer required
2915
+ // http bearer authentication required
2916
+ return [4 /*yield*/, (0, common_1.setBearerAuthToObject)(localVarHeaderParameter, configuration)];
2917
+ case 1:
2918
+ // authentication HTTPBearer required
2919
+ // http bearer authentication required
2920
+ _a.sent();
2921
+ if (limit !== undefined) {
2922
+ localVarQueryParameter['limit'] = limit;
2923
+ }
2924
+ (0, common_1.setSearchParams)(localVarUrlObj, localVarQueryParameter);
2925
+ headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
2926
+ localVarRequestOptions.headers = __assign(__assign(__assign({}, localVarHeaderParameter), headersFromBaseOptions), options.headers);
2927
+ return [2 /*return*/, {
2928
+ url: (0, common_1.toPathString)(localVarUrlObj),
2929
+ options: localVarRequestOptions,
2930
+ }];
2931
+ }
2932
+ });
2933
+ });
2934
+ },
2935
+ };
2936
+ };
2937
+ exports.GeneratorApiAxiosParamCreator = GeneratorApiAxiosParamCreator;
2938
+ /**
2939
+ * GeneratorApi - functional programming interface
2940
+ * @export
2941
+ */
2942
+ var GeneratorApiFp = function (configuration) {
2943
+ var localVarAxiosParamCreator = (0, exports.GeneratorApiAxiosParamCreator)(configuration);
2944
+ return {
2945
+ /**
2946
+ * 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
2947
+ * @summary Generate Agent from Natural Language Prompt
2948
+ * @param {AgentGenerateRequest} agentGenerateRequest
2949
+ * @param {*} [options] Override http request option.
2950
+ * @throws {RequiredError}
2951
+ */
2952
+ generateAgentGeneratorAgentGeneratePost: function (agentGenerateRequest, options) {
2953
+ return __awaiter(this, void 0, void 0, function () {
2954
+ var localVarAxiosArgs, localVarOperationServerIndex, localVarOperationServerBasePath;
2955
+ var _a, _b, _c;
2956
+ return __generator(this, function (_d) {
2957
+ switch (_d.label) {
2958
+ case 0: return [4 /*yield*/, localVarAxiosParamCreator.generateAgentGeneratorAgentGeneratePost(agentGenerateRequest, options)];
2959
+ case 1:
2960
+ localVarAxiosArgs = _d.sent();
2961
+ localVarOperationServerIndex = (_a = configuration === null || configuration === void 0 ? void 0 : configuration.serverIndex) !== null && _a !== void 0 ? _a : 0;
2962
+ localVarOperationServerBasePath = (_c = (_b = base_1.operationServerMap['GeneratorApi.generateAgentGeneratorAgentGeneratePost']) === null || _b === void 0 ? void 0 : _b[localVarOperationServerIndex]) === null || _c === void 0 ? void 0 : _c.url;
2963
+ return [2 /*return*/, function (axios, basePath) { return (0, common_1.createRequestFunction)(localVarAxiosArgs, axios_1.default, base_1.BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath); }];
2964
+ }
2965
+ });
2966
+ });
2967
+ },
2968
+ /**
2969
+ * 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
2970
+ * @summary Get Generation Detail by Project ID
2971
+ * @param {string} projectId
2972
+ * @param {*} [options] Override http request option.
2973
+ * @throws {RequiredError}
2974
+ */
2975
+ getGenerationDetailGeneratorAgentGenerationsProjectIdGet: function (projectId, options) {
2976
+ return __awaiter(this, void 0, void 0, function () {
2977
+ var localVarAxiosArgs, localVarOperationServerIndex, localVarOperationServerBasePath;
2978
+ var _a, _b, _c;
2979
+ return __generator(this, function (_d) {
2980
+ switch (_d.label) {
2981
+ case 0: return [4 /*yield*/, localVarAxiosParamCreator.getGenerationDetailGeneratorAgentGenerationsProjectIdGet(projectId, options)];
2982
+ case 1:
2983
+ localVarAxiosArgs = _d.sent();
2984
+ localVarOperationServerIndex = (_a = configuration === null || configuration === void 0 ? void 0 : configuration.serverIndex) !== null && _a !== void 0 ? _a : 0;
2985
+ localVarOperationServerBasePath = (_c = (_b = base_1.operationServerMap['GeneratorApi.getGenerationDetailGeneratorAgentGenerationsProjectIdGet']) === null || _b === void 0 ? void 0 : _b[localVarOperationServerIndex]) === null || _c === void 0 ? void 0 : _c.url;
2986
+ return [2 /*return*/, function (axios, basePath) { return (0, common_1.createRequestFunction)(localVarAxiosArgs, axios_1.default, base_1.BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath); }];
2987
+ }
2988
+ });
2989
+ });
2990
+ },
2991
+ /**
2992
+ * 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
2993
+ * @summary Get Generations List by User
2994
+ * @param {number} [limit]
2995
+ * @param {*} [options] Override http request option.
2996
+ * @throws {RequiredError}
2997
+ */
2998
+ getGenerationsGeneratorAgentGenerationsGet: function (limit, options) {
2999
+ return __awaiter(this, void 0, void 0, function () {
3000
+ var localVarAxiosArgs, localVarOperationServerIndex, localVarOperationServerBasePath;
3001
+ var _a, _b, _c;
3002
+ return __generator(this, function (_d) {
3003
+ switch (_d.label) {
3004
+ case 0: return [4 /*yield*/, localVarAxiosParamCreator.getGenerationsGeneratorAgentGenerationsGet(limit, options)];
3005
+ case 1:
3006
+ localVarAxiosArgs = _d.sent();
3007
+ localVarOperationServerIndex = (_a = configuration === null || configuration === void 0 ? void 0 : configuration.serverIndex) !== null && _a !== void 0 ? _a : 0;
3008
+ localVarOperationServerBasePath = (_c = (_b = base_1.operationServerMap['GeneratorApi.getGenerationsGeneratorAgentGenerationsGet']) === null || _b === void 0 ? void 0 : _b[localVarOperationServerIndex]) === null || _c === void 0 ? void 0 : _c.url;
3009
+ return [2 /*return*/, function (axios, basePath) { return (0, common_1.createRequestFunction)(localVarAxiosArgs, axios_1.default, base_1.BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath); }];
3010
+ }
3011
+ });
3012
+ });
3013
+ },
3014
+ };
3015
+ };
3016
+ exports.GeneratorApiFp = GeneratorApiFp;
3017
+ /**
3018
+ * GeneratorApi - factory interface
3019
+ * @export
3020
+ */
3021
+ var GeneratorApiFactory = function (configuration, basePath, axios) {
3022
+ var localVarFp = (0, exports.GeneratorApiFp)(configuration);
3023
+ return {
3024
+ /**
3025
+ * 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
3026
+ * @summary Generate Agent from Natural Language Prompt
3027
+ * @param {AgentGenerateRequest} agentGenerateRequest
3028
+ * @param {*} [options] Override http request option.
3029
+ * @throws {RequiredError}
3030
+ */
3031
+ generateAgentGeneratorAgentGeneratePost: function (agentGenerateRequest, options) {
3032
+ return localVarFp.generateAgentGeneratorAgentGeneratePost(agentGenerateRequest, options).then(function (request) { return request(axios, basePath); });
3033
+ },
3034
+ /**
3035
+ * 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
3036
+ * @summary Get Generation Detail by Project ID
3037
+ * @param {string} projectId
3038
+ * @param {*} [options] Override http request option.
3039
+ * @throws {RequiredError}
3040
+ */
3041
+ getGenerationDetailGeneratorAgentGenerationsProjectIdGet: function (projectId, options) {
3042
+ return localVarFp.getGenerationDetailGeneratorAgentGenerationsProjectIdGet(projectId, options).then(function (request) { return request(axios, basePath); });
3043
+ },
3044
+ /**
3045
+ * 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
3046
+ * @summary Get Generations List by User
3047
+ * @param {number} [limit]
3048
+ * @param {*} [options] Override http request option.
3049
+ * @throws {RequiredError}
3050
+ */
3051
+ getGenerationsGeneratorAgentGenerationsGet: function (limit, options) {
3052
+ return localVarFp.getGenerationsGeneratorAgentGenerationsGet(limit, options).then(function (request) { return request(axios, basePath); });
3053
+ },
3054
+ };
3055
+ };
3056
+ exports.GeneratorApiFactory = GeneratorApiFactory;
3057
+ /**
3058
+ * GeneratorApi - object-oriented interface
3059
+ * @export
3060
+ * @class GeneratorApi
3061
+ * @extends {BaseAPI}
3062
+ */
3063
+ var GeneratorApi = /** @class */ (function (_super) {
3064
+ __extends(GeneratorApi, _super);
3065
+ function GeneratorApi() {
3066
+ return _super !== null && _super.apply(this, arguments) || this;
3067
+ }
3068
+ /**
3069
+ * 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
3070
+ * @summary Generate Agent from Natural Language Prompt
3071
+ * @param {AgentGenerateRequest} agentGenerateRequest
3072
+ * @param {*} [options] Override http request option.
3073
+ * @throws {RequiredError}
3074
+ * @memberof GeneratorApi
3075
+ */
3076
+ GeneratorApi.prototype.generateAgentGeneratorAgentGeneratePost = function (agentGenerateRequest, options) {
3077
+ var _this = this;
3078
+ return (0, exports.GeneratorApiFp)(this.configuration).generateAgentGeneratorAgentGeneratePost(agentGenerateRequest, options).then(function (request) { return request(_this.axios, _this.basePath); });
3079
+ };
3080
+ /**
3081
+ * 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
3082
+ * @summary Get Generation Detail by Project ID
3083
+ * @param {string} projectId
3084
+ * @param {*} [options] Override http request option.
3085
+ * @throws {RequiredError}
3086
+ * @memberof GeneratorApi
3087
+ */
3088
+ GeneratorApi.prototype.getGenerationDetailGeneratorAgentGenerationsProjectIdGet = function (projectId, options) {
3089
+ var _this = this;
3090
+ return (0, exports.GeneratorApiFp)(this.configuration).getGenerationDetailGeneratorAgentGenerationsProjectIdGet(projectId, options).then(function (request) { return request(_this.axios, _this.basePath); });
3091
+ };
3092
+ /**
3093
+ * 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
3094
+ * @summary Get Generations List by User
3095
+ * @param {number} [limit]
3096
+ * @param {*} [options] Override http request option.
3097
+ * @throws {RequiredError}
3098
+ * @memberof GeneratorApi
3099
+ */
3100
+ GeneratorApi.prototype.getGenerationsGeneratorAgentGenerationsGet = function (limit, options) {
3101
+ var _this = this;
3102
+ return (0, exports.GeneratorApiFp)(this.configuration).getGenerationsGeneratorAgentGenerationsGet(limit, options).then(function (request) { return request(_this.axios, _this.basePath); });
3103
+ };
3104
+ return GeneratorApi;
3105
+ }(base_1.BaseAPI));
3106
+ exports.GeneratorApi = GeneratorApi;
2785
3107
  /**
2786
3108
  * HealthApi - axios parameter creator
2787
3109
  * @export
@@ -3348,6 +3670,251 @@ var MetadataApi = /** @class */ (function (_super) {
3348
3670
  return MetadataApi;
3349
3671
  }(base_1.BaseAPI));
3350
3672
  exports.MetadataApi = MetadataApi;
3673
+ /**
3674
+ * OAuthApi - axios parameter creator
3675
+ * @export
3676
+ */
3677
+ var OAuthApiAxiosParamCreator = function (configuration) {
3678
+ var _this = this;
3679
+ return {
3680
+ /**
3681
+ * 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
3682
+ * @summary Get Twitter Auth Url
3683
+ * @param {string} agentId
3684
+ * @param {string} redirectUri
3685
+ * @param {*} [options] Override http request option.
3686
+ * @throws {RequiredError}
3687
+ */
3688
+ getTwitterAuthUrlOauthTwitterGet: function (agentId_1, redirectUri_1) {
3689
+ var args_1 = [];
3690
+ for (var _i = 2; _i < arguments.length; _i++) {
3691
+ args_1[_i - 2] = arguments[_i];
3692
+ }
3693
+ return __awaiter(_this, __spreadArray([agentId_1, redirectUri_1], args_1, true), void 0, function (agentId, redirectUri, options) {
3694
+ var localVarPath, localVarUrlObj, baseOptions, localVarRequestOptions, localVarHeaderParameter, localVarQueryParameter, headersFromBaseOptions;
3695
+ if (options === void 0) { options = {}; }
3696
+ return __generator(this, function (_a) {
3697
+ switch (_a.label) {
3698
+ case 0:
3699
+ // verify required parameter 'agentId' is not null or undefined
3700
+ (0, common_1.assertParamExists)('getTwitterAuthUrlOauthTwitterGet', 'agentId', agentId);
3701
+ // verify required parameter 'redirectUri' is not null or undefined
3702
+ (0, common_1.assertParamExists)('getTwitterAuthUrlOauthTwitterGet', 'redirectUri', redirectUri);
3703
+ localVarPath = "/oauth/twitter";
3704
+ localVarUrlObj = new URL(localVarPath, common_1.DUMMY_BASE_URL);
3705
+ if (configuration) {
3706
+ baseOptions = configuration.baseOptions;
3707
+ }
3708
+ localVarRequestOptions = __assign(__assign({ method: 'GET' }, baseOptions), options);
3709
+ localVarHeaderParameter = {};
3710
+ localVarQueryParameter = {};
3711
+ // authentication HTTPBearer required
3712
+ // http bearer authentication required
3713
+ return [4 /*yield*/, (0, common_1.setBearerAuthToObject)(localVarHeaderParameter, configuration)];
3714
+ case 1:
3715
+ // authentication HTTPBearer required
3716
+ // http bearer authentication required
3717
+ _a.sent();
3718
+ if (agentId !== undefined) {
3719
+ localVarQueryParameter['agent_id'] = agentId;
3720
+ }
3721
+ if (redirectUri !== undefined) {
3722
+ localVarQueryParameter['redirect_uri'] = redirectUri;
3723
+ }
3724
+ (0, common_1.setSearchParams)(localVarUrlObj, localVarQueryParameter);
3725
+ headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
3726
+ localVarRequestOptions.headers = __assign(__assign(__assign({}, localVarHeaderParameter), headersFromBaseOptions), options.headers);
3727
+ return [2 /*return*/, {
3728
+ url: (0, common_1.toPathString)(localVarUrlObj),
3729
+ options: localVarRequestOptions,
3730
+ }];
3731
+ }
3732
+ });
3733
+ });
3734
+ },
3735
+ /**
3736
+ * 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
3737
+ * @summary Twitter Oauth Callback
3738
+ * @param {string} state
3739
+ * @param {string | null} [code]
3740
+ * @param {string | null} [error]
3741
+ * @param {*} [options] Override http request option.
3742
+ * @throws {RequiredError}
3743
+ */
3744
+ twitterOauthCallbackOauthTwitterCallbackGet: function (state_1, code_1, error_1) {
3745
+ var args_1 = [];
3746
+ for (var _i = 3; _i < arguments.length; _i++) {
3747
+ args_1[_i - 3] = arguments[_i];
3748
+ }
3749
+ return __awaiter(_this, __spreadArray([state_1, code_1, error_1], args_1, true), void 0, function (state, code, error, options) {
3750
+ var localVarPath, localVarUrlObj, baseOptions, localVarRequestOptions, localVarHeaderParameter, localVarQueryParameter, headersFromBaseOptions;
3751
+ if (options === void 0) { options = {}; }
3752
+ return __generator(this, function (_a) {
3753
+ // verify required parameter 'state' is not null or undefined
3754
+ (0, common_1.assertParamExists)('twitterOauthCallbackOauthTwitterCallbackGet', 'state', state);
3755
+ localVarPath = "/oauth/twitter/callback";
3756
+ localVarUrlObj = new URL(localVarPath, common_1.DUMMY_BASE_URL);
3757
+ if (configuration) {
3758
+ baseOptions = configuration.baseOptions;
3759
+ }
3760
+ localVarRequestOptions = __assign(__assign({ method: 'GET' }, baseOptions), options);
3761
+ localVarHeaderParameter = {};
3762
+ localVarQueryParameter = {};
3763
+ if (state !== undefined) {
3764
+ localVarQueryParameter['state'] = state;
3765
+ }
3766
+ if (code !== undefined) {
3767
+ localVarQueryParameter['code'] = code;
3768
+ }
3769
+ if (error !== undefined) {
3770
+ localVarQueryParameter['error'] = error;
3771
+ }
3772
+ (0, common_1.setSearchParams)(localVarUrlObj, localVarQueryParameter);
3773
+ headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
3774
+ localVarRequestOptions.headers = __assign(__assign(__assign({}, localVarHeaderParameter), headersFromBaseOptions), options.headers);
3775
+ return [2 /*return*/, {
3776
+ url: (0, common_1.toPathString)(localVarUrlObj),
3777
+ options: localVarRequestOptions,
3778
+ }];
3779
+ });
3780
+ });
3781
+ },
3782
+ };
3783
+ };
3784
+ exports.OAuthApiAxiosParamCreator = OAuthApiAxiosParamCreator;
3785
+ /**
3786
+ * OAuthApi - functional programming interface
3787
+ * @export
3788
+ */
3789
+ var OAuthApiFp = function (configuration) {
3790
+ var localVarAxiosParamCreator = (0, exports.OAuthApiAxiosParamCreator)(configuration);
3791
+ return {
3792
+ /**
3793
+ * 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
3794
+ * @summary Get Twitter Auth Url
3795
+ * @param {string} agentId
3796
+ * @param {string} redirectUri
3797
+ * @param {*} [options] Override http request option.
3798
+ * @throws {RequiredError}
3799
+ */
3800
+ getTwitterAuthUrlOauthTwitterGet: function (agentId, redirectUri, options) {
3801
+ return __awaiter(this, void 0, void 0, function () {
3802
+ var localVarAxiosArgs, localVarOperationServerIndex, localVarOperationServerBasePath;
3803
+ var _a, _b, _c;
3804
+ return __generator(this, function (_d) {
3805
+ switch (_d.label) {
3806
+ case 0: return [4 /*yield*/, localVarAxiosParamCreator.getTwitterAuthUrlOauthTwitterGet(agentId, redirectUri, options)];
3807
+ case 1:
3808
+ localVarAxiosArgs = _d.sent();
3809
+ localVarOperationServerIndex = (_a = configuration === null || configuration === void 0 ? void 0 : configuration.serverIndex) !== null && _a !== void 0 ? _a : 0;
3810
+ localVarOperationServerBasePath = (_c = (_b = base_1.operationServerMap['OAuthApi.getTwitterAuthUrlOauthTwitterGet']) === null || _b === void 0 ? void 0 : _b[localVarOperationServerIndex]) === null || _c === void 0 ? void 0 : _c.url;
3811
+ return [2 /*return*/, function (axios, basePath) { return (0, common_1.createRequestFunction)(localVarAxiosArgs, axios_1.default, base_1.BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath); }];
3812
+ }
3813
+ });
3814
+ });
3815
+ },
3816
+ /**
3817
+ * 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
3818
+ * @summary Twitter Oauth Callback
3819
+ * @param {string} state
3820
+ * @param {string | null} [code]
3821
+ * @param {string | null} [error]
3822
+ * @param {*} [options] Override http request option.
3823
+ * @throws {RequiredError}
3824
+ */
3825
+ twitterOauthCallbackOauthTwitterCallbackGet: function (state, code, error, options) {
3826
+ return __awaiter(this, void 0, void 0, function () {
3827
+ var localVarAxiosArgs, localVarOperationServerIndex, localVarOperationServerBasePath;
3828
+ var _a, _b, _c;
3829
+ return __generator(this, function (_d) {
3830
+ switch (_d.label) {
3831
+ case 0: return [4 /*yield*/, localVarAxiosParamCreator.twitterOauthCallbackOauthTwitterCallbackGet(state, code, error, options)];
3832
+ case 1:
3833
+ localVarAxiosArgs = _d.sent();
3834
+ localVarOperationServerIndex = (_a = configuration === null || configuration === void 0 ? void 0 : configuration.serverIndex) !== null && _a !== void 0 ? _a : 0;
3835
+ localVarOperationServerBasePath = (_c = (_b = base_1.operationServerMap['OAuthApi.twitterOauthCallbackOauthTwitterCallbackGet']) === null || _b === void 0 ? void 0 : _b[localVarOperationServerIndex]) === null || _c === void 0 ? void 0 : _c.url;
3836
+ return [2 /*return*/, function (axios, basePath) { return (0, common_1.createRequestFunction)(localVarAxiosArgs, axios_1.default, base_1.BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath); }];
3837
+ }
3838
+ });
3839
+ });
3840
+ },
3841
+ };
3842
+ };
3843
+ exports.OAuthApiFp = OAuthApiFp;
3844
+ /**
3845
+ * OAuthApi - factory interface
3846
+ * @export
3847
+ */
3848
+ var OAuthApiFactory = function (configuration, basePath, axios) {
3849
+ var localVarFp = (0, exports.OAuthApiFp)(configuration);
3850
+ return {
3851
+ /**
3852
+ * 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
3853
+ * @summary Get Twitter Auth Url
3854
+ * @param {string} agentId
3855
+ * @param {string} redirectUri
3856
+ * @param {*} [options] Override http request option.
3857
+ * @throws {RequiredError}
3858
+ */
3859
+ getTwitterAuthUrlOauthTwitterGet: function (agentId, redirectUri, options) {
3860
+ return localVarFp.getTwitterAuthUrlOauthTwitterGet(agentId, redirectUri, options).then(function (request) { return request(axios, basePath); });
3861
+ },
3862
+ /**
3863
+ * 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
3864
+ * @summary Twitter Oauth Callback
3865
+ * @param {string} state
3866
+ * @param {string | null} [code]
3867
+ * @param {string | null} [error]
3868
+ * @param {*} [options] Override http request option.
3869
+ * @throws {RequiredError}
3870
+ */
3871
+ twitterOauthCallbackOauthTwitterCallbackGet: function (state, code, error, options) {
3872
+ return localVarFp.twitterOauthCallbackOauthTwitterCallbackGet(state, code, error, options).then(function (request) { return request(axios, basePath); });
3873
+ },
3874
+ };
3875
+ };
3876
+ exports.OAuthApiFactory = OAuthApiFactory;
3877
+ /**
3878
+ * OAuthApi - object-oriented interface
3879
+ * @export
3880
+ * @class OAuthApi
3881
+ * @extends {BaseAPI}
3882
+ */
3883
+ var OAuthApi = /** @class */ (function (_super) {
3884
+ __extends(OAuthApi, _super);
3885
+ function OAuthApi() {
3886
+ return _super !== null && _super.apply(this, arguments) || this;
3887
+ }
3888
+ /**
3889
+ * 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
3890
+ * @summary Get Twitter Auth Url
3891
+ * @param {string} agentId
3892
+ * @param {string} redirectUri
3893
+ * @param {*} [options] Override http request option.
3894
+ * @throws {RequiredError}
3895
+ * @memberof OAuthApi
3896
+ */
3897
+ OAuthApi.prototype.getTwitterAuthUrlOauthTwitterGet = function (agentId, redirectUri, options) {
3898
+ var _this = this;
3899
+ return (0, exports.OAuthApiFp)(this.configuration).getTwitterAuthUrlOauthTwitterGet(agentId, redirectUri, options).then(function (request) { return request(_this.axios, _this.basePath); });
3900
+ };
3901
+ /**
3902
+ * 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
3903
+ * @summary Twitter Oauth Callback
3904
+ * @param {string} state
3905
+ * @param {string | null} [code]
3906
+ * @param {string | null} [error]
3907
+ * @param {*} [options] Override http request option.
3908
+ * @throws {RequiredError}
3909
+ * @memberof OAuthApi
3910
+ */
3911
+ OAuthApi.prototype.twitterOauthCallbackOauthTwitterCallbackGet = function (state, code, error, options) {
3912
+ var _this = this;
3913
+ return (0, exports.OAuthApiFp)(this.configuration).twitterOauthCallbackOauthTwitterCallbackGet(state, code, error, options).then(function (request) { return request(_this.axios, _this.basePath); });
3914
+ };
3915
+ return OAuthApi;
3916
+ }(base_1.BaseAPI));
3917
+ exports.OAuthApi = OAuthApi;
3351
3918
  /**
3352
3919
  * UserApi - axios parameter creator
3353
3920
  * @export
package/dist/base.d.ts CHANGED
@@ -2,7 +2,7 @@
2
2
  * Nation IntentKit API
3
3
  * API for Nation IntentKit services
4
4
  *
5
- * The version of the OpenAPI document: 0.1.28
5
+ * The version of the OpenAPI document: 0.1.30
6
6
  *
7
7
  *
8
8
  * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
package/dist/base.js CHANGED
@@ -5,7 +5,7 @@
5
5
  * Nation IntentKit API
6
6
  * API for Nation IntentKit services
7
7
  *
8
- * The version of the OpenAPI document: 0.1.28
8
+ * The version of the OpenAPI document: 0.1.30
9
9
  *
10
10
  *
11
11
  * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
package/dist/common.d.ts CHANGED
@@ -2,7 +2,7 @@
2
2
  * Nation IntentKit API
3
3
  * API for Nation IntentKit services
4
4
  *
5
- * The version of the OpenAPI document: 0.1.28
5
+ * The version of the OpenAPI document: 0.1.30
6
6
  *
7
7
  *
8
8
  * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).