Release v0.2.0: schema-first types, live-verified release gate, 56 AI tools#16
Merged
Conversation
…ic mocked tests fmp-node-types is now schema-first: Zod schemas are canonical and TS types are derived via z.infer (zod runtime dep; ts-to-zod bootstraps generation via gen:schemas). All 16 categories converted, with ~25 corrections to match the live FMP API (string-vs-number, nullable fields, added/removed fields, MarketIndex reshaped to the /quotes/index quote shape, new IntradayPrice). Add a live-API shape-check tool (packages/api/scripts/live + src/live/validate.ts): validates all ~85 endpoint methods against the canonical schemas, classifying PASS/FAIL/SKIP/DRIFT; sequential with throttle, --max-calls budget, and --sample/--category/--dry-run flags. Run via 'pnpm test:live'. Classifier is unit-tested. Make the Jest suite fully mocked and deterministic (no network or API key): convert the 15 live endpoint integration tests to mocked unit tests (assert client path/version/params), remove integration.test.ts and utils/test-setup.ts, and drop the test:integration script. api 378 tests + tools 97 run in ~5s. Add a scheduled GitHub Action (live-check.yml) that runs the live drift check weekly (and on demand), keeping live calls off the PR path while mocked tests gate PRs. Docs: sync both READMEs and all 15 docs-site category pages to the corrected types; remove examples for non-existent methods (getFederalFundsRate, getSP500, searchCompany, etc.). Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Add APIResponse.errorType (plan-restricted | rate-limit | auth | not-found
| bad-request | network | unknown). The API client now reads FMP's real
error message from the response body and classifies failures via a shared
classifyError(); the live-check tool reuses the same classifier.
AI tools route every result through toToolResponse() and catch thrown
errors via toToolError(), so failures reach the model as a structured
{ error, type, message, status } object instead of null or a raw throw
(e.g. a missing FMP_API_KEY now reports type: auth).
Versions: fmp-node-types/fmp-node-api 0.2.0-beta.1, fmp-ai-tools 0.2.0-beta.4.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
…ified release gate Add three fmp-node-api categories (live-verified against the stable API): - analyst: getEstimates, getPriceTargetConsensus, getPriceTargetSummary, getGrades - valuation: getDiscountedCashFlow, getRatingSnapshot, getHistoricalRating - technical: getTechnicalIndicator (SMA/EMA/RSI/etc.) Plus six matching AI tools (count 43 -> 49), client memoization + configureFMPClient, and price-history/news/screener/search tools from the prior round. Schemas corrected to the real stable responses (analyst field names, price-target-summary *Count fields, DCF "Stock Price" key, optional rating date); getEstimates defaults period. Process: wire the live API shape-check (test:live) into the release path as a hard gate -- publish-packages runs it before version/publish, and the CI publish job runs it as its own step -- so a renamed/removed route can no longer ship. Always release via pnpm publish-packages. Versions: fmp-node-types/fmp-node-api 0.2.0-beta.4, fmp-ai-tools 0.2.0-beta.8. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Adds 7 endpoints (each with a matching AI tool; tool count 49 -> 56), all live-verified against the FMP Starter plan (test:live PASS, 0 drift): - fmp.financial: getFinancialScores (Altman Z + Piotroski), getKeyMetricsTTM, getFinancialRatiosTTM, getRevenueProductSegmentation, getRevenueGeographicSegmentation. - fmp.analyst: getGradesConsensus (buy/hold/sell counts + label). - fmp.company: getStockPeers (peers with price + market cap). Canonical Zod schemas in fmp-node-types (schema-first; full field sets captured from the live API before writing). New live-check manifest cases. Tools wired into both Vercel-AI and OpenAI providers; consistency test bumped to 56. Docs: extended financial + company pages, and added the first /docs/api/analyst page + sidebar entry (covers the whole analyst category, not just the new method). Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Exits Changesets pre-release mode and consolidates all 12 accumulated pre-release changesets into the first stable 0.2.0 of fmp-node-types, fmp-node-api, and fmp-ai-tools. The 0.2 line bundles: schema-first Zod types with live-API drift checks as a release gate, typed error classification surfaced through the AI tools (incl. plan-restricted), the shared-definitions tools refactor (one definition -> Vercel-AI + OpenAI provider adapters), client config + memoization, expanded coverage (search/price history/news/screener + analyst/valuation/technical categories), and the latest batch of 7 Starter-verified endpoints (financial scores, TTM key metrics/ratios, revenue segmentation, grades consensus, stock peers). Tool count: 56. Live-check: 0 drift across all 116 manifest cases. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
…Next CVEs Bumps the three apps to clear the critical/high Next.js CVEs and modernizes the rest of the dependency surface. - apps/docs, both example apps -> Next 16.2.x, React 19.2.x, latest @types. - apps/docs: eslint-config-next 16; switched lint to flat-config (Next 16 removed `next lint`). Added eslint.config.mjs using eslint-config-next/core-web-vitals. - apps/docs MDX: Next 16 builds with Turbopack by default, which requires serializable loader options. Switched remark-gfm to string-form plugin spec (`[['remark-gfm', {}]]`) so @next/mdx serializes cleanly. - apps/examples/*: migrated Tailwind v3 -> v4. Replaced `tailwindcss + autoprefixer` PostCSS plugins with `@tailwindcss/postcss`, collapsed the three @tailwind directives to `@import 'tailwindcss';`, deleted the empty tailwind.config.js files (v4 auto-detects content paths). Dropped `next lint` scripts (examples are demos with no lint config; lint:all now skips them cleanly via turbo). - Bumped apps/examples deps to latest minor: ai 6.0.191, @ai-sdk/openai 3.0.65, @ai-sdk/react 3.0.193, @openai/agents 0.11.5, zod 4.3.6. - Root: turbo 2.5.5 -> 2.9.16 (clears the moderate CVE on <=2.9.13). - Trivial JSX cleanup in docs (unescaped apostrophes; annotated the next-themes "mounted" effect for the new react-hooks/set-state-in-effect rule). Verification: build/type-check/lint:all/test all green across the 6 turbo tasks. pnpm audit: 130 -> 50 vulnerabilities (critical 4 -> 1, high 56 -> 23). Remaining 1 critical and most high advisories trace through packages/api > axios@1.10.0 > form-data@4.0.3; bumping axios to >=1.15.0 in packages/api is the fix and is tracked as a separate 0.2.1 patch release (apps cannot fix a vuln in a workspace-linked published package). Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Patch release for fmp-node-api 0.2.1 (axios security floor bump from ^1.6.2 to ^1.13.0, resolves to 1.16.x at install time). Clears three transitive advisories surfaced by `pnpm audit` against consumers: - Critical: form-data unsafe random boundary (GHSA-fjxv-7rqg-78g4) - High: axios DoS via missing data-size check (GHSA-4hjh-wcwx-xvwj) - Moderate: axios cloud-metadata exfiltration (GHSA-fvcv-3m26-pcqx) fmp-ai-tools 0.2.1 cascades automatically per Changesets' updateInternalDependencies=patch setting (workspace dep on fmp-node-api). fmp-node-types stays at 0.2.0 (no source change). No runtime API changes; verified via build/type-check/lint:all/test + test:live (50/50 PASS, 0 drift). Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
CI was failing on test (18.x) because Next 16 (introduced in the apps dep update) requires Node >=20.9.0, which 18.x can't satisfy. The fmp-docs build step errored with: You are using Node.js 18.20.8. For Next.js, Node.js version ">=20.9.0" is required. Node 18 reached end of life 2025-04 anyway, so dropping it is the right call independent of Next 16. New matrix: [20.x, 22.x] — current active LTS line plus the latest LTS. Root engines bumped to match the binding constraint (Next 16). Published packages don't have explicit engines and continue to work on older Node where their runtime deps allow it. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
First stable 0.2.0 of
fmp-node-types,fmp-node-api, andfmp-ai-tools— exits Changesets pre-release mode and promotes the work that's been on thebetanpm tag tolatest. A plainnpm install fmp-node-apifinally returns the 0.2 line.Spans 10 commits and 12 consolidated changesets. Highlights:
What's in 0.2.0
Schema-first types + live-verified release gate
fmp-node-typesnow ships Zod schemas as the source of truth; TypeScript types arez.infer<...>derived.pnpm test:livevalidates real FMP responses against the canonical schemas (sequential, throttled, budgeted; supports--category,--endpoint,--include-locked,--fail-on-drift).pnpm publish-packagesas a release gate — schemas that drift from the live API abort the publish. Scheduled weekly drift CI on top of it.Typed error classification, surfaced through the AI tools
APIResponsegainserrorType(plan-restricted | rate-limit | auth | not-found | bad-request | network | unknown).plan-restrictedinstead of a generic failure.{ error, type, message, status }on failure instead ofnull, so agents can explain why a call failed (e.g. "this data requires a higher FMP plan").Tools refactor (one definition, two providers)
packages/tools/src/definitions/<category>.ts; Vercel-AI and OpenAI providers are thin adapters that rebuild their public shape.defineTool({...})+ one export per provider. Adding a new provider = one adapter + oneproviders/<name>/index.ts.configureFMPClient({ apiKey, timeout })+ memoizedgetFMPClient()exported from both entry points.Expanded coverage
fmp.analyst(estimates, price targets, grades, grades consensus),fmp.valuation(DCF, ratings snapshot/historical),fmp.technical(SMA/EMA/RSI/…),fmp.search.getHistoricalPrice,getIntraday), news (stock/crypto/forex + by-symbol), screener, symbol search.financial.getFinancialScores(Altman Z + Piotroski),getKeyMetricsTTM,getFinancialRatiosTTM,getRevenueProductSegmentation,getRevenueGeographicSegmentation;analyst.getGradesConsensus;company.getStockPeers.Tool count: 49 → 56 (cross-provider consistency-tested).
Docs
financialandcompanypages for the new endpoints./docs/api/analystpage + sidebar entry documenting the full analyst category (estimates, both price-target endpoints, grades, grades consensus).Verification
pnpm build && pnpm type-check && pnpm lint:all && pnpm test— green (124 tests across 38 suites; cross-provider consistency at 56).pnpm test:live— 115/116 PASS, 0 drift against the live Starter-plan API.getCikMapperByName), beyond the default 50-call gate budget — does not block publish.Migration notes for consumers on
0.1.xAPIResponse.errorTypeis a new optional field; existing checks againstsuccess/data/errorkeep working.fmp-ai-toolsnow ships per-provider subpaths:fmp-ai-tools/vercel-aiandfmp-ai-tools/openai. The category groupings and individual tool exports are unchanged.fmp-node-typesnow exports Zod schemas alongside types. Existing type imports still work; schemas are additional.ai@6,@ai-sdk/*@3),@openai/agents@0.11.5, Zod 4.