你遇到的错误来自一个叫 OpenClaw 的工具,它在校验插件配置时被拦截了:

Config validation failed: plugins: plugin: extension entry escapes package directory: ./index.ts

意思是:插件入口文件 ./index.ts 指向的路径跑到了这个插件自身的目录之外,被安全策略拒绝了。

结合你前面的信息,你大概是在用 openclaw configure 向导配置一个 飞书 DM policy 的插件(或者手动编辑了配置),但是给出的入口路径不符合要求。


为什么会这样?

OpenClaw 要求每个插件的所有文件都必须放在它自己的“包目录”里面,入口文件也不能跳出这个目录(防止路径遍历等安全问题)。
常见的触发场景:

  • 你在配置里写 entry: ./index.ts,但这个路径是相对于 OpenClaw 配置文件所在目录,而不是插件自己的目录。

  • 插件目录里其实没有 index.ts,那个文件在别的地方,或者插件本身只是一个裸文件,没有包目录。


怎么修?

1. 找到你的 OpenClaw 配置文件
一般会叫 openclaw.yaml / openclaw.yml / .openclaw/config.yaml,具体位置可以看向导提示,或者在 C:\Users\<你的用户名>\ 下找找。

2. 找到插件那段配置
类似:

plugins:
  feishu-dm-policy:
    entry: ./index.ts   # 这里有问题

3. 改成正确的入口路径
要让 entry 指向插件目录里面的某个文件,而且不能包含 ../ 跳出该目录。
正确的做法是:

  • 先确认插件的目录结构:比如插件文件夹是 feishu-dm-policy/,里面有个 index.ts

  • 在配置里用相对该插件目录的路径,例如只写 index.ts,而不是 ./index.ts(要看 OpenClaw 的约定,通常就是不带路径前缀的文件名或相对路径,且不能逃逸)

如果你是在命令行向导里直接输入路径,也改成类似 feishu-dm-policy/index.ts 这种在插件目录内的写法,并确保这个文件存在。

4. 如果插件只有一个单独的文件
那需要先给它建一个目录,比如:

feishu-dm-policy/
  index.ts

然后在配置里将插件设为这个目录,入口写 index.ts(不要带 ./ 或绝对路径,以符合“不逃逸”的要求)。


快速验证

改完配置后,重新执行你之前的 openclaw 命令(可能是 openclaw configure 或配对相关的命令),看错误是否消失。


如果还不行,方便的话把 插件目录结构 和 OpenClaw 配置文件里插件那一段 发给我,我可以帮你写出正确的配置。

We need to understand the user's message. It starts with "什么东西?" which is Chinese for "What is this?" or "What is it?" Then there's a line "o Feishu DM policy" (maybe "o" is a typo for "or" or "Open"?). Then "| Pairing (recommended)" looks like a CLI prompt. Then an error log from openclaw about config validation failed: "plugin: extension entry escapes package directory: ./index.ts". Then a stack trace.

User likely encountered an error while trying to configure openclaw with a Feishu (Lark) DM policy plugin. They're asking "什么东西?" meaning they're confused about the error. They might need explanation and a fix.

The error: "Config validation failed: plugins: plugin: extension entry escapes package directory: ./index.ts". This suggests that openclaw's configuration specifies a plugin with an entry point "./index.ts" that is considered to be escaping the package directory (maybe due to path traversal or symlink?). The plugin might be for Feishu DM policy. The "Pairing (recommended)" suggests a wizard or config option.

We need to interpret the error and provide a solution. The user likely ran something like openclaw configure or a pairing command. The error occurs when writing config, possibly because the entry point is relative but resolves outside the allowed directory. This might be a security measure.

I should explain the error and suggest how to fix the plugin configuration. Could be that the plugin is defined with a relative path that goes beyond the package root (e.g., "../../something"). The user might need to use an absolute path or ensure the plugin is installed locally. Maybe the plugin is from a local file that's not properly packaged. The error says "extension entry escapes package directory" which seems like a validation that the plugin's entry point (in the config) does not resolve to a path outside the plugin's designated directory. The config validation might be checking that "./index.ts" is within the plugin's own directory. If the plugin is a directory, maybe the entry is outside that directory. Could be the openclaw config has something like:

plugins:

  • name: feishu-dm-policy
    entry: ./index.ts

But that "./index.ts" might be relative to the current working directory, and openclaw expects it to be within the plugin's package directory, maybe it's not properly isolated. Possibly they need to set the entry as a full path or ensure it's inside the plugin's directory.

I should research openclaw (maybe an open-source tool). Quick mental search: openclaw might be a tool for managing policies or configurations? Not sure. But from the error, it's about config validation for plugins. The trace shows writeConfigFile at auth-profiles-CNyDTsy4.jspersistConfigrunConfigureWizard. So it's during a configuration wizard. The user was likely trying to add a Feishu DM policy plugin.

I'll structure the answer: first, clarify what the error means. Then suggest how to resolve: check the plugin entry path in the openclaw configuration file, ensure it points to a valid file within the plugin's directory. Perhaps the plugin was installed from a local path and the entry is set to "./index.ts" but the openclaw config expects a package directory, and the entry path must not traverse outside. Could also be a bug in the plugin's openclaw manifest. I'll provide steps: locate the openclaw config file (maybe openclaw.yaml or .openclaw/config.yaml), find the plugin section, change entry to an absolute path or ensure it's within the plugin directory. Or if the plugin is a local folder, maybe they need to use a different format like package: path/to/plugin. Not sure. I'll hypothesize: The config might be something like:

plugins:
feishu-dm-policy:
entry: ./index.ts

And that fails because the entry is relative to the config file location, and openclaw interprets it as escaping the plugin's package directory (maybe it expects entry to be relative to the plugin's own directory, not the config directory). The error "extension entry escapes package directory" suggests that after resolving, the entry points to a file outside of the plugin's designated directory. Maybe the plugin is not a directory but a single file, so there is no package directory. Could be that the user tried to add a plugin with --plugin entry=./index.ts during the wizard. The wizard probably validates.

I'll explain: The error means that openclaw's configuration validation found that the plugin's entry point (./index.ts) resolves to a location outside the plugin's own directory, which is not allowed for security reasons. This typically happens if you specify a relative path that points outside the plugin folder, or if the plugin isn't structured as a proper package with all files contained. Fix: Either restructure the plugin so that all its files, including the entry point, are within the same directory, and then set the entry path relative to that plugin directory (like just index.ts). Or if the plugin is a single file, maybe you can place the plugin file in its own directory and reference it as ./plugin-dir/index.ts but ensure the entry is inside. Alternatively, use an absolute path if supported. I'll also mention checking openclaw documentation for plugin configuration. Since I don't have access to openclaw docs, I'll provide general advice and ask for more details if needed.

I'll respond in Chinese because user started with "什么东西?" (Chinese). So answer in Chinese. Provide friendly explanation and troubleshooting steps.

Logo

中国智能体开发者社区,聚焦智能体与大模型开发,提供前沿资讯、实用工具链、开源项目及行业案例。通过技术沙龙、开发者大赛等活动,促进经验交流与协作,助力开发者快速构建创新智能应用。

更多推荐