agent-skill-manager 1.19.0 → 1.21.0
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/README.md +224 -43
- package/dist/agent-skill-manager.js +514 -312
- package/dist/{chunk-q3gm2x0a.js → chunk-1becp2v6.js} +1 -1
- package/dist/{chunk-33wmae4f.js → chunk-4qbqrrmk.js} +1 -1
- package/dist/{chunk-v3wdjh4r.js → chunk-a26gjzjk.js} +2 -2
- package/dist/chunk-cshq625q.js +15 -0
- package/package.json +3 -2
- package/dist/chunk-d3ed4n6q.js +0 -14
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{O as z,R as B}from"./chunk-a26gjzjk.js";import{readFile as J,writeFile as K,mkdir as M,copyFile as N}from"fs/promises";import{execFile as O}from"child_process";import{promisify as Q}from"util";import{dirname as R}from"path";var S=Q(O);function G(){return{version:1,skills:{}}}async function H(){let j=B(),v;try{v=await J(j,"utf-8")}catch(q){if(q?.code==="ENOENT")return z("lock: file not found, returning empty lock"),G();throw q}try{let q=JSON.parse(v);if(q.version!==1||typeof q.skills!=="object"||q.skills===null)throw Error("invalid schema");return z(`lock: loaded ${Object.keys(q.skills).length} entries`),q}catch{let q=j+".bak";z(`lock: parse error, backing up to ${q}`);try{await N(j,q)}catch{}return console.error(`Warning: .skill-lock.json was corrupted. Backup saved to ${q}. Starting fresh.`),G()}}async function Z(j,v){let q=await H();q.skills[j]=v,await I(q),z(`lock: wrote entry for "${j}"`)}async function $(j){let v=await H();if(!(j in v.skills)){z(`lock: no entry for "${j}", nothing to remove`);return}delete v.skills[j],await I(v),z(`lock: removed entry for "${j}"`)}async function I(j){let v=B();await M(R(v),{recursive:!0}),await K(v,JSON.stringify(j,null,2)+`
|
|
2
2
|
`,"utf-8")}async function A(j){try{let{stdout:v}=await S("git",["rev-parse","HEAD"],{cwd:j,timeout:5000});return v.trim()||null}catch{return z("lock: could not read commit hash from cloned repo"),null}}export{Z as writeLockEntry,$ as removeLockEntry,H as readLock,A as getCommitHash};
|
|
3
3
|
export{H as a,Z as b,$ as c,A as d};
|