@akasha-book/gate 1.3.1 → 1.3.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/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Ersith
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,4 +1,4 @@
1
- # @local/akasha-gate
1
+ # @akasha-book/gate
2
2
 
3
3
  阿卡夏之书门控 v1.2 —— 把「可机检的纪律」做成硬约束(设计稿 §10 投影律)。
4
4
 
@@ -8,15 +8,15 @@
8
8
  - ① `tools.guard`:拒绝 `edit` / `write` / `apply_patch` 对 `akasha\data\` 的直写;拒绝 `pwsh` / `bash` 命令里对 `akasha\data` 的写操作(Set-Content / Add-Content / Out-File / Remove-Item / Copy-Item / `del` / 重定向 等)。数据必须经校验写入:`akasha` CLI / `mcp__akasha__*`。
9
9
  - **已知边界(v0 有意为之)**:门控防「顺手直改」,不防刻意绕过(例如 `node -e` 脚本内写文件)——那是安全边界的活,不属于本层承诺。见设计稿 §10「只对可机检项承诺必定」。
10
10
  - ② `systemPrompt.section`(name `akasha:protocol`,order 700):**渲染时读库**——`text` 传函数,官方 `dsh-system-prompt` 在组装时求值(`lib/index.js:342`),读 `canon-akasha-usage` 的**当前版本**(`currentRecords` 取链尾,含 `-rN`);**改用法 = `revise canon-akasha-usage`,下一次组装即生效**(无需重启/改码);读库失败回退本文件内置同文兜底(渲染永不抛)。
11
- - 记录:`H:\Harness\akasha\logs\hooks.jsonl`(`gate-armed`〔含 `usageSource` / `selfSource`: library|fallback〕/ `gate-denied` / `prompt-change`〔只跟结构变更〕/ `gate-usage-fallback` / `gate-usage-recovered` / `gate-self-fallback` / `gate-self-recovered`)。
11
+ - 记录:`<AKASHA_DIR>/logs\hooks.jsonl`(`gate-armed`〔含 `usageSource` / `selfSource`: library|fallback〕/ `gate-denied` / `prompt-change`〔只跟结构变更〕/ `gate-usage-fallback` / `gate-usage-recovered` / `gate-self-fallback` / `gate-self-recovered`)。
12
12
  - 自测:`node selftest.mjs`(48 断言,桩 ctx + 真库文本 + 不存在目录回退 + 自我层三路,不需要宿主)。
13
- - 绕过:`plugin_manager set_bundle` → `@local/akasha-gate` → `enabled:false`(或改本包 config)。
13
+ - 绕过:`plugin_manager set_bundle` → `@akasha-book/gate` → `enabled:false`(或改本包 config)。
14
14
  - 版本纪律:**替换已安装包需要重启才载入新 JS 代**(官方语义)。v1.0.1 修复命令分支路径判定(`startsWith` → `includes`);**v1.1.0 起注入改为库驱动**(自举缺口修复,2026-10-07);**v1.1.1**:库驱动降级/恢复的切换观测线(`gate-usage-fallback` / `gate-usage-recovered`,仅切换时落一行)+ `prompt-change` 语义注记(**只跟结构变更**,文本漂移不触发)。
15
15
 
16
16
  ## 打包 / 安装
17
17
 
18
18
  ```powershell
19
- cd H:\Harness\dsh-akasha-gate
19
+ cd <LOCAL_PATH>
20
20
  F:\h\all\Nodejs\npm.cmd pack
21
21
  # 然后:plugin_manager install_bundle <tgz 绝对路径>(新 bundle 会 HMR 热生效)
22
22
  ```
@@ -26,4 +26,4 @@ F:\h\all\Nodejs\npm.cmd pack
26
26
 
27
27
  - 源仓库:https://github.com/Ersith/akasha-book
28
28
  - 本版本固定提交(pinned commit):`5a55099586cfae4e7511ba433eaf202455d81c30`
29
- - 许可证:MIT(见仓库根 LICENSE)
29
+ - 许可证:MIT
package/cordis.patch.yml CHANGED
@@ -1,8 +1,8 @@
1
1
  - insert:
2
2
  - id: akasha-gate
3
- name: '@local/akasha-gate'
3
+ name: '@akasha-book/gate'
4
4
  config:
5
- log: 'H:\Harness\akasha\logs\hooks.jsonl'
6
- dataDir: 'H:\Harness\akasha\data'
7
- akashaDir: 'H:\Harness\akasha'
5
+ log: '<AKASHA_DIR>/logs\hooks.jsonl'
6
+ dataDir: '<AKASHA_DIR>/data'
7
+ akashaDir: '<AKASHA_DIR>'
8
8
  sectionOrder: 700
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@akasha-book/gate",
3
- "version": "1.3.1",
3
+ "version": "1.3.2",
4
4
  "engines": {
5
5
  "node": ">=18"
6
6
  },
@@ -19,15 +19,14 @@
19
19
  "patch": "./cordis.patch.yml"
20
20
  }
21
21
  },
22
- "peerDependencies": {
23
- "@deepseek-ai/dsh": "^0.2.0-rc.2",
24
- "@deepseek-ai/cordis": "^4.0.4"
22
+ "publishConfig": {
23
+ "access": "public"
25
24
  },
26
25
  "license": "MIT",
27
26
  "repository": {
28
27
  "type": "git",
29
28
  "url": "git+https://github.com/Ersith/akasha-book.git",
30
- "directory": "dsh-akasha-gate"
29
+ "directory": "plugins/akasha-gate"
31
30
  },
32
31
  "scripts": {
33
32
  "test": "node selftest.test.mjs",