cortico-world-simple-trpg-check 0.4.0 → 0.4.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/CHANGELOG.md +6 -0
- package/README.md +7 -3
- package/package.json +5 -2
- package/src/config.ts +1 -1
- package/src/multilingual-laya.ts +2 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,11 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 0.4.1 - 2026-10-17
|
|
4
|
+
|
|
5
|
+
- Reject pending and subsequent requests when the multilingual Laya worker exits.
|
|
6
|
+
- Default to Jev; document backend setup and retaining an existing Laya selection.
|
|
7
|
+
- Declare the official external-setup, local and requires-key tags.
|
|
8
|
+
|
|
3
9
|
## 0.4.0 - 2026-10-16
|
|
4
10
|
|
|
5
11
|
- Target Cortico 0.2.1 and world contract 6.
|
package/README.md
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
<!-- Owner: src/definition.ts, src/world.ts, src/config.ts, src/request.ts, src/model.ts, src/ENV_PROMPT.md, src/display.ts, src/contest.ts -->
|
|
1
|
+
<!-- Owner: src/definition.ts, src/world.ts, src/config.ts, src/request.ts, src/model.ts, src/multilingual-laya.ts, src/ENV_PROMPT.md, src/display.ts, src/contest.ts -->
|
|
2
2
|
|
|
3
3
|
# Simple TRPG Check
|
|
4
4
|
|
|
@@ -6,6 +6,8 @@ Cortico 的 TRPG 技能检定 World 扩展,检定规则由COC7规则启发。a
|
|
|
6
6
|
|
|
7
7
|
支持单项检定、组合检定、对抗检定,以及奖励骰、惩罚骰和困难/极难任务。技能名可以自定义,不需要预先填写数值角色卡。
|
|
8
8
|
|
|
9
|
+
使用前须配置评分后端。默认使用远程 Jev,需填写服务密钥;使用本地 Laya 时须安装对应依赖或 Python 环境。
|
|
10
|
+
|
|
9
11
|
## 安装与配置
|
|
10
12
|
|
|
11
13
|
要求 Node.js 22 或更新版本,以及 Cortico World API 6。在 Cortico 仓库的 `extensions/` 目录安装:
|
|
@@ -19,12 +21,14 @@ corepack pnpm add --ignore-workspace cortico-world-simple-trpg-check
|
|
|
19
21
|
|
|
20
22
|
| 判定模型 | 配置方式 |
|
|
21
23
|
| --- | --- |
|
|
22
|
-
|
|
|
23
|
-
| 多语言 Laya
|
|
24
|
+
| 远程 Jev(默认) | 选择 TypeSafe、OpenRouter 或自定义服务,填写对应密钥与模型 ID。自定义服务还需配置服务地址。 |
|
|
25
|
+
| 多语言 Laya | 选择已安装 `laya` 的 Conda Python 环境。首次使用可能下载模型权重,后续使用本地缓存。 |
|
|
24
26
|
| 英文 Laya | 选择“本地 Laya(英文)”,通过可选依赖 `@receptron/laya` 在本机运行。 |
|
|
25
27
|
|
|
26
28
|
现有评测中,本地 Laya 对不同技能水平证据的区分较弱,建议使用 Jev。选择后点击“测试连接”验证服务与密钥;该操作不掷骰。
|
|
27
29
|
|
|
30
|
+
部署中已保存的 `backend` 保持原值;未配置该键时使用 Jev。需要保留原默认后端的部署应显式设置 `worlds.simple-trpg-check.backend: "laya-multilingual"`。
|
|
31
|
+
|
|
28
32
|
“决策模型”输入框提供预设,也接受其他模型 ID;留空使用所选服务的默认 JEV 模型。OpenRouter 支持 Luna Decisions 预设 `openai/gpt-6-luna-decisions`。自定义服务须支持 SystemOne 请求和答案格式。配置键 `backend: "jev"`、`jevSource`、`jevEndpoint` 继续使用,模型 ID 保存在 `jevModel`。
|
|
29
33
|
|
|
30
34
|
默认 JEV 模型使用现有技能评分校准。Luna 与其他模型显示“未校准”,按档位代表值取期望;财富与信用评级仍使用专用标尺。
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "cortico-world-simple-trpg-check",
|
|
3
|
-
"version": "0.4.
|
|
3
|
+
"version": "0.4.1",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "Cortico 的 TRPG 技能检定 World 扩展,使用本地或远程模型评估技能水平,支持 d100 掷骰、组合与对抗检定。",
|
|
6
6
|
"license": "MIT",
|
|
@@ -27,7 +27,10 @@
|
|
|
27
27
|
"api": 6,
|
|
28
28
|
"webUiClient": "dist/webui.js",
|
|
29
29
|
"tags": [
|
|
30
|
-
"game"
|
|
30
|
+
"game",
|
|
31
|
+
"external-setup",
|
|
32
|
+
"local",
|
|
33
|
+
"requires-key"
|
|
31
34
|
],
|
|
32
35
|
"describe": "describe.json"
|
|
33
36
|
},
|
package/src/config.ts
CHANGED
|
@@ -33,7 +33,7 @@ export interface SimpleTrpgCheckConfigSection {
|
|
|
33
33
|
|
|
34
34
|
export const SIMPLE_TRPG_CHECK_DEFAULTS: SimpleTrpgCheckConfigSection = {
|
|
35
35
|
enabled: false,
|
|
36
|
-
backend: '
|
|
36
|
+
backend: 'jev',
|
|
37
37
|
jevSource: 'typesafe',
|
|
38
38
|
jevEndpoint: '',
|
|
39
39
|
jevModel: '',
|
package/src/multilingual-laya.ts
CHANGED
|
@@ -9,7 +9,7 @@ export interface MultilingualLayaModel {
|
|
|
9
9
|
close(): Promise<void>;
|
|
10
10
|
}
|
|
11
11
|
|
|
12
|
-
class PythonLayaModel implements MultilingualLayaModel {
|
|
12
|
+
export class PythonLayaModel implements MultilingualLayaModel {
|
|
13
13
|
private nextId = 0;
|
|
14
14
|
private readonly pending = new Map<string, { resolve(value: unknown): void; reject(error: Error): void }>();
|
|
15
15
|
private readonly ready: Promise<void>;
|
|
@@ -39,6 +39,7 @@ class PythonLayaModel implements MultilingualLayaModel {
|
|
|
39
39
|
});
|
|
40
40
|
worker.once('error', () => { clearTimeout(timeout); reject(new Error('Python 进程无法启动')); });
|
|
41
41
|
worker.once('exit', (code) => {
|
|
42
|
+
this.closed = true;
|
|
42
43
|
clearTimeout(timeout);
|
|
43
44
|
const error = new Error(`Laya multilingual 进程已退出:${code ?? 'unknown'}`);
|
|
44
45
|
reject(error);
|