@frontmcp/plugin-remember 0.0.1 → 0.7.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/esm/index.mjs +1289 -0
- package/esm/package.json +65 -0
- package/index.d.ts +53 -0
- package/index.d.ts.map +1 -0
- package/index.js +1316 -0
- package/package.json +3 -3
- package/providers/index.d.ts +7 -0
- package/providers/index.d.ts.map +1 -0
- package/providers/remember-accessor.provider.d.ts +124 -0
- package/providers/remember-accessor.provider.d.ts.map +1 -0
- package/providers/remember-memory.provider.d.ts +53 -0
- package/providers/remember-memory.provider.d.ts.map +1 -0
- package/providers/remember-redis.provider.d.ts +62 -0
- package/providers/remember-redis.provider.d.ts.map +1 -0
- package/providers/remember-storage.provider.d.ts +126 -0
- package/providers/remember-storage.provider.d.ts.map +1 -0
- package/providers/remember-store.interface.d.ts +42 -0
- package/providers/remember-store.interface.d.ts.map +1 -0
- package/providers/remember-vercel-kv.provider.d.ts +52 -0
- package/providers/remember-vercel-kv.provider.d.ts.map +1 -0
- package/remember.context-extension.d.ts +65 -0
- package/remember.context-extension.d.ts.map +1 -0
- package/remember.crypto.d.ts +81 -0
- package/remember.crypto.d.ts.map +1 -0
- package/remember.plugin.d.ts +41 -0
- package/remember.plugin.d.ts.map +1 -0
- package/remember.secret-persistence.d.ts +77 -0
- package/remember.secret-persistence.d.ts.map +1 -0
- package/remember.symbols.d.ts +28 -0
- package/remember.symbols.d.ts.map +1 -0
- package/remember.types.d.ts +206 -0
- package/remember.types.d.ts.map +1 -0
- package/tools/forget.tool.d.ts +32 -0
- package/tools/forget.tool.d.ts.map +1 -0
- package/tools/index.d.ts +9 -0
- package/tools/index.d.ts.map +1 -0
- package/tools/list-memories.tool.d.ts +33 -0
- package/tools/list-memories.tool.d.ts.map +1 -0
- package/tools/recall.tool.d.ts +38 -0
- package/tools/recall.tool.d.ts.map +1 -0
- package/tools/remember-this.tool.d.ts +42 -0
- package/tools/remember-this.tool.d.ts.map +1 -0
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
import type { EncBlob } from '@frontmcp/utils';
|
|
2
|
+
import type { RememberScope } from './remember.types';
|
|
3
|
+
/**
|
|
4
|
+
* Encrypted blob structure for storage.
|
|
5
|
+
* Re-exports EncBlob from @frontmcp/utils for consistency.
|
|
6
|
+
*/
|
|
7
|
+
export type EncryptedBlob = EncBlob;
|
|
8
|
+
/**
|
|
9
|
+
* Key derivation source configuration.
|
|
10
|
+
*/
|
|
11
|
+
export type EncryptionKeySource = {
|
|
12
|
+
type: 'session';
|
|
13
|
+
sessionId: string;
|
|
14
|
+
} | {
|
|
15
|
+
type: 'user';
|
|
16
|
+
userId: string;
|
|
17
|
+
} | {
|
|
18
|
+
type: 'tool';
|
|
19
|
+
toolName: string;
|
|
20
|
+
sessionId: string;
|
|
21
|
+
} | {
|
|
22
|
+
type: 'global';
|
|
23
|
+
} | {
|
|
24
|
+
type: 'custom';
|
|
25
|
+
key: string;
|
|
26
|
+
};
|
|
27
|
+
/**
|
|
28
|
+
* Derive a 256-bit encryption key based on the source.
|
|
29
|
+
* Uses HKDF-SHA256 from @frontmcp/utils.
|
|
30
|
+
*
|
|
31
|
+
* Key derivation strategy (distributed-safe):
|
|
32
|
+
* - session: IKM = sessionId (unique per session, no external dependency)
|
|
33
|
+
* - tool: IKM = sessionId (same as session, tool name in context)
|
|
34
|
+
* - user: IKM = baseSecret + userId (requires persisted/env secret)
|
|
35
|
+
* - global: IKM = baseSecret (requires persisted/env secret)
|
|
36
|
+
* - custom: IKM = custom key
|
|
37
|
+
*/
|
|
38
|
+
export declare function deriveEncryptionKey(source: EncryptionKeySource): Promise<Uint8Array>;
|
|
39
|
+
/**
|
|
40
|
+
* Get the encryption key source based on scope and context.
|
|
41
|
+
*/
|
|
42
|
+
export declare function getKeySourceForScope(scope: RememberScope, context: {
|
|
43
|
+
sessionId: string;
|
|
44
|
+
userId?: string;
|
|
45
|
+
toolName?: string;
|
|
46
|
+
}): EncryptionKeySource;
|
|
47
|
+
/**
|
|
48
|
+
* Encrypt a value using AES-256-GCM.
|
|
49
|
+
* Uses @frontmcp/utils crypto for cross-platform support.
|
|
50
|
+
*
|
|
51
|
+
* @param data - Value to encrypt (will be JSON serialized)
|
|
52
|
+
* @param keySource - Key derivation source
|
|
53
|
+
* @returns Encrypted blob
|
|
54
|
+
*/
|
|
55
|
+
export declare function encryptValue(data: unknown, keySource: EncryptionKeySource): Promise<EncryptedBlob>;
|
|
56
|
+
/**
|
|
57
|
+
* Decrypt an encrypted blob.
|
|
58
|
+
* Uses @frontmcp/utils crypto for cross-platform support.
|
|
59
|
+
*
|
|
60
|
+
* @param blob - Encrypted blob to decrypt
|
|
61
|
+
* @param keySource - Key derivation source (must match encryption)
|
|
62
|
+
* @returns Decrypted and parsed value, or null if decryption fails
|
|
63
|
+
*/
|
|
64
|
+
export declare function decryptValue<T = unknown>(blob: EncryptedBlob, keySource: EncryptionKeySource): Promise<T | null>;
|
|
65
|
+
/**
|
|
66
|
+
* Serialize encrypted blob to a string for storage.
|
|
67
|
+
*/
|
|
68
|
+
export declare function serializeBlob(blob: EncryptedBlob): string;
|
|
69
|
+
/**
|
|
70
|
+
* Deserialize a string back to encrypted blob.
|
|
71
|
+
*/
|
|
72
|
+
export declare function deserializeBlob(str: string): EncryptedBlob | null;
|
|
73
|
+
/**
|
|
74
|
+
* Convenience function to encrypt and serialize in one step.
|
|
75
|
+
*/
|
|
76
|
+
export declare function encryptAndSerialize(data: unknown, keySource: EncryptionKeySource): Promise<string>;
|
|
77
|
+
/**
|
|
78
|
+
* Convenience function to deserialize and decrypt in one step.
|
|
79
|
+
*/
|
|
80
|
+
export declare function deserializeAndDecrypt<T = unknown>(str: string, keySource: EncryptionKeySource): Promise<T | null>;
|
|
81
|
+
//# sourceMappingURL=remember.crypto.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"remember.crypto.d.ts","sourceRoot":"","sources":["../src/remember.crypto.ts"],"names":[],"m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I,EAAE,aAAa,GAAG,MAAM,CAEzD;AAED;;GAEG;AACH,wBAAgB,eAAe,CAAC,GAAG,EAAE,MAAM,GAAG,aAAa,GAAG,IAAI,CAiBjE;AAED;;GAEG;AACH,wBAAsB,mBAAmB,CAAC,IAAI,EAAE,OAAO,EAAE,SAAS,EAAE,mBAAmB,GAAG,OAAO,CAAC,MAAM,CAAC,CAGxG;AAED;;GAEG;AACH,wBAAsB,qBAAqB,CAAC,CAAC,GAAG,OAAO,EACrD,GAAG,EAAE,MAAM,EACX,SAAS,EAAE,mBAAmB,GAC7B,OAAO,CAAC,CAAC,GAAG,IAAI,CAAC,CAInB"}
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import { DynamicPlugin, ProviderType } from '@frontmcp/sdk';
|
|
2
|
+
import type { RememberPluginOptions, RememberPluginOptionsInput } from './remember.types';
|
|
3
|
+
/**
|
|
4
|
+
* RememberPlugin - Stateful session memory for FrontMCP.
|
|
5
|
+
*
|
|
6
|
+
* Provides encrypted, session-scoped storage with human-friendly API.
|
|
7
|
+
* Enables LLMs and tools to "remember" things across sessions.
|
|
8
|
+
*
|
|
9
|
+
* @example
|
|
10
|
+
* ```typescript
|
|
11
|
+
* // Basic in-memory setup
|
|
12
|
+
* @FrontMcp({
|
|
13
|
+
* plugins: [
|
|
14
|
+
* RememberPlugin.init({ type: 'memory' }),
|
|
15
|
+
* ],
|
|
16
|
+
* })
|
|
17
|
+
* class MyServer {}
|
|
18
|
+
*
|
|
19
|
+
* // With Redis and LLM tools
|
|
20
|
+
* @FrontMcp({
|
|
21
|
+
* redis: { host: 'localhost', port: 6379 },
|
|
22
|
+
* plugins: [
|
|
23
|
+
* RememberPlugin.init({
|
|
24
|
+
* type: 'global-store',
|
|
25
|
+
* tools: { enabled: true },
|
|
26
|
+
* }),
|
|
27
|
+
* ],
|
|
28
|
+
* })
|
|
29
|
+
* class ProductionServer {}
|
|
30
|
+
* ```
|
|
31
|
+
*/
|
|
32
|
+
export default class RememberPlugin extends DynamicPlugin<RememberPluginOptions, RememberPluginOptionsInput> {
|
|
33
|
+
static defaultOptions: RememberPluginOptions;
|
|
34
|
+
options: RememberPluginOptions;
|
|
35
|
+
constructor(options?: RememberPluginOptionsInput);
|
|
36
|
+
/**
|
|
37
|
+
* Dynamic providers based on plugin options.
|
|
38
|
+
*/
|
|
39
|
+
static dynamicProviders: (options: RememberPluginOptionsInput) => ProviderType[];
|
|
40
|
+
}
|
|
41
|
+
//# sourceMappingURL=remember.plugin.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"remember.plugin.d.ts","sourceRoot":"","sources":["../src/remember.plugin.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,aAAa,EAEb,YAAY,EAOb,MAAM,eAAe,CAAC;AACvB,OAAO,KAAK,EAAE,qBAAqB,EAAE,0BAA0B,EAAE,MAAM,kBAAkB,CAAC;AAO1F;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4BG;AAsBH,MAAM,CAAC,OAAO,OAAO,cAAe,SAAQ,aAAa,CAAC,qBAAqB,EAAE,0BAA0B,CAAC;IAC1G,MAAM,CAAC,cAAc,EAAE,qBAAqB,CAI1C;IAEF,OAAO,EAAE,qBAAqB,CAAC;gBAEnB,OAAO,GAAE,0BAA+B;IAQpD;;OAEG;IACH,OAAgB,gBAAgB,GAAI,SAAS,0BAA0B,KAAG,YAAY,EAAE,CAyHtF;CACH"}
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Data structure for persisted remember secret.
|
|
3
|
+
*/
|
|
4
|
+
export interface RememberSecretData {
|
|
5
|
+
/** Random secret, base64url encoded (32 bytes = 256 bits) */
|
|
6
|
+
secret: string;
|
|
7
|
+
/** Creation timestamp (ms) */
|
|
8
|
+
createdAt: number;
|
|
9
|
+
/** Version for future migrations */
|
|
10
|
+
version: 1;
|
|
11
|
+
}
|
|
12
|
+
/**
|
|
13
|
+
* Options for secret persistence.
|
|
14
|
+
*/
|
|
15
|
+
export interface SecretPersistenceOptions {
|
|
16
|
+
/**
|
|
17
|
+
* Path to store the secret.
|
|
18
|
+
* @default '.frontmcp/remember-secret.json'
|
|
19
|
+
*/
|
|
20
|
+
secretPath?: string;
|
|
21
|
+
/**
|
|
22
|
+
* Enable persistence in production (NOT RECOMMENDED for multi-server).
|
|
23
|
+
* In production, use REMEMBER_SECRET env var instead.
|
|
24
|
+
* @default false
|
|
25
|
+
*/
|
|
26
|
+
forceEnable?: boolean;
|
|
27
|
+
}
|
|
28
|
+
/**
|
|
29
|
+
* Check if secret persistence is enabled based on environment and options.
|
|
30
|
+
*/
|
|
31
|
+
export declare function isSecretPersistenceEnabled(options?: SecretPersistenceOptions): boolean;
|
|
32
|
+
/**
|
|
33
|
+
* Resolve the secret file path.
|
|
34
|
+
*/
|
|
35
|
+
export declare function resolveSecretPath(options?: SecretPersistenceOptions): string;
|
|
36
|
+
/**
|
|
37
|
+
* Load persisted secret from file.
|
|
38
|
+
*
|
|
39
|
+
* @param options - Persistence options
|
|
40
|
+
* @returns The loaded secret data or null if not found/invalid
|
|
41
|
+
*/
|
|
42
|
+
export declare function loadRememberSecret(options?: SecretPersistenceOptions): Promise<RememberSecretData | null>;
|
|
43
|
+
/**
|
|
44
|
+
* Save secret to file.
|
|
45
|
+
*
|
|
46
|
+
* Uses atomic write (temp file + rename) to prevent corruption.
|
|
47
|
+
* Sets file permissions to 0o600 (owner read/write only) for security.
|
|
48
|
+
*
|
|
49
|
+
* @param secretData - Secret data to persist
|
|
50
|
+
* @param options - Persistence options
|
|
51
|
+
* @returns true if save succeeded, false otherwise
|
|
52
|
+
*/
|
|
53
|
+
export declare function saveRememberSecret(secretData: RememberSecretData, options?: SecretPersistenceOptions): Promise<boolean>;
|
|
54
|
+
/**
|
|
55
|
+
* Delete persisted secret.
|
|
56
|
+
*
|
|
57
|
+
* @param options - Persistence options
|
|
58
|
+
*/
|
|
59
|
+
export declare function deleteRememberSecret(options?: SecretPersistenceOptions): Promise<void>;
|
|
60
|
+
/**
|
|
61
|
+
* Get or create a persisted secret.
|
|
62
|
+
*
|
|
63
|
+
* This is the main entry point for getting the base secret.
|
|
64
|
+
* It will:
|
|
65
|
+
* 1. Return cached secret if available
|
|
66
|
+
* 2. Load from file if exists
|
|
67
|
+
* 3. Generate new secret and persist it
|
|
68
|
+
*
|
|
69
|
+
* @param options - Persistence options
|
|
70
|
+
* @returns The secret string
|
|
71
|
+
*/
|
|
72
|
+
export declare function getOrCreatePersistedSecret(options?: SecretPersistenceOptions): Promise<string>;
|
|
73
|
+
/**
|
|
74
|
+
* Clear the cached secret (for testing).
|
|
75
|
+
*/
|
|
76
|
+
export declare function clearCachedSecret(): void;
|
|
77
|
+
//# sourceMappingURL=remember.secret-persistence.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"remember.secret-persistence.d.ts","sourceRoot":"","sources":["../src/remember.secret-persistence.ts"],"names":[],"mappings":"AAkBA;;GAEG;AACH,MAAM,WAAW,kBAAkB;IACjC,6DAA6D;IAC7D,MAAM,EAAE,MAAM,CAAC;IACf,8BAA8B;IAC9B,SAAS,EAAE,MAAM,CAAC;IAClB,oCAAoC;IACpC,OAAO,EAAE,CAAC,CAAC;CACZ;AAED;;GAEG;AACH,MAAM,WAAW,wBAAwB;IACvC;;;OAGG;IACH,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB;;;;OAIG;IACH,WAAW,CAAC,EAAE,OAAO,CAAC;CACvB;AAuDD;;GAEG;AACH,wBAAgB,0BAA0B,CAAC,OAAO,CAAC,EAAE,wBAAwB,GAAG,OAAO,CAUtF;AAED;;GAEG;AACH,wBAAgB,iBAAiB,CAAC,OAAO,CAAC,EAAE,wBAAwB,GAAG,MAAM,CAU5E;AAMD;;;;;GAKG;AACH,wBAAsB,kBAAkB,CAAC,OAAO,CAAC,EAAE,wBAAwB,GAAG,OAAO,CAAC,kBAAkB,GAAG,IAAI,CAAC,CA8B/G;AAED;;;;;;;;;GASG;AACH,wBAAsB,kBAAkB,CACtC,UAAU,EAAE,kBAAkB,EAC9B,OAAO,CAAC,EAAE,wBAAwB,GACjC,OAAO,CAAC,OAAO,CAAC,CA+BlB;AAED;;;;GAIG;AACH,wBAAsB,oBAAoB,CAAC,OAAO,CAAC,EAAE,wBAAwB,GAAG,OAAO,CAAC,IAAI,CAAC,CAU5F;AAmBD;;;;;;;;;;;GAWG;AACH,wBAAsB,0BAA0B,CAAC,OAAO,CAAC,EAAE,wBAAwB,GAAG,OAAO,CAAC,MAAM,CAAC,CAyCpG;AAED;;GAEG;AACH,wBAAgB,iBAAiB,IAAI,IAAI,CAExC"}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { Reference } from '@frontmcp/sdk';
|
|
2
|
+
import type { RememberStoreInterface } from './providers/remember-store.interface';
|
|
3
|
+
import type { RememberAccessor } from './providers/remember-accessor.provider';
|
|
4
|
+
import type { RememberPluginOptions } from './remember.types';
|
|
5
|
+
/**
|
|
6
|
+
* DI token for the underlying storage provider.
|
|
7
|
+
*/
|
|
8
|
+
export declare const RememberStoreToken: Reference<RememberStoreInterface>;
|
|
9
|
+
/**
|
|
10
|
+
* DI token for the plugin configuration.
|
|
11
|
+
*/
|
|
12
|
+
export declare const RememberConfigToken: Reference<RememberPluginOptions>;
|
|
13
|
+
/**
|
|
14
|
+
* DI token for the context-scoped RememberAccessor.
|
|
15
|
+
* Use this to access remember functionality in tools and agents.
|
|
16
|
+
*
|
|
17
|
+
* @example
|
|
18
|
+
* ```typescript
|
|
19
|
+
* class MyTool extends ToolContext {
|
|
20
|
+
* async execute(input) {
|
|
21
|
+
* const remember = this.get(RememberAccessorToken);
|
|
22
|
+
* await remember.set('key', 'value');
|
|
23
|
+
* }
|
|
24
|
+
* }
|
|
25
|
+
* ```
|
|
26
|
+
*/
|
|
27
|
+
export declare const RememberAccessorToken: Reference<RememberAccessor>;
|
|
28
|
+
//# sourceMappingURL=remember.symbols.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"remember.symbols.d.ts","sourceRoot":"","sources":["../src/remember.symbols.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,eAAe,CAAC;AAC1C,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,sCAAsC,CAAC;AACnF,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,wCAAwC,CAAC;AAC/E,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,kBAAkB,CAAC;AAE9D;;GAEG;AACH,eAAO,MAAM,kBAAkB,EAAE,SAAS,CAAC,sBAAsB,CAE3B,CAAC;AAEvC;;GAEG;AACH,eAAO,MAAM,mBAAmB,EAAE,SAAS,CAAC,qBAAqB,CAE5B,CAAC;AAEtC;;;;;;;;;;;;;GAaG;AACH,eAAO,MAAM,qBAAqB,EAAE,SAAS,CAAC,gBAAgB,CAE9B,CAAC"}
|
|
@@ -0,0 +1,206 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import { Redis as RedisClient } from 'ioredis';
|
|
3
|
+
/**
|
|
4
|
+
* Memory scope determines the visibility and lifetime of stored data.
|
|
5
|
+
*/
|
|
6
|
+
export type RememberScope = 'session' | 'user' | 'tool' | 'global';
|
|
7
|
+
/**
|
|
8
|
+
* Zod schema for RememberScope validation.
|
|
9
|
+
*/
|
|
10
|
+
export declare const rememberScopeSchema: z.ZodEnum<{
|
|
11
|
+
session: "session";
|
|
12
|
+
user: "user";
|
|
13
|
+
tool: "tool";
|
|
14
|
+
global: "global";
|
|
15
|
+
}>;
|
|
16
|
+
/**
|
|
17
|
+
* Brand symbol for compile-time type discrimination.
|
|
18
|
+
*/
|
|
19
|
+
declare const PayloadBrand: unique symbol;
|
|
20
|
+
/**
|
|
21
|
+
* Branded type for memory payloads.
|
|
22
|
+
* Provides compile-time safety for different payload purposes.
|
|
23
|
+
*/
|
|
24
|
+
export type BrandedPayload<T, Brand extends string> = T & {
|
|
25
|
+
readonly [PayloadBrand]: Brand;
|
|
26
|
+
};
|
|
27
|
+
/** Approval payload - Tool approval state */
|
|
28
|
+
export type ApprovalPayload<T = unknown> = BrandedPayload<T, 'approval'>;
|
|
29
|
+
/** Preference payload - User preferences */
|
|
30
|
+
export type PreferencePayload<T = unknown> = BrandedPayload<T, 'preference'>;
|
|
31
|
+
/** Cache payload - Cached data */
|
|
32
|
+
export type CachePayload<T = unknown> = BrandedPayload<T, 'cache'>;
|
|
33
|
+
/** State payload - Application state */
|
|
34
|
+
export type StatePayload<T = unknown> = BrandedPayload<T, 'state'>;
|
|
35
|
+
/** Conversation payload - Conversation history/context */
|
|
36
|
+
export type ConversationPayload<T = unknown> = BrandedPayload<T, 'conversation'>;
|
|
37
|
+
/** Custom payload - Developer-defined data */
|
|
38
|
+
export type CustomPayload<T = unknown> = BrandedPayload<T, 'custom'>;
|
|
39
|
+
/**
|
|
40
|
+
* Helper to create a branded payload at runtime.
|
|
41
|
+
* The brand is stored in metadata, not on the value itself.
|
|
42
|
+
*/
|
|
43
|
+
export declare function brand<T, B extends string>(data: T, _brand: B): BrandedPayload<T, B>;
|
|
44
|
+
/**
|
|
45
|
+
* All supported payload brands.
|
|
46
|
+
*/
|
|
47
|
+
export type PayloadBrandType = 'approval' | 'preference' | 'cache' | 'state' | 'conversation' | 'custom';
|
|
48
|
+
/**
|
|
49
|
+
* Stored entry with metadata.
|
|
50
|
+
*/
|
|
51
|
+
export interface RememberEntry<T = unknown> {
|
|
52
|
+
/** The stored value */
|
|
53
|
+
value: T;
|
|
54
|
+
/** Payload brand for type discrimination */
|
|
55
|
+
brand?: PayloadBrandType;
|
|
56
|
+
/** When the entry was created */
|
|
57
|
+
createdAt: number;
|
|
58
|
+
/** When the entry was last updated */
|
|
59
|
+
updatedAt: number;
|
|
60
|
+
/** When the entry expires (timestamp) */
|
|
61
|
+
expiresAt?: number;
|
|
62
|
+
/** Additional metadata */
|
|
63
|
+
metadata?: Record<string, unknown>;
|
|
64
|
+
}
|
|
65
|
+
/**
|
|
66
|
+
* Zod schema for RememberEntry validation.
|
|
67
|
+
*/
|
|
68
|
+
export declare const rememberEntrySchema: z.ZodObject<{
|
|
69
|
+
value: z.ZodUnknown;
|
|
70
|
+
brand: z.ZodOptional<z.ZodEnum<{
|
|
71
|
+
approval: "approval";
|
|
72
|
+
preference: "preference";
|
|
73
|
+
cache: "cache";
|
|
74
|
+
state: "state";
|
|
75
|
+
conversation: "conversation";
|
|
76
|
+
custom: "custom";
|
|
77
|
+
}>>;
|
|
78
|
+
createdAt: z.ZodNumber;
|
|
79
|
+
updatedAt: z.ZodNumber;
|
|
80
|
+
expiresAt: z.ZodOptional<z.ZodNumber>;
|
|
81
|
+
metadata: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
82
|
+
}, z.core.$strip>;
|
|
83
|
+
/**
|
|
84
|
+
* Base options for all plugin configurations.
|
|
85
|
+
*/
|
|
86
|
+
export interface BaseRememberPluginOptions {
|
|
87
|
+
/** Default TTL in seconds for entries without explicit TTL */
|
|
88
|
+
defaultTTL?: number;
|
|
89
|
+
/** Key prefix for all storage keys */
|
|
90
|
+
keyPrefix?: string;
|
|
91
|
+
/** Encryption configuration */
|
|
92
|
+
encryption?: {
|
|
93
|
+
/** Whether encryption is enabled (default: true) */
|
|
94
|
+
enabled?: boolean;
|
|
95
|
+
/** Custom encryption key (overrides derived keys) */
|
|
96
|
+
customKey?: string;
|
|
97
|
+
};
|
|
98
|
+
/** LLM tools configuration */
|
|
99
|
+
tools?: {
|
|
100
|
+
/** Whether to expose tools to LLM (default: false) */
|
|
101
|
+
enabled?: boolean;
|
|
102
|
+
/** Restrict which scopes tools can access */
|
|
103
|
+
allowedScopes?: RememberScope[];
|
|
104
|
+
/** Tool name prefix (default: none) */
|
|
105
|
+
prefix?: string;
|
|
106
|
+
};
|
|
107
|
+
}
|
|
108
|
+
/**
|
|
109
|
+
* In-memory storage options.
|
|
110
|
+
*/
|
|
111
|
+
export interface MemoryRememberPluginOptions extends BaseRememberPluginOptions {
|
|
112
|
+
type: 'memory';
|
|
113
|
+
}
|
|
114
|
+
/**
|
|
115
|
+
* Redis storage options with connection config.
|
|
116
|
+
*/
|
|
117
|
+
export interface RedisRememberPluginOptions extends BaseRememberPluginOptions {
|
|
118
|
+
type: 'redis';
|
|
119
|
+
config: {
|
|
120
|
+
host: string;
|
|
121
|
+
port: number;
|
|
122
|
+
password?: string;
|
|
123
|
+
db?: number;
|
|
124
|
+
};
|
|
125
|
+
}
|
|
126
|
+
/**
|
|
127
|
+
* Redis storage options with existing client.
|
|
128
|
+
*/
|
|
129
|
+
export interface RedisClientRememberPluginOptions extends BaseRememberPluginOptions {
|
|
130
|
+
type: 'redis-client';
|
|
131
|
+
client: RedisClient;
|
|
132
|
+
}
|
|
133
|
+
/**
|
|
134
|
+
* Vercel KV storage options.
|
|
135
|
+
*/
|
|
136
|
+
export interface VercelKvRememberPluginOptions extends BaseRememberPluginOptions {
|
|
137
|
+
type: 'vercel-kv';
|
|
138
|
+
/** Vercel KV URL (defaults to KV_REST_API_URL env var) */
|
|
139
|
+
url?: string;
|
|
140
|
+
/** Vercel KV token (defaults to KV_REST_API_TOKEN env var) */
|
|
141
|
+
token?: string;
|
|
142
|
+
}
|
|
143
|
+
/**
|
|
144
|
+
* Global store configuration from @FrontMcp decorator.
|
|
145
|
+
* Uses the redis/vercel-kv config from main FrontMcp options.
|
|
146
|
+
*/
|
|
147
|
+
export interface GlobalStoreRememberPluginOptions extends BaseRememberPluginOptions {
|
|
148
|
+
type: 'global-store';
|
|
149
|
+
}
|
|
150
|
+
/**
|
|
151
|
+
* Union of all plugin options types.
|
|
152
|
+
*/
|
|
153
|
+
export type RememberPluginOptions = MemoryRememberPluginOptions | RedisRememberPluginOptions | RedisClientRememberPluginOptions | VercelKvRememberPluginOptions | GlobalStoreRememberPluginOptions;
|
|
154
|
+
/**
|
|
155
|
+
* Input type for plugin initialization (allows partial options).
|
|
156
|
+
*/
|
|
157
|
+
export type RememberPluginOptionsInput = Partial<RememberPluginOptions> & {
|
|
158
|
+
type?: RememberPluginOptions['type'];
|
|
159
|
+
};
|
|
160
|
+
/**
|
|
161
|
+
* Options for the set() method.
|
|
162
|
+
*/
|
|
163
|
+
export interface RememberSetOptions {
|
|
164
|
+
/** Memory scope (default: 'session') */
|
|
165
|
+
scope?: RememberScope;
|
|
166
|
+
/** Time-to-live in seconds */
|
|
167
|
+
ttl?: number;
|
|
168
|
+
/** Payload brand for type discrimination */
|
|
169
|
+
brand?: PayloadBrandType;
|
|
170
|
+
/** Additional metadata */
|
|
171
|
+
metadata?: Record<string, unknown>;
|
|
172
|
+
}
|
|
173
|
+
/**
|
|
174
|
+
* Options for the get() method.
|
|
175
|
+
*/
|
|
176
|
+
export interface RememberGetOptions<T = unknown> {
|
|
177
|
+
/** Memory scope (default: 'session') */
|
|
178
|
+
scope?: RememberScope;
|
|
179
|
+
/** Default value if key doesn't exist */
|
|
180
|
+
defaultValue?: T;
|
|
181
|
+
}
|
|
182
|
+
/**
|
|
183
|
+
* Options for the forget() method.
|
|
184
|
+
*/
|
|
185
|
+
export interface RememberForgetOptions {
|
|
186
|
+
/** Memory scope (default: 'session') */
|
|
187
|
+
scope?: RememberScope;
|
|
188
|
+
}
|
|
189
|
+
/**
|
|
190
|
+
* Options for the knows() method.
|
|
191
|
+
*/
|
|
192
|
+
export interface RememberKnowsOptions {
|
|
193
|
+
/** Memory scope (default: 'session') */
|
|
194
|
+
scope?: RememberScope;
|
|
195
|
+
}
|
|
196
|
+
/**
|
|
197
|
+
* Options for the list() method.
|
|
198
|
+
*/
|
|
199
|
+
export interface RememberListOptions {
|
|
200
|
+
/** Memory scope (default: 'session') */
|
|
201
|
+
scope?: RememberScope;
|
|
202
|
+
/** Pattern to filter keys (glob-style) */
|
|
203
|
+
pattern?: string;
|
|
204
|
+
}
|
|
205
|
+
export {};
|
|
206
|
+
//# sourceMappingURL=remember.types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file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QAAQ,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;CACpC;AAED;;GAEG;AACH,MAAM,WAAW,kBAAkB,CAAC,CAAC,GAAG,OAAO;IAC7C,wCAAwC;IACxC,KAAK,CAAC,EAAE,aAAa,CAAC;IACtB,yCAAyC;IACzC,YAAY,CAAC,EAAE,CAAC,CAAC;CAClB;AAED;;GAEG;AACH,MAAM,WAAW,qBAAqB;IACpC,wCAAwC;IACxC,KAAK,CAAC,EAAE,aAAa,CAAC;CACvB;AAED;;GAEG;AACH,MAAM,WAAW,oBAAoB;IACnC,wCAAwC;IACxC,KAAK,CAAC,EAAE,aAAa,CAAC;CACvB;AAED;;GAEG;AACH,MAAM,WAAW,mBAAmB;IAClC,wCAAwC;IACxC,KAAK,CAAC,EAAE,aAAa,CAAC;IACtB,0CAA0C;IAC1C,OAAO,CAAC,EAAE,MAAM,CAAC;CAClB"}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { ToolContext } from '@frontmcp/sdk';
|
|
2
|
+
import { z } from 'zod';
|
|
3
|
+
/**
|
|
4
|
+
* Input schema for the forget tool.
|
|
5
|
+
*/
|
|
6
|
+
export declare const forgetInputSchema: z.ZodObject<{
|
|
7
|
+
key: z.ZodString;
|
|
8
|
+
scope: z.ZodOptional<z.ZodEnum<{
|
|
9
|
+
session: "session";
|
|
10
|
+
user: "user";
|
|
11
|
+
tool: "tool";
|
|
12
|
+
global: "global";
|
|
13
|
+
}>>;
|
|
14
|
+
}, z.core.$strip>;
|
|
15
|
+
/**
|
|
16
|
+
* Output schema for the forget tool.
|
|
17
|
+
*/
|
|
18
|
+
export declare const forgetOutputSchema: z.ZodObject<{
|
|
19
|
+
success: z.ZodBoolean;
|
|
20
|
+
key: z.ZodString;
|
|
21
|
+
scope: z.ZodString;
|
|
22
|
+
existed: z.ZodBoolean;
|
|
23
|
+
}, z.core.$strip>;
|
|
24
|
+
export type ForgetInput = z.infer<typeof forgetInputSchema>;
|
|
25
|
+
export type ForgetOutput = z.infer<typeof forgetOutputSchema>;
|
|
26
|
+
/**
|
|
27
|
+
* Tool to forget a previously remembered value.
|
|
28
|
+
*/
|
|
29
|
+
export default class ForgetTool extends ToolContext {
|
|
30
|
+
execute(input: ForgetInput): Promise<ForgetOutput>;
|
|
31
|
+
}
|
|
32
|
+
//# sourceMappingURL=forget.tool.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"forget.tool.d.ts","sourceRoot":"","sources":["../../src/tools/forget.tool.ts"],"names":[],"mappings":"AAAA,OAAO,EAAQ,WAAW,EAAE,MAAM,eAAe,CAAC;AAClD,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAGxB;;GAEG;AACH,eAAO,MAAM,iBAAiB;;;;;;;;iBAM5B,CAAC;AAEH;;GAEG;AACH,eAAO,MAAM,kBAAkB;;;;;iBAK7B,CAAC;AAEH,MAAM,MAAM,WAAW,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,iBAAiB,CAAC,CAAC;AAE5D,MAAM,MAAM,YAAY,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,kBAAkB,CAAC,CAAC;AAE9D;;GAEG;AAYH,MAAM,CAAC,OAAO,OAAO,UAAW,SAAQ,WAAW;IAC3C,OAAO,CAAC,KAAK,EAAE,WAAW,GAAG,OAAO,CAAC,YAAY,CAAC;CAyBzD"}
|
package/tools/index.d.ts
ADDED
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
export { default as RememberThisTool } from './remember-this.tool';
|
|
2
|
+
export { default as RecallTool } from './recall.tool';
|
|
3
|
+
export { default as ForgetTool } from './forget.tool';
|
|
4
|
+
export { default as ListMemoriesTool } from './list-memories.tool';
|
|
5
|
+
export type { RememberThisInput, RememberThisOutput } from './remember-this.tool';
|
|
6
|
+
export type { RecallInput, RecallOutput } from './recall.tool';
|
|
7
|
+
export type { ForgetInput, ForgetOutput } from './forget.tool';
|
|
8
|
+
export type { ListMemoriesInput, ListMemoriesOutput } from './list-memories.tool';
|
|
9
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/tools/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,IAAI,gBAAgB,EAAE,MAAM,sBAAsB,CAAC;AACnE,OAAO,EAAE,OAAO,IAAI,UAAU,EAAE,MAAM,eAAe,CAAC;AACtD,OAAO,EAAE,OAAO,IAAI,UAAU,EAAE,MAAM,eAAe,CAAC;AACtD,OAAO,EAAE,OAAO,IAAI,gBAAgB,EAAE,MAAM,sBAAsB,CAAC;AAGnE,YAAY,EAAE,iBAAiB,EAAE,kBAAkB,EAAE,MAAM,sBAAsB,CAAC;AAClF,YAAY,EAAE,WAAW,EAAE,YAAY,EAAE,MAAM,eAAe,CAAC;AAC/D,YAAY,EAAE,WAAW,EAAE,YAAY,EAAE,MAAM,eAAe,CAAC;AAC/D,YAAY,EAAE,iBAAiB,EAAE,kBAAkB,EAAE,MAAM,sBAAsB,CAAC"}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { ToolContext } from '@frontmcp/sdk';
|
|
2
|
+
import { z } from 'zod';
|
|
3
|
+
/**
|
|
4
|
+
* Input schema for the list_memories tool.
|
|
5
|
+
*/
|
|
6
|
+
export declare const listMemoriesInputSchema: z.ZodObject<{
|
|
7
|
+
scope: z.ZodOptional<z.ZodEnum<{
|
|
8
|
+
session: "session";
|
|
9
|
+
user: "user";
|
|
10
|
+
tool: "tool";
|
|
11
|
+
global: "global";
|
|
12
|
+
}>>;
|
|
13
|
+
pattern: z.ZodOptional<z.ZodString>;
|
|
14
|
+
limit: z.ZodOptional<z.ZodNumber>;
|
|
15
|
+
}, z.core.$strip>;
|
|
16
|
+
/**
|
|
17
|
+
* Output schema for the list_memories tool.
|
|
18
|
+
*/
|
|
19
|
+
export declare const listMemoriesOutputSchema: z.ZodObject<{
|
|
20
|
+
keys: z.ZodArray<z.ZodString>;
|
|
21
|
+
scope: z.ZodString;
|
|
22
|
+
count: z.ZodNumber;
|
|
23
|
+
truncated: z.ZodBoolean;
|
|
24
|
+
}, z.core.$strip>;
|
|
25
|
+
export type ListMemoriesInput = z.infer<typeof listMemoriesInputSchema>;
|
|
26
|
+
export type ListMemoriesOutput = z.infer<typeof listMemoriesOutputSchema>;
|
|
27
|
+
/**
|
|
28
|
+
* Tool to list all remembered keys in a scope.
|
|
29
|
+
*/
|
|
30
|
+
export default class ListMemoriesTool extends ToolContext {
|
|
31
|
+
execute(input: ListMemoriesInput): Promise<ListMemoriesOutput>;
|
|
32
|
+
}
|
|
33
|
+
//# sourceMappingURL=list-memories.tool.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"list-memories.tool.d.ts","sourceRoot":"","sources":["../../src/tools/list-memories.tool.ts"],"names":[],"mappings":"AAAA,OAAO,EAAQ,WAAW,EAAE,MAAM,eAAe,CAAC;AAClD,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAGxB;;GAEG;AACH,eAAO,MAAM,uBAAuB;;;;;;;;;iBAOlC,CAAC;AAEH;;GAEG;AACH,eAAO,MAAM,wBAAwB;;;;;iBAKnC,CAAC;AAEH,MAAM,MAAM,iBAAiB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,uBAAuB,CAAC,CAAC;AAExE,MAAM,MAAM,kBAAkB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,wBAAwB,CAAC,CAAC;AAE1E;;GAEG;AAYH,MAAM,CAAC,OAAO,OAAO,gBAAiB,SAAQ,WAAW;IACjD,OAAO,CAAC,KAAK,EAAE,iBAAiB,GAAG,OAAO,CAAC,kBAAkB,CAAC;CA8BrE"}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import { ToolContext } from '@frontmcp/sdk';
|
|
2
|
+
import { z } from 'zod';
|
|
3
|
+
import type { RememberScope } from '../remember.types';
|
|
4
|
+
/**
|
|
5
|
+
* Input schema for the recall tool.
|
|
6
|
+
*/
|
|
7
|
+
export declare const recallInputSchema: {
|
|
8
|
+
key: z.ZodString;
|
|
9
|
+
scope: z.ZodOptional<z.ZodEnum<{
|
|
10
|
+
session: "session";
|
|
11
|
+
user: "user";
|
|
12
|
+
tool: "tool";
|
|
13
|
+
global: "global";
|
|
14
|
+
}>>;
|
|
15
|
+
};
|
|
16
|
+
/**
|
|
17
|
+
* Output schema for the recall tool.
|
|
18
|
+
*/
|
|
19
|
+
export declare const recallOutputSchema: z.ZodObject<{
|
|
20
|
+
found: z.ZodBoolean;
|
|
21
|
+
key: z.ZodString;
|
|
22
|
+
value: z.ZodOptional<z.ZodUnknown>;
|
|
23
|
+
scope: z.ZodString;
|
|
24
|
+
createdAt: z.ZodOptional<z.ZodNumber>;
|
|
25
|
+
expiresAt: z.ZodOptional<z.ZodNumber>;
|
|
26
|
+
}, z.core.$strip>;
|
|
27
|
+
export type RecallInput = {
|
|
28
|
+
key: string;
|
|
29
|
+
scope?: RememberScope;
|
|
30
|
+
};
|
|
31
|
+
export type RecallOutput = z.infer<typeof recallOutputSchema>;
|
|
32
|
+
/**
|
|
33
|
+
* Tool to recall a previously remembered value.
|
|
34
|
+
*/
|
|
35
|
+
export default class RecallTool extends ToolContext {
|
|
36
|
+
execute(input: RecallInput): Promise<RecallOutput>;
|
|
37
|
+
}
|
|
38
|
+
//# sourceMappingURL=recall.tool.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"recall.tool.d.ts","sourceRoot":"","sources":["../../src/tools/recall.tool.ts"],"names":[],"mappings":"AAAA,OAAO,EAAQ,WAAW,EAAE,MAAM,eAAe,CAAC;AAClD,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAC;AAEvD;;GAEG;AACH,eAAO,MAAM,iBAAiB;;;;;;;;CAG7B,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,kBAAkB;;;;;;;iBAO7B,CAAC;AAEH,MAAM,MAAM,WAAW,GAAG;IACxB,GAAG,EAAE,MAAM,CAAC;IACZ,KAAK,CAAC,EAAE,aAAa,CAAC;CACvB,CAAC;AAEF,MAAM,MAAM,YAAY,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,kBAAkB,CAAC,CAAC;AAE9D;;GAEG;AAYH,MAAM,CAAC,OAAO,OAAO,UAAW,SAAQ,WAAW;IAC3C,OAAO,CAAC,KAAK,EAAE,WAAW,GAAG,OAAO,CAAC,YAAY,CAAC;CAgCzD"}
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import { ToolContext } from '@frontmcp/sdk';
|
|
2
|
+
import { z } from 'zod';
|
|
3
|
+
/**
|
|
4
|
+
* Input schema for the remember_this tool.
|
|
5
|
+
*/
|
|
6
|
+
export declare const rememberThisInputSchema: z.ZodObject<{
|
|
7
|
+
key: z.ZodString;
|
|
8
|
+
value: z.ZodUnknown;
|
|
9
|
+
scope: z.ZodOptional<z.ZodEnum<{
|
|
10
|
+
session: "session";
|
|
11
|
+
user: "user";
|
|
12
|
+
tool: "tool";
|
|
13
|
+
global: "global";
|
|
14
|
+
}>>;
|
|
15
|
+
ttl: z.ZodOptional<z.ZodNumber>;
|
|
16
|
+
brand: z.ZodOptional<z.ZodEnum<{
|
|
17
|
+
preference: "preference";
|
|
18
|
+
cache: "cache";
|
|
19
|
+
state: "state";
|
|
20
|
+
conversation: "conversation";
|
|
21
|
+
custom: "custom";
|
|
22
|
+
}>>;
|
|
23
|
+
}, z.core.$strip>;
|
|
24
|
+
/**
|
|
25
|
+
* Output schema for the remember_this tool.
|
|
26
|
+
*/
|
|
27
|
+
export declare const rememberThisOutputSchema: z.ZodObject<{
|
|
28
|
+
success: z.ZodBoolean;
|
|
29
|
+
key: z.ZodString;
|
|
30
|
+
scope: z.ZodString;
|
|
31
|
+
expiresAt: z.ZodOptional<z.ZodNumber>;
|
|
32
|
+
}, z.core.$strip>;
|
|
33
|
+
export type RememberThisInput = z.infer<typeof rememberThisInputSchema>;
|
|
34
|
+
export type RememberThisOutput = z.infer<typeof rememberThisOutputSchema>;
|
|
35
|
+
/**
|
|
36
|
+
* Tool to store a value in memory.
|
|
37
|
+
* Enables LLM to remember things for later use.
|
|
38
|
+
*/
|
|
39
|
+
export default class RememberThisTool extends ToolContext {
|
|
40
|
+
execute(input: RememberThisInput): Promise<RememberThisOutput>;
|
|
41
|
+
}
|
|
42
|
+
//# sourceMappingURL=remember-this.tool.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"remember-this.tool.d.ts","sourceRoot":"","sources":["../../src/tools/remember-this.tool.ts"],"names":[],"mappings":"AAAA,OAAO,EAAQ,WAAW,EAAE,MAAM,eAAe,CAAC;AAClD,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAGxB;;GAEG;AACH,eAAO,MAAM,uBAAuB;;;;;;;;;;;;;;;;;iBAclC,CAAC;AAEH;;GAEG;AACH,eAAO,MAAM,wBAAwB;;;;;iBAKnC,CAAC;AAEH,MAAM,MAAM,iBAAiB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,uBAAuB,CAAC,CAAC;AAExE,MAAM,MAAM,kBAAkB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,wBAAwB,CAAC,CAAC;AAE1E;;;GAGG;AAYH,MAAM,CAAC,OAAO,OAAO,gBAAiB,SAAQ,WAAW;IACjD,OAAO,CAAC,KAAK,EAAE,iBAAiB,GAAG,OAAO,CAAC,kBAAkB,CAAC;CA2BrE"}
|