@klhapp/skillmux 1.0.0 → 1.0.1

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 CHANGED
@@ -5,6 +5,15 @@ All notable changes to this project are documented in this file.
5
5
  The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
6
6
  and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
7
7
 
8
+ ## [1.0.1](https://github.com/klhq/skillmux/compare/v1.0.0...v1.0.1) (2026-07-24)
9
+
10
+
11
+ ### Changed
12
+
13
+ * **cli:** centralize output envelopes ([#77](https://github.com/klhq/skillmux/issues/77)) ([d457b6b](https://github.com/klhq/skillmux/commit/d457b6b24322efe0eda896ebb76cfd8dc9985819))
14
+ * **cli:** split command modules ([#75](https://github.com/klhq/skillmux/issues/75)) ([b1c2e8b](https://github.com/klhq/skillmux/commit/b1c2e8bf69e0a12c95960729eda581468c9c0646))
15
+ * **config:** extract TOML config-mutation module and share watcher test-utils ([#80](https://github.com/klhq/skillmux/issues/80)) ([d084bd6](https://github.com/klhq/skillmux/commit/d084bd6a56a5985dc92b7362171a0e62e9875926))
16
+
8
17
  ## [1.0.0](https://github.com/klhq/skillmux/compare/v0.6.0...v1.0.0) (2026-07-24)
9
18
 
10
19
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@klhapp/skillmux",
3
- "version": "1.0.0",
3
+ "version": "1.0.1",
4
4
  "description": "Local read-only MCP server routing natural-language task queries to skills in a SKILL.md vault, with zero-loss delivery",
5
5
  "type": "module",
6
6
  "private": false,
package/src/calibrate.ts CHANGED
@@ -732,66 +732,14 @@ export async function applyCalibrationRun(
732
732
  // --- Atomic TOML write ---
733
733
  const { match_score, match_margin, candidate_floor } = run.selected_thresholds;
734
734
 
735
- const existing = await Bun.file(tomlPath).text();
736
- const patched = patchToml(existing, runId, match_score, match_margin, candidate_floor);
737
-
738
- // Write to a temp file then rename for atomicity
739
- const tmpPath = `${tomlPath}.${process.pid}.tmp`;
740
- await Bun.write(tmpPath, patched);
741
- const { renameSync } = await import("node:fs");
742
- renameSync(tmpPath, tomlPath);
735
+ const { patchTomlFile } = await import("./config-mutation");
736
+ await patchTomlFile(tomlPath, {
737
+ matchScore: match_score,
738
+ matchMargin: match_margin,
739
+ candidateFloor: candidate_floor,
740
+ runId,
741
+ });
743
742
  }
744
743
 
745
- // ---------------------------------------------------------------------------
746
- // TOML patch helpers (surgical text manipulation)
747
- // ---------------------------------------------------------------------------
748
-
749
- /**
750
- * Patch an existing TOML string to set [inference.thresholds] values and
751
- * add/update [inference.calibration] with run_id.
752
- *
753
- * Strategy:
754
- * 1. Replace any existing [inference.thresholds] section content
755
- * 2. Add/replace [inference.calibration] section
756
- */
757
- function patchToml(
758
- source: string,
759
- runId: string,
760
- matchScore: number,
761
- matchMargin: number,
762
- candidateFloor: number,
763
- ): string {
764
- const thresholdsBlock = `[inference.thresholds]\nmatch_score = ${matchScore}\nmatch_margin = ${matchMargin}\ncandidate_floor = ${candidateFloor}\n`;
765
- const calibrationBlock = `[inference.calibration]\nrun_id = "${runId}"\n`;
766
-
767
- // Remove existing [inference.thresholds] section
768
- let result = removeSectionBlock(source, "[inference.thresholds]");
769
- // Remove existing [inference.calibration] section
770
- result = removeSectionBlock(result, "[inference.calibration]");
771
- // Append both sections
772
- result = result.trimEnd() + "\n\n" + thresholdsBlock + "\n" + calibrationBlock;
773
- return result;
774
- }
775
-
776
- /**
777
- * Remove a TOML section header and all lines until the next section header
778
- * (or end of file). Matches exact header string at start of line.
779
- */
780
- function removeSectionBlock(source: string, header: string): string {
781
- const lines = source.split("\n");
782
- const out: string[] = [];
783
- let skipping = false;
784
- for (const line of lines) {
785
- if (line.trimEnd() === header) {
786
- skipping = true;
787
- continue;
788
- }
789
- if (skipping && line.startsWith("[")) {
790
- skipping = false;
791
- }
792
- if (!skipping) out.push(line);
793
- }
794
- return out.join("\n");
795
- }
796
744
 
797
745