@mainlayer/cli 0.1.1

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.
@@ -0,0 +1 @@
1
+ export { };
@@ -0,0 +1,30 @@
1
+ import { i as configurePlatforms, n as generateSkillsMd, r as PLATFORMS, t as SKILLS_FILENAME } from "../skills-template-CBLbA5-E.js";
2
+ import { mkdirSync, writeFileSync } from "node:fs";
3
+ import { homedir } from "node:os";
4
+ import { join } from "node:path";
5
+ //#region src/postinstall/index.ts
6
+ async function main() {
7
+ try {
8
+ const results = await configurePlatforms({ force: false });
9
+ const configured = results.filter((r) => r.configured).map((r) => r.name);
10
+ const skipped = results.filter((r) => r.skipped);
11
+ for (const s of skipped) if (s.error) process.stderr.write(`${s.name}: ${s.error}\n`);
12
+ for (const result of results) {
13
+ if (!result.detected) continue;
14
+ const desc = PLATFORMS.find((p) => p.name === result.name);
15
+ if (!desc) continue;
16
+ try {
17
+ const dir = desc.skillsDir(homedir());
18
+ mkdirSync(dir, { recursive: true });
19
+ writeFileSync(join(dir, SKILLS_FILENAME), generateSkillsMd(), "utf8");
20
+ } catch {}
21
+ }
22
+ const summary = configured.length > 0 ? `Configured MCP for: ${configured.join(", ")}` : "No AI platforms detected";
23
+ process.stderr.write(summary + "\n");
24
+ } catch {
25
+ process.stderr.write("No AI platforms detected\n");
26
+ }
27
+ }
28
+ main();
29
+ //#endregion
30
+ export {};