Skip to content
Discussion options

You must be logged in to vote

支持 Windows。这个错误不是插件代码本身的问题,而是 Node ESM 把原始路径开头的 F: 当成了 URL protocol;ESM loader 需要标准的 file: URL。

不要手工处理斜杠和转义,在 PowerShell 中让 Node 生成:

$pluginPath = Join-Path $PWD "scratch-plugin\src\my-plugin.ts"
node -e "const {pathToFileURL}=require('node:url'); console.log(pathToFileURL(process.argv[1]).href)" $pluginPath

它会输出类似:

file:///F:/path/to/deepseek-harness/scratch-plugin/src/my-plugin.ts

把这个完整输出放进 scratch-plugin/cordis.yml

- insert:
    - id: hello
      name: "file:///F:/path/to/deepseek-harness/scratch-plugin/src/my-plugin.ts"

然后重新运行:

pnpm dsh web --patch ./scratch-plugin/cordis.yml

成功边界是终端打印插件的 [hello-plugin] loaded,而不只是 URL scheme 错误消失。

当前 0.1.2-alpha.1 源码还会把 overlay 中插入的 ./src/my-plugin.ts

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@plytfys
Comment options

Answer selected by plytfys
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants