@jungjaehoon/mama-core 4.1.0 → 4.1.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/README.md CHANGED
@@ -4,7 +4,7 @@ The shared engine for storage, records and revisions, evidence links, memory, se
4
4
  runtime drivers. Consumers supply their own database, principals, source access and product
5
5
  vocabulary through public exports. Core does not require the MAMA OS daemon.
6
6
 
7
- Version **4.1.0**; Node.js 22.13+. This README describes the current rebuild checkout.
7
+ Version **4.1.1**; Node.js 22.13+. This README describes the current rebuild checkout.
8
8
  See [architecture](../../docs/explanation/architecture.md) and
9
9
  [the shared-engine goal](../../INTENT.md).
10
10
 
@@ -272,7 +272,11 @@ function validateInput(schema, value, path) {
272
272
  if (schema.oneOf !== undefined) {
273
273
  const matches = schema.oneOf.filter((sub) => validateInput(sub, value, path) === null).length;
274
274
  if (matches !== 1) {
275
- return `${path} must match exactly one allowed shape (${matches} matched).`;
275
+ // A refusal names what is allowed: "(0 matched)" alone once left a caller dropping the
276
+ // field and the write with it.
277
+ const shapes = schema.oneOf.map(shapeName).join(', ');
278
+ const described = schema.description === undefined ? '' : ` ${schema.description}`;
279
+ return `${path} must match exactly one of: ${shapes} (${matches} matched).${described}`;
276
280
  }
277
281
  }
278
282
  if (typeof value === 'number') {
@@ -349,6 +353,13 @@ function validateInput(schema, value, path) {
349
353
  }
350
354
  return null;
351
355
  }
356
+ function shapeName(schema) {
357
+ if (schema.const !== undefined)
358
+ return JSON.stringify(schema.const);
359
+ if (schema.enum !== undefined)
360
+ return schema.enum.map((value) => JSON.stringify(value)).join(' | ');
361
+ return schema.type ?? 'a described shape';
362
+ }
352
363
  function typeMismatch(type, value) {
353
364
  switch (type) {
354
365
  case 'object':
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@jungjaehoon/mama-core",
3
- "version": "4.1.0",
3
+ "version": "4.1.1",
4
4
  "description": "MAMA Core - Shared modules for Memory-Augmented MCP Assistant",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",