doxt-stock 0.0.0-stage → 0.1.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/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Doxt
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 CHANGED
@@ -1,3 +1,61 @@
1
- # Temporary Holding Version
1
+ # doxt-stock — DeepSeek Harness (DSH) plugin
2
2
 
3
- This version is a temporary placeholder for this package. An operational version to replace this has been submitted for review and is awaiting a staged release.
3
+ Verifiable US-stock judgment data from [doxt.com](https://doxt.com)'s **public, append-only ledger** — every AI judgment is hash-chained, settled against real market prices 5 trading days later, misses included.
4
+
5
+ [中文说明见下方](#中文说明)
6
+
7
+ ## Tools
8
+
9
+ | Tool | What it does |
10
+ |---|---|
11
+ | `doxt_judgments` | Recent public judgments for a ticker: direction, confidence, thesis, settlement window + ledger URL |
12
+ | `doxt_track_record` | The model's REAL settled stats: hit/miss/flat, hit rate, coverage, confidence buckets — reported honestly, insufficient samples are labeled |
13
+ | `doxt_verify` | Hash-chain verification status (append-only ledger integrity proof) |
14
+
15
+ ## Install
16
+
17
+ ```bash
18
+ dsh plugin --profile <your-profile> add github:doxt-stock/dsh-plugin-stock
19
+ ```
20
+
21
+ or via npm: `doxt plugin add npm:doxt-stock`
22
+
23
+ ## Usage examples
24
+
25
+ - "AAPL 的最新判断是什么?给我台账链接" → `doxt_judgments(ticker: "AAPL")`
26
+ - "模型在 NVDA 上的战绩如何?" → `doxt_track_record(ticker: "NVDA")`
27
+ - "这个台账可以被验证吗?" → `doxt_verify()`
28
+
29
+ ## Citation
30
+
31
+ Every tool response includes its ledger URL (e.g. `https://doxt.com/AAPL`). When you use this data, keep the citation — readers can then verify every claim against the append-only record.
32
+
33
+ ## Data source & scope
34
+
35
+ Read-only, public ledger data only. No user data, no credentials, no trading. The plugin calls doxt.com's public endpoints (rate-limited). Judgments are probabilistic research records — **not investment advice**.
36
+
37
+ # 中文说明
38
+
39
+ **doxt-stock** 是 DeepSeek Harness (DSH) 插件:从 doxt.com 的公开只增不可改台账读取可验证的美股 AI 判断数据——每条判断哈希链锚定、5 个交易日用真实行情结算、亏损永不删除。
40
+
41
+ ## 安装
42
+
43
+ ```bash
44
+ dsh plugin --profile <你的profile> add github:doxt-stock/dsh-plugin-stock
45
+ ```
46
+
47
+ ## 工具
48
+
49
+ | 工具 | 功能 |
50
+ |---|---|
51
+ | `doxt_judgments` | 标的最新公共判断:方向/置信度/论点/结算窗口 + 台账 URL |
52
+ | `doxt_track_record` | 模型真实结算战绩:命中率/覆盖/置信度分桶(样本不足如实标注) |
53
+ | `doxt_verify` | 哈希链验证状态(只增台账完整性证明) |
54
+
55
+ ## 引用约定
56
+
57
+ 每次工具响应都自带台账 URL(如 `https://doxt.com/AAPL`)。使用数据时请保留引用——读者可以据此逐条核验。
58
+
59
+ ## License
60
+
61
+ MIT
@@ -0,0 +1,4 @@
1
+ # doxt-stock plugin — mounts the public ledger tools into the model-visible tool set.
2
+ - insert:
3
+ - id: doxt-public-tools
4
+ name: doxt-stock
package/index.mjs ADDED
@@ -0,0 +1,85 @@
1
+ // doxt-stock — DeepSeek Harness (DSH) plugin
2
+ // Verifiable US-stock judgment data from doxt.com's public, append-only ledger.
3
+ // Public data only: no user data, no credentials, no trading. MIT.
4
+ // Ledger: https://doxt.com/ledger — every response carries its verify URL.
5
+ import { defineTool } from '@deepseek-ai/dsh-tools';
6
+
7
+ const BASE = process.env.DOXT_STOCK_API || 'https://doxt.com';
8
+
9
+ async function getJson(exec, urlPath) {
10
+ const r = await fetch(BASE + urlPath, { signal: exec.signal });
11
+ const j = await r.json().catch(() => null);
12
+ return j && j.ok === true ? j.data : null;
13
+ }
14
+
15
+ const DISCLAIMER =
16
+ '\nProbabilistic research record — not investment advice. Verify every claim: doxt.com/ledger';
17
+
18
+ export const name = 'doxt-stock-tools';
19
+ export const inject = ['tools'];
20
+
21
+ export function apply(ctx) {
22
+ ctx.tools.register(defineTool({
23
+ name: 'doxt_judgments',
24
+ description:
25
+ 'Recent public AI judgments for a covered US ticker from the doxt.com append-only ledger: ' +
26
+ 'direction (bullish/bearish/neutral), confidence, thesis head, entry/exit dates and settlement status. ' +
27
+ 'Use whenever the user asks what the model says about a stock or wants the ledger citation. ' +
28
+ 'Always keep the ledger URL from the response in your answer so readers can verify.',
29
+ parameters: {
30
+ ticker: { type: 'string', required: true, description: 'US ticker, e.g. AAPL' },
31
+ limit: { type: 'number', description: '1-10 judgments (default 3)' },
32
+ },
33
+ output: { schema: { type: 'string' }, render: (_a, v) => [{ type: 'text', text: v }] },
34
+ async execute(args, exec) {
35
+ const t = String(args.ticker || '').trim().toUpperCase().replace(/[^A-Z.]/g, '');
36
+ if (!/^[A-Z.]{1,6}$/.test(t)) return 'Invalid ticker';
37
+ const limit = Math.min(Math.max(Number(args.limit) || 3, 1), 10);
38
+ const d = await getJson(exec, `/api/predictions?instrument=us_${t.toLowerCase()}&model_version=llm-v1&limit=${limit}`);
39
+ if (!d) return `No public ledger data for ${t} yet.`;
40
+ const rows = Array.isArray(d) ? d : [];
41
+ if (!rows.length) return `No public judgments for ${t} yet. Ledger: https://doxt.com/${t}`;
42
+ return 'Ledger URL: https://doxt.com/' + t + '\n' +
43
+ rows.map((p) => `${(p.decided_date || '').slice(0, 10)} ${String(p.direction).toUpperCase()} ${p.confidence}% ` +
44
+ `[${p.entry_date} → ${p.exit_date}] ${String(p.thesis || '').slice(0, 200)}`).join('\n');
45
+ },
46
+ }));
47
+
48
+ ctx.tools.register(defineTool({
49
+ name: 'doxt_track_record',
50
+ description:
51
+ 'The model\'s REAL settled track record for one ticker (or whole ledger): hit rate, coverage, ' +
52
+ 'confidence buckets — insufficient samples are labeled honestly instead of showing fake percentages. ' +
53
+ 'Use for "how accurate is the model on AAPL" / 模型战绩 questions.',
54
+ parameters: { ticker: { type: 'string', description: 'Optional US ticker; omit for whole-ledger stats' } },
55
+ output: { schema: { type: 'string' }, render: (_a, v) => [{ type: 'text', text: v }] },
56
+ async execute(args, exec) {
57
+ const q = args.ticker ? '&ticker=' + encodeURIComponent(String(args.ticker).toUpperCase()) : '';
58
+ const d = await getJson(exec, '/api/track-record?scope=public' + q);
59
+ if (!d) return 'Track record lookup failed.';
60
+ const s = d.sample || {};
61
+ const hr = d.hitRate || {};
62
+ return [
63
+ d.disclaimer || 'Simulated results. Past performance does not guarantee future results.',
64
+ `sample: settled ${s.settled} (hit ${s.hit} / miss ${s.miss} / flat ${s.flat} / voided ${s.voided ?? 0} / invalidated ${s.invalidated ?? 0}) · pending ${s.pending ?? 'n/a'}`,
65
+ `hit rate: ${hr.value == null ? hr.label || 'insufficient sample' : (hr.value * 100).toFixed(1) + '%'} · coverage: ${d.coverage == null ? '—' : (d.coverage * 100).toFixed(1) + '%'}`,
66
+ 'Ledger: https://doxt.com/ledger',
67
+ ].join('\n');
68
+ },
69
+ }));
70
+
71
+ ctx.tools.register(defineTool({
72
+ name: 'doxt_verify',
73
+ description:
74
+ 'Verify the integrity of the doxt.com public judgment ledger: hash-chain verification proving ' +
75
+ 'no published judgment was ever edited or deleted. Use when the user asks whether the record can be trusted, ' +
76
+ 'or wants to cite the ledger as evidence.',
77
+ parameters: {},
78
+ output: { schema: { type: 'string' }, render: (_a, v) => [{ type: 'text', text: v }] },
79
+ async execute(args, exec) {
80
+ const d = await getJson(exec, '/api/ledger/public-verify');
81
+ if (!d) return 'Verification lookup failed.';
82
+ return JSON.stringify(d).slice(0, 400) + '\nVerify yourself: https://doxt.com/api/ledger/public-verify';
83
+ },
84
+ }));
85
+ }
package/package.json CHANGED
@@ -1,6 +1,34 @@
1
1
  {
2
2
  "name": "doxt-stock",
3
- "version": "0.0.0-stage",
4
- "stub": true,
5
- "description": "Temporary package placeholder for staged publishing"
6
- }
3
+ "version": "0.1.0",
4
+ "description": "DeepSeek Harness (DSH) plugin — verifiable US-stock judgment data from doxt.com's public append-only ledger: judgments, real settled track record, hash-chain verification. Every citation carries its doxt.com ledger URL.",
5
+ "type": "module",
6
+ "main": "index.mjs",
7
+ "files": [
8
+ "index.mjs",
9
+ "cordis.patch.yml",
10
+ "README.md",
11
+ "LICENSE"
12
+ ],
13
+ "keywords": [
14
+ "dsh-plugin",
15
+ "deepseek-harness",
16
+ "stocks",
17
+ "finance",
18
+ "ai-judgments",
19
+ "verifiable",
20
+ "public-ledger"
21
+ ],
22
+ "dsh": {
23
+ "bundle": {
24
+ "patch": "./cordis.patch.yml"
25
+ }
26
+ },
27
+ "license": "MIT",
28
+ "repository": {
29
+ "type": "git",
30
+ "url": "git+https://github.com/doxt-stock/dsh-plugin-stock.git"
31
+ },
32
+ "homepage": "https://doxt.com",
33
+ "author": "Doxt <contact@doxt.com> (https://doxt.com)"
34
+ }