@fonlan/dsh-gitmemo 0.1.5 → 0.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 +63 -65
- package/README.zh.md +55 -61
- package/cordis.patch.yml +10 -3
- package/lib/cli.d.ts +2 -0
- package/lib/cli.js +173 -0
- package/lib/index.d.ts +42 -38
- package/lib/index.js +243 -154
- package/lib/mem.d.ts +274 -65
- package/lib/mem.js +1442 -470
- package/lib/migrate.d.ts +73 -0
- package/lib/migrate.js +566 -0
- package/package.json +13 -7
package/lib/index.d.ts
CHANGED
|
@@ -2,14 +2,21 @@
|
|
|
2
2
|
* dsh-gitmemo — Git-backed long-term memory for DeepSeek Harness.
|
|
3
3
|
*
|
|
4
4
|
* A Cordis plugin mirroring gitmemo (https://github.com/fonlan/gitmemo):
|
|
5
|
-
* the agent stores completed task outcomes as markdown
|
|
6
|
-
* `.mem` git repository
|
|
5
|
+
* the root agent stores completed task outcomes as immutable markdown
|
|
6
|
+
* entries in a local `.mem` git repository (single `main` branch, structured
|
|
7
|
+
* commit messages) and searches them before starting new work.
|
|
7
8
|
*
|
|
8
|
-
*
|
|
9
|
-
* -
|
|
10
|
-
*
|
|
11
|
-
*
|
|
12
|
-
*
|
|
9
|
+
* Mechanism:
|
|
10
|
+
* - only ROOT agents (delegationDepth === 0) receive the gitmemo workflow
|
|
11
|
+
* section and the five `mem_*` tools, scoped into `agent.ctx` at
|
|
12
|
+
* `agent/created`; subagents carry neither (no token cost, no duplicate
|
|
13
|
+
* memory writes);
|
|
14
|
+
* - registration performs zero Git I/O;
|
|
15
|
+
* - no session-start seeding, no synchronous git runners, no branch
|
|
16
|
+
* alignment — `.mem` permanently stays on `main`;
|
|
17
|
+
* - the previous `mem_init` tool is gone from the model surface; legacy
|
|
18
|
+
* argument shapes are accepted for one version by the core engine
|
|
19
|
+
* compatibility adapter, while the model-facing schemas stay strict.
|
|
13
20
|
*
|
|
14
21
|
* @module dsh-gitmemo
|
|
15
22
|
*/
|
|
@@ -18,37 +25,34 @@ import z from "@deepseek-ai/schemastery";
|
|
|
18
25
|
declare const name = "dsh-gitmemo";
|
|
19
26
|
/** Host services this plugin needs. */
|
|
20
27
|
declare const inject: string[];
|
|
21
|
-
/** Plugin configuration
|
|
28
|
+
/** Plugin configuration. */
|
|
22
29
|
declare const Config: z<Schemastery.ObjectS<{
|
|
23
|
-
/**
|
|
30
|
+
/** @deprecated — the memory dir is fixed at `<projectRoot>/.mem`; kept for one version. */
|
|
24
31
|
memDirName: z<string, string>;
|
|
25
|
-
/** Max search hits per mem_search call. Default 20. */
|
|
32
|
+
/** Max search hits per mem_search call (page size). Default 20. */
|
|
26
33
|
searchLimit: z<number, number>;
|
|
27
|
-
/**
|
|
34
|
+
/** @deprecated — `.mem` always stays on main; kept for one version, no effect. */
|
|
28
35
|
branchAlign: z<boolean, boolean>;
|
|
29
|
-
/**
|
|
36
|
+
/** @deprecated — session-start recent seeding was removed; kept for one version, no effect. */
|
|
30
37
|
recentContextLimit: z<number, number>;
|
|
38
|
+
/** Cross-process lock wait timeout in milliseconds. Default 30000. */
|
|
39
|
+
lockTimeoutMs: z<number, number>;
|
|
31
40
|
/** Optional explicit project root; defaults to the calling session's cwd. */
|
|
32
41
|
projectRoot: z<string, string>;
|
|
33
42
|
}>, Schemastery.ObjectT<{
|
|
34
|
-
/**
|
|
43
|
+
/** @deprecated — the memory dir is fixed at `<projectRoot>/.mem`; kept for one version. */
|
|
35
44
|
memDirName: z<string, string>;
|
|
36
|
-
/** Max search hits per mem_search call. Default 20. */
|
|
45
|
+
/** Max search hits per mem_search call (page size). Default 20. */
|
|
37
46
|
searchLimit: z<number, number>;
|
|
38
|
-
/**
|
|
47
|
+
/** @deprecated — `.mem` always stays on main; kept for one version, no effect. */
|
|
39
48
|
branchAlign: z<boolean, boolean>;
|
|
40
|
-
/**
|
|
49
|
+
/** @deprecated — session-start recent seeding was removed; kept for one version, no effect. */
|
|
41
50
|
recentContextLimit: z<number, number>;
|
|
51
|
+
/** Cross-process lock wait timeout in milliseconds. Default 30000. */
|
|
52
|
+
lockTimeoutMs: z<number, number>;
|
|
42
53
|
/** Optional explicit project root; defaults to the calling session's cwd. */
|
|
43
54
|
projectRoot: z<string, string>;
|
|
44
55
|
}>>;
|
|
45
|
-
interface ResolvedConfig {
|
|
46
|
-
memDirName: string;
|
|
47
|
-
searchLimit: number;
|
|
48
|
-
branchAlign: boolean;
|
|
49
|
-
recentContextLimit: number;
|
|
50
|
-
projectRoot?: string;
|
|
51
|
-
}
|
|
52
56
|
/** Shape of the agent payload received by an `agent/created` listener. */
|
|
53
57
|
interface CreatedAgent {
|
|
54
58
|
id: string;
|
|
@@ -59,8 +63,11 @@ interface CreatedAgent {
|
|
|
59
63
|
};
|
|
60
64
|
};
|
|
61
65
|
ctx: {
|
|
66
|
+
tools: {
|
|
67
|
+
register(tool: unknown): unknown;
|
|
68
|
+
};
|
|
62
69
|
systemPrompt: {
|
|
63
|
-
|
|
70
|
+
section(section: {
|
|
64
71
|
name: string;
|
|
65
72
|
order: number;
|
|
66
73
|
text: string;
|
|
@@ -69,26 +76,23 @@ interface CreatedAgent {
|
|
|
69
76
|
};
|
|
70
77
|
}
|
|
71
78
|
/**
|
|
72
|
-
* Register the plugin:
|
|
73
|
-
*
|
|
74
|
-
*
|
|
79
|
+
* Register the plugin: root-agent-scoped mem tools + workflow rules. No
|
|
80
|
+
* global tool registration, no session-start seeding, no Git I/O at
|
|
81
|
+
* registration time.
|
|
75
82
|
*/
|
|
76
83
|
declare function apply(ctx: {
|
|
77
|
-
tools: {
|
|
78
|
-
register(tool: unknown): unknown;
|
|
79
|
-
};
|
|
80
|
-
systemPrompt: {
|
|
81
|
-
section(section: {
|
|
82
|
-
name: string;
|
|
83
|
-
order: number;
|
|
84
|
-
text: string;
|
|
85
|
-
}): unknown;
|
|
86
|
-
};
|
|
87
84
|
on(event: string, handler: (payload: {
|
|
88
85
|
agent: CreatedAgent;
|
|
89
86
|
}) => void): unknown;
|
|
90
87
|
logger: {
|
|
91
88
|
warn(message: string): void;
|
|
92
89
|
};
|
|
93
|
-
}, config?: Partial<
|
|
90
|
+
}, config?: Partial<{
|
|
91
|
+
memDirName?: string;
|
|
92
|
+
searchLimit?: number;
|
|
93
|
+
branchAlign?: boolean;
|
|
94
|
+
recentContextLimit?: number;
|
|
95
|
+
lockTimeoutMs?: number;
|
|
96
|
+
projectRoot?: string;
|
|
97
|
+
}>): Promise<void>;
|
|
94
98
|
export { Config, apply, inject, name };
|