@hasna/skills 0.1.2 → 0.1.4

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/LICENSE CHANGED
@@ -183,7 +183,7 @@
183
183
  replaced with your own identifying information. (Don't include
184
184
  the brackets!) The text should be enclosed in the appropriate
185
185
  comment syntax for the file format. Please also get an
186
- "Alarm or alarm" file of the Apache License for your project.
186
+ copy of the Apache License for your project.
187
187
 
188
188
  Copyright 2025 Hasna
189
189
 
package/bin/index.js CHANGED
@@ -1873,7 +1873,7 @@ var package_default;
1873
1873
  var init_package = __esm(() => {
1874
1874
  package_default = {
1875
1875
  name: "@hasna/skills",
1876
- version: "0.1.2",
1876
+ version: "0.1.4",
1877
1877
  description: "Skills library for AI coding agents",
1878
1878
  type: "module",
1879
1879
  bin: {
@@ -34831,9 +34831,21 @@ var exports_serve = {};
34831
34831
  __export(exports_serve, {
34832
34832
  startServer: () => startServer
34833
34833
  });
34834
- import { existsSync as existsSync3 } from "fs";
34834
+ import { existsSync as existsSync3, readFileSync as readFileSync3 } from "fs";
34835
34835
  import { join as join3, dirname as dirname2, extname } from "path";
34836
34836
  import { fileURLToPath as fileURLToPath2 } from "url";
34837
+ function getPackageVersion() {
34838
+ try {
34839
+ const scriptDir = dirname2(fileURLToPath2(import.meta.url));
34840
+ for (const rel of ["../..", ".."]) {
34841
+ const pkgPath = join3(scriptDir, rel, "package.json");
34842
+ if (existsSync3(pkgPath)) {
34843
+ return JSON.parse(readFileSync3(pkgPath, "utf-8")).version;
34844
+ }
34845
+ }
34846
+ } catch {}
34847
+ return "unknown";
34848
+ }
34837
34849
  function resolveDashboardDir() {
34838
34850
  const candidates = [];
34839
34851
  try {
@@ -34988,6 +35000,26 @@ Dashboard not found at: ${dashboardDir}`);
34988
35000
  const success2 = removeSkill(name);
34989
35001
  return json2({ success: success2, skill: name }, success2 ? 200 : 404);
34990
35002
  }
35003
+ if (path === "/api/version" && method === "GET") {
35004
+ return json2({ version: getPackageVersion() });
35005
+ }
35006
+ if (path === "/api/self-update" && method === "POST") {
35007
+ try {
35008
+ const proc = Bun.spawn(["bun", "add", "-g", "@hasna/skills@latest"], {
35009
+ stdout: "pipe",
35010
+ stderr: "pipe"
35011
+ });
35012
+ const stdout = await new Response(proc.stdout).text();
35013
+ const stderr = await new Response(proc.stderr).text();
35014
+ const exitCode = await proc.exited;
35015
+ if (exitCode === 0) {
35016
+ return json2({ success: true, output: stdout.trim() || stderr.trim() });
35017
+ }
35018
+ return json2({ success: false, error: stderr.trim() || stdout.trim() }, 500);
35019
+ } catch (e) {
35020
+ return json2({ success: false, error: e instanceof Error ? e.message : "Update failed" }, 500);
35021
+ }
35022
+ }
34991
35023
  if (method === "OPTIONS") {
34992
35024
  return new Response(null, {
34993
35025
  headers: {
@@ -35078,7 +35110,7 @@ var {
35078
35110
  // src/cli/index.tsx
35079
35111
  init_package();
35080
35112
  import chalk2 from "chalk";
35081
- import { existsSync as existsSync4, writeFileSync as writeFileSync2, appendFileSync, readFileSync as readFileSync3 } from "fs";
35113
+ import { existsSync as existsSync4, writeFileSync as writeFileSync2, appendFileSync, readFileSync as readFileSync4 } from "fs";
35082
35114
  import { join as join4 } from "path";
35083
35115
 
35084
35116
  // src/cli/components/App.tsx
@@ -36204,7 +36236,7 @@ init_registry();
36204
36236
  init_installer();
36205
36237
  init_skillinfo();
36206
36238
  import { jsxDEV as jsxDEV7 } from "react/jsx-dev-runtime";
36207
- var isTTY = process.stdout.isTTY ?? false;
36239
+ var isTTY = (process.stdout.isTTY ?? false) && (process.stdin.isTTY ?? false);
36208
36240
  var program2 = new Command;
36209
36241
  program2.name("skills").description("Install AI agent skills for your project").version(package_default.version).option("--verbose", "Enable verbose logging", false).enablePositionalOptions();
36210
36242
  program2.command("interactive", { isDefault: true }).alias("i").description("Interactive skill browser (TUI)").action(() => {
@@ -36520,7 +36552,7 @@ program2.command("init").description("Initialize project for installed skills (.
36520
36552
  const gitignoreEntry = ".skills/";
36521
36553
  let gitignoreContent = "";
36522
36554
  if (existsSync4(gitignorePath)) {
36523
- gitignoreContent = readFileSync3(gitignorePath, "utf-8");
36555
+ gitignoreContent = readFileSync4(gitignorePath, "utf-8");
36524
36556
  }
36525
36557
  if (!gitignoreContent.includes(gitignoreEntry)) {
36526
36558
  const addition = gitignoreContent.endsWith(`
@@ -36686,4 +36718,25 @@ program2.command("serve").description("Start the Skills Dashboard web server").o
36686
36718
  const port = parseInt(options.port, 10);
36687
36719
  await startServer2(port, { open: options.open });
36688
36720
  });
36721
+ program2.command("self-update").description("Update @hasna/skills to the latest version").action(async () => {
36722
+ console.log(chalk2.bold(`
36723
+ Updating @hasna/skills...
36724
+ `));
36725
+ const proc = Bun.spawn(["bun", "add", "-g", "@hasna/skills@latest"], {
36726
+ stdout: "inherit",
36727
+ stderr: "inherit"
36728
+ });
36729
+ const exitCode = await proc.exited;
36730
+ if (exitCode === 0) {
36731
+ console.log(chalk2.green(`
36732
+ \u2713 Updated to latest version`));
36733
+ const vProc = Bun.spawn(["skills", "--version"], { stdout: "pipe" });
36734
+ const ver = (await new Response(vProc.stdout).text()).trim();
36735
+ console.log(chalk2.dim(` Version: ${ver}`));
36736
+ } else {
36737
+ console.error(chalk2.red(`
36738
+ \u2717 Update failed`));
36739
+ process.exitCode = 1;
36740
+ }
36741
+ });
36689
36742
  program2.parse();
package/bin/mcp.js CHANGED
@@ -28543,7 +28543,7 @@ class StdioServerTransport {
28543
28543
  // package.json
28544
28544
  var package_default = {
28545
28545
  name: "@hasna/skills",
28546
- version: "0.1.2",
28546
+ version: "0.1.4",
28547
28547
  description: "Skills library for AI coding agents",
28548
28548
  type: "module",
28549
28549
  bin: {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@hasna/skills",
3
- "version": "0.1.2",
3
+ "version": "0.1.4",
4
4
  "description": "Skills library for AI coding agents",
5
5
  "type": "module",
6
6
  "bin": {