xmemory 2.3.0 → 3.0.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/README.md CHANGED
@@ -122,6 +122,7 @@ Extract and store structured objects from text.
122
122
  ```typescript
123
123
  const result = await inst.write("Bob is a designer based in Berlin.");
124
124
  console.log(result.write_id, result.trace_id);
125
+ console.log(result.changes); // what the write created / updated / deleted
125
126
  ```
126
127
 
127
128
  Options: `{ extractionLogic?, diffEngine?, timeoutMs? }` — `extractionLogic` defaults to `"fast"`.
@@ -5,6 +5,7 @@ import type { ApplyPendingDecisionsResult, AsyncWriteResult, DecideSuggestionsRe
5
5
  export declare class DescribeResult {
6
6
  readonly instanceId: string;
7
7
  readonly instanceName: string;
8
+ readonly about: string;
8
9
  readonly schemaSummary: string;
9
10
  readonly tools: readonly ToolDescription[];
10
11
  constructor(raw: RawDescribeResult);
package/dist/instance.js CHANGED
@@ -5,11 +5,13 @@ const DEFAULT_DESCRIBE_TTL_MS = 300_000; // 5 minutes
5
5
  export class DescribeResult {
6
6
  instanceId;
7
7
  instanceName;
8
+ about;
8
9
  schemaSummary;
9
10
  tools;
10
11
  constructor(raw) {
11
12
  this.instanceId = raw.instance_id;
12
13
  this.instanceName = raw.instance_name;
14
+ this.about = raw.about ?? "";
13
15
  this.schemaSummary = raw.schema_summary;
14
16
  this.tools = raw.tools;
15
17
  }
@@ -24,6 +26,9 @@ export class DescribeResult {
24
26
  const includeHttp = options?.includeHttp ?? false;
25
27
  const lines = [];
26
28
  lines.push(`Instance: ${this.instanceName} (${this.instanceId})`);
29
+ if (this.about) {
30
+ lines.push(`\n${this.about}`);
31
+ }
27
32
  if (this.schemaSummary) {
28
33
  lines.push(`\n${this.schemaSummary}`);
29
34
  }
package/dist/types.d.ts CHANGED
@@ -6,7 +6,7 @@ export declare const SchemaType: {
6
6
  readonly JSON: 1;
7
7
  };
8
8
  export type SchemaTypeValue = (typeof SchemaType)[keyof typeof SchemaType];
9
- export type ExtractionLogic = "fast" | "regular" | "deep";
9
+ export type ExtractionLogic = "fast" | "deep";
10
10
  export type ReadMode = "single-answer" | "raw-tables" | "xresponse";
11
11
  /**
12
12
  * One concrete object a scoped read may touch. Identify it by `type` (PascalCase
@@ -81,7 +81,8 @@ export interface ReadResult {
81
81
  export interface WriteResult {
82
82
  readonly write_id: string;
83
83
  readonly trace_id: string | null;
84
- readonly cleaned_objects: unknown;
84
+ /** What the write did, grouped into `created` / `updated` / `deleted`. */
85
+ readonly changes: unknown;
85
86
  }
86
87
  export interface AsyncWriteResult {
87
88
  readonly write_id: string;
@@ -326,6 +327,7 @@ export interface ToolDescription {
326
327
  export interface RawDescribeResult {
327
328
  readonly instance_id: string;
328
329
  readonly instance_name: string;
330
+ readonly about?: string;
329
331
  readonly schema_summary: string;
330
332
  readonly tools: ToolDescription[];
331
333
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "xmemory",
3
- "version": "2.3.0",
3
+ "version": "3.0.0",
4
4
  "description": "xmemory",
5
5
  "keywords": [
6
6
  "xmemory"