@fonlan/dsh-gitmemo 0.1.5 → 0.3.1

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/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 entries in a local
6
- * `.mem` git repository and searches them before starting new work.
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
- * This plugin registers on the host plane:
9
- * - five model-facing tools: `mem_init`, `mem_search`, `mem_read`,
10
- * `mem_write`, `mem_delete` (backed by {@link GitMemo});
11
- * - an always-on system-prompt section with the full memory workflow rules;
12
- * - a per-session seed of the most recent memory titles.
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 (all optional). */
28
+ /** Plugin configuration. */
22
29
  declare const Config: z<Schemastery.ObjectS<{
23
- /** Name of the memory repo directory at the project root. Default ".mem". */
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
- /** Align the .mem branch with the project branch on writes. Default true. */
34
+ /** @deprecated — `.mem` always stays on main; kept for one version, no effect. */
28
35
  branchAlign: z<boolean, boolean>;
29
- /** Number of most recent memory titles injected into each new session's system prompt (0 disables). Default 5. */
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
- /** Name of the memory repo directory at the project root. Default ".mem". */
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
- /** Align the .mem branch with the project branch on writes. Default true. */
47
+ /** @deprecated — `.mem` always stays on main; kept for one version, no effect. */
39
48
  branchAlign: z<boolean, boolean>;
40
- /** Number of most recent memory titles injected into each new session's system prompt (0 disables). Default 5. */
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
- context(section: {
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: tools, always-on rules, and session-start seed.
73
- * @param ctx - registrant context carrying the host tool/prompt services.
74
- * @param config - plugin configuration (defaults applied by the loader).
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<ResolvedConfig>): Promise<void>;
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 };