@zhin.js/plugin-lottery 1.0.0 → 1.0.2
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 +25 -26
- package/agent/tools/compute_recommend.ts +2 -2
- package/agent/tools/get_model_state.ts +2 -2
- package/agent/tools/history.ts +2 -2
- package/agent/tools/list_pending.ts +2 -2
- package/agent/tools/save_prediction.ts +2 -2
- package/agent/tools/stats_snapshot.ts +2 -2
- package/agent/tools/sync.ts +2 -2
- package/commands/lottery/[game:string=].ts +25 -0
- package/commands/lottery-backtest/[game:string=].ts +34 -0
- package/commands/lottery-history/[game:string].ts +20 -0
- package/commands/lottery-stats/[game:string].ts +34 -0
- package/commands/lottery-today.ts +15 -0
- package/commands/lottery-train/[game:string=].ts +34 -0
- package/lib/command-helpers.d.ts +8 -0
- package/lib/command-helpers.d.ts.map +1 -0
- package/lib/command-helpers.js +24 -0
- package/lib/command-helpers.js.map +1 -0
- package/lib/config.d.ts +30 -0
- package/lib/config.d.ts.map +1 -0
- package/lib/config.js +52 -0
- package/lib/config.js.map +1 -0
- package/lib/db-store.d.ts +10 -0
- package/lib/db-store.d.ts.map +1 -0
- package/lib/db-store.js +30 -0
- package/lib/db-store.js.map +1 -0
- package/lib/evaluate/adaptive-sim.d.ts +1 -1
- package/lib/evaluate/adaptive-sim.d.ts.map +1 -1
- package/lib/evaluate/adaptive-sim.js +5 -1
- package/lib/evaluate/adaptive-sim.js.map +1 -1
- package/lib/evaluate/backtest.d.ts +1 -1
- package/lib/evaluate/backtest.d.ts.map +1 -1
- package/lib/evaluate/backtest.js.map +1 -1
- package/lib/evaluate/hit-rate.d.ts +0 -1
- package/lib/evaluate/hit-rate.d.ts.map +1 -1
- package/lib/evaluate/hit-rate.js +0 -2
- package/lib/evaluate/hit-rate.js.map +1 -1
- package/lib/evaluate/review-pending.d.ts +1 -1
- package/lib/evaluate/review-pending.d.ts.map +1 -1
- package/lib/evaluate/review-pending.js.map +1 -1
- package/lib/evaluate/tracker.d.ts +1 -2
- package/lib/evaluate/tracker.d.ts.map +1 -1
- package/lib/evaluate/tracker.js +4 -0
- package/lib/evaluate/tracker.js.map +1 -1
- package/lib/evaluate/train-weights.d.ts +2 -2
- package/lib/evaluate/train-weights.d.ts.map +1 -1
- package/lib/evaluate/train-weights.js.map +1 -1
- package/lib/evaluate/weight-guard.d.ts +1 -1
- package/lib/evaluate/weight-guard.d.ts.map +1 -1
- package/lib/evaluate/weight-guard.js.map +1 -1
- package/lib/games/kl8-groups.d.ts +0 -1
- package/lib/games/kl8-groups.d.ts.map +1 -1
- package/lib/games/kl8-groups.js +2 -2
- package/lib/games/kl8-groups.js.map +1 -1
- package/lib/index.d.ts +7 -2
- package/lib/index.d.ts.map +1 -1
- package/lib/index.js +5 -214
- package/lib/index.js.map +1 -1
- package/lib/{src/lottery-agent-deps.d.ts → lottery-agent-deps.d.ts} +2 -2
- package/lib/lottery-agent-deps.d.ts.map +1 -0
- package/lib/lottery-agent-deps.js +22 -0
- package/lib/lottery-agent-deps.js.map +1 -0
- package/lib/lottery-tool-handlers.d.ts.map +1 -0
- package/lib/{src/lottery-tool-handlers.js → lottery-tool-handlers.js} +3 -3
- package/lib/lottery-tool-handlers.js.map +1 -0
- package/lib/memory-db.d.ts +7 -0
- package/lib/memory-db.d.ts.map +1 -0
- package/lib/memory-db.js +49 -0
- package/lib/memory-db.js.map +1 -0
- package/lib/pipeline.d.ts +1 -4
- package/lib/pipeline.d.ts.map +1 -1
- package/lib/pipeline.js +6 -9
- package/lib/pipeline.js.map +1 -1
- package/lib/push.d.ts +13 -2
- package/lib/push.d.ts.map +1 -1
- package/lib/push.js +22 -29
- package/lib/push.js.map +1 -1
- package/lib/recommend/game-pick.d.ts +0 -1
- package/lib/recommend/game-pick.d.ts.map +1 -1
- package/lib/recommend/game-pick.js +2 -2
- package/lib/recommend/game-pick.js.map +1 -1
- package/lib/recommend/report.d.ts +3 -6
- package/lib/recommend/report.d.ts.map +1 -1
- package/lib/recommend/report.js +5 -27
- package/lib/recommend/report.js.map +1 -1
- package/lib/runtime-state.d.ts +12 -0
- package/lib/runtime-state.d.ts.map +1 -0
- package/lib/runtime-state.js +13 -0
- package/lib/runtime-state.js.map +1 -0
- package/lib/stats/engine.d.ts +1 -1
- package/lib/stats/engine.d.ts.map +1 -1
- package/lib/stats/engine.js.map +1 -1
- package/lib/stats/pro-analysis.d.ts +1 -1
- package/lib/stats/pro-analysis.d.ts.map +1 -1
- package/lib/stats/pro-analysis.js.map +1 -1
- package/lib/stats/weights.d.ts +0 -1
- package/lib/stats/weights.d.ts.map +1 -1
- package/lib/stats/weights.js.map +1 -1
- package/lib/sync/run-sync.d.ts +1 -1
- package/lib/sync/run-sync.d.ts.map +1 -1
- package/lib/sync/run-sync.js.map +1 -1
- package/package.json +30 -7
- package/plugin.ts +106 -0
- package/schema.json +52 -0
- package/src/command-helpers.ts +35 -0
- package/src/config.ts +83 -0
- package/src/db-store.ts +34 -0
- package/src/index.ts +13 -216
- package/src/lottery-agent-deps.ts +14 -4
- package/src/lottery-tool-handlers.ts +3 -3
- package/src/memory-db.ts +60 -0
- package/src/pipeline.ts +4 -11
- package/src/push.ts +32 -31
- package/src/recommend/report.ts +0 -30
- package/src/runtime-state.ts +23 -0
- package/agent/schedules/daily_pipeline.ts +0 -34
- package/lib/agent/agent.d.ts +0 -3
- package/lib/agent/agent.d.ts.map +0 -1
- package/lib/agent/agent.js +0 -6
- package/lib/agent/agent.js.map +0 -1
- package/lib/agent/run-turn.d.ts +0 -14
- package/lib/agent/run-turn.d.ts.map +0 -1
- package/lib/agent/run-turn.js +0 -47
- package/lib/agent/run-turn.js.map +0 -1
- package/lib/agent/schedules/daily_pipeline.d.ts +0 -3
- package/lib/agent/schedules/daily_pipeline.d.ts.map +0 -1
- package/lib/agent/schedules/daily_pipeline.js +0 -36
- package/lib/agent/schedules/daily_pipeline.js.map +0 -1
- package/lib/agent/tools/compute_recommend.d.ts +0 -5
- package/lib/agent/tools/compute_recommend.d.ts.map +0 -1
- package/lib/agent/tools/compute_recommend.js +0 -11
- package/lib/agent/tools/compute_recommend.js.map +0 -1
- package/lib/agent/tools/get_model_state.d.ts +0 -5
- package/lib/agent/tools/get_model_state.d.ts.map +0 -1
- package/lib/agent/tools/get_model_state.js +0 -11
- package/lib/agent/tools/get_model_state.js.map +0 -1
- package/lib/agent/tools/history.d.ts +0 -6
- package/lib/agent/tools/history.d.ts.map +0 -1
- package/lib/agent/tools/history.js +0 -24
- package/lib/agent/tools/history.js.map +0 -1
- package/lib/agent/tools/list_pending.d.ts +0 -5
- package/lib/agent/tools/list_pending.d.ts.map +0 -1
- package/lib/agent/tools/list_pending.js +0 -11
- package/lib/agent/tools/list_pending.js.map +0 -1
- package/lib/agent/tools/save_prediction.d.ts +0 -6
- package/lib/agent/tools/save_prediction.d.ts.map +0 -1
- package/lib/agent/tools/save_prediction.js +0 -14
- package/lib/agent/tools/save_prediction.js.map +0 -1
- package/lib/agent/tools/stats_snapshot.d.ts +0 -5
- package/lib/agent/tools/stats_snapshot.d.ts.map +0 -1
- package/lib/agent/tools/stats_snapshot.js +0 -11
- package/lib/agent/tools/stats_snapshot.js.map +0 -1
- package/lib/agent/tools/sync.d.ts +0 -5
- package/lib/agent/tools/sync.d.ts.map +0 -1
- package/lib/agent/tools/sync.js +0 -19
- package/lib/agent/tools/sync.js.map +0 -1
- package/lib/evals/pipeline_smoke.eval.d.ts +0 -3
- package/lib/evals/pipeline_smoke.eval.d.ts.map +0 -1
- package/lib/evals/pipeline_smoke.eval.js +0 -8
- package/lib/evals/pipeline_smoke.eval.js.map +0 -1
- package/lib/src/agent/prompts.d.ts +0 -11
- package/lib/src/agent/prompts.d.ts.map +0 -1
- package/lib/src/agent/prompts.js +0 -11
- package/lib/src/agent/prompts.js.map +0 -1
- package/lib/src/agent/read-skills.d.ts +0 -3
- package/lib/src/agent/read-skills.d.ts.map +0 -1
- package/lib/src/agent/read-skills.js +0 -25
- package/lib/src/agent/read-skills.js.map +0 -1
- package/lib/src/agent/run-turn.d.ts +0 -14
- package/lib/src/agent/run-turn.d.ts.map +0 -1
- package/lib/src/agent/run-turn.js +0 -47
- package/lib/src/agent/run-turn.js.map +0 -1
- package/lib/src/db.d.ts +0 -33
- package/lib/src/db.d.ts.map +0 -1
- package/lib/src/db.js +0 -108
- package/lib/src/db.js.map +0 -1
- package/lib/src/evaluate/adaptive-sim.d.ts +0 -31
- package/lib/src/evaluate/adaptive-sim.d.ts.map +0 -1
- package/lib/src/evaluate/adaptive-sim.js +0 -159
- package/lib/src/evaluate/adaptive-sim.js.map +0 -1
- package/lib/src/evaluate/backtest.d.ts +0 -29
- package/lib/src/evaluate/backtest.d.ts.map +0 -1
- package/lib/src/evaluate/backtest.js +0 -87
- package/lib/src/evaluate/backtest.js.map +0 -1
- package/lib/src/evaluate/hit-rate.d.ts +0 -8
- package/lib/src/evaluate/hit-rate.d.ts.map +0 -1
- package/lib/src/evaluate/hit-rate.js +0 -118
- package/lib/src/evaluate/hit-rate.js.map +0 -1
- package/lib/src/evaluate/review-pending.d.ts +0 -13
- package/lib/src/evaluate/review-pending.d.ts.map +0 -1
- package/lib/src/evaluate/review-pending.js +0 -89
- package/lib/src/evaluate/review-pending.js.map +0 -1
- package/lib/src/evaluate/tracker.d.ts +0 -28
- package/lib/src/evaluate/tracker.d.ts.map +0 -1
- package/lib/src/evaluate/tracker.js +0 -269
- package/lib/src/evaluate/tracker.js.map +0 -1
- package/lib/src/evaluate/train-weights.d.ts +0 -28
- package/lib/src/evaluate/train-weights.d.ts.map +0 -1
- package/lib/src/evaluate/train-weights.js +0 -101
- package/lib/src/evaluate/train-weights.js.map +0 -1
- package/lib/src/evaluate/weight-guard.d.ts +0 -15
- package/lib/src/evaluate/weight-guard.d.ts.map +0 -1
- package/lib/src/evaluate/weight-guard.js +0 -46
- package/lib/src/evaluate/weight-guard.js.map +0 -1
- package/lib/src/games/kl8-groups.d.ts +0 -31
- package/lib/src/games/kl8-groups.d.ts.map +0 -1
- package/lib/src/games/kl8-groups.js +0 -62
- package/lib/src/games/kl8-groups.js.map +0 -1
- package/lib/src/games/registry.d.ts +0 -13
- package/lib/src/games/registry.d.ts.map +0 -1
- package/lib/src/games/registry.js +0 -45
- package/lib/src/games/registry.js.map +0 -1
- package/lib/src/index.d.ts +0 -3
- package/lib/src/index.d.ts.map +0 -1
- package/lib/src/index.js +0 -183
- package/lib/src/index.js.map +0 -1
- package/lib/src/lottery-agent-deps.d.ts.map +0 -1
- package/lib/src/lottery-agent-deps.js +0 -10
- package/lib/src/lottery-agent-deps.js.map +0 -1
- package/lib/src/lottery-tool-handlers.d.ts.map +0 -1
- package/lib/src/lottery-tool-handlers.js.map +0 -1
- package/lib/src/pipeline.d.ts +0 -36
- package/lib/src/pipeline.d.ts.map +0 -1
- package/lib/src/pipeline.js +0 -130
- package/lib/src/pipeline.js.map +0 -1
- package/lib/src/push.d.ts +0 -3
- package/lib/src/push.d.ts.map +0 -1
- package/lib/src/push.js +0 -31
- package/lib/src/push.js.map +0 -1
- package/lib/src/recommend/game-pick.d.ts +0 -14
- package/lib/src/recommend/game-pick.d.ts.map +0 -1
- package/lib/src/recommend/game-pick.js +0 -169
- package/lib/src/recommend/game-pick.js.map +0 -1
- package/lib/src/recommend/report.d.ts +0 -22
- package/lib/src/recommend/report.d.ts.map +0 -1
- package/lib/src/recommend/report.js +0 -176
- package/lib/src/recommend/report.js.map +0 -1
- package/lib/src/stats/engine.d.ts +0 -18
- package/lib/src/stats/engine.d.ts.map +0 -1
- package/lib/src/stats/engine.js +0 -122
- package/lib/src/stats/engine.js.map +0 -1
- package/lib/src/stats/pro-analysis.d.ts +0 -7
- package/lib/src/stats/pro-analysis.d.ts.map +0 -1
- package/lib/src/stats/pro-analysis.js +0 -121
- package/lib/src/stats/pro-analysis.js.map +0 -1
- package/lib/src/stats/weights.d.ts +0 -8
- package/lib/src/stats/weights.d.ts.map +0 -1
- package/lib/src/stats/weights.js +0 -25
- package/lib/src/stats/weights.js.map +0 -1
- package/lib/src/sync/fetch-official.d.ts +0 -4
- package/lib/src/sync/fetch-official.d.ts.map +0 -1
- package/lib/src/sync/fetch-official.js +0 -160
- package/lib/src/sync/fetch-official.js.map +0 -1
- package/lib/src/sync/run-sync.d.ts +0 -8
- package/lib/src/sync/run-sync.d.ts.map +0 -1
- package/lib/src/sync/run-sync.js +0 -29
- package/lib/src/sync/run-sync.js.map +0 -1
- package/lib/src/tools/agent-tools.d.ts +0 -15
- package/lib/src/tools/agent-tools.d.ts.map +0 -1
- package/lib/src/tools/agent-tools.js +0 -211
- package/lib/src/tools/agent-tools.js.map +0 -1
- package/lib/src/types.d.ts +0 -84
- package/lib/src/types.d.ts.map +0 -1
- package/lib/src/types.js +0 -3
- package/lib/src/types.js.map +0 -1
- package/lib/tools/agent-tools.d.ts +0 -15
- package/lib/tools/agent-tools.d.ts.map +0 -1
- package/lib/tools/agent-tools.js +0 -211
- package/lib/tools/agent-tools.js.map +0 -1
- package/lib/tsconfig.tsbuildinfo +0 -1
- package/src/agent/run-turn.ts +0 -74
- /package/lib/{src/lottery-tool-handlers.d.ts → lottery-tool-handlers.d.ts} +0 -0
package/README.md
CHANGED
|
@@ -6,8 +6,11 @@
|
|
|
6
6
|
|
|
7
7
|
- **单条定时流水线**:同步 → 复盘 → 推荐 → 推送(默认 18:00)
|
|
8
8
|
- 频率 + 遗漏 + 趋势综合统计;开奖后自动调权
|
|
9
|
-
- 按 `games`
|
|
9
|
+
- 按 `games` 配置过滤,经 Runtime `OutboundHost` 推送到显式 `pushTargets`
|
|
10
10
|
- 手动触发:`lottery`(不推送,结果在会话内返回)
|
|
11
|
+
- IM commands 通过 owner-scoped `LotteryRuntime` 使用实例 DB。Agent deps 与 Outbound
|
|
12
|
+
sender 使用 generation-owned 注册;配置关闭推送时会显式遮蔽旧 generation,回滚时再
|
|
13
|
+
恢复仍存活的上一代。
|
|
11
14
|
|
|
12
15
|
## 安装
|
|
13
16
|
|
|
@@ -23,7 +26,7 @@ scheduleCron (18:00)
|
|
|
23
26
|
2. review pending picks vs new issues → tune weights → **lottery_model_weights**
|
|
24
27
|
3. if no new review: replay history simulation → refresh **lottery_model_weights**
|
|
25
28
|
4. compute next-period picks (reads weights from DB) → lottery_predictions
|
|
26
|
-
5. push report to
|
|
29
|
+
5. push report to configured targets (enabled games only)
|
|
27
30
|
```
|
|
28
31
|
|
|
29
32
|
权重表 `lottery_model_weights` 每玩法一行,字段 `freq_weight` / `omit_weight` / `trend_weight` + `eval_count` / `avg_hit_rate`:
|
|
@@ -33,35 +36,31 @@ scheduleCron (18:00)
|
|
|
33
36
|
- **推荐**:`loadGameWeights` 读库中最新权重算号
|
|
34
37
|
|
|
35
38
|
- **代码层**:官网同步、F/O/T 引擎、复盘调权
|
|
36
|
-
-
|
|
39
|
+
- **确定性报告**:主流水线不依赖 legacy Plugin 或 LLM,Agent 可通过独立 tools 读取结果
|
|
37
40
|
|
|
38
41
|
## 配置
|
|
39
42
|
|
|
40
43
|
```yaml
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
pickCount: 5
|
|
50
|
-
historyLimit: 500
|
|
51
|
-
kl8:
|
|
44
|
+
plugins:
|
|
45
|
+
lottery:
|
|
46
|
+
scheduleCron: "0 0 18 * * *"
|
|
47
|
+
scheduleEnabled: true
|
|
48
|
+
backtestEnabled: true
|
|
49
|
+
backtestWindow: 50
|
|
50
|
+
backtestRandomTrials: 64
|
|
51
|
+
backtestMinHistory: 30
|
|
52
52
|
pickCount: 5
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
- pl5
|
|
53
|
+
historyLimit: 500
|
|
54
|
+
kl8:
|
|
55
|
+
pickCount: 5
|
|
56
|
+
recommendGroups: 3
|
|
57
|
+
groupStrategies: [balanced, hot, cold]
|
|
58
|
+
games: [kl8, ssq, dlt, fc3d, pl3, pl5]
|
|
59
|
+
pushTargets:
|
|
60
|
+
- adapter: sandbox
|
|
61
|
+
endpointId: sandbox-bot
|
|
62
|
+
channelType: private
|
|
63
|
+
channelId: operator
|
|
65
64
|
```
|
|
66
65
|
|
|
67
66
|
## 权重训练(模拟盘)
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { defineAgentTool } from '@zhin.js/agent/tools';
|
|
2
2
|
import { z } from 'zod';
|
|
3
3
|
import { handleComputeRecommend } from '../../src/lottery-tool-handlers.js';
|
|
4
4
|
|
|
5
|
-
export default
|
|
5
|
+
export default defineAgentTool<{ game: string }>({
|
|
6
6
|
description: 'Compute lottery recommendation numbers via F/O/T stats engine',
|
|
7
7
|
inputSchema: z.object({ game: z.string().min(1) }),
|
|
8
8
|
async execute({ game }) {
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { defineAgentTool } from '@zhin.js/agent/tools';
|
|
2
2
|
import { z } from 'zod';
|
|
3
3
|
import { handleGetModelState } from '../../src/lottery-tool-handlers.js';
|
|
4
4
|
|
|
5
|
-
export default
|
|
5
|
+
export default defineAgentTool<{ game?: string }>({
|
|
6
6
|
description: 'Query model weights and historical hit rate per game',
|
|
7
7
|
inputSchema: z.object({ game: z.string().optional() }),
|
|
8
8
|
async execute({ game }) {
|
package/agent/tools/history.ts
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { defineAgentTool } from '@zhin.js/agent/tools';
|
|
2
2
|
import { z } from 'zod';
|
|
3
3
|
import { parseGameId } from '../../src/games/registry.js';
|
|
4
4
|
import { loadDraws } from '../../src/db.js';
|
|
5
5
|
import { getLotteryAgentDeps } from '../../src/lottery-agent-deps.js';
|
|
6
6
|
|
|
7
|
-
export default
|
|
7
|
+
export default defineAgentTool<{ game: string; count?: number }>({
|
|
8
8
|
description: 'Query historical lottery draws',
|
|
9
9
|
inputSchema: z.object({
|
|
10
10
|
game: z.string().min(1),
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { defineAgentTool } from '@zhin.js/agent/tools';
|
|
2
2
|
import { z } from 'zod';
|
|
3
3
|
import { handleListPending } from '../../src/lottery-tool-handlers.js';
|
|
4
4
|
|
|
5
|
-
export default
|
|
5
|
+
export default defineAgentTool<{ game?: string }>({
|
|
6
6
|
description: 'List pending lottery predictions awaiting review',
|
|
7
7
|
inputSchema: z.object({ game: z.string().optional() }),
|
|
8
8
|
async execute({ game }) {
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { defineAgentTool } from '@zhin.js/agent/tools';
|
|
2
2
|
import { z } from 'zod';
|
|
3
3
|
import { handleSavePrediction } from '../../src/lottery-tool-handlers.js';
|
|
4
4
|
|
|
5
|
-
export default
|
|
5
|
+
export default defineAgentTool<{ game: string; numbers_json: string }>({
|
|
6
6
|
description: 'Save a pending lottery prediction',
|
|
7
7
|
inputSchema: z.object({
|
|
8
8
|
game: z.string().min(1),
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { defineAgentTool } from '@zhin.js/agent/tools';
|
|
2
2
|
import { z } from 'zod';
|
|
3
3
|
import { handleStatsSnapshot } from '../../src/lottery-tool-handlers.js';
|
|
4
4
|
|
|
5
|
-
export default
|
|
5
|
+
export default defineAgentTool<{ game: string }>({
|
|
6
6
|
description: 'Get stats snapshot for a lottery game',
|
|
7
7
|
inputSchema: z.object({ game: z.string().min(1) }),
|
|
8
8
|
async execute({ game }) {
|
package/agent/tools/sync.ts
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { defineAgentTool } from '@zhin.js/agent/tools';
|
|
2
2
|
import { z } from 'zod';
|
|
3
3
|
import { parseGameId } from '../../src/games/registry.js';
|
|
4
4
|
import { getLotteryAgentDeps } from '../../src/lottery-agent-deps.js';
|
|
5
5
|
import { runDataSync } from '../../src/sync/run-sync.js';
|
|
6
6
|
|
|
7
|
-
export default
|
|
7
|
+
export default defineAgentTool<{ game?: string }>({
|
|
8
8
|
description: 'Sync official lottery draws into DB',
|
|
9
9
|
inputSchema: z.object({ game: z.string().optional() }),
|
|
10
10
|
async execute({ game }) {
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { defineCommand } from '@zhin.js/command';
|
|
2
|
+
import { parseGameId } from '../../src/games/registry.js';
|
|
3
|
+
import {
|
|
4
|
+
buildPipelineDeps,
|
|
5
|
+
formatPipelineReply,
|
|
6
|
+
getLotteryDb,
|
|
7
|
+
runLotteryPipeline,
|
|
8
|
+
resolveLotteryConfig,
|
|
9
|
+
type LotteryConfig,
|
|
10
|
+
} from '../../src/command-helpers.js';
|
|
11
|
+
import { resolveLotteryRuntime } from '../../src/runtime-state.js';
|
|
12
|
+
|
|
13
|
+
export default defineCommand<LotteryConfig>({
|
|
14
|
+
description: 'Run full pipeline: sync → review → recommend (manual, no push)',
|
|
15
|
+
async execute({ params, config, owner, use }) {
|
|
16
|
+
const cfg = resolveLotteryConfig(config);
|
|
17
|
+
const gid = parseGameId(String(params.game ?? ''));
|
|
18
|
+
const db = resolveLotteryRuntime({ owner, use })?.db ?? getLotteryDb();
|
|
19
|
+
const out = await runLotteryPipeline(buildPipelineDeps(cfg, db), {
|
|
20
|
+
gameId: gid ?? undefined,
|
|
21
|
+
push: false,
|
|
22
|
+
});
|
|
23
|
+
return formatPipelineReply(out);
|
|
24
|
+
},
|
|
25
|
+
});
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import { defineCommand } from '@zhin.js/command';
|
|
2
|
+
import { parseGameId } from '../../src/games/registry.js';
|
|
3
|
+
import {
|
|
4
|
+
formatBacktestSection,
|
|
5
|
+
runBacktestForGames,
|
|
6
|
+
} from '../../src/evaluate/backtest.js';
|
|
7
|
+
import {
|
|
8
|
+
getLotteryDb,
|
|
9
|
+
resolveLotteryConfig,
|
|
10
|
+
type LotteryConfig,
|
|
11
|
+
} from '../../src/command-helpers.js';
|
|
12
|
+
import { lotteryEnabledGames } from '../../src/config.js';
|
|
13
|
+
import { resolveLotteryRuntime } from '../../src/runtime-state.js';
|
|
14
|
+
|
|
15
|
+
export default defineCommand<LotteryConfig>({
|
|
16
|
+
description: 'Walk-forward backtest vs random baseline',
|
|
17
|
+
async execute({ params, config, owner, use }) {
|
|
18
|
+
const db = resolveLotteryRuntime({ owner, use })?.db ?? getLotteryDb();
|
|
19
|
+
if (!db) return '数据库未就绪';
|
|
20
|
+
const cfg = resolveLotteryConfig(config);
|
|
21
|
+
const gid = parseGameId(String(params.game ?? ''));
|
|
22
|
+
const gameIds = gid ? [gid] : lotteryEnabledGames(cfg);
|
|
23
|
+
const summaries = await runBacktestForGames(db, gameIds, {
|
|
24
|
+
pickCount: cfg.pickCount,
|
|
25
|
+
window: cfg.backtestWindow,
|
|
26
|
+
randomTrials: cfg.backtestRandomTrials,
|
|
27
|
+
minHistory: cfg.backtestMinHistory,
|
|
28
|
+
historyLimit: cfg.historyLimit,
|
|
29
|
+
adaptive: cfg.backtestAdaptive,
|
|
30
|
+
});
|
|
31
|
+
const text = formatBacktestSection(summaries);
|
|
32
|
+
return text || '历史数据不足,请先执行 lottery 同步开奖';
|
|
33
|
+
},
|
|
34
|
+
});
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { defineCommand } from '@zhin.js/command';
|
|
2
|
+
import { parseGameId } from '../../src/games/registry.js';
|
|
3
|
+
import { loadDraws } from '../../src/db.js';
|
|
4
|
+
import { getLotteryDb, type LotteryConfig } from '../../src/command-helpers.js';
|
|
5
|
+
import { resolveLotteryRuntime } from '../../src/runtime-state.js';
|
|
6
|
+
|
|
7
|
+
export default defineCommand<LotteryConfig>({
|
|
8
|
+
description: 'List historical draw results',
|
|
9
|
+
async execute({ params, args, owner, use }) {
|
|
10
|
+
const gid = parseGameId(String(params.game ?? ''));
|
|
11
|
+
if (!gid) return '请指定玩法';
|
|
12
|
+
const db = resolveLotteryRuntime({ owner, use })?.db ?? getLotteryDb();
|
|
13
|
+
if (!db) return '数据库未就绪';
|
|
14
|
+
// count 原来是第二动态段,约定式命令只支持单动态文件参数,改从 args 取
|
|
15
|
+
const count = Math.min(50, Math.max(1, Number(args[0]) || 10));
|
|
16
|
+
const draws = await loadDraws(db, gid, count);
|
|
17
|
+
if (!draws.length) return '暂无数据';
|
|
18
|
+
return draws.map((d) => `${d.issue} ${d.drawTime} ${JSON.stringify(d.numbers)}`).join('\n');
|
|
19
|
+
},
|
|
20
|
+
});
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import { defineCommand } from '@zhin.js/command';
|
|
2
|
+
import { parseGameId } from '../../src/games/registry.js';
|
|
3
|
+
import { loadDraws } from '../../src/db.js';
|
|
4
|
+
import { recommendGame, formatPickLine, formatPickStats } from '../../src/recommend/game-pick.js';
|
|
5
|
+
import { loadAccuracySnapshot, loadGameWeights } from '../../src/evaluate/tracker.js';
|
|
6
|
+
import {
|
|
7
|
+
getLotteryDb,
|
|
8
|
+
resolveLotteryConfig,
|
|
9
|
+
type LotteryConfig,
|
|
10
|
+
} from '../../src/command-helpers.js';
|
|
11
|
+
import { lotteryKl8 } from '../../src/config.js';
|
|
12
|
+
import { resolveLotteryRuntime } from '../../src/runtime-state.js';
|
|
13
|
+
|
|
14
|
+
export default defineCommand<LotteryConfig>({
|
|
15
|
+
description: 'Single-game stats snapshot',
|
|
16
|
+
async execute({ params, config, owner, use }) {
|
|
17
|
+
const gid = parseGameId(String(params.game ?? ''));
|
|
18
|
+
if (!gid) return '请指定玩法';
|
|
19
|
+
const db = resolveLotteryRuntime({ owner, use })?.db ?? getLotteryDb();
|
|
20
|
+
if (!db) return '数据库未就绪';
|
|
21
|
+
const cfg = resolveLotteryConfig(config);
|
|
22
|
+
const draws = await loadDraws(db, gid, cfg.historyLimit);
|
|
23
|
+
if (!draws.length) return '暂无数据,请先 lottery';
|
|
24
|
+
const kl8 = lotteryKl8(cfg);
|
|
25
|
+
const pick = recommendGame(gid, draws, {
|
|
26
|
+
pickCount: gid === 'kl8' ? kl8.pickCount : cfg.pickCount,
|
|
27
|
+
tieSeed: 'stats',
|
|
28
|
+
weights: await loadGameWeights(db, gid),
|
|
29
|
+
accuracy: await loadAccuracySnapshot(db, gid),
|
|
30
|
+
kl8: gid === 'kl8' ? kl8 : undefined,
|
|
31
|
+
});
|
|
32
|
+
return [formatPickLine(pick), formatPickStats(pick), `样本 ${draws.length} 期`].join('\n');
|
|
33
|
+
},
|
|
34
|
+
});
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { defineCommand } from '@zhin.js/command';
|
|
2
|
+
import { formatDailyReportText, loadTodayReport } from '../src/recommend/report.js';
|
|
3
|
+
import { getLotteryDb, type LotteryConfig } from '../src/command-helpers.js';
|
|
4
|
+
import { resolveLotteryRuntime } from '../src/runtime-state.js';
|
|
5
|
+
|
|
6
|
+
export default defineCommand<LotteryConfig>({
|
|
7
|
+
description: 'Show today published recommendation report',
|
|
8
|
+
async execute({ owner, use }) {
|
|
9
|
+
const db = resolveLotteryRuntime({ owner, use })?.db ?? getLotteryDb();
|
|
10
|
+
if (!db) return '数据库未就绪';
|
|
11
|
+
const report = await loadTodayReport(db);
|
|
12
|
+
if (!report) return '今日尚无推荐,可执行 lottery 或等待定时任务';
|
|
13
|
+
return formatDailyReportText(report, '');
|
|
14
|
+
},
|
|
15
|
+
});
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import { defineCommand } from '@zhin.js/command';
|
|
2
|
+
import { parseGameId } from '../../src/games/registry.js';
|
|
3
|
+
import {
|
|
4
|
+
formatTrainReport,
|
|
5
|
+
trainAllGameWeights,
|
|
6
|
+
} from '../../src/evaluate/backtest.js';
|
|
7
|
+
import {
|
|
8
|
+
getLotteryDb,
|
|
9
|
+
resolveLotteryConfig,
|
|
10
|
+
type LotteryConfig,
|
|
11
|
+
} from '../../src/command-helpers.js';
|
|
12
|
+
import { lotteryEnabledGames } from '../../src/config.js';
|
|
13
|
+
import { resolveLotteryRuntime } from '../../src/runtime-state.js';
|
|
14
|
+
|
|
15
|
+
export default defineCommand<LotteryConfig>({
|
|
16
|
+
description: 'Full-history weight training',
|
|
17
|
+
async execute({ params, config, owner, use }) {
|
|
18
|
+
const db = resolveLotteryRuntime({ owner, use })?.db ?? getLotteryDb();
|
|
19
|
+
if (!db) return '数据库未就绪';
|
|
20
|
+
const cfg = resolveLotteryConfig(config);
|
|
21
|
+
const gid = parseGameId(String(params.game ?? ''));
|
|
22
|
+
const gameIds = gid ? [gid] : lotteryEnabledGames(cfg);
|
|
23
|
+
const results = await trainAllGameWeights(db, gameIds, {
|
|
24
|
+
pickCount: cfg.pickCount,
|
|
25
|
+
minHistory: cfg.backtestMinHistory,
|
|
26
|
+
historyLimit: cfg.historyLimit,
|
|
27
|
+
randomTrials: cfg.backtestRandomTrials,
|
|
28
|
+
holdoutWindow: cfg.backtestWindow,
|
|
29
|
+
holdoutFallback: cfg.weightHoldoutFallback,
|
|
30
|
+
persist: true,
|
|
31
|
+
});
|
|
32
|
+
return formatTrainReport(results);
|
|
33
|
+
},
|
|
34
|
+
});
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { resolveLotteryConfig, type LotteryConfig } from './config.js';
|
|
2
|
+
import { getLotteryDb } from './db-store.js';
|
|
3
|
+
import type { LotteryDb } from './db.js';
|
|
4
|
+
import { formatPipelineReply, runLotteryPipeline, type PipelineDeps } from './pipeline.js';
|
|
5
|
+
export declare function buildPipelineDeps(raw: Partial<LotteryConfig> | undefined, db?: LotteryDb | null): PipelineDeps;
|
|
6
|
+
export { formatPipelineReply, runLotteryPipeline, resolveLotteryConfig, getLotteryDb };
|
|
7
|
+
export type { LotteryConfig };
|
|
8
|
+
//# sourceMappingURL=command-helpers.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"command-helpers.d.ts","sourceRoot":"","sources":["../src/command-helpers.ts"],"names":[],"mappings":"AAAA,OAAO,EAGL,oBAAoB,EACpB,KAAK,aAAa,EACnB,MAAM,aAAa,CAAC;AACrB,OAAO,EAAE,YAAY,EAAE,MAAM,eAAe,CAAC;AAC7C,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,SAAS,CAAC;AACzC,OAAO,EAAE,mBAAmB,EAAE,kBAAkB,EAAE,KAAK,YAAY,EAAE,MAAM,eAAe,CAAC;AAE3F,wBAAgB,iBAAiB,CAC/B,GAAG,EAAE,OAAO,CAAC,aAAa,CAAC,GAAG,SAAS,EACvC,EAAE,GAAE,SAAS,GAAG,IAAqB,GACpC,YAAY,CAkBd;AAED,OAAO,EAAE,mBAAmB,EAAE,kBAAkB,EAAE,oBAAoB,EAAE,YAAY,EAAE,CAAC;AACvF,YAAY,EAAE,aAAa,EAAE,CAAC"}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { lotteryEnabledGames, lotteryKl8, resolveLotteryConfig, } from './config.js';
|
|
2
|
+
import { getLotteryDb } from './db-store.js';
|
|
3
|
+
import { formatPipelineReply, runLotteryPipeline } from './pipeline.js';
|
|
4
|
+
export function buildPipelineDeps(raw, db = getLotteryDb()) {
|
|
5
|
+
const config = resolveLotteryConfig(raw);
|
|
6
|
+
return {
|
|
7
|
+
getDb: () => db,
|
|
8
|
+
enabledGames: () => lotteryEnabledGames(config),
|
|
9
|
+
historyLimit: config.historyLimit,
|
|
10
|
+
pickCount: config.pickCount,
|
|
11
|
+
kl8: lotteryKl8(config),
|
|
12
|
+
backtest: {
|
|
13
|
+
enabled: config.backtestEnabled,
|
|
14
|
+
window: config.backtestWindow,
|
|
15
|
+
randomTrials: config.backtestRandomTrials,
|
|
16
|
+
minHistory: config.backtestMinHistory,
|
|
17
|
+
adaptive: config.backtestAdaptive,
|
|
18
|
+
},
|
|
19
|
+
weightPersist: config.weightPersistEnabled,
|
|
20
|
+
weightHoldoutFallback: config.weightHoldoutFallback,
|
|
21
|
+
};
|
|
22
|
+
}
|
|
23
|
+
export { formatPipelineReply, runLotteryPipeline, resolveLotteryConfig, getLotteryDb };
|
|
24
|
+
//# sourceMappingURL=command-helpers.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"command-helpers.js","sourceRoot":"","sources":["../src/command-helpers.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,mBAAmB,EACnB,UAAU,EACV,oBAAoB,GAErB,MAAM,aAAa,CAAC;AACrB,OAAO,EAAE,YAAY,EAAE,MAAM,eAAe,CAAC;AAE7C,OAAO,EAAE,mBAAmB,EAAE,kBAAkB,EAAqB,MAAM,eAAe,CAAC;AAE3F,MAAM,UAAU,iBAAiB,CAC/B,GAAuC,EACvC,KAAuB,YAAY,EAAE;IAErC,MAAM,MAAM,GAAG,oBAAoB,CAAC,GAAG,CAAC,CAAC;IACzC,OAAO;QACL,KAAK,EAAE,GAAG,EAAE,CAAC,EAAE;QACf,YAAY,EAAE,GAAG,EAAE,CAAC,mBAAmB,CAAC,MAAM,CAAC;QAC/C,YAAY,EAAE,MAAM,CAAC,YAAY;QACjC,SAAS,EAAE,MAAM,CAAC,SAAS;QAC3B,GAAG,EAAE,UAAU,CAAC,MAAM,CAAC;QACvB,QAAQ,EAAE;YACR,OAAO,EAAE,MAAM,CAAC,eAAe;YAC/B,MAAM,EAAE,MAAM,CAAC,cAAc;YAC7B,YAAY,EAAE,MAAM,CAAC,oBAAoB;YACzC,UAAU,EAAE,MAAM,CAAC,kBAAkB;YACrC,QAAQ,EAAE,MAAM,CAAC,gBAAgB;SAClC;QACD,aAAa,EAAE,MAAM,CAAC,oBAAoB;QAC1C,qBAAqB,EAAE,MAAM,CAAC,qBAAqB;KACpD,CAAC;AACJ,CAAC;AAED,OAAO,EAAE,mBAAmB,EAAE,kBAAkB,EAAE,oBAAoB,EAAE,YAAY,EAAE,CAAC"}
|
package/lib/config.d.ts
ADDED
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import type { Kl8Config, Kl8ConfigInput } from './games/kl8-groups.js';
|
|
2
|
+
import type { GameId } from './types.js';
|
|
3
|
+
export interface LotteryConfig {
|
|
4
|
+
readonly pickCount: number;
|
|
5
|
+
readonly scheduleCron: string;
|
|
6
|
+
readonly historyLimit: number;
|
|
7
|
+
readonly scheduleEnabled: boolean;
|
|
8
|
+
readonly backtestEnabled: boolean;
|
|
9
|
+
readonly backtestWindow: number;
|
|
10
|
+
readonly backtestRandomTrials: number;
|
|
11
|
+
readonly backtestMinHistory: number;
|
|
12
|
+
readonly backtestAdaptive: boolean;
|
|
13
|
+
readonly weightPersistEnabled: boolean;
|
|
14
|
+
readonly weightHoldoutFallback: boolean;
|
|
15
|
+
readonly kl8?: Kl8ConfigInput;
|
|
16
|
+
readonly games: readonly string[];
|
|
17
|
+
/** Plugin Runtime OutboundHost push targets (cron / publish). */
|
|
18
|
+
readonly pushTargets: readonly LotteryPushTargetConfig[];
|
|
19
|
+
}
|
|
20
|
+
export interface LotteryPushTargetConfig {
|
|
21
|
+
readonly adapter: string;
|
|
22
|
+
readonly endpointId?: string;
|
|
23
|
+
readonly channelType?: string;
|
|
24
|
+
readonly channelId: string;
|
|
25
|
+
}
|
|
26
|
+
export declare const DEFAULT_LOTTERY_CONFIG: LotteryConfig;
|
|
27
|
+
export declare function resolveLotteryConfig(raw: Partial<LotteryConfig> | undefined): LotteryConfig;
|
|
28
|
+
export declare function lotteryKl8(config: LotteryConfig): Kl8Config;
|
|
29
|
+
export declare function lotteryEnabledGames(config: LotteryConfig): GameId[];
|
|
30
|
+
//# sourceMappingURL=config.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../src/config.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAC;AAEvE,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,YAAY,CAAC;AAGzC,MAAM,WAAW,aAAa;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
import { resolveKl8Config } from './games/kl8-groups.js';
|
|
2
|
+
import { resolveEnabledGames } from './games/registry.js';
|
|
3
|
+
export const DEFAULT_LOTTERY_CONFIG = {
|
|
4
|
+
pickCount: 5,
|
|
5
|
+
scheduleCron: '0 0 18 * * *',
|
|
6
|
+
historyLimit: 500,
|
|
7
|
+
scheduleEnabled: true,
|
|
8
|
+
backtestEnabled: true,
|
|
9
|
+
backtestWindow: 50,
|
|
10
|
+
backtestRandomTrials: 64,
|
|
11
|
+
backtestMinHistory: 30,
|
|
12
|
+
backtestAdaptive: true,
|
|
13
|
+
weightPersistEnabled: true,
|
|
14
|
+
weightHoldoutFallback: true,
|
|
15
|
+
kl8: {
|
|
16
|
+
pickCount: 5,
|
|
17
|
+
recommendGroups: 3,
|
|
18
|
+
groupStrategies: ['balanced', 'hot', 'cold'],
|
|
19
|
+
},
|
|
20
|
+
games: ['kl8', 'ssq', 'dlt', 'fc3d', 'pl3', 'pl5'],
|
|
21
|
+
pushTargets: [],
|
|
22
|
+
};
|
|
23
|
+
export function resolveLotteryConfig(raw) {
|
|
24
|
+
const pushTargets = Array.isArray(raw?.pushTargets)
|
|
25
|
+
? raw.pushTargets
|
|
26
|
+
.filter((t) => !!t && typeof t === 'object'
|
|
27
|
+
&& typeof t.adapter === 'string'
|
|
28
|
+
&& typeof t.channelId === 'string'
|
|
29
|
+
&& t.adapter.length > 0
|
|
30
|
+
&& t.channelId.length > 0)
|
|
31
|
+
.map((t) => Object.freeze({
|
|
32
|
+
adapter: t.adapter,
|
|
33
|
+
endpointId: typeof t.endpointId === 'string' ? t.endpointId : t.adapter,
|
|
34
|
+
channelType: typeof t.channelType === 'string' ? t.channelType : 'private',
|
|
35
|
+
channelId: t.channelId,
|
|
36
|
+
}))
|
|
37
|
+
: [];
|
|
38
|
+
return {
|
|
39
|
+
...DEFAULT_LOTTERY_CONFIG,
|
|
40
|
+
...raw,
|
|
41
|
+
games: raw?.games?.length ? [...raw.games] : [...DEFAULT_LOTTERY_CONFIG.games],
|
|
42
|
+
kl8: { ...DEFAULT_LOTTERY_CONFIG.kl8, ...raw?.kl8 },
|
|
43
|
+
pushTargets,
|
|
44
|
+
};
|
|
45
|
+
}
|
|
46
|
+
export function lotteryKl8(config) {
|
|
47
|
+
return resolveKl8Config(config.pickCount, config.kl8);
|
|
48
|
+
}
|
|
49
|
+
export function lotteryEnabledGames(config) {
|
|
50
|
+
return resolveEnabledGames([...config.games]);
|
|
51
|
+
}
|
|
52
|
+
//# sourceMappingURL=config.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"config.js","sourceRoot":"","sources":["../src/config.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAC;AAEzD,OAAO,EAAE,mBAAmB,EAAE,MAAM,qBAAqB,CAAC;AA2B1D,MAAM,CAAC,MAAM,sBAAsB,GAAkB;IACnD,SAAS,EAAE,CAAC;IACZ,YAAY,EAAE,cAAc;IAC5B,YAAY,EAAE,GAAG;IACjB,eAAe,EAAE,IAAI;IACrB,eAAe,EAAE,IAAI;IACrB,cAAc,EAAE,EAAE;IAClB,oBAAoB,EAAE,EAAE;IACxB,kBAAkB,EAAE,EAAE;IACtB,gBAAgB,EAAE,IAAI;IACtB,oBAAoB,EAAE,IAAI;IAC1B,qBAAqB,EAAE,IAAI;IAC3B,GAAG,EAAE;QACH,SAAS,EAAE,CAAC;QACZ,eAAe,EAAE,CAAC;QAClB,eAAe,EAAE,CAAC,UAAU,EAAE,KAAK,EAAE,MAAM,CAAC;KAC7C;IACD,KAAK,EAAE,CAAC,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,MAAM,EAAE,KAAK,EAAE,KAAK,CAAC;IAClD,WAAW,EAAE,EAAE;CAChB,CAAC;AAEF,MAAM,UAAU,oBAAoB,CAAC,GAAuC;IAC1E,MAAM,WAAW,GAAG,KAAK,CAAC,OAAO,CAAC,GAAG,EAAE,WAAW,CAAC;QACjD,CAAC,CAA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CAAC,MAAqB;IACvD,OAAO,mBAAmB,CAAC,CAAC,GAAG,MAAM,CAAC,KAAK,CAAC,CAAC,CAAC;AAChD,CAAC"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { LotteryDb } from './db.js';
|
|
2
|
+
/** Ensure an in-memory store when Runtime database Resource is not wired yet. */
|
|
3
|
+
export declare function ensureLotteryMemoryDb(): LotteryDb;
|
|
4
|
+
export declare function getLotteryDb(): LotteryDb | null;
|
|
5
|
+
export declare function setLotteryDb(db: LotteryDb | null): void;
|
|
6
|
+
/** Generation-owned database binding used by Plugin Runtime setup(). */
|
|
7
|
+
export declare function registerLotteryDb(db: LotteryDb): () => void;
|
|
8
|
+
/** Test helper: clear module store. */
|
|
9
|
+
export declare function resetLotteryDb(): void;
|
|
10
|
+
//# sourceMappingURL=db-store.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"db-store.d.ts","sourceRoot":"","sources":["../src/db-store.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,SAAS,CAAC;AAMzC,iFAAiF;AACjF,wBAAgB,qBAAqB,IAAI,SAAS,CAGjD;AAED,wBAAgB,YAAY,IAAI,SAAS,GAAG,IAAI,CAE/C;AAED,wBAAgB,YAAY,CAAC,EAAE,EAAE,SAAS,GAAG,IAAI,GAAG,IAAI,CAEvD;AAED,wEAAwE;AACxE,wBAAgB,iBAAiB,CAAC,EAAE,EAAE,SAAS,GAAG,MAAM,IAAI,CAO3D;AAED,uCAAuC;AACvC,wBAAgB,cAAc,IAAI,IAAI,CAErC"}
|
package/lib/db-store.js
ADDED
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { createInMemoryLotteryDb } from './memory-db.js';
|
|
2
|
+
let _db = null;
|
|
3
|
+
const registrations = [];
|
|
4
|
+
/** Ensure an in-memory store when Runtime database Resource is not wired yet. */
|
|
5
|
+
export function ensureLotteryMemoryDb() {
|
|
6
|
+
if (!_db)
|
|
7
|
+
_db = createInMemoryLotteryDb();
|
|
8
|
+
return _db;
|
|
9
|
+
}
|
|
10
|
+
export function getLotteryDb() {
|
|
11
|
+
return registrations[registrations.length - 1]?.value ?? ensureLotteryMemoryDb();
|
|
12
|
+
}
|
|
13
|
+
export function setLotteryDb(db) {
|
|
14
|
+
_db = db;
|
|
15
|
+
}
|
|
16
|
+
/** Generation-owned database binding used by Plugin Runtime setup(). */
|
|
17
|
+
export function registerLotteryDb(db) {
|
|
18
|
+
const registration = Object.freeze({ value: db });
|
|
19
|
+
registrations.push(registration);
|
|
20
|
+
return () => {
|
|
21
|
+
const index = registrations.lastIndexOf(registration);
|
|
22
|
+
if (index >= 0)
|
|
23
|
+
registrations.splice(index, 1);
|
|
24
|
+
};
|
|
25
|
+
}
|
|
26
|
+
/** Test helper: clear module store. */
|
|
27
|
+
export function resetLotteryDb() {
|
|
28
|
+
_db = null;
|
|
29
|
+
}
|
|
30
|
+
//# sourceMappingURL=db-store.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"db-store.js","sourceRoot":"","sources":["../src/db-store.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,uBAAuB,EAAE,MAAM,gBAAgB,CAAC;AAEzD,IAAI,GAAG,GAAqB,IAAI,CAAC;AACjC,MAAM,aAAa,GAAyC,EAAE,CAAC;AAE/D,iFAAiF;AACjF,MAAM,UAAU,qBAAqB;IACnC,IAAI,CAAC,GAAG;QAAE,GAAG,GAAG,uBAAuB,EAAE,CAAC;IAC1C,OAAO,GAAG,CAAC;AACb,CAAC;AAED,MAAM,UAAU,YAAY;IAC1B,OAAO,aAAa,CAAC,aAAa,CAAC,MAAM,GAAG,CAAC,CAAC,EAAE,KAAK,IAAI,qBAAqB,EAAE,CAAC;AACnF,CAAC;AAED,MAAM,UAAU,YAAY,CAAC,EAAoB;IAC/C,GAAG,GAAG,EAAE,CAAC;AACX,CAAC;AAED,wEAAwE;AACxE,MAAM,UAAU,iBAAiB,CAAC,EAAa;IAC7C,MAAM,YAAY,GAAG,MAAM,CAAC,MAAM,CAAC,EAAE,KAAK,EAAE,EAAE,EAAE,CAAC,CAAC;IAClD,aAAa,CAAC,IAAI,CAAC,YAAY,CAAC,CAAC;IACjC,OAAO,GAAG,EAAE;QACV,MAAM,KAAK,GAAG,aAAa,CAAC,WAAW,CAAC,YAAY,CAAC,CAAC;QACtD,IAAI,KAAK,IAAI,CAAC;YAAE,aAAa,CAAC,MAAM,CAAC,KAAK,EAAE,CAAC,CAAC,CAAC;IACjD,CAAC,CAAC;AACJ,CAAC;AAED,uCAAuC;AACvC,MAAM,UAAU,cAAc;IAC5B,GAAG,GAAG,IAAI,CAAC;AACb,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"adaptive-sim.d.ts","sourceRoot":"","sources":["../../src/evaluate/adaptive-sim.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,
|
|
1
|
+
{"version":3,"file":"adaptive-sim.d.ts","sourceRoot":"","sources":["../../src/evaluate/adaptive-sim.ts"],"names":[],"mappings":"AAAA,OAAO,EAAmB,KAAK,WAAW,EAAE,KAAK,MAAM,EAAiB,KAAK,cAAc,EAAE,KAAK,YAAY,EAAE,MAAM,aAAa,CAAC;AAKpI,MAAM,WAAW,iBAAiB;IAChC,SAAS,EAAE,MAAM,CAAC;IAClB,UAAU,EAAE,MAAM,CAAC;IACnB,YAAY,EAAE,MAAM,CAAC;IACrB,cAAc,CAAC,EAAE,YAAY,CAAC;IAC9B,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,wEAAwE;IACxE,WAAW,CAAC,EAAE,MAAM,CAAC;CACtB;AAED,MAAM,WAAW,gBAAgB;IAC/B,MAAM,EAAE,MAAM,CAAC;IACf,OAAO,EAAE,MAAM,CAAC;IAChB,aAAa,EAAE,MAAM,CAAC;IACtB,kBAAkB,EAAE,MAAM,CAAC;IAC3B,eAAe,EAAE,MAAM,CAAC;IACxB,gBAAgB,EAAE,MAAM,CAAC;IACzB,gBAAgB,EAAE,MAAM,CAAC;IACzB,eAAe,EAAE,MAAM,CAAC;IACxB,cAAc,EAAE,YAAY,CAAC;IAC7B,YAAY,EAAE,YAAY,CAAC;IAC3B,gBAAgB,EAAE,MAAM,CAAC;IACzB,eAAe,EAAE,MAAM,CAAC;CACzB;AAsCD,wBAAgB,iBAAiB,CAAC,MAAM,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,MAAM,GAAG,WAAW,CAgBnG;AAkCD;;;GAGG;AACH,wBAAgB,qBAAqB,CACnC,aAAa,EAAE,cAAc,EAAE,EAC/B,MAAM,EAAE,MAAM,EACd,OAAO,EAAE,iBAAiB,GACzB,gBAAgB,GAAG,IAAI,CAqFzB"}
|
|
@@ -24,7 +24,9 @@ function pickUnique(rng, min, max, count) {
|
|
|
24
24
|
const out = [];
|
|
25
25
|
for (let i = 0; i < count && pool.length; i++) {
|
|
26
26
|
const idx = Math.floor(rng() * pool.length);
|
|
27
|
-
|
|
27
|
+
const picked = pool.splice(idx, 1)[0];
|
|
28
|
+
if (picked !== undefined)
|
|
29
|
+
out.push(picked);
|
|
28
30
|
}
|
|
29
31
|
return out.sort((a, b) => a - b);
|
|
30
32
|
}
|
|
@@ -105,6 +107,8 @@ export function runAdaptiveSimulation(chronological, gameId, options) {
|
|
|
105
107
|
let lastScoredIssue = '';
|
|
106
108
|
for (let idx = options.minHistory; idx < chronological.length; idx++) {
|
|
107
109
|
const actual = chronological[idx];
|
|
110
|
+
if (!actual)
|
|
111
|
+
continue;
|
|
108
112
|
const history = chronological.slice(0, idx).reverse();
|
|
109
113
|
const tieSeed = `sim:${actual.issue}`;
|
|
110
114
|
const fixedPick = recommendGame(gameId, history, {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"adaptive-sim.js","sourceRoot":"","sources":["../../src/evaluate/adaptive-sim.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"adaptive-sim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AC;YAC5D,SAAS,IAAI,mBAAmB,CAAC,MAAM,EAAE,OAAO,CAAC,SAAS,EAAE,MAAM,EAAE,OAAO,CAAC,YAAY,CAAC,CAAC;YAC1F,MAAM,EAAE,CAAC;QACX,CAAC;QAED,IAAI,WAAW,EAAE,CAAC;YAChB,eAAe,GAAG,mBAAmB,CACnC,eAAe,EACf,YAAY,CAAC,OAAO,EACpB,MAAM,CAAC,OAAO,EACd,MAAM,EACN,OAAO,CACR,CAAC;QACJ,CAAC;IACH,CAAC;IAED,IAAI,CAAC,MAAM;QAAE,OAAO,IAAI,CAAC;IACzB,MAAM,WAAW,GAAG,WAAW,GAAG,MAAM,CAAC;IACzC,MAAM,QAAQ,GAAG,QAAQ,GAAG,MAAM,CAAC;IACnC,MAAM,SAAS,GAAG,SAAS,GAAG,MAAM,CAAC;IAErC,OAAO;QACL,MAAM;QACN,OAAO,EAAE,MAAM;QACf,aAAa,EAAE,YAAY,GAAG,OAAO,CAAC,UAAU;QAChD,kBAAkB,EAAE,WAAW;QAC/B,eAAe,EAAE,QAAQ;QACzB,gBAAgB,EAAE,SAAS;QAC3B,gBAAgB,EAAE,WAAW,GAAG,SAAS;QACzC,eAAe,EAAE,WAAW,GAAG,QAAQ;QACvC,cAAc;QACd,YAAY,EAAE,eAAe;QAC7B,gBAAgB;QAChB,eAAe;KAChB,CAAC;AACJ,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"backtest.d.ts","sourceRoot":"","sources":["../../src/evaluate/backtest.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AAC1C,OAAO,KAAK,
|
|
1
|
+
{"version":3,"file":"backtest.d.ts","sourceRoot":"","sources":["../../src/evaluate/backtest.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AAC1C,OAAO,EAAa,KAAK,SAAS,EAAE,MAAM,UAAU,CAAC;AAGr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