@systemdox/mcp-server 0.1.46 → 0.1.48

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,53 @@
1
+ /**
2
+ * `systemdox-mcp-server sync-memory [--project <name>] [--dir <folder>]
3
+ * [--import <folder>] [--dry-run]`, and the core of the local MCP tool
4
+ * `sync_memory` (ADR-217 §2.3 with Amendment 2,
5
+ * specs/changes/team-setup/contract.md "sync-memory and the MCP tool
6
+ * sync_memory").
7
+ *
8
+ * 1. Pull: the team's latest version (`getMemory`), the base (state.json; with
9
+ * none, the empty manifest, while the push names the team's latest version)
10
+ * and the local folder.
11
+ * 2. People: every value in the shared files, grouped; `lookupValues`; in a
12
+ * terminal only, one question per unanswered value, then one y/N over the
13
+ * whole rewrite. Without a terminal nothing is asked or rewritten, and a
14
+ * file still holding a value is skipped and listed.
15
+ * 3. The merge (lib/memory-sync.ts), written to the local folder.
16
+ * 4. The push on the base; on 409 SYD-K010 pull, merge again and retry once.
17
+ * state.json takes the new base only after the push succeeds.
18
+ *
19
+ * Exit codes: 0 synced; 1 usage, no key, or the API refused; 2 the push was
20
+ * refused twice on a stale base.
21
+ */
22
+ import { SystemDoxApiClient } from "./lib/api-client.js";
23
+ import { type CommandIo } from "./lib/team-setup-files.js";
24
+ export declare const SYNC_MEMORY_USAGE = "Usage: systemdox-mcp-server sync-memory [--project <name>] [--dir <folder>] [--import <folder>] [--dry-run]";
25
+ export declare const SYNC_MEMORY_COMMAND = "npx -y @systemdox/mcp-server sync-memory";
26
+ export type SyncClient = Pick<SystemDoxApiClient, "getOwnTeamSetup" | "getMemory" | "readBlobs" | "findMissingBlobs" | "uploadBlobs" | "pushMemoryVersion" | "lookupValues" | "answerValues" | "fileMemoryPeople">;
27
+ export interface SyncMemoryArgs {
28
+ project?: string;
29
+ dir?: string;
30
+ importDir?: string;
31
+ dryRun: boolean;
32
+ }
33
+ export interface SyncMemoryOptions extends SyncMemoryArgs {
34
+ client: SyncClient;
35
+ /** Each argument is one line of the report. */
36
+ out: (...lines: string[]) => void;
37
+ /** A person at a terminal. Absent for the MCP tool, a hook or CI: then
38
+ * nothing is asked and nothing is rewritten. */
39
+ ask?: (question: string) => Promise<string>;
40
+ now?: () => Date;
41
+ }
42
+ export declare function parseSyncMemoryArgs(argv: string[]): SyncMemoryArgs;
43
+ /**
44
+ * Sync one project's team memory. Returns the exit code; every line of the
45
+ * report goes to `opts.out`.
46
+ */
47
+ export declare function syncMemory(opts: SyncMemoryOptions): Promise<number>;
48
+ /** The command: parse, find the key, sync. */
49
+ export declare function runSyncMemory(argv: string[], io: CommandIo & {
50
+ client?: SyncClient;
51
+ ask?: (question: string) => Promise<string>;
52
+ now?: () => Date;
53
+ }, env?: NodeJS.ProcessEnv): Promise<number>;