faf-cli 6.10.1 → 6.11.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/README.md +11 -1
- package/dist/cli.js +227 -227
- package/dist/cli.js.map +5 -5
- package/dist/commands/bench.d.ts +7 -2
- package/dist/core/interview.d.ts +38 -0
- package/dist/detect/assemble.d.ts +16 -0
- package/dist/detect/frameworks.d.ts +3 -0
- package/dist/detect/relentless.d.ts +22 -0
- package/dist/detect/scanner.d.ts +70 -0
- package/dist/detect/stack.d.ts +3 -0
- package/dist/index.d.ts +5 -2
- package/dist/index.js +137 -129
- package/dist/index.js.map +15 -6
- package/dist/interrogate/cargo.d.ts +10 -0
- package/dist/interrogate/index.d.ts +16 -0
- package/dist/interrogate/readme.d.ts +25 -0
- package/dist/interrogate/types.d.ts +49 -0
- package/package.json +1 -1
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Cargo.toml interrogation — extract Rust project metadata.
|
|
3
|
+
*
|
|
4
|
+
* The [package].description field is the Rust ecosystem's equivalent of
|
|
5
|
+
* package.json's `description` — a one-line elevator pitch. It maps to
|
|
6
|
+
* `project.goal` (overarching/use-case framing).
|
|
7
|
+
*/
|
|
8
|
+
import type { ExtractedContext } from './types.js';
|
|
9
|
+
/** Read Cargo.toml and extract per-slot content. Returns {} if no Cargo.toml. */
|
|
10
|
+
export declare function interrogateCargo(dir: string): ExtractedContext;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Repo interrogation orchestrator — runs all extractors and merges results.
|
|
3
|
+
*
|
|
4
|
+
* Order of precedence: extractors that run first WIN (their non-empty values
|
|
5
|
+
* are kept; later extractors fill only empties). README is highest-precedence
|
|
6
|
+
* because its prose is most likely to be hand-curated; manifest fields
|
|
7
|
+
* (Cargo.toml description, package.json description) are fallbacks.
|
|
8
|
+
*
|
|
9
|
+
* The orchestrator never overwrites with empty — only fills empties.
|
|
10
|
+
*/
|
|
11
|
+
import type { ExtractedContext } from './types.js';
|
|
12
|
+
export type { ExtractedContext } from './types.js';
|
|
13
|
+
export { interrogateReadme } from './readme.js';
|
|
14
|
+
export { interrogateCargo } from './cargo.js';
|
|
15
|
+
/** Run all repo interrogators and return merged context. */
|
|
16
|
+
export declare function interrogateRepo(dir: string): ExtractedContext;
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* README.md interrogation — extract slot content from semantic markdown anchors.
|
|
3
|
+
*
|
|
4
|
+
* Per faf-auto-no-guess-no-slop:
|
|
5
|
+
* Each extractor looks for a specific anchor (heading, structural pattern).
|
|
6
|
+
* If the anchor is missing or the content fails validation → return undefined.
|
|
7
|
+
* No slot is synthesized from another slot's content.
|
|
8
|
+
*/
|
|
9
|
+
import type { ExtractedContext } from './types.js';
|
|
10
|
+
/** Extract `project.goal` — first prose paragraph or ## Use Case / ## Goal */
|
|
11
|
+
export declare function extractGoal(content: string): string | undefined;
|
|
12
|
+
/** Extract `human_context.what` — ## About / ## Description / ## Overview */
|
|
13
|
+
export declare function extractWhat(content: string): string | undefined;
|
|
14
|
+
/** Extract `human_context.who` — ## Audience / ## For Whom / ## Users */
|
|
15
|
+
export declare function extractWho(content: string): string | undefined;
|
|
16
|
+
/** Extract `human_context.why` — ## Why / ## Motivation / ## Problem */
|
|
17
|
+
export declare function extractWhy(content: string): string | undefined;
|
|
18
|
+
/** Extract `human_context.where` — ## Deployment / ## Where it runs / ## Install */
|
|
19
|
+
export declare function extractWhere(content: string): string | undefined;
|
|
20
|
+
/** Extract `human_context.when` — ## Status / ## History / "Production since" */
|
|
21
|
+
export declare function extractWhen(content: string): string | undefined;
|
|
22
|
+
/** Extract `human_context.how` — ## Architecture / ## How it works / ## Approach */
|
|
23
|
+
export declare function extractHow(content: string): string | undefined;
|
|
24
|
+
/** Read README.md and extract per-slot content. Returns {} if no README. */
|
|
25
|
+
export declare function interrogateReadme(dir: string): ExtractedContext;
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Repo interrogation — extract slot content from README, Cargo.toml,
|
|
3
|
+
* package.json, etc., without guessing or substituting generic slop.
|
|
4
|
+
*
|
|
5
|
+
* Contract (per faf-auto-no-guess-no-slop doctrine):
|
|
6
|
+
* - Each slot has a per-slot evidence anchor
|
|
7
|
+
* - If the anchor is missing → leave empty (do NOT synthesize from other slots)
|
|
8
|
+
* - If the anchor is present but content is generic / too long / structural →
|
|
9
|
+
* leave empty (do NOT settle for slop)
|
|
10
|
+
* - Empty is honest; wrong is a lie
|
|
11
|
+
*
|
|
12
|
+
* Per goal-is-not-a-6w doctrine:
|
|
13
|
+
* - `project.goal` is the elevator pitch / use case — its own anchor
|
|
14
|
+
* - Each `human_context.*` 6W has its own anchor
|
|
15
|
+
* - No slot inherits from / is split-extracted from another
|
|
16
|
+
*/
|
|
17
|
+
/** Content extracted from a single source file (README, Cargo.toml, etc.) */
|
|
18
|
+
export interface ExtractedContext {
|
|
19
|
+
project?: {
|
|
20
|
+
/** One-line elevator pitch / use case. README first prose paragraph,
|
|
21
|
+
* ## Use Case section, or Cargo.toml description. */
|
|
22
|
+
goal?: string;
|
|
23
|
+
};
|
|
24
|
+
human_context?: {
|
|
25
|
+
/** Audience — "## Audience" / "for {audience}" patterns */
|
|
26
|
+
who?: string;
|
|
27
|
+
/** What's being built — "## About" / "## Description" / "X is..." */
|
|
28
|
+
what?: string;
|
|
29
|
+
/** Motivation — "## Why" / "## Motivation" / "Problem:" */
|
|
30
|
+
why?: string;
|
|
31
|
+
/** Where it runs — "## Deployment" / "## Where" / install-target */
|
|
32
|
+
where?: string;
|
|
33
|
+
/** Status / timeline — "## Status" / "Production since" / version line */
|
|
34
|
+
when?: string;
|
|
35
|
+
/** Approach — "## Architecture" / "## How it works" */
|
|
36
|
+
how?: string;
|
|
37
|
+
};
|
|
38
|
+
}
|
|
39
|
+
/** Confidence threshold rules for extracted text — empty if violated */
|
|
40
|
+
export declare const EXTRACTION_LIMITS: {
|
|
41
|
+
/** Minimum length for a slot to be considered worth filling (in chars) */
|
|
42
|
+
readonly MIN_LENGTH: 8;
|
|
43
|
+
/** Maximum length — anything longer is documentation, not a slot fill */
|
|
44
|
+
readonly MAX_LENGTH: 280;
|
|
45
|
+
};
|
|
46
|
+
/** Generic slop patterns — extracted text matching these is rejected */
|
|
47
|
+
export declare const SLOP_PATTERNS: readonly RegExp[];
|
|
48
|
+
/** Validate extracted text against the no-guess/no-slop doctrine */
|
|
49
|
+
export declare function isValidExtraction(text: string): boolean;
|
package/package.json
CHANGED