fmp-ai-tools 0.0.11-beta.4 → 0.0.11-beta.6

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,184 +1,44 @@
1
1
  import * as _openai_agents from '@openai/agents';
2
2
  import { Tool } from '@openai/agents';
3
3
 
4
- declare const getCompanyProfile: _openai_agents.FunctionTool<unknown, {
5
- type: "object";
6
- properties: Record<string, any>;
7
- required: string[];
8
- additionalProperties: false;
9
- }, string>;
4
+ declare const getCompanyProfile: _openai_agents.FunctionTool<unknown, any, string>;
10
5
 
11
- declare const getEarningsCalendar: _openai_agents.FunctionTool<unknown, {
12
- type: "object";
13
- properties: Record<string, any>;
14
- required: string[];
15
- additionalProperties: false;
16
- }, string>;
17
- declare const getEconomicCalendar: _openai_agents.FunctionTool<unknown, {
18
- type: "object";
19
- properties: Record<string, any>;
20
- required: string[];
21
- additionalProperties: false;
22
- }, string>;
6
+ declare const getEarningsCalendar: _openai_agents.FunctionTool<unknown, any, string>;
7
+ declare const getEconomicCalendar: _openai_agents.FunctionTool<unknown, any, string>;
23
8
 
24
- declare const getTreasuryRates: _openai_agents.FunctionTool<unknown, {
25
- type: "object";
26
- properties: Record<string, any>;
27
- required: string[];
28
- additionalProperties: false;
29
- }, string>;
30
- declare const getEconomicIndicators: _openai_agents.FunctionTool<unknown, {
31
- type: "object";
32
- properties: Record<string, any>;
33
- required: string[];
34
- additionalProperties: false;
35
- }, string>;
9
+ declare const getTreasuryRates: _openai_agents.FunctionTool<unknown, any, string>;
10
+ declare const getEconomicIndicators: _openai_agents.FunctionTool<unknown, any, string>;
36
11
 
37
- declare const getETFHoldings: _openai_agents.FunctionTool<unknown, {
38
- type: "object";
39
- properties: Record<string, any>;
40
- required: string[];
41
- additionalProperties: false;
42
- }, string>;
43
- declare const getETFProfile: _openai_agents.FunctionTool<unknown, {
44
- type: "object";
45
- properties: Record<string, any>;
46
- required: string[];
47
- additionalProperties: false;
48
- }, string>;
12
+ declare const getETFHoldings: _openai_agents.FunctionTool<unknown, any, string>;
13
+ declare const getETFProfile: _openai_agents.FunctionTool<unknown, any, string>;
49
14
 
50
- declare const getBalanceSheet: _openai_agents.FunctionTool<unknown, {
51
- type: "object";
52
- properties: Record<string, any>;
53
- required: string[];
54
- additionalProperties: false;
55
- }, string>;
56
- declare const getIncomeStatement: _openai_agents.FunctionTool<unknown, {
57
- type: "object";
58
- properties: Record<string, any>;
59
- required: string[];
60
- additionalProperties: false;
61
- }, string>;
62
- declare const getCashFlowStatement: _openai_agents.FunctionTool<unknown, {
63
- type: "object";
64
- properties: Record<string, any>;
65
- required: string[];
66
- additionalProperties: false;
67
- }, string>;
68
- declare const getFinancialRatios: _openai_agents.FunctionTool<unknown, {
69
- type: "object";
70
- properties: Record<string, any>;
71
- required: string[];
72
- additionalProperties: false;
73
- }, string>;
15
+ declare const getBalanceSheet: _openai_agents.FunctionTool<unknown, any, string>;
16
+ declare const getIncomeStatement: _openai_agents.FunctionTool<unknown, any, string>;
17
+ declare const getCashFlowStatement: _openai_agents.FunctionTool<unknown, any, string>;
18
+ declare const getFinancialRatios: _openai_agents.FunctionTool<unknown, any, string>;
74
19
 
75
- declare const getInsiderTrading: _openai_agents.FunctionTool<unknown, {
76
- type: "object";
77
- properties: Record<string, any>;
78
- required: string[];
79
- additionalProperties: false;
80
- }, string>;
20
+ declare const getInsiderTrading: _openai_agents.FunctionTool<unknown, any, string>;
81
21
 
82
- declare const getInstitutionalHolders: _openai_agents.FunctionTool<unknown, {
83
- type: "object";
84
- properties: Record<string, any>;
85
- required: string[];
86
- additionalProperties: false;
87
- }, string>;
22
+ declare const getInstitutionalHolders: _openai_agents.FunctionTool<unknown, any, string>;
88
23
 
89
- declare const getMarketPerformance: _openai_agents.FunctionTool<unknown, {
90
- type: "object";
91
- properties: Record<string, any>;
92
- required: string[];
93
- additionalProperties: false;
94
- }, string>;
95
- declare const getSectorPerformance: _openai_agents.FunctionTool<unknown, {
96
- type: "object";
97
- properties: Record<string, any>;
98
- required: string[];
99
- additionalProperties: false;
100
- }, string>;
101
- declare const getGainers: _openai_agents.FunctionTool<unknown, {
102
- type: "object";
103
- properties: Record<string, any>;
104
- required: string[];
105
- additionalProperties: false;
106
- }, string>;
107
- declare const getLosers: _openai_agents.FunctionTool<unknown, {
108
- type: "object";
109
- properties: Record<string, any>;
110
- required: string[];
111
- additionalProperties: false;
112
- }, string>;
113
- declare const getMostActive: _openai_agents.FunctionTool<unknown, {
114
- type: "object";
115
- properties: Record<string, any>;
116
- required: string[];
117
- additionalProperties: false;
118
- }, string>;
24
+ declare const getMarketPerformance: _openai_agents.FunctionTool<unknown, any, string>;
25
+ declare const getSectorPerformance: _openai_agents.FunctionTool<unknown, any, string>;
26
+ declare const getGainers: _openai_agents.FunctionTool<unknown, any, string>;
27
+ declare const getLosers: _openai_agents.FunctionTool<unknown, any, string>;
28
+ declare const getMostActive: _openai_agents.FunctionTool<unknown, any, string>;
119
29
 
120
- declare const getStockQuote: _openai_agents.FunctionTool<unknown, {
121
- type: "object";
122
- properties: Record<string, any>;
123
- required: string[];
124
- additionalProperties: false;
125
- }, string>;
30
+ declare const getStockQuote: _openai_agents.FunctionTool<unknown, any, string>;
126
31
 
127
- declare const getSenateTrading: _openai_agents.FunctionTool<unknown, {
128
- type: "object";
129
- properties: Record<string, any>;
130
- required: string[];
131
- additionalProperties: false;
132
- }, string>;
133
- declare const getHouseTrading: _openai_agents.FunctionTool<unknown, {
134
- type: "object";
135
- properties: Record<string, any>;
136
- required: string[];
137
- additionalProperties: false;
138
- }, string>;
139
- declare const getSenateTradingByName: _openai_agents.FunctionTool<unknown, {
140
- type: "object";
141
- properties: Record<string, any>;
142
- required: string[];
143
- additionalProperties: false;
144
- }, string>;
145
- declare const getHouseTradingByName: _openai_agents.FunctionTool<unknown, {
146
- type: "object";
147
- properties: Record<string, any>;
148
- required: string[];
149
- additionalProperties: false;
150
- }, string>;
151
- declare const getSenateTradingRSSFeed: _openai_agents.FunctionTool<unknown, {
152
- type: "object";
153
- properties: Record<string, any>;
154
- required: string[];
155
- additionalProperties: false;
156
- }, string>;
157
- declare const getHouseTradingRSSFeed: _openai_agents.FunctionTool<unknown, {
158
- type: "object";
159
- properties: Record<string, any>;
160
- required: string[];
161
- additionalProperties: false;
162
- }, string>;
32
+ declare const getSenateTrading: _openai_agents.FunctionTool<unknown, any, string>;
33
+ declare const getHouseTrading: _openai_agents.FunctionTool<unknown, any, string>;
34
+ declare const getSenateTradingByName: _openai_agents.FunctionTool<unknown, any, string>;
35
+ declare const getHouseTradingByName: _openai_agents.FunctionTool<unknown, any, string>;
36
+ declare const getSenateTradingRSSFeed: _openai_agents.FunctionTool<unknown, any, string>;
37
+ declare const getHouseTradingRSSFeed: _openai_agents.FunctionTool<unknown, any, string>;
163
38
 
164
- declare const getMarketCap: _openai_agents.FunctionTool<unknown, {
165
- type: "object";
166
- properties: Record<string, any>;
167
- required: string[];
168
- additionalProperties: false;
169
- }, string>;
170
- declare const getStockSplits: _openai_agents.FunctionTool<unknown, {
171
- type: "object";
172
- properties: Record<string, any>;
173
- required: string[];
174
- additionalProperties: false;
175
- }, string>;
176
- declare const getDividendHistory: _openai_agents.FunctionTool<unknown, {
177
- type: "object";
178
- properties: Record<string, any>;
179
- required: string[];
180
- additionalProperties: false;
181
- }, string>;
39
+ declare const getMarketCap: _openai_agents.FunctionTool<unknown, any, string>;
40
+ declare const getStockSplits: _openai_agents.FunctionTool<unknown, any, string>;
41
+ declare const getDividendHistory: _openai_agents.FunctionTool<unknown, any, string>;
182
42
 
183
43
  declare const companyTools: Tool<unknown>[];
184
44
  declare const calendarTools: Tool<unknown>[];
@@ -1,184 +1,44 @@
1
1
  import * as _openai_agents from '@openai/agents';
2
2
  import { Tool } from '@openai/agents';
3
3
 
4
- declare const getCompanyProfile: _openai_agents.FunctionTool<unknown, {
5
- type: "object";
6
- properties: Record<string, any>;
7
- required: string[];
8
- additionalProperties: false;
9
- }, string>;
4
+ declare const getCompanyProfile: _openai_agents.FunctionTool<unknown, any, string>;
10
5
 
11
- declare const getEarningsCalendar: _openai_agents.FunctionTool<unknown, {
12
- type: "object";
13
- properties: Record<string, any>;
14
- required: string[];
15
- additionalProperties: false;
16
- }, string>;
17
- declare const getEconomicCalendar: _openai_agents.FunctionTool<unknown, {
18
- type: "object";
19
- properties: Record<string, any>;
20
- required: string[];
21
- additionalProperties: false;
22
- }, string>;
6
+ declare const getEarningsCalendar: _openai_agents.FunctionTool<unknown, any, string>;
7
+ declare const getEconomicCalendar: _openai_agents.FunctionTool<unknown, any, string>;
23
8
 
24
- declare const getTreasuryRates: _openai_agents.FunctionTool<unknown, {
25
- type: "object";
26
- properties: Record<string, any>;
27
- required: string[];
28
- additionalProperties: false;
29
- }, string>;
30
- declare const getEconomicIndicators: _openai_agents.FunctionTool<unknown, {
31
- type: "object";
32
- properties: Record<string, any>;
33
- required: string[];
34
- additionalProperties: false;
35
- }, string>;
9
+ declare const getTreasuryRates: _openai_agents.FunctionTool<unknown, any, string>;
10
+ declare const getEconomicIndicators: _openai_agents.FunctionTool<unknown, any, string>;
36
11
 
37
- declare const getETFHoldings: _openai_agents.FunctionTool<unknown, {
38
- type: "object";
39
- properties: Record<string, any>;
40
- required: string[];
41
- additionalProperties: false;
42
- }, string>;
43
- declare const getETFProfile: _openai_agents.FunctionTool<unknown, {
44
- type: "object";
45
- properties: Record<string, any>;
46
- required: string[];
47
- additionalProperties: false;
48
- }, string>;
12
+ declare const getETFHoldings: _openai_agents.FunctionTool<unknown, any, string>;
13
+ declare const getETFProfile: _openai_agents.FunctionTool<unknown, any, string>;
49
14
 
50
- declare const getBalanceSheet: _openai_agents.FunctionTool<unknown, {
51
- type: "object";
52
- properties: Record<string, any>;
53
- required: string[];
54
- additionalProperties: false;
55
- }, string>;
56
- declare const getIncomeStatement: _openai_agents.FunctionTool<unknown, {
57
- type: "object";
58
- properties: Record<string, any>;
59
- required: string[];
60
- additionalProperties: false;
61
- }, string>;
62
- declare const getCashFlowStatement: _openai_agents.FunctionTool<unknown, {
63
- type: "object";
64
- properties: Record<string, any>;
65
- required: string[];
66
- additionalProperties: false;
67
- }, string>;
68
- declare const getFinancialRatios: _openai_agents.FunctionTool<unknown, {
69
- type: "object";
70
- properties: Record<string, any>;
71
- required: string[];
72
- additionalProperties: false;
73
- }, string>;
15
+ declare const getBalanceSheet: _openai_agents.FunctionTool<unknown, any, string>;
16
+ declare const getIncomeStatement: _openai_agents.FunctionTool<unknown, any, string>;
17
+ declare const getCashFlowStatement: _openai_agents.FunctionTool<unknown, any, string>;
18
+ declare const getFinancialRatios: _openai_agents.FunctionTool<unknown, any, string>;
74
19
 
75
- declare const getInsiderTrading: _openai_agents.FunctionTool<unknown, {
76
- type: "object";
77
- properties: Record<string, any>;
78
- required: string[];
79
- additionalProperties: false;
80
- }, string>;
20
+ declare const getInsiderTrading: _openai_agents.FunctionTool<unknown, any, string>;
81
21
 
82
- declare const getInstitutionalHolders: _openai_agents.FunctionTool<unknown, {
83
- type: "object";
84
- properties: Record<string, any>;
85
- required: string[];
86
- additionalProperties: false;
87
- }, string>;
22
+ declare const getInstitutionalHolders: _openai_agents.FunctionTool<unknown, any, string>;
88
23
 
89
- declare const getMarketPerformance: _openai_agents.FunctionTool<unknown, {
90
- type: "object";
91
- properties: Record<string, any>;
92
- required: string[];
93
- additionalProperties: false;
94
- }, string>;
95
- declare const getSectorPerformance: _openai_agents.FunctionTool<unknown, {
96
- type: "object";
97
- properties: Record<string, any>;
98
- required: string[];
99
- additionalProperties: false;
100
- }, string>;
101
- declare const getGainers: _openai_agents.FunctionTool<unknown, {
102
- type: "object";
103
- properties: Record<string, any>;
104
- required: string[];
105
- additionalProperties: false;
106
- }, string>;
107
- declare const getLosers: _openai_agents.FunctionTool<unknown, {
108
- type: "object";
109
- properties: Record<string, any>;
110
- required: string[];
111
- additionalProperties: false;
112
- }, string>;
113
- declare const getMostActive: _openai_agents.FunctionTool<unknown, {
114
- type: "object";
115
- properties: Record<string, any>;
116
- required: string[];
117
- additionalProperties: false;
118
- }, string>;
24
+ declare const getMarketPerformance: _openai_agents.FunctionTool<unknown, any, string>;
25
+ declare const getSectorPerformance: _openai_agents.FunctionTool<unknown, any, string>;
26
+ declare const getGainers: _openai_agents.FunctionTool<unknown, any, string>;
27
+ declare const getLosers: _openai_agents.FunctionTool<unknown, any, string>;
28
+ declare const getMostActive: _openai_agents.FunctionTool<unknown, any, string>;
119
29
 
120
- declare const getStockQuote: _openai_agents.FunctionTool<unknown, {
121
- type: "object";
122
- properties: Record<string, any>;
123
- required: string[];
124
- additionalProperties: false;
125
- }, string>;
30
+ declare const getStockQuote: _openai_agents.FunctionTool<unknown, any, string>;
126
31
 
127
- declare const getSenateTrading: _openai_agents.FunctionTool<unknown, {
128
- type: "object";
129
- properties: Record<string, any>;
130
- required: string[];
131
- additionalProperties: false;
132
- }, string>;
133
- declare const getHouseTrading: _openai_agents.FunctionTool<unknown, {
134
- type: "object";
135
- properties: Record<string, any>;
136
- required: string[];
137
- additionalProperties: false;
138
- }, string>;
139
- declare const getSenateTradingByName: _openai_agents.FunctionTool<unknown, {
140
- type: "object";
141
- properties: Record<string, any>;
142
- required: string[];
143
- additionalProperties: false;
144
- }, string>;
145
- declare const getHouseTradingByName: _openai_agents.FunctionTool<unknown, {
146
- type: "object";
147
- properties: Record<string, any>;
148
- required: string[];
149
- additionalProperties: false;
150
- }, string>;
151
- declare const getSenateTradingRSSFeed: _openai_agents.FunctionTool<unknown, {
152
- type: "object";
153
- properties: Record<string, any>;
154
- required: string[];
155
- additionalProperties: false;
156
- }, string>;
157
- declare const getHouseTradingRSSFeed: _openai_agents.FunctionTool<unknown, {
158
- type: "object";
159
- properties: Record<string, any>;
160
- required: string[];
161
- additionalProperties: false;
162
- }, string>;
32
+ declare const getSenateTrading: _openai_agents.FunctionTool<unknown, any, string>;
33
+ declare const getHouseTrading: _openai_agents.FunctionTool<unknown, any, string>;
34
+ declare const getSenateTradingByName: _openai_agents.FunctionTool<unknown, any, string>;
35
+ declare const getHouseTradingByName: _openai_agents.FunctionTool<unknown, any, string>;
36
+ declare const getSenateTradingRSSFeed: _openai_agents.FunctionTool<unknown, any, string>;
37
+ declare const getHouseTradingRSSFeed: _openai_agents.FunctionTool<unknown, any, string>;
163
38
 
164
- declare const getMarketCap: _openai_agents.FunctionTool<unknown, {
165
- type: "object";
166
- properties: Record<string, any>;
167
- required: string[];
168
- additionalProperties: false;
169
- }, string>;
170
- declare const getStockSplits: _openai_agents.FunctionTool<unknown, {
171
- type: "object";
172
- properties: Record<string, any>;
173
- required: string[];
174
- additionalProperties: false;
175
- }, string>;
176
- declare const getDividendHistory: _openai_agents.FunctionTool<unknown, {
177
- type: "object";
178
- properties: Record<string, any>;
179
- required: string[];
180
- additionalProperties: false;
181
- }, string>;
39
+ declare const getMarketCap: _openai_agents.FunctionTool<unknown, any, string>;
40
+ declare const getStockSplits: _openai_agents.FunctionTool<unknown, any, string>;
41
+ declare const getDividendHistory: _openai_agents.FunctionTool<unknown, any, string>;
182
42
 
183
43
  declare const companyTools: Tool<unknown>[];
184
44
  declare const calendarTools: Tool<unknown>[];
@@ -1,33 +1,80 @@
1
1
  'use strict';
2
2
 
3
+ var fs = require('fs');
4
+ var path = require('path');
3
5
  var zod = require('zod');
4
6
  var agents = require('@openai/agents');
5
7
  var fmpNodeApi = require('fmp-node-api');
6
8
 
9
+ function _interopNamespace(e) {
10
+ if (e && e.__esModule) return e;
11
+ var n = Object.create(null);
12
+ if (e) {
13
+ Object.keys(e).forEach(function (k) {
14
+ if (k !== 'default') {
15
+ var d = Object.getOwnPropertyDescriptor(e, k);
16
+ Object.defineProperty(n, k, d.get ? d : {
17
+ enumerable: true,
18
+ get: function () { return e[k]; }
19
+ });
20
+ }
21
+ });
22
+ }
23
+ n.default = e;
24
+ return Object.freeze(n);
25
+ }
26
+
27
+ var fs__namespace = /*#__PURE__*/_interopNamespace(fs);
28
+ var path__namespace = /*#__PURE__*/_interopNamespace(path);
29
+
7
30
  var __require = /* @__PURE__ */ ((x) => typeof require !== "undefined" ? require : typeof Proxy !== "undefined" ? new Proxy(x, {
8
31
  get: (a, b) => (typeof require !== "undefined" ? require : a)[b]
9
32
  }) : x)(function(x) {
10
33
  if (typeof require !== "undefined") return require.apply(this, arguments);
11
34
  throw Error('Dynamic require of "' + x + '" is not supported');
12
35
  });
13
-
14
- // src/utils/version-check.ts
15
- function checkOpenAIAgentsVersion() {
36
+ var REQUIRED_VERSION = "0.1.0";
37
+ function getInstalledPackageVersion(packageName) {
16
38
  try {
17
- const { tool: tool2 } = __require("@openai/agents");
18
- tool2({
19
- name: "test",
20
- description: "test",
21
- parameters: { type: "object", properties: {} },
22
- strict: true,
23
- execute: async () => "test"
24
- });
25
- } catch (error) {
26
- const errorMessage = error instanceof Error ? error.message : String(error);
39
+ const packagePath = path__namespace.dirname(__require.resolve(packageName));
40
+ const packageJsonPath = path__namespace.join(packagePath, "..", "package.json");
41
+ if (fs__namespace.existsSync(packageJsonPath)) {
42
+ const packageJson = JSON.parse(fs__namespace.readFileSync(packageJsonPath, "utf8"));
43
+ return packageJson.version;
44
+ }
45
+ } catch (_error) {
46
+ return null;
47
+ }
48
+ return null;
49
+ }
50
+ function compareVersions(v1, v2) {
51
+ const parseVersion = (version) => {
52
+ return version.split(".").map((num) => parseInt(num, 10) || 0);
53
+ };
54
+ const v1Parts = parseVersion(v1);
55
+ const v2Parts = parseVersion(v2);
56
+ const maxLength = Math.max(v1Parts.length, v2Parts.length);
57
+ for (let i = 0; i < maxLength; i++) {
58
+ const v1Part = v1Parts[i] || 0;
59
+ const v2Part = v2Parts[i] || 0;
60
+ if (v1Part < v2Part) return -1;
61
+ if (v1Part > v2Part) return 1;
62
+ }
63
+ return 0;
64
+ }
65
+ function matchesExactVersion(installedVersion, requiredVersion) {
66
+ return compareVersions(installedVersion, requiredVersion) === 0;
67
+ }
68
+ function checkOpenAIAgentsVersion() {
69
+ const installedVersion = getInstalledPackageVersion("@openai/agents");
70
+ if (!installedVersion) {
27
71
  throw new Error(
28
- `Incompatible @openai/agents version detected. This package requires version ^0.0.17 or higher due to breaking changes in the API. Please upgrade with: npm install @openai/agents@latest
29
-
30
- Error details: ${errorMessage}`
72
+ `@openai/agents package not found. This package requires @openai/agents to be installed. Please install with: npm install @openai/agents@${REQUIRED_VERSION}`
73
+ );
74
+ }
75
+ if (!matchesExactVersion(installedVersion, REQUIRED_VERSION)) {
76
+ console.warn(
77
+ `Incompatible @openai/agents version detected. Installed version: ${installedVersion}, Required: ${REQUIRED_VERSION} This package requires exactly version ${REQUIRED_VERSION} due to API compatibility. Please install with: npm install @openai/agents@${REQUIRED_VERSION}`
31
78
  );
32
79
  }
33
80
  }
@@ -222,9 +269,9 @@ function createOpenAITool(config) {
222
269
  additionalProperties: false
223
270
  },
224
271
  strict: true,
225
- execute: async (input) => {
272
+ execute: async (args) => {
226
273
  try {
227
- const validatedInput = inputSchema.parse(input);
274
+ const validatedInput = inputSchema.parse(args);
228
275
  return await logApiExecutionWithTiming(name, validatedInput, () => execute(validatedInput));
229
276
  } catch (error) {
230
277
  if (error instanceof zod.z.ZodError) {