@hasna/configs 0.2.14 → 0.2.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/dist/mcp/index.js +43 -1
- package/dist/server/index.d.ts +1 -0
- package/dist/server/index.d.ts.map +1 -1
- package/dist/server/index.js +3 -2
- package/package.json +1 -1
package/dist/mcp/index.js
CHANGED
|
@@ -1,6 +1,21 @@
|
|
|
1
1
|
#!/usr/bin/env bun
|
|
2
2
|
// @bun
|
|
3
|
+
var __create = Object.create;
|
|
4
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
3
5
|
var __defProp = Object.defineProperty;
|
|
6
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
7
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
8
|
+
var __toESM = (mod, isNodeMode, target) => {
|
|
9
|
+
target = mod != null ? __create(__getProtoOf(mod)) : {};
|
|
10
|
+
const to = isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target;
|
|
11
|
+
for (let key of __getOwnPropNames(mod))
|
|
12
|
+
if (!__hasOwnProp.call(to, key))
|
|
13
|
+
__defProp(to, key, {
|
|
14
|
+
get: () => mod[key],
|
|
15
|
+
enumerable: true
|
|
16
|
+
});
|
|
17
|
+
return to;
|
|
18
|
+
};
|
|
4
19
|
var __export = (target, all) => {
|
|
5
20
|
for (var name in all)
|
|
6
21
|
__defProp(target, name, {
|
|
@@ -11,6 +26,7 @@ var __export = (target, all) => {
|
|
|
11
26
|
});
|
|
12
27
|
};
|
|
13
28
|
var __esm = (fn, res) => () => (fn && (res = fn(fn = 0)), res);
|
|
29
|
+
var __require = import.meta.require;
|
|
14
30
|
|
|
15
31
|
// src/types/index.ts
|
|
16
32
|
var ConfigNotFoundError, ProfileNotFoundError, ConfigApplyError, TemplateRenderError;
|
|
@@ -346,6 +362,12 @@ var init_snapshots = __esm(() => {
|
|
|
346
362
|
});
|
|
347
363
|
|
|
348
364
|
// src/lib/apply.ts
|
|
365
|
+
var exports_apply = {};
|
|
366
|
+
__export(exports_apply, {
|
|
367
|
+
expandPath: () => expandPath,
|
|
368
|
+
applyConfigs: () => applyConfigs,
|
|
369
|
+
applyConfig: () => applyConfig
|
|
370
|
+
});
|
|
349
371
|
import { existsSync as existsSync2, mkdirSync as mkdirSync2, readFileSync, writeFileSync } from "fs";
|
|
350
372
|
import { dirname as dirname2, resolve as resolve2 } from "path";
|
|
351
373
|
import { homedir } from "os";
|
|
@@ -1189,15 +1211,35 @@ server.setRequestHandler(CallToolRequestSchema, async (req) => {
|
|
|
1189
1211
|
case "get_status": {
|
|
1190
1212
|
const stats = getConfigStats();
|
|
1191
1213
|
const allConfigs = listConfigs({ kind: "file" });
|
|
1192
|
-
|
|
1214
|
+
const { existsSync: ex, readFileSync: rf } = await import("fs");
|
|
1215
|
+
const { expandPath: expandPath2 } = await Promise.resolve().then(() => (init_apply(), exports_apply));
|
|
1216
|
+
const { redactContent: redactContent2 } = await Promise.resolve().then(() => (init_redact(), exports_redact));
|
|
1217
|
+
let drifted = 0, missing = 0, templates = 0;
|
|
1218
|
+
const driftedSlugs = [];
|
|
1193
1219
|
for (const c of allConfigs) {
|
|
1194
1220
|
if (c.is_template)
|
|
1195
1221
|
templates++;
|
|
1222
|
+
if (!c.target_path)
|
|
1223
|
+
continue;
|
|
1224
|
+
const abs = expandPath2(c.target_path);
|
|
1225
|
+
if (!ex(abs)) {
|
|
1226
|
+
missing++;
|
|
1227
|
+
continue;
|
|
1228
|
+
}
|
|
1229
|
+
const disk = rf(abs, "utf-8");
|
|
1230
|
+
const { content: redactedDisk } = redactContent2(disk, c.format);
|
|
1231
|
+
if (redactedDisk !== c.content) {
|
|
1232
|
+
drifted++;
|
|
1233
|
+
driftedSlugs.push(c.slug);
|
|
1234
|
+
}
|
|
1196
1235
|
}
|
|
1197
1236
|
return ok({
|
|
1198
1237
|
total: stats["total"] || 0,
|
|
1199
1238
|
by_category: Object.fromEntries(Object.entries(stats).filter(([k]) => k !== "total")),
|
|
1200
1239
|
templates,
|
|
1240
|
+
drifted,
|
|
1241
|
+
drifted_configs: driftedSlugs.slice(0, 5),
|
|
1242
|
+
missing,
|
|
1201
1243
|
db_path: process.env["CONFIGS_DB_PATH"] || "~/.configs/configs.db"
|
|
1202
1244
|
});
|
|
1203
1245
|
}
|
package/dist/server/index.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/server/index.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/server/index.ts"],"names":[],"mappings":";;;;;;AAsRA,wBAAgE"}
|
package/dist/server/index.js
CHANGED
|
@@ -2721,8 +2721,9 @@ if (dashDir) {
|
|
|
2721
2721
|
});
|
|
2722
2722
|
});
|
|
2723
2723
|
}
|
|
2724
|
-
|
|
2725
|
-
|
|
2724
|
+
var HOST = process.env["CONFIGS_HOST"] ?? "localhost";
|
|
2725
|
+
console.log(`configs-serve listening on http://${HOST}:${PORT}${dashDir ? " (dashboard: /" : " (no dashboard found)"}`);
|
|
2726
|
+
var server_default = { port: PORT, hostname: HOST, fetch: app.fetch };
|
|
2726
2727
|
export {
|
|
2727
2728
|
server_default as default
|
|
2728
2729
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@hasna/configs",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.16",
|
|
4
4
|
"description": "AI coding agent configuration manager — store, version, apply, and share all your AI coding configs. CLI + MCP + REST API + Dashboard.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "dist/index.js",
|