faf-cli 6.10.1 → 6.12.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 +29 -4
- package/dist/cli.js +228 -228
- package/dist/cli.js.map +10 -10
- 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 +7 -2
- package/dist/index.js +138 -129
- package/dist/index.js.map +16 -6
- package/dist/interop/servercard.d.ts +61 -0
- 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 +4 -3
- package/project.faf +1 -1
package/dist/commands/bench.d.ts
CHANGED
|
@@ -88,8 +88,11 @@ export interface BenchState {
|
|
|
88
88
|
cold?: RunRecord;
|
|
89
89
|
faf?: RunRecord;
|
|
90
90
|
}
|
|
91
|
-
/** ✪ receipt — sha256 over the canonical projection; third-party verifiable.
|
|
92
|
-
|
|
91
|
+
/** ✪ receipt — sha256 over the canonical projection; third-party verifiable.
|
|
92
|
+
* Includes `repo` so the receipt attests WHICH project was benched — two repos
|
|
93
|
+
* that score identically on the same qset get distinct receipts (bench-only;
|
|
94
|
+
* independent of the parity/trust score hash). */
|
|
95
|
+
export declare function buildReceipt(state: BenchState, repo?: string): {
|
|
93
96
|
projection: string;
|
|
94
97
|
hash: string;
|
|
95
98
|
};
|
|
@@ -100,5 +103,7 @@ export interface BenchOptions {
|
|
|
100
103
|
tokens?: string;
|
|
101
104
|
model?: string;
|
|
102
105
|
file?: string;
|
|
106
|
+
submit?: boolean;
|
|
107
|
+
endpoint?: string;
|
|
103
108
|
}
|
|
104
109
|
export declare function benchCommand(action?: string, answersFile?: string, options?: BenchOptions): void;
|
package/dist/core/interview.d.ts
CHANGED
|
@@ -70,3 +70,41 @@ export declare function questionForSlot(path: string): string;
|
|
|
70
70
|
* interviewed. `data` is the parsed .faf object.
|
|
71
71
|
*/
|
|
72
72
|
export declare function interviewForMissing(data: Record<string, unknown>, isEmpty: (value: unknown) => boolean): InterviewQuestion[];
|
|
73
|
+
export interface GoalSeed {
|
|
74
|
+
what?: string;
|
|
75
|
+
where?: string;
|
|
76
|
+
who?: string;
|
|
77
|
+
}
|
|
78
|
+
/**
|
|
79
|
+
* Seed the human-context slots from the Goal sentence — verbatim facts only.
|
|
80
|
+
* Returns a partial { what?, where?, who? }; absent keys = "no fact, ask the
|
|
81
|
+
* human". Never returns why/when/how (not verbatim-extractable from a goal).
|
|
82
|
+
*/
|
|
83
|
+
export declare function seedSixWsFromGoal(goal: string): GoalSeed;
|
|
84
|
+
export type BoxStatus = 'filled' | 'seeded' | 'empty';
|
|
85
|
+
export interface TableOf8Row {
|
|
86
|
+
n: number;
|
|
87
|
+
path: string;
|
|
88
|
+
header: string;
|
|
89
|
+
question: string;
|
|
90
|
+
value: string;
|
|
91
|
+
status: BoxStatus;
|
|
92
|
+
seeded: boolean;
|
|
93
|
+
}
|
|
94
|
+
export interface TableOf8 {
|
|
95
|
+
version: string;
|
|
96
|
+
rows: TableOf8Row[];
|
|
97
|
+
filledCount: number;
|
|
98
|
+
seededCount: number;
|
|
99
|
+
emptyCount: number;
|
|
100
|
+
complete: boolean;
|
|
101
|
+
}
|
|
102
|
+
/**
|
|
103
|
+
* Build the Table-of-8 from a .faf object (any/empty) + an optional goal. The
|
|
104
|
+
* goal seeds WHO/WHAT/WHERE via seedSixWsFromGoal (facts only); WHY/WHEN/HOW are
|
|
105
|
+
* never seeded. Rows the .faf already fills are 'filled'; goal-seeded ones are
|
|
106
|
+
* 'seeded' (suggestions); the rest are 'empty' (ask the human). Pure.
|
|
107
|
+
*/
|
|
108
|
+
export declare function buildTableOf8(faf: Record<string, unknown>, opts?: {
|
|
109
|
+
goal?: string;
|
|
110
|
+
}): TableOf8;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Shared .faf assembly pipeline. The full slot-filling flow used to build a
|
|
3
|
+
* FRESH .faf for a directory:
|
|
4
|
+
* detect → interrogate → slotignore inactive categories → Turbo-Cat → Relentless
|
|
5
|
+
*
|
|
6
|
+
* Used by BOTH `faf auto` (new-file path) and `faf git` (cloned repo) so they
|
|
7
|
+
* can't drift — `faf git` previously ran detectStack alone (~33% vs ~75%).
|
|
8
|
+
*/
|
|
9
|
+
/** Build a fresh .faf for `dir` using the full slot-filling pipeline. */
|
|
10
|
+
export declare function assembleFreshFaf(dir: string): Record<string, unknown>;
|
|
11
|
+
/** Fill empty/placeholder slots in `target` with values from `source`.
|
|
12
|
+
* `target` wins when its slot is non-empty. Empty here is per `isPlaceholder`
|
|
13
|
+
* (covers '', null, undefined, and known placeholder strings) — this is what
|
|
14
|
+
* lets interrogated/detected values overwrite the empty-string defaults that
|
|
15
|
+
* detectStack writes to human_context. */
|
|
16
|
+
export declare function fillEmpties(target: Record<string, unknown>, source: Record<string, unknown>): Record<string, unknown>;
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Relentless — the 6-W human-context extractor. "Never gives up on finding
|
|
3
|
+
* context" (the v5 RelentlessContextExtractor), rewritten v6-native + sync and
|
|
4
|
+
* realigned to FAF's no-guess doctrine: it reads EVERY source (manifest +
|
|
5
|
+
* README, tiered) but FILLS ONLY from sourced evidence. The v5 INFERRED tiers
|
|
6
|
+
* (guess from project name / tech stack) are deliberately dropped —
|
|
7
|
+
* sourced-or-empty; `faf go` is where the human confirms.
|
|
8
|
+
*
|
|
9
|
+
* Pairs with Turbo-Cat: Turbo-Cat fills STACK slots from file formats;
|
|
10
|
+
* Relentless fills the 6 HUMAN-CONTEXT slots (who/what/why/where/when/how) by
|
|
11
|
+
* reading. WHO is the target AUDIENCE (not the package author — a v5 conflation
|
|
12
|
+
* this rewrite corrects).
|
|
13
|
+
*/
|
|
14
|
+
export interface SeededContext {
|
|
15
|
+
who?: string;
|
|
16
|
+
what?: string;
|
|
17
|
+
why?: string;
|
|
18
|
+
where?: string;
|
|
19
|
+
when?: string;
|
|
20
|
+
how?: string;
|
|
21
|
+
}
|
|
22
|
+
export declare function relentlessContext(dir: string): SeededContext;
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
import type { DetectedFramework } from '../core/types.js';
|
|
2
|
+
interface PackageJson {
|
|
3
|
+
name?: string;
|
|
4
|
+
version?: string;
|
|
5
|
+
description?: string;
|
|
6
|
+
keywords?: string[];
|
|
7
|
+
dependencies?: Record<string, string>;
|
|
8
|
+
devDependencies?: Record<string, string>;
|
|
9
|
+
scripts?: Record<string, string>;
|
|
10
|
+
type?: string;
|
|
11
|
+
main?: string;
|
|
12
|
+
types?: string;
|
|
13
|
+
exports?: unknown;
|
|
14
|
+
bin?: string | Record<string, string>;
|
|
15
|
+
private?: boolean;
|
|
16
|
+
workspaces?: string[] | {
|
|
17
|
+
packages?: string[];
|
|
18
|
+
};
|
|
19
|
+
files?: string[];
|
|
20
|
+
}
|
|
21
|
+
/** Read and parse package.json from a directory */
|
|
22
|
+
export declare function readPackageJson(dir: string): PackageJson | null;
|
|
23
|
+
/** Detect frameworks in a directory */
|
|
24
|
+
export declare function detectFrameworks(dir: string): DetectedFramework[];
|
|
25
|
+
/** Detect the primary language of a project */
|
|
26
|
+
export declare function detectLanguage(dir: string): string;
|
|
27
|
+
/** Project-type detection result + rationale (the #found list).
|
|
28
|
+
* Each `found` entry is a human-readable signal that contributed to the
|
|
29
|
+
* classification — emitted as a YAML comment by `writeFaf` for transparency
|
|
30
|
+
* ("Glass Hood" doctrine: the user sees WHY the cli classified as it did). */
|
|
31
|
+
export interface ProjectTypeDetection {
|
|
32
|
+
type: string;
|
|
33
|
+
/** Signals that matched, in order observed. */
|
|
34
|
+
found: string[];
|
|
35
|
+
}
|
|
36
|
+
/** Detect the project type with rationale. The `found` list captures every
|
|
37
|
+
* positive signal that contributed to the classification — used downstream
|
|
38
|
+
* by `writeFaf` to render `# found: <list>` next to `type:` in the .faf.
|
|
39
|
+
*
|
|
40
|
+
* Priority order per v6.6.md doctrine (most-specific first). `about` is
|
|
41
|
+
* owner-declared, not auto-detected — never matches in this function.
|
|
42
|
+
* Rule: SDK keyword takes priority (sdk wins over library/cli/wasm). */
|
|
43
|
+
export declare function detectProjectTypeWithRationale(dir: string): ProjectTypeDetection;
|
|
44
|
+
/** Detect the project type for slot mapping. Backward-compatible wrapper —
|
|
45
|
+
* returns just the type string. New code should prefer
|
|
46
|
+
* `detectProjectTypeWithRationale` to access the `#found` rationale. */
|
|
47
|
+
export declare function detectProjectType(dir: string): string;
|
|
48
|
+
/** Detect the runtime */
|
|
49
|
+
export declare function detectRuntime(dir: string): string;
|
|
50
|
+
/** Detect package manager */
|
|
51
|
+
export declare function detectPackageManager(dir: string): string;
|
|
52
|
+
/** Detect CI/CD */
|
|
53
|
+
export declare function detectCicd(dir: string): string | null;
|
|
54
|
+
/** Detect hosting platform */
|
|
55
|
+
export declare function detectHosting(dir: string): string | null;
|
|
56
|
+
/** Detect SvelteKit adapter from svelte.config.js */
|
|
57
|
+
export declare function detectSvelteAdapter(dir: string): string | null;
|
|
58
|
+
/** Detect build tool */
|
|
59
|
+
export declare function detectBuildTool(dir: string): string | null;
|
|
60
|
+
/** Detect a list of important file paths for the KEY_FILES FAFB section.
|
|
61
|
+
* Returns up to ~10 entries, ordered by canonical importance. */
|
|
62
|
+
export declare function detectKeyFiles(dir: string): string[];
|
|
63
|
+
/** Detect build/test/lint commands for the COMMANDS FAFB section.
|
|
64
|
+
* Returns a Record<string, string> mapping command name → shell command. */
|
|
65
|
+
export declare function detectCommands(dir: string, pkg: PackageJson | null): Record<string, string>;
|
|
66
|
+
/** Detect a tech-stack list for the TECH_STACK FAFB section.
|
|
67
|
+
* Combines language + frameworks + runtime into a flat list of strings
|
|
68
|
+
* (matching the canonical xai-faf-rust project.faf shape). */
|
|
69
|
+
export declare function detectTechStack(dir: string, pkg: PackageJson | null, frameworks: DetectedFramework[], language: string): string[];
|
|
70
|
+
export {};
|
package/dist/index.d.ts
CHANGED
|
@@ -6,10 +6,15 @@ export { enrichScore, scoreFafYaml } from './core/scorer.js';
|
|
|
6
6
|
export { validateFaf } from './core/schema.js';
|
|
7
7
|
export { findFafFile, readFaf, readFafRaw } from './interop/faf.js';
|
|
8
8
|
export { generateProjectHtml, writeProjectHtml } from './interop/projecthtml.js';
|
|
9
|
-
export
|
|
10
|
-
export {
|
|
9
|
+
export { generateServerCard, writeServerCard, fafContextBlock, registryMeta, registryName, REGISTRY_PUBLISHER_KEY, } from './interop/servercard.js';
|
|
10
|
+
export type { ServerCardOptions } from './interop/servercard.js';
|
|
11
|
+
export type { InterviewQuestion, InterviewOption, GoalSeed, TableOf8, TableOf8Row, BoxStatus } from './core/interview.js';
|
|
12
|
+
export { INTERVIEW, SIX_WS_INTERVIEW, STACK_INTERVIEW, INTERVIEW_BY_PATH, INTERVIEW_PATHS, INTERVIEW_VERSION, questionForSlot, interviewForMissing, seedSixWsFromGoal, buildTableOf8, } from './core/interview.js';
|
|
11
13
|
export { BENCH_VERSION, deriveQuestionSet, publicQuestions, gradeAnswers, buildReceipt, normalizeAnswer, answersMatch, ALIAS_GROUPS, } from './commands/bench.js';
|
|
12
14
|
export type { BenchQuestion, QuestionSet, GradeResult, BenchState, RunRecord } from './commands/bench.js';
|
|
13
15
|
export { turboCatScan, turboCatSlots } from './detect/turbo-cat.js';
|
|
14
16
|
export type { TurboCatResult, DiscoveredFormat } from './detect/turbo-cat.js';
|
|
17
|
+
export { relentlessContext } from './detect/relentless.js';
|
|
18
|
+
export type { SeededContext } from './detect/relentless.js';
|
|
19
|
+
export { assembleFreshFaf } from './detect/assemble.js';
|
|
15
20
|
export * as kernel from './wasm/kernel.js';
|