feat: bootstrap personal stock agent

This commit is contained in:
2026-05-11 21:10:55 +08:00
commit 437565c16c
21 changed files with 5014 additions and 0 deletions

19
tests/symbols.test.ts Normal file
View File

@@ -0,0 +1,19 @@
import { describe, expect, it } from "vitest";
import { normalizeSymbol } from "../src/agent/symbols";
describe("normalizeSymbol", () => {
it.each([
["600519", { symbol: "600519", market: "CN", display: "600519.SS" }],
["000001.SZ", { symbol: "000001", market: "CN", display: "000001.SZ" }],
["00700.hk", { symbol: "00700", market: "HK", display: "00700.HK" }],
["AAPL", { symbol: "AAPL", market: "US", display: "AAPL" }],
["msft.us", { symbol: "MSFT", market: "US", display: "MSFT" }]
])("normalizes %s", (input, expected) => {
expect(normalizeSymbol(input)).toEqual(expected);
});
it("rejects empty and unsupported symbols", () => {
expect(() => normalizeSymbol("")).toThrow("Stock symbol is required");
expect(() => normalizeSymbol("!!!")).toThrow("Unsupported stock symbol");
});
});