@r_masseater/msch 0.94.0 → 0.95.0
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 +1 -1
- package/dist/{base-revision-C9RxuIMK.mjs → base-revision-uiUwYlbc.mjs} +2 -2
- package/dist/{base-revision-C9RxuIMK.mjs.map → base-revision-uiUwYlbc.mjs.map} +1 -1
- package/dist/cargo-inputs.mjs +2 -2
- package/dist/changed.mjs +5 -5
- package/dist/cli.mjs +496 -382
- package/dist/cli.mjs.map +1 -1
- package/dist/collections-CdEHfcEj.mjs +6 -0
- package/dist/collections-CdEHfcEj.mjs.map +1 -0
- package/dist/config-BBdsNPSO.mjs.map +1 -1
- package/dist/config.mjs +1 -1
- package/dist/decision-rules.mjs +1 -1
- package/dist/{define-lint-preset-GWsBHDRn.mjs → define-lint-preset-BjHY5WNt.mjs} +57 -38
- package/dist/define-lint-preset-BjHY5WNt.mjs.map +1 -0
- package/dist/exits.mjs +4 -4
- package/dist/{ignored-directories-Ce-45yzO.mjs → ignored-directories-BRRODOoG.mjs} +2 -2
- package/dist/{ignored-directories-Ce-45yzO.mjs.map → ignored-directories-BRRODOoG.mjs.map} +1 -1
- package/dist/index-skill-Bf5Ish11.mjs +19 -0
- package/dist/index-skill-Bf5Ish11.mjs.map +1 -0
- package/dist/judge.mjs +4 -4
- package/dist/lint.mjs +1 -1
- package/dist/{lookup-report-DVJg0K4Z.mjs → lookup-report-BWiDFlSS.mjs} +3 -3
- package/dist/{lookup-report-DVJg0K4Z.mjs.map → lookup-report-BWiDFlSS.mjs.map} +1 -1
- package/dist/{manifest-texts-B69vIp7o.mjs → manifest-texts-Bhlz2Z2_.mjs} +2 -2
- package/dist/{manifest-texts-B69vIp7o.mjs.map → manifest-texts-Bhlz2Z2_.mjs.map} +1 -1
- package/dist/{output-B_YPmKad.mjs → output-B4GNchqH.mjs} +3 -3
- package/dist/{output-B_YPmKad.mjs.map → output-B4GNchqH.mjs.map} +1 -1
- package/dist/oxlint.mjs +2 -2
- package/dist/package-routes-BdYpOLTv.mjs +73 -0
- package/dist/package-routes-BdYpOLTv.mjs.map +1 -0
- package/dist/{package-versions-PMKDR-bJ.mjs → package-versions-BLtKon6D.mjs} +4 -4
- package/dist/{package-versions-PMKDR-bJ.mjs.map → package-versions-BLtKon6D.mjs.map} +1 -1
- package/dist/{pass-records-CBvMwfN3.mjs → pass-records-ljpQ--tm.mjs} +4 -4
- package/dist/{pass-records-CBvMwfN3.mjs.map → pass-records-ljpQ--tm.mjs.map} +1 -1
- package/dist/{problem-CUIz4TEI.mjs → problem-Bi4Kgg9b.mjs} +2 -2
- package/dist/{problem-CUIz4TEI.mjs.map → problem-Bi4Kgg9b.mjs.map} +1 -1
- package/dist/publish.mjs +23 -87
- package/dist/publish.mjs.map +1 -1
- package/dist/{published-B5LA4ZlS.mjs → published-BGur-Htr.mjs} +9 -5
- package/dist/{published-B5LA4ZlS.mjs.map → published-BGur-Htr.mjs.map} +1 -1
- package/dist/published.mjs +15 -18
- package/dist/published.mjs.map +1 -1
- package/dist/refs.mjs +7 -7
- package/dist/refs.mjs.map +1 -1
- package/dist/registries-DePiYd3D.mjs +11 -0
- package/dist/registries-DePiYd3D.mjs.map +1 -0
- package/dist/{registry-releases-Dj6jH8Yt.mjs → registry-releases-CaO-8xAO.mjs} +3 -3
- package/dist/registry-releases-CaO-8xAO.mjs.map +1 -0
- package/dist/{repository-files-B6PEvKWe.mjs → repository-files-hbJpQ1i0.mjs} +9 -5
- package/dist/repository-files-hbJpQ1i0.mjs.map +1 -0
- package/dist/{runtime-C8OGDSk9.mjs → runtime-BdEuIL6Z.mjs} +2 -2
- package/dist/{runtime-C8OGDSk9.mjs.map → runtime-BdEuIL6Z.mjs.map} +1 -1
- package/dist/unbumped.mjs +5 -5
- package/dist/{upstream-exits-nTTh2qcD.mjs → upstream-exits-BC8ofnVa.mjs} +7 -7
- package/dist/{upstream-exits-nTTh2qcD.mjs.map → upstream-exits-BC8ofnVa.mjs.map} +1 -1
- package/dist/{upstream-record-DlluH3fY.mjs → upstream-record-I5ZgAwk-.mjs} +3 -2
- package/dist/{upstream-record-DlluH3fY.mjs.map → upstream-record-I5ZgAwk-.mjs.map} +1 -1
- package/dist/upstream.mjs +7 -8
- package/dist/upstream.mjs.map +1 -1
- package/dist/{workspace-projects-B-vCr6bx.mjs → workspace-projects-DnWDM8G1.mjs} +2 -2
- package/dist/{workspace-projects-B-vCr6bx.mjs.map → workspace-projects-DnWDM8G1.mjs.map} +1 -1
- package/dist/workspace-settings.mjs +4 -4
- package/package.json +4 -5
- package/skills/msch-checks/SKILL.md +3 -3
- package/skills/msch-publishing/SKILL.md +4 -4
- package/skills/msch-repository-config/SKILL.md +20 -33
- package/skills/msch-workspace-settings/SKILL.md +1 -0
- package/src/app/vite.d.ts +1 -34
- package/dist/credential-broker-PkIpsaMh.mjs +0 -29
- package/dist/credential-broker-PkIpsaMh.mjs.map +0 -1
- package/dist/define-lint-preset-GWsBHDRn.mjs.map +0 -1
- package/dist/owner-settings-BAh-fFKg.mjs +0 -122
- package/dist/owner-settings-BAh-fFKg.mjs.map +0 -1
- package/dist/package-routes-DQmhjX07.mjs +0 -82
- package/dist/package-routes-DQmhjX07.mjs.map +0 -1
- package/dist/registry-releases-Dj6jH8Yt.mjs.map +0 -1
- package/dist/repository-files-B6PEvKWe.mjs.map +0 -1
- package/dist/wake.d.mts +0 -1
- package/dist/wake.mjs +0 -34
- package/dist/wake.mjs.map +0 -1
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { Option, Order, String, pipe } from "effect";
|
|
2
|
+
Order.mapInput(String.Order, ([key]) => key);
|
|
3
|
+
const groupOf = (name) => (found) => pipe(Option.fromNullishOr(found), Option.flatMap((match) => Option.fromNullishOr(match.groups)), Option.flatMap((groups) => Option.fromNullishOr(groups[name])));
|
|
4
|
+
export { groupOf as t };
|
|
5
|
+
|
|
6
|
+
//# sourceMappingURL=collections-CdEHfcEj.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"collections-CdEHfcEj.mjs","names":["Str"],"sources":["../../lint-host/src/shared/lib/collections.ts"],"sourcesContent":["import { Array as Arr, Option, Order, Record as Rec, String as Str, pipe } from \"effect\";\n\nconst byKey = Order.mapInput(Str.Order, ([key]: readonly [string, unknown]) => key);\n\nexport const sortedRecord = <Value>(\n entries: readonly (readonly [string, Value])[],\n): Readonly<Record<string, Value>> => Rec.fromEntries(Arr.sort(entries, byKey));\n\nconst NEXT = 1;\n\nexport interface Grouped<Head, Item> {\n readonly head: Head;\n readonly items: readonly Item[];\n}\n\nexport const groupedUnder =\n <Item, Head>(asHead: (item: Item) => Option.Option<Head>) =>\n (closes: (head: Head, item: Item) => boolean) =>\n (items: readonly Item[]): readonly Grouped<Head, Item>[] =>\n pipe(\n items,\n Arr.flatMap((item, index) =>\n pipe(\n asHead(item),\n Option.map((head): Grouped<Head, Item> => ({\n head,\n items: pipe(\n items,\n Arr.drop(index + NEXT),\n Arr.takeWhile((next) => !closes(head, next)),\n ),\n })),\n Option.toArray,\n ),\n ),\n );\n\nexport const ancestorsBy =\n <Node>(parentOf: (node: Node) => Option.Option<Node>) =>\n (node: Node): readonly Node[] =>\n Arr.unfold(parentOf(node), (current) =>\n pipe(\n current,\n Option.map((found) => [found, parentOf(found)] as const),\n ),\n );\n\nexport const groupOf =\n (name: string) =>\n (found: RegExpMatchArray | null): Option.Option<string> =>\n pipe(\n Option.fromNullishOr(found),\n Option.flatMap((match) => Option.fromNullishOr(match.groups)),\n Option.flatMap((groups) => Option.fromNullishOr(groups[name])),\n );\n"],"mappings":";AAEc,MAAM,SAASA,OAAI,QAAQ,CAAC,SAAqC,GAAG;AA6ClF,MAAa,WACV,UACA,UACC,KACE,OAAO,cAAc,KAAK,GAC1B,OAAO,SAAS,UAAU,OAAO,cAAc,MAAM,MAAM,CAAC,GAC5D,OAAO,SAAS,WAAW,OAAO,cAAc,OAAO,KAAK,CAAC,CAC/D"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"config-BBdsNPSO.mjs","names":[],"sources":["../src/shared/config/index.ts"],"sourcesContent":["export const JAPANESE = /[\\p{Script=Hiragana}\\p{Script=Katakana}\\p{Script=Han}]/u;\n\n/** @msch video.intro */\nexport const VIDEO_INTROS = [\"beats\", \"plain\"] as const;\n\nexport type VideoIntro = (typeof VIDEO_INTROS)[number];\n\nexport const DECISION_MODEL = \"cloudflare/@cf/cloudflare/clef-flash\";\n\nexport const DECISION_TIMEOUT_MS = 50_000;\n"],"mappings":";AAAA,MAAa,WAAW;;AAGxB,MAAa,eAAe,CAAC,SAAS,OAAO;AAI7C,MAAa,iBAAiB;AAE9B,MAAa,sBAAsB"}
|
|
1
|
+
{"version":3,"file":"config-BBdsNPSO.mjs","names":[],"sources":["../src/shared/config/index.ts"],"sourcesContent":["export const JAPANESE = /[\\p{Script=Hiragana}\\p{Script=Katakana}\\p{Script=Han}]/u;\n\n/** @msch video.intro */\nexport const VIDEO_INTROS = [\"beats\", \"plain\"] as const;\n\nexport type VideoIntro = (typeof VIDEO_INTROS)[number];\n\nexport const DECISION_MODEL = \"cloudflare/@cf/cloudflare/clef-flash\";\n\nexport const DECISION_TIMEOUT_MS = 50_000;\n\nexport { RENOVATE_PRESET, SELF_HOMEPAGE, SELF_NAME } from \"./self.ts\";\n"],"mappings":";AAAA,MAAa,WAAW;;AAGxB,MAAa,eAAe,CAAC,SAAS,OAAO;AAI7C,MAAa,iBAAiB;AAE9B,MAAa,sBAAsB"}
|
package/dist/config.mjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { i as structureOf, l as requiredStack, m as generated, n as textlintFilters, p as decisionTestRules, r as textlintPresets, t as markdownOf, u as lint } from "./define-lint-preset-
|
|
1
|
+
import { i as structureOf, l as requiredStack, m as generated, n as textlintFilters, p as decisionTestRules, r as textlintPresets, t as markdownOf, u as lint } from "./define-lint-preset-BjHY5WNt.mjs";
|
|
2
2
|
import { Array, Option, Record, pipe } from "effect";
|
|
3
3
|
import { fileURLToPath } from "node:url";
|
|
4
4
|
import { recommended } from "@r_masseater/fu4/presets";
|
package/dist/decision-rules.mjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export { h as default } from "./define-lint-preset-
|
|
1
|
+
export { h as default } from "./define-lint-preset-BjHY5WNt.mjs";
|
|
@@ -1,6 +1,7 @@
|
|
|
1
|
+
import { r as splitFrontmatter, t as isIndexSkill } from "./index-skill-Bf5Ish11.mjs";
|
|
1
2
|
import { n as DECISION_TIMEOUT_MS, r as JAPANESE, t as DECISION_MODEL } from "./config-BBdsNPSO.mjs";
|
|
2
3
|
import { createRequire, registerHooks } from "node:module";
|
|
3
|
-
import { Array, Option, Predicate, Record, String, Struct, pipe } from "effect";
|
|
4
|
+
import { Array, Option, Order, Predicate, Record, String, Struct, pipe } from "effect";
|
|
4
5
|
import { fileURLToPath } from "node:url";
|
|
5
6
|
import { createDecisionPlugin, defineDecisionRule } from "@r_masseater/oxlint-plugin-decision";
|
|
6
7
|
import tanstackQuery from "@r_masseater/oxlint-typed-rules/tanstack-query";
|
|
@@ -15,6 +16,8 @@ import remotion from "@r_masseater/oxlint-typed-rules/remotion";
|
|
|
15
16
|
import { rustCrate, skill, structure, workspace } from "@r_masseater/wism/presets";
|
|
16
17
|
import presetJa from "@r_masseater/textlint-rule-preset-ja";
|
|
17
18
|
import { recommended } from "@r_masseater/y8/presets";
|
|
19
|
+
import { globSync, readFileSync } from "node:fs";
|
|
20
|
+
import path from "node:path";
|
|
18
21
|
// src/features/define-lint-preset/config/lint-overrides.config.ts
|
|
19
22
|
const LOGPUSH = "Property[key.name=\"logpush\"]:not([value.value=false])";
|
|
20
23
|
const LOGPUSH_MESSAGE = "Worker には logpush: true を付ける。付けないと、その Worker のログが Logpush に流れない";
|
|
@@ -454,10 +457,6 @@ const lint = {
|
|
|
454
457
|
files: ["**/bin/**"],
|
|
455
458
|
rules: { "baseline-js/use-baseline": "off" }
|
|
456
459
|
},
|
|
457
|
-
{
|
|
458
|
-
files: ["**/masseater-utils/src/**"],
|
|
459
|
-
rules: { "msch-lint/main-through-node-main": "off" }
|
|
460
|
-
},
|
|
461
460
|
{
|
|
462
461
|
files: [
|
|
463
462
|
"**/*.test.ts",
|
|
@@ -755,20 +754,37 @@ const textlintPresets = {
|
|
|
755
754
|
const isFilter = (value) => Predicate.isFunction(value);
|
|
756
755
|
const filterIn = (specifier, loaded) => pipe(Option.liftPredicate(loaded, isFilter), Option.getOrThrowWith(() => /* @__PURE__ */ new TypeError(`${specifier} does not export a textlint filter`)));
|
|
757
756
|
const textlintFilters = { comments: filterIn("textlint-filter-rule-comments", createRequire(import.meta.url)("textlint-filter-rule-comments")) };
|
|
757
|
+
// src/features/define-lint-preset/config/index-skill.config.ts
|
|
758
|
+
const SKILL_FILES = [
|
|
759
|
+
".agents/skills/*/SKILL.md",
|
|
760
|
+
".claude/skills/*/SKILL.md",
|
|
761
|
+
"skills/*/SKILL.md",
|
|
762
|
+
"plugins/*/skills/*/SKILL.md"
|
|
763
|
+
];
|
|
764
|
+
const nameOf = ({ fields }) => Option.filter(Option.fromNullishOr(fields["name"]), Predicate.isString);
|
|
765
|
+
const readSource = Option.liftThrowable((file) => readFileSync(file, "utf8"));
|
|
766
|
+
const indexNameAt = (root) => (file) => pipe(readSource(path.join(root, file)), Option.flatMap(splitFrontmatter), Option.filter(isIndexSkill), Option.flatMap(nameOf));
|
|
767
|
+
const indexSkillIn = (root) => pipe(globSync(SKILL_FILES, { cwd: root }), Array.sortBy(Order.String), Array.findFirst(indexNameAt(root)));
|
|
758
768
|
// src/features/define-lint-preset/config/markdown.config.ts
|
|
759
|
-
const
|
|
760
|
-
|
|
761
|
-
|
|
762
|
-
|
|
763
|
-
|
|
764
|
-
|
|
765
|
-
|
|
766
|
-
|
|
767
|
-
|
|
768
|
-
|
|
769
|
-
|
|
770
|
-
|
|
771
|
-
|
|
769
|
+
const skillNamesIn = (root) => Option.match(indexSkillIn(root), {
|
|
770
|
+
onNone: () => ({}),
|
|
771
|
+
onSome: (index) => ({ index })
|
|
772
|
+
});
|
|
773
|
+
const docsIn = (root) => {
|
|
774
|
+
const skillNames = skillNamesIn(root);
|
|
775
|
+
return {
|
|
776
|
+
agents: {
|
|
777
|
+
sections: [
|
|
778
|
+
["Tech stack"],
|
|
779
|
+
["Commands"],
|
|
780
|
+
["Rules"]
|
|
781
|
+
],
|
|
782
|
+
commands: ["Commands"],
|
|
783
|
+
stack: ["Tech stack"],
|
|
784
|
+
skillNames
|
|
785
|
+
},
|
|
786
|
+
skills: { skillNames }
|
|
787
|
+
};
|
|
772
788
|
};
|
|
773
789
|
const MARKDOWN_IGNORES = [
|
|
774
790
|
".agents/skills/**",
|
|
@@ -777,26 +793,29 @@ const MARKDOWN_IGNORES = [
|
|
|
777
793
|
"CHANGELOG.md",
|
|
778
794
|
"**/CLAUDE.md"
|
|
779
795
|
];
|
|
780
|
-
const markdownOf = ({ ignores = [], rules = {}, docs = {} }) =>
|
|
781
|
-
|
|
782
|
-
|
|
783
|
-
|
|
784
|
-
|
|
785
|
-
...
|
|
786
|
-
|
|
796
|
+
const markdownOf = ({ ignores = [], rules = {}, docs = {} }) => {
|
|
797
|
+
const base = docsIn(process.cwd());
|
|
798
|
+
return {
|
|
799
|
+
extends: [recommended({
|
|
800
|
+
...base,
|
|
801
|
+
...docs,
|
|
802
|
+
agents: {
|
|
803
|
+
...base.agents,
|
|
804
|
+
...docs.agents
|
|
805
|
+
},
|
|
806
|
+
skills: {
|
|
807
|
+
...base.skills,
|
|
808
|
+
...docs.skills
|
|
809
|
+
}
|
|
810
|
+
})],
|
|
811
|
+
rules: {
|
|
812
|
+
"agnix/XP-001": "off",
|
|
813
|
+
...rules
|
|
787
814
|
},
|
|
788
|
-
|
|
789
|
-
|
|
790
|
-
|
|
791
|
-
|
|
792
|
-
})],
|
|
793
|
-
rules: {
|
|
794
|
-
"agnix/XP-001": "off",
|
|
795
|
-
...rules
|
|
796
|
-
},
|
|
797
|
-
reportUnusedDirectives: true,
|
|
798
|
-
ignores: [...MARKDOWN_IGNORES, ...ignores]
|
|
799
|
-
});
|
|
815
|
+
reportUnusedDirectives: true,
|
|
816
|
+
ignores: [...MARKDOWN_IGNORES, ...ignores]
|
|
817
|
+
};
|
|
818
|
+
};
|
|
800
819
|
export { cloudflareResourceSyntax as _, videoRules as a, removalPolicySyntax as b, INSTRUMENTATION as c, allRulesOf as d, decisionRules as f, alchemyOverride as g, decision_rules_default as h, structureOf as i, requiredStack as l, generated as m, textlintFilters as n, remotionRules as o, decisionTestRules as p, textlintPresets as r, tracedRules as s, markdownOf as t, lint as u, commandsOverride as v, removalPolicyOverride as y };
|
|
801
820
|
|
|
802
|
-
//# sourceMappingURL=define-lint-preset-
|
|
821
|
+
//# sourceMappingURL=define-lint-preset-BjHY5WNt.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"define-lint-preset-BjHY5WNt.mjs","names":["Rec","Arr","Str","effectPresets","decisionPlugin","shadcn","Str","Arr","Rec","Arr"],"sources":["../src/features/define-lint-preset/config/lint-overrides.config.ts","../src/features/define-lint-preset/config/decision-rules.ts","../src/features/define-lint-preset/config/web-guidance.config.ts","../src/features/define-lint-preset/config/lint.config.ts","../src/features/define-lint-preset/config/test-rules.config.ts","../src/features/define-lint-preset/config/preset.ts","../src/features/define-lint-preset/config/required-stack.config.ts","../src/features/define-lint-preset/config/traced-rules.config.ts","../src/features/define-lint-preset/config/remotion-rules.config.ts","../src/features/define-lint-preset/config/video-rules.config.ts","../src/features/define-lint-preset/config/structure.config.ts","../src/features/define-lint-preset/config/kuromojin.config.ts","../src/features/define-lint-preset/config/textlint-presets.config.ts","../src/features/define-lint-preset/config/textlint-filters.config.ts","../src/features/define-lint-preset/config/index-skill.config.ts","../src/features/define-lint-preset/config/markdown.config.ts"],"sourcesContent":["const LOGPUSH = 'Property[key.name=\"logpush\"]:not([value.value=false])';\nconst LOGPUSH_MESSAGE =\n \"Worker には logpush: true を付ける。付けないと、その Worker のログが Logpush に流れない\";\n\nconst CPU_LIMIT = 'Property[key.name=\"limits\"]:has(Property[key.name=\"cpuMs\"])';\nconst CPU_LIMIT_MESSAGE =\n \"コードを動かす Worker には limits.cpuMs を付け、本番の CPU 時間の最大値をわずかに上回る値にする。付けないと、1 回の暴走が上限の CPU 時間まで請求される\";\n\nconst UNATTRIBUTED_MODEL_CALL =\n \"モデルの呼び出しは AI Gateway を通し、呼び出し元を metadata に載せる。載せないと、費用やエラーを後から呼び出し元で引けない\";\n\nconst UNGATED_MODEL_CALL =\n \"モデルの呼び出しは AI Gateway を通す。通らない呼び出しには日ごとの費用の上限が掛からず、無料枠を超えた分がそのまま請求される\";\n\nconst MODEL_RUN =\n 'CallExpression[callee.property.name=\"run\"]:matches([callee.object.name=\"AI\"], [callee.object.property.name=\"AI\"])';\n\nconst AI_RUN_URL =\n \":matches(Literal[value=/ai.run/], TemplateLiteral:has(TemplateElement[value.raw=/ai.run/]))\";\n\nconst AI_RUN_REQUEST = `CallExpression:has(> ${AI_RUN_URL})`;\n\nexport const cloudflareResourceSyntax: readonly Readonly<{ selector: string; message: string }>[] =\n [\n {\n selector: `CallExpression[callee.object.name=\"Workers\"][callee.property.name=\"Worker\"] > ObjectExpression.arguments:not(:has(${LOGPUSH}))`,\n message: LOGPUSH_MESSAGE,\n },\n {\n selector: `CallExpression[callee.object.name=\"Website\"] > ObjectExpression.arguments:not(:has(${LOGPUSH}))`,\n message: LOGPUSH_MESSAGE,\n },\n {\n selector: `CallExpression[callee.object.name=/^(Workers|Website)$/] > ObjectExpression.arguments:has(Property[key.name=\"main\"]):not(:has(${CPU_LIMIT}))`,\n message: CPU_LIMIT_MESSAGE,\n },\n {\n selector: `CallExpression[callee.object.name=\"Website\"]:not([callee.property.name=\"StaticSite\"]) > ObjectExpression.arguments:not(:has(${CPU_LIMIT}))`,\n message: CPU_LIMIT_MESSAGE,\n },\n {\n selector: `${MODEL_RUN}[arguments.length<3]`,\n message: UNATTRIBUTED_MODEL_CALL,\n },\n {\n selector: `${MODEL_RUN} > .arguments:nth-child(3):not(Identifier[name=\"options\"])`,\n message: `${UNGATED_MODEL_CALL}。AI.run の第 3 引数には、runWorkersAi の call が受け取る options をそのまま渡す`,\n },\n {\n selector: `${AI_RUN_REQUEST} > ObjectExpression.arguments:not(:has(Property[key.name=\"headers\"]))`,\n message: `${UNGATED_MODEL_CALL}。REST の /ai/run を呼ぶときは、headers に cf-aig-gateway-id を付ける`,\n },\n {\n selector: `${AI_RUN_REQUEST} > ObjectExpression.arguments > Property[key.name=\"headers\"] > ObjectExpression:not(:has(Property[key.value=\"cf-aig-gateway-id\"]))`,\n message: `${UNGATED_MODEL_CALL}。REST の /ai/run を呼ぶときは、headers に cf-aig-gateway-id を付ける`,\n },\n {\n selector:\n 'CallExpression[callee.name=\"runWorkersAi\"] > ObjectExpression > Property[key.name=\"call\"] > ArrowFunctionExpression[params.length=0]',\n message: UNATTRIBUTED_MODEL_CALL,\n },\n {\n selector:\n 'CallExpression[callee.name=\"createAI\"] > ObjectExpression.arguments:not(:has(Property[key.name=\"metadata\"]))',\n message: UNATTRIBUTED_MODEL_CALL,\n },\n {\n selector:\n 'ObjectExpression:has(Property[key.value=\"cf-aig-gateway-id\"]):not(:has(Property[key.value=\"cf-aig-metadata\"]))',\n message: UNATTRIBUTED_MODEL_CALL,\n },\n {\n selector:\n 'CallExpression[callee.object.name=\"AI\"][callee.property.name=\"Gateway\"] > ObjectExpression.arguments:not(:has(Property[key.name=\"collectLogs\"][value.value=true]))',\n message:\n \"AI Gateway には collectLogs: true を付ける。付けないと、モデルの呼び出しが後から引けない\",\n },\n {\n selector:\n 'CallExpression[callee.object.name=\"AI\"][callee.property.name=\"Gateway\"] > ObjectExpression.arguments:not(:has(Property[key.name=\"spendLimits\"] > ObjectExpression > Property[key.name=\"enabled\"][value.value=true]))',\n message:\n \"AI Gateway には spendLimits を enabled: true で付け、日ごとの費用の上限を掛ける。付けないと、従量課金のモデルの呼び出しが上限なく請求される\",\n },\n {\n selector:\n 'CallExpression[callee.object.name=\"AI\"][callee.property.name=\"Gateway\"] > ObjectExpression.arguments:not(:has(Property[key.name=\"cacheTtl\"]))',\n message:\n \"AI Gateway には cacheTtl を付け、同じ問いの答えをキャッシュする。付けないと、同じ問いにも毎回課金される\",\n },\n {\n selector: 'MemberExpression[object.name=\"Rum\"][property.name=\"Site\"]',\n message:\n \"Rum.Site は使わない。CI のトークンに Account Settings Write が要る。Cloudflare API でホストごとに一度サイトを作り、トークンを CF_BEACON_TOKEN に置く\",\n },\n ];\nexport const removalPolicySyntax: Readonly<{ selector: string; message: string }> = {\n selector:\n 'CallExpression[callee.object.name=/^(D1|R2)$/][callee.property.name=/^(Database|Bucket)$/]:not(CallExpression[callee.property.name=\"pipe\"][arguments.0.callee.object.name=\"RemovalPolicy\"] > MemberExpression.callee > CallExpression.object)',\n message:\n \"D1 と R2 は作り直すと中身が消えるので、alchemy の RemovalPolicy.protect() を .pipe で付けて置き換えと削除を止める\",\n};\n\nexport const removalPolicyOverride: {\n files: string[];\n excludeFiles: string[];\n rules: Readonly<Record<string, [\"error\", ...unknown[]]>>;\n} = {\n files: [\"**/*.ts\"],\n excludeFiles: [\"**/*.test.ts\"],\n rules: {\n \"eslint-js/no-restricted-syntax\": [\"error\", ...cloudflareResourceSyntax, removalPolicySyntax],\n },\n};\n\nexport const alchemyOverride: {\n files: string[];\n rules: Readonly<Record<string, [\"error\", ...unknown[]]>>;\n} = {\n files: [\"**/alchemy.run.ts\"],\n rules: {\n \"eslint-js/no-restricted-syntax\": [\n \"error\",\n ...cloudflareResourceSyntax,\n removalPolicySyntax,\n {\n selector: 'CallExpression[callee.name=\"Stack\"]:not([arguments.0.name=\"APP_NAME\"])',\n message: \"スタック名には app-name.ts の APP_NAME を渡す\",\n },\n {\n selector:\n 'Program:not(:has(YieldExpression[delegate=true] > Identifier.argument[name=\"requireAppPrefix\"]))',\n message:\n \"スタックの最後で app-name.ts の requireAppPrefix を yield* して、リソース名の prefix を検査する\",\n },\n {\n selector:\n 'CallExpression[callee.name=\"Stack\"] > .arguments:nth-child(3):not(:has(FunctionExpression > BlockStatement > ExpressionStatement:nth-last-child(2) > YieldExpression[delegate=true] > Identifier.argument[name=\"requireAppPrefix\"]))',\n message:\n \"スタックの最後で app-name.ts の requireAppPrefix を yield* して、リソース名の prefix を検査する\",\n },\n ],\n },\n};\n\nexport const commandsOverride: {\n files: string[];\n rules: Readonly<Record<string, \"off\">>;\n} = {\n files: [\"bin/**\"],\n rules: {\n \"node/no-process-env\": \"off\",\n \"node/no-sync\": \"off\",\n \"effecttsgo/node-builtin-import\": \"off\",\n },\n};\n","import { createDecisionPlugin, defineDecisionRule } from \"@r_masseater/oxlint-plugin-decision\";\n\nexport default createDecisionPlugin({\n name: \"stack\",\n rules: [\n defineDecisionRule({\n id: \"exclusive-status\",\n target: \"file\",\n question:\n \"Does this code represent one piece of state with several boolean flags or optional fields whose combinations can contradict each other, instead of one exclusive status expressed as a discriminated union? Answer no when every state is a single exclusive status, or when the file holds no such state. A violation needs two or more booleans or optional fields that describe the same piece of state; a single boolean value, parameter, return value or field is not a violation, and a union of objects told apart by a status or kind field is already an exclusive status. A constant configuration object whose shape a library fixes, such as an OpenFeature flag definition, holds no state and is not a violation.\",\n message: \"状態は排他的なstatusを持つ判別共用体で表し、booleanフラグの組を使わない。\",\n cutoff: 0.8,\n }),\n defineDecisionRule({\n id: \"server-state-tanstack-query\",\n target: \"file\",\n question:\n \"Does this code fetch, cache or synchronize server data on the client with something other than TanStack Query, such as fetch inside useEffect, SWR or a hand-written cache? Answer no when server data on the client goes only through TanStack Query, or when the file handles none. Creating an API client such as a better-auth or Eden client, which fetches nothing until a query calls it, is not a violation.\",\n message: \"サーバー状態はTanStack Queryだけで扱う。\",\n cutoff: 0.8,\n }),\n defineDecisionRule({\n id: \"ui-state-effect-atom\",\n target: \"file\",\n question:\n \"Does this code hold client-side UI state with something other than effect-atom, such as useState, useReducer, React context used as a store, zustand, jotai or redux? Answer no when client-side UI state is held only by effect-atom, or when the file holds none. effect-atom is Atom from effect/reactivity, read and written through @effect/atom-react hooks such as useAtomValue and useAtomSet. Creating a TanStack Query QueryClient or configuring the router, which hold no UI state, is not a violation.\",\n message: \"UI状態はeffect-atomだけで扱う。\",\n cutoff: 0.8,\n }),\n ],\n});\n","import type { UserConfig } from \"vite-plus\";\n\ntype LintRules = NonNullable<NonNullable<UserConfig[\"lint\"]>[\"rules\"]>;\n\nexport const webGuidanceRules = {\n \"jsx-a11y/no-redundant-roles\": [\"error\", { ul: [\"list\"], ol: [\"list\"] }],\n \"jsx-a11y/no-noninteractive-tabindex\": [\"error\", { tags: [\"section\"], roles: [\"tabpanel\"] }],\n} satisfies LintRules;\n","import { presets as effectPresets } from \"@effect/tsgo/oxlint-presets\";\nimport htmlReact from \"@html-eslint/eslint-plugin-react\";\nimport eslintReact from \"@r_masseater/oxlint-typed-rules/react\";\nimport { Array as Arr, Record as Rec, String as Str, Struct, pipe } from \"effect\";\nimport reactHooks from \"eslint-plugin-react-hooks\";\n\nimport decisionPlugin from \"./decision-rules.ts\";\n\nexport const generated = [\n \"**/routeTree.gen.ts\",\n \"**/generated/**\",\n \"**/drizzle/**/snapshot.json\",\n \".claude/skills/**\",\n \".intent/**\",\n \"AGENTS.md\",\n \"CLAUDE.md\",\n \"**/CHANGELOG.md\",\n \".github/release-please/*manifest.json\",\n \"**/.release-please-manifest.json\",\n \"**/*.d.*.ts\",\n \"**/src-tauri/gen/**\",\n];\n\nconst asErrors = (names: readonly string[]): Readonly<Record<string, \"error\">> =>\n Rec.fromEntries(\n pipe(\n names,\n Arr.map((name) => [name, \"error\"] as const),\n ),\n );\n\nexport const allRulesOf = ({\n prefix,\n rules,\n}: Readonly<{ prefix: string; rules: Readonly<Record<string, unknown>> }>): Readonly<\n Record<string, \"error\">\n> =>\n asErrors(\n pipe(\n Rec.keys(rules),\n Arr.map((rule) => `${prefix}/${rule}`),\n ),\n );\n\nconst reactHooksRuleNames = pipe(\n Struct.keys(reactHooks.configs[\"recommended-latest\"].rules),\n Arr.map(Str.replace(\"react-hooks/\", \"react-hooks-js/\")),\n);\n\nconst reactHooksRules = asErrors(reactHooksRuleNames);\n\nconst eslintReactRuleNames = pipe(\n Rec.keys(eslintReact.configs[\"strict-typescript\"].rules ?? {}),\n Arr.filter(\n (name) => !(Str.replace(\"@eslint-react/\", \"react-hooks-js/\")(name) in reactHooksRules),\n ),\n);\n\nconst effectRuleNames = pipe(\n Rec.values(effectPresets),\n Arr.flatMap((preset) => Struct.keys(preset.rules ?? {})),\n);\n\nexport const pluginRules: Readonly<Record<string, \"error\">> = {\n ...asErrors(Rec.keys(htmlReact.configs.all.rules ?? {})),\n ...reactHooksRules,\n ...asErrors(eslintReactRuleNames),\n ...asErrors(effectRuleNames),\n};\n\nexport const decisionPluginName = decisionPlugin.meta.name;\n\nexport const decisionRules = allRulesOf({\n prefix: decisionPluginName,\n rules: decisionPlugin.rules,\n});\n\nexport const decisionTestRules = pipe(\n decisionRules,\n Rec.map(() => \"off\" as const),\n);\n\nexport const shadcnRestyleContracts = [\n { pattern: \"^Table(Head|Cell)$\", allow: [\"text-alignment\", \"fvn-spacing\"] },\n { pattern: \"^TableCaption$\", allow: [\"caption\", \"text-alignment\", \"mt-*\", \"mb-*\"] },\n];\n\nexport { webGuidanceRules } from \"./web-guidance.config.ts\";\n","import type { UserConfig } from \"vite-plus\";\n\ntype LintRules = NonNullable<NonNullable<UserConfig[\"lint\"]>[\"rules\"]>;\n\nconst NO_TEST_DOUBLES =\n \"依存の振る舞いを差し替えない。Effect の Layer を差し替えるか、本物の実装を使う\";\n\nexport const testRules = {\n \"vitest/expect-expect\": [\n \"error\",\n { assertFunctionNames: [\"expect\", \"expect*\", \"assert*\", \"waitFor*\", \"run\", \"*.run\"] },\n ],\n \"vitest/valid-expect\": [\"error\", { maxArgs: 2 }],\n \"vitest/valid-title\": [\"error\", { allowArguments: true }],\n \"vitest/prefer-called-times\": \"off\",\n \"vitest/prefer-import-in-mock\": \"off\",\n \"vitest/no-standalone-expect\": \"off\",\n \"vitest/no-conditional-in-test\": \"off\",\n \"vitest/require-test-timeout\": \"off\",\n \"vitest/prefer-expect-assertions\": \"off\",\n \"vitest/require-top-level-describe\": \"off\",\n \"vitest/no-importing-vitest-globals\": \"off\",\n \"vitest/require-hook\": \"off\",\n \"vitest/no-hooks\": \"off\",\n \"vitest/consistent-test-it\": \"off\",\n \"vitest/prefer-describe-function-title\": \"off\",\n \"vitest/prefer-lowercase-title\": \"off\",\n \"vitest/prefer-to-be-truthy\": \"off\",\n \"vitest/prefer-to-be-falsy\": \"off\",\n \"vitest/padding-around-after-all-blocks\": \"off\",\n \"vitest/padding-around-test-blocks\": \"off\",\n \"vitest/max-expects\": \"off\",\n} satisfies LintRules;\n\nconst NO_FLAKE_MASKING =\n \"再試行や flakyTest で不安定なテストを隠さない。待つ対象のイベントを await して直す\";\n\nexport const testDoubleSyntax: readonly Readonly<{ selector: string; message: string }>[] = [\n {\n selector: 'CallExpression[callee.object.name=\"vi\"][callee.property.name=/^(mock|doMock)$/]',\n message: NO_TEST_DOUBLES,\n },\n {\n selector: 'CallExpression[callee.object.name=\"vi\"][callee.property.name=\"stubGlobal\"]',\n message: NO_TEST_DOUBLES,\n },\n];\n\nexport const flakeMaskingSyntax: readonly Readonly<{ selector: string; message: string }>[] = [\n { selector: 'Property[key.name=\"retry\"]', message: NO_FLAKE_MASKING },\n { selector: 'MemberExpression[property.name=\"retry\"]', message: NO_FLAKE_MASKING },\n { selector: 'MemberExpression[property.name=\"flakyTest\"]', message: NO_FLAKE_MASKING },\n];\n","import { fileURLToPath } from \"node:url\";\n\nimport tanstackQuery from \"@r_masseater/oxlint-typed-rules/tanstack-query\";\nimport tanstackRouter from \"@r_masseater/oxlint-typed-rules/tanstack-router\";\nimport { plugin as shadcn } from \"@shadcn/lint\";\nimport baselineJs from \"eslint-plugin-baseline-js\";\nimport type { UserConfig } from \"vite-plus\";\n\nimport { DECISION_MODEL, DECISION_TIMEOUT_MS } from \"#/shared/config/index.ts\";\n\nimport {\n alchemyOverride,\n cloudflareResourceSyntax,\n removalPolicyOverride,\n commandsOverride,\n} from \"./lint-overrides.config.ts\";\nimport {\n allRulesOf,\n decisionPluginName,\n generated,\n pluginRules,\n shadcnRestyleContracts,\n webGuidanceRules,\n} from \"./lint.config.ts\";\nimport { flakeMaskingSyntax, testDoubleSyntax, testRules } from \"./test-rules.config.ts\";\n\ntype LintConfig = NonNullable<UserConfig[\"lint\"]>;\n\nconst resolved = (specifier: string): string => fileURLToPath(import.meta.resolve(specifier));\n\nconst typedRules = \"@r_masseater/oxlint-typed-rules\";\n\nconst jsPlugins = [\n { name: \"vite-plus\", specifier: resolved(\"vite-plus/oxlint-plugin\") },\n { name: \"tanstack-query\", specifier: resolved(`${typedRules}/tanstack-query`) },\n { name: \"tanstack-router\", specifier: resolved(`${typedRules}/tanstack-router`) },\n { name: \"tanstack-start\", specifier: resolved(`${typedRules}/tanstack-start`) },\n { name: \"drizzle\", specifier: resolved(`${typedRules}/drizzle`) },\n { name: \"react-hooks-js\", specifier: resolved(\"eslint-plugin-react-hooks\") },\n { name: \"@eslint-react\", specifier: resolved(`${typedRules}/react`) },\n { name: \"@remotion\", specifier: resolved(`${typedRules}/remotion`) },\n { name: \"shadcn\", specifier: resolved(\"@shadcn/lint\") },\n { name: \"baseline-js\", specifier: resolved(\"eslint-plugin-baseline-js\") },\n { name: \"@html-eslint/react\", specifier: resolved(\"@html-eslint/eslint-plugin-react\") },\n { name: \"eslint-js\", specifier: resolved(\"oxlint-plugin-eslint\") },\n { name: decisionPluginName, specifier: resolved(\"@r_masseater/msch/decision-rules\") },\n { name: \"msch-lint\", specifier: resolved(\"@r_masseater/msch/lint-rules\") },\n];\n\nconst rules = {\n \"vite-plus/prefer-vite-plus-imports\": \"error\",\n \"tanstack-start/no-async-client-component\": \"error\",\n \"tanstack-start/no-client-code-in-server-component\": \"error\",\n ...allRulesOf({ prefix: \"tanstack-query\", rules: tanstackQuery.rules }),\n ...allRulesOf({ prefix: \"tanstack-router\", rules: tanstackRouter.rules }),\n \"drizzle/enforce-delete-with-where\": [\"error\", { drizzleObjectName: [\"db\"] }],\n \"drizzle/enforce-update-with-where\": [\"error\", { drizzleObjectName: [\"db\"] }],\n ...allRulesOf({ prefix: \"shadcn\", rules: shadcn.rules }),\n \"shadcn/no-restyle\": [\"error\", { contracts: shadcnRestyleContracts }],\n ...allRulesOf({ prefix: \"baseline-js\", rules: baselineJs.rules }),\n ...baselineJs.configs.recommended().rules,\n \"baseline-js/use-baseline\": [\n \"error\",\n {\n available: \"widely\",\n includeWebApis: { preset: \"auto\" },\n includeJsBuiltins: { preset: \"auto\" },\n },\n ],\n ...pluginRules,\n \"eslint/capitalized-comments\": \"off\",\n \"eslint/sort-imports\": \"off\",\n \"eslint/sort-keys\": \"off\",\n \"import/no-named-export\": \"off\",\n \"import/prefer-default-export\": \"off\",\n \"import/group-exports\": \"off\",\n \"import/exports-last\": \"off\",\n ...testRules,\n ...webGuidanceRules,\n \"msch-lint/array-from-async\": \"error\",\n \"msch-lint/ecosystem-readers\": \"error\",\n \"msch-lint/explicit-import-path\": \"error\",\n \"msch-lint/get-or-insert\": \"error\",\n \"msch-lint/mcp-tool-layer\": \"error\",\n \"msch-lint/main-through-node-main\": \"error\",\n \"msch-lint/inline-exports\": \"error\",\n \"msch-lint/ui-state-in-atoms\": \"error\",\n \"msch-lint/no-hand-written-sql\": \"error\",\n \"msch-lint/platform-node-by-module\": \"error\",\n \"msch-lint/readonly-parameters\": \"error\",\n \"msch-lint/separate-min-max\": \"error\",\n \"msch-lint/typed-calls-not-reflect\": \"error\",\n \"react/react-in-jsx-scope\": \"off\",\n \"eslint/no-undef\": \"off\",\n \"typescript/promise-function-async\": \"off\",\n \"react/forbid-component-props\": \"off\",\n \"oxc/no-rest-spread-properties\": \"off\",\n \"node/no-top-level-await\": \"off\",\n \"import/no-nodejs-modules\": \"off\",\n \"eslint/new-cap\": [\"error\", { capIsNew: false }],\n \"eslint/one-var\": [\"error\", \"never\"],\n \"unicorn/relative-url-style\": [\"error\", \"always\"],\n \"eslint/id-length\": [\"error\", { exceptions: [\"x\", \"y\"] }],\n \"jsdoc/check-tag-names\": [\"error\", { definedTags: [\"msch\", \"stability\"] }],\n \"jsdoc/require-param\": [\"error\", { exemptedBy: [\"inheritdoc\", \"internal\", \"msch\", \"stability\"] }],\n \"jsdoc/require-returns\": [\n \"error\",\n { exemptedBy: [\"inheritdoc\", \"internal\", \"msch\", \"stability\"] },\n ],\n \"eslint-js/no-restricted-syntax\": [\"error\", ...cloudflareResourceSyntax],\n \"typescript/prefer-readonly-parameter-types\": \"off\",\n \"eslint/no-duplicate-imports\": [\"error\", { allowSeparateTypeImports: true }],\n \"react/function-component-definition\": [\n \"error\",\n { namedComponents: \"arrow-function\", unnamedComponents: \"arrow-function\" },\n ],\n \"typescript/no-empty-interface\": [\"error\", { allowSingleExtends: true }],\n \"typescript/no-empty-object-type\": [\"error\", { allowInterfaces: \"with-single-extends\" }],\n \"react/jsx-filename-extension\": [\"error\", { extensions: [\".tsx\"] }],\n \"react/only-export-components\": [\"error\", { allowExportNames: [\"Route\"] }],\n} satisfies LintConfig[\"rules\"];\n\nconst overrides = [\n removalPolicyOverride,\n alchemyOverride,\n {\n files: [\"**/*.config.ts\", \"**/alchemy.*.ts\", \"**/decision-rules.ts\"],\n rules: { \"import/no-default-export\": \"off\" },\n },\n commandsOverride,\n {\n files: [\"**/bin/**\"],\n rules: { \"baseline-js/use-baseline\": \"off\" },\n },\n {\n files: [\"**/*.test.ts\", \"**/*.test.tsx\", \"**/*.test.support.ts\", \"**/vite.config.ts\"],\n rules: {\n \"eslint-js/no-restricted-syntax\": [\n \"error\",\n ...cloudflareResourceSyntax,\n ...flakeMaskingSyntax,\n ...testDoubleSyntax,\n ],\n },\n },\n {\n files: [\"**/vite.config.ts\"],\n rules: {\n \"eslint/max-lines\": \"off\",\n \"eslint/max-lines-per-function\": \"off\",\n \"baseline-js/use-baseline\": \"off\",\n },\n },\n] satisfies LintConfig[\"overrides\"];\n\nexport const lint = {\n ignorePatterns: generated,\n plugins: [\n \"eslint\",\n \"typescript\",\n \"unicorn\",\n \"oxc\",\n \"import\",\n \"react\",\n \"react-perf\",\n \"jsx-a11y\",\n \"jsdoc\",\n \"vitest\",\n \"promise\",\n \"node\",\n \"effecttsgo\",\n ],\n categories: {\n correctness: \"error\",\n suspicious: \"error\",\n pedantic: \"error\",\n perf: \"error\",\n style: \"error\",\n restriction: \"error\",\n nursery: \"error\",\n },\n jsPlugins,\n rules,\n overrides,\n settings: {\n [decisionPluginName]: {\n model: DECISION_MODEL,\n timeoutMs: DECISION_TIMEOUT_MS,\n ci: \"skip\",\n },\n },\n options: {\n typeAware: true,\n typeCheck: true,\n denyWarnings: true,\n reportUnusedDisableDirectives: \"error\",\n },\n} satisfies LintConfig;\n","const UI_STATE = \"UI 状態は effect-atom だけで扱う\";\n\nexport const INSTRUMENTATION = \"計装は Effect のトレーシングだけで扱う\";\nconst INFRASTRUCTURE = \"インフラは Alchemy の IaC と Cloudflare だけで扱い、wrangler は使わない\";\n\nexport const requiredStack: Readonly<Record<string, readonly string[]>> = {\n [UI_STATE]: [\n \"zustand\",\n \"jotai\",\n \"valtio\",\n \"recoil\",\n \"mobx\",\n \"mobx-*\",\n \"redux\",\n \"@reduxjs/*\",\n \"react-redux\",\n \"xstate\",\n \"@xstate/*\",\n \"nanostores\",\n \"@nanostores/*\",\n \"@preact/signals*\",\n ],\n \"サーバー状態は TanStack Query と Eden だけで扱う\": [\n \"swr\",\n \"react-query\",\n \"@apollo/*\",\n \"urql\",\n \"@urql/*\",\n \"axios\",\n \"ky\",\n \"ofetch\",\n \"got\",\n \"node-fetch\",\n \"graphql-request\",\n \"@trpc/*\",\n ],\n \"ルーティングとサーバーは TanStack Start と Elysia だけで扱う\": [\n \"react-router\",\n \"react-router-dom\",\n \"next\",\n \"@remix-run/*\",\n \"wouter\",\n \"express\",\n \"hono\",\n \"fastify\",\n \"koa\",\n \"@nestjs/*\",\n ],\n \"データベースは Drizzle だけで扱い、スキーマはマイグレーションで生成する\": [\n \"prisma\",\n \"@prisma/*\",\n \"typeorm\",\n \"sequelize\",\n \"kysely\",\n \"knex\",\n \"@mikro-orm/*\",\n \"better-sqlite3\",\n \"pg\",\n \"mysql2\",\n ],\n \"認証は better-auth だけで扱う\": [\n \"next-auth\",\n \"@auth/*\",\n \"lucia\",\n \"passport\",\n \"passport-*\",\n \"@clerk/*\",\n \"firebase/auth\",\n \"@supabase/*\",\n ],\n \"UI は shadcn/ui と Tailwind CSS だけで組む\": [\n \"@mui/*\",\n \"antd\",\n \"@chakra-ui/*\",\n \"@mantine/*\",\n \"styled-components\",\n \"@emotion/*\",\n \"bootstrap\",\n \"react-bootstrap\",\n ],\n \"検証、日時、ログ、関数型ユーティリティは Effect だけで扱う\": [\n \"zod\",\n \"yup\",\n \"joi\",\n \"valibot\",\n \"arktype\",\n \"io-ts\",\n \"superstruct\",\n \"moment\",\n \"dayjs\",\n \"date-fns\",\n \"luxon\",\n \"winston\",\n \"pino\",\n \"bunyan\",\n \"loglevel\",\n \"lodash\",\n \"lodash-es\",\n \"ramda\",\n \"rxjs\",\n \"fp-ts\",\n \"neverthrow\",\n \"ts-results\",\n \"purify-ts\",\n ],\n \"CSV は effect/encoding の Csv だけで読み書きする\": [\n \"papaparse\",\n \"csv-parse\",\n \"csv-parser\",\n \"csv-stringify\",\n \"fast-csv\",\n \"@fast-csv/*\",\n \"d3-dsv\",\n ],\n \"tar は effect/encoding の Tar だけで読み書きする\": [\n \"modern-tar\",\n \"nanotar\",\n \"tar\",\n \"tar-stream\",\n \"tar-fs\",\n \"tar-js\",\n \"tarts\",\n \"it-tar\",\n ],\n \"エージェントスキルは vite.config.ts の skills に書き、msch --prepare で入れる\": [\"skills\"],\n \"フィーチャーフラグは OpenFeature だけで扱う\": [\n \"launchdarkly-*\",\n \"@launchdarkly/*\",\n \"@growthbook/*\",\n \"unleash-client\",\n \"flagsmith\",\n \"@vercel/flags\",\n ],\n \"テストは Vitest と Playwright だけで扱う\": [\n \"jest\",\n \"jest-*\",\n \"@jest/*\",\n \"ts-jest\",\n \"mocha\",\n \"jasmine\",\n \"jasmine-core\",\n \"ava\",\n \"cypress\",\n \"tap\",\n \"uvu\",\n ],\n \"決済は Stripe だけで扱う\": [\n \"@paypal/*\",\n \"paypal-rest-sdk\",\n \"braintree\",\n \"@paddle/*\",\n \"@lemonsqueezy/*\",\n \"square\",\n ],\n \"整形は Vite+ の vp fmt だけで扱う\": [\n \"prettier\",\n \"prettier-plugin-*\",\n \"@prettier/*\",\n \"@biomejs/*\",\n \"dprint\",\n ],\n \"lint は Vite+ の vp lint だけで扱い、ESLint のプラグインは oxlint の JS プラグインとして読む\": [\n \"eslint\",\n \"@eslint/*\",\n \"eslint-config-*\",\n \"tslint\",\n \"standard\",\n \"xo\",\n ],\n [INSTRUMENTATION]: [\"@opentelemetry/*\", \"dd-trace\", \"newrelic\"],\n [INFRASTRUCTURE]: [\n \"wrangler\",\n \"miniflare\",\n \"@cloudflare/vite-plugin\",\n \"@vercel/*\",\n \"@netlify/*\",\n \"aws-cdk\",\n \"aws-cdk-lib\",\n \"@pulumi/*\",\n \"cdktf\",\n ],\n};\n","export const tracedRules = {\n \"msch-lint/traced-elysia\": \"error\",\n \"msch-lint/traced-effect-run\": \"error\",\n} as const;\n","import remotion from \"@r_masseater/oxlint-typed-rules/remotion\";\n\nimport { allRulesOf } from \"./lint.config.ts\";\n\nexport const remotionRules = allRulesOf({ prefix: \"@remotion\", rules: remotion.rules });\n","import type { VideoIntro } from \"#/shared/config/index.ts\";\n\nexport interface VideoSayOptions {\n readonly terms?: Readonly<Record<string, string>>;\n readonly banned?: Readonly<Record<string, string>>;\n readonly maxEmphasis?: number;\n}\n\nexport interface VideoSeriesOptions {\n readonly values?: Readonly<Record<string, string>>;\n readonly voices?: readonly string[];\n readonly opener?: string;\n readonly closer?: string;\n readonly intro?: VideoIntro;\n readonly afterIntro?: Readonly<Record<string, string>>;\n}\n\nexport interface VideoRulesOptions {\n readonly say: VideoSayOptions;\n readonly series: Readonly<Record<string, VideoSeriesOptions>>;\n readonly banned?: Readonly<Record<string, string>>;\n}\n\nexport const videoRules = ({ say, series, banned = {} }: VideoRulesOptions) =>\n ({\n \"msch-lint/video-say\": [\"error\", say],\n \"msch-lint/video-readings\": \"error\",\n \"msch-lint/video-series\": [\"error\", { series, banned }],\n }) as const;\n","import type { WismConfig } from \"@r_masseater/wism\";\nimport { rustCrate, skill, structure, workspace } from \"@r_masseater/wism/presets\";\nimport { Array as Arr, Predicate, String as Str, pipe } from \"effect\";\n\nconst NEGATION = \"!\";\nconst isIgnore = Predicate.not(Str.startsWith(NEGATION));\n\nexport interface StructureOptions {\n readonly members: readonly string[];\n readonly ignorePatterns: readonly string[];\n}\n\nexport const structureOf = ({ members, ignorePatterns }: StructureOptions): WismConfig =>\n structure({\n kinds: [workspace({ paths: members }), rustCrate(), skill()],\n ignores: pipe(ignorePatterns, Arr.filter(isIgnore)),\n });\n","import { createRequire, registerHooks } from \"node:module\";\n\nexport const KUROMOJIN = \"kuromojin\";\nconst ON_Y8 = \"@r_masseater/y8/kuromojin\";\n\nexport const requireWithY8Kuromojin = (parentUrl: string): NodeJS.Require => {\n registerHooks({\n resolve: (specifier, context, nextResolve) => {\n if (specifier === KUROMOJIN) {\n return nextResolve(ON_Y8, { ...context, parentURL: import.meta.url });\n }\n return nextResolve(specifier, context);\n },\n });\n return createRequire(parentUrl);\n};\n","import presetJa from \"@r_masseater/textlint-rule-preset-ja\";\nimport type { ToolSections } from \"@r_masseater/vite-plus-adopt\";\nimport { Option, Predicate, Record as Rec, pipe } from \"effect\";\n\nimport { JAPANESE } from \"#/shared/config/index.ts\";\n\nimport { requireWithY8Kuromojin } from \"./kuromojin.config.ts\";\n\ntype Preset = NonNullable<NonNullable<ToolSections[\"textlint\"]>[\"presets\"]>[string];\ntype Rule = Preset[\"rules\"][string];\ntype Reporter = Extract<Rule, (...args: never) => unknown>;\ntype Fixable = Exclude<Rule, Reporter>;\n\nconst NO_HANDLERS = {};\n\nconst isPreset = (value: unknown): value is Preset =>\n Predicate.hasProperty(value, \"rules\") &&\n Predicate.isObject(value.rules) &&\n Predicate.hasProperty(value, \"rulesConfig\") &&\n Predicate.isObject(value.rulesConfig);\n\nconst presetIn = (value: unknown): Option.Option<Preset> => {\n if (isPreset(value)) {\n return Option.some(value);\n }\n if (Predicate.hasProperty(value, \"default\")) {\n return presetIn(value.default);\n }\n return Option.none();\n};\n\nconst required = requireWithY8Kuromojin(import.meta.url);\n\nconst presetOf = (specifier: string, loaded: unknown): Preset =>\n Option.getOrThrowWith(\n presetIn(loaded),\n () => new TypeError(`${specifier} does not export a textlint preset`),\n );\n\nconst japaneseOnly =\n (reporter: Reporter): Reporter =>\n (context, options) => {\n if (JAPANESE.test(context.getSource())) {\n return reporter(context, options);\n }\n return NO_HANDLERS;\n };\n\nconst forJapanese = (rule: Reporter | Readonly<Fixable>): Rule => {\n if (Predicate.isFunction(rule)) {\n return japaneseOnly(rule);\n }\n return { linter: japaneseOnly(rule.linter), fixer: japaneseOnly(rule.fixer) };\n};\n\nconst japanesePreset = (specifier: string, loaded: unknown): Preset => {\n const { rules, rulesConfig } = presetOf(specifier, loaded);\n return { rules: pipe(rules, Rec.map(forJapanese)), rulesConfig };\n};\n\nexport const textlintPresets: NonNullable<NonNullable<ToolSections[\"textlint\"]>[\"presets\"]> = {\n \"@r_masseater/preset-ja\": japanesePreset(\"@r_masseater/textlint-rule-preset-ja\", presetJa),\n \"@textlint-ja/preset-ai-writing\": japanesePreset(\n \"@textlint-ja/textlint-rule-preset-ai-writing\",\n required(\"@textlint-ja/textlint-rule-preset-ai-writing\"),\n ),\n \"preset-ja-technical-writing\": japanesePreset(\n \"textlint-rule-preset-ja-technical-writing\",\n required(\"textlint-rule-preset-ja-technical-writing\"),\n ),\n};\n","import { createRequire } from \"node:module\";\n\nimport type { ToolSections } from \"@r_masseater/vite-plus-adopt\";\nimport { Option, Predicate, pipe } from \"effect\";\n\ntype Filter = NonNullable<NonNullable<ToolSections[\"textlint\"]>[\"filterModules\"]>[string];\n\nconst isFilter = (value: unknown): value is Filter => Predicate.isFunction(value);\n\nconst filterIn = (specifier: string, loaded: unknown): Filter =>\n pipe(\n Option.liftPredicate(loaded, isFilter),\n Option.getOrThrowWith(() => new TypeError(`${specifier} does not export a textlint filter`)),\n );\n\nexport const textlintFilters: NonNullable<NonNullable<ToolSections[\"textlint\"]>[\"filterModules\"]> =\n {\n comments: filterIn(\n \"textlint-filter-rule-comments\",\n createRequire(import.meta.url)(\"textlint-filter-rule-comments\"),\n ),\n };\n","import { globSync, readFileSync } from \"node:fs\";\nimport path from \"node:path\";\n\nimport { Array as Arr, Option, Order, Predicate, pipe } from \"effect\";\n\nimport { splitFrontmatter } from \"#/shared/lib/frontmatter.ts\";\nimport type { Frontmatter } from \"#/shared/lib/frontmatter.ts\";\nimport { isIndexSkill } from \"#/shared/lib/index-skill.ts\";\n\nconst SKILL_FILES = [\n \".agents/skills/*/SKILL.md\",\n \".claude/skills/*/SKILL.md\",\n \"skills/*/SKILL.md\",\n \"plugins/*/skills/*/SKILL.md\",\n];\n\nconst nameOf = ({ fields }: Frontmatter): Option.Option<string> =>\n Option.filter(Option.fromNullishOr(fields[\"name\"]), Predicate.isString);\n\nconst readSource = Option.liftThrowable((file: string): string => readFileSync(file, \"utf8\"));\n\nconst indexNameAt =\n (root: string) =>\n (file: string): Option.Option<string> =>\n pipe(\n readSource(path.join(root, file)),\n Option.flatMap(splitFrontmatter),\n Option.filter(isIndexSkill),\n Option.flatMap(nameOf),\n );\n\nexport const indexSkillIn = (root: string): Option.Option<string> =>\n pipe(\n globSync(SKILL_FILES, { cwd: root }),\n Arr.sortBy(Order.String),\n Arr.findFirst(indexNameAt(root)),\n );\n","import type { RuleEntry, Y8Config } from \"@r_masseater/y8\";\nimport { recommended } from \"@r_masseater/y8/presets\";\nimport type { RecommendedOptions } from \"@r_masseater/y8/presets\";\nimport { Option } from \"effect\";\n\nimport { indexSkillIn } from \"./index-skill.config.ts\";\n\ntype SkillNames = NonNullable<NonNullable<RecommendedOptions[\"skills\"]>[\"skillNames\"]>;\n\nconst skillNamesIn = (root: string): SkillNames =>\n Option.match(indexSkillIn(root), {\n onNone: (): SkillNames => ({}),\n onSome: (index): SkillNames => ({ index }),\n });\n\nconst docsIn = (root: string): RecommendedOptions => {\n const skillNames = skillNamesIn(root);\n return {\n agents: {\n sections: [[\"Tech stack\"], [\"Commands\"], [\"Rules\"]],\n commands: [\"Commands\"],\n stack: [\"Tech stack\"],\n skillNames,\n },\n skills: { skillNames },\n };\n};\n\nconst MARKDOWN_IGNORES = [\n \".agents/skills/**\",\n \"**/fixtures/**\",\n \"**/upstream/**\",\n \"CHANGELOG.md\",\n \"**/CLAUDE.md\",\n];\n\nexport interface MarkdownOptions {\n readonly ignores?: readonly string[];\n readonly rules?: Readonly<Record<string, RuleEntry>>;\n readonly docs?: RecommendedOptions;\n}\n\nexport const markdownOf = ({ ignores = [], rules = {}, docs = {} }: MarkdownOptions): Y8Config => {\n const base = docsIn(process.cwd());\n return {\n extends: [\n recommended({\n ...base,\n ...docs,\n agents: { ...base.agents, ...docs.agents },\n skills: { ...base.skills, ...docs.skills },\n }),\n ],\n rules: { \"agnix/XP-001\": \"off\", ...rules },\n reportUnusedDirectives: true,\n ignores: [...MARKDOWN_IGNORES, ...ignores],\n };\n};\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;AAAA,MAAM,UAAU;AAChB,MAAM,kBACJ;AAEF,MAAM,YAAY;AAClB,MAAM,oBACJ;AAEF,MAAM,0BACJ;AAEF,MAAM,qBACJ;AAEF,MAAM,YACJ;AAKF,MAAM,iBAAiB;AAEvB,MAAa,2BACX;CACE;EACE,UAAU,qHAAqH,QAAQ;EACvI,SAAS;CACX;CACA;EACE,UAAU,sFAAsF,QAAQ;EACxG,SAAS;CACX;CACA;EACE,UAAU,iIAAiI,UAAU;EACrJ,SAAS;CACX;CACA;EACE,UAAU,+HAA+H,UAAU;EACnJ,SAAS;CACX;CACA;EACE,UAAU,GAAG,UAAU;EACvB,SAAS;CACX;CACA;EACE,UAAU,GAAG,UAAU;EACvB,SAAS,GAAG,mBAAmB;CACjC;CACA;EACE,UAAU,GAAG,eAAe;EAC5B,SAAS,GAAG,mBAAmB;CACjC;CACA;EACE,UAAU,GAAG,eAAe;EAC5B,SAAS,GAAG,mBAAmB;CACjC;CACA;EACE,UACE;EACF,SAAS;CACX;CACA;EACE,UACE;EACF,SAAS;CACX;CACA;EACE,UACE;EACF,SAAS;CACX;CACA;EACE,UACE;EACF,SACE;CACJ;CACA;EACE,UACE;EACF,SACE;CACJ;CACA;EACE,UACE;EACF,SACE;CACJ;CACA;EACE,UAAU;EACV,SACE;CACJ;AACF;AACF,MAAa,sBAAuE;CAClF,UACE;CACF,SACE;AACJ;AAEA,MAAa,wBAIT;CACF,OAAO,CAAC,SAAS;CACjB,cAAc,CAAC,cAAc;CAC7B,OAAO,EACL,kCAAkC;EAAC;EAAS,GAAG;EAA0B;CAAmB,EAC9F;AACF;AAEA,MAAa,kBAGT;CACF,OAAO,CAAC,mBAAmB;CAC3B,OAAO,EACL,kCAAkC;EAChC;EACA,GAAG;EACH;EACA;GACE,UAAU;GACV,SAAS;EACX;EACA;GACE,UACE;GACF,SACE;EACJ;EACA;GACE,UACE;GACF,SACE;EACJ;CACF,EACF;AACF;AAEA,MAAa,mBAGT;CACF,OAAO,CAAC,QAAQ;CAChB,OAAO;EACL,uBAAuB;EACvB,gBAAgB;EAChB,kCAAkC;CACpC;AACF;;ACxJA,IAAA,yBAAe,qBAAqB;CAClC,MAAM;CACN,OAAO;EACL,mBAAmB;GACjB,IAAI;GACJ,QAAQ;GACR,UACE;GACF,SAAS;GACT,QAAQ;EACV,CAAC;EACD,mBAAmB;GACjB,IAAI;GACJ,QAAQ;GACR,UACE;GACF,SAAS;GACT,QAAQ;EACV,CAAC;EACD,mBAAmB;GACjB,IAAI;GACJ,Q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;EACA;EACA;EACA;EACA;EACA;EACA;EACA;CACF;CACA,yBAAyB;EACvB;EACA;EACA;EACA;EACA;EACA;EACA;EACA;CACF;CACA,uCAAuC;EACrC;EACA;EACA;EACA;EACA;EACA;EACA;EACA;CACF;CACA,qCAAqC;EACnC;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;CACF;CACA,yCAAyC;EACvC;EACA;EACA;EACA;EACA;EACA;EACA;CACF;CACA,yCAAyC;EACvC;EACA;EACA;EACA;EACA;EACA;EACA;EACA;CACF;CACA,8DAA8D,CAAC,QAAQ;CACvE,gCAAgC;EAC9B;EACA;EACA;EACA;EACA;EACA;CACF;CACA,kCAAkC;EAChC;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;CACF;CACA,oBAAoB;EAClB;EACA;EACA;EACA;EACA;EACA;CACF;CACA,4BAA4B;EAC1B;EACA;EACA;EACA;EACA;CACF;CACA,sEAAsE;EACpE;EACA;EACA;EACA;EACA;EACA;CACF;EACC,kBAAkB;EAAC;EAAoB;EAAY;CAAU;EAC7D,iBAAiB;EAChB;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;CACF;AACF;;ACrLA,MAAa,cAAc;CACzB,2BAA2B;CAC3B,+BAA+B;AACjC;;ACCA,MAAa,gBAAgB,WAAW;CAAE,QAAQ;CAAa,OAAO,SAAS;AAAM,CAAC;;ACmBtF,MAAa,cAAc,EAAE,KAAK,QAAQ,SAAS,CAAC,SACjD;CACC,uBAAuB,CAAC,SAAS,GAAG;CACpC,4BAA4B;CAC5B,0BAA0B,CAAC,SAAS;EAAE;EAAQ;CAAO,CAAC;AACxD;;ACvBF,MAAM,WAAW,UAAU,IAAIC,OAAI,WAAW,GAAQ,CAAC;AAOvD,MAAa,eAAe,EAAE,SAAS,qBACrC,UAAU;CACR,OAAO;EAAC,UAAU,EAAE,OAAO,QAAQ,C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G,CAAC,OAAO;GAAC;GAClD,UAAU,CAAC,UAAU;GACrB,OAAO,CAAC,YAAY;GACpB;EACF;EACA,QAAQ,EAAE,WAAW;CACvB;AACF;AAEA,MAAM,mBAAmB;CACvB;CACA;CACA;CACA;CACA;AACF;AAQA,MAAa,cAAc,EAAE,UAAU,CAAC,GAAG,QAAQ,CAAC,GAAG,OAAO,CAAC,QAAmC;CAChG,MAAM,OAAO,OAAO,QAAQ,IAAI,CAAC;CACjC,OAAO;EACL,SAAS,CACP,YAAY;GACV,GAAG;GACH,GAAG;GACH,QAAQ;IAAE,GAAG,KAAK;IAAQ,GAAG,KAAK;GAAO;GACzC,QAAQ;IAAE,GAAG,KAAK;IAAQ,GAAG,KAAK;GAAO;EAC3C,CAAC,CACH;EACA,OAAO;GAAE,gBAAgB;GAAO,GAAG;EAAM;EACzC,wBAAwB;EACxB,SAAS,CAAC,GAAG,kBAAkB,GAAG,OAAO;CAC3C;AACF"}
|
package/dist/exits.mjs
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import { t as lookupReport } from "./lookup-report-
|
|
3
|
-
import { t as runCli } from "./runtime-
|
|
4
|
-
import { n as upstreamExitsMet } from "./upstream-exits-
|
|
5
|
-
import { r as RepositoryFiles } from "./repository-files-
|
|
2
|
+
import { t as lookupReport } from "./lookup-report-BWiDFlSS.mjs";
|
|
3
|
+
import { t as runCli } from "./runtime-BdEuIL6Z.mjs";
|
|
4
|
+
import { n as upstreamExitsMet } from "./upstream-exits-BC8ofnVa.mjs";
|
|
5
|
+
import { r as RepositoryFiles } from "./repository-files-hbJpQ1i0.mjs";
|
|
6
6
|
import { Array, Effect, Schema, pipe } from "effect";
|
|
7
7
|
// bin/msch-exits.ts
|
|
8
8
|
const MetRow = Schema.Struct({
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { i as nodeRepositoryFiles, r as RepositoryFiles } from "./repository-files-
|
|
1
|
+
import { i as nodeRepositoryFiles, r as RepositoryFiles } from "./repository-files-hbJpQ1i0.mjs";
|
|
2
2
|
import { Array, Effect, Function, HashSet, Option, String, pipe } from "effect";
|
|
3
3
|
// src/shared/lib/reachable.ts
|
|
4
4
|
const DATA_FIRST_ARITY = 2;
|
|
@@ -91,4 +91,4 @@ const collectPlacedIgnoredDirectories = Effect.fn("collectPlacedIgnoredDirectori
|
|
|
91
91
|
const ignoredDirectories = (root) => Effect.runPromise(collectIgnoredDirectories(root).pipe(Effect.provide(nodeRepositoryFiles)));
|
|
92
92
|
export { reachable as i, collectPlacedIgnoredDirectories as n, ignoredDirectories as r, collectIgnoredDirectories as t };
|
|
93
93
|
|
|
94
|
-
//# sourceMappingURL=ignored-directories-
|
|
94
|
+
//# sourceMappingURL=ignored-directories-BRRODOoG.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ignored-directories-Ce-45yzO.mjs","names":["Arr","Fn","Str","Arr"],"sources":["../src/shared/lib/reachable.ts","../src/shared/lib/ignored-directories.ts"],"sourcesContent":["import { Array as Arr, Function as Fn, HashSet, pipe } from \"effect\";\n\nexport type Edges = Readonly<Record<string, readonly string[]>>;\n\nconst DATA_FIRST_ARITY = 2;\n\nconst visit = (\n edges: Edges,\n seen: HashSet.HashSet<string>,\n frontier: readonly string[],\n): HashSet.HashSet<string> => {\n const fresh = HashSet.difference(HashSet.fromIterable(frontier), seen);\n if (HashSet.isEmpty(fresh)) {\n return seen;\n }\n const next = pipe(\n Arr.fromIterable(fresh),\n Arr.flatMap((id) => edges[id] ?? []),\n );\n return visit(edges, HashSet.union(seen, fresh), next);\n};\n\nexport const reachable: {\n (roots: readonly string[]): (edges: Edges) => readonly string[];\n (edges: Edges, roots: readonly string[]): readonly string[];\n} = Fn.dual(DATA_FIRST_ARITY, (edges: Edges, roots: readonly string[]): readonly string[] =>\n Arr.fromIterable(visit(edges, HashSet.empty(), roots)),\n);\n","import { Array as Arr, Effect, Option, String as Str, pipe } from \"effect\";\n\nimport { RepositoryFiles, nodeRepositoryFiles } from \"./repository-files.ts\";\n\nconst IGNORE_FILES = \":(glob)**/.gitignore\";\nconst SEPARATOR = \"/\";\nconst NEGATION = \"!\";\nconst CONTENTS = \"/**\";\nconst ROOT = \".\";\nconst ANYWHERE = \"**/\";\nconst READ_CONCURRENCY = 16;\nconst DIRECTORY_ENTRY = /^(?<anchor>\\/?)(?<name>[^!#/].*)\\/$/u;\nconst TOOL_DIRECTORIES = [\"**/node_modules/.vite*\"];\nconst WILDCARD = /[*?[]/u;\n\nexport interface IgnoredDirectory {\n readonly pattern: string;\n readonly base: \"workspace\";\n}\n\nconst scopedName = (anchor: string, name: string): string => {\n if (anchor === SEPARATOR || Str.includes(SEPARATOR)(name)) {\n return name;\n }\n return `${ANYWHERE}${name}`;\n};\n\nconst inDirectory =\n (directory: string) =>\n (glob: string): string => {\n if (directory === ROOT) {\n return glob;\n }\n return `${directory}${SEPARATOR}${glob}`;\n };\n\nconst globOf =\n (directory: string) =>\n (line: string): Option.Option<string> => {\n const found = DIRECTORY_ENTRY.exec(Str.trim(line));\n return pipe(\n Option.fromNullishOr(found),\n Option.flatMap(({ groups }) => Option.fromNullishOr(groups)),\n Option.flatMap(({ anchor, name }) =>\n Option.map(Option.fromNullishOr(name), (entry) => scopedName(anchor ?? \"\", entry)),\n ),\n Option.map(inDirectory(directory)),\n );\n };\n\nconst contentsOf = (glob: string): string => `:(glob)${glob}${CONTENTS}`;\n\nconst keptGlob = Effect.fn(\"keptGlob\")(function* keptGlob(root: string, glob: string) {\n const files = yield* RepositoryFiles;\n const listed = yield* files.trackedFiles(root, [contentsOf(glob)]);\n return Option.some(glob).pipe(Option.filter(() => Arr.isReadonlyArrayEmpty(listed)));\n});\n\nconst keptGlobs = Effect.fn(\"keptGlobs\")(function* keptGlobs(\n root: string,\n candidates: readonly string[],\n) {\n const files = yield* RepositoryFiles;\n const listed = yield* files.trackedFiles(root, pipe(candidates, Arr.map(contentsOf)));\n if (Arr.isReadonlyArrayEmpty(listed)) {\n return candidates;\n }\n const kept = yield* Effect.forEach(candidates, (glob) => keptGlob(root, glob), {\n concurrency: READ_CONCURRENCY,\n });\n return Arr.getSomes(kept);\n});\n\nconst globsIn = Effect.fn(\"globsIn\")(function* globsIn(root: string, file: string) {\n const files = yield* RepositoryFiles;\n const text = yield* files.readFile(files.join(root, file));\n const toGlob = globOf(files.dirname(file));\n return pipe(\n Option.getOrElse(text, () => \"\"),\n Str.split(\"\\n\"),\n Arr.map(toGlob),\n Arr.getSomes,\n );\n});\n\nconst ignoredGlobs = Effect.fn(\"ignoredGlobs\")(function* ignoredGlobs(root: string) {\n const files = yield* RepositoryFiles;\n const ignoreFiles = yield* files.trackedFiles(root, [IGNORE_FILES]);\n const globs = yield* Effect.forEach(ignoreFiles, (file) => globsIn(root, file), {\n concurrency: 1,\n });\n const kept = yield* keptGlobs(root, Arr.dedupe(Arr.flatten(globs)));\n return Arr.dedupe([...kept, ...TOOL_DIRECTORIES]);\n});\n\nconst exclusionsOf = (globs: readonly string[]): readonly IgnoredDirectory[] =>\n pipe(\n globs,\n Arr.flatMap((glob): readonly IgnoredDirectory[] => [\n { pattern: `${NEGATION}${glob}`, base: \"workspace\" },\n { pattern: `${NEGATION}${glob}${CONTENTS}`, base: \"workspace\" },\n ]),\n );\n\ninterface Placement {\n readonly parent: readonly string[];\n readonly name: string;\n}\n\nconst placementOf = (glob: string): Option.Option<Placement> =>\n pipe(\n Option.liftPredicate(glob, Str.startsWith(ANYWHERE)),\n Option.map((found) => Str.split(SEPARATOR)(Str.slice(ANYWHERE.length)(found))),\n Option.map((segments) => ({\n parent: Arr.initNonEmpty(segments),\n name: Arr.lastNonEmpty(segments),\n })),\n Option.filter(\n ({ parent }) =>\n Arr.isReadonlyArrayNonEmpty(parent) &&\n !pipe(\n parent,\n Arr.some((segment) => WILDCARD.test(segment)),\n ),\n ),\n );\n\nconst placesOf =\n (parent: readonly string[]) =>\n (file: string): readonly string[] => {\n const segments = Str.split(SEPARATOR)(file);\n return pipe(\n Arr.makeBy(segments.length - parent.length, (start) => start),\n Arr.filter((start) =>\n pipe(\n parent,\n Arr.every((segment, offset) => segments[start + offset] === segment),\n ),\n ),\n Arr.map((start) => Arr.join(Arr.take(segments, start + parent.length), SEPARATOR)),\n );\n };\n\nconst placedGlobs = Effect.fn(\"placedGlobs\")(function* placedGlobs(\n root: string,\n globs: readonly string[],\n) {\n const files = yield* RepositoryFiles;\n const parents = pipe(\n globs,\n Arr.flatMap((glob) => Option.toArray(placementOf(glob))),\n Arr.map(({ parent }) => contentsOf(`${ANYWHERE}${Arr.join(parent, SEPARATOR)}`)),\n );\n const listed = yield* files.trackedFiles(root, Arr.dedupe(parents));\n return pipe(\n globs,\n Arr.flatMap((glob) =>\n Option.match(placementOf(glob), {\n onNone: () => Arr.filter([glob], (kept) => !Str.startsWith(ANYWHERE)(kept)),\n onSome: ({ parent, name }) =>\n pipe(\n listed,\n Arr.flatMap(placesOf(parent)),\n Arr.dedupe,\n Arr.map((place) => `${place}${SEPARATOR}${name}`),\n ),\n }),\n ),\n );\n});\n\nexport const collectIgnoredDirectories = Effect.fn(\"collectIgnoredDirectories\")(\n function* collectIgnoredDirectories(root: string) {\n const globs = yield* ignoredGlobs(root);\n return exclusionsOf(globs);\n },\n);\n\nexport const collectPlacedIgnoredDirectories = Effect.fn(\"collectPlacedIgnoredDirectories\")(\n function* collectPlacedIgnoredDirectories(root: string) {\n const globs = yield* ignoredGlobs(root);\n const placed = yield* placedGlobs(root, globs);\n return exclusionsOf(placed);\n },\n);\n\nexport const ignoredDirectories = (root: string): Promise<readonly IgnoredDirectory[]> =>\n Effect.runPromise(collectIgnoredDirectories(root).pipe(Effect.provide(nodeRepositoryFiles)));\n"],"mappings":";;;AAIA,MAAM,mBAAmB;AAEzB,MAAM,SACJ,OACA,MACA,aAC4B;CAC5B,MAAM,QAAQ,QAAQ,WAAW,QAAQ,aAAa,QAAQ,GAAG,IAAI;CACrE,IAAI,QAAQ,QAAQ,KAAK,GACvB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,OAAO,OAAO,CAAC;CAClE,OAAO,KACL,OACAA,MAAI,SAAS,SACX,OAAO,MAAM,YAAY,IAAI,GAAG;EAC9B,cAAcA,MAAI,OAAO,CAAC,IAAI,IAAI,SAAS,CAACD,OAAI,WAAW,QAAQ,CAAC,CAAC,IAAI,CAAC;EAC1E,SAAS,EAAE,QAAQ,WACjB,KACE,QACAC,MAAI,QAAQ,SAAS,MAAM,CAAC,GAC5BA,MAAI,QACJA,MAAI,KAAK,UAAU,GAAG,QAAQ,YAAY,MAAM,CAClD;CACJ,CAAC,CACH,CACF;AACF,CAAC;AAED,MAAa,4BAA4B,OAAO,GAAG,2BAA2B,CAAC,CAC7E,UAAU,0BAA0B,MAAc;CAChD,MAAM,QAAQ,OAAO,aAAa,IAAI;CACtC,OAAO,aAAa,KAAK;AAC3B,CACF;AAEA,MAAa,kCAAkC,OAAO,GAAG,iCAAiC,CAAC,CACzF,UAAU,gCAAgC,MAAc;CACtD,MAAM,QAAQ,OAAO,aAAa,IAAI;CACtC,MAAM,SAAS,OAAO,YAAY,MAAM,KAAK;CAC7C,OAAO,aAAa,MAAM;AAC5B,CACF;AAEA,MAAa,sBAAsB,SACjC,OAAO,WAAW,0BAA0B,IAAI,CAAC,CAAC,KAAK,OAAO,QAAQ,mBAAmB,CAAC,CAAC"}
|
|
1
|
+
{"version":3,"file":"ignored-directories-BRRODOoG.mjs","names":["Arr","Fn","Str","Arr"],"sources":["../src/shared/lib/reachable.ts","../src/shared/lib/ignored-directories.ts"],"sourcesContent":["import { Array as Arr, Function as Fn, HashSet, pipe } from \"effect\";\n\nexport type Edges = Readonly<Record<string, readonly string[]>>;\n\nconst DATA_FIRST_ARITY = 2;\n\nconst visit = (\n edges: Edges,\n seen: HashSet.HashSet<string>,\n frontier: readonly string[],\n): HashSet.HashSet<string> => {\n const fresh = HashSet.difference(HashSet.fromIterable(frontier), seen);\n if (HashSet.isEmpty(fresh)) {\n return seen;\n }\n const next = pipe(\n Arr.fromIterable(fresh),\n Arr.flatMap((id) => edges[id] ?? []),\n );\n return visit(edges, HashSet.union(seen, fresh), next);\n};\n\nexport const reachable: {\n (roots: readonly string[]): (edges: Edges) => readonly string[];\n (edges: Edges, roots: readonly string[]): readonly string[];\n} = Fn.dual(DATA_FIRST_ARITY, (edges: Edges, roots: readonly string[]): readonly string[] =>\n Arr.fromIterable(visit(edges, HashSet.empty(), roots)),\n);\n","import { Array as Arr, Effect, Option, String as Str, pipe } from \"effect\";\n\nimport { RepositoryFiles, nodeRepositoryFiles } from \"./repository-files.ts\";\n\nconst IGNORE_FILES = \":(glob)**/.gitignore\";\nconst SEPARATOR = \"/\";\nconst NEGATION = \"!\";\nconst CONTENTS = \"/**\";\nconst ROOT = \".\";\nconst ANYWHERE = \"**/\";\nconst READ_CONCURRENCY = 16;\nconst DIRECTORY_ENTRY = /^(?<anchor>\\/?)(?<name>[^!#/].*)\\/$/u;\nconst TOOL_DIRECTORIES = [\"**/node_modules/.vite*\"];\nconst WILDCARD = /[*?[]/u;\n\nexport interface IgnoredDirectory {\n readonly pattern: string;\n readonly base: \"workspace\";\n}\n\nconst scopedName = (anchor: string, name: string): string => {\n if (anchor === SEPARATOR || Str.includes(SEPARATOR)(name)) {\n return name;\n }\n return `${ANYWHERE}${name}`;\n};\n\nconst inDirectory =\n (directory: string) =>\n (glob: string): string => {\n if (directory === ROOT) {\n return glob;\n }\n return `${directory}${SEPARATOR}${glob}`;\n };\n\nconst globOf =\n (directory: string) =>\n (line: string): Option.Option<string> => {\n const found = DIRECTORY_ENTRY.exec(Str.trim(line));\n return pipe(\n Option.fromNullishOr(found),\n Option.flatMap(({ groups }) => Option.fromNullishOr(groups)),\n Option.flatMap(({ anchor, name }) =>\n Option.map(Option.fromNullishOr(name), (entry) => scopedName(anchor ?? \"\", entry)),\n ),\n Option.map(inDirectory(directory)),\n );\n };\n\nconst contentsOf = (glob: string): string => `:(glob)${glob}${CONTENTS}`;\n\nconst keptGlob = Effect.fn(\"keptGlob\")(function* keptGlob(root: string, glob: string) {\n const files = yield* RepositoryFiles;\n const listed = yield* files.trackedFiles(root, [contentsOf(glob)]);\n return Option.some(glob).pipe(Option.filter(() => Arr.isReadonlyArrayEmpty(listed)));\n});\n\nconst keptGlobs = Effect.fn(\"keptGlobs\")(function* keptGlobs(\n root: string,\n candidates: readonly string[],\n) {\n const files = yield* RepositoryFiles;\n const listed = yield* files.trackedFiles(root, pipe(candidates, Arr.map(contentsOf)));\n if (Arr.isReadonlyArrayEmpty(listed)) {\n return candidates;\n }\n const kept = yield* Effect.forEach(candidates, (glob) => keptGlob(root, glob), {\n concurrency: READ_CONCURRENCY,\n });\n return Arr.getSomes(kept);\n});\n\nconst globsIn = Effect.fn(\"globsIn\")(function* globsIn(root: string, file: string) {\n const files = yield* RepositoryFiles;\n const text = yield* files.readFile(files.join(root, file));\n const toGlob = globOf(files.dirname(file));\n return pipe(\n Option.getOrElse(text, () => \"\"),\n Str.split(\"\\n\"),\n Arr.map(toGlob),\n Arr.getSomes,\n );\n});\n\nconst ignoredGlobs = Effect.fn(\"ignoredGlobs\")(function* ignoredGlobs(root: string) {\n const files = yield* RepositoryFiles;\n const ignoreFiles = yield* files.trackedFiles(root, [IGNORE_FILES]);\n const globs = yield* Effect.forEach(ignoreFiles, (file) => globsIn(root, file), {\n concurrency: 1,\n });\n const kept = yield* keptGlobs(root, Arr.dedupe(Arr.flatten(globs)));\n return Arr.dedupe([...kept, ...TOOL_DIRECTORIES]);\n});\n\nconst exclusionsOf = (globs: readonly string[]): readonly IgnoredDirectory[] =>\n pipe(\n globs,\n Arr.flatMap((glob): readonly IgnoredDirectory[] => [\n { pattern: `${NEGATION}${glob}`, base: \"workspace\" },\n { pattern: `${NEGATION}${glob}${CONTENTS}`, base: \"workspace\" },\n ]),\n );\n\ninterface Placement {\n readonly parent: readonly string[];\n readonly name: string;\n}\n\nconst placementOf = (glob: string): Option.Option<Placement> =>\n pipe(\n Option.liftPredicate(glob, Str.startsWith(ANYWHERE)),\n Option.map((found) => Str.split(SEPARATOR)(Str.slice(ANYWHERE.length)(found))),\n Option.map((segments) => ({\n parent: Arr.initNonEmpty(segments),\n name: Arr.lastNonEmpty(segments),\n })),\n Option.filter(\n ({ parent }) =>\n Arr.isReadonlyArrayNonEmpty(parent) &&\n !pipe(\n parent,\n Arr.some((segment) => WILDCARD.test(segment)),\n ),\n ),\n );\n\nconst placesOf =\n (parent: readonly string[]) =>\n (file: string): readonly string[] => {\n const segments = Str.split(SEPARATOR)(file);\n return pipe(\n Arr.makeBy(segments.length - parent.length, (start) => start),\n Arr.filter((start) =>\n pipe(\n parent,\n Arr.every((segment, offset) => segments[start + offset] === segment),\n ),\n ),\n Arr.map((start) => Arr.join(Arr.take(segments, start + parent.length), SEPARATOR)),\n );\n };\n\nconst placedGlobs = Effect.fn(\"placedGlobs\")(function* placedGlobs(\n root: string,\n globs: readonly string[],\n) {\n const files = yield* RepositoryFiles;\n const parents = pipe(\n globs,\n Arr.flatMap((glob) => Option.toArray(placementOf(glob))),\n Arr.map(({ parent }) => contentsOf(`${ANYWHERE}${Arr.join(parent, SEPARATOR)}`)),\n );\n const listed = yield* files.trackedFiles(root, Arr.dedupe(parents));\n return pipe(\n globs,\n Arr.flatMap((glob) =>\n Option.match(placementOf(glob), {\n onNone: () => Arr.filter([glob], (kept) => !Str.startsWith(ANYWHERE)(kept)),\n onSome: ({ parent, name }) =>\n pipe(\n listed,\n Arr.flatMap(placesOf(parent)),\n Arr.dedupe,\n Arr.map((place) => `${place}${SEPARATOR}${name}`),\n ),\n }),\n ),\n );\n});\n\nexport const collectIgnoredDirectories = Effect.fn(\"collectIgnoredDirectories\")(\n function* collectIgnoredDirectories(root: string) {\n const globs = yield* ignoredGlobs(root);\n return exclusionsOf(globs);\n },\n);\n\nexport const collectPlacedIgnoredDirectories = Effect.fn(\"collectPlacedIgnoredDirectories\")(\n function* collectPlacedIgnoredDirectories(root: string) {\n const globs = yield* ignoredGlobs(root);\n const placed = yield* placedGlobs(root, globs);\n return exclusionsOf(placed);\n },\n);\n\nexport const ignoredDirectories = (root: string): Promise<readonly IgnoredDirectory[]> =>\n Effect.runPromise(collectIgnoredDirectories(root).pipe(Effect.provide(nodeRepositoryFiles)));\n"],"mappings":";;;AAIA,MAAM,mBAAmB;AAEzB,MAAM,SACJ,OACA,MACA,aAC4B;CAC5B,MAAM,QAAQ,QAAQ,WAAW,QAAQ,aAAa,QAAQ,GAAG,IAAI;CACrE,IAAI,QAAQ,QAAQ,KAAK,GACvB,OAAO;CAET,MAAM,OAAO,KACXA,MAAI,aAAa,KAAK,GACtBA,MAAI,SAAS,OAAO,MAAM,OAAO,CAAC,CAAC,CACrC;CACA,OAAO,MAAM,OAAO,QAAQ,MAAM,MAAM,KAAK,GAAG,IAAI;AACtD;AAEA,MAAa,YAGTC,SAAG,KAAK,mBAAmB,OAAc,UAC3CD,MAAI,aAAa,MAAM,OAAO,QAAQ,MAAM,GAAG,KAAK,CAAC,CACvD;;ACvBA,MAAM,eAAe;AACrB,MAAM,YAAY;AAClB,MAAM,WAAW;AACjB,MAAM,WAAW;AACjB,MAAM,OAAO;AACb,MAAM,WAAW;AACjB,MAAM,mBAAmB;AACzB,MAAM,kBAAkB;AACxB,MAAM,mBAAmB,CAAC,wBAAwB;AAClD,MAAM,WAAW;AAOjB,MAAM,cAAc,QAAgB,SAAyB;CAC3D,IAAI,WAAW,aAAaE,OAAI,SAAS,SAAS,CAAC,CAAC,IAAI,GACtD,OAAO;CAET,OAAO,GAAG,WAAW;AACvB;AAEA,MAAM,eACH,eACA,SAAyB;CACxB,IAAI,cAAc,MAChB,OAAO;CAET,OAAO,GAAG,YAAY,YAAY;AACpC;AAEF,MAAM,UACH,eACA,SAAwC;CACvC,MAAM,QAAQ,gBAAgB,KAAKA,OAAI,KAAK,IAAI,CAAC;CACjD,OAAO,KACL,OAAO,cAAc,KAAK,GAC1B,OAAO,SAAS,EAAE,aAAa,OAAO,cAAc,MAAM,CAAC,GAC3D,OAAO,SAAS,EAAE,QAAQ,WACxB,OAAO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parse } from "yaml";
|
|
4
|
+
// src/shared/lib/frontmatter.ts
|
|
5
|
+
const FRONTMATTER = /^---\n(?<yaml>[\s\S]*?)\n---\n/u;
|
|
6
|
+
const START = 0;
|
|
7
|
+
const Fields = Schema.Record(Schema.String, Schema.Unknown);
|
|
8
|
+
const decodeFields = Schema.decodeUnknownOption(Fields);
|
|
9
|
+
const splitFrontmatter = (source) => pipe(Option.fromNullishOr(FRONTMATTER.exec(source)), Option.flatMap((found) => pipe(groupOf("yaml")(found), Option.flatMap(Option.liftThrowable((yaml) => parse(yaml))), Option.flatMap(decodeFields), Option.map((fields) => ({
|
|
10
|
+
fields,
|
|
11
|
+
body: String.slice(found[START].length)(source)
|
|
12
|
+
})))));
|
|
13
|
+
// src/shared/lib/index-skill.ts
|
|
14
|
+
const INDEX_ROLE = "index";
|
|
15
|
+
/** @internal */
|
|
16
|
+
const isIndexSkill = ({ fields }) => Predicate.isObject(fields["metadata"]) && Predicate.hasProperty(fields["metadata"], "role") && fields["metadata"].role === INDEX_ROLE;
|
|
17
|
+
export { FRONTMATTER as n, splitFrontmatter as r, isIndexSkill as t };
|
|
18
|
+
|
|
19
|
+
//# sourceMappingURL=index-skill-Bf5Ish11.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index-skill-Bf5Ish11.mjs","names":["Str"],"sources":["../src/shared/lib/frontmatter.ts","../src/shared/lib/index-skill.ts"],"sourcesContent":["import { groupOf } from \"@masseater.dev/lint-host/collections\";\nimport { Option, Schema, String as Str, pipe } from \"effect\";\nimport { parse } from \"yaml\";\n\nexport const FRONTMATTER = /^---\\n(?<yaml>[\\s\\S]*?)\\n---\\n/u;\n\nconst START = 0;\nconst Fields = Schema.Record(Schema.String, Schema.Unknown);\nconst decodeFields = Schema.decodeUnknownOption(Fields);\n\nexport interface Frontmatter {\n readonly fields: typeof Fields.Type;\n readonly body: string;\n}\n\nexport const splitFrontmatter = (source: string): Option.Option<Frontmatter> =>\n pipe(\n Option.fromNullishOr(FRONTMATTER.exec(source)),\n Option.flatMap((found) =>\n pipe(\n groupOf(\"yaml\")(found),\n Option.flatMap(Option.liftThrowable((yaml: string): unknown => parse(yaml))),\n Option.flatMap(decodeFields),\n Option.map((fields): Frontmatter => ({\n fields,\n body: Str.slice(found[START].length)(source),\n })),\n ),\n ),\n );\n","import { Predicate } from \"effect\";\n\nimport type { Frontmatter } from \"./frontmatter.ts\";\n\nconst INDEX_ROLE = \"index\";\n\n/** @internal */\nexport const isIndexSkill = ({ fields }: Frontmatter): boolean =>\n Predicate.isObject(fields[\"metadata\"]) &&\n Predicate.hasProperty(fields[\"metadata\"], \"role\") &&\n fields[\"metadata\"].role === INDEX_ROLE;\n"],"mappings":";;;;AAIA,MAAa,cAAc;AAE3B,MAAM,QAAQ;AACd,MAAM,SAAS,OAAO,OAAO,OAAO,QAAQ,OAAO,OAAO;AAC1D,MAAM,eAAe,OAAO,oBAAoB,MAAM;AAOtD,MAAa,oBAAoB,WAC/B,KACE,OAAO,cAAc,YAAY,KAAK,MAAM,CAAC,GAC7C,OAAO,SAAS,UACd,KACE,QAAQ,MAAM,CAAC,CAAC,KAAK,GACrB,OAAO,QAAQ,OAAO,eAAe,SAA0B,MAAM,IAAI,CAAC,CAAC,GAC3E,OAAO,QAAQ,YAAY,GAC3B,OAAO,KAAK,YAAyB;CACnC;CACA,MAAMA,OAAI,MAAM,MAAM,MAAM,CAAC,MAAM,CAAC,CAAC,MAAM;AAC7C,EAAE,CACJ,CACF,CACF;;ACzBF,MAAM,aAAa;;AAGnB,MAAa,gBAAgB,EAAE,aAC7B,UAAU,SAAS,OAAO,WAAW,KACrC,UAAU,YAAY,OAAO,aAAa,MAAM,KAChD,OAAO,WAAW,CAAC,SAAS"}
|
package/dist/judge.mjs
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import { i as writeProblems, n as failWhenAny, r as writeJsonProblems } from "./output-
|
|
3
|
-
import { t as runCli } from "./runtime-
|
|
2
|
+
import { i as writeProblems, n as failWhenAny, r as writeJsonProblems } from "./output-B4GNchqH.mjs";
|
|
3
|
+
import { t as runCli } from "./runtime-BdEuIL6Z.mjs";
|
|
4
4
|
import { n as DECISION_TIMEOUT_MS, t as DECISION_MODEL } from "./config-BBdsNPSO.mjs";
|
|
5
|
-
import { a as problemAtPosition, o as problemInFile, s as sortProblems } from "./problem-
|
|
6
|
-
import { r as RepositoryFiles } from "./repository-files-
|
|
5
|
+
import { a as problemAtPosition, o as problemInFile, s as sortProblems } from "./problem-Bi4Kgg9b.mjs";
|
|
6
|
+
import { r as RepositoryFiles } from "./repository-files-hbJpQ1i0.mjs";
|
|
7
7
|
import { t as JSON_FLAG } from "./cli-contract-D7btWrEu.mjs";
|
|
8
8
|
import { Array, Effect, FileSystem, Option, Order, Path, Schema, Stdio, Stream, String as String$1, pipe } from "effect";
|
|
9
9
|
import { ChildProcess } from "effect/process";
|
package/dist/lint.mjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export { c as INSTRUMENTATION, g as alchemyOverride, d as allRulesOf, _ as cloudflareResourceSyntax, v as commandsOverride, h as decisionPlugin, f as decisionRules, p as decisionTestRules, m as generated, u as lint, t as markdownOf, o as remotionRules, y as removalPolicyOverride, b as removalPolicySyntax, l as requiredStack, i as structureOf, n as textlintFilters, r as textlintPresets, s as tracedRules, a as videoRules } from "./define-lint-preset-
|
|
1
|
+
export { c as INSTRUMENTATION, g as alchemyOverride, d as allRulesOf, _ as cloudflareResourceSyntax, v as commandsOverride, h as decisionPlugin, f as decisionRules, p as decisionTestRules, m as generated, u as lint, t as markdownOf, o as remotionRules, y as removalPolicyOverride, b as removalPolicySyntax, l as requiredStack, i as structureOf, n as textlintFilters, r as textlintPresets, s as tracedRules, a as videoRules } from "./define-lint-preset-BjHY5WNt.mjs";
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { t as JSON_FLAG } from "./cli-contract-D7btWrEu.mjs";
|
|
2
|
-
import { r as RepositoryFiles } from "./repository-files-
|
|
3
|
-
import { a as writeStdout, t as ProblemsFound } from "./output-
|
|
2
|
+
import { r as RepositoryFiles } from "./repository-files-hbJpQ1i0.mjs";
|
|
3
|
+
import { a as writeStdout, t as ProblemsFound } from "./output-B4GNchqH.mjs";
|
|
4
4
|
import { Array, Effect, Order, Schema, Stdio, pipe } from "effect";
|
|
5
5
|
// src/app/lookup-report.ts
|
|
6
6
|
const NONE_FOUND = 0;
|
|
@@ -26,4 +26,4 @@ const lookupReport = ({ row, rows, describe }) => Effect.gen(function* report()
|
|
|
26
26
|
});
|
|
27
27
|
export { lookupReport as t };
|
|
28
28
|
|
|
29
|
-
//# sourceMappingURL=lookup-report-
|
|
29
|
+
//# sourceMappingURL=lookup-report-BWiDFlSS.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"lookup-report-
|
|
1
|
+
{"version":3,"file":"lookup-report-BWiDFlSS.mjs","names":["Arr"],"sources":["../src/app/lookup-report.ts"],"sourcesContent":["import { Array as Arr, Effect, Order, Schema, Stdio, pipe } from \"effect\";\n\nimport { JSON_FLAG } from \"#/shared/lib/cli-contract.ts\";\nimport { RepositoryFiles } from \"#/shared/lib/repository-files.ts\";\n\nimport { ProblemsFound, writeStdout } from \"./output.ts\";\n\nconst NONE_FOUND = 0;\nconst LINE_BREAK = \"\\n\";\n\nconst byPlace = Order.Struct({ file: Order.String, line: Order.Number });\n\n/** @internal */\nexport interface Place {\n readonly file: string;\n readonly line: number;\n}\n\n/** @internal */\nexport interface LookupReport<Row extends Place, Failure, Requirements> {\n readonly row: Schema.Codec<Row>;\n readonly rows: (root: string) => Effect.Effect<readonly Row[], Failure, Requirements>;\n readonly describe: (row: Row) => string;\n}\n\nconst textOf =\n <Row extends Place>(row: Schema.Codec<Row>, describe: (row: Row) => string) =>\n (json: boolean, rows: readonly Row[]): Effect.Effect<string, Schema.SchemaError> => {\n if (json) {\n return Schema.encodeEffect(row.pipe(Schema.Array, Schema.fromJsonString))(rows);\n }\n return Effect.succeed(\n pipe(\n rows,\n Arr.map((found) => `${describe(found)}${LINE_BREAK}`),\n Arr.join(\"\"),\n ),\n );\n };\n\n/** @internal */\nexport const lookupReport = <Row extends Place, Failure, Requirements>({\n row,\n rows,\n describe,\n}: LookupReport<Row, Failure, Requirements>): Effect.Effect<\n number,\n Failure | Schema.SchemaError | ProblemsFound,\n Requirements | RepositoryFiles | Stdio.Stdio\n> =>\n Effect.gen(function* report() {\n const stdio = yield* Stdio.Stdio;\n const files = yield* RepositoryFiles;\n const args = yield* stdio.args;\n const found = yield* rows(files.resolve(\".\"));\n const text = yield* textOf(row, describe)(\n Arr.contains(args, JSON_FLAG),\n Arr.sort(found, byPlace),\n );\n yield* writeStdout(text);\n if (found.length > NONE_FOUND) {\n return yield* ProblemsFound.make({ count: found.length });\n }\n return NONE_FOUND;\n });\n"],"mappings":";;;;;AAOA,MAAM,aAAa;AACnB,MAAM,aAAa;AAEnB,MAAM,UAAU,MAAM,OAAO;CAAE,MAAM,MAAM;CAAQ,MAAM,MAAM;AAAO,CAAC;AAevE,MAAM,UACgB,KAAwB,cAC3C,MAAe,SAAoE;CAClF,IAAI,MACF,OAAO,OAAO,aAAa,IAAI,KAAK,OAAO,OAAO,OAAO,cAAc,CAAC,CAAC,CAAC,IAAI;CAEhF,OAAO,OAAO,QACZ,KACE,MACAA,MAAI,KAAK,UAAU,GAAG,SAAS,KAAK,IAAI,YAAY,GACpDA,MAAI,KAAK,EAAE,CACb,CACF;AACF;;AAGF,MAAa,gBAA0D,EACrE,KACA,MACA,eAMA,OAAO,IAAI,UAAU,SAAS;CAC5B,MAAM,QAAQ,OAAO,MAAM;CAC3B,MAAM,QAAQ,OAAO;CACrB,MAAM,OAAO,OAAO,MAAM;CAC1B,MAAM,QAAQ,OAAO,KAAK,MAAM,QAAQ,GAAG,CAAC;CAC5C,MAAM,OAAO,OAAO,OAAO,KAAK,QAAQ,CAAC,CACvCA,MAAI,SAAS,MAAM,SAAS,GAC5BA,MAAI,KAAK,OAAO,OAAO,CACzB;CACA,OAAO,YAAY,IAAI;CACvB,IAAI,MAAM,SAAS,YACjB,OAAO,OAAO,cAAc,KAAK,EAAE,OAAO,MAAM,OAAO,CAAC;CAE1D,OAAO;AACT,CAAC"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { r as RepositoryFiles } from "./repository-files-
|
|
1
|
+
import { r as RepositoryFiles } from "./repository-files-hbJpQ1i0.mjs";
|
|
2
2
|
import { Array, Effect, Option, pipe } from "effect";
|
|
3
3
|
// src/shared/lib/manifest-texts.ts
|
|
4
4
|
const MANIFEST = /(?:^|\/)package\.json$/u;
|
|
@@ -16,4 +16,4 @@ const manifestTexts = Effect.fn("manifestTexts")(function* manifestTexts(root) {
|
|
|
16
16
|
});
|
|
17
17
|
export { manifestTexts as t };
|
|
18
18
|
|
|
19
|
-
//# sourceMappingURL=manifest-texts-
|
|
19
|
+
//# sourceMappingURL=manifest-texts-Bhlz2Z2_.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"manifest-texts-
|
|
1
|
+
{"version":3,"file":"manifest-texts-Bhlz2Z2_.mjs","names":["Arr"],"sources":["../src/shared/lib/manifest-texts.ts"],"sourcesContent":["import { Array as Arr, Effect, Option, pipe } from \"effect\";\n\nimport { RepositoryFiles } from \"./repository-files.ts\";\n\nconst MANIFEST = /(?:^|\\/)package\\.json$/u;\nconst READ_CONCURRENCY = 16;\n\n/** @internal */\nexport interface ManifestText {\n readonly file: string;\n readonly text: string;\n}\n\n/** @internal */\nexport const manifestTexts = Effect.fn(\"manifestTexts\")(function* manifestTexts(root: string) {\n const files = yield* RepositoryFiles;\n const listed = yield* files.listedFiles(root);\n const names = pipe(\n listed,\n Arr.filter((name) => MANIFEST.test(name)),\n );\n const read = yield* Effect.forEach(\n names,\n (file) =>\n Effect.map(\n files.readFile(files.join(root, file)),\n Option.map((text): ManifestText => ({ file, text })),\n ),\n { concurrency: READ_CONCURRENCY },\n );\n return Arr.getSomes(read);\n});\n"],"mappings":";;;AAIA,MAAM,WAAW;AACjB,MAAM,mBAAmB;;AASzB,MAAa,gBAAgB,OAAO,GAAG,eAAe,CAAC,CAAC,UAAU,cAAc,MAAc;CAC5F,MAAM,QAAQ,OAAO;CACrB,MAAM,SAAS,OAAO,MAAM,YAAY,IAAI;CAC5C,MAAM,QAAQ,KACZ,QACAA,MAAI,QAAQ,SAAS,SAAS,KAAK,IAAI,CAAC,CAC1C;CACA,MAAM,OAAO,OAAO,OAAO,QACzB,QACC,SACC,OAAO,IACL,MAAM,SAAS,MAAM,KAAK,MAAM,IAAI,CAAC,GACrC,OAAO,KAAK,UAAwB;EAAE;EAAM;CAAK,EAAE,CACrD,GACF,EAAE,aAAa,iBAAiB,CAClC;CACA,OAAOA,MAAI,SAAS,IAAI;AAC1B,CAAC"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { r as formatProblem, t as ProblemList } from "./problem-
|
|
2
|
-
import { r as RepositoryFiles } from "./repository-files-
|
|
1
|
+
import { r as formatProblem, t as ProblemList } from "./problem-Bi4Kgg9b.mjs";
|
|
2
|
+
import { r as RepositoryFiles } from "./repository-files-hbJpQ1i0.mjs";
|
|
3
3
|
import { Array, Effect, Runtime, Schema, Stdio, Stream, pipe } from "effect";
|
|
4
4
|
// src/app/output.ts
|
|
5
5
|
const taggedError = Schema.TaggedError;
|
|
@@ -30,4 +30,4 @@ const failWhenAny = (count) => {
|
|
|
30
30
|
};
|
|
31
31
|
export { writeStdout as a, writeProblems as i, failWhenAny as n, writeJsonProblems as r, ProblemsFound as t };
|
|
32
32
|
|
|
33
|
-
//# sourceMappingURL=output-
|
|
33
|
+
//# sourceMappingURL=output-B4GNchqH.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"output-
|
|
1
|
+
{"version":3,"file":"output-B4GNchqH.mjs","names":["Arr"],"sources":["../src/app/output.ts"],"sourcesContent":["import { Array as Arr, Effect, Runtime, Schema, Stdio, Stream, pipe } from \"effect\";\n\nimport { ProblemList, formatProblem } from \"#/shared/lib/problem.ts\";\nimport type { Problem } from \"#/shared/lib/problem.ts\";\nimport { RepositoryFiles } from \"#/shared/lib/repository-files.ts\";\n\nconst taggedError = Schema.TaggedError;\nconst NO_PROBLEMS = 0;\n\nexport class ProblemsFound extends taggedError<ProblemsFound, { readonly brand: unique symbol }>()(\n \"ProblemsFound\",\n {\n count: Schema.Finite,\n },\n) {\n public override readonly [Runtime.errorReported] = false;\n}\n\n/** @internal */\nexport const writeStdout = Effect.fn(\"writeStdout\")(function* writeStdout(text: string) {\n const stdio = yield* Stdio.Stdio;\n yield* Stream.make(text).pipe(Stream.run(stdio.stdout()), Effect.orDie);\n});\n\n/** @internal */\nexport const writeProblems =\n (root: string) =>\n (problems: readonly Problem[]): Effect.Effect<void, never, RepositoryFiles | Stdio.Stdio> =>\n Effect.gen(function* report() {\n const files = yield* RepositoryFiles;\n const format = formatProblem((file) => files.relative(root, file));\n yield* writeStdout(\n pipe(\n problems,\n Arr.map((problem) => `${format(problem)}\\n`),\n Arr.join(\"\"),\n ),\n );\n });\n\n/** @internal */\nexport const writeJsonProblems = Effect.fn(\"writeJsonProblems\")(function* writeJsonProblems(\n problems: readonly Problem[],\n) {\n const text = yield* Schema.encodeEffect(Schema.fromJsonString(ProblemList))(problems);\n return yield* writeStdout(text);\n});\n\n/** @internal */\nexport const failWhenAny = (count: number): Effect.Effect<void, ProblemsFound> => {\n if (count > NO_PROBLEMS) {\n return Effect.fail(ProblemsFound.make({ count }));\n }\n return Effect.void;\n};\n"],"mappings":";;;;AAMA,MAAM,cAAc,OAAO;AAC3B,MAAM,cAAc;AAEpB,IAAa,gBAAb,cAAmC,YAA8D,CAAC,CAChG,iBACA,EACE,OAAO,OAAO,OAChB,CACF,CAAC,CAAC;CACA,CAA0B,QAAQ,iBAAiB;AACrD;;AAGA,MAAa,cAAc,OAAO,GAAG,aAAa,CAAC,CAAC,UAAU,YAAY,MAAc;CACtF,MAAM,QAAQ,OAAO,MAAM;CAC3B,OAAO,OAAO,KAAK,IAAI,CAAC,CAAC,KAAK,OAAO,IAAI,MAAM,OAAO,CAAC,GAAG,OAAO,KAAK;AACxE,CAAC;;AAGD,MAAa,iBACV,UACA,aACC,OAAO,IAAI,UAAU,SAAS;CAC5B,MAAM,QAAQ,OAAO;CACrB,MAAM,SAAS,eAAe,SAAS,MAAM,SAAS,MAAM,IAAI,CAAC;CACjE,OAAO,YACL,KACE,UACAA,MAAI,KAAK,YAAY,GAAG,OAAO,OAAO,EAAE,GAAG,GAC3CA,MAAI,KAAK,EAAE,CACb,CACF;AACF,CAAC;;AAGL,MAAa,oBAAoB,OAAO,GAAG,mBAAmB,CAAC,CAAC,UAAU,kBACxE,UACA;CACA,MAAM,OAAO,OAAO,OAAO,aAAa,OAAO,eAAe,WAAW,CAAC,CAAC,CAAC,QAAQ;CACpF,OAAO,OAAO,YAAY,IAAI;AAChC,CAAC;;AAGD,MAAa,eAAe,UAAsD;CAChF,IAAI,QAAQ,aACV,OAAO,OAAO,KAAK,cAAc,KAAK,EAAE,MAAM,CAAC,CAAC;CAElD,OAAO,OAAO;AAChB"}
|
package/dist/oxlint.mjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { n as describeFinding, t as ProblemList } from "./problem-
|
|
1
|
+
import { n as describeFinding, t as ProblemList } from "./problem-Bi4Kgg9b.mjs";
|
|
2
2
|
import { t as JSON_FLAG } from "./cli-contract-D7btWrEu.mjs";
|
|
3
|
-
import { a as nodeServicesLayer } from "./repository-files-
|
|
3
|
+
import { a as nodeServicesLayer } from "./repository-files-hbJpQ1i0.mjs";
|
|
4
4
|
import { Array, Effect, Layer, Schema, Stream, pipe } from "effect";
|
|
5
5
|
import { ChildProcess } from "effect/process";
|
|
6
6
|
// src/features/report-problems/model/oxlint-rule.ts
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
import { t as manifestTexts } from "./manifest-texts-Bhlz2Z2_.mjs";
|
|
2
|
+
import { n as PUBLIC_REGISTRY, r as scopeOfName } from "./registries-DePiYd3D.mjs";
|
|
3
|
+
import { Array, Config, Effect, Option, String, pipe } from "effect";
|
|
4
|
+
import { decodePackageJson } from "@r_masseater/masseater-utils/kestrion/npm";
|
|
5
|
+
import { HttpClient, HttpClientRequest, HttpClientResponse } from "effect/http";
|
|
6
|
+
// package.json
|
|
7
|
+
var name = "@r_masseater/msch";
|
|
8
|
+
var homepage = "https://github.com/masseater/ecosystems/tree/main/libs/msch#readme";
|
|
9
|
+
var repository = {
|
|
10
|
+
"type": "git",
|
|
11
|
+
"url": "git+https://github.com/masseater/ecosystems.git",
|
|
12
|
+
"directory": "libs/msch"
|
|
13
|
+
};
|
|
14
|
+
// src/shared/config/self.ts
|
|
15
|
+
const GIT_PREFIX = /^git\+/u;
|
|
16
|
+
const GIT_SUFFIX = /\.git$/u;
|
|
17
|
+
const GITHUB = "https://github.com/";
|
|
18
|
+
const SELF_NAME = name;
|
|
19
|
+
const SELF_HOMEPAGE = homepage;
|
|
20
|
+
const SELF_DIRECTORY = repository.directory;
|
|
21
|
+
const RENOVATE_PRESET = `github>${pipe(repository.url, String.replace(GIT_PREFIX, ""), String.replace(GIT_SUFFIX, ""), String.replace(GITHUB, ""))}//${SELF_DIRECTORY}/renovate`;
|
|
22
|
+
// src/shared/lib/lookup.ts
|
|
23
|
+
const USER_AGENT = `msch (${SELF_HOMEPAGE})`;
|
|
24
|
+
/** @internal */
|
|
25
|
+
const JSON_ACCEPT = "application/json";
|
|
26
|
+
const requestOf = ({ url, token, accept }) => {
|
|
27
|
+
const request = HttpClientRequest.get(url).pipe(HttpClientRequest.setHeader("user-agent", USER_AGENT), HttpClientRequest.setHeader("accept", accept));
|
|
28
|
+
return Option.match(token, {
|
|
29
|
+
onNone: () => request,
|
|
30
|
+
onSome: (value) => HttpClientRequest.bearerToken(value)(request)
|
|
31
|
+
});
|
|
32
|
+
};
|
|
33
|
+
/** @internal */
|
|
34
|
+
const sent = (lookup) => HttpClient.HttpClient.pipe(Effect.flatMap((client) => client.execute(requestOf(lookup))));
|
|
35
|
+
/** @internal */
|
|
36
|
+
const fetched = (lookup) => sent(lookup).pipe(Effect.flatMap(HttpClientResponse.filterStatusOk));
|
|
37
|
+
/** @internal */
|
|
38
|
+
const jsonLookup = ({ url, token }) => ({
|
|
39
|
+
url,
|
|
40
|
+
token,
|
|
41
|
+
accept: JSON_ACCEPT
|
|
42
|
+
});
|
|
43
|
+
/** @internal */
|
|
44
|
+
const publicLookup = (url) => jsonLookup({
|
|
45
|
+
url,
|
|
46
|
+
token: Option.none()
|
|
47
|
+
});
|
|
48
|
+
/** @internal */
|
|
49
|
+
const githubToken = Config.option(Config.String("GH_TOKEN").pipe(Config.orElse(() => Config.String("GITHUB_TOKEN")))).pipe(Effect.orElseSucceed(() => Option.none()));
|
|
50
|
+
// src/shared/lib/package-routes.ts
|
|
51
|
+
/** @internal */
|
|
52
|
+
const packageRoutes = Effect.fn("packageRoutes")(function* packageRoutes(root) {
|
|
53
|
+
const manifests = yield* manifestTexts(root);
|
|
54
|
+
return { ownScopes: Array.dedupe(pipe(manifests, Array.flatMap(({ text }) => pipe(decodePackageJson(text), Option.flatMap(({ name }) => Option.fromUndefinedOr(name)), Option.flatMap(scopeOfName), Option.toArray)))) };
|
|
55
|
+
});
|
|
56
|
+
/** @internal */
|
|
57
|
+
const isOwnPackage = ({ ownScopes }) => (name) => Option.exists(scopeOfName(name), (scope) => Array.contains(ownScopes, scope));
|
|
58
|
+
/** @internal */
|
|
59
|
+
const packageLookup = (name) => jsonLookup({
|
|
60
|
+
url: `${PUBLIC_REGISTRY}${String.replace("/", "%2f")(name)}`,
|
|
61
|
+
token: Option.none()
|
|
62
|
+
});
|
|
63
|
+
const ABBREVIATED = "application/vnd.npm.install-v1+json";
|
|
64
|
+
/** @internal */
|
|
65
|
+
const abbreviatedLookup = (name) => ({
|
|
66
|
+
...packageLookup(name),
|
|
67
|
+
accept: ABBREVIATED
|
|
68
|
+
});
|
|
69
|
+
/** @internal */
|
|
70
|
+
const abbreviatedPackument = (name) => sent(abbreviatedLookup(name));
|
|
71
|
+
export { packageRoutes as a, jsonLookup as c, RENOVATE_PRESET as d, SELF_NAME as f, packageLookup as i, publicLookup as l, abbreviatedPackument as n, fetched as o, isOwnPackage as r, githubToken as s, abbreviatedLookup as t, sent as u };
|
|
72
|
+
|
|
73
|
+
//# sourceMappingURL=package-routes-BdYpOLTv.mjs.map
|