@quantbrasil/cli 0.1.0-beta.5 → 0.1.0-beta.7

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.
@@ -138,6 +138,112 @@ export declare const capabilityRegistry: readonly [{
138
138
  readonly title: "Get asset overview";
139
139
  };
140
140
  readonly outputModes: readonly ["json", "human"];
141
+ }, {
142
+ readonly id: "screening.universes";
143
+ readonly kind: "read";
144
+ readonly visibility: readonly ["cli", "opencode"];
145
+ readonly description: "Lista universos salvos e baseados em portfólios disponíveis para screening de indicadores.";
146
+ readonly http: {
147
+ readonly method: "GET";
148
+ readonly path: "/api/desk/tools/screening/universes";
149
+ readonly inputMode: "none";
150
+ readonly schemas: {
151
+ readonly request: null;
152
+ readonly response: "ScreeningUniversesResponse";
153
+ };
154
+ };
155
+ readonly cli: {
156
+ readonly group: "screening";
157
+ readonly command: "universes";
158
+ readonly summary: "Lista carteiras do sistema, watchlists e carteiras disponíveis para screening.";
159
+ readonly positional: readonly [];
160
+ readonly options: readonly [];
161
+ readonly examples: readonly ["quantbrasil screening universes"];
162
+ };
163
+ readonly tool: {
164
+ readonly name: "qb_screening_universes";
165
+ readonly title: "Listar universos de screening";
166
+ };
167
+ readonly outputModes: readonly ["json", "human"];
168
+ }, {
169
+ readonly id: "screening.run";
170
+ readonly kind: "read";
171
+ readonly visibility: readonly ["cli", "opencode"];
172
+ readonly description: "Executa o screener de indicadores existente sobre um universo salvo baseado em portfólio.";
173
+ readonly http: {
174
+ readonly method: "POST";
175
+ readonly path: "/api/desk/tools/screening/run";
176
+ readonly inputMode: "json_body";
177
+ readonly schemas: {
178
+ readonly request: "ScreeningRunRequest";
179
+ readonly response: "ScreeningRunResponse";
180
+ };
181
+ };
182
+ readonly cli: {
183
+ readonly group: "screening";
184
+ readonly command: "run";
185
+ readonly summary: "Executa screening de indicadores a partir de um payload ScreenerRequest JSON.";
186
+ readonly positional: readonly [];
187
+ readonly options: readonly [{
188
+ readonly kind: "option";
189
+ readonly flag: "--system";
190
+ readonly name: "system_slug";
191
+ readonly type: "string";
192
+ readonly required: false;
193
+ readonly placeholder: "SLUG";
194
+ readonly exclusiveGroup: "screening_universe_selector";
195
+ readonly description: "Slug da carteira do sistema retornado por `screening universes`, por exemplo acoes-mais-liquidas.";
196
+ }, {
197
+ readonly kind: "option";
198
+ readonly flag: "--watchlist";
199
+ readonly name: "watchlist_id";
200
+ readonly type: "integer";
201
+ readonly required: false;
202
+ readonly placeholder: "ID";
203
+ readonly exclusiveGroup: "screening_universe_selector";
204
+ readonly description: "ID da watchlist retornado por `watchlists list`.";
205
+ }, {
206
+ readonly kind: "option";
207
+ readonly flag: "--holding";
208
+ readonly name: "holding_id";
209
+ readonly type: "integer";
210
+ readonly required: false;
211
+ readonly placeholder: "ID";
212
+ readonly exclusiveGroup: "screening_universe_selector";
213
+ readonly description: "ID da carteira retornado por `holdings list`.";
214
+ }, {
215
+ readonly kind: "option";
216
+ readonly flag: "--query-file";
217
+ readonly name: "query_file";
218
+ readonly type: "string";
219
+ readonly required: true;
220
+ readonly placeholder: "ARQUIVO|-";
221
+ readonly description: "Caminho para um arquivo ScreenerRequest JSON completo, ou `-` para ler JSON de stdin.";
222
+ }, {
223
+ readonly kind: "option";
224
+ readonly flag: "--limit";
225
+ readonly name: "limit";
226
+ readonly type: "integer";
227
+ readonly required: false;
228
+ readonly placeholder: "N";
229
+ readonly description: "Sobrescreve o limit de topo do ScreenerRequest sem alterar o arquivo da consulta.";
230
+ }, {
231
+ readonly kind: "option";
232
+ readonly flag: "--sort";
233
+ readonly name: "sort";
234
+ readonly type: "enum";
235
+ readonly required: false;
236
+ readonly placeholder: "price|ticker";
237
+ readonly enumValues: readonly ["price", "ticker"];
238
+ readonly description: "Sobrescreve o sort de topo do ScreenerRequest sem alterar o arquivo da consulta.";
239
+ }];
240
+ readonly examples: readonly ["quantbrasil screening run --system acoes-mais-liquidas --query-file ./screening.json", "quantbrasil screening run --watchlist 93 --query-file ./screening.json --limit 25", "cat screening.json | quantbrasil screening run --holding 182 --query-file - --sort ticker"];
241
+ };
242
+ readonly tool: {
243
+ readonly name: "qb_screening_run";
244
+ readonly title: "Executar screening de indicadores";
245
+ };
246
+ readonly outputModes: readonly ["json", "human"];
141
247
  }, {
142
248
  readonly id: "watchlists.list";
143
249
  readonly kind: "read";
@@ -899,6 +1005,112 @@ export declare function getCapabilityById(id: CapabilityId): {
899
1005
  readonly title: "Get asset overview";
900
1006
  };
901
1007
  readonly outputModes: readonly ["json", "human"];
1008
+ } | {
1009
+ readonly id: "screening.universes";
1010
+ readonly kind: "read";
1011
+ readonly visibility: readonly ["cli", "opencode"];
1012
+ readonly description: "Lista universos salvos e baseados em portfólios disponíveis para screening de indicadores.";
1013
+ readonly http: {
1014
+ readonly method: "GET";
1015
+ readonly path: "/api/desk/tools/screening/universes";
1016
+ readonly inputMode: "none";
1017
+ readonly schemas: {
1018
+ readonly request: null;
1019
+ readonly response: "ScreeningUniversesResponse";
1020
+ };
1021
+ };
1022
+ readonly cli: {
1023
+ readonly group: "screening";
1024
+ readonly command: "universes";
1025
+ readonly summary: "Lista carteiras do sistema, watchlists e carteiras disponíveis para screening.";
1026
+ readonly positional: readonly [];
1027
+ readonly options: readonly [];
1028
+ readonly examples: readonly ["quantbrasil screening universes"];
1029
+ };
1030
+ readonly tool: {
1031
+ readonly name: "qb_screening_universes";
1032
+ readonly title: "Listar universos de screening";
1033
+ };
1034
+ readonly outputModes: readonly ["json", "human"];
1035
+ } | {
1036
+ readonly id: "screening.run";
1037
+ readonly kind: "read";
1038
+ readonly visibility: readonly ["cli", "opencode"];
1039
+ readonly description: "Executa o screener de indicadores existente sobre um universo salvo baseado em portfólio.";
1040
+ readonly http: {
1041
+ readonly method: "POST";
1042
+ readonly path: "/api/desk/tools/screening/run";
1043
+ readonly inputMode: "json_body";
1044
+ readonly schemas: {
1045
+ readonly request: "ScreeningRunRequest";
1046
+ readonly response: "ScreeningRunResponse";
1047
+ };
1048
+ };
1049
+ readonly cli: {
1050
+ readonly group: "screening";
1051
+ readonly command: "run";
1052
+ readonly summary: "Executa screening de indicadores a partir de um payload ScreenerRequest JSON.";
1053
+ readonly positional: readonly [];
1054
+ readonly options: readonly [{
1055
+ readonly kind: "option";
1056
+ readonly flag: "--system";
1057
+ readonly name: "system_slug";
1058
+ readonly type: "string";
1059
+ readonly required: false;
1060
+ readonly placeholder: "SLUG";
1061
+ readonly exclusiveGroup: "screening_universe_selector";
1062
+ readonly description: "Slug da carteira do sistema retornado por `screening universes`, por exemplo acoes-mais-liquidas.";
1063
+ }, {
1064
+ readonly kind: "option";
1065
+ readonly flag: "--watchlist";
1066
+ readonly name: "watchlist_id";
1067
+ readonly type: "integer";
1068
+ readonly required: false;
1069
+ readonly placeholder: "ID";
1070
+ readonly exclusiveGroup: "screening_universe_selector";
1071
+ readonly description: "ID da watchlist retornado por `watchlists list`.";
1072
+ }, {
1073
+ readonly kind: "option";
1074
+ readonly flag: "--holding";
1075
+ readonly name: "holding_id";
1076
+ readonly type: "integer";
1077
+ readonly required: false;
1078
+ readonly placeholder: "ID";
1079
+ readonly exclusiveGroup: "screening_universe_selector";
1080
+ readonly description: "ID da carteira retornado por `holdings list`.";
1081
+ }, {
1082
+ readonly kind: "option";
1083
+ readonly flag: "--query-file";
1084
+ readonly name: "query_file";
1085
+ readonly type: "string";
1086
+ readonly required: true;
1087
+ readonly placeholder: "ARQUIVO|-";
1088
+ readonly description: "Caminho para um arquivo ScreenerRequest JSON completo, ou `-` para ler JSON de stdin.";
1089
+ }, {
1090
+ readonly kind: "option";
1091
+ readonly flag: "--limit";
1092
+ readonly name: "limit";
1093
+ readonly type: "integer";
1094
+ readonly required: false;
1095
+ readonly placeholder: "N";
1096
+ readonly description: "Sobrescreve o limit de topo do ScreenerRequest sem alterar o arquivo da consulta.";
1097
+ }, {
1098
+ readonly kind: "option";
1099
+ readonly flag: "--sort";
1100
+ readonly name: "sort";
1101
+ readonly type: "enum";
1102
+ readonly required: false;
1103
+ readonly placeholder: "price|ticker";
1104
+ readonly enumValues: readonly ["price", "ticker"];
1105
+ readonly description: "Sobrescreve o sort de topo do ScreenerRequest sem alterar o arquivo da consulta.";
1106
+ }];
1107
+ readonly examples: readonly ["quantbrasil screening run --system acoes-mais-liquidas --query-file ./screening.json", "quantbrasil screening run --watchlist 93 --query-file ./screening.json --limit 25", "cat screening.json | quantbrasil screening run --holding 182 --query-file - --sort ticker"];
1108
+ };
1109
+ readonly tool: {
1110
+ readonly name: "qb_screening_run";
1111
+ readonly title: "Executar screening de indicadores";
1112
+ };
1113
+ readonly outputModes: readonly ["json", "human"];
902
1114
  } | {
903
1115
  readonly id: "watchlists.list";
904
1116
  readonly kind: "read";
@@ -1 +1 @@
1
- {"version":3,"file":"registry.d.ts","sourceRoot":"","sources":["../../src/capabilities/registry.ts"],"names":[],"mappings":"AAIA,eAAO,MAAM,kBAAkB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAEjD"}
@@ -1,9 +1,11 @@
1
1
  import { assetCapabilities } from "./assets.js";
2
2
  import { marketCapabilities } from "./market.js";
3
3
  import { portfolioCapabilities } from "./portfolios.js";
4
+ import { screeningCapabilities } from "./screening.js";
4
5
  export const capabilityRegistry = [
5
6
  ...marketCapabilities,
6
7
  ...assetCapabilities,
8
+ ...screeningCapabilities,
7
9
  ...portfolioCapabilities,
8
10
  ];
9
11
  export const capabilityRegistryById = Object.fromEntries(capabilityRegistry.map(capability => [capability.id, capability]));
@@ -0,0 +1,109 @@
1
+ export declare const screeningSortValues: readonly ["price", "ticker"];
2
+ export declare const screeningCapabilities: readonly [{
3
+ readonly id: "screening.universes";
4
+ readonly kind: "read";
5
+ readonly visibility: readonly ["cli", "opencode"];
6
+ readonly description: "Lista universos salvos e baseados em portfólios disponíveis para screening de indicadores.";
7
+ readonly http: {
8
+ readonly method: "GET";
9
+ readonly path: "/api/desk/tools/screening/universes";
10
+ readonly inputMode: "none";
11
+ readonly schemas: {
12
+ readonly request: null;
13
+ readonly response: "ScreeningUniversesResponse";
14
+ };
15
+ };
16
+ readonly cli: {
17
+ readonly group: "screening";
18
+ readonly command: "universes";
19
+ readonly summary: "Lista carteiras do sistema, watchlists e carteiras disponíveis para screening.";
20
+ readonly positional: readonly [];
21
+ readonly options: readonly [];
22
+ readonly examples: readonly ["quantbrasil screening universes"];
23
+ };
24
+ readonly tool: {
25
+ readonly name: "qb_screening_universes";
26
+ readonly title: "Listar universos de screening";
27
+ };
28
+ readonly outputModes: readonly ["json", "human"];
29
+ }, {
30
+ readonly id: "screening.run";
31
+ readonly kind: "read";
32
+ readonly visibility: readonly ["cli", "opencode"];
33
+ readonly description: "Executa o screener de indicadores existente sobre um universo salvo baseado em portfólio.";
34
+ readonly http: {
35
+ readonly method: "POST";
36
+ readonly path: "/api/desk/tools/screening/run";
37
+ readonly inputMode: "json_body";
38
+ readonly schemas: {
39
+ readonly request: "ScreeningRunRequest";
40
+ readonly response: "ScreeningRunResponse";
41
+ };
42
+ };
43
+ readonly cli: {
44
+ readonly group: "screening";
45
+ readonly command: "run";
46
+ readonly summary: "Executa screening de indicadores a partir de um payload ScreenerRequest JSON.";
47
+ readonly positional: readonly [];
48
+ readonly options: readonly [{
49
+ readonly kind: "option";
50
+ readonly flag: "--system";
51
+ readonly name: "system_slug";
52
+ readonly type: "string";
53
+ readonly required: false;
54
+ readonly placeholder: "SLUG";
55
+ readonly exclusiveGroup: "screening_universe_selector";
56
+ readonly description: "Slug da carteira do sistema retornado por `screening universes`, por exemplo acoes-mais-liquidas.";
57
+ }, {
58
+ readonly kind: "option";
59
+ readonly flag: "--watchlist";
60
+ readonly name: "watchlist_id";
61
+ readonly type: "integer";
62
+ readonly required: false;
63
+ readonly placeholder: "ID";
64
+ readonly exclusiveGroup: "screening_universe_selector";
65
+ readonly description: "ID da watchlist retornado por `watchlists list`.";
66
+ }, {
67
+ readonly kind: "option";
68
+ readonly flag: "--holding";
69
+ readonly name: "holding_id";
70
+ readonly type: "integer";
71
+ readonly required: false;
72
+ readonly placeholder: "ID";
73
+ readonly exclusiveGroup: "screening_universe_selector";
74
+ readonly description: "ID da carteira retornado por `holdings list`.";
75
+ }, {
76
+ readonly kind: "option";
77
+ readonly flag: "--query-file";
78
+ readonly name: "query_file";
79
+ readonly type: "string";
80
+ readonly required: true;
81
+ readonly placeholder: "ARQUIVO|-";
82
+ readonly description: "Caminho para um arquivo ScreenerRequest JSON completo, ou `-` para ler JSON de stdin.";
83
+ }, {
84
+ readonly kind: "option";
85
+ readonly flag: "--limit";
86
+ readonly name: "limit";
87
+ readonly type: "integer";
88
+ readonly required: false;
89
+ readonly placeholder: "N";
90
+ readonly description: "Sobrescreve o limit de topo do ScreenerRequest sem alterar o arquivo da consulta.";
91
+ }, {
92
+ readonly kind: "option";
93
+ readonly flag: "--sort";
94
+ readonly name: "sort";
95
+ readonly type: "enum";
96
+ readonly required: false;
97
+ readonly placeholder: "price|ticker";
98
+ readonly enumValues: readonly ["price", "ticker"];
99
+ readonly description: "Sobrescreve o sort de topo do ScreenerRequest sem alterar o arquivo da consulta.";
100
+ }];
101
+ readonly examples: readonly ["quantbrasil screening run --system acoes-mais-liquidas --query-file ./screening.json", "quantbrasil screening run --watchlist 93 --query-file ./screening.json --limit 25", "cat screening.json | quantbrasil screening run --holding 182 --query-file - --sort ticker"];
102
+ };
103
+ readonly tool: {
104
+ readonly name: "qb_screening_run";
105
+ readonly title: "Executar screening de indicadores";
106
+ };
107
+ readonly outputModes: readonly ["json", "human"];
108
+ }];
109
+ //# sourceMappingURL=screening.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"screening.d.ts","sourceRoot":"","sources":["../../src/capabilities/screening.ts"],"names":[],"mappings":"AAKA,eAAO,MAAM,mBAAmB,8BAA+B,CAAC;AAEhE,eAAO,MAAM,qBAAqB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAgIkB,CAAC"}
@@ -0,0 +1,124 @@
1
+ import { publicRuntimeVisibility, standardOutputModes } from "./shared.js";
2
+ const screeningSelectorExclusiveGroup = "screening_universe_selector";
3
+ export const screeningSortValues = ["price", "ticker"];
4
+ export const screeningCapabilities = [
5
+ {
6
+ id: "screening.universes",
7
+ kind: "read",
8
+ visibility: publicRuntimeVisibility,
9
+ description: "Lista universos salvos e baseados em portfólios disponíveis para screening de indicadores.",
10
+ http: {
11
+ method: "GET",
12
+ path: "/api/desk/tools/screening/universes",
13
+ inputMode: "none",
14
+ schemas: {
15
+ request: null,
16
+ response: "ScreeningUniversesResponse",
17
+ },
18
+ },
19
+ cli: {
20
+ group: "screening",
21
+ command: "universes",
22
+ summary: "Lista carteiras do sistema, watchlists e carteiras disponíveis para screening.",
23
+ positional: [],
24
+ options: [],
25
+ examples: ["quantbrasil screening universes"],
26
+ },
27
+ tool: {
28
+ name: "qb_screening_universes",
29
+ title: "Listar universos de screening",
30
+ },
31
+ outputModes: standardOutputModes,
32
+ },
33
+ {
34
+ id: "screening.run",
35
+ kind: "read",
36
+ visibility: publicRuntimeVisibility,
37
+ description: "Executa o screener de indicadores existente sobre um universo salvo baseado em portfólio.",
38
+ http: {
39
+ method: "POST",
40
+ path: "/api/desk/tools/screening/run",
41
+ inputMode: "json_body",
42
+ schemas: {
43
+ request: "ScreeningRunRequest",
44
+ response: "ScreeningRunResponse",
45
+ },
46
+ },
47
+ cli: {
48
+ group: "screening",
49
+ command: "run",
50
+ summary: "Executa screening de indicadores a partir de um payload ScreenerRequest JSON.",
51
+ positional: [],
52
+ options: [
53
+ {
54
+ kind: "option",
55
+ flag: "--system",
56
+ name: "system_slug",
57
+ type: "string",
58
+ required: false,
59
+ placeholder: "SLUG",
60
+ exclusiveGroup: screeningSelectorExclusiveGroup,
61
+ description: "Slug da carteira do sistema retornado por `screening universes`, por exemplo acoes-mais-liquidas.",
62
+ },
63
+ {
64
+ kind: "option",
65
+ flag: "--watchlist",
66
+ name: "watchlist_id",
67
+ type: "integer",
68
+ required: false,
69
+ placeholder: "ID",
70
+ exclusiveGroup: screeningSelectorExclusiveGroup,
71
+ description: "ID da watchlist retornado por `watchlists list`.",
72
+ },
73
+ {
74
+ kind: "option",
75
+ flag: "--holding",
76
+ name: "holding_id",
77
+ type: "integer",
78
+ required: false,
79
+ placeholder: "ID",
80
+ exclusiveGroup: screeningSelectorExclusiveGroup,
81
+ description: "ID da carteira retornado por `holdings list`.",
82
+ },
83
+ {
84
+ kind: "option",
85
+ flag: "--query-file",
86
+ name: "query_file",
87
+ type: "string",
88
+ required: true,
89
+ placeholder: "ARQUIVO|-",
90
+ description: "Caminho para um arquivo ScreenerRequest JSON completo, ou `-` para ler JSON de stdin.",
91
+ },
92
+ {
93
+ kind: "option",
94
+ flag: "--limit",
95
+ name: "limit",
96
+ type: "integer",
97
+ required: false,
98
+ placeholder: "N",
99
+ description: "Sobrescreve o limit de topo do ScreenerRequest sem alterar o arquivo da consulta.",
100
+ },
101
+ {
102
+ kind: "option",
103
+ flag: "--sort",
104
+ name: "sort",
105
+ type: "enum",
106
+ required: false,
107
+ placeholder: "price|ticker",
108
+ enumValues: screeningSortValues,
109
+ description: "Sobrescreve o sort de topo do ScreenerRequest sem alterar o arquivo da consulta.",
110
+ },
111
+ ],
112
+ examples: [
113
+ "quantbrasil screening run --system acoes-mais-liquidas --query-file ./screening.json",
114
+ "quantbrasil screening run --watchlist 93 --query-file ./screening.json --limit 25",
115
+ "cat screening.json | quantbrasil screening run --holding 182 --query-file - --sort ticker",
116
+ ],
117
+ },
118
+ tool: {
119
+ name: "qb_screening_run",
120
+ title: "Executar screening de indicadores",
121
+ },
122
+ outputModes: standardOutputModes,
123
+ },
124
+ ];
@@ -1,6 +1,6 @@
1
1
  export type CapabilityVisibility = "cli" | "opencode";
2
2
  export type CapabilityKind = "read" | "mutation";
3
- export type CapabilityGroup = "market" | "assets" | "watchlists" | "holdings";
3
+ export type CapabilityGroup = "market" | "assets" | "screening" | "watchlists" | "holdings";
4
4
  export type CapabilityHttpMethod = "GET" | "POST";
5
5
  export type CapabilityInputMode = "none" | "query" | "json_body";
6
6
  export type CapabilityOutputMode = "json" | "human";
@@ -1 +1 @@
1
- {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/capabilities/types.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,oBAAoB,GAAG,KAAK,GAAG,UAAU,CAAC;AACtD,MAAM,MAAM,cAAc,GAAG,MAAM,GAAG,UAAU,CAAC;AACjD,MAAM,MAAM,eAAe,GAAG,QAAQ,GAAG,QAAQ,GAAG,YAAY,GAAG,UAAU,CAAC;AAC9E,MAAM,MAAM,oBAAoB,GAAG,KAA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gCACf,SAAQ,0BAA0B;IAClC,IAAI,EAAE,YAAY,CAAC;CACpB;AAED,MAAM,WAAW,4BACf,SAAQ,0BAA0B;IAClC,IAAI,EAAE,QAAQ,CAAC;IACf,IAAI,EAAE,KAAK,MAAM,EAAE,CAAC;CACrB;AAED,MAAM,MAAM,sBAAsB,GAC9B,gCAAgC,GAChC,4BAA4B,CAAC;AAEjC,wDAAwD;AACxD,MAAM,WAAW,qBAAqB;IACpC,KAAK,EAAE,eAAe,CAAC;IACvB,OAAO,EAAE,MAAM,CAAC;IAChB,OAAO,EAAE,MAAM,CAAC;IAChB,UAAU,EAAE,SAAS,gCAAgC,EAAE,CAAC;IACxD,OAAO,EAAE,SAAS,4BAA4B,EAAE,CAAC;IACjD;;;;OAIG;IACH,QAAQ,EAAE,SAAS,MAAM,EAAE,CAAC;CAC7B;AAED,uDAAuD;AACvD,MAAM,WAAW,sBAAsB;IACrC,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,EAAE,MAAM,CAAC;CACf;AAED,8EAA8E;AAC9E,MAAM,WAAW,oBAAoB;IACnC,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,cAAc,CAAC;IACrB,UAAU,EAAE,SAAS,oBAAoB,EAAE,CAAC;IAC5C,WAAW,EAAE,MAAM,CAAC;IACpB,IAAI,EAAE,sBAAsB,CAAC;IAC7B,GAAG,EAAE,qBAAqB,CAAC;IAC3B,IAAI,EAAE,sBAAsB,CAAC;IAC7B,WAAW,EAAE,SAAS,oBAAoB,EAAE,CAAC;CAC9C"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@quantbrasil/cli",
3
- "version": "0.1.0-beta.5",
3
+ "version": "0.1.0-beta.7",
4
4
  "type": "module",
5
5
  "description": "Public QuantBrasil CLI for deterministic operations",
6
6
  "repository": {
@@ -1,17 +1,18 @@
1
1
  ---
2
2
  name: quantbrasil
3
- description: Go-to QuantBrasil market and investing skill. Use for supported asset lookup, prices, asset analysis, watchlists, holdings, and risk/return metrics through the QuantBrasil CLI.
3
+ description: Use this skill when a user asks for QuantBrasil-supported market or investing data/actions through the QuantBrasil CLI, including asset lookup, prices, asset analysis, watchlists, holdings, screening, historical return, beta, and VaR, even if they do not explicitly mention QuantBrasil.
4
4
  ---
5
5
 
6
6
  # QuantBrasil CLI
7
7
 
8
- Use this skill when the user asks for market or investing data/actions that QuantBrasil supports, including asset lookup, prices, asset analysis, watchlists, holdings, and holding metrics.
8
+ Use this skill when the user asks for market or investing data/actions that QuantBrasil supports, including asset lookup, prices, asset analysis, watchlists, holdings, screening, and holding metrics.
9
9
 
10
10
  ## Routing
11
11
 
12
12
  - Use this skill even when the user does not say "QuantBrasil" if the request fits the supported market or investing surface.
13
- - For QuantBrasil-supported market, asset, watchlist, holding, or holding metric data, use the CLI before generic web or finance search.
14
- - When the request mentions portfolios, carteiras, watchlists, holdings, target weights, positions, historical return, beta, VaR, or saved compositions, load [`references/portfolios.md`](./references/portfolios.md) before choosing commands.
13
+ - Most end-user QuantBrasil requests are expected in pt-BR; Portuguese prompts about ativos, carteiras, cotações, screening, retorno, beta, VaR, watchlists, or Ibovespa should trigger this skill when they map to the supported CLI surface.
14
+ - For QuantBrasil-supported market, asset, screening, watchlist, holding, or holding metric data, use the CLI before generic web or finance search.
15
+ - When the request mentions portfolios, carteiras, watchlists, holdings, target weights, positions, historical return, beta, VaR, screening universes, or saved compositions, load [`references/portfolios.md`](./references/portfolios.md) before choosing commands.
15
16
  - Use `quantbrasil` when available on PATH.
16
17
  - If `quantbrasil` is not found, report that the CLI binary is not on PATH and ask the user to install it or fix PATH.
17
18
  - Check readiness first: `quantbrasil --status`
@@ -23,16 +24,18 @@ Use this skill when the user asks for market or investing data/actions that Quan
23
24
  - richer asset analysis: `quantbrasil assets overview <ticker> --sections ...`
24
25
  - watchlist details and changes: `quantbrasil watchlists ...`
25
26
  - holding details and historical return: `quantbrasil holdings ...`
27
+ - indicator screening over saved universes: `quantbrasil screening ...`
26
28
  - holding metrics: `quantbrasil holdings historical-return|beta|var ...`
27
29
  - Use `--json` when output will be parsed by agent or script
28
30
  - Use generic web or finance search only if the CLI is unavailable, the requested data is outside the QuantBrasil-supported surface, or the user explicitly asks for an external source.
29
31
  - Do not inspect the local repo, package source, or `~/.config/quantbrasil/config.json` for normal data queries. Use CLI status/errors instead.
30
32
 
31
- ## References
33
+ ## Reference Loading
32
34
 
33
- - Portfolio, watchlist, and holding semantics: [`references/portfolios.md`](./references/portfolios.md)
34
- - CLI surface: [`references/cli.md`](./references/cli.md)
35
- - Common workflows: [`references/workflows.md`](./references/workflows.md)
36
- - Cost-aware behavior: [`references/costs.md`](./references/costs.md)
37
- - Failure handling: [`references/errors.md`](./references/errors.md)
38
- - Unsupported / not-yet-public operations: [`references/unsupported.md`](./references/unsupported.md)
35
+ - Load [`references/workflows.md`](./references/workflows.md) when the user describes an investing task but does not name an exact command, or when a task spans discovery plus a follow-up action.
36
+ - Load [`references/cli.md`](./references/cli.md) when you need exact command syntax, flags, examples, or supported `--sections` values.
37
+ - Load [`references/portfolios.md`](./references/portfolios.md) when the request mentions portfolios, carteiras, watchlists, holdings, target weights, positions, historical return, beta, VaR, screening universes, or saved compositions.
38
+ - Load [`references/costs.md`](./references/costs.md) before chaining heavy reads, choosing between overview/screening/holding metrics, or answering cost-sensitive agent workflow questions.
39
+ - Load [`references/errors.md`](./references/errors.md) when a CLI command fails, auth/config is unclear, or the user asks how to fix a QuantBrasil CLI error.
40
+ - Load [`references/unsupported.md`](./references/unsupported.md) when the user asks for deletion, file export, ad-hoc ticker-list screening, unsupported commands, or a capability that may not be public yet.
41
+ - Use [`references/quality-eval-queries.json`](./references/quality-eval-queries.json) only when evaluating or tuning skill quality and trigger accuracy.
@@ -77,3 +77,51 @@ quantbrasil holdings var 182 --years 1 --confidence 95
77
77
  ```
78
78
 
79
79
  Use `--json` on any holding metric command when machine parsing needed.
80
+
81
+ ## Screening
82
+
83
+ ```bash
84
+ quantbrasil screening universes
85
+ quantbrasil screening run --system acoes-mais-liquidas --query-file ./screening.json
86
+ quantbrasil screening run --watchlist 93 --query-file ./screening.json --limit 25
87
+ quantbrasil screening run --holding 182 --query-file ./screening.json --sort ticker
88
+ cat ./screening.json | quantbrasil screening run --system etfs --query-file -
89
+ ```
90
+
91
+ Rules:
92
+
93
+ - use exactly one selector: `--system`, `--watchlist`, or `--holding`
94
+ - `--system` accepts a slug from `screening universes`
95
+ - `--watchlist` and `--holding` accept numeric ids
96
+ - `--query-file` must contain the full backend `ScreenerRequest` JSON shape
97
+ - `--query-file -` reads the same JSON shape from stdin
98
+ - `--limit` and `--sort` override only top-level fields from the query JSON
99
+
100
+ Example query JSON:
101
+
102
+ ```json
103
+ {
104
+ "query": {
105
+ "comparison": {
106
+ "left": {
107
+ "indicator": {
108
+ "name": "RSI",
109
+ "timeframe": "D1",
110
+ "offset": 0,
111
+ "params": {
112
+ "period": 14
113
+ }
114
+ }
115
+ },
116
+ "operator": "lt",
117
+ "right": {
118
+ "constant": {
119
+ "value": 30
120
+ }
121
+ }
122
+ }
123
+ },
124
+ "limit": 50,
125
+ "sort": "ticker"
126
+ }
127
+ ```
@@ -13,14 +13,17 @@ Current guidance uses backend qualitative classes only:
13
13
  - `market assets` is lowest-cost discovery path
14
14
  - `market price` is narrow read path
15
15
  - `assets overview` is richer and should use minimal `--sections`
16
+ - `screening universes` is a discovery path for saved screening universes
17
+ - `screening run` is a heavy read and should be targeted to one selected universe
16
18
  - holding metrics (`historical-return`, `beta`, `var`) are heaviest current public reads
17
19
 
18
20
  ## Agent rules
19
21
 
20
22
  - prefer narrow command that answers question
21
23
  - prefer `market price` over `assets overview` for quote-only requests
24
+ - run `screening universes` before `screening run` when the universe selector is not known
22
25
  - prefer one holding metric call targeted to actual question
23
- - do not chain multiple heavy holding metric calls unless user asked for them
26
+ - do not chain multiple heavy holding metric or screening calls unless user asked for them
24
27
  - use `--json` only when structured output needed
25
28
 
26
29
  ## Safe defaults