@quantbrasil/cli 0.1.0-beta.8 → 0.1.0-beta.9
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/README.md +4 -0
- package/dist/cli/index.d.ts +2 -0
- package/dist/cli/index.d.ts.map +1 -1
- package/dist/cli/index.js +8 -0
- package/dist/commands/rankings.d.ts +82 -0
- package/dist/commands/rankings.d.ts.map +1 -0
- package/dist/commands/rankings.js +202 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1 -0
- package/dist/vendor/core/capabilities/index.d.ts +1 -0
- package/dist/vendor/core/capabilities/index.d.ts.map +1 -1
- package/dist/vendor/core/capabilities/index.js +1 -0
- package/dist/vendor/core/capabilities/rankings.d.ts +83 -0
- package/dist/vendor/core/capabilities/rankings.d.ts.map +1 -0
- package/dist/vendor/core/capabilities/rankings.js +95 -0
- package/dist/vendor/core/capabilities/registry.d.ts +162 -0
- package/dist/vendor/core/capabilities/registry.d.ts.map +1 -1
- package/dist/vendor/core/capabilities/registry.js +2 -0
- package/dist/vendor/core/capabilities/types.d.ts +1 -1
- package/dist/vendor/core/capabilities/types.d.ts.map +1 -1
- package/package.json +1 -1
- package/skills/quantbrasil/SKILL.md +7 -4
- package/skills/quantbrasil/references/cli.md +21 -0
- package/skills/quantbrasil/references/rankings.md +60 -0
- package/skills/quantbrasil/references/workflows.md +23 -0
package/README.md
CHANGED
|
@@ -73,6 +73,10 @@ quantbrasil holdings historical-return 182 --from 2025-01-01 --to 2026-01-01
|
|
|
73
73
|
quantbrasil holdings historical-return 182 --period 1y
|
|
74
74
|
quantbrasil holdings beta 182 --years 3
|
|
75
75
|
quantbrasil holdings var 182 --years 1 --confidence 95
|
|
76
|
+
quantbrasil rankings list
|
|
77
|
+
quantbrasil rankings current --system momentum-90d --top 20
|
|
78
|
+
quantbrasil rankings current --system magic-formula --top 10
|
|
79
|
+
quantbrasil rankings current --user 123 --top 20
|
|
76
80
|
quantbrasil screening universes
|
|
77
81
|
quantbrasil screening indicators
|
|
78
82
|
quantbrasil screening run --system acoes-mais-liquidas --query-file ./screening.json
|
package/dist/cli/index.d.ts
CHANGED
|
@@ -3,6 +3,7 @@ import { type CapabilitiesCommandIO, runCapabilitiesCommand } from "../commands/
|
|
|
3
3
|
import { runMarketAssetsCommand, runMarketPriceCommand } from "../commands/market.js";
|
|
4
4
|
import { runInitCommand } from "../commands/init.js";
|
|
5
5
|
import { runHoldingCreateCommand, runHoldingBetaCommand, runHoldingGetCommand, runHoldingHistoricalReturnCommand, runHoldingListCommand, runHoldingRenameCommand, runHoldingSetPositionsCommand, runHoldingSetTargetsCommand, runHoldingVarCommand, runWatchlistAddAssetsCommand, runWatchlistCreateCommand, runWatchlistGetCommand, runWatchlistListCommand, runWatchlistRemoveAssetsCommand, runWatchlistRenameCommand } from "../commands/portfolios.js";
|
|
6
|
+
import { runRankingsCurrentCommand, runRankingsListCommand } from "../commands/rankings.js";
|
|
6
7
|
import { runScreeningIndicatorsCommand, runScreeningRunCommand, runScreeningUniversesCommand } from "../commands/screening.js";
|
|
7
8
|
import { runSkillsInstallCommand } from "../commands/skills.js";
|
|
8
9
|
import { runStatusCommand } from "../commands/status.js";
|
|
@@ -29,6 +30,7 @@ export { runAssetOverviewCommand } from "../commands/assets.js";
|
|
|
29
30
|
export { runCapabilitiesCommand, runStatusCommand };
|
|
30
31
|
export { runInitCommand };
|
|
31
32
|
export { runMarketAssetsCommand, runMarketPriceCommand };
|
|
33
|
+
export { runRankingsCurrentCommand, runRankingsListCommand };
|
|
32
34
|
export { runScreeningIndicatorsCommand, runScreeningRunCommand, runScreeningUniversesCommand, };
|
|
33
35
|
export { runHoldingBetaCommand, runHoldingCreateCommand, runHoldingGetCommand, runHoldingHistoricalReturnCommand, runHoldingListCommand, runHoldingRenameCommand, runHoldingSetPositionsCommand, runHoldingSetTargetsCommand, runHoldingVarCommand, runWatchlistAddAssetsCommand, runWatchlistCreateCommand, runWatchlistGetCommand, runWatchlistListCommand, runWatchlistRemoveAssetsCommand, runWatchlistRenameCommand, };
|
|
34
36
|
export { runSkillsInstallCommand };
|
package/dist/cli/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/cli/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAUpC,OAAO,EACL,KAAK,qBAAqB,EAE1B,sBAAsB,EACvB,MAAM,6BAA6B,CAAC;AACrC,OAAO,EAGL,sBAAsB,EACtB,qBAAqB,EACtB,MAAM,uBAAuB,CAAC;AAC/B,OAAO,EAGL,cAAc,EACf,MAAM,qBAAqB,CAAC;AAC7B,OAAO,EAGL,uBAAuB,EACvB,qBAAqB,EACrB,oBAAoB,EACpB,iCAAiC,EACjC,qBAAqB,EACrB,uBAAuB,EACvB,6BAA6B,EAC7B,2BAA2B,EAC3B,oBAAoB,EACpB,4BAA4B,EAC5B,yBAAyB,EACzB,sBAAsB,EACtB,uBAAuB,EACvB,+BAA+B,EAC/B,yBAAyB,EAC1B,MAAM,2BAA2B,CAAC;AACnC,OAAO,EAGL,6BAA6B,EAC7B,sBAAsB,EACtB,4BAA4B,EAC7B,MAAM,0BAA0B,CAAC;AAClC,OAAO,EAGL,uBAAuB,EACxB,MAAM,uBAAuB,CAAC;AAC/B,OAAO,EAGL,gBAAgB,EACjB,MAAM,uBAAuB,CAAC;AAC/B,OAAO,EAEL,gBAAgB,EAEhB,KAAK,mBAAmB,EACzB,MAAM,uBAAuB,CAAC;AAO/B,OAAO,EAAqB,KAAK,cAAc,EAAE,MAAM,eAAe,CAAC;AAQvE,MAAM,WAAW,iBAAiB;IAChC,EAAE,CAAC,EAAE,qBAAqB,CAAC;IAC3B,GAAG,CAAC,EAAE,MAAM,CAAC,UAAU,CAAC;IACxB,KAAK,CAAC,EAAE,OAAO,KAAK,CAAC;IACrB,MAAM,CAAC,EAAE,CAAC,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,qBAAqB,EACrB,uBAAuB,EACvB,oBAAoB,EACpB,iCAAiC,EACjC,qBAAqB,EACrB,uBAAuB,EACvB,6BAA6B,EAC7B,2BAA2B,EAC3B,oBAAoB,EACpB,4BAA4B,EAC5B,yBAAyB,EACzB,sBAAsB,EACtB,uBAAuB,EACvB,+BAA+B,EAC/B,yBAAyB,GAC1B,CAAC;AACF,OAAO,EAAE,uBAAuB,EAAE,CAAC;AACnC,OAAO,EAAE,gBAAgB,EAAE,CAAC"}
|
package/dist/cli/index.js
CHANGED
|
@@ -6,6 +6,7 @@ import { registerCapabilitiesCommand, runCapabilitiesCommand, } from "../command
|
|
|
6
6
|
import { registerMarketCommands, runMarketAssetsCommand, runMarketPriceCommand, } from "../commands/market.js";
|
|
7
7
|
import { registerInitCommand, runInitCommand, } from "../commands/init.js";
|
|
8
8
|
import { registerPortfoliosCommands, runHoldingCreateCommand, runHoldingBetaCommand, runHoldingGetCommand, runHoldingHistoricalReturnCommand, runHoldingListCommand, runHoldingRenameCommand, runHoldingSetPositionsCommand, runHoldingSetTargetsCommand, runHoldingVarCommand, runWatchlistAddAssetsCommand, runWatchlistCreateCommand, runWatchlistGetCommand, runWatchlistListCommand, runWatchlistRemoveAssetsCommand, runWatchlistRenameCommand, } from "../commands/portfolios.js";
|
|
9
|
+
import { registerRankingsCommands, runRankingsCurrentCommand, runRankingsListCommand, } from "../commands/rankings.js";
|
|
9
10
|
import { registerScreeningCommands, runScreeningIndicatorsCommand, runScreeningRunCommand, runScreeningUniversesCommand, } from "../commands/screening.js";
|
|
10
11
|
import { registerSkillsCommands, runSkillsInstallCommand, } from "../commands/skills.js";
|
|
11
12
|
import { registerStatusFlag, runStatusCommand, } from "../commands/status.js";
|
|
@@ -44,6 +45,11 @@ export function createCliProgram(options = {}) {
|
|
|
44
45
|
fetch: options.fetch,
|
|
45
46
|
now: options.now,
|
|
46
47
|
};
|
|
48
|
+
const rankingsContext = {
|
|
49
|
+
io: options.io,
|
|
50
|
+
env: options.env,
|
|
51
|
+
fetch: options.fetch,
|
|
52
|
+
};
|
|
47
53
|
const screeningContext = {
|
|
48
54
|
io: options.io,
|
|
49
55
|
env: options.env,
|
|
@@ -80,6 +86,7 @@ export function createCliProgram(options = {}) {
|
|
|
80
86
|
registerInitCommand(program, initContext);
|
|
81
87
|
registerMarketCommands(program, marketContext);
|
|
82
88
|
registerPortfoliosCommands(program, portfoliosContext);
|
|
89
|
+
registerRankingsCommands(program, rankingsContext);
|
|
83
90
|
registerScreeningCommands(program, screeningContext);
|
|
84
91
|
registerSkillsCommands(program, skillsContext);
|
|
85
92
|
registerUpdateCommand(program, updateContext);
|
|
@@ -148,6 +155,7 @@ export { runAssetOverviewCommand } from "../commands/assets.js";
|
|
|
148
155
|
export { runCapabilitiesCommand, runStatusCommand };
|
|
149
156
|
export { runInitCommand };
|
|
150
157
|
export { runMarketAssetsCommand, runMarketPriceCommand };
|
|
158
|
+
export { runRankingsCurrentCommand, runRankingsListCommand };
|
|
151
159
|
export { runScreeningIndicatorsCommand, runScreeningRunCommand, runScreeningUniversesCommand, };
|
|
152
160
|
export { runHoldingBetaCommand, runHoldingCreateCommand, runHoldingGetCommand, runHoldingHistoricalReturnCommand, runHoldingListCommand, runHoldingRenameCommand, runHoldingSetPositionsCommand, runHoldingSetTargetsCommand, runHoldingVarCommand, runWatchlistAddAssetsCommand, runWatchlistCreateCommand, runWatchlistGetCommand, runWatchlistListCommand, runWatchlistRemoveAssetsCommand, runWatchlistRenameCommand, };
|
|
153
161
|
export { runSkillsInstallCommand };
|
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
import { Command } from "commander";
|
|
2
|
+
import type { JsonValue } from "../vendor/core/index.js";
|
|
3
|
+
import { type CliInvokeContext } from "../cli/client.js";
|
|
4
|
+
import { type TerminalWriter } from "../cli/terminal.js";
|
|
5
|
+
export interface RankingsCommandIO {
|
|
6
|
+
stdout: TerminalWriter;
|
|
7
|
+
}
|
|
8
|
+
export interface RankingsListCommandOptions {
|
|
9
|
+
json?: boolean;
|
|
10
|
+
}
|
|
11
|
+
export interface RankingsCurrentCommandOptions {
|
|
12
|
+
system?: string;
|
|
13
|
+
user?: string;
|
|
14
|
+
top?: string;
|
|
15
|
+
json?: boolean;
|
|
16
|
+
}
|
|
17
|
+
export interface RankingMetricOut {
|
|
18
|
+
[key: string]: JsonValue;
|
|
19
|
+
key: string;
|
|
20
|
+
label: string;
|
|
21
|
+
direction: "asc" | "desc";
|
|
22
|
+
unit: string | null;
|
|
23
|
+
}
|
|
24
|
+
export interface RankingDefinitionOut {
|
|
25
|
+
[key: string]: JsonValue;
|
|
26
|
+
id: string;
|
|
27
|
+
name: string;
|
|
28
|
+
kind: "SYSTEM" | "USER";
|
|
29
|
+
description: string | null;
|
|
30
|
+
order_metric: RankingMetricOut;
|
|
31
|
+
metrics: RankingMetricOut[];
|
|
32
|
+
latest_as_of: string | null;
|
|
33
|
+
total_assets: number | null;
|
|
34
|
+
}
|
|
35
|
+
export interface RankingsListResponse {
|
|
36
|
+
[key: string]: JsonValue;
|
|
37
|
+
ok: boolean;
|
|
38
|
+
system: RankingDefinitionOut[];
|
|
39
|
+
user: RankingDefinitionOut[];
|
|
40
|
+
total: number;
|
|
41
|
+
}
|
|
42
|
+
export interface RankingMetricValueOut {
|
|
43
|
+
[key: string]: JsonValue;
|
|
44
|
+
key: string;
|
|
45
|
+
label: string;
|
|
46
|
+
value: string | number | boolean | null;
|
|
47
|
+
unit: string | null;
|
|
48
|
+
direction: "asc" | "desc";
|
|
49
|
+
}
|
|
50
|
+
export interface RankingCurrentRowOut {
|
|
51
|
+
[key: string]: JsonValue;
|
|
52
|
+
rank: number;
|
|
53
|
+
ticker: string;
|
|
54
|
+
name: string | null;
|
|
55
|
+
order_metric: RankingMetricValueOut;
|
|
56
|
+
score: number | null;
|
|
57
|
+
metrics: Record<string, string | number | boolean | null>;
|
|
58
|
+
}
|
|
59
|
+
export interface RankingCurrentResponse {
|
|
60
|
+
[key: string]: JsonValue;
|
|
61
|
+
ok: boolean;
|
|
62
|
+
summary_markdown: string;
|
|
63
|
+
ranking: RankingDefinitionOut;
|
|
64
|
+
as_of: string | null;
|
|
65
|
+
top_n: number;
|
|
66
|
+
count: number;
|
|
67
|
+
rows: RankingCurrentRowOut[];
|
|
68
|
+
}
|
|
69
|
+
export interface RankingsCommandContext extends CliInvokeContext {
|
|
70
|
+
io?: RankingsCommandIO;
|
|
71
|
+
}
|
|
72
|
+
type JsonRecord = {
|
|
73
|
+
[key: string]: JsonValue;
|
|
74
|
+
};
|
|
75
|
+
export declare function registerRankingsCommands(program: Command, context?: RankingsCommandContext): void;
|
|
76
|
+
export declare function runRankingsListCommand(options: RankingsListCommandOptions, context?: RankingsCommandContext): Promise<void>;
|
|
77
|
+
export declare function runRankingsCurrentCommand(options: RankingsCurrentCommandOptions, context?: RankingsCommandContext): Promise<void>;
|
|
78
|
+
export declare function buildRankingsCurrentInput(options: RankingsCurrentCommandOptions): JsonRecord;
|
|
79
|
+
export declare function formatRankingsListHuman(data: RankingsListResponse, theme?: import("../cli/terminal.js").TerminalTheme): string;
|
|
80
|
+
export declare function formatRankingCurrentHuman(data: RankingCurrentResponse, theme?: import("../cli/terminal.js").TerminalTheme): string;
|
|
81
|
+
export {};
|
|
82
|
+
//# sourceMappingURL=rankings.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"rankings.d.ts","sourceRoot":"","sources":["../../src/commands/rankings.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACpC,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,YAAY,CAAC;AAC5C,OAAO,EAAuB,KAAK,gBAAgB,EAAE,MAAM,kBAAkB,CAAC;AAE9E,OAAO,EAAuB,KAAK,cAAc,EAAE,MAAM,oBAAoB,CAAC;AAE9E,MAAM,WAAW,iBAAiB;IAChC,MAAM,EAAE,cAAc,CAAC;CACxB;AAED,MAAM,WAAW,0BAA0B;IACzC,IAAI,CA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,CAgBf;AAED,wBAAgB,yBAAyB,CACvC,OAAO,EAAE,6BAA6B,GACrC,UAAU,CAuBZ;AAED,wBAAgB,uBAAuB,CACrC,IAAI,EAAE,oBAAoB,EAC1B,KAAK,6CAAsC,GAC1C,MAAM,CAaR;AAED,wBAAgB,yBAAyB,CACvC,IAAI,EAAE,sBAAsB,EAC5B,KAAK,6CAAsC,GAC1C,MAAM,CAyBR"}
|
|
@@ -0,0 +1,202 @@
|
|
|
1
|
+
import { invokeCliCapability } from "../cli/client.js";
|
|
2
|
+
import { createCliValidationError } from "../cli/errors.js";
|
|
3
|
+
import { createTerminalTheme } from "../cli/terminal.js";
|
|
4
|
+
export function registerRankingsCommands(program, context = {}) {
|
|
5
|
+
const rankingsCommand = program
|
|
6
|
+
.command("rankings")
|
|
7
|
+
.description("Consulta rankings do sistema e rankings do usuário");
|
|
8
|
+
rankingsCommand
|
|
9
|
+
.command("list")
|
|
10
|
+
.description("Lista rankings disponíveis")
|
|
11
|
+
.option("--json", "Exibe saída JSON")
|
|
12
|
+
.action(async (options) => {
|
|
13
|
+
await runRankingsListCommand(options, context);
|
|
14
|
+
});
|
|
15
|
+
rankingsCommand
|
|
16
|
+
.command("current")
|
|
17
|
+
.description("Consulta o topo atual de um ranking")
|
|
18
|
+
.option("--system <id>", "ID do ranking do sistema")
|
|
19
|
+
.option("--user <id>", "ID do ranking do usuário")
|
|
20
|
+
.option("--top <n>", "Número de ativos do topo do ranking", "20")
|
|
21
|
+
.option("--json", "Exibe saída JSON")
|
|
22
|
+
.action(async (options) => {
|
|
23
|
+
await runRankingsCurrentCommand(options, context);
|
|
24
|
+
});
|
|
25
|
+
}
|
|
26
|
+
export async function runRankingsListCommand(options, context = {}) {
|
|
27
|
+
const stdout = context.io?.stdout ?? process.stdout;
|
|
28
|
+
const theme = createTerminalTheme(stdout, context.env ?? process.env);
|
|
29
|
+
const response = await invokeCliCapability({
|
|
30
|
+
capability: "rankings.list",
|
|
31
|
+
env: context.env,
|
|
32
|
+
fetch: context.fetch,
|
|
33
|
+
});
|
|
34
|
+
if (options.json) {
|
|
35
|
+
stdout.write(`${JSON.stringify(response.data, null, 2)}\n`);
|
|
36
|
+
return;
|
|
37
|
+
}
|
|
38
|
+
stdout.write(`${formatRankingsListHuman(response.data, theme)}\n`);
|
|
39
|
+
}
|
|
40
|
+
export async function runRankingsCurrentCommand(options, context = {}) {
|
|
41
|
+
const stdout = context.io?.stdout ?? process.stdout;
|
|
42
|
+
const theme = createTerminalTheme(stdout, context.env ?? process.env);
|
|
43
|
+
const response = await invokeCliCapability({
|
|
44
|
+
capability: "rankings.current",
|
|
45
|
+
input: buildRankingsCurrentInput(options),
|
|
46
|
+
env: context.env,
|
|
47
|
+
fetch: context.fetch,
|
|
48
|
+
});
|
|
49
|
+
if (options.json) {
|
|
50
|
+
stdout.write(`${JSON.stringify(response.data, null, 2)}\n`);
|
|
51
|
+
return;
|
|
52
|
+
}
|
|
53
|
+
stdout.write(`${formatRankingCurrentHuman(response.data, theme)}\n`);
|
|
54
|
+
}
|
|
55
|
+
export function buildRankingsCurrentInput(options) {
|
|
56
|
+
const hasSystem = options.system !== undefined;
|
|
57
|
+
const hasUser = options.user !== undefined;
|
|
58
|
+
if (Number(hasSystem) + Number(hasUser) !== 1) {
|
|
59
|
+
throw createCliValidationError("Use exatamente um seletor: --system ou --user.");
|
|
60
|
+
}
|
|
61
|
+
const input = {
|
|
62
|
+
top_n: parseTopOption(options.top),
|
|
63
|
+
};
|
|
64
|
+
if (hasSystem) {
|
|
65
|
+
input.system_id = normalizeRequiredString(options.system, "--system");
|
|
66
|
+
}
|
|
67
|
+
if (hasUser) {
|
|
68
|
+
input.user_ranking_id = parsePositiveInteger(options.user, "--user");
|
|
69
|
+
}
|
|
70
|
+
return input;
|
|
71
|
+
}
|
|
72
|
+
export function formatRankingsListHuman(data, theme = createTerminalTheme(process.stdout)) {
|
|
73
|
+
const lines = [
|
|
74
|
+
theme.label("Rankings"),
|
|
75
|
+
"",
|
|
76
|
+
`${theme.label("Total:")} ${formatInteger(data.total)}`,
|
|
77
|
+
];
|
|
78
|
+
lines.push("");
|
|
79
|
+
lines.push(...formatRankingGroup("Sistema", data.system, theme));
|
|
80
|
+
lines.push("");
|
|
81
|
+
lines.push(...formatRankingGroup("Meus rankings", data.user, theme));
|
|
82
|
+
return lines.join("\n");
|
|
83
|
+
}
|
|
84
|
+
export function formatRankingCurrentHuman(data, theme = createTerminalTheme(process.stdout)) {
|
|
85
|
+
const lines = [
|
|
86
|
+
theme.label("Ranking atual"),
|
|
87
|
+
"",
|
|
88
|
+
`${theme.bold(data.ranking.name)} ${theme.dim(`(${formatRankingKind(data.ranking.kind)})`)}`,
|
|
89
|
+
`${theme.label("ID:")} ${data.ranking.id}`,
|
|
90
|
+
`${theme.label("Métrica:")} ${formatMetricDefinition(data.ranking.order_metric)}`,
|
|
91
|
+
`${theme.label("Top:")} ${formatInteger(data.top_n)}`,
|
|
92
|
+
`${theme.label("Ativos retornados:")} ${formatInteger(data.count)}`,
|
|
93
|
+
];
|
|
94
|
+
if (data.as_of) {
|
|
95
|
+
lines.push(`${theme.label("Data:")} ${data.as_of}`);
|
|
96
|
+
}
|
|
97
|
+
if (data.rows.length === 0) {
|
|
98
|
+
lines.push("");
|
|
99
|
+
lines.push(theme.dim("Nenhum ativo retornado."));
|
|
100
|
+
return lines.join("\n");
|
|
101
|
+
}
|
|
102
|
+
lines.push("");
|
|
103
|
+
lines.push(...formatRankingRows(data.rows, data.ranking.order_metric.label));
|
|
104
|
+
return lines.join("\n");
|
|
105
|
+
}
|
|
106
|
+
function formatRankingGroup(title, rankings, theme) {
|
|
107
|
+
const lines = [
|
|
108
|
+
`${theme.label(title)} ${theme.dim(`(${formatInteger(rankings.length)})`)}`,
|
|
109
|
+
];
|
|
110
|
+
if (rankings.length === 0) {
|
|
111
|
+
lines.push(` ${theme.dim("Nenhum ranking disponível.")}`);
|
|
112
|
+
return lines;
|
|
113
|
+
}
|
|
114
|
+
for (const ranking of rankings) {
|
|
115
|
+
lines.push(` ${theme.bold(ranking.id)} - ${ranking.name}`);
|
|
116
|
+
lines.push(` ${theme.label("Métrica:")} ${formatMetricDefinition(ranking.order_metric)}`);
|
|
117
|
+
if (ranking.latest_as_of) {
|
|
118
|
+
lines.push(` ${theme.label("Atualizado em:")} ${ranking.latest_as_of}`);
|
|
119
|
+
}
|
|
120
|
+
if (ranking.total_assets !== null) {
|
|
121
|
+
lines.push(` ${theme.label("Ativos:")} ${formatInteger(ranking.total_assets)}`);
|
|
122
|
+
}
|
|
123
|
+
lines.push(` ${theme.label("Uso:")} ${formatRankingUsage(ranking)}`);
|
|
124
|
+
}
|
|
125
|
+
return lines;
|
|
126
|
+
}
|
|
127
|
+
function formatRankingRows(rows, metricLabel) {
|
|
128
|
+
const metricHeader = truncate(metricLabel, 26);
|
|
129
|
+
const header = `${"#".padEnd(4)}${"Ativo".padEnd(12)}${metricHeader}`;
|
|
130
|
+
const divider = "-".repeat(header.length);
|
|
131
|
+
const lines = [header, divider];
|
|
132
|
+
for (const row of rows) {
|
|
133
|
+
lines.push(`${formatInteger(row.rank).padEnd(4)}${row.ticker.padEnd(12)}${formatMetricValue(row.order_metric)}`);
|
|
134
|
+
}
|
|
135
|
+
return lines;
|
|
136
|
+
}
|
|
137
|
+
function formatRankingUsage(ranking) {
|
|
138
|
+
if (ranking.kind === "USER") {
|
|
139
|
+
const id = ranking.id.startsWith("user:")
|
|
140
|
+
? ranking.id.slice("user:".length)
|
|
141
|
+
: ranking.id;
|
|
142
|
+
return `quantbrasil rankings current --user ${id} --top 20`;
|
|
143
|
+
}
|
|
144
|
+
return `quantbrasil rankings current --system ${ranking.id} --top 20`;
|
|
145
|
+
}
|
|
146
|
+
function formatRankingKind(kind) {
|
|
147
|
+
return kind === "SYSTEM" ? "sistema" : "usuário";
|
|
148
|
+
}
|
|
149
|
+
function formatMetricDefinition(metric) {
|
|
150
|
+
return `${metric.label} (${metric.direction})`;
|
|
151
|
+
}
|
|
152
|
+
function formatMetricValue(metric) {
|
|
153
|
+
if (metric.value === null) {
|
|
154
|
+
return "-";
|
|
155
|
+
}
|
|
156
|
+
if (typeof metric.value === "number") {
|
|
157
|
+
if (metric.unit === "ratio") {
|
|
158
|
+
return `${formatNumber(metric.value * 100)}%`;
|
|
159
|
+
}
|
|
160
|
+
return formatNumber(metric.value);
|
|
161
|
+
}
|
|
162
|
+
return String(metric.value);
|
|
163
|
+
}
|
|
164
|
+
function parseTopOption(rawTop) {
|
|
165
|
+
if (rawTop === undefined) {
|
|
166
|
+
return 20;
|
|
167
|
+
}
|
|
168
|
+
return parsePositiveInteger(rawTop, "--top");
|
|
169
|
+
}
|
|
170
|
+
function parsePositiveInteger(rawValue, label) {
|
|
171
|
+
const normalized = normalizeRequiredString(rawValue, label);
|
|
172
|
+
const parsed = Number.parseInt(normalized, 10);
|
|
173
|
+
if (!Number.isInteger(parsed) ||
|
|
174
|
+
parsed <= 0 ||
|
|
175
|
+
String(parsed) !== normalized) {
|
|
176
|
+
throw createCliValidationError(`${label} deve ser um inteiro positivo.`);
|
|
177
|
+
}
|
|
178
|
+
return parsed;
|
|
179
|
+
}
|
|
180
|
+
function normalizeRequiredString(rawValue, label) {
|
|
181
|
+
const normalized = rawValue?.trim();
|
|
182
|
+
if (!normalized) {
|
|
183
|
+
throw createCliValidationError(`${label} não pode ser vazio.`);
|
|
184
|
+
}
|
|
185
|
+
return normalized;
|
|
186
|
+
}
|
|
187
|
+
function formatInteger(value) {
|
|
188
|
+
return new Intl.NumberFormat("pt-BR", {
|
|
189
|
+
maximumFractionDigits: 0,
|
|
190
|
+
}).format(value);
|
|
191
|
+
}
|
|
192
|
+
function formatNumber(value) {
|
|
193
|
+
return new Intl.NumberFormat("pt-BR", {
|
|
194
|
+
maximumFractionDigits: 4,
|
|
195
|
+
}).format(value);
|
|
196
|
+
}
|
|
197
|
+
function truncate(value, maxLength) {
|
|
198
|
+
if (value.length <= maxLength) {
|
|
199
|
+
return value;
|
|
200
|
+
}
|
|
201
|
+
return `${value.slice(0, maxLength - 3)}...`;
|
|
202
|
+
}
|
package/dist/index.d.ts
CHANGED
|
@@ -8,6 +8,7 @@ export * from "./commands/capabilities.js";
|
|
|
8
8
|
export * from "./commands/init.js";
|
|
9
9
|
export * from "./commands/market.js";
|
|
10
10
|
export * from "./commands/portfolios.js";
|
|
11
|
+
export * from "./commands/rankings.js";
|
|
11
12
|
export * from "./commands/screening.js";
|
|
12
13
|
export * from "./commands/skills.js";
|
|
13
14
|
export * from "./commands/status.js";
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,eAAe,CAAC;AAC9B,cAAc,iBAAiB,CAAC;AAChC,cAAc,iBAAiB,CAAC;AAChC,cAAc,gBAAgB,CAAC;AAC/B,cAAc,sBAAsB,CAAC;AACrC,cAAc,oBAAoB,CAAC;AACnC,cAAc,4BAA4B,CAAC;AAC3C,cAAc,oBAAoB,CAAC;AACnC,cAAc,sBAAsB,CAAC;AACrC,cAAc,0BAA0B,CAAC;AACzC,cAAc,yBAAyB,CAAC;AACxC,cAAc,sBAAsB,CAAC;AACrC,cAAc,sBAAsB,CAAC;AACrC,cAAc,sBAAsB,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,eAAe,CAAC;AAC9B,cAAc,iBAAiB,CAAC;AAChC,cAAc,iBAAiB,CAAC;AAChC,cAAc,gBAAgB,CAAC;AAC/B,cAAc,sBAAsB,CAAC;AACrC,cAAc,oBAAoB,CAAC;AACnC,cAAc,4BAA4B,CAAC;AAC3C,cAAc,oBAAoB,CAAC;AACnC,cAAc,sBAAsB,CAAC;AACrC,cAAc,0BAA0B,CAAC;AACzC,cAAc,wBAAwB,CAAC;AACvC,cAAc,yBAAyB,CAAC;AACxC,cAAc,sBAAsB,CAAC;AACrC,cAAc,sBAAsB,CAAC;AACrC,cAAc,sBAAsB,CAAC"}
|
package/dist/index.js
CHANGED
|
@@ -8,6 +8,7 @@ export * from "./commands/capabilities.js";
|
|
|
8
8
|
export * from "./commands/init.js";
|
|
9
9
|
export * from "./commands/market.js";
|
|
10
10
|
export * from "./commands/portfolios.js";
|
|
11
|
+
export * from "./commands/rankings.js";
|
|
11
12
|
export * from "./commands/screening.js";
|
|
12
13
|
export * from "./commands/skills.js";
|
|
13
14
|
export * from "./commands/status.js";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/capabilities/index.ts"],"names":[],"mappings":"AAAA,cAAc,YAAY,CAAC;AAC3B,cAAc,aAAa,CAAC;AAC5B,cAAc,aAAa,CAAC;AAC5B,cAAc,aAAa,CAAC;AAC5B,cAAc,gBAAgB,CAAC;AAC/B,cAAc,iBAAiB,CAAC;AAChC,cAAc,eAAe,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/capabilities/index.ts"],"names":[],"mappings":"AAAA,cAAc,YAAY,CAAC;AAC3B,cAAc,aAAa,CAAC;AAC5B,cAAc,aAAa,CAAC;AAC5B,cAAc,aAAa,CAAC;AAC5B,cAAc,eAAe,CAAC;AAC9B,cAAc,gBAAgB,CAAC;AAC/B,cAAc,iBAAiB,CAAC;AAChC,cAAc,eAAe,CAAC"}
|
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
export declare const rankingsCapabilities: readonly [{
|
|
2
|
+
readonly id: "rankings.list";
|
|
3
|
+
readonly kind: "read";
|
|
4
|
+
readonly visibility: readonly ["cli", "opencode"];
|
|
5
|
+
readonly description: "Lista rankings do sistema e rankings do usuário disponíveis para consulta atual.";
|
|
6
|
+
readonly http: {
|
|
7
|
+
readonly method: "GET";
|
|
8
|
+
readonly path: "/api/desk/tools/rankings/list";
|
|
9
|
+
readonly inputMode: "none";
|
|
10
|
+
readonly schemas: {
|
|
11
|
+
readonly request: null;
|
|
12
|
+
readonly response: "RankingsListResponse";
|
|
13
|
+
};
|
|
14
|
+
};
|
|
15
|
+
readonly cli: {
|
|
16
|
+
readonly group: "rankings";
|
|
17
|
+
readonly command: "list";
|
|
18
|
+
readonly summary: "Lista rankings do sistema e rankings do usuário.";
|
|
19
|
+
readonly positional: readonly [];
|
|
20
|
+
readonly options: readonly [];
|
|
21
|
+
readonly examples: readonly ["quantbrasil rankings list"];
|
|
22
|
+
};
|
|
23
|
+
readonly tool: {
|
|
24
|
+
readonly name: "qb_rankings_list";
|
|
25
|
+
readonly title: "Listar rankings";
|
|
26
|
+
};
|
|
27
|
+
readonly outputModes: readonly ["json", "human"];
|
|
28
|
+
}, {
|
|
29
|
+
readonly id: "rankings.current";
|
|
30
|
+
readonly kind: "read";
|
|
31
|
+
readonly visibility: readonly ["cli", "opencode"];
|
|
32
|
+
readonly description: "Retorna os ativos atuais no topo de um ranking do sistema ou ranking do usuário.";
|
|
33
|
+
readonly http: {
|
|
34
|
+
readonly method: "POST";
|
|
35
|
+
readonly path: "/api/desk/tools/rankings/current";
|
|
36
|
+
readonly inputMode: "json_body";
|
|
37
|
+
readonly schemas: {
|
|
38
|
+
readonly request: "RankingCurrentRequest";
|
|
39
|
+
readonly response: "RankingCurrentResponse";
|
|
40
|
+
};
|
|
41
|
+
};
|
|
42
|
+
readonly cli: {
|
|
43
|
+
readonly group: "rankings";
|
|
44
|
+
readonly command: "current";
|
|
45
|
+
readonly summary: "Consulta o topo atual de um ranking.";
|
|
46
|
+
readonly positional: readonly [];
|
|
47
|
+
readonly options: readonly [{
|
|
48
|
+
readonly kind: "option";
|
|
49
|
+
readonly flag: "--system";
|
|
50
|
+
readonly name: "system_id";
|
|
51
|
+
readonly type: "string";
|
|
52
|
+
readonly required: false;
|
|
53
|
+
readonly placeholder: "ID";
|
|
54
|
+
readonly exclusiveGroup: "ranking_selector";
|
|
55
|
+
readonly description: "ID de ranking do sistema retornado por `rankings list`, por exemplo momentum-90d.";
|
|
56
|
+
}, {
|
|
57
|
+
readonly kind: "option";
|
|
58
|
+
readonly flag: "--user";
|
|
59
|
+
readonly name: "user_ranking_id";
|
|
60
|
+
readonly type: "integer";
|
|
61
|
+
readonly required: false;
|
|
62
|
+
readonly placeholder: "ID";
|
|
63
|
+
readonly exclusiveGroup: "ranking_selector";
|
|
64
|
+
readonly description: "ID numérico de ranking do usuário retornado por `rankings list`.";
|
|
65
|
+
}, {
|
|
66
|
+
readonly kind: "option";
|
|
67
|
+
readonly flag: "--top";
|
|
68
|
+
readonly name: "top_n";
|
|
69
|
+
readonly type: "integer";
|
|
70
|
+
readonly required: false;
|
|
71
|
+
readonly placeholder: "N";
|
|
72
|
+
readonly defaultValue: 20;
|
|
73
|
+
readonly description: "Número de ativos do topo do ranking a retornar.";
|
|
74
|
+
}];
|
|
75
|
+
readonly examples: readonly ["quantbrasil rankings current --system momentum-90d --top 20", "quantbrasil rankings current --system magic-formula --top 10", "quantbrasil rankings current --user 123 --top 20"];
|
|
76
|
+
};
|
|
77
|
+
readonly tool: {
|
|
78
|
+
readonly name: "qb_rankings_current";
|
|
79
|
+
readonly title: "Consultar ranking atual";
|
|
80
|
+
};
|
|
81
|
+
readonly outputModes: readonly ["json", "human"];
|
|
82
|
+
}];
|
|
83
|
+
//# sourceMappingURL=rankings.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"rankings.d.ts","sourceRoot":"","sources":["../../src/capabilities/rankings.ts"],"names":[],"mappings":"AAKA,eAAO,MAAM,oBAAoB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAgGmB,CAAC"}
|
|
@@ -0,0 +1,95 @@
|
|
|
1
|
+
import { publicRuntimeVisibility, standardOutputModes } from "./shared.js";
|
|
2
|
+
const rankingSelectorExclusiveGroup = "ranking_selector";
|
|
3
|
+
export const rankingsCapabilities = [
|
|
4
|
+
{
|
|
5
|
+
id: "rankings.list",
|
|
6
|
+
kind: "read",
|
|
7
|
+
visibility: publicRuntimeVisibility,
|
|
8
|
+
description: "Lista rankings do sistema e rankings do usuário disponíveis para consulta atual.",
|
|
9
|
+
http: {
|
|
10
|
+
method: "GET",
|
|
11
|
+
path: "/api/desk/tools/rankings/list",
|
|
12
|
+
inputMode: "none",
|
|
13
|
+
schemas: {
|
|
14
|
+
request: null,
|
|
15
|
+
response: "RankingsListResponse",
|
|
16
|
+
},
|
|
17
|
+
},
|
|
18
|
+
cli: {
|
|
19
|
+
group: "rankings",
|
|
20
|
+
command: "list",
|
|
21
|
+
summary: "Lista rankings do sistema e rankings do usuário.",
|
|
22
|
+
positional: [],
|
|
23
|
+
options: [],
|
|
24
|
+
examples: ["quantbrasil rankings list"],
|
|
25
|
+
},
|
|
26
|
+
tool: {
|
|
27
|
+
name: "qb_rankings_list",
|
|
28
|
+
title: "Listar rankings",
|
|
29
|
+
},
|
|
30
|
+
outputModes: standardOutputModes,
|
|
31
|
+
},
|
|
32
|
+
{
|
|
33
|
+
id: "rankings.current",
|
|
34
|
+
kind: "read",
|
|
35
|
+
visibility: publicRuntimeVisibility,
|
|
36
|
+
description: "Retorna os ativos atuais no topo de um ranking do sistema ou ranking do usuário.",
|
|
37
|
+
http: {
|
|
38
|
+
method: "POST",
|
|
39
|
+
path: "/api/desk/tools/rankings/current",
|
|
40
|
+
inputMode: "json_body",
|
|
41
|
+
schemas: {
|
|
42
|
+
request: "RankingCurrentRequest",
|
|
43
|
+
response: "RankingCurrentResponse",
|
|
44
|
+
},
|
|
45
|
+
},
|
|
46
|
+
cli: {
|
|
47
|
+
group: "rankings",
|
|
48
|
+
command: "current",
|
|
49
|
+
summary: "Consulta o topo atual de um ranking.",
|
|
50
|
+
positional: [],
|
|
51
|
+
options: [
|
|
52
|
+
{
|
|
53
|
+
kind: "option",
|
|
54
|
+
flag: "--system",
|
|
55
|
+
name: "system_id",
|
|
56
|
+
type: "string",
|
|
57
|
+
required: false,
|
|
58
|
+
placeholder: "ID",
|
|
59
|
+
exclusiveGroup: rankingSelectorExclusiveGroup,
|
|
60
|
+
description: "ID de ranking do sistema retornado por `rankings list`, por exemplo momentum-90d.",
|
|
61
|
+
},
|
|
62
|
+
{
|
|
63
|
+
kind: "option",
|
|
64
|
+
flag: "--user",
|
|
65
|
+
name: "user_ranking_id",
|
|
66
|
+
type: "integer",
|
|
67
|
+
required: false,
|
|
68
|
+
placeholder: "ID",
|
|
69
|
+
exclusiveGroup: rankingSelectorExclusiveGroup,
|
|
70
|
+
description: "ID numérico de ranking do usuário retornado por `rankings list`.",
|
|
71
|
+
},
|
|
72
|
+
{
|
|
73
|
+
kind: "option",
|
|
74
|
+
flag: "--top",
|
|
75
|
+
name: "top_n",
|
|
76
|
+
type: "integer",
|
|
77
|
+
required: false,
|
|
78
|
+
placeholder: "N",
|
|
79
|
+
defaultValue: 20,
|
|
80
|
+
description: "Número de ativos do topo do ranking a retornar.",
|
|
81
|
+
},
|
|
82
|
+
],
|
|
83
|
+
examples: [
|
|
84
|
+
"quantbrasil rankings current --system momentum-90d --top 20",
|
|
85
|
+
"quantbrasil rankings current --system magic-formula --top 10",
|
|
86
|
+
"quantbrasil rankings current --user 123 --top 20",
|
|
87
|
+
],
|
|
88
|
+
},
|
|
89
|
+
tool: {
|
|
90
|
+
name: "qb_rankings_current",
|
|
91
|
+
title: "Consultar ranking atual",
|
|
92
|
+
},
|
|
93
|
+
outputModes: standardOutputModes,
|
|
94
|
+
},
|
|
95
|
+
];
|
|
@@ -138,6 +138,87 @@ 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: "rankings.list";
|
|
143
|
+
readonly kind: "read";
|
|
144
|
+
readonly visibility: readonly ["cli", "opencode"];
|
|
145
|
+
readonly description: "Lista rankings do sistema e rankings do usuário disponíveis para consulta atual.";
|
|
146
|
+
readonly http: {
|
|
147
|
+
readonly method: "GET";
|
|
148
|
+
readonly path: "/api/desk/tools/rankings/list";
|
|
149
|
+
readonly inputMode: "none";
|
|
150
|
+
readonly schemas: {
|
|
151
|
+
readonly request: null;
|
|
152
|
+
readonly response: "RankingsListResponse";
|
|
153
|
+
};
|
|
154
|
+
};
|
|
155
|
+
readonly cli: {
|
|
156
|
+
readonly group: "rankings";
|
|
157
|
+
readonly command: "list";
|
|
158
|
+
readonly summary: "Lista rankings do sistema e rankings do usuário.";
|
|
159
|
+
readonly positional: readonly [];
|
|
160
|
+
readonly options: readonly [];
|
|
161
|
+
readonly examples: readonly ["quantbrasil rankings list"];
|
|
162
|
+
};
|
|
163
|
+
readonly tool: {
|
|
164
|
+
readonly name: "qb_rankings_list";
|
|
165
|
+
readonly title: "Listar rankings";
|
|
166
|
+
};
|
|
167
|
+
readonly outputModes: readonly ["json", "human"];
|
|
168
|
+
}, {
|
|
169
|
+
readonly id: "rankings.current";
|
|
170
|
+
readonly kind: "read";
|
|
171
|
+
readonly visibility: readonly ["cli", "opencode"];
|
|
172
|
+
readonly description: "Retorna os ativos atuais no topo de um ranking do sistema ou ranking do usuário.";
|
|
173
|
+
readonly http: {
|
|
174
|
+
readonly method: "POST";
|
|
175
|
+
readonly path: "/api/desk/tools/rankings/current";
|
|
176
|
+
readonly inputMode: "json_body";
|
|
177
|
+
readonly schemas: {
|
|
178
|
+
readonly request: "RankingCurrentRequest";
|
|
179
|
+
readonly response: "RankingCurrentResponse";
|
|
180
|
+
};
|
|
181
|
+
};
|
|
182
|
+
readonly cli: {
|
|
183
|
+
readonly group: "rankings";
|
|
184
|
+
readonly command: "current";
|
|
185
|
+
readonly summary: "Consulta o topo atual de um ranking.";
|
|
186
|
+
readonly positional: readonly [];
|
|
187
|
+
readonly options: readonly [{
|
|
188
|
+
readonly kind: "option";
|
|
189
|
+
readonly flag: "--system";
|
|
190
|
+
readonly name: "system_id";
|
|
191
|
+
readonly type: "string";
|
|
192
|
+
readonly required: false;
|
|
193
|
+
readonly placeholder: "ID";
|
|
194
|
+
readonly exclusiveGroup: "ranking_selector";
|
|
195
|
+
readonly description: "ID de ranking do sistema retornado por `rankings list`, por exemplo momentum-90d.";
|
|
196
|
+
}, {
|
|
197
|
+
readonly kind: "option";
|
|
198
|
+
readonly flag: "--user";
|
|
199
|
+
readonly name: "user_ranking_id";
|
|
200
|
+
readonly type: "integer";
|
|
201
|
+
readonly required: false;
|
|
202
|
+
readonly placeholder: "ID";
|
|
203
|
+
readonly exclusiveGroup: "ranking_selector";
|
|
204
|
+
readonly description: "ID numérico de ranking do usuário retornado por `rankings list`.";
|
|
205
|
+
}, {
|
|
206
|
+
readonly kind: "option";
|
|
207
|
+
readonly flag: "--top";
|
|
208
|
+
readonly name: "top_n";
|
|
209
|
+
readonly type: "integer";
|
|
210
|
+
readonly required: false;
|
|
211
|
+
readonly placeholder: "N";
|
|
212
|
+
readonly defaultValue: 20;
|
|
213
|
+
readonly description: "Número de ativos do topo do ranking a retornar.";
|
|
214
|
+
}];
|
|
215
|
+
readonly examples: readonly ["quantbrasil rankings current --system momentum-90d --top 20", "quantbrasil rankings current --system magic-formula --top 10", "quantbrasil rankings current --user 123 --top 20"];
|
|
216
|
+
};
|
|
217
|
+
readonly tool: {
|
|
218
|
+
readonly name: "qb_rankings_current";
|
|
219
|
+
readonly title: "Consultar ranking atual";
|
|
220
|
+
};
|
|
221
|
+
readonly outputModes: readonly ["json", "human"];
|
|
141
222
|
}, {
|
|
142
223
|
readonly id: "screening.universes";
|
|
143
224
|
readonly kind: "read";
|
|
@@ -1032,6 +1113,87 @@ export declare function getCapabilityById(id: CapabilityId): {
|
|
|
1032
1113
|
readonly title: "Get asset overview";
|
|
1033
1114
|
};
|
|
1034
1115
|
readonly outputModes: readonly ["json", "human"];
|
|
1116
|
+
} | {
|
|
1117
|
+
readonly id: "rankings.list";
|
|
1118
|
+
readonly kind: "read";
|
|
1119
|
+
readonly visibility: readonly ["cli", "opencode"];
|
|
1120
|
+
readonly description: "Lista rankings do sistema e rankings do usuário disponíveis para consulta atual.";
|
|
1121
|
+
readonly http: {
|
|
1122
|
+
readonly method: "GET";
|
|
1123
|
+
readonly path: "/api/desk/tools/rankings/list";
|
|
1124
|
+
readonly inputMode: "none";
|
|
1125
|
+
readonly schemas: {
|
|
1126
|
+
readonly request: null;
|
|
1127
|
+
readonly response: "RankingsListResponse";
|
|
1128
|
+
};
|
|
1129
|
+
};
|
|
1130
|
+
readonly cli: {
|
|
1131
|
+
readonly group: "rankings";
|
|
1132
|
+
readonly command: "list";
|
|
1133
|
+
readonly summary: "Lista rankings do sistema e rankings do usuário.";
|
|
1134
|
+
readonly positional: readonly [];
|
|
1135
|
+
readonly options: readonly [];
|
|
1136
|
+
readonly examples: readonly ["quantbrasil rankings list"];
|
|
1137
|
+
};
|
|
1138
|
+
readonly tool: {
|
|
1139
|
+
readonly name: "qb_rankings_list";
|
|
1140
|
+
readonly title: "Listar rankings";
|
|
1141
|
+
};
|
|
1142
|
+
readonly outputModes: readonly ["json", "human"];
|
|
1143
|
+
} | {
|
|
1144
|
+
readonly id: "rankings.current";
|
|
1145
|
+
readonly kind: "read";
|
|
1146
|
+
readonly visibility: readonly ["cli", "opencode"];
|
|
1147
|
+
readonly description: "Retorna os ativos atuais no topo de um ranking do sistema ou ranking do usuário.";
|
|
1148
|
+
readonly http: {
|
|
1149
|
+
readonly method: "POST";
|
|
1150
|
+
readonly path: "/api/desk/tools/rankings/current";
|
|
1151
|
+
readonly inputMode: "json_body";
|
|
1152
|
+
readonly schemas: {
|
|
1153
|
+
readonly request: "RankingCurrentRequest";
|
|
1154
|
+
readonly response: "RankingCurrentResponse";
|
|
1155
|
+
};
|
|
1156
|
+
};
|
|
1157
|
+
readonly cli: {
|
|
1158
|
+
readonly group: "rankings";
|
|
1159
|
+
readonly command: "current";
|
|
1160
|
+
readonly summary: "Consulta o topo atual de um ranking.";
|
|
1161
|
+
readonly positional: readonly [];
|
|
1162
|
+
readonly options: readonly [{
|
|
1163
|
+
readonly kind: "option";
|
|
1164
|
+
readonly flag: "--system";
|
|
1165
|
+
readonly name: "system_id";
|
|
1166
|
+
readonly type: "string";
|
|
1167
|
+
readonly required: false;
|
|
1168
|
+
readonly placeholder: "ID";
|
|
1169
|
+
readonly exclusiveGroup: "ranking_selector";
|
|
1170
|
+
readonly description: "ID de ranking do sistema retornado por `rankings list`, por exemplo momentum-90d.";
|
|
1171
|
+
}, {
|
|
1172
|
+
readonly kind: "option";
|
|
1173
|
+
readonly flag: "--user";
|
|
1174
|
+
readonly name: "user_ranking_id";
|
|
1175
|
+
readonly type: "integer";
|
|
1176
|
+
readonly required: false;
|
|
1177
|
+
readonly placeholder: "ID";
|
|
1178
|
+
readonly exclusiveGroup: "ranking_selector";
|
|
1179
|
+
readonly description: "ID numérico de ranking do usuário retornado por `rankings list`.";
|
|
1180
|
+
}, {
|
|
1181
|
+
readonly kind: "option";
|
|
1182
|
+
readonly flag: "--top";
|
|
1183
|
+
readonly name: "top_n";
|
|
1184
|
+
readonly type: "integer";
|
|
1185
|
+
readonly required: false;
|
|
1186
|
+
readonly placeholder: "N";
|
|
1187
|
+
readonly defaultValue: 20;
|
|
1188
|
+
readonly description: "Número de ativos do topo do ranking a retornar.";
|
|
1189
|
+
}];
|
|
1190
|
+
readonly examples: readonly ["quantbrasil rankings current --system momentum-90d --top 20", "quantbrasil rankings current --system magic-formula --top 10", "quantbrasil rankings current --user 123 --top 20"];
|
|
1191
|
+
};
|
|
1192
|
+
readonly tool: {
|
|
1193
|
+
readonly name: "qb_rankings_current";
|
|
1194
|
+
readonly title: "Consultar ranking atual";
|
|
1195
|
+
};
|
|
1196
|
+
readonly outputModes: readonly ["json", "human"];
|
|
1035
1197
|
} | {
|
|
1036
1198
|
readonly id: "screening.universes";
|
|
1037
1199
|
readonly kind: "read";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"registry.d.ts","sourceRoot":"","sources":["../../src/capabilities/registry.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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAEjD"}
|
|
@@ -1,10 +1,12 @@
|
|
|
1
1
|
import { assetCapabilities } from "./assets.js";
|
|
2
2
|
import { marketCapabilities } from "./market.js";
|
|
3
3
|
import { portfolioCapabilities } from "./portfolios.js";
|
|
4
|
+
import { rankingsCapabilities } from "./rankings.js";
|
|
4
5
|
import { screeningCapabilities } from "./screening.js";
|
|
5
6
|
export const capabilityRegistry = [
|
|
6
7
|
...marketCapabilities,
|
|
7
8
|
...assetCapabilities,
|
|
9
|
+
...rankingsCapabilities,
|
|
8
10
|
...screeningCapabilities,
|
|
9
11
|
...portfolioCapabilities,
|
|
10
12
|
];
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
export type CapabilityVisibility = "cli" | "opencode";
|
|
2
2
|
export type CapabilityKind = "read" | "mutation";
|
|
3
|
-
export type CapabilityGroup = "market" | "assets" | "screening" | "watchlists" | "holdings";
|
|
3
|
+
export type CapabilityGroup = "market" | "assets" | "rankings" | "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,e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AC,EAAE,OAAO,CAAC;IACnB,gBAAgB,CAAC,EAAE,0BAA0B,CAAC;IAC9C,cAAc,CAAC,EAAE,MAAM,CAAC;CACzB;AAED,MAAM,WAAW,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,18 +1,19 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: quantbrasil
|
|
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.
|
|
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, rankings, 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, screening, 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, rankings, 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
|
-
- 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.
|
|
13
|
+
- Most end-user QuantBrasil requests are expected in pt-BR; Portuguese prompts about ativos, rankings, Magic Formula, momentum, ranking fatorial, 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, ranking, screening, watchlist, holding, or holding metric data, use the CLI before generic web or finance search.
|
|
15
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.
|
|
16
|
+
- When the request asks for Magic Formula, momentum rankings, top ranked assets, ranking fatorial, rankings do usuário, or ordered asset lists, load [`references/rankings.md`](./references/rankings.md) before choosing commands.
|
|
16
17
|
- When the request mentions IFR/RSI filters, sobrevendido, sobrecomprado, indicator screening, technical screening rules, or screening indicators, load [`references/screening.md`](./references/screening.md) before building the request JSON.
|
|
17
18
|
- Use `quantbrasil` when available on PATH.
|
|
18
19
|
- If `quantbrasil` is not found, report that the CLI binary is not on PATH and ask the user to install it or fix PATH.
|
|
@@ -23,6 +24,7 @@ Use this skill when the user asks for market or investing data/actions that Quan
|
|
|
23
24
|
- asset discovery: `quantbrasil market assets`
|
|
24
25
|
- price lookup: `quantbrasil market price <ticker>`
|
|
25
26
|
- richer asset analysis: `quantbrasil assets overview <ticker> --sections ...`
|
|
27
|
+
- ranked asset lists: `quantbrasil rankings list|current ...`
|
|
26
28
|
- watchlist details and changes: `quantbrasil watchlists ...`
|
|
27
29
|
- holding details and historical return: `quantbrasil holdings ...`
|
|
28
30
|
- indicator screening over saved universes: `quantbrasil screening universes|indicators|run ...`
|
|
@@ -35,6 +37,7 @@ Use this skill when the user asks for market or investing data/actions that Quan
|
|
|
35
37
|
|
|
36
38
|
- 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.
|
|
37
39
|
- Load [`references/cli.md`](./references/cli.md) when you need exact command syntax, flags, examples, or supported `--sections` values.
|
|
40
|
+
- Load [`references/rankings.md`](./references/rankings.md) when the user asks for Magic Formula, momentum rankings, top ranked assets, ranking fatorial, rankings do usuário, or current ordered lists.
|
|
38
41
|
- 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.
|
|
39
42
|
- Load [`references/screening.md`](./references/screening.md) when the user asks for IFR/RSI filters, sobrevendido/sobrecomprado assets, indicator screening, technical filter JSON, screening indicators, or examples of `ScreenerRequest`.
|
|
40
43
|
- Load [`references/costs.md`](./references/costs.md) before chaining heavy reads, choosing between overview/screening/holding metrics, or answering cost-sensitive agent workflow questions.
|
|
@@ -46,6 +46,27 @@ Valid `--sections`:
|
|
|
46
46
|
- `fundamentals`
|
|
47
47
|
- `rankings`
|
|
48
48
|
|
|
49
|
+
## Rankings
|
|
50
|
+
|
|
51
|
+
```bash
|
|
52
|
+
quantbrasil rankings list
|
|
53
|
+
quantbrasil rankings list --json
|
|
54
|
+
quantbrasil rankings current --system momentum-90d --top 20
|
|
55
|
+
quantbrasil rankings current --system magic-formula --top 10
|
|
56
|
+
quantbrasil rankings current --user 123 --top 20
|
|
57
|
+
quantbrasil rankings current --system momentum-90d --top 20 --json
|
|
58
|
+
```
|
|
59
|
+
|
|
60
|
+
Rules:
|
|
61
|
+
|
|
62
|
+
- use `rankings list` to discover rankings before using ids
|
|
63
|
+
- system rankings use stable ids such as `magic-formula`, `momentum-90d`, `dividend-yield`, and `momentum-double`
|
|
64
|
+
- user rankings use the numeric id returned by `rankings list`
|
|
65
|
+
- use exactly one selector: `--system` or `--user`
|
|
66
|
+
- `--top` controls how many ranked assets are returned
|
|
67
|
+
- `current` returns the ordered rows and the metric used to order the ranking
|
|
68
|
+
- use `--json` when the result will be parsed by an agent or script
|
|
69
|
+
|
|
49
70
|
## Watchlists and holdings
|
|
50
71
|
|
|
51
72
|
Watchlists:
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
# Rankings
|
|
2
|
+
|
|
3
|
+
Use rankings for order-first questions: Magic Formula, momentum leaders,
|
|
4
|
+
dividend-yield leaders, Momentum Double, or saved user rankings. A ranking
|
|
5
|
+
returns an ordered asset list plus the metric used to order it.
|
|
6
|
+
|
|
7
|
+
## Discovery
|
|
8
|
+
|
|
9
|
+
Always discover ids before running a ranking unless the user already gave an
|
|
10
|
+
exact id.
|
|
11
|
+
|
|
12
|
+
```bash
|
|
13
|
+
quantbrasil rankings list
|
|
14
|
+
```
|
|
15
|
+
|
|
16
|
+
The list is grouped into:
|
|
17
|
+
|
|
18
|
+
- system rankings: platform-provided rankings with stable ids
|
|
19
|
+
- user rankings: saved rankings owned by the authenticated user
|
|
20
|
+
|
|
21
|
+
## Current ranking
|
|
22
|
+
|
|
23
|
+
System ranking:
|
|
24
|
+
|
|
25
|
+
```bash
|
|
26
|
+
quantbrasil rankings current --system momentum-90d --top 20
|
|
27
|
+
quantbrasil rankings current --system magic-formula --top 10
|
|
28
|
+
```
|
|
29
|
+
|
|
30
|
+
User ranking:
|
|
31
|
+
|
|
32
|
+
```bash
|
|
33
|
+
quantbrasil rankings current --user 123 --top 20
|
|
34
|
+
```
|
|
35
|
+
|
|
36
|
+
Rules:
|
|
37
|
+
|
|
38
|
+
- use exactly one selector: `--system` or `--user`
|
|
39
|
+
- `--top` is the number of ranked assets to return
|
|
40
|
+
- use `--json` when another step needs to parse tickers, rank, score, or metric values
|
|
41
|
+
- do not use `factor:<id>` in command syntax; ranking fatorial is a saved user ranking and uses `--user <id>`
|
|
42
|
+
|
|
43
|
+
## Ranking vs screening
|
|
44
|
+
|
|
45
|
+
Use rankings when the user starts from an ordered list:
|
|
46
|
+
|
|
47
|
+
- "top 20 do momentum"
|
|
48
|
+
- "top 10 Magic Formula"
|
|
49
|
+
- "meu ranking de qualidade"
|
|
50
|
+
- "ativos com maior dividend yield"
|
|
51
|
+
|
|
52
|
+
Use screening when the user starts from a condition:
|
|
53
|
+
|
|
54
|
+
- "IFR14 abaixo de 30"
|
|
55
|
+
- "ativos sobrevendidos"
|
|
56
|
+
- "preço acima da média móvel"
|
|
57
|
+
|
|
58
|
+
If the user wants both ranking and a condition, keep the steps explicit. First
|
|
59
|
+
get the ranking with `--json`, then apply the follow-up workflow only if the CLI
|
|
60
|
+
surface supports that next step. Do not invent ranking-specific screening flags.
|
|
@@ -5,6 +5,7 @@
|
|
|
5
5
|
- asset price, quote, or daily move → `market price`
|
|
6
6
|
- supported assets, tickers, or market universe → `market assets`
|
|
7
7
|
- asset performance, technicals, risk, fundamentals, or ranking → `assets overview`
|
|
8
|
+
- current ordered asset lists such as Magic Formula, momentum, or user rankings → `rankings list`, then `rankings current`
|
|
8
9
|
- watchlist details or changes → `watchlists ...`
|
|
9
10
|
- holding details or changes → `holdings ...`
|
|
10
11
|
- holding return, beta, risk, VaR, or comparison → `holdings historical-return|beta|var`
|
|
@@ -62,6 +63,28 @@ Guidance:
|
|
|
62
63
|
|
|
63
64
|
Avoid asking for every section unless user clearly wants full report.
|
|
64
65
|
|
|
66
|
+
## Get current ranked assets
|
|
67
|
+
|
|
68
|
+
Use this when the user asks for an ordered list such as top Magic Formula,
|
|
69
|
+
momentum leaders, dividend-yield leaders, Momentum Double, or a saved user
|
|
70
|
+
ranking.
|
|
71
|
+
|
|
72
|
+
```bash
|
|
73
|
+
quantbrasil rankings list
|
|
74
|
+
quantbrasil rankings current --system momentum-90d --top 20
|
|
75
|
+
quantbrasil rankings current --system magic-formula --top 10
|
|
76
|
+
quantbrasil rankings current --user 123 --top 20
|
|
77
|
+
```
|
|
78
|
+
|
|
79
|
+
Rules:
|
|
80
|
+
|
|
81
|
+
- rankings answer order-first questions
|
|
82
|
+
- system rankings use `--system <id>` from `rankings list`
|
|
83
|
+
- user rankings use `--user <id>` from `rankings list`
|
|
84
|
+
- do not call user rankings "factor:" in command syntax; ranking fatorial is a saved user ranking
|
|
85
|
+
- use `--json` if another step needs to parse tickers, ranks, or ordering metrics
|
|
86
|
+
- do not route ranking-first questions through screening unless the user asks for indicator conditions
|
|
87
|
+
|
|
65
88
|
## Analyze saved holding
|
|
66
89
|
|
|
67
90
|
1. Discover holding id.
|