@almadar/llm 2.48.0 → 2.49.0

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.d.ts CHANGED
@@ -325,7 +325,10 @@ declare function buildGenericContinuationPrompt(context: string, partialResponse
325
325
  */
326
326
  interface JsonSchemaDefinition extends ServiceParams {
327
327
  type?: string;
328
- properties?: JsonSchemaDefinition;
328
+ /** Keyed by field name — each named field carries its OWN nested schema
329
+ * (real JSON-Schema semantics; a single un-keyed nested schema here would
330
+ * say every field of an object shares one shape). */
331
+ properties?: Record<string, JsonSchemaDefinition>;
329
332
  required?: string[];
330
333
  items?: JsonSchemaDefinition;
331
334
  additionalProperties?: JsonSchemaDefinition;
@@ -395,6 +398,8 @@ type LLMServiceActions = {
395
398
  model?: string;
396
399
  };
397
400
  result: {
401
+ /** The extracted structure follows the caller's `schema` — the consumer declares its shape.
402
+ * @shapedBy schema */
398
403
  data: ExtractedData;
399
404
  confidence: number;
400
405
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@almadar/llm",
3
- "version": "2.48.0",
3
+ "version": "2.49.0",
4
4
  "description": "Multi-provider LLM client with rate limiting, token tracking, structured outputs, and continuation handling",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",
@@ -47,11 +47,11 @@
47
47
  "zod": "^3.22.0"
48
48
  },
49
49
  "peerDependencies": {
50
- "@almadar/core": "^10.81.0"
50
+ "@almadar/core": "^10.87.0"
51
51
  },
52
52
  "devDependencies": {
53
- "@almadar/core": "^10.81.0",
54
- "@almadar/eslint-plugin": "^2.17.0",
53
+ "@almadar/core": "^10.87.0",
54
+ "@almadar/eslint-plugin": "^2.18.0",
55
55
  "@types/node": "^22.0.0",
56
56
  "@typescript-eslint/parser": "8.65.0",
57
57
  "@typescript/native": "npm:typescript@^7.0.2",
package/src/contracts.ts CHANGED
@@ -21,7 +21,10 @@ import type { ServiceContract, ServiceParams, ServiceParamsValue } from "@almada
21
21
  */
22
22
  interface JsonSchemaDefinition extends ServiceParams {
23
23
  type?: string;
24
- properties?: JsonSchemaDefinition;
24
+ /** Keyed by field name — each named field carries its OWN nested schema
25
+ * (real JSON-Schema semantics; a single un-keyed nested schema here would
26
+ * say every field of an object shares one shape). */
27
+ properties?: Record<string, JsonSchemaDefinition>;
25
28
  required?: string[];
26
29
  items?: JsonSchemaDefinition;
27
30
  additionalProperties?: JsonSchemaDefinition;
@@ -93,6 +96,8 @@ export type LLMServiceActions = {
93
96
  model?: string;
94
97
  };
95
98
  result: {
99
+ /** The extracted structure follows the caller's `schema` — the consumer declares its shape.
100
+ * @shapedBy schema */
96
101
  data: ExtractedData;
97
102
  confidence: number;
98
103
  };