@pleri/olam-cli 0.1.111 → 0.1.113
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/dist/commands/bootstrap.d.ts +2 -45
- package/dist/commands/bootstrap.d.ts.map +1 -1
- package/dist/commands/bootstrap.js +8 -101
- package/dist/commands/bootstrap.js.map +1 -1
- package/dist/commands/mcp/index.d.ts +6 -3
- package/dist/commands/mcp/index.d.ts.map +1 -1
- package/dist/commands/mcp/index.js +13 -4
- package/dist/commands/mcp/index.js.map +1 -1
- package/dist/commands/mcp/install-shared.d.ts +22 -0
- package/dist/commands/mcp/install-shared.d.ts.map +1 -0
- package/dist/commands/mcp/install-shared.js +29 -0
- package/dist/commands/mcp/install-shared.js.map +1 -0
- package/dist/commands/mcp/install.d.ts +20 -0
- package/dist/commands/mcp/install.d.ts.map +1 -0
- package/dist/commands/mcp/install.js +59 -0
- package/dist/commands/mcp/install.js.map +1 -0
- package/dist/commands/mcp/serve.d.ts +12 -0
- package/dist/commands/mcp/serve.d.ts.map +1 -0
- package/dist/commands/mcp/serve.js +36 -0
- package/dist/commands/mcp/serve.js.map +1 -0
- package/dist/commands/mcp/uninstall.d.ts +20 -0
- package/dist/commands/mcp/uninstall.d.ts.map +1 -0
- package/dist/commands/mcp/uninstall.js +69 -0
- package/dist/commands/mcp/uninstall.js.map +1 -0
- package/dist/image-digests.json +4 -4
- package/dist/index.js +345 -144
- package/dist/index.js.map +1 -1
- package/dist/mcp-server.js +107 -7
- package/package.json +1 -1
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* olam mcp uninstall — Remove olam from Claude Code's MCP servers via
|
|
3
|
+
* `claude mcp remove`. Symmetric with `olam mcp install` (B1).
|
|
4
|
+
*
|
|
5
|
+
* Handles "not installed" gracefully — claude reports a non-zero exit
|
|
6
|
+
* with an informative stderr; we parse that and return success-as-noop
|
|
7
|
+
* so the command is idempotent.
|
|
8
|
+
*/
|
|
9
|
+
import { printError, printSuccess, printWarning } from '../../output.js';
|
|
10
|
+
import { DEFAULT_CLAUDE_SHELL_DEPS, REMEDY_CLAUDE_MISSING, isOnPath, normaliseScope, } from './install-shared.js';
|
|
11
|
+
// Real `claude mcp remove` output verified on this machine (2026-05-12):
|
|
12
|
+
// --scope user → "No user-scoped MCP server found with name: <n>"
|
|
13
|
+
// --scope local → "No project-local MCP server found with name: <n>"
|
|
14
|
+
// --scope project → "No MCP server found with name: <n> in .mcp.json"
|
|
15
|
+
// One pattern covers all three: "No <anything> MCP server found".
|
|
16
|
+
const NOT_INSTALLED_PATTERN = /no\s+(?:\S+\s+)*mcp\s+server\s+found/i;
|
|
17
|
+
function looksLikeNotInstalled(text) {
|
|
18
|
+
return NOT_INSTALLED_PATTERN.test(text);
|
|
19
|
+
}
|
|
20
|
+
export function buildClaudeMcpRemoveArgs(scope) {
|
|
21
|
+
return {
|
|
22
|
+
command: 'claude',
|
|
23
|
+
args: ['mcp', 'remove', 'olam', '--scope', scope],
|
|
24
|
+
};
|
|
25
|
+
}
|
|
26
|
+
export async function runUninstall(opts, deps = DEFAULT_CLAUDE_SHELL_DEPS) {
|
|
27
|
+
if (!isOnPath(deps, 'claude')) {
|
|
28
|
+
printError(REMEDY_CLAUDE_MISSING);
|
|
29
|
+
return 1;
|
|
30
|
+
}
|
|
31
|
+
const { command, args } = buildClaudeMcpRemoveArgs(opts.scope);
|
|
32
|
+
deps.log(`Unwiring: ${command} ${args.join(' ')}`);
|
|
33
|
+
const result = deps.spawn(command, args, {
|
|
34
|
+
encoding: 'utf8',
|
|
35
|
+
stdio: ['ignore', 'pipe', 'pipe'],
|
|
36
|
+
});
|
|
37
|
+
if (result.status === 0) {
|
|
38
|
+
printSuccess(`olam MCP removed from claude (--scope ${opts.scope}).`);
|
|
39
|
+
return 0;
|
|
40
|
+
}
|
|
41
|
+
const stderr = result.stderr?.trim() ?? '';
|
|
42
|
+
const stdout = result.stdout?.trim() ?? '';
|
|
43
|
+
const combined = `${stderr}\n${stdout}`.trim();
|
|
44
|
+
if (looksLikeNotInstalled(combined)) {
|
|
45
|
+
printWarning(`olam MCP not registered with claude (--scope ${opts.scope}); nothing to remove.`);
|
|
46
|
+
return 0;
|
|
47
|
+
}
|
|
48
|
+
printError(`claude mcp remove failed (rc=${result.status ?? 'unknown'}): ${combined || '(no output)'}`);
|
|
49
|
+
return result.status ?? 1;
|
|
50
|
+
}
|
|
51
|
+
export function registerMcpUninstall(cmd) {
|
|
52
|
+
cmd
|
|
53
|
+
.command('uninstall')
|
|
54
|
+
.description('Remove olam from Claude Code (symmetric with `install`; idempotent — exits 0 when olam is not registered)')
|
|
55
|
+
.option('--scope <scope>', 'claude mcp scope: user | project | local', 'user')
|
|
56
|
+
.action(async (rawOpts) => {
|
|
57
|
+
const scope = normaliseScope(rawOpts.scope);
|
|
58
|
+
if (scope === null) {
|
|
59
|
+
printError(`--scope must be one of: user, project, local (got: ${rawOpts.scope})`);
|
|
60
|
+
process.exitCode = 1;
|
|
61
|
+
return;
|
|
62
|
+
}
|
|
63
|
+
const rc = await runUninstall({ scope });
|
|
64
|
+
if (rc !== 0) {
|
|
65
|
+
process.exitCode = rc;
|
|
66
|
+
}
|
|
67
|
+
});
|
|
68
|
+
}
|
|
69
|
+
//# sourceMappingURL=uninstall.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"uninstall.js","sourceRoot":"","sources":["../../../src/commands/mcp/uninstall.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAGH,OAAO,EAAE,UAAU,EAAE,YAAY,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AACzE,OAAO,EACL,yBAAyB,EACzB,qBAAqB,EACrB,QAAQ,EACR,cAAc,GAGf,MAAM,qBAAqB,CAAC;AAM7B,yEAAyE;AACzE,uEAAuE;AACvE,yEAAyE;AACzE,wEAAwE;AACxE,kEAAkE;AAClE,MAAM,qBAAqB,GAAG,uCAAuC,CAAC;AAEtE,SAAS,qBA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,EAAE,CAAC;IAE/C,IAAI,qBAAqB,CAAC,QAAQ,CAAC,EAAE,CAAC;QACpC,YAAY,CACV,gDAAgD,IAAI,CAAC,KAAK,uBAAuB,CAClF,CAAC;QACF,OAAO,CAAC,CAAC;IACX,CAAC;IAED,UAAU,CACR,gCAAgC,MAAM,CAAC,MAAM,IAAI,SAAS,MAAM,QAAQ,IAAI,aAAa,EAAE,CAC5F,CAAC;IACF,OAAO,MAAM,CAAC,MAAM,IAAI,CAAC,CAAC;AAC5B,CAAC;AAED,MAAM,UAAU,oBAAoB,CAAC,GAAY;IAC/C,GAAG;SACA,OAAO,CAAC,WAAW,CAAC;SACpB,WAAW,CACV,2GAA2G,CAC5G;SACA,MAAM,CAAC,iBAAiB,EAAE,0CAA0C,EAAE,MAAM,CAAC;SAC7E,MAAM,CAAC,KAAK,EAAE,OAA2B,EAAE,EAAE;QAC5C,MAAM,KAAK,GAAG,cAAc,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC;QAC5C,IAAI,KAAK,KAAK,IAAI,EAAE,CAAC;YACnB,UAAU,CAAC,sDAAsD,OAAO,CAAC,KAAK,GAAG,CAAC,CAAC;YACnF,OAAO,CAAC,QAAQ,GAAG,CAAC,CAAC;YACrB,OAAO;QACT,CAAC;QACD,MAAM,EAAE,GAAG,MAAM,YAAY,CAAC,EAAE,KAAK,EAAE,CAAC,CAAC;QACzC,IAAI,EAAE,KAAK,CAAC,EAAE,CAAC;YACb,OAAO,CAAC,QAAQ,GAAG,EAAE,CAAC;QACxB,CAAC;IACH,CAAC,CAAC,CAAC;AACP,CAAC"}
|
package/dist/image-digests.json
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
{
|
|
2
2
|
"auth": "sha256:c8ebf817e09719289c7d7e37056b24adacb9d9fbc555e2540fbe88dfd400f2d9",
|
|
3
|
-
"devbox": "sha256:
|
|
4
|
-
"devbox-base": "sha256:
|
|
5
|
-
"host-cp": "sha256:
|
|
3
|
+
"devbox": "sha256:e08235bedcb6c8fe431c2518176b1134f9473ba9f851cb8e61661d548d07aadb",
|
|
4
|
+
"devbox-base": "sha256:a0ddfbcf46227bdedcf1752dd203817154c0a15e3382056e3fa055005ff4d8e4",
|
|
5
|
+
"host-cp": "sha256:13a26950fea2917ebb268f7bda04fd54267ffe8e5ba4a550db89f28eb309553f",
|
|
6
6
|
"mcp-auth": "sha256:c82fcfca7ed1b139cbea252697487889b96b45a6575cfba076de7f57eaa943ac",
|
|
7
7
|
"$schema_version": 1,
|
|
8
|
-
"$published_version": "0.1.
|
|
8
|
+
"$published_version": "0.1.113",
|
|
9
9
|
"$registry": "ghcr.io/pleri"
|
|
10
10
|
}
|