@hasna/configs 0.2.4 → 0.2.6
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/cli/index.js +20 -0
- package/dist/mcp/index.js +9 -1
- package/package.json +1 -1
package/dist/cli/index.js
CHANGED
|
@@ -4075,5 +4075,25 @@ program.command("push").description("Alias for sync --to-disk (write DB configs
|
|
|
4075
4075
|
const result = await syncToDisk({ dryRun: opts.dryRun, agent: opts.agent });
|
|
4076
4076
|
console.log(chalk.green("\u2713") + ` Pushed: updated:${result.updated} unchanged:${result.unchanged} skipped:${result.skipped.length}`);
|
|
4077
4077
|
});
|
|
4078
|
+
program.command("update").description("Check for updates and install latest version").option("--check", "only check, don't install").action(async (opts) => {
|
|
4079
|
+
try {
|
|
4080
|
+
const proc = Bun.spawn(["npm", "view", "@hasna/configs", "version"], { stdout: "pipe", stderr: "pipe" });
|
|
4081
|
+
const latest = (await new Response(proc.stdout).text()).trim();
|
|
4082
|
+
await proc.exited;
|
|
4083
|
+
if (latest === pkg.version) {
|
|
4084
|
+
console.log(chalk.green("\u2713") + ` Already on latest version (${pkg.version})`);
|
|
4085
|
+
} else {
|
|
4086
|
+
console.log(`Current: ${chalk.dim(pkg.version)} \u2192 Latest: ${chalk.green(latest)}`);
|
|
4087
|
+
if (!opts.check) {
|
|
4088
|
+
console.log(chalk.dim("Installing..."));
|
|
4089
|
+
const install = Bun.spawn(["bun", "install", "-g", `@hasna/configs@${latest}`], { stdout: "inherit", stderr: "inherit" });
|
|
4090
|
+
await install.exited;
|
|
4091
|
+
console.log(chalk.green("\u2713") + ` Updated to ${latest}`);
|
|
4092
|
+
}
|
|
4093
|
+
}
|
|
4094
|
+
} catch (e) {
|
|
4095
|
+
console.error(chalk.red("Failed to check for updates: " + (e instanceof Error ? e.message : String(e))));
|
|
4096
|
+
}
|
|
4097
|
+
});
|
|
4078
4098
|
program.version(pkg.version).name("configs");
|
|
4079
4099
|
program.parse(process.argv);
|
package/dist/mcp/index.js
CHANGED
|
@@ -1005,7 +1005,14 @@ var TOOL_DOCS = {
|
|
|
1005
1005
|
search_tools: "Search tool descriptions. Params: query. Returns matching tool names and descriptions.",
|
|
1006
1006
|
describe_tools: "Get full descriptions for tools. Params: names? (array). Returns tool docs."
|
|
1007
1007
|
};
|
|
1008
|
-
var
|
|
1008
|
+
var PROFILES = {
|
|
1009
|
+
minimal: ["get_status", "get_config", "sync_known"],
|
|
1010
|
+
standard: ["list_configs", "get_config", "create_config", "update_config", "apply_config", "sync_known", "get_status", "list_profiles", "apply_profile", "search_tools", "describe_tools"],
|
|
1011
|
+
full: []
|
|
1012
|
+
};
|
|
1013
|
+
var activeProfile = process.env["CONFIGS_PROFILE"] || "full";
|
|
1014
|
+
var profileFilter = PROFILES[activeProfile];
|
|
1015
|
+
var ALL_LEAN_TOOLS = [
|
|
1009
1016
|
{ name: "list_configs", inputSchema: { type: "object", properties: { category: { type: "string" }, agent: { type: "string" }, kind: { type: "string" }, search: { type: "string" } } } },
|
|
1010
1017
|
{ name: "get_config", inputSchema: { type: "object", properties: { id_or_slug: { type: "string" } }, required: ["id_or_slug"] } },
|
|
1011
1018
|
{ name: "create_config", inputSchema: { type: "object", properties: { name: { type: "string" }, content: { type: "string" }, category: { type: "string" }, agent: { type: "string" }, target_path: { type: "string" }, kind: { type: "string" }, format: { type: "string" }, tags: { type: "array", items: { type: "string" } }, description: { type: "string" }, is_template: { type: "boolean" } }, required: ["name", "content", "category"] } },
|
|
@@ -1027,6 +1034,7 @@ function err(msg) {
|
|
|
1027
1034
|
return { content: [{ type: "text", text: JSON.stringify({ error: msg }) }], isError: true };
|
|
1028
1035
|
}
|
|
1029
1036
|
var server = new Server({ name: "configs", version: "0.1.0" }, { capabilities: { tools: {} } });
|
|
1037
|
+
var LEAN_TOOLS = profileFilter && profileFilter.length > 0 ? ALL_LEAN_TOOLS.filter((t) => profileFilter.includes(t.name)) : ALL_LEAN_TOOLS;
|
|
1030
1038
|
server.setRequestHandler(ListToolsRequestSchema, async () => ({ tools: LEAN_TOOLS }));
|
|
1031
1039
|
server.setRequestHandler(CallToolRequestSchema, async (req) => {
|
|
1032
1040
|
const { name, arguments: args = {} } = req.params;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@hasna/configs",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.6",
|
|
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",
|