tn-financial-data 0.1.1
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/LICENSE +21 -0
- package/README.md +164 -0
- package/dist/cli.js +2054 -0
- package/dist/client/index.d.ts +747 -0
- package/dist/client/index.js +228 -0
- package/package.json +50 -0
- package/skills/tn-financial-data/SKILL.md +91 -0
- package/skills/tn-financial-data/agents/claude.md +8 -0
- package/skills/tn-financial-data/agents/openai.yaml +7 -0
- package/skills/tn-financial-data/agents/opencode.md +11 -0
- package/skills/tn-financial-data/references/cli.md +326 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 moonshot6666
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
ADDED
|
@@ -0,0 +1,164 @@
|
|
|
1
|
+
# tn-financial-data
|
|
2
|
+
|
|
3
|
+
Hosted US equity financial data for agents.
|
|
4
|
+
|
|
5
|
+
`tn-financial-data` is the published agent-facing surface for the hosted API:
|
|
6
|
+
|
|
7
|
+
- `tn-financial-data query ...`
|
|
8
|
+
- `tn-financial-data skill ...`
|
|
9
|
+
- `tn-financial-data describe opencli`
|
|
10
|
+
- a typed TypeScript client from `tn-financial-data`
|
|
11
|
+
|
|
12
|
+
The package does not bundle your API key.
|
|
13
|
+
The installed package does not read project-local `.env` files. Pass credentials with CLI flags or environment variables in the invoking process.
|
|
14
|
+
|
|
15
|
+
## Requires API Access
|
|
16
|
+
|
|
17
|
+
Installing the package is not enough for live reads.
|
|
18
|
+
|
|
19
|
+
- You need a valid `TN_FINANCIAL_DATA_API_KEY` or `--api-key <key>`
|
|
20
|
+
- `skill install` only installs the packaged skill bundle; it does not provision API access
|
|
21
|
+
- the agent or CLI process itself must see the API key in its runtime environment
|
|
22
|
+
- the default hosted base URL is `https://api.truenorth-financial.ai/v1`
|
|
23
|
+
|
|
24
|
+
This package is the hosted agent-facing surface only. The repo's website, local playground, self-hosting runtime, and local TradingView prototype tooling are intentionally outside the npm contract.
|
|
25
|
+
|
|
26
|
+
## Features
|
|
27
|
+
|
|
28
|
+
- Company facts, financials, prices, news, insider trades, ownership, and global rates through one hosted API
|
|
29
|
+
- Agent-friendly CLI with JSON output and self-description via `tn-financial-data describe opencli`
|
|
30
|
+
- Packaged skill bundle for Claude and OpenCode installs
|
|
31
|
+
- Typed TypeScript client from the root package export
|
|
32
|
+
- Stable production default at `https://api.truenorth-financial.ai/v1`
|
|
33
|
+
|
|
34
|
+
## Installation
|
|
35
|
+
|
|
36
|
+
```bash
|
|
37
|
+
npm install -g tn-financial-data
|
|
38
|
+
|
|
39
|
+
export TN_FINANCIAL_DATA_API_KEY=<your-api-key>
|
|
40
|
+
tn-financial-data query available-tickers
|
|
41
|
+
```
|
|
42
|
+
|
|
43
|
+
Live reads accept:
|
|
44
|
+
|
|
45
|
+
- `--api-key <key>`
|
|
46
|
+
- `TN_FINANCIAL_DATA_API_KEY`
|
|
47
|
+
- `TN_FINANCIAL_DATA_API_KEYS`
|
|
48
|
+
|
|
49
|
+
Optional base URL override:
|
|
50
|
+
|
|
51
|
+
- `TN_FINANCIAL_DATA_API_BASE_URL`
|
|
52
|
+
|
|
53
|
+
The published CLI reads those values from the current process environment only.
|
|
54
|
+
|
|
55
|
+
Production default:
|
|
56
|
+
|
|
57
|
+
```text
|
|
58
|
+
https://api.truenorth-financial.ai/v1
|
|
59
|
+
```
|
|
60
|
+
|
|
61
|
+
## Quick Start
|
|
62
|
+
|
|
63
|
+
```bash
|
|
64
|
+
tn-financial-data query available-tickers
|
|
65
|
+
tn-financial-data query company --ticker AAPL
|
|
66
|
+
tn-financial-data query general-overview --ticker AAPL --period quarterly --financial-limit 4 --news-limit 5
|
|
67
|
+
tn-financial-data skill install --tool claude
|
|
68
|
+
tn-financial-data describe opencli
|
|
69
|
+
```
|
|
70
|
+
|
|
71
|
+
Ownership semantics:
|
|
72
|
+
|
|
73
|
+
- `institutional-ownership` is issuer-centric: ticker to holders
|
|
74
|
+
- `investor-portfolio` is investor-centric: filer to holdings via SEC 13F
|
|
75
|
+
|
|
76
|
+
## Commands
|
|
77
|
+
|
|
78
|
+
| Command | Description |
|
|
79
|
+
| --- | --- |
|
|
80
|
+
| `tn-financial-data query ...` | Hosted reads over the stable API contract |
|
|
81
|
+
| `tn-financial-data skill install` | Install the packaged skill bundle |
|
|
82
|
+
| `tn-financial-data skill print` | Print the packaged skill or adapter metadata |
|
|
83
|
+
| `tn-financial-data describe opencli` | Emit machine-readable CLI metadata for agents |
|
|
84
|
+
|
|
85
|
+
Common query examples:
|
|
86
|
+
|
|
87
|
+
```bash
|
|
88
|
+
tn-financial-data query financials --ticker AAPL --period annual --statement all
|
|
89
|
+
tn-financial-data query financial-metrics --ticker AAPL --period annual --limit 4
|
|
90
|
+
tn-financial-data query earnings --ticker AAPL --period quarterly --limit 8
|
|
91
|
+
tn-financial-data query quarterly-highlights --ticker AAPL
|
|
92
|
+
tn-financial-data query prices --ticker AAPL --interval day --start-date 2025-01-01 --end-date 2025-01-31
|
|
93
|
+
tn-financial-data query institutional-ownership --ticker AAPL --limit 20
|
|
94
|
+
tn-financial-data query investor-portfolio --investor vanguard --limit 20
|
|
95
|
+
tn-financial-data query global-rates --series ecb_refi,boe_sonia --limit 10
|
|
96
|
+
tn-financial-data query screen --filter "trailing_pe < 25" --filter "recommendation_key = buy" --limit 10
|
|
97
|
+
```
|
|
98
|
+
|
|
99
|
+
## Skill Usage
|
|
100
|
+
|
|
101
|
+
Install the packaged skill bundle:
|
|
102
|
+
|
|
103
|
+
```bash
|
|
104
|
+
tn-financial-data skill install --tool opencode
|
|
105
|
+
tn-financial-data skill install --tool claude
|
|
106
|
+
```
|
|
107
|
+
|
|
108
|
+
OpenCode quick start after install:
|
|
109
|
+
|
|
110
|
+
```bash
|
|
111
|
+
export TN_FINANCIAL_DATA_API_KEY=<your-api-key>
|
|
112
|
+
opencode run "Use tn-financial-data to summarize AAPL."
|
|
113
|
+
```
|
|
114
|
+
|
|
115
|
+
If you want to test against a non-default deployment, pass the base URL in the same process environment:
|
|
116
|
+
|
|
117
|
+
```bash
|
|
118
|
+
export TN_FINANCIAL_DATA_API_BASE_URL=https://your-host.example.com/v1
|
|
119
|
+
opencode run "Use tn-financial-data to list available tickers."
|
|
120
|
+
```
|
|
121
|
+
|
|
122
|
+
Print the packaged skill or adapter metadata:
|
|
123
|
+
|
|
124
|
+
```bash
|
|
125
|
+
tn-financial-data skill print
|
|
126
|
+
tn-financial-data skill print --adapter openai
|
|
127
|
+
```
|
|
128
|
+
|
|
129
|
+
Describe the CLI for tool-aware runtimes:
|
|
130
|
+
|
|
131
|
+
```bash
|
|
132
|
+
tn-financial-data describe opencli
|
|
133
|
+
```
|
|
134
|
+
|
|
135
|
+
Installing the skill bundle does not provision API access. Agents still need the same runtime credential for live reads.
|
|
136
|
+
For OpenCode, that means the `opencode` process itself must see `TN_FINANCIAL_DATA_API_KEY` in its environment.
|
|
137
|
+
|
|
138
|
+
## Agent Integration
|
|
139
|
+
|
|
140
|
+
Agents only need two surfaces:
|
|
141
|
+
|
|
142
|
+
```bash
|
|
143
|
+
tn-financial-data describe opencli
|
|
144
|
+
tn-financial-data query <resource> [options]
|
|
145
|
+
```
|
|
146
|
+
|
|
147
|
+
`describe opencli` exposes the command surface in a machine-readable form for tool-aware runtimes.
|
|
148
|
+
|
|
149
|
+
## TypeScript Client
|
|
150
|
+
|
|
151
|
+
```ts
|
|
152
|
+
import { TnFinancialData } from "tn-financial-data";
|
|
153
|
+
|
|
154
|
+
const client = new TnFinancialData({
|
|
155
|
+
apiKey: process.env.TN_FINANCIAL_DATA_API_KEY!,
|
|
156
|
+
});
|
|
157
|
+
|
|
158
|
+
const company = await client.getCompanyFacts({ ticker: "AAPL" });
|
|
159
|
+
console.log(company.company_facts.name);
|
|
160
|
+
```
|
|
161
|
+
|
|
162
|
+
## Package Scope
|
|
163
|
+
|
|
164
|
+
The published npm package is intentionally limited to agent-facing surfaces. Repository-specific website, local playground, and self-hosting workflows live in the GitHub repository, not in the npm contract.
|