claude-code-marketplace 0.5.2 → 0.5.3

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": "claude-code-marketplace",
3
- "version": "0.5.2",
3
+ "version": "0.5.3",
4
4
  "description": "Web UI for browsing and managing Claude Code marketplace plugins",
5
5
  "main": "server.js",
6
6
  "bin": {
package/public/app.js CHANGED
@@ -1002,6 +1002,25 @@ function restoreAppState() {
1002
1002
  if (params.has('plugin')) {
1003
1003
  selectedPluginId = params.get('plugin');
1004
1004
  }
1005
+ if (params.has('project')) {
1006
+ const projectPath = params.get('project');
1007
+ fetch('/api/project', {
1008
+ method: 'PUT',
1009
+ headers: { 'Content-Type': 'application/json' },
1010
+ body: JSON.stringify({ path: projectPath }),
1011
+ })
1012
+ .then((r) => {
1013
+ if (r.ok) {
1014
+ loadProject();
1015
+ loadData();
1016
+ }
1017
+ })
1018
+ .catch(() => {});
1019
+ const cleanParams = new URLSearchParams(window.location.search);
1020
+ cleanParams.delete('project');
1021
+ const qs = cleanParams.toString();
1022
+ history.replaceState(null, '', qs ? `?${qs}` : window.location.pathname);
1023
+ }
1005
1024
  try {
1006
1025
  const saved = JSON.parse(localStorage.getItem('expandedNodes') || '[]');
1007
1026
  saved.forEach((n) => expandedNodes.add(n));
@@ -1337,3 +1356,24 @@ function showHelpModal() {
1337
1356
  if ('serviceWorker' in navigator) {
1338
1357
  navigator.serviceWorker.register('/sw.js');
1339
1358
  }
1359
+
1360
+ // #region HUB_INTEGRATION
1361
+ (async function initHub() {
1362
+ const cfg = await fetch('/hub-config')
1363
+ .then((r) => r.json())
1364
+ .catch(() => ({}));
1365
+ if (!cfg.enabled) return;
1366
+ window.__HUB__ = cfg;
1367
+ document.addEventListener('keydown', (e) => {
1368
+ if (e.ctrlKey && e.altKey && (e.key === 'ArrowLeft' || e.key === 'ArrowRight')) {
1369
+ e.preventDefault();
1370
+ window.parent?.postMessage({ type: 'hub:keydown', key: e.key }, '*');
1371
+ }
1372
+ });
1373
+ })();
1374
+
1375
+ function hubNavigate(app, url) {
1376
+ if (!window.__HUB__?.enabled) return;
1377
+ window.parent?.postMessage({ type: 'hub:navigate', app, url }, '*');
1378
+ }
1379
+ // #endregion HUB_INTEGRATION
package/server.js CHANGED
@@ -7,6 +7,11 @@ const { execFile } = require('child_process');
7
7
 
8
8
  const app = express();
9
9
  app.use(express.json());
10
+
11
+ app.get('/hub-config', (_req, res) => {
12
+ res.json({ enabled: !!process.env.CLAUDE_HUB, url: process.env.HUB_URL || null });
13
+ });
14
+
10
15
  app.use(express.static(path.join(__dirname, 'public')));
11
16
 
12
17
  const CLAUDE_DIR = path.join(os.homedir(), '.claude');