@dongfangw/study-kit 0.1.1 → 0.1.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/lib/client.js +4 -4
- package/lib/client.js.map +1 -1
- package/lib/index.d.ts +1 -1
- package/lib/index.js +2 -2
- package/lib/isolation.d.ts +1 -1
- package/lib/libraries.d.ts +1 -1
- package/lib/libraries.js +1 -1
- package/lib/session.d.ts +1 -1
- package/lib/slidev.js +1 -1
- package/lib/tools.js +2 -2
- package/package.json +40 -3
- package/skills/kb-organize/SKILL.md +2 -2
package/lib/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { Context } from '@deepseek-ai/cordis';
|
|
2
|
-
import { type CatalogNode } from '@
|
|
2
|
+
import { type CatalogNode } from '@dongfangw/library-core';
|
|
3
3
|
export declare const name = "aero-study-kit";
|
|
4
4
|
export declare const inject: string[];
|
|
5
5
|
/** 插件包目录(`slidev` 构建缓存、`ext/adoc-convert` 定位都基于它)。 */
|
package/lib/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* `@
|
|
2
|
+
* `@dongfangw/study-kit` 宿主侧入口:把"一个工作区里的多个库"变成可读、可搜、可问的学习台。
|
|
3
3
|
*
|
|
4
4
|
* 路由(`/kb/*`,并且 `/aero-kb/*` 作为别名继续可用):
|
|
5
5
|
* GET health · libraries · catalog · doc · asset · katex · slidev/… · git/…
|
|
@@ -11,7 +11,7 @@
|
|
|
11
11
|
*/
|
|
12
12
|
import { existsSync, readFileSync, statSync } from 'node:fs';
|
|
13
13
|
import path from 'node:path';
|
|
14
|
-
import { isInside } from '@
|
|
14
|
+
import { isInside } from '@dongfangw/library-core';
|
|
15
15
|
import { createGitHandler, setGitRepos } from "./git.js";
|
|
16
16
|
import { DEFAULT_SEGMENT_TARGET_BYTES, SEGMENT_HARD_MAX_BYTES, mapSegmentIndex, splitDocument } from "./docsplit.js";
|
|
17
17
|
import { createSlidevHandler, disposeSlidev } from "./slidev.js";
|
package/lib/isolation.d.ts
CHANGED
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
* 检索结果、发给模型的"正在阅读"上下文之外的其他出口(见 `assertNoPrivateLeak`);
|
|
8
8
|
* 3. 私人库永不参与"发布 / 分享 / 导出可分发副本"。
|
|
9
9
|
*/
|
|
10
|
-
import type { LibraryManifest, Viewer, Visibility } from '@
|
|
10
|
+
import type { LibraryManifest, Viewer, Visibility } from '@dongfangw/library-core';
|
|
11
11
|
/** 库对当前视图是否可见。 */
|
|
12
12
|
export declare function isLibraryVisible(visibility: Visibility, viewer: Viewer): boolean;
|
|
13
13
|
/** 从一堆库里筛出当前视图可见的(顺序不变)。 */
|
package/lib/libraries.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { type LibraryManifest, type Viewer } from '@
|
|
1
|
+
import { type LibraryManifest, type Viewer } from '@dongfangw/library-core';
|
|
2
2
|
import type { CatalogResponse as KbCatalogResponse } from './types.ts';
|
|
3
3
|
/** 一份库的解析结果。 */
|
|
4
4
|
export interface ResolvedLibrary {
|
package/lib/libraries.js
CHANGED
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
* **本文件不出现任何课程专名**:课程内容长什么样,由内容仓自己的 `library.yaml` 说。
|
|
9
9
|
*/
|
|
10
10
|
import path from 'node:path';
|
|
11
|
-
import { buildCatalog, loadLibrary, loadWorkspace, resolveEntry, resolveLibraryDirs, } from '@
|
|
11
|
+
import { buildCatalog, loadLibrary, loadWorkspace, resolveEntry, resolveLibraryDirs, } from '@dongfangw/library-core';
|
|
12
12
|
/** 会话/环境里可用的种子目录(去重,保持优先级)。 */
|
|
13
13
|
export function collectSeeds(sessionCwd, extra = []) {
|
|
14
14
|
const seen = new Set();
|
package/lib/session.d.ts
CHANGED
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
* 缓存键是会话 cwd;TTL 30s,`libraries.yaml` / `library.yaml` 改了就靠 TTL 自动失效
|
|
5
5
|
* (比到处手动 invalidate 可靠;目录扫描本身有 200ms 级开销,30s 足够安全)。
|
|
6
6
|
*/
|
|
7
|
-
import type { Viewer } from '@
|
|
7
|
+
import type { Viewer } from '@dongfangw/library-core';
|
|
8
8
|
import { type ResolvedWorkspace } from './libraries.ts';
|
|
9
9
|
export interface Resolved {
|
|
10
10
|
readonly cwd: string;
|
package/lib/slidev.js
CHANGED
|
@@ -19,7 +19,7 @@ import { spawn } from 'node:child_process';
|
|
|
19
19
|
import { resolveSlidevBin } from './slidevBin.js';
|
|
20
20
|
import { getSlidevEnv } from './slidevEnv.js';
|
|
21
21
|
import { sendFile } from './static.js';
|
|
22
|
-
import { isInside } from '@
|
|
22
|
+
import { isInside } from '@dongfangw/library-core';
|
|
23
23
|
// ---------------------------------------------------------------------------
|
|
24
24
|
// 常量与缓存根
|
|
25
25
|
// ---------------------------------------------------------------------------
|
package/lib/tools.js
CHANGED
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
*/
|
|
10
10
|
import path from 'node:path';
|
|
11
11
|
import { defineTool } from '@deepseek-ai/dsh-tools';
|
|
12
|
-
import { isInside, searchLibraries } from '@
|
|
12
|
+
import { isInside, searchLibraries } from '@dongfangw/library-core';
|
|
13
13
|
import { readKbText } from "./render.js";
|
|
14
14
|
import { lookResolved } from "./session.js";
|
|
15
15
|
function textOf(value) {
|
|
@@ -78,7 +78,7 @@ export function registerKbTools(_rootCtx, agent) {
|
|
|
78
78
|
};
|
|
79
79
|
for (const l of ws.workspace.libraries) {
|
|
80
80
|
lines.push(`## ${l.manifest.title}(${l.manifest.id})`);
|
|
81
|
-
const { buildLibraryCatalog } = await import('@
|
|
81
|
+
const { buildLibraryCatalog } = await import('@dongfangw/library-core');
|
|
82
82
|
walk(buildLibraryCatalog(l.root, l.manifest, ws.viewer).groups, ' ');
|
|
83
83
|
lines.push('');
|
|
84
84
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@dongfangw/study-kit",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.2",
|
|
4
4
|
"description": "AI 学伴:把任意「带清单的内容库」变成可读、可搜、可标注、可问的学习台;支持多库与私人库隔离",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"license": "AGPL-3.0-or-later",
|
|
@@ -52,7 +52,6 @@
|
|
|
52
52
|
"dependencies": {
|
|
53
53
|
"@dongfangw/library-core": "^0.1.0",
|
|
54
54
|
"@asciidoctor/core": "^3.0.4",
|
|
55
|
-
"@deepseek-ai/dsh-client-ui-slots": "0.2.0-rc.2",
|
|
56
55
|
"katex": "^0.16.22",
|
|
57
56
|
"markdown-it": "^14.1.0",
|
|
58
57
|
"yaml": "^2.9.0"
|
|
@@ -97,5 +96,43 @@
|
|
|
97
96
|
"type": "git",
|
|
98
97
|
"url": "git+https://gitee.com/dongfangW/aero-study-kit.git"
|
|
99
98
|
},
|
|
100
|
-
"homepage": "https://gitee.com/dongfangW/aero-study-kit"
|
|
99
|
+
"homepage": "https://gitee.com/dongfangW/aero-study-kit",
|
|
100
|
+
"peerDependenciesMeta": {
|
|
101
|
+
"@deepseek-ai/cordis": {
|
|
102
|
+
"optional": true
|
|
103
|
+
},
|
|
104
|
+
"@deepseek-ai/dsh-agent": {
|
|
105
|
+
"optional": true
|
|
106
|
+
},
|
|
107
|
+
"@deepseek-ai/dsh-api-session-controller": {
|
|
108
|
+
"optional": true
|
|
109
|
+
},
|
|
110
|
+
"@deepseek-ai/dsh-client-ui-conversation": {
|
|
111
|
+
"optional": true
|
|
112
|
+
},
|
|
113
|
+
"@deepseek-ai/dsh-client-ui-renderer": {
|
|
114
|
+
"optional": true
|
|
115
|
+
},
|
|
116
|
+
"@deepseek-ai/dsh-client-ui-session": {
|
|
117
|
+
"optional": true
|
|
118
|
+
},
|
|
119
|
+
"@deepseek-ai/dsh-client-ui-slots": {
|
|
120
|
+
"optional": true
|
|
121
|
+
},
|
|
122
|
+
"@deepseek-ai/dsh-client-ui-workspace": {
|
|
123
|
+
"optional": true
|
|
124
|
+
},
|
|
125
|
+
"@deepseek-ai/dsh-host-webserver": {
|
|
126
|
+
"optional": true
|
|
127
|
+
},
|
|
128
|
+
"@deepseek-ai/dsh-session": {
|
|
129
|
+
"optional": true
|
|
130
|
+
},
|
|
131
|
+
"@deepseek-ai/dsh-tools": {
|
|
132
|
+
"optional": true
|
|
133
|
+
},
|
|
134
|
+
"react": {
|
|
135
|
+
"optional": true
|
|
136
|
+
}
|
|
137
|
+
}
|
|
101
138
|
}
|
|
@@ -50,8 +50,8 @@ outline:
|
|
|
50
50
|
## 4. 验证(30 秒)
|
|
51
51
|
|
|
52
52
|
```bash
|
|
53
|
-
npx @
|
|
54
|
-
npx @
|
|
53
|
+
npx @dongfangw/library-core validate "<资料目录>"
|
|
54
|
+
npx @dongfangw/library-core catalog "<资料目录>"
|
|
55
55
|
```
|
|
56
56
|
|
|
57
57
|
两条都通过后,刷新学伴的「我的库」,新库即出现;打开任意一篇检查公式与图片。
|