@oss-autopilot/core 3.17.3 → 3.18.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/cli-registry.js +4 -2
- package/dist/cli.bundle.cjs +61 -61
- package/dist/commands/search.d.ts +17 -0
- package/dist/commands/search.js +30 -0
- package/package.json +5 -5
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
* Search command
|
|
3
3
|
* Searches for new issues to work on via @oss-scout/core
|
|
4
4
|
*/
|
|
5
|
+
import { type SearchStrategy } from '@oss-scout/core';
|
|
5
6
|
import { getStateManager } from '../core/index.js';
|
|
6
7
|
import { type SearchOutput } from '../formatters/json.js';
|
|
7
8
|
export { type SearchOutput } from '../formatters/json.js';
|
|
@@ -19,7 +20,23 @@ export declare const MAX_SEARCH_RESULTS = 100;
|
|
|
19
20
|
export { SEARCH_DIVERSITY_RATIO } from './scout-bridge.js';
|
|
20
21
|
interface SearchOptions {
|
|
21
22
|
maxResults: number;
|
|
23
|
+
/**
|
|
24
|
+
* Restrict discovery to specific scout phases (#1244 selector surface).
|
|
25
|
+
* Undefined runs scout's default staged pipeline (all phases). Passed
|
|
26
|
+
* straight through to `scout.search`, which gates each phase on the set.
|
|
27
|
+
*/
|
|
28
|
+
strategies?: SearchStrategy[];
|
|
22
29
|
}
|
|
30
|
+
/**
|
|
31
|
+
* Parse and validate a comma-separated `--strategy` value into scout strategies.
|
|
32
|
+
*
|
|
33
|
+
* Mirrors oss-scout's own CLI validation so an unknown token fails fast with a
|
|
34
|
+
* clear message instead of silently running all phases. Returns `undefined`
|
|
35
|
+
* for an absent/empty value so scout falls back to its default (all phases).
|
|
36
|
+
*
|
|
37
|
+
* @throws {Error} If any token is not a valid scout strategy.
|
|
38
|
+
*/
|
|
39
|
+
export declare function parseSearchStrategies(raw: string | undefined): SearchStrategy[] | undefined;
|
|
23
40
|
/**
|
|
24
41
|
* Retention window for the search seen-set (#1528). Entries older than this are
|
|
25
42
|
* culled so the list stays bounded. Set well beyond oss-scout's rotation TTL
|
package/dist/commands/search.js
CHANGED
|
@@ -3,6 +3,7 @@
|
|
|
3
3
|
* Searches for new issues to work on via @oss-scout/core
|
|
4
4
|
*/
|
|
5
5
|
import { adaptScoutLinkedPR, buildCandidateLinkedPR, createAutopilotScout, SEARCH_DIVERSITY_RATIO, } from './scout-bridge.js';
|
|
6
|
+
import { SearchStrategySchema } from '@oss-scout/core';
|
|
6
7
|
import { classifyLinkedPR, getStateManager } from '../core/index.js';
|
|
7
8
|
import { gradeFromCandidate } from '../core/issue-grading.js';
|
|
8
9
|
import { computeStrategy } from '../core/strategy.js';
|
|
@@ -21,6 +22,34 @@ export const MAX_SEARCH_RESULTS = 100;
|
|
|
21
22
|
* here so existing importers keep working.
|
|
22
23
|
*/
|
|
23
24
|
export { SEARCH_DIVERSITY_RATIO } from './scout-bridge.js';
|
|
25
|
+
/**
|
|
26
|
+
* Parse and validate a comma-separated `--strategy` value into scout strategies.
|
|
27
|
+
*
|
|
28
|
+
* Mirrors oss-scout's own CLI validation so an unknown token fails fast with a
|
|
29
|
+
* clear message instead of silently running all phases. Returns `undefined`
|
|
30
|
+
* for an absent/empty value so scout falls back to its default (all phases).
|
|
31
|
+
*
|
|
32
|
+
* @throws {Error} If any token is not a valid scout strategy.
|
|
33
|
+
*/
|
|
34
|
+
export function parseSearchStrategies(raw) {
|
|
35
|
+
if (raw === undefined)
|
|
36
|
+
return undefined;
|
|
37
|
+
const tokens = raw
|
|
38
|
+
.split(',')
|
|
39
|
+
.map((s) => s.trim())
|
|
40
|
+
.filter(Boolean);
|
|
41
|
+
if (tokens.length === 0)
|
|
42
|
+
return undefined;
|
|
43
|
+
const strategies = [];
|
|
44
|
+
for (const token of tokens) {
|
|
45
|
+
const parsed = SearchStrategySchema.safeParse(token);
|
|
46
|
+
if (!parsed.success) {
|
|
47
|
+
throw new Error(`Unknown search strategy "${token}". Valid strategies: merged, starred, broad, maintained, all`);
|
|
48
|
+
}
|
|
49
|
+
strategies.push(parsed.data);
|
|
50
|
+
}
|
|
51
|
+
return strategies;
|
|
52
|
+
}
|
|
24
53
|
/**
|
|
25
54
|
* Search GitHub for contributable issues using multi-phase discovery.
|
|
26
55
|
*
|
|
@@ -140,6 +169,7 @@ export async function runSearch(options) {
|
|
|
140
169
|
const broadPhaseDelayMs = readScoutDelayOverride('OSS_AUTOPILOT_SCOUT_BROAD_PHASE_DELAY_MS');
|
|
141
170
|
const result = await scout.search({
|
|
142
171
|
maxResults: options.maxResults,
|
|
172
|
+
...(options.strategies ? { strategies: options.strategies } : {}),
|
|
143
173
|
preferLanguages,
|
|
144
174
|
preferRepos,
|
|
145
175
|
diversityRatio: SEARCH_DIVERSITY_RATIO,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@oss-autopilot/core",
|
|
3
|
-
"version": "3.
|
|
3
|
+
"version": "3.18.0",
|
|
4
4
|
"description": "CLI and core library for managing open source contributions",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"bin": {
|
|
@@ -61,12 +61,12 @@
|
|
|
61
61
|
},
|
|
62
62
|
"devDependencies": {
|
|
63
63
|
"@types/node": "^26.1.0",
|
|
64
|
-
"@vitest/coverage-v8": "^4.1.
|
|
64
|
+
"@vitest/coverage-v8": "^4.1.9",
|
|
65
65
|
"esbuild": "^0.28.1",
|
|
66
|
-
"tsx": "^4.
|
|
67
|
-
"typedoc": "^0.28.
|
|
66
|
+
"tsx": "^4.23.0",
|
|
67
|
+
"typedoc": "^0.28.20",
|
|
68
68
|
"typescript": "^5.9.3",
|
|
69
|
-
"vitest": "^4.1.
|
|
69
|
+
"vitest": "^4.1.9"
|
|
70
70
|
},
|
|
71
71
|
"scripts": {
|
|
72
72
|
"build": "tsc",
|