@hasna/skills 0.9.4 → 0.9.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/bin/index.js CHANGED
@@ -36868,7 +36868,7 @@ var package_default;
36868
36868
  var init_package = __esm(() => {
36869
36869
  package_default = {
36870
36870
  name: "@hasna/skills",
36871
- version: "0.9.4",
36871
+ version: "0.9.6",
36872
36872
  description: "Skills library for AI coding agents",
36873
36873
  type: "module",
36874
36874
  bin: {
@@ -55453,6 +55453,7 @@ function projectAncestorDirectories(projects) {
55453
55453
  function inventoryNativeSkills(home = homedir4(), options = {}) {
55454
55454
  const aliases = rootAliases(home, options.allowRootAliases);
55455
55455
  const selectedAgents = options.agents ? new Set(options.agents) : undefined;
55456
+ const includesAgent = (agent) => !selectedAgents || selectedAgents.has(agent);
55456
55457
  const rootDefinitions = selectedAgents ? ROOTS.filter(([agent, path]) => selectedAgents.has(agent) || selectedAgents.has("hermes") && agent === "codex" && path === ".agents/skills") : ROOTS;
55457
55458
  const roots = rootDefinitions.map(([agent, path]) => [agent, canonicalAgentPath(join29(home, path), aliases)]);
55458
55459
  const bridgePaths = Object.values(AGENT_ADAPTERS).map((adapter) => canonicalAgentPath(join29(home, adapter.root, CLI_BRIDGE_NAME), aliases));
@@ -55557,14 +55558,17 @@ function inventoryNativeSkills(home = homedir4(), options = {}) {
55557
55558
  for (const [agent, path] of roots)
55558
55559
  scanRoot(agent, path);
55559
55560
  if (options.includeVendor) {
55560
- for (const agent of ["codex", "claude"])
55561
+ for (const agent of ["codex", "claude"].filter(includesAgent))
55561
55562
  scanRoot(agent, canonicalAgentPath(join29(home, `.${agent}`, "plugins", "cache"), aliases), true, true);
55562
- scanRoot("claude", canonicalAgentPath(join29(home, ".claude", "plugins", "synced"), aliases), true);
55563
- scanRoot("gemini", join29(home, ".gemini", "extensions"), true);
55563
+ if (includesAgent("claude"))
55564
+ scanRoot("claude", canonicalAgentPath(join29(home, ".claude", "plugins", "synced"), aliases), true);
55565
+ if (includesAgent("gemini"))
55566
+ scanRoot("gemini", join29(home, ".gemini", "extensions"), true);
55564
55567
  }
55565
- const configured = options.configured ? INTEGRATION_AGENTS.flatMap((agent) => resolveAgentDiscovery({ home, agent, reviewed: options.discoveryInputs, canonical: (path) => canonicalAgentPath(path, aliases) }).roots.map((path) => ({ agent, path }))) : [];
55568
+ const configured = options.configured ? INTEGRATION_AGENTS.filter(includesAgent).flatMap((agent) => resolveAgentDiscovery({ home, agent, reviewed: options.discoveryInputs, canonical: (path) => canonicalAgentPath(path, aliases) }).roots.map((path) => ({ agent, path }))) : [];
55566
55569
  for (const root2 of [...options.agentRoots ?? [], ...configured])
55567
- scanRoot(root2.agent, canonicalAgentPath(root2.path, aliases), true);
55570
+ if (includesAgent(root2.agent))
55571
+ scanRoot(root2.agent, canonicalAgentPath(root2.path, aliases), true);
55568
55572
  recheckRootAliases(aliases);
55569
55573
  return entries;
55570
55574
  }
@@ -108115,11 +108119,23 @@ var fail4 = () => new Error('CODEX_HOOK_TRUST_UNSUPPORTED_LAYOUT: preserve and c
108115
108119
  if (!headers.length)
108116
108120
  return text3;
108117
108121
  const keys3 = headers.map((header) => header[1].trim());
108118
- if (keys3.some((key) => key.startsWith("[[") || keys3.filter((other) => other === key).length > 1))
108119
- return text3;
108120
- const plain = keys3.map((key) => key.slice(1, -1).trim());
108121
- if (plain.some((key, index) => plain.some((other, otherIndex) => index !== otherIndex && (other.startsWith(`${key}.`) || key.startsWith(`${other}.`)))))
108122
+ const repeated = keys3.filter((key) => !key.startsWith("[[")).filter((key, index, simple2) => simple2.indexOf(key) !== index);
108123
+ const arrayKeys = keys3.filter((key) => key.startsWith("[["));
108124
+ const plain = keys3.map((key) => key.replace(/^\[\[?/, "").replace(/\]\]?$/, "").trim());
108125
+ const parentChild = plain.some((key, index) => plain.some((other, otherIndex) => index !== otherIndex && (other.startsWith(`${key}.`) || key.startsWith(`${other}.`))));
108126
+ if (repeated.length || parentChild)
108122
108127
  return text3;
108128
+ if (!arrayKeys.length) {
108129
+ const first2 = headers[0].index;
108130
+ const prefix2 = text3.slice(0, first2);
108131
+ const blocks2 = headers.map((header, index) => ({
108132
+ key: header[1],
108133
+ order: index,
108134
+ text: text3.slice(header.index, headers[index + 1]?.index ?? text3.length)
108135
+ }));
108136
+ blocks2.sort((a, b) => a.key.localeCompare(b.key) || a.order - b.order);
108137
+ return prefix2 + blocks2.map((block) => block.text).join("");
108138
+ }
108123
108139
  const first = headers[0].index;
108124
108140
  const prefix = text3.slice(0, first);
108125
108141
  const blocks = headers.map((header, index) => ({
@@ -108127,8 +108143,9 @@ var fail4 = () => new Error('CODEX_HOOK_TRUST_UNSUPPORTED_LAYOUT: preserve and c
108127
108143
  order: index,
108128
108144
  text: text3.slice(header.index, headers[index + 1]?.index ?? text3.length)
108129
108145
  }));
108130
- blocks.sort((a, b) => a.key.localeCompare(b.key) || a.order - b.order);
108131
- return prefix + blocks.map((block) => block.text).join("");
108146
+ const simple = blocks.filter((block) => !block.key.startsWith("[["));
108147
+ const arrays = blocks.filter((block) => block.key.startsWith("[["));
108148
+ return prefix + [...simple, ...arrays].map((block) => block.text).join("");
108132
108149
  };
108133
108150
  var init_codex_hook_trust_layout = () => {};
108134
108151
 
package/bin/mcp.js CHANGED
@@ -20019,7 +20019,7 @@ var package_default;
20019
20019
  var init_package = __esm(() => {
20020
20020
  package_default = {
20021
20021
  name: "@hasna/skills",
20022
- version: "0.9.4",
20022
+ version: "0.9.6",
20023
20023
  description: "Skills library for AI coding agents",
20024
20024
  type: "module",
20025
20025
  bin: {
package/bin/migrate.js CHANGED
@@ -7,7 +7,7 @@ import { join as join5 } from "path";
7
7
  // package.json
8
8
  var package_default = {
9
9
  name: "@hasna/skills",
10
- version: "0.9.4",
10
+ version: "0.9.6",
11
11
  description: "Skills library for AI coding agents",
12
12
  type: "module",
13
13
  bin: {
package/bin/server.js CHANGED
@@ -24122,7 +24122,7 @@ var init_dist_es9 = __esm(() => {
24122
24122
  // package.json
24123
24123
  var package_default = {
24124
24124
  name: "@hasna/skills",
24125
- version: "0.9.4",
24125
+ version: "0.9.6",
24126
24126
  description: "Skills library for AI coding agents",
24127
24127
  type: "module",
24128
24128
  bin: {
package/bin/worker.js CHANGED
@@ -24125,7 +24125,7 @@ import { randomUUID as randomUUID6 } from "crypto";
24125
24125
  // package.json
24126
24126
  var package_default = {
24127
24127
  name: "@hasna/skills",
24128
- version: "0.9.4",
24128
+ version: "0.9.6",
24129
24129
  description: "Skills library for AI coding agents",
24130
24130
  type: "module",
24131
24131
  bin: {
package/dist/index.js CHANGED
@@ -11448,7 +11448,7 @@ import { isAbsolute as isAbsolute10, join as join20, resolve as resolve10 } from
11448
11448
  // package.json
11449
11449
  var package_default = {
11450
11450
  name: "@hasna/skills",
11451
- version: "0.9.4",
11451
+ version: "0.9.6",
11452
11452
  description: "Skills library for AI coding agents",
11453
11453
  type: "module",
11454
11454
  bin: {
@@ -15786,6 +15786,7 @@ function projectAncestorDirectories(projects) {
15786
15786
  function inventoryNativeSkills(home = homedir3(), options = {}) {
15787
15787
  const aliases = rootAliases(home, options.allowRootAliases);
15788
15788
  const selectedAgents = options.agents ? new Set(options.agents) : undefined;
15789
+ const includesAgent = (agent) => !selectedAgents || selectedAgents.has(agent);
15789
15790
  const rootDefinitions = selectedAgents ? ROOTS.filter(([agent, path]) => selectedAgents.has(agent) || selectedAgents.has("hermes") && agent === "codex" && path === ".agents/skills") : ROOTS;
15790
15791
  const roots = rootDefinitions.map(([agent, path]) => [agent, canonicalAgentPath(join25(home, path), aliases)]);
15791
15792
  const bridgePaths = Object.values(AGENT_ADAPTERS).map((adapter) => canonicalAgentPath(join25(home, adapter.root, CLI_BRIDGE_NAME), aliases));
@@ -15890,14 +15891,17 @@ function inventoryNativeSkills(home = homedir3(), options = {}) {
15890
15891
  for (const [agent, path] of roots)
15891
15892
  scanRoot(agent, path);
15892
15893
  if (options.includeVendor) {
15893
- for (const agent of ["codex", "claude"])
15894
+ for (const agent of ["codex", "claude"].filter(includesAgent))
15894
15895
  scanRoot(agent, canonicalAgentPath(join25(home, `.${agent}`, "plugins", "cache"), aliases), true, true);
15895
- scanRoot("claude", canonicalAgentPath(join25(home, ".claude", "plugins", "synced"), aliases), true);
15896
- scanRoot("gemini", join25(home, ".gemini", "extensions"), true);
15896
+ if (includesAgent("claude"))
15897
+ scanRoot("claude", canonicalAgentPath(join25(home, ".claude", "plugins", "synced"), aliases), true);
15898
+ if (includesAgent("gemini"))
15899
+ scanRoot("gemini", join25(home, ".gemini", "extensions"), true);
15897
15900
  }
15898
- const configured = options.configured ? INTEGRATION_AGENTS.flatMap((agent) => resolveAgentDiscovery({ home, agent, reviewed: options.discoveryInputs, canonical: (path) => canonicalAgentPath(path, aliases) }).roots.map((path) => ({ agent, path }))) : [];
15901
+ const configured = options.configured ? INTEGRATION_AGENTS.filter(includesAgent).flatMap((agent) => resolveAgentDiscovery({ home, agent, reviewed: options.discoveryInputs, canonical: (path) => canonicalAgentPath(path, aliases) }).roots.map((path) => ({ agent, path }))) : [];
15899
15902
  for (const root2 of [...options.agentRoots ?? [], ...configured])
15900
- scanRoot(root2.agent, canonicalAgentPath(root2.path, aliases), true);
15903
+ if (includesAgent(root2.agent))
15904
+ scanRoot(root2.agent, canonicalAgentPath(root2.path, aliases), true);
15901
15905
  recheckRootAliases(aliases);
15902
15906
  return entries;
15903
15907
  }
package/dist/sdk/index.js CHANGED
@@ -32373,7 +32373,7 @@ var init_event_sink = __esm(() => {
32373
32373
  // package.json
32374
32374
  var package_default = {
32375
32375
  name: "@hasna/skills",
32376
- version: "0.9.4",
32376
+ version: "0.9.6",
32377
32377
  description: "Skills library for AI coding agents",
32378
32378
  type: "module",
32379
32379
  bin: {
@@ -40709,6 +40709,7 @@ function projectAncestorDirectories(projects) {
40709
40709
  function inventoryNativeSkills(home = homedir3(), options = {}) {
40710
40710
  const aliases = rootAliases(home, options.allowRootAliases);
40711
40711
  const selectedAgents = options.agents ? new Set(options.agents) : undefined;
40712
+ const includesAgent = (agent) => !selectedAgents || selectedAgents.has(agent);
40712
40713
  const rootDefinitions = selectedAgents ? ROOTS.filter(([agent, path]) => selectedAgents.has(agent) || selectedAgents.has("hermes") && agent === "codex" && path === ".agents/skills") : ROOTS;
40713
40714
  const roots = rootDefinitions.map(([agent, path]) => [agent, canonicalAgentPath(join21(home, path), aliases)]);
40714
40715
  const bridgePaths = Object.values(AGENT_ADAPTERS).map((adapter) => canonicalAgentPath(join21(home, adapter.root, CLI_BRIDGE_NAME), aliases));
@@ -40813,14 +40814,17 @@ function inventoryNativeSkills(home = homedir3(), options = {}) {
40813
40814
  for (const [agent, path] of roots)
40814
40815
  scanRoot(agent, path);
40815
40816
  if (options.includeVendor) {
40816
- for (const agent of ["codex", "claude"])
40817
+ for (const agent of ["codex", "claude"].filter(includesAgent))
40817
40818
  scanRoot(agent, canonicalAgentPath(join21(home, `.${agent}`, "plugins", "cache"), aliases), true, true);
40818
- scanRoot("claude", canonicalAgentPath(join21(home, ".claude", "plugins", "synced"), aliases), true);
40819
- scanRoot("gemini", join21(home, ".gemini", "extensions"), true);
40819
+ if (includesAgent("claude"))
40820
+ scanRoot("claude", canonicalAgentPath(join21(home, ".claude", "plugins", "synced"), aliases), true);
40821
+ if (includesAgent("gemini"))
40822
+ scanRoot("gemini", join21(home, ".gemini", "extensions"), true);
40820
40823
  }
40821
- const configured = options.configured ? INTEGRATION_AGENTS.flatMap((agent) => resolveAgentDiscovery({ home, agent, reviewed: options.discoveryInputs, canonical: (path) => canonicalAgentPath(path, aliases) }).roots.map((path) => ({ agent, path }))) : [];
40824
+ const configured = options.configured ? INTEGRATION_AGENTS.filter(includesAgent).flatMap((agent) => resolveAgentDiscovery({ home, agent, reviewed: options.discoveryInputs, canonical: (path) => canonicalAgentPath(path, aliases) }).roots.map((path) => ({ agent, path }))) : [];
40822
40825
  for (const root2 of [...options.agentRoots ?? [], ...configured])
40823
- scanRoot(root2.agent, canonicalAgentPath(root2.path, aliases), true);
40826
+ if (includesAgent(root2.agent))
40827
+ scanRoot(root2.agent, canonicalAgentPath(root2.path, aliases), true);
40824
40828
  recheckRootAliases(aliases);
40825
40829
  return entries;
40826
40830
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@hasna/skills",
3
- "version": "0.9.4",
3
+ "version": "0.9.6",
4
4
  "description": "Skills library for AI coding agents",
5
5
  "type": "module",
6
6
  "bin": {