minecodex 2.0.9 → 2.0.10

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "minecodex",
3
- "version": "2.0.9",
3
+ "version": "2.0.10",
4
4
  "description": "Lightweight, local-first plugins for the Codex desktop app.",
5
5
  "license": "MIT",
6
6
  "type": "module",
@@ -2,7 +2,10 @@
2
2
  export function tokenRequirements(source, bindings) {
3
3
  const nativeNames=new Map(Object.entries(bindings).map(([native,project])=>[project,native]));
4
4
  const requirements=new Map();
5
+ const localNames=new Set([...source.matchAll(/(--mcx-[a-z0-9-]+)\s*:/g)].map(match=>match[1]));
5
6
  for (const match of source.matchAll(/var\((--mcx-[a-z0-9-]+)\s*([,)])/g)) {
7
+ // 插件声明的局部变量不属于原生映射;其消费的共享变量仍独立检查。
8
+ if (!nativeNames.has(match[1]) && localNames.has(match[1])) continue;
6
9
  const name=nativeNames.get(match[1]) ?? match[1];
7
10
  requirements.set(name,{name,required:match[2] === ")" || requirements.get(name)?.required === true,
8
11
  ...(nativeNames.has(match[1]) ? {} : {unmapped:true})});