faf-cli 6.11.0 → 6.13.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 +34 -7
- package/dist/cli.js +242 -241
- package/dist/cli.js.map +12 -11
- package/dist/detect/dart.d.ts +29 -0
- package/dist/index.d.ts +2 -0
- package/dist/index.js +129 -127
- package/dist/index.js.map +10 -8
- package/dist/interop/servercard.d.ts +61 -0
- package/dist/interrogate/cargo.d.ts +1 -1
- package/dist/interrogate/readme.d.ts +1 -1
- package/package.json +4 -3
- package/project.faf +1 -1
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
import type { FafData } from '../core/types.js';
|
|
2
|
+
/**
|
|
3
|
+
* Generate an MCP Server Card (SEP-2127) from a .faf.
|
|
4
|
+
*
|
|
5
|
+
* The card is a published discovery manifest. By design it carries the FAF
|
|
6
|
+
* context-block in `_meta["one.faf/context"]` — so every Server Card produced
|
|
7
|
+
* through FAF ships FAF context by default. This emitter is the SINGLE SOURCE of
|
|
8
|
+
* the block — faf-server-card-ref and `.fafa` provenance compose it (never
|
|
9
|
+
* hand-roll), so every surface is byte-identical by construction: one context,
|
|
10
|
+
* one source, every door.
|
|
11
|
+
*
|
|
12
|
+
* Honest-first: no score is baked (it would go stale on disk); the block points
|
|
13
|
+
* to the .faf and asserts the score is deterministic. The card omits `remotes`
|
|
14
|
+
* unless a deployment URL is supplied — it must not claim an endpoint it lacks.
|
|
15
|
+
*/
|
|
16
|
+
export interface ServerCardOptions {
|
|
17
|
+
/** Pointer to the .faf context (default: ./project.faf). Pass an absolute URL
|
|
18
|
+
* for a remote/served card (e.g. faf-server-card-ref at context.faf.one). */
|
|
19
|
+
fafPointer?: string;
|
|
20
|
+
/** Optional live endpoint; adds a streamable-http remote when set. */
|
|
21
|
+
remoteUrl?: string;
|
|
22
|
+
/** Optional "verify the score here" URL — makes verify-don't-trust actionable
|
|
23
|
+
* (faf-server-card-ref uses https://faf.one). Omitted from the block if unset. */
|
|
24
|
+
scoreEndpoint?: string;
|
|
25
|
+
/** Override timestamp (tests); otherwise .faf `generated`, else now. */
|
|
26
|
+
now?: string;
|
|
27
|
+
}
|
|
28
|
+
/**
|
|
29
|
+
* The canonical FAF context-block — the value of `_meta["one.faf/context"]`,
|
|
30
|
+
* identical across every surface (Server Card, registry `server.json`, `.fafa`):
|
|
31
|
+
* one context, every door. Honest-first: no score baked (it would go stale on
|
|
32
|
+
* disk); it points to the .faf and asserts the score is deterministic.
|
|
33
|
+
*/
|
|
34
|
+
export declare function fafContextBlock(data: FafData, opts?: ServerCardOptions): Record<string, unknown>;
|
|
35
|
+
/** Build the Server Card object from .faf data. */
|
|
36
|
+
export declare function generateServerCard(data: FafData, opts?: ServerCardOptions): Record<string, unknown>;
|
|
37
|
+
export declare const REGISTRY_PUBLISHER_KEY = "io.modelcontextprotocol.registry/publisher-provided";
|
|
38
|
+
/**
|
|
39
|
+
* Build the `_meta` for an MCP Registry `server.json`.
|
|
40
|
+
*
|
|
41
|
+
* The SAME canonical context-block as the Server Card, but nested under
|
|
42
|
+
* `io.modelcontextprotocol.registry/publisher-provided` — the ONLY `_meta` key
|
|
43
|
+
* the official registry preserves on publish. Top-level keys (the way the card
|
|
44
|
+
* carries `one.faf/context`) are silently dropped by the registry. Throws if the
|
|
45
|
+
* block exceeds the registry's 4KB cap. Merge the result into an existing
|
|
46
|
+
* `server.json` `_meta`; don't regenerate the manifest (packages/mcpb are tuned).
|
|
47
|
+
*/
|
|
48
|
+
export declare function registryMeta(data: FafData, opts?: ServerCardOptions): Record<string, unknown>;
|
|
49
|
+
/** The canonical reverse-DNS registry name, e.g. `one.faf/claude-faf-mcp`.
|
|
50
|
+
*
|
|
51
|
+
* HOMEPAGE REQUIRED: the namespace is derived from `project.homepage`'s host
|
|
52
|
+
* (faf.one -> one.faf). With no homepage/website/url the namespace falls back
|
|
53
|
+
* to `local/<name>`. This can't silently ship — the migration is guarded
|
|
54
|
+
* (`rewrite-server-json.ts` refuses any name that isn't `one.faf/*`) — but set
|
|
55
|
+
* `homepage: https://faf.one` in the .faf to get the correct `one.faf/<name>`. */
|
|
56
|
+
export declare function registryName(data: FafData): string;
|
|
57
|
+
/** Write the Server Card to a `server-card` file. Returns the path.
|
|
58
|
+
* Per experimental-ext-server-card#22 the reserved location is
|
|
59
|
+
* `<streamable-http-url>/server-card` (no longer `.well-known`); serve the
|
|
60
|
+
* emitted file there as `application/mcp-server-card+json`. */
|
|
61
|
+
export declare function writeServerCard(dir: string, data: FafData, opts?: ServerCardOptions): string;
|
|
@@ -5,6 +5,6 @@
|
|
|
5
5
|
* package.json's `description` — a one-line elevator pitch. It maps to
|
|
6
6
|
* `project.goal` (overarching/use-case framing).
|
|
7
7
|
*/
|
|
8
|
-
import type
|
|
8
|
+
import { type ExtractedContext } from './types.js';
|
|
9
9
|
/** Read Cargo.toml and extract per-slot content. Returns {} if no Cargo.toml. */
|
|
10
10
|
export declare function interrogateCargo(dir: string): ExtractedContext;
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
* If the anchor is missing or the content fails validation → return undefined.
|
|
7
7
|
* No slot is synthesized from another slot's content.
|
|
8
8
|
*/
|
|
9
|
-
import type
|
|
9
|
+
import { type ExtractedContext } from './types.js';
|
|
10
10
|
/** Extract `project.goal` — first prose paragraph or ## Use Case / ## Goal */
|
|
11
11
|
export declare function extractGoal(content: string): string | undefined;
|
|
12
12
|
/** Extract `human_context.what` — ## About / ## Description / ## Overview */
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "faf-cli",
|
|
3
|
-
"version": "6.
|
|
4
|
-
"description": "Persistent AI Context Standard — project DNA for AI. IANA-registered. Anthropic-
|
|
3
|
+
"version": "6.13.0",
|
|
4
|
+
"description": "Persistent AI Context Standard — project DNA for AI. IANA-registered. Anthropic-merged.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"icon": "https://faf.one/orange-smiley.svg",
|
|
7
7
|
"logo": "https://faf.one/orange-smiley.svg",
|
|
@@ -25,7 +25,8 @@
|
|
|
25
25
|
],
|
|
26
26
|
"scripts": {
|
|
27
27
|
"dev": "bun src/cli.ts",
|
|
28
|
-
"
|
|
28
|
+
"clean": "rm -rf dist",
|
|
29
|
+
"build": "bun run clean && bun build src/cli.ts --outdir dist --target=node --minify --sourcemap=linked --external faf-scoring-kernel --external open && bun build src/index.ts --outdir dist --target=node --minify --sourcemap=linked --external faf-scoring-kernel --external open && tsc -p tsconfig.build.json",
|
|
29
30
|
"compile": "bun build src/cli.ts --compile --bytecode --minify --outfile faf",
|
|
30
31
|
"compile:all": "bun build src/cli.ts --compile --bytecode --minify --target=bun-darwin-arm64 --outfile faf-darwin-arm64 && bun build src/cli.ts --compile --bytecode --minify --target=bun-darwin-x64 --outfile faf-darwin-x64 && bun build src/cli.ts --compile --bytecode --minify --target=bun-linux-x64 --outfile faf-linux-x64 && bun build src/cli.ts --compile --bytecode --minify --target=bun-windows-x64 --outfile faf-windows-x64.exe",
|
|
31
32
|
"test": "bun test --timeout=120000",
|
package/project.faf
CHANGED
|
@@ -26,7 +26,7 @@ stack:
|
|
|
26
26
|
storage: slotignored
|
|
27
27
|
human_context:
|
|
28
28
|
who: Developers and teams using AI coding assistants
|
|
29
|
-
what: Persistent AI Context Standard — project DNA for AI. IANA-registered. Anthropic-
|
|
29
|
+
what: Persistent AI Context Standard — project DNA for AI. IANA-registered. Anthropic-merged.
|
|
30
30
|
why: Eliminates 91% context re-discovery tax — define once, AI remembers forever
|
|
31
31
|
where: npm registry, Homebrew, GitHub
|
|
32
32
|
when: Production since September 2025, v6.0 March 2026
|