myagentmemory 0.4.16 → 0.5.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.
@@ -96,6 +96,23 @@ export interface PluginSessionStartHookV1 {
96
96
  run(context: PluginSessionStartContextV1): Promise<void>;
97
97
  }
98
98
 
99
+ export interface PluginBackgroundRefreshContextV1 {
100
+ host: string;
101
+ cwd?: string;
102
+ signal: AbortSignal;
103
+ }
104
+
105
+ /**
106
+ * Un-metered per-turn refresh callback. Fired on every UserPromptSubmit so
107
+ * plugins can keep background workers alive across `/clear` and long idle.
108
+ * MUST be idempotent and cheap — no quota is charged.
109
+ */
110
+ export interface PluginBackgroundRefreshHookV1 {
111
+ name: string;
112
+ requiredCapability: string;
113
+ run(context: PluginBackgroundRefreshContextV1): Promise<void>;
114
+ }
115
+
99
116
  export interface PluginMemoryWriteV1 {
100
117
  target: "long_term" | "daily" | "topic";
101
118
  content: string;
@@ -131,11 +148,47 @@ export interface PluginStructuredErrorV1 {
131
148
  retryable?: boolean;
132
149
  }
133
150
 
151
+ export interface PluginContextSectionV1 {
152
+ id: string;
153
+ label: string;
154
+ content: string;
155
+ artifactPath?: string;
156
+ metadata?: Record<string, unknown>;
157
+ }
158
+
159
+ export interface PluginContextProviderV1 {
160
+ name: string;
161
+ requiredCapability: string;
162
+ provide(context: {
163
+ host: string;
164
+ cwd?: string;
165
+ query?: string;
166
+ signal: AbortSignal;
167
+ }): Promise<PluginContextSectionV1[]>;
168
+ }
169
+
170
+ export interface PluginMcpToolInputSchema {
171
+ type: "object";
172
+ properties: Record<string, { type: string; description?: string; enum?: string[] }>;
173
+ required?: string[];
174
+ }
175
+
176
+ export interface PluginMcpToolV1 {
177
+ name: string;
178
+ description: string;
179
+ inputSchema: PluginMcpToolInputSchema;
180
+ run(input: Record<string, unknown>): unknown | Promise<unknown>;
181
+ }
182
+
134
183
  export interface AgentMemoryPluginHostV1 {
135
184
  apiVersion: 1;
136
185
  coreVersion: string;
137
186
  registerCommand(command: PluginCommandV1): void;
138
187
  registerSessionStartHook(hook: PluginSessionStartHookV1): void;
188
+ registerBackgroundRefresh?(hook: PluginBackgroundRefreshHookV1): void;
189
+ registerContextProvider?(provider: PluginContextProviderV1): void;
190
+ registerMcpTool?(tool: PluginMcpToolV1): void;
191
+ registerMcpStartup?(fn: () => void | Promise<void>): void;
139
192
  getStateDirectory(): string;
140
193
  getMemoryDirectory(): string;
141
194
  getEntitlement(): Promise<PluginEntitlementStatusV1>;