faf 7.1.4 → 7.3.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 +31 -6
- package/dist/cli.js +272 -259
- package/dist/cli.js.map +53 -48
- package/dist/core/tiers.d.ts +4 -2
- package/dist/detect/go.d.ts +25 -0
- package/dist/fafm/from-claude-dir.d.ts +14 -0
- package/dist/fafm/index.d.ts +4 -0
- package/dist/fafm/soul.d.ts +71 -0
- package/dist/fafm/types.d.ts +41 -0
- package/dist/index.d.ts +2 -0
- package/dist/index.js +136 -135
- package/dist/index.js.map +24 -20
- package/package.json +6 -3
- package/project.faf +6 -3
package/dist/core/tiers.d.ts
CHANGED
|
@@ -1,14 +1,16 @@
|
|
|
1
1
|
import type { TierInfo } from './types.js';
|
|
2
2
|
/** Tier boundaries — ordered from highest to lowest
|
|
3
3
|
*
|
|
4
|
-
* Indicators:
|
|
5
|
-
*
|
|
4
|
+
* Indicators (work surfaces — CLI · code · docs · receipts):
|
|
5
|
+
* ✪ Proof Seal (Trophy 100% — work glyph; social still uses 🏆; brand uses Trophy Mark PNG)
|
|
6
6
|
* ★ filled star (gold — orange)
|
|
7
7
|
* ◆ filled diamond (silver — cyan)
|
|
8
8
|
* ◇ open diamond (bronze — deep cyan, one rung below silver)
|
|
9
9
|
* ● filled circle (mid tiers)
|
|
10
10
|
* ○ open circle (low — dim)
|
|
11
11
|
* ♡ heart (empty — good luck)
|
|
12
|
+
*
|
|
13
|
+
* All three 100% glyphs mean the same score: ✪ work · 🏆 social · Trophy Mark (PNG) visual.
|
|
12
14
|
*/
|
|
13
15
|
export declare const TIERS: TierInfo[];
|
|
14
16
|
/** Get the display badge for a tier */
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Go detection — CONTENT-AWARE go.mod classification.
|
|
3
|
+
*
|
|
4
|
+
* A go.mod alone does NOT mean "backend" or "CLI". The same module file backs
|
|
5
|
+
* libraries, HTTP servers (Gin / Echo / Fiber / Chi), CLIs (Cobra), and MCP
|
|
6
|
+
* servers (mcp-go). We read require paths and light layout signals, then branch.
|
|
7
|
+
*
|
|
8
|
+
* Same composition pattern as dart.ts: knowledge in go-detection.json, logic here.
|
|
9
|
+
* Turbo-Cat + scanner both call detectGoProject so they agree by construction.
|
|
10
|
+
*/
|
|
11
|
+
export type GoAppType = 'mcp' | 'backend' | 'cli' | 'library';
|
|
12
|
+
export interface GoProject {
|
|
13
|
+
/** faf app_type — MCP→mcp, server→backend, CLI→cli, else library. */
|
|
14
|
+
appType: GoAppType;
|
|
15
|
+
/** Module path from `module` line, or ''. */
|
|
16
|
+
modulePath: string;
|
|
17
|
+
/** Primary framework (Gin / Cobra / …) or ''. */
|
|
18
|
+
framework: string;
|
|
19
|
+
/** Human-readable rationale for the .faf `# found:` comment (Glass Hood). */
|
|
20
|
+
found: string;
|
|
21
|
+
}
|
|
22
|
+
/** Collect require module paths from go.mod (require X and require ( … ) blocks). */
|
|
23
|
+
export declare function goModRequires(content: string): Set<string>;
|
|
24
|
+
/** Classify a Go project from go.mod (+ light layout). Returns null if not Go. */
|
|
25
|
+
export declare function detectGoProject(dir: string): GoProject | null;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* fromClaudeDir — Claude Code memory store → knowledge Soul.
|
|
3
|
+
* Cite: claude-fafm-sdk 1.0 / fafm-engine serialize_memory approach.
|
|
4
|
+
* Not the proof convert_md_to_fafm (entries/v1.0 anti-pattern).
|
|
5
|
+
*/
|
|
6
|
+
import { Soul } from './soul.js';
|
|
7
|
+
export declare const DEFAULT_SKIP: Set<string>;
|
|
8
|
+
/**
|
|
9
|
+
* Convert a Claude Code memory directory into a knowledge Soul.
|
|
10
|
+
*/
|
|
11
|
+
export declare function fromClaudeDir(path: string, opts?: {
|
|
12
|
+
namepoint?: string;
|
|
13
|
+
skip?: Set<string>;
|
|
14
|
+
}): Soul;
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
/** .fafm knowledge-profile library (TS) — INTEROP with claude-fafm-sdk 1.0 */
|
|
2
|
+
export { PRIORITY_ORDER, PRIORITY_RANK, KNOWLEDGE_TYPES, type Fact, type Priority, type Profile, type SoulDoc, } from './types.js';
|
|
3
|
+
export { Soul, utcNow, canonicalPriority, factFromObj, factToObj, } from './soul.js';
|
|
4
|
+
export { fromClaudeDir, DEFAULT_SKIP } from './from-claude-dir.js';
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Soul — local .fafm model (TS mirror of claude-fafm-sdk 1.0 Soul).
|
|
3
|
+
* INTEROP: load/save fidelity, residual preserve, recall SoT.
|
|
4
|
+
*/
|
|
5
|
+
import { type Fact, type SoulDoc } from './types.js';
|
|
6
|
+
export declare function utcNow(): string;
|
|
7
|
+
export declare function canonicalPriority(p: string | null | undefined): string;
|
|
8
|
+
export declare function factFromObj(obj: unknown): Fact;
|
|
9
|
+
export declare function factToObj(f: Fact): unknown;
|
|
10
|
+
export declare class Soul {
|
|
11
|
+
namepoint: string;
|
|
12
|
+
profile: string;
|
|
13
|
+
retention: string;
|
|
14
|
+
created: string;
|
|
15
|
+
last_etched: string;
|
|
16
|
+
private _facts;
|
|
17
|
+
private _byId;
|
|
18
|
+
private _index;
|
|
19
|
+
private _sessions;
|
|
20
|
+
private _preferences;
|
|
21
|
+
private _custom;
|
|
22
|
+
private _extra;
|
|
23
|
+
private _memoryExtra;
|
|
24
|
+
constructor(namepoint: string, opts?: {
|
|
25
|
+
profile?: string;
|
|
26
|
+
facts?: Fact[];
|
|
27
|
+
retention?: string;
|
|
28
|
+
created?: string | null;
|
|
29
|
+
index?: string[];
|
|
30
|
+
sessions?: unknown[];
|
|
31
|
+
preferences?: Record<string, unknown>;
|
|
32
|
+
custom?: Record<string, unknown>;
|
|
33
|
+
extra?: Record<string, unknown>;
|
|
34
|
+
memoryExtra?: Record<string, unknown>;
|
|
35
|
+
});
|
|
36
|
+
get facts(): Fact[];
|
|
37
|
+
get index(): string[];
|
|
38
|
+
get sessions(): unknown[];
|
|
39
|
+
get preferences(): Record<string, unknown>;
|
|
40
|
+
get custom(): Record<string, unknown>;
|
|
41
|
+
get extra(): Record<string, unknown>;
|
|
42
|
+
get memoryExtra(): Record<string, unknown>;
|
|
43
|
+
static load(path: string): Soul;
|
|
44
|
+
static fromFile(path: string): Soul;
|
|
45
|
+
toDoc(): SoulDoc;
|
|
46
|
+
toYaml(): string;
|
|
47
|
+
rebuildIndex(width?: number): string[];
|
|
48
|
+
save(path: string, opts?: {
|
|
49
|
+
reindex?: boolean;
|
|
50
|
+
}): string;
|
|
51
|
+
toFile(path: string, opts?: {
|
|
52
|
+
reindex?: boolean;
|
|
53
|
+
}): string;
|
|
54
|
+
add(fact: Fact): Fact;
|
|
55
|
+
etch(text: string, opts?: {
|
|
56
|
+
id?: string;
|
|
57
|
+
type?: string;
|
|
58
|
+
priority?: string;
|
|
59
|
+
tags?: string[];
|
|
60
|
+
links?: string[];
|
|
61
|
+
source?: string;
|
|
62
|
+
}): Fact;
|
|
63
|
+
recall(query?: string | null, opts?: {
|
|
64
|
+
tags?: string[];
|
|
65
|
+
type?: string;
|
|
66
|
+
minPriority?: string;
|
|
67
|
+
limit?: number | null;
|
|
68
|
+
}): Fact[];
|
|
69
|
+
getFact(id: string): Fact | null;
|
|
70
|
+
deleteFact(id: string): boolean;
|
|
71
|
+
}
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* .fafm types — INTEROP-aligned with claude-fafm-sdk 1.0.0
|
|
3
|
+
* application/vnd.fafm+yaml v1.1
|
|
4
|
+
*/
|
|
5
|
+
export declare const PRIORITY_ORDER: readonly ["ephemeral", "standard", "high", "critical"];
|
|
6
|
+
export type Priority = (typeof PRIORITY_ORDER)[number];
|
|
7
|
+
export declare const PRIORITY_RANK: Record<string, number>;
|
|
8
|
+
export declare const KNOWLEDGE_TYPES: Set<string>;
|
|
9
|
+
export declare const KNOWN_DOC_KEYS: Set<string>;
|
|
10
|
+
export declare const KNOWN_MEMORY_KEYS: Set<string>;
|
|
11
|
+
export declare const LEGACY_PRIORITY: Record<string, Priority>;
|
|
12
|
+
export interface Fact {
|
|
13
|
+
text: string;
|
|
14
|
+
id?: string | null;
|
|
15
|
+
type?: string | null;
|
|
16
|
+
priority: Priority | string;
|
|
17
|
+
tags: string[];
|
|
18
|
+
links: string[];
|
|
19
|
+
timestamp?: string | null;
|
|
20
|
+
source?: string | null;
|
|
21
|
+
/** Unknown fact fields (INTEROP §4) */
|
|
22
|
+
extra: Record<string, unknown>;
|
|
23
|
+
}
|
|
24
|
+
export type Profile = 'voice' | 'knowledge';
|
|
25
|
+
export interface SoulDoc {
|
|
26
|
+
version: string;
|
|
27
|
+
profile: string;
|
|
28
|
+
namepoint: string;
|
|
29
|
+
created: string;
|
|
30
|
+
last_etched: string;
|
|
31
|
+
retention: string;
|
|
32
|
+
index: string[];
|
|
33
|
+
memory: {
|
|
34
|
+
facts: unknown[];
|
|
35
|
+
sessions: unknown[];
|
|
36
|
+
preferences: Record<string, unknown>;
|
|
37
|
+
custom: Record<string, unknown>;
|
|
38
|
+
[key: string]: unknown;
|
|
39
|
+
};
|
|
40
|
+
[key: string]: unknown;
|
|
41
|
+
}
|
package/dist/index.d.ts
CHANGED
|
@@ -8,6 +8,8 @@ export { findFafFile, readFaf, readFafRaw } from './interop/faf.js';
|
|
|
8
8
|
export { generateProjectHtml, writeProjectHtml } from './interop/projecthtml.js';
|
|
9
9
|
export { generateServerCard, writeServerCard, fafContextBlock, registryMeta, registryName, REGISTRY_PUBLISHER_KEY, } from './interop/servercard.js';
|
|
10
10
|
export type { ServerCardOptions } from './interop/servercard.js';
|
|
11
|
+
export { Soul as FafmSoul, fromClaudeDir, canonicalPriority, utcNow, PRIORITY_ORDER, PRIORITY_RANK, KNOWLEDGE_TYPES, } from './fafm/index.js';
|
|
12
|
+
export type { Fact as FafmFact, SoulDoc, Profile as FafmProfile } from './fafm/index.js';
|
|
11
13
|
export type { InterviewQuestion, InterviewOption, HumanSlotPath, SourcedSlotPath, GoalSeed, TableOf8, TableOf8Row, BoxStatus } from './core/interview.js';
|
|
12
14
|
export { INTERVIEW, SIX_WS_INTERVIEW, STACK_INTERVIEW, INTERVIEW_BY_PATH, INTERVIEW_PATHS, INTERVIEW_VERSION, questionForSlot, interviewForMissing, seedSixWsFromGoal, buildTableOf8, } from './core/interview.js';
|
|
13
15
|
export type { LoopStatus, LoopGaps, LoopVerdict, LoopRunStatus, LoopDeps, LoopRunOptions, LoopRunResult } from './core/loop.js';
|