@r_masseater/msch 0.100.0 → 0.102.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/baseline-rules.d.mts +4 -0
- package/dist/baseline-rules.mjs +61 -0
- package/dist/baseline-rules.mjs.map +1 -0
- package/dist/cargo-inputs.mjs +2 -2
- package/dist/cli.mjs +701 -295
- package/dist/cli.mjs.map +1 -1
- package/dist/config.d.mts +2 -2
- package/dist/config.mjs +8 -4
- package/dist/config.mjs.map +1 -1
- package/dist/decision-rules.d.mts +1 -1
- package/dist/decision-rules.mjs +1 -1
- package/dist/{define-lint-preset-BnOZuTNT.mjs → define-lint-preset-Jiu7pMHB.mjs} +34 -6
- package/dist/define-lint-preset-Jiu7pMHB.mjs.map +1 -0
- package/dist/{ignored-directories-DVyp8bfD.mjs → ignored-directories-B9ZYjMI4.mjs} +2 -2
- package/dist/{ignored-directories-DVyp8bfD.mjs.map → ignored-directories-B9ZYjMI4.mjs.map} +1 -1
- package/dist/{index-DbmdHsLx.d.mts → index-Cg3RkK6V.d.mts} +8 -3
- package/dist/{index-Cdap8t_F.d.mts → index-uu_6hUYh.d.mts} +2 -1
- package/dist/lint.d.mts +2 -2
- package/dist/lint.mjs +1 -1
- package/dist/oxlint.mjs +2 -2
- package/dist/{problem-BTQ96CJ5.mjs → problem-BP2B-3M4.mjs} +2 -2
- package/dist/{problem-BTQ96CJ5.mjs.map → problem-BP2B-3M4.mjs.map} +1 -1
- package/dist/{published-O6THHxdC.mjs → published-DDN36qgu.mjs} +24 -5
- package/dist/published-DDN36qgu.mjs.map +1 -0
- package/dist/{repository-files-BwjF-kJ8.mjs → repository-files-DbZY3I_3.mjs} +9 -1
- package/dist/repository-files-DbZY3I_3.mjs.map +1 -0
- package/dist/{repository-text-qZQSVg9L.mjs → repository-text-B1wK0ETA.mjs} +7 -6
- package/dist/repository-text-B1wK0ETA.mjs.map +1 -0
- package/dist/workspace-settings.d.mts +1 -1
- package/dist/workspace-settings.mjs +5 -4
- package/dist/workspace-settings.mjs.map +1 -1
- package/package.json +17 -4
- package/skills/msch-checks/SKILL.md +9 -1
- package/dist/define-lint-preset-BnOZuTNT.mjs.map +0 -1
- package/dist/published-O6THHxdC.mjs.map +0 -1
- package/dist/repository-files-BwjF-kJ8.mjs.map +0 -1
- package/dist/repository-text-qZQSVg9L.mjs.map +0 -1
package/dist/cli.mjs
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import { i as nodeRepositoryFiles, n as NODE_MODULES, o as TOOL_NAME$1, r as RepositoryFiles, s as groupOf, t as MSCH_CACHE } from "./repository-files-
|
|
3
|
-
import { $ as isIdentifier, A as uniqueByReference, B as getTextOfJSDocComment, C as moduleSpecifierOf, D as resolvedSymbol, E as referencedSymbols, F as SymbolFlags, G as isCallExpression, H as isArrowFunction, I as SyntaxKind, J as isEnumDeclaration, K as isClassDeclaration, L as getJSDocTags, M as IndexKind, N as InternalSymbolName, O as symbolAt, P as SignatureKind, Q as isFunctionExpression, R as getLeadingCommentRanges, S as moduleSpecifierLiteralOf, St as isVariableStatement, T as propertyNamesOf, U as isBinaryExpression, V as isArrayLiteralExpression, W as isBlock, X as isExpressionStatement, Y as isExportDeclaration, Z as isFunctionDeclaration, _ as isGenericDeclaration, _t as isTypeLiteralNode, a as problemAtPosition, at as isNumericLiteral, b as isTypeDeclaration, bt as isVariableDeclaration, c as carriesTag, ct as isPropertyAccessExpression, d as contains, dt as isSatisfiesExpression, et as isImportDeclaration, f as declarationsOf, ft as isSignatureDeclaration, g as isExternalDeclaration, gt as isTypeAliasDeclaration, h as importedModulesOf, ht as isStringLiteral, i as problemAt$7, it as isNewExpression, j as API, k as symbolAtLocation, l as childrenOf$3, lt as isPropertyAssignment, m as descendantsOf, mt as isSpreadElement, nt as isModuleBlock, o as problemInFile, ot as isObjectLiteralExpression, p as declaresAType, pt as isSourceFile, q as isElementAccessExpression, r as formatProblem, rt as isModuleDeclaration, s as sortProblems, st as isParenthesizedExpression, t as ProblemList, tt as isInterfaceDeclaration, u as columnOf, ut as isReturnStatement, v as isInsideAny, vt as isTypeReferenceNode, w as packageOf$1, x as lineOf$5, xt as isVariableDeclarationList, y as isOutsideDeclaration, yt as isUnionTypeNode, z as getNameOfDeclaration } from "./problem-
|
|
4
|
-
import { B as
|
|
2
|
+
import { i as nodeRepositoryFiles, n as NODE_MODULES, o as TOOL_NAME$1, r as RepositoryFiles, s as groupOf, t as MSCH_CACHE } from "./repository-files-DbZY3I_3.mjs";
|
|
3
|
+
import { $ as isIdentifier, A as uniqueByReference, B as getTextOfJSDocComment, C as moduleSpecifierOf, D as resolvedSymbol, E as referencedSymbols, F as SymbolFlags, G as isCallExpression, H as isArrowFunction, I as SyntaxKind, J as isEnumDeclaration, K as isClassDeclaration, L as getJSDocTags, M as IndexKind, N as InternalSymbolName, O as symbolAt, P as SignatureKind, Q as isFunctionExpression, R as getLeadingCommentRanges, S as moduleSpecifierLiteralOf, St as isVariableStatement, T as propertyNamesOf, U as isBinaryExpression, V as isArrayLiteralExpression, W as isBlock, X as isExpressionStatement, Y as isExportDeclaration, Z as isFunctionDeclaration, _ as isGenericDeclaration, _t as isTypeLiteralNode, a as problemAtPosition, at as isNumericLiteral, b as isTypeDeclaration, bt as isVariableDeclaration, c as carriesTag, ct as isPropertyAccessExpression, d as contains, dt as isSatisfiesExpression, et as isImportDeclaration, f as declarationsOf, ft as isSignatureDeclaration, g as isExternalDeclaration, gt as isTypeAliasDeclaration, h as importedModulesOf, ht as isStringLiteral, i as problemAt$7, it as isNewExpression, j as API, k as symbolAtLocation, l as childrenOf$3, lt as isPropertyAssignment, m as descendantsOf, mt as isSpreadElement, nt as isModuleBlock, o as problemInFile, ot as isObjectLiteralExpression, p as declaresAType, pt as isSourceFile, q as isElementAccessExpression, r as formatProblem, rt as isModuleDeclaration, s as sortProblems, st as isParenthesizedExpression, t as ProblemList, tt as isInterfaceDeclaration, u as columnOf, ut as isReturnStatement, v as isInsideAny, vt as isTypeReferenceNode, w as packageOf$1, x as lineOf$5, xt as isVariableDeclarationList, y as isOutsideDeclaration, yt as isUnionTypeNode, z as getNameOfDeclaration } from "./problem-BP2B-3M4.mjs";
|
|
4
|
+
import { B as keyName, C as workspaceProjects, D as VERIFY_TASK, E as RUN_TASKS, G as dependencyEntries, H as nestedValues, J as workspaceDependencies$1, K as installedManifest, L as workspaceConfigOf, O as definesTask, R as KeySchema, S as workspaceDirectories, U as propertyValue, V as literalOf, W as stringsIn, a as workspaceConfigs, b as publishedProjects, c as publicEntriesOf, d as FRONTMATTER, f as splitFrontmatter, g as deployEntries, h as bundledEntries, i as publishedWorkspaces, k as hasVerifyTask, l as publishedArticlesIn, m as workspaceLinks, o as entryNameOf, q as readManifest, r as packedWorkspaces, s as isBinEntry, u as isIndexSkill, v as shadcnUiOf, w as workspaceManifest, x as unmatchedWorkspacePatterns, z as childrenOf$4 } from "./published-DDN36qgu.mjs";
|
|
5
5
|
import { a as parent, i as join, n as isInside, t as baseName$1 } from "./path-DUttmo2s.mjs";
|
|
6
6
|
import { n as DECISION_TIMEOUT_MS, r as JAPANESE, t as DECISION_MODEL } from "./config-BBdsNPSO.mjs";
|
|
7
7
|
import { t as startedOnce } from "./started-once-muJbvD_I.mjs";
|
|
8
|
-
import {
|
|
9
|
-
import { a as MSCH_TASK_COMMANDS, n as
|
|
8
|
+
import { g as decisionTestRules, n as MARKDOWN_RULES, p as lint$3, r as markdownIgnoresOf, x as exempt } from "./define-lint-preset-Jiu7pMHB.mjs";
|
|
9
|
+
import { a as MSCH_TASK_COMMANDS, n as secretsOf, r as textIgnoresOf, t as builtTextRuleNames } from "./repository-text-B1wK0ETA.mjs";
|
|
10
10
|
import { builtinModules, isBuiltin } from "node:module";
|
|
11
11
|
import { VpToolsError, findCiDrift, runVpa } from "@r_masseater/vite-plus-adopt";
|
|
12
12
|
import { Array as Array$1, Boolean as Boolean$1, Clock, Config, Console, Context, Effect, Equal, FileSystem, Function, HashMap, HashSet, Match, Metric, Number as Number$1, Option, Order, Path, Predicate, Record, Result, Runtime, Schedule, Schema, SchemaTransformation, Stdio, Stream, String as String$1, pipe } from "effect";
|
|
@@ -42,7 +42,7 @@ import { Base64 } from "effect/encoding";
|
|
|
42
42
|
import { dual } from "effect/Function";
|
|
43
43
|
// package.json
|
|
44
44
|
var name = "@r_masseater/msch";
|
|
45
|
-
var version = "0.
|
|
45
|
+
var version = "0.102.0";
|
|
46
46
|
var homepage = "https://github.com/masseater/ecosystems/tree/main/libs/msch#readme";
|
|
47
47
|
var repository = {
|
|
48
48
|
"type": "git",
|
|
@@ -58,9 +58,9 @@ const rootFlags = {
|
|
|
58
58
|
...hookFlags
|
|
59
59
|
};
|
|
60
60
|
// src/app/output.ts
|
|
61
|
-
const taggedError$
|
|
61
|
+
const taggedError$15 = Schema.TaggedError;
|
|
62
62
|
const NO_PROBLEMS$2 = 0;
|
|
63
|
-
var ProblemsFound = class extends taggedError$
|
|
63
|
+
var ProblemsFound = class extends taggedError$15()("ProblemsFound", { count: Schema.Finite }) {
|
|
64
64
|
[Runtime.errorReported] = false;
|
|
65
65
|
};
|
|
66
66
|
/** @internal */
|
|
@@ -666,7 +666,7 @@ const namedWorkspaces = Effect.fn("namedWorkspaces")(function* namedWorkspaces(r
|
|
|
666
666
|
});
|
|
667
667
|
// src/entities/workspace/model/cargo-crates.ts
|
|
668
668
|
const SEPARATOR$30 = "/";
|
|
669
|
-
const SUCCESS$
|
|
669
|
+
const SUCCESS$7 = 0;
|
|
670
670
|
const CrateTarget = Schema.Struct({ kind: Schema.Array(Schema.String) });
|
|
671
671
|
const CrateDependency = Schema.Struct({ path: Schema.optional(Schema.String) });
|
|
672
672
|
const CrateEntry = Schema.Struct({
|
|
@@ -699,7 +699,7 @@ const cratesIn = Effect.fn("cratesIn")(function* cratesIn(root) {
|
|
|
699
699
|
stdin: "ignore"
|
|
700
700
|
});
|
|
701
701
|
const output = yield* handle.stdout.pipe(Stream.decodeText(), Stream.mkString);
|
|
702
|
-
if ((yield* handle.exitCode) !== SUCCESS$
|
|
702
|
+
if ((yield* handle.exitCode) !== SUCCESS$7) return [];
|
|
703
703
|
const list = yield* decodeCrateList(output);
|
|
704
704
|
return pipe(list.packages, Array$1.map(crateOf$1));
|
|
705
705
|
}, Effect.scoped);
|
|
@@ -711,7 +711,7 @@ const owningWorkspace = (directories) => (directory) => {
|
|
|
711
711
|
// src/entities/workspace/model/plugins.ts
|
|
712
712
|
const PLUGIN_FILE$4 = ".claude-plugin/plugin.json";
|
|
713
713
|
const SKILLS_DIRECTORY = "skills";
|
|
714
|
-
const SKILL_FILE$
|
|
714
|
+
const SKILL_FILE$4 = "SKILL.md";
|
|
715
715
|
const CONCURRENCY$4 = 16;
|
|
716
716
|
const SEPARATOR$29 = "/";
|
|
717
717
|
const PluginManifest$1 = Schema.fromJsonString(Schema.Struct({
|
|
@@ -727,7 +727,7 @@ const bySkillName = Order.mapInput(String$1.Order, ({ name }) => name);
|
|
|
727
727
|
const skillIn = Effect.fn("skillIn")(function* skillIn(scan, { plugin, skills }, name) {
|
|
728
728
|
const files = yield* RepositoryFiles;
|
|
729
729
|
const directory = files.join(skills, name);
|
|
730
|
-
const file = files.join(directory, SKILL_FILE$
|
|
730
|
+
const file = files.join(directory, SKILL_FILE$4);
|
|
731
731
|
const source = yield* files.readFile(file);
|
|
732
732
|
const prefix = `${files.relative(scan.root, directory)}${SEPARATOR$29}`;
|
|
733
733
|
const inside = pipe(scan.listed, Array$1.filter(String$1.startsWith(prefix)), Array$1.map((entry) => files.join(scan.root, entry)));
|
|
@@ -745,7 +745,7 @@ const filesUnder = Effect.fn("filesUnder")(function* filesUnder(scan, directory)
|
|
|
745
745
|
const prefix = `${(yield* RepositoryFiles).relative(scan.root, directory)}${SEPARATOR$29}`;
|
|
746
746
|
return pipe(scan.listed, Array$1.filter(String$1.startsWith(prefix)), Array$1.map(String$1.slice(prefix.length)));
|
|
747
747
|
});
|
|
748
|
-
const skillsOf = Effect.fn("skillsOf")(function* skillsOf(scan, plugin, directory) {
|
|
748
|
+
const skillsOf$1 = Effect.fn("skillsOf")(function* skillsOf(scan, plugin, directory) {
|
|
749
749
|
const files = yield* RepositoryFiles;
|
|
750
750
|
const skills = files.join(directory, SKILLS_DIRECTORY);
|
|
751
751
|
const names = yield* files.readDirectory(skills);
|
|
@@ -768,7 +768,7 @@ const pluginAt = Effect.fn("pluginAt")(function* pluginAt(scan, { directory, pub
|
|
|
768
768
|
const { name } = decoded.value;
|
|
769
769
|
const packageVersion = yield* packageVersionAt(directory);
|
|
770
770
|
const inside = yield* filesUnder(scan, directory);
|
|
771
|
-
const skills = yield* skillsOf(scan, name, directory);
|
|
771
|
+
const skills = yield* skillsOf$1(scan, name, directory);
|
|
772
772
|
return Option.some({
|
|
773
773
|
name,
|
|
774
774
|
directory,
|
|
@@ -806,14 +806,14 @@ const SKILLS_START = "<!-- skills:generated -->";
|
|
|
806
806
|
const SKILLS_END = "<!-- /skills:generated -->";
|
|
807
807
|
// src/shared/lib/text-position.ts
|
|
808
808
|
const START$35 = 0;
|
|
809
|
-
const FIRST_COLUMN$
|
|
809
|
+
const FIRST_COLUMN$8 = 1;
|
|
810
810
|
const positionOf = (source) => (index) => {
|
|
811
811
|
const before = pipe(source, String$1.slice(START$35, index), String$1.split("\n"));
|
|
812
812
|
return {
|
|
813
813
|
line: before.length,
|
|
814
814
|
column: pipe(Array$1.last(before), Option.match({
|
|
815
|
-
onNone: () => FIRST_COLUMN$
|
|
816
|
-
onSome: (last) => last.length + FIRST_COLUMN$
|
|
815
|
+
onNone: () => FIRST_COLUMN$8,
|
|
816
|
+
onSome: (last) => last.length + FIRST_COLUMN$8
|
|
817
817
|
}))
|
|
818
818
|
};
|
|
819
819
|
};
|
|
@@ -968,12 +968,12 @@ const RESOLUTION_FILES = [
|
|
|
968
968
|
];
|
|
969
969
|
const RESOLUTION_CONCURRENCY = 2;
|
|
970
970
|
const SUCCEEDED$1 = 0;
|
|
971
|
-
const taggedError$
|
|
972
|
-
var OverrideResolutionFailed = class extends taggedError$
|
|
971
|
+
const taggedError$14 = Schema.TaggedError;
|
|
972
|
+
var OverrideResolutionFailed = class extends taggedError$14()("OverrideResolutionFailed", {
|
|
973
973
|
override: Schema.String,
|
|
974
974
|
output: Schema.String
|
|
975
975
|
}) {};
|
|
976
|
-
const textOf$
|
|
976
|
+
const textOf$1 = (stream) => stream.pipe(Stream.decodeText(), Stream.mkString);
|
|
977
977
|
const resolveIn = Effect.fn("resolveIn")(function* resolveIn(directory, override) {
|
|
978
978
|
const handle = yield* ChildProcess.make("vp", [
|
|
979
979
|
"install",
|
|
@@ -987,7 +987,7 @@ const resolveIn = Effect.fn("resolveIn")(function* resolveIn(directory, override
|
|
|
987
987
|
extendEnv: true,
|
|
988
988
|
stdin: "ignore"
|
|
989
989
|
});
|
|
990
|
-
const [output, status] = yield* Effect.all([textOf$
|
|
990
|
+
const [output, status] = yield* Effect.all([textOf$1(handle.all), handle.exitCode], { concurrency: "unbounded" });
|
|
991
991
|
if (Number(status) !== SUCCEEDED$1) return yield* OverrideResolutionFailed.make({
|
|
992
992
|
override,
|
|
993
993
|
output
|
|
@@ -1004,7 +1004,7 @@ const auditIn = Effect.fn("auditIn")(function* auditIn(directory) {
|
|
|
1004
1004
|
extendEnv: true,
|
|
1005
1005
|
stdin: "ignore"
|
|
1006
1006
|
});
|
|
1007
|
-
const [report] = yield* Effect.all([textOf$
|
|
1007
|
+
const [report] = yield* Effect.all([textOf$1(handle.stdout), handle.exitCode], { concurrency: "unbounded" });
|
|
1008
1008
|
return advisoriesIn(report);
|
|
1009
1009
|
}, Effect.scoped);
|
|
1010
1010
|
const trackedResolutionFiles = Effect.fn("trackedResolutionFiles")(function* trackedFiles(root) {
|
|
@@ -1014,7 +1014,7 @@ const trackedResolutionFiles = Effect.fn("trackedResolutionFiles")(function* tra
|
|
|
1014
1014
|
"--",
|
|
1015
1015
|
...RESOLUTION_FILES
|
|
1016
1016
|
], { cwd: root });
|
|
1017
|
-
const listed = yield* textOf$
|
|
1017
|
+
const listed = yield* textOf$1(handle.stdout);
|
|
1018
1018
|
return pipe(String$1.split(listed, "\0"), Array$1.filter(String$1.isNonEmpty));
|
|
1019
1019
|
}, Effect.scoped);
|
|
1020
1020
|
const copyFiles = Effect.fn("copyFiles")(function* copyFiles(workspace, directory) {
|
|
@@ -1087,7 +1087,7 @@ const checkOverrides = Effect.fn("checkOverrides")(function* checkOverrides(root
|
|
|
1087
1087
|
const SCANNED_FILE = /(?:\.(?:[cm]?[jt]sx?|jsonc?|toml|ya?ml|sh|bash|zsh|fish|rs|cs|go|mk)|(?:^|\/)(?:(?:Dockerfile|Containerfile)[^/]*|Makefile|justfile|\.tool-versions|[^./][^./]*))$/u;
|
|
1088
1088
|
const LOCKFILE$1 = /(?:^|\/)(?:[^/]*\.lock|[^/]*-lock\.(?:json|ya?ml))$/u;
|
|
1089
1089
|
const TOOL_VERSIONS = /(?:^|\/)(?:\.?mise(?:\.[^/]+)?\.toml|\.tool-versions)$/u;
|
|
1090
|
-
const READ_CONCURRENCY$
|
|
1090
|
+
const READ_CONCURRENCY$43 = 64;
|
|
1091
1091
|
const isScannedText = ({ name }) => SCANNED_FILE.test(name) && !LOCKFILE$1.test(name);
|
|
1092
1092
|
const isToolVersions = ({ name }) => TOOL_VERSIONS.test(name);
|
|
1093
1093
|
/** @internal */
|
|
@@ -1110,7 +1110,7 @@ const scanText = Effect.fn("scanText")(function* scanText(listed, foundIn) {
|
|
|
1110
1110
|
const found = yield* Effect.forEach(listed, (entry) => files.readFile(entry.file).pipe(Effect.map(Option.match({
|
|
1111
1111
|
onNone: () => [],
|
|
1112
1112
|
onSome: (source) => foundIn(entry, source)
|
|
1113
|
-
}))), { concurrency: READ_CONCURRENCY$
|
|
1113
|
+
}))), { concurrency: READ_CONCURRENCY$43 });
|
|
1114
1114
|
return Array$1.flatten(found);
|
|
1115
1115
|
});
|
|
1116
1116
|
// src/features/check-overrides/model/git-subpath.ts
|
|
@@ -3449,7 +3449,7 @@ const LEADING_SLASHES = /^\/+/u;
|
|
|
3449
3449
|
const TRAILING_SLASHES = /\/+$/u;
|
|
3450
3450
|
const SPACES = /\s+/u;
|
|
3451
3451
|
const FIRST$27 = 1;
|
|
3452
|
-
const READ_CONCURRENCY$
|
|
3452
|
+
const READ_CONCURRENCY$42 = 16;
|
|
3453
3453
|
const withoutPrefix = (prefix, text) => {
|
|
3454
3454
|
if (String$1.startsWith(prefix)(text)) return String$1.slice(prefix.length)(text);
|
|
3455
3455
|
return text;
|
|
@@ -3540,17 +3540,17 @@ const repeated = (entries) => (entry) => {
|
|
|
3540
3540
|
/** @internal */
|
|
3541
3541
|
const checkColocatedGitPatterns = Effect.fn("checkColocatedGitPatterns")(function* checkColocatedGitPatterns(root) {
|
|
3542
3542
|
const patternFiles = yield* (yield* RepositoryFiles).matchingFiles(root, PATTERN_FILES);
|
|
3543
|
-
const read = yield* Effect.forEach(patternFiles, (file) => entriesIn$2(root, file), { concurrency: READ_CONCURRENCY$
|
|
3543
|
+
const read = yield* Effect.forEach(patternFiles, (file) => entriesIn$2(root, file), { concurrency: READ_CONCURRENCY$42 });
|
|
3544
3544
|
const entries = Array$1.flatten(read);
|
|
3545
3545
|
const workspaces = yield* workspaceDirectories(root);
|
|
3546
|
-
const misplacedFound = yield* Effect.forEach(entries, (entry) => misplaced(root, workspaces, entry), { concurrency: READ_CONCURRENCY$
|
|
3546
|
+
const misplacedFound = yield* Effect.forEach(entries, (entry) => misplaced(root, workspaces, entry), { concurrency: READ_CONCURRENCY$42 });
|
|
3547
3547
|
const repeatedFound = pipe(entries, Array$1.map(repeated(entries)));
|
|
3548
3548
|
return Array$1.getSomes([...misplacedFound, ...repeatedFound]);
|
|
3549
3549
|
});
|
|
3550
3550
|
// src/features/check-placement/model/colocated-tests.ts
|
|
3551
3551
|
const RULE$76 = "colocated-test";
|
|
3552
3552
|
const FIRST$26 = 1;
|
|
3553
|
-
const READ_CONCURRENCY$
|
|
3553
|
+
const READ_CONCURRENCY$41 = 64;
|
|
3554
3554
|
const ROOT_SUBPATH$2 = ".";
|
|
3555
3555
|
const NAME_GROUP$1 = "name";
|
|
3556
3556
|
const SPECIFIER_GROUP = "specifier";
|
|
@@ -3634,21 +3634,21 @@ const checkColocatedTests = Effect.fn("checkColocatedTests")(function* checkColo
|
|
|
3634
3634
|
directory: files.dirname(file)
|
|
3635
3635
|
};
|
|
3636
3636
|
}));
|
|
3637
|
-
const found = yield* Effect.forEach(tests, (test) => problemIn$8(context, test), { concurrency: READ_CONCURRENCY$
|
|
3637
|
+
const found = yield* Effect.forEach(tests, (test) => problemIn$8(context, test), { concurrency: READ_CONCURRENCY$41 });
|
|
3638
3638
|
return Array$1.getSomes(found);
|
|
3639
3639
|
});
|
|
3640
3640
|
// src/shared/lib/agent-docs.ts
|
|
3641
|
-
const AGENT_DOC = /(?:^|\/)(?:AGENTS|CLAUDE)\.md$/u;
|
|
3642
|
-
const READ_CONCURRENCY$
|
|
3641
|
+
const AGENT_DOC$1 = /(?:^|\/)(?:AGENTS|CLAUDE)\.md$/u;
|
|
3642
|
+
const READ_CONCURRENCY$40 = 16;
|
|
3643
3643
|
const agentDocProblems = Effect.fn("agentDocProblems")(function* agentDocProblems(root, problemIn) {
|
|
3644
3644
|
const files = yield* RepositoryFiles;
|
|
3645
3645
|
const listed = yield* files.listedFiles(root);
|
|
3646
|
-
const docs = pipe(listed, Array$1.filter((name) => AGENT_DOC.test(name)));
|
|
3646
|
+
const docs = pipe(listed, Array$1.filter((name) => AGENT_DOC$1.test(name)));
|
|
3647
3647
|
const found = yield* Effect.forEach(docs, (name) => {
|
|
3648
3648
|
const file = files.join(root, name);
|
|
3649
3649
|
const problemOf = Option.flatMap(problemIn(file));
|
|
3650
3650
|
return files.readFile(file).pipe(Effect.map(problemOf));
|
|
3651
|
-
}, { concurrency: READ_CONCURRENCY$
|
|
3651
|
+
}, { concurrency: READ_CONCURRENCY$40 });
|
|
3652
3652
|
return Array$1.getSomes(found);
|
|
3653
3653
|
});
|
|
3654
3654
|
// src/features/check-placement/model/agent-docs-length.ts
|
|
@@ -3670,10 +3670,10 @@ const problemFor$9 = (file) => (lines) => {
|
|
|
3670
3670
|
const checkAgentDocsLength = (root) => agentDocProblems(root, (file) => (source) => problemFor$9(file)(lineCount(source)));
|
|
3671
3671
|
// src/features/check-placement/model/claude-link.ts
|
|
3672
3672
|
const RULE$74 = "claude-md-link";
|
|
3673
|
-
const CLAUDE
|
|
3673
|
+
const CLAUDE = "CLAUDE.md";
|
|
3674
3674
|
const AGENTS = "AGENTS.md";
|
|
3675
3675
|
const FIRST$24 = 1;
|
|
3676
|
-
const READ_CONCURRENCY$
|
|
3676
|
+
const READ_CONCURRENCY$39 = 16;
|
|
3677
3677
|
const MESSAGE$20 = "CLAUDE.md must be a symbolic link to AGENTS.md";
|
|
3678
3678
|
/** @internal */
|
|
3679
3679
|
const checkClaudeLinks = Effect.fn("checkClaudeLinks")(function* checkClaudeLinks(root) {
|
|
@@ -3692,15 +3692,15 @@ const checkClaudeLinks = Effect.fn("checkClaudeLinks")(function* checkClaudeLink
|
|
|
3692
3692
|
message: MESSAGE$20
|
|
3693
3693
|
})));
|
|
3694
3694
|
});
|
|
3695
|
-
const claude = pipe(listed, Array$1.filter((name) => files.basename(name) === CLAUDE
|
|
3696
|
-
const found = yield* Effect.forEach(claude, problemOf, { concurrency: READ_CONCURRENCY$
|
|
3695
|
+
const claude = pipe(listed, Array$1.filter((name) => files.basename(name) === CLAUDE));
|
|
3696
|
+
const found = yield* Effect.forEach(claude, problemOf, { concurrency: READ_CONCURRENCY$39 });
|
|
3697
3697
|
return Array$1.getSomes(found);
|
|
3698
3698
|
});
|
|
3699
3699
|
// src/features/check-placement/model/dangling-links.ts
|
|
3700
3700
|
const RULE$73 = "dangling-link";
|
|
3701
3701
|
const SEPARATOR$28 = "/";
|
|
3702
3702
|
const FIRST$23 = 1;
|
|
3703
|
-
const READ_CONCURRENCY$
|
|
3703
|
+
const READ_CONCURRENCY$38 = 16;
|
|
3704
3704
|
const holds = (target) => (name) => name === target || String$1.startsWith(`${target}${SEPARATOR$28}`)(name);
|
|
3705
3705
|
/** @internal */
|
|
3706
3706
|
const checkDanglingLinks = Effect.fn("checkDanglingLinks")(function* checkDanglingLinks(root) {
|
|
@@ -3717,7 +3717,7 @@ const checkDanglingLinks = Effect.fn("checkDanglingLinks")(function* checkDangli
|
|
|
3717
3717
|
message: `is a link to ${target}, where no file is tracked. A fresh checkout gets a link to nothing, and GitHub Actions fails to load the repository's actions. Track a file there, such as .gitkeep, or delete the link.`
|
|
3718
3718
|
})));
|
|
3719
3719
|
});
|
|
3720
|
-
const found = yield* Effect.forEach(links, problemOf, { concurrency: READ_CONCURRENCY$
|
|
3720
|
+
const found = yield* Effect.forEach(links, problemOf, { concurrency: READ_CONCURRENCY$38 });
|
|
3721
3721
|
return Array$1.getSomes(found);
|
|
3722
3722
|
});
|
|
3723
3723
|
// src/features/check-placement/model/member-sources.ts
|
|
@@ -3773,7 +3773,7 @@ const readReadme = Effect.fn("readReadme")(function* readReadme({ root, director
|
|
|
3773
3773
|
// src/features/check-placement/model/deployed-readme.ts
|
|
3774
3774
|
const RULE$72 = "deployed-readme";
|
|
3775
3775
|
const ROOT_DIRECTORY$4 = "";
|
|
3776
|
-
const READ_CONCURRENCY$
|
|
3776
|
+
const READ_CONCURRENCY$37 = 16;
|
|
3777
3777
|
const MISSING_MESSAGE$2 = "is missing. This workspace has an Alchemy stack that serves an address, so give it a README.md that says what it is and links its URL.";
|
|
3778
3778
|
const NO_URL_MESSAGE = "has no https:// URL. This workspace has an Alchemy stack that serves an address, so link the URL it is served at.";
|
|
3779
3779
|
const ADDRESS_KEYS = [
|
|
@@ -3829,24 +3829,24 @@ const checkDeployedReadme = Effect.fn("checkDeployedReadme")(function* checkDepl
|
|
|
3829
3829
|
const listed = yield* files.listedFiles(root);
|
|
3830
3830
|
const directories = yield* workspaceDirectories(root);
|
|
3831
3831
|
const candidates = pipe(listed, Array$1.filter((file) => STACK_FILE.test(file)));
|
|
3832
|
-
const deploying = yield* Effect.filter(candidates, (file) => deploysTo(root, file), { concurrency: READ_CONCURRENCY$
|
|
3832
|
+
const deploying = yield* Effect.filter(candidates, (file) => deploysTo(root, file), { concurrency: READ_CONCURRENCY$37 });
|
|
3833
3833
|
const owners = pipe(deploying, Array$1.map((file) => pipe(owningWorkspace(directories)(files.dirname(file)), Option.getOrElse(() => ROOT_DIRECTORY$4))), Array$1.dedupe);
|
|
3834
|
-
const found = yield* Effect.forEach(owners, (directory) => problemIn$7(root, directory), { concurrency: READ_CONCURRENCY$
|
|
3834
|
+
const found = yield* Effect.forEach(owners, (directory) => problemIn$7(root, directory), { concurrency: READ_CONCURRENCY$37 });
|
|
3835
3835
|
return Array$1.getSomes(found);
|
|
3836
3836
|
});
|
|
3837
3837
|
// src/features/check-placement/model/nested-docs.ts
|
|
3838
3838
|
const RULE$71 = "nested-docs";
|
|
3839
3839
|
const CONFIG_FILE$9 = "vite.config.ts";
|
|
3840
3840
|
const SEPARATOR$26 = "/";
|
|
3841
|
-
const READ_CONCURRENCY$
|
|
3841
|
+
const READ_CONCURRENCY$36 = 64;
|
|
3842
3842
|
const AGENT_DOCS$1 = /^(?:AGENTS|CLAUDE)(?:\.[^/]+)?\.md$/iu;
|
|
3843
3843
|
const WORKSPACE_AGENT_DOC = "AGENTS.md";
|
|
3844
3844
|
const README = /^README(?:\.[^/]+)?$/iu;
|
|
3845
3845
|
const MANIFEST$4 = "package.json";
|
|
3846
3846
|
const MISSING_RULE = "workspace-agents-md";
|
|
3847
3847
|
const RootConfig$1 = Schema.Struct({ msch: Schema.Struct({ workspaceAgentsMd: Schema.Literal(true) }) });
|
|
3848
|
-
const taggedError$
|
|
3849
|
-
var RootConfigUnreadable = class extends taggedError$
|
|
3848
|
+
const taggedError$13 = Schema.TaggedError;
|
|
3849
|
+
var RootConfigUnreadable = class extends taggedError$13()("RootConfigUnreadable", { file: Schema.String }) {};
|
|
3850
3850
|
const isNested = (name) => String$1.includes(SEPARATOR$26)(name);
|
|
3851
3851
|
const problemFor$8 = problemInFile(RULE$71);
|
|
3852
3852
|
const AGENT_DOCS_MESSAGE = "belongs only at the repository root. Move what agents need into the root AGENTS.md and delete this file.";
|
|
@@ -3895,7 +3895,7 @@ const checkNestedDocs = Effect.fn("checkNestedDocs")(function* checkNestedDocs(r
|
|
|
3895
3895
|
workspaces: pipe(directories, Array$1.map((directory) => files.join(root, directory)), HashSet.fromIterable),
|
|
3896
3896
|
workspaceAgentDocs
|
|
3897
3897
|
};
|
|
3898
|
-
const found = yield* Effect.forEach(nested, (name) => problemIn$6(root, allowed, name), { concurrency: READ_CONCURRENCY$
|
|
3898
|
+
const found = yield* Effect.forEach(nested, (name) => problemIn$6(root, allowed, name), { concurrency: READ_CONCURRENCY$36 });
|
|
3899
3899
|
const missing = missingProblems({
|
|
3900
3900
|
required: workspaceAgentDocs,
|
|
3901
3901
|
directories: pipe(directories, Array$1.map((directory) => files.join(root, directory))),
|
|
@@ -3906,7 +3906,7 @@ const checkNestedDocs = Effect.fn("checkNestedDocs")(function* checkNestedDocs(r
|
|
|
3906
3906
|
});
|
|
3907
3907
|
// src/features/check-placement/model/published-readme.ts
|
|
3908
3908
|
const RULE$70 = "published-readme";
|
|
3909
|
-
const READ_CONCURRENCY$
|
|
3909
|
+
const READ_CONCURRENCY$35 = 16;
|
|
3910
3910
|
const MESSAGE$19 = "contains Japanese. This package is published to npm, so write its README in English.";
|
|
3911
3911
|
const MISSING_MESSAGE = "is missing. This package is published to npm, so give it an English README.md.";
|
|
3912
3912
|
const problemIn$5 = Effect.fn("problemIn")(function* problemIn(root, { directory }) {
|
|
@@ -3933,7 +3933,7 @@ const problemIn$5 = Effect.fn("problemIn")(function* problemIn(root, { directory
|
|
|
3933
3933
|
/** @internal */
|
|
3934
3934
|
const checkPublishedReadme = Effect.fn("checkPublishedReadme")(function* checkPublishedReadme(root) {
|
|
3935
3935
|
const projects = yield* publishedProjects(root);
|
|
3936
|
-
const found = yield* Effect.forEach(projects, (project) => problemIn$5(root, project), { concurrency: READ_CONCURRENCY$
|
|
3936
|
+
const found = yield* Effect.forEach(projects, (project) => problemIn$5(root, project), { concurrency: READ_CONCURRENCY$35 });
|
|
3937
3937
|
return Array$1.getSomes(found);
|
|
3938
3938
|
});
|
|
3939
3939
|
// src/features/check-placement/model/published-tests.ts
|
|
@@ -3969,9 +3969,9 @@ const RULE$68 = "root-docs";
|
|
|
3969
3969
|
const SEPARATOR$25 = "/";
|
|
3970
3970
|
const FIRST$21 = 1;
|
|
3971
3971
|
const MARKDOWN$6 = /\.(?:md|mdx|markdown)$/iu;
|
|
3972
|
-
const ALLOWED = /^(?:README(?:\.[^/]+)?|AGENTS|CLAUDE|ARCHITECTURE|DESIGN|CHANGELOG|LICENSE|NOTICE)\.(?:md|mdx|markdown)$/iu;
|
|
3972
|
+
const ALLOWED$1 = /^(?:README(?:\.[^/]+)?|AGENTS|CLAUDE|ARCHITECTURE|DESIGN|CHANGELOG|LICENSE|NOTICE)\.(?:md|mdx|markdown)$/iu;
|
|
3973
3973
|
const MESSAGE$17 = "is a hand-written document outside the places documents belong. Hand-written text goes only in the root README.md, AGENTS.md, CLAUDE.md, ARCHITECTURE.md and DESIGN.md, and under docs/. Move what is still true and not already told by the code into one of them, and delete this file.";
|
|
3974
|
-
const isStrayRootDoc = (name) => !String$1.includes(SEPARATOR$25)(name) && MARKDOWN$6.test(name) && !ALLOWED.test(name);
|
|
3974
|
+
const isStrayRootDoc = (name) => !String$1.includes(SEPARATOR$25)(name) && MARKDOWN$6.test(name) && !ALLOWED$1.test(name);
|
|
3975
3975
|
/** @internal */
|
|
3976
3976
|
const checkRootDocs = Effect.fn("checkRootDocs")(function* checkRootDocs(root) {
|
|
3977
3977
|
const files = yield* RepositoryFiles;
|
|
@@ -3987,7 +3987,7 @@ const checkRootDocs = Effect.fn("checkRootDocs")(function* checkRootDocs(root) {
|
|
|
3987
3987
|
// src/features/check-placement/model/root-readme.ts
|
|
3988
3988
|
const RULE$67 = "root-readme";
|
|
3989
3989
|
const ROOT_DOC = /^(?:README(?:\.[^/]+)?|AGENTS\.md|CLAUDE\.md)$/iu;
|
|
3990
|
-
const READ_CONCURRENCY$
|
|
3990
|
+
const READ_CONCURRENCY$34 = 16;
|
|
3991
3991
|
const START$32 = 0;
|
|
3992
3992
|
const MARKETPLACE = ".claude-plugin/marketplace.json";
|
|
3993
3993
|
const RELATIVE$2 = /^\.\//u;
|
|
@@ -4045,7 +4045,7 @@ const checkRootReadme = Effect.fn("checkRootReadme")(function* checkRootReadme(r
|
|
|
4045
4045
|
const named = yield* namedWorkspaces(root);
|
|
4046
4046
|
const workspaces = pipe(named, Array$1.filter((workspace) => !isCheckPolicy(workspace)));
|
|
4047
4047
|
const plugins = yield* marketplacePlugins(root);
|
|
4048
|
-
const found = yield* Effect.forEach(readmes, (name) => problemsInReadme(files.join(root, name), workspaces, plugins), { concurrency: READ_CONCURRENCY$
|
|
4048
|
+
const found = yield* Effect.forEach(readmes, (name) => problemsInReadme(files.join(root, name), workspaces, plugins), { concurrency: READ_CONCURRENCY$34 });
|
|
4049
4049
|
return Array$1.flatten(found);
|
|
4050
4050
|
});
|
|
4051
4051
|
// src/features/check-placement/model/doc-placement.ts
|
|
@@ -4068,7 +4068,7 @@ const checkDocPlacement = Effect.fn("checkDocPlacement")(function* checkDocPlace
|
|
|
4068
4068
|
const RULE$66 = "docs-mirror";
|
|
4069
4069
|
const DOC = /(?:^|\/)(?:README|AGENTS|ARCHITECTURE|CLAUDE|SKILL)\.md$/u;
|
|
4070
4070
|
const MIRROR_LIMIT = 3;
|
|
4071
|
-
const READ_CONCURRENCY$
|
|
4071
|
+
const READ_CONCURRENCY$33 = 16;
|
|
4072
4072
|
const SPECIAL = /[$()*+.?[\\\]^{|}]/gu;
|
|
4073
4073
|
const BEFORE = String.raw`(?<![\w@/.-])`;
|
|
4074
4074
|
const AFTER = String.raw`(?![\w@.-])`;
|
|
@@ -4105,7 +4105,7 @@ const workspacesOf$1 = Effect.fn("workspacesOf")(function* workspacesOf(root) {
|
|
|
4105
4105
|
return yield* Effect.forEach(directories, (directory) => readManifest(files.join(root, directory)).pipe(Effect.map((manifest) => ({
|
|
4106
4106
|
directory,
|
|
4107
4107
|
names: [directory, ...pipe(manifest, Option.flatMap(({ name }) => Option.fromUndefinedOr(name)), Option.toArray)]
|
|
4108
|
-
}))), { concurrency: READ_CONCURRENCY$
|
|
4108
|
+
}))), { concurrency: READ_CONCURRENCY$33 });
|
|
4109
4109
|
});
|
|
4110
4110
|
/** @internal */
|
|
4111
4111
|
const checkDocsMirror = Effect.fn("checkDocsMirror")(function* checkDocsMirror(root) {
|
|
@@ -4118,7 +4118,7 @@ const checkDocsMirror = Effect.fn("checkDocsMirror")(function* checkDocsMirror(r
|
|
|
4118
4118
|
onNone: () => [],
|
|
4119
4119
|
onSome: (text) => problemIn$4(workspaces)(doc, file, text)
|
|
4120
4120
|
})));
|
|
4121
|
-
}, { concurrency: READ_CONCURRENCY$
|
|
4121
|
+
}, { concurrency: READ_CONCURRENCY$33 });
|
|
4122
4122
|
return Array$1.flatten(found);
|
|
4123
4123
|
});
|
|
4124
4124
|
// src/features/check-placement/model/ignored-sources.ts
|
|
@@ -4164,8 +4164,8 @@ const checkPublicEntries = Effect.fn("checkPublicEntries")(function* checkPublic
|
|
|
4164
4164
|
return Array$1.flatten(entries);
|
|
4165
4165
|
});
|
|
4166
4166
|
// src/shared/lib/tree-sitter.ts
|
|
4167
|
-
const taggedError$
|
|
4168
|
-
var GrammarUnreadable = class extends taggedError$
|
|
4167
|
+
const taggedError$12 = Schema.TaggedError;
|
|
4168
|
+
var GrammarUnreadable = class extends taggedError$12()("GrammarUnreadable", {
|
|
4169
4169
|
grammar: Schema.String,
|
|
4170
4170
|
message: Schema.String
|
|
4171
4171
|
}) {};
|
|
@@ -12811,7 +12811,7 @@ const LAYER_ITEMS = [
|
|
|
12811
12811
|
"attribute_item",
|
|
12812
12812
|
"inner_attribute_item"
|
|
12813
12813
|
];
|
|
12814
|
-
const READ_CONCURRENCY$
|
|
12814
|
+
const READ_CONCURRENCY$32 = 64;
|
|
12815
12815
|
const EXCLUDED$6 = [":(exclude,attr:linguist-vendored)", ":(exclude,attr:linguist-generated)"];
|
|
12816
12816
|
const NONE$4 = [];
|
|
12817
12817
|
const ROOT_MESSAGE = "defines code in the crate root. Keep lib.rs and main.rs to mod declarations of layers, use, pub use and fn main, and put the code in a layer.";
|
|
@@ -12887,13 +12887,13 @@ const checkRustModules = Effect.fn("checkRustModules")(function* checkRustModule
|
|
|
12887
12887
|
if (!Array$1.isReadonlyArrayNonEmpty(sources)) return NONE$4;
|
|
12888
12888
|
const language = yield* loadLanguage(GRAMMAR$1).pipe(Effect.orDie);
|
|
12889
12889
|
const parse = parsedWith(language);
|
|
12890
|
-
const read = yield* Effect.forEach(pipe(sources, Array$1.filter(isRead)), (source) => files.readFile(source.file).pipe(Effect.map(Option.flatMap((text) => parse(source, text)))), { concurrency: READ_CONCURRENCY$
|
|
12890
|
+
const read = yield* Effect.forEach(pipe(sources, Array$1.filter(isRead)), (source) => files.readFile(source.file).pipe(Effect.map(Option.flatMap((text) => parse(source, text)))), { concurrency: READ_CONCURRENCY$32 });
|
|
12891
12891
|
return [...sliceNameProblems(root, files.join, sources), ...Array$1.flatMap(Array$1.getSomes(read), problemsOf$4)];
|
|
12892
12892
|
});
|
|
12893
12893
|
// src/features/check-placement/model/shadcn-ui-alias.ts
|
|
12894
12894
|
const RULE$64 = "shadcn-ui-alias";
|
|
12895
12895
|
const FIRST$19 = 1;
|
|
12896
|
-
const problemOf$
|
|
12896
|
+
const problemOf$13 = (directory, { file, alias }) => ({
|
|
12897
12897
|
file,
|
|
12898
12898
|
line: FIRST$19,
|
|
12899
12899
|
column: FIRST$19,
|
|
@@ -12909,7 +12909,7 @@ const shadcnAliasProblems = Effect.fn("shadcnAliasProblems")(function* shadcnAli
|
|
|
12909
12909
|
onNone: () => Effect.succeed(false),
|
|
12910
12910
|
onSome: (target) => files.isDirectory(files.join(root, directory, target)).pipe(Effect.map(Option.getOrElse(() => false)))
|
|
12911
12911
|
})) return Array$1.empty();
|
|
12912
|
-
return [problemOf$
|
|
12912
|
+
return [problemOf$13(directory, found.value)];
|
|
12913
12913
|
});
|
|
12914
12914
|
// src/features/check-placement/model/source-aliases.ts
|
|
12915
12915
|
const ALIAS_RULE = "source-alias";
|
|
@@ -12961,7 +12961,7 @@ const SCRIPTS_DIRECTORY = "scripts";
|
|
|
12961
12961
|
const WORKFLOW_DIRECTORY$1 = ".github/";
|
|
12962
12962
|
const SEPARATOR$22 = "/";
|
|
12963
12963
|
const CURRENT = "./";
|
|
12964
|
-
const READ_CONCURRENCY$
|
|
12964
|
+
const READ_CONCURRENCY$31 = 8;
|
|
12965
12965
|
const FIRST$18 = 1;
|
|
12966
12966
|
const RUN_FILE = /(?:^|[\s;&|(])(?:node|vpx|tsx|bun|deno)\s+(?:-\S+\s+)*(?<file>[^\s;&|)]+\.[cm]?[jt]s)\b/gu;
|
|
12967
12967
|
const COMMAND$1 = /^bin\/[^/]+\.[cm]?ts$/u;
|
|
@@ -13003,7 +13003,7 @@ const workflowText = Effect.fn("workflowText")(function* workflowText(root) {
|
|
|
13003
13003
|
const files = yield* RepositoryFiles;
|
|
13004
13004
|
const listed = yield* files.listedFiles(root);
|
|
13005
13005
|
const workflows = pipe(listed, Array$1.filter(String$1.startsWith(WORKFLOW_DIRECTORY$1)));
|
|
13006
|
-
const texts = yield* Effect.forEach(workflows, (file) => files.readFile(files.join(root, file)), { concurrency: READ_CONCURRENCY$
|
|
13006
|
+
const texts = yield* Effect.forEach(workflows, (file) => files.readFile(files.join(root, file)), { concurrency: READ_CONCURRENCY$31 });
|
|
13007
13007
|
return pipe(Array$1.getSomes(texts), Array$1.join("\n"));
|
|
13008
13008
|
});
|
|
13009
13009
|
const workspacePath = (directory, path) => pipe([directory, path], Array$1.filter(String$1.isNonEmpty), Array$1.join(SEPARATOR$22));
|
|
@@ -13066,9 +13066,9 @@ const codeInBinProblems = Effect.fn("codeInBinProblems")(function* codeInBinProb
|
|
|
13066
13066
|
const checkCommandEntries = Effect.fn("checkCommandEntries")(function* checkCommandEntries(root) {
|
|
13067
13067
|
const all = ["", ...yield* workspaceDirectories(root)];
|
|
13068
13068
|
const workflows = yield* workflowText(root);
|
|
13069
|
-
const found = yield* Effect.forEach(all, (directory) => problemsIn$21(root, directory, workflows), { concurrency: READ_CONCURRENCY$
|
|
13070
|
-
const scripts = yield* Effect.forEach(all, (directory) => scriptsProblem(root, directory), { concurrency: READ_CONCURRENCY$
|
|
13071
|
-
const code = yield* Effect.forEach(all, (directory) => codeInBinProblems(root, directory), { concurrency: READ_CONCURRENCY$
|
|
13069
|
+
const found = yield* Effect.forEach(all, (directory) => problemsIn$21(root, directory, workflows), { concurrency: READ_CONCURRENCY$31 });
|
|
13070
|
+
const scripts = yield* Effect.forEach(all, (directory) => scriptsProblem(root, directory), { concurrency: READ_CONCURRENCY$31 });
|
|
13071
|
+
const code = yield* Effect.forEach(all, (directory) => codeInBinProblems(root, directory), { concurrency: READ_CONCURRENCY$31 });
|
|
13072
13072
|
return [
|
|
13073
13073
|
...Array$1.flatten(found),
|
|
13074
13074
|
...Array$1.getSomes(scripts),
|
|
@@ -13198,18 +13198,18 @@ const WORKSPACE_FILE$4 = "pnpm-workspace.yaml";
|
|
|
13198
13198
|
const CARGO_MANIFEST = /(?:^|\/)Cargo\.toml$/u;
|
|
13199
13199
|
const TSCONFIG = /(?:^|\/)tsconfig(?:\.[\w-]+)?\.json$/u;
|
|
13200
13200
|
const OUTSIDE = "..";
|
|
13201
|
-
const READ_CONCURRENCY$
|
|
13201
|
+
const READ_CONCURRENCY$30 = 8;
|
|
13202
13202
|
const isMissing$2 = Effect.fn("isMissing")(function* isMissing(root, file, mention) {
|
|
13203
13203
|
const files = yield* RepositoryFiles;
|
|
13204
13204
|
const relatives = pipe(mention.candidates, Array$1.map((candidate) => files.relative(root, files.resolve(files.dirname(file), candidate))), Array$1.filter((relative) => !String$1.startsWith(OUTSIDE)(relative)));
|
|
13205
13205
|
if (!Array$1.isReadonlyArrayNonEmpty(relatives)) return false;
|
|
13206
|
-
const present = yield* Effect.forEach(relatives, (relative) => existsAt(root, relative), { concurrency: READ_CONCURRENCY$
|
|
13206
|
+
const present = yield* Effect.forEach(relatives, (relative) => existsAt(root, relative), { concurrency: READ_CONCURRENCY$30 });
|
|
13207
13207
|
if (pipe(present, Array$1.some(Boolean))) return false;
|
|
13208
|
-
const ignored = yield* Effect.forEach(relatives, (relative) => isIgnored(root, relative), { concurrency: READ_CONCURRENCY$
|
|
13208
|
+
const ignored = yield* Effect.forEach(relatives, (relative) => isIgnored(root, relative), { concurrency: READ_CONCURRENCY$30 });
|
|
13209
13209
|
return !pipe(ignored, Array$1.some(Boolean));
|
|
13210
13210
|
});
|
|
13211
13211
|
const byIndex = Order.mapInput(Order.Number, ({ index }) => index);
|
|
13212
|
-
const problemOf$
|
|
13212
|
+
const problemOf$12 = (file, source) => (mention) => ({
|
|
13213
13213
|
file,
|
|
13214
13214
|
...positionOf(source)(mention.index),
|
|
13215
13215
|
rule: RULE$63,
|
|
@@ -13225,8 +13225,8 @@ const problemsIn$20 = Effect.fn("problemsIn")(function* problemsIn(root, name) {
|
|
|
13225
13225
|
const source = yield* files.readFile(file);
|
|
13226
13226
|
if (Option.isNone(source)) return [];
|
|
13227
13227
|
const mentions = yield* mentionsIn(file, source.value);
|
|
13228
|
-
const missing = yield* Effect.filter(mentions, (mention) => isMissing$2(root, file, mention), { concurrency: READ_CONCURRENCY$
|
|
13229
|
-
return pipe(Array$1.sort(missing, byIndex), Array$1.map(problemOf$
|
|
13228
|
+
const missing = yield* Effect.filter(mentions, (mention) => isMissing$2(root, file, mention), { concurrency: READ_CONCURRENCY$30 });
|
|
13229
|
+
return pipe(Array$1.sort(missing, byIndex), Array$1.map(problemOf$12(file, source.value)));
|
|
13230
13230
|
});
|
|
13231
13231
|
const unmatchedPatterns = Effect.fn("unmatchedPatterns")(function* unmatchedPatterns(root) {
|
|
13232
13232
|
const files = yield* RepositoryFiles;
|
|
@@ -13245,7 +13245,7 @@ const unmatchedPatterns = Effect.fn("unmatchedPatterns")(function* unmatchedPatt
|
|
|
13245
13245
|
const checkConfigPaths = Effect.fn("checkConfigPaths")(function* checkConfigPaths(root) {
|
|
13246
13246
|
const owned = yield* (yield* RepositoryFiles).ownedFiles(root);
|
|
13247
13247
|
const configs = pipe(owned, Array$1.filter((name) => CARGO_MANIFEST.test(name) || TSCONFIG.test(name)));
|
|
13248
|
-
const [found, patterns] = yield* Effect.all([Effect.forEach(configs, (name) => problemsIn$20(root, name), { concurrency: READ_CONCURRENCY$
|
|
13248
|
+
const [found, patterns] = yield* Effect.all([Effect.forEach(configs, (name) => problemsIn$20(root, name), { concurrency: READ_CONCURRENCY$30 }), unmatchedPatterns(root)], { concurrency: "unbounded" });
|
|
13249
13249
|
return [...Array$1.flatten(found), ...patterns];
|
|
13250
13250
|
});
|
|
13251
13251
|
// src/features/check-repository-layout/model/crates.ts
|
|
@@ -13256,7 +13256,7 @@ const CARGO_FILE$1 = "Cargo.toml";
|
|
|
13256
13256
|
const CONFIG_FILE$8 = "vite.config.ts";
|
|
13257
13257
|
const SEPARATOR$19 = "/";
|
|
13258
13258
|
const FIRST$16 = 1;
|
|
13259
|
-
const READ_CONCURRENCY$
|
|
13259
|
+
const READ_CONCURRENCY$29 = 8;
|
|
13260
13260
|
const problemFor$5 = (crate, message) => ({
|
|
13261
13261
|
file: crate.manifest,
|
|
13262
13262
|
line: FIRST$16,
|
|
@@ -13293,7 +13293,7 @@ const checkCrates = Effect.fn("checkCrates")(function* checkCrates(root) {
|
|
|
13293
13293
|
if (!(yield* files.exists(files.join(root, CARGO_FILE$1)))) return [];
|
|
13294
13294
|
const directories = yield* workspaceDirectories(root);
|
|
13295
13295
|
const crates = yield* cratesIn(root);
|
|
13296
|
-
const found = yield* Effect.forEach(crates, (crate) => Effect.all([problemIn$3(root, directories, crate), versionProblemIn(root, directories, crate)], { concurrency: "unbounded" }), { concurrency: READ_CONCURRENCY$
|
|
13296
|
+
const found = yield* Effect.forEach(crates, (crate) => Effect.all([problemIn$3(root, directories, crate), versionProblemIn(root, directories, crate)], { concurrency: "unbounded" }), { concurrency: READ_CONCURRENCY$29 });
|
|
13297
13297
|
return Array$1.getSomes(Array$1.flatten(found));
|
|
13298
13298
|
});
|
|
13299
13299
|
// src/features/check-repository-layout/model/deploy-entry-patterns.ts
|
|
@@ -13315,7 +13315,7 @@ const NEGATED = "!";
|
|
|
13315
13315
|
const ROOT_WORKSPACE = ".";
|
|
13316
13316
|
const WRAP_OFFSET$1 = 1;
|
|
13317
13317
|
const NO_OFFSET = 0;
|
|
13318
|
-
const READ_CONCURRENCY$
|
|
13318
|
+
const READ_CONCURRENCY$28 = 8;
|
|
13319
13319
|
const MESSAGE$15 = "selects deploy entries by their name or location. A deploy entry is the file that an Alchemy resource names in main, and its name and place change with the code. Use workspaceSettings().lint.deployEntries in lint settings; fallow reads main from the stack by itself.";
|
|
13320
13320
|
const decodeKey$1 = Schema.decodeUnknownOption(KeySchema);
|
|
13321
13321
|
const FALLOW = {
|
|
@@ -13397,7 +13397,7 @@ const checkDeployEntryPatterns = Effect.fn("checkDeployEntryPatterns")(function*
|
|
|
13397
13397
|
kind,
|
|
13398
13398
|
workspaces,
|
|
13399
13399
|
entries
|
|
13400
|
-
}), { concurrency: READ_CONCURRENCY$
|
|
13400
|
+
}), { concurrency: READ_CONCURRENCY$28 });
|
|
13401
13401
|
return Array$1.flatten(found);
|
|
13402
13402
|
});
|
|
13403
13403
|
// src/features/check-repository-layout/model/fallow-entries.ts
|
|
@@ -13411,7 +13411,7 @@ const FALLOW_CONFIG = /(?:^|\/)(?:\.fallowrc\.jsonc?|fallow-plugin-[^/]+\.jsonc?
|
|
|
13411
13411
|
const WILDCARD$2 = /[*?{[]/u;
|
|
13412
13412
|
const SEPARATOR$18 = "/";
|
|
13413
13413
|
const WRAP_OFFSET = 1;
|
|
13414
|
-
const READ_CONCURRENCY$
|
|
13414
|
+
const READ_CONCURRENCY$27 = 8;
|
|
13415
13415
|
const decodeKey = Schema.decodeUnknownOption(KeySchema);
|
|
13416
13416
|
const isEntryProperty = (node) => node["type"] === "Property" && pipe(decodeKey(node["key"]), Option.exists((key) => Array$1.contains(ENTRY_KEYS, keyName(key))));
|
|
13417
13417
|
const entryPatternsIn = (node) => {
|
|
@@ -13439,7 +13439,7 @@ const problemsIn$18 = Effect.fn("problemsIn")(function* problemsIn(root, file, d
|
|
|
13439
13439
|
const checkFallowEntries = Effect.fn("checkFallowEntries")(function* checkFallowEntries(root) {
|
|
13440
13440
|
const listed = yield* (yield* RepositoryFiles).listedFiles(root);
|
|
13441
13441
|
const directories = yield* workspaceDirectories(root);
|
|
13442
|
-
const found = yield* Effect.forEach(pipe(listed, Array$1.filter((file) => FALLOW_CONFIG.test(file))), (file) => problemsIn$18(root, file, directories), { concurrency: READ_CONCURRENCY$
|
|
13442
|
+
const found = yield* Effect.forEach(pipe(listed, Array$1.filter((file) => FALLOW_CONFIG.test(file))), (file) => problemsIn$18(root, file, directories), { concurrency: READ_CONCURRENCY$27 });
|
|
13443
13443
|
return Array$1.flatten(found);
|
|
13444
13444
|
});
|
|
13445
13445
|
// src/features/check-repository-layout/model/root-workspace-paths.ts
|
|
@@ -13479,7 +13479,7 @@ const checkRootWorkspacePaths = Effect.fn("checkRootWorkspacePaths")(function* c
|
|
|
13479
13479
|
const RULE$58 = "hidden-verify";
|
|
13480
13480
|
const CONFIG_FILE$6 = "vite.config.ts";
|
|
13481
13481
|
const FIRST$14 = 1;
|
|
13482
|
-
const READ_CONCURRENCY$
|
|
13482
|
+
const READ_CONCURRENCY$26 = 8;
|
|
13483
13483
|
const problemIn$2 = Effect.fn("problemIn")(function* problemIn(root, directory) {
|
|
13484
13484
|
const config = yield* workspaceConfigOf(root, directory);
|
|
13485
13485
|
if (Option.isNone(config)) return Option.none();
|
|
@@ -13497,12 +13497,12 @@ const problemIn$2 = Effect.fn("problemIn")(function* problemIn(root, directory)
|
|
|
13497
13497
|
/** @internal */
|
|
13498
13498
|
const checkHiddenVerify = Effect.fn("checkHiddenVerify")(function* checkHiddenVerify(root) {
|
|
13499
13499
|
const directories = yield* workspaceDirectories(root);
|
|
13500
|
-
const found = yield* Effect.forEach(directories, (directory) => problemIn$2(root, directory), { concurrency: READ_CONCURRENCY$
|
|
13500
|
+
const found = yield* Effect.forEach(directories, (directory) => problemIn$2(root, directory), { concurrency: READ_CONCURRENCY$26 });
|
|
13501
13501
|
return Array$1.getSomes(found);
|
|
13502
13502
|
});
|
|
13503
13503
|
// src/features/check-repository-layout/model/shared-uncached-tasks.ts
|
|
13504
13504
|
const RULE$57 = "shared-uncached-task";
|
|
13505
|
-
const READ_CONCURRENCY$
|
|
13505
|
+
const READ_CONCURRENCY$25 = 8;
|
|
13506
13506
|
const SHARED = 2;
|
|
13507
13507
|
const OWN_PROGRAM = /^(?:node|vpx|bun|deno|tsx)$|\//u;
|
|
13508
13508
|
const UncachedTask = Schema.Struct({
|
|
@@ -13551,12 +13551,12 @@ const problemsOf$3 = (definitions) => {
|
|
|
13551
13551
|
/** @internal */
|
|
13552
13552
|
const checkSharedUncachedTasks = Effect.fn("checkSharedUncachedTasks")(function* checkSharedUncachedTasks(root) {
|
|
13553
13553
|
const directories = yield* workspaceDirectories(root);
|
|
13554
|
-
const found = yield* Effect.forEach(directories, (directory) => definitionsIn(root, directory), { concurrency: READ_CONCURRENCY$
|
|
13554
|
+
const found = yield* Effect.forEach(directories, (directory) => definitionsIn(root, directory), { concurrency: READ_CONCURRENCY$25 });
|
|
13555
13555
|
return pipe(Array$1.flatten(found), Array$1.groupBy(({ name, definition }) => `${name}\u0000${definition}`), Record.values, Array$1.flatMap(problemsOf$3));
|
|
13556
13556
|
});
|
|
13557
13557
|
// src/features/check-repository-layout/model/unlocked-tasks.ts
|
|
13558
13558
|
const RULE$56 = "unlocked-task";
|
|
13559
|
-
const READ_CONCURRENCY$
|
|
13559
|
+
const READ_CONCURRENCY$24 = 8;
|
|
13560
13560
|
const READS_DEPENDENCIES = /^vp (?:test|pack|build)\b/u;
|
|
13561
13561
|
const decodeCommand = Schema.decodeUnknownOption(Schema.Union([Schema.String, Schema.NonEmptyArray(Schema.String)]));
|
|
13562
13562
|
const commandOf = (task) => pipe(propertyValue("command")(task.value), Option.getOrElse(() => task.value), literalOf, Option.flatMap(decodeCommand), Option.flatMap((command) => Array$1.findFirst(Array$1.ensure(command), (line) => READS_DEPENDENCIES.test(line))));
|
|
@@ -13573,7 +13573,7 @@ const problemsOf$2 = ({ file, source, tasks }) => pipe(tasks, Array$1.filter(tra
|
|
|
13573
13573
|
/** @internal */
|
|
13574
13574
|
const checkUnlockedTasks = Effect.fn("checkUnlockedTasks")(function* checkUnlockedTasks(root) {
|
|
13575
13575
|
const directories = yield* workspaceDirectories(root);
|
|
13576
|
-
const found = yield* Effect.forEach(directories, (directory) => runTasksOf(root, directory), { concurrency: READ_CONCURRENCY$
|
|
13576
|
+
const found = yield* Effect.forEach(directories, (directory) => runTasksOf(root, directory), { concurrency: READ_CONCURRENCY$24 });
|
|
13577
13577
|
return pipe(Array$1.getSomes(found), Array$1.flatMap(problemsOf$2));
|
|
13578
13578
|
});
|
|
13579
13579
|
// src/features/check-repository-layout/model/task-checks.ts
|
|
@@ -13725,7 +13725,7 @@ const producedPaths = (source) => pipe(jobsOf(source), Array$1.flatMap(([, job])
|
|
|
13725
13725
|
const RULE$55 = "workflow-path";
|
|
13726
13726
|
const WORKFLOW_DIRECTORY = ".github/workflows/";
|
|
13727
13727
|
const WORKFLOW_EXTENSIONS = [".yml", ".yaml"];
|
|
13728
|
-
const READ_CONCURRENCY$
|
|
13728
|
+
const READ_CONCURRENCY$23 = 8;
|
|
13729
13729
|
const SEPARATOR$16 = "/";
|
|
13730
13730
|
const EXPECTED = {
|
|
13731
13731
|
action: "a directory with action.yml",
|
|
@@ -13763,7 +13763,7 @@ const isMissing$1 = Effect.fn("isMissing")(function* isMissing(root, produced, f
|
|
|
13763
13763
|
if (yield* RESOLVERS[found.kind](root, found.path)) return false;
|
|
13764
13764
|
return !(yield* isIgnored(root, found.path));
|
|
13765
13765
|
});
|
|
13766
|
-
const problemOf$
|
|
13766
|
+
const problemOf$11 = (file, source) => (found) => ({
|
|
13767
13767
|
file,
|
|
13768
13768
|
...positionOf(source)(found.offset),
|
|
13769
13769
|
rule: RULE$55,
|
|
@@ -13776,12 +13776,12 @@ const problemsIn$16 = Effect.fn("problemsIn")(function* problemsIn(root, workflo
|
|
|
13776
13776
|
if (Option.isNone(source)) return [];
|
|
13777
13777
|
const produced = producedPaths(source.value);
|
|
13778
13778
|
const missing = yield* Effect.filter(workflowReferences(source.value), (found) => isMissing$1(root, produced, found));
|
|
13779
|
-
return pipe(missing, Array$1.map(problemOf$
|
|
13779
|
+
return pipe(missing, Array$1.map(problemOf$11(file, source.value)));
|
|
13780
13780
|
});
|
|
13781
13781
|
/** @internal */
|
|
13782
13782
|
const checkWorkflowPaths = Effect.fn("checkWorkflowPaths")(function* checkWorkflowPaths(root) {
|
|
13783
13783
|
const listed = yield* (yield* RepositoryFiles).listedFiles(root);
|
|
13784
|
-
const found = yield* Effect.forEach(pipe(listed, Array$1.filter(isWorkflow)), (workflow) => problemsIn$16(root, workflow), { concurrency: READ_CONCURRENCY$
|
|
13784
|
+
const found = yield* Effect.forEach(pipe(listed, Array$1.filter(isWorkflow)), (workflow) => problemsIn$16(root, workflow), { concurrency: READ_CONCURRENCY$23 });
|
|
13785
13785
|
return Array$1.flatten(found);
|
|
13786
13786
|
});
|
|
13787
13787
|
// src/features/check-repository-layout/model/workflow-scale.ts
|
|
@@ -13793,7 +13793,7 @@ const FILTER_KEYS = ["paths", "paths-ignore"];
|
|
|
13793
13793
|
const PATHS_FILTER_ACTION = /(?:^|\/)paths-filter@/u;
|
|
13794
13794
|
const PACKAGE_FILTER = /(?:^|\s)(?:--filter|-F)(?:\s+|=)(?<quote>["']?)(?<value>[^\s"'$][^\s"']*)\k<quote>/gu;
|
|
13795
13795
|
const START$29 = 0;
|
|
13796
|
-
const READ_CONCURRENCY$
|
|
13796
|
+
const READ_CONCURRENCY$22 = 8;
|
|
13797
13797
|
const SEPARATOR$15 = "/";
|
|
13798
13798
|
const WORD_SEPARATORS = /[-_]/gu;
|
|
13799
13799
|
const SPACE = " ";
|
|
@@ -13815,8 +13815,8 @@ const pathFiltersIn = (file, source) => {
|
|
|
13815
13815
|
source
|
|
13816
13816
|
}, PATH_FILTER, FILTER_MESSAGE)(offset)));
|
|
13817
13817
|
};
|
|
13818
|
-
const matching = (workspaces, text) => pipe(workspaces, Array$1.findFirst(({ names }) => Array$1.isReadonlyArrayNonEmpty(names) && Option.isSome(String$1.match(patternOf$1(names))(text))), Option.map(({ directory }) => directory));
|
|
13819
|
-
const named$1 = (workspaces, text) => Option.orElse(matching(workspaces, text), () => matching(workspaces, String$1.replaceAll(WORD_SEPARATORS, SPACE)(text)));
|
|
13818
|
+
const matching$1 = (workspaces, text) => pipe(workspaces, Array$1.findFirst(({ names }) => Array$1.isReadonlyArrayNonEmpty(names) && Option.isSome(String$1.match(patternOf$1(names))(text))), Option.map(({ directory }) => directory));
|
|
13819
|
+
const named$1 = (workspaces, text) => Option.orElse(matching$1(workspaces, text), () => matching$1(workspaces, String$1.replaceAll(WORD_SEPARATORS, SPACE)(text)));
|
|
13820
13820
|
const containing = (workspaces, path) => pipe(workspaces, Array$1.findFirst(({ directory }) => path === directory || String$1.startsWith(`${directory}${SEPARATOR$15}`)(path)), Option.map(({ directory }) => directory));
|
|
13821
13821
|
const namesIn$2 = (name, source) => {
|
|
13822
13822
|
const root = parseDocument(source).contents;
|
|
@@ -13841,7 +13841,7 @@ const packagesIn$1 = (workspaces, { file, name, source }) => {
|
|
|
13841
13841
|
};
|
|
13842
13842
|
const fromNames = pipe(namesIn$2(name, source), Array$1.flatMap(({ text, offset }) => reported(where, offset, `"${text}"`)(named$1(workspaces, text))));
|
|
13843
13843
|
const referenced = pipe(workflowReferences(source), Array$1.filter(({ field }) => !String$1.startsWith("on.")(field)), Array$1.flatMap(({ field, path, offset }) => reported(where, offset, field)(containing(workspaces, path))));
|
|
13844
|
-
const filtered = pipe(filtersIn(source), Array$1.flatMap(({ text, offset }) => reported(where, offset, `--filter ${text}`)(matching(workspaces, text))));
|
|
13844
|
+
const filtered = pipe(filtersIn(source), Array$1.flatMap(({ text, offset }) => reported(where, offset, `--filter ${text}`)(matching$1(workspaces, text))));
|
|
13845
13845
|
return [
|
|
13846
13846
|
...fromNames,
|
|
13847
13847
|
...referenced,
|
|
@@ -13872,7 +13872,7 @@ const checkWorkflowScale = Effect.fn("checkWorkflowScale")(function* checkWorkfl
|
|
|
13872
13872
|
name: stem,
|
|
13873
13873
|
source: text
|
|
13874
13874
|
})]), Option.getOrElse(() => []));
|
|
13875
|
-
}), { concurrency: READ_CONCURRENCY$
|
|
13875
|
+
}), { concurrency: READ_CONCURRENCY$22 });
|
|
13876
13876
|
const actions = pipe(listed, Array$1.flatMap((name) => pipe(groupOf("name")(ACTION.exec(name)), Option.map((action) => actionProblems(workspaces, files.join(root, name), action)), Option.getOrElse(() => []))));
|
|
13877
13877
|
return [...Array$1.flatten(found), ...actions];
|
|
13878
13878
|
});
|
|
@@ -14179,7 +14179,7 @@ const SNAPSHOT = "snapshot.json";
|
|
|
14179
14179
|
const MIGRATION = "migration.sql";
|
|
14180
14180
|
const SNAPSHOTS = [`*/${SNAPSHOT}`];
|
|
14181
14181
|
const FIRST$13 = 1;
|
|
14182
|
-
const READ_CONCURRENCY$
|
|
14182
|
+
const READ_CONCURRENCY$21 = 16;
|
|
14183
14183
|
const isSnapshot = (basename) => (file) => basename(file) === SNAPSHOT;
|
|
14184
14184
|
const migrationAt = Effect.fn("migrationAt")(function* migrationAt(root, base, file) {
|
|
14185
14185
|
const files = yield* RepositoryFiles;
|
|
@@ -14219,7 +14219,7 @@ const checkMigrationOrder = Effect.fn("checkMigrationOrder")(function* checkMigr
|
|
|
14219
14219
|
if (Option.isNone(found)) return [];
|
|
14220
14220
|
const [listed, changed] = yield* Effect.all([files.matchingFiles(root, SNAPSHOTS), files.changedFiles(root, base)], { concurrency: "unbounded" });
|
|
14221
14221
|
const snapshots = pipe([...listed, ...changed], Array$1.filter(isSnapshot(files.basename)), Array$1.dedupe);
|
|
14222
|
-
const migrations = yield* Effect.forEach(snapshots, (file) => migrationAt(root, base, file), { concurrency: READ_CONCURRENCY$
|
|
14222
|
+
const migrations = yield* Effect.forEach(snapshots, (file) => migrationAt(root, base, file), { concurrency: READ_CONCURRENCY$21 });
|
|
14223
14223
|
return pipe(Array$1.getSomes(migrations), Array$1.groupBy(({ directory }) => directory), Record.values, Array$1.flatMap(outOfOrder(root, base, files.join)));
|
|
14224
14224
|
});
|
|
14225
14225
|
// src/shared/lib/bundle-error.ts
|
|
@@ -14264,7 +14264,7 @@ const PLUGIN_FILE$3 = ".claude-plugin/plugin.json";
|
|
|
14264
14264
|
const LOCK_FILE = "bun.lock";
|
|
14265
14265
|
const SOURCE_FILE$1 = /\.[cm]?[jt]sx?$/u;
|
|
14266
14266
|
const TEST_FILE$2 = /\.test(?:\.support)?\.[cm]?[jt]sx?$/u;
|
|
14267
|
-
const SUCCESS$
|
|
14267
|
+
const SUCCESS$6 = 0;
|
|
14268
14268
|
const NOT_STARTED = -1;
|
|
14269
14269
|
const DETAIL_LINES = 3;
|
|
14270
14270
|
const PLUGIN_CONCURRENCY = 2;
|
|
@@ -14330,7 +14330,7 @@ const unresolvedProblems = (file, names) => {
|
|
|
14330
14330
|
};
|
|
14331
14331
|
const checkInstalled = Effect.fn("checkInstalled")(function* checkInstalled(manifest, sandbox, entries) {
|
|
14332
14332
|
const result = yield* installed$1(sandbox).pipe(Effect.orElseSucceed(bunNotStarted));
|
|
14333
|
-
if (result.code !== SUCCESS$
|
|
14333
|
+
if (result.code !== SUCCESS$6) return [installProblem(manifest, result)];
|
|
14334
14334
|
if (!Array$1.isReadonlyArrayNonEmpty(entries)) return [];
|
|
14335
14335
|
return yield* unresolvedFrom(entries).pipe(Effect.match({
|
|
14336
14336
|
onFailure: (detail) => [bundleProblem$2(manifest, detail)],
|
|
@@ -14368,8 +14368,8 @@ const quote = (text) => pipe(Schema.encodeOption(Quoted)(text), Option.getOrElse
|
|
|
14368
14368
|
const builtins = new Set(builtinModules);
|
|
14369
14369
|
const always = () => true;
|
|
14370
14370
|
const never = () => false;
|
|
14371
|
-
const taggedError$
|
|
14372
|
-
var BundleFailed = class extends taggedError$
|
|
14371
|
+
const taggedError$11 = Schema.TaggedError;
|
|
14372
|
+
var BundleFailed = class extends taggedError$11()("BundleFailed", { detail: Schema.String }) {};
|
|
14373
14373
|
const failed = (error) => BundleFailed.make({ detail: bundleErrorDetail(error) });
|
|
14374
14374
|
const isBare = (specifier) => !String$1.startsWith(RELATIVE_PREFIX)(specifier) && !String$1.startsWith(SUBPATH_IMPORT)(specifier) && !ABSOLUTE.test(specifier) && !String$1.startsWith(VIRTUAL_PREFIX)(specifier);
|
|
14375
14375
|
const isBuiltin$1 = (specifier) => String$1.startsWith(NODE_PROTOCOL)(specifier) || builtins.has(packageNameOf(specifier));
|
|
@@ -14586,26 +14586,26 @@ const othersOf = (total) => {
|
|
|
14586
14586
|
if (total <= FIRST$12) return "";
|
|
14587
14587
|
return ` The same happens for ${String(total - FIRST$12)} other exports.`;
|
|
14588
14588
|
};
|
|
14589
|
-
const messageOf$
|
|
14589
|
+
const messageOf$5 = (worst, total) => `importing \`${worst.member}\` from \`${worst.label}\` also bundles ${String(worst.modules)} modules${importsOf$1(worst.packages)}, which it does not use.${othersOf(total)} Declare "sideEffects": false in package.json so that a bundler drops what nothing imports, and keep a module that must run for its effect out of the package.`;
|
|
14590
14590
|
const largest = Order.mapInput(Order.flip(Order.Number), (excess) => excess.modules);
|
|
14591
14591
|
const keyIndex$1 = (source) => pipe(String$1.indexOf(SIDE_EFFECTS_KEY)(source), Option.orElse(() => String$1.indexOf(EXPORTS_KEY)(source)), Option.getOrElse(() => START$26));
|
|
14592
14592
|
const sideEffectProblems = ({ file, source, excesses }) => pipe(excesses, Array$1.sortBy(largest), Array$1.head, Option.map((worst) => ({
|
|
14593
14593
|
file,
|
|
14594
14594
|
...positionOf(source)(keyIndex$1(source)),
|
|
14595
14595
|
rule: RULE$51,
|
|
14596
|
-
message: messageOf$
|
|
14596
|
+
message: messageOf$5(worst, excesses.length)
|
|
14597
14597
|
})), Option.toArray);
|
|
14598
14598
|
// src/features/check-tree-shaking/model/top-level-effects.ts
|
|
14599
14599
|
const RULE$50 = "top-level-effect";
|
|
14600
14600
|
const CODE$1 = /\.[cm]?[jt]sx?$/u;
|
|
14601
|
-
const READ_CONCURRENCY$
|
|
14601
|
+
const READ_CONCURRENCY$20 = 16;
|
|
14602
14602
|
const IMPORT_MESSAGE = "imports a module only for its effect, but sideEffects in package.json does not list this file, so a bundler drops the import. Import what the module exports, or list the entry that exists for its effect in sideEffects.";
|
|
14603
14603
|
const STATEMENT_MESSAGE = "runs a statement at the top level for its effect, but sideEffects in package.json does not list this file, so a bundler drops the module when nothing it exports is used. Move the statement into a function that the caller runs, or list the entry that exists for its effect in sideEffects.";
|
|
14604
14604
|
const isEffect = (statement) => {
|
|
14605
14605
|
if (isExpressionStatement(statement)) return !isStringLiteral(statement.expression);
|
|
14606
14606
|
return isImportDeclaration(statement) && Predicate.isUndefined(statement.importClause);
|
|
14607
14607
|
};
|
|
14608
|
-
const messageOf$
|
|
14608
|
+
const messageOf$4 = (statement) => {
|
|
14609
14609
|
if (isImportDeclaration(statement)) return IMPORT_MESSAGE;
|
|
14610
14610
|
return STATEMENT_MESSAGE;
|
|
14611
14611
|
};
|
|
@@ -14613,7 +14613,7 @@ const problemsIn$15 = (api) => (file) => (source) => {
|
|
|
14613
14613
|
const retained = api.createSourceFile(file, source);
|
|
14614
14614
|
const problems = pipe(retained.sourceFile.statements, Array$1.fromIterable, Array$1.filter(isEffect), Array$1.map((statement) => problemAt$7({
|
|
14615
14615
|
rule: RULE$50,
|
|
14616
|
-
message: messageOf$
|
|
14616
|
+
message: messageOf$4(statement)
|
|
14617
14617
|
})(statement)));
|
|
14618
14618
|
retained.dispose();
|
|
14619
14619
|
return problems;
|
|
@@ -14625,7 +14625,7 @@ const topLevelEffects = Effect.fn("topLevelEffects")(function* topLevelEffects(r
|
|
|
14625
14625
|
const names = yield* files.ownedFiles(root);
|
|
14626
14626
|
const owned = new Set(pipe(names, Array$1.map((name) => files.join(root, name))));
|
|
14627
14627
|
const sources = pipe(modules, Array$1.filter((file) => owned.has(file) && CODE$1.test(file)));
|
|
14628
|
-
const found = yield* Effect.forEach(sources, (file) => files.readFile(file).pipe(Effect.map((text) => pipe(text, Option.map(problemsIn$15(compiler.api)(file)), Option.getOrElse(() => [])))), { concurrency: READ_CONCURRENCY$
|
|
14628
|
+
const found = yield* Effect.forEach(sources, (file) => files.readFile(file).pipe(Effect.map((text) => pipe(text, Option.map(problemsIn$15(compiler.api)(file)), Option.getOrElse(() => [])))), { concurrency: READ_CONCURRENCY$20 });
|
|
14629
14629
|
return Array$1.flatten(found);
|
|
14630
14630
|
}, Effect.scoped);
|
|
14631
14631
|
const BUNDLED_RULE = "bundled-side-effects";
|
|
@@ -14655,7 +14655,7 @@ const bundledSideEffectProblems = Effect.fn("bundledSideEffectProblems")(functio
|
|
|
14655
14655
|
const manifests = new Set(pipe(owned, Array$1.filter((file) => files.basename(file) === PACKAGE_JSON_FILE)));
|
|
14656
14656
|
const ownedSet = new Set(owned);
|
|
14657
14657
|
const directories = pipe(used, Array$1.flatMap(({ modules }) => modules), Array$1.filter((module) => ownedSet.has(module)), Array$1.flatMap((module) => Option.toArray(packageDirectoryOf(manifests, files)(module))), Array$1.dedupe, Array$1.filter((found) => found !== directory), Array$1.sortBy(Order.String));
|
|
14658
|
-
const undeclared = yield* Effect.forEach(directories, undeclaredAt, { concurrency: READ_CONCURRENCY$
|
|
14658
|
+
const undeclared = yield* Effect.forEach(directories, undeclaredAt, { concurrency: READ_CONCURRENCY$20 });
|
|
14659
14659
|
const at = problemAtIndex(BUNDLED_RULE)(located.file, located.source);
|
|
14660
14660
|
const index = nameIndex$1(located.source);
|
|
14661
14661
|
return pipe(Array$1.getSomes(undeclared), Array$1.map((found) => at(index, undeclaredMessage(files, root)(found))));
|
|
@@ -14800,7 +14800,7 @@ const lineOf$4 = (source) => (id) => pipe(String$1.split(source, "\n"), Array$1.
|
|
|
14800
14800
|
onNone: () => FIRST$11,
|
|
14801
14801
|
onSome: (index) => index + FIRST$11
|
|
14802
14802
|
}));
|
|
14803
|
-
const messageOf$
|
|
14803
|
+
const messageOf$3 = (legacy, dependents) => `\`${legacy.id}\` is installed, pulled in by ${Array$1.join(dependents, ", ")}. Only TypeScript ${String(CURRENT_MAJOR)} or newer is used: remove the dependency that needs the old compiler, move it to the TypeScript ${String(CURRENT_MAJOR)} API, or bundle or port it. Do not install an old compiler beside TypeScript ${String(CURRENT_MAJOR)}.`;
|
|
14804
14804
|
/** @internal */
|
|
14805
14805
|
const checkTypescriptGeneration = Effect.fn("checkTypescriptGeneration")(function* checkTypescriptGeneration(root) {
|
|
14806
14806
|
const files = yield* RepositoryFiles;
|
|
@@ -14813,7 +14813,7 @@ const checkTypescriptGeneration = Effect.fn("checkTypescriptGeneration")(functio
|
|
|
14813
14813
|
line: lineOf$4(source)(legacy.id),
|
|
14814
14814
|
column: FIRST$11,
|
|
14815
14815
|
rule: RULE$49,
|
|
14816
|
-
message: messageOf$
|
|
14816
|
+
message: messageOf$3(legacy, dependentsOf$1(Option.getOrElse(nodes, () => []))(legacy.id))
|
|
14817
14817
|
})));
|
|
14818
14818
|
});
|
|
14819
14819
|
// src/features/check-worker-bundles/model/worker-bundles.ts
|
|
@@ -14829,7 +14829,7 @@ const CONDITIONS = [
|
|
|
14829
14829
|
"default"
|
|
14830
14830
|
];
|
|
14831
14831
|
const problemFor$2 = problemInFile(RULE$48);
|
|
14832
|
-
const problemOf$
|
|
14832
|
+
const problemOf$10 = (file, detail) => problemFor$2(file, `does not bundle as a Worker, so the deploy would fail. ${detail}`);
|
|
14833
14833
|
const bundleProblem = (file) => Effect.gen(function* bundle() {
|
|
14834
14834
|
const built = yield* Effect.tryPromise({
|
|
14835
14835
|
try: () => rolldown({
|
|
@@ -14848,7 +14848,7 @@ const bundleProblem = (file) => Effect.gen(function* bundle() {
|
|
|
14848
14848
|
yield* Effect.promise(() => built.close());
|
|
14849
14849
|
}).pipe(Effect.match({
|
|
14850
14850
|
onSuccess: () => Option.none(),
|
|
14851
|
-
onFailure: (detail) => Option.some(problemOf$
|
|
14851
|
+
onFailure: (detail) => Option.some(problemOf$10(file, detail))
|
|
14852
14852
|
}));
|
|
14853
14853
|
/** @internal */
|
|
14854
14854
|
const checkWorkerBundles = Effect.fn("checkWorkerBundles")(function* checkWorkerBundles(root) {
|
|
@@ -14882,14 +14882,16 @@ const enabledRulesIn = Effect.fn("enabledRulesIn")(function* enabledRulesIn(root
|
|
|
14882
14882
|
});
|
|
14883
14883
|
/** @internal */
|
|
14884
14884
|
const expectationsIn = Effect.fn("expectationsIn")(function* expectationsIn(root) {
|
|
14885
|
+
const enabledRules = yield* enabledRulesIn(root);
|
|
14886
|
+
const published = yield* publishedArticlesIn(root);
|
|
14885
14887
|
return {
|
|
14886
|
-
enabledRules
|
|
14888
|
+
enabledRules,
|
|
14887
14889
|
text: {
|
|
14888
|
-
ignores:
|
|
14890
|
+
ignores: textIgnoresOf(published),
|
|
14889
14891
|
builtRuleNames: builtTextRuleNames
|
|
14890
14892
|
},
|
|
14891
14893
|
markdown: {
|
|
14892
|
-
ignores:
|
|
14894
|
+
ignores: markdownIgnoresOf(published),
|
|
14893
14895
|
rules: MARKDOWN_RULES
|
|
14894
14896
|
},
|
|
14895
14897
|
tasks: MSCH_TASK_COMMANDS,
|
|
@@ -14916,9 +14918,9 @@ const MSCH_RELAXATIONS = [
|
|
|
14916
14918
|
const isList = (value) => Array$1.isArray(value);
|
|
14917
14919
|
const isSection = (value) => Predicate.isObject(value) && !Array$1.isArray(value);
|
|
14918
14920
|
const sectionOf = (value) => pipe(Option.some(value), Option.filter(isSection), Option.getOrElse(() => ({})));
|
|
14919
|
-
const listOf$
|
|
14920
|
-
const severityOf = (value) => pipe(listOf$
|
|
14921
|
-
const hasOptions = (value) => Array$1.length(listOf$
|
|
14921
|
+
const listOf$2 = (value) => pipe(Option.some(value), Option.filter(isList), Option.getOrElse(() => []));
|
|
14922
|
+
const severityOf = (value) => pipe(listOf$2(value), Array$1.head, Option.getOrElse(() => value));
|
|
14923
|
+
const hasOptions = (value) => Array$1.length(listOf$2(value)) > SEVERITY_ONLY;
|
|
14922
14924
|
const unless = (kept, weakening) => Array$1.filter([weakening], () => !kept);
|
|
14923
14925
|
const whenPresent = (what, weakeningsIn) => (value) => Option.match(Option.fromUndefinedOr(value), {
|
|
14924
14926
|
onNone: () => [{
|
|
@@ -14951,7 +14953,7 @@ const lintWeakenings = (enabledRules) => whenPresent("lint section, so the msch
|
|
|
14951
14953
|
anchor: "ignorePatterns",
|
|
14952
14954
|
message: "lint.ignorePatterns differs from the files msch exempts (generated files, fixtures and upstream code). Files are not taken out of lint in a repository that uses msch."
|
|
14953
14955
|
}),
|
|
14954
|
-
...pipe(listOf$
|
|
14956
|
+
...pipe(listOf$2(section["overrides"]), Array$1.flatMap(overrideWeakenings(enabledRules)))
|
|
14955
14957
|
]);
|
|
14956
14958
|
const isOff = (value) => value === false || pipe(Record.values(sectionOf(value)), Array$1.some(isOff));
|
|
14957
14959
|
const textRuleWeakenings = (expected) => (owner, rules) => [...pipe(expected.builtRuleNames, Array$1.filter((name) => !Record.has(rules, name)), Array$1.map((name) => ({
|
|
@@ -14967,7 +14969,7 @@ const textWeakenings = (expected) => whenPresent("textlint section, so the Japan
|
|
|
14967
14969
|
message: "textlint.ignores differs from the files msch exempts. Files are not taken out of the text checks in a repository that uses msch."
|
|
14968
14970
|
}),
|
|
14969
14971
|
...textRuleWeakenings(expected)("textlint", sectionOf(section["rules"])),
|
|
14970
|
-
...pipe(listOf$
|
|
14972
|
+
...pipe(listOf$2(section["sources"]), Array$1.flatMap((source) => textRuleWeakenings(expected)("A textlint source", sectionOf(sectionOf(source)["rules"]))))
|
|
14971
14973
|
]);
|
|
14972
14974
|
const markdownWeakenings = (expected) => whenPresent("y8 section, so the Markdown checks do not run", (section) => [...unless(Equal.equals(section["ignores"], expected.ignores), {
|
|
14973
14975
|
anchor: "ignores",
|
|
@@ -14978,7 +14980,7 @@ const markdownWeakenings = (expected) => whenPresent("y8 section, so the Markdow
|
|
|
14978
14980
|
})]);
|
|
14979
14981
|
const taskWeakenings = (run, expected) => {
|
|
14980
14982
|
const tasks = sectionOf(sectionOf(run)["tasks"]);
|
|
14981
|
-
const dependsOn = listOf$
|
|
14983
|
+
const dependsOn = listOf$2(sectionOf(tasks["verify"])["dependsOn"]);
|
|
14982
14984
|
return [...pipe(Record.toEntries(expected.tasks), Array$1.filter(([name, command]) => !Equal.equals(sectionOf(tasks[name])["command"], command)), Array$1.map(([name]) => ({
|
|
14983
14985
|
anchor: "run",
|
|
14984
14986
|
message: `The ${name} task does not run what msch builds for it. Leave msch's tasks as repositoryConfig builds them; add other work under another task name.`
|
|
@@ -15005,8 +15007,8 @@ const CONFIG_FILE$5 = "vite.config.ts";
|
|
|
15005
15007
|
const START$24 = 0;
|
|
15006
15008
|
const SIDE_CONFIG = /(?:^|\/)(?:\.oxlintrc(?:\.jsonc?)?|oxlint\.config\.[cm]?[jt]s|\.oxlintignore|\.eslintrc(?:\.\w+)?|eslint\.config\.[cm]?[jt]s|\.eslintignore|\.textlintrc(?:\.\w+)?|\.textlintignore|\.markdownlint(?:-cli2)?(?:\.\w+)?|\.markdownlintignore|\.prettierignore|\.oxfmtrc(?:\.jsonc?)?|knip\.jsonc?)$/u;
|
|
15007
15009
|
const SIDE_CONFIG_MESSAGE = "This file configures a check outside vite.config.ts, where msch cannot see whether it turns rules off. Delete it; msch builds every check setting in vite.config.ts.";
|
|
15008
|
-
const taggedError$
|
|
15009
|
-
var DisabledRulesConfigUnreadable = class extends taggedError$
|
|
15010
|
+
const taggedError$10 = Schema.TaggedError;
|
|
15011
|
+
var DisabledRulesConfigUnreadable = class extends taggedError$10()("DisabledRulesConfigUnreadable", {
|
|
15010
15012
|
file: Schema.String,
|
|
15011
15013
|
reason: Schema.String
|
|
15012
15014
|
}) {};
|
|
@@ -15148,7 +15150,7 @@ const listedProblem = ({ file, line, column, names, reason }) => ({
|
|
|
15148
15150
|
rule: RULE$46,
|
|
15149
15151
|
message: `The names ${formatValues(names)} are listed by hand, but ${reason}`
|
|
15150
15152
|
});
|
|
15151
|
-
const problemOf$
|
|
15153
|
+
const problemOf$9 = ({ list, reason }) => listedProblem({
|
|
15152
15154
|
file: list.site.file,
|
|
15153
15155
|
line: list.site.line,
|
|
15154
15156
|
column: list.site.column,
|
|
@@ -15741,7 +15743,7 @@ const declaredNameProblem = ({ literals, relative }) => {
|
|
|
15741
15743
|
if (defined.length < mostNamesOf(list) || files.length < 2) return Option.none();
|
|
15742
15744
|
const names = pipe(defined, Array$1.map(([name]) => name));
|
|
15743
15745
|
const shown = pipe(files, Array$1.take(SHOWN_FILES), Array$1.map(relative), Array$1.join(", "));
|
|
15744
|
-
return Option.some(problemOf$
|
|
15746
|
+
return Option.some(problemOf$9({
|
|
15745
15747
|
list,
|
|
15746
15748
|
reason: `${formatValues(names)} are each written in another module (${shown}). Type those values with this list, or build this list from them, so that adding one does not mean editing two places.`
|
|
15747
15749
|
}));
|
|
@@ -15774,11 +15776,11 @@ const listedPathProblem = (repository) => (list) => {
|
|
|
15774
15776
|
const paths = pipe(list.names, Array$1.map(namedPath(repository, list.site.file)), Array$1.getSomes);
|
|
15775
15777
|
const packages = pipe(list.names, Array$1.filter((name) => HashSet.has(repository.packages, name)));
|
|
15776
15778
|
const directory = enumeratedDirectory(repository)(paths);
|
|
15777
|
-
if (Option.isSome(directory)) return Option.some(problemOf$
|
|
15779
|
+
if (Option.isSome(directory)) return Option.some(problemOf$9({
|
|
15778
15780
|
list,
|
|
15779
15781
|
reason: `they enumerate the entries of ${directoryLabel(directory.value)}. Find them with a glob or derive them from the declaration that names them.`
|
|
15780
15782
|
}));
|
|
15781
|
-
if (packages.length >= 2) return Option.some(problemOf$
|
|
15783
|
+
if (packages.length >= 2) return Option.some(problemOf$9({
|
|
15782
15784
|
list,
|
|
15783
15785
|
reason: `${formatValues(packages)} are workspace packages. Derive them from the workspace manifests or from a property that each package declares.`
|
|
15784
15786
|
}));
|
|
@@ -15793,7 +15795,7 @@ const connected = (index) => (left, right) => left === right || imports$1(index)
|
|
|
15793
15795
|
const isPartOf = (index, list) => (other) => other !== list && canImport(list.site.scope, other.site.scope) && connected(index)(list.site.file, other.site.file) && isSubsetOf(list.names, other.names) && list.names.length * SUBSET_SHARE >= other.names.length && !sameValues(list.names, other.names);
|
|
15794
15796
|
const subsetListProblem = ({ lists, literals, relative }) => {
|
|
15795
15797
|
const index = importIndexOf(literals);
|
|
15796
|
-
return (list) => pipe(lists, Array$1.findFirst(isPartOf(index, list)), Option.map((other) => problemOf$
|
|
15798
|
+
return (list) => pipe(lists, Array$1.findFirst(isPartOf(index, list)), Option.map((other) => problemOf$9({
|
|
15797
15799
|
list,
|
|
15798
15800
|
reason: `they are a part of ${formatValues(other.names)} at ${relative(other.site.file)}:${String(other.site.line)}. Name that list once and select from it with Extract or Exclude.`
|
|
15799
15801
|
})));
|
|
@@ -15938,7 +15940,7 @@ const checkRepository = Effect.fn("checkRepository")(function* checkRepository(r
|
|
|
15938
15940
|
// src/features/source-code/find-namespace-destructuring/model/namespace-destructuring.ts
|
|
15939
15941
|
const RULE$45 = "namespace-destructuring";
|
|
15940
15942
|
const LOCAL = /^[.#/]/u;
|
|
15941
|
-
const messageOf$
|
|
15943
|
+
const messageOf$2 = (name) => `Destructuring ${name}, which comes from a package, makes the bundler keep everything ${name} exports. Write ${name}.<member> where it is used.`;
|
|
15942
15944
|
const isPackage = (specifier) => isStringLiteral(specifier) && !LOCAL.test(specifier.text);
|
|
15943
15945
|
const importedNames = (sourceFile) => {
|
|
15944
15946
|
const bindings = pipe(sourceFile.statements, Array$1.filter(isImportDeclaration), Array$1.filter((declaration) => isPackage(declaration.moduleSpecifier)), Array$1.map((declaration) => Option.fromUndefinedOr(declaration.importClause)), Array$1.getSomes, Array$1.filter((clause) => clause.phaseModifier !== SyntaxKind.TypeKeyword), Array$1.map((clause) => Option.fromUndefinedOr(clause.namedBindings)), Array$1.getSomes);
|
|
@@ -15951,13 +15953,13 @@ const destructuredName = (declaration) => {
|
|
|
15951
15953
|
if (declaration.name.kind !== SyntaxKind.ObjectBindingPattern) return Option.none();
|
|
15952
15954
|
return pipe(Option.fromUndefinedOr(declaration.initializer), Option.filter(isIdentifier), Option.map((initializer) => initializer.text));
|
|
15953
15955
|
};
|
|
15954
|
-
const problemOf$
|
|
15956
|
+
const problemOf$8 = (names) => (declaration) => pipe(destructuredName(declaration), Option.filter((name) => names.includes(name)), Option.map((name) => problemAt$7({
|
|
15955
15957
|
rule: RULE$45,
|
|
15956
|
-
message: messageOf$
|
|
15958
|
+
message: messageOf$2(name)
|
|
15957
15959
|
})), Option.map((report) => report(declaration)));
|
|
15958
15960
|
const namespaceDestructuringIn = () => (sourceFile) => {
|
|
15959
15961
|
const names = importedNames(sourceFile);
|
|
15960
|
-
return pipe(descendantsOf(sourceFile), Array$1.filter(isVariableDeclaration), Array$1.map(problemOf$
|
|
15962
|
+
return pipe(descendantsOf(sourceFile), Array$1.filter(isVariableDeclaration), Array$1.map(problemOf$8(names)), Array$1.getSomes);
|
|
15961
15963
|
};
|
|
15962
15964
|
// src/features/source-code/find-pass-through-wrappers/model/pass-through-wrappers.ts
|
|
15963
15965
|
const RULE$44 = "pass-through-wrapper";
|
|
@@ -15965,7 +15967,7 @@ const SINGLE_STATEMENT = 1;
|
|
|
15965
15967
|
const SINGLE_DECLARATION = 1;
|
|
15966
15968
|
const THIS_PARAMETER = "this";
|
|
15967
15969
|
const NO_ARGUMENTS = [];
|
|
15968
|
-
const messageOf = (callee) => `This function only passes its parameters to ${callee} unchanged. Call ${callee} directly and delete this function.`;
|
|
15970
|
+
const messageOf$1 = (callee) => `This function only passes its parameters to ${callee} unchanged. Call ${callee} directly and delete this function.`;
|
|
15969
15971
|
const unwrapped = (expression) => {
|
|
15970
15972
|
if (isParenthesizedExpression(expression)) return unwrapped(expression.expression);
|
|
15971
15973
|
return expression;
|
|
@@ -16054,14 +16056,14 @@ const isPassThrough = (checker) => (candidate) => (forward) => {
|
|
|
16054
16056
|
const restForwarded = pipe(wrapper.parameters, Array$1.some(isRest));
|
|
16055
16057
|
return Option.exists(forwardedNames(wrapper, forward), (names) => callsAnotherFunction(candidate, forward, names)) && (restForwarded || calleeTakesExactly(checker)(forward, wrapper.parameters.length)) && keepsTheReturnType(checker)(wrapper, forward) && !isOverloaded(checker)(name);
|
|
16056
16058
|
};
|
|
16057
|
-
const problemOf$
|
|
16059
|
+
const problemOf$7 = (checker) => (candidate) => {
|
|
16058
16060
|
if (changesTheCall(candidate.wrapper)) return Option.none();
|
|
16059
16061
|
return pipe(returnedExpression(candidate.wrapper), Option.flatMap(forwardOf), Option.filter(isPassThrough(checker)(candidate)), Option.map((forward) => problemAt$7({
|
|
16060
16062
|
rule: RULE$44,
|
|
16061
|
-
message: messageOf(forward.callee.getText())
|
|
16063
|
+
message: messageOf$1(forward.callee.getText())
|
|
16062
16064
|
})(candidate.name)));
|
|
16063
16065
|
};
|
|
16064
|
-
const passThroughWrappersIn = (checker) => (sourceFile) => pipe(descendantsOf(sourceFile), Array$1.map(candidateOf), Array$1.getSomes, Array$1.map(problemOf$
|
|
16066
|
+
const passThroughWrappersIn = (checker) => (sourceFile) => pipe(descendantsOf(sourceFile), Array$1.map(candidateOf), Array$1.getSomes, Array$1.map(problemOf$7(checker)), Array$1.getSomes);
|
|
16065
16067
|
// src/app/source-checks.ts
|
|
16066
16068
|
/** @internal */
|
|
16067
16069
|
const checkSources = (root) => checkRepository(root, [passThroughWrappersIn, namespaceDestructuringIn]);
|
|
@@ -16132,7 +16134,7 @@ const PLUGIN_HOOKS_FILE = /(?:^|\/)hooks\/hooks\.json$/u;
|
|
|
16132
16134
|
const PROJECT_PATH = /(?<optional>--env-file-if-exists=)?\$\{?CLAUDE_PROJECT_DIR\}?(?:\\")?\/(?<path>[\w.@/-]+)/gu;
|
|
16133
16135
|
const PLUGIN_PATH = /(?<optional>--env-file-if-exists=)?\$\{?CLAUDE_PLUGIN_ROOT\}?(?:\\")?\/(?<path>[\w.@/-]+)/gu;
|
|
16134
16136
|
const PLUGIN_ROOT = "..";
|
|
16135
|
-
const READ_CONCURRENCY$
|
|
16137
|
+
const READ_CONCURRENCY$19 = 16;
|
|
16136
16138
|
const START$23 = 0;
|
|
16137
16139
|
const referenceOf$1 = (found) => pipe(groupOf("path")(found), Option.filter(() => Option.isNone(groupOf("optional")(found))), Option.map((path) => ({
|
|
16138
16140
|
path,
|
|
@@ -16175,11 +16177,11 @@ const checkMissingHooks = Effect.fn("checkMissingHooks")(function* checkMissingH
|
|
|
16175
16177
|
}];
|
|
16176
16178
|
return [];
|
|
16177
16179
|
}));
|
|
16178
|
-
const found = yield* Effect.forEach(hookFiles, problemsIn$14, { concurrency: READ_CONCURRENCY$
|
|
16180
|
+
const found = yield* Effect.forEach(hookFiles, problemsIn$14, { concurrency: READ_CONCURRENCY$19 });
|
|
16179
16181
|
return Array$1.flatten(found);
|
|
16180
16182
|
});
|
|
16181
16183
|
// src/features/check-documented-commands/model/task-graph.ts
|
|
16182
|
-
const SUCCESS$
|
|
16184
|
+
const SUCCESS$5 = 0;
|
|
16183
16185
|
const PackageSchema = Schema.Struct({ name: Schema.optional(Schema.String) });
|
|
16184
16186
|
const TaskSchema = Schema.Struct({
|
|
16185
16187
|
package: Schema.String,
|
|
@@ -16200,7 +16202,7 @@ const listedTasks = Effect.fn("listedTasks")(function* listedTasks(root) {
|
|
|
16200
16202
|
});
|
|
16201
16203
|
const text = yield* handle.stdout.pipe(Stream.decodeText(), Stream.mkString);
|
|
16202
16204
|
const code = yield* handle.exitCode;
|
|
16203
|
-
return pipe(Option.liftPredicate(text, () => Number(code) === SUCCESS$
|
|
16205
|
+
return pipe(Option.liftPredicate(text, () => Number(code) === SUCCESS$5), Option.flatMap(decodeGraph));
|
|
16204
16206
|
}, Effect.scoped, Effect.orElseSucceed(() => Option.none()));
|
|
16205
16207
|
const GivenTaskGraph = Context.Reference("msch/GivenTaskGraph", { defaultValue: () => Option.none() });
|
|
16206
16208
|
// src/features/check-documented-commands/model/commands.ts
|
|
@@ -16315,7 +16317,7 @@ const checkDocumentedCommands = Effect.fn("checkDocumentedCommands")(function* c
|
|
|
16315
16317
|
});
|
|
16316
16318
|
// src/features/check-legacy-web/model/legacy-web.ts
|
|
16317
16319
|
const RULE$40 = "legacy-web";
|
|
16318
|
-
const FIRST_COLUMN$
|
|
16320
|
+
const FIRST_COLUMN$7 = 1;
|
|
16319
16321
|
const SCANNER = fileURLToPath(new URL("./skills/modern-web-guidance/modern-web.mjs", import.meta.resolve("modern-web-guidance/package.json")));
|
|
16320
16322
|
const Finding = Schema.Struct({
|
|
16321
16323
|
file: Schema.String,
|
|
@@ -16352,15 +16354,15 @@ const checkLegacyWeb = Effect.fn("checkLegacyWeb")(function* checkLegacyWeb(root
|
|
|
16352
16354
|
const problemOf = (guideId, ruleId) => ({ file, line, message }) => ({
|
|
16353
16355
|
file: files.join(root, file),
|
|
16354
16356
|
line,
|
|
16355
|
-
column: FIRST_COLUMN$
|
|
16357
|
+
column: FIRST_COLUMN$7,
|
|
16356
16358
|
rule: RULE$40,
|
|
16357
16359
|
message: `${ruleId}: ${message} Read the guide with \`modern-web-guidance retrieve ${guideId}\` and apply it.`
|
|
16358
16360
|
});
|
|
16359
16361
|
return pipe(scan.guides, Array$1.flatMap(({ guideId, rules }) => pipe(rules, Array$1.flatMap(({ ruleId, findings }) => pipe(findings, Array$1.map(problemOf(guideId, ruleId)))))));
|
|
16360
16362
|
});
|
|
16361
16363
|
// src/shared/lib/section-check.ts
|
|
16362
|
-
const taggedError$
|
|
16363
|
-
var SectionConfigUnreadable = class extends taggedError$
|
|
16364
|
+
const taggedError$9 = Schema.TaggedError;
|
|
16365
|
+
var SectionConfigUnreadable = class extends taggedError$9()("SectionConfigUnreadable", { file: Schema.String }) {};
|
|
16364
16366
|
const CONFIG_FILE$4 = "vite.config.ts";
|
|
16365
16367
|
const FIRST$10 = 1;
|
|
16366
16368
|
const ONE$1 = 1;
|
|
@@ -16423,7 +16425,7 @@ const SHELL_FILE = /\.(?:sh|bash|zsh|ksh|fish|command)$/u;
|
|
|
16423
16425
|
const SHELL_SHEBANG = /^#!\S*(?:\/|\s)(?:env\s+)?(?:-\S+\s+)*(?:ba|z|k|da)?sh\b|^#!\S*fish\b/u;
|
|
16424
16426
|
const EXTENSION$1 = /\.[^./]+$/u;
|
|
16425
16427
|
const SETTINGS_FILE = ".claude/settings.json";
|
|
16426
|
-
const READ_CONCURRENCY$
|
|
16428
|
+
const READ_CONCURRENCY$18 = 64;
|
|
16427
16429
|
const RULE$39 = "shell-script";
|
|
16428
16430
|
const MESSAGE$14 = "is a shell script. Do the work in TypeScript as a Vite+ task in vite.config.ts, a test, or the tool's own hook, and delete this file. Only the SessionStart hook in .claude/settings.json, which installs the toolchain before TypeScript can run, stays a shell script.";
|
|
16429
16431
|
const HookSchema = Schema.Struct({
|
|
@@ -16456,12 +16458,12 @@ const checkShellScripts = Effect.fn("checkShellScripts")(function* checkShellScr
|
|
|
16456
16458
|
return files.readFile(file).pipe(Effect.map(Option.exists((source) => SHELL_SHEBANG.test(source))));
|
|
16457
16459
|
};
|
|
16458
16460
|
const candidates = pipe(names, Array$1.filter((name) => !isSessionStartHook(name)));
|
|
16459
|
-
const shell = yield* Effect.filter(candidates, isShell, { concurrency: READ_CONCURRENCY$
|
|
16461
|
+
const shell = yield* Effect.filter(candidates, isShell, { concurrency: READ_CONCURRENCY$18 });
|
|
16460
16462
|
return pipe(shell, Array$1.map((name) => problemInFile(RULE$39)(files.join(root, name), MESSAGE$14)));
|
|
16461
16463
|
});
|
|
16462
16464
|
// src/shared/lib/workflow-files.ts
|
|
16463
16465
|
const WORKFLOW_FILE = /^\.github\/workflows\/[^/]+\.ya?ml$/u;
|
|
16464
|
-
const READ_CONCURRENCY$
|
|
16466
|
+
const READ_CONCURRENCY$17 = 16;
|
|
16465
16467
|
const readWorkflows = Effect.fn("readWorkflows")(function* readWorkflows(root) {
|
|
16466
16468
|
const files = yield* RepositoryFiles;
|
|
16467
16469
|
const names = yield* files.listedFiles(root);
|
|
@@ -16471,7 +16473,7 @@ const readWorkflows = Effect.fn("readWorkflows")(function* readWorkflows(root) {
|
|
|
16471
16473
|
file,
|
|
16472
16474
|
source
|
|
16473
16475
|
}))));
|
|
16474
|
-
}, { concurrency: READ_CONCURRENCY$
|
|
16476
|
+
}, { concurrency: READ_CONCURRENCY$17 });
|
|
16475
16477
|
return Array$1.getSomes(found);
|
|
16476
16478
|
});
|
|
16477
16479
|
// src/shared/lib/workflow-run.ts
|
|
@@ -16633,7 +16635,7 @@ const AGENT_DOCS = [
|
|
|
16633
16635
|
":(glob)**/CLAUDE.md",
|
|
16634
16636
|
...EXCLUDED$5
|
|
16635
16637
|
];
|
|
16636
|
-
const READ_CONCURRENCY$
|
|
16638
|
+
const READ_CONCURRENCY$16 = 16;
|
|
16637
16639
|
const START$20 = 0;
|
|
16638
16640
|
const FIRST$9 = 1;
|
|
16639
16641
|
const LINE = "\n";
|
|
@@ -16702,7 +16704,7 @@ const taskSources = Effect.fn("taskSources")(function* taskSources(root, directo
|
|
|
16702
16704
|
return pipe(tasks, Array$1.flatMap((task) => Option.toArray(taskSource(file, source)(task))));
|
|
16703
16705
|
});
|
|
16704
16706
|
const workspaceTasks = Effect.fn("workspaceTasks")(function* workspaceTasks(root, directories) {
|
|
16705
|
-
const found = yield* Effect.forEach(directories, (directory) => taskSources(root, directory), { concurrency: READ_CONCURRENCY$
|
|
16707
|
+
const found = yield* Effect.forEach(directories, (directory) => taskSources(root, directory), { concurrency: READ_CONCURRENCY$16 });
|
|
16706
16708
|
return Array$1.flatten(found);
|
|
16707
16709
|
});
|
|
16708
16710
|
const readSources = Effect.fn("readSources")(function* readSources(root, names, sourcesOf) {
|
|
@@ -16714,7 +16716,7 @@ const readSources = Effect.fn("readSources")(function* readSources(root, names,
|
|
|
16714
16716
|
onSome: sourcesOf(file, name)
|
|
16715
16717
|
});
|
|
16716
16718
|
return files.readFile(file).pipe(Effect.map(sourcesIn));
|
|
16717
|
-
}, { concurrency: READ_CONCURRENCY$
|
|
16719
|
+
}, { concurrency: READ_CONCURRENCY$16 });
|
|
16718
16720
|
return Array$1.flatten(found);
|
|
16719
16721
|
});
|
|
16720
16722
|
/** @internal */
|
|
@@ -16758,13 +16760,13 @@ const LIFECYCLE = [
|
|
|
16758
16760
|
"dependencies",
|
|
16759
16761
|
"pnpm:devPreinstall"
|
|
16760
16762
|
];
|
|
16761
|
-
const problemOf$
|
|
16763
|
+
const problemOf$6 = ({ file, position, name }) => ({
|
|
16762
16764
|
file,
|
|
16763
16765
|
...position,
|
|
16764
16766
|
rule: RULE$37,
|
|
16765
16767
|
message: `The script ${name} is not a lifecycle script. package.json scripts hold only the scripts the package manager runs by itself, such as prepare and prepack. Write ${name} as a task in run.tasks of this package's vite.config.ts, where its shape is type-checked.`
|
|
16766
16768
|
});
|
|
16767
|
-
const packageScriptProblems = (sources) => pipe(sources, Array$1.filter(({ kind, name }) => kind === "script" && !Array$1.contains(LIFECYCLE, name)), Array$1.map(problemOf$
|
|
16769
|
+
const packageScriptProblems = (sources) => pipe(sources, Array$1.filter(({ kind, name }) => kind === "script" && !Array$1.contains(LIFECYCLE, name)), Array$1.map(problemOf$6));
|
|
16768
16770
|
// src/features/check-vite-plus/model/vite-plus-block.ts
|
|
16769
16771
|
const RULE$36 = "vite-plus-block";
|
|
16770
16772
|
const MARKER = Array$1.join([
|
|
@@ -16850,11 +16852,11 @@ const WORKFLOW_MESSAGE = "differs from the template's workflow, which Renovate d
|
|
|
16850
16852
|
const setupProblem$1 = problemInFile(SETUP_RULE$1);
|
|
16851
16853
|
const refProblem = problemInFile(REF_RULE);
|
|
16852
16854
|
const workflowProblem = problemInFile(WORKFLOW_RULE);
|
|
16853
|
-
const problemOf$
|
|
16855
|
+
const problemOf$5 = ({ file, reason }) => Match.value(reason).pipe(Match.when("setup", () => setupProblem$1(file, SETUP_MESSAGE)), Match.when("ref", () => refProblem(file, REF_MESSAGE)), Match.when("workflow", () => workflowProblem(file, WORKFLOW_MESSAGE)), Match.exhaustive);
|
|
16854
16856
|
/** @internal */
|
|
16855
16857
|
const checkCiDrift = Effect.fn("checkCiDrift")(function* checkCiDrift(root) {
|
|
16856
16858
|
const drifts = yield* findCiDrift(root);
|
|
16857
|
-
return pipe(drifts, Array$1.map(problemOf$
|
|
16859
|
+
return pipe(drifts, Array$1.map(problemOf$5));
|
|
16858
16860
|
});
|
|
16859
16861
|
// src/features/check-workflows/model/publish-trigger.ts
|
|
16860
16862
|
const RULE$34 = "publish-trigger";
|
|
@@ -17049,8 +17051,8 @@ const tomlSourceComments = (source) => pipe(parseTOML(source).comments, Array$1.
|
|
|
17049
17051
|
text: String$1.slice(start, end)(source)
|
|
17050
17052
|
})));
|
|
17051
17053
|
// src/features/ban-comments/model/found-comment.ts
|
|
17052
|
-
const taggedError$
|
|
17053
|
-
var CommentsUnreadable = class extends taggedError$
|
|
17054
|
+
const taggedError$8 = Schema.TaggedError;
|
|
17055
|
+
var CommentsUnreadable = class extends taggedError$8()("CommentsUnreadable", {
|
|
17054
17056
|
reader: Schema.String,
|
|
17055
17057
|
message: Schema.String
|
|
17056
17058
|
}) {};
|
|
@@ -17243,7 +17245,7 @@ const RULE$29 = "comment";
|
|
|
17243
17245
|
const SUPPRESSION_RULE = "suppression";
|
|
17244
17246
|
const UNUSED_RULE = "unused-comment-allowance";
|
|
17245
17247
|
const CONFIG_FILE$3 = "vite.config.ts";
|
|
17246
|
-
const READ_CONCURRENCY$
|
|
17248
|
+
const READ_CONCURRENCY$15 = 64;
|
|
17247
17249
|
const START$18 = 0;
|
|
17248
17250
|
const SHEBANG = "#!";
|
|
17249
17251
|
const PIN = /@(?:[0-9a-f]{40}|sha256:[0-9a-f]{64})\s*$/u;
|
|
@@ -17255,8 +17257,8 @@ const CommentSettings = Schema.Struct({ allow: Patterns });
|
|
|
17255
17257
|
const MschSettings = Schema.Struct({ comments: Schema.optional(CommentSettings) });
|
|
17256
17258
|
const RootConfig = Schema.Struct({ msch: Schema.optional(MschSettings) });
|
|
17257
17259
|
const NO_SETTINGS = { allow: [] };
|
|
17258
|
-
const taggedError$
|
|
17259
|
-
var CommentConfigUnreadable = class extends taggedError$
|
|
17260
|
+
const taggedError$7 = Schema.TaggedError;
|
|
17261
|
+
var CommentConfigUnreadable = class extends taggedError$7()("CommentConfigUnreadable", { file: Schema.String }) {};
|
|
17260
17262
|
const valueOf = (text) => String$1.replaceAll(DELIMITERS, "")(text);
|
|
17261
17263
|
const lineBefore = (source, index) => {
|
|
17262
17264
|
const lines = pipe(source, String$1.slice(START$18, index), String$1.split("\n"));
|
|
@@ -17271,7 +17273,7 @@ const NOTHING = {
|
|
|
17271
17273
|
used: []
|
|
17272
17274
|
};
|
|
17273
17275
|
const unusedMessage = (entry) => `allows the comment pattern \`${entry}\`, but no comment in the repository matches it. Delete the entry and add it back when a comment needs it.`;
|
|
17274
|
-
const problemOf$
|
|
17276
|
+
const problemOf$4 = (file, source) => (comment) => Match.value(isSuppression(comment)).pipe(Match.when(true, () => problemAtIndex(SUPPRESSION_RULE)(file, source)(comment.index, SUPPRESSION_MESSAGE)), Match.orElse(() => problemAtIndex(RULE$29)(file, source)(comment.index, MESSAGE$5)));
|
|
17275
17277
|
const settingsOf = ({ msch }) => ({ allow: pipe(Option.fromUndefinedOr(msch), Option.flatMap(({ comments }) => Option.fromUndefinedOr(comments)), Option.match({
|
|
17276
17278
|
onNone: () => NO_SETTINGS.allow,
|
|
17277
17279
|
onSome: ({ allow }) => allow
|
|
@@ -17301,7 +17303,7 @@ const unusedAllowances = Effect.fn("unusedAllowances")(function* unusedAllowance
|
|
|
17301
17303
|
});
|
|
17302
17304
|
const scanFile = ({ directives, allowances, comments }) => ({ name, file }, source) => {
|
|
17303
17305
|
const kept = Predicate.not(isAllowed(source, directives));
|
|
17304
|
-
const toProblem = problemOf$
|
|
17306
|
+
const toProblem = problemOf$4(file, source);
|
|
17305
17307
|
return Option.match(readerOf(name)(source), {
|
|
17306
17308
|
onNone: () => Effect.succeed(NOTHING),
|
|
17307
17309
|
onSome: (reader) => comments(reader, source).pipe(Effect.map((found) => ({
|
|
@@ -17327,7 +17329,7 @@ const checkComments = Effect.fn("checkComments")(function* checkComments(root) {
|
|
|
17327
17329
|
const found = yield* Effect.forEach(scanned, (entry) => files.readFile(entry.file).pipe(Effect.flatMap(Option.match({
|
|
17328
17330
|
onNone: () => Effect.succeed(NOTHING),
|
|
17329
17331
|
onSome: (source) => scan(entry, source)
|
|
17330
|
-
}))), { concurrency: READ_CONCURRENCY$
|
|
17332
|
+
}))), { concurrency: READ_CONCURRENCY$15 });
|
|
17331
17333
|
const used = HashSet.fromIterable(pipe(found, Array$1.flatMap(({ used: indexes }) => indexes)));
|
|
17332
17334
|
const unused = yield* unusedAllowances(root, settings, used);
|
|
17333
17335
|
return [...pipe(found, Array$1.flatMap(({ problems }) => problems)), ...unused];
|
|
@@ -17343,12 +17345,12 @@ const patternsBy = ({ spawn, command, toolVersions = [] }) => (entry) => {
|
|
|
17343
17345
|
};
|
|
17344
17346
|
const spawnPattern = (program) => new RegExp(String.raw`(?:\bcommand["']?\s*[:=]\s*|(?:\bspawn\w*|\bexec\w*|\bexeca|Command::new|ChildProcess\.make)\(\s*|\$\(\s*|\$\s*(?=\x60))["'\x60](?:${program})(?=["'\x60\s])`, "gu");
|
|
17345
17347
|
const FIRST_LINE$6 = 1;
|
|
17346
|
-
const FIRST_COLUMN$
|
|
17348
|
+
const FIRST_COLUMN$6 = 1;
|
|
17347
17349
|
const WHOLE_MATCH$1 = 0;
|
|
17348
17350
|
const fileProblem = (tool) => (entry) => ({
|
|
17349
17351
|
file: entry.file,
|
|
17350
17352
|
line: FIRST_LINE$6,
|
|
17351
|
-
column: FIRST_COLUMN$
|
|
17353
|
+
column: FIRST_COLUMN$6,
|
|
17352
17354
|
rule: tool.fileRule,
|
|
17353
17355
|
message: tool.fileMessage(entry)
|
|
17354
17356
|
});
|
|
@@ -17455,7 +17457,7 @@ const uncatalogedDependencies = Effect.fn("uncatalogedDependencies")(function* u
|
|
|
17455
17457
|
// src/features/check-catalog-entries/model/catalog-entries.ts
|
|
17456
17458
|
const WORKSPACE_FILE$3 = "pnpm-workspace.yaml";
|
|
17457
17459
|
const FIRST_LINE$5 = 1;
|
|
17458
|
-
const FIRST_COLUMN$
|
|
17460
|
+
const FIRST_COLUMN$5 = 1;
|
|
17459
17461
|
const RULE$27 = "prune-setting-off";
|
|
17460
17462
|
const PRUNE_SETTINGS = [["catalogPrune", "removes catalog entries no package refers to, so the catalog holds only versions in use."], ["minimumReleaseAgeExcludePrune", "removes `minimumReleaseAgeExclude` entries the lockfile no longer resolves, which only exempted that one version while it was new."]];
|
|
17461
17463
|
const decodeTrue = Schema.decodeUnknownOption(Schema.Literal(true));
|
|
@@ -17469,7 +17471,7 @@ const pruneProblems = Effect.fn("pruneProblems")(function* pruneProblems(file, s
|
|
|
17469
17471
|
return pipe(PRUNE_SETTINGS, Array$1.filter(([setting]) => Option.isNone(decodeTrue(settings[setting]))), Array$1.map(([setting, effect]) => ({
|
|
17470
17472
|
file,
|
|
17471
17473
|
line: at(setting),
|
|
17472
|
-
column: FIRST_COLUMN$
|
|
17474
|
+
column: FIRST_COLUMN$5,
|
|
17473
17475
|
rule: RULE$27,
|
|
17474
17476
|
message: `Set \`${setting}: true\`. It ${effect}`
|
|
17475
17477
|
})));
|
|
@@ -17504,8 +17506,8 @@ const Source = Schema.Struct({
|
|
|
17504
17506
|
});
|
|
17505
17507
|
const SkillsConfig = Schema.Struct({ skills: Schema.Record(Schema.String, Source) });
|
|
17506
17508
|
const decodeSkills = Schema.decodeUnknownOption(SkillsConfig);
|
|
17507
|
-
const taggedError$
|
|
17508
|
-
var SkillsConfigUnreadable = class extends taggedError$
|
|
17509
|
+
const taggedError$6 = Schema.TaggedError;
|
|
17510
|
+
var SkillsConfigUnreadable = class extends taggedError$6()("SkillsConfigUnreadable", { file: Schema.String }) {};
|
|
17509
17511
|
const problemAt$3 = (rule, file, text) => (anchor, message) => ({
|
|
17510
17512
|
file,
|
|
17511
17513
|
...positionOf(text)(pipe(String$1.indexOf(anchor)(text), Option.getOrElse(() => START$17))),
|
|
@@ -17567,11 +17569,11 @@ const checkSkillEntry = Effect.fn("checkSkillEntry")(function* checkSkillEntry(r
|
|
|
17567
17569
|
const RULE$26 = "published-skills";
|
|
17568
17570
|
const KEYWORD = "tanstack-intent";
|
|
17569
17571
|
const SKILLS = "skills";
|
|
17570
|
-
const SKILL_FILE$
|
|
17572
|
+
const SKILL_FILE$3 = "SKILL.md";
|
|
17571
17573
|
const SUCCEEDED = 0;
|
|
17572
17574
|
const INTENT_CLI = fileURLToPath(new URL("./cli.mjs", import.meta.resolve("@tanstack/intent")));
|
|
17573
17575
|
const problemAt$2 = problemInFile(RULE$26);
|
|
17574
|
-
const skillDirectoriesIn = (files, directory) => pipe(findSkillFiles(files.join(directory, SKILLS)), Array$1.filter((file) => files.basename(file) === SKILL_FILE$
|
|
17576
|
+
const skillDirectoriesIn = (files, directory) => pipe(findSkillFiles(files.join(directory, SKILLS)), Array$1.filter((file) => files.basename(file) === SKILL_FILE$3), Array$1.map((file) => files.relative(directory, files.dirname(file))));
|
|
17575
17577
|
const isShipped = (listed) => (skill) => Array$1.contains(listed, SKILLS) || Array$1.contains(listed, skill);
|
|
17576
17578
|
const packagingMessages = ({ keywords, files }, skills) => {
|
|
17577
17579
|
const keyword = pipe(Option.liftPredicate(keywords, (own) => !Array$1.contains(own, KEYWORD)), Option.map(() => `is published with skills but lacks the ${KEYWORD} keyword, so Intent does not find them. Add it to keywords.`));
|
|
@@ -17596,7 +17598,7 @@ const problemsIn$10 = Effect.fn("problemsIn")(function* problemsIn(root, project
|
|
|
17596
17598
|
const directory = files.join(root, project.directory);
|
|
17597
17599
|
const manifest = files.join(directory, PACKAGE_JSON_FILE);
|
|
17598
17600
|
const skills = skillDirectoriesIn(files, directory);
|
|
17599
|
-
if (!Array$1.isReadonlyArrayNonEmpty(skills)) return [problemAt$2(manifest, `is published without agent skills. Write the tasks an agent needs for this package as ${SKILLS}/<task>/${SKILL_FILE$
|
|
17601
|
+
if (!Array$1.isReadonlyArrayNonEmpty(skills)) return [problemAt$2(manifest, `is published without agent skills. Write the tasks an agent needs for this package as ${SKILLS}/<task>/${SKILL_FILE$3}, so that repositories which approve them in the permissions of pnpm-workspace.yaml give their agents guidance for the installed version.`)];
|
|
17600
17602
|
const validation = yield* validationOf(directory).pipe(Effect.orElseSucceed(() => Option.none()));
|
|
17601
17603
|
return [...pipe(packagingMessages(project, skills), Array$1.map((message) => problemAt$2(manifest, message))), ...pipe(validation, Option.map((output) => problemAt$2(files.join(directory, SKILLS), `fails intent validate:\n${output}`)), Option.toArray)];
|
|
17602
17604
|
});
|
|
@@ -17608,7 +17610,7 @@ const checkPublishedSkills = Effect.fn("checkPublishedSkills")(function* checkPu
|
|
|
17608
17610
|
});
|
|
17609
17611
|
// src/features/check-skills/model/skill-files.ts
|
|
17610
17612
|
const RULE$25 = "skill-file";
|
|
17611
|
-
const SKILL_FILE$
|
|
17613
|
+
const SKILL_FILE$2 = /(?:^|\/)SKILL\.md$/u;
|
|
17612
17614
|
const INSTALLED = /(?:^|\/)\.(?:agents|claude|codex)\/skills\//u;
|
|
17613
17615
|
const FIXTURE$1 = /(?:^|\/)fixtures\//u;
|
|
17614
17616
|
const MARKDOWN$5 = ".md";
|
|
@@ -17626,7 +17628,7 @@ const BLANK = /\s+/u;
|
|
|
17626
17628
|
const SEPARATOR$9 = "/";
|
|
17627
17629
|
const START$16 = 0;
|
|
17628
17630
|
const FIRST$7 = 1;
|
|
17629
|
-
const READ_CONCURRENCY$
|
|
17631
|
+
const READ_CONCURRENCY$14 = 16;
|
|
17630
17632
|
const Metadata = Schema.Struct({ "derived-from": Schema.optional(Schema.String) });
|
|
17631
17633
|
const Frontmatter = Schema.Struct({
|
|
17632
17634
|
name: Schema.optional(Schema.String),
|
|
@@ -17702,7 +17704,7 @@ const problemsIn$9 = Effect.fn("problemsIn")(function* problemsIn(root, listed,
|
|
|
17702
17704
|
const inside = pipe(listed, Array$1.filter(String$1.startsWith(`${directory}${SEPARATOR$9}`)));
|
|
17703
17705
|
const text = yield* files.readFile(file);
|
|
17704
17706
|
const documents = pipe(inside, Array$1.filter(String$1.endsWith(MARKDOWN$5)), Array$1.map((entry) => files.join(root, entry)));
|
|
17705
|
-
const links = yield* Effect.forEach(documents, linkProblems, { concurrency: READ_CONCURRENCY$
|
|
17707
|
+
const links = yield* Effect.forEach(documents, linkProblems, { concurrency: READ_CONCURRENCY$14 });
|
|
17706
17708
|
const licenses = pipe(inside, Array$1.filter((entry) => files.dirname(entry) === directory), Array$1.filter((entry) => LICENSE_FILE.test(files.basename(entry))), Array$1.map((entry) => ({
|
|
17707
17709
|
file: files.join(root, entry),
|
|
17708
17710
|
line: FIRST$7,
|
|
@@ -17723,8 +17725,8 @@ const problemsIn$9 = Effect.fn("problemsIn")(function* problemsIn(root, listed,
|
|
|
17723
17725
|
/** @internal */
|
|
17724
17726
|
const checkSkillFiles = Effect.fn("checkSkillFiles")(function* checkSkillFiles(root) {
|
|
17725
17727
|
const listed = yield* (yield* RepositoryFiles).listedFiles(root);
|
|
17726
|
-
const skills = pipe(listed, Array$1.filter((name) => SKILL_FILE$
|
|
17727
|
-
const found = yield* Effect.forEach(skills, (name) => problemsIn$9(root, listed, name), { concurrency: READ_CONCURRENCY$
|
|
17728
|
+
const skills = pipe(listed, Array$1.filter((name) => SKILL_FILE$2.test(name) && !INSTALLED.test(name) && !FIXTURE$1.test(name)));
|
|
17729
|
+
const found = yield* Effect.forEach(skills, (name) => problemsIn$9(root, listed, name), { concurrency: READ_CONCURRENCY$14 });
|
|
17728
17730
|
return Array$1.flatten(found);
|
|
17729
17731
|
});
|
|
17730
17732
|
// src/features/check-version-downgrades/model/version-entries.ts
|
|
@@ -17786,7 +17788,7 @@ const cargoEntries = (text) => {
|
|
|
17786
17788
|
const toolchainEntries = (text) => singleEntry("channel", fieldOf("channel")(parseToml(text)["toolchain"]));
|
|
17787
17789
|
// src/features/check-version-downgrades/model/version-downgrade.ts
|
|
17788
17790
|
const RULE$24 = "version-downgrade";
|
|
17789
|
-
const READ_CONCURRENCY$
|
|
17791
|
+
const READ_CONCURRENCY$13 = 16;
|
|
17790
17792
|
const READERS = [
|
|
17791
17793
|
[/(?:^|\/)package\.json$/u, manifestEntries],
|
|
17792
17794
|
[/^pnpm-workspace\.yaml$/u, workspaceEntries],
|
|
@@ -17830,7 +17832,7 @@ const checkDowngrades = Effect.fn("checkDowngrades")(function* checkDowngrades(r
|
|
|
17830
17832
|
before: read(before),
|
|
17831
17833
|
after: read(after)
|
|
17832
17834
|
})), Option.getOrElse(() => []));
|
|
17833
|
-
}), { concurrency: READ_CONCURRENCY$
|
|
17835
|
+
}), { concurrency: READ_CONCURRENCY$13 });
|
|
17834
17836
|
return Array$1.flatten(found);
|
|
17835
17837
|
});
|
|
17836
17838
|
// src/features/check-version-downgrades/model/renovate-settings.ts
|
|
@@ -17841,7 +17843,7 @@ const AUTOMERGE_RULE = "renovate-platform-automerge";
|
|
|
17841
17843
|
const CAP_RULE = "renovate-version-cap";
|
|
17842
17844
|
const PRESET_RULE = "renovate-msch-preset";
|
|
17843
17845
|
const START$15 = 0;
|
|
17844
|
-
const READ_CONCURRENCY$
|
|
17846
|
+
const READ_CONCURRENCY$12 = 16;
|
|
17845
17847
|
const AUTOMERGE_MESSAGE = "sets `platformAutomerge: false`. Keep the platform's automerge on so passing updates merge without waiting for the next Renovate run.";
|
|
17846
17848
|
const CAP_MESSAGE = "caps a dependency below a version with `allowedVersions`. A cap holds the dependency on an old version, which is a downgrade that never ends: fix what breaks on the new version instead.";
|
|
17847
17849
|
const PRESET_MESSAGE = `does not extend \`${RENOVATE_PRESET}\`, so Renovate writes ranges that the \`version-range\` check rejects. Add it to \`extends\`.`;
|
|
@@ -17875,12 +17877,12 @@ const checkRenovateSettings = Effect.fn("checkRenovateSettings")(function* check
|
|
|
17875
17877
|
onNone: () => [],
|
|
17876
17878
|
onSome: (source) => problemsIn$8(file, source)
|
|
17877
17879
|
})));
|
|
17878
|
-
}, { concurrency: READ_CONCURRENCY$
|
|
17880
|
+
}, { concurrency: READ_CONCURRENCY$12 });
|
|
17879
17881
|
return Array$1.flatten(found);
|
|
17880
17882
|
});
|
|
17881
17883
|
// src/shared/lib/manifest-texts.ts
|
|
17882
17884
|
const MANIFEST$2 = /(?:^|\/)package\.json$/u;
|
|
17883
|
-
const READ_CONCURRENCY$
|
|
17885
|
+
const READ_CONCURRENCY$11 = 16;
|
|
17884
17886
|
/** @internal */
|
|
17885
17887
|
const manifestTexts = Effect.fn("manifestTexts")(function* manifestTexts(root) {
|
|
17886
17888
|
const files = yield* RepositoryFiles;
|
|
@@ -17889,7 +17891,7 @@ const manifestTexts = Effect.fn("manifestTexts")(function* manifestTexts(root) {
|
|
|
17889
17891
|
const read = yield* Effect.forEach(names, (file) => Effect.map(files.readFile(files.join(root, file)), Option.map((text) => ({
|
|
17890
17892
|
file,
|
|
17891
17893
|
text
|
|
17892
|
-
}))), { concurrency: READ_CONCURRENCY$
|
|
17894
|
+
}))), { concurrency: READ_CONCURRENCY$11 });
|
|
17893
17895
|
return Array$1.getSomes(read);
|
|
17894
17896
|
});
|
|
17895
17897
|
// src/features/check-version-downgrades/model/package-versions.ts
|
|
@@ -17897,8 +17899,8 @@ const RULE$23 = "unbumped-package";
|
|
|
17897
17899
|
const UNSHIPPED = /(?:\.test\.[\w.]+$|(?:^|\/)(?:fixtures|__tests__|tests?)\/|(?:^|\/)(?:AGENTS|CLAUDE|CHANGELOG)\.md$)/u;
|
|
17898
17900
|
const UNVERSIONED$5 = "0.0.0";
|
|
17899
17901
|
const FIRST_LINE$3 = 1;
|
|
17900
|
-
const FIRST_COLUMN$
|
|
17901
|
-
const READ_CONCURRENCY$
|
|
17902
|
+
const FIRST_COLUMN$4 = 1;
|
|
17903
|
+
const READ_CONCURRENCY$10 = 16;
|
|
17902
17904
|
const LAST_SEGMENT$1 = /[^/]*$/u;
|
|
17903
17905
|
const directoryOf$1 = (file) => String$1.replace(LAST_SEGMENT$1, "")(file);
|
|
17904
17906
|
const packageAt$1 = (file, text) => pipe(decodeVersionedPackageJson(text), Option.filter(({ private: hidden, version }) => hidden !== true && version !== UNVERSIONED$5), Option.map((manifest) => ({
|
|
@@ -17967,11 +17969,11 @@ const checkPackageVersions = Effect.fn("checkPackageVersions")(function* checkPa
|
|
|
17967
17969
|
return pipe(floor, Option.filter((lowest) => !semver.gt(pack.version, lowest)), Option.map((lowest) => ({
|
|
17968
17970
|
file: files.join(root, pack.file),
|
|
17969
17971
|
line: versionLine(pack.text),
|
|
17970
|
-
column: FIRST_COLUMN$
|
|
17972
|
+
column: FIRST_COLUMN$4,
|
|
17971
17973
|
rule: RULE$23,
|
|
17972
17974
|
message: message(pack, part, lowest)
|
|
17973
17975
|
})), Option.toArray);
|
|
17974
|
-
}), { concurrency: READ_CONCURRENCY$
|
|
17976
|
+
}), { concurrency: READ_CONCURRENCY$10 });
|
|
17975
17977
|
return Array$1.flatten(found);
|
|
17976
17978
|
});
|
|
17977
17979
|
// src/features/find-unneeded-files/model/applied-packages.ts
|
|
@@ -18186,7 +18188,7 @@ const TOOL_PATTERNS = [/^[ \t]*["']?(?:rust|rustup)["']?[ \t]*(?:=|[ \t]+\S)/gmu
|
|
|
18186
18188
|
const START$14 = 0;
|
|
18187
18189
|
const LAST_SEGMENT = 1;
|
|
18188
18190
|
const FIRST_LINE$2 = 1;
|
|
18189
|
-
const FIRST_COLUMN$
|
|
18191
|
+
const FIRST_COLUMN$3 = 1;
|
|
18190
18192
|
const WHOLE_MATCH = 0;
|
|
18191
18193
|
const FILE_RULE = "unneeded-file";
|
|
18192
18194
|
const SETUP_RULE = "unneeded-setup";
|
|
@@ -18198,7 +18200,7 @@ const cargoEnabled = (manifest) => pipe(decodeWorkspaceFile(manifest), Option.fl
|
|
|
18198
18200
|
const problemAtStart = (rule, message) => ({ file }) => ({
|
|
18199
18201
|
file,
|
|
18200
18202
|
line: FIRST_LINE$2,
|
|
18201
|
-
column: FIRST_COLUMN$
|
|
18203
|
+
column: FIRST_COLUMN$3,
|
|
18202
18204
|
rule,
|
|
18203
18205
|
message
|
|
18204
18206
|
});
|
|
@@ -18421,10 +18423,10 @@ const NUL = "\0";
|
|
|
18421
18423
|
const START$11 = 0;
|
|
18422
18424
|
const HEX = 16;
|
|
18423
18425
|
const CODE_POINT_WIDTH = 4;
|
|
18424
|
-
const READ_CONCURRENCY$
|
|
18426
|
+
const READ_CONCURRENCY$9 = 64;
|
|
18425
18427
|
const RULE$18 = "hidden-unicode";
|
|
18426
18428
|
const hexOf = (character) => pipe(String$1.codePointAt(START$11)(character), Option.getOrElse(() => START$11), (code) => code.toString(HEX), String$1.toUpperCase, String$1.padStart(CODE_POINT_WIDTH, "0"));
|
|
18427
|
-
const problemOf$
|
|
18429
|
+
const problemOf$3 = (file, source) => (found) => {
|
|
18428
18430
|
const hex = hexOf(found[START$11]);
|
|
18429
18431
|
return {
|
|
18430
18432
|
file,
|
|
@@ -18435,7 +18437,7 @@ const problemOf$2 = (file, source) => (found) => {
|
|
|
18435
18437
|
};
|
|
18436
18438
|
const problemsIn$6 = (file, source) => {
|
|
18437
18439
|
if (String$1.includes(NUL)(source)) return [];
|
|
18438
|
-
return pipe(Array$1.fromIterable(String$1.matchAll(HIDDEN)(source)), Array$1.map(problemOf$
|
|
18440
|
+
return pipe(Array$1.fromIterable(String$1.matchAll(HIDDEN)(source)), Array$1.map(problemOf$3(file, source)));
|
|
18439
18441
|
};
|
|
18440
18442
|
/** @internal */
|
|
18441
18443
|
const checkHiddenUnicode = Effect.fn("checkHiddenUnicode")(function* checkHiddenUnicode(root) {
|
|
@@ -18447,7 +18449,7 @@ const checkHiddenUnicode = Effect.fn("checkHiddenUnicode")(function* checkHidden
|
|
|
18447
18449
|
onNone: () => [],
|
|
18448
18450
|
onSome: (source) => problemsIn$6(file, source)
|
|
18449
18451
|
})));
|
|
18450
|
-
}, { concurrency: READ_CONCURRENCY$
|
|
18452
|
+
}, { concurrency: READ_CONCURRENCY$9 });
|
|
18451
18453
|
return Array$1.flatten(found);
|
|
18452
18454
|
});
|
|
18453
18455
|
// src/app/document-checks.ts
|
|
@@ -18541,14 +18543,14 @@ const RULE$15 = "pack-publint";
|
|
|
18541
18543
|
const CONFIG_FILE = "vite.config.ts";
|
|
18542
18544
|
const PACK_KEY = "pack:";
|
|
18543
18545
|
const START$9 = 0;
|
|
18544
|
-
const READ_CONCURRENCY$
|
|
18546
|
+
const READ_CONCURRENCY$8 = 16;
|
|
18545
18547
|
const EXCLUDED$2 = [":(exclude,attr:linguist-vendored)", ":(exclude,attr:linguist-generated)"];
|
|
18546
18548
|
const StrictPack = Schema.Struct({ publint: Schema.Struct({ strict: Schema.Literal(true) }) });
|
|
18547
18549
|
const isStrict = Schema.is(StrictPack);
|
|
18548
18550
|
const PackConfig = Schema.Struct({ pack: Schema.optional(Schema.Unknown) });
|
|
18549
18551
|
const decodePackConfig = Schema.decodeUnknownOption(PackConfig);
|
|
18550
|
-
const taggedError$
|
|
18551
|
-
var PackConfigUnreadable = class extends taggedError$
|
|
18552
|
+
const taggedError$5 = Schema.TaggedError;
|
|
18553
|
+
var PackConfigUnreadable = class extends taggedError$5()("PackConfigUnreadable", { file: Schema.String }) {};
|
|
18552
18554
|
const runsStrictPublint = (config) => pipe(decodePackConfig(config), Option.flatMap(({ pack }) => Option.fromUndefinedOr(pack)), Option.map((pack) => Array$1.ensure(pack)), Option.exists(Array$1.some(isStrict)));
|
|
18553
18555
|
const problemFor = (file, source) => ({
|
|
18554
18556
|
file,
|
|
@@ -18579,7 +18581,7 @@ const problemsIn$4 = Effect.fn("problemsIn")(function* problemsIn(root, manifest
|
|
|
18579
18581
|
/** @internal */
|
|
18580
18582
|
const checkPackSettings = Effect.fn("checkPackSettings")(function* checkPackSettings(root) {
|
|
18581
18583
|
const manifests = yield* (yield* RepositoryFiles).matchingFiles(root, [`:(glob)**/${PACKAGE_JSON_FILE}`, ...EXCLUDED$2]);
|
|
18582
|
-
const found = yield* Effect.forEach(manifests, (name) => problemsIn$4(root, name), { concurrency: READ_CONCURRENCY$
|
|
18584
|
+
const found = yield* Effect.forEach(manifests, (name) => problemsIn$4(root, name), { concurrency: READ_CONCURRENCY$8 });
|
|
18583
18585
|
return Array$1.flatten(found);
|
|
18584
18586
|
});
|
|
18585
18587
|
// src/features/check-published-manifest/model/package-homepage.ts
|
|
@@ -18758,7 +18760,7 @@ const checkWorkspaceDescriptions = Effect.fn("checkWorkspaceDescriptions")(funct
|
|
|
18758
18760
|
const RULE$9 = "plugin-layout";
|
|
18759
18761
|
const PLUGIN_FILE$2 = ".claude-plugin/plugin.json";
|
|
18760
18762
|
const MARKETPLACE_FILE$1 = ".claude-plugin/marketplace.json";
|
|
18761
|
-
const SKILL_FILE = "SKILL.md";
|
|
18763
|
+
const SKILL_FILE$1 = "SKILL.md";
|
|
18762
18764
|
const BIN_PREFIX = "bin/";
|
|
18763
18765
|
const SEPARATOR$5 = "/";
|
|
18764
18766
|
const MOST_FILES = 5e3;
|
|
@@ -18838,7 +18840,7 @@ const skillViolations = (skills) => {
|
|
|
18838
18840
|
Option.liftPredicate(`shares the name ${name} with another SKILL.md of the plugin.`, () => pipe(Record.get(counts, name), Option.exists((group) => group.length > SINGLE)))
|
|
18839
18841
|
], Array$1.getSomes, Array$1.map((message) => violation(file, message)))));
|
|
18840
18842
|
};
|
|
18841
|
-
const skillFilesOf = (plugin) => pipe(plugin.files, Array$1.filter((file) => file === SKILL_FILE || String$1.endsWith(`${SEPARATOR$5}${SKILL_FILE}`)(file)));
|
|
18843
|
+
const skillFilesOf = (plugin) => pipe(plugin.files, Array$1.filter((file) => file === SKILL_FILE$1 || String$1.endsWith(`${SEPARATOR$5}${SKILL_FILE$1}`)(file)));
|
|
18842
18844
|
const violationsOf = Effect.fn("violationsOf")(function* violationsOf(root, plugin, links) {
|
|
18843
18845
|
const prefix = `${(yield* RepositoryFiles).relative(root, plugin.directory)}${SEPARATOR$5}`;
|
|
18844
18846
|
const skills = yield* Effect.forEach(skillFilesOf(plugin), (file) => skillTextOf(plugin, file), { concurrency: CONCURRENCY$3 });
|
|
@@ -19452,7 +19454,7 @@ const isUnused = (condition) => condition.kind === "unused";
|
|
|
19452
19454
|
const USER_AGENT = `msch (${SELF_HOMEPAGE})`;
|
|
19453
19455
|
/** @internal */
|
|
19454
19456
|
const JSON_ACCEPT = "application/json";
|
|
19455
|
-
const requestOf = ({ url, token, accept }) => {
|
|
19457
|
+
const requestOf$1 = ({ url, token, accept }) => {
|
|
19456
19458
|
const request = HttpClientRequest.get(url).pipe(HttpClientRequest.setHeader("user-agent", USER_AGENT), HttpClientRequest.setHeader("accept", accept));
|
|
19457
19459
|
return Option.match(token, {
|
|
19458
19460
|
onNone: () => request,
|
|
@@ -19460,7 +19462,7 @@ const requestOf = ({ url, token, accept }) => {
|
|
|
19460
19462
|
});
|
|
19461
19463
|
};
|
|
19462
19464
|
/** @internal */
|
|
19463
|
-
const sent = (lookup) => HttpClient.HttpClient.pipe(Effect.flatMap((client) => client.execute(requestOf(lookup))));
|
|
19465
|
+
const sent = (lookup) => HttpClient.HttpClient.pipe(Effect.flatMap((client) => client.execute(requestOf$1(lookup))));
|
|
19464
19466
|
/** @internal */
|
|
19465
19467
|
const fetched = (lookup) => sent(lookup).pipe(Effect.flatMap(HttpClientResponse.filterStatusOk));
|
|
19466
19468
|
/** @internal */
|
|
@@ -19749,7 +19751,7 @@ const RULE$1 = "upstream-record";
|
|
|
19749
19751
|
const EXCLUDED = [":(exclude,attr:linguist-vendored)", ":(exclude,attr:linguist-generated)"];
|
|
19750
19752
|
const FIRST_INDEX = 0;
|
|
19751
19753
|
const LINE_OFFSET = 1;
|
|
19752
|
-
const FIRST_COLUMN$
|
|
19754
|
+
const FIRST_COLUMN$2 = 1;
|
|
19753
19755
|
/** @internal */
|
|
19754
19756
|
const VERDICTS$3 = [
|
|
19755
19757
|
"adopted",
|
|
@@ -19771,22 +19773,22 @@ const lineOf$1 = ({ source, key }) => {
|
|
|
19771
19773
|
const section = pipe(lines, Array$1.findFirstIndex(String$1.includes("\"upstream\"")), Option.getOrElse(() => FIRST_INDEX));
|
|
19772
19774
|
return section + pipe(lines, Array$1.drop(section), Array$1.findFirstIndex(String$1.includes(`"${key}"`)), Option.getOrElse(() => FIRST_INDEX)) + LINE_OFFSET;
|
|
19773
19775
|
};
|
|
19774
|
-
const problemOf$
|
|
19776
|
+
const problemOf$2 = (place, message) => ({
|
|
19775
19777
|
record: Option.none(),
|
|
19776
19778
|
problem: Option.some({
|
|
19777
19779
|
file: place.file,
|
|
19778
19780
|
line: lineOf$1(place),
|
|
19779
|
-
column: FIRST_COLUMN$
|
|
19781
|
+
column: FIRST_COLUMN$2,
|
|
19780
19782
|
rule: RULE$1,
|
|
19781
19783
|
message
|
|
19782
19784
|
})
|
|
19783
19785
|
});
|
|
19784
19786
|
const foundFrom = (place, value) => {
|
|
19785
19787
|
const upstream = parseSource(place.key);
|
|
19786
|
-
if (Option.isNone(upstream)) return problemOf$
|
|
19788
|
+
if (Option.isNone(upstream)) return problemOf$2(place, `The upstream \`${place.key}\` is not a source msch upstream can look up. ${REASON} Write ${SOURCE_GRAMMAR}.`);
|
|
19787
19789
|
const entry = decodeEntry(value);
|
|
19788
|
-
if (Option.isNone(entry)) return problemOf$
|
|
19789
|
-
if (semver.valid(entry.value.reviewed) !== entry.value.reviewed) return problemOf$
|
|
19790
|
+
if (Option.isNone(entry)) return problemOf$2(place, `The record of the upstream \`${describeSource(upstream.value)}\` is incomplete. ${REASON} ${SHAPE}.`);
|
|
19791
|
+
if (semver.valid(entry.value.reviewed) !== entry.value.reviewed) return problemOf$2(place, `\`reviewed\` of the upstream \`${place.key}\` is \`${entry.value.reviewed}\`, which is not a plain version such as \`1.7.12\`. Write the last upstream version whose changes were decided on, without a \`v\`.`);
|
|
19790
19792
|
return {
|
|
19791
19793
|
record: Option.some({
|
|
19792
19794
|
file: place.file,
|
|
@@ -19905,7 +19907,7 @@ const checkUpstream = Effect.fn("checkUpstream")(function* checkUpstream(root) {
|
|
|
19905
19907
|
return Array$1.flatten(found);
|
|
19906
19908
|
});
|
|
19907
19909
|
// src/features/check-surface-callers/model/caller-texts.ts
|
|
19908
|
-
const READ_CONCURRENCY$
|
|
19910
|
+
const READ_CONCURRENCY$7 = 64;
|
|
19909
19911
|
const SEPARATOR$4 = "/";
|
|
19910
19912
|
const UNTRACKED = /(?:^|\/)(?:node_modules|\.git)\//u;
|
|
19911
19913
|
const NOT_A_CALLER = /(?:^|\/)(?:README\.md|CHANGELOG\.md|pnpm-lock\.yaml|[^/]+\.test(?:\.support)?\.[cm]?[jt]sx?)$/u;
|
|
@@ -19916,7 +19918,7 @@ const readTexts = Effect.fn("readTexts")(function* readTexts(root, listed, label
|
|
|
19916
19918
|
const read = yield* Effect.forEach(pipe(listed, Array$1.filter(isCallerText)), (file) => files.readFile(files.join(root, file)).pipe(Effect.map(Option.map((text) => ({
|
|
19917
19919
|
file: label(file),
|
|
19918
19920
|
text
|
|
19919
|
-
})))), { concurrency: READ_CONCURRENCY$
|
|
19921
|
+
})))), { concurrency: READ_CONCURRENCY$7 });
|
|
19920
19922
|
return Array$1.getSomes(read);
|
|
19921
19923
|
});
|
|
19922
19924
|
/** @internal */
|
|
@@ -19934,7 +19936,7 @@ const textsUnder = Effect.fn("textsUnder")(function* textsUnder(directory, label
|
|
|
19934
19936
|
const EXPORT_RULE = "uncalled-export";
|
|
19935
19937
|
const COMMAND_RULE = "uncalled-command";
|
|
19936
19938
|
const FLAG_RULE = "uncalled-flag";
|
|
19937
|
-
const READ_CONCURRENCY$
|
|
19939
|
+
const READ_CONCURRENCY$6 = 64;
|
|
19938
19940
|
const SEPARATOR$3 = "/";
|
|
19939
19941
|
const START$2 = 0;
|
|
19940
19942
|
const ROOT_SUBPATH$1 = ".";
|
|
@@ -20019,7 +20021,7 @@ const surfaceProblems = Effect.fn("surfaceProblems")(function* surfaceProblems(r
|
|
|
20019
20021
|
const files = yield* RepositoryFiles;
|
|
20020
20022
|
const directories = yield* workspaceDirectories(root);
|
|
20021
20023
|
const corpus = [...yield* ownTexts(root), ...callers];
|
|
20022
|
-
const found = yield* Effect.forEach(directories, (directory) => workspaceOf$1(root, directory), { concurrency: READ_CONCURRENCY$
|
|
20024
|
+
const found = yield* Effect.forEach(directories, (directory) => workspaceOf$1(root, directory), { concurrency: READ_CONCURRENCY$6 });
|
|
20023
20025
|
const workspaces = pipe(Array$1.getSomes(found), Array$1.filter((workspace) => reachOf(workspace) === reach));
|
|
20024
20026
|
return [...pipe(workspaces, Array$1.flatMap(exportProblems(root, files.join, corpus))), ...pipe(workspaces, Array$1.flatMap(commandProblems(root, files.join, corpus)))];
|
|
20025
20027
|
});
|
|
@@ -20037,7 +20039,7 @@ const ROOT_DIRECTORY = "";
|
|
|
20037
20039
|
const TASK_SEPARATOR = "#";
|
|
20038
20040
|
const START$1 = 0;
|
|
20039
20041
|
const FIRST$1 = 1;
|
|
20040
|
-
const READ_CONCURRENCY$
|
|
20042
|
+
const READ_CONCURRENCY$5 = 8;
|
|
20041
20043
|
const LIBRARY_KINDS = [
|
|
20042
20044
|
"lib",
|
|
20043
20045
|
"rlib",
|
|
@@ -20099,7 +20101,7 @@ const taskLinks = Effect.fn("taskLinks")(function* taskLinks(root, members) {
|
|
|
20099
20101
|
const found = yield* Effect.forEach(sources, (from) => {
|
|
20100
20102
|
const toLinks = Array$1.flatMap(linksTo(members, from));
|
|
20101
20103
|
return taskTargets(root, from).pipe(Effect.map(toLinks));
|
|
20102
|
-
}, { concurrency: READ_CONCURRENCY$
|
|
20104
|
+
}, { concurrency: READ_CONCURRENCY$5 });
|
|
20103
20105
|
return Array$1.flatten(found);
|
|
20104
20106
|
});
|
|
20105
20107
|
/** @internal */
|
|
@@ -20116,7 +20118,7 @@ const checkUnusedWorkspaces = Effect.fn("checkUnusedWorkspaces")(function* check
|
|
|
20116
20118
|
directory,
|
|
20117
20119
|
crateLibraries: cargo.libraries,
|
|
20118
20120
|
deployed
|
|
20119
|
-
}), { concurrency: READ_CONCURRENCY$
|
|
20121
|
+
}), { concurrency: READ_CONCURRENCY$5 });
|
|
20120
20122
|
const members = Array$1.getSomes(found);
|
|
20121
20123
|
const tasks = yield* taskLinks(root, members);
|
|
20122
20124
|
const links = [
|
|
@@ -20215,6 +20217,455 @@ const runCli = (name) => (program) => {
|
|
|
20215
20217
|
services: nodeRepositoryFiles
|
|
20216
20218
|
})(program);
|
|
20217
20219
|
};
|
|
20220
|
+
// src/shared/lib/quote-line.ts
|
|
20221
|
+
const LINE_BREAK$2 = "\n";
|
|
20222
|
+
const START = 0;
|
|
20223
|
+
/** @internal */
|
|
20224
|
+
const lineOfQuote = ({ text, quote }) => {
|
|
20225
|
+
if (String$1.isEmpty(quote)) return Option.none();
|
|
20226
|
+
return pipe(String$1.indexOf(quote)(text), Option.map((index) => pipe(String$1.slice(START, index)(text), String$1.split(LINE_BREAK$2)).length));
|
|
20227
|
+
};
|
|
20228
|
+
// src/features/check-with-agents/model/answers.ts
|
|
20229
|
+
const HypothesisSchema = Schema.Struct({
|
|
20230
|
+
paths: Schema.Array(Schema.String),
|
|
20231
|
+
question: Schema.String
|
|
20232
|
+
});
|
|
20233
|
+
/** @internal */
|
|
20234
|
+
const Plan = Schema.Struct({ hypotheses: Schema.Array(HypothesisSchema) });
|
|
20235
|
+
const FindingSchema = Schema.Struct({
|
|
20236
|
+
file: Schema.String,
|
|
20237
|
+
quote: Schema.String,
|
|
20238
|
+
problem: Schema.String,
|
|
20239
|
+
evidence: Schema.String,
|
|
20240
|
+
fix: Schema.String,
|
|
20241
|
+
check: Schema.String
|
|
20242
|
+
});
|
|
20243
|
+
/** @internal */
|
|
20244
|
+
const Investigation = Schema.Struct({ findings: Schema.Array(FindingSchema) });
|
|
20245
|
+
/** @internal */
|
|
20246
|
+
const Rebuttal = Schema.Struct({
|
|
20247
|
+
upheld: Schema.Boolean,
|
|
20248
|
+
reason: Schema.String
|
|
20249
|
+
});
|
|
20250
|
+
// src/features/check-with-agents/model/prompts.ts
|
|
20251
|
+
const lines = (parts) => Array$1.join(parts, "\n");
|
|
20252
|
+
const listOf$1 = (names) => pipe(names, Array$1.map((name) => `- ${name}`), lines);
|
|
20253
|
+
const documentOf = ({ name, text }) => lines([
|
|
20254
|
+
`<file path="${name}">`,
|
|
20255
|
+
text,
|
|
20256
|
+
"</file>"
|
|
20257
|
+
]);
|
|
20258
|
+
const documentsOf = (documents) => pipe(documents, Array$1.map(documentOf), lines);
|
|
20259
|
+
const skillsOf = (skills) => pipe(skills, Array$1.map(({ name, description }) => `- ${name}: ${description}`), lines);
|
|
20260
|
+
const contextOf = (context) => lines([
|
|
20261
|
+
"The working directory is the root of a git repository. Read any file you need; git log, git show and git blame give its history.",
|
|
20262
|
+
"The index skill, which states the ideal state of the repository and which skills apply when:",
|
|
20263
|
+
documentsOf(context.indexSkills),
|
|
20264
|
+
"Instructions for agents:",
|
|
20265
|
+
documentsOf(context.agentDocs),
|
|
20266
|
+
"Skills the repository loads:",
|
|
20267
|
+
skillsOf(context.skills)
|
|
20268
|
+
]);
|
|
20269
|
+
const findingList = (findings) => pipe(findings, Array$1.map(({ file, problem }) => `- ${file}: ${problem}`), lines);
|
|
20270
|
+
const hypothesisList = (hypotheses) => pipe(hypotheses, Array$1.map(({ question }) => `- ${question}`), lines);
|
|
20271
|
+
/** @internal */
|
|
20272
|
+
const planPrompt = (input) => lines([
|
|
20273
|
+
"You plan an investigation of a repository by a team of agents. You do not investigate yourself.",
|
|
20274
|
+
contextOf(input.context),
|
|
20275
|
+
"Recent commits, newest first, each with the files it changed:",
|
|
20276
|
+
input.context.history,
|
|
20277
|
+
`Viewpoint: ${input.viewpoint.focus}`,
|
|
20278
|
+
"Questions already investigated:",
|
|
20279
|
+
hypothesisList(input.asked),
|
|
20280
|
+
"Problems already found:",
|
|
20281
|
+
findingList(input.found),
|
|
20282
|
+
"Read enough of the repository to know where problems may hide.",
|
|
20283
|
+
"Return every new question worth one investigator, each about one suspected problem under the viewpoint, with the paths the investigator should start from.",
|
|
20284
|
+
"Follow up on the problems already found: ask where the same cause shows up elsewhere and what made it possible.",
|
|
20285
|
+
"Do not repeat a question already investigated. Return no questions when nothing worth investigating is left."
|
|
20286
|
+
]);
|
|
20287
|
+
/** @internal */
|
|
20288
|
+
const investigatePrompt = (input) => lines([
|
|
20289
|
+
"You investigate one question about a repository.",
|
|
20290
|
+
contextOf(input.context),
|
|
20291
|
+
`Viewpoint: ${input.viewpoint.focus}`,
|
|
20292
|
+
`Question: ${input.hypothesis.question}`,
|
|
20293
|
+
"Start from:",
|
|
20294
|
+
listOf$1(input.hypothesis.paths),
|
|
20295
|
+
"Read the files and the history you need to answer it, and follow what you find beyond these paths.",
|
|
20296
|
+
"Return each problem you confirmed. file is the path from the repository root. quote is text copied exactly from that file that shows the problem, without paraphrase. evidence says what you read that proves it. fix says the change that removes the cause, not a patch on the symptom.",
|
|
20297
|
+
"check is the static check that would catch the problem from the files alone, in one sentence, when one can decide it with certainty. Leave check empty otherwise.",
|
|
20298
|
+
"Return no findings when the suspicion turned out wrong."
|
|
20299
|
+
]);
|
|
20300
|
+
/** @internal */
|
|
20301
|
+
const rebutPrompt = (input) => lines([
|
|
20302
|
+
"Another agent reported a problem in a repository. Try to refute it.",
|
|
20303
|
+
contextOf(input.context),
|
|
20304
|
+
`File: ${input.finding.file}`,
|
|
20305
|
+
`Quoted text: ${input.finding.quote}`,
|
|
20306
|
+
`Problem: ${input.finding.problem}`,
|
|
20307
|
+
`Evidence: ${input.finding.evidence}`,
|
|
20308
|
+
`Proposed fix: ${input.finding.fix}`,
|
|
20309
|
+
"Read the file, the rules it is measured against and anything that could justify it, such as a rule that allows it, a check that already catches it or a reason written next to it.",
|
|
20310
|
+
"Set upheld to false when the report is wrong, already handled or not worth changing, and true only when it survives every attempt. Give the reason in one sentence."
|
|
20311
|
+
]);
|
|
20312
|
+
// src/features/check-with-agents/model/step.ts
|
|
20313
|
+
const ATTEMPTS = 3;
|
|
20314
|
+
const taggedError$4 = Schema.TaggedError;
|
|
20315
|
+
/** @internal */
|
|
20316
|
+
var StepFailed = class extends taggedError$4()("StepFailed", { message: Schema.String }) {};
|
|
20317
|
+
const retryNote = (failures) => pipe(Array$1.last(failures), Option.match({
|
|
20318
|
+
onNone: () => "",
|
|
20319
|
+
onSome: (reason) => `\n\nYour previous answer was rejected: ${reason} Answer again and fix that.`
|
|
20320
|
+
}));
|
|
20321
|
+
const attempt = (setup, { step, failures }) => Effect.gen(function* attempting() {
|
|
20322
|
+
const output = yield* setup.query({
|
|
20323
|
+
...step.request,
|
|
20324
|
+
prompt: `${step.request.prompt}${retryNote(failures)}`,
|
|
20325
|
+
schema: Schema.toJsonSchemaDocument(step.answer).schema
|
|
20326
|
+
});
|
|
20327
|
+
const answer = yield* Schema.decodeUnknownEffect(step.answer)(output).pipe(Effect.mapError((issue) => `the answer does not match the schema: ${issue.message}`));
|
|
20328
|
+
return yield* step.verify(answer);
|
|
20329
|
+
});
|
|
20330
|
+
const attempts = (setup, step) => {
|
|
20331
|
+
const loop = (failures) => Effect.matchEffect(attempt(setup, {
|
|
20332
|
+
step,
|
|
20333
|
+
failures
|
|
20334
|
+
}), {
|
|
20335
|
+
onSuccess: (answer) => Effect.succeed({
|
|
20336
|
+
answer: Option.some(answer),
|
|
20337
|
+
failures
|
|
20338
|
+
}),
|
|
20339
|
+
onFailure: (error) => {
|
|
20340
|
+
const failed = [...failures, error];
|
|
20341
|
+
if (failed.length >= ATTEMPTS) return Effect.succeed({
|
|
20342
|
+
answer: Option.none(),
|
|
20343
|
+
failures: failed
|
|
20344
|
+
});
|
|
20345
|
+
return loop(failed);
|
|
20346
|
+
}
|
|
20347
|
+
});
|
|
20348
|
+
return loop(Array$1.empty());
|
|
20349
|
+
};
|
|
20350
|
+
const recordOf = (answer) => Schema.fromJsonString(Schema.Struct({
|
|
20351
|
+
prompt: Schema.String,
|
|
20352
|
+
failures: Schema.Array(Schema.String),
|
|
20353
|
+
answer: Schema.optional(answer)
|
|
20354
|
+
}));
|
|
20355
|
+
const stateFileOf = (setup, step) => Effect.gen(function* stateFile() {
|
|
20356
|
+
const files = yield* RepositoryFiles;
|
|
20357
|
+
const hash = yield* files.hash(step.request.prompt);
|
|
20358
|
+
const key = `${step.stage}-${hash}`;
|
|
20359
|
+
return {
|
|
20360
|
+
key,
|
|
20361
|
+
file: files.join(setup.stateDirectory, `${key}.json`)
|
|
20362
|
+
};
|
|
20363
|
+
});
|
|
20364
|
+
const savedAnswer = (file, record) => RepositoryFiles.pipe(Effect.flatMap((files) => files.readFile(file)), Effect.map((text) => pipe(text, Option.flatMap(Schema.decodeUnknownOption(record)), Option.flatMap(({ answer }) => Option.fromUndefinedOr(answer)))));
|
|
20365
|
+
const failedStep = (key, failures) => StepFailed.make({ message: `step ${key} failed ${String(ATTEMPTS)} times: ${Array$1.join(failures, " / ")}` });
|
|
20366
|
+
/** @internal */
|
|
20367
|
+
const runStep = Effect.fn("runStep")(function* running(setup, step) {
|
|
20368
|
+
const files = yield* RepositoryFiles;
|
|
20369
|
+
const record = recordOf(step.answer);
|
|
20370
|
+
const { key, file } = yield* stateFileOf(setup, step);
|
|
20371
|
+
const saved = yield* savedAnswer(file, record);
|
|
20372
|
+
if (Option.isSome(saved)) return saved.value;
|
|
20373
|
+
const { answer, failures } = yield* attempts(setup, step);
|
|
20374
|
+
const encoded = yield* Schema.encodeEffect(record)({
|
|
20375
|
+
prompt: step.request.prompt,
|
|
20376
|
+
failures,
|
|
20377
|
+
answer: Option.getOrUndefined(answer)
|
|
20378
|
+
}).pipe(Effect.orDie);
|
|
20379
|
+
yield* files.writeFile(file, encoded);
|
|
20380
|
+
return yield* Effect.fromOption(answer).pipe(Effect.mapError(() => failedStep(key, failures)));
|
|
20381
|
+
});
|
|
20382
|
+
// src/features/check-with-agents/model/swarm.ts
|
|
20383
|
+
const LEAD_MODEL = "claude-opus-5-5";
|
|
20384
|
+
const INVESTIGATOR_MODEL = "claude-sonnet-5-5";
|
|
20385
|
+
const MAX_TURNS = 200;
|
|
20386
|
+
const AGENT_CONCURRENCY$1 = 4;
|
|
20387
|
+
const SEQUENTIAL$2 = 1;
|
|
20388
|
+
const FIRST_COLUMN$1 = 1;
|
|
20389
|
+
const TOOLS = [
|
|
20390
|
+
"Read",
|
|
20391
|
+
"Grep",
|
|
20392
|
+
"Glob",
|
|
20393
|
+
"Bash"
|
|
20394
|
+
];
|
|
20395
|
+
const ALLOWED = [
|
|
20396
|
+
"Read",
|
|
20397
|
+
"Grep",
|
|
20398
|
+
"Glob",
|
|
20399
|
+
"Bash(git log:*)",
|
|
20400
|
+
"Bash(git show:*)",
|
|
20401
|
+
"Bash(git blame:*)"
|
|
20402
|
+
];
|
|
20403
|
+
const requestOf = (root, { prompt, model }) => ({
|
|
20404
|
+
directory: root,
|
|
20405
|
+
prompt,
|
|
20406
|
+
model,
|
|
20407
|
+
effort: "high",
|
|
20408
|
+
tools: TOOLS,
|
|
20409
|
+
allowed: ALLOWED,
|
|
20410
|
+
maxTurns: MAX_TURNS
|
|
20411
|
+
});
|
|
20412
|
+
const quotedLine = (root) => (finding) => Effect.gen(function* locating() {
|
|
20413
|
+
const files = yield* RepositoryFiles;
|
|
20414
|
+
const text = yield* files.readFile(files.join(root, finding.file));
|
|
20415
|
+
return pipe(text, Option.flatMap((source) => lineOfQuote({
|
|
20416
|
+
text: source,
|
|
20417
|
+
quote: finding.quote
|
|
20418
|
+
})));
|
|
20419
|
+
});
|
|
20420
|
+
const verifyQuotes = (root) => (answer) => Effect.gen(function* verifying() {
|
|
20421
|
+
const lines = yield* Effect.forEach(answer.findings, quotedLine(root), { concurrency: SEQUENTIAL$2 });
|
|
20422
|
+
const missing = pipe(Array$1.zip(answer.findings, lines), Array$1.filter(([, line]) => Option.isNone(line)), Array$1.map(([{ file }]) => file));
|
|
20423
|
+
if (Array$1.isReadonlyArrayNonEmpty(missing)) return yield* Effect.fail(`the quoted text is not in ${Array$1.join(missing, ", ")}. Copy quote exactly from the file, and give file as the path from the repository root.`);
|
|
20424
|
+
return answer;
|
|
20425
|
+
});
|
|
20426
|
+
const accept = (answer) => Effect.succeed(answer);
|
|
20427
|
+
const plan$1 = (setup, input) => runStep(setup.step, {
|
|
20428
|
+
stage: `${input.viewpoint.id}-plan`,
|
|
20429
|
+
request: requestOf(setup.root, {
|
|
20430
|
+
prompt: planPrompt({
|
|
20431
|
+
context: setup.context,
|
|
20432
|
+
...input
|
|
20433
|
+
}),
|
|
20434
|
+
model: LEAD_MODEL
|
|
20435
|
+
}),
|
|
20436
|
+
answer: Plan,
|
|
20437
|
+
verify: accept
|
|
20438
|
+
});
|
|
20439
|
+
const investigate = (setup, viewpoint) => (hypothesis) => runStep(setup.step, {
|
|
20440
|
+
stage: `${viewpoint.id}-investigate`,
|
|
20441
|
+
request: requestOf(setup.root, {
|
|
20442
|
+
prompt: investigatePrompt({
|
|
20443
|
+
context: setup.context,
|
|
20444
|
+
viewpoint,
|
|
20445
|
+
hypothesis
|
|
20446
|
+
}),
|
|
20447
|
+
model: INVESTIGATOR_MODEL
|
|
20448
|
+
}),
|
|
20449
|
+
answer: Investigation,
|
|
20450
|
+
verify: verifyQuotes(setup.root)
|
|
20451
|
+
});
|
|
20452
|
+
const survives = (setup, viewpoint) => (finding) => runStep(setup.step, {
|
|
20453
|
+
stage: `${viewpoint.id}-rebut`,
|
|
20454
|
+
request: requestOf(setup.root, {
|
|
20455
|
+
prompt: rebutPrompt({
|
|
20456
|
+
context: setup.context,
|
|
20457
|
+
finding
|
|
20458
|
+
}),
|
|
20459
|
+
model: LEAD_MODEL
|
|
20460
|
+
}),
|
|
20461
|
+
answer: Rebuttal,
|
|
20462
|
+
verify: accept
|
|
20463
|
+
}).pipe(Effect.map(({ upheld }) => upheld));
|
|
20464
|
+
const findingKey = ({ file, quote }) => `${file}\0${quote}`;
|
|
20465
|
+
const newQuestions = (planned, asked) => pipe(planned, Array$1.filter((hypothesis) => !pipe(asked, Array$1.some(({ question }) => question === hypothesis.question))));
|
|
20466
|
+
const newFindings = (investigations, found) => {
|
|
20467
|
+
const known = new Set(pipe(found, Array$1.map(findingKey)));
|
|
20468
|
+
return pipe(investigations, Array$1.flatMap(({ findings }) => findings), Array$1.dedupeWith((left, right) => findingKey(left) === findingKey(right)), Array$1.filter((finding) => !known.has(findingKey(finding))));
|
|
20469
|
+
};
|
|
20470
|
+
const nextRound = (setup, viewpoint) => ({ asked, found }) => Effect.gen(function* rounding() {
|
|
20471
|
+
const planned = yield* plan$1(setup, {
|
|
20472
|
+
viewpoint,
|
|
20473
|
+
asked,
|
|
20474
|
+
found
|
|
20475
|
+
});
|
|
20476
|
+
const questions = newQuestions(planned.hypotheses, asked);
|
|
20477
|
+
if (Array$1.isReadonlyArrayEmpty(questions)) return found;
|
|
20478
|
+
const investigations = yield* Effect.forEach(questions, investigate(setup, viewpoint), { concurrency: AGENT_CONCURRENCY$1 });
|
|
20479
|
+
const upheld = yield* Effect.filter(newFindings(investigations, found), survives(setup, viewpoint), { concurrency: AGENT_CONCURRENCY$1 });
|
|
20480
|
+
if (Array$1.isReadonlyArrayEmpty(upheld)) return found;
|
|
20481
|
+
return yield* nextRound(setup, viewpoint)({
|
|
20482
|
+
asked: [...asked, ...questions],
|
|
20483
|
+
found: [...found, ...upheld]
|
|
20484
|
+
});
|
|
20485
|
+
});
|
|
20486
|
+
const messageOf = ({ problem, fix, check }) => pipe([
|
|
20487
|
+
problem,
|
|
20488
|
+
`Fix: ${fix}`,
|
|
20489
|
+
...pipe(Option.liftPredicate(check, String$1.isNonEmpty), Option.map((text) => `Static check: ${text}`), Option.toArray)
|
|
20490
|
+
], Array$1.join(" "));
|
|
20491
|
+
const problemOf$1 = (setup, viewpoint) => (finding) => Effect.gen(function* reporting() {
|
|
20492
|
+
const files = yield* RepositoryFiles;
|
|
20493
|
+
const line = yield* quotedLine(setup.root)(finding);
|
|
20494
|
+
return problemAtPosition(viewpoint.id)(files.join(setup.root, finding.file), {
|
|
20495
|
+
line: Option.getOrElse(line, () => FIRST_COLUMN$1),
|
|
20496
|
+
column: FIRST_COLUMN$1
|
|
20497
|
+
}, messageOf(finding));
|
|
20498
|
+
});
|
|
20499
|
+
/** @internal */
|
|
20500
|
+
const investigateViewpoint = (viewpoint) => (setup) => nextRound(setup, viewpoint)({
|
|
20501
|
+
asked: [],
|
|
20502
|
+
found: []
|
|
20503
|
+
}).pipe(Effect.flatMap((findings) => Effect.forEach(findings, problemOf$1(setup, viewpoint), { concurrency: SEQUENTIAL$2 })));
|
|
20504
|
+
// src/features/check-with-agents/model/agent-checks.ts
|
|
20505
|
+
/** @internal */
|
|
20506
|
+
const AGENT_CHECKS = pipe([
|
|
20507
|
+
{
|
|
20508
|
+
id: "ideal-gap",
|
|
20509
|
+
focus: "The gap between the repository and the ideal state its index skill and AGENTS.md describe: the state they aim for, their principles and the finished stack. Look past rule violations: a repository can pass every check and still be far from that state. When the foundation itself is wrong, say that the part should be rebuilt from scratch instead of patched."
|
|
20510
|
+
},
|
|
20511
|
+
{
|
|
20512
|
+
id: "unchecked-convention",
|
|
20513
|
+
focus: "Code, configuration, workflows and documents that break a rule written in AGENTS.md or in a skill the repository loads, where no check of the repository catches the break."
|
|
20514
|
+
},
|
|
20515
|
+
{
|
|
20516
|
+
id: "repeated-correction",
|
|
20517
|
+
focus: "Mistakes that the git history shows were corrected more than once, such as the same kind of fix, revert or rename in several commits, and that the code still allows. Also implicit state machines: steps that must happen in a fixed order or together, kept only by people remembering them."
|
|
20518
|
+
},
|
|
20519
|
+
{
|
|
20520
|
+
id: "drifted-prose",
|
|
20521
|
+
focus: "Documents and skills whose structure drifted through additions: the same rule stated in two places, statements that contradict each other or the code, descriptions of code that no longer exists, and text that restates what the code already shows."
|
|
20522
|
+
},
|
|
20523
|
+
{
|
|
20524
|
+
id: "mechanizable-rule",
|
|
20525
|
+
focus: "Rules written as prose in AGENTS.md or skills that code could decide with certainty from the files of the repository, and checks written as one-off tests, scripts or workflow steps instead of in the repository's check tool."
|
|
20526
|
+
}
|
|
20527
|
+
], Array$1.map((viewpoint) => ({
|
|
20528
|
+
id: viewpoint.id,
|
|
20529
|
+
run: investigateViewpoint(viewpoint)
|
|
20530
|
+
})));
|
|
20531
|
+
const FAILED = "agent-check-failed";
|
|
20532
|
+
/** @internal */
|
|
20533
|
+
const runAgentCheck = (setup) => (check) => check.run(setup).pipe(Effect.catchTag("StepFailed", (failure) => Effect.succeed([problemInFile(FAILED)(setup.root, `${check.id} stopped: ${failure.message}. Run again to resume from the last finished step.`)])));
|
|
20534
|
+
// src/features/check-with-agents/model/context.ts
|
|
20535
|
+
const AGENT_DOC = /(?:^|\/)(?:AGENTS|CLAUDE)\.md$/u;
|
|
20536
|
+
const SKILL = /(?:^|\/)SKILL\.md$/u;
|
|
20537
|
+
const INSTALLED_SKILLS = ".agents/skills";
|
|
20538
|
+
const SKILL_FILE = "SKILL.md";
|
|
20539
|
+
const READ_CONCURRENCY$4 = 16;
|
|
20540
|
+
const installedSkills = (root) => Effect.gen(function* listing() {
|
|
20541
|
+
const files = yield* RepositoryFiles;
|
|
20542
|
+
const names = yield* files.readDirectory(files.join(root, INSTALLED_SKILLS));
|
|
20543
|
+
return pipe(names, Array$1.map((name) => `${INSTALLED_SKILLS}/${name}/${SKILL_FILE}`));
|
|
20544
|
+
});
|
|
20545
|
+
const readDocument = (root) => (name) => Effect.gen(function* reading() {
|
|
20546
|
+
const files = yield* RepositoryFiles;
|
|
20547
|
+
const text = yield* files.readFile(files.join(root, name));
|
|
20548
|
+
return pipe(text, Option.map((found) => ({
|
|
20549
|
+
name,
|
|
20550
|
+
text: found
|
|
20551
|
+
})));
|
|
20552
|
+
});
|
|
20553
|
+
const descriptionOf = (fields) => pipe(Option.fromUndefinedOr(fields["description"]), Option.filter(Predicate.isString), Option.getOrElse(() => ""));
|
|
20554
|
+
const summaryOf = ({ name, text }) => pipe(splitFrontmatter(text), Option.match({
|
|
20555
|
+
onNone: () => ({
|
|
20556
|
+
name,
|
|
20557
|
+
description: "",
|
|
20558
|
+
index: false
|
|
20559
|
+
}),
|
|
20560
|
+
onSome: (frontmatter) => ({
|
|
20561
|
+
name,
|
|
20562
|
+
description: descriptionOf(frontmatter.fields),
|
|
20563
|
+
index: isIndexSkill(frontmatter)
|
|
20564
|
+
})
|
|
20565
|
+
}));
|
|
20566
|
+
const readAll = (root, names) => Effect.forEach(names, readDocument(root), { concurrency: READ_CONCURRENCY$4 }).pipe(Effect.map(Array$1.getSomes));
|
|
20567
|
+
const matching = (pattern) => (names) => pipe(names, Array$1.filter((name) => pattern.test(name)));
|
|
20568
|
+
const indexSkillsOf = (documents, skills) => pipe(Array$1.zip(documents, skills), Array$1.filter(([, { index }]) => index), Array$1.map(([document]) => document));
|
|
20569
|
+
/** @internal */
|
|
20570
|
+
const repositoryContext = Effect.fn("repositoryContext")(function* gathering(root) {
|
|
20571
|
+
const files = yield* RepositoryFiles;
|
|
20572
|
+
const listed = yield* files.listedFiles(root);
|
|
20573
|
+
const installed = yield* installedSkills(root);
|
|
20574
|
+
const skillNames = pipe(matching(SKILL)(listed), Array$1.appendAll(installed), Array$1.dedupe, Array$1.sortBy(Order.String));
|
|
20575
|
+
const skillDocuments = yield* readAll(root, skillNames);
|
|
20576
|
+
const agentDocs = yield* readAll(root, matching(AGENT_DOC)(listed));
|
|
20577
|
+
const skills = pipe(skillDocuments, Array$1.map(summaryOf));
|
|
20578
|
+
const history = yield* files.history(root);
|
|
20579
|
+
return {
|
|
20580
|
+
agentDocs,
|
|
20581
|
+
indexSkills: indexSkillsOf(skillDocuments, skills),
|
|
20582
|
+
skills,
|
|
20583
|
+
history
|
|
20584
|
+
};
|
|
20585
|
+
});
|
|
20586
|
+
// src/features/check-with-agents/model/check-with-agents.ts
|
|
20587
|
+
const SEQUENTIAL$1 = 1;
|
|
20588
|
+
/** @internal */
|
|
20589
|
+
const checkWithAgents = Effect.fn("checkWithAgents")(function* checkWithAgents(root, { query, stateDirectory, checks = AGENT_CHECKS }) {
|
|
20590
|
+
const files = yield* RepositoryFiles;
|
|
20591
|
+
const setup = {
|
|
20592
|
+
root,
|
|
20593
|
+
context: yield* repositoryContext(root),
|
|
20594
|
+
step: {
|
|
20595
|
+
query,
|
|
20596
|
+
stateDirectory: files.resolve(stateDirectory)
|
|
20597
|
+
}
|
|
20598
|
+
};
|
|
20599
|
+
const found = yield* Effect.forEach(checks, runAgentCheck(setup), { concurrency: SEQUENTIAL$1 });
|
|
20600
|
+
return pipe(found, Array$1.flatten);
|
|
20601
|
+
});
|
|
20602
|
+
// src/shared/lib/agent-query.ts
|
|
20603
|
+
const SDK = "@anthropic-ai/claude-agent-sdk";
|
|
20604
|
+
const ResultMessage = Schema.Struct({
|
|
20605
|
+
type: Schema.Literal("result"),
|
|
20606
|
+
subtype: Schema.String,
|
|
20607
|
+
is_error: Schema.Boolean,
|
|
20608
|
+
structured_output: Schema.optional(Schema.Unknown)
|
|
20609
|
+
});
|
|
20610
|
+
const isResult = Schema.is(ResultMessage);
|
|
20611
|
+
const reasonOf$2 = (failure) => {
|
|
20612
|
+
if (failure instanceof Error) return failure.message;
|
|
20613
|
+
return String(failure);
|
|
20614
|
+
};
|
|
20615
|
+
const loadSdk = Effect.tryPromise({
|
|
20616
|
+
try: () => import("@anthropic-ai/claude-agent-sdk"),
|
|
20617
|
+
catch: () => `${SDK} is not installed. Add it to the devDependencies of the repository root to run agents.`
|
|
20618
|
+
});
|
|
20619
|
+
const answerOf = (message) => {
|
|
20620
|
+
if (message.is_error || message.subtype !== "success") return Effect.fail(`the agent ended with ${message.subtype}`);
|
|
20621
|
+
return Effect.fromOption(Option.fromUndefinedOr(message.structured_output)).pipe(Effect.mapError(() => "the agent returned no structured output"));
|
|
20622
|
+
};
|
|
20623
|
+
const lastResult = (messages) => pipe(Stream.fromAsyncIterable(messages, reasonOf$2), Stream.filter(isResult), Stream.runLast);
|
|
20624
|
+
/** @internal */
|
|
20625
|
+
const sdkAgentQuery = Effect.fn("sdkAgentQuery")(function* querying(request) {
|
|
20626
|
+
const messages = (yield* loadSdk).query({
|
|
20627
|
+
prompt: request.prompt,
|
|
20628
|
+
options: {
|
|
20629
|
+
cwd: request.directory,
|
|
20630
|
+
model: request.model,
|
|
20631
|
+
effort: request.effort,
|
|
20632
|
+
tools: [...request.tools],
|
|
20633
|
+
allowedTools: [...request.allowed],
|
|
20634
|
+
permissionMode: "dontAsk",
|
|
20635
|
+
settingSources: [],
|
|
20636
|
+
mcpServers: {},
|
|
20637
|
+
strictMcpConfig: true,
|
|
20638
|
+
persistSession: false,
|
|
20639
|
+
maxTurns: request.maxTurns,
|
|
20640
|
+
outputFormat: {
|
|
20641
|
+
type: "json_schema",
|
|
20642
|
+
schema: { ...request.schema }
|
|
20643
|
+
}
|
|
20644
|
+
}
|
|
20645
|
+
});
|
|
20646
|
+
const result = yield* lastResult(messages);
|
|
20647
|
+
const message = yield* Effect.fromOption(result).pipe(Effect.mapError(() => "the agent ended without a result"));
|
|
20648
|
+
return yield* answerOf(message);
|
|
20649
|
+
});
|
|
20650
|
+
// src/app/agents-command.ts
|
|
20651
|
+
const agents = Effect.fn("agents")(function* investigating(input) {
|
|
20652
|
+
const root = (yield* RepositoryFiles).resolve(".");
|
|
20653
|
+
const found = yield* checkWithAgents(root, {
|
|
20654
|
+
query: sdkAgentQuery,
|
|
20655
|
+
stateDirectory: input.stateDirectory
|
|
20656
|
+
});
|
|
20657
|
+
const problems = sortProblems(found);
|
|
20658
|
+
yield* reportProblems(root, {
|
|
20659
|
+
problems,
|
|
20660
|
+
json: input.json
|
|
20661
|
+
});
|
|
20662
|
+
return yield* failWhenAny(problems.length);
|
|
20663
|
+
});
|
|
20664
|
+
/** @internal */
|
|
20665
|
+
const agentsCommand = Command.make("agents", {
|
|
20666
|
+
stateDirectory: Argument.String("state-directory").pipe(Argument.withDescription("The directory that keeps each finished step, so a rerun resumes from it")),
|
|
20667
|
+
json: jsonFlag
|
|
20668
|
+
}, agents).pipe(Command.withDescription("Has a swarm of agents plan, investigate and refute what the repository's rules and history miss"));
|
|
20218
20669
|
// src/features/publish-workspace/model/export-targets.ts
|
|
20219
20670
|
const PATTERN = "*";
|
|
20220
20671
|
const taggedError$3 = Schema.TaggedError;
|
|
@@ -20851,7 +21302,7 @@ const checkCompat = Effect.fn("publish.compat")(function* checkCompat(directory)
|
|
|
20851
21302
|
// src/features/publish-workspace/model/consumer-build.ts
|
|
20852
21303
|
const PNPMFILE = ".pnpmfile.cjs";
|
|
20853
21304
|
const TASK = "msch";
|
|
20854
|
-
const SUCCESS$
|
|
21305
|
+
const SUCCESS$4 = 0;
|
|
20855
21306
|
const TARBALLS_ENV = "MSCH_CONSUMER_TARBALLS";
|
|
20856
21307
|
const TaskGraph$1 = Schema.Struct({ tasks: Schema.Record(Schema.String, Schema.Unknown) }).pipe(Schema.fromJsonString);
|
|
20857
21308
|
const Tarballed = Schema.Struct({
|
|
@@ -20931,7 +21382,7 @@ const brokenReason = Effect.fn("consumers.reason")(function* brokenReason(direct
|
|
|
20931
21382
|
cwd: directory
|
|
20932
21383
|
});
|
|
20933
21384
|
const after = yield* stateOf(directory);
|
|
20934
|
-
if (code !== SUCCESS$
|
|
21385
|
+
if (code !== SUCCESS$4) return Option.some(`vp run ${TASK} exited with ${String(code)}:\n${tailOf(output)}`);
|
|
20935
21386
|
return Option.liftPredicate(after, (state) => state !== before).pipe(Option.map((state) => `vp run ${TASK} rewrote files:\n${state}`));
|
|
20936
21387
|
});
|
|
20937
21388
|
const install = (directory, options) => mustSucceed({
|
|
@@ -21021,7 +21472,7 @@ const checkConsumer = Effect.fn("consumers.check")(function* checkConsumer(check
|
|
|
21021
21472
|
}, Effect.scoped);
|
|
21022
21473
|
// src/features/publish-workspace/model/consumer-repositories.ts
|
|
21023
21474
|
const GH = "gh";
|
|
21024
|
-
const SUCCESS$
|
|
21475
|
+
const SUCCESS$3 = 0;
|
|
21025
21476
|
const READ_RAW = "Accept: application/vnd.github.raw+json";
|
|
21026
21477
|
const MANIFESTS = ["package.json", "pnpm-workspace.yaml"];
|
|
21027
21478
|
const REMOTE$1 = /[:/](?<owner>[^/:]+)\/(?<name>[^/]+?)(?:\.git)?$/u;
|
|
@@ -21053,7 +21504,7 @@ const apiOutput = (args, token) => finished({
|
|
|
21053
21504
|
command: GH,
|
|
21054
21505
|
args: ["api", ...args],
|
|
21055
21506
|
env: envOf(token)
|
|
21056
|
-
}).pipe(Effect.map(({ output, code }) => pipe(Option.some(output), Option.filter(() => code === SUCCESS$
|
|
21507
|
+
}).pipe(Effect.map(({ output, code }) => pipe(Option.some(output), Option.filter(() => code === SUCCESS$3))));
|
|
21057
21508
|
const listing = (path, expression, token) => apiOutput([
|
|
21058
21509
|
"--paginate",
|
|
21059
21510
|
path,
|
|
@@ -21757,7 +22208,7 @@ const publishRelease = Effect.fn("publish.release")(function* publishRelease(dir
|
|
|
21757
22208
|
});
|
|
21758
22209
|
});
|
|
21759
22210
|
// src/app/callers-command.ts
|
|
21760
|
-
const SUCCESS$
|
|
22211
|
+
const SUCCESS$2 = 0;
|
|
21761
22212
|
const REMOTE = "git";
|
|
21762
22213
|
const REMOTE_ARGS = [
|
|
21763
22214
|
"remote",
|
|
@@ -21787,7 +22238,7 @@ const textsOf = Effect.fn("textsOf")(function* textsOf(fullName) {
|
|
|
21787
22238
|
fullName,
|
|
21788
22239
|
directory
|
|
21789
22240
|
]
|
|
21790
|
-
})).code !== SUCCESS$
|
|
22241
|
+
})).code !== SUCCESS$2) return yield* RepositoriesUnlisted.make({ message: `${fullName} could not be downloaded` });
|
|
21791
22242
|
return yield* textsUnder(directory, fullName);
|
|
21792
22243
|
}, Effect.scoped);
|
|
21793
22244
|
const otherTexts = Effect.fn("otherTexts")(function* otherTexts() {
|
|
@@ -21946,7 +22397,7 @@ const unitsOf = Effect.fn("unitsOf")(function* unitsOf(root) {
|
|
|
21946
22397
|
return [yield* rootUnit(listing, shared), ...units];
|
|
21947
22398
|
});
|
|
21948
22399
|
// src/features/run-changed/model/run.ts
|
|
21949
|
-
const SUCCESS$
|
|
22400
|
+
const SUCCESS$1 = 0;
|
|
21950
22401
|
const LIST_SEPARATOR = ", ";
|
|
21951
22402
|
const ARGUMENT_SEPARATOR = " ";
|
|
21952
22403
|
const EVERYTHING = "everything";
|
|
@@ -21983,14 +22434,14 @@ const ranBatch = Effect.fn("ranBatch")(function* ranBatch(plan, batch) {
|
|
|
21983
22434
|
const code = yield* exitCodeOf(plan.root, [...plan.command, ...pathsOf(plan.units, batch)]);
|
|
21984
22435
|
const records = yield* recordsOf(plan.root, plan.command);
|
|
21985
22436
|
const keys = keysAfter(plan, records, batch);
|
|
21986
|
-
yield* Effect.when(keepOnly(records, keys), Effect.succeed(code === SUCCESS$
|
|
22437
|
+
yield* Effect.when(keepOnly(records, keys), Effect.succeed(code === SUCCESS$1));
|
|
21987
22438
|
return code;
|
|
21988
22439
|
});
|
|
21989
22440
|
const ran = Effect.fn("ran")(function* ran(plan, batchSources) {
|
|
21990
22441
|
const batches = batchesOf(plan.changed, batchSources);
|
|
21991
22442
|
yield* Effect.when(report(`${String(batches.length)} batches of at most ${String(batchSources)} source files`), Effect.succeed(batches.length > SINGLE_BATCH));
|
|
21992
22443
|
const codes = yield* Effect.forEach(batches, (batch) => ranBatch(plan, batch), { concurrency: 1 });
|
|
21993
|
-
return pipe(codes, Array$1.findFirst((code) => code !== SUCCESS$
|
|
22444
|
+
return pipe(codes, Array$1.findFirst((code) => code !== SUCCESS$1), Option.getOrElse(() => SUCCESS$1));
|
|
21994
22445
|
});
|
|
21995
22446
|
/** @internal */
|
|
21996
22447
|
const runChanged = Effect.fn("runChanged")(function* runChanged(root, { command, batchSources }) {
|
|
@@ -22000,7 +22451,7 @@ const runChanged = Effect.fn("runChanged")(function* runChanged(root, { command,
|
|
|
22000
22451
|
const since = `since \`${Array$1.join(command, ARGUMENT_SEPARATOR)}\` last passed`;
|
|
22001
22452
|
if (!Array$1.isReadonlyArrayNonEmpty(changed)) {
|
|
22002
22453
|
yield* report(`nothing changed ${since}`);
|
|
22003
|
-
return SUCCESS$
|
|
22454
|
+
return SUCCESS$1;
|
|
22004
22455
|
}
|
|
22005
22456
|
yield* report(`${String(changed.length)} of ${String(units.length)} changed ${since}: ${namesOf(units, changed)}`);
|
|
22006
22457
|
return yield* ran({
|
|
@@ -22011,7 +22462,7 @@ const runChanged = Effect.fn("runChanged")(function* runChanged(root, { command,
|
|
|
22011
22462
|
}, batchSources);
|
|
22012
22463
|
});
|
|
22013
22464
|
// src/app/changed-command.ts
|
|
22014
|
-
const SUCCESS
|
|
22465
|
+
const SUCCESS = 0;
|
|
22015
22466
|
const ONE_FAILURE$1 = 1;
|
|
22016
22467
|
const NO_LIMIT = Number.POSITIVE_INFINITY;
|
|
22017
22468
|
const atLeastOne = Schema.isGreaterThanOrEqualTo(1);
|
|
@@ -22021,7 +22472,7 @@ const changed = Effect.fn("changed")(function* changed(input) {
|
|
|
22021
22472
|
if ((yield* runChanged(files.resolve("."), {
|
|
22022
22473
|
batchSources: input.batchSources,
|
|
22023
22474
|
command: [input.program, ...input.rest]
|
|
22024
|
-
})) !== SUCCESS
|
|
22475
|
+
})) !== SUCCESS) return yield* ProblemsFound.make({ count: ONE_FAILURE$1 });
|
|
22025
22476
|
return yield* Effect.void;
|
|
22026
22477
|
});
|
|
22027
22478
|
/** @internal */
|
|
@@ -22037,14 +22488,14 @@ const byPlace = Order.Struct({
|
|
|
22037
22488
|
file: Order.String,
|
|
22038
22489
|
line: Order.Number
|
|
22039
22490
|
});
|
|
22040
|
-
const textOf
|
|
22491
|
+
const textOf = (row, describe) => (json, rows) => {
|
|
22041
22492
|
if (json) return Schema.encodeEffect(row.pipe(Schema.Array, Schema.fromJsonString))(rows);
|
|
22042
22493
|
return Effect.succeed(pipe(rows, Array$1.map((found) => `${describe(found)}${LINE_BREAK$1}`), Array$1.join("")));
|
|
22043
22494
|
};
|
|
22044
22495
|
/** @internal */
|
|
22045
22496
|
const lookupReport = ({ row, rows, describe }) => (json) => Effect.gen(function* report() {
|
|
22046
22497
|
const found = yield* rows((yield* RepositoryFiles).resolve("."));
|
|
22047
|
-
const text = yield* textOf
|
|
22498
|
+
const text = yield* textOf(row, describe)(json, Array$1.sort(found, byPlace));
|
|
22048
22499
|
yield* writeStdout(text);
|
|
22049
22500
|
if (found.length > NONE_FOUND) return yield* ProblemsFound.make({ count: found.length });
|
|
22050
22501
|
return NONE_FOUND;
|
|
@@ -22111,7 +22562,6 @@ const promptOf = ({ rule, target, context }) => pipe([
|
|
|
22111
22562
|
// src/features/judge-documents/model/verdict.ts
|
|
22112
22563
|
const LINE_BREAK = "\n";
|
|
22113
22564
|
const FIRST_LINE$1 = 1;
|
|
22114
|
-
const START = 0;
|
|
22115
22565
|
const Violation = Schema.Struct({
|
|
22116
22566
|
status: Schema.Literal("violation"),
|
|
22117
22567
|
line: Schema.Int,
|
|
@@ -22133,49 +22583,17 @@ const unknownBecause = (reason) => ({
|
|
|
22133
22583
|
/** @internal */
|
|
22134
22584
|
const isDecided = (verdict) => verdict.status !== "unknown";
|
|
22135
22585
|
/** @internal */
|
|
22136
|
-
const lineOfQuote = ({ text, quote }) => {
|
|
22137
|
-
if (String$1.isEmpty(quote)) return Option.none();
|
|
22138
|
-
return pipe(String$1.indexOf(quote)(text), Option.map((index) => pipe(String$1.slice(START, index)(text), String$1.split(LINE_BREAK)).length));
|
|
22139
|
-
};
|
|
22140
|
-
/** @internal */
|
|
22141
22586
|
const textOfLine = ({ text, line }) => pipe(String$1.split(text, LINE_BREAK), Array$1.get(line - FIRST_LINE$1), Option.getOrElse(() => ""));
|
|
22142
22587
|
// src/features/judge-documents/model/agent-judge.ts
|
|
22143
22588
|
const AGENT_MODEL = "claude-sonnet-5-5";
|
|
22144
22589
|
const AGENT_EFFORT = "medium";
|
|
22145
|
-
const AGENT_TOOLS =
|
|
22146
|
-
|
|
22147
|
-
|
|
22148
|
-
|
|
22149
|
-
/** @internal */
|
|
22150
|
-
const CLAUDE = { command: ["claude"] };
|
|
22151
|
-
const ClaudeResult = Schema.Struct({
|
|
22152
|
-
is_error: Schema.Boolean,
|
|
22153
|
-
structured_output: Schema.optional(AgentAnswer)
|
|
22154
|
-
});
|
|
22155
|
-
const decodeResult = Schema.decodeUnknownEffect(Schema.fromJsonString(ClaudeResult));
|
|
22156
|
-
const encodeJson$1 = Schema.encodeEffect(Schema.fromJsonString(Schema.Unknown));
|
|
22157
|
-
const argsOf = (input, schema) => [
|
|
22158
|
-
"-p",
|
|
22159
|
-
promptOf(input),
|
|
22160
|
-
"--model",
|
|
22161
|
-
AGENT_MODEL,
|
|
22162
|
-
"--effort",
|
|
22163
|
-
AGENT_EFFORT,
|
|
22164
|
-
"--restricted",
|
|
22165
|
-
"--tools",
|
|
22166
|
-
AGENT_TOOLS,
|
|
22167
|
-
"--strict-mcp-config",
|
|
22168
|
-
"--disable-slash-commands",
|
|
22169
|
-
"--no-session-persistence",
|
|
22170
|
-
"--permission-mode",
|
|
22171
|
-
"dontAsk",
|
|
22172
|
-
"--permission-prompts",
|
|
22173
|
-
"none",
|
|
22174
|
-
"--output-format",
|
|
22175
|
-
"json",
|
|
22176
|
-
"--json-schema",
|
|
22177
|
-
schema
|
|
22590
|
+
const AGENT_TOOLS = [
|
|
22591
|
+
"Read",
|
|
22592
|
+
"Grep",
|
|
22593
|
+
"Glob"
|
|
22178
22594
|
];
|
|
22595
|
+
const AGENT_MAX_TURNS = 50;
|
|
22596
|
+
const AGENT_TIMEOUT = "10 minutes";
|
|
22179
22597
|
const sandboxOf = Effect.fn("sandboxOf")(function* sandboxOf(files) {
|
|
22180
22598
|
const fs = yield* FileSystem.FileSystem;
|
|
22181
22599
|
const path = yield* Path.Path;
|
|
@@ -22189,21 +22607,6 @@ const sandboxOf = Effect.fn("sandboxOf")(function* sandboxOf(files) {
|
|
|
22189
22607
|
});
|
|
22190
22608
|
return directory;
|
|
22191
22609
|
});
|
|
22192
|
-
const textOf = (stream) => stream.pipe(Stream.decodeText(), Stream.mkString);
|
|
22193
|
-
const runClaude = Effect.fn("runClaude")(function* runClaude(setup, call) {
|
|
22194
|
-
const [command, ...prefix] = setup.command;
|
|
22195
|
-
const handle = yield* ChildProcess.make(command, [...prefix, ...call.args], {
|
|
22196
|
-
cwd: call.directory,
|
|
22197
|
-
stdin: "ignore"
|
|
22198
|
-
});
|
|
22199
|
-
const [stdout, stderr, code] = yield* Effect.all([
|
|
22200
|
-
textOf(handle.stdout),
|
|
22201
|
-
textOf(handle.stderr),
|
|
22202
|
-
handle.exitCode
|
|
22203
|
-
], { concurrency: "unbounded" });
|
|
22204
|
-
if (Number(code) !== SUCCESS) return yield* Effect.fail(`claude exited with ${String(code)}: ${pipe(stderr, String$1.trim, String$1.takeRight(STDERR_TAIL))}`);
|
|
22205
|
-
return stdout;
|
|
22206
|
-
});
|
|
22207
22610
|
const verdictOf = (target, answer) => {
|
|
22208
22611
|
if (answer.verdict === "pass") return { status: "pass" };
|
|
22209
22612
|
if (answer.verdict === "unknown") return unknownBecause(answer.reason);
|
|
@@ -22220,17 +22623,19 @@ const verdictOf = (target, answer) => {
|
|
|
22220
22623
|
})
|
|
22221
22624
|
});
|
|
22222
22625
|
};
|
|
22223
|
-
const judgeIn = Effect.fn("agentJudge")(function*
|
|
22224
|
-
const
|
|
22225
|
-
|
|
22226
|
-
|
|
22227
|
-
|
|
22228
|
-
|
|
22626
|
+
const judgeIn = Effect.fn("agentJudge")(function* judging(query, input) {
|
|
22627
|
+
const output = yield* query({
|
|
22628
|
+
directory: yield* sandboxOf([input.target, ...input.context]),
|
|
22629
|
+
prompt: promptOf(input),
|
|
22630
|
+
schema: AGENT_SCHEMA,
|
|
22631
|
+
tools: AGENT_TOOLS,
|
|
22632
|
+
allowed: AGENT_TOOLS,
|
|
22633
|
+
model: AGENT_MODEL,
|
|
22634
|
+
effort: AGENT_EFFORT,
|
|
22635
|
+
maxTurns: AGENT_MAX_TURNS
|
|
22229
22636
|
});
|
|
22230
|
-
const
|
|
22231
|
-
|
|
22232
|
-
if (result.is_error || Option.isNone(answer)) return unknownBecause("claude returned no structured answer");
|
|
22233
|
-
return verdictOf(input.target, answer.value);
|
|
22637
|
+
const answer = yield* Schema.decodeUnknownEffect(AgentAnswer)(output);
|
|
22638
|
+
return verdictOf(input.target, answer);
|
|
22234
22639
|
});
|
|
22235
22640
|
const reasonOf$1 = (failure) => {
|
|
22236
22641
|
if (typeof failure === "string") return failure;
|
|
@@ -22238,12 +22643,12 @@ const reasonOf$1 = (failure) => {
|
|
|
22238
22643
|
return String(failure);
|
|
22239
22644
|
};
|
|
22240
22645
|
/** @internal */
|
|
22241
|
-
const agentJudge = (
|
|
22646
|
+
const agentJudge = (query) => ({
|
|
22242
22647
|
identity: {
|
|
22243
22648
|
model: AGENT_MODEL,
|
|
22244
22649
|
promptVersion: 1
|
|
22245
22650
|
},
|
|
22246
|
-
judge: (input) => judgeIn(
|
|
22651
|
+
judge: (input) => judgeIn(query, input).pipe(Effect.scoped, Effect.timeout(AGENT_TIMEOUT), Effect.match({
|
|
22247
22652
|
onSuccess: (verdict) => verdict,
|
|
22248
22653
|
onFailure: (failure) => unknownBecause(reasonOf$1(failure))
|
|
22249
22654
|
}))
|
|
@@ -22457,7 +22862,7 @@ const judge = Effect.fn("judge")(function* judge(input) {
|
|
|
22457
22862
|
cacheDirectory: files.resolve(input.cacheDirectory),
|
|
22458
22863
|
rules: JUDGE_RULES,
|
|
22459
22864
|
decision: DECISION_JUDGE,
|
|
22460
|
-
agent: agentJudge(
|
|
22865
|
+
agent: agentJudge(sdkAgentQuery)
|
|
22461
22866
|
});
|
|
22462
22867
|
const problems = sortProblems(found);
|
|
22463
22868
|
yield* reportProblems(root, {
|
|
@@ -22862,6 +23267,7 @@ const describeRow = (row) => `${row.file}:${String(row.line)} upstream ${row.ups
|
|
|
22862
23267
|
// src/app/subcommands.ts
|
|
22863
23268
|
/** @internal */
|
|
22864
23269
|
const SUBCOMMANDS = [
|
|
23270
|
+
agentsCommand,
|
|
22865
23271
|
callersCommand,
|
|
22866
23272
|
changedCommand,
|
|
22867
23273
|
exitsCommand,
|