@alexein/sdk 0.3.2 → 0.3.3

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.
@@ -187,6 +187,11 @@ interface ItemDefaults {
187
187
  }
188
188
  /** Options `add` takes besides the items. */
189
189
  interface AddOptions extends ItemDefaults {
190
+ /**
191
+ * The id of the one item added, so the same id again edits it. With several items, give each
192
+ * its own `id`: here it is a RangeError, since one id would make them edits of one another.
193
+ */
194
+ id?: string;
190
195
  /** Answer once the items are searchable (briefly waited for). */
191
196
  wait?: boolean;
192
197
  /** Replace phone numbers, cards, keys and the like with their kind before memory keeps them. */
@@ -283,7 +288,8 @@ interface Me {
283
288
  * What memory holds for a question. `memories` come in order: known lines, then facts, then
284
289
  * excerpts. `answerable` is false when memory does not seem to hold the answer, and null when it
285
290
  * was not checked. `failed` is true when a `failOpen` client could not reach memory, and the
286
- * result is empty for that reason.
291
+ * result is empty for that reason. `searchId` is what `feedback()` takes to say how the search
292
+ * went (null when failed).
287
293
  */
288
294
  declare class SearchResult {
289
295
  readonly query: string;
@@ -293,7 +299,8 @@ declare class SearchResult {
293
299
  readonly sources: Json[] | null;
294
300
  readonly failed: boolean;
295
301
  readonly raw: Json;
296
- constructor(query: string, answerable: boolean | null, notes: string[], memories: MemoryEntry[], sources: Json[] | null, failed: boolean, raw: Json);
302
+ readonly searchId: string | null;
303
+ constructor(query: string, answerable: boolean | null, notes: string[], memories: MemoryEntry[], sources: Json[] | null, failed: boolean, raw: Json, searchId?: string | null);
297
304
  static parse(value: unknown): SearchResult;
298
305
  /** What a `failOpen` client answers when memory could not be reached. */
299
306
  static unavailable(query: string): SearchResult;
@@ -304,13 +311,100 @@ declare class SearchResult {
304
311
  get refs(): string[];
305
312
  /**
306
313
  * The text to paste into a prompt: each note on its own line, a blank line, then each memory on
307
- * its own line as `- <text>` (an excerpt with a date as `- <YYYY-MM-DD>: <text>`), cut at a whole
314
+ * its own line as `- <text>` (an excerpt with a date as `- <YYYY-MM-DD>: <text>`; a memory's
315
+ * own line breaks made spaces), cut at a whole
308
316
  * memory so it is never longer than `maxChars`. Empty when there are no memories, or when not
309
317
  * even the first fits. The Python client and the n8n node write the same text.
310
318
  */
311
319
  context(maxChars?: number): string;
312
320
  }
313
321
 
322
+ /**
323
+ * What the routes about people and things answer: one subject whole, what a memory links to, how
324
+ * the person works, and the lessons they taught assistants. Each keeps its JSON in `raw`.
325
+ */
326
+
327
+ /**
328
+ * How one person or thing relates to another, in words (`link`): the day it was said, the ref of
329
+ * the fact that says it, and the ref of the excerpt that fact was learned from (null when unknown,
330
+ * and on `subject()` links).
331
+ */
332
+ interface Link {
333
+ readonly link: string;
334
+ readonly ref: string;
335
+ readonly date: string | null;
336
+ readonly source: string | null;
337
+ readonly raw: Json;
338
+ }
339
+ /**
340
+ * A line for a model, with the refs of the facts it rests on: a subject's `about`, and a
341
+ * conversation about it (whose one ref is an excerpt of that conversation).
342
+ */
343
+ interface Line {
344
+ readonly text: string;
345
+ readonly refs: string[];
346
+ readonly date: string | null;
347
+ readonly raw: Json;
348
+ }
349
+ /**
350
+ * One person or thing by name, whole: `about`, a few lines on how it went; `values`, each
351
+ * property's newest value; `timeline`, its facts oldest first; `conversations` about it; `links`
352
+ * to other people and things. `facts` is 0 when memory holds nothing by that name, and then
353
+ * `suggestions` names the nearest it does.
354
+ */
355
+ interface Subject {
356
+ readonly name: string;
357
+ readonly facts: number;
358
+ readonly about: Line[];
359
+ readonly values: Value[];
360
+ readonly timeline: Fact[];
361
+ readonly conversations: Line[];
362
+ readonly links: Link[];
363
+ readonly suggestions: string[] | null;
364
+ readonly raw: Json;
365
+ }
366
+ /** What the people and things one memory names link to, newest said first. Iterable. */
367
+ interface Related extends Iterable<Link> {
368
+ readonly links: Link[];
369
+ readonly raw: Json;
370
+ }
371
+ /**
372
+ * A plain line for a model, and the refs of the facts it cites. `kind` says what it is: `routine`
373
+ * or `style` from `howTheyWork()` (`surface` names where a style is for), `lesson` from
374
+ * `lessons()` (`from` says what it came from: `correction`, `feedback` or `said`), or `strategy`,
375
+ * `failure` or `workflow` among a `Lessons`' `lessons`. The counts a card rests on are in `raw`.
376
+ */
377
+ interface Card {
378
+ readonly kind: string;
379
+ readonly text: string;
380
+ readonly refs: string[];
381
+ readonly surface: string | null;
382
+ readonly from: string[];
383
+ readonly raw: Json;
384
+ }
385
+ /**
386
+ * How someone works: `cards`, each a routine or a writing style; `procedures`, each routine's
387
+ * counts written out for a model; `voice`, how they write, or null when memory has too few of
388
+ * their messages to say.
389
+ */
390
+ interface Ways {
391
+ readonly who: string;
392
+ readonly cards: Card[];
393
+ readonly procedures: string[];
394
+ readonly voice: string | null;
395
+ readonly raw: Json;
396
+ }
397
+ /**
398
+ * What an assistant should know before a task like `task`: `cards`, the lessons the person taught,
399
+ * most like it first; `lessons`, what earlier attempts at similar tasks taught.
400
+ */
401
+ interface Lessons {
402
+ readonly task: string;
403
+ readonly cards: Card[];
404
+ readonly lessons: Card[];
405
+ readonly raw: Json;
406
+ }
407
+
314
408
  /** The client's settings: from its options, else the environment, else the defaults. */
315
409
  declare const DEFAULT_BASE_URL = "https://api.alexein.ai";
316
410
  /** Long enough for the slowest search and an add that waits; a caller that cannot wait sets less. */
@@ -460,6 +554,21 @@ interface Deleted {
460
554
  readonly deleted: boolean;
461
555
  readonly raw: Json;
462
556
  }
557
+ /**
558
+ * Feedback on one search, kept as a note of this app user's memory: the search id and verdict as
559
+ * sent, and the note's `status`, `queued` or `stored` as an add answers it.
560
+ */
561
+ interface Feedback {
562
+ readonly searchId: string;
563
+ readonly verdict: string;
564
+ readonly status: string;
565
+ readonly raw: Json;
566
+ }
567
+ /** A refresh asked for: `queued`, or `already_queued` when one was already waiting or under way. */
568
+ interface Refreshed {
569
+ readonly status: string;
570
+ readonly raw: Json;
571
+ }
463
572
 
464
573
  /**
465
574
  * Each route as the request it is: path, body and how to read the answer. Written once here and
@@ -514,6 +623,14 @@ interface PageOptions {
514
623
  interface ItemsOptions extends PageOptions {
515
624
  filters?: Filters;
516
625
  }
626
+ interface HowTheyWorkOptions {
627
+ /** Someone in this memory, by name; absent, the person. */
628
+ who?: string;
629
+ /** Where the writing is for, such as a channel or a repository; absent, where they write most. */
630
+ surface?: string;
631
+ }
632
+ /** How a search went: wrong, the answer missing from it, or fine. */
633
+ type Verdict = "wrong" | "missing" | "ok";
517
634
  interface ForgetOptions {
518
635
  items?: string[];
519
636
  sessions?: string[];
@@ -551,6 +668,25 @@ declare class User {
551
668
  }): Promise<Memories>;
552
669
  /** One memory by its ref, whole: an excerpt, or a fact with the excerpts it came from. */
553
670
  open(ref: string): Promise<Opened>;
671
+ /**
672
+ * One person or thing by name, whole: how it went, its values now, its facts in the order they
673
+ * were said, the conversations about it, and how it relates to others.
674
+ */
675
+ subject(name: string, options?: {
676
+ limit?: number;
677
+ }): Promise<Subject>;
678
+ /** What the people and things one fact or excerpt names link to, by its ref. */
679
+ related(ref: string): Promise<Related>;
680
+ /**
681
+ * How the person works - their routines before an action and how they write on each `surface` -
682
+ * for an agent about to act or write for them. `who` names someone else.
683
+ */
684
+ howTheyWork(options?: HowTheyWorkOptions): Promise<Ways>;
685
+ /**
686
+ * What an assistant should know before `task`: how the person corrected assistants and the notes
687
+ * they left on answers, most like it first.
688
+ */
689
+ lessons(task: string): Promise<Lessons>;
554
690
  /** Every value a subject was stated to have, by attribute, oldest first. */
555
691
  history(subject: string, options?: {
556
692
  attribute?: string;
@@ -582,6 +718,19 @@ declare class User {
582
718
  forget(named: ForgetOptions): Promise<Forgotten>;
583
719
  /** Retract one fact for good, by its ref; a `replacement` is kept as a note. */
584
720
  correct(ref: string, replacement?: string): Promise<Correction>;
721
+ /**
722
+ * Say how a search went - `wrong`, `missing` or `ok` - by its result or its `searchId`, and
723
+ * optionally what was true, so memory answers questions like it better. Kept as a note of this
724
+ * memory. Takes a key that writes.
725
+ */
726
+ feedback(search: SearchResult | string, verdict: Verdict, options?: {
727
+ note?: string;
728
+ }): Promise<Feedback>;
729
+ /**
730
+ * Ask memory to bring what it has gathered of this app user up to date soon - after a large
731
+ * import, say. Once an hour per app user. Takes a key that writes.
732
+ */
733
+ refresh(): Promise<Refreshed>;
585
734
  /** Every version of one added item, oldest first. Takes a key that writes. */
586
735
  versions(itemId: string): Promise<Versions>;
587
736
  /** Everything memory holds for this app user, a page at a time. */
@@ -642,4 +791,4 @@ declare class Memory {
642
791
  close(): void;
643
792
  }
644
793
 
645
- export { type Versions as $, type AddOptions as A, type Opened as B, type Correction as C, DEFAULT_BASE_URL as D, type Erased as E, type Fact as F, type GrepOptions as G, type History as H, type Item as I, type Json as J, type Known as K, type LatestOptions as L, type Me as M, type Origin as N, type OpenItem as O, type PageOptions as P, SearchResult as Q, type Source as R, type SearchOptions as S, type Sources as T, type Statuses as U, type StoredItem as V, type Summary as W, User as X, type UsersPage as Y, type Value as Z, type VersionEntry as _, type AddResult as a, type AddedItem as b, type Adding as c, type AppUser as d, type Author as e, DEFAULT_RETRIES as f, DEFAULT_TIMEOUT_MS as g, type Deleted as h, type Excerpt as i, type ExportPage as j, type ExportRecord as k, type FactsPage as l, type Filters as m, type FollowUp as n, type ForgetOptions as o, type Forgotten as p, type ItemDefaults as q, type ItemStatus as r, type ItemsOptions as s, type ItemsPage as t, type Memories as u, Memory as v, type MemoryEntry as w, type MemoryOptions as x, type OpenItems as y, type OpenItemsOptions as z };
794
+ export { type Sources as $, type AddOptions as A, type Memories as B, type Card as C, DEFAULT_BASE_URL as D, type Erased as E, type Fact as F, type GrepOptions as G, type History as H, type Item as I, type Json as J, type Known as K, type LatestOptions as L, type Me as M, Memory as N, type MemoryEntry as O, type MemoryOptions as P, type OpenItem as Q, type OpenItems as R, type OpenItemsOptions as S, type Opened as T, type Origin as U, type PageOptions as V, type Refreshed as W, type Related as X, type SearchOptions as Y, SearchResult as Z, type Source as _, type AddResult as a, type Statuses as a0, type StoredItem as a1, type Subject as a2, type Summary as a3, User as a4, type UsersPage as a5, type Value as a6, type Verdict as a7, type VersionEntry as a8, type Versions as a9, type Ways as aa, type AddedItem as b, type Adding as c, type AppUser as d, type Author as e, type Correction as f, DEFAULT_RETRIES as g, DEFAULT_TIMEOUT_MS as h, type Deleted as i, type Excerpt as j, type ExportPage as k, type ExportRecord as l, type FactsPage as m, type Feedback as n, type Filters as o, type FollowUp as p, type ForgetOptions as q, type Forgotten as r, type HowTheyWorkOptions as s, type ItemDefaults as t, type ItemStatus as u, type ItemsOptions as v, type ItemsPage as w, type Lessons as x, type Line as y, type Link as z };
@@ -187,6 +187,11 @@ interface ItemDefaults {
187
187
  }
188
188
  /** Options `add` takes besides the items. */
189
189
  interface AddOptions extends ItemDefaults {
190
+ /**
191
+ * The id of the one item added, so the same id again edits it. With several items, give each
192
+ * its own `id`: here it is a RangeError, since one id would make them edits of one another.
193
+ */
194
+ id?: string;
190
195
  /** Answer once the items are searchable (briefly waited for). */
191
196
  wait?: boolean;
192
197
  /** Replace phone numbers, cards, keys and the like with their kind before memory keeps them. */
@@ -283,7 +288,8 @@ interface Me {
283
288
  * What memory holds for a question. `memories` come in order: known lines, then facts, then
284
289
  * excerpts. `answerable` is false when memory does not seem to hold the answer, and null when it
285
290
  * was not checked. `failed` is true when a `failOpen` client could not reach memory, and the
286
- * result is empty for that reason.
291
+ * result is empty for that reason. `searchId` is what `feedback()` takes to say how the search
292
+ * went (null when failed).
287
293
  */
288
294
  declare class SearchResult {
289
295
  readonly query: string;
@@ -293,7 +299,8 @@ declare class SearchResult {
293
299
  readonly sources: Json[] | null;
294
300
  readonly failed: boolean;
295
301
  readonly raw: Json;
296
- constructor(query: string, answerable: boolean | null, notes: string[], memories: MemoryEntry[], sources: Json[] | null, failed: boolean, raw: Json);
302
+ readonly searchId: string | null;
303
+ constructor(query: string, answerable: boolean | null, notes: string[], memories: MemoryEntry[], sources: Json[] | null, failed: boolean, raw: Json, searchId?: string | null);
297
304
  static parse(value: unknown): SearchResult;
298
305
  /** What a `failOpen` client answers when memory could not be reached. */
299
306
  static unavailable(query: string): SearchResult;
@@ -304,13 +311,100 @@ declare class SearchResult {
304
311
  get refs(): string[];
305
312
  /**
306
313
  * The text to paste into a prompt: each note on its own line, a blank line, then each memory on
307
- * its own line as `- <text>` (an excerpt with a date as `- <YYYY-MM-DD>: <text>`), cut at a whole
314
+ * its own line as `- <text>` (an excerpt with a date as `- <YYYY-MM-DD>: <text>`; a memory's
315
+ * own line breaks made spaces), cut at a whole
308
316
  * memory so it is never longer than `maxChars`. Empty when there are no memories, or when not
309
317
  * even the first fits. The Python client and the n8n node write the same text.
310
318
  */
311
319
  context(maxChars?: number): string;
312
320
  }
313
321
 
322
+ /**
323
+ * What the routes about people and things answer: one subject whole, what a memory links to, how
324
+ * the person works, and the lessons they taught assistants. Each keeps its JSON in `raw`.
325
+ */
326
+
327
+ /**
328
+ * How one person or thing relates to another, in words (`link`): the day it was said, the ref of
329
+ * the fact that says it, and the ref of the excerpt that fact was learned from (null when unknown,
330
+ * and on `subject()` links).
331
+ */
332
+ interface Link {
333
+ readonly link: string;
334
+ readonly ref: string;
335
+ readonly date: string | null;
336
+ readonly source: string | null;
337
+ readonly raw: Json;
338
+ }
339
+ /**
340
+ * A line for a model, with the refs of the facts it rests on: a subject's `about`, and a
341
+ * conversation about it (whose one ref is an excerpt of that conversation).
342
+ */
343
+ interface Line {
344
+ readonly text: string;
345
+ readonly refs: string[];
346
+ readonly date: string | null;
347
+ readonly raw: Json;
348
+ }
349
+ /**
350
+ * One person or thing by name, whole: `about`, a few lines on how it went; `values`, each
351
+ * property's newest value; `timeline`, its facts oldest first; `conversations` about it; `links`
352
+ * to other people and things. `facts` is 0 when memory holds nothing by that name, and then
353
+ * `suggestions` names the nearest it does.
354
+ */
355
+ interface Subject {
356
+ readonly name: string;
357
+ readonly facts: number;
358
+ readonly about: Line[];
359
+ readonly values: Value[];
360
+ readonly timeline: Fact[];
361
+ readonly conversations: Line[];
362
+ readonly links: Link[];
363
+ readonly suggestions: string[] | null;
364
+ readonly raw: Json;
365
+ }
366
+ /** What the people and things one memory names link to, newest said first. Iterable. */
367
+ interface Related extends Iterable<Link> {
368
+ readonly links: Link[];
369
+ readonly raw: Json;
370
+ }
371
+ /**
372
+ * A plain line for a model, and the refs of the facts it cites. `kind` says what it is: `routine`
373
+ * or `style` from `howTheyWork()` (`surface` names where a style is for), `lesson` from
374
+ * `lessons()` (`from` says what it came from: `correction`, `feedback` or `said`), or `strategy`,
375
+ * `failure` or `workflow` among a `Lessons`' `lessons`. The counts a card rests on are in `raw`.
376
+ */
377
+ interface Card {
378
+ readonly kind: string;
379
+ readonly text: string;
380
+ readonly refs: string[];
381
+ readonly surface: string | null;
382
+ readonly from: string[];
383
+ readonly raw: Json;
384
+ }
385
+ /**
386
+ * How someone works: `cards`, each a routine or a writing style; `procedures`, each routine's
387
+ * counts written out for a model; `voice`, how they write, or null when memory has too few of
388
+ * their messages to say.
389
+ */
390
+ interface Ways {
391
+ readonly who: string;
392
+ readonly cards: Card[];
393
+ readonly procedures: string[];
394
+ readonly voice: string | null;
395
+ readonly raw: Json;
396
+ }
397
+ /**
398
+ * What an assistant should know before a task like `task`: `cards`, the lessons the person taught,
399
+ * most like it first; `lessons`, what earlier attempts at similar tasks taught.
400
+ */
401
+ interface Lessons {
402
+ readonly task: string;
403
+ readonly cards: Card[];
404
+ readonly lessons: Card[];
405
+ readonly raw: Json;
406
+ }
407
+
314
408
  /** The client's settings: from its options, else the environment, else the defaults. */
315
409
  declare const DEFAULT_BASE_URL = "https://api.alexein.ai";
316
410
  /** Long enough for the slowest search and an add that waits; a caller that cannot wait sets less. */
@@ -460,6 +554,21 @@ interface Deleted {
460
554
  readonly deleted: boolean;
461
555
  readonly raw: Json;
462
556
  }
557
+ /**
558
+ * Feedback on one search, kept as a note of this app user's memory: the search id and verdict as
559
+ * sent, and the note's `status`, `queued` or `stored` as an add answers it.
560
+ */
561
+ interface Feedback {
562
+ readonly searchId: string;
563
+ readonly verdict: string;
564
+ readonly status: string;
565
+ readonly raw: Json;
566
+ }
567
+ /** A refresh asked for: `queued`, or `already_queued` when one was already waiting or under way. */
568
+ interface Refreshed {
569
+ readonly status: string;
570
+ readonly raw: Json;
571
+ }
463
572
 
464
573
  /**
465
574
  * Each route as the request it is: path, body and how to read the answer. Written once here and
@@ -514,6 +623,14 @@ interface PageOptions {
514
623
  interface ItemsOptions extends PageOptions {
515
624
  filters?: Filters;
516
625
  }
626
+ interface HowTheyWorkOptions {
627
+ /** Someone in this memory, by name; absent, the person. */
628
+ who?: string;
629
+ /** Where the writing is for, such as a channel or a repository; absent, where they write most. */
630
+ surface?: string;
631
+ }
632
+ /** How a search went: wrong, the answer missing from it, or fine. */
633
+ type Verdict = "wrong" | "missing" | "ok";
517
634
  interface ForgetOptions {
518
635
  items?: string[];
519
636
  sessions?: string[];
@@ -551,6 +668,25 @@ declare class User {
551
668
  }): Promise<Memories>;
552
669
  /** One memory by its ref, whole: an excerpt, or a fact with the excerpts it came from. */
553
670
  open(ref: string): Promise<Opened>;
671
+ /**
672
+ * One person or thing by name, whole: how it went, its values now, its facts in the order they
673
+ * were said, the conversations about it, and how it relates to others.
674
+ */
675
+ subject(name: string, options?: {
676
+ limit?: number;
677
+ }): Promise<Subject>;
678
+ /** What the people and things one fact or excerpt names link to, by its ref. */
679
+ related(ref: string): Promise<Related>;
680
+ /**
681
+ * How the person works - their routines before an action and how they write on each `surface` -
682
+ * for an agent about to act or write for them. `who` names someone else.
683
+ */
684
+ howTheyWork(options?: HowTheyWorkOptions): Promise<Ways>;
685
+ /**
686
+ * What an assistant should know before `task`: how the person corrected assistants and the notes
687
+ * they left on answers, most like it first.
688
+ */
689
+ lessons(task: string): Promise<Lessons>;
554
690
  /** Every value a subject was stated to have, by attribute, oldest first. */
555
691
  history(subject: string, options?: {
556
692
  attribute?: string;
@@ -582,6 +718,19 @@ declare class User {
582
718
  forget(named: ForgetOptions): Promise<Forgotten>;
583
719
  /** Retract one fact for good, by its ref; a `replacement` is kept as a note. */
584
720
  correct(ref: string, replacement?: string): Promise<Correction>;
721
+ /**
722
+ * Say how a search went - `wrong`, `missing` or `ok` - by its result or its `searchId`, and
723
+ * optionally what was true, so memory answers questions like it better. Kept as a note of this
724
+ * memory. Takes a key that writes.
725
+ */
726
+ feedback(search: SearchResult | string, verdict: Verdict, options?: {
727
+ note?: string;
728
+ }): Promise<Feedback>;
729
+ /**
730
+ * Ask memory to bring what it has gathered of this app user up to date soon - after a large
731
+ * import, say. Once an hour per app user. Takes a key that writes.
732
+ */
733
+ refresh(): Promise<Refreshed>;
585
734
  /** Every version of one added item, oldest first. Takes a key that writes. */
586
735
  versions(itemId: string): Promise<Versions>;
587
736
  /** Everything memory holds for this app user, a page at a time. */
@@ -642,4 +791,4 @@ declare class Memory {
642
791
  close(): void;
643
792
  }
644
793
 
645
- export { type Versions as $, type AddOptions as A, type Opened as B, type Correction as C, DEFAULT_BASE_URL as D, type Erased as E, type Fact as F, type GrepOptions as G, type History as H, type Item as I, type Json as J, type Known as K, type LatestOptions as L, type Me as M, type Origin as N, type OpenItem as O, type PageOptions as P, SearchResult as Q, type Source as R, type SearchOptions as S, type Sources as T, type Statuses as U, type StoredItem as V, type Summary as W, User as X, type UsersPage as Y, type Value as Z, type VersionEntry as _, type AddResult as a, type AddedItem as b, type Adding as c, type AppUser as d, type Author as e, DEFAULT_RETRIES as f, DEFAULT_TIMEOUT_MS as g, type Deleted as h, type Excerpt as i, type ExportPage as j, type ExportRecord as k, type FactsPage as l, type Filters as m, type FollowUp as n, type ForgetOptions as o, type Forgotten as p, type ItemDefaults as q, type ItemStatus as r, type ItemsOptions as s, type ItemsPage as t, type Memories as u, Memory as v, type MemoryEntry as w, type MemoryOptions as x, type OpenItems as y, type OpenItemsOptions as z };
794
+ export { type Sources as $, type AddOptions as A, type Memories as B, type Card as C, DEFAULT_BASE_URL as D, type Erased as E, type Fact as F, type GrepOptions as G, type History as H, type Item as I, type Json as J, type Known as K, type LatestOptions as L, type Me as M, Memory as N, type MemoryEntry as O, type MemoryOptions as P, type OpenItem as Q, type OpenItems as R, type OpenItemsOptions as S, type Opened as T, type Origin as U, type PageOptions as V, type Refreshed as W, type Related as X, type SearchOptions as Y, SearchResult as Z, type Source as _, type AddResult as a, type Statuses as a0, type StoredItem as a1, type Subject as a2, type Summary as a3, User as a4, type UsersPage as a5, type Value as a6, type Verdict as a7, type VersionEntry as a8, type Versions as a9, type Ways as aa, type AddedItem as b, type Adding as c, type AppUser as d, type Author as e, type Correction as f, DEFAULT_RETRIES as g, DEFAULT_TIMEOUT_MS as h, type Deleted as i, type Excerpt as j, type ExportPage as k, type ExportRecord as l, type FactsPage as m, type Feedback as n, type Filters as o, type FollowUp as p, type ForgetOptions as q, type Forgotten as r, type HowTheyWorkOptions as s, type ItemDefaults as t, type ItemStatus as u, type ItemsOptions as v, type ItemsPage as w, type Lessons as x, type Line as y, type Link as z };
package/dist/index.cjs CHANGED
@@ -16,7 +16,7 @@
16
16
 
17
17
 
18
18
 
19
- var _chunkAJGT53UZcjs = require('./chunk-AJGT53UZ.cjs');
19
+ var _chunk34W2JJVDcjs = require('./chunk-34W2JJVD.cjs');
20
20
 
21
21
 
22
22
 
@@ -35,4 +35,4 @@ var _chunkAJGT53UZcjs = require('./chunk-AJGT53UZ.cjs');
35
35
 
36
36
 
37
37
 
38
- exports.APIConnectionError = _chunkAJGT53UZcjs.APIConnectionError; exports.APITimeoutError = _chunkAJGT53UZcjs.APITimeoutError; exports.AlexeinError = _chunkAJGT53UZcjs.AlexeinError; exports.AuthenticationError = _chunkAJGT53UZcjs.AuthenticationError; exports.DEFAULT_BASE_URL = _chunkAJGT53UZcjs.DEFAULT_BASE_URL; exports.DEFAULT_RETRIES = _chunkAJGT53UZcjs.DEFAULT_RETRIES; exports.DEFAULT_TIMEOUT_MS = _chunkAJGT53UZcjs.DEFAULT_TIMEOUT_MS; exports.InvalidRequestError = _chunkAJGT53UZcjs.InvalidRequestError; exports.Memory = _chunkAJGT53UZcjs.Memory; exports.NotFoundError = _chunkAJGT53UZcjs.NotFoundError; exports.PermissionDeniedError = _chunkAJGT53UZcjs.PermissionDeniedError; exports.QuotaExceededError = _chunkAJGT53UZcjs.QuotaExceededError; exports.RateLimitError = _chunkAJGT53UZcjs.RateLimitError; exports.SearchResult = _chunkAJGT53UZcjs.SearchResult; exports.ServiceUnavailableError = _chunkAJGT53UZcjs.ServiceUnavailableError; exports.User = _chunkAJGT53UZcjs.User; exports.VERSION = _chunkAJGT53UZcjs.VERSION;
38
+ exports.APIConnectionError = _chunk34W2JJVDcjs.APIConnectionError; exports.APITimeoutError = _chunk34W2JJVDcjs.APITimeoutError; exports.AlexeinError = _chunk34W2JJVDcjs.AlexeinError; exports.AuthenticationError = _chunk34W2JJVDcjs.AuthenticationError; exports.DEFAULT_BASE_URL = _chunk34W2JJVDcjs.DEFAULT_BASE_URL; exports.DEFAULT_RETRIES = _chunk34W2JJVDcjs.DEFAULT_RETRIES; exports.DEFAULT_TIMEOUT_MS = _chunk34W2JJVDcjs.DEFAULT_TIMEOUT_MS; exports.InvalidRequestError = _chunk34W2JJVDcjs.InvalidRequestError; exports.Memory = _chunk34W2JJVDcjs.Memory; exports.NotFoundError = _chunk34W2JJVDcjs.NotFoundError; exports.PermissionDeniedError = _chunk34W2JJVDcjs.PermissionDeniedError; exports.QuotaExceededError = _chunk34W2JJVDcjs.QuotaExceededError; exports.RateLimitError = _chunk34W2JJVDcjs.RateLimitError; exports.SearchResult = _chunk34W2JJVDcjs.SearchResult; exports.ServiceUnavailableError = _chunk34W2JJVDcjs.ServiceUnavailableError; exports.User = _chunk34W2JJVDcjs.User; exports.VERSION = _chunk34W2JJVDcjs.VERSION;
package/dist/index.d.cts CHANGED
@@ -1,7 +1,7 @@
1
- import { J as Json } from './client-DJsIRKil.cjs';
2
- export { A as AddOptions, a as AddResult, b as AddedItem, c as Adding, d as AppUser, e as Author, C as Correction, D as DEFAULT_BASE_URL, f as DEFAULT_RETRIES, g as DEFAULT_TIMEOUT_MS, h as Deleted, E as Erased, i as Excerpt, j as ExportPage, k as ExportRecord, F as Fact, l as FactsPage, m as Filters, n as FollowUp, o as ForgetOptions, p as Forgotten, G as GrepOptions, H as History, I as Item, q as ItemDefaults, r as ItemStatus, s as ItemsOptions, t as ItemsPage, K as Known, L as LatestOptions, M as Me, u as Memories, v as Memory, w as MemoryEntry, x as MemoryOptions, O as OpenItem, y as OpenItems, z as OpenItemsOptions, B as Opened, N as Origin, P as PageOptions, S as SearchOptions, Q as SearchResult, R as Source, T as Sources, U as Statuses, V as StoredItem, W as Summary, X as User, Y as UsersPage, Z as Value, _ as VersionEntry, $ as Versions } from './client-DJsIRKil.cjs';
1
+ import { J as Json } from './client-Bz10lVYG.cjs';
2
+ export { A as AddOptions, a as AddResult, b as AddedItem, c as Adding, d as AppUser, e as Author, C as Card, f as Correction, D as DEFAULT_BASE_URL, g as DEFAULT_RETRIES, h as DEFAULT_TIMEOUT_MS, i as Deleted, E as Erased, j as Excerpt, k as ExportPage, l as ExportRecord, F as Fact, m as FactsPage, n as Feedback, o as Filters, p as FollowUp, q as ForgetOptions, r as Forgotten, G as GrepOptions, H as History, s as HowTheyWorkOptions, I as Item, t as ItemDefaults, u as ItemStatus, v as ItemsOptions, w as ItemsPage, K as Known, L as LatestOptions, x as Lessons, y as Line, z as Link, M as Me, B as Memories, N as Memory, O as MemoryEntry, P as MemoryOptions, Q as OpenItem, R as OpenItems, S as OpenItemsOptions, T as Opened, U as Origin, V as PageOptions, W as Refreshed, X as Related, Y as SearchOptions, Z as SearchResult, _ as Source, $ as Sources, a0 as Statuses, a1 as StoredItem, a2 as Subject, a3 as Summary, a4 as User, a5 as UsersPage, a6 as Value, a7 as Verdict, a8 as VersionEntry, a9 as Versions, aa as Ways } from './client-Bz10lVYG.cjs';
3
3
 
4
- declare const VERSION = "0.3.2";
4
+ declare const VERSION = "0.3.3";
5
5
 
6
6
  /**
7
7
  * What can go wrong, one class per thing a caller would handle differently: the same classes as
package/dist/index.d.ts CHANGED
@@ -1,7 +1,7 @@
1
- import { J as Json } from './client-DJsIRKil.js';
2
- export { A as AddOptions, a as AddResult, b as AddedItem, c as Adding, d as AppUser, e as Author, C as Correction, D as DEFAULT_BASE_URL, f as DEFAULT_RETRIES, g as DEFAULT_TIMEOUT_MS, h as Deleted, E as Erased, i as Excerpt, j as ExportPage, k as ExportRecord, F as Fact, l as FactsPage, m as Filters, n as FollowUp, o as ForgetOptions, p as Forgotten, G as GrepOptions, H as History, I as Item, q as ItemDefaults, r as ItemStatus, s as ItemsOptions, t as ItemsPage, K as Known, L as LatestOptions, M as Me, u as Memories, v as Memory, w as MemoryEntry, x as MemoryOptions, O as OpenItem, y as OpenItems, z as OpenItemsOptions, B as Opened, N as Origin, P as PageOptions, S as SearchOptions, Q as SearchResult, R as Source, T as Sources, U as Statuses, V as StoredItem, W as Summary, X as User, Y as UsersPage, Z as Value, _ as VersionEntry, $ as Versions } from './client-DJsIRKil.js';
1
+ import { J as Json } from './client-Bz10lVYG.js';
2
+ export { A as AddOptions, a as AddResult, b as AddedItem, c as Adding, d as AppUser, e as Author, C as Card, f as Correction, D as DEFAULT_BASE_URL, g as DEFAULT_RETRIES, h as DEFAULT_TIMEOUT_MS, i as Deleted, E as Erased, j as Excerpt, k as ExportPage, l as ExportRecord, F as Fact, m as FactsPage, n as Feedback, o as Filters, p as FollowUp, q as ForgetOptions, r as Forgotten, G as GrepOptions, H as History, s as HowTheyWorkOptions, I as Item, t as ItemDefaults, u as ItemStatus, v as ItemsOptions, w as ItemsPage, K as Known, L as LatestOptions, x as Lessons, y as Line, z as Link, M as Me, B as Memories, N as Memory, O as MemoryEntry, P as MemoryOptions, Q as OpenItem, R as OpenItems, S as OpenItemsOptions, T as Opened, U as Origin, V as PageOptions, W as Refreshed, X as Related, Y as SearchOptions, Z as SearchResult, _ as Source, $ as Sources, a0 as Statuses, a1 as StoredItem, a2 as Subject, a3 as Summary, a4 as User, a5 as UsersPage, a6 as Value, a7 as Verdict, a8 as VersionEntry, a9 as Versions, aa as Ways } from './client-Bz10lVYG.js';
3
3
 
4
- declare const VERSION = "0.3.2";
4
+ declare const VERSION = "0.3.3";
5
5
 
6
6
  /**
7
7
  * What can go wrong, one class per thing a caller would handle differently: the same classes as
package/dist/index.js CHANGED
@@ -16,7 +16,7 @@ import {
16
16
  ServiceUnavailableError,
17
17
  User,
18
18
  VERSION
19
- } from "./chunk-CKBVQNV5.js";
19
+ } from "./chunk-5YIOYX3J.js";
20
20
  export {
21
21
  APIConnectionError,
22
22
  APITimeoutError,
@@ -12,10 +12,10 @@
12
12
 
13
13
 
14
14
 
15
- var _chunkVNLJZ26Ccjs = require('./chunk-VNLJZ26C.cjs');
15
+ var _chunkLWBADF3Fcjs = require('./chunk-LWBADF3F.cjs');
16
16
 
17
17
 
18
- var _chunkAJGT53UZcjs = require('./chunk-AJGT53UZ.cjs');
18
+ var _chunk34W2JJVDcjs = require('./chunk-34W2JJVD.cjs');
19
19
 
20
20
  // src/langgraph/index.ts
21
21
  var _messages = require('@langchain/core/messages');
@@ -58,12 +58,12 @@ var AlexeinMemory = (_class = class {
58
58
  #client;
59
59
  /** `client` defaults to one made on first use: fail-open unless strict, a 10 s timeout. */
60
60
  constructor(client, options = {}) {;_class.prototype.__init.call(this);_class.prototype.__init2.call(this);_class.prototype.__init3.call(this);
61
- const given = _chunkVNLJZ26Ccjs.isClient.call(void 0, client) ? client : void 0;
62
- const settings = _chunkVNLJZ26Ccjs.isClient.call(void 0, client) ? options : { ...client, ...options };
61
+ const given = _chunkLWBADF3Fcjs.isClient.call(void 0, client) ? client : void 0;
62
+ const settings = _chunkLWBADF3Fcjs.isClient.call(void 0, client) ? options : { ...client, ...options };
63
63
  this.fast = _nullishCoalesce(settings.fast, () => ( false));
64
64
  this.maxChars = _nullishCoalesce(settings.maxChars, () => ( 4e3));
65
65
  this.strict = _nullishCoalesce(settings.strict, () => ( false));
66
- this.#client = new (0, _chunkVNLJZ26Ccjs.LazyClient)(given, "langgraph", this.strict, settings.timeout);
66
+ this.#client = new (0, _chunkLWBADF3Fcjs.LazyClient)(given, "langgraph", this.strict, settings.timeout);
67
67
  }
68
68
  get client() {
69
69
  return this.#client.client;
@@ -76,7 +76,7 @@ var AlexeinMemory = (_class = class {
76
76
  const asked = _optionalChain([lastHuman, 'call', _16 => _16(state.messages), 'optionalAccess', _17 => _17.text, 'access', _18 => _18.trim, 'call', _19 => _19()]);
77
77
  const user = this.user(config);
78
78
  if (!asked) return { memory: "" };
79
- const found = await _chunkVNLJZ26Ccjs.searchFor.call(void 0, user, asked, this.fast);
79
+ const found = await _chunkLWBADF3Fcjs.searchFor.call(void 0, user, asked, this.fast);
80
80
  return { memory: _nullishCoalesce(_optionalChain([found, 'optionalAccess', _20 => _20.context, 'call', _21 => _21(this.maxChars)]), () => ( "")) };
81
81
  }}
82
82
  /**
@@ -96,7 +96,7 @@ var AlexeinMemory = (_class = class {
96
96
  return {};
97
97
  }}
98
98
  /** What `recall` found, as a block for your system prompt; empty when it found nothing. */
99
- __init3() {this.prompt = (state) => _chunkVNLJZ26Ccjs.promptBlock.call(void 0, _nullishCoalesce(state.memory, () => ( "")))}
99
+ __init3() {this.prompt = (state) => _chunkLWBADF3Fcjs.promptBlock.call(void 0, _nullishCoalesce(state.memory, () => ( "")))}
100
100
  /**
101
101
  * Tools the model calls when it decides to: `memory_search` and `memory_open`, and with
102
102
  * `write`, `memory_add`. The user comes from the run, which a model never sees.
@@ -108,8 +108,8 @@ var AlexeinMemory = (_class = class {
108
108
  searchTool() {
109
109
  return _tools.tool.call(void 0,
110
110
  async ({ query }, config) => {
111
- const found = await _chunkVNLJZ26Ccjs.searchFor.call(void 0, this.user(config), query, this.fast);
112
- return _chunkVNLJZ26Ccjs.searchAnswer.call(void 0, found, this.maxChars);
111
+ const found = await _chunkLWBADF3Fcjs.searchFor.call(void 0, this.user(config), query, this.fast);
112
+ return _chunkLWBADF3Fcjs.searchAnswer.call(void 0, found, this.maxChars);
113
113
  },
114
114
  {
115
115
  name: "memory_search",
@@ -123,10 +123,10 @@ var AlexeinMemory = (_class = class {
123
123
  async ({ ref }, config) => {
124
124
  const user = this.user(config);
125
125
  try {
126
- return _chunkVNLJZ26Ccjs.openAnswer.call(void 0, await user.open(ref));
126
+ return _chunkLWBADF3Fcjs.openAnswer.call(void 0, await user.open(ref));
127
127
  } catch (error) {
128
- if (error instanceof _chunkAJGT53UZcjs.NotFoundError) return _chunkVNLJZ26Ccjs.notFoundAnswer.call(void 0, error);
129
- return _chunkVNLJZ26Ccjs.outageAnswer.call(void 0, error, this.strict);
128
+ if (error instanceof _chunk34W2JJVDcjs.NotFoundError) return _chunkLWBADF3Fcjs.notFoundAnswer.call(void 0, error);
129
+ return _chunkLWBADF3Fcjs.outageAnswer.call(void 0, error, this.strict);
130
130
  }
131
131
  },
132
132
  {
@@ -143,7 +143,7 @@ var AlexeinMemory = (_class = class {
143
143
  kind: "note",
144
144
  session: threadOf(config)
145
145
  });
146
- return saved.failed ? _chunkVNLJZ26Ccjs.UNAVAILABLE : _chunkVNLJZ26Ccjs.SAVED;
146
+ return saved.failed ? _chunkLWBADF3Fcjs.UNAVAILABLE : _chunkLWBADF3Fcjs.SAVED;
147
147
  },
148
148
  {
149
149
  name: "memory_add",
@@ -156,7 +156,7 @@ var AlexeinMemory = (_class = class {
156
156
  async function item(message, role, thread) {
157
157
  const text = _optionalChain([message, 'optionalAccess', _22 => _22.text]);
158
158
  if (!_optionalChain([text, 'optionalAccess', _23 => _23.trim, 'call', _24 => _24()])) return void 0;
159
- const id = await _asyncNullishCoalesce(await _asyncOptionalChain([message, 'optionalAccess', async _25 => _25.id]), async () => ( await _chunkVNLJZ26Ccjs.stableId.call(void 0, thread, role, text)));
159
+ const id = await _asyncNullishCoalesce(await _asyncOptionalChain([message, 'optionalAccess', async _25 => _25.id]), async () => ( await _chunkLWBADF3Fcjs.stableId.call(void 0, thread, role, text)));
160
160
  return { id, role, text };
161
161
  }
162
162
  var fallback;
@@ -182,4 +182,4 @@ var memoryTools = (options = {}) => defaultMemory().tools(options);
182
182
 
183
183
 
184
184
 
185
- exports.AlexeinMemory = AlexeinMemory; exports.MemoryAnnotation = MemoryAnnotation; exports.MemoryContext = MemoryContext; exports.MemoryState = MemoryState; exports.NOTHING_FOUND = _chunkVNLJZ26Ccjs.NOTHING_FOUND; exports.NOTHING_YET = _chunkVNLJZ26Ccjs.NOTHING_YET; exports.UNAVAILABLE = _chunkVNLJZ26Ccjs.UNAVAILABLE; exports.defaultMemory = defaultMemory; exports.memoryPrompt = memoryPrompt; exports.memoryTools = memoryTools; exports.recall = recall; exports.remember = remember; exports.userIdOf = userIdOf;
185
+ exports.AlexeinMemory = AlexeinMemory; exports.MemoryAnnotation = MemoryAnnotation; exports.MemoryContext = MemoryContext; exports.MemoryState = MemoryState; exports.NOTHING_FOUND = _chunkLWBADF3Fcjs.NOTHING_FOUND; exports.NOTHING_YET = _chunkLWBADF3Fcjs.NOTHING_YET; exports.UNAVAILABLE = _chunkLWBADF3Fcjs.UNAVAILABLE; exports.defaultMemory = defaultMemory; exports.memoryPrompt = memoryPrompt; exports.memoryTools = memoryTools; exports.recall = recall; exports.remember = remember; exports.userIdOf = userIdOf;
@@ -4,7 +4,7 @@ import * as _langchain_langgraph from '@langchain/langgraph';
4
4
  import { StateSchema } from '@langchain/langgraph';
5
5
  import { StructuredToolInterface } from '@langchain/core/tools';
6
6
  import { z } from 'zod';
7
- import { v as Memory } from './client-DJsIRKil.cjs';
7
+ import { N as Memory } from './client-Bz10lVYG.cjs';
8
8
  import { I as IntegrationOptions } from './shared-Btg8LbKC.cjs';
9
9
  export { N as NOTHING_FOUND, a as NOTHING_YET, U as UNAVAILABLE } from './shared-Btg8LbKC.cjs';
10
10
 
@@ -4,7 +4,7 @@ import * as _langchain_langgraph from '@langchain/langgraph';
4
4
  import { StateSchema } from '@langchain/langgraph';
5
5
  import { StructuredToolInterface } from '@langchain/core/tools';
6
6
  import { z } from 'zod';
7
- import { v as Memory } from './client-DJsIRKil.js';
7
+ import { N as Memory } from './client-Bz10lVYG.js';
8
8
  import { I as IntegrationOptions } from './shared-Btg8LbKC.js';
9
9
  export { N as NOTHING_FOUND, a as NOTHING_YET, U as UNAVAILABLE } from './shared-Btg8LbKC.js';
10
10
 
package/dist/langgraph.js CHANGED
@@ -12,10 +12,10 @@ import {
12
12
  searchAnswer,
13
13
  searchFor,
14
14
  stableId
15
- } from "./chunk-5Y43EWDD.js";
15
+ } from "./chunk-HDNKPJS2.js";
16
16
  import {
17
17
  NotFoundError
18
- } from "./chunk-CKBVQNV5.js";
18
+ } from "./chunk-5YIOYX3J.js";
19
19
 
20
20
  // src/langgraph/index.ts
21
21
  import { AIMessage, HumanMessage } from "@langchain/core/messages";