@maximem/synap-js-sdk 0.5.7 → 0.5.8
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.cjs +5 -1
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +24 -1
- package/dist/index.d.ts +24 -1
- package/dist/index.js +5 -1
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.d.cts
CHANGED
|
@@ -393,6 +393,15 @@ interface RawContextItem {
|
|
|
393
393
|
* served from the prefetch cache.
|
|
394
394
|
*/
|
|
395
395
|
matched_queries?: string[];
|
|
396
|
+
/**
|
|
397
|
+
* Anything the server sends that this SDK version has no named field for.
|
|
398
|
+
*
|
|
399
|
+
* This index signature already made unknown keys reachable in the TYPE; what
|
|
400
|
+
* dropped them was the normaliser, which built each item from a hand-picked
|
|
401
|
+
* list of keys. So `event_end` and `event_precision` were computed by the
|
|
402
|
+
* server, dropped by its own payload, and dropped a third time here, and a
|
|
403
|
+
* caller could not read "sometime in April" even once the server sent it.
|
|
404
|
+
*/
|
|
396
405
|
[key: string]: unknown;
|
|
397
406
|
}
|
|
398
407
|
interface RawConversationContext {
|
|
@@ -419,6 +428,17 @@ interface RawContext {
|
|
|
419
428
|
}
|
|
420
429
|
interface TemporalFields {
|
|
421
430
|
eventDate: string | null;
|
|
431
|
+
/**
|
|
432
|
+
* The rest of the event window. `eventDate` is its START.
|
|
433
|
+
*
|
|
434
|
+
* "last month" is stored as 2023-04-01 to 2023-04-30 at precision "month",
|
|
435
|
+
* and reading only the start makes it look like the 1st, so arithmetic from
|
|
436
|
+
* it is wrong by up to the width of the window. `eventPrecision` carries the
|
|
437
|
+
* one distinction nothing else does: "approximate" has no end, so "around
|
|
438
|
+
* November 20" and "on November 20" differ only by this label.
|
|
439
|
+
*/
|
|
440
|
+
eventEnd: string | null;
|
|
441
|
+
eventPrecision: string | null;
|
|
422
442
|
/**
|
|
423
443
|
* The day the words were SAID, which is not the day the event happened.
|
|
424
444
|
*
|
|
@@ -478,6 +498,9 @@ interface TemporalEvent extends QueryAttribution {
|
|
|
478
498
|
id: string;
|
|
479
499
|
content: string;
|
|
480
500
|
eventDate: string | null;
|
|
501
|
+
/** The rest of the window. See the note on `TemporalFields.eventEnd`. */
|
|
502
|
+
eventEnd: string | null;
|
|
503
|
+
eventPrecision: string | null;
|
|
481
504
|
/** See the note on `TemporalFields.saidAt`. */
|
|
482
505
|
saidAt: string | null;
|
|
483
506
|
validUntil: string | null;
|
|
@@ -1678,7 +1701,7 @@ declare class SynapClient {
|
|
|
1678
1701
|
* build when the two disagree, which is the only thing that makes a manual
|
|
1679
1702
|
* publish safe.
|
|
1680
1703
|
*/
|
|
1681
|
-
declare const SDK_VERSION = "0.5.
|
|
1704
|
+
declare const SDK_VERSION = "0.5.8";
|
|
1682
1705
|
|
|
1683
1706
|
/**
|
|
1684
1707
|
* BM25 scorer for the anticipation cache.
|
package/dist/index.d.ts
CHANGED
|
@@ -393,6 +393,15 @@ interface RawContextItem {
|
|
|
393
393
|
* served from the prefetch cache.
|
|
394
394
|
*/
|
|
395
395
|
matched_queries?: string[];
|
|
396
|
+
/**
|
|
397
|
+
* Anything the server sends that this SDK version has no named field for.
|
|
398
|
+
*
|
|
399
|
+
* This index signature already made unknown keys reachable in the TYPE; what
|
|
400
|
+
* dropped them was the normaliser, which built each item from a hand-picked
|
|
401
|
+
* list of keys. So `event_end` and `event_precision` were computed by the
|
|
402
|
+
* server, dropped by its own payload, and dropped a third time here, and a
|
|
403
|
+
* caller could not read "sometime in April" even once the server sent it.
|
|
404
|
+
*/
|
|
396
405
|
[key: string]: unknown;
|
|
397
406
|
}
|
|
398
407
|
interface RawConversationContext {
|
|
@@ -419,6 +428,17 @@ interface RawContext {
|
|
|
419
428
|
}
|
|
420
429
|
interface TemporalFields {
|
|
421
430
|
eventDate: string | null;
|
|
431
|
+
/**
|
|
432
|
+
* The rest of the event window. `eventDate` is its START.
|
|
433
|
+
*
|
|
434
|
+
* "last month" is stored as 2023-04-01 to 2023-04-30 at precision "month",
|
|
435
|
+
* and reading only the start makes it look like the 1st, so arithmetic from
|
|
436
|
+
* it is wrong by up to the width of the window. `eventPrecision` carries the
|
|
437
|
+
* one distinction nothing else does: "approximate" has no end, so "around
|
|
438
|
+
* November 20" and "on November 20" differ only by this label.
|
|
439
|
+
*/
|
|
440
|
+
eventEnd: string | null;
|
|
441
|
+
eventPrecision: string | null;
|
|
422
442
|
/**
|
|
423
443
|
* The day the words were SAID, which is not the day the event happened.
|
|
424
444
|
*
|
|
@@ -478,6 +498,9 @@ interface TemporalEvent extends QueryAttribution {
|
|
|
478
498
|
id: string;
|
|
479
499
|
content: string;
|
|
480
500
|
eventDate: string | null;
|
|
501
|
+
/** The rest of the window. See the note on `TemporalFields.eventEnd`. */
|
|
502
|
+
eventEnd: string | null;
|
|
503
|
+
eventPrecision: string | null;
|
|
481
504
|
/** See the note on `TemporalFields.saidAt`. */
|
|
482
505
|
saidAt: string | null;
|
|
483
506
|
validUntil: string | null;
|
|
@@ -1678,7 +1701,7 @@ declare class SynapClient {
|
|
|
1678
1701
|
* build when the two disagree, which is the only thing that makes a manual
|
|
1679
1702
|
* publish safe.
|
|
1680
1703
|
*/
|
|
1681
|
-
declare const SDK_VERSION = "0.5.
|
|
1704
|
+
declare const SDK_VERSION = "0.5.8";
|
|
1682
1705
|
|
|
1683
1706
|
/**
|
|
1684
1707
|
* BM25 scorer for the anticipation cache.
|
package/dist/index.js
CHANGED
|
@@ -638,6 +638,8 @@ function matchedQueries(item = {}) {
|
|
|
638
638
|
function normalizeTemporalFields(item = {}) {
|
|
639
639
|
return {
|
|
640
640
|
eventDate: pick(item["eventDate"], item.event_date, null),
|
|
641
|
+
eventEnd: pick(item["eventEnd"], item.event_end, null),
|
|
642
|
+
eventPrecision: pick(item["eventPrecision"], item.event_precision, null),
|
|
641
643
|
saidAt: pick(item["saidAt"], item.said_at, null),
|
|
642
644
|
validUntil: pick(item["validUntil"], item.valid_until, null),
|
|
643
645
|
temporalCategory: pick(item["temporalCategory"], item.temporal_category, null),
|
|
@@ -698,6 +700,8 @@ function normalizeTemporalEvent(item = {}) {
|
|
|
698
700
|
id: item.id || "",
|
|
699
701
|
content: item.content || "",
|
|
700
702
|
eventDate: pick(item["eventDate"], item.event_date, null),
|
|
703
|
+
eventEnd: pick(item["eventEnd"], item.event_end, null),
|
|
704
|
+
eventPrecision: pick(item["eventPrecision"], item.event_precision, null),
|
|
701
705
|
saidAt: pick(item["saidAt"], item.said_at, null),
|
|
702
706
|
validUntil: pick(item["validUntil"], item.valid_until, null),
|
|
703
707
|
temporalCategory: pick(item["temporalCategory"], item.temporal_category, ""),
|
|
@@ -1686,7 +1690,7 @@ function createInstanceNamespace(credentials, cache, onTurn) {
|
|
|
1686
1690
|
}
|
|
1687
1691
|
|
|
1688
1692
|
// src/version.ts
|
|
1689
|
-
var SDK_VERSION = "0.5.
|
|
1693
|
+
var SDK_VERSION = "0.5.8";
|
|
1690
1694
|
|
|
1691
1695
|
// src/registry.ts
|
|
1692
1696
|
var instances = /* @__PURE__ */ new Map();
|