@r_masseater/msch 0.126.1 → 0.127.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/dist/cli.mjs
CHANGED
|
@@ -49,7 +49,7 @@ import { Buffer } from "node:buffer";
|
|
|
49
49
|
import { createZstdDecompress } from "node:zlib";
|
|
50
50
|
// package.json
|
|
51
51
|
var name = "@r_masseater/msch";
|
|
52
|
-
var version = "0.
|
|
52
|
+
var version = "0.127.1";
|
|
53
53
|
var homepage = "https://github.com/masseater/ecosystems/tree/main/libs/msch#readme";
|
|
54
54
|
var repository = {
|
|
55
55
|
"type": "git",
|
|
@@ -16416,7 +16416,7 @@ const PLUGIN_HOOKS = /(?:^|\/)hooks\/hooks\.json$/u;
|
|
|
16416
16416
|
const PLUGIN_ROOT = /\$\{CLAUDE_PLUGIN_ROOT\}/gu;
|
|
16417
16417
|
const READ_CONCURRENCY$17 = 64;
|
|
16418
16418
|
const RULE$36 = "shell-script";
|
|
16419
|
-
const MESSAGE$9 = "is a shell script. Do the work in TypeScript as a Vite+ task in vite.config.ts, a test, or the tool's own hook, and delete this file. Only a SessionStart hook in .claude/settings.json
|
|
16419
|
+
const MESSAGE$9 = "is a shell script. Do the work in TypeScript as a Vite+ task in vite.config.ts, a test, or the tool's own hook, and delete this file. Only a SessionStart hook in .claude/settings.json, which installs the toolchain, and a script that a plugin's hooks/hooks.json runs to provide the plugin's dependencies before its TypeScript can load stay shell scripts.";
|
|
16420
16420
|
const HookSchema = Schema.Struct({
|
|
16421
16421
|
command: Schema.optional(Schema.String),
|
|
16422
16422
|
args: Schema.String.pipe(Schema.Array, Schema.optional)
|
|
@@ -16425,6 +16425,8 @@ const MatcherSchema = Schema.Struct({ hooks: Schema.Array(HookSchema) });
|
|
|
16425
16425
|
const HooksSchema = Schema.Struct({ SessionStart: MatcherSchema.pipe(Schema.Array, Schema.optional) });
|
|
16426
16426
|
const SettingsSchema = Schema.Struct({ hooks: Schema.optional(HooksSchema) });
|
|
16427
16427
|
const decodeSettings = Schema.decodeOption(Schema.fromJsonString(SettingsSchema));
|
|
16428
|
+
const PluginHooksSchema = Schema.Struct({ hooks: Schema.Record(Schema.String, Schema.Array(MatcherSchema)) });
|
|
16429
|
+
const decodePluginHooks = Schema.decodeOption(Schema.fromJsonString(PluginHooksSchema));
|
|
16428
16430
|
const NO_TEXT = [];
|
|
16429
16431
|
const commandText = ({ command, args }) => [...Option.toArray(Option.fromUndefinedOr(command)), ...pipe(Option.fromUndefinedOr(args), Option.getOrElse(() => NO_TEXT))];
|
|
16430
16432
|
const matcherText = ({ hooks }) => pipe(hooks, Array$1.flatMap((hook) => commandText(hook)));
|
|
@@ -16433,9 +16435,10 @@ const sessionStartCommands = (source) => {
|
|
|
16433
16435
|
return pipe(matchers, Option.map(Array$1.flatMap((matcher) => matcherText(matcher))), Option.getOrElse(() => NO_TEXT));
|
|
16434
16436
|
};
|
|
16435
16437
|
const pluginRootOf = (hooksFile) => String$1.replace(PLUGIN_HOOKS, "")(hooksFile);
|
|
16438
|
+
const everyHookCommand = (source) => pipe(decodePluginHooks(source), Option.map(({ hooks }) => pipe(Record.values(hooks), Array$1.flatten, Array$1.flatMap((matcher) => matcherText(matcher)))), Option.getOrElse(() => NO_TEXT));
|
|
16436
16439
|
const pluginCommands = (hooksFile, source) => {
|
|
16437
16440
|
const root = pluginRootOf(hooksFile);
|
|
16438
|
-
return pipe(
|
|
16441
|
+
return pipe(everyHookCommand(source), Array$1.map((text) => String$1.replaceAll(PLUGIN_ROOT, root)(text)), Array$1.map((text) => String$1.replace(/^\//u, "")(text)));
|
|
16439
16442
|
};
|
|
16440
16443
|
const hasExtension = (name) => EXTENSION$1.test(baseName$1(name));
|
|
16441
16444
|
const pluginSessionStarts = Effect.fn("pluginSessionStarts")(function* pluginSessionStarts(root, names) {
|