diwen 0.0.0-stage → 6.2.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 +39 -0
- package/README.md +23 -2
- package/dist/core.mjs +45 -0
- package/dist/data.enc +1 -0
- package/dist/diwen.schema.json +318 -0
- package/env.cjs +17 -0
- package/index.d.ts +752 -0
- package/index.mjs +2 -0
- package/package.json +18 -3
package/LICENSE
ADDED
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
Diwen(迪文)自定义许可协议
|
|
2
|
+
Custom Source-Available License (Commercial-Permitted, No-Redistribution, Attribution)
|
|
3
|
+
Copyright (c) 2026 Pondsi(作者)
|
|
4
|
+
|
|
5
|
+
本软件及 accompanying 文档(统称「本项目」)按以下条款提供。使用、集成或商用本项目即表示接受本条款。
|
|
6
|
+
|
|
7
|
+
一、使用与商用(免费、无需另行授权)
|
|
8
|
+
1. 任何个人或**商业目的**均可免费使用、集成本项目,**无需事先取得作者授权**。
|
|
9
|
+
2. 你可以将本项目**集成在你自己的程序中**(作为组件/依赖/内嵌模块/插件/MCP 服务),并销售你的程序。
|
|
10
|
+
|
|
11
|
+
二、不可再分发
|
|
12
|
+
1. 你不得将本项目本身(源码、闭源核心、加密数据、整体或实质性部分)单独或随你的程序一并再分发、转售、公开镜像或上传至其他仓库/市场。
|
|
13
|
+
2. 你的程序可以分发,但其中包含的本项目部分须以「依赖/引用」形式存在,且不得使接收者能直接提取本项目(含闭源核心与数据)作为独立项目。
|
|
14
|
+
3. 本项目以 **open-core** 形式分发:开源加载壳 + 闭源核心 + 加密概念数据。你不得试图解密、提取、绕过或再分发闭源核心与数据。
|
|
15
|
+
|
|
16
|
+
三、署名义务(必须)
|
|
17
|
+
凡使用/集成本项目,须在你的程序文档、关于页或随附说明中:
|
|
18
|
+
(a) 注明使用了本项目(Diwen / 迪文);
|
|
19
|
+
(b) 写明本项目作者:**Pondsi**;
|
|
20
|
+
(c) 附本项目仓库链接 https://github.com/Pondsi/Diwen 。
|
|
21
|
+
|
|
22
|
+
四、保留权利
|
|
23
|
+
除本条款明确授予的权利外,其余一切权利(包括但不限于再分发权、修改后再分发权、闭源核心与数据的提取权)均保留给作者。
|
|
24
|
+
|
|
25
|
+
五、无担保
|
|
26
|
+
本项目按「现状」提供,不附带任何明示或暗示的担保(包括适销性、特定用途适用性、不侵权)。作者不对因使用本项目产生的任何索赔、损害或责任负责。
|
|
27
|
+
|
|
28
|
+
六、终止
|
|
29
|
+
违反本条款(尤其再分发限制与署名义务)将自动终止你已获授予的权利。
|
|
30
|
+
|
|
31
|
+
---
|
|
32
|
+
|
|
33
|
+
English summary (non-binding; Chinese text above governs):
|
|
34
|
+
- Use & commercial use: FREE, no prior authorization required. You may integrate Diwen into your own programs (component/dependency/plugin/MCP service) and sell your programs.
|
|
35
|
+
- No redistribution of the project itself (source, closed core, encrypted data). Your programs may be distributed only with Diwen as a dependency/reference that cannot be extracted as a standalone project. Open-core: you may not decrypt/extract/redistribute the closed core & data.
|
|
36
|
+
- Attribution REQUIRED: credit "Diwen / 迪文", name the author "Pondsi", link https://github.com/Pondsi/Diwen .
|
|
37
|
+
- All other rights reserved. Provided "AS IS", without warranty.
|
|
38
|
+
|
|
39
|
+
Contact: via https://github.com/Pondsi/Diwen (issues).
|
package/README.md
CHANGED
|
@@ -1,3 +1,24 @@
|
|
|
1
|
-
#
|
|
1
|
+
# diwen(npm 包)
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
迪文概念坐标系统 open-core npm 包:**开源加载壳**(`index.mjs`/`env.cjs`)+ **闭源核心**(`dist/core.mjs`,minify bundle)+ **加密概念数据**(`dist/data.enc`,AES-256-GCM)。
|
|
4
|
+
|
|
5
|
+
## 安装与使用
|
|
6
|
+
```bash
|
|
7
|
+
npm install # 运行时依赖 @node-rs/jieba(中文分词)
|
|
8
|
+
```
|
|
9
|
+
```js
|
|
10
|
+
import { mapChinese, describeConcept, checkModelCapacity } from './index.mjs';
|
|
11
|
+
const r = await mapChinese('我吃饭', { model: 'deterministic' });
|
|
12
|
+
console.log(r.contract.words, r.semanticApproval); // semanticApproval 恒 false
|
|
13
|
+
console.log(describeConcept(1223).lemma_zh); // 折
|
|
14
|
+
```
|
|
15
|
+
`env.cjs` 在加载时把 `data.enc` 解密到临时目录并设 `DIWEN_DATA_DIR`,再加载闭源核心。无需手动解密。
|
|
16
|
+
|
|
17
|
+
## 选项容量(提示 + 错误反馈,不禁止模型)
|
|
18
|
+
`checkModelCapacity(model, required)` 给建议性提示(上限未知/可能超限/质量风险),**不禁止任何模型**,由使用者自判。`decisionSelect` 使用出错时 `classifyModelError` 反馈是否为模型上限问题(`choice-capacity`),使用者自行调整。能力表 `data/decision-model-caps.json`(在加密数据内)。
|
|
19
|
+
|
|
20
|
+
## 许可
|
|
21
|
+
允许商用(无需授权)、不可再分发、必须署名 Pondsi + Diwen/迪文 + 仓库链接。见 LICENSE。
|
|
22
|
+
|
|
23
|
+
## 诚实说明
|
|
24
|
+
客户端加密/混淆非不可破(密钥在壳内);真保密需服务端化。
|