skillrepo 3.1.0 → 3.1.2
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 +6 -2
- package/package.json +1 -1
- package/src/commands/init-session-sync.mjs +307 -0
- package/src/commands/init.mjs +111 -101
- package/src/commands/session-sync-actions.mjs +92 -0
- package/src/lib/artifact-registry.mjs +43 -3
- package/src/lib/binary-locator.mjs +99 -0
- package/src/lib/cli-config.mjs +16 -3
- package/src/lib/cli-version.mjs +56 -0
- package/src/lib/config.mjs +6 -3
- package/src/lib/file-write.mjs +8 -3
- package/src/lib/fs-utils.mjs +9 -10
- package/src/lib/global-install.mjs +387 -0
- package/src/lib/mcp-merge.mjs +16 -5
- package/src/lib/mergers/session-hook.mjs +125 -33
- package/src/lib/platform.mjs +124 -0
- package/src/lib/sync.mjs +26 -0
- package/src/lib/transient-runners.mjs +204 -0
- package/src/test/commands/add.test.mjs +10 -4
- package/src/test/commands/get.test.mjs +10 -4
- package/src/test/commands/init.test.mjs +889 -15
- package/src/test/commands/list.test.mjs +10 -4
- package/src/test/commands/remove.test.mjs +10 -4
- package/src/test/commands/search.test.mjs +10 -4
- package/src/test/commands/session-sync-actions.test.mjs +74 -0
- package/src/test/commands/session-sync.test.mjs +25 -23
- package/src/test/commands/uninstall.test.mjs +20 -14
- package/src/test/commands/update.test.mjs +10 -4
- package/src/test/helpers/mock-spawn.mjs +121 -0
- package/src/test/helpers/sandbox-home.mjs +161 -0
- package/src/test/helpers/skillrepo-shim.mjs +133 -0
- package/src/test/integration/file-write.integration.test.mjs +10 -4
- package/src/test/lib/cli-config.test.mjs +182 -4
- package/src/test/lib/cli-version.test.mjs +47 -0
- package/src/test/lib/config.test.mjs +10 -4
- package/src/test/lib/file-write.test.mjs +24 -10
- package/src/test/lib/global-install.test.mjs +424 -0
- package/src/test/lib/mcp-merge.test.mjs +13 -7
- package/src/test/lib/paths.test.mjs +10 -4
- package/src/test/lib/platform.test.mjs +135 -0
- package/src/test/lib/sync.test.mjs +20 -4
- package/src/test/lib/transient-runners.test.mjs +270 -0
- package/src/test/mergers/session-hook.test.mjs +722 -22
- package/src/test/mergers/uninstall-settings.test.mjs +12 -1
- package/src/test/mergers/uninstall-windsurf-mcp.test.mjs +10 -4
|
@@ -270,9 +270,20 @@ describe("removeSettingsSessionHook", () => {
|
|
|
270
270
|
// refactor ever moves the fingerprint elsewhere or drops it,
|
|
271
271
|
// this import breaks loudly and the architect tightening #3
|
|
272
272
|
// (bidirectional registry/merger mapping) fails at import time.
|
|
273
|
+
//
|
|
274
|
+
// The fingerprint is deliberately platform-neutral — before
|
|
275
|
+
// v3.1.1 it contained `skillrepo`, but Windows `.cmd` shim
|
|
276
|
+
// paths broke the substring match. The current value is
|
|
277
|
+
// `update --session-hook` which appears in BOTH POSIX and
|
|
278
|
+
// Windows hook command shapes.
|
|
273
279
|
assert.equal(typeof SESSION_HOOK_FINGERPRINT, "string");
|
|
274
280
|
assert.ok(SESSION_HOOK_FINGERPRINT.length > 0);
|
|
275
|
-
assert.match(
|
|
281
|
+
assert.match(
|
|
282
|
+
SESSION_HOOK_FINGERPRINT,
|
|
283
|
+
/--session-hook/,
|
|
284
|
+
"fingerprint must contain the --session-hook flag — that's what makes " +
|
|
285
|
+
"it specific to SkillRepo's installed hook and not a random user hook",
|
|
286
|
+
);
|
|
276
287
|
});
|
|
277
288
|
|
|
278
289
|
it("returns a structured error on unparseable JSON", () => {
|
|
@@ -23,15 +23,21 @@ import { join } from "node:path";
|
|
|
23
23
|
import { tmpdir } from "node:os";
|
|
24
24
|
|
|
25
25
|
import { removeWindsurfMcp } from "../../lib/removers/windsurf-mcp.mjs";
|
|
26
|
+
import {
|
|
27
|
+
captureHome,
|
|
28
|
+
setSandboxHome,
|
|
29
|
+
restoreHome,
|
|
30
|
+
} from "../helpers/sandbox-home.mjs";
|
|
26
31
|
|
|
27
32
|
let sandbox;
|
|
28
|
-
|
|
33
|
+
/** @type {import("../helpers/sandbox-home.mjs").HomeEnvSnapshot} */
|
|
34
|
+
let originalHomeEnv;
|
|
29
35
|
let mcpConfigPath;
|
|
30
36
|
|
|
31
37
|
function setup() {
|
|
32
38
|
sandbox = mkdtempSync(join(tmpdir(), "cli-unrm-windsurf-"));
|
|
33
|
-
|
|
34
|
-
|
|
39
|
+
originalHomeEnv = captureHome();
|
|
40
|
+
setSandboxHome(sandbox);
|
|
35
41
|
// Sanity guard: asserting the override worked BEFORE any remover
|
|
36
42
|
// runs is cheap insurance against forgetting to restore HOME in a
|
|
37
43
|
// previous test's teardown or a parallel test cross-contamination.
|
|
@@ -44,7 +50,7 @@ function setup() {
|
|
|
44
50
|
}
|
|
45
51
|
|
|
46
52
|
function teardown() {
|
|
47
|
-
|
|
53
|
+
restoreHome(originalHomeEnv);
|
|
48
54
|
if (sandbox) rmSync(sandbox, { recursive: true, force: true });
|
|
49
55
|
}
|
|
50
56
|
|