@hasna/skills 0.5.6 → 0.5.7

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
@@ -36860,7 +36860,7 @@ var package_default;
36860
36860
  var init_package = __esm(() => {
36861
36861
  package_default = {
36862
36862
  name: "@hasna/skills",
36863
- version: "0.5.6",
36863
+ version: "0.5.7",
36864
36864
  description: "Skills library for AI coding agents",
36865
36865
  type: "module",
36866
36866
  bin: {
package/bin/mcp.js CHANGED
@@ -5586,7 +5586,7 @@ var package_default;
5586
5586
  var init_package = __esm(() => {
5587
5587
  package_default = {
5588
5588
  name: "@hasna/skills",
5589
- version: "0.5.6",
5589
+ version: "0.5.7",
5590
5590
  description: "Skills library for AI coding agents",
5591
5591
  type: "module",
5592
5592
  bin: {
package/bin/migrate.js CHANGED
@@ -7,7 +7,7 @@ import { join as join6 } from "path";
7
7
  // package.json
8
8
  var package_default = {
9
9
  name: "@hasna/skills",
10
- version: "0.5.6",
10
+ version: "0.5.7",
11
11
  description: "Skills library for AI coding agents",
12
12
  type: "module",
13
13
  bin: {
package/bin/server.js CHANGED
@@ -23100,7 +23100,7 @@ var init_dist_es9 = __esm(() => {
23100
23100
  // package.json
23101
23101
  var package_default = {
23102
23102
  name: "@hasna/skills",
23103
- version: "0.5.6",
23103
+ version: "0.5.7",
23104
23104
  description: "Skills library for AI coding agents",
23105
23105
  type: "module",
23106
23106
  bin: {
package/bin/worker.js CHANGED
@@ -23103,7 +23103,7 @@ import { randomUUID as randomUUID4 } from "crypto";
23103
23103
  // package.json
23104
23104
  var package_default = {
23105
23105
  name: "@hasna/skills",
23106
- version: "0.5.6",
23106
+ version: "0.5.7",
23107
23107
  description: "Skills library for AI coding agents",
23108
23108
  type: "module",
23109
23109
  bin: {
package/dist/index.js CHANGED
@@ -13336,7 +13336,7 @@ import { dirname as dirname7, relative as relative4 } from "path";
13336
13336
  // package.json
13337
13337
  var package_default = {
13338
13338
  name: "@hasna/skills",
13339
- version: "0.5.6",
13339
+ version: "0.5.7",
13340
13340
  description: "Skills library for AI coding agents",
13341
13341
  type: "module",
13342
13342
  bin: {
package/dist/sdk/index.js CHANGED
@@ -25496,7 +25496,7 @@ class MissingSkillsFleetError extends Error {
25496
25496
  // package.json
25497
25497
  var package_default = {
25498
25498
  name: "@hasna/skills",
25499
- version: "0.5.6",
25499
+ version: "0.5.7",
25500
25500
  description: "Skills library for AI coding agents",
25501
25501
  type: "module",
25502
25502
  bin: {
@@ -48699,7 +48699,7 @@ var DEFAULT_IMAGE_PROFILES = {
48699
48699
  function createImageProfileRegistry(config = DEFAULT_IMAGE_PROFILES) {
48700
48700
  const runtimes = new Map;
48701
48701
  for (const pinned of config.runtimes) {
48702
- runtimes.set(pinned.runtime, pinned);
48702
+ runtimes.set(pinned.runtime, { ...pinned });
48703
48703
  }
48704
48704
  const allowlist = new Map(Object.entries(config.dependencyLayers));
48705
48705
  return {
@@ -48714,11 +48714,14 @@ function createImageProfileRegistry(config = DEFAULT_IMAGE_PROFILES) {
48714
48714
  if (systemDeps.length > 0 && dependencyLayerTag === null) {
48715
48715
  throw new ImageProfileResolutionError({ reason: "UNALLOWED_SYSTEM_DEPS", systemDeps });
48716
48716
  }
48717
- return { runtime: pinned, runtimeImageDigest: pinned.imageDigest, dependencyLayerTag };
48717
+ return { runtime: { ...pinned }, runtimeImageDigest: pinned.imageDigest, dependencyLayerTag };
48718
48718
  }
48719
48719
  };
48720
48720
  }
48721
48721
  function canonicalSystemDepsKey(systemDeps) {
48722
+ if (systemDeps.some((dep) => typeof dep !== "string" || dep.length === 0 || dep.includes(","))) {
48723
+ throw new ImageProfileResolutionError({ reason: "UNALLOWED_SYSTEM_DEPS", systemDeps: [...systemDeps] });
48724
+ }
48722
48725
  return Array.from(new Set(systemDeps)).sort().join(",");
48723
48726
  }
48724
48727
  function dependencyLayerRule(layerTag, systemDeps) {
@@ -48763,10 +48766,17 @@ function createSubmitRunService(options) {
48763
48766
  async submit(input) {
48764
48767
  if (!input.idempotencyKey.trim())
48765
48768
  throw new Error("admission: idempotencyKey is required");
48769
+ const policy = { ...DEFAULT_RUN_POLICY, ...input.policy };
48770
+ input = {
48771
+ ...input,
48772
+ systemDeps: [...input.systemDeps ?? []],
48773
+ policy: { ...policy, egressAllowlist: [...policy.egressAllowlist] },
48774
+ limits: { ...DEFAULT_RUN_LIMITS, ...input.limits }
48775
+ };
48776
+ const inputDigest = digestInput(input.input);
48766
48777
  const byKey = await store.getRunByKey(input.tenantId, input.idempotencyKey);
48767
48778
  if (byKey)
48768
- return { run: byKey.admission, created: false };
48769
- const inputDigest = digestInput(input.input);
48779
+ return { run: ownedAdmission(byKey.admission), created: false };
48770
48780
  const byDigests = await store.getRunByDigests({
48771
48781
  tenantId: input.tenantId,
48772
48782
  skillId: input.skillId,
@@ -48775,7 +48785,7 @@ function createSubmitRunService(options) {
48775
48785
  inputDigest
48776
48786
  });
48777
48787
  if (byDigests)
48778
- return { run: byDigests.admission, created: false };
48788
+ return { run: ownedAdmission(byDigests.admission), created: false };
48779
48789
  const image = resolveImageProfile(imageProfiles, {
48780
48790
  runtime: input.runtime,
48781
48791
  systemDeps: input.systemDeps ?? []
@@ -48797,10 +48807,17 @@ function createSubmitRunService(options) {
48797
48807
  createdAt: now().toISOString()
48798
48808
  };
48799
48809
  const row = await store.admit(admission);
48800
- return { run: row.admission, created: true };
48810
+ return { run: ownedAdmission(row.admission), created: true };
48801
48811
  }
48802
48812
  };
48803
48813
  }
48814
+ function ownedAdmission(admission) {
48815
+ return {
48816
+ ...admission,
48817
+ policy: { ...admission.policy, egressAllowlist: [...admission.policy.egressAllowlist] },
48818
+ limits: { ...admission.limits }
48819
+ };
48820
+ }
48804
48821
  function digestInput(input) {
48805
48822
  return createHash10("sha256").update(canonicalJson(input)).digest("hex");
48806
48823
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@hasna/skills",
3
- "version": "0.5.6",
3
+ "version": "0.5.7",
4
4
  "description": "Skills library for AI coding agents",
5
5
  "type": "module",
6
6
  "bin": {