faf 8.9.0 → 8.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 +25 -23
- package/dist/cli.js +364 -346
- package/dist/cli.js.map +1 -1
- package/dist/core/dot-path.d.ts +23 -0
- package/dist/core/interview.d.ts +18 -6
- package/dist/core/suggest.d.ts +55 -0
- package/dist/detect/assemble.d.ts +4 -2
- package/dist/detect/relentless.d.ts +3 -2
- package/dist/index.d.ts +2 -0
- package/dist/index.js +179 -178
- package/dist/index.js.map +1 -1
- package/dist/interop/agents.d.ts +7 -5
- package/dist/interop/claude.d.ts +1 -1
- package/dist/interop/copilot-instructions.d.ts +2 -2
- package/dist/interop/cursorrules.d.ts +2 -2
- package/dist/interop/faf.d.ts +16 -0
- package/dist/interop/gemini.d.ts +2 -2
- package/dist/interop/labels.d.ts +29 -0
- package/dist/interrogate/readme.d.ts +9 -0
- package/dist/interrogate/types.d.ts +34 -0
- package/package.json +2 -2
- package/project.faf +5 -5
package/dist/interop/agents.d.ts
CHANGED
|
@@ -5,11 +5,13 @@ import type { FafData } from '../core/types.js';
|
|
|
5
5
|
* Deterministic projection from curated TRUTH — facts, not hallucinated prose
|
|
6
6
|
* (Gloaguen: LLM freewrite hurts). Sections: orientation · setup · verify ·
|
|
7
7
|
* map · conventions · three-tier guardrails · DoD · when stuck · security ·
|
|
8
|
-
* commit.
|
|
9
|
-
*
|
|
8
|
+
* commit · project facts. AGENTS.md does not copy the six W's: it points to
|
|
9
|
+
* the facts file (project.faf), which holds them. GEMINI.md, .cursorrules,
|
|
10
|
+
* CLAUDE.md and Copilot carry them (labels.ts sixWsFilled).
|
|
10
11
|
*
|
|
11
12
|
* Design: BETTER guide + hand exemplar (faf-cli AGENTS.md) + agents-md-facts.
|
|
12
13
|
*/
|
|
13
|
-
export declare function renderAgentsMd(data: FafData): string;
|
|
14
|
-
/** Write AGENTS.md — non-destructive: injects/updates the faf block, preserves the rest.
|
|
15
|
-
|
|
14
|
+
export declare function renderAgentsMd(data: FafData, factsRef?: string): string;
|
|
15
|
+
/** Write AGENTS.md — non-destructive: injects/updates the faf block, preserves the rest.
|
|
16
|
+
* factsRef: the facts file's path relative to `dir` (default `project.faf`). */
|
|
17
|
+
export declare function writeAgentsMd(dir: string, data: FafData, factsRef?: string): void;
|
package/dist/interop/claude.d.ts
CHANGED
|
@@ -34,6 +34,6 @@ export interface FafMetaOpts {
|
|
|
34
34
|
*/
|
|
35
35
|
export declare function fafMetaTag(data: FafData, opts?: FafMetaOpts): string;
|
|
36
36
|
/** Render CLAUDE.md content from .faf data */
|
|
37
|
-
export declare function renderClaudeMd(data: FafData): string;
|
|
37
|
+
export declare function renderClaudeMd(data: FafData, factsRef?: string): string;
|
|
38
38
|
/** Extract project data from CLAUDE.md content (pull direction) */
|
|
39
39
|
export declare function parseClaudeMd(content: string): Partial<FafData>;
|
|
@@ -18,10 +18,10 @@ import type { FafData } from '../core/types.js';
|
|
|
18
18
|
* already consume the richer slots Option B will add (test/lint/run, …), so this
|
|
19
19
|
* emitter is built once and grows with the data.
|
|
20
20
|
*/
|
|
21
|
-
export declare function renderCopilotInstructions(data: FafData): string;
|
|
21
|
+
export declare function renderCopilotInstructions(data: FafData, factsRef?: string): string;
|
|
22
22
|
/**
|
|
23
23
|
* Write `.github/copilot-instructions.md` — non-destructive (injects/updates the
|
|
24
24
|
* faf block, preserves the rest). Creates the `.github/` directory if absent.
|
|
25
25
|
* The project folder is the boundary: a `.github` linked outside it is refused.
|
|
26
26
|
*/
|
|
27
|
-
export declare function writeCopilotInstructions(dir: string, data: FafData): void;
|
|
27
|
+
export declare function writeCopilotInstructions(dir: string, data: FafData, factsRef?: string): void;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { FafData } from '../core/types.js';
|
|
2
2
|
/** Render .cursorrules content from .faf data */
|
|
3
|
-
export declare function renderCursorrules(data: FafData): string;
|
|
3
|
+
export declare function renderCursorrules(data: FafData, factsRef?: string): string;
|
|
4
4
|
/** Write .cursorrules — non-destructive: injects/updates the faf block (hash-comment markers), preserves the rest. */
|
|
5
|
-
export declare function writeCursorrules(dir: string, data: FafData): void;
|
|
5
|
+
export declare function writeCursorrules(dir: string, data: FafData, factsRef?: string): void;
|
package/dist/interop/faf.d.ts
CHANGED
|
@@ -79,6 +79,9 @@ export interface WriteFafOptions {
|
|
|
79
79
|
* overwrite (`faf init --new` / `--force`, `faf git --force`). Default: an existing
|
|
80
80
|
* file is updated in place with {@link updateFafFile}. */
|
|
81
81
|
replace?: boolean;
|
|
82
|
+
/** Called when `replace` overwrote an existing file after keeping
|
|
83
|
+
* `path.bak-<timestamp>`. */
|
|
84
|
+
onReplacedBackup?: (backupPath: string) => void;
|
|
82
85
|
/** Called for each alias of an existing file that `data` would change
|
|
83
86
|
* (`stack: *base` while `data.stack` has more keys): faf leaves it as
|
|
84
87
|
* written — it never replaces or expands an alias — and that path is not
|
|
@@ -139,3 +142,16 @@ export declare function findFafFile(dir?: string): string | null;
|
|
|
139
142
|
* tracked AND untracked .faf (it's the cwd's location under the root, not file status).
|
|
140
143
|
* Caller must already be inside a git repo. */
|
|
141
144
|
export declare function gitRepoRel(fafPath: string, cwd?: string): string;
|
|
145
|
+
/**
|
|
146
|
+
* How the context files faf writes into `dir` name the facts file: the AGENTS.md
|
|
147
|
+
* pointer, the `claim=` stamp and the "Authored from" line. One rule for every
|
|
148
|
+
* file: the path from `dir` (the folder faf writes into, the project folder by
|
|
149
|
+
* default) to the real facts file, also for a file in a subfolder such as
|
|
150
|
+
* `.github/copilot-instructions.md`. It names the facts file; it is not a link
|
|
151
|
+
* relative to each file. It finds a legacy `.faf` or a project.faf one folder
|
|
152
|
+
* up, and uses real paths so a symlinked folder still resolves. When `dir` is
|
|
153
|
+
* outside the project (an `--output` elsewhere), the path would climb out and
|
|
154
|
+
* carry this machine's folders into a file meant to be shared, so it is the
|
|
155
|
+
* file name alone.
|
|
156
|
+
*/
|
|
157
|
+
export declare function factsRefFor(dir: string, fafPath: string): string;
|
package/dist/interop/gemini.d.ts
CHANGED
|
@@ -7,6 +7,6 @@ import type { FafData } from '../core/types.js';
|
|
|
7
7
|
* required actions — not the AGENTS.md BETTER ladder, which is a different
|
|
8
8
|
* spec for a different reader.
|
|
9
9
|
*/
|
|
10
|
-
export declare function renderGeminiMd(data: FafData): string;
|
|
10
|
+
export declare function renderGeminiMd(data: FafData, factsRef?: string): string;
|
|
11
11
|
/** Write GEMINI.md — non-destructive: injects/updates the faf block, preserves the rest. */
|
|
12
|
-
export declare function writeGeminiMd(dir: string, data: FafData): void;
|
|
12
|
+
export declare function writeGeminiMd(dir: string, data: FafData, factsRef?: string): void;
|
package/dist/interop/labels.d.ts
CHANGED
|
@@ -17,6 +17,35 @@ export declare const ACRONYMS: Set<string>;
|
|
|
17
17
|
export declare function titleLabel(key: string): string;
|
|
18
18
|
/** A slot value that carries real content (not empty, not slotignored). */
|
|
19
19
|
export declare function filled(v: unknown): v is string;
|
|
20
|
+
/**
|
|
21
|
+
* A six-W value as one line of text, or null when the slot does not count as
|
|
22
|
+
* filled. Same rule as the scorer: empty, `slotignored` and placeholder words
|
|
23
|
+
* (TBD, None, N/A, …; isPlaceholder) are not facts. Numbers, booleans, dates
|
|
24
|
+
* and lists are facts and render as text. Line breaks and runs of spaces
|
|
25
|
+
* become one space, so a value never opens a new line in the host file. Files
|
|
26
|
+
* that put a bullet or comment marker before each value (CLAUDE.md, GEMINI.md,
|
|
27
|
+
* .cursorrules, Copilot, MEMORY.md) are then safe; llms.txt writes values on
|
|
28
|
+
* their own line and escapes a leading Markdown marker itself (llms.ts).
|
|
29
|
+
* One slot, one fact, one line.
|
|
30
|
+
*/
|
|
31
|
+
export declare function factText(v: unknown): string | null;
|
|
32
|
+
/**
|
|
33
|
+
* The fact at `path` in .faf data as one line (factText), with numbers as
|
|
34
|
+
* written in the file. YAML reads an unquoted `2026.10`, `0x1F` or `1e3` as a
|
|
35
|
+
* number and loses the text; this puts it back from the file faf read, so every
|
|
36
|
+
* context file shows what the person wrote. Data that was not read from a file
|
|
37
|
+
* (no source recorded) renders as before.
|
|
38
|
+
*/
|
|
39
|
+
export declare function factAt(data: object, path: readonly string[]): string | null;
|
|
40
|
+
/**
|
|
41
|
+
* The filled six W's, in fixed order, as [label, value] pairs ("Who", "What",
|
|
42
|
+
* "Why", "Where", "When", "How"). One source for every context file faf writes
|
|
43
|
+
* (CLAUDE.md, GEMINI.md, .cursorrules, Copilot), so they agree word for word.
|
|
44
|
+
* Each renderer formats the pairs in its host file's own style.
|
|
45
|
+
*/
|
|
46
|
+
export declare function sixWsFilled(data: {
|
|
47
|
+
human_context?: unknown;
|
|
48
|
+
}): [string, string][];
|
|
20
49
|
/**
|
|
21
50
|
* The canonical display label for a .faf slot path, sourced from the slot
|
|
22
51
|
* registry ("know your stack") — `stack.cicd` → "CI/CD", `stack.api_type` → "API".
|
|
@@ -23,3 +23,12 @@ export declare function extractWhen(content: string): string | undefined;
|
|
|
23
23
|
export declare function extractHow(content: string): string | undefined;
|
|
24
24
|
/** Read README.md and extract per-slot content. Returns {} if no README. */
|
|
25
25
|
export declare function interrogateReadme(dir: string): ExtractedContext;
|
|
26
|
+
/** A README find with where it came from: `README.md § Status`. */
|
|
27
|
+
export interface ReadmeFind {
|
|
28
|
+
value: string;
|
|
29
|
+
source: string;
|
|
30
|
+
}
|
|
31
|
+
/** The README's goal and six W's, each with its source — suggestions for the
|
|
32
|
+
* human to confirm in `faf go`, never written to project.faf by init or auto.
|
|
33
|
+
* Same anchors and slop rules as the extractors above. {} if no README. */
|
|
34
|
+
export declare function interrogateReadmeSourced(dir: string): Record<string, ReadmeFind>;
|
|
@@ -53,6 +53,21 @@ export interface ExtractedContext {
|
|
|
53
53
|
example?: string;
|
|
54
54
|
};
|
|
55
55
|
}
|
|
56
|
+
/** The README headings that hold each slot's fact — one list, shared by the
|
|
57
|
+
* README interrogator and Relentless. Each is matched as the whole heading
|
|
58
|
+
* (regex source, case-insensitive; groups must be non-capturing). Left out,
|
|
59
|
+
* because they usually hold a misplaced fact: Release / Roadmap (the release
|
|
60
|
+
* process, future plans), History (a changelog), Design (visual design),
|
|
61
|
+
* About (the author), Users (an adopters list). */
|
|
62
|
+
export declare const SECTION_HEADINGS: {
|
|
63
|
+
readonly goal: readonly ["use\\s+cases?", "goals?"];
|
|
64
|
+
readonly what: readonly ["description", "overview", "purpose", "introduction", "what", "what\\s+is\\s+(?!new\\b)\\S+", "what\\s+it\\s+does"];
|
|
65
|
+
readonly who: readonly ["audience", "target\\s+audience", "for\\s+whom", "who", "who\\s+is\\s+(?:this|it)\\s+for", "who\\s+it.s\\s+for"];
|
|
66
|
+
readonly why: readonly ["why", "why\\s+(?:use\\s+)?(?!not\\b)\\S+", "motivations?", "(?:the\\s+)?problem", "rationale", "mission", "vision"];
|
|
67
|
+
readonly where: readonly ["deployment", "where", "where\\s+it\\s+runs", "hosting", "platforms", "supported\\s+platforms", "platform\\s+support"];
|
|
68
|
+
readonly when: readonly ["status", "(?:project|current)\\s+status", "timeline", "since", "launched"];
|
|
69
|
+
readonly how: readonly ["architecture", "how", "how\\s+it\\s+works", "how\\s+does\\s+it\\s+work", "under\\s+the\\s+hood", "internals", "approach", "methodology"];
|
|
70
|
+
};
|
|
56
71
|
/** Confidence threshold rules for extracted text — empty if violated */
|
|
57
72
|
export declare const EXTRACTION_LIMITS: {
|
|
58
73
|
/** Minimum length for a slot to be considered worth filling (in chars) */
|
|
@@ -62,5 +77,24 @@ export declare const EXTRACTION_LIMITS: {
|
|
|
62
77
|
};
|
|
63
78
|
/** Generic slop patterns — extracted text matching these is rejected */
|
|
64
79
|
export declare const SLOP_PATTERNS: readonly RegExp[];
|
|
80
|
+
/** A notice, not a description of the project: maintenance status,
|
|
81
|
+
* sponsors, hiring, where the docs are, requirements, a move or a mirror,
|
|
82
|
+
* merch, a question, a status label or an emoji-led feature label. Fine in
|
|
83
|
+
* `when` (## Status: "No longer maintained since 2024"), never the goal. */
|
|
84
|
+
export declare function isNotice(t: string): boolean;
|
|
85
|
+
/** A callout or banner, not a description: a GitHub admonition, a warning
|
|
86
|
+
* sign, or pre-release phrasing ("Nightly release, expect rough edges"). */
|
|
87
|
+
export declare function isCallout(t: string): boolean;
|
|
88
|
+
/** Lines without a setext title at the top ("Title" over "-----" or
|
|
89
|
+
* "=====") — it is the title, not the first paragraph. */
|
|
90
|
+
export declare function dropSetextTitle(lines: string[]): string[];
|
|
65
91
|
/** Validate extracted text against the no-guess/no-slop doctrine */
|
|
66
92
|
export declare function isValidExtraction(text: string): boolean;
|
|
93
|
+
/** The first sentence of `text` — whole, ending at its own full stop — or
|
|
94
|
+
* null when there is none, or when it is a question (not a fact). For a
|
|
95
|
+
* first paragraph too long to be a slot: its opening sentence is usually the
|
|
96
|
+
* fact ("Flask is a lightweight WSGI web application framework."), and a
|
|
97
|
+
* whole sentence is never a cut. A stop after `e.g.`, `i.e.`, `vs.`, `Dr.`
|
|
98
|
+
* or an ellipsis does not end it; after `etc.` or initials (`U.S.`) it ends
|
|
99
|
+
* only when the next word starts a sentence. */
|
|
100
|
+
export declare function firstSentence(text: string): string | null;
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "faf",
|
|
3
|
-
"version": "8.
|
|
4
|
-
"description": "Persistent AI context + memory — .faf and .fafm, IANA-registered. Anthropic-merged.",
|
|
3
|
+
"version": "8.11.0",
|
|
4
|
+
"description": "Persistent AI context + memory — .faf and .fafm, IANA-registered. AI suggests your goal and six W's, you confirm, and every agent file faf writes carries them. Anthropic-merged.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"icon": "https://faf.one/orange-smiley.svg",
|
|
7
7
|
"logo": "https://faf.one/orange-smiley.svg",
|
package/project.faf
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
faf_version: "3.0"
|
|
2
2
|
project:
|
|
3
3
|
name: faf-cli
|
|
4
|
-
version: "8.
|
|
5
|
-
goal: "CLI for IANA-registered
|
|
4
|
+
version: "8.11.0"
|
|
5
|
+
goal: "CLI for IANA-registered .faf + .fafm — context DNA and portable agent memory, scored by the always-33 engine"
|
|
6
6
|
main_language: TypeScript
|
|
7
7
|
type: cli # found: package.json bin
|
|
8
8
|
# Commands + key_files feed `faf export --agents` (hand values win over detection).
|
|
@@ -58,11 +58,11 @@ stack:
|
|
|
58
58
|
storage: slotignored
|
|
59
59
|
human_context:
|
|
60
60
|
who: Developers and teams using AI coding assistants
|
|
61
|
-
what:
|
|
61
|
+
what: IANA-registered CLI for persistent project context and agent memory
|
|
62
62
|
why: Ends context re-discovery — define once, AI remembers forever
|
|
63
63
|
where: npm registry, Homebrew, GitHub
|
|
64
|
-
when: Production since September 2025; Bun-native since v6
|
|
65
|
-
how:
|
|
64
|
+
when: Production since September 2025; Bun-native since v6
|
|
65
|
+
how: Detects the stack from repo files and scores with the always-33 WASM kernel; the goal and six W's are only suggested, never written
|
|
66
66
|
monorepo:
|
|
67
67
|
packages_count: slotignored
|
|
68
68
|
build_orchestrator: slotignored
|