@skillsmith/core 0.12.3 → 0.12.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/CHANGELOG.md +164 -0
- package/README.md +2 -2
- package/dist/.tsbuildinfo +1 -1
- package/dist/src/config/owned-lock.acquire.d.ts +8 -0
- package/dist/src/config/owned-lock.acquire.d.ts.map +1 -1
- package/dist/src/config/owned-lock.acquire.js +19 -4
- package/dist/src/config/owned-lock.acquire.js.map +1 -1
- package/dist/src/config/owned-lock.claim.d.ts +4 -2
- package/dist/src/config/owned-lock.claim.d.ts.map +1 -1
- package/dist/src/config/owned-lock.claim.js +42 -8
- package/dist/src/config/owned-lock.claim.js.map +1 -1
- package/dist/src/config/owned-lock.d.ts.map +1 -1
- package/dist/src/config/owned-lock.js +1 -0
- package/dist/src/config/owned-lock.js.map +1 -1
- package/dist/src/config/owned-lock.test.js +126 -2
- package/dist/src/config/owned-lock.test.js.map +1 -1
- package/dist/src/config/owned-lock.types.d.ts +9 -0
- package/dist/src/config/owned-lock.types.d.ts.map +1 -1
- package/dist/src/db/createDatabase.d.ts.map +1 -1
- package/dist/src/db/createDatabase.js +0 -2
- package/dist/src/db/createDatabase.js.map +1 -1
- package/dist/src/exports/services.install.d.ts +1 -0
- package/dist/src/exports/services.install.d.ts.map +1 -1
- package/dist/src/exports/services.install.js +5 -0
- package/dist/src/exports/services.install.js.map +1 -1
- package/dist/src/index.d.ts +1 -1
- package/dist/src/index.js +1 -1
- package/dist/src/install/fan-out.cleanup.d.ts +37 -0
- package/dist/src/install/fan-out.cleanup.d.ts.map +1 -0
- package/dist/src/install/fan-out.cleanup.js +75 -0
- package/dist/src/install/fan-out.cleanup.js.map +1 -0
- package/dist/src/install/fan-out.d.ts +41 -31
- package/dist/src/install/fan-out.d.ts.map +1 -1
- package/dist/src/install/fan-out.js +213 -112
- package/dist/src/install/fan-out.js.map +1 -1
- package/dist/src/install/fan-out.leftovers.d.ts +60 -0
- package/dist/src/install/fan-out.leftovers.d.ts.map +1 -0
- package/dist/src/install/fan-out.leftovers.js +251 -0
- package/dist/src/install/fan-out.leftovers.js.map +1 -0
- package/dist/src/install/fan-out.locks.d.ts +12 -0
- package/dist/src/install/fan-out.locks.d.ts.map +1 -0
- package/dist/src/install/fan-out.locks.js +114 -0
- package/dist/src/install/fan-out.locks.js.map +1 -0
- package/dist/src/install/fan-out.manifest.d.ts +64 -0
- package/dist/src/install/fan-out.manifest.d.ts.map +1 -0
- package/dist/src/install/fan-out.manifest.js +130 -0
- package/dist/src/install/fan-out.manifest.js.map +1 -0
- package/dist/src/install/fan-out.overwrite.d.ts +51 -0
- package/dist/src/install/fan-out.overwrite.d.ts.map +1 -0
- package/dist/src/install/fan-out.overwrite.js +343 -0
- package/dist/src/install/fan-out.overwrite.js.map +1 -0
- package/dist/src/install/remove-if-same.d.ts +58 -0
- package/dist/src/install/remove-if-same.d.ts.map +1 -0
- package/dist/src/install/remove-if-same.js +222 -0
- package/dist/src/install/remove-if-same.js.map +1 -0
- package/dist/src/provenance/backfill.d.ts.map +1 -1
- package/dist/src/provenance/backfill.js +15 -2
- package/dist/src/provenance/backfill.js.map +1 -1
- package/dist/src/security/scanner/SecurityScanner.scanners.d.ts.map +1 -1
- package/dist/src/security/scanner/SecurityScanner.scanners.js +8 -1
- package/dist/src/security/scanner/SecurityScanner.scanners.js.map +1 -1
- package/dist/src/security/scanner/SecurityScanner.value-gate.d.ts +22 -2
- package/dist/src/security/scanner/SecurityScanner.value-gate.d.ts.map +1 -1
- package/dist/src/security/scanner/SecurityScanner.value-gate.js +143 -6
- package/dist/src/security/scanner/SecurityScanner.value-gate.js.map +1 -1
- package/dist/src/security/scanner/SecurityScanner.weak-passwords.d.ts +2 -2
- package/dist/src/security/scanner/SecurityScanner.weak-passwords.d.ts.map +1 -1
- package/dist/src/security/scanner/SecurityScanner.weak-passwords.js +185 -190
- package/dist/src/security/scanner/SecurityScanner.weak-passwords.js.map +1 -1
- package/dist/src/security/scanner/patterns.d.ts +47 -2
- package/dist/src/security/scanner/patterns.d.ts.map +1 -1
- package/dist/src/security/scanner/patterns.js +48 -3
- package/dist/src/security/scanner/patterns.js.map +1 -1
- package/dist/src/security/scanner/patterns.sensitive-path.d.ts +31 -3
- package/dist/src/security/scanner/patterns.sensitive-path.d.ts.map +1 -1
- package/dist/src/security/scanner/patterns.sensitive-path.js +59 -4
- package/dist/src/security/scanner/patterns.sensitive-path.js.map +1 -1
- package/dist/src/services/agent-pack/prompt-source.d.ts.map +1 -1
- package/dist/src/services/agent-pack/prompt-source.js +3 -2
- package/dist/src/services/agent-pack/prompt-source.js.map +1 -1
- package/dist/src/services/skill-installation.content.d.ts +7 -2
- package/dist/src/services/skill-installation.content.d.ts.map +1 -1
- package/dist/src/services/skill-installation.content.js +75 -28
- package/dist/src/services/skill-installation.content.js.map +1 -1
- package/dist/src/services/skill-installation.helpers.d.ts.map +1 -1
- package/dist/src/services/skill-installation.helpers.js +8 -0
- package/dist/src/services/skill-installation.helpers.js.map +1 -1
- package/dist/src/services/skill-installation.io.d.ts +1 -29
- package/dist/src/services/skill-installation.io.d.ts.map +1 -1
- package/dist/src/services/skill-installation.io.dirs.d.ts +15 -0
- package/dist/src/services/skill-installation.io.dirs.d.ts.map +1 -0
- package/dist/src/services/skill-installation.io.dirs.js +84 -0
- package/dist/src/services/skill-installation.io.dirs.js.map +1 -0
- package/dist/src/services/skill-installation.io.js +6 -176
- package/dist/src/services/skill-installation.io.js.map +1 -1
- package/dist/src/services/skill-installation.io.rollback.d.ts +138 -0
- package/dist/src/services/skill-installation.io.rollback.d.ts.map +1 -0
- package/dist/src/services/skill-installation.io.rollback.js +218 -0
- package/dist/src/services/skill-installation.io.rollback.js.map +1 -0
- package/dist/src/services/skill-installation.io.write.d.ts +69 -0
- package/dist/src/services/skill-installation.io.write.d.ts.map +1 -0
- package/dist/src/services/skill-installation.io.write.js +417 -0
- package/dist/src/services/skill-installation.io.write.js.map +1 -0
- package/dist/src/services/skill-installation.service.d.ts.map +1 -1
- package/dist/src/services/skill-installation.service.finalize.d.ts +62 -0
- package/dist/src/services/skill-installation.service.finalize.d.ts.map +1 -0
- package/dist/src/services/skill-installation.service.finalize.js +136 -0
- package/dist/src/services/skill-installation.service.finalize.js.map +1 -0
- package/dist/src/services/skill-installation.service.js +66 -80
- package/dist/src/services/skill-installation.service.js.map +1 -1
- package/dist/src/services/skill-installation.target-guard.d.ts +82 -0
- package/dist/src/services/skill-installation.target-guard.d.ts.map +1 -0
- package/dist/src/services/skill-installation.target-guard.js +410 -0
- package/dist/src/services/skill-installation.target-guard.js.map +1 -0
- package/dist/src/services/skill-installation.types.d.ts +13 -1
- package/dist/src/services/skill-installation.types.d.ts.map +1 -1
- package/dist/src/services/skill-installation.types.js.map +1 -1
- package/dist/src/services/skill-installation.uninstall.d.ts +3 -1
- package/dist/src/services/skill-installation.uninstall.d.ts.map +1 -1
- package/dist/src/services/skill-installation.uninstall.helpers.d.ts +59 -0
- package/dist/src/services/skill-installation.uninstall.helpers.d.ts.map +1 -0
- package/dist/src/services/skill-installation.uninstall.helpers.js +124 -0
- package/dist/src/services/skill-installation.uninstall.helpers.js.map +1 -0
- package/dist/src/services/skill-installation.uninstall.js +148 -25
- package/dist/src/services/skill-installation.uninstall.js.map +1 -1
- package/dist/src/utils/safe-fs.d.ts +69 -0
- package/dist/src/utils/safe-fs.d.ts.map +1 -1
- package/dist/src/utils/safe-fs.js +113 -2
- package/dist/src/utils/safe-fs.js.map +1 -1
- package/dist/tests/install/fan-out.test.js +1951 -13
- package/dist/tests/install/fan-out.test.js.map +1 -1
- package/dist/tests/install/remove-if-same.test.d.ts +2 -0
- package/dist/tests/install/remove-if-same.test.d.ts.map +1 -0
- package/dist/tests/install/remove-if-same.test.js +298 -0
- package/dist/tests/install/remove-if-same.test.js.map +1 -0
- package/dist/tests/integration/fan-out-lock-contention.test.d.ts +11 -0
- package/dist/tests/integration/fan-out-lock-contention.test.d.ts.map +1 -0
- package/dist/tests/integration/fan-out-lock-contention.test.js +53 -0
- package/dist/tests/integration/fan-out-lock-contention.test.js.map +1 -0
- package/dist/tests/provenance/backfill.test.js +43 -0
- package/dist/tests/provenance/backfill.test.js.map +1 -1
- package/dist/tests/security/scanner-regression-guard.test.js +33 -5
- package/dist/tests/security/scanner-regression-guard.test.js.map +1 -1
- package/dist/tests/security/sensitive-path-adversarial-review.test.js +120 -0
- package/dist/tests/security/sensitive-path-adversarial-review.test.js.map +1 -1
- package/dist/tests/security/sensitive-path-boolean-flag.test.d.ts +2 -0
- package/dist/tests/security/sensitive-path-boolean-flag.test.d.ts.map +1 -0
- package/dist/tests/security/sensitive-path-boolean-flag.test.js +151 -0
- package/dist/tests/security/sensitive-path-boolean-flag.test.js.map +1 -0
- package/dist/tests/security/sensitive-path-fp.test.js +71 -5
- package/dist/tests/security/sensitive-path-fp.test.js.map +1 -1
- package/dist/tests/security/sensitive-path-prefixed-secrets.test.d.ts +2 -0
- package/dist/tests/security/sensitive-path-prefixed-secrets.test.d.ts.map +1 -0
- package/dist/tests/security/sensitive-path-prefixed-secrets.test.js +176 -0
- package/dist/tests/security/sensitive-path-prefixed-secrets.test.js.map +1 -0
- package/dist/tests/security/weak-password-lexicon.test.js +14 -4
- package/dist/tests/security/weak-password-lexicon.test.js.map +1 -1
- package/dist/tests/unit/services/skill-installation.content.test.js +23 -0
- package/dist/tests/unit/services/skill-installation.content.test.js.map +1 -1
- package/dist/tests/unit/services/skill-installation.io.client-agent-path.test.js +35 -14
- package/dist/tests/unit/services/skill-installation.io.client-agent-path.test.js.map +1 -1
- package/dist/tests/unit/services/skill-installation.io.rollback.test.d.ts +2 -0
- package/dist/tests/unit/services/skill-installation.io.rollback.test.d.ts.map +1 -0
- package/dist/tests/unit/services/skill-installation.io.rollback.test.js +984 -0
- package/dist/tests/unit/services/skill-installation.io.rollback.test.js.map +1 -0
- package/dist/tests/unit/services/skill-installation.io.rollback.unit.test.d.ts +2 -0
- package/dist/tests/unit/services/skill-installation.io.rollback.unit.test.d.ts.map +1 -0
- package/dist/tests/unit/services/skill-installation.io.rollback.unit.test.js +148 -0
- package/dist/tests/unit/services/skill-installation.io.rollback.unit.test.js.map +1 -0
- package/dist/tests/unit/services/skill-installation.service.error-codes.test.js +19 -0
- package/dist/tests/unit/services/skill-installation.service.error-codes.test.js.map +1 -1
- package/dist/tests/unit/services/skill-installation.service.finalize.test.d.ts +2 -0
- package/dist/tests/unit/services/skill-installation.service.finalize.test.d.ts.map +1 -0
- package/dist/tests/unit/services/skill-installation.service.finalize.test.js +147 -0
- package/dist/tests/unit/services/skill-installation.service.finalize.test.js.map +1 -0
- package/dist/tests/unit/services/skill-installation.service.test.js +43 -0
- package/dist/tests/unit/services/skill-installation.service.test.js.map +1 -1
- package/dist/tests/unit/services/skill-installation.target-guard.test.d.ts +2 -0
- package/dist/tests/unit/services/skill-installation.target-guard.test.d.ts.map +1 -0
- package/dist/tests/unit/services/skill-installation.target-guard.test.js +590 -0
- package/dist/tests/unit/services/skill-installation.target-guard.test.js.map +1 -0
- package/dist/tests/unit/services/skill-installation.uninstall.guard.test.d.ts +2 -0
- package/dist/tests/unit/services/skill-installation.uninstall.guard.test.d.ts.map +1 -0
- package/dist/tests/unit/services/skill-installation.uninstall.guard.test.js +473 -0
- package/dist/tests/unit/services/skill-installation.uninstall.guard.test.js.map +1 -0
- package/dist/tests/utils/safe-fs.test.js +129 -2
- package/dist/tests/utils/safe-fs.test.js.map +1 -1
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"services.install.d.ts","sourceRoot":"","sources":["../../../src/exports/services.install.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAcH,OAAO,EACL,yBAAyB,EACzB,wBAAwB,GACzB,MAAM,6CAA6C,CAAA;AAsBpD,OAAO,EACL,wBAAwB,EACxB,KAAK,8BAA8B,GACpC,MAAM,2CAA2C,CAAA;AAElD,OAAO,EAAE,eAAe,EAAE,qBAAqB,EAAE,MAAM,+BAA+B,CAAA;
|
|
1
|
+
{"version":3,"file":"services.install.d.ts","sourceRoot":"","sources":["../../../src/exports/services.install.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAcH,OAAO,EACL,yBAAyB,EACzB,wBAAwB,GACzB,MAAM,6CAA6C,CAAA;AAsBpD,OAAO,EACL,wBAAwB,EACxB,KAAK,8BAA8B,GACpC,MAAM,2CAA2C,CAAA;AAElD,OAAO,EAAE,eAAe,EAAE,qBAAqB,EAAE,MAAM,+BAA+B,CAAA;AAMtF,OAAO,EACL,kBAAkB,EAClB,KAAK,wBAAwB,EAC7B,KAAK,wBAAwB,GAC9B,MAAM,gDAAgD,CAAA;AAEvD,OAAO,EACL,0BAA0B,IAAI,kCAAkC,EAChE,KAAK,gBAAgB,EACrB,KAAK,cAAc,EACnB,KAAK,aAAa,IAAI,iBAAiB,EACvC,KAAK,gBAAgB,EAErB,KAAK,YAAY,EACjB,KAAK,yBAAyB,EAC9B,KAAK,gBAAgB,EACrB,KAAK,eAAe,IAAI,mBAAmB,EAC3C,KAAK,aAAa,EAClB,KAAK,kBAAkB,EACvB,KAAK,iBAAiB,EACtB,KAAK,cAAc,EACnB,KAAK,iBAAiB,EACtB,KAAK,cAAc,EACnB,KAAK,gBAAgB,IAAI,oBAAoB,EAC7C,KAAK,cAAc,IAAI,kBAAkB,EACzC,KAAK,iBAAiB,GACvB,MAAM,yCAAyC,CAAA;AAEhD,OAAO,EACL,uBAAuB,EACvB,oBAAoB,GACrB,MAAM,4CAA4C,CAAA;AAUnD,OAAO,EACL,oBAAoB,EACpB,gBAAgB,EAChB,mBAAmB,EACnB,oBAAoB,EACpB,6BAA6B,EAC7B,oBAAoB,EACpB,sBAAsB,EACtB,qBAAqB,EACrB,KAAK,cAAc,EACnB,KAAK,0BAA0B,EAC/B,KAAK,2BAA2B,EAChC,KAAK,sBAAsB,EAC3B,KAAK,qBAAqB,EAC1B,KAAK,wBAAwB,EAC7B,KAAK,4BAA4B,EACjC,KAAK,4BAA4B,GAClC,MAAM,8CAA8C,CAAA;AAMrD,OAAO,EACL,oBAAoB,EACpB,KAAK,aAAa,EAClB,KAAK,mBAAmB,GACzB,MAAM,iCAAiC,CAAA;AAExC,OAAO,EACL,uBAAuB,EACvB,kCAAkC,GACnC,MAAM,gCAAgC,CAAA;AAMvC,OAAO,EAAE,mBAAmB,EAAE,MAAM,8BAA8B,CAAA"}
|
|
@@ -39,6 +39,11 @@ export { buildAdoptedManifestEntry, adoptUntrackedSkillEntry, } from '../service
|
|
|
39
39
|
// ============================================================================
|
|
40
40
|
export { SkillInstallationService, } from '../services/skill-installation.service.js';
|
|
41
41
|
export { ManifestManager, assertNotRealUserHome } from '../services/skill-manifest.js';
|
|
42
|
+
// SMI-6529 L20 (round 2): exported so mcp-server's `install.ts` conflict
|
|
43
|
+
// pre-flight can run the SAME pre-write target guard `install()` itself runs
|
|
44
|
+
// internally, BEFORE any backup/GC side effect — see that call site's own
|
|
45
|
+
// comment for why running it first matters.
|
|
46
|
+
export { checkInstallTarget, } from '../services/skill-installation.target-guard.js';
|
|
42
47
|
export { TRUST_TIER_SCANNER_OPTIONS as INSTALL_TRUST_TIER_SCANNER_OPTIONS, } from '../services/skill-installation.types.js';
|
|
43
48
|
export { recordAiDefenceFeedback, collectTrendWarnings, } from '../services/skill-installation.feedback.js';
|
|
44
49
|
// ============================================================================
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"services.install.js","sourceRoot":"","sources":["../../../src/exports/services.install.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,0EAA0E;AAC1E,yEAAyE;AACzE,4EAA4E;AAC5E,0EAA0E;AAC1E,gCAAgC;AAChC,EAAE;AACF,2EAA2E;AAC3E,qEAAqE;AACrE,0EAA0E;AAC1E,4EAA4E;AAC5E,qEAAqE;AACrE,uEAAuE;AACvE,OAAO,EACL,yBAAyB,EACzB,wBAAwB,GACzB,MAAM,6CAA6C,CAAA;AAEpD,+EAA+E;AAC/E,sEAAsE;AACtE,+EAA+E;AAC/E,EAAE;AACF,8EAA8E;AAC9E,0EAA0E;AAC1E,4DAA4D;AAC5D,EAAE;AACF,8EAA8E;AAC9E,oFAAoF;AACpF,EAAE;AACF,6EAA6E;AAC7E,6EAA6E;AAC7E,+EAA+E;AAC/E,2EAA2E;AAE3E,+EAA+E;AAC/E,wCAAwC;AACxC,+EAA+E;AAE/E,OAAO,EACL,wBAAwB,GAEzB,MAAM,2CAA2C,CAAA;AAElD,OAAO,EAAE,eAAe,EAAE,qBAAqB,EAAE,MAAM,+BAA+B,CAAA;AAEtF,OAAO,EACL,0BAA0B,IAAI,kCAAkC,GAmBjE,MAAM,yCAAyC,CAAA;AAEhD,OAAO,EACL,uBAAuB,EACvB,oBAAoB,GACrB,MAAM,4CAA4C,CAAA;AAEnD,+EAA+E;AAC/E,4CAA4C;AAC5C,+EAA+E;AAE/E,qEAAqE;AACrE,2EAA2E;AAC3E,qEAAqE;AACrE,qCAAqC;AACrC,OAAO,EACL,oBAAoB,EACpB,gBAAgB,EAChB,mBAAmB,EACnB,oBAAoB,EACpB,6BAA6B,EAC7B,oBAAoB,EACpB,sBAAsB,EACtB,qBAAqB,GAStB,MAAM,8CAA8C,CAAA;AAErD,+EAA+E;AAC/E,gDAAgD;AAChD,+EAA+E;AAE/E,OAAO,EACL,oBAAoB,GAGrB,MAAM,iCAAiC,CAAA;AAExC,OAAO,EACL,uBAAuB,EACvB,kCAAkC,GACnC,MAAM,gCAAgC,CAAA;AAEvC,4EAA4E;AAC5E,gEAAgE;AAChE,yEAAyE;AACzE,QAAQ;AACR,OAAO,EAAE,mBAAmB,EAAE,MAAM,8BAA8B,CAAA"}
|
|
1
|
+
{"version":3,"file":"services.install.js","sourceRoot":"","sources":["../../../src/exports/services.install.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,0EAA0E;AAC1E,yEAAyE;AACzE,4EAA4E;AAC5E,0EAA0E;AAC1E,gCAAgC;AAChC,EAAE;AACF,2EAA2E;AAC3E,qEAAqE;AAC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ACzE,QAAQ;AACR,OAAO,EAAE,mBAAmB,EAAE,MAAM,8BAA8B,CAAA"}
|
package/dist/src/index.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* @skillsmith/core - Core functionality for skill discovery
|
|
3
3
|
*/
|
|
4
|
-
export declare const VERSION = "0.12.
|
|
4
|
+
export declare const VERSION = "0.12.4";
|
|
5
5
|
export * from './exports/services.js';
|
|
6
6
|
export * from './exports/repositories.js';
|
|
7
7
|
export { createDatabaseSync, createDatabaseAsync } from './db/createDatabase.js';
|
package/dist/src/index.js
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
* @skillsmith/core - Core functionality for skill discovery
|
|
3
3
|
*/
|
|
4
4
|
// Version
|
|
5
|
-
export const VERSION = '0.12.
|
|
5
|
+
export const VERSION = '0.12.4';
|
|
6
6
|
// ============================================================================
|
|
7
7
|
// Grouped Exports from Barrel Files
|
|
8
8
|
// ============================================================================
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import { type EntryIdentity } from './remove-if-same.js';
|
|
2
|
+
/** Result of {@link removeRecordedLink}. */
|
|
3
|
+
export type RecordedLinkRemoval = {
|
|
4
|
+
removed: true;
|
|
5
|
+
} | {
|
|
6
|
+
removed: false;
|
|
7
|
+
reason: string;
|
|
8
|
+
};
|
|
9
|
+
/**
|
|
10
|
+
* SMI-6529 H3 (round 2) / N6 (round 4): uninstall's teardown of a copy-mode
|
|
11
|
+
* fan-out (or symlink) Skillsmith created and recorded in the link manifest.
|
|
12
|
+
*
|
|
13
|
+
* A recorded copy can later become a real git working tree (the user
|
|
14
|
+
* `git init`s or clones into that path), so a non-symlink recorded copy with
|
|
15
|
+
* `.git` at its root is refused: reported and left in place. Symlinks are
|
|
16
|
+
* just unlinked; what they point at is untouched.
|
|
17
|
+
*
|
|
18
|
+
* Returns `{ removed: true }` on a removal, or when the path is already gone,
|
|
19
|
+
* and `{ removed: false, reason }` on a refusal or a failure, so the caller
|
|
20
|
+
* keeps the manifest entry and reports it.
|
|
21
|
+
*/
|
|
22
|
+
export declare function removeRecordedLink(p: string): Promise<RecordedLinkRemoval>;
|
|
23
|
+
/**
|
|
24
|
+
* SMI-6529 rounds 10–11: undo addLink's write when its record couldn't be
|
|
25
|
+
* saved. A fresh destination is removed. A refreshed symlink is put back,
|
|
26
|
+
* since its existing record still describes it (it was replaced with no
|
|
27
|
+
* backup). Left as is, either would be a destination the manifest doesn't
|
|
28
|
+
* describe: uninstall would miss it, and a force refresh would refuse it.
|
|
29
|
+
*
|
|
30
|
+
* The caller holds the destination's lock, so no other Skillsmith call has
|
|
31
|
+
* touched it. Another program may have, so only the entry this call placed is
|
|
32
|
+
* removed; anything else found there is left, and the error says so. Round
|
|
33
|
+
* 15: `placed` is the staged entry's identity, taken before it was swapped
|
|
34
|
+
* into place, so a swap after that moment can't pass as this call's write.
|
|
35
|
+
*/
|
|
36
|
+
export declare function undoUnrecordedWrite(toDir: string, cause: unknown, oldLinkTarget: string | undefined, placed: EntryIdentity | null): Promise<void>;
|
|
37
|
+
//# sourceMappingURL=fan-out.cleanup.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"fan-out.cleanup.d.ts","sourceRoot":"","sources":["../../../src/install/fan-out.cleanup.ts"],"names":[],"mappings":"AAkBA,OAAO,EAAgB,KAAK,aAAa,EAAE,MAAM,qBAAqB,CAAA;AAMtE,4CAA4C;AAC5C,MAAM,MAAM,mBAAmB,GAAG;IAAE,OAAO,EAAE,IAAI,CAAA;CAAE,GAAG;IAAE,OAAO,EAAE,KAAK,CAAC;IAAC,MAAM,EAAE,MAAM,CAAA;CAAE,CAAA;AAExF;;;;;;;;;;;;GAYG;AACH,wBAAsB,kBAAkB,CAAC,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,mBAAmB,CAAC,CAkBhF;AAED;;;;;;;;;;;;GAYG;AACH,wBAAsB,mBAAmB,CACvC,KAAK,EAAE,MAAM,EACb,KAAK,EAAE,OAAO,EACd,aAAa,EAAE,MAAM,GAAG,SAAS,EACjC,MAAM,EAAE,aAAa,GAAG,IAAI,GAC3B,OAAO,CAAC,IAAI,CAAC,CAuBf"}
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
import * as fsp from 'node:fs/promises';
|
|
2
|
+
import { checkGitAtRoot, gitRefusal } from './fan-out.overwrite.js';
|
|
3
|
+
import { removeIfSame } from './remove-if-same.js';
|
|
4
|
+
function errorText(err) {
|
|
5
|
+
return err instanceof Error ? err.message : String(err);
|
|
6
|
+
}
|
|
7
|
+
/**
|
|
8
|
+
* SMI-6529 H3 (round 2) / N6 (round 4): uninstall's teardown of a copy-mode
|
|
9
|
+
* fan-out (or symlink) Skillsmith created and recorded in the link manifest.
|
|
10
|
+
*
|
|
11
|
+
* A recorded copy can later become a real git working tree (the user
|
|
12
|
+
* `git init`s or clones into that path), so a non-symlink recorded copy with
|
|
13
|
+
* `.git` at its root is refused: reported and left in place. Symlinks are
|
|
14
|
+
* just unlinked; what they point at is untouched.
|
|
15
|
+
*
|
|
16
|
+
* Returns `{ removed: true }` on a removal, or when the path is already gone,
|
|
17
|
+
* and `{ removed: false, reason }` on a refusal or a failure, so the caller
|
|
18
|
+
* keeps the manifest entry and reports it.
|
|
19
|
+
*/
|
|
20
|
+
export async function removeRecordedLink(p) {
|
|
21
|
+
let stat;
|
|
22
|
+
try {
|
|
23
|
+
stat = await fsp.lstat(p);
|
|
24
|
+
}
|
|
25
|
+
catch (err) {
|
|
26
|
+
// Already gone: races with an external editor or uninstall are expected,
|
|
27
|
+
// and there is nothing left to report. Round 15 (cross-model review): any
|
|
28
|
+
// other error means we can't tell what is there, so the record is kept.
|
|
29
|
+
if (err.code === 'ENOENT')
|
|
30
|
+
return { removed: true };
|
|
31
|
+
return { removed: false, reason: `${p} could not be checked: ${errorText(err)}` };
|
|
32
|
+
}
|
|
33
|
+
if (!stat.isSymbolicLink() && !stat.isFile()) {
|
|
34
|
+
const refusal = gitRefusal(p, await checkGitAtRoot(p), 'delete');
|
|
35
|
+
if (refusal)
|
|
36
|
+
return { removed: false, reason: refusal };
|
|
37
|
+
}
|
|
38
|
+
// Remove only the entry checked above.
|
|
39
|
+
const removal = await removeIfSame(p, stat);
|
|
40
|
+
return removal.removed ? removal : { removed: false, reason: `${p} ${removal.reason}.` };
|
|
41
|
+
}
|
|
42
|
+
/**
|
|
43
|
+
* SMI-6529 rounds 10–11: undo addLink's write when its record couldn't be
|
|
44
|
+
* saved. A fresh destination is removed. A refreshed symlink is put back,
|
|
45
|
+
* since its existing record still describes it (it was replaced with no
|
|
46
|
+
* backup). Left as is, either would be a destination the manifest doesn't
|
|
47
|
+
* describe: uninstall would miss it, and a force refresh would refuse it.
|
|
48
|
+
*
|
|
49
|
+
* The caller holds the destination's lock, so no other Skillsmith call has
|
|
50
|
+
* touched it. Another program may have, so only the entry this call placed is
|
|
51
|
+
* removed; anything else found there is left, and the error says so. Round
|
|
52
|
+
* 15: `placed` is the staged entry's identity, taken before it was swapped
|
|
53
|
+
* into place, so a swap after that moment can't pass as this call's write.
|
|
54
|
+
*/
|
|
55
|
+
export async function undoUnrecordedWrite(toDir, cause, oldLinkTarget, placed) {
|
|
56
|
+
const fail = (what) => new Error(`addLink: ${errorText(cause)}; this call's unrecorded write could not be undone: ${what}.`, { cause });
|
|
57
|
+
if (placed === null) {
|
|
58
|
+
// Round 21 (Opus): the write could not be identified — something replaced
|
|
59
|
+
// it while it was being created — so nothing here is safe to remove.
|
|
60
|
+
throw fail(`${toDir} holds a write this call could not identify, since something replaced it while ` +
|
|
61
|
+
`it was being created, so nothing was removed`);
|
|
62
|
+
}
|
|
63
|
+
const removal = await removeIfSame(toDir, placed);
|
|
64
|
+
if (!removal.removed)
|
|
65
|
+
throw fail(`${toDir} ${removal.reason}`);
|
|
66
|
+
if (oldLinkTarget !== undefined) {
|
|
67
|
+
try {
|
|
68
|
+
await fsp.symlink(oldLinkTarget, toDir, 'dir');
|
|
69
|
+
}
|
|
70
|
+
catch (err) {
|
|
71
|
+
throw fail(`${toDir} could not be put back as the symlink it was (${errorText(err)})`);
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
}
|
|
75
|
+
//# sourceMappingURL=fan-out.cleanup.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"fan-out.cleanup.js","sourceRoot":"","sources":["../../../src/install/fan-out.cleanup.ts"],"names":[],"mappings":"AAgBA,OAAO,KAAK,GAAG,MAAM,kBAAkB,CAAA;AACvC,OAAO,EAAE,cAAc,EAAE,UAAU,EAAE,MAAM,wBAAwB,CAAA;AACnE,OAAO,EAAE,YAAY,EAAsB,MAAM,qBAAqB,CAAA;AAEtE,SAAS,SAAS,CAAC,GAAY;IAC7B,OAAO,GAAG,YAAY,KAAK,CAAC,CAAC,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,GAAG,CAAC,CAAA;AACzD,CAAC;AAKD;;;;;;;;;;;;GAYG;AACH,MAAM,CAAC,KAAK,UAAU,kBAAkB,CAAC,CAAS;IAChD,IAAI,IAAW,CAAA;IACf,IAAI,CAAC;QACH,IAAI,GAAG,MAAM,GAAG,CAAC,KAAK,CAAC,CAAC,CAAC,CAAA;IAC3B,CAAC;IAAC,OAAO,GAAG,EAAE,CAAC;QACb,yEAAyE;QACzE,0EAA0E;QAC1E,wEAAwE;QACxE,IAAK,GAA6B,CAAC,IAAI,KAAK,QAAQ;YAAE,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,CAAA;QAC9E,OAAO,EAAE,OAAO,EAAE,KAAK,EAAE,MAAM,EAAE,GAAG,CAAC,0BAA0B,SAAS,CAAC,GAAG,CAAC,EAAE,EAAE,CAAA;IACnF,CAAC;IACD,IAAI,CAAC,IAAI,CAAC,cAAc,EAAE,IAAI,CAAC,IAAI,CAAC,MAAM,EAAE,EAAE,CAAC;QAC7C,MAAM,OAAO,GAAG,UAAU,CAAC,CAAC,EAAE,MAAM,cAAc,C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,iDAAiD,SAAS,CAAC,GAAG,CAAC,GAAG,CAAC,CAAA;QACxF,CAAC;IACH,CAAC;AACH,CAAC"}
|
|
@@ -1,32 +1,7 @@
|
|
|
1
1
|
import { type ClientId } from './paths.js';
|
|
2
|
-
|
|
3
|
-
export
|
|
4
|
-
|
|
5
|
-
from: string;
|
|
6
|
-
to: string;
|
|
7
|
-
kind: LinkKind;
|
|
8
|
-
createdAt: string;
|
|
9
|
-
}
|
|
10
|
-
export interface LinkManifest {
|
|
11
|
-
version: 1;
|
|
12
|
-
links: LinkRecord[];
|
|
13
|
-
}
|
|
14
|
-
/**
|
|
15
|
-
* Resolve the manifest file path. Sits under `~/.skillsmith/` so it shares
|
|
16
|
-
* the existing allow-list entry for that directory (DEFAULT_ALLOWED_DIRS in
|
|
17
|
-
* `pathValidation.ts`).
|
|
18
|
-
*/
|
|
19
|
-
export declare function getLinkManifestPath(): string;
|
|
20
|
-
/**
|
|
21
|
-
* Load the manifest from disk. Returns an empty manifest if the file is
|
|
22
|
-
* missing or unreadable — fan-out is best-effort, never crash on cold start.
|
|
23
|
-
*/
|
|
24
|
-
export declare function loadManifest(): Promise<LinkManifest>;
|
|
25
|
-
/**
|
|
26
|
-
* Persist the manifest atomically (write-temp + rename) so a crash mid-write
|
|
27
|
-
* never leaves the file in a partial state.
|
|
28
|
-
*/
|
|
29
|
-
export declare function saveManifest(manifest: LinkManifest): Promise<void>;
|
|
2
|
+
import { type LinkRecord } from './fan-out.manifest.js';
|
|
3
|
+
export { getLinkManifestPath, loadManifest, saveManifest } from './fan-out.manifest.js';
|
|
4
|
+
export type { LinkKind, LinkManifest, LinkRecord } from './fan-out.manifest.js';
|
|
30
5
|
export interface AddLinkOptions {
|
|
31
6
|
/** Skill identifier (e.g. `author/name`). Used as the directory name on disk. */
|
|
32
7
|
skillId: string;
|
|
@@ -46,6 +21,12 @@ export interface AddLinkResult {
|
|
|
46
21
|
record: LinkRecord;
|
|
47
22
|
/** True if `preferSymlink` was set but EPERM forced a fallback to copy. */
|
|
48
23
|
fellBackToCopy: boolean;
|
|
24
|
+
/**
|
|
25
|
+
* Things to tell the user: hidden backups left by an interrupted refresh
|
|
26
|
+
* (SMI-6529 round 7), or a corrupt link manifest moved aside (round 9).
|
|
27
|
+
* Omitted when none.
|
|
28
|
+
*/
|
|
29
|
+
warnings?: string[];
|
|
49
30
|
}
|
|
50
31
|
/**
|
|
51
32
|
* Create a fan-out link from one client's skill directory into another's.
|
|
@@ -58,14 +39,43 @@ export interface AddLinkResult {
|
|
|
58
39
|
* `~/.skillsmith/links/manifest.json` so uninstall can tear it down.
|
|
59
40
|
*/
|
|
60
41
|
export declare function addLink(opts: AddLinkOptions): Promise<AddLinkResult>;
|
|
42
|
+
/** Result of {@link removeLinks} — see N6's doc comment on `removeRecordedLink`. */
|
|
43
|
+
export interface RemoveLinksResult {
|
|
44
|
+
/** Count of destinations actually removed from disk. */
|
|
45
|
+
removed: number;
|
|
46
|
+
/**
|
|
47
|
+
* Destinations refused (left in place, e.g. N6's `.git`-at-root guard, or
|
|
48
|
+
* a removal error) — each entry stays in the manifest so a future
|
|
49
|
+
* `removeLinks` call retries it, and callers should surface `reason` to
|
|
50
|
+
* the user rather than silently discarding it.
|
|
51
|
+
*/
|
|
52
|
+
refused: Array<{
|
|
53
|
+
to: string;
|
|
54
|
+
reason: string;
|
|
55
|
+
}>;
|
|
56
|
+
/**
|
|
57
|
+
* Things to tell the user: hidden backups left by an interrupted refresh
|
|
58
|
+
* (SMI-6529 round 7), a corrupt link manifest moved aside (round 9), or a
|
|
59
|
+
* manifest this uninstall couldn't use (round 11). Omitted when none.
|
|
60
|
+
*/
|
|
61
|
+
warnings?: string[];
|
|
62
|
+
}
|
|
61
63
|
/**
|
|
62
|
-
* Remove every fan-out link recorded for `skillId`.
|
|
63
|
-
*
|
|
64
|
+
* Remove every fan-out link recorded for `skillId`. Safe to call when no
|
|
65
|
+
* manifest exists (returns `{ removed: 0, refused: [] }`).
|
|
64
66
|
*
|
|
65
67
|
* Uninstall callers should invoke this BEFORE removing the canonical
|
|
66
68
|
* directory so symlinks resolve cleanly during their lstat checks.
|
|
69
|
+
*
|
|
70
|
+
* SMI-6529 N6 (round 4): a destination `removeRecordedLink` refuses (a
|
|
71
|
+
* recorded copy that now contains `.git` at its root, or a removal error)
|
|
72
|
+
* keeps its manifest entry instead of being unconditionally dropped — the
|
|
73
|
+
* old unconditional `manifest.links = manifest.links.filter(...)` discarded
|
|
74
|
+
* the record for EVERY matching link regardless of whether the on-disk
|
|
75
|
+
* removal actually succeeded, so a refused destination could never be
|
|
76
|
+
* retried and its refusal was never reported anywhere.
|
|
67
77
|
*/
|
|
68
|
-
export declare function removeLinks(skillId: string): Promise<
|
|
78
|
+
export declare function removeLinks(skillId: string): Promise<RemoveLinksResult>;
|
|
69
79
|
/**
|
|
70
80
|
* List all fan-out links for a skill (or all skills when `skillId` is
|
|
71
81
|
* undefined). Read-only — for `skillsmith list --client X` and the
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"fan-out.d.ts","sourceRoot":"","sources":["../../../src/install/fan-out.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"fan-out.d.ts","sourceRoot":"","sources":["../../../src/install/fan-out.ts"],"names":[],"mappings":"AAoBA,OAAO,EAAyC,KAAK,QAAQ,EAAE,MAAM,YAAY,CAAA;AASjF,OAAO,EAQL,KAAK,UAAU,EAEhB,MAAM,uBAAuB,CAAA;AAG9B,OAAO,EAAE,mBAAmB,EAAE,YAAY,EAAE,YAAY,EAAE,MAAM,uBAAuB,CAAA;AACvF,YAAY,EAAE,QAAQ,EAAE,YAAY,EAAE,UAAU,EAAE,MAAM,uBAAuB,CAAA;AAE/E,MAAM,WAAW,cAAc;IAC7B,iFAAiF;IACjF,OAAO,EAAE,MAAM,CAAA;IACf,4DAA4D;IAC5D,UAAU,EAAE,QAAQ,CAAA;IACpB,0DAA0D;IAC1D,QAAQ,EAAE,QAAQ,CAAA;IAClB,iFAAiF;IACjF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