@r_masseater/msch 0.134.0 → 0.141.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.
Files changed (55) hide show
  1. package/dist/addon-tasks.mjs +1 -1
  2. package/dist/build-workspace-settings-C2EOC9GX.mjs +627 -0
  3. package/dist/build-workspace-settings-C2EOC9GX.mjs.map +1 -0
  4. package/dist/cargo-inputs.mjs +1 -1
  5. package/dist/cli.mjs +711 -752
  6. package/dist/cli.mjs.map +1 -1
  7. package/dist/config.d.mts +13 -37
  8. package/dist/config.mjs +335 -23
  9. package/dist/config.mjs.map +1 -1
  10. package/dist/decision-rules-CqgOVodl.mjs +43 -0
  11. package/dist/decision-rules-CqgOVodl.mjs.map +1 -0
  12. package/dist/decision-rules.d.mts +2 -1
  13. package/dist/decision-rules.mjs +1 -1
  14. package/dist/{dependencies-Bjn3xWkq.mjs → dependencies-DgltkhvK.mjs} +2 -2
  15. package/dist/{dependencies-Bjn3xWkq.mjs.map → dependencies-DgltkhvK.mjs.map} +1 -1
  16. package/dist/{derive-cargo-inputs-BLMqkRS3.mjs → derive-cargo-inputs-DbMOBcGP.mjs} +3 -3
  17. package/dist/{derive-cargo-inputs-BLMqkRS3.mjs.map → derive-cargo-inputs-DbMOBcGP.mjs.map} +1 -1
  18. package/dist/{ignored-directories-CaTFIbjo.mjs → ignored-directories-BGiOSvNx.mjs} +2 -2
  19. package/dist/{ignored-directories-CaTFIbjo.mjs.map → ignored-directories-BGiOSvNx.mjs.map} +1 -1
  20. package/dist/index-DOkaGaUe.d.mts +25 -0
  21. package/dist/library.mjs +2 -2
  22. package/dist/lint.d.mts +38 -2
  23. package/dist/lint.mjs +20 -1
  24. package/dist/lint.mjs.map +1 -0
  25. package/dist/oxlint.mjs +2 -2
  26. package/dist/{problem-Dk1svgmC.mjs → problem-CkDaLJxX.mjs} +2 -2
  27. package/dist/{problem-Dk1svgmC.mjs.map → problem-CkDaLJxX.mjs.map} +1 -1
  28. package/dist/{published-Cgl1qeYH.mjs → published-BrX24558.mjs} +269 -8
  29. package/dist/published-BrX24558.mjs.map +1 -0
  30. package/dist/{repository-files-C_GzAnYp.mjs → repository-files-CX48nfE5.mjs} +4 -5
  31. package/dist/repository-files-CX48nfE5.mjs.map +1 -0
  32. package/dist/{define-lint-preset-_bDnJMcY.mjs → repository-text-CpD8Z1kp.mjs} +355 -380
  33. package/dist/repository-text-CpD8Z1kp.mjs.map +1 -0
  34. package/dist/traced-rules.config-CnYNZrOa.mjs +8 -0
  35. package/dist/traced-rules.config-CnYNZrOa.mjs.map +1 -0
  36. package/dist/workspace-settings.mjs +2 -434
  37. package/dist/zenn-markdown.config-uksui7Go.mjs +77 -0
  38. package/dist/zenn-markdown.config-uksui7Go.mjs.map +1 -0
  39. package/package.json +13 -13
  40. package/skills/msch-checks/SKILL.md +5 -5
  41. package/skills/msch-publishing/SKILL.md +1 -1
  42. package/skills/msch-repository-config/SKILL.md +19 -18
  43. package/skills/msch-workspace-settings/SKILL.md +15 -9
  44. package/src/app/vite.d.ts +5 -8
  45. package/dist/define-lint-preset-_bDnJMcY.mjs.map +0 -1
  46. package/dist/index-_y7Igwy0.d.mts +0 -321
  47. package/dist/published-Cgl1qeYH.mjs.map +0 -1
  48. package/dist/repository-files-C_GzAnYp.mjs.map +0 -1
  49. package/dist/repository-text-BPhi-pct.mjs +0 -331
  50. package/dist/repository-text-BPhi-pct.mjs.map +0 -1
  51. package/dist/required-stack-BLSiAmpx.mjs +0 -188
  52. package/dist/required-stack-BLSiAmpx.mjs.map +0 -1
  53. package/dist/workspace-projects-Zg078aA1.mjs +0 -269
  54. package/dist/workspace-projects-Zg078aA1.mjs.map +0 -1
  55. package/dist/workspace-settings.mjs.map +0 -1
@@ -1 +1 @@
1
- {"version":3,"file":"config.mjs","names":["Arr","MESSAGE","Arr","MESSAGE","MESSAGE","SEPARATOR","FILTER_KEYS","QUOTED","Arr","Str","SEPARATOR","Arr","Str","MESSAGE","Arr","Arr","Str","MESSAGE","Arr","Str","Arr","Rec","Arr","Rec","preset","Arr"],"sources":["../src/features/guard-workflows/model/yaml.ts","../src/features/guard-workflows/model/publish-trigger.ts","../src/features/guard-workflows/model/release-please.ts","../src/features/guard-workflows/model/workflow-commit.ts","../src/features/guard-workflows/model/repository-services.ts","../src/features/guard-workflows/model/workflow-references.ts","../src/features/guard-workflows/model/workflow-package.ts","../src/features/guard-workflows/model/workflow-path-filter.ts","../src/features/guard-workflows/model/workflow-path.ts","../src/features/guard-workflows/model/workflow-queue.ts","../src/features/guard-workflows/model/workflow-script.ts","../src/features/guard-workflows/model/policy.ts","../src/features/guard-workflows/model/fu4-config.ts","../src/app/repository-commit.ts","../src/app/repository-dependencies.ts","../src/app/repository-config.ts"],"sourcesContent":["import type { RuleContext, YamlNode } from \"@r_masseater/fu4\";\nimport { pairsOf, valueAt } from \"@r_masseater/fu4/rules\";\nimport { Array as Arr, Option, pipe } from \"effect\";\n\nexport interface Located {\n readonly text: string;\n readonly line: number;\n readonly column: number;\n}\n\nexport const rootOf = ({ source }: RuleContext): Option.Option<YamlNode> =>\n Option.fromNullishOr(source.yaml);\n\nexport const stringOf = (node: Option.Option<YamlNode>): Option.Option<Located> =>\n pipe(\n node,\n Option.filter(({ kind }) => kind === \"scalar\"),\n Option.map(({ value, line, column }) => ({ text: value, line, column })),\n );\n\nexport const childOf =\n (key: string) =>\n (node: Option.Option<YamlNode>): Option.Option<YamlNode> =>\n pipe(node, Option.flatMap(valueAt(key)));\n\nexport const keyNodeOf =\n (key: string) =>\n (node: Option.Option<YamlNode>): Option.Option<YamlNode> =>\n pipe(\n node,\n Option.flatMap((mapping) =>\n pipe(\n pairsOf(mapping),\n Arr.findFirst((pair) => pair.key.value === key),\n Option.map((pair) => pair.key),\n ),\n ),\n );\n\nexport const itemsOf = (node: Option.Option<YamlNode>): readonly YamlNode[] =>\n pipe(\n node,\n Option.filter(({ kind }) => kind === \"sequence\"),\n Option.map(({ children }) => children),\n Option.getOrElse((): readonly YamlNode[] => []),\n );\n\nexport const entriesOf = (\n node: Option.Option<YamlNode>,\n): readonly (readonly [string, YamlNode])[] =>\n pipe(\n node,\n Option.map(pairsOf),\n Option.getOrElse(() => []),\n Arr.map((pair) => [pair.key.value, pair.value] as const),\n );\n\nexport const scalarsIn = (node: YamlNode): readonly Located[] => {\n if (node.kind === \"scalar\") {\n return [{ text: node.value, line: node.line, column: node.column }];\n }\n return pipe(\n node.children,\n Arr.flatMap((child) => scalarsIn(child)),\n );\n};\n\nconst ownValuesNamed = (name: string, node: YamlNode): readonly YamlNode[] => {\n if (node.kind !== \"mapping\") {\n return [];\n }\n return pipe(\n pairsOf(node),\n Arr.filter((pair) => pair.key.value === name),\n Arr.map((pair) => pair.value),\n );\n};\n\nexport const valuesNamed =\n (name: string) =>\n (node: YamlNode): readonly YamlNode[] => [\n ...ownValuesNamed(name, node),\n ...pipe(node.children, Arr.flatMap(valuesNamed(name))),\n ];\n\nexport const descend =\n (...keys: readonly string[]) =>\n (node: Option.Option<YamlNode>): Option.Option<YamlNode> => {\n let found = node;\n for (const key of keys) {\n found = pipe(found, childOf(key));\n }\n return found;\n };\n","import type { YamlNode } from \"@r_masseater/fu4\";\nimport { NOOP, keysOf, runOf, workflowRule } from \"@r_masseater/fu4/rules\";\nimport type { Visitor } from \"@r_masseater/fu4/rules\";\nimport { Array as Arr, Option, pipe } from \"effect\";\n\nimport { childOf, keyNodeOf, rootOf } from \"./yaml.ts\";\n\nconst PUBLISH = /\\bmsch\\s+publish\\s+(?:plan|npm|release)\\b/u;\nconst MANUAL = \"workflow_dispatch\";\nconst TRIGGER_KEY = \"on\";\nconst MESSAGE =\n \"publishes with `msch publish plan`, `npm` or `release` from a trigger other than `workflow_dispatch`. Keep those steps in a workflow that only `workflow_dispatch` starts, and start it on a push to main with `msch publish dispatch`.\";\n\nconst triggersOf = (node: YamlNode): readonly string[] => {\n if (node.kind === \"scalar\") {\n return [node.value];\n }\n if (node.kind === \"sequence\") {\n return pipe(\n node.children,\n Arr.map(({ value }) => value),\n );\n }\n return keysOf(node);\n};\n\n/** @internal */\nexport const publishTrigger = workflowRule({\n description:\n \"Reports msch publish steps in a workflow that something other than workflow_dispatch starts\",\n visitor: (fail, context): Visitor => {\n const publishing: string[] = [];\n return {\n ...NOOP,\n step: (step): void => {\n const publishes = pipe(\n runOf(step),\n Option.flatMap(({ run }) => Option.fromNullishOr(run)),\n Option.exists(({ value }) => PUBLISH.test(value)),\n );\n if (publishes) {\n publishing.push(MANUAL);\n }\n },\n workflowPost: (): void => {\n const root = rootOf(context);\n const triggers = pipe(\n childOf(TRIGGER_KEY)(root),\n Option.map(triggersOf),\n Option.getOrElse((): readonly string[] => []),\n );\n const manualOnly = pipe(\n triggers,\n Arr.every((trigger) => trigger === MANUAL),\n );\n if (Arr.isReadonlyArrayNonEmpty(publishing) && !manualOnly) {\n for (const key of pipe(root, keyNodeOf(TRIGGER_KEY), Option.toArray)) {\n fail(key, MESSAGE);\n }\n }\n },\n };\n },\n});\n","import { NOOP, actionOf, workflowRule } from \"@r_masseater/fu4/rules\";\nimport type { Visitor } from \"@r_masseater/fu4/rules\";\nimport { Option, pipe } from \"effect\";\n\nconst RELEASE_PLEASE = /^googleapis\\/release-please-action(?:@|$)/u;\nconst MESSAGE =\n \"releases with release-please. Releases are manual: bump the version in a PR, then run the publish workflow, which runs `msch publish` for the workspace.\";\n\n/** @internal */\nexport const releasePlease = workflowRule({\n description: \"Reports the release-please action, because releases here are manual\",\n visitor: (fail): Visitor => ({\n ...NOOP,\n step: (step): void => {\n const uses = pipe(\n actionOf(step),\n Option.flatMap(({ uses: text }) => Option.fromNullishOr(text)),\n Option.filter(({ value }) => RELEASE_PLEASE.test(value)),\n Option.toArray,\n );\n for (const found of uses) {\n fail(found, MESSAGE);\n }\n },\n }),\n});\n","import { NOOP, actionOf, runOf, workflowRule } from \"@r_masseater/fu4/rules\";\nimport type { Visitor } from \"@r_masseater/fu4/rules\";\nimport { Option, pipe } from \"effect\";\n\nconst GIT_WRITE = /\\bgit\\s+(?:-{1,2}\\S+\\s+(?:\\S+\\s+)?)*(?:commit|push)\\b/u;\nconst COMMIT_ACTION = /^[^@/]+\\/[^@]*(?:commit|push)[^@]*(?:@|$)/iu;\nconst MESSAGE =\n \"commits or pushes from a workflow. A bot commit leaves generated files out of review and races the next push. Regenerate the files in a commit hook (for example `.vite-hooks/pre-commit`) so they land in the author's commit, and let CI only check that they are current.\";\n\n/** @internal */\nexport const workflowCommit = workflowRule({\n description: \"Reports git commit, git push and commit actions in a workflow\",\n visitor: (fail): Visitor => ({\n ...NOOP,\n step: (step): void => {\n const writes = pipe(\n runOf(step),\n Option.flatMap((exec) => {\n const position = Option.orElse(Option.fromNullishOr(exec.runPosition), () =>\n Option.fromNullishOr(exec.run),\n );\n return Option.fromNullishOr(exec.run).pipe(\n Option.filter(({ value }) => GIT_WRITE.test(value)),\n Option.zipRight(position),\n );\n }),\n );\n const commits = pipe(\n actionOf(step),\n Option.flatMap(({ uses }) => Option.fromNullishOr(uses)),\n Option.filter(({ value }) => COMMIT_ACTION.test(value)),\n );\n const flagged = writes.pipe(\n Option.orElse(() => commits),\n Option.toArray,\n );\n for (const found of flagged) {\n fail(found, MESSAGE);\n }\n },\n }),\n});\n","import { Effect, Layer, ManagedRuntime } from \"effect\";\n\nimport type { RepositoryFiles } from \"#/shared/lib/repository-files.ts\";\nimport { nodeRepositoryFiles, nodeServicesLayer } from \"#/shared/lib/repository-files.ts\";\n\nconst runtime = nodeRepositoryFiles.pipe(Layer.provide(nodeServicesLayer), ManagedRuntime.make);\n\n/** @internal */\nexport const inRepository = <Found>(\n effect: Effect.Effect<Found, never, RepositoryFiles>,\n): Effect.Effect<Found> => Effect.promise(() => runtime.runPromise(effect));\n","import type { YamlNode } from \"@r_masseater/fu4\";\nimport { Array as Arr, Option, String as Str, pipe } from \"effect\";\n\nimport { childOf, descend, entriesOf, itemsOf, scalarsIn, stringOf } from \"./yaml.ts\";\nimport type { Located } from \"./yaml.ts\";\n\nconst ROOT = \".\";\nconst LOCAL = \"./\";\nconst NEGATION = \"!\";\nconst SEPARATOR = \"/\";\nconst LINE = \"\\n\";\nconst UNRESOLVED_MARKERS = [\"${{\", \"$\", \"{\"];\nconst ABSOLUTE_MARKERS = [\"/\", \"~\"];\nconst FILE_INPUT_SUFFIX = \"-file\";\nconst DEPENDENCY_PATH_INPUT = \"cache-dependency-path\";\nconst FILTER_KEYS = [\"paths\", \"paths-ignore\"];\nconst HASH_FILES = /hashFiles\\((?<arguments>[^)]*)\\)/gu;\nconst QUOTED = /'(?<path>[^']*)'/gu;\nconst SCRIPT = /^[\\w.@/-]+\\.(?:ts|mts|cts|sh)$/u;\nconst TOKEN_SEPARATOR = /[\\s;&|()<>\"'`=]+/u;\n\nexport const ACTION_DEFINITIONS: readonly string[] = [\"action.yml\", \"action.yaml\"];\n\nexport type ReferenceKind = \"glob\" | \"file\" | \"script\" | \"directory\" | \"action\";\n\nexport interface WorkflowReference extends Located {\n readonly kind: ReferenceKind;\n readonly field: string;\n readonly path: string;\n}\n\ntype Entry = readonly [string, YamlNode];\n\nconst containsAny =\n (markers: readonly string[]) =>\n (path: string): boolean =>\n pipe(\n markers,\n Arr.some((marker) => Str.includes(marker)(path)),\n );\n\nconst startsWithAny =\n (markers: readonly string[]) =>\n (path: string): boolean =>\n pipe(\n markers,\n Arr.some((marker) => Str.startsWith(marker)(path)),\n );\n\nconst isLiteralPath = (path: string): boolean =>\n Str.isNonEmpty(path) &&\n !containsAny(UNRESOLVED_MARKERS)(path) &&\n !startsWithAny(ABSOLUTE_MARKERS)(path);\n\nconst withoutLocal = (path: string): string => {\n if (Str.startsWith(LOCAL)(path)) {\n return Str.slice(LOCAL.length)(path);\n }\n return path;\n};\n\nconst joinPath = (base: string, path: string): string => {\n const relative = withoutLocal(Str.trim(path));\n if (base === ROOT) {\n return relative;\n }\n return `${base}${SEPARATOR}${relative}`;\n};\n\nconst reference =\n (kind: ReferenceKind, field: string, base = ROOT) =>\n ({ text, line, column }: Located): readonly WorkflowReference[] => {\n const path = Str.trim(text);\n if (!isLiteralPath(path) || !isLiteralPath(base)) {\n return [];\n }\n return [{ kind, field, path: joinPath(base, path), text, line, column }];\n };\n\nconst isPositive = ({ text }: Located): boolean => !Str.startsWith(NEGATION)(Str.trim(text));\n\nconst globsIn = (field: string, node: Option.Option<YamlNode>): readonly WorkflowReference[] =>\n pipe(\n itemsOf(node),\n Arr.flatMap((item) => pipe(item, Option.some, stringOf, Option.toArray)),\n Arr.filter(isPositive),\n Arr.flatMap(reference(\"glob\", field)),\n );\n\nconst filtersOf = ([event, filters]: Entry): readonly WorkflowReference[] =>\n pipe(\n FILTER_KEYS,\n Arr.flatMap((key) => globsIn(`on.${event}.${key}`, pipe(filters, Option.some, childOf(key)))),\n );\n\nconst workingDirectoryOf = (owner: Option.Option<YamlNode>): Option.Option<Located> =>\n pipe(owner, descend(\"defaults\", \"run\", \"working-directory\"), stringOf);\n\nconst directoryOf = (found: Option.Option<Located>, base: string): string =>\n pipe(\n found,\n Option.map(({ text }) => joinPath(ROOT, text)),\n Option.getOrElse(() => base),\n );\n\nconst located =\n (kind: ReferenceKind, field: string, base = ROOT) =>\n (found: Option.Option<Located>): readonly WorkflowReference[] =>\n pipe(found, Option.toArray, Arr.flatMap(reference(kind, field, base)));\n\nconst localUses = (node: Option.Option<YamlNode>): Option.Option<Located> =>\n pipe(\n node,\n childOf(\"uses\"),\n stringOf,\n Option.filter(({ text }) => Str.startsWith(LOCAL)(text)),\n );\n\nconst scriptsIn =\n (field: string, base: string) =>\n ({ text, line, column }: Located): readonly WorkflowReference[] =>\n pipe(\n Str.split(text, TOKEN_SEPARATOR),\n Arr.filter((token) => SCRIPT.test(token)),\n Arr.dedupe,\n Arr.flatMap((token) => pipe({ text: token, line, column }, reference(\"script\", field, base))),\n );\n\nconst isFileInput = ([key]: Entry): boolean =>\n Str.endsWith(FILE_INPUT_SUFFIX)(key) || key === DEPENDENCY_PATH_INPUT;\n\nconst linesOf = ({ text, line, column }: Located): readonly Located[] =>\n pipe(\n Str.split(text, LINE),\n Arr.map((each) => ({ text: each, line, column })),\n );\n\nconst fileInputOf =\n (field: string) =>\n ([key, value]: Entry): readonly WorkflowReference[] =>\n pipe(\n value,\n Option.some,\n stringOf,\n Option.toArray,\n Arr.flatMap(linesOf),\n Arr.flatMap(reference(\"glob\", `${field}.with.${key}`)),\n );\n\nconst fileInputsIn = (field: string, step: YamlNode): readonly WorkflowReference[] =>\n pipe(\n step,\n Option.some,\n childOf(\"with\"),\n entriesOf,\n Arr.filter(isFileInput),\n Arr.flatMap(fileInputOf(field)),\n );\n\nconst scriptReferencesOf = (\n field: string,\n directory: string,\n step: YamlNode,\n): readonly WorkflowReference[] =>\n pipe(\n step,\n Option.some,\n childOf(\"run\"),\n stringOf,\n Option.toArray,\n Arr.flatMap(scriptsIn(`${field}.run`, directory)),\n );\n\nconst stepReferences =\n (job: string, base: string) =>\n (step: YamlNode, index: number): readonly WorkflowReference[] => {\n const field = `jobs.${job}.steps[${index}]`;\n const own = pipe(step, Option.some, childOf(\"working-directory\"), stringOf);\n const directory = directoryOf(own, base);\n return [\n ...pipe(step, Option.some, localUses, located(\"action\", `${field}.uses`)),\n ...pipe(own, located(\"directory\", `${field}.working-directory`)),\n ...scriptReferencesOf(field, directory, step),\n ...fileInputsIn(field, step),\n ];\n };\n\nconst jobReferences =\n (base: string) =>\n ([job, node]: Entry): readonly WorkflowReference[] => {\n const own = pipe(node, Option.some, workingDirectoryOf);\n const steps = pipe(node, Option.some, childOf(\"steps\"), itemsOf);\n const directory = directoryOf(own, base);\n return [\n ...pipe(node, Option.some, localUses, located(\"file\", `jobs.${job}.uses`)),\n ...pipe(own, located(\"directory\", `jobs.${job}.defaults.run.working-directory`)),\n ...pipe(steps, Arr.flatMap(stepReferences(job, directory))),\n ];\n };\n\nconst groupsOf =\n (pattern: RegExp, group: string) =>\n ({ text, line, column }: Located): readonly Located[] =>\n pipe(\n Arr.fromIterable(Str.matchAll(pattern)(text)),\n Arr.flatMap((match) =>\n pipe(\n Option.fromNullishOr(match.groups),\n Option.flatMap((groups) => Option.fromNullishOr(groups[group])),\n Option.toArray,\n ),\n ),\n Arr.map((value) => ({ text: value, line, column })),\n );\n\nconst hashFilesIn = (root: YamlNode): readonly WorkflowReference[] =>\n pipe(\n scalarsIn(root),\n Arr.flatMap(groupsOf(HASH_FILES, \"arguments\")),\n Arr.flatMap(groupsOf(QUOTED, \"path\")),\n Arr.filter(isPositive),\n Arr.flatMap(reference(\"glob\", \"hashFiles\")),\n );\n\nconst jobsOf = (root: YamlNode): readonly Entry[] =>\n pipe(root, Option.some, childOf(\"jobs\"), entriesOf);\n\n/** @internal */\nexport const workflowReferences = (root: YamlNode): readonly WorkflowReference[] => {\n const workflowDefault = pipe(root, Option.some, workingDirectoryOf);\n const base = directoryOf(workflowDefault, ROOT);\n return [\n ...pipe(root, Option.some, childOf(\"on\"), entriesOf, Arr.flatMap(filtersOf)),\n ...pipe(workflowDefault, located(\"directory\", \"defaults.run.working-directory\")),\n ...pipe(jobsOf(root), Arr.flatMap(jobReferences(base))),\n ...hashFilesIn(root),\n ];\n};\n\nconst outputPathsOf = (step: YamlNode): readonly string[] =>\n pipe(\n step,\n Option.some,\n descend(\"with\", \"path\"),\n stringOf,\n Option.toArray,\n Arr.flatMap(linesOf),\n Arr.map(({ text }) => joinPath(ROOT, text)),\n Arr.filter(isLiteralPath),\n );\n\n/** @internal */\nexport const producedPaths = (root: YamlNode): readonly string[] =>\n pipe(\n jobsOf(root),\n Arr.flatMap(([, job]) => pipe(job, Option.some, childOf(\"steps\"), itemsOf)),\n Arr.flatMap(outputPathsOf),\n );\n","import { groupOf } from \"@masseater.dev/lint-host/collections\";\nimport { defineRule } from \"@r_masseater/fu4\";\nimport type { Report, YamlNode } from \"@r_masseater/fu4\";\nimport { pairsOf } from \"@r_masseater/fu4/rules\";\nimport { Array as Arr, Effect, Option, String as Str, pipe } from \"effect\";\n\nimport { namedWorkspaces, patternOf } from \"#/entities/workspace/index.ts\";\nimport type { NamedWorkspace } from \"#/entities/workspace/index.ts\";\n\nimport { inRepository } from \"./repository-services.ts\";\nimport { workflowReferences } from \"./workflow-references.ts\";\nimport { childOf, scalarsIn, stringOf } from \"./yaml.ts\";\nimport type { Located } from \"./yaml.ts\";\n\nconst WORKFLOW = /(?:^|\\/)\\.github\\/workflows\\/(?<name>[^/]+)\\.ya?ml$/u;\nconst ACTION = /(?:^|\\/)\\.github\\/actions\\/(?<name>[^/]+)\\/action\\.ya?ml$/u;\nconst PACKAGE_FILTER =\n /(?:^|\\s)(?:--filter|-F)(?:\\s+|=)(?<quote>[\"']?)(?<value>[^\\s\"'$][^\\s\"']*)\\k<quote>/gu;\nconst SEPARATOR = \"/\";\nconst WORD_SEPARATORS = /[-_]/gu;\nconst SPACE = \" \";\nconst FIRST_LINE: Located = { text: \"\", line: 1, column: 1 };\n\nconst packageMessage = (what: string, directory: string): string =>\n `${what} names the workspace ${directory}. A workflow or job made for one package does not scale: give the package a vp task and let the generic pipeline (verify, deploy, release, daily, task) find it.`;\n\nconst matching = (workspaces: readonly NamedWorkspace[], text: string): Option.Option<string> =>\n pipe(\n workspaces,\n Arr.findFirst(\n ({ names }) =>\n Arr.isReadonlyArrayNonEmpty(names) && Option.isSome(Str.match(patternOf(names))(text)),\n ),\n Option.map(({ directory }) => directory),\n );\n\nconst named = (workspaces: readonly NamedWorkspace[], text: string): Option.Option<string> =>\n Option.orElse(matching(workspaces, text), () =>\n matching(workspaces, Str.replaceAll(WORD_SEPARATORS, SPACE)(text)),\n );\n\nconst containing = (workspaces: readonly NamedWorkspace[], path: string): Option.Option<string> =>\n pipe(\n workspaces,\n Arr.findFirst(\n ({ directory }) => path === directory || Str.startsWith(`${directory}${SEPARATOR}`)(path),\n ),\n Option.map(({ directory }) => directory),\n );\n\nconst filtersIn = (scalars: readonly Located[]): readonly Located[] =>\n pipe(\n scalars,\n Arr.flatMap(({ text, line, column }) =>\n pipe(\n Arr.fromIterable(Str.matchAll(PACKAGE_FILTER)(text)),\n Arr.flatMap((match) =>\n pipe(\n Option.fromNullishOr(match.groups),\n Option.flatMap((groups) => Option.fromNullishOr(groups[\"value\"])),\n Option.toArray,\n ),\n ),\n Arr.map((value) => ({ text: value, line, column })),\n ),\n ),\n );\n\nconst findingFor = (\n what: string,\n found: Located,\n directory: Option.Option<string>,\n): readonly Finding[] =>\n pipe(\n directory,\n Option.map((workspace): Finding => ({\n line: found.line,\n column: found.column,\n message: packageMessage(what, workspace),\n })),\n Option.toArray,\n );\n\ntype Finding = Pick<Report, \"line\" | \"column\" | \"message\">;\n\nconst namesIn = (stem: string, root: Option.Option<YamlNode>): readonly Located[] => [\n { ...FIRST_LINE, text: stem },\n ...pipe(root, childOf(\"name\"), stringOf, Option.toArray),\n ...pipe(\n root,\n childOf(\"jobs\"),\n Option.map((jobs) =>\n pipe(\n pairsOf(jobs),\n Arr.map(({ key }): Located => ({ text: key.value, line: key.line, column: key.column })),\n ),\n ),\n Option.getOrElse((): readonly Located[] => []),\n ),\n];\n\nconst workflowFindings = (\n workspaces: readonly NamedWorkspace[],\n stem: string,\n root: YamlNode,\n): readonly Finding[] => {\n const fromNames = pipe(\n namesIn(stem, Option.some(root)),\n Arr.flatMap((found) => findingFor(`\"${found.text}\"`, found, named(workspaces, found.text))),\n );\n const referenced = pipe(\n workflowReferences(root),\n Arr.filter(({ field }) => !Str.startsWith(\"on.\")(field)),\n Arr.flatMap((found) => findingFor(found.field, found, containing(workspaces, found.path))),\n );\n const filtered = pipe(\n filtersIn(scalarsIn(root)),\n Arr.flatMap((found) =>\n findingFor(`--filter ${found.text}`, found, matching(workspaces, found.text)),\n ),\n );\n return [...fromNames, ...referenced, ...filtered];\n};\n\nexport const workflowPackage = defineRule({\n meta: {\n description: \"Reports workflows, jobs, actions and paths that are made for one workspace\",\n kinds: [\"workflow\", \"action\"],\n },\n check: ({ filename, project, source, report }) =>\n Effect.gen(function* checkPackages() {\n const workspaces = yield* namedWorkspaces(project.root);\n const asWorkflow = groupOf(\"name\")(WORKFLOW.exec(filename));\n const asAction = groupOf(\"name\")(ACTION.exec(filename));\n const found: readonly Finding[] = [\n ...pipe(\n asAction,\n Option.flatMap((name) => named(workspaces, name)),\n Option.map((directory): Finding => ({\n ...FIRST_LINE,\n message: packageMessage(\n `The action ${Option.getOrElse(asAction, () => \"\")}`,\n directory,\n ),\n })),\n Option.toArray,\n ),\n ...pipe(\n Option.all([asWorkflow, Option.fromNullishOr(source.yaml)]),\n Option.map(([stem, root]) => workflowFindings(workspaces, stem, root)),\n Option.getOrElse((): readonly Finding[] => []),\n ),\n ];\n for (const each of found) {\n report(each);\n }\n }).pipe(inRepository),\n});\n","import { defineRule } from \"@r_masseater/fu4\";\nimport { Array as Arr, Option, pipe } from \"effect\";\n\nimport { childOf, entriesOf, keyNodeOf, rootOf, scalarsIn } from \"./yaml.ts\";\n\nconst FILTER_KEYS: readonly string[] = [\"paths\", \"paths-ignore\"];\nconst PATHS_FILTER_ACTION = /(?:^|\\/)paths-filter@/u;\nconst MESSAGE =\n \"A workflow that reacts to changes under listed paths needs a new entry for every package and drifts from the packages it is meant to cover. Run the generic pipeline on every push and let it decide from the workspace what changed.\";\n\n/** @internal */\nexport const workflowPathFilter = defineRule({\n meta: {\n description: \"Reports paths and paths-ignore triggers and the paths-filter action\",\n kinds: [\"workflow\"],\n },\n check: (context): void => {\n const root = rootOf(context);\n const triggers = pipe(\n root,\n childOf(\"on\"),\n entriesOf,\n Arr.flatMap(([, trigger]) =>\n pipe(\n FILTER_KEYS,\n Arr.flatMap((key) => pipe(Option.some(trigger), keyNodeOf(key), Option.toArray)),\n ),\n ),\n );\n const actions = pipe(\n Option.toArray(root),\n Arr.flatMap((node) => scalarsIn(node)),\n Arr.filter(({ text }) => PATHS_FILTER_ACTION.test(text)),\n );\n for (const found of [...triggers, ...actions]) {\n context.report({ line: found.line, column: found.column, message: MESSAGE });\n }\n },\n});\n","import { defineRule } from \"@r_masseater/fu4\";\nimport { Array as Arr, Effect, Option, String as Str, pipe } from \"effect\";\n\nimport { existsAt, isDirectoryAt, isIgnored, staticPrefix } from \"#/shared/lib/path-existence.ts\";\nimport { RepositoryFiles } from \"#/shared/lib/repository-files.ts\";\n\nimport { inRepository } from \"./repository-services.ts\";\nimport { ACTION_DEFINITIONS, producedPaths, workflowReferences } from \"./workflow-references.ts\";\nimport type { ReferenceKind, WorkflowReference } from \"./workflow-references.ts\";\n\nconst SEPARATOR = \"/\";\n\nconst EXPECTED: Readonly<Record<ReferenceKind, string>> = {\n action: \"a directory with action.yml\",\n directory: \"a directory\",\n file: \"a file\",\n glob: \"a pattern that matches a tracked file\",\n script: \"a file\",\n};\n\ntype Resolver = (root: string, path: string) => Effect.Effect<boolean, never, RepositoryFiles>;\n\nconst matchesAny = Effect.fn(\"matchesAny\")(function* matchesAny(\n root: string,\n pathspecs: readonly string[],\n) {\n const files = yield* RepositoryFiles;\n const matched = yield* files.matchingFiles(root, pathspecs);\n return Arr.isReadonlyArrayNonEmpty(matched);\n});\n\nconst matchesGlob: Resolver = (root, path) => matchesAny(root, [`:(glob)${path}`]);\n\nconst hasAction: Resolver = Effect.fn(\"hasAction\")(function* hasAction(root: string, path: string) {\n const found = yield* Effect.forEach(\n ACTION_DEFINITIONS,\n (name) => existsAt(root, `${path}${SEPARATOR}${name}`),\n { concurrency: 1 },\n );\n return pipe(found, Arr.some(Boolean));\n});\n\nconst suffixAt =\n (segments: readonly string[]) =>\n (index: number): string =>\n `:(glob)**/${pipe(segments, Arr.drop(index), Arr.join(SEPARATOR))}`;\n\nconst findsScript: Resolver = Effect.fn(\"findsScript\")(function* findsScript(\n root: string,\n path: string,\n) {\n if (yield* existsAt(root, path)) {\n return true;\n }\n const segments = Str.split(path, SEPARATOR);\n return yield* matchesAny(root, Arr.makeBy(segments.length, suffixAt(segments)));\n});\n\nconst RESOLVERS: Readonly<Record<ReferenceKind, Resolver>> = {\n action: hasAction,\n directory: isDirectoryAt,\n file: existsAt,\n glob: matchesGlob,\n script: findsScript,\n};\n\nconst overlaps =\n (path: string) =>\n (produced: string): boolean =>\n produced === path ||\n Str.startsWith(`${path}${SEPARATOR}`)(produced) ||\n Str.startsWith(`${produced}${SEPARATOR}`)(path);\n\nconst isMissing = Effect.fn(\"isMissing\")(function* isMissing(\n root: string,\n produced: readonly string[],\n found: WorkflowReference,\n) {\n const prefix = staticPrefix(found.path);\n if (pipe(produced, Arr.some(overlaps(prefix)))) {\n return false;\n }\n if (yield* RESOLVERS[found.kind](root, found.path)) {\n return false;\n }\n return !(yield* isIgnored(root, found.path));\n});\n\nexport const workflowPath = defineRule({\n meta: {\n description: \"Reports a path that a workflow names and the repository does not have\",\n kinds: [\"workflow\"],\n },\n check: ({ project, source, report }) =>\n Effect.gen(function* checkPaths() {\n for (const yaml of Option.toArray(Option.fromNullishOr(source.yaml))) {\n const produced = producedPaths(yaml);\n const missing = yield* Effect.filter(workflowReferences(yaml), (found) =>\n isMissing(project.root, produced, found),\n );\n for (const found of missing) {\n report({\n line: found.line,\n column: found.column,\n message: `${found.field} names ${found.path}, which is not ${EXPECTED[found.kind]} in this repository. Point it at a path that exists or remove it.`,\n });\n }\n }\n }).pipe(inRepository),\n});\n","import { defineRule } from \"@r_masseater/fu4\";\nimport { keysOf } from \"@r_masseater/fu4/rules\";\nimport { Array as Arr, Option, pipe } from \"effect\";\n\nimport { keyNodeOf, rootOf, valuesNamed } from \"./yaml.ts\";\n\nconst CONCURRENCY_KEY = \"concurrency\";\nconst QUEUE_KEY = \"queue\";\nconst MESSAGE =\n \"queues runs with `queue`. A queued group runs every old push one by one, so a long run holds back the newest commit for hours. Drop `queue`: a job that later pushes redo gets `cancel-in-progress: true`, and a deploy or release job keeps the default, which lets the running one finish and replaces the waiting one with the newest run.\";\n\n/** @internal */\nexport const workflowQueue = defineRule({\n meta: {\n description:\n \"Reports queue on a concurrency group, because a queued group holds back the newest commit\",\n kinds: [\"workflow\"],\n },\n check: (context): void => {\n const keys = pipe(\n rootOf(context),\n Option.toArray,\n Arr.flatMap((root) => valuesNamed(CONCURRENCY_KEY)(root)),\n Arr.filter((group) => Arr.contains(keysOf(group), QUEUE_KEY)),\n Arr.flatMap((group) => pipe(Option.some(group), keyNodeOf(QUEUE_KEY), Option.toArray)),\n );\n for (const key of keys) {\n context.report({ line: key.line, column: key.column, message: MESSAGE });\n }\n },\n});\n","import { NOOP, runOf, workflowRule } from \"@r_masseater/fu4/rules\";\nimport type { Visitor } from \"@r_masseater/fu4/rules\";\nimport { Array as Arr, Option, String as Str, pipe } from \"effect\";\n\nconst COMMAND_CHAIN = /&&|\\|\\||;|\\|/u;\nconst QUOTED = /\\$\\{\\{.*?\\}\\}|\"(?:[^\"\\\\]|\\\\.)*\"|'[^']*'/gu;\nconst COMMENT = \"#\";\nconst ONE_COMMAND = 1;\nconst MESSAGE =\n \"runs more than one command. Keep a step to one command, `vp run <task>` or `vp exec <bin>`, and put the logic in a Vite+ task in TypeScript.\";\n\nconst isCommand = (line: string): boolean => Str.isNonEmpty(line) && !Str.startsWith(COMMENT)(line);\n\nconst chainsCommands = (line: string): boolean =>\n COMMAND_CHAIN.test(Str.replaceAll(QUOTED, \"\")(line));\n\nconst runsMoreThanOneCommand = (text: string): boolean => {\n const lines = pipe(Str.split(\"\\n\")(text), Arr.map(Str.trim), Arr.filter(isCommand));\n return lines.length > ONE_COMMAND || pipe(lines, Arr.some(chainsCommands));\n};\n\n/** @internal */\nexport const workflowScript = workflowRule({\n description: \"Reports a run step with more than one command, because the logic belongs in a task\",\n visitor: (fail): Visitor => ({\n ...NOOP,\n step: (step): void => {\n const runs = pipe(\n runOf(step),\n Option.flatMap(({ run }) => Option.fromNullishOr(run)),\n Option.filter(({ value }) => runsMoreThanOneCommand(value)),\n Option.toArray,\n );\n for (const found of runs) {\n fail(found, MESSAGE);\n }\n },\n }),\n});\n","import { definePlugin } from \"@r_masseater/fu4\";\nimport type { Fu4Config } from \"@r_masseater/fu4\";\nimport { Array as Arr, Record as Rec, pipe } from \"effect\";\n\nimport { publishTrigger } from \"./publish-trigger.ts\";\nimport { releasePlease } from \"./release-please.ts\";\nimport { workflowCommit } from \"./workflow-commit.ts\";\nimport { workflowPackage } from \"./workflow-package.ts\";\nimport { workflowPathFilter } from \"./workflow-path-filter.ts\";\nimport { workflowPath } from \"./workflow-path.ts\";\nimport { workflowQueue } from \"./workflow-queue.ts\";\nimport { workflowScript } from \"./workflow-script.ts\";\n\nconst NAME = \"msch\";\n\nconst plugin = definePlugin({\n rules: {\n \"publish-trigger\": publishTrigger,\n \"release-please\": releasePlease,\n \"workflow-commit\": workflowCommit,\n \"workflow-package\": workflowPackage,\n \"workflow-path\": workflowPath,\n \"workflow-path-filter\": workflowPathFilter,\n \"workflow-queue\": workflowQueue,\n \"workflow-script\": workflowScript,\n },\n});\n\n/** @internal */\nexport const workflowPolicy = (): Fu4Config => ({\n plugins: Rec.singleton(NAME, plugin),\n rules: pipe(\n Rec.keys(plugin.rules),\n Arr.map((rule): readonly [string, \"error\"] => [`${NAME}/${rule}`, \"error\"]),\n Rec.fromEntries,\n ),\n});\n","import type { Fu4Config } from \"@r_masseater/fu4\";\nimport { recommended } from \"@r_masseater/fu4/presets\";\n\nimport { workflowPolicy } from \"./policy.ts\";\n\n/** @internal */\nexport const fu4Of = (): Fu4Config => ({ extends: [recommended(), workflowPolicy()] });\n","import { fileURLToPath } from \"node:url\";\n\nimport { RuleConfigSeverity } from \"@commitlint/types\";\nimport type { ToolSections } from \"@r_masseater/vite-plus-adopt\";\nimport { Option, pipe } from \"effect\";\n\nexport interface CommitOptions {\n readonly subjectScripts: readonly string[];\n}\n\nexport type CommitlintSection = NonNullable<ToolSections[\"commitlint\"]>;\n\nconst COMMIT_CONVENTION = fileURLToPath(import.meta.resolve(\"@commitlint/config-conventional\"));\n\nexport const COMMIT_LINT = { extends: [COMMIT_CONVENTION] };\n\nexport const SUBJECT_SCRIPT = \"subject-script\";\n\nexport const commitlintOf = (commit: CommitOptions | undefined): CommitlintSection =>\n pipe(\n Option.fromUndefinedOr(commit),\n Option.match({\n onNone: (): CommitlintSection => COMMIT_LINT,\n onSome: ({ subjectScripts }): CommitlintSection => ({\n ...COMMIT_LINT,\n rules: { [SUBJECT_SCRIPT]: [RuleConfigSeverity.Error, \"always\", [...subjectScripts]] },\n }),\n }),\n );\n","import { RUNTIME_SECTIONS } from \"@r_masseater/masseater-utils/kestrion\";\nimport type { DependencySection } from \"@r_masseater/masseater-utils/kestrion\";\nimport { Record as Rec, pipe } from \"effect\";\nimport type { UserConfig } from \"vite-plus\";\n\nimport type { WorkspaceSettings } from \"#/features/build-workspace-settings/index.ts\";\nimport { requiredStack } from \"#/shared/config/index.ts\";\n\nexport type DependencyRules = NonNullable<UserConfig[\"dependencyRules\"]>;\ntype Allowed = NonNullable<DependencyRules[\"allowed\"]>;\n\nconst allowedIn = (\n allowances: WorkspaceSettings[\"devDependencies\"],\n fields: readonly DependencySection[],\n): Allowed =>\n pipe(\n allowances,\n Rec.map(({ workspaces, dependencies }) => ({ workspaces, dependencies, fields: [...fields] })),\n );\n\nexport const PLUGIN_DEPENDENCIES =\n \"Claude Code installs a plugin's dependencies from its own package.json and lockfile, where only exact registry versions install\";\n\nexport const dependencyRulesOf = (workspace: WorkspaceSettings): DependencyRules => ({\n allowed: {\n ...allowedIn(workspace.devDependencies, [\"devDependencies\"]),\n ...allowedIn(workspace.dependencies, RUNTIME_SECTIONS),\n },\n banned: requiredStack,\n exactDependencies: { [PLUGIN_DEPENDENCIES]: workspace.plugins },\n peerRanges: \"intersect\",\n});\n","import { Array as Arr, Option, pipe } from \"effect\";\nimport type { UserConfig } from \"vite-plus\";\n\nimport type {\n AddedRulesValue,\n WorkspaceSettings,\n} from \"#/features/build-workspace-settings/index.ts\";\nimport type { MarkdownOptions, FallowConfig } from \"#/features/define-lint-preset/index.ts\";\nimport {\n decisionTestRules,\n exempt,\n fallowOf,\n lint as preset,\n markdownOf,\n structureOf,\n tracedRules,\n} from \"#/features/define-lint-preset/index.ts\";\nimport { fu4Of } from \"#/features/guard-workflows/index.ts\";\n\nimport { recordBuilt } from \"./built-config.ts\";\nimport { commitlintOf } from \"./repository-commit.ts\";\nimport type { CommitOptions } from \"./repository-commit.ts\";\nimport { dependencyRulesOf } from \"./repository-dependencies.ts\";\nimport { gitHooksOf, tasksOf } from \"./repository-tasks.ts\";\nimport type { CargoInputs, GitHooksSection, UsageOptions } from \"./repository-tasks.ts\";\nimport { secretsOf, textlintOf } from \"./repository-text.ts\";\nimport type { TextOptions } from \"./repository-text.ts\";\n\nexport { COMMIT_LINT } from \"./repository-commit.ts\";\nexport { PLUGIN_DEPENDENCIES } from \"./repository-dependencies.ts\";\nexport { secretsOf } from \"./repository-text.ts\";\nexport { GIT_HOOKS } from \"./repository-tasks.ts\";\n\nexport interface AddedOverride {\n readonly files: readonly string[];\n readonly excludeFiles?: readonly string[];\n readonly rules: AddedRulesValue;\n}\n\nexport interface RepositoryOptions {\n readonly workspace: WorkspaceSettings;\n readonly commit?: CommitOptions;\n readonly overrides?: readonly AddedOverride[];\n readonly textlint?: TextOptions;\n readonly markdown?: Omit<MarkdownOptions, \"indexSkill\">;\n readonly run?: {\n readonly tasks?: Readonly<Record<string, string>>;\n readonly remoteCache?: string;\n };\n readonly usage?: UsageOptions;\n readonly cargo?: { readonly inputs: CargoInputs };\n readonly gitHooks?: GitHooksSection;\n readonly fallow?: FallowConfig;\n}\n\ntype OxlintOverride = NonNullable<NonNullable<UserConfig[\"lint\"]>[\"overrides\"]>[number];\n\ninterface SharedCache {\n readonly scripts: true;\n readonly tasks: true;\n readonly remote: { readonly url: string };\n}\n\nconst cacheOf = (remoteCache: string | undefined): SharedCache | true =>\n pipe(\n Option.fromNullishOr(remoteCache),\n Option.match({\n onNone: (): SharedCache | true => true,\n onSome: (url) => ({ scripts: true, tasks: true, remote: { url } }),\n }),\n );\n\nexport const STAGED = { \"*\": \"vp fmt --no-error-on-unmatched-pattern\" };\n\nexport const FORMAT = {\n ignorePatterns: exempt,\n sortImports: true,\n sortTailwindcss: true,\n sortPackageJson: true,\n};\n\nconst added = ({ files, excludeFiles, rules }: AddedOverride): OxlintOverride =>\n pipe(\n Option.fromUndefinedOr(excludeFiles),\n Option.match({\n onNone: (): OxlintOverride => ({ files: [...files], rules: { ...rules } }),\n onSome: (excluded): OxlintOverride => ({\n files: [...files],\n excludeFiles: [...excluded],\n rules: { ...rules },\n }),\n }),\n );\n\nconst lintOf = ({\n workspace,\n overrides = [],\n}: RepositoryOptions): NonNullable<UserConfig[\"lint\"]> => ({\n ...preset,\n ignorePatterns: exempt,\n overrides: [\n ...preset.overrides,\n {\n files: [...workspace.lint.shadcnUi],\n rules: { \"react/jsx-props-no-spreading\": \"off\" },\n },\n {\n files: [\n ...workspace.lint.publicEntries,\n ...workspace.lint.deployEntries,\n ...workspace.lint.siteEntries,\n ],\n rules: { \"import/no-default-export\": \"off\" },\n },\n {\n files: [\n ...workspace.lint.deployEntries,\n ...workspace.lint.siteEntries,\n \"**/*.server.ts\",\n \"**/*.server.tsx\",\n ],\n excludeFiles: [\"**/*.test.ts\", \"**/*.test.tsx\"],\n rules: tracedRules,\n },\n ...pipe(overrides, Arr.map(added)),\n ...workspace.lint.overrides,\n { files: [\"**/*.test.ts\"], rules: decisionTestRules },\n ],\n});\n\nexport const repositoryConfig = (options: RepositoryOptions): UserConfig => {\n const {\n workspace,\n commit,\n textlint = {},\n markdown = {},\n run = {},\n usage,\n cargo,\n gitHooks,\n fallow,\n } = options;\n const ownFallow = Option.toArray(Option.fromUndefinedOr(fallow));\n const cargoInputs = Option.map(Option.fromUndefinedOr(cargo), ({ inputs }) => inputs);\n return recordBuilt({\n commitlint: commitlintOf(commit),\n dependencyRules: dependencyRulesOf(workspace),\n h56m: secretsOf(),\n wism: structureOf({\n members: workspace.members,\n ignorePatterns: exempt,\n }),\n textlint: textlintOf({ ...textlint, articles: workspace.articles }),\n y8: markdownOf({ ...markdown, indexSkill: workspace.indexSkill }),\n fu4: fu4Of(),\n fallow: fallowOf([...workspace.fallow, ...ownFallow]),\n test: { projects: [...workspace.testProjects], passWithNoTests: true },\n staged: STAGED,\n gitHooks: gitHooksOf(gitHooks),\n fmt: FORMAT,\n lint: lintOf(options),\n run: {\n cache: cacheOf(run.remoteCache),\n tasks: tasksOf({\n workspace,\n commands: run.tasks ?? {},\n usage: Option.fromUndefinedOr(usage),\n cargo: cargoInputs,\n }),\n },\n });\n};\n"],"mappings":";;;;;;;;;;;;AAUA,MAAa,UAAU,EAAE,aACvB,OAAO,cAAc,OAAO,IAAI;AAElC,MAAa,YAAY,SACvB,KACE,MACA,OAAO,QAAQ,EAAE,WAAW,SAAS,QAAQ,GAC7C,OAAO,KAAK,EAAE,OAAO,MAAM,cAAc;CAAE,MAAM;CAAO;CAAM;AAAO,EAAE,CACzE;AAEF,MAAa,WACV,SACA,SACC,KAAK,MAAM,OAAO,QAAQ,QAAQ,GAAG,CAAC,CAAC;AAE3C,MAAa,aACV,SACA,SACC,KACE,MACA,OAAO,SAAS,YACd,KACE,QAAQ,OAAO,GACfA,MAAI,WAAW,SAAS,KAAK,IAAI,UAAU,GAAG,GAC9C,OAAO,KAAK,SAAS,KAAK,GAAG,CAC/B,CACF,CACF;AAEJ,MAAa,WAAW,SACtB,KACE,MACA,OAAO,QAAQ,EAAE,WAAW,SAAS,UAAU,GAC/C,OAAO,KAAK,EAAE,eAAe,QAAQ,GACrC,OAAO,gBAAqC,CAAC,CAAC,CAChD;AAEF,MAAa,aACX,SAEA,KACE,MACA,OAAO,IAAI,OAAO,GAClB,OAAO,gBAAgB,CAAC,CAAC,GACzBA,MAAI,KAAK,SAAS,CAAC,KAAK,IAAI,OAAO,KAAK,KAAK,CAAU,CACzD;AAEF,MAAa,aAAa,SAAuC;CAC/D,IAAI,KAAK,SAAS,UAChB,OAAO,CAAC;EAAE,MAAM,KAAK;EAAO,MAAM,KAAK;EAAM,QAAQ,KAAK;CAAO,CAAC;CAEpE,OAAO,KACL,KAAK,UACLA,MAAI,SAAS,UAAU,UAAU,KAAK,CAAC,CACzC;AACF;AAEA,MAAM,kBAA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file":"config.mjs","names":["Str","Arr","Arr","Rec","Arr","MESSAGE","Arr","MESSAGE","MESSAGE","SEPARATOR","FILTER_KEYS","QUOTED","Arr","Str","SEPARATOR","Arr","Str","MESSAGE","Arr","Arr","Str","MESSAGE","Arr","Str","Arr","Rec","Arr","recommended","Rec","preset","Arr","Str"],"sources":["../src/features/define-lint-preset/config/structure.config.ts","../src/features/define-lint-preset/config/markdown.config.ts","../src/features/define-lint-preset/config/fallow.config.ts","../src/features/guard-workflows/model/yaml.ts","../src/features/guard-workflows/model/publish-trigger.ts","../src/features/guard-workflows/model/release-please.ts","../src/features/guard-workflows/model/workflow-commit.ts","../src/features/guard-workflows/model/repository-services.ts","../src/features/guard-workflows/model/workflow-references.ts","../src/features/guard-workflows/model/workflow-package.ts","../src/features/guard-workflows/model/workflow-path-filter.ts","../src/features/guard-workflows/model/workflow-path.ts","../src/features/guard-workflows/model/workflow-queue.ts","../src/features/guard-workflows/model/workflow-script.ts","../src/features/guard-workflows/model/policy.ts","../src/features/guard-workflows/model/fu4-config.ts","../src/app/repository-commit.ts","../src/app/repository-dependencies.ts","../src/app/repository-config.ts","../src/app/config.ts"],"sourcesContent":["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 { mdlct } from \"@r_masseater/mdlct/y8\";\nimport type { MdlctOptions } from \"@r_masseater/mdlct/y8\";\nimport type { 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 { exempt } from \"#/shared/config/index.ts\";\n\ntype SkillNames = NonNullable<NonNullable<MdlctOptions[\"skills\"]>[\"skillNames\"]>;\n\nconst skillNamesOf = (indexSkill: Option.Option<string>): SkillNames =>\n Option.match(indexSkill, {\n onNone: (): SkillNames => ({}),\n onSome: (index): SkillNames => ({ index }),\n });\n\nconst agentDocsOf = (indexSkill: Option.Option<string>): MdlctOptions => {\n const skillNames = skillNamesOf(indexSkill);\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\nexport const MARKDOWN_IGNORES = [\".agents/skills/**\", \"CHANGELOG.md\", \"**/CLAUDE.md\", ...exempt];\n\nexport const MARKDOWN_RULES = { \"agnix/XP-001\": \"off\" } as const;\n\nexport interface MarkdownDocs extends RecommendedOptions, MdlctOptions {}\n\nexport interface MarkdownOptions {\n readonly indexSkill: Option.Option<string>;\n readonly docs?: MarkdownDocs;\n}\n\nexport const markdownOf = ({ indexSkill, docs = {} }: MarkdownOptions): Y8Config => {\n const base = agentDocsOf(indexSkill);\n const { agents, skills, ...documents } = docs;\n return {\n extends: [\n recommended(documents),\n mdlct({\n agents: { ...base.agents, ...agents },\n skills: { ...base.skills, ...skills },\n }),\n ],\n rules: MARKDOWN_RULES,\n reportUnusedDirectives: true,\n ignores: MARKDOWN_IGNORES,\n };\n};\n","import { Array as Arr, Predicate, Record as Rec } from \"effect\";\n\nexport type FallowConfig = Readonly<Record<string, unknown>>;\n\nconst PRESET: FallowConfig = {\n typeAware: { enabled: true, require: \"complete\" },\n ignoreExportsUsedInFile: true,\n failOnParseError: true,\n audit: { gate: \"all\" },\n security: {\n categories: {\n include: [\n \"angular-trusted-html\",\n \"cleartext-transport\",\n \"code-injection\",\n \"command-injection\",\n \"dangerous-html\",\n \"deprecated-cipher\",\n \"dom-document-write\",\n \"dynamic-module-load\",\n \"dynamic-regex\",\n \"electron-unsafe-webpreferences\",\n \"hardcoded-secret\",\n \"header-injection\",\n \"insecure-cookie\",\n \"insecure-randomness\",\n \"insecure-temp-file\",\n \"jquery-html\",\n \"jwt-alg-none\",\n \"jwt-verify-missing-algorithms\",\n \"llm-call-injection\",\n \"mass-assignment\",\n \"mysql-multiple-statements\",\n \"nextjs-open-redirect\",\n \"nosql-injection\",\n \"open-redirect\",\n \"path-traversal\",\n \"permissive-cors\",\n \"postmessage-wildcard-origin\",\n \"prototype-pollution\",\n \"redos-regex\",\n \"resource-amplification\",\n \"route-send-file\",\n \"secret-pii-log\",\n \"secret-to-network\",\n \"sql-injection\",\n \"ssrf\",\n \"ssti\",\n \"template-escape-bypass\",\n \"tls-validation-disabled\",\n \"unsafe-buffer-alloc\",\n \"unsafe-deserialization\",\n \"weak-crypto\",\n \"webview-injection\",\n \"world-writable-permission\",\n \"xpath-injection\",\n \"xxe\",\n \"zip-slip\",\n ],\n },\n },\n duplicates: { threshold: 1 },\n flags: {\n sdkPatterns: [\n { function: \"getBooleanValue\", nameArg: 0, provider: \"OpenFeature\" },\n { function: \"getStringValue\", nameArg: 0, provider: \"OpenFeature\" },\n { function: \"getNumberValue\", nameArg: 0, provider: \"OpenFeature\" },\n { function: \"getObjectValue\", nameArg: 0, provider: \"OpenFeature\" },\n { function: \"getBooleanDetails\", nameArg: 0, provider: \"OpenFeature\" },\n { function: \"getStringDetails\", nameArg: 0, provider: \"OpenFeature\" },\n { function: \"getNumberDetails\", nameArg: 0, provider: \"OpenFeature\" },\n { function: \"getObjectDetails\", nameArg: 0, provider: \"OpenFeature\" },\n { function: \"getBoolean\", nameArg: 0, provider: \"OpenFeature (Effect service)\" },\n ],\n },\n framework: [\n {\n name: \"vite-plus-adopt\",\n enablers: [\"@r_masseater/msch\"],\n toolingDependencies: [\n \"@commitlint/config-conventional\",\n \"@textlint-ja/textlint-rule-preset-ai-writing\",\n \"fallow\",\n \"textlint-rule-preset-ja-technical-writing\",\n ],\n },\n {\n name: \"oxlint-plugin-decision\",\n enablers: [\"@r_masseater/msch\"],\n entryPoints: [\"decision-rules.ts\"],\n },\n {\n name: \"skills\",\n enablers: [\"skills\"],\n configPatterns: [\"skills-lock.json\"],\n toolingDependencies: [\"skills\"],\n },\n {\n name: \"tanstack-intent\",\n enablers: [\"@tanstack/intent\"],\n configPatterns: [\".intent/hooks/*.mjs\"],\n toolingDependencies: [\"@tanstack/intent\"],\n },\n ],\n rules: {\n \"unused-files\": \"error\",\n \"unused-exports\": \"error\",\n \"unused-types\": \"error\",\n \"private-type-leaks\": \"error\",\n \"deprecated-exports-in-use\": \"error\",\n \"unused-dependencies\": \"error\",\n \"unused-dev-dependencies\": \"error\",\n \"unused-optional-dependencies\": \"error\",\n \"unused-enum-members\": \"error\",\n \"unused-class-members\": \"error\",\n \"unused-store-members\": \"error\",\n \"unprovided-injects\": \"error\",\n \"unrendered-components\": \"error\",\n \"unused-component-props\": \"error\",\n \"unused-component-emits\": \"error\",\n \"unused-component-inputs\": \"error\",\n \"unused-component-outputs\": \"error\",\n \"unused-svelte-events\": \"error\",\n \"unused-server-actions\": \"error\",\n \"unused-load-data-keys\": \"error\",\n \"prop-drilling\": \"error\",\n \"thin-wrapper\": \"error\",\n \"duplicate-prop-shape\": \"error\",\n \"css-token-drift\": \"error\",\n \"css-duplicate-block\": \"error\",\n \"css-selector-complexity\": \"error\",\n \"css-dead-surface\": \"error\",\n \"css-broken-reference\": \"error\",\n \"complexity-cyclomatic\": \"error\",\n \"complexity-cognitive\": \"error\",\n \"complexity-crap\": \"error\",\n \"unresolved-imports\": \"error\",\n \"unlisted-dependencies\": \"error\",\n \"duplicate-exports\": \"error\",\n \"type-only-dependencies\": \"error\",\n \"test-only-dependencies\": \"error\",\n \"dev-dependencies-in-production\": \"error\",\n \"circular-dependencies\": \"error\",\n \"re-export-cycle\": \"error\",\n \"boundary-violation\": \"error\",\n \"feature-flags\": \"error\",\n \"stale-suppressions\": \"error\",\n \"require-suppression-reason\": \"error\",\n \"unused-catalog-entries\": \"error\",\n \"empty-catalog-groups\": \"error\",\n \"unresolved-catalog-references\": \"error\",\n \"unused-dependency-overrides\": \"error\",\n \"misconfigured-dependency-overrides\": \"error\",\n \"security-client-server-leak\": \"error\",\n \"security-sink\": \"error\",\n \"policy-violation\": \"error\",\n \"invalid-client-export\": \"error\",\n \"mixed-client-server-barrel\": \"error\",\n \"misplaced-directive\": \"error\",\n \"route-collision\": \"error\",\n \"dynamic-segment-name-conflict\": \"error\",\n },\n};\n\nconst isRecord = (value: unknown): value is Readonly<Record<string, unknown>> =>\n Predicate.isReadonlyObject(value) && !Arr.isArray(value);\n\nconst mergeValue = (base: unknown, own: unknown): unknown => {\n if (Arr.isArray(base) && Arr.isArray(own)) {\n return [...base, ...own];\n }\n if (isRecord(base) && isRecord(own)) {\n return Rec.union(base, own, mergeValue);\n }\n return own;\n};\n\nexport const fallowOf = (owns: readonly FallowConfig[]): FallowConfig =>\n Arr.reduce(owns, PRESET, (merged, own) => Rec.union(merged, own, mergeValue));\n","import type { RuleContext, YamlNode } from \"@r_masseater/fu4\";\nimport { pairsOf, valueAt } from \"@r_masseater/fu4/rules\";\nimport { Array as Arr, Option, pipe } from \"effect\";\n\nexport interface Located {\n readonly text: string;\n readonly line: number;\n readonly column: number;\n}\n\nexport const rootOf = ({ source }: RuleContext): Option.Option<YamlNode> =>\n Option.fromNullishOr(source.yaml);\n\nexport const stringOf = (node: Option.Option<YamlNode>): Option.Option<Located> =>\n pipe(\n node,\n Option.filter(({ kind }) => kind === \"scalar\"),\n Option.map(({ value, line, column }) => ({ text: value, line, column })),\n );\n\nexport const childOf =\n (key: string) =>\n (node: Option.Option<YamlNode>): Option.Option<YamlNode> =>\n pipe(node, Option.flatMap(valueAt(key)));\n\nexport const keyNodeOf =\n (key: string) =>\n (node: Option.Option<YamlNode>): Option.Option<YamlNode> =>\n pipe(\n node,\n Option.flatMap((mapping) =>\n pipe(\n pairsOf(mapping),\n Arr.findFirst((pair) => pair.key.value === key),\n Option.map((pair) => pair.key),\n ),\n ),\n );\n\nexport const itemsOf = (node: Option.Option<YamlNode>): readonly YamlNode[] =>\n pipe(\n node,\n Option.filter(({ kind }) => kind === \"sequence\"),\n Option.map(({ children }) => children),\n Option.getOrElse((): readonly YamlNode[] => []),\n );\n\nexport const entriesOf = (\n node: Option.Option<YamlNode>,\n): readonly (readonly [string, YamlNode])[] =>\n pipe(\n node,\n Option.map(pairsOf),\n Option.getOrElse(() => []),\n Arr.map((pair) => [pair.key.value, pair.value] as const),\n );\n\nexport const scalarsIn = (node: YamlNode): readonly Located[] => {\n if (node.kind === \"scalar\") {\n return [{ text: node.value, line: node.line, column: node.column }];\n }\n return pipe(\n node.children,\n Arr.flatMap((child) => scalarsIn(child)),\n );\n};\n\nconst ownValuesNamed = (name: string, node: YamlNode): readonly YamlNode[] => {\n if (node.kind !== \"mapping\") {\n return [];\n }\n return pipe(\n pairsOf(node),\n Arr.filter((pair) => pair.key.value === name),\n Arr.map((pair) => pair.value),\n );\n};\n\nexport const valuesNamed =\n (name: string) =>\n (node: YamlNode): readonly YamlNode[] => [\n ...ownValuesNamed(name, node),\n ...pipe(node.children, Arr.flatMap(valuesNamed(name))),\n ];\n\nexport const descend =\n (...keys: readonly string[]) =>\n (node: Option.Option<YamlNode>): Option.Option<YamlNode> => {\n let found = node;\n for (const key of keys) {\n found = pipe(found, childOf(key));\n }\n return found;\n };\n","import type { YamlNode } from \"@r_masseater/fu4\";\nimport { NOOP, keysOf, runOf, workflowRule } from \"@r_masseater/fu4/rules\";\nimport type { Visitor } from \"@r_masseater/fu4/rules\";\nimport { Array as Arr, Option, pipe } from \"effect\";\n\nimport { childOf, keyNodeOf, rootOf } from \"./yaml.ts\";\n\nconst PUBLISH = /\\bmsch\\s+publish\\s+(?:plan|npm|release)\\b/u;\nconst MANUAL = \"workflow_dispatch\";\nconst CALLED = \"workflow_call\";\nconst PUBLISH_WORKFLOW = /\\/\\.github\\/workflows\\/publish\\.ya?ml(?:@|$)/u;\nconst TRIGGER_KEY = \"on\";\nconst MESSAGE =\n \"publishes with `msch publish plan`, `npm` or `release` from a trigger other than `workflow_dispatch`. Keep those steps, or the call of the shared publish workflow, in a workflow that only `workflow_dispatch` starts, and start it on a push to main with `msch publish dispatch`. A reusable workflow may also take `workflow_call`, because its callers meet the same rule.\";\n\nconst triggersOf = (node: YamlNode): readonly string[] => {\n if (node.kind === \"scalar\") {\n return [node.value];\n }\n if (node.kind === \"sequence\") {\n return pipe(\n node.children,\n Arr.map(({ value }) => value),\n );\n }\n return keysOf(node);\n};\n\n/** @internal */\nexport const publishTrigger = workflowRule({\n description:\n \"Reports msch publish steps, or a call of the shared publish workflow, in a workflow that something other than workflow_dispatch starts\",\n visitor: (fail, context): Visitor => {\n const publishing: string[] = [];\n return {\n ...NOOP,\n jobPre: (job): void => {\n const calls = pipe(\n Option.fromNullishOr(job.workflowCall),\n Option.flatMap(({ uses }) => Option.fromNullishOr(uses)),\n Option.exists(({ value }) => PUBLISH_WORKFLOW.test(value)),\n );\n if (calls) {\n publishing.push(MANUAL);\n }\n },\n step: (step): void => {\n const publishes = pipe(\n runOf(step),\n Option.flatMap(({ run }) => Option.fromNullishOr(run)),\n Option.exists(({ value }) => PUBLISH.test(value)),\n );\n if (publishes) {\n publishing.push(MANUAL);\n }\n },\n workflowPost: (): void => {\n const root = rootOf(context);\n const triggers = pipe(\n childOf(TRIGGER_KEY)(root),\n Option.map(triggersOf),\n Option.getOrElse((): readonly string[] => []),\n );\n const manualOnly = pipe(\n triggers,\n Arr.every((trigger) => trigger === MANUAL || trigger === CALLED),\n );\n if (Arr.isReadonlyArrayNonEmpty(publishing) && !manualOnly) {\n for (const key of pipe(root, keyNodeOf(TRIGGER_KEY), Option.toArray)) {\n fail(key, MESSAGE);\n }\n }\n },\n };\n },\n});\n","import { NOOP, actionOf, workflowRule } from \"@r_masseater/fu4/rules\";\nimport type { Visitor } from \"@r_masseater/fu4/rules\";\nimport { Option, pipe } from \"effect\";\n\nconst RELEASE_PLEASE = /^googleapis\\/release-please-action(?:@|$)/u;\nconst MESSAGE =\n \"releases with release-please. Releases are manual: bump the version in a PR, then run the publish workflow, which runs `msch publish` for the workspace.\";\n\n/** @internal */\nexport const releasePlease = workflowRule({\n description: \"Reports the release-please action, because releases here are manual\",\n visitor: (fail): Visitor => ({\n ...NOOP,\n step: (step): void => {\n const uses = pipe(\n actionOf(step),\n Option.flatMap(({ uses: text }) => Option.fromNullishOr(text)),\n Option.filter(({ value }) => RELEASE_PLEASE.test(value)),\n Option.toArray,\n );\n for (const found of uses) {\n fail(found, MESSAGE);\n }\n },\n }),\n});\n","import { NOOP, actionOf, runOf, workflowRule } from \"@r_masseater/fu4/rules\";\nimport type { Visitor } from \"@r_masseater/fu4/rules\";\nimport { Option, pipe } from \"effect\";\n\nconst GIT_WRITE = /\\bgit\\s+(?:-{1,2}\\S+\\s+(?:\\S+\\s+)?)*(?:commit|push)\\b/u;\nconst COMMIT_ACTION = /^[^@/]+\\/[^@]*(?:commit|push)[^@]*(?:@|$)/iu;\nconst MESSAGE =\n \"commits or pushes from a workflow. A bot commit leaves generated files out of review and races the next push. Regenerate the files in a commit hook (for example `.vite-hooks/pre-commit`) so they land in the author's commit, and let CI only check that they are current.\";\n\n/** @internal */\nexport const workflowCommit = workflowRule({\n description: \"Reports git commit, git push and commit actions in a workflow\",\n visitor: (fail): Visitor => ({\n ...NOOP,\n step: (step): void => {\n const writes = pipe(\n runOf(step),\n Option.flatMap((exec) => {\n const position = Option.orElse(Option.fromNullishOr(exec.runPosition), () =>\n Option.fromNullishOr(exec.run),\n );\n return Option.fromNullishOr(exec.run).pipe(\n Option.filter(({ value }) => GIT_WRITE.test(value)),\n Option.zipRight(position),\n );\n }),\n );\n const commits = pipe(\n actionOf(step),\n Option.flatMap(({ uses }) => Option.fromNullishOr(uses)),\n Option.filter(({ value }) => COMMIT_ACTION.test(value)),\n );\n const flagged = writes.pipe(\n Option.orElse(() => commits),\n Option.toArray,\n );\n for (const found of flagged) {\n fail(found, MESSAGE);\n }\n },\n }),\n});\n","import { Effect, Layer, ManagedRuntime } from \"effect\";\n\nimport type { RepositoryFiles } from \"#/shared/lib/repository-files.ts\";\nimport { nodeRepositoryFiles, nodeServicesLayer } from \"#/shared/lib/repository-files.ts\";\n\nconst runtime = nodeRepositoryFiles.pipe(Layer.provide(nodeServicesLayer), ManagedRuntime.make);\n\n/** @internal */\nexport const inRepository = <Found>(\n effect: Effect.Effect<Found, never, RepositoryFiles>,\n): Effect.Effect<Found> => Effect.promise(() => runtime.runPromise(effect));\n","import type { YamlNode } from \"@r_masseater/fu4\";\nimport { Array as Arr, Option, String as Str, pipe } from \"effect\";\n\nimport { childOf, descend, entriesOf, itemsOf, scalarsIn, stringOf } from \"./yaml.ts\";\nimport type { Located } from \"./yaml.ts\";\n\nconst ROOT = \".\";\nconst LOCAL = \"./\";\nconst NEGATION = \"!\";\nconst SEPARATOR = \"/\";\nconst LINE = \"\\n\";\nconst UNRESOLVED_MARKERS = [\"${{\", \"$\", \"{\"];\nconst ABSOLUTE_MARKERS = [\"/\", \"~\"];\nconst FILE_INPUT_SUFFIX = \"-file\";\nconst DEPENDENCY_PATH_INPUT = \"cache-dependency-path\";\nconst FILTER_KEYS = [\"paths\", \"paths-ignore\"];\nconst HASH_FILES = /hashFiles\\((?<arguments>[^)]*)\\)/gu;\nconst QUOTED = /'(?<path>[^']*)'/gu;\nconst SCRIPT = /^[\\w.@/-]+\\.(?:ts|mts|cts|sh)$/u;\nconst TOKEN_SEPARATOR = /[\\s;&|()<>\"'`=]+/u;\n\nexport const ACTION_DEFINITIONS: readonly string[] = [\"action.yml\", \"action.yaml\"];\n\nexport type ReferenceKind = \"glob\" | \"file\" | \"script\" | \"directory\" | \"action\";\n\nexport interface WorkflowReference extends Located {\n readonly kind: ReferenceKind;\n readonly field: string;\n readonly path: string;\n}\n\ntype Entry = readonly [string, YamlNode];\n\nconst containsAny =\n (markers: readonly string[]) =>\n (path: string): boolean =>\n pipe(\n markers,\n Arr.some((marker) => Str.includes(marker)(path)),\n );\n\nconst startsWithAny =\n (markers: readonly string[]) =>\n (path: string): boolean =>\n pipe(\n markers,\n Arr.some((marker) => Str.startsWith(marker)(path)),\n );\n\nconst isLiteralPath = (path: string): boolean =>\n Str.isNonEmpty(path) &&\n !containsAny(UNRESOLVED_MARKERS)(path) &&\n !startsWithAny(ABSOLUTE_MARKERS)(path);\n\nconst withoutLocal = (path: string): string => {\n if (Str.startsWith(LOCAL)(path)) {\n return Str.slice(LOCAL.length)(path);\n }\n return path;\n};\n\nconst joinPath = (base: string, path: string): string => {\n const relative = withoutLocal(Str.trim(path));\n if (base === ROOT) {\n return relative;\n }\n return `${base}${SEPARATOR}${relative}`;\n};\n\nconst reference =\n (kind: ReferenceKind, field: string, base = ROOT) =>\n ({ text, line, column }: Located): readonly WorkflowReference[] => {\n const path = Str.trim(text);\n if (!isLiteralPath(path) || !isLiteralPath(base)) {\n return [];\n }\n return [{ kind, field, path: joinPath(base, path), text, line, column }];\n };\n\nconst isPositive = ({ text }: Located): boolean => !Str.startsWith(NEGATION)(Str.trim(text));\n\nconst globsIn = (field: string, node: Option.Option<YamlNode>): readonly WorkflowReference[] =>\n pipe(\n itemsOf(node),\n Arr.flatMap((item) => pipe(item, Option.some, stringOf, Option.toArray)),\n Arr.filter(isPositive),\n Arr.flatMap(reference(\"glob\", field)),\n );\n\nconst filtersOf = ([event, filters]: Entry): readonly WorkflowReference[] =>\n pipe(\n FILTER_KEYS,\n Arr.flatMap((key) => globsIn(`on.${event}.${key}`, pipe(filters, Option.some, childOf(key)))),\n );\n\nconst workingDirectoryOf = (owner: Option.Option<YamlNode>): Option.Option<Located> =>\n pipe(owner, descend(\"defaults\", \"run\", \"working-directory\"), stringOf);\n\nconst directoryOf = (found: Option.Option<Located>, base: string): string =>\n pipe(\n found,\n Option.map(({ text }) => joinPath(ROOT, text)),\n Option.getOrElse(() => base),\n );\n\nconst located =\n (kind: ReferenceKind, field: string, base = ROOT) =>\n (found: Option.Option<Located>): readonly WorkflowReference[] =>\n pipe(found, Option.toArray, Arr.flatMap(reference(kind, field, base)));\n\nconst localUses = (node: Option.Option<YamlNode>): Option.Option<Located> =>\n pipe(\n node,\n childOf(\"uses\"),\n stringOf,\n Option.filter(({ text }) => Str.startsWith(LOCAL)(text)),\n );\n\nconst scriptsIn =\n (field: string, base: string) =>\n ({ text, line, column }: Located): readonly WorkflowReference[] =>\n pipe(\n Str.split(text, TOKEN_SEPARATOR),\n Arr.filter((token) => SCRIPT.test(token)),\n Arr.dedupe,\n Arr.flatMap((token) => pipe({ text: token, line, column }, reference(\"script\", field, base))),\n );\n\nconst isFileInput = ([key]: Entry): boolean =>\n Str.endsWith(FILE_INPUT_SUFFIX)(key) || key === DEPENDENCY_PATH_INPUT;\n\nconst linesOf = ({ text, line, column }: Located): readonly Located[] =>\n pipe(\n Str.split(text, LINE),\n Arr.map((each) => ({ text: each, line, column })),\n );\n\nconst fileInputOf =\n (field: string) =>\n ([key, value]: Entry): readonly WorkflowReference[] =>\n pipe(\n value,\n Option.some,\n stringOf,\n Option.toArray,\n Arr.flatMap(linesOf),\n Arr.flatMap(reference(\"glob\", `${field}.with.${key}`)),\n );\n\nconst fileInputsIn = (field: string, step: YamlNode): readonly WorkflowReference[] =>\n pipe(\n step,\n Option.some,\n childOf(\"with\"),\n entriesOf,\n Arr.filter(isFileInput),\n Arr.flatMap(fileInputOf(field)),\n );\n\nconst scriptReferencesOf = (\n field: string,\n directory: string,\n step: YamlNode,\n): readonly WorkflowReference[] =>\n pipe(\n step,\n Option.some,\n childOf(\"run\"),\n stringOf,\n Option.toArray,\n Arr.flatMap(scriptsIn(`${field}.run`, directory)),\n );\n\nconst stepReferences =\n (job: string, base: string) =>\n (step: YamlNode, index: number): readonly WorkflowReference[] => {\n const field = `jobs.${job}.steps[${index}]`;\n const own = pipe(step, Option.some, childOf(\"working-directory\"), stringOf);\n const directory = directoryOf(own, base);\n return [\n ...pipe(step, Option.some, localUses, located(\"action\", `${field}.uses`)),\n ...pipe(own, located(\"directory\", `${field}.working-directory`)),\n ...scriptReferencesOf(field, directory, step),\n ...fileInputsIn(field, step),\n ];\n };\n\nconst jobReferences =\n (base: string) =>\n ([job, node]: Entry): readonly WorkflowReference[] => {\n const own = pipe(node, Option.some, workingDirectoryOf);\n const steps = pipe(node, Option.some, childOf(\"steps\"), itemsOf);\n const directory = directoryOf(own, base);\n return [\n ...pipe(node, Option.some, localUses, located(\"file\", `jobs.${job}.uses`)),\n ...pipe(own, located(\"directory\", `jobs.${job}.defaults.run.working-directory`)),\n ...pipe(steps, Arr.flatMap(stepReferences(job, directory))),\n ];\n };\n\nconst groupsOf =\n (pattern: RegExp, group: string) =>\n ({ text, line, column }: Located): readonly Located[] =>\n pipe(\n Arr.fromIterable(Str.matchAll(pattern)(text)),\n Arr.flatMap((match) =>\n pipe(\n Option.fromNullishOr(match.groups),\n Option.flatMap((groups) => Option.fromNullishOr(groups[group])),\n Option.toArray,\n ),\n ),\n Arr.map((value) => ({ text: value, line, column })),\n );\n\nconst hashFilesIn = (root: YamlNode): readonly WorkflowReference[] =>\n pipe(\n scalarsIn(root),\n Arr.flatMap(groupsOf(HASH_FILES, \"arguments\")),\n Arr.flatMap(groupsOf(QUOTED, \"path\")),\n Arr.filter(isPositive),\n Arr.flatMap(reference(\"glob\", \"hashFiles\")),\n );\n\nconst jobsOf = (root: YamlNode): readonly Entry[] =>\n pipe(root, Option.some, childOf(\"jobs\"), entriesOf);\n\n/** @internal */\nexport const workflowReferences = (root: YamlNode): readonly WorkflowReference[] => {\n const workflowDefault = pipe(root, Option.some, workingDirectoryOf);\n const base = directoryOf(workflowDefault, ROOT);\n return [\n ...pipe(root, Option.some, childOf(\"on\"), entriesOf, Arr.flatMap(filtersOf)),\n ...pipe(workflowDefault, located(\"directory\", \"defaults.run.working-directory\")),\n ...pipe(jobsOf(root), Arr.flatMap(jobReferences(base))),\n ...hashFilesIn(root),\n ];\n};\n\nconst outputPathsOf = (step: YamlNode): readonly string[] =>\n pipe(\n step,\n Option.some,\n descend(\"with\", \"path\"),\n stringOf,\n Option.toArray,\n Arr.flatMap(linesOf),\n Arr.map(({ text }) => joinPath(ROOT, text)),\n Arr.filter(isLiteralPath),\n );\n\n/** @internal */\nexport const producedPaths = (root: YamlNode): readonly string[] =>\n pipe(\n jobsOf(root),\n Arr.flatMap(([, job]) => pipe(job, Option.some, childOf(\"steps\"), itemsOf)),\n Arr.flatMap(outputPathsOf),\n );\n","import { defineRule } from \"@r_masseater/fu4\";\nimport type { Report, YamlNode } from \"@r_masseater/fu4\";\nimport { pairsOf } from \"@r_masseater/fu4/rules\";\nimport { groupOf } from \"@r_masseater/masseater-utils/text\";\nimport { Array as Arr, Effect, Option, String as Str, pipe } from \"effect\";\n\nimport { namedWorkspaces, patternOf } from \"#/entities/workspace/index.ts\";\nimport type { NamedWorkspace } from \"#/entities/workspace/index.ts\";\n\nimport { inRepository } from \"./repository-services.ts\";\nimport { workflowReferences } from \"./workflow-references.ts\";\nimport { childOf, scalarsIn, stringOf } from \"./yaml.ts\";\nimport type { Located } from \"./yaml.ts\";\n\nconst WORKFLOW = /(?:^|\\/)\\.github\\/workflows\\/(?<name>[^/]+)\\.ya?ml$/u;\nconst ACTION = /(?:^|\\/)\\.github\\/actions\\/(?<name>[^/]+)\\/action\\.ya?ml$/u;\nconst PACKAGE_FILTER =\n /(?:^|\\s)(?:--filter|-F)(?:\\s+|=)(?<quote>[\"']?)(?<value>[^\\s\"'$][^\\s\"']*)\\k<quote>/gu;\nconst SEPARATOR = \"/\";\nconst WORD_SEPARATORS = /[-_]/gu;\nconst SPACE = \" \";\nconst FIRST_LINE: Located = { text: \"\", line: 1, column: 1 };\n\nconst packageMessage = (what: string, directory: string): string =>\n `${what} names the workspace ${directory}. A workflow or job made for one package does not scale: give the package a vp task and let the generic pipeline (verify, deploy, release, daily, task) find it.`;\n\nconst matching = (workspaces: readonly NamedWorkspace[], text: string): Option.Option<string> =>\n pipe(\n workspaces,\n Arr.findFirst(\n ({ names }) =>\n Arr.isReadonlyArrayNonEmpty(names) && Option.isSome(Str.match(patternOf(names))(text)),\n ),\n Option.map(({ directory }) => directory),\n );\n\nconst named = (workspaces: readonly NamedWorkspace[], text: string): Option.Option<string> =>\n Option.orElse(matching(workspaces, text), () =>\n matching(workspaces, Str.replaceAll(WORD_SEPARATORS, SPACE)(text)),\n );\n\nconst containing = (workspaces: readonly NamedWorkspace[], path: string): Option.Option<string> =>\n pipe(\n workspaces,\n Arr.findFirst(\n ({ directory }) => path === directory || Str.startsWith(`${directory}${SEPARATOR}`)(path),\n ),\n Option.map(({ directory }) => directory),\n );\n\nconst filtersIn = (scalars: readonly Located[]): readonly Located[] =>\n pipe(\n scalars,\n Arr.flatMap(({ text, line, column }) =>\n pipe(\n Arr.fromIterable(Str.matchAll(PACKAGE_FILTER)(text)),\n Arr.flatMap((match) =>\n pipe(\n Option.fromNullishOr(match.groups),\n Option.flatMap((groups) => Option.fromNullishOr(groups[\"value\"])),\n Option.toArray,\n ),\n ),\n Arr.map((value) => ({ text: value, line, column })),\n ),\n ),\n );\n\nconst findingFor = (\n what: string,\n found: Located,\n directory: Option.Option<string>,\n): readonly Finding[] =>\n pipe(\n directory,\n Option.map((workspace): Finding => ({\n line: found.line,\n column: found.column,\n message: packageMessage(what, workspace),\n })),\n Option.toArray,\n );\n\ntype Finding = Pick<Report, \"line\" | \"column\" | \"message\">;\n\nconst namesIn = (stem: string, root: Option.Option<YamlNode>): readonly Located[] => [\n { ...FIRST_LINE, text: stem },\n ...pipe(root, childOf(\"name\"), stringOf, Option.toArray),\n ...pipe(\n root,\n childOf(\"jobs\"),\n Option.map((jobs) =>\n pipe(\n pairsOf(jobs),\n Arr.map(({ key }): Located => ({ text: key.value, line: key.line, column: key.column })),\n ),\n ),\n Option.getOrElse((): readonly Located[] => []),\n ),\n];\n\nconst workflowFindings = (\n workspaces: readonly NamedWorkspace[],\n stem: string,\n root: YamlNode,\n): readonly Finding[] => {\n const fromNames = pipe(\n namesIn(stem, Option.some(root)),\n Arr.flatMap((found) => findingFor(`\"${found.text}\"`, found, named(workspaces, found.text))),\n );\n const referenced = pipe(\n workflowReferences(root),\n Arr.filter(({ field }) => !Str.startsWith(\"on.\")(field)),\n Arr.flatMap((found) => findingFor(found.field, found, containing(workspaces, found.path))),\n );\n const filtered = pipe(\n filtersIn(scalarsIn(root)),\n Arr.flatMap((found) =>\n findingFor(`--filter ${found.text}`, found, matching(workspaces, found.text)),\n ),\n );\n return [...fromNames, ...referenced, ...filtered];\n};\n\nexport const workflowPackage = defineRule({\n meta: {\n description: \"Reports workflows, jobs, actions and paths that are made for one workspace\",\n kinds: [\"workflow\", \"action\"],\n },\n check: ({ filename, project, source, report }) =>\n Effect.gen(function* checkPackages() {\n const workspaces = yield* namedWorkspaces(project.root);\n const asWorkflow = groupOf(\"name\")(WORKFLOW.exec(filename));\n const asAction = groupOf(\"name\")(ACTION.exec(filename));\n const found: readonly Finding[] = [\n ...pipe(\n asAction,\n Option.flatMap((name) => named(workspaces, name)),\n Option.map((directory): Finding => ({\n ...FIRST_LINE,\n message: packageMessage(\n `The action ${Option.getOrElse(asAction, () => \"\")}`,\n directory,\n ),\n })),\n Option.toArray,\n ),\n ...pipe(\n Option.all([asWorkflow, Option.fromNullishOr(source.yaml)]),\n Option.map(([stem, root]) => workflowFindings(workspaces, stem, root)),\n Option.getOrElse((): readonly Finding[] => []),\n ),\n ];\n for (const each of found) {\n report(each);\n }\n }).pipe(inRepository),\n});\n","import { defineRule } from \"@r_masseater/fu4\";\nimport { Array as Arr, Option, pipe } from \"effect\";\n\nimport { childOf, entriesOf, keyNodeOf, rootOf, scalarsIn } from \"./yaml.ts\";\n\nconst FILTER_KEYS: readonly string[] = [\"paths\", \"paths-ignore\"];\nconst PATHS_FILTER_ACTION = /(?:^|\\/)paths-filter@/u;\nconst MESSAGE =\n \"A workflow that reacts to changes under listed paths needs a new entry for every package and drifts from the packages it is meant to cover. Run the generic pipeline on every push and let it decide from the workspace what changed.\";\n\n/** @internal */\nexport const workflowPathFilter = defineRule({\n meta: {\n description: \"Reports paths and paths-ignore triggers and the paths-filter action\",\n kinds: [\"workflow\"],\n },\n check: (context): void => {\n const root = rootOf(context);\n const triggers = pipe(\n root,\n childOf(\"on\"),\n entriesOf,\n Arr.flatMap(([, trigger]) =>\n pipe(\n FILTER_KEYS,\n Arr.flatMap((key) => pipe(Option.some(trigger), keyNodeOf(key), Option.toArray)),\n ),\n ),\n );\n const actions = pipe(\n Option.toArray(root),\n Arr.flatMap((node) => scalarsIn(node)),\n Arr.filter(({ text }) => PATHS_FILTER_ACTION.test(text)),\n );\n for (const found of [...triggers, ...actions]) {\n context.report({ line: found.line, column: found.column, message: MESSAGE });\n }\n },\n});\n","import { defineRule } from \"@r_masseater/fu4\";\nimport { Array as Arr, Effect, Option, String as Str, pipe } from \"effect\";\n\nimport { existsAt, isDirectoryAt, isIgnored, staticPrefix } from \"#/shared/lib/path-existence.ts\";\nimport { RepositoryFiles } from \"#/shared/lib/repository-files.ts\";\n\nimport { inRepository } from \"./repository-services.ts\";\nimport { ACTION_DEFINITIONS, producedPaths, workflowReferences } from \"./workflow-references.ts\";\nimport type { ReferenceKind, WorkflowReference } from \"./workflow-references.ts\";\n\nconst SEPARATOR = \"/\";\n\nconst EXPECTED: Readonly<Record<ReferenceKind, string>> = {\n action: \"a directory with action.yml\",\n directory: \"a directory\",\n file: \"a file\",\n glob: \"a pattern that matches a tracked file\",\n script: \"a file\",\n};\n\ntype Resolver = (root: string, path: string) => Effect.Effect<boolean, never, RepositoryFiles>;\n\nconst matchesAny = Effect.fn(\"matchesAny\")(function* matchesAny(\n root: string,\n pathspecs: readonly string[],\n) {\n const files = yield* RepositoryFiles;\n const matched = yield* files.matchingFiles(root, pathspecs);\n return Arr.isReadonlyArrayNonEmpty(matched);\n});\n\nconst matchesGlob: Resolver = (root, path) => matchesAny(root, [`:(glob)${path}`]);\n\nconst hasAction: Resolver = Effect.fn(\"hasAction\")(function* hasAction(root: string, path: string) {\n const found = yield* Effect.forEach(\n ACTION_DEFINITIONS,\n (name) => existsAt(root, `${path}${SEPARATOR}${name}`),\n { concurrency: 1 },\n );\n return pipe(found, Arr.some(Boolean));\n});\n\nconst suffixAt =\n (segments: readonly string[]) =>\n (index: number): string =>\n `:(glob)**/${pipe(segments, Arr.drop(index), Arr.join(SEPARATOR))}`;\n\nconst findsScript: Resolver = Effect.fn(\"findsScript\")(function* findsScript(\n root: string,\n path: string,\n) {\n if (yield* existsAt(root, path)) {\n return true;\n }\n const segments = Str.split(path, SEPARATOR);\n return yield* matchesAny(root, Arr.makeBy(segments.length, suffixAt(segments)));\n});\n\nconst RESOLVERS: Readonly<Record<ReferenceKind, Resolver>> = {\n action: hasAction,\n directory: isDirectoryAt,\n file: existsAt,\n glob: matchesGlob,\n script: findsScript,\n};\n\nconst overlaps =\n (path: string) =>\n (produced: string): boolean =>\n produced === path ||\n Str.startsWith(`${path}${SEPARATOR}`)(produced) ||\n Str.startsWith(`${produced}${SEPARATOR}`)(path);\n\nconst isMissing = Effect.fn(\"isMissing\")(function* isMissing(\n root: string,\n produced: readonly string[],\n found: WorkflowReference,\n) {\n const prefix = staticPrefix(found.path);\n if (pipe(produced, Arr.some(overlaps(prefix)))) {\n return false;\n }\n if (yield* RESOLVERS[found.kind](root, found.path)) {\n return false;\n }\n return !(yield* isIgnored(root, found.path));\n});\n\nexport const workflowPath = defineRule({\n meta: {\n description: \"Reports a path that a workflow names and the repository does not have\",\n kinds: [\"workflow\"],\n },\n check: ({ project, source, report }) =>\n Effect.gen(function* checkPaths() {\n for (const yaml of Option.toArray(Option.fromNullishOr(source.yaml))) {\n const produced = producedPaths(yaml);\n const missing = yield* Effect.filter(workflowReferences(yaml), (found) =>\n isMissing(project.root, produced, found),\n );\n for (const found of missing) {\n report({\n line: found.line,\n column: found.column,\n message: `${found.field} names ${found.path}, which is not ${EXPECTED[found.kind]} in this repository. Point it at a path that exists or remove it.`,\n });\n }\n }\n }).pipe(inRepository),\n});\n","import { defineRule } from \"@r_masseater/fu4\";\nimport { keysOf } from \"@r_masseater/fu4/rules\";\nimport { Array as Arr, Option, pipe } from \"effect\";\n\nimport { keyNodeOf, rootOf, valuesNamed } from \"./yaml.ts\";\n\nconst CONCURRENCY_KEY = \"concurrency\";\nconst QUEUE_KEY = \"queue\";\nconst MESSAGE =\n \"queues runs with `queue`. A queued group runs every old push one by one, so a long run holds back the newest commit for hours. Drop `queue`: a job that later pushes redo gets `cancel-in-progress: true`, and a deploy or release job keeps the default, which lets the running one finish and replaces the waiting one with the newest run.\";\n\n/** @internal */\nexport const workflowQueue = defineRule({\n meta: {\n description:\n \"Reports queue on a concurrency group, because a queued group holds back the newest commit\",\n kinds: [\"workflow\"],\n },\n check: (context): void => {\n const keys = pipe(\n rootOf(context),\n Option.toArray,\n Arr.flatMap((root) => valuesNamed(CONCURRENCY_KEY)(root)),\n Arr.filter((group) => Arr.contains(keysOf(group), QUEUE_KEY)),\n Arr.flatMap((group) => pipe(Option.some(group), keyNodeOf(QUEUE_KEY), Option.toArray)),\n );\n for (const key of keys) {\n context.report({ line: key.line, column: key.column, message: MESSAGE });\n }\n },\n});\n","import { NOOP, runOf, workflowRule } from \"@r_masseater/fu4/rules\";\nimport type { Visitor } from \"@r_masseater/fu4/rules\";\nimport { Array as Arr, Option, String as Str, pipe } from \"effect\";\n\nconst COMMAND_CHAIN = /&&|\\|\\||;|\\|/u;\nconst QUOTED = /\\$\\{\\{.*?\\}\\}|\"(?:[^\"\\\\]|\\\\.)*\"|'[^']*'/gu;\nconst COMMENT = \"#\";\nconst ONE_COMMAND = 1;\nconst MESSAGE =\n \"runs more than one command. Keep a step to one command, `vp run <task>` or `vp exec <bin>`, and put the logic in a Vite+ task in TypeScript.\";\n\nconst isCommand = (line: string): boolean => Str.isNonEmpty(line) && !Str.startsWith(COMMENT)(line);\n\nconst chainsCommands = (line: string): boolean =>\n COMMAND_CHAIN.test(Str.replaceAll(QUOTED, \"\")(line));\n\nconst runsMoreThanOneCommand = (text: string): boolean => {\n const lines = pipe(Str.split(\"\\n\")(text), Arr.map(Str.trim), Arr.filter(isCommand));\n return lines.length > ONE_COMMAND || pipe(lines, Arr.some(chainsCommands));\n};\n\n/** @internal */\nexport const workflowScript = workflowRule({\n description: \"Reports a run step with more than one command, because the logic belongs in a task\",\n visitor: (fail): Visitor => ({\n ...NOOP,\n step: (step): void => {\n const runs = pipe(\n runOf(step),\n Option.flatMap(({ run }) => Option.fromNullishOr(run)),\n Option.filter(({ value }) => runsMoreThanOneCommand(value)),\n Option.toArray,\n );\n for (const found of runs) {\n fail(found, MESSAGE);\n }\n },\n }),\n});\n","import { definePlugin } from \"@r_masseater/fu4\";\nimport type { Fu4Config } from \"@r_masseater/fu4\";\nimport { Array as Arr, Record as Rec, pipe } from \"effect\";\n\nimport { publishTrigger } from \"./publish-trigger.ts\";\nimport { releasePlease } from \"./release-please.ts\";\nimport { workflowCommit } from \"./workflow-commit.ts\";\nimport { workflowPackage } from \"./workflow-package.ts\";\nimport { workflowPathFilter } from \"./workflow-path-filter.ts\";\nimport { workflowPath } from \"./workflow-path.ts\";\nimport { workflowQueue } from \"./workflow-queue.ts\";\nimport { workflowScript } from \"./workflow-script.ts\";\n\nconst NAME = \"msch\";\n\nconst plugin = definePlugin({\n rules: {\n \"publish-trigger\": publishTrigger,\n \"release-please\": releasePlease,\n \"workflow-commit\": workflowCommit,\n \"workflow-package\": workflowPackage,\n \"workflow-path\": workflowPath,\n \"workflow-path-filter\": workflowPathFilter,\n \"workflow-queue\": workflowQueue,\n \"workflow-script\": workflowScript,\n },\n});\n\n/** @internal */\nexport const workflowPolicy = (): Fu4Config => ({\n plugins: Rec.singleton(NAME, plugin),\n rules: pipe(\n Rec.keys(plugin.rules),\n Arr.map((rule): readonly [string, \"error\"] => [`${NAME}/${rule}`, \"error\"]),\n Rec.fromEntries,\n ),\n});\n","import type { Fu4Config } from \"@r_masseater/fu4\";\nimport { recommended } from \"@r_masseater/fu4/presets\";\n\nimport { workflowPolicy } from \"./policy.ts\";\n\n/** @internal */\nexport const fu4Of = (): Fu4Config => ({ extends: [recommended(), workflowPolicy()] });\n","import { fileURLToPath } from \"node:url\";\n\nimport { RuleConfigSeverity } from \"@commitlint/types\";\nimport type { ToolSections } from \"@r_masseater/vite-plus-adopt\";\nimport { Option, pipe } from \"effect\";\n\nexport interface CommitOptions {\n readonly subjectScripts: readonly string[];\n}\n\nexport type CommitlintSection = NonNullable<ToolSections[\"commitlint\"]>;\n\nconst COMMIT_CONVENTION = fileURLToPath(import.meta.resolve(\"@commitlint/config-conventional\"));\n\nexport const COMMIT_LINT = { extends: [COMMIT_CONVENTION] };\n\nexport const SUBJECT_SCRIPT = \"subject-script\";\n\nconst JAPANESE_SCRIPTS: readonly string[] = [\"Hiragana\", \"Katakana\", \"Han\"];\n\nexport const commitlintOf = (commit: CommitOptions | undefined): CommitlintSection => {\n const subjectScripts = pipe(\n Option.fromUndefinedOr(commit),\n Option.match({\n onNone: () => JAPANESE_SCRIPTS,\n onSome: (options) => options.subjectScripts,\n }),\n );\n return {\n ...COMMIT_LINT,\n rules: { [SUBJECT_SCRIPT]: [RuleConfigSeverity.Error, \"always\", [...subjectScripts]] },\n };\n};\n","import { RUNTIME_SECTIONS } from \"@r_masseater/masseater-utils/kestrion\";\nimport type { DependencySection } from \"@r_masseater/masseater-utils/kestrion\";\nimport { Record as Rec, pipe } from \"effect\";\nimport type { UserConfig } from \"vite-plus\";\n\nimport type { WorkspaceSettings } from \"#/features/build-workspace-settings/index.ts\";\nimport { requiredStack } from \"#/shared/config/index.ts\";\n\nexport type DependencyRules = NonNullable<UserConfig[\"dependencyRules\"]>;\ntype Allowed = NonNullable<DependencyRules[\"allowed\"]>;\n\nconst allowedIn = (\n allowances: WorkspaceSettings[\"devDependencies\"],\n fields: readonly DependencySection[],\n): Allowed =>\n pipe(\n allowances,\n Rec.map(({ workspaces, dependencies }) => ({ workspaces, dependencies, fields: [...fields] })),\n );\n\nexport const PLUGIN_DEPENDENCIES =\n \"Claude Code installs a plugin's dependencies from its own package.json and lockfile, where only exact registry versions install\";\n\nexport const dependencyRulesOf = (workspace: WorkspaceSettings): DependencyRules => ({\n allowed: {\n ...allowedIn(workspace.devDependencies, [\"devDependencies\"]),\n ...allowedIn(workspace.dependencies, RUNTIME_SECTIONS),\n },\n banned: requiredStack,\n exactDependencies: { [PLUGIN_DEPENDENCIES]: workspace.plugins },\n});\n","import { Array as Arr, Option, pipe } from \"effect\";\nimport type { UserConfig } from \"vite-plus\";\n\nimport type {\n AddedRulesValue,\n WorkspaceSettings,\n} from \"#/features/build-workspace-settings/index.ts\";\nimport type { MarkdownOptions, FallowConfig } from \"#/features/define-lint-preset/index.ts\";\nimport {\n decisionTestRules,\n exempt,\n fallowOf,\n lint as preset,\n markdownOf,\n structureOf,\n tracedRules,\n} from \"#/features/define-lint-preset/index.ts\";\nimport { fu4Of } from \"#/features/guard-workflows/index.ts\";\n\nimport { recordBuilt } from \"./built-config.ts\";\nimport { commitlintOf } from \"./repository-commit.ts\";\nimport type { CommitOptions } from \"./repository-commit.ts\";\nimport { dependencyRulesOf } from \"./repository-dependencies.ts\";\nimport { gitHooksOf, tasksOf, toolsOf } from \"./repository-tasks.ts\";\nimport type {\n CargoInputs,\n GitHooksSection,\n ToolsSection,\n UsageOptions,\n} from \"./repository-tasks.ts\";\nimport { secretsOf, textlintOf } from \"./repository-text.ts\";\nimport type { TextOptions } from \"./repository-text.ts\";\n\nexport interface AddedOverride {\n readonly files: readonly string[];\n readonly excludeFiles?: readonly string[];\n readonly rules: AddedRulesValue;\n}\n\nexport interface RepositoryOptions {\n readonly root: string;\n readonly commit?: CommitOptions;\n readonly overrides?: readonly AddedOverride[];\n readonly textlint?: TextOptions;\n readonly markdown?: Omit<MarkdownOptions, \"indexSkill\">;\n readonly run?: {\n readonly tasks?: Readonly<Record<string, string>>;\n readonly remoteCache?: string;\n };\n readonly usage?: UsageOptions;\n readonly tools?: ToolsSection;\n readonly gitHooks?: GitHooksSection;\n readonly fallow?: FallowConfig;\n}\n\ntype OxlintOverride = NonNullable<NonNullable<UserConfig[\"lint\"]>[\"overrides\"]>[number];\n\ninterface SharedCache {\n readonly scripts: true;\n readonly tasks: true;\n readonly remote: { readonly url: string };\n}\n\nconst cacheOf = (remoteCache: string | undefined): SharedCache | true =>\n pipe(\n Option.fromNullishOr(remoteCache),\n Option.match({\n onNone: (): SharedCache | true => true,\n onSome: (url) => ({ scripts: true, tasks: true, remote: { url } }),\n }),\n );\n\nconst STAGED = { \"*\": \"vp fmt --no-error-on-unmatched-pattern\" };\n\nconst FORMAT = {\n ignorePatterns: exempt,\n sortImports: true,\n sortTailwindcss: true,\n sortPackageJson: true,\n};\n\nconst added = ({ files, excludeFiles, rules }: AddedOverride): OxlintOverride =>\n pipe(\n Option.fromUndefinedOr(excludeFiles),\n Option.match({\n onNone: (): OxlintOverride => ({ files: [...files], rules: { ...rules } }),\n onSome: (excluded): OxlintOverride => ({\n files: [...files],\n excludeFiles: [...excluded],\n rules: { ...rules },\n }),\n }),\n );\n\nconst lintOf = ({\n workspace,\n overrides = [],\n}: DerivedOptions): NonNullable<UserConfig[\"lint\"]> => ({\n ...preset,\n ignorePatterns: exempt,\n overrides: [\n ...preset.overrides,\n {\n files: [...workspace.lint.shadcnUi],\n rules: { \"react/jsx-props-no-spreading\": \"off\" },\n },\n {\n files: [\n ...workspace.lint.publicEntries,\n ...workspace.lint.deployEntries,\n ...workspace.lint.siteEntries,\n ],\n rules: { \"import/no-default-export\": \"off\" },\n },\n {\n files: [\n ...workspace.lint.deployEntries,\n ...workspace.lint.siteEntries,\n \"**/*.server.ts\",\n \"**/*.server.tsx\",\n ],\n excludeFiles: [\"**/*.test.ts\", \"**/*.test.tsx\"],\n rules: tracedRules,\n },\n ...pipe(overrides, Arr.map(added)),\n ...workspace.lint.overrides,\n { files: [\"**/*.test.ts\"], rules: decisionTestRules },\n ],\n});\n\n/** @internal */\nexport interface DerivedOptions extends Omit<RepositoryOptions, \"root\"> {\n readonly workspace: WorkspaceSettings;\n readonly cargo: Option.Option<CargoInputs>;\n}\n\n/** @internal */\nexport const configOf = (options: DerivedOptions): UserConfig => {\n const {\n workspace,\n commit,\n textlint = {},\n markdown = {},\n run = {},\n usage,\n cargo,\n gitHooks,\n fallow,\n } = options;\n const ownFallow = Option.toArray(Option.fromUndefinedOr(fallow));\n return recordBuilt({\n commitlint: commitlintOf(commit),\n dependencyRules: dependencyRulesOf(workspace),\n h56m: secretsOf(),\n wism: structureOf({\n members: workspace.members,\n ignorePatterns: exempt,\n }),\n textlint: textlintOf({ ...textlint, articles: workspace.articles }),\n y8: markdownOf({ ...markdown, indexSkill: workspace.indexSkill }),\n fu4: fu4Of(),\n fallow: fallowOf([...workspace.fallow, ...ownFallow]),\n tools: toolsOf(options.tools),\n test: { projects: [...workspace.testProjects], passWithNoTests: true },\n staged: STAGED,\n gitHooks: gitHooksOf(gitHooks),\n fmt: FORMAT,\n lint: lintOf(options),\n run: {\n cache: cacheOf(run.remoteCache),\n tasks: tasksOf({\n workspace,\n commands: run.tasks ?? {},\n usage: Option.fromUndefinedOr(usage),\n cargo,\n }),\n },\n });\n};\n","import { Effect, Option, Schema, String as Str } from \"effect\";\nimport type { UserConfig } from \"vite-plus\";\n\nimport { workspaceSettings } from \"#/features/build-workspace-settings/index.ts\";\nimport { cargoInputs } from \"#/features/derive-cargo-inputs/index.ts\";\nimport { RepositoryFiles, nodeRepositoryFiles } from \"#/shared/lib/repository-files.ts\";\n\nimport { configOf } from \"./repository-config.ts\";\nimport type { RepositoryOptions } from \"./repository-config.ts\";\nimport type { CargoInputs } from \"./repository-tasks.ts\";\n\nexport type { AddedOverride, RepositoryOptions } from \"./repository-config.ts\";\n\nconst CARGO_MANIFEST = \"Cargo.toml\";\n\nconst derivedCargo = Effect.fn(\"derivedCargo\")(function* derivedCargo(root: string) {\n const files = yield* RepositoryFiles;\n const present = yield* files.exists(files.join(root, CARGO_MANIFEST));\n if (!present) {\n return Option.none<CargoInputs>();\n }\n const inputs = yield* Effect.promise(() => cargoInputs({ directory: root }));\n return Option.some(inputs);\n});\n\nconst Manifest = Schema.fromJsonString(Schema.Struct({ name: Schema.String }));\n\nconst repositoryName = Effect.fn(\"repositoryName\")(function* repositoryName(root: string) {\n const files = yield* RepositoryFiles;\n const text = yield* files.readFile(files.join(root, \"package.json\"));\n const manifest = yield* text.pipe(\n Option.getOrElse(() => \"{}\"),\n Schema.decodeEffect(Manifest),\n Effect.orDie,\n );\n return manifest.name;\n});\n\nconst remoteCacheOf = Effect.fn(\"remoteCacheOf\")(function* remoteCacheOf(\n root: string,\n base: string,\n) {\n const name = yield* repositoryName(root);\n return `${Str.replace(/\\/+$/u, \"\")(base)}/${encodeURIComponent(name)}`;\n});\n\ntype RunOptions = NonNullable<RepositoryOptions[\"run\"]>;\n\nconst derivedRun = (\n root: string,\n run: RunOptions,\n): Effect.Effect<RunOptions, never, RepositoryFiles> =>\n Option.fromNullishOr(run.remoteCache).pipe(\n Option.match({\n onNone: () => Effect.succeed(run),\n onSome: (base) =>\n remoteCacheOf(root, base).pipe(Effect.map((remoteCache) => ({ ...run, remoteCache }))),\n }),\n );\n\nconst derivedConfig = Effect.fn(\"derivedConfig\")(function* derivedConfig({\n root,\n run = {},\n ...options\n}: RepositoryOptions) {\n const workspace = yield* Effect.promise(() => workspaceSettings({ root }));\n const cargo = yield* derivedCargo(root);\n const derived = yield* derivedRun(root, run);\n return configOf({ ...options, run: derived, workspace, cargo });\n});\n\nexport const repositoryConfig = (options: RepositoryOptions): Promise<UserConfig> =>\n Effect.runPromise(derivedConfig(options).pipe(Effect.provide(nodeRepositoryFiles)));\n"],"mappings":";;;;;;;;;;;;;;;;;;AAKA,MAAM,WAAW,UAAU,IAAIA,OAAI,WAAW,GAAQ,CAAC;AAOvD,MAAa,eAAe,EAAE,SAAS,qBACrC,UAAU;CACR,OAAO;EAAC,UAAU,EAAE,OAAO,QAAQ,CAAC;EAAG,UAAU;EAAG,MAAM;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W,cAAc,OAAO,CAAC,CAAC,KAAK,OAAO,QAAQ,mBAAmB,CAAC,CAAC"}
@@ -0,0 +1,43 @@
1
+ import { createDecisionPlugin, defineDecisionRule } from "@r_masseater/oxlint-plugin-decision";
2
+ // src/features/define-lint-preset/config/decision-rules.ts
3
+ var decision_rules_default = createDecisionPlugin({
4
+ name: "stack",
5
+ rules: [
6
+ defineDecisionRule({
7
+ id: "exclusive-status",
8
+ target: "file",
9
+ question: "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. Fields that each stand on their own, so that every combination of them is valid, such as the optional filters of a search, the options of a request or independent settings, describe separate things and are not a violation.",
10
+ message: "状態は排他的なstatusを持つ判別共用体で表し、booleanフラグの組を使わない。",
11
+ cutoff: .8,
12
+ location: {
13
+ question: "Select the declaration of the boolean flags or optional fields that describe one piece of state.",
14
+ cutoff: .8
15
+ }
16
+ }),
17
+ defineDecisionRule({
18
+ id: "server-state-tanstack-query",
19
+ target: "file",
20
+ question: "Does this code, running in the browser, fetch, cache or synchronize server data with something other than TanStack Query or the Query and Command of Effect UI, such as fetch inside useEffect, SWR or a hand-written cache? Answer no when server data in the browser goes only through TanStack Query or Effect UI, when the file runs only on a server, in a Worker or in a command-line tool, when the file is part of plover, the framework that carries Effect UI queries between the Worker and the browser, or when the file handles no server data. A file that a static site built with it, such as a search index that a plain script of that site loads, is part of the site and not server data. Creating an API client such as a better-auth or Eden client, which fetches nothing until a query calls it, is not a violation.",
21
+ message: "ブラウザのサーバー状態はTanStack QueryかEffect UIのQuery・Commandだけで扱う。",
22
+ cutoff: .8,
23
+ location: {
24
+ question: "Select the code that fetches, caches or synchronizes server data outside TanStack Query and Effect UI.",
25
+ cutoff: .8
26
+ }
27
+ }),
28
+ defineDecisionRule({
29
+ id: "ui-state-effect-atom",
30
+ target: "file",
31
+ question: "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.",
32
+ message: "UI状態はeffect-atomだけで扱う。",
33
+ cutoff: .8,
34
+ location: {
35
+ question: "Select the code that holds client-side UI state outside effect-atom.",
36
+ cutoff: .8
37
+ }
38
+ })
39
+ ]
40
+ });
41
+ export { decision_rules_default as t };
42
+
43
+ //# sourceMappingURL=decision-rules-CqgOVodl.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"decision-rules-CqgOVodl.mjs","names":[],"sources":["../src/features/define-lint-preset/config/decision-rules.ts"],"sourcesContent":["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. Fields that each stand on their own, so that every combination of them is valid, such as the optional filters of a search, the options of a request or independent settings, describe separate things and are not a violation.\",\n message: \"状態は排他的なstatusを持つ判別共用体で表し、booleanフラグの組を使わない。\",\n cutoff: 0.8,\n location: {\n question:\n \"Select the declaration of the boolean flags or optional fields that describe one piece of state.\",\n cutoff: 0.8,\n },\n }),\n defineDecisionRule({\n id: \"server-state-tanstack-query\",\n target: \"file\",\n question:\n \"Does this code, running in the browser, fetch, cache or synchronize server data with something other than TanStack Query or the Query and Command of Effect UI, such as fetch inside useEffect, SWR or a hand-written cache? Answer no when server data in the browser goes only through TanStack Query or Effect UI, when the file runs only on a server, in a Worker or in a command-line tool, when the file is part of plover, the framework that carries Effect UI queries between the Worker and the browser, or when the file handles no server data. A file that a static site built with it, such as a search index that a plain script of that site loads, is part of the site and not server data. 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かEffect UIのQuery・Commandだけで扱う。\",\n cutoff: 0.8,\n location: {\n question:\n \"Select the code that fetches, caches or synchronizes server data outside TanStack Query and Effect UI.\",\n cutoff: 0.8,\n },\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 location: {\n question: \"Select the code that holds client-side UI state outside effect-atom.\",\n cutoff: 0.8,\n },\n }),\n ],\n});\n"],"mappings":";;AAEA,IAAA,yBAAe,qBAAqB;CAClC,MAAM;CACN,OAAO;EACL,mBAAmB;GACjB,IAAI;GACJ,QAAQ;GACR,UACE;GACF,SAAS;GACT,QAAQ;GACR,UAAU;IACR,UACE;IACF,QAAQ;GACV;EACF,CAAC;EACD,mBAAmB;GACjB,IAAI;GACJ,QAAQ;GACR,UACE;GACF,SAAS;GACT,QAAQ;GACR,UAAU;IACR,UACE;IACF,QAAQ;GACV;EACF,CAAC;EACD,mBAAmB;GACjB,IAAI;GACJ,QAAQ;GACR,UACE;GACF,SAAS;GACT,QAAQ;GACR,UAAU;IACR,UAAU;IACV,QAAQ;GACV;EACF,CAAC;CACH;AACF,CAAC"}
@@ -1,2 +1,3 @@
1
- import { s as _default } from "./index-_y7Igwy0.mjs";
1
+ import "./index-DOkaGaUe.mjs";
2
+ declare const _default: import("@r_masseater/oxlint-plugin-decision").DecisionPlugin;
2
3
  export { _default as default };
@@ -1 +1 @@
1
- export { g as default } from "./define-lint-preset-_bDnJMcY.mjs";
1
+ export { t as default } from "./decision-rules-CqgOVodl.mjs";
@@ -2,7 +2,7 @@ import { PACKAGE_JSON_FILE, ROOT_SUBPATH, SUBPATH_PREFIX, exportEntriesOf, impor
2
2
  import { findPackageJson } from "@r_masseater/masseater-utils/kestrion/node";
3
3
  import { decodePackageJson } from "@r_masseater/masseater-utils/kestrion/npm";
4
4
  import { Array, Effect, Option, Order, Predicate, Record, String, pipe } from "effect";
5
- import { n as NODE_MODULES, r as RepositoryFiles } from "./repository-files-C_GzAnYp.mjs";
5
+ import { n as NODE_MODULES, r as RepositoryFiles } from "./repository-files-CX48nfE5.mjs";
6
6
  // src/entities/package/model/dependencies.ts
7
7
  const WORKSPACE_PROTOCOL = "workspace:";
8
8
  const WILDCARD = "*";
@@ -109,4 +109,4 @@ const dependencyEntries = Effect.fn("dependencyEntries")(function* dependencyEnt
109
109
  });
110
110
  export { workspaceDependencies as i, installedManifest as n, readManifest as r, dependencyEntries as t };
111
111
 
112
- //# sourceMappingURL=dependencies-Bjn3xWkq.mjs.map
112
+ //# sourceMappingURL=dependencies-DgltkhvK.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"dependencies-Bjn3xWkq.mjs","names":["Rec","Arr","Str"],"sources":["../src/entities/package/model/dependencies.ts"],"sourcesContent":["import {\n PACKAGE_JSON_FILE,\n ROOT_SUBPATH,\n SUBPATH_PREFIX,\n exportEntriesOf,\n importSpecifierOf,\n} from \"@r_masseater/masseater-utils/kestrion\";\nimport type { PackageJson } from \"@r_masseater/masseater-utils/kestrion\";\nimport { findPackageJson } from \"@r_masseater/masseater-utils/kestrion/node\";\nimport { decodePackageJson } from \"@r_masseater/masseater-utils/kestrion/npm\";\nimport {\n Array as Arr,\n Effect,\n Option,\n Order,\n Predicate,\n String as Str,\n Record as Rec,\n pipe,\n} from \"effect\";\n\nimport { RepositoryFiles, NODE_MODULES } from \"#/shared/lib/repository-files.ts\";\n\nexport interface DependencyEntry {\n readonly packageName: string;\n readonly specifier: string;\n readonly declarationsPath: string;\n}\n\nconst WORKSPACE_PROTOCOL = \"workspace:\";\nconst WILDCARD = \"*\";\nconst TYPES_CONDITION = \"types\";\nconst TYPES_SCOPE = \"@types/\";\nconst TYPES_SCOPE_SEPARATOR = \"__\";\nconst CONDITION_DEPTH_LIMIT = 8;\nconst ROOT_DEPTH = 0;\nconst DEPTH_STEP = 1;\nconst DECLARATIONS_SUFFIX = /\\.d\\.[cm]?ts$|\\.[cm]?tsx?$/u;\nconst SCRIPT_SUFFIX = /\\.(?<module>[cm]?)js$/u;\n\nexport const readManifest = Effect.fn(\"readManifest\")(function* readManifest(directory: string) {\n const files = yield* RepositoryFiles;\n const text = yield* files.readFile(files.join(directory, PACKAGE_JSON_FILE));\n return pipe(text, Option.flatMap(decodePackageJson));\n});\n\nexport const installedManifest = Effect.fn(\"installedManifest\")(function* installedManifest(\n name: string,\n base: string,\n) {\n const files = yield* RepositoryFiles;\n return yield* pipe(\n findPackageJson(name, base),\n Option.match({\n onNone: () => Effect.succeed(Option.none<PackageJson>()),\n onSome: (file) => readManifest(files.dirname(file)),\n }),\n );\n});\n\nconst conditionsOf = (held: unknown): readonly (readonly [string, unknown])[] => {\n if (!Predicate.isObject(held)) {\n return [];\n }\n return Rec.toEntries(held);\n};\n\nconst typesConditionIn = (held: unknown, depth: number): Option.Option<string> => {\n if (depth > CONDITION_DEPTH_LIMIT) {\n return Option.none();\n }\n const entries = conditionsOf(held);\n const declared = Arr.findFirst(entries, ([condition, target]) =>\n Option.liftPredicate(\n target,\n (candidate) => condition === TYPES_CONDITION && Predicate.isString(candidate),\n ),\n ).pipe(Option.filter(Predicate.isString));\n return Option.orElse(declared, () =>\n Arr.findFirst(entries, ([, nested]) => typesConditionIn(nested, depth + DEPTH_STEP)),\n );\n};\n\nconst anyConditionIn = (held: unknown, depth: number): Option.Option<string> => {\n if (Predicate.isString(held)) {\n return Option.some(held);\n }\n if (depth > CONDITION_DEPTH_LIMIT) {\n return Option.none();\n }\n return Arr.findFirst(conditionsOf(held), ([, nested]) =>\n anyConditionIn(nested, depth + DEPTH_STEP),\n );\n};\n\nconst targetPathsOf = (target: unknown): readonly string[] =>\n Arr.getSomes([typesConditionIn(target, ROOT_DEPTH), anyConditionIn(target, ROOT_DEPTH)]);\n\nconst isDeclaredSubpath = ([subpath]: readonly [string, unknown]): boolean =>\n (subpath === ROOT_SUBPATH || Str.startsWith(SUBPATH_PREFIX)(subpath)) &&\n !Str.includes(WILDCARD)(subpath);\n\nconst declarationsCandidateFor = (entryPath: string): Option.Option<string> => {\n if (DECLARATIONS_SUFFIX.test(entryPath)) {\n return Option.some(entryPath);\n }\n if (!SCRIPT_SUFFIX.test(entryPath)) {\n return Option.none();\n }\n return Option.some(Str.replace(SCRIPT_SUFFIX, \".d.$<module>ts\")(entryPath));\n};\n\nconst firstDeclarationsAmong = Effect.fn(\"firstDeclarationsAmong\")(function* firstDeclarations(\n directory: string,\n entryPaths: readonly string[],\n) {\n const files = yield* RepositoryFiles;\n const candidates = Arr.getSomes(\n pipe(\n entryPaths,\n Arr.map((entryPath) => declarationsCandidateFor(entryPath)),\n ),\n );\n const existing = yield* Effect.filter(\n pipe(\n candidates,\n Arr.map((candidate) => files.join(directory, candidate)),\n ),\n (candidate) => files.exists(candidate),\n );\n return yield* Option.match(Arr.head(existing), {\n onNone: (): Effect.Effect<Option.Option<string>> => Effect.succeedNone,\n onSome: (candidate) => files.realPath(candidate).pipe(Effect.asSome),\n });\n});\n\nconst importNameOf = (packageName: string): string => {\n if (!Str.startsWith(TYPES_SCOPE)(packageName)) {\n return packageName;\n }\n const unscoped = Str.slice(TYPES_SCOPE.length)(packageName);\n if (!Str.includes(TYPES_SCOPE_SEPARATOR)(unscoped)) {\n return unscoped;\n }\n return `@${Str.replace(TYPES_SCOPE_SEPARATOR, \"/\")(unscoped)}`;\n};\n\nconst rootEntryPaths = (manifest: PackageJson): readonly string[] =>\n Arr.getSomes([\n Option.fromUndefinedOr(manifest.types),\n Option.fromUndefinedOr(manifest.typings),\n Option.fromUndefinedOr(manifest.main),\n ]);\n\nconst subpathEntriesOf = Effect.fn(\"subpathEntriesOf\")(function* subpathEntriesOf(\n packageName: string,\n directory: string,\n manifest: PackageJson,\n) {\n const found = yield* Effect.forEach(\n pipe(exportEntriesOf(manifest.exports), Arr.filter(isDeclaredSubpath)),\n ([subpath, target]) =>\n firstDeclarationsAmong(directory, targetPathsOf(target)).pipe(\n Effect.map(\n Option.map((declarationsPath) => ({\n packageName,\n specifier: importSpecifierOf(importNameOf(packageName), subpath),\n declarationsPath,\n })),\n ),\n ),\n { concurrency: 1 },\n );\n return Arr.getSomes(found);\n});\n\nconst entriesOfDependency = Effect.fn(\"entriesOfDependency\")(function* entriesOfDependency(\n packageName: string,\n directory: string,\n) {\n const manifest = yield* readManifest(directory);\n if (Option.isNone(manifest)) {\n return [];\n }\n const subpathEntries = yield* subpathEntriesOf(packageName, directory, manifest.value);\n const rootSpecifier = importSpecifierOf(importNameOf(packageName), ROOT_SUBPATH);\n if (\n pipe(\n subpathEntries,\n Arr.some((entry) => entry.specifier === rootSpecifier),\n )\n ) {\n return subpathEntries;\n }\n const rootDeclarations = yield* firstDeclarationsAmong(directory, rootEntryPaths(manifest.value));\n const rootEntries = rootDeclarations.pipe(\n Option.map((declarationsPath) => ({ packageName, specifier: rootSpecifier, declarationsPath })),\n Option.toArray,\n );\n return [...rootEntries, ...subpathEntries];\n});\n\nconst isWorkspaceRange = Str.startsWith(WORKSPACE_PROTOCOL);\n\nconst namesWhere = (\n keep: (range: string) => boolean,\n declared: Readonly<Record<string, string>>,\n): readonly string[] =>\n pipe(\n Rec.toEntries(declared),\n Arr.filter(([, range]) => keep(range)),\n Arr.map(([packageName]) => packageName),\n );\n\nconst declaredDependencies = (manifest: PackageJson): readonly string[] =>\n namesWhere((range) => !isWorkspaceRange(range), {\n ...manifest.dependencies,\n ...manifest.devDependencies,\n ...manifest.peerDependencies,\n });\n\nexport const workspaceDependencies = (manifest: PackageJson): readonly string[] =>\n namesWhere(isWorkspaceRange, { ...manifest.dependencies, ...manifest.devDependencies });\n\nconst entryOrder = Order.mapInput(Order.String, (entry: DependencyEntry) => entry.specifier);\n\nexport const dependencyEntries = Effect.fn(\"dependencyEntries\")(function* dependencyEntries(\n packageDirectory: string,\n) {\n const files = yield* RepositoryFiles;\n const manifest = yield* readManifest(packageDirectory);\n if (Option.isNone(manifest)) {\n return [];\n }\n const entries = yield* Effect.forEach(\n declaredDependencies(manifest.value),\n (packageName) =>\n entriesOfDependency(packageName, files.join(packageDirectory, NODE_MODULES, packageName)),\n { concurrency: 1 },\n );\n return Arr.sort(\n Arr.dedupeWith(entries.flat(), (left, right) => left.specifier === right.specifier),\n entryOrder,\n );\n});\n"],"mappings":";;;;;;AA6BA,MAAM,qBAAqB;AAC3B,MAAM,WAAW;AACjB,MAAM,kBAAkB;AACxB,MAAM,cAAc;AACpB,MAAM,wBAAwB;AAC9B,MAAM,wBAAwB;AAC9B,MAAM,aAAa;AACnB,MAAM,aAAa;AACnB,MAAM,sBAAsB;AAC5B,MAAM,gBAAgB;AAEtB,MAAa,eAAe,OAAO,GAAG,cAAc,CAAC,CAAC,UAAU,aAAa,WAAmB;CAC9F,MAAM,QAAQ,OAAO;CACrB,MAAM,OAAO,OAAO,MAAM,SAAS,MAAM,KAAK,WAAW,iBAAiB,CAAC;CAC3E,OAAO,KAAK,MAAM,OAAO,QAAQ,iBAAiB,CAAC;AACrD,CAAC;AAED,MAAa,oBAAoB,OAAO,GAAG,mBAAmB,CAAC,CAAC,UAAU,kBACxE,MACA,MACA;CACA,MAAM,QAAQ,OAAO;CACrB,OAAO,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AAc,GAAG,SAAS;AAAgB,CAAC;AAExF,MAAM,aAAa,MAAM,SAAS,MAAM,SAAS,UAA2B,MAAM,SAAS;AAE3F,MAAa,oBAAoB,OAAO,GAAG,mBAAmB,CAAC,CAAC,UAAU,kBACxE,kBACA;CACA,MAAM,QAAQ,OAAO;CACrB,MAAM,WAAW,OAAO,aAAa,gBAAgB;CACrD,IAAI,OAAO,OAAO,QAAQ,GACxB,OAAO,CAAC;CAEV,MAAM,UAAU,OAAO,OAAO,QAC5B,qBAAqB,SAAS,KAAK,IAClC,gBACC,oBAAoB,aAAa,MAAM,KAAK,kBAAkB,cAAc,WAAW,CAAC,GAC1F,EAAE,aAAa,EAAE,CACnB;CACA,OAAOA,MAAI,KACTA,MAAI,WAAW,QAAQ,KAAK,IAAI,MAAM,UAAU,KAAK,cAAc,MAAM,SAAS,GAClF,UACF;AACF,CAAC"}
1
+ {"version":3,"file":"dependencies-DgltkhvK.mjs","names":["Rec","Arr","Str"],"sources":["../src/entities/package/model/dependencies.ts"],"sourcesContent":["import {\n PACKAGE_JSON_FILE,\n ROOT_SUBPATH,\n SUBPATH_PREFIX,\n exportEntriesOf,\n importSpecifierOf,\n} from \"@r_masseater/masseater-utils/kestrion\";\nimport type { PackageJson } from \"@r_masseater/masseater-utils/kestrion\";\nimport { findPackageJson } from \"@r_masseater/masseater-utils/kestrion/node\";\nimport { decodePackageJson } from \"@r_masseater/masseater-utils/kestrion/npm\";\nimport {\n Array as Arr,\n Effect,\n Option,\n Order,\n Predicate,\n String as Str,\n Record as Rec,\n pipe,\n} from \"effect\";\n\nimport { RepositoryFiles, NODE_MODULES } from \"#/shared/lib/repository-files.ts\";\n\nexport interface DependencyEntry {\n readonly packageName: string;\n readonly specifier: string;\n readonly declarationsPath: string;\n}\n\nconst WORKSPACE_PROTOCOL = \"workspace:\";\nconst WILDCARD = \"*\";\nconst TYPES_CONDITION = \"types\";\nconst TYPES_SCOPE = \"@types/\";\nconst TYPES_SCOPE_SEPARATOR = \"__\";\nconst CONDITION_DEPTH_LIMIT = 8;\nconst ROOT_DEPTH = 0;\nconst DEPTH_STEP = 1;\nconst DECLARATIONS_SUFFIX = /\\.d\\.[cm]?ts$|\\.[cm]?tsx?$/u;\nconst SCRIPT_SUFFIX = /\\.(?<module>[cm]?)js$/u;\n\nexport const readManifest = Effect.fn(\"readManifest\")(function* readManifest(directory: string) {\n const files = yield* RepositoryFiles;\n const text = yield* files.readFile(files.join(directory, PACKAGE_JSON_FILE));\n return pipe(text, Option.flatMap(decodePackageJson));\n});\n\nexport const installedManifest = Effect.fn(\"installedManifest\")(function* installedManifest(\n name: string,\n base: string,\n) {\n const files = yield* RepositoryFiles;\n return yield* pipe(\n findPackageJson(name, base),\n Option.match({\n onNone: () => Effect.succeed(Option.none<PackageJson>()),\n onSome: (file) => readManifest(files.dirname(file)),\n }),\n );\n});\n\nconst conditionsOf = (held: unknown): readonly (readonly [string, unknown])[] => {\n if (!Predicate.isObject(held)) {\n return [];\n }\n return Rec.toEntries(held);\n};\n\nconst typesConditionIn = (held: unknown, depth: number): Option.Option<string> => {\n if (depth > CONDITION_DEPTH_LIMIT) {\n return Option.none();\n }\n const entries = conditionsOf(held);\n const declared = Arr.findFirst(entries, ([condition, target]) =>\n Option.liftPredicate(\n target,\n (candidate) => condition === TYPES_CONDITION && Predicate.isString(candidate),\n ),\n ).pipe(Option.filter(Predicate.isString));\n return Option.orElse(declared, () =>\n Arr.findFirst(entries, ([, nested]) => typesConditionIn(nested, depth + DEPTH_STEP)),\n );\n};\n\nconst anyConditionIn = (held: unknown, depth: number): Option.Option<string> => {\n if (Predicate.isString(held)) {\n return Option.some(held);\n }\n if (depth > CONDITION_DEPTH_LIMIT) {\n return Option.none();\n }\n return Arr.findFirst(conditionsOf(held), ([, nested]) =>\n anyConditionIn(nested, depth + DEPTH_STEP),\n );\n};\n\nconst targetPathsOf = (target: unknown): readonly string[] =>\n Arr.getSomes([typesConditionIn(target, ROOT_DEPTH), anyConditionIn(target, ROOT_DEPTH)]);\n\nconst isDeclaredSubpath = ([subpath]: readonly [string, unknown]): boolean =>\n (subpath === ROOT_SUBPATH || Str.startsWith(SUBPATH_PREFIX)(subpath)) &&\n !Str.includes(WILDCARD)(subpath);\n\nconst declarationsCandidateFor = (entryPath: string): Option.Option<string> => {\n if (DECLARATIONS_SUFFIX.test(entryPath)) {\n return Option.some(entryPath);\n }\n if (!SCRIPT_SUFFIX.test(entryPath)) {\n return Option.none();\n }\n return Option.some(Str.replace(SCRIPT_SUFFIX, \".d.$<module>ts\")(entryPath));\n};\n\nconst firstDeclarationsAmong = Effect.fn(\"firstDeclarationsAmong\")(function* firstDeclarations(\n directory: string,\n entryPaths: readonly string[],\n) {\n const files = yield* RepositoryFiles;\n const candidates = Arr.getSomes(\n pipe(\n entryPaths,\n Arr.map((entryPath) => declarationsCandidateFor(entryPath)),\n ),\n );\n const existing = yield* Effect.filter(\n pipe(\n candidates,\n Arr.map((candidate) => files.join(directory, candidate)),\n ),\n (candidate) => files.exists(candidate),\n );\n return yield* Option.match(Arr.head(existing), {\n onNone: (): Effect.Effect<Option.Option<string>> => Effect.succeedNone,\n onSome: (candidate) => files.realPath(candidate).pipe(Effect.asSome),\n });\n});\n\nconst importNameOf = (packageName: string): string => {\n if (!Str.startsWith(TYPES_SCOPE)(packageName)) {\n return packageName;\n }\n const unscoped = Str.slice(TYPES_SCOPE.length)(packageName);\n if (!Str.includes(TYPES_SCOPE_SEPARATOR)(unscoped)) {\n return unscoped;\n }\n return `@${Str.replace(TYPES_SCOPE_SEPARATOR, \"/\")(unscoped)}`;\n};\n\nconst rootEntryPaths = (manifest: PackageJson): readonly string[] =>\n Arr.getSomes([\n Option.fromUndefinedOr(manifest.types),\n Option.fromUndefinedOr(manifest.typings),\n Option.fromUndefinedOr(manifest.main),\n ]);\n\nconst subpathEntriesOf = Effect.fn(\"subpathEntriesOf\")(function* subpathEntriesOf(\n packageName: string,\n directory: string,\n manifest: PackageJson,\n) {\n const found = yield* Effect.forEach(\n pipe(exportEntriesOf(manifest.exports), Arr.filter(isDeclaredSubpath)),\n ([subpath, target]) =>\n firstDeclarationsAmong(directory, targetPathsOf(target)).pipe(\n Effect.map(\n Option.map((declarationsPath) => ({\n packageName,\n specifier: importSpecifierOf(importNameOf(packageName), subpath),\n declarationsPath,\n })),\n ),\n ),\n { concurrency: 1 },\n );\n return Arr.getSomes(found);\n});\n\nconst entriesOfDependency = Effect.fn(\"entriesOfDependency\")(function* entriesOfDependency(\n packageName: string,\n directory: string,\n) {\n const manifest = yield* readManifest(directory);\n if (Option.isNone(manifest)) {\n return [];\n }\n const subpathEntries = yield* subpathEntriesOf(packageName, directory, manifest.value);\n const rootSpecifier = importSpecifierOf(importNameOf(packageName), ROOT_SUBPATH);\n if (\n pipe(\n subpathEntries,\n Arr.some((entry) => entry.specifier === rootSpecifier),\n )\n ) {\n return subpathEntries;\n }\n const rootDeclarations = yield* firstDeclarationsAmong(directory, rootEntryPaths(manifest.value));\n const rootEntries = rootDeclarations.pipe(\n Option.map((declarationsPath) => ({ packageName, specifier: rootSpecifier, declarationsPath })),\n Option.toArray,\n );\n return [...rootEntries, ...subpathEntries];\n});\n\nconst isWorkspaceRange = Str.startsWith(WORKSPACE_PROTOCOL);\n\nconst namesWhere = (\n keep: (range: string) => boolean,\n declared: Readonly<Record<string, string>>,\n): readonly string[] =>\n pipe(\n Rec.toEntries(declared),\n Arr.filter(([, range]) => keep(range)),\n Arr.map(([packageName]) => packageName),\n );\n\nconst declaredDependencies = (manifest: PackageJson): readonly string[] =>\n namesWhere((range) => !isWorkspaceRange(range), {\n ...manifest.dependencies,\n ...manifest.devDependencies,\n ...manifest.peerDependencies,\n });\n\nexport const workspaceDependencies = (manifest: PackageJson): readonly string[] =>\n namesWhere(isWorkspaceRange, { ...manifest.dependencies, ...manifest.devDependencies });\n\nconst entryOrder = Order.mapInput(Order.String, (entry: DependencyEntry) => entry.specifier);\n\nexport const dependencyEntries = Effect.fn(\"dependencyEntries\")(function* dependencyEntries(\n packageDirectory: string,\n) {\n const files = yield* RepositoryFiles;\n const manifest = yield* readManifest(packageDirectory);\n if (Option.isNone(manifest)) {\n return [];\n }\n const entries = yield* Effect.forEach(\n declaredDependencies(manifest.value),\n (packageName) =>\n entriesOfDependency(packageName, files.join(packageDirectory, NODE_MODULES, packageName)),\n { concurrency: 1 },\n );\n return Arr.sort(\n Arr.dedupeWith(entries.flat(), (left, right) => left.specifier === right.specifier),\n entryOrder,\n );\n});\n"],"mappings":";;;;;;AA6BA,MAAM,qBAAqB;AAC3B,MAAM,WAAW;AACjB,MAAM,kBAAkB;AACxB,MAAM,cAAc;AACpB,MAAM,wBAAwB;AAC9B,MAAM,wBAAwB;AAC9B,MAAM,aAAa;AACnB,MAAM,aAAa;AACnB,MAAM,sBAAsB;AAC5B,MAAM,gBAAgB;AAEtB,MAAa,eAAe,OAAO,GAAG,cAAc,CAAC,CAAC,UAAU,aAAa,WAAmB;CAC9F,MAAM,QAAQ,OAAO;CACrB,MAAM,OAAO,OAAO,MAAM,SAAS,MAAM,KAAK,WAAW,iBAAiB,CAAC;CAC3E,OAAO,KAAK,MAAM,OAAO,QAAQ,iBAAiB,CAAC;AACrD,CAAC;AAED,MAAa,oBAAoB,OAAO,GAAG,mBAAmB,CAAC,CAAC,UAAU,kBACxE,MACA,MACA;CACA,MAAM,QAAQ,OAAO;CACrB,OAAO,OAAO,KACZ,gBAAgB,MAAM,IAAI,GAC1B,OAAO,MAAM;EACX,cAAc,OAAO,QAAQ,OAAO,KAAkB,CAAC;EACvD,SAAS,SAAS,aAAa,MAAM,QAAQ,IAAI,CAAC;CACpD,CAAC,CACH;AACF,CAAC;AAED,MAAM,gBAAgB,SAA2D;CAC/E,IAAI,CAAC,UAAU,SAAS,IAAI,GAC1B,OAAO,CAAC;CAEV,OAAOA,OAAI,UAAU,IAAI;AAC3B;AAEA,MAAM,oBAAoB,MAAe,UAAyC;CAChF,IAAI,QAAQ,uBACV,OAAO,OAAO,KAAK;CAErB,MAAM,UAAU,aAAa,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AAC,GAC1F,EAAE,aAAa,EAAE,CACnB;CACA,OAAOA,MAAI,KACTA,MAAI,WAAW,QAAQ,KAAK,IAAI,MAAM,UAAU,KAAK,cAAc,MAAM,SAAS,GAClF,UACF;AACF,CAAC"}
@@ -1,7 +1,7 @@
1
1
  import { Array, Console, Effect, Layer, Option, Record, Schema, Stream, String as String$1, pipe } from "effect";
2
2
  import { ChildProcess } from "effect/process";
3
- import { i as reachable, n as collectPlacedIgnoredDirectories } from "./ignored-directories-CaTFIbjo.mjs";
4
- import { a as nodeServicesLayer, i as nodeRepositoryFiles, r as RepositoryFiles } from "./repository-files-C_GzAnYp.mjs";
3
+ import { i as reachable, n as collectPlacedIgnoredDirectories } from "./ignored-directories-BGiOSvNx.mjs";
4
+ import { a as nodeServicesLayer, i as nodeRepositoryFiles, r as RepositoryFiles } from "./repository-files-CX48nfE5.mjs";
5
5
  import { t as startedOnce } from "./started-once-BN_hLlmU.mjs";
6
6
  import { c as toPosix, o as relativeTo, r as isWithin } from "./path-BhBnc3Sn.mjs";
7
7
  import { getStaticTOMLValue, parseTOML } from "toml-eslint-parser";
@@ -272,4 +272,4 @@ const deriveCargoInputs = Effect.fn("deriveCargoInputs")(function* deriveCargoIn
272
272
  const cargoInputs = (options) => Effect.runPromise(deriveCargoInputs(options).pipe(Effect.provide(nodeLayer)));
273
273
  export { DERIVATION_READS as n, cargoInputs as t };
274
274
 
275
- //# sourceMappingURL=derive-cargo-inputs-BLMqkRS3.mjs.map
275
+ //# sourceMappingURL=derive-cargo-inputs-DbMOBcGP.mjs.map