faf-cli 7.1.4 → 7.2.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.
@@ -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';