@memorilabs/openclaw-memori 0.0.12 → 0.0.14

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/dist/index.js CHANGED
@@ -1,7 +1,7 @@
1
1
  import { handleAugmentation } from './handlers/augmentation.js';
2
2
  import { PLUGIN_CONFIG } from './constants.js';
3
3
  import { MemoriLogger, loadSkillsContent } from './utils/index.js';
4
- import { registerAllTools } from './tools/index.js';
4
+ import { registerUtilityTools, registerAuthenticatedTools } from './tools/index.js';
5
5
  import { registerCliCommands } from './cli/commands.js';
6
6
  const memoriPlugin = {
7
7
  id: PLUGIN_CONFIG.ID,
@@ -15,19 +15,20 @@ const memoriPlugin = {
15
15
  entityId: rawConfig?.entityId,
16
16
  projectId: rawConfig?.projectId,
17
17
  };
18
+ const logger = new MemoriLogger(api);
19
+ const skillsContent = loadSkillsContent(api.resolvePath.bind(api));
20
+ registerUtilityTools({ api, config, logger });
18
21
  if (!config.apiKey || !config.entityId) {
19
22
  api.logger.warn(`${PLUGIN_CONFIG.LOG_PREFIX} Missing apiKey or entityId in config. Plugin disabled.`);
20
23
  return;
21
24
  }
22
- const logger = new MemoriLogger(api);
23
- const skillsContent = loadSkillsContent(api.resolvePath.bind(api));
24
25
  logger.info(`\n=== ${PLUGIN_CONFIG.LOG_PREFIX} INITIALIZING PLUGIN ===`);
25
26
  logger.info(`${PLUGIN_CONFIG.LOG_PREFIX} Tracking Entity ID: ${config.entityId}`);
26
27
  if (skillsContent) {
27
28
  api.on('before_prompt_build', () => ({ appendSystemContext: skillsContent }));
28
29
  }
29
30
  api.on('agent_end', (event, ctx) => handleAugmentation(event, ctx, config, logger));
30
- registerAllTools({ api, config, logger });
31
+ registerAuthenticatedTools({ api, config, logger });
31
32
  },
32
33
  };
33
34
  export default memoriPlugin;
@@ -1,3 +1,4 @@
1
1
  import type { ToolDeps } from './types.js';
2
- export declare function registerAllTools(deps: ToolDeps): void;
2
+ export declare function registerUtilityTools(deps: ToolDeps): void;
3
+ export declare function registerAuthenticatedTools(deps: ToolDeps): void;
3
4
  export type { ToolDeps };
@@ -3,10 +3,12 @@ import { createMemoriQuotaTool } from './memori-quota.js';
3
3
  import { createMemoriRecallTool } from './memori-recall.js';
4
4
  import { createMemoriRecallSummaryTool } from './memori-recall-summary.js';
5
5
  import { createMemoriFeedbackTool } from './memori-feedback.js';
6
- export function registerAllTools(deps) {
6
+ export function registerUtilityTools(deps) {
7
7
  deps.api.registerTool(createMemoriSignupTool(deps));
8
- deps.api.registerTool(createMemoriQuotaTool(deps));
8
+ }
9
+ export function registerAuthenticatedTools(deps) {
9
10
  deps.api.registerTool(createMemoriRecallTool(deps));
10
11
  deps.api.registerTool(createMemoriRecallSummaryTool(deps));
11
12
  deps.api.registerTool(createMemoriFeedbackTool(deps));
13
+ deps.api.registerTool(createMemoriQuotaTool(deps));
12
14
  }
@@ -26,7 +26,7 @@ export function createMemoriRecallTool(deps) {
26
26
  },
27
27
  signal: {
28
28
  type: 'string',
29
- description: 'Filter to a specific fact signal. MUST be one of the allowed enum values.',
29
+ description: 'Filter by how the memory was derived. MUST be set together with `source` using one of the allowed (source, signal) pairs — never set independently. Valid pairs: (constraint, discovery), (decision, commit), (fact, verification), (execution, failure), (instruction, discovery), (insight, inference), (status, update), (strategy, pattern), (task, result).',
30
30
  enum: [
31
31
  'commit',
32
32
  'discovery',
@@ -40,7 +40,7 @@ export function createMemoriRecallTool(deps) {
40
40
  },
41
41
  source: {
42
42
  type: 'string',
43
- description: 'Filter to a specific source origin. MUST be one of the allowed enum values.',
43
+ description: 'Filter by memory type. MUST be set together with `signal` using one of the allowed (source, signal) pairs — never set independently. Valid pairs: (constraint, discovery), (decision, commit), (fact, verification), (execution, failure), (instruction, discovery), (insight, inference), (status, update), (strategy, pattern), (task, result).',
44
44
  enum: [
45
45
  'constraint',
46
46
  'decision',
@@ -68,6 +68,40 @@ export function createMemoriRecallTool(deps) {
68
68
  details: null,
69
69
  };
70
70
  }
71
+ const hasSource = finalParams.source != null;
72
+ const hasSignal = finalParams.signal != null;
73
+ if (hasSource !== hasSignal) {
74
+ const errorResult = {
75
+ error: 'source and signal must be provided together or both omitted',
76
+ };
77
+ logger.warn(`memori_recall rejected: ${JSON.stringify(errorResult)}`);
78
+ return {
79
+ content: [{ type: 'text', text: JSON.stringify(errorResult) }],
80
+ details: null,
81
+ };
82
+ }
83
+ const VALID_PAIRS = {
84
+ constraint: 'discovery',
85
+ decision: 'commit',
86
+ fact: 'verification',
87
+ execution: 'failure',
88
+ instruction: 'discovery',
89
+ insight: 'inference',
90
+ status: 'update',
91
+ strategy: 'pattern',
92
+ task: 'result',
93
+ };
94
+ const source = finalParams.source;
95
+ if (hasSource && source != null && VALID_PAIRS[source] !== finalParams.signal) {
96
+ const errorResult = {
97
+ error: `Invalid (source, signal) pair: (${source}, ${finalParams.signal}). Expected signal for source "${source}" is "${VALID_PAIRS[source]}".`,
98
+ };
99
+ logger.warn(`memori_recall rejected: ${JSON.stringify(errorResult)}`);
100
+ return {
101
+ content: [{ type: 'text', text: JSON.stringify(errorResult) }],
102
+ details: null,
103
+ };
104
+ }
71
105
  logger.info(`memori_recall params: ${JSON.stringify(finalParams)}`);
72
106
  const client = createRecallClient(config.apiKey, config.entityId);
73
107
  const result = await client.agentRecall(finalParams);
package/dist/version.d.ts CHANGED
@@ -1 +1 @@
1
- export declare const SDK_VERSION = "0.0.12";
1
+ export declare const SDK_VERSION = "0.0.14";
package/dist/version.js CHANGED
@@ -1 +1 @@
1
- export const SDK_VERSION = '0.0.12';
1
+ export const SDK_VERSION = '0.0.14';
@@ -1,12 +1,18 @@
1
1
  {
2
2
  "id": "openclaw-memori",
3
3
  "name": "Memori System",
4
- "version": "0.0.10",
4
+ "version": "0.0.13",
5
5
  "description": "Hosted memory backend",
6
6
  "kind": "memory",
7
7
  "main": "dist/index.js",
8
8
  "contracts": {
9
- "tools": ["memori_recall", "memori_recall_summary", "memori_feedback"]
9
+ "tools": [
10
+ "memori_recall",
11
+ "memori_recall_summary",
12
+ "memori_feedback",
13
+ "memori_signup",
14
+ "memori_quota"
15
+ ]
10
16
  },
11
17
  "uiHints": {
12
18
  "apiKey": {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@memorilabs/openclaw-memori",
3
- "version": "0.0.12",
3
+ "version": "0.0.14",
4
4
  "description": "Official MemoriLabs.ai long-term memory plugin for OpenClaw",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",
@@ -57,36 +57,29 @@ Prefer targeted recall over broad queries.
57
57
  - `projectId` → project or workspace context
58
58
  - `sessionId` → specific session
59
59
  - `dateStart` / `dateEnd` → time-bounded recall
60
- - `source` → type of memory
61
- - `signal` → how the memory was derived
60
+ - `source` → type of memory (must be paired with `signal` from the allowed combinations below)
61
+ - `signal` → how the memory was derived (must be paired with `source` from the allowed combinations below)
62
62
 
63
63
  > Note: If a `sessionId` is provided, a `projectId` must also be provided.
64
64
  > All timestamps are stored in **UTC**.
65
65
 
66
- ### Memory filters
67
-
68
- - `source`:
69
- - constraint
70
- - decision
71
- - execution
72
- - fact
73
- - insight
74
- - instruction
75
- - status
76
- - strategy
77
- - task
78
-
79
- - `signal`:
80
- - commit
81
- - discovery
82
- - failure
83
- - inference
84
- - pattern
85
- - result
86
- - update
87
- - verification
88
-
89
- Use `source` and `signal` to prioritize high-signal memory when possible.
66
+ ### Allowed source + signal combinations
67
+
68
+ `source` and `signal` are not independent. They must be set together (or both omitted). Only the following `(source, signal)` pairs are valid:
69
+
70
+ - `source=constraint`, `signal=discovery`
71
+ - `source=decision`, `signal=commit`
72
+ - `source=fact`, `signal=verification`
73
+ - `source=execution`, `signal=failure`
74
+ - `source=instruction`, `signal=discovery`
75
+ - `source=insight`, `signal=inference`
76
+ - `source=status`, `signal=update`
77
+ - `source=strategy`, `signal=pattern`
78
+ - `source=task`, `signal=result`
79
+
80
+ Any combination of `source` and `signal` not in this list is invalid and must not be sent to `memori_recall`.
81
+
82
+ Use one of the allowed `(source, signal)` pairs to prioritize high-signal memory when possible; never set `source` or `signal` independently.
90
83
 
91
84
  ### Default behavior (recall)
92
85
 
@@ -97,7 +90,7 @@ Use `source` and `signal` to prioritize high-signal memory when possible.
97
90
 
98
91
  - Start narrow (entity + project)
99
92
  - Add time bounds only when needed
100
- - Use `source` and `signal` to refine results
93
+ - Use an allowed `(source, signal)` pair to refine results (never set them independently)
101
94
  - Expand scope only if needed
102
95
  - Do not recall on every turn
103
96