oreshnik-cli 0.1.0-alpha → 0.1.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cli.js +18 -14
- package/dist/cli.js.map +1 -1
- package/dist/index.js +14 -4
- package/dist/index.js.map +1 -1
- package/package.json +11 -3
package/dist/cli.js
CHANGED
|
@@ -2092,17 +2092,27 @@ var init_notes_ingestion_service = __esm({
|
|
|
2092
2092
|
}
|
|
2093
2093
|
classifyProject(text, validIds) {
|
|
2094
2094
|
const lower = text.toLowerCase();
|
|
2095
|
-
const
|
|
2095
|
+
const candidates = [];
|
|
2096
2096
|
for (const [pid, keywords] of Object.entries(PROJECT_KEYWORDS)) {
|
|
2097
2097
|
if (!validIds.has(pid)) continue;
|
|
2098
2098
|
for (const kw of keywords) {
|
|
2099
|
-
|
|
2100
|
-
|
|
2099
|
+
const pos = lower.indexOf(kw);
|
|
2100
|
+
if (pos >= 0) {
|
|
2101
|
+
candidates.push({ id: pid, pos });
|
|
2101
2102
|
break;
|
|
2102
2103
|
}
|
|
2103
2104
|
}
|
|
2104
2105
|
}
|
|
2105
|
-
return
|
|
2106
|
+
if (candidates.length === 0) return [];
|
|
2107
|
+
if (candidates.length === 1) return [candidates[0].id];
|
|
2108
|
+
candidates.sort((a, b) => a.pos - b.pos);
|
|
2109
|
+
const first = candidates[0];
|
|
2110
|
+
const nearby = candidates.filter((c) => c.pos - first.pos <= 40);
|
|
2111
|
+
if (nearby.length > 1) {
|
|
2112
|
+
const span = lower.slice(first.pos, first.pos + 40);
|
|
2113
|
+
if (span.includes(" y ") || span.includes(" and ")) return nearby.map((c) => c.id);
|
|
2114
|
+
}
|
|
2115
|
+
return [first.id];
|
|
2106
2116
|
}
|
|
2107
2117
|
classifyOwner(text) {
|
|
2108
2118
|
const lower = text.toLowerCase();
|
|
@@ -6115,16 +6125,10 @@ async function runPreflight(operator, sprint, repoPath, desc) {
|
|
|
6115
6125
|
try {
|
|
6116
6126
|
const { execCommandInherit: execCommandInherit2 } = await Promise.resolve().then(() => (init_exec(), exec_exports));
|
|
6117
6127
|
const resolvedRepo = isAbsolute9(repoPath) ? repoPath : resolve9(ROOT19, repoPath);
|
|
6118
|
-
|
|
6119
|
-
|
|
6120
|
-
|
|
6121
|
-
|
|
6122
|
-
sprint,
|
|
6123
|
-
"--operator",
|
|
6124
|
-
operator,
|
|
6125
|
-
"--desc",
|
|
6126
|
-
desc
|
|
6127
|
-
], { cwd: resolvedRepo, timeout: 12e4 });
|
|
6128
|
+
const localCli = join19(ROOT19, "dist", "cli.js");
|
|
6129
|
+
const command = existsSync19(localCli) ? "node" : "oreshnik";
|
|
6130
|
+
const args = existsSync19(localCli) ? [localCli, "preflight", "--sprint", sprint, "--operator", operator, "--desc", desc] : ["preflight", "--sprint", sprint, "--operator", operator, "--desc", desc];
|
|
6131
|
+
execCommandInherit2(command, args, { cwd: resolvedRepo, timeout: 12e4 });
|
|
6128
6132
|
} catch (e) {
|
|
6129
6133
|
log("FAIL", "Preflight failed for " + sprint + ": " + String(e).slice(0, 100));
|
|
6130
6134
|
}
|