dsh-ptc-moejs 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/README.md +1 -1
- package/README.zh_CN.md +1 -1
- package/lib/binary.d.ts +9 -0
- package/lib/binary.js +12 -1
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -138,7 +138,7 @@ The returned value goes back to dsh as lossless JSON: plain objects, arrays, str
|
|
|
138
138
|
- `console` output imitates Node's `util.inspect` for strings, numbers, plain objects, arrays, `Map`, `Set`, errors and class instances, and breaks a line at 72 characters.
|
|
139
139
|
- moejs interrupts running JavaScript, and a compile runs to its end once it starts. A program that takes long to parse still ends at its deadline for dsh, and the sidecar drops the run once the parse returns.
|
|
140
140
|
- If a tool call that the program never awaits fails, the failure stays in that unread promise.
|
|
141
|
-
-
|
|
141
|
+
- CI runs the tests on Linux x64, Linux arm64, macOS arm64 and Windows x64 for every push. macOS x64 is untested: its binary is cross-compiled from the same source.
|
|
142
142
|
|
|
143
143
|
## Development
|
|
144
144
|
|
package/README.zh_CN.md
CHANGED
|
@@ -138,7 +138,7 @@ return { head: head.stdout?.text };
|
|
|
138
138
|
- `console` 的输出仿照 Node 的 `util.inspect`,覆盖字符串、数字、普通对象、数组、`Map`、`Set`、错误和类的实例,单行超过 72 个字符时换行。
|
|
139
139
|
- moejs 的中断作用于正在运行的 JavaScript,编译一旦开始会一直进行到结束。解析很慢的程序到截止时间时,dsh 一侧照常结束这次运行,sidecar 等解析返回后丢弃它。
|
|
140
140
|
- 程序没有 await 的工具调用如果失败,这个失败只留在那个没人读取的 promise 里。
|
|
141
|
-
-
|
|
141
|
+
- CI 每次推送都在 Linux x64、Linux arm64、macOS arm64 和 Windows x64 上跑测试。macOS x64 还没测过,它的程序由同一份源码交叉编译。
|
|
142
142
|
|
|
143
143
|
## 开发
|
|
144
144
|
|
package/lib/binary.d.ts
CHANGED
|
@@ -5,6 +5,15 @@
|
|
|
5
5
|
*/
|
|
6
6
|
/** The platforms that have a binary package. */
|
|
7
7
|
export declare const PLATFORMS: readonly ["darwin-arm64", "darwin-x64", "linux-arm64", "linux-x64", "win32-x64"];
|
|
8
|
+
/**
|
|
9
|
+
* Name the package that holds the sidecar binary for a platform.
|
|
10
|
+
* npm's spam filter rejects the name dsh-ptc-moejs-win32-x64, so the
|
|
11
|
+
* Windows package says "windows" where Node says "win32".
|
|
12
|
+
* @param platform - the Node platform name.
|
|
13
|
+
* @param arch - the Node architecture name.
|
|
14
|
+
* @returns the npm package name.
|
|
15
|
+
*/
|
|
16
|
+
export declare function binaryPackage(platform: string, arch: string): string;
|
|
8
17
|
/**
|
|
9
18
|
* Resolve the sidecar binary for this platform.
|
|
10
19
|
* @param platform - the Node platform name.
|
package/lib/binary.js
CHANGED
|
@@ -6,6 +6,17 @@
|
|
|
6
6
|
import { createRequire } from 'node:module';
|
|
7
7
|
/** The platforms that have a binary package. */
|
|
8
8
|
export const PLATFORMS = ['darwin-arm64', 'darwin-x64', 'linux-arm64', 'linux-x64', 'win32-x64'];
|
|
9
|
+
/**
|
|
10
|
+
* Name the package that holds the sidecar binary for a platform.
|
|
11
|
+
* npm's spam filter rejects the name dsh-ptc-moejs-win32-x64, so the
|
|
12
|
+
* Windows package says "windows" where Node says "win32".
|
|
13
|
+
* @param platform - the Node platform name.
|
|
14
|
+
* @param arch - the Node architecture name.
|
|
15
|
+
* @returns the npm package name.
|
|
16
|
+
*/
|
|
17
|
+
export function binaryPackage(platform, arch) {
|
|
18
|
+
return `dsh-ptc-moejs-${platform === 'win32' ? 'windows' : platform}-${arch}`;
|
|
19
|
+
}
|
|
9
20
|
/**
|
|
10
21
|
* Resolve the sidecar binary for this platform.
|
|
11
22
|
* @param platform - the Node platform name.
|
|
@@ -15,7 +26,7 @@ export const PLATFORMS = ['darwin-arm64', 'darwin-x64', 'linux-arm64', 'linux-x6
|
|
|
15
26
|
*/
|
|
16
27
|
export function resolveBinary(platform = process.platform, arch = process.arch) {
|
|
17
28
|
const target = `${platform}-${arch}`;
|
|
18
|
-
const pkg =
|
|
29
|
+
const pkg = binaryPackage(platform, arch);
|
|
19
30
|
try {
|
|
20
31
|
return createRequire(import.meta.url).resolve(`${pkg}/bin/moejs-ptc${platform === 'win32' ? '.exe' : ''}`);
|
|
21
32
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "dsh-ptc-moejs",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.2",
|
|
4
4
|
"description": "PTC runtime for the DeepSeek Harness that runs model-written programs in moejs, a pure-Go JavaScript engine, inside one long-lived sidecar process",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"dsh-plugin",
|
|
@@ -54,7 +54,7 @@
|
|
|
54
54
|
"dsh-ptc-moejs-darwin-x64": "0.1.0",
|
|
55
55
|
"dsh-ptc-moejs-linux-arm64": "0.1.0",
|
|
56
56
|
"dsh-ptc-moejs-linux-x64": "0.1.0",
|
|
57
|
-
"dsh-ptc-moejs-
|
|
57
|
+
"dsh-ptc-moejs-windows-x64": "0.1.0"
|
|
58
58
|
},
|
|
59
59
|
"devDependencies": {
|
|
60
60
|
"@deepseek-ai/cordis": "~4.0.5",
|