@r_masseater/msch 0.100.0 → 0.101.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/cargo-inputs.mjs +2 -2
- package/dist/cli.mjs +695 -291
- package/dist/cli.mjs.map +1 -1
- package/dist/config.mjs +1 -1
- 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/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-DFPG7vgX.mjs} +2 -2
- package/dist/{published-O6THHxdC.mjs.map → published-DFPG7vgX.mjs.map} +1 -1
- 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-D0XVpjiD.mjs} +2 -2
- package/dist/repository-text-D0XVpjiD.mjs.map +1 -0
- package/dist/workspace-settings.mjs +3 -3
- package/package.json +9 -2
- package/skills/msch-checks/SKILL.md +9 -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 literalOf, C as workspaceManifest, D as definesTask, E as VERIFY_TASK, G as installedManifest, H as propertyValue, I as workspaceConfigOf, K as readManifest, L as KeySchema, O as hasVerifyTask, R as childrenOf$4, S as workspaceProjects, T as RUN_TASKS, U as stringsIn, V as nestedValues, W as dependencyEntries, _ as shadcnUiOf, a as workspaceConfigs, b as unmatchedWorkspacePatterns, c as publicEntriesOf, d as splitFrontmatter, h as deployEntries, i as publishedWorkspaces, l as isIndexSkill, m as bundledEntries, o as entryNameOf, p as workspaceLinks, q as workspaceDependencies$1, r as packedWorkspaces, s as isBinEntry, u as FRONTMATTER, x as workspaceDirectories, y as publishedProjects, z as keyName } from "./published-
|
|
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 literalOf, C as workspaceManifest, D as definesTask, E as VERIFY_TASK, G as installedManifest, H as propertyValue, I as workspaceConfigOf, K as readManifest, L as KeySchema, O as hasVerifyTask, R as childrenOf$4, S as workspaceProjects, T as RUN_TASKS, U as stringsIn, V as nestedValues, W as dependencyEntries, _ as shadcnUiOf, a as workspaceConfigs, b as unmatchedWorkspacePatterns, c as publicEntriesOf, d as splitFrontmatter, h as deployEntries, i as publishedWorkspaces, l as isIndexSkill, m as bundledEntries, o as entryNameOf, p as workspaceLinks, q as workspaceDependencies$1, r as packedWorkspaces, s as isBinEntry, u as FRONTMATTER, x as workspaceDirectories, y as publishedProjects, z as keyName } from "./published-DFPG7vgX.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
8
|
import { b as exempt, f as lint$3, h as decisionTestRules, n as MARKDOWN_RULES, t as MARKDOWN_IGNORES } from "./define-lint-preset-BnOZuTNT.mjs";
|
|
9
|
-
import { a as MSCH_TASK_COMMANDS, n as builtTextRuleNames, r as secretsOf, t as TEXT_IGNORES } from "./repository-text-
|
|
9
|
+
import { a as MSCH_TASK_COMMANDS, n as builtTextRuleNames, r as secretsOf, t as TEXT_IGNORES } from "./repository-text-D0XVpjiD.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.101.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) {
|
|
@@ -14916,9 +14916,9 @@ const MSCH_RELAXATIONS = [
|
|
|
14916
14916
|
const isList = (value) => Array$1.isArray(value);
|
|
14917
14917
|
const isSection = (value) => Predicate.isObject(value) && !Array$1.isArray(value);
|
|
14918
14918
|
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$
|
|
14919
|
+
const listOf$2 = (value) => pipe(Option.some(value), Option.filter(isList), Option.getOrElse(() => []));
|
|
14920
|
+
const severityOf = (value) => pipe(listOf$2(value), Array$1.head, Option.getOrElse(() => value));
|
|
14921
|
+
const hasOptions = (value) => Array$1.length(listOf$2(value)) > SEVERITY_ONLY;
|
|
14922
14922
|
const unless = (kept, weakening) => Array$1.filter([weakening], () => !kept);
|
|
14923
14923
|
const whenPresent = (what, weakeningsIn) => (value) => Option.match(Option.fromUndefinedOr(value), {
|
|
14924
14924
|
onNone: () => [{
|
|
@@ -14951,7 +14951,7 @@ const lintWeakenings = (enabledRules) => whenPresent("lint section, so the msch
|
|
|
14951
14951
|
anchor: "ignorePatterns",
|
|
14952
14952
|
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
14953
|
}),
|
|
14954
|
-
...pipe(listOf$
|
|
14954
|
+
...pipe(listOf$2(section["overrides"]), Array$1.flatMap(overrideWeakenings(enabledRules)))
|
|
14955
14955
|
]);
|
|
14956
14956
|
const isOff = (value) => value === false || pipe(Record.values(sectionOf(value)), Array$1.some(isOff));
|
|
14957
14957
|
const textRuleWeakenings = (expected) => (owner, rules) => [...pipe(expected.builtRuleNames, Array$1.filter((name) => !Record.has(rules, name)), Array$1.map((name) => ({
|
|
@@ -14967,7 +14967,7 @@ const textWeakenings = (expected) => whenPresent("textlint section, so the Japan
|
|
|
14967
14967
|
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
14968
|
}),
|
|
14969
14969
|
...textRuleWeakenings(expected)("textlint", sectionOf(section["rules"])),
|
|
14970
|
-
...pipe(listOf$
|
|
14970
|
+
...pipe(listOf$2(section["sources"]), Array$1.flatMap((source) => textRuleWeakenings(expected)("A textlint source", sectionOf(sectionOf(source)["rules"]))))
|
|
14971
14971
|
]);
|
|
14972
14972
|
const markdownWeakenings = (expected) => whenPresent("y8 section, so the Markdown checks do not run", (section) => [...unless(Equal.equals(section["ignores"], expected.ignores), {
|
|
14973
14973
|
anchor: "ignores",
|
|
@@ -14978,7 +14978,7 @@ const markdownWeakenings = (expected) => whenPresent("y8 section, so the Markdow
|
|
|
14978
14978
|
})]);
|
|
14979
14979
|
const taskWeakenings = (run, expected) => {
|
|
14980
14980
|
const tasks = sectionOf(sectionOf(run)["tasks"]);
|
|
14981
|
-
const dependsOn = listOf$
|
|
14981
|
+
const dependsOn = listOf$2(sectionOf(tasks["verify"])["dependsOn"]);
|
|
14982
14982
|
return [...pipe(Record.toEntries(expected.tasks), Array$1.filter(([name, command]) => !Equal.equals(sectionOf(tasks[name])["command"], command)), Array$1.map(([name]) => ({
|
|
14983
14983
|
anchor: "run",
|
|
14984
14984
|
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 +15005,8 @@ const CONFIG_FILE$5 = "vite.config.ts";
|
|
|
15005
15005
|
const START$24 = 0;
|
|
15006
15006
|
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
15007
|
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$
|
|
15008
|
+
const taggedError$10 = Schema.TaggedError;
|
|
15009
|
+
var DisabledRulesConfigUnreadable = class extends taggedError$10()("DisabledRulesConfigUnreadable", {
|
|
15010
15010
|
file: Schema.String,
|
|
15011
15011
|
reason: Schema.String
|
|
15012
15012
|
}) {};
|
|
@@ -15148,7 +15148,7 @@ const listedProblem = ({ file, line, column, names, reason }) => ({
|
|
|
15148
15148
|
rule: RULE$46,
|
|
15149
15149
|
message: `The names ${formatValues(names)} are listed by hand, but ${reason}`
|
|
15150
15150
|
});
|
|
15151
|
-
const problemOf$
|
|
15151
|
+
const problemOf$9 = ({ list, reason }) => listedProblem({
|
|
15152
15152
|
file: list.site.file,
|
|
15153
15153
|
line: list.site.line,
|
|
15154
15154
|
column: list.site.column,
|
|
@@ -15741,7 +15741,7 @@ const declaredNameProblem = ({ literals, relative }) => {
|
|
|
15741
15741
|
if (defined.length < mostNamesOf(list) || files.length < 2) return Option.none();
|
|
15742
15742
|
const names = pipe(defined, Array$1.map(([name]) => name));
|
|
15743
15743
|
const shown = pipe(files, Array$1.take(SHOWN_FILES), Array$1.map(relative), Array$1.join(", "));
|
|
15744
|
-
return Option.some(problemOf$
|
|
15744
|
+
return Option.some(problemOf$9({
|
|
15745
15745
|
list,
|
|
15746
15746
|
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
15747
|
}));
|
|
@@ -15774,11 +15774,11 @@ const listedPathProblem = (repository) => (list) => {
|
|
|
15774
15774
|
const paths = pipe(list.names, Array$1.map(namedPath(repository, list.site.file)), Array$1.getSomes);
|
|
15775
15775
|
const packages = pipe(list.names, Array$1.filter((name) => HashSet.has(repository.packages, name)));
|
|
15776
15776
|
const directory = enumeratedDirectory(repository)(paths);
|
|
15777
|
-
if (Option.isSome(directory)) return Option.some(problemOf$
|
|
15777
|
+
if (Option.isSome(directory)) return Option.some(problemOf$9({
|
|
15778
15778
|
list,
|
|
15779
15779
|
reason: `they enumerate the entries of ${directoryLabel(directory.value)}. Find them with a glob or derive them from the declaration that names them.`
|
|
15780
15780
|
}));
|
|
15781
|
-
if (packages.length >= 2) return Option.some(problemOf$
|
|
15781
|
+
if (packages.length >= 2) return Option.some(problemOf$9({
|
|
15782
15782
|
list,
|
|
15783
15783
|
reason: `${formatValues(packages)} are workspace packages. Derive them from the workspace manifests or from a property that each package declares.`
|
|
15784
15784
|
}));
|
|
@@ -15793,7 +15793,7 @@ const connected = (index) => (left, right) => left === right || imports$1(index)
|
|
|
15793
15793
|
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
15794
|
const subsetListProblem = ({ lists, literals, relative }) => {
|
|
15795
15795
|
const index = importIndexOf(literals);
|
|
15796
|
-
return (list) => pipe(lists, Array$1.findFirst(isPartOf(index, list)), Option.map((other) => problemOf$
|
|
15796
|
+
return (list) => pipe(lists, Array$1.findFirst(isPartOf(index, list)), Option.map((other) => problemOf$9({
|
|
15797
15797
|
list,
|
|
15798
15798
|
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
15799
|
})));
|
|
@@ -15938,7 +15938,7 @@ const checkRepository = Effect.fn("checkRepository")(function* checkRepository(r
|
|
|
15938
15938
|
// src/features/source-code/find-namespace-destructuring/model/namespace-destructuring.ts
|
|
15939
15939
|
const RULE$45 = "namespace-destructuring";
|
|
15940
15940
|
const LOCAL = /^[.#/]/u;
|
|
15941
|
-
const messageOf$
|
|
15941
|
+
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
15942
|
const isPackage = (specifier) => isStringLiteral(specifier) && !LOCAL.test(specifier.text);
|
|
15943
15943
|
const importedNames = (sourceFile) => {
|
|
15944
15944
|
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 +15951,13 @@ const destructuredName = (declaration) => {
|
|
|
15951
15951
|
if (declaration.name.kind !== SyntaxKind.ObjectBindingPattern) return Option.none();
|
|
15952
15952
|
return pipe(Option.fromUndefinedOr(declaration.initializer), Option.filter(isIdentifier), Option.map((initializer) => initializer.text));
|
|
15953
15953
|
};
|
|
15954
|
-
const problemOf$
|
|
15954
|
+
const problemOf$8 = (names) => (declaration) => pipe(destructuredName(declaration), Option.filter((name) => names.includes(name)), Option.map((name) => problemAt$7({
|
|
15955
15955
|
rule: RULE$45,
|
|
15956
|
-
message: messageOf$
|
|
15956
|
+
message: messageOf$2(name)
|
|
15957
15957
|
})), Option.map((report) => report(declaration)));
|
|
15958
15958
|
const namespaceDestructuringIn = () => (sourceFile) => {
|
|
15959
15959
|
const names = importedNames(sourceFile);
|
|
15960
|
-
return pipe(descendantsOf(sourceFile), Array$1.filter(isVariableDeclaration), Array$1.map(problemOf$
|
|
15960
|
+
return pipe(descendantsOf(sourceFile), Array$1.filter(isVariableDeclaration), Array$1.map(problemOf$8(names)), Array$1.getSomes);
|
|
15961
15961
|
};
|
|
15962
15962
|
// src/features/source-code/find-pass-through-wrappers/model/pass-through-wrappers.ts
|
|
15963
15963
|
const RULE$44 = "pass-through-wrapper";
|
|
@@ -15965,7 +15965,7 @@ const SINGLE_STATEMENT = 1;
|
|
|
15965
15965
|
const SINGLE_DECLARATION = 1;
|
|
15966
15966
|
const THIS_PARAMETER = "this";
|
|
15967
15967
|
const NO_ARGUMENTS = [];
|
|
15968
|
-
const messageOf = (callee) => `This function only passes its parameters to ${callee} unchanged. Call ${callee} directly and delete this function.`;
|
|
15968
|
+
const messageOf$1 = (callee) => `This function only passes its parameters to ${callee} unchanged. Call ${callee} directly and delete this function.`;
|
|
15969
15969
|
const unwrapped = (expression) => {
|
|
15970
15970
|
if (isParenthesizedExpression(expression)) return unwrapped(expression.expression);
|
|
15971
15971
|
return expression;
|
|
@@ -16054,14 +16054,14 @@ const isPassThrough = (checker) => (candidate) => (forward) => {
|
|
|
16054
16054
|
const restForwarded = pipe(wrapper.parameters, Array$1.some(isRest));
|
|
16055
16055
|
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
16056
|
};
|
|
16057
|
-
const problemOf$
|
|
16057
|
+
const problemOf$7 = (checker) => (candidate) => {
|
|
16058
16058
|
if (changesTheCall(candidate.wrapper)) return Option.none();
|
|
16059
16059
|
return pipe(returnedExpression(candidate.wrapper), Option.flatMap(forwardOf), Option.filter(isPassThrough(checker)(candidate)), Option.map((forward) => problemAt$7({
|
|
16060
16060
|
rule: RULE$44,
|
|
16061
|
-
message: messageOf(forward.callee.getText())
|
|
16061
|
+
message: messageOf$1(forward.callee.getText())
|
|
16062
16062
|
})(candidate.name)));
|
|
16063
16063
|
};
|
|
16064
|
-
const passThroughWrappersIn = (checker) => (sourceFile) => pipe(descendantsOf(sourceFile), Array$1.map(candidateOf), Array$1.getSomes, Array$1.map(problemOf$
|
|
16064
|
+
const passThroughWrappersIn = (checker) => (sourceFile) => pipe(descendantsOf(sourceFile), Array$1.map(candidateOf), Array$1.getSomes, Array$1.map(problemOf$7(checker)), Array$1.getSomes);
|
|
16065
16065
|
// src/app/source-checks.ts
|
|
16066
16066
|
/** @internal */
|
|
16067
16067
|
const checkSources = (root) => checkRepository(root, [passThroughWrappersIn, namespaceDestructuringIn]);
|
|
@@ -16132,7 +16132,7 @@ const PLUGIN_HOOKS_FILE = /(?:^|\/)hooks\/hooks\.json$/u;
|
|
|
16132
16132
|
const PROJECT_PATH = /(?<optional>--env-file-if-exists=)?\$\{?CLAUDE_PROJECT_DIR\}?(?:\\")?\/(?<path>[\w.@/-]+)/gu;
|
|
16133
16133
|
const PLUGIN_PATH = /(?<optional>--env-file-if-exists=)?\$\{?CLAUDE_PLUGIN_ROOT\}?(?:\\")?\/(?<path>[\w.@/-]+)/gu;
|
|
16134
16134
|
const PLUGIN_ROOT = "..";
|
|
16135
|
-
const READ_CONCURRENCY$
|
|
16135
|
+
const READ_CONCURRENCY$19 = 16;
|
|
16136
16136
|
const START$23 = 0;
|
|
16137
16137
|
const referenceOf$1 = (found) => pipe(groupOf("path")(found), Option.filter(() => Option.isNone(groupOf("optional")(found))), Option.map((path) => ({
|
|
16138
16138
|
path,
|
|
@@ -16175,11 +16175,11 @@ const checkMissingHooks = Effect.fn("checkMissingHooks")(function* checkMissingH
|
|
|
16175
16175
|
}];
|
|
16176
16176
|
return [];
|
|
16177
16177
|
}));
|
|
16178
|
-
const found = yield* Effect.forEach(hookFiles, problemsIn$14, { concurrency: READ_CONCURRENCY$
|
|
16178
|
+
const found = yield* Effect.forEach(hookFiles, problemsIn$14, { concurrency: READ_CONCURRENCY$19 });
|
|
16179
16179
|
return Array$1.flatten(found);
|
|
16180
16180
|
});
|
|
16181
16181
|
// src/features/check-documented-commands/model/task-graph.ts
|
|
16182
|
-
const SUCCESS$
|
|
16182
|
+
const SUCCESS$5 = 0;
|
|
16183
16183
|
const PackageSchema = Schema.Struct({ name: Schema.optional(Schema.String) });
|
|
16184
16184
|
const TaskSchema = Schema.Struct({
|
|
16185
16185
|
package: Schema.String,
|
|
@@ -16200,7 +16200,7 @@ const listedTasks = Effect.fn("listedTasks")(function* listedTasks(root) {
|
|
|
16200
16200
|
});
|
|
16201
16201
|
const text = yield* handle.stdout.pipe(Stream.decodeText(), Stream.mkString);
|
|
16202
16202
|
const code = yield* handle.exitCode;
|
|
16203
|
-
return pipe(Option.liftPredicate(text, () => Number(code) === SUCCESS$
|
|
16203
|
+
return pipe(Option.liftPredicate(text, () => Number(code) === SUCCESS$5), Option.flatMap(decodeGraph));
|
|
16204
16204
|
}, Effect.scoped, Effect.orElseSucceed(() => Option.none()));
|
|
16205
16205
|
const GivenTaskGraph = Context.Reference("msch/GivenTaskGraph", { defaultValue: () => Option.none() });
|
|
16206
16206
|
// src/features/check-documented-commands/model/commands.ts
|
|
@@ -16315,7 +16315,7 @@ const checkDocumentedCommands = Effect.fn("checkDocumentedCommands")(function* c
|
|
|
16315
16315
|
});
|
|
16316
16316
|
// src/features/check-legacy-web/model/legacy-web.ts
|
|
16317
16317
|
const RULE$40 = "legacy-web";
|
|
16318
|
-
const FIRST_COLUMN$
|
|
16318
|
+
const FIRST_COLUMN$7 = 1;
|
|
16319
16319
|
const SCANNER = fileURLToPath(new URL("./skills/modern-web-guidance/modern-web.mjs", import.meta.resolve("modern-web-guidance/package.json")));
|
|
16320
16320
|
const Finding = Schema.Struct({
|
|
16321
16321
|
file: Schema.String,
|
|
@@ -16352,15 +16352,15 @@ const checkLegacyWeb = Effect.fn("checkLegacyWeb")(function* checkLegacyWeb(root
|
|
|
16352
16352
|
const problemOf = (guideId, ruleId) => ({ file, line, message }) => ({
|
|
16353
16353
|
file: files.join(root, file),
|
|
16354
16354
|
line,
|
|
16355
|
-
column: FIRST_COLUMN$
|
|
16355
|
+
column: FIRST_COLUMN$7,
|
|
16356
16356
|
rule: RULE$40,
|
|
16357
16357
|
message: `${ruleId}: ${message} Read the guide with \`modern-web-guidance retrieve ${guideId}\` and apply it.`
|
|
16358
16358
|
});
|
|
16359
16359
|
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
16360
|
});
|
|
16361
16361
|
// src/shared/lib/section-check.ts
|
|
16362
|
-
const taggedError$
|
|
16363
|
-
var SectionConfigUnreadable = class extends taggedError$
|
|
16362
|
+
const taggedError$9 = Schema.TaggedError;
|
|
16363
|
+
var SectionConfigUnreadable = class extends taggedError$9()("SectionConfigUnreadable", { file: Schema.String }) {};
|
|
16364
16364
|
const CONFIG_FILE$4 = "vite.config.ts";
|
|
16365
16365
|
const FIRST$10 = 1;
|
|
16366
16366
|
const ONE$1 = 1;
|
|
@@ -16423,7 +16423,7 @@ const SHELL_FILE = /\.(?:sh|bash|zsh|ksh|fish|command)$/u;
|
|
|
16423
16423
|
const SHELL_SHEBANG = /^#!\S*(?:\/|\s)(?:env\s+)?(?:-\S+\s+)*(?:ba|z|k|da)?sh\b|^#!\S*fish\b/u;
|
|
16424
16424
|
const EXTENSION$1 = /\.[^./]+$/u;
|
|
16425
16425
|
const SETTINGS_FILE = ".claude/settings.json";
|
|
16426
|
-
const READ_CONCURRENCY$
|
|
16426
|
+
const READ_CONCURRENCY$18 = 64;
|
|
16427
16427
|
const RULE$39 = "shell-script";
|
|
16428
16428
|
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
16429
|
const HookSchema = Schema.Struct({
|
|
@@ -16456,12 +16456,12 @@ const checkShellScripts = Effect.fn("checkShellScripts")(function* checkShellScr
|
|
|
16456
16456
|
return files.readFile(file).pipe(Effect.map(Option.exists((source) => SHELL_SHEBANG.test(source))));
|
|
16457
16457
|
};
|
|
16458
16458
|
const candidates = pipe(names, Array$1.filter((name) => !isSessionStartHook(name)));
|
|
16459
|
-
const shell = yield* Effect.filter(candidates, isShell, { concurrency: READ_CONCURRENCY$
|
|
16459
|
+
const shell = yield* Effect.filter(candidates, isShell, { concurrency: READ_CONCURRENCY$18 });
|
|
16460
16460
|
return pipe(shell, Array$1.map((name) => problemInFile(RULE$39)(files.join(root, name), MESSAGE$14)));
|
|
16461
16461
|
});
|
|
16462
16462
|
// src/shared/lib/workflow-files.ts
|
|
16463
16463
|
const WORKFLOW_FILE = /^\.github\/workflows\/[^/]+\.ya?ml$/u;
|
|
16464
|
-
const READ_CONCURRENCY$
|
|
16464
|
+
const READ_CONCURRENCY$17 = 16;
|
|
16465
16465
|
const readWorkflows = Effect.fn("readWorkflows")(function* readWorkflows(root) {
|
|
16466
16466
|
const files = yield* RepositoryFiles;
|
|
16467
16467
|
const names = yield* files.listedFiles(root);
|
|
@@ -16471,7 +16471,7 @@ const readWorkflows = Effect.fn("readWorkflows")(function* readWorkflows(root) {
|
|
|
16471
16471
|
file,
|
|
16472
16472
|
source
|
|
16473
16473
|
}))));
|
|
16474
|
-
}, { concurrency: READ_CONCURRENCY$
|
|
16474
|
+
}, { concurrency: READ_CONCURRENCY$17 });
|
|
16475
16475
|
return Array$1.getSomes(found);
|
|
16476
16476
|
});
|
|
16477
16477
|
// src/shared/lib/workflow-run.ts
|
|
@@ -16633,7 +16633,7 @@ const AGENT_DOCS = [
|
|
|
16633
16633
|
":(glob)**/CLAUDE.md",
|
|
16634
16634
|
...EXCLUDED$5
|
|
16635
16635
|
];
|
|
16636
|
-
const READ_CONCURRENCY$
|
|
16636
|
+
const READ_CONCURRENCY$16 = 16;
|
|
16637
16637
|
const START$20 = 0;
|
|
16638
16638
|
const FIRST$9 = 1;
|
|
16639
16639
|
const LINE = "\n";
|
|
@@ -16702,7 +16702,7 @@ const taskSources = Effect.fn("taskSources")(function* taskSources(root, directo
|
|
|
16702
16702
|
return pipe(tasks, Array$1.flatMap((task) => Option.toArray(taskSource(file, source)(task))));
|
|
16703
16703
|
});
|
|
16704
16704
|
const workspaceTasks = Effect.fn("workspaceTasks")(function* workspaceTasks(root, directories) {
|
|
16705
|
-
const found = yield* Effect.forEach(directories, (directory) => taskSources(root, directory), { concurrency: READ_CONCURRENCY$
|
|
16705
|
+
const found = yield* Effect.forEach(directories, (directory) => taskSources(root, directory), { concurrency: READ_CONCURRENCY$16 });
|
|
16706
16706
|
return Array$1.flatten(found);
|
|
16707
16707
|
});
|
|
16708
16708
|
const readSources = Effect.fn("readSources")(function* readSources(root, names, sourcesOf) {
|
|
@@ -16714,7 +16714,7 @@ const readSources = Effect.fn("readSources")(function* readSources(root, names,
|
|
|
16714
16714
|
onSome: sourcesOf(file, name)
|
|
16715
16715
|
});
|
|
16716
16716
|
return files.readFile(file).pipe(Effect.map(sourcesIn));
|
|
16717
|
-
}, { concurrency: READ_CONCURRENCY$
|
|
16717
|
+
}, { concurrency: READ_CONCURRENCY$16 });
|
|
16718
16718
|
return Array$1.flatten(found);
|
|
16719
16719
|
});
|
|
16720
16720
|
/** @internal */
|
|
@@ -16758,13 +16758,13 @@ const LIFECYCLE = [
|
|
|
16758
16758
|
"dependencies",
|
|
16759
16759
|
"pnpm:devPreinstall"
|
|
16760
16760
|
];
|
|
16761
|
-
const problemOf$
|
|
16761
|
+
const problemOf$6 = ({ file, position, name }) => ({
|
|
16762
16762
|
file,
|
|
16763
16763
|
...position,
|
|
16764
16764
|
rule: RULE$37,
|
|
16765
16765
|
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
16766
|
});
|
|
16767
|
-
const packageScriptProblems = (sources) => pipe(sources, Array$1.filter(({ kind, name }) => kind === "script" && !Array$1.contains(LIFECYCLE, name)), Array$1.map(problemOf$
|
|
16767
|
+
const packageScriptProblems = (sources) => pipe(sources, Array$1.filter(({ kind, name }) => kind === "script" && !Array$1.contains(LIFECYCLE, name)), Array$1.map(problemOf$6));
|
|
16768
16768
|
// src/features/check-vite-plus/model/vite-plus-block.ts
|
|
16769
16769
|
const RULE$36 = "vite-plus-block";
|
|
16770
16770
|
const MARKER = Array$1.join([
|
|
@@ -16850,11 +16850,11 @@ const WORKFLOW_MESSAGE = "differs from the template's workflow, which Renovate d
|
|
|
16850
16850
|
const setupProblem$1 = problemInFile(SETUP_RULE$1);
|
|
16851
16851
|
const refProblem = problemInFile(REF_RULE);
|
|
16852
16852
|
const workflowProblem = problemInFile(WORKFLOW_RULE);
|
|
16853
|
-
const problemOf$
|
|
16853
|
+
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
16854
|
/** @internal */
|
|
16855
16855
|
const checkCiDrift = Effect.fn("checkCiDrift")(function* checkCiDrift(root) {
|
|
16856
16856
|
const drifts = yield* findCiDrift(root);
|
|
16857
|
-
return pipe(drifts, Array$1.map(problemOf$
|
|
16857
|
+
return pipe(drifts, Array$1.map(problemOf$5));
|
|
16858
16858
|
});
|
|
16859
16859
|
// src/features/check-workflows/model/publish-trigger.ts
|
|
16860
16860
|
const RULE$34 = "publish-trigger";
|
|
@@ -17049,8 +17049,8 @@ const tomlSourceComments = (source) => pipe(parseTOML(source).comments, Array$1.
|
|
|
17049
17049
|
text: String$1.slice(start, end)(source)
|
|
17050
17050
|
})));
|
|
17051
17051
|
// src/features/ban-comments/model/found-comment.ts
|
|
17052
|
-
const taggedError$
|
|
17053
|
-
var CommentsUnreadable = class extends taggedError$
|
|
17052
|
+
const taggedError$8 = Schema.TaggedError;
|
|
17053
|
+
var CommentsUnreadable = class extends taggedError$8()("CommentsUnreadable", {
|
|
17054
17054
|
reader: Schema.String,
|
|
17055
17055
|
message: Schema.String
|
|
17056
17056
|
}) {};
|
|
@@ -17243,7 +17243,7 @@ const RULE$29 = "comment";
|
|
|
17243
17243
|
const SUPPRESSION_RULE = "suppression";
|
|
17244
17244
|
const UNUSED_RULE = "unused-comment-allowance";
|
|
17245
17245
|
const CONFIG_FILE$3 = "vite.config.ts";
|
|
17246
|
-
const READ_CONCURRENCY$
|
|
17246
|
+
const READ_CONCURRENCY$15 = 64;
|
|
17247
17247
|
const START$18 = 0;
|
|
17248
17248
|
const SHEBANG = "#!";
|
|
17249
17249
|
const PIN = /@(?:[0-9a-f]{40}|sha256:[0-9a-f]{64})\s*$/u;
|
|
@@ -17255,8 +17255,8 @@ const CommentSettings = Schema.Struct({ allow: Patterns });
|
|
|
17255
17255
|
const MschSettings = Schema.Struct({ comments: Schema.optional(CommentSettings) });
|
|
17256
17256
|
const RootConfig = Schema.Struct({ msch: Schema.optional(MschSettings) });
|
|
17257
17257
|
const NO_SETTINGS = { allow: [] };
|
|
17258
|
-
const taggedError$
|
|
17259
|
-
var CommentConfigUnreadable = class extends taggedError$
|
|
17258
|
+
const taggedError$7 = Schema.TaggedError;
|
|
17259
|
+
var CommentConfigUnreadable = class extends taggedError$7()("CommentConfigUnreadable", { file: Schema.String }) {};
|
|
17260
17260
|
const valueOf = (text) => String$1.replaceAll(DELIMITERS, "")(text);
|
|
17261
17261
|
const lineBefore = (source, index) => {
|
|
17262
17262
|
const lines = pipe(source, String$1.slice(START$18, index), String$1.split("\n"));
|
|
@@ -17271,7 +17271,7 @@ const NOTHING = {
|
|
|
17271
17271
|
used: []
|
|
17272
17272
|
};
|
|
17273
17273
|
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$
|
|
17274
|
+
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
17275
|
const settingsOf = ({ msch }) => ({ allow: pipe(Option.fromUndefinedOr(msch), Option.flatMap(({ comments }) => Option.fromUndefinedOr(comments)), Option.match({
|
|
17276
17276
|
onNone: () => NO_SETTINGS.allow,
|
|
17277
17277
|
onSome: ({ allow }) => allow
|
|
@@ -17301,7 +17301,7 @@ const unusedAllowances = Effect.fn("unusedAllowances")(function* unusedAllowance
|
|
|
17301
17301
|
});
|
|
17302
17302
|
const scanFile = ({ directives, allowances, comments }) => ({ name, file }, source) => {
|
|
17303
17303
|
const kept = Predicate.not(isAllowed(source, directives));
|
|
17304
|
-
const toProblem = problemOf$
|
|
17304
|
+
const toProblem = problemOf$4(file, source);
|
|
17305
17305
|
return Option.match(readerOf(name)(source), {
|
|
17306
17306
|
onNone: () => Effect.succeed(NOTHING),
|
|
17307
17307
|
onSome: (reader) => comments(reader, source).pipe(Effect.map((found) => ({
|
|
@@ -17327,7 +17327,7 @@ const checkComments = Effect.fn("checkComments")(function* checkComments(root) {
|
|
|
17327
17327
|
const found = yield* Effect.forEach(scanned, (entry) => files.readFile(entry.file).pipe(Effect.flatMap(Option.match({
|
|
17328
17328
|
onNone: () => Effect.succeed(NOTHING),
|
|
17329
17329
|
onSome: (source) => scan(entry, source)
|
|
17330
|
-
}))), { concurrency: READ_CONCURRENCY$
|
|
17330
|
+
}))), { concurrency: READ_CONCURRENCY$15 });
|
|
17331
17331
|
const used = HashSet.fromIterable(pipe(found, Array$1.flatMap(({ used: indexes }) => indexes)));
|
|
17332
17332
|
const unused = yield* unusedAllowances(root, settings, used);
|
|
17333
17333
|
return [...pipe(found, Array$1.flatMap(({ problems }) => problems)), ...unused];
|
|
@@ -17343,12 +17343,12 @@ const patternsBy = ({ spawn, command, toolVersions = [] }) => (entry) => {
|
|
|
17343
17343
|
};
|
|
17344
17344
|
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
17345
|
const FIRST_LINE$6 = 1;
|
|
17346
|
-
const FIRST_COLUMN$
|
|
17346
|
+
const FIRST_COLUMN$6 = 1;
|
|
17347
17347
|
const WHOLE_MATCH$1 = 0;
|
|
17348
17348
|
const fileProblem = (tool) => (entry) => ({
|
|
17349
17349
|
file: entry.file,
|
|
17350
17350
|
line: FIRST_LINE$6,
|
|
17351
|
-
column: FIRST_COLUMN$
|
|
17351
|
+
column: FIRST_COLUMN$6,
|
|
17352
17352
|
rule: tool.fileRule,
|
|
17353
17353
|
message: tool.fileMessage(entry)
|
|
17354
17354
|
});
|
|
@@ -17455,7 +17455,7 @@ const uncatalogedDependencies = Effect.fn("uncatalogedDependencies")(function* u
|
|
|
17455
17455
|
// src/features/check-catalog-entries/model/catalog-entries.ts
|
|
17456
17456
|
const WORKSPACE_FILE$3 = "pnpm-workspace.yaml";
|
|
17457
17457
|
const FIRST_LINE$5 = 1;
|
|
17458
|
-
const FIRST_COLUMN$
|
|
17458
|
+
const FIRST_COLUMN$5 = 1;
|
|
17459
17459
|
const RULE$27 = "prune-setting-off";
|
|
17460
17460
|
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
17461
|
const decodeTrue = Schema.decodeUnknownOption(Schema.Literal(true));
|
|
@@ -17469,7 +17469,7 @@ const pruneProblems = Effect.fn("pruneProblems")(function* pruneProblems(file, s
|
|
|
17469
17469
|
return pipe(PRUNE_SETTINGS, Array$1.filter(([setting]) => Option.isNone(decodeTrue(settings[setting]))), Array$1.map(([setting, effect]) => ({
|
|
17470
17470
|
file,
|
|
17471
17471
|
line: at(setting),
|
|
17472
|
-
column: FIRST_COLUMN$
|
|
17472
|
+
column: FIRST_COLUMN$5,
|
|
17473
17473
|
rule: RULE$27,
|
|
17474
17474
|
message: `Set \`${setting}: true\`. It ${effect}`
|
|
17475
17475
|
})));
|
|
@@ -17504,8 +17504,8 @@ const Source = Schema.Struct({
|
|
|
17504
17504
|
});
|
|
17505
17505
|
const SkillsConfig = Schema.Struct({ skills: Schema.Record(Schema.String, Source) });
|
|
17506
17506
|
const decodeSkills = Schema.decodeUnknownOption(SkillsConfig);
|
|
17507
|
-
const taggedError$
|
|
17508
|
-
var SkillsConfigUnreadable = class extends taggedError$
|
|
17507
|
+
const taggedError$6 = Schema.TaggedError;
|
|
17508
|
+
var SkillsConfigUnreadable = class extends taggedError$6()("SkillsConfigUnreadable", { file: Schema.String }) {};
|
|
17509
17509
|
const problemAt$3 = (rule, file, text) => (anchor, message) => ({
|
|
17510
17510
|
file,
|
|
17511
17511
|
...positionOf(text)(pipe(String$1.indexOf(anchor)(text), Option.getOrElse(() => START$17))),
|
|
@@ -17567,11 +17567,11 @@ const checkSkillEntry = Effect.fn("checkSkillEntry")(function* checkSkillEntry(r
|
|
|
17567
17567
|
const RULE$26 = "published-skills";
|
|
17568
17568
|
const KEYWORD = "tanstack-intent";
|
|
17569
17569
|
const SKILLS = "skills";
|
|
17570
|
-
const SKILL_FILE$
|
|
17570
|
+
const SKILL_FILE$3 = "SKILL.md";
|
|
17571
17571
|
const SUCCEEDED = 0;
|
|
17572
17572
|
const INTENT_CLI = fileURLToPath(new URL("./cli.mjs", import.meta.resolve("@tanstack/intent")));
|
|
17573
17573
|
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$
|
|
17574
|
+
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
17575
|
const isShipped = (listed) => (skill) => Array$1.contains(listed, SKILLS) || Array$1.contains(listed, skill);
|
|
17576
17576
|
const packagingMessages = ({ keywords, files }, skills) => {
|
|
17577
17577
|
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 +17596,7 @@ const problemsIn$10 = Effect.fn("problemsIn")(function* problemsIn(root, project
|
|
|
17596
17596
|
const directory = files.join(root, project.directory);
|
|
17597
17597
|
const manifest = files.join(directory, PACKAGE_JSON_FILE);
|
|
17598
17598
|
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$
|
|
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$3}, so that repositories which approve them in the permissions of pnpm-workspace.yaml give their agents guidance for the installed version.`)];
|
|
17600
17600
|
const validation = yield* validationOf(directory).pipe(Effect.orElseSucceed(() => Option.none()));
|
|
17601
17601
|
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
17602
|
});
|
|
@@ -17608,7 +17608,7 @@ const checkPublishedSkills = Effect.fn("checkPublishedSkills")(function* checkPu
|
|
|
17608
17608
|
});
|
|
17609
17609
|
// src/features/check-skills/model/skill-files.ts
|
|
17610
17610
|
const RULE$25 = "skill-file";
|
|
17611
|
-
const SKILL_FILE$
|
|
17611
|
+
const SKILL_FILE$2 = /(?:^|\/)SKILL\.md$/u;
|
|
17612
17612
|
const INSTALLED = /(?:^|\/)\.(?:agents|claude|codex)\/skills\//u;
|
|
17613
17613
|
const FIXTURE$1 = /(?:^|\/)fixtures\//u;
|
|
17614
17614
|
const MARKDOWN$5 = ".md";
|
|
@@ -17626,7 +17626,7 @@ const BLANK = /\s+/u;
|
|
|
17626
17626
|
const SEPARATOR$9 = "/";
|
|
17627
17627
|
const START$16 = 0;
|
|
17628
17628
|
const FIRST$7 = 1;
|
|
17629
|
-
const READ_CONCURRENCY$
|
|
17629
|
+
const READ_CONCURRENCY$14 = 16;
|
|
17630
17630
|
const Metadata = Schema.Struct({ "derived-from": Schema.optional(Schema.String) });
|
|
17631
17631
|
const Frontmatter = Schema.Struct({
|
|
17632
17632
|
name: Schema.optional(Schema.String),
|
|
@@ -17702,7 +17702,7 @@ const problemsIn$9 = Effect.fn("problemsIn")(function* problemsIn(root, listed,
|
|
|
17702
17702
|
const inside = pipe(listed, Array$1.filter(String$1.startsWith(`${directory}${SEPARATOR$9}`)));
|
|
17703
17703
|
const text = yield* files.readFile(file);
|
|
17704
17704
|
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$
|
|
17705
|
+
const links = yield* Effect.forEach(documents, linkProblems, { concurrency: READ_CONCURRENCY$14 });
|
|
17706
17706
|
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
17707
|
file: files.join(root, entry),
|
|
17708
17708
|
line: FIRST$7,
|
|
@@ -17723,8 +17723,8 @@ const problemsIn$9 = Effect.fn("problemsIn")(function* problemsIn(root, listed,
|
|
|
17723
17723
|
/** @internal */
|
|
17724
17724
|
const checkSkillFiles = Effect.fn("checkSkillFiles")(function* checkSkillFiles(root) {
|
|
17725
17725
|
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$
|
|
17726
|
+
const skills = pipe(listed, Array$1.filter((name) => SKILL_FILE$2.test(name) && !INSTALLED.test(name) && !FIXTURE$1.test(name)));
|
|
17727
|
+
const found = yield* Effect.forEach(skills, (name) => problemsIn$9(root, listed, name), { concurrency: READ_CONCURRENCY$14 });
|
|
17728
17728
|
return Array$1.flatten(found);
|
|
17729
17729
|
});
|
|
17730
17730
|
// src/features/check-version-downgrades/model/version-entries.ts
|
|
@@ -17786,7 +17786,7 @@ const cargoEntries = (text) => {
|
|
|
17786
17786
|
const toolchainEntries = (text) => singleEntry("channel", fieldOf("channel")(parseToml(text)["toolchain"]));
|
|
17787
17787
|
// src/features/check-version-downgrades/model/version-downgrade.ts
|
|
17788
17788
|
const RULE$24 = "version-downgrade";
|
|
17789
|
-
const READ_CONCURRENCY$
|
|
17789
|
+
const READ_CONCURRENCY$13 = 16;
|
|
17790
17790
|
const READERS = [
|
|
17791
17791
|
[/(?:^|\/)package\.json$/u, manifestEntries],
|
|
17792
17792
|
[/^pnpm-workspace\.yaml$/u, workspaceEntries],
|
|
@@ -17830,7 +17830,7 @@ const checkDowngrades = Effect.fn("checkDowngrades")(function* checkDowngrades(r
|
|
|
17830
17830
|
before: read(before),
|
|
17831
17831
|
after: read(after)
|
|
17832
17832
|
})), Option.getOrElse(() => []));
|
|
17833
|
-
}), { concurrency: READ_CONCURRENCY$
|
|
17833
|
+
}), { concurrency: READ_CONCURRENCY$13 });
|
|
17834
17834
|
return Array$1.flatten(found);
|
|
17835
17835
|
});
|
|
17836
17836
|
// src/features/check-version-downgrades/model/renovate-settings.ts
|
|
@@ -17841,7 +17841,7 @@ const AUTOMERGE_RULE = "renovate-platform-automerge";
|
|
|
17841
17841
|
const CAP_RULE = "renovate-version-cap";
|
|
17842
17842
|
const PRESET_RULE = "renovate-msch-preset";
|
|
17843
17843
|
const START$15 = 0;
|
|
17844
|
-
const READ_CONCURRENCY$
|
|
17844
|
+
const READ_CONCURRENCY$12 = 16;
|
|
17845
17845
|
const AUTOMERGE_MESSAGE = "sets `platformAutomerge: false`. Keep the platform's automerge on so passing updates merge without waiting for the next Renovate run.";
|
|
17846
17846
|
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
17847
|
const PRESET_MESSAGE = `does not extend \`${RENOVATE_PRESET}\`, so Renovate writes ranges that the \`version-range\` check rejects. Add it to \`extends\`.`;
|
|
@@ -17875,12 +17875,12 @@ const checkRenovateSettings = Effect.fn("checkRenovateSettings")(function* check
|
|
|
17875
17875
|
onNone: () => [],
|
|
17876
17876
|
onSome: (source) => problemsIn$8(file, source)
|
|
17877
17877
|
})));
|
|
17878
|
-
}, { concurrency: READ_CONCURRENCY$
|
|
17878
|
+
}, { concurrency: READ_CONCURRENCY$12 });
|
|
17879
17879
|
return Array$1.flatten(found);
|
|
17880
17880
|
});
|
|
17881
17881
|
// src/shared/lib/manifest-texts.ts
|
|
17882
17882
|
const MANIFEST$2 = /(?:^|\/)package\.json$/u;
|
|
17883
|
-
const READ_CONCURRENCY$
|
|
17883
|
+
const READ_CONCURRENCY$11 = 16;
|
|
17884
17884
|
/** @internal */
|
|
17885
17885
|
const manifestTexts = Effect.fn("manifestTexts")(function* manifestTexts(root) {
|
|
17886
17886
|
const files = yield* RepositoryFiles;
|
|
@@ -17889,7 +17889,7 @@ const manifestTexts = Effect.fn("manifestTexts")(function* manifestTexts(root) {
|
|
|
17889
17889
|
const read = yield* Effect.forEach(names, (file) => Effect.map(files.readFile(files.join(root, file)), Option.map((text) => ({
|
|
17890
17890
|
file,
|
|
17891
17891
|
text
|
|
17892
|
-
}))), { concurrency: READ_CONCURRENCY$
|
|
17892
|
+
}))), { concurrency: READ_CONCURRENCY$11 });
|
|
17893
17893
|
return Array$1.getSomes(read);
|
|
17894
17894
|
});
|
|
17895
17895
|
// src/features/check-version-downgrades/model/package-versions.ts
|
|
@@ -17897,8 +17897,8 @@ const RULE$23 = "unbumped-package";
|
|
|
17897
17897
|
const UNSHIPPED = /(?:\.test\.[\w.]+$|(?:^|\/)(?:fixtures|__tests__|tests?)\/|(?:^|\/)(?:AGENTS|CLAUDE|CHANGELOG)\.md$)/u;
|
|
17898
17898
|
const UNVERSIONED$5 = "0.0.0";
|
|
17899
17899
|
const FIRST_LINE$3 = 1;
|
|
17900
|
-
const FIRST_COLUMN$
|
|
17901
|
-
const READ_CONCURRENCY$
|
|
17900
|
+
const FIRST_COLUMN$4 = 1;
|
|
17901
|
+
const READ_CONCURRENCY$10 = 16;
|
|
17902
17902
|
const LAST_SEGMENT$1 = /[^/]*$/u;
|
|
17903
17903
|
const directoryOf$1 = (file) => String$1.replace(LAST_SEGMENT$1, "")(file);
|
|
17904
17904
|
const packageAt$1 = (file, text) => pipe(decodeVersionedPackageJson(text), Option.filter(({ private: hidden, version }) => hidden !== true && version !== UNVERSIONED$5), Option.map((manifest) => ({
|
|
@@ -17967,11 +17967,11 @@ const checkPackageVersions = Effect.fn("checkPackageVersions")(function* checkPa
|
|
|
17967
17967
|
return pipe(floor, Option.filter((lowest) => !semver.gt(pack.version, lowest)), Option.map((lowest) => ({
|
|
17968
17968
|
file: files.join(root, pack.file),
|
|
17969
17969
|
line: versionLine(pack.text),
|
|
17970
|
-
column: FIRST_COLUMN$
|
|
17970
|
+
column: FIRST_COLUMN$4,
|
|
17971
17971
|
rule: RULE$23,
|
|
17972
17972
|
message: message(pack, part, lowest)
|
|
17973
17973
|
})), Option.toArray);
|
|
17974
|
-
}), { concurrency: READ_CONCURRENCY$
|
|
17974
|
+
}), { concurrency: READ_CONCURRENCY$10 });
|
|
17975
17975
|
return Array$1.flatten(found);
|
|
17976
17976
|
});
|
|
17977
17977
|
// src/features/find-unneeded-files/model/applied-packages.ts
|
|
@@ -18186,7 +18186,7 @@ const TOOL_PATTERNS = [/^[ \t]*["']?(?:rust|rustup)["']?[ \t]*(?:=|[ \t]+\S)/gmu
|
|
|
18186
18186
|
const START$14 = 0;
|
|
18187
18187
|
const LAST_SEGMENT = 1;
|
|
18188
18188
|
const FIRST_LINE$2 = 1;
|
|
18189
|
-
const FIRST_COLUMN$
|
|
18189
|
+
const FIRST_COLUMN$3 = 1;
|
|
18190
18190
|
const WHOLE_MATCH = 0;
|
|
18191
18191
|
const FILE_RULE = "unneeded-file";
|
|
18192
18192
|
const SETUP_RULE = "unneeded-setup";
|
|
@@ -18198,7 +18198,7 @@ const cargoEnabled = (manifest) => pipe(decodeWorkspaceFile(manifest), Option.fl
|
|
|
18198
18198
|
const problemAtStart = (rule, message) => ({ file }) => ({
|
|
18199
18199
|
file,
|
|
18200
18200
|
line: FIRST_LINE$2,
|
|
18201
|
-
column: FIRST_COLUMN$
|
|
18201
|
+
column: FIRST_COLUMN$3,
|
|
18202
18202
|
rule,
|
|
18203
18203
|
message
|
|
18204
18204
|
});
|
|
@@ -18421,10 +18421,10 @@ const NUL = "\0";
|
|
|
18421
18421
|
const START$11 = 0;
|
|
18422
18422
|
const HEX = 16;
|
|
18423
18423
|
const CODE_POINT_WIDTH = 4;
|
|
18424
|
-
const READ_CONCURRENCY$
|
|
18424
|
+
const READ_CONCURRENCY$9 = 64;
|
|
18425
18425
|
const RULE$18 = "hidden-unicode";
|
|
18426
18426
|
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$
|
|
18427
|
+
const problemOf$3 = (file, source) => (found) => {
|
|
18428
18428
|
const hex = hexOf(found[START$11]);
|
|
18429
18429
|
return {
|
|
18430
18430
|
file,
|
|
@@ -18435,7 +18435,7 @@ const problemOf$2 = (file, source) => (found) => {
|
|
|
18435
18435
|
};
|
|
18436
18436
|
const problemsIn$6 = (file, source) => {
|
|
18437
18437
|
if (String$1.includes(NUL)(source)) return [];
|
|
18438
|
-
return pipe(Array$1.fromIterable(String$1.matchAll(HIDDEN)(source)), Array$1.map(problemOf$
|
|
18438
|
+
return pipe(Array$1.fromIterable(String$1.matchAll(HIDDEN)(source)), Array$1.map(problemOf$3(file, source)));
|
|
18439
18439
|
};
|
|
18440
18440
|
/** @internal */
|
|
18441
18441
|
const checkHiddenUnicode = Effect.fn("checkHiddenUnicode")(function* checkHiddenUnicode(root) {
|
|
@@ -18447,7 +18447,7 @@ const checkHiddenUnicode = Effect.fn("checkHiddenUnicode")(function* checkHidden
|
|
|
18447
18447
|
onNone: () => [],
|
|
18448
18448
|
onSome: (source) => problemsIn$6(file, source)
|
|
18449
18449
|
})));
|
|
18450
|
-
}, { concurrency: READ_CONCURRENCY$
|
|
18450
|
+
}, { concurrency: READ_CONCURRENCY$9 });
|
|
18451
18451
|
return Array$1.flatten(found);
|
|
18452
18452
|
});
|
|
18453
18453
|
// src/app/document-checks.ts
|
|
@@ -18541,14 +18541,14 @@ const RULE$15 = "pack-publint";
|
|
|
18541
18541
|
const CONFIG_FILE = "vite.config.ts";
|
|
18542
18542
|
const PACK_KEY = "pack:";
|
|
18543
18543
|
const START$9 = 0;
|
|
18544
|
-
const READ_CONCURRENCY$
|
|
18544
|
+
const READ_CONCURRENCY$8 = 16;
|
|
18545
18545
|
const EXCLUDED$2 = [":(exclude,attr:linguist-vendored)", ":(exclude,attr:linguist-generated)"];
|
|
18546
18546
|
const StrictPack = Schema.Struct({ publint: Schema.Struct({ strict: Schema.Literal(true) }) });
|
|
18547
18547
|
const isStrict = Schema.is(StrictPack);
|
|
18548
18548
|
const PackConfig = Schema.Struct({ pack: Schema.optional(Schema.Unknown) });
|
|
18549
18549
|
const decodePackConfig = Schema.decodeUnknownOption(PackConfig);
|
|
18550
|
-
const taggedError$
|
|
18551
|
-
var PackConfigUnreadable = class extends taggedError$
|
|
18550
|
+
const taggedError$5 = Schema.TaggedError;
|
|
18551
|
+
var PackConfigUnreadable = class extends taggedError$5()("PackConfigUnreadable", { file: Schema.String }) {};
|
|
18552
18552
|
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
18553
|
const problemFor = (file, source) => ({
|
|
18554
18554
|
file,
|
|
@@ -18579,7 +18579,7 @@ const problemsIn$4 = Effect.fn("problemsIn")(function* problemsIn(root, manifest
|
|
|
18579
18579
|
/** @internal */
|
|
18580
18580
|
const checkPackSettings = Effect.fn("checkPackSettings")(function* checkPackSettings(root) {
|
|
18581
18581
|
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$
|
|
18582
|
+
const found = yield* Effect.forEach(manifests, (name) => problemsIn$4(root, name), { concurrency: READ_CONCURRENCY$8 });
|
|
18583
18583
|
return Array$1.flatten(found);
|
|
18584
18584
|
});
|
|
18585
18585
|
// src/features/check-published-manifest/model/package-homepage.ts
|
|
@@ -18758,7 +18758,7 @@ const checkWorkspaceDescriptions = Effect.fn("checkWorkspaceDescriptions")(funct
|
|
|
18758
18758
|
const RULE$9 = "plugin-layout";
|
|
18759
18759
|
const PLUGIN_FILE$2 = ".claude-plugin/plugin.json";
|
|
18760
18760
|
const MARKETPLACE_FILE$1 = ".claude-plugin/marketplace.json";
|
|
18761
|
-
const SKILL_FILE = "SKILL.md";
|
|
18761
|
+
const SKILL_FILE$1 = "SKILL.md";
|
|
18762
18762
|
const BIN_PREFIX = "bin/";
|
|
18763
18763
|
const SEPARATOR$5 = "/";
|
|
18764
18764
|
const MOST_FILES = 5e3;
|
|
@@ -18838,7 +18838,7 @@ const skillViolations = (skills) => {
|
|
|
18838
18838
|
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
18839
|
], Array$1.getSomes, Array$1.map((message) => violation(file, message)))));
|
|
18840
18840
|
};
|
|
18841
|
-
const skillFilesOf = (plugin) => pipe(plugin.files, Array$1.filter((file) => file === SKILL_FILE || String$1.endsWith(`${SEPARATOR$5}${SKILL_FILE}`)(file)));
|
|
18841
|
+
const skillFilesOf = (plugin) => pipe(plugin.files, Array$1.filter((file) => file === SKILL_FILE$1 || String$1.endsWith(`${SEPARATOR$5}${SKILL_FILE$1}`)(file)));
|
|
18842
18842
|
const violationsOf = Effect.fn("violationsOf")(function* violationsOf(root, plugin, links) {
|
|
18843
18843
|
const prefix = `${(yield* RepositoryFiles).relative(root, plugin.directory)}${SEPARATOR$5}`;
|
|
18844
18844
|
const skills = yield* Effect.forEach(skillFilesOf(plugin), (file) => skillTextOf(plugin, file), { concurrency: CONCURRENCY$3 });
|
|
@@ -19452,7 +19452,7 @@ const isUnused = (condition) => condition.kind === "unused";
|
|
|
19452
19452
|
const USER_AGENT = `msch (${SELF_HOMEPAGE})`;
|
|
19453
19453
|
/** @internal */
|
|
19454
19454
|
const JSON_ACCEPT = "application/json";
|
|
19455
|
-
const requestOf = ({ url, token, accept }) => {
|
|
19455
|
+
const requestOf$1 = ({ url, token, accept }) => {
|
|
19456
19456
|
const request = HttpClientRequest.get(url).pipe(HttpClientRequest.setHeader("user-agent", USER_AGENT), HttpClientRequest.setHeader("accept", accept));
|
|
19457
19457
|
return Option.match(token, {
|
|
19458
19458
|
onNone: () => request,
|
|
@@ -19460,7 +19460,7 @@ const requestOf = ({ url, token, accept }) => {
|
|
|
19460
19460
|
});
|
|
19461
19461
|
};
|
|
19462
19462
|
/** @internal */
|
|
19463
|
-
const sent = (lookup) => HttpClient.HttpClient.pipe(Effect.flatMap((client) => client.execute(requestOf(lookup))));
|
|
19463
|
+
const sent = (lookup) => HttpClient.HttpClient.pipe(Effect.flatMap((client) => client.execute(requestOf$1(lookup))));
|
|
19464
19464
|
/** @internal */
|
|
19465
19465
|
const fetched = (lookup) => sent(lookup).pipe(Effect.flatMap(HttpClientResponse.filterStatusOk));
|
|
19466
19466
|
/** @internal */
|
|
@@ -19749,7 +19749,7 @@ const RULE$1 = "upstream-record";
|
|
|
19749
19749
|
const EXCLUDED = [":(exclude,attr:linguist-vendored)", ":(exclude,attr:linguist-generated)"];
|
|
19750
19750
|
const FIRST_INDEX = 0;
|
|
19751
19751
|
const LINE_OFFSET = 1;
|
|
19752
|
-
const FIRST_COLUMN$
|
|
19752
|
+
const FIRST_COLUMN$2 = 1;
|
|
19753
19753
|
/** @internal */
|
|
19754
19754
|
const VERDICTS$3 = [
|
|
19755
19755
|
"adopted",
|
|
@@ -19771,22 +19771,22 @@ const lineOf$1 = ({ source, key }) => {
|
|
|
19771
19771
|
const section = pipe(lines, Array$1.findFirstIndex(String$1.includes("\"upstream\"")), Option.getOrElse(() => FIRST_INDEX));
|
|
19772
19772
|
return section + pipe(lines, Array$1.drop(section), Array$1.findFirstIndex(String$1.includes(`"${key}"`)), Option.getOrElse(() => FIRST_INDEX)) + LINE_OFFSET;
|
|
19773
19773
|
};
|
|
19774
|
-
const problemOf$
|
|
19774
|
+
const problemOf$2 = (place, message) => ({
|
|
19775
19775
|
record: Option.none(),
|
|
19776
19776
|
problem: Option.some({
|
|
19777
19777
|
file: place.file,
|
|
19778
19778
|
line: lineOf$1(place),
|
|
19779
|
-
column: FIRST_COLUMN$
|
|
19779
|
+
column: FIRST_COLUMN$2,
|
|
19780
19780
|
rule: RULE$1,
|
|
19781
19781
|
message
|
|
19782
19782
|
})
|
|
19783
19783
|
});
|
|
19784
19784
|
const foundFrom = (place, value) => {
|
|
19785
19785
|
const upstream = parseSource(place.key);
|
|
19786
|
-
if (Option.isNone(upstream)) return problemOf$
|
|
19786
|
+
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
19787
|
const entry = decodeEntry(value);
|
|
19788
|
-
if (Option.isNone(entry)) return problemOf$
|
|
19789
|
-
if (semver.valid(entry.value.reviewed) !== entry.value.reviewed) return problemOf$
|
|
19788
|
+
if (Option.isNone(entry)) return problemOf$2(place, `The record of the upstream \`${describeSource(upstream.value)}\` is incomplete. ${REASON} ${SHAPE}.`);
|
|
19789
|
+
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
19790
|
return {
|
|
19791
19791
|
record: Option.some({
|
|
19792
19792
|
file: place.file,
|
|
@@ -19905,7 +19905,7 @@ const checkUpstream = Effect.fn("checkUpstream")(function* checkUpstream(root) {
|
|
|
19905
19905
|
return Array$1.flatten(found);
|
|
19906
19906
|
});
|
|
19907
19907
|
// src/features/check-surface-callers/model/caller-texts.ts
|
|
19908
|
-
const READ_CONCURRENCY$
|
|
19908
|
+
const READ_CONCURRENCY$7 = 64;
|
|
19909
19909
|
const SEPARATOR$4 = "/";
|
|
19910
19910
|
const UNTRACKED = /(?:^|\/)(?:node_modules|\.git)\//u;
|
|
19911
19911
|
const NOT_A_CALLER = /(?:^|\/)(?:README\.md|CHANGELOG\.md|pnpm-lock\.yaml|[^/]+\.test(?:\.support)?\.[cm]?[jt]sx?)$/u;
|
|
@@ -19916,7 +19916,7 @@ const readTexts = Effect.fn("readTexts")(function* readTexts(root, listed, label
|
|
|
19916
19916
|
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
19917
|
file: label(file),
|
|
19918
19918
|
text
|
|
19919
|
-
})))), { concurrency: READ_CONCURRENCY$
|
|
19919
|
+
})))), { concurrency: READ_CONCURRENCY$7 });
|
|
19920
19920
|
return Array$1.getSomes(read);
|
|
19921
19921
|
});
|
|
19922
19922
|
/** @internal */
|
|
@@ -19934,7 +19934,7 @@ const textsUnder = Effect.fn("textsUnder")(function* textsUnder(directory, label
|
|
|
19934
19934
|
const EXPORT_RULE = "uncalled-export";
|
|
19935
19935
|
const COMMAND_RULE = "uncalled-command";
|
|
19936
19936
|
const FLAG_RULE = "uncalled-flag";
|
|
19937
|
-
const READ_CONCURRENCY$
|
|
19937
|
+
const READ_CONCURRENCY$6 = 64;
|
|
19938
19938
|
const SEPARATOR$3 = "/";
|
|
19939
19939
|
const START$2 = 0;
|
|
19940
19940
|
const ROOT_SUBPATH$1 = ".";
|
|
@@ -20019,7 +20019,7 @@ const surfaceProblems = Effect.fn("surfaceProblems")(function* surfaceProblems(r
|
|
|
20019
20019
|
const files = yield* RepositoryFiles;
|
|
20020
20020
|
const directories = yield* workspaceDirectories(root);
|
|
20021
20021
|
const corpus = [...yield* ownTexts(root), ...callers];
|
|
20022
|
-
const found = yield* Effect.forEach(directories, (directory) => workspaceOf$1(root, directory), { concurrency: READ_CONCURRENCY$
|
|
20022
|
+
const found = yield* Effect.forEach(directories, (directory) => workspaceOf$1(root, directory), { concurrency: READ_CONCURRENCY$6 });
|
|
20023
20023
|
const workspaces = pipe(Array$1.getSomes(found), Array$1.filter((workspace) => reachOf(workspace) === reach));
|
|
20024
20024
|
return [...pipe(workspaces, Array$1.flatMap(exportProblems(root, files.join, corpus))), ...pipe(workspaces, Array$1.flatMap(commandProblems(root, files.join, corpus)))];
|
|
20025
20025
|
});
|
|
@@ -20037,7 +20037,7 @@ const ROOT_DIRECTORY = "";
|
|
|
20037
20037
|
const TASK_SEPARATOR = "#";
|
|
20038
20038
|
const START$1 = 0;
|
|
20039
20039
|
const FIRST$1 = 1;
|
|
20040
|
-
const READ_CONCURRENCY$
|
|
20040
|
+
const READ_CONCURRENCY$5 = 8;
|
|
20041
20041
|
const LIBRARY_KINDS = [
|
|
20042
20042
|
"lib",
|
|
20043
20043
|
"rlib",
|
|
@@ -20099,7 +20099,7 @@ const taskLinks = Effect.fn("taskLinks")(function* taskLinks(root, members) {
|
|
|
20099
20099
|
const found = yield* Effect.forEach(sources, (from) => {
|
|
20100
20100
|
const toLinks = Array$1.flatMap(linksTo(members, from));
|
|
20101
20101
|
return taskTargets(root, from).pipe(Effect.map(toLinks));
|
|
20102
|
-
}, { concurrency: READ_CONCURRENCY$
|
|
20102
|
+
}, { concurrency: READ_CONCURRENCY$5 });
|
|
20103
20103
|
return Array$1.flatten(found);
|
|
20104
20104
|
});
|
|
20105
20105
|
/** @internal */
|
|
@@ -20116,7 +20116,7 @@ const checkUnusedWorkspaces = Effect.fn("checkUnusedWorkspaces")(function* check
|
|
|
20116
20116
|
directory,
|
|
20117
20117
|
crateLibraries: cargo.libraries,
|
|
20118
20118
|
deployed
|
|
20119
|
-
}), { concurrency: READ_CONCURRENCY$
|
|
20119
|
+
}), { concurrency: READ_CONCURRENCY$5 });
|
|
20120
20120
|
const members = Array$1.getSomes(found);
|
|
20121
20121
|
const tasks = yield* taskLinks(root, members);
|
|
20122
20122
|
const links = [
|
|
@@ -20215,6 +20215,455 @@ const runCli = (name) => (program) => {
|
|
|
20215
20215
|
services: nodeRepositoryFiles
|
|
20216
20216
|
})(program);
|
|
20217
20217
|
};
|
|
20218
|
+
// src/shared/lib/quote-line.ts
|
|
20219
|
+
const LINE_BREAK$2 = "\n";
|
|
20220
|
+
const START = 0;
|
|
20221
|
+
/** @internal */
|
|
20222
|
+
const lineOfQuote = ({ text, quote }) => {
|
|
20223
|
+
if (String$1.isEmpty(quote)) return Option.none();
|
|
20224
|
+
return pipe(String$1.indexOf(quote)(text), Option.map((index) => pipe(String$1.slice(START, index)(text), String$1.split(LINE_BREAK$2)).length));
|
|
20225
|
+
};
|
|
20226
|
+
// src/features/check-with-agents/model/answers.ts
|
|
20227
|
+
const HypothesisSchema = Schema.Struct({
|
|
20228
|
+
paths: Schema.Array(Schema.String),
|
|
20229
|
+
question: Schema.String
|
|
20230
|
+
});
|
|
20231
|
+
/** @internal */
|
|
20232
|
+
const Plan = Schema.Struct({ hypotheses: Schema.Array(HypothesisSchema) });
|
|
20233
|
+
const FindingSchema = Schema.Struct({
|
|
20234
|
+
file: Schema.String,
|
|
20235
|
+
quote: Schema.String,
|
|
20236
|
+
problem: Schema.String,
|
|
20237
|
+
evidence: Schema.String,
|
|
20238
|
+
fix: Schema.String,
|
|
20239
|
+
check: Schema.String
|
|
20240
|
+
});
|
|
20241
|
+
/** @internal */
|
|
20242
|
+
const Investigation = Schema.Struct({ findings: Schema.Array(FindingSchema) });
|
|
20243
|
+
/** @internal */
|
|
20244
|
+
const Rebuttal = Schema.Struct({
|
|
20245
|
+
upheld: Schema.Boolean,
|
|
20246
|
+
reason: Schema.String
|
|
20247
|
+
});
|
|
20248
|
+
// src/features/check-with-agents/model/prompts.ts
|
|
20249
|
+
const lines = (parts) => Array$1.join(parts, "\n");
|
|
20250
|
+
const listOf$1 = (names) => pipe(names, Array$1.map((name) => `- ${name}`), lines);
|
|
20251
|
+
const documentOf = ({ name, text }) => lines([
|
|
20252
|
+
`<file path="${name}">`,
|
|
20253
|
+
text,
|
|
20254
|
+
"</file>"
|
|
20255
|
+
]);
|
|
20256
|
+
const documentsOf = (documents) => pipe(documents, Array$1.map(documentOf), lines);
|
|
20257
|
+
const skillsOf = (skills) => pipe(skills, Array$1.map(({ name, description }) => `- ${name}: ${description}`), lines);
|
|
20258
|
+
const contextOf = (context) => lines([
|
|
20259
|
+
"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.",
|
|
20260
|
+
"The index skill, which states the ideal state of the repository and which skills apply when:",
|
|
20261
|
+
documentsOf(context.indexSkills),
|
|
20262
|
+
"Instructions for agents:",
|
|
20263
|
+
documentsOf(context.agentDocs),
|
|
20264
|
+
"Skills the repository loads:",
|
|
20265
|
+
skillsOf(context.skills)
|
|
20266
|
+
]);
|
|
20267
|
+
const findingList = (findings) => pipe(findings, Array$1.map(({ file, problem }) => `- ${file}: ${problem}`), lines);
|
|
20268
|
+
const hypothesisList = (hypotheses) => pipe(hypotheses, Array$1.map(({ question }) => `- ${question}`), lines);
|
|
20269
|
+
/** @internal */
|
|
20270
|
+
const planPrompt = (input) => lines([
|
|
20271
|
+
"You plan an investigation of a repository by a team of agents. You do not investigate yourself.",
|
|
20272
|
+
contextOf(input.context),
|
|
20273
|
+
"Recent commits, newest first, each with the files it changed:",
|
|
20274
|
+
input.context.history,
|
|
20275
|
+
`Viewpoint: ${input.viewpoint.focus}`,
|
|
20276
|
+
"Questions already investigated:",
|
|
20277
|
+
hypothesisList(input.asked),
|
|
20278
|
+
"Problems already found:",
|
|
20279
|
+
findingList(input.found),
|
|
20280
|
+
"Read enough of the repository to know where problems may hide.",
|
|
20281
|
+
"Return every new question worth one investigator, each about one suspected problem under the viewpoint, with the paths the investigator should start from.",
|
|
20282
|
+
"Follow up on the problems already found: ask where the same cause shows up elsewhere and what made it possible.",
|
|
20283
|
+
"Do not repeat a question already investigated. Return no questions when nothing worth investigating is left."
|
|
20284
|
+
]);
|
|
20285
|
+
/** @internal */
|
|
20286
|
+
const investigatePrompt = (input) => lines([
|
|
20287
|
+
"You investigate one question about a repository.",
|
|
20288
|
+
contextOf(input.context),
|
|
20289
|
+
`Viewpoint: ${input.viewpoint.focus}`,
|
|
20290
|
+
`Question: ${input.hypothesis.question}`,
|
|
20291
|
+
"Start from:",
|
|
20292
|
+
listOf$1(input.hypothesis.paths),
|
|
20293
|
+
"Read the files and the history you need to answer it, and follow what you find beyond these paths.",
|
|
20294
|
+
"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.",
|
|
20295
|
+
"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.",
|
|
20296
|
+
"Return no findings when the suspicion turned out wrong."
|
|
20297
|
+
]);
|
|
20298
|
+
/** @internal */
|
|
20299
|
+
const rebutPrompt = (input) => lines([
|
|
20300
|
+
"Another agent reported a problem in a repository. Try to refute it.",
|
|
20301
|
+
contextOf(input.context),
|
|
20302
|
+
`File: ${input.finding.file}`,
|
|
20303
|
+
`Quoted text: ${input.finding.quote}`,
|
|
20304
|
+
`Problem: ${input.finding.problem}`,
|
|
20305
|
+
`Evidence: ${input.finding.evidence}`,
|
|
20306
|
+
`Proposed fix: ${input.finding.fix}`,
|
|
20307
|
+
"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.",
|
|
20308
|
+
"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."
|
|
20309
|
+
]);
|
|
20310
|
+
// src/features/check-with-agents/model/step.ts
|
|
20311
|
+
const ATTEMPTS = 3;
|
|
20312
|
+
const taggedError$4 = Schema.TaggedError;
|
|
20313
|
+
/** @internal */
|
|
20314
|
+
var StepFailed = class extends taggedError$4()("StepFailed", { message: Schema.String }) {};
|
|
20315
|
+
const retryNote = (failures) => pipe(Array$1.last(failures), Option.match({
|
|
20316
|
+
onNone: () => "",
|
|
20317
|
+
onSome: (reason) => `\n\nYour previous answer was rejected: ${reason} Answer again and fix that.`
|
|
20318
|
+
}));
|
|
20319
|
+
const attempt = (setup, { step, failures }) => Effect.gen(function* attempting() {
|
|
20320
|
+
const output = yield* setup.query({
|
|
20321
|
+
...step.request,
|
|
20322
|
+
prompt: `${step.request.prompt}${retryNote(failures)}`,
|
|
20323
|
+
schema: Schema.toJsonSchemaDocument(step.answer).schema
|
|
20324
|
+
});
|
|
20325
|
+
const answer = yield* Schema.decodeUnknownEffect(step.answer)(output).pipe(Effect.mapError((issue) => `the answer does not match the schema: ${issue.message}`));
|
|
20326
|
+
return yield* step.verify(answer);
|
|
20327
|
+
});
|
|
20328
|
+
const attempts = (setup, step) => {
|
|
20329
|
+
const loop = (failures) => Effect.matchEffect(attempt(setup, {
|
|
20330
|
+
step,
|
|
20331
|
+
failures
|
|
20332
|
+
}), {
|
|
20333
|
+
onSuccess: (answer) => Effect.succeed({
|
|
20334
|
+
answer: Option.some(answer),
|
|
20335
|
+
failures
|
|
20336
|
+
}),
|
|
20337
|
+
onFailure: (error) => {
|
|
20338
|
+
const failed = [...failures, error];
|
|
20339
|
+
if (failed.length >= ATTEMPTS) return Effect.succeed({
|
|
20340
|
+
answer: Option.none(),
|
|
20341
|
+
failures: failed
|
|
20342
|
+
});
|
|
20343
|
+
return loop(failed);
|
|
20344
|
+
}
|
|
20345
|
+
});
|
|
20346
|
+
return loop(Array$1.empty());
|
|
20347
|
+
};
|
|
20348
|
+
const recordOf = (answer) => Schema.fromJsonString(Schema.Struct({
|
|
20349
|
+
prompt: Schema.String,
|
|
20350
|
+
failures: Schema.Array(Schema.String),
|
|
20351
|
+
answer: Schema.optional(answer)
|
|
20352
|
+
}));
|
|
20353
|
+
const stateFileOf = (setup, step) => Effect.gen(function* stateFile() {
|
|
20354
|
+
const files = yield* RepositoryFiles;
|
|
20355
|
+
const hash = yield* files.hash(step.request.prompt);
|
|
20356
|
+
const key = `${step.stage}-${hash}`;
|
|
20357
|
+
return {
|
|
20358
|
+
key,
|
|
20359
|
+
file: files.join(setup.stateDirectory, `${key}.json`)
|
|
20360
|
+
};
|
|
20361
|
+
});
|
|
20362
|
+
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)))));
|
|
20363
|
+
const failedStep = (key, failures) => StepFailed.make({ message: `step ${key} failed ${String(ATTEMPTS)} times: ${Array$1.join(failures, " / ")}` });
|
|
20364
|
+
/** @internal */
|
|
20365
|
+
const runStep = Effect.fn("runStep")(function* running(setup, step) {
|
|
20366
|
+
const files = yield* RepositoryFiles;
|
|
20367
|
+
const record = recordOf(step.answer);
|
|
20368
|
+
const { key, file } = yield* stateFileOf(setup, step);
|
|
20369
|
+
const saved = yield* savedAnswer(file, record);
|
|
20370
|
+
if (Option.isSome(saved)) return saved.value;
|
|
20371
|
+
const { answer, failures } = yield* attempts(setup, step);
|
|
20372
|
+
const encoded = yield* Schema.encodeEffect(record)({
|
|
20373
|
+
prompt: step.request.prompt,
|
|
20374
|
+
failures,
|
|
20375
|
+
answer: Option.getOrUndefined(answer)
|
|
20376
|
+
}).pipe(Effect.orDie);
|
|
20377
|
+
yield* files.writeFile(file, encoded);
|
|
20378
|
+
return yield* Effect.fromOption(answer).pipe(Effect.mapError(() => failedStep(key, failures)));
|
|
20379
|
+
});
|
|
20380
|
+
// src/features/check-with-agents/model/swarm.ts
|
|
20381
|
+
const LEAD_MODEL = "claude-opus-5-5";
|
|
20382
|
+
const INVESTIGATOR_MODEL = "claude-sonnet-5-5";
|
|
20383
|
+
const MAX_TURNS = 200;
|
|
20384
|
+
const AGENT_CONCURRENCY$1 = 4;
|
|
20385
|
+
const SEQUENTIAL$2 = 1;
|
|
20386
|
+
const FIRST_COLUMN$1 = 1;
|
|
20387
|
+
const TOOLS = [
|
|
20388
|
+
"Read",
|
|
20389
|
+
"Grep",
|
|
20390
|
+
"Glob",
|
|
20391
|
+
"Bash"
|
|
20392
|
+
];
|
|
20393
|
+
const ALLOWED = [
|
|
20394
|
+
"Read",
|
|
20395
|
+
"Grep",
|
|
20396
|
+
"Glob",
|
|
20397
|
+
"Bash(git log:*)",
|
|
20398
|
+
"Bash(git show:*)",
|
|
20399
|
+
"Bash(git blame:*)"
|
|
20400
|
+
];
|
|
20401
|
+
const requestOf = (root, { prompt, model }) => ({
|
|
20402
|
+
directory: root,
|
|
20403
|
+
prompt,
|
|
20404
|
+
model,
|
|
20405
|
+
effort: "high",
|
|
20406
|
+
tools: TOOLS,
|
|
20407
|
+
allowed: ALLOWED,
|
|
20408
|
+
maxTurns: MAX_TURNS
|
|
20409
|
+
});
|
|
20410
|
+
const quotedLine = (root) => (finding) => Effect.gen(function* locating() {
|
|
20411
|
+
const files = yield* RepositoryFiles;
|
|
20412
|
+
const text = yield* files.readFile(files.join(root, finding.file));
|
|
20413
|
+
return pipe(text, Option.flatMap((source) => lineOfQuote({
|
|
20414
|
+
text: source,
|
|
20415
|
+
quote: finding.quote
|
|
20416
|
+
})));
|
|
20417
|
+
});
|
|
20418
|
+
const verifyQuotes = (root) => (answer) => Effect.gen(function* verifying() {
|
|
20419
|
+
const lines = yield* Effect.forEach(answer.findings, quotedLine(root), { concurrency: SEQUENTIAL$2 });
|
|
20420
|
+
const missing = pipe(Array$1.zip(answer.findings, lines), Array$1.filter(([, line]) => Option.isNone(line)), Array$1.map(([{ file }]) => file));
|
|
20421
|
+
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.`);
|
|
20422
|
+
return answer;
|
|
20423
|
+
});
|
|
20424
|
+
const accept = (answer) => Effect.succeed(answer);
|
|
20425
|
+
const plan$1 = (setup, input) => runStep(setup.step, {
|
|
20426
|
+
stage: `${input.viewpoint.id}-plan`,
|
|
20427
|
+
request: requestOf(setup.root, {
|
|
20428
|
+
prompt: planPrompt({
|
|
20429
|
+
context: setup.context,
|
|
20430
|
+
...input
|
|
20431
|
+
}),
|
|
20432
|
+
model: LEAD_MODEL
|
|
20433
|
+
}),
|
|
20434
|
+
answer: Plan,
|
|
20435
|
+
verify: accept
|
|
20436
|
+
});
|
|
20437
|
+
const investigate = (setup, viewpoint) => (hypothesis) => runStep(setup.step, {
|
|
20438
|
+
stage: `${viewpoint.id}-investigate`,
|
|
20439
|
+
request: requestOf(setup.root, {
|
|
20440
|
+
prompt: investigatePrompt({
|
|
20441
|
+
context: setup.context,
|
|
20442
|
+
viewpoint,
|
|
20443
|
+
hypothesis
|
|
20444
|
+
}),
|
|
20445
|
+
model: INVESTIGATOR_MODEL
|
|
20446
|
+
}),
|
|
20447
|
+
answer: Investigation,
|
|
20448
|
+
verify: verifyQuotes(setup.root)
|
|
20449
|
+
});
|
|
20450
|
+
const survives = (setup, viewpoint) => (finding) => runStep(setup.step, {
|
|
20451
|
+
stage: `${viewpoint.id}-rebut`,
|
|
20452
|
+
request: requestOf(setup.root, {
|
|
20453
|
+
prompt: rebutPrompt({
|
|
20454
|
+
context: setup.context,
|
|
20455
|
+
finding
|
|
20456
|
+
}),
|
|
20457
|
+
model: LEAD_MODEL
|
|
20458
|
+
}),
|
|
20459
|
+
answer: Rebuttal,
|
|
20460
|
+
verify: accept
|
|
20461
|
+
}).pipe(Effect.map(({ upheld }) => upheld));
|
|
20462
|
+
const findingKey = ({ file, quote }) => `${file}\0${quote}`;
|
|
20463
|
+
const newQuestions = (planned, asked) => pipe(planned, Array$1.filter((hypothesis) => !pipe(asked, Array$1.some(({ question }) => question === hypothesis.question))));
|
|
20464
|
+
const newFindings = (investigations, found) => {
|
|
20465
|
+
const known = new Set(pipe(found, Array$1.map(findingKey)));
|
|
20466
|
+
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))));
|
|
20467
|
+
};
|
|
20468
|
+
const nextRound = (setup, viewpoint) => ({ asked, found }) => Effect.gen(function* rounding() {
|
|
20469
|
+
const planned = yield* plan$1(setup, {
|
|
20470
|
+
viewpoint,
|
|
20471
|
+
asked,
|
|
20472
|
+
found
|
|
20473
|
+
});
|
|
20474
|
+
const questions = newQuestions(planned.hypotheses, asked);
|
|
20475
|
+
if (Array$1.isReadonlyArrayEmpty(questions)) return found;
|
|
20476
|
+
const investigations = yield* Effect.forEach(questions, investigate(setup, viewpoint), { concurrency: AGENT_CONCURRENCY$1 });
|
|
20477
|
+
const upheld = yield* Effect.filter(newFindings(investigations, found), survives(setup, viewpoint), { concurrency: AGENT_CONCURRENCY$1 });
|
|
20478
|
+
if (Array$1.isReadonlyArrayEmpty(upheld)) return found;
|
|
20479
|
+
return yield* nextRound(setup, viewpoint)({
|
|
20480
|
+
asked: [...asked, ...questions],
|
|
20481
|
+
found: [...found, ...upheld]
|
|
20482
|
+
});
|
|
20483
|
+
});
|
|
20484
|
+
const messageOf = ({ problem, fix, check }) => pipe([
|
|
20485
|
+
problem,
|
|
20486
|
+
`Fix: ${fix}`,
|
|
20487
|
+
...pipe(Option.liftPredicate(check, String$1.isNonEmpty), Option.map((text) => `Static check: ${text}`), Option.toArray)
|
|
20488
|
+
], Array$1.join(" "));
|
|
20489
|
+
const problemOf$1 = (setup, viewpoint) => (finding) => Effect.gen(function* reporting() {
|
|
20490
|
+
const files = yield* RepositoryFiles;
|
|
20491
|
+
const line = yield* quotedLine(setup.root)(finding);
|
|
20492
|
+
return problemAtPosition(viewpoint.id)(files.join(setup.root, finding.file), {
|
|
20493
|
+
line: Option.getOrElse(line, () => FIRST_COLUMN$1),
|
|
20494
|
+
column: FIRST_COLUMN$1
|
|
20495
|
+
}, messageOf(finding));
|
|
20496
|
+
});
|
|
20497
|
+
/** @internal */
|
|
20498
|
+
const investigateViewpoint = (viewpoint) => (setup) => nextRound(setup, viewpoint)({
|
|
20499
|
+
asked: [],
|
|
20500
|
+
found: []
|
|
20501
|
+
}).pipe(Effect.flatMap((findings) => Effect.forEach(findings, problemOf$1(setup, viewpoint), { concurrency: SEQUENTIAL$2 })));
|
|
20502
|
+
// src/features/check-with-agents/model/agent-checks.ts
|
|
20503
|
+
/** @internal */
|
|
20504
|
+
const AGENT_CHECKS = pipe([
|
|
20505
|
+
{
|
|
20506
|
+
id: "ideal-gap",
|
|
20507
|
+
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."
|
|
20508
|
+
},
|
|
20509
|
+
{
|
|
20510
|
+
id: "unchecked-convention",
|
|
20511
|
+
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."
|
|
20512
|
+
},
|
|
20513
|
+
{
|
|
20514
|
+
id: "repeated-correction",
|
|
20515
|
+
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."
|
|
20516
|
+
},
|
|
20517
|
+
{
|
|
20518
|
+
id: "drifted-prose",
|
|
20519
|
+
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."
|
|
20520
|
+
},
|
|
20521
|
+
{
|
|
20522
|
+
id: "mechanizable-rule",
|
|
20523
|
+
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."
|
|
20524
|
+
}
|
|
20525
|
+
], Array$1.map((viewpoint) => ({
|
|
20526
|
+
id: viewpoint.id,
|
|
20527
|
+
run: investigateViewpoint(viewpoint)
|
|
20528
|
+
})));
|
|
20529
|
+
const FAILED = "agent-check-failed";
|
|
20530
|
+
/** @internal */
|
|
20531
|
+
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.`)])));
|
|
20532
|
+
// src/features/check-with-agents/model/context.ts
|
|
20533
|
+
const AGENT_DOC = /(?:^|\/)(?:AGENTS|CLAUDE)\.md$/u;
|
|
20534
|
+
const SKILL = /(?:^|\/)SKILL\.md$/u;
|
|
20535
|
+
const INSTALLED_SKILLS = ".agents/skills";
|
|
20536
|
+
const SKILL_FILE = "SKILL.md";
|
|
20537
|
+
const READ_CONCURRENCY$4 = 16;
|
|
20538
|
+
const installedSkills = (root) => Effect.gen(function* listing() {
|
|
20539
|
+
const files = yield* RepositoryFiles;
|
|
20540
|
+
const names = yield* files.readDirectory(files.join(root, INSTALLED_SKILLS));
|
|
20541
|
+
return pipe(names, Array$1.map((name) => `${INSTALLED_SKILLS}/${name}/${SKILL_FILE}`));
|
|
20542
|
+
});
|
|
20543
|
+
const readDocument = (root) => (name) => Effect.gen(function* reading() {
|
|
20544
|
+
const files = yield* RepositoryFiles;
|
|
20545
|
+
const text = yield* files.readFile(files.join(root, name));
|
|
20546
|
+
return pipe(text, Option.map((found) => ({
|
|
20547
|
+
name,
|
|
20548
|
+
text: found
|
|
20549
|
+
})));
|
|
20550
|
+
});
|
|
20551
|
+
const descriptionOf = (fields) => pipe(Option.fromUndefinedOr(fields["description"]), Option.filter(Predicate.isString), Option.getOrElse(() => ""));
|
|
20552
|
+
const summaryOf = ({ name, text }) => pipe(splitFrontmatter(text), Option.match({
|
|
20553
|
+
onNone: () => ({
|
|
20554
|
+
name,
|
|
20555
|
+
description: "",
|
|
20556
|
+
index: false
|
|
20557
|
+
}),
|
|
20558
|
+
onSome: (frontmatter) => ({
|
|
20559
|
+
name,
|
|
20560
|
+
description: descriptionOf(frontmatter.fields),
|
|
20561
|
+
index: isIndexSkill(frontmatter)
|
|
20562
|
+
})
|
|
20563
|
+
}));
|
|
20564
|
+
const readAll = (root, names) => Effect.forEach(names, readDocument(root), { concurrency: READ_CONCURRENCY$4 }).pipe(Effect.map(Array$1.getSomes));
|
|
20565
|
+
const matching = (pattern) => (names) => pipe(names, Array$1.filter((name) => pattern.test(name)));
|
|
20566
|
+
const indexSkillsOf = (documents, skills) => pipe(Array$1.zip(documents, skills), Array$1.filter(([, { index }]) => index), Array$1.map(([document]) => document));
|
|
20567
|
+
/** @internal */
|
|
20568
|
+
const repositoryContext = Effect.fn("repositoryContext")(function* gathering(root) {
|
|
20569
|
+
const files = yield* RepositoryFiles;
|
|
20570
|
+
const listed = yield* files.listedFiles(root);
|
|
20571
|
+
const installed = yield* installedSkills(root);
|
|
20572
|
+
const skillNames = pipe(matching(SKILL)(listed), Array$1.appendAll(installed), Array$1.dedupe, Array$1.sortBy(Order.String));
|
|
20573
|
+
const skillDocuments = yield* readAll(root, skillNames);
|
|
20574
|
+
const agentDocs = yield* readAll(root, matching(AGENT_DOC)(listed));
|
|
20575
|
+
const skills = pipe(skillDocuments, Array$1.map(summaryOf));
|
|
20576
|
+
const history = yield* files.history(root);
|
|
20577
|
+
return {
|
|
20578
|
+
agentDocs,
|
|
20579
|
+
indexSkills: indexSkillsOf(skillDocuments, skills),
|
|
20580
|
+
skills,
|
|
20581
|
+
history
|
|
20582
|
+
};
|
|
20583
|
+
});
|
|
20584
|
+
// src/features/check-with-agents/model/check-with-agents.ts
|
|
20585
|
+
const SEQUENTIAL$1 = 1;
|
|
20586
|
+
/** @internal */
|
|
20587
|
+
const checkWithAgents = Effect.fn("checkWithAgents")(function* checkWithAgents(root, { query, stateDirectory, checks = AGENT_CHECKS }) {
|
|
20588
|
+
const files = yield* RepositoryFiles;
|
|
20589
|
+
const setup = {
|
|
20590
|
+
root,
|
|
20591
|
+
context: yield* repositoryContext(root),
|
|
20592
|
+
step: {
|
|
20593
|
+
query,
|
|
20594
|
+
stateDirectory: files.resolve(stateDirectory)
|
|
20595
|
+
}
|
|
20596
|
+
};
|
|
20597
|
+
const found = yield* Effect.forEach(checks, runAgentCheck(setup), { concurrency: SEQUENTIAL$1 });
|
|
20598
|
+
return pipe(found, Array$1.flatten);
|
|
20599
|
+
});
|
|
20600
|
+
// src/shared/lib/agent-query.ts
|
|
20601
|
+
const SDK = "@anthropic-ai/claude-agent-sdk";
|
|
20602
|
+
const ResultMessage = Schema.Struct({
|
|
20603
|
+
type: Schema.Literal("result"),
|
|
20604
|
+
subtype: Schema.String,
|
|
20605
|
+
is_error: Schema.Boolean,
|
|
20606
|
+
structured_output: Schema.optional(Schema.Unknown)
|
|
20607
|
+
});
|
|
20608
|
+
const isResult = Schema.is(ResultMessage);
|
|
20609
|
+
const reasonOf$2 = (failure) => {
|
|
20610
|
+
if (failure instanceof Error) return failure.message;
|
|
20611
|
+
return String(failure);
|
|
20612
|
+
};
|
|
20613
|
+
const loadSdk = Effect.tryPromise({
|
|
20614
|
+
try: () => import("@anthropic-ai/claude-agent-sdk"),
|
|
20615
|
+
catch: () => `${SDK} is not installed. Add it to the devDependencies of the repository root to run agents.`
|
|
20616
|
+
});
|
|
20617
|
+
const answerOf = (message) => {
|
|
20618
|
+
if (message.is_error || message.subtype !== "success") return Effect.fail(`the agent ended with ${message.subtype}`);
|
|
20619
|
+
return Effect.fromOption(Option.fromUndefinedOr(message.structured_output)).pipe(Effect.mapError(() => "the agent returned no structured output"));
|
|
20620
|
+
};
|
|
20621
|
+
const lastResult = (messages) => pipe(Stream.fromAsyncIterable(messages, reasonOf$2), Stream.filter(isResult), Stream.runLast);
|
|
20622
|
+
/** @internal */
|
|
20623
|
+
const sdkAgentQuery = Effect.fn("sdkAgentQuery")(function* querying(request) {
|
|
20624
|
+
const messages = (yield* loadSdk).query({
|
|
20625
|
+
prompt: request.prompt,
|
|
20626
|
+
options: {
|
|
20627
|
+
cwd: request.directory,
|
|
20628
|
+
model: request.model,
|
|
20629
|
+
effort: request.effort,
|
|
20630
|
+
tools: [...request.tools],
|
|
20631
|
+
allowedTools: [...request.allowed],
|
|
20632
|
+
permissionMode: "dontAsk",
|
|
20633
|
+
settingSources: [],
|
|
20634
|
+
mcpServers: {},
|
|
20635
|
+
strictMcpConfig: true,
|
|
20636
|
+
persistSession: false,
|
|
20637
|
+
maxTurns: request.maxTurns,
|
|
20638
|
+
outputFormat: {
|
|
20639
|
+
type: "json_schema",
|
|
20640
|
+
schema: { ...request.schema }
|
|
20641
|
+
}
|
|
20642
|
+
}
|
|
20643
|
+
});
|
|
20644
|
+
const result = yield* lastResult(messages);
|
|
20645
|
+
const message = yield* Effect.fromOption(result).pipe(Effect.mapError(() => "the agent ended without a result"));
|
|
20646
|
+
return yield* answerOf(message);
|
|
20647
|
+
});
|
|
20648
|
+
// src/app/agents-command.ts
|
|
20649
|
+
const agents = Effect.fn("agents")(function* investigating(input) {
|
|
20650
|
+
const root = (yield* RepositoryFiles).resolve(".");
|
|
20651
|
+
const found = yield* checkWithAgents(root, {
|
|
20652
|
+
query: sdkAgentQuery,
|
|
20653
|
+
stateDirectory: input.stateDirectory
|
|
20654
|
+
});
|
|
20655
|
+
const problems = sortProblems(found);
|
|
20656
|
+
yield* reportProblems(root, {
|
|
20657
|
+
problems,
|
|
20658
|
+
json: input.json
|
|
20659
|
+
});
|
|
20660
|
+
return yield* failWhenAny(problems.length);
|
|
20661
|
+
});
|
|
20662
|
+
/** @internal */
|
|
20663
|
+
const agentsCommand = Command.make("agents", {
|
|
20664
|
+
stateDirectory: Argument.String("state-directory").pipe(Argument.withDescription("The directory that keeps each finished step, so a rerun resumes from it")),
|
|
20665
|
+
json: jsonFlag
|
|
20666
|
+
}, agents).pipe(Command.withDescription("Has a swarm of agents plan, investigate and refute what the repository's rules and history miss"));
|
|
20218
20667
|
// src/features/publish-workspace/model/export-targets.ts
|
|
20219
20668
|
const PATTERN = "*";
|
|
20220
20669
|
const taggedError$3 = Schema.TaggedError;
|
|
@@ -20851,7 +21300,7 @@ const checkCompat = Effect.fn("publish.compat")(function* checkCompat(directory)
|
|
|
20851
21300
|
// src/features/publish-workspace/model/consumer-build.ts
|
|
20852
21301
|
const PNPMFILE = ".pnpmfile.cjs";
|
|
20853
21302
|
const TASK = "msch";
|
|
20854
|
-
const SUCCESS$
|
|
21303
|
+
const SUCCESS$4 = 0;
|
|
20855
21304
|
const TARBALLS_ENV = "MSCH_CONSUMER_TARBALLS";
|
|
20856
21305
|
const TaskGraph$1 = Schema.Struct({ tasks: Schema.Record(Schema.String, Schema.Unknown) }).pipe(Schema.fromJsonString);
|
|
20857
21306
|
const Tarballed = Schema.Struct({
|
|
@@ -20931,7 +21380,7 @@ const brokenReason = Effect.fn("consumers.reason")(function* brokenReason(direct
|
|
|
20931
21380
|
cwd: directory
|
|
20932
21381
|
});
|
|
20933
21382
|
const after = yield* stateOf(directory);
|
|
20934
|
-
if (code !== SUCCESS$
|
|
21383
|
+
if (code !== SUCCESS$4) return Option.some(`vp run ${TASK} exited with ${String(code)}:\n${tailOf(output)}`);
|
|
20935
21384
|
return Option.liftPredicate(after, (state) => state !== before).pipe(Option.map((state) => `vp run ${TASK} rewrote files:\n${state}`));
|
|
20936
21385
|
});
|
|
20937
21386
|
const install = (directory, options) => mustSucceed({
|
|
@@ -21021,7 +21470,7 @@ const checkConsumer = Effect.fn("consumers.check")(function* checkConsumer(check
|
|
|
21021
21470
|
}, Effect.scoped);
|
|
21022
21471
|
// src/features/publish-workspace/model/consumer-repositories.ts
|
|
21023
21472
|
const GH = "gh";
|
|
21024
|
-
const SUCCESS$
|
|
21473
|
+
const SUCCESS$3 = 0;
|
|
21025
21474
|
const READ_RAW = "Accept: application/vnd.github.raw+json";
|
|
21026
21475
|
const MANIFESTS = ["package.json", "pnpm-workspace.yaml"];
|
|
21027
21476
|
const REMOTE$1 = /[:/](?<owner>[^/:]+)\/(?<name>[^/]+?)(?:\.git)?$/u;
|
|
@@ -21053,7 +21502,7 @@ const apiOutput = (args, token) => finished({
|
|
|
21053
21502
|
command: GH,
|
|
21054
21503
|
args: ["api", ...args],
|
|
21055
21504
|
env: envOf(token)
|
|
21056
|
-
}).pipe(Effect.map(({ output, code }) => pipe(Option.some(output), Option.filter(() => code === SUCCESS$
|
|
21505
|
+
}).pipe(Effect.map(({ output, code }) => pipe(Option.some(output), Option.filter(() => code === SUCCESS$3))));
|
|
21057
21506
|
const listing = (path, expression, token) => apiOutput([
|
|
21058
21507
|
"--paginate",
|
|
21059
21508
|
path,
|
|
@@ -21757,7 +22206,7 @@ const publishRelease = Effect.fn("publish.release")(function* publishRelease(dir
|
|
|
21757
22206
|
});
|
|
21758
22207
|
});
|
|
21759
22208
|
// src/app/callers-command.ts
|
|
21760
|
-
const SUCCESS$
|
|
22209
|
+
const SUCCESS$2 = 0;
|
|
21761
22210
|
const REMOTE = "git";
|
|
21762
22211
|
const REMOTE_ARGS = [
|
|
21763
22212
|
"remote",
|
|
@@ -21787,7 +22236,7 @@ const textsOf = Effect.fn("textsOf")(function* textsOf(fullName) {
|
|
|
21787
22236
|
fullName,
|
|
21788
22237
|
directory
|
|
21789
22238
|
]
|
|
21790
|
-
})).code !== SUCCESS$
|
|
22239
|
+
})).code !== SUCCESS$2) return yield* RepositoriesUnlisted.make({ message: `${fullName} could not be downloaded` });
|
|
21791
22240
|
return yield* textsUnder(directory, fullName);
|
|
21792
22241
|
}, Effect.scoped);
|
|
21793
22242
|
const otherTexts = Effect.fn("otherTexts")(function* otherTexts() {
|
|
@@ -21946,7 +22395,7 @@ const unitsOf = Effect.fn("unitsOf")(function* unitsOf(root) {
|
|
|
21946
22395
|
return [yield* rootUnit(listing, shared), ...units];
|
|
21947
22396
|
});
|
|
21948
22397
|
// src/features/run-changed/model/run.ts
|
|
21949
|
-
const SUCCESS$
|
|
22398
|
+
const SUCCESS$1 = 0;
|
|
21950
22399
|
const LIST_SEPARATOR = ", ";
|
|
21951
22400
|
const ARGUMENT_SEPARATOR = " ";
|
|
21952
22401
|
const EVERYTHING = "everything";
|
|
@@ -21983,14 +22432,14 @@ const ranBatch = Effect.fn("ranBatch")(function* ranBatch(plan, batch) {
|
|
|
21983
22432
|
const code = yield* exitCodeOf(plan.root, [...plan.command, ...pathsOf(plan.units, batch)]);
|
|
21984
22433
|
const records = yield* recordsOf(plan.root, plan.command);
|
|
21985
22434
|
const keys = keysAfter(plan, records, batch);
|
|
21986
|
-
yield* Effect.when(keepOnly(records, keys), Effect.succeed(code === SUCCESS$
|
|
22435
|
+
yield* Effect.when(keepOnly(records, keys), Effect.succeed(code === SUCCESS$1));
|
|
21987
22436
|
return code;
|
|
21988
22437
|
});
|
|
21989
22438
|
const ran = Effect.fn("ran")(function* ran(plan, batchSources) {
|
|
21990
22439
|
const batches = batchesOf(plan.changed, batchSources);
|
|
21991
22440
|
yield* Effect.when(report(`${String(batches.length)} batches of at most ${String(batchSources)} source files`), Effect.succeed(batches.length > SINGLE_BATCH));
|
|
21992
22441
|
const codes = yield* Effect.forEach(batches, (batch) => ranBatch(plan, batch), { concurrency: 1 });
|
|
21993
|
-
return pipe(codes, Array$1.findFirst((code) => code !== SUCCESS$
|
|
22442
|
+
return pipe(codes, Array$1.findFirst((code) => code !== SUCCESS$1), Option.getOrElse(() => SUCCESS$1));
|
|
21994
22443
|
});
|
|
21995
22444
|
/** @internal */
|
|
21996
22445
|
const runChanged = Effect.fn("runChanged")(function* runChanged(root, { command, batchSources }) {
|
|
@@ -22000,7 +22449,7 @@ const runChanged = Effect.fn("runChanged")(function* runChanged(root, { command,
|
|
|
22000
22449
|
const since = `since \`${Array$1.join(command, ARGUMENT_SEPARATOR)}\` last passed`;
|
|
22001
22450
|
if (!Array$1.isReadonlyArrayNonEmpty(changed)) {
|
|
22002
22451
|
yield* report(`nothing changed ${since}`);
|
|
22003
|
-
return SUCCESS$
|
|
22452
|
+
return SUCCESS$1;
|
|
22004
22453
|
}
|
|
22005
22454
|
yield* report(`${String(changed.length)} of ${String(units.length)} changed ${since}: ${namesOf(units, changed)}`);
|
|
22006
22455
|
return yield* ran({
|
|
@@ -22011,7 +22460,7 @@ const runChanged = Effect.fn("runChanged")(function* runChanged(root, { command,
|
|
|
22011
22460
|
}, batchSources);
|
|
22012
22461
|
});
|
|
22013
22462
|
// src/app/changed-command.ts
|
|
22014
|
-
const SUCCESS
|
|
22463
|
+
const SUCCESS = 0;
|
|
22015
22464
|
const ONE_FAILURE$1 = 1;
|
|
22016
22465
|
const NO_LIMIT = Number.POSITIVE_INFINITY;
|
|
22017
22466
|
const atLeastOne = Schema.isGreaterThanOrEqualTo(1);
|
|
@@ -22021,7 +22470,7 @@ const changed = Effect.fn("changed")(function* changed(input) {
|
|
|
22021
22470
|
if ((yield* runChanged(files.resolve("."), {
|
|
22022
22471
|
batchSources: input.batchSources,
|
|
22023
22472
|
command: [input.program, ...input.rest]
|
|
22024
|
-
})) !== SUCCESS
|
|
22473
|
+
})) !== SUCCESS) return yield* ProblemsFound.make({ count: ONE_FAILURE$1 });
|
|
22025
22474
|
return yield* Effect.void;
|
|
22026
22475
|
});
|
|
22027
22476
|
/** @internal */
|
|
@@ -22037,14 +22486,14 @@ const byPlace = Order.Struct({
|
|
|
22037
22486
|
file: Order.String,
|
|
22038
22487
|
line: Order.Number
|
|
22039
22488
|
});
|
|
22040
|
-
const textOf
|
|
22489
|
+
const textOf = (row, describe) => (json, rows) => {
|
|
22041
22490
|
if (json) return Schema.encodeEffect(row.pipe(Schema.Array, Schema.fromJsonString))(rows);
|
|
22042
22491
|
return Effect.succeed(pipe(rows, Array$1.map((found) => `${describe(found)}${LINE_BREAK$1}`), Array$1.join("")));
|
|
22043
22492
|
};
|
|
22044
22493
|
/** @internal */
|
|
22045
22494
|
const lookupReport = ({ row, rows, describe }) => (json) => Effect.gen(function* report() {
|
|
22046
22495
|
const found = yield* rows((yield* RepositoryFiles).resolve("."));
|
|
22047
|
-
const text = yield* textOf
|
|
22496
|
+
const text = yield* textOf(row, describe)(json, Array$1.sort(found, byPlace));
|
|
22048
22497
|
yield* writeStdout(text);
|
|
22049
22498
|
if (found.length > NONE_FOUND) return yield* ProblemsFound.make({ count: found.length });
|
|
22050
22499
|
return NONE_FOUND;
|
|
@@ -22111,7 +22560,6 @@ const promptOf = ({ rule, target, context }) => pipe([
|
|
|
22111
22560
|
// src/features/judge-documents/model/verdict.ts
|
|
22112
22561
|
const LINE_BREAK = "\n";
|
|
22113
22562
|
const FIRST_LINE$1 = 1;
|
|
22114
|
-
const START = 0;
|
|
22115
22563
|
const Violation = Schema.Struct({
|
|
22116
22564
|
status: Schema.Literal("violation"),
|
|
22117
22565
|
line: Schema.Int,
|
|
@@ -22133,49 +22581,17 @@ const unknownBecause = (reason) => ({
|
|
|
22133
22581
|
/** @internal */
|
|
22134
22582
|
const isDecided = (verdict) => verdict.status !== "unknown";
|
|
22135
22583
|
/** @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
22584
|
const textOfLine = ({ text, line }) => pipe(String$1.split(text, LINE_BREAK), Array$1.get(line - FIRST_LINE$1), Option.getOrElse(() => ""));
|
|
22142
22585
|
// src/features/judge-documents/model/agent-judge.ts
|
|
22143
22586
|
const AGENT_MODEL = "claude-sonnet-5-5";
|
|
22144
22587
|
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
|
|
22588
|
+
const AGENT_TOOLS = [
|
|
22589
|
+
"Read",
|
|
22590
|
+
"Grep",
|
|
22591
|
+
"Glob"
|
|
22178
22592
|
];
|
|
22593
|
+
const AGENT_MAX_TURNS = 50;
|
|
22594
|
+
const AGENT_TIMEOUT = "10 minutes";
|
|
22179
22595
|
const sandboxOf = Effect.fn("sandboxOf")(function* sandboxOf(files) {
|
|
22180
22596
|
const fs = yield* FileSystem.FileSystem;
|
|
22181
22597
|
const path = yield* Path.Path;
|
|
@@ -22189,21 +22605,6 @@ const sandboxOf = Effect.fn("sandboxOf")(function* sandboxOf(files) {
|
|
|
22189
22605
|
});
|
|
22190
22606
|
return directory;
|
|
22191
22607
|
});
|
|
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
22608
|
const verdictOf = (target, answer) => {
|
|
22208
22609
|
if (answer.verdict === "pass") return { status: "pass" };
|
|
22209
22610
|
if (answer.verdict === "unknown") return unknownBecause(answer.reason);
|
|
@@ -22220,17 +22621,19 @@ const verdictOf = (target, answer) => {
|
|
|
22220
22621
|
})
|
|
22221
22622
|
});
|
|
22222
22623
|
};
|
|
22223
|
-
const judgeIn = Effect.fn("agentJudge")(function*
|
|
22224
|
-
const
|
|
22225
|
-
|
|
22226
|
-
|
|
22227
|
-
|
|
22228
|
-
|
|
22624
|
+
const judgeIn = Effect.fn("agentJudge")(function* judging(query, input) {
|
|
22625
|
+
const output = yield* query({
|
|
22626
|
+
directory: yield* sandboxOf([input.target, ...input.context]),
|
|
22627
|
+
prompt: promptOf(input),
|
|
22628
|
+
schema: AGENT_SCHEMA,
|
|
22629
|
+
tools: AGENT_TOOLS,
|
|
22630
|
+
allowed: AGENT_TOOLS,
|
|
22631
|
+
model: AGENT_MODEL,
|
|
22632
|
+
effort: AGENT_EFFORT,
|
|
22633
|
+
maxTurns: AGENT_MAX_TURNS
|
|
22229
22634
|
});
|
|
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);
|
|
22635
|
+
const answer = yield* Schema.decodeUnknownEffect(AgentAnswer)(output);
|
|
22636
|
+
return verdictOf(input.target, answer);
|
|
22234
22637
|
});
|
|
22235
22638
|
const reasonOf$1 = (failure) => {
|
|
22236
22639
|
if (typeof failure === "string") return failure;
|
|
@@ -22238,12 +22641,12 @@ const reasonOf$1 = (failure) => {
|
|
|
22238
22641
|
return String(failure);
|
|
22239
22642
|
};
|
|
22240
22643
|
/** @internal */
|
|
22241
|
-
const agentJudge = (
|
|
22644
|
+
const agentJudge = (query) => ({
|
|
22242
22645
|
identity: {
|
|
22243
22646
|
model: AGENT_MODEL,
|
|
22244
22647
|
promptVersion: 1
|
|
22245
22648
|
},
|
|
22246
|
-
judge: (input) => judgeIn(
|
|
22649
|
+
judge: (input) => judgeIn(query, input).pipe(Effect.scoped, Effect.timeout(AGENT_TIMEOUT), Effect.match({
|
|
22247
22650
|
onSuccess: (verdict) => verdict,
|
|
22248
22651
|
onFailure: (failure) => unknownBecause(reasonOf$1(failure))
|
|
22249
22652
|
}))
|
|
@@ -22457,7 +22860,7 @@ const judge = Effect.fn("judge")(function* judge(input) {
|
|
|
22457
22860
|
cacheDirectory: files.resolve(input.cacheDirectory),
|
|
22458
22861
|
rules: JUDGE_RULES,
|
|
22459
22862
|
decision: DECISION_JUDGE,
|
|
22460
|
-
agent: agentJudge(
|
|
22863
|
+
agent: agentJudge(sdkAgentQuery)
|
|
22461
22864
|
});
|
|
22462
22865
|
const problems = sortProblems(found);
|
|
22463
22866
|
yield* reportProblems(root, {
|
|
@@ -22862,6 +23265,7 @@ const describeRow = (row) => `${row.file}:${String(row.line)} upstream ${row.ups
|
|
|
22862
23265
|
// src/app/subcommands.ts
|
|
22863
23266
|
/** @internal */
|
|
22864
23267
|
const SUBCOMMANDS = [
|
|
23268
|
+
agentsCommand,
|
|
22865
23269
|
callersCommand,
|
|
22866
23270
|
changedCommand,
|
|
22867
23271
|
exitsCommand,
|