@quantbrasil/cli 0.1.0-beta.0
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 +272 -0
- package/bin/quantbrasil.js +4 -0
- package/dist/cli/auth.d.ts +20 -0
- package/dist/cli/auth.d.ts.map +1 -0
- package/dist/cli/auth.js +76 -0
- package/dist/cli/client.d.ts +17 -0
- package/dist/cli/client.d.ts.map +1 -0
- package/dist/cli/client.js +112 -0
- package/dist/cli/config.d.ts +33 -0
- package/dist/cli/config.d.ts.map +1 -0
- package/dist/cli/config.js +148 -0
- package/dist/cli/errors.d.ts +40 -0
- package/dist/cli/errors.d.ts.map +1 -0
- package/dist/cli/errors.js +122 -0
- package/dist/cli/index.d.ts +30 -0
- package/dist/cli/index.d.ts.map +1 -0
- package/dist/cli/index.js +112 -0
- package/dist/cli/prompt.d.ts +2 -0
- package/dist/cli/prompt.d.ts.map +1 -0
- package/dist/cli/prompt.js +40 -0
- package/dist/cli/skills.d.ts +26 -0
- package/dist/cli/skills.d.ts.map +1 -0
- package/dist/cli/skills.js +94 -0
- package/dist/cli/terminal.d.ts +18 -0
- package/dist/cli/terminal.d.ts.map +1 -0
- package/dist/cli/terminal.js +43 -0
- package/dist/commands/analytics.d.ts +131 -0
- package/dist/commands/analytics.d.ts.map +1 -0
- package/dist/commands/analytics.js +291 -0
- package/dist/commands/assets.d.ts +69 -0
- package/dist/commands/assets.d.ts.map +1 -0
- package/dist/commands/assets.js +350 -0
- package/dist/commands/auth.d.ts +17 -0
- package/dist/commands/auth.d.ts.map +1 -0
- package/dist/commands/auth.js +48 -0
- package/dist/commands/capabilities.d.ts +25 -0
- package/dist/commands/capabilities.d.ts.map +1 -0
- package/dist/commands/capabilities.js +61 -0
- package/dist/commands/init.d.ts +17 -0
- package/dist/commands/init.d.ts.map +1 -0
- package/dist/commands/init.js +89 -0
- package/dist/commands/market.d.ts +45 -0
- package/dist/commands/market.d.ts.map +1 -0
- package/dist/commands/market.js +162 -0
- package/dist/commands/portfolios.d.ts +60 -0
- package/dist/commands/portfolios.d.ts.map +1 -0
- package/dist/commands/portfolios.js +298 -0
- package/dist/commands/skills.d.ts +17 -0
- package/dist/commands/skills.d.ts.map +1 -0
- package/dist/commands/skills.js +38 -0
- package/dist/commands/status.d.ts +15 -0
- package/dist/commands/status.d.ts.map +1 -0
- package/dist/commands/status.js +52 -0
- package/dist/index.d.ts +14 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +13 -0
- package/dist/vendor/core/capabilities/analytics.d.ts +187 -0
- package/dist/vendor/core/capabilities/analytics.d.ts.map +1 -0
- package/dist/vendor/core/capabilities/analytics.js +214 -0
- package/dist/vendor/core/capabilities/assets.d.ts +48 -0
- package/dist/vendor/core/capabilities/assets.d.ts.map +1 -0
- package/dist/vendor/core/capabilities/assets.js +66 -0
- package/dist/vendor/core/capabilities/index.d.ts +8 -0
- package/dist/vendor/core/capabilities/index.d.ts.map +1 -0
- package/dist/vendor/core/capabilities/index.js +7 -0
- package/dist/vendor/core/capabilities/market.d.ts +90 -0
- package/dist/vendor/core/capabilities/market.d.ts.map +1 -0
- package/dist/vendor/core/capabilities/market.js +114 -0
- package/dist/vendor/core/capabilities/portfolios.d.ts +224 -0
- package/dist/vendor/core/capabilities/portfolios.d.ts.map +1 -0
- package/dist/vendor/core/capabilities/portfolios.js +244 -0
- package/dist/vendor/core/capabilities/registry.d.ts +1083 -0
- package/dist/vendor/core/capabilities/registry.d.ts.map +1 -0
- package/dist/vendor/core/capabilities/registry.js +14 -0
- package/dist/vendor/core/capabilities/shared.d.ts +3 -0
- package/dist/vendor/core/capabilities/shared.d.ts.map +1 -0
- package/dist/vendor/core/capabilities/shared.js +2 -0
- package/dist/vendor/core/capabilities/types.d.ts +75 -0
- package/dist/vendor/core/capabilities/types.d.ts.map +1 -0
- package/dist/vendor/core/capabilities/types.js +1 -0
- package/dist/vendor/core/errors.d.ts +22 -0
- package/dist/vendor/core/errors.d.ts.map +1 -0
- package/dist/vendor/core/errors.js +42 -0
- package/dist/vendor/core/http/client.d.ts +45 -0
- package/dist/vendor/core/http/client.d.ts.map +1 -0
- package/dist/vendor/core/http/client.js +170 -0
- package/dist/vendor/core/http/index.d.ts +2 -0
- package/dist/vendor/core/http/index.d.ts.map +1 -0
- package/dist/vendor/core/http/index.js +1 -0
- package/dist/vendor/core/index.d.ts +5 -0
- package/dist/vendor/core/index.d.ts.map +1 -0
- package/dist/vendor/core/index.js +4 -0
- package/dist/vendor/core/invoke.d.ts +17 -0
- package/dist/vendor/core/invoke.d.ts.map +1 -0
- package/dist/vendor/core/invoke.js +70 -0
- package/package.json +57 -0
- package/skills/quantbrasil/SKILL.md +29 -0
- package/skills/quantbrasil/references/cli.md +77 -0
- package/skills/quantbrasil/references/costs.md +30 -0
- package/skills/quantbrasil/references/errors.md +128 -0
- package/skills/quantbrasil/references/unsupported.md +20 -0
- package/skills/quantbrasil/references/workflows.md +99 -0
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
const ANSI_RESET = "\u001B[0m";
|
|
2
|
+
const ANSI_BOLD = "\u001B[1m";
|
|
3
|
+
const ANSI_DIM = "\u001B[2m";
|
|
4
|
+
const QB_ACCENT_RGB = [73, 206, 139];
|
|
5
|
+
const QB_WARNING_RGB = [212, 158, 22];
|
|
6
|
+
const QB_DANGER_RGB = [225, 82, 65];
|
|
7
|
+
const QB_INFO_RGB = [18, 144, 248];
|
|
8
|
+
export function createTerminalTheme(writer, env = process.env) {
|
|
9
|
+
const enabled = isColorEnabled(writer, env);
|
|
10
|
+
return {
|
|
11
|
+
enabled,
|
|
12
|
+
accent: text => applyRgb(text, QB_ACCENT_RGB, enabled),
|
|
13
|
+
bold: text => applyCodes(text, [ANSI_BOLD], enabled),
|
|
14
|
+
dim: text => applyCodes(text, [ANSI_DIM], enabled),
|
|
15
|
+
success: text => applyRgb(text, QB_ACCENT_RGB, enabled),
|
|
16
|
+
warning: text => applyRgb(text, QB_WARNING_RGB, enabled),
|
|
17
|
+
danger: text => applyRgb(text, QB_DANGER_RGB, enabled),
|
|
18
|
+
info: text => applyRgb(text, QB_INFO_RGB, enabled),
|
|
19
|
+
label: text => applyRgb(applyCodes(text, [ANSI_BOLD], enabled), QB_ACCENT_RGB, enabled),
|
|
20
|
+
};
|
|
21
|
+
}
|
|
22
|
+
export function styleErrorMessage(message, writer, env = process.env) {
|
|
23
|
+
const theme = createTerminalTheme(writer, env);
|
|
24
|
+
return theme.enabled ? `${theme.danger("Error:")} ${message}` : message;
|
|
25
|
+
}
|
|
26
|
+
function isColorEnabled(writer, env) {
|
|
27
|
+
if (env.NO_COLOR !== undefined) {
|
|
28
|
+
return false;
|
|
29
|
+
}
|
|
30
|
+
if (env.FORCE_COLOR && env.FORCE_COLOR !== "0") {
|
|
31
|
+
return true;
|
|
32
|
+
}
|
|
33
|
+
return writer.isTTY === true;
|
|
34
|
+
}
|
|
35
|
+
function applyRgb(text, rgb, enabled) {
|
|
36
|
+
return applyCodes(text, [`\u001B[38;2;${rgb[0]};${rgb[1]};${rgb[2]}m`], enabled);
|
|
37
|
+
}
|
|
38
|
+
function applyCodes(text, codes, enabled) {
|
|
39
|
+
if (!enabled || !text) {
|
|
40
|
+
return text;
|
|
41
|
+
}
|
|
42
|
+
return `${codes.join("")}${text}${ANSI_RESET}`;
|
|
43
|
+
}
|
|
@@ -0,0 +1,131 @@
|
|
|
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 AnalyticsCommandIO {
|
|
6
|
+
stdout: TerminalWriter;
|
|
7
|
+
}
|
|
8
|
+
export interface AnalyticsCommandContext extends CliInvokeContext {
|
|
9
|
+
io?: AnalyticsCommandIO;
|
|
10
|
+
}
|
|
11
|
+
export interface HistoricalReturnCommandOptions {
|
|
12
|
+
portfolio?: number;
|
|
13
|
+
asset?: string[];
|
|
14
|
+
from: string;
|
|
15
|
+
to: string;
|
|
16
|
+
json?: boolean;
|
|
17
|
+
}
|
|
18
|
+
export interface BetaCommandOptions {
|
|
19
|
+
portfolio?: number;
|
|
20
|
+
asset?: string[];
|
|
21
|
+
years?: string;
|
|
22
|
+
json?: boolean;
|
|
23
|
+
}
|
|
24
|
+
export interface VarCommandOptions {
|
|
25
|
+
portfolio?: number;
|
|
26
|
+
asset?: string[];
|
|
27
|
+
years?: string;
|
|
28
|
+
confidence?: string;
|
|
29
|
+
json?: boolean;
|
|
30
|
+
}
|
|
31
|
+
export interface HistoricalReturnHolding {
|
|
32
|
+
[key: string]: JsonValue;
|
|
33
|
+
ticker: string;
|
|
34
|
+
weight_pct: number;
|
|
35
|
+
total_return: number;
|
|
36
|
+
contribution: number;
|
|
37
|
+
}
|
|
38
|
+
export interface HistoricalReturnResponse {
|
|
39
|
+
[key: string]: JsonValue;
|
|
40
|
+
source_type: "saved_portfolio" | "ad_hoc";
|
|
41
|
+
portfolio_id: number | null;
|
|
42
|
+
portfolio_name: string | null;
|
|
43
|
+
requested_start_date: string;
|
|
44
|
+
requested_end_date: string;
|
|
45
|
+
effective_start_date: string;
|
|
46
|
+
effective_end_date: string;
|
|
47
|
+
total_return: number;
|
|
48
|
+
annualized_return: number;
|
|
49
|
+
max_drawdown: number;
|
|
50
|
+
daily_volatility: number;
|
|
51
|
+
annualized_volatility: number;
|
|
52
|
+
sharpe_ratio: number;
|
|
53
|
+
ibov_return: number;
|
|
54
|
+
cdi_return: number;
|
|
55
|
+
ipca_return: number;
|
|
56
|
+
holdings: HistoricalReturnHolding[];
|
|
57
|
+
summary_markdown: string;
|
|
58
|
+
assumptions: string[];
|
|
59
|
+
warnings: string[];
|
|
60
|
+
}
|
|
61
|
+
export interface BetaHolding {
|
|
62
|
+
[key: string]: JsonValue;
|
|
63
|
+
ticker: string;
|
|
64
|
+
weight_pct: number;
|
|
65
|
+
beta: number | null;
|
|
66
|
+
weighted_beta: number | null;
|
|
67
|
+
correlation: number | null;
|
|
68
|
+
asset_daily_volatility: number | null;
|
|
69
|
+
benchmark_daily_volatility: number | null;
|
|
70
|
+
last_updated: string | null;
|
|
71
|
+
}
|
|
72
|
+
export interface BetaResponse {
|
|
73
|
+
[key: string]: JsonValue;
|
|
74
|
+
source_type: "saved_portfolio" | "ad_hoc";
|
|
75
|
+
portfolio_id: number | null;
|
|
76
|
+
portfolio_name: string | null;
|
|
77
|
+
benchmark: "IBOV";
|
|
78
|
+
lookback_years: number;
|
|
79
|
+
beta: number;
|
|
80
|
+
correlation: number;
|
|
81
|
+
daily_volatility: number;
|
|
82
|
+
annualized_volatility: number;
|
|
83
|
+
long_exposure_pct: number;
|
|
84
|
+
short_exposure_pct: number;
|
|
85
|
+
total_weight_pct: number;
|
|
86
|
+
holdings: BetaHolding[];
|
|
87
|
+
summary_markdown: string;
|
|
88
|
+
assumptions: string[];
|
|
89
|
+
warnings: string[];
|
|
90
|
+
}
|
|
91
|
+
export interface VarHolding {
|
|
92
|
+
[key: string]: JsonValue;
|
|
93
|
+
ticker: string;
|
|
94
|
+
weight_pct: number;
|
|
95
|
+
}
|
|
96
|
+
export interface VarResponse {
|
|
97
|
+
[key: string]: JsonValue;
|
|
98
|
+
source_type: "saved_portfolio" | "ad_hoc";
|
|
99
|
+
portfolio_id: number | null;
|
|
100
|
+
portfolio_name: string | null;
|
|
101
|
+
lookback_years: number;
|
|
102
|
+
confidence_pct: number;
|
|
103
|
+
time_horizon: "1d";
|
|
104
|
+
var: number;
|
|
105
|
+
long_exposure_pct: number;
|
|
106
|
+
short_exposure_pct: number;
|
|
107
|
+
total_weight_pct: number;
|
|
108
|
+
holdings: VarHolding[];
|
|
109
|
+
histogram_data: JsonValue[];
|
|
110
|
+
summary_markdown: string;
|
|
111
|
+
assumptions: string[];
|
|
112
|
+
warnings: string[];
|
|
113
|
+
}
|
|
114
|
+
interface ParsedAssetInput {
|
|
115
|
+
[key: string]: JsonValue;
|
|
116
|
+
ticker: string;
|
|
117
|
+
weight_pct: number | null;
|
|
118
|
+
}
|
|
119
|
+
export declare function registerAnalyticsCommands(program: Command, context?: AnalyticsCommandContext): void;
|
|
120
|
+
export declare function runHistoricalReturnCommand(options: HistoricalReturnCommandOptions, context?: AnalyticsCommandContext): Promise<void>;
|
|
121
|
+
export declare function runBetaCommand(options: BetaCommandOptions, context?: AnalyticsCommandContext): Promise<void>;
|
|
122
|
+
export declare function runVarCommand(options: VarCommandOptions, context?: AnalyticsCommandContext): Promise<void>;
|
|
123
|
+
export declare function buildHistoricalReturnInput(options: HistoricalReturnCommandOptions): JsonValue;
|
|
124
|
+
export declare function buildBetaInput(options: BetaCommandOptions): JsonValue;
|
|
125
|
+
export declare function buildVarInput(options: VarCommandOptions): JsonValue;
|
|
126
|
+
export declare function formatHistoricalReturnHuman(data: HistoricalReturnResponse, theme?: import("../cli/terminal.js").TerminalTheme): string;
|
|
127
|
+
export declare function formatBetaHuman(data: BetaResponse, theme?: import("../cli/terminal.js").TerminalTheme): string;
|
|
128
|
+
export declare function formatVarHuman(data: VarResponse, theme?: import("../cli/terminal.js").TerminalTheme): string;
|
|
129
|
+
export declare function parseAssetSpec(rawAsset: string): ParsedAssetInput;
|
|
130
|
+
export {};
|
|
131
|
+
//# sourceMappingURL=analytics.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"analytics.d.ts","sourceRoot":"","sources":["../../src/commands/analytics.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,kBAAkB;IACjC,MAAM,EAAE,cAAc,CAAC;CACxB;AAED,MAAM,WAAW,uBAAwB,SAAQ,gBA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B,EACvC,OAAO,GAAE,uBAA4B,GACpC,OAAO,CAAC,IAAI,CAAC,CAgBf;AAED,wBAAsB,cAAc,CAClC,OAAO,EAAE,kBAAkB,EAC3B,OAAO,GAAE,uBAA4B,GACpC,OAAO,CAAC,IAAI,CAAC,CAgBf;AAED,wBAAsB,aAAa,CACjC,OAAO,EAAE,iBAAiB,EAC1B,OAAO,GAAE,uBAA4B,GACpC,OAAO,CAAC,IAAI,CAAC,CAgBf;AAED,wBAAgB,0BAA0B,CACxC,OAAO,EAAE,8BAA8B,GACtC,SAAS,CAOX;AAED,wBAAgB,cAAc,CAAC,OAAO,EAAE,kBAAkB,GAAG,SAAS,CAMrE;AAED,wBAAgB,aAAa,CAAC,OAAO,EAAE,iBAAiB,GAAG,SAAS,CAOnE;AAED,wBAAgB,2BAA2B,CACzC,IAAI,EAAE,wBAAwB,EAC9B,KAAK,6CAAsC,GAC1C,MAAM,CA8BR;AAED,wBAAgB,eAAe,CAC7B,IAAI,EAAE,YAAY,EAClB,KAAK,6CAAsC,GAC1C,MAAM,CA0BR;AAED,wBAAgB,cAAc,CAC5B,IAAI,EAAE,WAAW,EACjB,KAAK,6CAAsC,GAC1C,MAAM,CA0BR;AAED,wBAAgB,cAAc,CAAC,QAAQ,EAAE,MAAM,GAAG,gBAAgB,CAiCjE"}
|
|
@@ -0,0 +1,291 @@
|
|
|
1
|
+
import { invokeCliCapability } from "../cli/client.js";
|
|
2
|
+
import { createCliValidationError } from "../cli/errors.js";
|
|
3
|
+
import { createTerminalTheme } from "../cli/terminal.js";
|
|
4
|
+
export function registerAnalyticsCommands(program, context = {}) {
|
|
5
|
+
const analyticsCommand = program
|
|
6
|
+
.command("analytics")
|
|
7
|
+
.description("Read portfolio analytics operations");
|
|
8
|
+
analyticsCommand
|
|
9
|
+
.command("historical-return")
|
|
10
|
+
.description("Calculate historical return for a saved portfolio or basket")
|
|
11
|
+
.option("--portfolio <id>", "Saved portfolio id", parsePositiveIntegerOption)
|
|
12
|
+
.option("--asset <asset>", "Repeatable asset input in TICKER[:WEIGHT_PCT] form", collectStringOption, [])
|
|
13
|
+
.requiredOption("--from <date>", "Inclusive start date in ISO format")
|
|
14
|
+
.requiredOption("--to <date>", "Inclusive end date in ISO format")
|
|
15
|
+
.option("--json", "Show JSON output")
|
|
16
|
+
.action(async (options) => {
|
|
17
|
+
await runHistoricalReturnCommand(options, context);
|
|
18
|
+
});
|
|
19
|
+
analyticsCommand
|
|
20
|
+
.command("beta")
|
|
21
|
+
.description("Calculate portfolio beta against IBOV")
|
|
22
|
+
.option("--portfolio <id>", "Saved portfolio id", parsePositiveIntegerOption)
|
|
23
|
+
.option("--asset <asset>", "Repeatable asset input in TICKER[:WEIGHT_PCT] form", collectStringOption, [])
|
|
24
|
+
.option("--years <years>", "Lookback window in years", "1")
|
|
25
|
+
.option("--json", "Show JSON output")
|
|
26
|
+
.action(async (options) => {
|
|
27
|
+
await runBetaCommand(options, context);
|
|
28
|
+
});
|
|
29
|
+
analyticsCommand
|
|
30
|
+
.command("var")
|
|
31
|
+
.description("Calculate one-day Value-at-Risk for a portfolio or basket")
|
|
32
|
+
.option("--portfolio <id>", "Saved portfolio id", parsePositiveIntegerOption)
|
|
33
|
+
.option("--asset <asset>", "Repeatable asset input in TICKER[:WEIGHT_PCT] form", collectStringOption, [])
|
|
34
|
+
.option("--years <years>", "Lookback window in years", "1")
|
|
35
|
+
.option("--confidence <confidence>", "Confidence level in percent", "95")
|
|
36
|
+
.option("--json", "Show JSON output")
|
|
37
|
+
.action(async (options) => {
|
|
38
|
+
await runVarCommand(options, context);
|
|
39
|
+
});
|
|
40
|
+
}
|
|
41
|
+
export async function runHistoricalReturnCommand(options, context = {}) {
|
|
42
|
+
const stdout = context.io?.stdout ?? process.stdout;
|
|
43
|
+
const theme = createTerminalTheme(stdout, context.env ?? process.env);
|
|
44
|
+
const response = await invokeCliCapability({
|
|
45
|
+
capability: "analytics.historical-return",
|
|
46
|
+
input: buildHistoricalReturnInput(options),
|
|
47
|
+
env: context.env,
|
|
48
|
+
fetch: context.fetch,
|
|
49
|
+
});
|
|
50
|
+
if (options.json) {
|
|
51
|
+
stdout.write(`${JSON.stringify(response.data, null, 2)}\n`);
|
|
52
|
+
return;
|
|
53
|
+
}
|
|
54
|
+
stdout.write(`${formatHistoricalReturnHuman(response.data, theme)}\n`);
|
|
55
|
+
}
|
|
56
|
+
export async function runBetaCommand(options, context = {}) {
|
|
57
|
+
const stdout = context.io?.stdout ?? process.stdout;
|
|
58
|
+
const theme = createTerminalTheme(stdout, context.env ?? process.env);
|
|
59
|
+
const response = await invokeCliCapability({
|
|
60
|
+
capability: "analytics.beta",
|
|
61
|
+
input: buildBetaInput(options),
|
|
62
|
+
env: context.env,
|
|
63
|
+
fetch: context.fetch,
|
|
64
|
+
});
|
|
65
|
+
if (options.json) {
|
|
66
|
+
stdout.write(`${JSON.stringify(response.data, null, 2)}\n`);
|
|
67
|
+
return;
|
|
68
|
+
}
|
|
69
|
+
stdout.write(`${formatBetaHuman(response.data, theme)}\n`);
|
|
70
|
+
}
|
|
71
|
+
export async function runVarCommand(options, context = {}) {
|
|
72
|
+
const stdout = context.io?.stdout ?? process.stdout;
|
|
73
|
+
const theme = createTerminalTheme(stdout, context.env ?? process.env);
|
|
74
|
+
const response = await invokeCliCapability({
|
|
75
|
+
capability: "analytics.var",
|
|
76
|
+
input: buildVarInput(options),
|
|
77
|
+
env: context.env,
|
|
78
|
+
fetch: context.fetch,
|
|
79
|
+
});
|
|
80
|
+
if (options.json) {
|
|
81
|
+
stdout.write(`${JSON.stringify(response.data, null, 2)}\n`);
|
|
82
|
+
return;
|
|
83
|
+
}
|
|
84
|
+
stdout.write(`${formatVarHuman(response.data, theme)}\n`);
|
|
85
|
+
}
|
|
86
|
+
export function buildHistoricalReturnInput(options) {
|
|
87
|
+
const source = resolveAnalyticsSource(options.portfolio, options.asset ?? []);
|
|
88
|
+
return {
|
|
89
|
+
...source,
|
|
90
|
+
start_date: options.from,
|
|
91
|
+
end_date: options.to,
|
|
92
|
+
};
|
|
93
|
+
}
|
|
94
|
+
export function buildBetaInput(options) {
|
|
95
|
+
const source = resolveAnalyticsSource(options.portfolio, options.asset ?? []);
|
|
96
|
+
return {
|
|
97
|
+
...source,
|
|
98
|
+
years: parseYearsOption(options.years ?? "1"),
|
|
99
|
+
};
|
|
100
|
+
}
|
|
101
|
+
export function buildVarInput(options) {
|
|
102
|
+
const source = resolveAnalyticsSource(options.portfolio, options.asset ?? []);
|
|
103
|
+
return {
|
|
104
|
+
...source,
|
|
105
|
+
years: parsePositiveIntegerOption(options.years ?? "1"),
|
|
106
|
+
confidence_pct: parseNumberOption(options.confidence ?? "95", "confidence"),
|
|
107
|
+
};
|
|
108
|
+
}
|
|
109
|
+
export function formatHistoricalReturnHuman(data, theme = createTerminalTheme(process.stdout)) {
|
|
110
|
+
const lines = [
|
|
111
|
+
theme.label("Historical return"),
|
|
112
|
+
"",
|
|
113
|
+
formatSourceLabel(data, theme),
|
|
114
|
+
`${theme.label("Period:")} ${data.effective_start_date} → ${data.effective_end_date}`,
|
|
115
|
+
`${theme.label("Requested:")} ${data.requested_start_date} → ${data.requested_end_date}`,
|
|
116
|
+
"",
|
|
117
|
+
`${theme.label("Portfolio return:")} ${formatPercentValue(data.total_return)}`,
|
|
118
|
+
`${theme.label("Annualized return:")} ${formatPercentValue(data.annualized_return)}`,
|
|
119
|
+
`${theme.label("Max drawdown:")} ${formatPercentValue(data.max_drawdown)}`,
|
|
120
|
+
`${theme.label("Daily volatility:")} ${formatPercentValue(data.daily_volatility)}`,
|
|
121
|
+
`${theme.label("Annualized volatility:")} ${formatPercentValue(data.annualized_volatility)}`,
|
|
122
|
+
`${theme.label("Sharpe ratio:")} ${formatNumber(data.sharpe_ratio)}`,
|
|
123
|
+
"",
|
|
124
|
+
theme.label("Benchmarks"),
|
|
125
|
+
` IBOV: ${formatPercentValue(data.ibov_return)}`,
|
|
126
|
+
` CDI: ${formatPercentValue(data.cdi_return)}`,
|
|
127
|
+
` IPCA: ${formatPercentValue(data.ipca_return)}`,
|
|
128
|
+
"",
|
|
129
|
+
theme.label("Holdings"),
|
|
130
|
+
...data.holdings.map(item => ` - ${item.ticker}: weight=${formatPercentDirect(item.weight_pct)}, return=${formatPercentValue(item.total_return)}, contribution=${formatPercentValue(item.contribution)}`),
|
|
131
|
+
];
|
|
132
|
+
pushNotes(lines, "Assumptions", data.assumptions, theme);
|
|
133
|
+
pushNotes(lines, "Warnings", data.warnings, theme);
|
|
134
|
+
return lines.join("\n");
|
|
135
|
+
}
|
|
136
|
+
export function formatBetaHuman(data, theme = createTerminalTheme(process.stdout)) {
|
|
137
|
+
const lines = [
|
|
138
|
+
theme.label("Portfolio beta"),
|
|
139
|
+
"",
|
|
140
|
+
formatSourceLabel(data, theme),
|
|
141
|
+
`${theme.label("Benchmark:")} ${data.benchmark}`,
|
|
142
|
+
`${theme.label("Lookback:")} ${data.lookback_years}Y`,
|
|
143
|
+
"",
|
|
144
|
+
`${theme.label("Beta:")} ${formatNumber(data.beta)}`,
|
|
145
|
+
`${theme.label("Correlation:")} ${formatNumber(data.correlation)}`,
|
|
146
|
+
`${theme.label("Daily volatility:")} ${formatPercentValue(data.daily_volatility)}`,
|
|
147
|
+
`${theme.label("Annualized volatility:")} ${formatPercentValue(data.annualized_volatility)}`,
|
|
148
|
+
`${theme.label("Long exposure:")} ${formatPercentDirect(data.long_exposure_pct)}`,
|
|
149
|
+
`${theme.label("Short exposure:")} ${formatPercentDirect(data.short_exposure_pct)}`,
|
|
150
|
+
`${theme.label("Net exposure:")} ${formatPercentDirect(data.total_weight_pct)}`,
|
|
151
|
+
"",
|
|
152
|
+
theme.label("Holdings"),
|
|
153
|
+
...data.holdings.map(item => ` - ${item.ticker}: weight=${formatPercentDirect(item.weight_pct)}, beta=${formatNullableNumber(item.beta)}, weighted=${formatNullableNumber(item.weighted_beta)}, corr=${formatNullableNumber(item.correlation)}`),
|
|
154
|
+
];
|
|
155
|
+
pushNotes(lines, "Assumptions", data.assumptions, theme);
|
|
156
|
+
pushNotes(lines, "Warnings", data.warnings, theme);
|
|
157
|
+
return lines.join("\n");
|
|
158
|
+
}
|
|
159
|
+
export function formatVarHuman(data, theme = createTerminalTheme(process.stdout)) {
|
|
160
|
+
const lines = [
|
|
161
|
+
theme.label("Portfolio VaR"),
|
|
162
|
+
"",
|
|
163
|
+
formatSourceLabel(data, theme),
|
|
164
|
+
`${theme.label("Lookback:")} ${data.lookback_years}Y`,
|
|
165
|
+
`${theme.label("Confidence:")} ${formatPercentDirect(data.confidence_pct)}`,
|
|
166
|
+
`${theme.label("Horizon:")} ${data.time_horizon}`,
|
|
167
|
+
"",
|
|
168
|
+
`${theme.label("VaR:")} ${formatPercentValue(data.var)}`,
|
|
169
|
+
`${theme.label("Long exposure:")} ${formatPercentDirect(data.long_exposure_pct)}`,
|
|
170
|
+
`${theme.label("Short exposure:")} ${formatPercentDirect(data.short_exposure_pct)}`,
|
|
171
|
+
`${theme.label("Net exposure:")} ${formatPercentDirect(data.total_weight_pct)}`,
|
|
172
|
+
"",
|
|
173
|
+
theme.label("Holdings"),
|
|
174
|
+
...data.holdings.map(item => ` - ${item.ticker}: weight=${formatPercentDirect(item.weight_pct)}`),
|
|
175
|
+
"",
|
|
176
|
+
`${theme.label("Histogram bins:")} ${formatInteger(data.histogram_data.length)}`,
|
|
177
|
+
];
|
|
178
|
+
pushNotes(lines, "Assumptions", data.assumptions, theme);
|
|
179
|
+
pushNotes(lines, "Warnings", data.warnings, theme);
|
|
180
|
+
return lines.join("\n");
|
|
181
|
+
}
|
|
182
|
+
export function parseAssetSpec(rawAsset) {
|
|
183
|
+
const normalized = rawAsset.trim();
|
|
184
|
+
if (!normalized) {
|
|
185
|
+
throw createCliValidationError("Asset input cannot be empty.");
|
|
186
|
+
}
|
|
187
|
+
const parts = normalized.split(":");
|
|
188
|
+
if (parts.length > 2) {
|
|
189
|
+
throw createCliValidationError(`Invalid asset input "${rawAsset}". Use TICKER[:WEIGHT_PCT].`);
|
|
190
|
+
}
|
|
191
|
+
const [rawTicker, rawWeight] = parts;
|
|
192
|
+
const ticker = rawTicker?.trim().toUpperCase();
|
|
193
|
+
if (!ticker) {
|
|
194
|
+
throw createCliValidationError(`Invalid asset input "${rawAsset}". Use TICKER[:WEIGHT_PCT].`);
|
|
195
|
+
}
|
|
196
|
+
if (rawWeight === undefined) {
|
|
197
|
+
return { ticker, weight_pct: null };
|
|
198
|
+
}
|
|
199
|
+
const weight_pct = Number(rawWeight.trim());
|
|
200
|
+
if (!Number.isFinite(weight_pct)) {
|
|
201
|
+
throw createCliValidationError(`Invalid asset weight in "${rawAsset}". Use TICKER[:WEIGHT_PCT].`);
|
|
202
|
+
}
|
|
203
|
+
return { ticker, weight_pct };
|
|
204
|
+
}
|
|
205
|
+
function resolveAnalyticsSource(portfolioId, assets) {
|
|
206
|
+
const hasPortfolio = portfolioId !== undefined;
|
|
207
|
+
const hasAssets = assets.length > 0;
|
|
208
|
+
if (hasPortfolio === hasAssets) {
|
|
209
|
+
throw createCliValidationError("Use exactly one source: --portfolio <id> or one or more --asset TICKER[:WEIGHT_PCT].");
|
|
210
|
+
}
|
|
211
|
+
if (hasPortfolio) {
|
|
212
|
+
return { portfolio_id: portfolioId };
|
|
213
|
+
}
|
|
214
|
+
return {
|
|
215
|
+
assets: assets.map(parseAssetSpec),
|
|
216
|
+
};
|
|
217
|
+
}
|
|
218
|
+
function collectStringOption(value, previous) {
|
|
219
|
+
previous.push(value);
|
|
220
|
+
return previous;
|
|
221
|
+
}
|
|
222
|
+
function parsePositiveIntegerOption(value) {
|
|
223
|
+
const normalized = value.trim();
|
|
224
|
+
if (!/^\d+$/.test(normalized)) {
|
|
225
|
+
throw createCliValidationError("Value must be a positive integer.");
|
|
226
|
+
}
|
|
227
|
+
const parsed = Number(normalized);
|
|
228
|
+
if (!Number.isSafeInteger(parsed) || parsed <= 0) {
|
|
229
|
+
throw createCliValidationError("Value must be a positive integer.");
|
|
230
|
+
}
|
|
231
|
+
return parsed;
|
|
232
|
+
}
|
|
233
|
+
function parseYearsOption(value) {
|
|
234
|
+
const parsed = parsePositiveIntegerOption(value);
|
|
235
|
+
if (![1, 3, 5].includes(parsed)) {
|
|
236
|
+
throw createCliValidationError("Years must be one of: 1, 3, 5.");
|
|
237
|
+
}
|
|
238
|
+
return parsed;
|
|
239
|
+
}
|
|
240
|
+
function parseNumberOption(value, fieldName) {
|
|
241
|
+
const parsed = Number(value.trim());
|
|
242
|
+
if (!Number.isFinite(parsed)) {
|
|
243
|
+
throw createCliValidationError(`${fieldName} must be a number.`);
|
|
244
|
+
}
|
|
245
|
+
return parsed;
|
|
246
|
+
}
|
|
247
|
+
function formatSourceLabel(data, theme) {
|
|
248
|
+
if (data.source_type === "saved_portfolio" && data.portfolio_id !== null) {
|
|
249
|
+
const name = data.portfolio_name ? ` · ${data.portfolio_name}` : "";
|
|
250
|
+
return `${theme.bold(String(data.portfolio_id))}${theme.dim(name)}`;
|
|
251
|
+
}
|
|
252
|
+
return theme.bold("Ad-hoc basket");
|
|
253
|
+
}
|
|
254
|
+
function pushNotes(lines, title, items, theme) {
|
|
255
|
+
if (items.length === 0) {
|
|
256
|
+
return;
|
|
257
|
+
}
|
|
258
|
+
lines.push("");
|
|
259
|
+
lines.push(theme.label(title));
|
|
260
|
+
for (const item of items) {
|
|
261
|
+
lines.push(` - ${item}`);
|
|
262
|
+
}
|
|
263
|
+
}
|
|
264
|
+
function formatNumber(value) {
|
|
265
|
+
return new Intl.NumberFormat("en-US", {
|
|
266
|
+
maximumFractionDigits: 4,
|
|
267
|
+
}).format(value);
|
|
268
|
+
}
|
|
269
|
+
function formatInteger(value) {
|
|
270
|
+
return new Intl.NumberFormat("en-US", {
|
|
271
|
+
maximumFractionDigits: 0,
|
|
272
|
+
}).format(value);
|
|
273
|
+
}
|
|
274
|
+
function formatNullableNumber(value) {
|
|
275
|
+
if (value === null) {
|
|
276
|
+
return "n/a";
|
|
277
|
+
}
|
|
278
|
+
return formatNumber(value);
|
|
279
|
+
}
|
|
280
|
+
function formatPercentValue(value) {
|
|
281
|
+
return `${new Intl.NumberFormat("en-US", {
|
|
282
|
+
maximumFractionDigits: 2,
|
|
283
|
+
minimumFractionDigits: 2,
|
|
284
|
+
}).format(value * 100)}%`;
|
|
285
|
+
}
|
|
286
|
+
function formatPercentDirect(value) {
|
|
287
|
+
return `${new Intl.NumberFormat("en-US", {
|
|
288
|
+
maximumFractionDigits: 2,
|
|
289
|
+
minimumFractionDigits: 2,
|
|
290
|
+
}).format(value)}%`;
|
|
291
|
+
}
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
import { Command } from "commander";
|
|
2
|
+
import type { JsonValue } from "../vendor/core/index.js";
|
|
3
|
+
import { assetOverviewSections } from "../vendor/core/capabilities/index.js";
|
|
4
|
+
import { type CliInvokeContext } from "../cli/client.js";
|
|
5
|
+
import { type TerminalWriter } from "../cli/terminal.js";
|
|
6
|
+
export interface AssetsCommandIO {
|
|
7
|
+
stdout: TerminalWriter;
|
|
8
|
+
}
|
|
9
|
+
export interface AssetOverviewCommandOptions {
|
|
10
|
+
sections: string;
|
|
11
|
+
json?: boolean;
|
|
12
|
+
}
|
|
13
|
+
export interface AssetOverviewResponse {
|
|
14
|
+
asset: AssetOverviewAssetInfo | null;
|
|
15
|
+
as_of: AssetOverviewAsOfInfo | null;
|
|
16
|
+
price: AssetOverviewPrice | null;
|
|
17
|
+
performance: AssetOverviewValueItem[] | null;
|
|
18
|
+
momentum: AssetOverviewMomentumItem[] | null;
|
|
19
|
+
technicals: Record<string, JsonValue> | null;
|
|
20
|
+
risk: Record<string, JsonValue> | null;
|
|
21
|
+
fundamentals: Record<string, JsonValue> | null;
|
|
22
|
+
rankings: AssetOverviewRankingItem[] | null;
|
|
23
|
+
candles: JsonValue[] | null;
|
|
24
|
+
}
|
|
25
|
+
interface AssetOverviewAssetInfo {
|
|
26
|
+
symbol: string;
|
|
27
|
+
name?: string | null;
|
|
28
|
+
type?: string | null;
|
|
29
|
+
}
|
|
30
|
+
interface AssetOverviewAsOfInfo {
|
|
31
|
+
price_date: string;
|
|
32
|
+
last_updated: string;
|
|
33
|
+
}
|
|
34
|
+
interface AssetOverviewPrice {
|
|
35
|
+
close: number;
|
|
36
|
+
open: number;
|
|
37
|
+
high: number;
|
|
38
|
+
low: number;
|
|
39
|
+
volume: number | null;
|
|
40
|
+
prev_close?: number | null;
|
|
41
|
+
change_pct?: number | null;
|
|
42
|
+
}
|
|
43
|
+
interface AssetOverviewValueItem {
|
|
44
|
+
id: string;
|
|
45
|
+
label: string;
|
|
46
|
+
value?: number | null;
|
|
47
|
+
}
|
|
48
|
+
interface AssetOverviewMomentumItem {
|
|
49
|
+
id: string;
|
|
50
|
+
label: string;
|
|
51
|
+
regression_type: string;
|
|
52
|
+
momentum?: number | null;
|
|
53
|
+
r_squared?: number | null;
|
|
54
|
+
}
|
|
55
|
+
interface AssetOverviewRankingItem {
|
|
56
|
+
id: string;
|
|
57
|
+
label: string;
|
|
58
|
+
position?: number | null;
|
|
59
|
+
total?: number | null;
|
|
60
|
+
}
|
|
61
|
+
export interface AssetsCommandContext extends CliInvokeContext {
|
|
62
|
+
io?: AssetsCommandIO;
|
|
63
|
+
}
|
|
64
|
+
export declare function registerAssetsCommands(program: Command, context?: AssetsCommandContext): void;
|
|
65
|
+
export declare function runAssetOverviewCommand(ticker: string, options: AssetOverviewCommandOptions, context?: AssetsCommandContext): Promise<void>;
|
|
66
|
+
export declare function parseAssetOverviewSections(rawSections: string): (typeof assetOverviewSections)[number][];
|
|
67
|
+
export declare function formatAssetOverviewHuman(data: AssetOverviewResponse, sections: readonly (typeof assetOverviewSections)[number][], theme?: import("../cli/terminal.js").TerminalTheme): string;
|
|
68
|
+
export {};
|
|
69
|
+
//# sourceMappingURL=assets.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"assets.d.ts","sourceRoot":"","sources":["../../src/commands/assets.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW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