koishi-plugin-minecraft-notifier 1.0.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/lib/index.d.ts ADDED
@@ -0,0 +1,40 @@
1
+ import { Context, Schema } from 'koishi';
2
+ export declare const name = "minecraft-notifier";
3
+ export declare const inject: string[];
4
+ export interface LatestVersion {
5
+ id: number;
6
+ lastRelease: string;
7
+ lastSnapshot: string;
8
+ }
9
+ export interface ArticleLatestVersion {
10
+ id: number;
11
+ lastRelease: string;
12
+ lastSnapshot: string;
13
+ releaseTryTime: number;
14
+ snapshotTryTime: number;
15
+ }
16
+ export interface ArticleRecord {
17
+ id: number;
18
+ version: string;
19
+ isSnapshot: boolean;
20
+ articleUrl: string;
21
+ articleContent: string;
22
+ }
23
+ declare module 'koishi' {
24
+ interface Tables {
25
+ minecraft_notifier: LatestVersion;
26
+ minecraft_article_version: ArticleLatestVersion;
27
+ minecraft_article_record: ArticleRecord;
28
+ }
29
+ }
30
+ export interface Config {
31
+ checkInterval: number;
32
+ baseApiUrl: string;
33
+ model: string;
34
+ apiKey: string;
35
+ notifyChannel: string[];
36
+ }
37
+ export declare const Config: Schema<Config>;
38
+ export declare function apply(ctx: Context, cfg: Config & {
39
+ articleTracker: any;
40
+ }): void;
@@ -0,0 +1,9 @@
1
+ import { Bot } from 'koishi';
2
+ export declare function createBotTextMsgNode(bot: Bot, content: string): {
3
+ type: string;
4
+ data: {
5
+ user_id: string;
6
+ nickname: string;
7
+ content: string;
8
+ };
9
+ };
@@ -0,0 +1 @@
1
+ export declare const systemPrompt = "\nYou are a professional Minecraft changelog summarizer.\nAnalyze the given update notes and return a **structured JSON** following the provided schema.\nEach top-level category (new_features, improvements, balancing, bug_fixes, technical_changes) may include:\n* `\"general\"`: a list of general updates directly under the main category.\n* `\"subcategories\"`: a list of subcategories, each containing:\n * `\"subcategory\"`: a concise name (in Chinese).\n * `\"emoji\"`: one emoji that visually represents this subcategory. Ensure variety across different subcategories.\n * `\"items\"`: detailed update entries related to that subcategory.\nRules:\n1. **Write in fluent Chinese.** Avoid English unless it\u2019s an untranslatable proper name.\n2. **Keep entries concise:** Each item in 'general' or 'items' is one short sentence (50-100 characters max) to fit group chat messages. Merge similar updates if possible.\n3. **Group logically:** Use subcategories for clustered changes; only 2-5 subcategories per category.\n4. **Ignore trivial, internal, or repeated changes.**\n5. **Do not return any extra text outside the JSON.**\n6. **Ensure every subcategory has a distinct emoji.**\n7. **Insert a single space between any adjacent characters from different categories\u2014Chinese (\u6C49\u5B57), English (letters), or numbers (digits)\u2014without adding extra spaces, punctuation changes, or other edits.**\n";
@@ -0,0 +1 @@
1
+ export declare function getRandomUserAgent(): string;
package/package.json ADDED
@@ -0,0 +1,52 @@
1
+ {
2
+ "name": "koishi-plugin-minecraft-notifier",
3
+ "description": "A Minecraft new version notification plugin, also featuring a PCL homepage.",
4
+ "version": "1.0.0",
5
+ "main": "lib/index.js",
6
+ "typings": "lib/index.d.ts",
7
+ "type": "module",
8
+ "files": [
9
+ "lib",
10
+ "dist"
11
+ ],
12
+ "license": "MIT",
13
+ "keywords": [
14
+ "chatbot",
15
+ "koishi",
16
+ "plugin"
17
+ ],
18
+ "scripts": {
19
+ "lint": "eslint ./src --ext .ts",
20
+ "lint:fix": "eslint ./src --ext .ts --fix",
21
+ "build": "node esbuild.config.js && tsc --emitDeclarationOnly",
22
+ "release": "semantic-release"
23
+ },
24
+ "peerDependencies": {
25
+ "@pynickle/koishi-plugin-adapter-onebot": "^1.0.0",
26
+ "koishi": "^4.18.9"
27
+ },
28
+ "devDependencies": {
29
+ "@semantic-release/changelog": "^6.0.3",
30
+ "@semantic-release/commit-analyzer": "^13.0.1",
31
+ "@semantic-release/git": "^10.0.1",
32
+ "@semantic-release/npm": "^13.1.1",
33
+ "@semantic-release/release-notes-generator": "^14.1.0",
34
+ "@trivago/prettier-plugin-sort-imports": "^5.2.2",
35
+ "@types/turndown": "^5.0.6",
36
+ "conventional-changelog-conventionalcommits": "^9.1.0",
37
+ "esbuild": "^0.25.11",
38
+ "esbuild-plugin-yaml": "^0.0.1",
39
+ "eslint": "^9.38.0",
40
+ "eslint-config-prettier": "^10.1.8",
41
+ "eslint-plugin-prettier": "^5.5.4",
42
+ "prettier": "^3.6.2",
43
+ "semantic-release": "^25.0.1",
44
+ "typescript": "^5.9.3",
45
+ "typescript-eslint": "^8.46.2"
46
+ },
47
+ "dependencies": {
48
+ "axios": "^1.12.2",
49
+ "cheerio": "^1.1.2",
50
+ "turndown": "^7.2.2"
51
+ }
52
+ }
package/readme.md ADDED
@@ -0,0 +1,5 @@
1
+ # koishi-plugin-minecraft-notifier
2
+
3
+ [![npm](https://img.shields.io/npm/v/koishi-plugin-minecraft-notifier?style=flat-square)](https://www.npmjs.com/package/koishi-plugin-minecraft-notifier)
4
+
5
+ A Minecraft new version notification plugin, featuring a PCL homepage and beautiful images.