@skedulo/memory-hub-mcp 0.2.39 → 0.2.41
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 +2 -0
- package/assets/session-start.sh +12 -2
- package/assets/session-stop.sh +2 -2
- package/assets/skills/ask/SKILL.md +3 -3
- package/assets/skills/delegate-ticket/SKILL.md +2 -1
- package/assets/skills/plan-ticket/SKILL.md +5 -2
- package/assets/skills/setup/SKILL.md +1 -1
- package/assets/uninstall-memory-hub.sh +1 -1
- package/dist/ask-prompt.js +1 -1
- package/dist/index.js +19 -1
- package/dist/list-fields.js +27 -0
- package/dist/login-tool.js +11 -2
- package/dist/migrate-plugin.js +49 -81
- package/dist/move-lock.js +55 -0
- package/dist/move-trigger.js +43 -0
- package/dist/plugin-move-util.js +77 -0
- package/dist/read-api.js +6 -1
- package/dist/setup.js +82 -51
- package/dist/skedulo-move.js +323 -0
- package/package.json +1 -1
- package/skill-guide.md +3 -1
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.logLine = exports.withNotes = exports.captureFlag = exports.captureValue = exports.putBack = exports.pick = exports.updateSettings = exports.readStrict = exports.parseObject = exports.message = exports.has = void 0;
|
|
4
|
+
const fs_1 = require("fs");
|
|
5
|
+
const setup_1 = require("./setup");
|
|
6
|
+
const has = (value, key) => typeof value === 'object' && value !== null && Object.prototype.hasOwnProperty.call(value, key);
|
|
7
|
+
exports.has = has;
|
|
8
|
+
const message = (error) => (error instanceof Error ? error.message : String(error));
|
|
9
|
+
exports.message = message;
|
|
10
|
+
function parseObject(output) {
|
|
11
|
+
const start = output.indexOf('{');
|
|
12
|
+
const end = output.lastIndexOf('}');
|
|
13
|
+
if (start < 0 || end < start)
|
|
14
|
+
return undefined;
|
|
15
|
+
try {
|
|
16
|
+
return JSON.parse(output.slice(start, end + 1));
|
|
17
|
+
}
|
|
18
|
+
catch {
|
|
19
|
+
return undefined;
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
exports.parseObject = parseObject;
|
|
23
|
+
// readJson reads a torn or hand-broken file as {}, and writing that back would wipe the user's settings.
|
|
24
|
+
function readStrict(path) {
|
|
25
|
+
if (!(0, fs_1.existsSync)(path))
|
|
26
|
+
return {};
|
|
27
|
+
try {
|
|
28
|
+
const value = JSON.parse((0, fs_1.readFileSync)(path, 'utf8'));
|
|
29
|
+
return typeof value === 'object' && value !== null && !Array.isArray(value) ? value : undefined;
|
|
30
|
+
}
|
|
31
|
+
catch {
|
|
32
|
+
return undefined;
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
exports.readStrict = readStrict;
|
|
36
|
+
function updateSettings(path, change) {
|
|
37
|
+
const settings = readStrict(path);
|
|
38
|
+
if (!settings)
|
|
39
|
+
return false;
|
|
40
|
+
change(settings);
|
|
41
|
+
(0, setup_1.writeJson)(path, settings);
|
|
42
|
+
return true;
|
|
43
|
+
}
|
|
44
|
+
exports.updateSettings = updateSettings;
|
|
45
|
+
function pick(source, keys) {
|
|
46
|
+
return Object.fromEntries(keys.filter((key) => (0, exports.has)(source, key)).map((key) => [key, JSON.parse(JSON.stringify(source[key]))]));
|
|
47
|
+
}
|
|
48
|
+
exports.pick = pick;
|
|
49
|
+
function putBack(settings, field, keys, before) {
|
|
50
|
+
for (const key of keys) {
|
|
51
|
+
if ((0, exports.has)(before, key))
|
|
52
|
+
(settings[field] ||= {})[key] = before[key];
|
|
53
|
+
else if ((0, exports.has)(settings[field], key))
|
|
54
|
+
delete settings[field][key];
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
exports.putBack = putBack;
|
|
58
|
+
function captureValue(inputs) {
|
|
59
|
+
const capture = inputs?.capture;
|
|
60
|
+
if (capture === true || capture === 'true')
|
|
61
|
+
return true;
|
|
62
|
+
if (capture === false || capture === 'false')
|
|
63
|
+
return false;
|
|
64
|
+
return undefined;
|
|
65
|
+
}
|
|
66
|
+
exports.captureValue = captureValue;
|
|
67
|
+
function captureFlag(inputs) {
|
|
68
|
+
const capture = captureValue(inputs);
|
|
69
|
+
return capture === undefined ? [] : ['--config', `capture=${capture}`];
|
|
70
|
+
}
|
|
71
|
+
exports.captureFlag = captureFlag;
|
|
72
|
+
const withNotes = (reason, notes) => (notes.length > 0 ? `${reason} (${notes.join('; ')})` : reason);
|
|
73
|
+
exports.withNotes = withNotes;
|
|
74
|
+
function logLine(status, reason) {
|
|
75
|
+
return `${new Date().toISOString()} ${status} ${reason.replace(/\s+/g, ' ')}`;
|
|
76
|
+
}
|
|
77
|
+
exports.logLine = logLine;
|
package/dist/read-api.js
CHANGED
|
@@ -5,6 +5,7 @@ const zod_1 = require("zod");
|
|
|
5
5
|
const annotate_1 = require("./annotate");
|
|
6
6
|
const change_tools_1 = require("./change-tools");
|
|
7
7
|
const check_sources_1 = require("./check-sources");
|
|
8
|
+
const list_fields_1 = require("./list-fields");
|
|
8
9
|
const list_repos_1 = require("./list-repos");
|
|
9
10
|
const recall_1 = require("./recall");
|
|
10
11
|
const source_1 = require("./source");
|
|
@@ -41,6 +42,7 @@ const listShape = {
|
|
|
41
42
|
verifiedBefore: zod_1.z.string().min(1).refine(source_1.isIsoDate, 'verifiedBefore must be an ISO date or datetime').optional().describe('Only items last verified before this ISO date or datetime.'),
|
|
42
43
|
offset: zod_1.z.number().int().min(0).optional(),
|
|
43
44
|
limit: zod_1.z.number().int().min(1).max(200).optional().describe('Default 50, max 200.'),
|
|
45
|
+
fields: zod_1.z.array(zod_1.z.enum(list_fields_1.LIST_FIELDS)).min(1).optional().describe(list_fields_1.LIST_FIELDS_DESCRIPTION),
|
|
44
46
|
};
|
|
45
47
|
const checkSourcesShape = {
|
|
46
48
|
repo: zod_1.z.string().min(1).optional().describe("owner/name. Defaults to the current directory's repo."),
|
|
@@ -95,7 +97,10 @@ exports.READ_FUNCTIONS = {
|
|
|
95
97
|
summary: 'List one type of items you can see, newest first, one page at a time.',
|
|
96
98
|
flags: '`check`, `upstream`; not annotated, so no `staleness` or `superseded`',
|
|
97
99
|
shape: listShape,
|
|
98
|
-
run: ({ client }, input) =>
|
|
100
|
+
run: async ({ client }, input) => {
|
|
101
|
+
const { fields, ...filters } = input;
|
|
102
|
+
return (0, list_fields_1.projectListItems)(await client.listResources(filters), fields);
|
|
103
|
+
},
|
|
99
104
|
},
|
|
100
105
|
related: {
|
|
101
106
|
name: 'related',
|
package/dist/setup.js
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
3
|
+
exports.desktopRestartOffer = exports.insideClaudeDesktop = exports.chooseSetup = exports.registerPromptHook = exports.registerSessionStartHook = exports.removeMcpServer = exports.removeCopiedAssets = exports.setCapture = exports.captureOn = exports.CAPTURE_FLAG = exports.unregisterHooks = exports.claudeRunner = exports.installPlugin = exports.enableMarketplaceAutoUpdate = exports.removeUserEnv = exports.allowMemoryHubTools = exports.writeUserEnv = exports.writeDesktopConfig = exports.writeMcpServer = exports.functionUrl = exports.writeJson = exports.readJsonStrict = exports.readJson = exports.desktopConfigPath = exports.mcpLaunch = exports.lastLine = exports.isSkeduloSource = exports.isHubSource = exports.pluginInstalled = exports.installedPluginId = exports.installedPluginIds = exports.claudeConfigDir = exports.marketplaceSource = exports.marketplaceFromRoot = exports.skeduloMoveEnabled = exports.LEGACY_PLUGIN_ID = exports.SKEDULO_MARKETPLACE_MOVE = exports.SKEDULO_PLUGIN_ID = exports.SKEDULO_MARKETPLACE_REPO = exports.SKEDULO_MARKETPLACE_NAME = exports.PLUGIN_ID = exports.DIRECT_ALLOW_RULE = exports.PLUGIN_ALLOW_RULE = exports.MARKETPLACE_REF = exports.MARKETPLACE_GIT_URL = exports.MARKETPLACE_REPO = exports.LEGACY_MARKETPLACE_NAME = exports.MARKETPLACE_NAME = exports.launchPath = exports.PACKAGE_SPEC = void 0;
|
|
4
|
+
exports.runSetup = exports.runCapture = exports.captureMessage = exports.processAncestors = exports.doneLine = void 0;
|
|
4
5
|
const child_process_1 = require("child_process");
|
|
5
6
|
const fs_1 = require("fs");
|
|
6
7
|
const os_1 = require("os");
|
|
@@ -8,6 +9,8 @@ const path_1 = require("path");
|
|
|
8
9
|
const readline_1 = require("readline");
|
|
9
10
|
const asset_sync_1 = require("./asset-sync");
|
|
10
11
|
const migrate_plugin_1 = require("./migrate-plugin");
|
|
12
|
+
const skedulo_move_1 = require("./skedulo-move");
|
|
13
|
+
const move_lock_1 = require("./move-lock");
|
|
11
14
|
const DEFAULT_API_HOST = 'dev-api.test.skl.io';
|
|
12
15
|
const DEFAULT_TENANT = 'memory-hub';
|
|
13
16
|
const SKED_CONFIG = (0, path_1.join)((0, os_1.homedir)(), '.config', 'sked', 'config.json');
|
|
@@ -30,7 +33,28 @@ exports.MARKETPLACE_REF = 'main';
|
|
|
30
33
|
exports.PLUGIN_ALLOW_RULE = 'mcp__plugin_memory-hub_memory-hub__*';
|
|
31
34
|
exports.DIRECT_ALLOW_RULE = 'mcp__memory-hub__*';
|
|
32
35
|
exports.PLUGIN_ID = `memory-hub@${exports.MARKETPLACE_NAME}`;
|
|
36
|
+
exports.SKEDULO_MARKETPLACE_NAME = 'skedulo-plugin-marketplace';
|
|
37
|
+
exports.SKEDULO_MARKETPLACE_REPO = 'Skedulo/skedulo-plugin-marketplace';
|
|
38
|
+
exports.SKEDULO_PLUGIN_ID = `memory-hub@${exports.SKEDULO_MARKETPLACE_NAME}`;
|
|
39
|
+
exports.SKEDULO_MARKETPLACE_MOVE = false;
|
|
33
40
|
exports.LEGACY_PLUGIN_ID = `memory-hub@${exports.LEGACY_MARKETPLACE_NAME}`;
|
|
41
|
+
function skeduloMoveEnabled(env = process.env) {
|
|
42
|
+
return exports.SKEDULO_MARKETPLACE_MOVE || env.MEMORY_HUB_SKEDULO_MOVE === '1';
|
|
43
|
+
}
|
|
44
|
+
exports.skeduloMoveEnabled = skeduloMoveEnabled;
|
|
45
|
+
function marketplaceFromRoot(root) {
|
|
46
|
+
const path = (root || '').replace(/\\/g, '/');
|
|
47
|
+
const marker = 'plugins/cache/';
|
|
48
|
+
const at = path.indexOf(marker);
|
|
49
|
+
return at < 0 ? undefined : path.slice(at + marker.length).split('/')[0] || undefined;
|
|
50
|
+
}
|
|
51
|
+
exports.marketplaceFromRoot = marketplaceFromRoot;
|
|
52
|
+
function marketplaceSource(name) {
|
|
53
|
+
if (name === exports.SKEDULO_MARKETPLACE_NAME)
|
|
54
|
+
return { source: 'github', repo: exports.SKEDULO_MARKETPLACE_REPO };
|
|
55
|
+
return { source: 'github', repo: exports.MARKETPLACE_REPO, ref: exports.MARKETPLACE_REF };
|
|
56
|
+
}
|
|
57
|
+
exports.marketplaceSource = marketplaceSource;
|
|
34
58
|
// `||`, not `??`: Claude Code treats an empty CLAUDE_CONFIG_DIR as the current directory.
|
|
35
59
|
function claudeConfigDir(env = process.env, home = (0, os_1.homedir)()) {
|
|
36
60
|
return env.CLAUDE_CONFIG_DIR || (0, path_1.join)(home, '.claude');
|
|
@@ -38,7 +62,7 @@ function claudeConfigDir(env = process.env, home = (0, os_1.homedir)()) {
|
|
|
38
62
|
exports.claudeConfigDir = claudeConfigDir;
|
|
39
63
|
function installedPluginIds(path = (0, path_1.join)(claudeConfigDir(), 'plugins', 'installed_plugins.json')) {
|
|
40
64
|
const plugins = readJson(path).plugins || {};
|
|
41
|
-
return [exports.PLUGIN_ID, exports.LEGACY_PLUGIN_ID].filter((id) => Object.prototype.hasOwnProperty.call(plugins, id));
|
|
65
|
+
return [exports.SKEDULO_PLUGIN_ID, exports.PLUGIN_ID, exports.LEGACY_PLUGIN_ID].filter((id) => Object.prototype.hasOwnProperty.call(plugins, id));
|
|
42
66
|
}
|
|
43
67
|
exports.installedPluginIds = installedPluginIds;
|
|
44
68
|
function installedPluginId(path) {
|
|
@@ -49,9 +73,9 @@ function pluginInstalled(path) {
|
|
|
49
73
|
return installedPluginId(path) !== undefined;
|
|
50
74
|
}
|
|
51
75
|
exports.pluginInstalled = pluginInstalled;
|
|
52
|
-
function
|
|
76
|
+
function sourceIsRepo(source, repoName) {
|
|
53
77
|
const s = (source || {});
|
|
54
|
-
const repo =
|
|
78
|
+
const repo = repoName.toLowerCase();
|
|
55
79
|
if (typeof s.repo === 'string')
|
|
56
80
|
return s.repo.toLowerCase() === repo;
|
|
57
81
|
if (typeof s.url !== 'string')
|
|
@@ -59,7 +83,10 @@ function isHubSource(source) {
|
|
|
59
83
|
const url = s.url.toLowerCase().replace(/\.git$/, '');
|
|
60
84
|
return url.endsWith(`/${repo}`) || url.endsWith(`:${repo}`);
|
|
61
85
|
}
|
|
86
|
+
const isHubSource = (source) => sourceIsRepo(source, exports.MARKETPLACE_REPO);
|
|
62
87
|
exports.isHubSource = isHubSource;
|
|
88
|
+
const isSkeduloSource = (source) => sourceIsRepo(source, exports.SKEDULO_MARKETPLACE_REPO);
|
|
89
|
+
exports.isSkeduloSource = isSkeduloSource;
|
|
63
90
|
function lastLine(output) {
|
|
64
91
|
return output.trim().split('\n').pop() || 'no output';
|
|
65
92
|
}
|
|
@@ -289,10 +316,21 @@ exports.enableMarketplaceAutoUpdate = enableMarketplaceAutoUpdate;
|
|
|
289
316
|
// The repo's marketplace.json decides the name `marketplace add` registers, and main may still carry the old one.
|
|
290
317
|
function registeredMarketplace(knownPath) {
|
|
291
318
|
const known = readJson(knownPath);
|
|
292
|
-
const names = Object.keys(known).filter((name) => isHubSource(known[name]?.source));
|
|
319
|
+
const names = Object.keys(known).filter((name) => (0, exports.isHubSource)(known[name]?.source));
|
|
293
320
|
return names.includes(exports.MARKETPLACE_NAME) ? exports.MARKETPLACE_NAME : names[0] || exports.MARKETPLACE_NAME;
|
|
294
321
|
}
|
|
295
|
-
function
|
|
322
|
+
function installFromSkedulo(run, installedPath, knownPath) {
|
|
323
|
+
const known = readJson(knownPath);
|
|
324
|
+
const registered = Object.keys(known).includes(exports.SKEDULO_MARKETPLACE_NAME) && (0, exports.isSkeduloSource)(known[exports.SKEDULO_MARKETPLACE_NAME]?.source);
|
|
325
|
+
if (!registered && run(['plugin', 'marketplace', 'add', exports.SKEDULO_MARKETPLACE_REPO]).status !== 0)
|
|
326
|
+
return false;
|
|
327
|
+
if (run(['plugin', 'install', exports.SKEDULO_PLUGIN_ID, '--scope', 'user']).status !== 0)
|
|
328
|
+
return false;
|
|
329
|
+
return installedPluginIds(installedPath).includes(exports.SKEDULO_PLUGIN_ID);
|
|
330
|
+
}
|
|
331
|
+
function installPlugin(run, settingsPath, installedPath = (0, path_1.join)(claudeConfigDir(), 'plugins', 'installed_plugins.json'), knownPath = (0, path_1.join)((0, path_1.dirname)(installedPath), 'known_marketplaces.json'), env = process.env) {
|
|
332
|
+
if (skeduloMoveEnabled(env) && installFromSkedulo(run, installedPath, knownPath))
|
|
333
|
+
return { ok: true };
|
|
296
334
|
const added = run(['plugin', 'marketplace', 'add', `${exports.MARKETPLACE_REPO}#${exports.MARKETPLACE_REF}`]);
|
|
297
335
|
if (added.status !== 0)
|
|
298
336
|
return { ok: false, reason: lastLine(added.output) };
|
|
@@ -302,15 +340,16 @@ function installPlugin(run, settingsPath, installedPath = (0, path_1.join)(claud
|
|
|
302
340
|
const installed = run(['plugin', 'install', id]);
|
|
303
341
|
if (installed.status !== 0)
|
|
304
342
|
return { ok: false, reason: lastLine(installed.output) };
|
|
305
|
-
return
|
|
343
|
+
return installedPluginIds(installedPath).includes(id) ? { ok: true } : { ok: false, reason: 'claude reported success but did not list the plugin' };
|
|
306
344
|
}
|
|
307
345
|
exports.installPlugin = installPlugin;
|
|
308
346
|
// Without repo access git would otherwise wait on a password prompt or an SSH host-key question.
|
|
309
347
|
function claudeRunner() {
|
|
310
|
-
|
|
348
|
+
const command = (0, child_process_1.spawnSync)('which', ['claude']).status === 0 ? 'claude' : process.env.CLAUDE_CODE_EXECPATH;
|
|
349
|
+
if (!command)
|
|
311
350
|
return undefined;
|
|
312
351
|
return (args) => {
|
|
313
|
-
const result = (0, child_process_1.spawnSync)(
|
|
352
|
+
const result = (0, child_process_1.spawnSync)(command, args, {
|
|
314
353
|
encoding: 'utf8',
|
|
315
354
|
timeout: 180000,
|
|
316
355
|
env: {
|
|
@@ -634,53 +673,38 @@ async function runCapture(argv = []) {
|
|
|
634
673
|
}
|
|
635
674
|
exports.runCapture = runCapture;
|
|
636
675
|
const QUIET_SKIPS = ['not installed', 'already moved', 'not released yet'];
|
|
637
|
-
|
|
638
|
-
|
|
639
|
-
|
|
640
|
-
|
|
641
|
-
|
|
642
|
-
|
|
643
|
-
|
|
644
|
-
|
|
645
|
-
|
|
646
|
-
(0,
|
|
647
|
-
|
|
648
|
-
catch {
|
|
649
|
-
return false;
|
|
650
|
-
}
|
|
651
|
-
try {
|
|
652
|
-
fn();
|
|
653
|
-
}
|
|
654
|
-
finally {
|
|
655
|
-
try {
|
|
656
|
-
(0, fs_1.rmdirSync)(lock);
|
|
657
|
-
}
|
|
658
|
-
catch { }
|
|
659
|
-
}
|
|
660
|
-
return true;
|
|
661
|
-
}
|
|
662
|
-
function moveLegacyPlugin() {
|
|
676
|
+
function hasOldPlugin() {
|
|
677
|
+
const ids = installedPluginIds();
|
|
678
|
+
return ids.includes(exports.LEGACY_PLUGIN_ID) || (skeduloMoveEnabled() && ids.includes(exports.PLUGIN_ID));
|
|
679
|
+
}
|
|
680
|
+
function moveOldPlugin() {
|
|
681
|
+
const skedulo = skeduloMoveEnabled();
|
|
682
|
+
const target = skedulo ? exports.SKEDULO_PLUGIN_ID : exports.PLUGIN_ID;
|
|
683
|
+
const configDir = claudeConfigDir();
|
|
684
|
+
const from = skedulo
|
|
685
|
+
? ((0, skedulo_move_1.pickOldId)(readJson((0, path_1.join)(configDir, 'plugins', 'installed_plugins.json')).plugins || {}, readJson((0, path_1.join)(configDir, 'settings.json')))?.old ?? exports.PLUGIN_ID)
|
|
686
|
+
: exports.LEGACY_PLUGIN_ID;
|
|
663
687
|
const run = claudeRunner();
|
|
664
688
|
if (!run) {
|
|
665
|
-
console.log(` kept ${
|
|
689
|
+
console.log(` kept ${from}: the claude CLI is not on PATH to move it to ${target}.`);
|
|
666
690
|
return;
|
|
667
691
|
}
|
|
668
692
|
let result;
|
|
669
|
-
const
|
|
670
|
-
result = (0, migrate_plugin_1.migratePlugin)({ run, configDir
|
|
671
|
-
});
|
|
672
|
-
if (
|
|
673
|
-
console.log(` a move of ${
|
|
693
|
+
const outcome = (0, move_lock_1.withMoveLock)(() => {
|
|
694
|
+
result = (0, migrate_plugin_1.migratePlugin)({ run, configDir, log: () => { } });
|
|
695
|
+
}, { stamp: false });
|
|
696
|
+
if (outcome !== 'ran' || !result) {
|
|
697
|
+
console.log(` a move of ${from} to ${target} is already running; re-run setup in a minute if it is still listed.`);
|
|
674
698
|
return;
|
|
675
699
|
}
|
|
676
700
|
if (result.status === 'moved' && result.reason.startsWith('retired'))
|
|
677
|
-
console.log(` removed the old ${
|
|
701
|
+
console.log(` removed the old ${from} install; ${target} stays.`);
|
|
678
702
|
else if (result.status === 'moved')
|
|
679
|
-
console.log(` moved ${
|
|
703
|
+
console.log(` moved ${from} to its new ID ${target}; it loads at the next session.`);
|
|
680
704
|
else if (result.status === 'failed')
|
|
681
|
-
console.log(` couldn't move ${
|
|
705
|
+
console.log(` couldn't move ${from} to ${target}: ${result.reason}.`);
|
|
682
706
|
else if (!QUIET_SKIPS.includes(result.reason))
|
|
683
|
-
console.log(` kept ${
|
|
707
|
+
console.log(` kept ${from} (${result.reason}).`);
|
|
684
708
|
}
|
|
685
709
|
async function runSetup(argv = []) {
|
|
686
710
|
console.log('==> Setting up the memory hub');
|
|
@@ -771,10 +795,10 @@ async function runSetup(argv = []) {
|
|
|
771
795
|
console.log(` Couldn't install the plugin (${result.reason}), so the MCP server, hooks and skills are installed directly.`);
|
|
772
796
|
}
|
|
773
797
|
}
|
|
774
|
-
if (plugin &&
|
|
798
|
+
if (plugin && hasOldPlugin()) {
|
|
775
799
|
// Before the move: a settings token is what lets an install with a pasted token move.
|
|
776
800
|
writeUserEnv(settingsPath, env);
|
|
777
|
-
|
|
801
|
+
moveOldPlugin();
|
|
778
802
|
plugin = pluginInstalled();
|
|
779
803
|
if (!plugin)
|
|
780
804
|
console.log(' No memory-hub plugin is installed now, so the MCP server, hooks and skills are installed directly.');
|
|
@@ -782,10 +806,17 @@ async function runSetup(argv = []) {
|
|
|
782
806
|
if (plugin) {
|
|
783
807
|
writeUserEnv(settingsPath, env);
|
|
784
808
|
const pluginId = installedPluginId() ?? exports.PLUGIN_ID;
|
|
785
|
-
console.log(installedNow
|
|
786
|
-
?
|
|
787
|
-
:
|
|
788
|
-
|
|
809
|
+
console.log(!installedNow
|
|
810
|
+
? ` The ${pluginId} plugin is already installed. Your token is saved for it.`
|
|
811
|
+
: pluginId === exports.SKEDULO_PLUGIN_ID
|
|
812
|
+
? ' Installed. Your token is saved for it.'
|
|
813
|
+
: ' Installed. It updates itself at each new session, and your token is saved for it.');
|
|
814
|
+
if (pluginId === exports.SKEDULO_PLUGIN_ID) {
|
|
815
|
+
console.log(` To get Memory Hub updates automatically, turn on auto-update for ${exports.SKEDULO_MARKETPLACE_NAME} in /plugin → Marketplaces (it covers every Skedulo plugin).`);
|
|
816
|
+
}
|
|
817
|
+
else {
|
|
818
|
+
enableMarketplaceAutoUpdate(settingsPath, pluginId === exports.LEGACY_PLUGIN_ID ? exports.LEGACY_MARKETPLACE_NAME : exports.MARKETPLACE_NAME);
|
|
819
|
+
}
|
|
789
820
|
const hooks = unregisterHooks(settingsPath);
|
|
790
821
|
const server = removeMcpServer((0, path_1.join)((0, os_1.homedir)(), '.claude.json'));
|
|
791
822
|
const copies = removeCopiedAssets(settingsPath);
|