@skillsmith/core 0.11.1 → 0.11.3

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.
Files changed (138) hide show
  1. package/CHANGELOG.md +20 -0
  2. package/README.md +6 -7
  3. package/dist/.tsbuildinfo +1 -1
  4. package/dist/src/analysis/McpReferenceExtractor.d.ts +59 -5
  5. package/dist/src/analysis/McpReferenceExtractor.d.ts.map +1 -1
  6. package/dist/src/analysis/McpReferenceExtractor.hardening.test.d.ts +2 -0
  7. package/dist/src/analysis/McpReferenceExtractor.hardening.test.d.ts.map +1 -0
  8. package/dist/src/analysis/McpReferenceExtractor.hardening.test.js +278 -0
  9. package/dist/src/analysis/McpReferenceExtractor.hardening.test.js.map +1 -0
  10. package/dist/src/analysis/McpReferenceExtractor.js +276 -20
  11. package/dist/src/analysis/McpReferenceExtractor.js.map +1 -1
  12. package/dist/src/analysis/McpReferenceExtractor.test.js +4 -0
  13. package/dist/src/analysis/McpReferenceExtractor.test.js.map +1 -1
  14. package/dist/src/config/config-atomic-write.d.ts +58 -0
  15. package/dist/src/config/config-atomic-write.d.ts.map +1 -0
  16. package/dist/src/config/config-atomic-write.js +151 -0
  17. package/dist/src/config/config-atomic-write.js.map +1 -0
  18. package/dist/src/config/config-atomic-write.test.d.ts +9 -0
  19. package/dist/src/config/config-atomic-write.test.d.ts.map +1 -0
  20. package/dist/src/config/config-atomic-write.test.js +92 -0
  21. package/dist/src/config/config-atomic-write.test.js.map +1 -0
  22. package/dist/src/config/device-identity.d.ts +16 -0
  23. package/dist/src/config/device-identity.d.ts.map +1 -1
  24. package/dist/src/config/device-identity.js +82 -14
  25. package/dist/src/config/device-identity.js.map +1 -1
  26. package/dist/src/config/device-identity.test.js +158 -1
  27. package/dist/src/config/device-identity.test.js.map +1 -1
  28. package/dist/src/config/index.d.ts +14 -0
  29. package/dist/src/config/index.d.ts.map +1 -1
  30. package/dist/src/config/index.js +31 -15
  31. package/dist/src/config/index.js.map +1 -1
  32. package/dist/src/exports/services.d.ts +2 -1
  33. package/dist/src/exports/services.d.ts.map +1 -1
  34. package/dist/src/exports/services.js +1 -0
  35. package/dist/src/exports/services.js.map +1 -1
  36. package/dist/src/index.d.ts +2 -1
  37. package/dist/src/index.d.ts.map +1 -1
  38. package/dist/src/index.js +5 -1
  39. package/dist/src/index.js.map +1 -1
  40. package/dist/src/indexer/SwarmIndexer.d.ts +1 -1
  41. package/dist/src/indexer/SwarmIndexer.js +2 -2
  42. package/dist/src/indexer/SwarmIndexer.js.map +1 -1
  43. package/dist/src/install/paths.d.ts +1 -1
  44. package/dist/src/install/paths.d.ts.map +1 -1
  45. package/dist/src/install/paths.js +2 -0
  46. package/dist/src/install/paths.js.map +1 -1
  47. package/dist/src/install/paths.test.js +10 -1
  48. package/dist/src/install/paths.test.js.map +1 -1
  49. package/dist/src/journal/reader.d.ts.map +1 -1
  50. package/dist/src/journal/reader.js +4 -1
  51. package/dist/src/journal/reader.js.map +1 -1
  52. package/dist/src/journal/types.d.ts +13 -3
  53. package/dist/src/journal/types.d.ts.map +1 -1
  54. package/dist/src/journal/types.js +8 -2
  55. package/dist/src/journal/types.js.map +1 -1
  56. package/dist/src/scripts/__tests__/scan-imported-skills.test.js +36 -0
  57. package/dist/src/scripts/__tests__/scan-imported-skills.test.js.map +1 -1
  58. package/dist/src/security/audit-types.d.ts +1 -1
  59. package/dist/src/security/audit-types.d.ts.map +1 -1
  60. package/dist/src/security/audit-types.js.map +1 -1
  61. package/dist/src/security/scanner/SecurityScanner.exec.d.ts +7 -0
  62. package/dist/src/security/scanner/SecurityScanner.exec.d.ts.map +1 -1
  63. package/dist/src/security/scanner/SecurityScanner.exec.js +10 -74
  64. package/dist/src/security/scanner/SecurityScanner.exec.js.map +1 -1
  65. package/dist/src/security/scanner/SecurityScanner.formatters.d.ts +14 -1
  66. package/dist/src/security/scanner/SecurityScanner.formatters.d.ts.map +1 -1
  67. package/dist/src/security/scanner/SecurityScanner.formatters.js +33 -0
  68. package/dist/src/security/scanner/SecurityScanner.formatters.js.map +1 -1
  69. package/dist/src/security/scanner/SecurityScanner.formatters.test.d.ts +9 -0
  70. package/dist/src/security/scanner/SecurityScanner.formatters.test.d.ts.map +1 -0
  71. package/dist/src/security/scanner/SecurityScanner.formatters.test.js +65 -0
  72. package/dist/src/security/scanner/SecurityScanner.formatters.test.js.map +1 -0
  73. package/dist/src/security/scanner/SecurityScanner.helpers.d.ts.map +1 -1
  74. package/dist/src/security/scanner/SecurityScanner.helpers.js +15 -1
  75. package/dist/src/security/scanner/SecurityScanner.helpers.js.map +1 -1
  76. package/dist/src/security/scanner/confusables.d.ts +28 -0
  77. package/dist/src/security/scanner/confusables.d.ts.map +1 -0
  78. package/dist/src/security/scanner/confusables.js +87 -0
  79. package/dist/src/security/scanner/confusables.js.map +1 -0
  80. package/dist/src/security/scanner/confusables.test.d.ts +10 -0
  81. package/dist/src/security/scanner/confusables.test.d.ts.map +1 -0
  82. package/dist/src/security/scanner/confusables.test.js +44 -0
  83. package/dist/src/security/scanner/confusables.test.js.map +1 -0
  84. package/dist/src/security/scanner/index.d.ts +7 -1
  85. package/dist/src/security/scanner/index.d.ts.map +1 -1
  86. package/dist/src/security/scanner/index.js +13 -0
  87. package/dist/src/security/scanner/index.js.map +1 -1
  88. package/dist/src/security/scanner/types.d.ts +14 -1
  89. package/dist/src/security/scanner/types.d.ts.map +1 -1
  90. package/dist/src/security/scanner/typosquat-reference-list.d.ts +54 -0
  91. package/dist/src/security/scanner/typosquat-reference-list.d.ts.map +1 -0
  92. package/dist/src/security/scanner/typosquat-reference-list.js +55 -0
  93. package/dist/src/security/scanner/typosquat-reference-list.js.map +1 -0
  94. package/dist/src/security/scanner/typosquat-reference-list.test.d.ts +5 -0
  95. package/dist/src/security/scanner/typosquat-reference-list.test.d.ts.map +1 -0
  96. package/dist/src/security/scanner/typosquat-reference-list.test.js +52 -0
  97. package/dist/src/security/scanner/typosquat-reference-list.test.js.map +1 -0
  98. package/dist/src/security/scanner/typosquat.d.ts +100 -0
  99. package/dist/src/security/scanner/typosquat.d.ts.map +1 -0
  100. package/dist/src/security/scanner/typosquat.js +256 -0
  101. package/dist/src/security/scanner/typosquat.js.map +1 -0
  102. package/dist/src/security/scanner/typosquat.test.d.ts +12 -0
  103. package/dist/src/security/scanner/typosquat.test.d.ts.map +1 -0
  104. package/dist/src/security/scanner/typosquat.test.js +140 -0
  105. package/dist/src/security/scanner/typosquat.test.js.map +1 -0
  106. package/dist/src/security/scanner/weights.d.ts.map +1 -1
  107. package/dist/src/security/scanner/weights.js +10 -0
  108. package/dist/src/security/scanner/weights.js.map +1 -1
  109. package/dist/src/services/skill-installation.helpers.d.ts +21 -0
  110. package/dist/src/services/skill-installation.helpers.d.ts.map +1 -1
  111. package/dist/src/services/skill-installation.helpers.js +46 -2
  112. package/dist/src/services/skill-installation.helpers.js.map +1 -1
  113. package/dist/src/services/skill-installation.helpers.test.d.ts +2 -0
  114. package/dist/src/services/skill-installation.helpers.test.d.ts.map +1 -0
  115. package/dist/src/services/skill-installation.helpers.test.js +80 -0
  116. package/dist/src/services/skill-installation.helpers.test.js.map +1 -0
  117. package/dist/src/sync/inventory-collector.d.ts +15 -4
  118. package/dist/src/sync/inventory-collector.d.ts.map +1 -1
  119. package/dist/src/sync/inventory-collector.js +73 -24
  120. package/dist/src/sync/inventory-collector.js.map +1 -1
  121. package/dist/src/sync/inventory-collector.test.d.ts +15 -1
  122. package/dist/src/sync/inventory-collector.test.d.ts.map +1 -1
  123. package/dist/src/sync/inventory-collector.test.js +75 -5
  124. package/dist/src/sync/inventory-collector.test.js.map +1 -1
  125. package/dist/src/telemetry/tracer-imports.d.ts +1 -1
  126. package/dist/src/telemetry/tracer-imports.js +1 -1
  127. package/dist/src/telemetry/tracer.js +1 -1
  128. package/dist/tests/SecurityScanner.scoring.test.js +60 -0
  129. package/dist/tests/SecurityScanner.scoring.test.js.map +1 -1
  130. package/dist/tests/SwarmIndexer.test.js +4 -5
  131. package/dist/tests/SwarmIndexer.test.js.map +1 -1
  132. package/dist/tests/security/scanner-regression-guard.test.js +1 -0
  133. package/dist/tests/security/scanner-regression-guard.test.js.map +1 -1
  134. package/dist/tests/services/aidefence-feedback.test.js +1 -0
  135. package/dist/tests/services/aidefence-feedback.test.js.map +1 -1
  136. package/dist/tests/skill-scanner/allowlist.test.js +8 -1
  137. package/dist/tests/skill-scanner/allowlist.test.js.map +1 -1
  138. package/package.json +13 -8
package/CHANGELOG.md CHANGED
@@ -4,6 +4,26 @@ All notable changes to `@skillsmith/core` are documented here.
4
4
 
5
5
  ## [Unreleased]
6
6
 
7
+ ## v0.11.3
8
+
9
+ - **Chore**: Migrate remaining stale references to ruflo v3 (#1952)
10
+ - **Chore**: bump the opentelemetry group across 1 directory with 8 updates (#1862)
11
+ - **Fix**: doc-comments in `telemetry/tracer.ts`/`tracer-imports.ts` referencing the optional enterprise instrumentation dependency now name the real package, `@smith-horn/enterprise` (SMI-5738; no behavior change here, see `@skillsmith/mcp-server`/`@skillsmith/cli` for the actual runtime import fix)
12
+ - **Feature**: new `@skillsmith/core/security/scanner` export subpath, exposing `stripInvisible`/`confusableSkeleton`/`CONFUSABLES` for reuse outside the package (SMI-4703) — enables `@skillsmith/doc-retrieval-mcp`'s memory-write injection scanner to reuse the same confusable/homoglyph normalization primitives `SecurityScanner.exec.ts` uses, instead of reimplementing them
13
+ - **Feature**: new `getOrCreateInstallId()` in `config/device-identity.ts` — a stable per-install telemetry identifier (`sha256(randomUUID())`), generated and persisted unconditionally regardless of legacy telemetry env-gating (SMI-5531)
14
+ - **Fix**: `saveConfig` (`config/index.ts`) is now atomic — its read-modify-write runs under a new cross-process exclusive lock (`config/config-atomic-write.ts`) and writes via temp-file-then-rename, closing a lost-update race where two concurrent writers could silently drop each other's change. This also fixes a pre-existing, independent TOCTOU race in `getOrCreateDeviceId` that shared the same unguarded writer (SMI-5531)
15
+ - **Feature**: typosquat/impersonation detector for skill names (Wave 1) — exact-confusable-skeleton match, Levenshtein edit-distance ≤2, and an independent authority-claiming-affix check (`-official`/`-verified`/`-authentic`/`-genuine`); wired into `SecurityFindingType`/`RiskScoreBreakdown`/`CATEGORY_WEIGHTS`/`calculateRiskScore` as a new `typosquat` category, plus a `typosquatEnforcementMode` (`'off' | 'warn' | 'block'`, default `'warn'`) that caps findings at `medium` severity in shadow mode. `confusableSkeleton`/`CONFUSABLES`/`isFullwidthLatin`/`isMathAlphanumeric` extracted from `SecurityScanner.exec.ts` into a standalone `confusables.ts` (no behavior change). Live wiring into the install-time scan pipeline and the `skill_audit` MCP tool (SMI-5711) are follow-ups (SMI-595)
16
+ - **Fix**: `collectDeviceSkills()` no longer collapses a symlinked skill alias across harnesses into a single inventory row — realpath now only memoizes the expensive SKILL.md read/parse/hash (never the directory-name-derived `skill_id` fallback, which is computed per-harness to avoid one harness's directory name leaking onto another's row) and only collapses multiple aliases to the same target WITHIN one harness's own directory, while an entry is still emitted for every harness that observes the skill (SMI-5717) (GH #1912)
17
+ - **Feature**: `grok` (Grok Build, xAI's coding CLI) added as a scanned harness for cross-machine skill inventory — `CLIENT_NATIVE_PATHS`/`CLIENT_IDS` in `install/paths.ts` now include `~/.grok/skills` (SMI-5697)
18
+ - **Fix**: `extractMcpReferences` now parses frontmatter `allowed-tools`/`tools` YAML (bare-server, wildcard, and full forms), detects embedded `mcpServers` JSON-registration blocks, and cross-checks every candidate server name against the project's `.mcp.json` via a new `serverResolutions` map (`registered`/`unregistered`/`unknown`) — candidates are tagged, never excluded (SMI-5676)
19
+ - **Fix**: `extractDepIntel`/`persistDependencies` pass the project's registered MCP server list via the new `getRegisteredMcpServers()` export, which fails open (not to an empty list) when `.mcp.json` is missing or unparseable
20
+ - Exported `getBestDriver`/`DriverType` from the package root, and added a `compliance_export` `AuditEventType` (SMI-3140)
21
+
22
+ ## v0.11.2
23
+
24
+ - **Fix**: Expose apply_namespace_rename action:'revert'
25
+ - **Fix**: Widen `JournalAction` to include `'revert'` and bump `JOURNAL_SCHEMA_VERSION` 1→2 — an older reader's closed-set validation would otherwise flag a legitimate revert journal record as corrupt (SMI-5671) (#1878)
26
+
7
27
  ## v0.11.1
8
28
 
9
29
  - **Fix**: unified shutdown coordinator + awaitable sync stop (SMI-5649/SMI-5640) (#1826)
package/README.md CHANGED
@@ -4,19 +4,18 @@ Core library for Skillsmith - provides database operations, search services, cac
4
4
 
5
5
  ## Contents
6
6
 
7
- - [What's New](#whats-new-in-v0100)
7
+ - [What's New](#whats-new-in-v0112)
8
8
  - [Installation](#installation)
9
9
  - [Quick Start](#quick-start)
10
10
  - [Features](#features)
11
11
  - [Exports](#exports)
12
12
 
13
- ## What's New in v0.10.0
13
+ ## What's New in v0.11.2
14
14
 
15
- - **Cross-harness agent-pack generation**: Multi-target agent-pack generator, installer, and uninstaller emitting `SKILL.md` plus Claude Code, Codex, OpenCode, and Copilot shims and hooks, with manifest tracking and path-guarded uninstall.
16
- - **Change journal**: Hash-chained, fsync'd change-journal module the foundation for the session-scoped undo now surfaced by `@skillsmith/mcp-server`'s `undo_apply` tool.
17
- - **Cross-harness skill inventory**: Data-plane and write-path support for auditing and syncing skill inventories across multiple agent harnesses, plus a local CLI/MCP push agent.
18
- - **Quarantine hardening**: Split scanner architecture with chmod-evasion detection and sibling re-scan on quarantine recheck.
19
- - **Per-user inventory purge**: New hard-delete path for removing a user's full skill inventory.
15
+ - **Cross-session rename revert**: `apply_namespace_rename`'s `action: 'revert'` is now exposed, and `JournalAction`/`JOURNAL_SCHEMA_VERSION` are widened so an older reader no longer flags a legitimate revert journal record as corrupt.
16
+ - **Unified shutdown coordinator**: Awaitable sync stop consolidates shutdown handling across the database and background writers.
17
+ - **Production-grade error logging and diagnostics**: Structured error logging and diagnostics for easier triage in production.
18
+ - **Dependency backfill**: `skill_dependencies` now backfills correctly for installs that predate v0.7.1.
20
19
 
21
20
  See [CHANGELOG.md](./CHANGELOG.md) for previous releases.
22
21