@quantbrasil/cli 0.1.0-beta.0 → 0.1.0-beta.10

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.
Files changed (70) hide show
  1. package/README.md +63 -11
  2. package/dist/cli/client.js +4 -0
  3. package/dist/cli/index.d.ts +12 -4
  4. package/dist/cli/index.d.ts.map +1 -1
  5. package/dist/cli/index.js +64 -14
  6. package/dist/cli/prompt.d.ts +1 -0
  7. package/dist/cli/prompt.d.ts.map +1 -1
  8. package/dist/cli/prompt.js +17 -0
  9. package/dist/cli/skills.d.ts +9 -0
  10. package/dist/cli/skills.d.ts.map +1 -1
  11. package/dist/cli/skills.js +68 -4
  12. package/dist/commands/auth.d.ts +18 -0
  13. package/dist/commands/auth.d.ts.map +1 -1
  14. package/dist/commands/auth.js +49 -0
  15. package/dist/commands/market.d.ts +1 -0
  16. package/dist/commands/market.d.ts.map +1 -1
  17. package/dist/commands/market.js +17 -1
  18. package/dist/commands/portfolios.d.ts +148 -8
  19. package/dist/commands/portfolios.d.ts.map +1 -1
  20. package/dist/commands/portfolios.js +557 -55
  21. package/dist/commands/rankings.d.ts +82 -0
  22. package/dist/commands/rankings.d.ts.map +1 -0
  23. package/dist/commands/rankings.js +235 -0
  24. package/dist/commands/screening.d.ts +120 -0
  25. package/dist/commands/screening.d.ts.map +1 -0
  26. package/dist/commands/screening.js +361 -0
  27. package/dist/commands/skills.js +7 -7
  28. package/dist/commands/update.d.ts +23 -0
  29. package/dist/commands/update.d.ts.map +1 -0
  30. package/dist/commands/update.js +209 -0
  31. package/dist/index.d.ts +3 -1
  32. package/dist/index.d.ts.map +1 -1
  33. package/dist/index.js +3 -1
  34. package/dist/vendor/core/capabilities/index.d.ts +2 -1
  35. package/dist/vendor/core/capabilities/index.d.ts.map +1 -1
  36. package/dist/vendor/core/capabilities/index.js +2 -1
  37. package/dist/vendor/core/capabilities/market.d.ts +9 -1
  38. package/dist/vendor/core/capabilities/market.d.ts.map +1 -1
  39. package/dist/vendor/core/capabilities/market.js +10 -0
  40. package/dist/vendor/core/capabilities/portfolios.d.ts +452 -56
  41. package/dist/vendor/core/capabilities/portfolios.d.ts.map +1 -1
  42. package/dist/vendor/core/capabilities/portfolios.js +434 -116
  43. package/dist/vendor/core/capabilities/rankings.d.ts +83 -0
  44. package/dist/vendor/core/capabilities/rankings.d.ts.map +1 -0
  45. package/dist/vendor/core/capabilities/rankings.js +95 -0
  46. package/dist/vendor/core/capabilities/registry.d.ts +1279 -413
  47. package/dist/vendor/core/capabilities/registry.d.ts.map +1 -1
  48. package/dist/vendor/core/capabilities/registry.js +4 -2
  49. package/dist/vendor/core/capabilities/screening.d.ts +136 -0
  50. package/dist/vendor/core/capabilities/screening.d.ts.map +1 -0
  51. package/dist/vendor/core/capabilities/screening.js +155 -0
  52. package/dist/vendor/core/capabilities/types.d.ts +1 -1
  53. package/dist/vendor/core/capabilities/types.d.ts.map +1 -1
  54. package/package.json +1 -1
  55. package/skills/quantbrasil/SKILL.md +28 -11
  56. package/skills/quantbrasil/references/cli.md +96 -20
  57. package/skills/quantbrasil/references/costs.md +9 -4
  58. package/skills/quantbrasil/references/errors.md +16 -5
  59. package/skills/quantbrasil/references/portfolios.md +114 -0
  60. package/skills/quantbrasil/references/quality-eval-queries.json +127 -0
  61. package/skills/quantbrasil/references/rankings.md +62 -0
  62. package/skills/quantbrasil/references/screening.md +212 -0
  63. package/skills/quantbrasil/references/unsupported.md +7 -2
  64. package/skills/quantbrasil/references/workflows.md +95 -23
  65. package/dist/commands/analytics.d.ts +0 -131
  66. package/dist/commands/analytics.d.ts.map +0 -1
  67. package/dist/commands/analytics.js +0 -291
  68. package/dist/vendor/core/capabilities/analytics.d.ts +0 -187
  69. package/dist/vendor/core/capabilities/analytics.d.ts.map +0 -1
  70. package/dist/vendor/core/capabilities/analytics.js +0 -214
@@ -1,187 +0,0 @@
1
- export declare const analyticsCapabilities: readonly [{
2
- readonly id: "analytics.historical-return";
3
- readonly kind: "read";
4
- readonly visibility: readonly ["cli", "opencode"];
5
- readonly description: "Calculate historical return for a saved portfolio or an ad-hoc weighted basket.";
6
- readonly http: {
7
- readonly method: "POST";
8
- readonly path: "/api/desk/tools/portfolio/historical_return";
9
- readonly inputMode: "json_body";
10
- readonly schemas: {
11
- readonly request: "PortfolioHistoricalReturnRequest";
12
- readonly response: "HistoricalReturnResponse";
13
- };
14
- };
15
- readonly cli: {
16
- readonly group: "analytics";
17
- readonly command: "historical-return";
18
- readonly summary: "Calculate historical return for a saved portfolio or repeated --asset inputs.";
19
- readonly positional: readonly [];
20
- readonly options: readonly [{
21
- readonly kind: "option";
22
- readonly flag: "--portfolio";
23
- readonly name: "portfolio_id";
24
- readonly type: "integer";
25
- readonly required: false;
26
- readonly placeholder: "ID";
27
- readonly exclusiveGroup: "source";
28
- readonly description: "Saved portfolio id. Use exactly one source: --portfolio or repeated --asset.";
29
- }, {
30
- readonly kind: "option";
31
- readonly flag: "--asset";
32
- readonly name: "assets";
33
- readonly type: "string_array";
34
- readonly required: false;
35
- readonly placeholder: "TICKER[:PESO]";
36
- readonly multiple: true;
37
- readonly collectionFormat: "repeatable";
38
- readonly exclusiveGroup: "source";
39
- readonly description: "Repeatable ad-hoc asset input using TICKER[:WEIGHT_PCT], for example PRIO3:50.";
40
- }, {
41
- readonly kind: "option";
42
- readonly flag: "--from";
43
- readonly name: "start_date";
44
- readonly type: "string";
45
- readonly required: true;
46
- readonly placeholder: "AAAA-MM-DD";
47
- readonly description: "Inclusive start date in ISO format.";
48
- }, {
49
- readonly kind: "option";
50
- readonly flag: "--to";
51
- readonly name: "end_date";
52
- readonly type: "string";
53
- readonly required: true;
54
- readonly placeholder: "AAAA-MM-DD";
55
- readonly description: "Inclusive end date in ISO format.";
56
- }];
57
- readonly examples: readonly ["quantbrasil analytics historical-return --portfolio 123 --from 2024-01-01 --to 2025-01-01", "quantbrasil analytics historical-return --asset PRIO3:50 --asset VALE3:50 --from 2021-01-01 --to 2025-01-01"];
58
- };
59
- readonly tool: {
60
- readonly name: "qb_historical_return";
61
- readonly title: "Calculate historical return";
62
- };
63
- readonly outputModes: readonly ["json", "human"];
64
- }, {
65
- readonly id: "analytics.beta";
66
- readonly kind: "read";
67
- readonly visibility: readonly ["cli", "opencode"];
68
- readonly description: "Calculate portfolio beta against IBOV for a saved portfolio or an ad-hoc basket.";
69
- readonly http: {
70
- readonly method: "POST";
71
- readonly path: "/api/desk/tools/portfolio/beta";
72
- readonly inputMode: "json_body";
73
- readonly schemas: {
74
- readonly request: "PortfolioBetaRequest";
75
- readonly response: "PortfolioBetaResponse";
76
- };
77
- };
78
- readonly cli: {
79
- readonly group: "analytics";
80
- readonly command: "beta";
81
- readonly summary: "Calculate portfolio beta against IBOV.";
82
- readonly positional: readonly [];
83
- readonly options: readonly [{
84
- readonly kind: "option";
85
- readonly flag: "--portfolio";
86
- readonly name: "portfolio_id";
87
- readonly type: "integer";
88
- readonly required: false;
89
- readonly placeholder: "ID";
90
- readonly exclusiveGroup: "source";
91
- readonly description: "Saved portfolio id. Use exactly one source: --portfolio or repeated --asset.";
92
- }, {
93
- readonly kind: "option";
94
- readonly flag: "--asset";
95
- readonly name: "assets";
96
- readonly type: "string_array";
97
- readonly required: false;
98
- readonly placeholder: "TICKER[:PESO]";
99
- readonly multiple: true;
100
- readonly collectionFormat: "repeatable";
101
- readonly exclusiveGroup: "source";
102
- readonly description: "Repeatable ad-hoc asset input using TICKER[:WEIGHT_PCT], for example PETR4:120 or WINFUT:-20.";
103
- }, {
104
- readonly kind: "option";
105
- readonly flag: "--years";
106
- readonly name: "years";
107
- readonly type: "enum";
108
- readonly required: false;
109
- readonly placeholder: "ANOS";
110
- readonly defaultValue: 1;
111
- readonly enumValues: readonly ["1", "3", "5"];
112
- readonly description: "Historical lookback window in years. Accepted values: 1, 3, or 5.";
113
- }];
114
- readonly examples: readonly ["quantbrasil analytics beta --portfolio 123 --years 3", "quantbrasil analytics beta --asset PRIO3:120 --asset WINFUT:-20 --years 1"];
115
- };
116
- readonly tool: {
117
- readonly name: "qb_portfolio_beta";
118
- readonly title: "Calculate portfolio beta";
119
- };
120
- readonly outputModes: readonly ["json", "human"];
121
- }, {
122
- readonly id: "analytics.var";
123
- readonly kind: "read";
124
- readonly visibility: readonly ["cli", "opencode"];
125
- readonly description: "Calculate one-day Value-at-Risk for a saved portfolio or an ad-hoc basket.";
126
- readonly http: {
127
- readonly method: "POST";
128
- readonly path: "/api/desk/tools/portfolio/var";
129
- readonly inputMode: "json_body";
130
- readonly schemas: {
131
- readonly request: "PortfolioVaRRequest";
132
- readonly response: "PortfolioVaRResponse";
133
- };
134
- };
135
- readonly cli: {
136
- readonly group: "analytics";
137
- readonly command: "var";
138
- readonly summary: "Calculate one-day Value-at-Risk for a portfolio or basket.";
139
- readonly positional: readonly [];
140
- readonly options: readonly [{
141
- readonly kind: "option";
142
- readonly flag: "--portfolio";
143
- readonly name: "portfolio_id";
144
- readonly type: "integer";
145
- readonly required: false;
146
- readonly placeholder: "ID";
147
- readonly exclusiveGroup: "source";
148
- readonly description: "Saved portfolio id. Use exactly one source: --portfolio or repeated --asset.";
149
- }, {
150
- readonly kind: "option";
151
- readonly flag: "--asset";
152
- readonly name: "assets";
153
- readonly type: "string_array";
154
- readonly required: false;
155
- readonly placeholder: "TICKER[:PESO]";
156
- readonly multiple: true;
157
- readonly collectionFormat: "repeatable";
158
- readonly exclusiveGroup: "source";
159
- readonly description: "Repeatable ad-hoc asset input using TICKER[:WEIGHT_PCT], for example PRIO3:120 or WINFUT:-20.";
160
- }, {
161
- readonly kind: "option";
162
- readonly flag: "--years";
163
- readonly name: "years";
164
- readonly type: "integer";
165
- readonly required: false;
166
- readonly placeholder: "ANOS";
167
- readonly defaultValue: 1;
168
- readonly description: "Historical lookback window in years. The VaR horizon remains one day.";
169
- }, {
170
- readonly kind: "option";
171
- readonly flag: "--confidence";
172
- readonly name: "confidence_pct";
173
- readonly type: "number";
174
- readonly required: false;
175
- readonly placeholder: "PERCENTUAL";
176
- readonly defaultValue: 95;
177
- readonly description: "Confidence level in percent, for example 95 or 99.";
178
- }];
179
- readonly examples: readonly ["quantbrasil analytics var --portfolio 123 --years 1 --confidence 95", "quantbrasil analytics var --asset PRIO3:50 --asset VALE3:50 --years 3 --confidence 99"];
180
- };
181
- readonly tool: {
182
- readonly name: "qb_portfolio_var";
183
- readonly title: "Calculate portfolio VaR";
184
- };
185
- readonly outputModes: readonly ["json", "human"];
186
- }];
187
- //# sourceMappingURL=analytics.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"analytics.d.ts","sourceRoot":"","sources":["../../src/capabilities/analytics.ts"],"names":[],"mappings":"AAGA,eAAO,MAAM,qBAAqB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAgOkB,CAAC"}
@@ -1,214 +0,0 @@
1
- import { publicRuntimeVisibility, standardOutputModes } from "./shared.js";
2
- export const analyticsCapabilities = [
3
- {
4
- id: "analytics.historical-return",
5
- kind: "read",
6
- visibility: publicRuntimeVisibility,
7
- description: "Calculate historical return for a saved portfolio or an ad-hoc weighted basket.",
8
- http: {
9
- method: "POST",
10
- path: "/api/desk/tools/portfolio/historical_return",
11
- inputMode: "json_body",
12
- schemas: {
13
- request: "PortfolioHistoricalReturnRequest",
14
- response: "HistoricalReturnResponse",
15
- },
16
- },
17
- cli: {
18
- group: "analytics",
19
- command: "historical-return",
20
- summary: "Calculate historical return for a saved portfolio or repeated --asset inputs.",
21
- positional: [],
22
- options: [
23
- {
24
- kind: "option",
25
- flag: "--portfolio",
26
- name: "portfolio_id",
27
- type: "integer",
28
- required: false,
29
- placeholder: "ID",
30
- exclusiveGroup: "source",
31
- description: "Saved portfolio id. Use exactly one source: --portfolio or repeated --asset.",
32
- },
33
- {
34
- kind: "option",
35
- flag: "--asset",
36
- name: "assets",
37
- type: "string_array",
38
- required: false,
39
- placeholder: "TICKER[:PESO]",
40
- multiple: true,
41
- collectionFormat: "repeatable",
42
- exclusiveGroup: "source",
43
- description: "Repeatable ad-hoc asset input using TICKER[:WEIGHT_PCT], for example PRIO3:50.",
44
- },
45
- {
46
- kind: "option",
47
- flag: "--from",
48
- name: "start_date",
49
- type: "string",
50
- required: true,
51
- placeholder: "AAAA-MM-DD",
52
- description: "Inclusive start date in ISO format.",
53
- },
54
- {
55
- kind: "option",
56
- flag: "--to",
57
- name: "end_date",
58
- type: "string",
59
- required: true,
60
- placeholder: "AAAA-MM-DD",
61
- description: "Inclusive end date in ISO format.",
62
- },
63
- ],
64
- examples: [
65
- "quantbrasil analytics historical-return --portfolio 123 --from 2024-01-01 --to 2025-01-01",
66
- "quantbrasil analytics historical-return --asset PRIO3:50 --asset VALE3:50 --from 2021-01-01 --to 2025-01-01",
67
- ],
68
- },
69
- tool: {
70
- name: "qb_historical_return",
71
- title: "Calculate historical return",
72
- },
73
- outputModes: standardOutputModes,
74
- },
75
- {
76
- id: "analytics.beta",
77
- kind: "read",
78
- visibility: publicRuntimeVisibility,
79
- description: "Calculate portfolio beta against IBOV for a saved portfolio or an ad-hoc basket.",
80
- http: {
81
- method: "POST",
82
- path: "/api/desk/tools/portfolio/beta",
83
- inputMode: "json_body",
84
- schemas: {
85
- request: "PortfolioBetaRequest",
86
- response: "PortfolioBetaResponse",
87
- },
88
- },
89
- cli: {
90
- group: "analytics",
91
- command: "beta",
92
- summary: "Calculate portfolio beta against IBOV.",
93
- positional: [],
94
- options: [
95
- {
96
- kind: "option",
97
- flag: "--portfolio",
98
- name: "portfolio_id",
99
- type: "integer",
100
- required: false,
101
- placeholder: "ID",
102
- exclusiveGroup: "source",
103
- description: "Saved portfolio id. Use exactly one source: --portfolio or repeated --asset.",
104
- },
105
- {
106
- kind: "option",
107
- flag: "--asset",
108
- name: "assets",
109
- type: "string_array",
110
- required: false,
111
- placeholder: "TICKER[:PESO]",
112
- multiple: true,
113
- collectionFormat: "repeatable",
114
- exclusiveGroup: "source",
115
- description: "Repeatable ad-hoc asset input using TICKER[:WEIGHT_PCT], for example PETR4:120 or WINFUT:-20.",
116
- },
117
- {
118
- kind: "option",
119
- flag: "--years",
120
- name: "years",
121
- type: "enum",
122
- required: false,
123
- placeholder: "ANOS",
124
- defaultValue: 1,
125
- enumValues: ["1", "3", "5"],
126
- description: "Historical lookback window in years. Accepted values: 1, 3, or 5.",
127
- },
128
- ],
129
- examples: [
130
- "quantbrasil analytics beta --portfolio 123 --years 3",
131
- "quantbrasil analytics beta --asset PRIO3:120 --asset WINFUT:-20 --years 1",
132
- ],
133
- },
134
- tool: {
135
- name: "qb_portfolio_beta",
136
- title: "Calculate portfolio beta",
137
- },
138
- outputModes: standardOutputModes,
139
- },
140
- {
141
- id: "analytics.var",
142
- kind: "read",
143
- visibility: publicRuntimeVisibility,
144
- description: "Calculate one-day Value-at-Risk for a saved portfolio or an ad-hoc basket.",
145
- http: {
146
- method: "POST",
147
- path: "/api/desk/tools/portfolio/var",
148
- inputMode: "json_body",
149
- schemas: {
150
- request: "PortfolioVaRRequest",
151
- response: "PortfolioVaRResponse",
152
- },
153
- },
154
- cli: {
155
- group: "analytics",
156
- command: "var",
157
- summary: "Calculate one-day Value-at-Risk for a portfolio or basket.",
158
- positional: [],
159
- options: [
160
- {
161
- kind: "option",
162
- flag: "--portfolio",
163
- name: "portfolio_id",
164
- type: "integer",
165
- required: false,
166
- placeholder: "ID",
167
- exclusiveGroup: "source",
168
- description: "Saved portfolio id. Use exactly one source: --portfolio or repeated --asset.",
169
- },
170
- {
171
- kind: "option",
172
- flag: "--asset",
173
- name: "assets",
174
- type: "string_array",
175
- required: false,
176
- placeholder: "TICKER[:PESO]",
177
- multiple: true,
178
- collectionFormat: "repeatable",
179
- exclusiveGroup: "source",
180
- description: "Repeatable ad-hoc asset input using TICKER[:WEIGHT_PCT], for example PRIO3:120 or WINFUT:-20.",
181
- },
182
- {
183
- kind: "option",
184
- flag: "--years",
185
- name: "years",
186
- type: "integer",
187
- required: false,
188
- placeholder: "ANOS",
189
- defaultValue: 1,
190
- description: "Historical lookback window in years. The VaR horizon remains one day.",
191
- },
192
- {
193
- kind: "option",
194
- flag: "--confidence",
195
- name: "confidence_pct",
196
- type: "number",
197
- required: false,
198
- placeholder: "PERCENTUAL",
199
- defaultValue: 95,
200
- description: "Confidence level in percent, for example 95 or 99.",
201
- },
202
- ],
203
- examples: [
204
- "quantbrasil analytics var --portfolio 123 --years 1 --confidence 95",
205
- "quantbrasil analytics var --asset PRIO3:50 --asset VALE3:50 --years 3 --confidence 99",
206
- ],
207
- },
208
- tool: {
209
- name: "qb_portfolio_var",
210
- title: "Calculate portfolio VaR",
211
- },
212
- outputModes: standardOutputModes,
213
- },
214
- ];