minecodex 2.0.15 → 2.0.16
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 +9 -0
- package/apps/dashboard/app.js +8 -5
- package/apps/dashboard/assets/data-transfer.js +2 -1
- package/apps/dashboard/transport.js +18 -0
- package/assets/brand/minecodex-icon-selected.svg +4 -0
- package/features/notes/assets/icons/prompt-entry-selected.svg +1 -0
- package/features/notes/assets/icons/prompt-entry.svg +16 -0
- package/features/notes/codex-feature.json +3 -2
- package/features/notes/src/adapters/codex/insertion.mjs +92 -0
- package/features/notes/src/adapters/codex/requests.mjs +7 -0
- package/features/notes/src/frontend/entry.mjs +39 -137
- package/features/notes/src/frontend/icons.json +0 -2
- package/features/notes/src/injection-source.mjs +5 -0
- package/package.json +18 -5
- package/packages/cli/src/commands.mjs +10 -0
- package/packages/codex-adapter/src/renderer/environment.mjs +30 -1
- package/packages/plugin/assets/app.js +116 -0
- package/packages/plugin/assets/prompts.js +437 -0
- package/packages/plugin/plugin.json +16 -0
- package/packages/plugin/src/app.mjs +17 -0
- package/packages/plugin/src/control-client.mjs +41 -0
- package/packages/plugin/src/install.mjs +26 -0
- package/packages/plugin/src/navigation-icons.mjs +8 -0
- package/packages/plugin/src/prompts-app.mjs +45 -0
- package/packages/plugin/src/prompts-client.mjs +16 -0
- package/packages/plugin/src/server.mjs +74 -0
- package/packages/plugin/src/ui-resource.mjs +22 -0
- package/packages/runtime-host/src/codex-injection.mjs +5 -12
- package/packages/runtime-host/src/codex-runtime.mjs +3 -16
- package/packages/ui/src/install.mjs +4 -3
- package/packages/ui/src/native/mcp-app.mjs +32 -0
- package/packages/ui/src/native/mcp-navigation.mjs +52 -0
- package/packages/ui/src/native/mcp-theme.css +4 -0
- package/packages/ui/src/native/mcp-theme.mjs +20 -0
- package/packages/ui/assets/arrow-up-right.svg +0 -13
- package/packages/ui/assets/minecodex-menu-16.svg +0 -7
- package/packages/ui/assets/minecodex-menu-20.svg +0 -7
- package/packages/ui/src/components/account-menu.mjs +0 -88
- package/packages/ui/src/native/account-menu.mjs +0 -21
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "minecodex",
|
|
3
|
-
"version": "2.0.
|
|
3
|
+
"version": "2.0.16",
|
|
4
4
|
"description": "Lightweight, local-first plugins for the Codex desktop app.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"type": "module",
|
|
@@ -57,6 +57,7 @@
|
|
|
57
57
|
"assets/brand/minecodex-icon.svg",
|
|
58
58
|
"assets/brand/minecodex-icon-light.svg",
|
|
59
59
|
"assets/brand/minecodex-icon-dark.svg",
|
|
60
|
+
"assets/brand/minecodex-icon-selected.svg",
|
|
60
61
|
"assets/brand/references/lucide-LICENSE.txt",
|
|
61
62
|
"assets/readme/hero.svg",
|
|
62
63
|
"packages/ui/assets",
|
|
@@ -67,14 +68,18 @@
|
|
|
67
68
|
"features/file-navigation/src",
|
|
68
69
|
"features/file-navigation/codex-feature.json",
|
|
69
70
|
"features/file-navigation/assets",
|
|
70
|
-
"features/file-navigation/vendor/lucide-LICENSE"
|
|
71
|
+
"features/file-navigation/vendor/lucide-LICENSE",
|
|
72
|
+
"apps/dashboard/transport.js",
|
|
73
|
+
"packages/plugin/src",
|
|
74
|
+
"packages/plugin/assets",
|
|
75
|
+
"packages/plugin/plugin.json"
|
|
71
76
|
],
|
|
72
77
|
"engines": {
|
|
73
78
|
"node": ">=22.5.0"
|
|
74
79
|
},
|
|
75
80
|
"scripts": {
|
|
76
81
|
"start": "node packages/cli/bin/mcx.mjs serve",
|
|
77
|
-
"test": "node --test packages/cli/test/*.test.mjs packages/runtime-host/test/*.test.mjs features/model-slider/test/*.test.mjs features/notes/test/*.test.mjs features/images/test/*.test.mjs features/hide-upsell-banner/test/*.test.mjs features/session-status/test/*.test.mjs features/usage-meter/test/*.test.mjs apps/dashboard/test/*.test.mjs features/unread-inbox/test/*.test.mjs features/sidebar-focus/test/*.test.mjs features/sites/test/*.test.mjs packages/ui/test/*.test.mjs packages/codex-adapter/test/*.test.mjs features/markdown-reading/test/*.test.mjs features/file-navigation/test/*.test.mjs",
|
|
82
|
+
"test": "node --test packages/cli/test/*.test.mjs packages/runtime-host/test/*.test.mjs features/model-slider/test/*.test.mjs features/notes/test/*.test.mjs features/images/test/*.test.mjs features/hide-upsell-banner/test/*.test.mjs features/session-status/test/*.test.mjs features/usage-meter/test/*.test.mjs apps/dashboard/test/*.test.mjs features/unread-inbox/test/*.test.mjs features/sidebar-focus/test/*.test.mjs features/sites/test/*.test.mjs packages/ui/test/*.test.mjs packages/codex-adapter/test/*.test.mjs features/markdown-reading/test/*.test.mjs features/file-navigation/test/*.test.mjs packages/plugin/test/*.test.mjs",
|
|
78
83
|
"test:cli": "node --test packages/cli/test/*.test.mjs",
|
|
79
84
|
"test:runtime": "node --test packages/runtime-host/test/*.test.mjs",
|
|
80
85
|
"check": "node scripts/check-syntax.mjs",
|
|
@@ -83,7 +88,9 @@
|
|
|
83
88
|
"pack:audit": "node scripts/audit-package.mjs",
|
|
84
89
|
"prepublishOnly": "npm test && npm run check && npm run pack:audit",
|
|
85
90
|
"test:ui": "node --test packages/ui/test/*.test.mjs",
|
|
86
|
-
"build:icons": "node scripts/build-brand-icons.mjs"
|
|
91
|
+
"build:icons": "node scripts/build-brand-icons.mjs",
|
|
92
|
+
"build:plugin": "node scripts/build-plugin.mjs",
|
|
93
|
+
"test:plugin": "node --test packages/plugin/test/*.test.mjs"
|
|
87
94
|
},
|
|
88
95
|
"repository": {
|
|
89
96
|
"type": "git",
|
|
@@ -105,6 +112,12 @@
|
|
|
105
112
|
"win32"
|
|
106
113
|
],
|
|
107
114
|
"dependencies": {
|
|
108
|
-
"
|
|
115
|
+
"@modelcontextprotocol/ext-apps": "^2.0.3",
|
|
116
|
+
"@modelcontextprotocol/sdk": "^1.32.0",
|
|
117
|
+
"acorn": "^8.18.0",
|
|
118
|
+
"zod": "^4.6.5"
|
|
119
|
+
},
|
|
120
|
+
"devDependencies": {
|
|
121
|
+
"esbuild": "^0.28.2"
|
|
109
122
|
}
|
|
110
123
|
}
|
|
@@ -85,6 +85,7 @@ Commands:
|
|
|
85
85
|
mcx uninstall [--purge] Remove integration; preserve data unless --purge is used
|
|
86
86
|
mcx update Update to the latest stable npm release
|
|
87
87
|
mcx open Open the MineCodex plugin control panel
|
|
88
|
+
mcx plugin install Register the official Codex plugin entry
|
|
88
89
|
mcx status [--json] Show installation and plugin status
|
|
89
90
|
mcx restart Restart Codex and apply saved plugin switches
|
|
90
91
|
mcx --version Print the installed version
|
|
@@ -447,6 +448,15 @@ export async function runCli(argv, {
|
|
|
447
448
|
const [command = "--help", ...args] = argv;
|
|
448
449
|
if (["--help", "-h", "help"].includes(command)) return printHelp(output);
|
|
449
450
|
if (["--version", "-v"].includes(command)) return output(packageMetadata.version);
|
|
451
|
+
if (command === "plugin" && args[0] === "serve") {
|
|
452
|
+
const { servePlugin } = await import("../../plugin/src/server.mjs");
|
|
453
|
+
return servePlugin({ paths });
|
|
454
|
+
}
|
|
455
|
+
if (command === "plugin" && args[0] === "install") {
|
|
456
|
+
const { installPlugin } = await import("../../plugin/src/install.mjs");
|
|
457
|
+
await installPlugin({ paths });
|
|
458
|
+
return output("MineCodex plugin installed. Open Explore in Codex to find MineCodex.");
|
|
459
|
+
}
|
|
450
460
|
if (command === "install") return installCommand({ paths, platform, cliPath, output, serviceProbe, fetchImpl, confirmRestart, nodeVersion });
|
|
451
461
|
if (command === "open" || command === "gui") return openCommand({ paths, platform, output, serviceProbe, fetchImpl });
|
|
452
462
|
if (command === "status") return statusCommand({ paths, platform, jsonOutput: args.includes("--json"), output, fetchImpl });
|
|
@@ -65,12 +65,41 @@ export function createCodexEnvironment() {
|
|
|
65
65
|
const group = [...(scroll?.children ?? [])].find(child => child !== ownGroup && child.classList.contains('flex-col') && child.classList.contains('shrink-0'));
|
|
66
66
|
return node && template && scroll ? { rail:node, template, scroll, group } : null;
|
|
67
67
|
}
|
|
68
|
+
// 导航与 MCP iframe 身份在 Adapter 内解释,功能不接触 React props。
|
|
69
|
+
function navigation() {
|
|
70
|
+
const scope = props(rail(), value => Boolean((value.router ?? value.value?.router)?.navigate));
|
|
71
|
+
const router = scope?.router ?? scope?.value?.router;
|
|
72
|
+
if (!router?.subscribe) return null;
|
|
73
|
+
const read = () => {
|
|
74
|
+
const location = router.state.location;
|
|
75
|
+
return {path:location.pathname + (location.search ?? "") + (location.hash ?? ""), key:location.key};
|
|
76
|
+
};
|
|
77
|
+
return {location:read, navigate:path => router.navigate(path, {replace:true}),
|
|
78
|
+
subscribe:callback => router.subscribe(state => {
|
|
79
|
+
if (!state.navigation?.state || state.navigation.state === "idle") callback(read());
|
|
80
|
+
})};
|
|
81
|
+
}
|
|
82
|
+
function mcpAppSource(sourceWindow, {server, pluginId, resourceUri}) {
|
|
83
|
+
for (const frame of document.querySelectorAll('[data-mcp-extension-surface] iframe')) {
|
|
84
|
+
let source = sourceWindow, matches = false;
|
|
85
|
+
// 官方 sandbox proxy 包含资源 iframe;WindowProxy.parent 可跨源读取。
|
|
86
|
+
for (let depth = 0; source && depth < 4; depth++) {
|
|
87
|
+
if (source === frame.contentWindow) {matches = true;break;}
|
|
88
|
+
try {if (source.parent === source) break; source = source.parent;} catch {break;}
|
|
89
|
+
}
|
|
90
|
+
if (!matches) continue;
|
|
91
|
+
const view = props(frame, value => value.view?.resourceUri != null)?.view;
|
|
92
|
+
if (view?.resourceUri === resourceUri && (view.server === server || view.pluginId === pluginId))
|
|
93
|
+
return {connected:() => frame.isConnected};
|
|
94
|
+
}
|
|
95
|
+
return null;
|
|
96
|
+
}
|
|
68
97
|
function route() {
|
|
69
98
|
const node = rail();
|
|
70
99
|
const scope = node && props(node, value => Boolean((value.router ?? value.value?.router)?.state?.location));
|
|
71
100
|
return (scope?.router ?? scope?.value?.router)?.state?.location?.pathname ?? null;
|
|
72
101
|
}
|
|
73
|
-
return { composer, composerSurface, rail, railSlot, route, currentThreadId:element => composer(element)?.threadId ?? null,
|
|
102
|
+
return { composer, composerSurface, rail, railSlot, route, navigation, mcpAppSource, currentThreadId:element => composer(element)?.threadId ?? null,
|
|
74
103
|
// 仅供 UI/插件 native Adapter 使用,交互层不读取 React props。
|
|
75
104
|
currentFiber, props, report, diagnostics:() => [...capabilities.values()].map(item => ({...item})) };
|
|
76
105
|
}
|