@louisultra/dsh-verymath 0.7.1 → 0.7.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/CHANGELOG.md +51 -1
- package/DEVELOPMENT.md +61 -0
- package/NOTICE.md +3 -2
- package/README.md +6 -2
- package/README_EN.md +7 -2
- package/UPSTREAM.json +1 -1
- package/lib/core/index.d.ts +6 -0
- package/lib/core/index.js +19 -3
- package/lib/http.d.ts +6 -0
- package/lib/http.js +3 -3
- package/lib/index.js +3 -0
- package/lib/tool/index.d.ts +1 -1
- package/lib/tool/index.js +2 -2
- package/package.json +21 -13
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,56 @@
|
|
|
3
3
|
All notable changes to this project are documented in this file.
|
|
4
4
|
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/).
|
|
5
5
|
|
|
6
|
+
## [0.7.2] - 2026-11-23
|
|
7
|
+
|
|
8
|
+
### Fixed
|
|
9
|
+
|
|
10
|
+
- **The Python tool and the environment panel could still disagree.** After
|
|
11
|
+
0.7.1 moved executable discovery into `core/exec.ts`, the panel used that
|
|
12
|
+
resolver but `ctx.verymath.resolvePython()` still spawned the bare configured
|
|
13
|
+
name. A desktop app that inherited no login-shell `PATH` could therefore find
|
|
14
|
+
a conda interpreter in the panel and fail the glossary tools, and a configured
|
|
15
|
+
`pythonExecutable`/`DSH_OFFICE_PYTHON` was invisible to the panel. Python
|
|
16
|
+
resolution now goes through the same absolute-path search on both surfaces,
|
|
17
|
+
and the runtime owns the configured-interpreter lookup the panel calls.
|
|
18
|
+
- The tool module imported `core` through its published package specifier while
|
|
19
|
+
building from the same package. That depended on a TypeScript path alias and
|
|
20
|
+
made the EduWork package copy diverge; it now imports the sibling core module
|
|
21
|
+
directly.
|
|
22
|
+
- A path whose parent component is a regular file reports `ENOTDIR` on some
|
|
23
|
+
platforms. It is now treated as "the glossary does not exist yet" just like
|
|
24
|
+
`ENOENT`, instead of surfacing an I/O error that blocks a legitimate first
|
|
25
|
+
write.
|
|
26
|
+
- The glossary coverage audit still described the upstream suite as partially
|
|
27
|
+
testing bundled scripts. It now records what `test:upstream` really checks;
|
|
28
|
+
the default runtime probe exercises the bundled build path separately.
|
|
29
|
+
- The same audit claimed every bundled glossary script was byte-identical to
|
|
30
|
+
upstream. `glossary_export.py` has a local pyright-comment header; the
|
|
31
|
+
provenance note now states that exception instead of overclaiming.
|
|
32
|
+
- The DSH peer range did not actually admit `0.2.2-rc.3`: npm reports
|
|
33
|
+
`>=0.2.1-rc.5 <0.3.0-0` as `1` for newer `0.2.2` pre-releases, so the old
|
|
34
|
+
`|| 0.2.2-rc.1` clause made the upstream target look incompatible. The
|
|
35
|
+
explicit pre-release branch now covers `>=0.2.2-rc.1 <0.2.3-0`, with a
|
|
36
|
+
manifest regression test covering both the runtime and its boundaries.
|
|
37
|
+
|
|
38
|
+
### Tests
|
|
39
|
+
|
|
40
|
+
- Added a PATH-starved conda fallback regression and a panel/runtime
|
|
41
|
+
configured-interpreter test. The runtime probe now also asserts that
|
|
42
|
+
`verymath_python_check` and the panel resolver return the same executable.
|
|
43
|
+
- Added the development guide that the README already pointed to, and included
|
|
44
|
+
it in the npm package. It records the current 185-test/16-check baseline,
|
|
45
|
+
upstream-suite scope, unpacked behavior, and package verification commands.
|
|
46
|
+
- Upgraded Vitest from 4.1.8 to 4.1.12, clearing the direct development-only
|
|
47
|
+
advisory for the mock path-traversal issue. The DSH development baseline is
|
|
48
|
+
now `0.2.2-rc.3`, matching EduWork 0.4.14; a clean `npm ci` and the full
|
|
49
|
+
dependency audit both pass without `--legacy-peer-deps`.
|
|
50
|
+
- Declared `@deepseek-ai/dsh-scope`, `@deepseek-ai/dsh-util-values`, React and
|
|
51
|
+
the React testing types as direct development dependencies. They were only
|
|
52
|
+
transitive before, which hid missing packages in a clean DSH `rc.3` install.
|
|
53
|
+
- Added `semver` as a development dependency for an executable check of the
|
|
54
|
+
supported DSH peers; it is not part of the production dependency surface.
|
|
55
|
+
|
|
6
56
|
## [0.7.1] - 2026-11-11
|
|
7
57
|
|
|
8
58
|
### Fixed
|
|
@@ -94,7 +144,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/).
|
|
|
94
144
|
client errors, not 500s; the paper route returns topology plus an SVG that
|
|
95
145
|
actually contains the entity labels.
|
|
96
146
|
|
|
97
|
-
|
|
147
|
+
## [0.5.0] - 2026-11-11
|
|
98
148
|
|
|
99
149
|
### Added
|
|
100
150
|
|
package/DEVELOPMENT.md
ADDED
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
# Development and validation
|
|
2
|
+
|
|
3
|
+
Requires Node.js `24.22.1+` (verified on 24.22.2). Development dependencies pin
|
|
4
|
+
DSH `0.2.2-rc.3`, the runtime bundled with EduWork 0.4.14; the peer range also
|
|
5
|
+
covers `0.2.1-rc.5`, `0.2.2-rc.1` and later `0.2.x`.
|
|
6
|
+
|
|
7
|
+
```sh
|
|
8
|
+
npm ci
|
|
9
|
+
npm run check
|
|
10
|
+
```
|
|
11
|
+
|
|
12
|
+
`lib/` and `node_modules/` are generated and not committed. Installation uses the
|
|
13
|
+
built `lib/` tree.
|
|
14
|
+
|
|
15
|
+
## What `npm run check` covers
|
|
16
|
+
|
|
17
|
+
The command runs type checking, a production build, **185 Vitest tests** in 14
|
|
18
|
+
files, and **16 runtime probe checks**. The probe mounts the real
|
|
19
|
+
`ctx.verymath` service, tool registry, skill registry and native executor. It
|
|
20
|
+
executes the tools against a synthetic workspace, including glossary alias
|
|
21
|
+
creation, correction by `term_id`, whole-batch rollback, path-alias cache
|
|
22
|
+
invalidation, concurrent writes, and batch paper-graph merging. It does not call
|
|
23
|
+
a remote model or require network access.
|
|
24
|
+
|
|
25
|
+
## Upstream glossary suite
|
|
26
|
+
|
|
27
|
+
When the sibling upstream clone exists, run its 19 Python tests with:
|
|
28
|
+
|
|
29
|
+
```sh
|
|
30
|
+
npm run test:upstream
|
|
31
|
+
```
|
|
32
|
+
|
|
33
|
+
This command expects `research/AI4Math-MathTool/` next to the plugin's parent
|
|
34
|
+
directory. The upstream tests load scripts relative to their own test file, so
|
|
35
|
+
this gate verifies upstream behaviour, not the bundled copies. The default
|
|
36
|
+
`npm run check` separately executes the bundled build script; the vendored
|
|
37
|
+
scripts are tracked against their upstream commit in `UPSTREAM.json`.
|
|
38
|
+
|
|
39
|
+
## Not covered
|
|
40
|
+
|
|
41
|
+
Python, SageMath, TeX Live, Lean/elan and MATLAB are installed by the user and
|
|
42
|
+
are not bundled. Tests prove probe and fallback behaviour, not arbitrary
|
|
43
|
+
execution inside those environments. Real-model task chains are outside
|
|
44
|
+
`npm run check` and are recorded in [`docs/capability-examples.md`](docs/capability-examples.md).
|
|
45
|
+
Windows is not exercised by CI.
|
|
46
|
+
|
|
47
|
+
## Package contents
|
|
48
|
+
|
|
49
|
+
`package.json` `files` controls the tarball: `lib`, `skills`,
|
|
50
|
+
`docs/capability-examples.md`, `docs/examples`, `cordis.patch.yml`, both
|
|
51
|
+
READMEs, this guide, `NOTICE.md`, `UPSTREAM.json`, and `CHANGELOG.md`. Source and
|
|
52
|
+
test files are excluded. Verify a release candidate with:
|
|
53
|
+
|
|
54
|
+
```sh
|
|
55
|
+
npm pack --dry-run --json
|
|
56
|
+
```
|
|
57
|
+
|
|
58
|
+
The dry run must still contain `lib/index.js`, `lib/client.js`,
|
|
59
|
+
`cordis.patch.yml`, all 16 `skills/*/SKILL.md` files, and the documentation
|
|
60
|
+
listed above. The current `0.7.2` candidate is 279 entries; both the production
|
|
61
|
+
and full development dependency trees audit clean with DSH `0.2.2-rc.3`.
|
package/NOTICE.md
CHANGED
|
@@ -10,8 +10,9 @@ This package contains code and skill content adapted from third-party sources.
|
|
|
10
10
|
- Adapted commit: recorded in `UPSTREAM.json`
|
|
11
11
|
- Changes: SKILL.md trigger text and script invocation guidance adapted for the
|
|
12
12
|
DSH tool surface (`verymath_glossary_*` tools); Python scripts are included
|
|
13
|
-
|
|
14
|
-
|
|
13
|
+
with behaviour unchanged, except that `glossary_export.py` has a local
|
|
14
|
+
pyright-comment header. Skill content and scripts remain under the upstream
|
|
15
|
+
MIT license; this NOTICE and UPSTREAM.json record the provenance.
|
|
15
16
|
|
|
16
17
|
## VeryMath AI4Math-Paper-Reading (`math-paper-reading`, `graph-theory-paper-reading`, `after-ocr`)
|
|
17
18
|
|
package/README.md
CHANGED
|
@@ -90,7 +90,9 @@
|
|
|
90
90
|
|
|
91
91
|
## 安装与使用
|
|
92
92
|
|
|
93
|
-
要求 Node.js `24.22.1+` 与 DSH `0.2.x
|
|
93
|
+
要求 Node.js `24.22.1+` 与 DSH `0.2.x`:开发依赖与运行探针锁定 EduWork 0.4.14 所用的 `0.2.2-rc.3`,peer 范围同时覆盖 `0.2.1-rc.5`、`0.2.2-rc.1` 与后续 `0.2.x`。运行探针会检测宿主是否装载了工具执行器,据此自适应 0.2.1 的单调用与 0.2.2 的批量接口。
|
|
94
|
+
|
|
95
|
+
Python 解释器按“插件配置 → `DSH_OFFICE_PYTHON` → PATH → 常见 conda/Homebrew 目录”解析一次,工具与面板共用同一个绝对路径;从 Finder 启动、没有登录 shell PATH 的桌面应用也能找到 conda 环境里的 Python。
|
|
94
96
|
|
|
95
97
|
```sh
|
|
96
98
|
dsh plugin --profile <你的profile> add @louisultra/dsh-verymath
|
|
@@ -111,7 +113,7 @@ dsh plugin --profile <你的profile> add ./louisultra-dsh-verymath-<version>.tgz
|
|
|
111
113
|
|
|
112
114
|
- **查询与论文校验**:无需任何外部依赖。
|
|
113
115
|
- **术语库构建/导出**(`verymath_glossary_build`):需要本地 Python 3 与上游脚本依赖(`PyYAML`;Excel 导出另需 `openpyxl`,Web 管理界面另需 `Flask`)。`verymath_python_check` 只能确认 `python3` 可用;上游依赖缺失时由脚本报错(如 `No module named 'yaml'`),按需 `pip install PyYAML openpyxl Flask`。插件不捆绑 Python。
|
|
114
|
-
- **平台**:仅在 macOS(Apple Silicon
|
|
116
|
+
- **平台**:仅在 macOS(Apple Silicon)验证过,包括 DSH CLI 沙箱、EduWork 0.4.13 桌面端和 DSH `0.2.2-rc.3` 工具链。**Windows 未测试**:解释器按 PATH 与常见 conda 目录解析,外部二进制按 PATH 与 PATHEXT 解析(不再指向 macOS 固定路径),但未在 Windows 上实测,涉及 TeX、MATLAB、osqp 等外部环境的场景尤其如此。
|
|
115
117
|
|
|
116
118
|
## 持续集成
|
|
117
119
|
|
|
@@ -129,6 +131,8 @@ npm run test:upstream # 上游 math-glossary 离线测试(需把 VeryMath 的
|
|
|
129
131
|
# 克隆到与本仓库同级的 research/ 下;仅开发机可用,不随 npm 包分发)
|
|
130
132
|
```
|
|
131
133
|
|
|
134
|
+
更完整的构建、探针、上游测试与打包说明见 [`DEVELOPMENT.md`](DEVELOPMENT.md)。
|
|
135
|
+
|
|
132
136
|
## 许可与来源
|
|
133
137
|
|
|
134
138
|
本包 MIT 许可(`LICENSE`)。技能内容与 Python 脚本改编自 VeryMath 的 MIT 项目,来源提交与适配范围见 `UPSTREAM.json`,归属详情见 `NOTICE.md`。感谢 VeryMath 团队与上游贡献者。
|
package/README_EN.md
CHANGED
|
@@ -90,7 +90,9 @@ Skills carry the methodology; tools carry deterministic execution. The plugin co
|
|
|
90
90
|
|
|
91
91
|
## Installation and usage
|
|
92
92
|
|
|
93
|
-
Requires Node.js `24.22.1+` and DSH `0.2.x`: the
|
|
93
|
+
Requires Node.js `24.22.1+` and DSH `0.2.x`: development dependencies and the runtime probe pin `0.2.2-rc.3`, the version bundled with EduWork 0.4.14, while the peer range also covers `0.2.1-rc.5`, `0.2.2-rc.1` and later `0.2.x`. The runtime probe detects whether the host mounted a tool executor and adapts to the 0.2.1 single-call and 0.2.2 batch interfaces accordingly.
|
|
94
|
+
|
|
95
|
+
Python is resolved once per runtime through the plugin setting, `DSH_OFFICE_PYTHON`, PATH and the common conda/Homebrew directories. The tools and the panel receive the same absolute interpreter path, including when a desktop app starts without a login-shell PATH.
|
|
94
96
|
|
|
95
97
|
```sh
|
|
96
98
|
dsh plugin --profile <your-profile> add @louisultra/dsh-verymath
|
|
@@ -111,7 +113,7 @@ Then just ask in a session, e.g. "look up the Chinese term for manifold" or "rea
|
|
|
111
113
|
|
|
112
114
|
- **Query and paper validation**: no external dependencies.
|
|
113
115
|
- **Glossary build/export** (`verymath_glossary_build`): requires a local Python 3 plus the upstream script dependencies (`PyYAML`; Excel export additionally needs `openpyxl`, the web UI needs `Flask`). `verymath_python_check` only confirms that `python3` is available; a missing upstream dependency surfaces as a script error (for example `No module named 'yaml'`), so install what you need with `pip install PyYAML openpyxl Flask`. The plugin does not bundle Python.
|
|
114
|
-
- **Platforms**: verified on macOS (Apple Silicon)
|
|
116
|
+
- **Platforms**: verified on macOS (Apple Silicon), including the DSH CLI sandbox, the EduWork 0.4.13 desktop app and the DSH `0.2.2-rc.3` toolchain. Windows is not yet tested: interpreters are resolved through PATH and the common conda directories, and external binaries through PATH and PATHEXT rather than a macOS-only path, but neither has been exercised on Windows. Feedback welcome.
|
|
115
117
|
|
|
116
118
|
## Continuous integration
|
|
117
119
|
|
|
@@ -127,6 +129,9 @@ npm run test:runtime # real DSH API probe (synthetic data, no model calls)
|
|
|
127
129
|
npm run check # all of the above
|
|
128
130
|
```
|
|
129
131
|
|
|
132
|
+
See [`DEVELOPMENT.md`](DEVELOPMENT.md) for the full build, probe, upstream-test
|
|
133
|
+
and packaging notes.
|
|
134
|
+
|
|
130
135
|
## License and provenance
|
|
131
136
|
|
|
132
137
|
This package is MIT licensed (`LICENSE`). Skill content and Python scripts are adapted from VeryMath's MIT projects; the adapted commits and paths are recorded in `UPSTREAM.json`, with attribution details in `NOTICE.md`. Thanks to the VeryMath team and upstream contributors.
|
package/UPSTREAM.json
CHANGED
|
@@ -12,7 +12,7 @@
|
|
|
12
12
|
"skills/math-glossary/tests/",
|
|
13
13
|
"skills/matlab-runner/ (SKILL.md + references + examples, with DSH MCP setup notes)"
|
|
14
14
|
],
|
|
15
|
-
"adaptationNotes": "SKILL.md routing and script-invocation text adapted for DSH tool names (verymath_glossary_*); Python scripts
|
|
15
|
+
"adaptationNotes": "SKILL.md routing and script-invocation text adapted for DSH tool names (verymath_glossary_*); Python scripts have unchanged behavior and all but `glossary_export.py` are byte-for-byte upstream. That file adds a local pyright-comment header for openpyxl stubs; alias-row ids (`en__N`) still use the upstream algorithm. Tests are adapted to run from the skill directory. matlab-runner bundled after user installed MATLAB R2025b; MathWorks official MCP server v0.14.0 wired via dsh-mcp-client (5 tools match the skill capability list). One sentence added to SKILL.md rule 6 (added 0.4.0) explains the DSH tool contract that the bundled scripts do not cover: adding another translation omits term_id and creates an alias row, correcting a translation passes the term_id returned by a query."
|
|
16
16
|
},
|
|
17
17
|
{
|
|
18
18
|
"repository": "https://github.com/VeryMath/AI4Math-Paper-Reading",
|
package/lib/core/index.d.ts
CHANGED
|
@@ -112,6 +112,12 @@ export declare class VeryMathRuntime extends Service {
|
|
|
112
112
|
hits: GlossaryHit[];
|
|
113
113
|
total: number;
|
|
114
114
|
}>;
|
|
115
|
+
/**
|
|
116
|
+
* Resolve the configured Python interpreter without running it. The browser
|
|
117
|
+
* panel uses the same config and fallback search as the tools, so a configured
|
|
118
|
+
* `pythonExecutable`/`DSH_OFFICE_PYTHON` cannot make the two surfaces disagree.
|
|
119
|
+
*/
|
|
120
|
+
resolvePythonExecutable(): string | undefined;
|
|
115
121
|
/**
|
|
116
122
|
* Locate a Python interpreter able to run the upstream `math-glossary`
|
|
117
123
|
* scripts: the configured executable, then `python3`, then `python`.
|
package/lib/core/index.js
CHANGED
|
@@ -11,6 +11,7 @@ import { spawn } from 'node:child_process';
|
|
|
11
11
|
import { readFile } from 'node:fs/promises';
|
|
12
12
|
import { normalize } from 'node:path';
|
|
13
13
|
import { isErrnoCode, VeryMathError } from "./error.js";
|
|
14
|
+
import { resolveExecutable, resolvePythonExecutable } from "./exec.js";
|
|
14
15
|
import { parseGlossary, queryGlossary, validateGlossaryInvariants } from "./glossary.js";
|
|
15
16
|
import { bundledSkillsDir } from "./paths.js";
|
|
16
17
|
import { VeryMathSkillProvider } from "./skills.js";
|
|
@@ -81,7 +82,11 @@ export class VeryMathRuntime extends Service {
|
|
|
81
82
|
// Only a genuinely absent file means "there is no glossary yet". Treating
|
|
82
83
|
// every read failure that way let an EACCES/EIO/abort turn into "start from
|
|
83
84
|
// an empty glossary", and the next write then replaced the real document.
|
|
84
|
-
|
|
85
|
+
// ENOENT/ENOTDIR mean "there is no document at this path". Other read
|
|
86
|
+
// failures (permissions, I/O, cancellation) must not be mistaken for an
|
|
87
|
+
// empty glossary, because the upsert tool would then replace a real file
|
|
88
|
+
// with only the terms in that request.
|
|
89
|
+
if (isErrnoCode(error, 'ENOENT') || isErrnoCode(error, 'ENOTDIR')) {
|
|
85
90
|
throw new VeryMathError(`cannot read glossary at ${key}: ${error instanceof Error ? error.message : String(error)}`, 'VERYMATH_GLOSSARY_UNAVAILABLE', { cause: error });
|
|
86
91
|
}
|
|
87
92
|
if (error instanceof Error && error.name === 'AbortError')
|
|
@@ -154,6 +159,14 @@ export class VeryMathRuntime extends Service {
|
|
|
154
159
|
const { terms } = await this.loadGlossary(path, signal);
|
|
155
160
|
return queryGlossary(terms, query, { limit: this.config.queryMaxHits, ...queryOptions });
|
|
156
161
|
}
|
|
162
|
+
/**
|
|
163
|
+
* Resolve the configured Python interpreter without running it. The browser
|
|
164
|
+
* panel uses the same config and fallback search as the tools, so a configured
|
|
165
|
+
* `pythonExecutable`/`DSH_OFFICE_PYTHON` cannot make the two surfaces disagree.
|
|
166
|
+
*/
|
|
167
|
+
resolvePythonExecutable() {
|
|
168
|
+
return resolvePythonExecutable(this.config.pythonExecutable);
|
|
169
|
+
}
|
|
157
170
|
/**
|
|
158
171
|
* Locate a Python interpreter able to run the upstream `math-glossary`
|
|
159
172
|
* scripts: the configured executable, then `python3`, then `python`.
|
|
@@ -168,9 +181,12 @@ export class VeryMathRuntime extends Service {
|
|
|
168
181
|
async probePython() {
|
|
169
182
|
const candidates = [...new Set([this.config.pythonExecutable, 'python3', 'python'])];
|
|
170
183
|
for (const candidate of candidates) {
|
|
171
|
-
const
|
|
184
|
+
const resolved = resolveExecutable(candidate);
|
|
185
|
+
if (resolved === undefined)
|
|
186
|
+
continue;
|
|
187
|
+
const probe = await this.runPython(resolved, ['--version'], 5_000).catch(() => undefined);
|
|
172
188
|
if (probe !== undefined && probe.exitCode === 0)
|
|
173
|
-
return
|
|
189
|
+
return resolved;
|
|
174
190
|
}
|
|
175
191
|
return undefined;
|
|
176
192
|
}
|
package/lib/http.d.ts
CHANGED
|
@@ -27,6 +27,12 @@ export interface HttpContext {
|
|
|
27
27
|
* document and the chat tool keeps answering from the pre-write snapshot.
|
|
28
28
|
*/
|
|
29
29
|
readonly invalidateGlossaryCache?: () => void;
|
|
30
|
+
/**
|
|
31
|
+
* Resolve the configured Python interpreter. The runtime owns the plugin
|
|
32
|
+
* config (`pythonExecutable`/`DSH_OFFICE_PYTHON`), so the panel asks it
|
|
33
|
+
* instead of running a second resolver with different inputs.
|
|
34
|
+
*/
|
|
35
|
+
readonly resolvePythonExecutable?: () => string | undefined;
|
|
30
36
|
}
|
|
31
37
|
/**
|
|
32
38
|
* Resolve a caller-supplied relative path and refuse anything outside the workspace.
|
package/lib/http.js
CHANGED
|
@@ -142,7 +142,7 @@ function firstLine(text, max = 80) {
|
|
|
142
142
|
* `python3` is probed here only to answer "can the glossary build scripts run";
|
|
143
143
|
* the OSQP/Sage probes reuse the same command shape as the corresponding tools.
|
|
144
144
|
*/
|
|
145
|
-
async function probeEnvironment() {
|
|
145
|
+
async function probeEnvironment(svc) {
|
|
146
146
|
// All probes run concurrently: seven sequential spawns made the panel sit on
|
|
147
147
|
// "probing…" for up to twenty seconds, which reads as a hang.
|
|
148
148
|
const check = (executable, args, timeoutMs = 8_000) => run(executable, args, timeoutMs).catch(() => ({ ok: false, stdout: '', stderr: 'probe failed' }));
|
|
@@ -152,7 +152,7 @@ async function probeEnvironment() {
|
|
|
152
152
|
return { ok: false, stdout: '', stderr: 'not found' };
|
|
153
153
|
return await check(executable, args, timeoutMs);
|
|
154
154
|
};
|
|
155
|
-
const pythonExecutable = resolvePythonExecutable();
|
|
155
|
+
const pythonExecutable = svc?.resolvePythonExecutable?.() ?? resolvePythonExecutable();
|
|
156
156
|
const pythonProbe = pythonExecutable === undefined
|
|
157
157
|
? Promise.resolve({ ok: false, stdout: '', stderr: 'not found' })
|
|
158
158
|
: check(pythonExecutable, ['--version'], 5_000);
|
|
@@ -460,7 +460,7 @@ export function registerHttp(ctx, connection) {
|
|
|
460
460
|
methods: ['GET'],
|
|
461
461
|
requestBody: 'buffered',
|
|
462
462
|
fetch: guard(async () => {
|
|
463
|
-
const rows = await probeEnvironment();
|
|
463
|
+
const rows = await probeEnvironment(ctx);
|
|
464
464
|
const ready = rows.filter(row => row.state === 'ready').length;
|
|
465
465
|
return json({ rows, ready, total: rows.length, workspace: ctx.workspace() });
|
|
466
466
|
}),
|
package/lib/index.js
CHANGED
|
@@ -52,6 +52,9 @@ export const apply = (ctx) => {
|
|
|
52
52
|
...(service?.invalidateAllGlossaries !== undefined
|
|
53
53
|
? { invalidateGlossaryCache: service.invalidateAllGlossaries.bind(service) }
|
|
54
54
|
: {}),
|
|
55
|
+
...(service?.resolvePythonExecutable !== undefined
|
|
56
|
+
? { resolvePythonExecutable: service.resolvePythonExecutable.bind(service) }
|
|
57
|
+
: {}),
|
|
55
58
|
}, connection);
|
|
56
59
|
});
|
|
57
60
|
};
|
package/lib/tool/index.d.ts
CHANGED
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
*/
|
|
7
7
|
import type { Context } from '@deepseek-ai/cordis';
|
|
8
8
|
import z from '@deepseek-ai/schemastery';
|
|
9
|
-
import { executableSearchDirs, resolveExecutable, resolveSageExecutable, sageSearchDirs } from '
|
|
9
|
+
import { executableSearchDirs, resolveExecutable, resolveSageExecutable, sageSearchDirs } from '../core/index.ts';
|
|
10
10
|
export { executableSearchDirs, resolveExecutable, resolveSageExecutable, sageSearchDirs };
|
|
11
11
|
export declare const name = "tool-verymath";
|
|
12
12
|
export declare const inject: string[];
|
package/lib/tool/index.js
CHANGED
|
@@ -2,8 +2,8 @@ import z from '@deepseek-ai/schemastery';
|
|
|
2
2
|
import { defineTool } from '@deepseek-ai/dsh-tools';
|
|
3
3
|
import { spawn } from 'node:child_process';
|
|
4
4
|
import { isAbsolute, resolve } from 'node:path';
|
|
5
|
-
import { VeryMathError, isVeryMathError } from
|
|
6
|
-
import { bundledSkillsDir, checkGate, computeTopology, dependencySummary, executableSearchDirs, findExcerpt, focusClosure, loadManifest, mergeBatches, mergeStructures, parsePaperBatch, parsePaperStructure, readCorpusDocWindow, renderMermaid, resolveCorpusRoot, resolveExecutable, resolveSageExecutable, sageSearchDirs, searchSageRefs, termsFor, upsertTerms } from
|
|
5
|
+
import { VeryMathError, isVeryMathError } from "../core/index.js";
|
|
6
|
+
import { bundledSkillsDir, checkGate, computeTopology, dependencySummary, executableSearchDirs, findExcerpt, focusClosure, loadManifest, mergeBatches, mergeStructures, parsePaperBatch, parsePaperStructure, readCorpusDocWindow, renderMermaid, resolveCorpusRoot, resolveExecutable, resolveSageExecutable, sageSearchDirs, searchSageRefs, termsFor, upsertTerms } from "../core/index.js";
|
|
7
7
|
// Re-exported for the tool-level tests and for callers that imported these from
|
|
8
8
|
// the tool module before they moved into `core`. There is exactly one
|
|
9
9
|
// implementation now — two copies used to drift, which is how the panel ended up
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@louisultra/dsh-verymath",
|
|
3
|
-
"version": "0.7.
|
|
3
|
+
"version": "0.7.2",
|
|
4
4
|
"description": "VeryMath capabilities for DSH: 16 bundled math skills and 14 tools covering paper reading, bilingual glossary, writing, Beamer, optimization, computation, Lean formalization, research workflows, Sage doc lookup and MATLAB. Community plugin for issue ECNU/EduWork#152.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "lib/index.js",
|
|
@@ -23,6 +23,7 @@
|
|
|
23
23
|
"cordis.patch.yml",
|
|
24
24
|
"README.md",
|
|
25
25
|
"README_EN.md",
|
|
26
|
+
"DEVELOPMENT.md",
|
|
26
27
|
"LICENSE",
|
|
27
28
|
"NOTICE.md",
|
|
28
29
|
"UPSTREAM.json",
|
|
@@ -57,29 +58,36 @@
|
|
|
57
58
|
},
|
|
58
59
|
"peerDependencies": {
|
|
59
60
|
"@deepseek-ai/cordis": ">=4.0.5 <4.2.0",
|
|
60
|
-
"@deepseek-ai/dsh-fs": ">=0.2.1-rc.5 <0.3.0-0 || 0.2.2-rc.1",
|
|
61
|
-
"@deepseek-ai/dsh-llm": ">=0.2.1-rc.5 <0.3.0-0 || 0.2.2-rc.1",
|
|
62
|
-
"@deepseek-ai/dsh-skill": ">=0.2.1-rc.5 <0.3.0-0 || 0.2.2-rc.1",
|
|
63
|
-
"@deepseek-ai/dsh-tools": ">=0.2.1-rc.5 <0.3.0-0 || 0.2.2-rc.1",
|
|
61
|
+
"@deepseek-ai/dsh-fs": ">=0.2.1-rc.5 <0.3.0-0 || >=0.2.2-rc.1 <0.2.3-0",
|
|
62
|
+
"@deepseek-ai/dsh-llm": ">=0.2.1-rc.5 <0.3.0-0 || >=0.2.2-rc.1 <0.2.3-0",
|
|
63
|
+
"@deepseek-ai/dsh-skill": ">=0.2.1-rc.5 <0.3.0-0 || >=0.2.2-rc.1 <0.2.3-0",
|
|
64
|
+
"@deepseek-ai/dsh-tools": ">=0.2.1-rc.5 <0.3.0-0 || >=0.2.2-rc.1 <0.2.3-0",
|
|
64
65
|
"@deepseek-ai/schemastery": ">=3.18.5 <3.19.0 || 3.19.0"
|
|
65
66
|
},
|
|
66
67
|
"devDependencies": {
|
|
67
68
|
"@deepseek-ai/cordis": "4.1.0",
|
|
68
|
-
"@deepseek-ai/dsh-fs": "0.2.2-rc.
|
|
69
|
-
"@deepseek-ai/dsh-fs-local": "0.2.2-rc.
|
|
70
|
-
"@deepseek-ai/dsh-llm": "0.2.2-rc.
|
|
71
|
-
"@deepseek-ai/dsh-
|
|
72
|
-
"@deepseek-ai/dsh-
|
|
73
|
-
"@deepseek-ai/dsh-
|
|
74
|
-
"@deepseek-ai/dsh-
|
|
69
|
+
"@deepseek-ai/dsh-fs": "0.2.2-rc.3",
|
|
70
|
+
"@deepseek-ai/dsh-fs-local": "0.2.2-rc.3",
|
|
71
|
+
"@deepseek-ai/dsh-llm": "0.2.2-rc.3",
|
|
72
|
+
"@deepseek-ai/dsh-scope": "0.2.2-rc.3",
|
|
73
|
+
"@deepseek-ai/dsh-skill": "0.2.2-rc.3",
|
|
74
|
+
"@deepseek-ai/dsh-system-prompt": "0.2.2-rc.3",
|
|
75
|
+
"@deepseek-ai/dsh-tool-executor-native": "0.2.2-rc.3",
|
|
76
|
+
"@deepseek-ai/dsh-tools": "0.2.2-rc.3",
|
|
77
|
+
"@deepseek-ai/dsh-util-values": "0.2.2-rc.3",
|
|
75
78
|
"@deepseek-ai/schemastery": "3.19.0",
|
|
76
79
|
"@testing-library/dom": "10.4.2",
|
|
77
80
|
"@testing-library/react": "16.3.3",
|
|
78
81
|
"@types/js-yaml": "4.0.9",
|
|
79
82
|
"@types/node": "24.19.2",
|
|
83
|
+
"@types/react": "19.3.0",
|
|
84
|
+
"@types/react-dom": "19.3.0",
|
|
80
85
|
"jsdom": "31.0.0",
|
|
86
|
+
"react": "19.3.1",
|
|
87
|
+
"react-dom": "19.3.1",
|
|
88
|
+
"semver": "7.8.6",
|
|
81
89
|
"typescript": "6.0.3",
|
|
82
|
-
"vitest": "4.1.
|
|
90
|
+
"vitest": "4.1.12"
|
|
83
91
|
},
|
|
84
92
|
"keywords": [
|
|
85
93
|
"dsh",
|