@xcitedbs/client 0.2.10 → 0.2.12
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 +22 -0
- package/dist/client.d.ts +85 -7
- package/dist/client.js +199 -52
- package/dist/index.d.ts +1 -1
- package/dist/types.d.ts +101 -28
- package/llms-full.txt +140 -103
- package/llms.txt +68 -47
- package/package.json +1 -1
package/dist/types.d.ts
CHANGED
|
@@ -41,12 +41,20 @@ export interface TextSearchQuery {
|
|
|
41
41
|
branch?: string;
|
|
42
42
|
offset?: number;
|
|
43
43
|
limit?: number;
|
|
44
|
-
/**
|
|
45
|
-
|
|
44
|
+
/**
|
|
45
|
+
* Default server behavior when omitted: `auto` (hybrid if FTS+vector enabled, else semantic or FTS).
|
|
46
|
+
* Explicit `fts` / `semantic` / `hybrid` require the matching capabilities to be enabled.
|
|
47
|
+
*/
|
|
48
|
+
mode?: 'auto' | 'fts' | 'semantic' | 'hybrid';
|
|
46
49
|
/** Minimum cosine similarity for semantic / hybrid vector leg (default 0.3). */
|
|
47
50
|
min_score?: number;
|
|
48
51
|
/** Hybrid only: weight of semantic vs FTS in weighted RRF (0–1, default 0.5). */
|
|
49
52
|
semantic_weight?: number;
|
|
53
|
+
/** Point-in-time FTS filter (ISO date string; server maps to internal date key). */
|
|
54
|
+
at_date?: string;
|
|
55
|
+
/** Range FTS filter: interval overlap with [date_from, date_to) (ISO dates). */
|
|
56
|
+
date_from?: string;
|
|
57
|
+
date_to?: string;
|
|
50
58
|
}
|
|
51
59
|
export interface TextSearchHit {
|
|
52
60
|
identifier: string;
|
|
@@ -59,6 +67,9 @@ export interface TextSearchHit {
|
|
|
59
67
|
score: number;
|
|
60
68
|
/** Present for semantic / hybrid search. */
|
|
61
69
|
source?: 'fts' | 'semantic' | 'both';
|
|
70
|
+
/** FTS temporal window for this hit (internal 7-char keys), when returned by the server. */
|
|
71
|
+
valid_from?: string;
|
|
72
|
+
valid_to?: string;
|
|
62
73
|
}
|
|
63
74
|
export interface TextSearchResult {
|
|
64
75
|
hits: TextSearchHit[];
|
|
@@ -153,6 +164,15 @@ export interface ProjectSearchSettingsUpdate {
|
|
|
153
164
|
llm_base_url?: string | null;
|
|
154
165
|
llm_api_key?: string;
|
|
155
166
|
}
|
|
167
|
+
/** `GET /api/v1/project/settings/doc-conf` (and returned after `PUT` / `DELETE`). */
|
|
168
|
+
export interface ProjectDocConfResponse {
|
|
169
|
+
has_project_override: boolean;
|
|
170
|
+
doc_conf_text: string | null;
|
|
171
|
+
}
|
|
172
|
+
/** `GET /api/v1/platform/default-doc-conf` */
|
|
173
|
+
export interface PlatformDefaultDocConfResponse {
|
|
174
|
+
doc_conf_text: string;
|
|
175
|
+
}
|
|
156
176
|
/** `POST /api/v1/rag/query` (non-streaming: set `stream: false` or omit). */
|
|
157
177
|
export interface RagQueryOptions {
|
|
158
178
|
question: string;
|
|
@@ -307,7 +327,18 @@ export interface ApiKeyInfo {
|
|
|
307
327
|
}
|
|
308
328
|
export type Flags = 'None' | 'FirstMatch' | 'IncludeChildren' | 'NoChildren' | 'KeepIndexNodes' | 'PrevIfDeleted' | string;
|
|
309
329
|
export interface DatabaseContext {
|
|
330
|
+
/**
|
|
331
|
+
* Workspace name (isolated editing environment). Empty / unset = main timeline.
|
|
332
|
+
* Sent as `X-Workspace` (preferred); see also {@link DatabaseContext.branch}.
|
|
333
|
+
*/
|
|
334
|
+
workspace?: string;
|
|
335
|
+
/** @deprecated Prefer {@link DatabaseContext.workspace}. Sent as `X-Branch` when `workspace` is unset. */
|
|
310
336
|
branch?: string;
|
|
337
|
+
/**
|
|
338
|
+
* As-of revision time, sent as `X-Date`. Accepted forms (whole string must match; trailing spaces ignored):
|
|
339
|
+
* `mm/dd/yyyy`, `mm/dd/yyyy:HH:MM:SS`, ISO `YYYY-MM-DDTHH:MM:SS` with optional numeric timezone,
|
|
340
|
+
* `YYYY-MM-DD HH:MM:SS`, and ISO date-only `YYYY-MM-DD`.
|
|
341
|
+
*/
|
|
311
342
|
date?: string;
|
|
312
343
|
prefix?: string;
|
|
313
344
|
/**
|
|
@@ -386,6 +417,11 @@ export interface XCiteDBClientOptions {
|
|
|
386
417
|
testRequireAuth?: boolean;
|
|
387
418
|
/** Auto-prefix identifiers for app-user sessions (see {@link UserIsolationOptions}). */
|
|
388
419
|
userIsolation?: UserIsolationOptions;
|
|
420
|
+
/**
|
|
421
|
+
* Per-request timeout in milliseconds for normal REST calls (uses `AbortSignal.timeout` when available).
|
|
422
|
+
* Omit for no timeout. Streaming RAG (`ragQueryStream`) does not apply this.
|
|
423
|
+
*/
|
|
424
|
+
requestTimeoutMs?: number;
|
|
389
425
|
}
|
|
390
426
|
/** Options for {@link XCiteDBClient.createTestSession} (provisions via API key or Bearer). */
|
|
391
427
|
export interface CreateTestSessionOptions {
|
|
@@ -397,12 +433,17 @@ export interface CreateTestSessionOptions {
|
|
|
397
433
|
context?: DatabaseContext;
|
|
398
434
|
platformConsole?: boolean;
|
|
399
435
|
projectId?: string;
|
|
436
|
+
/**
|
|
437
|
+
* When true, creates an overlay test session: writable ephemeral LMDB with production project data as read-only base.
|
|
438
|
+
*/
|
|
439
|
+
overlay?: boolean;
|
|
400
440
|
/** Keep `apiKey` / `accessToken` on the client and send `X-Test-Auth: required` on each request. */
|
|
401
441
|
testRequireAuth?: boolean;
|
|
402
442
|
onSessionTokensUpdated?: (pair: TokenPair) => void;
|
|
403
443
|
onAppUserTokensUpdated?: (pair: AppUserTokenPair) => void;
|
|
404
444
|
onSessionInvalid?: () => void;
|
|
405
445
|
userIsolation?: UserIsolationOptions;
|
|
446
|
+
requestTimeoutMs?: number;
|
|
406
447
|
}
|
|
407
448
|
/** Application user (tenant-scoped), distinct from developer users. */
|
|
408
449
|
export interface AppUser {
|
|
@@ -596,83 +637,115 @@ export interface StoredTriggerResponse {
|
|
|
596
637
|
trigger_id: string;
|
|
597
638
|
trigger: TriggerDefinition;
|
|
598
639
|
}
|
|
599
|
-
/**
|
|
600
|
-
export interface
|
|
640
|
+
/** Named snapshot on a workspace (checkpoint). */
|
|
641
|
+
export interface CheckpointRecord {
|
|
601
642
|
id: string;
|
|
643
|
+
/** Same as `id` when returned by newer APIs. */
|
|
644
|
+
checkpoint_id?: string;
|
|
602
645
|
branch: string;
|
|
603
|
-
/**
|
|
604
|
-
date_key: string;
|
|
605
|
-
date_human?: string;
|
|
606
|
-
/** Alias for human-readable date (same as date_human when present). */
|
|
646
|
+
/** Human-readable revision date/time. */
|
|
607
647
|
date?: string;
|
|
648
|
+
date_human?: string;
|
|
649
|
+
/** @deprecated Internal key; omitted from newer API responses. */
|
|
650
|
+
date_key?: string;
|
|
608
651
|
message: string;
|
|
609
652
|
author: string;
|
|
610
653
|
parent_id: string | null;
|
|
611
654
|
merge_source?: {
|
|
612
655
|
branch: string;
|
|
613
|
-
|
|
656
|
+
checkpoint_id?: string;
|
|
657
|
+
commit_id?: string;
|
|
614
658
|
};
|
|
615
659
|
cherry_picked_from?: string;
|
|
616
660
|
affected_identifiers: string[];
|
|
617
661
|
status: 'active' | 'rolled_back';
|
|
618
662
|
created_at: number;
|
|
619
663
|
}
|
|
620
|
-
/**
|
|
621
|
-
export
|
|
664
|
+
/** @deprecated Use {@link CheckpointRecord}. */
|
|
665
|
+
export type CommitRecord = CheckpointRecord;
|
|
666
|
+
/** Workspace row from `GET /api/v1/workspaces` (legacy: `/api/v1/branches`). */
|
|
667
|
+
export interface WorkspaceInfo {
|
|
622
668
|
name: string;
|
|
623
669
|
from_branch: string;
|
|
624
670
|
from_date: string;
|
|
625
|
-
|
|
626
|
-
|
|
627
|
-
tip_commit?:
|
|
628
|
-
}
|
|
629
|
-
|
|
630
|
-
export
|
|
671
|
+
tip_checkpoint?: CheckpointRecord;
|
|
672
|
+
/** @deprecated Alias of {@link WorkspaceInfo.tip_checkpoint}. */
|
|
673
|
+
tip_commit?: CheckpointRecord;
|
|
674
|
+
}
|
|
675
|
+
/** @deprecated Use {@link WorkspaceInfo}. */
|
|
676
|
+
export type BranchInfo = WorkspaceInfo;
|
|
677
|
+
/** @deprecated Use {@link WorkspaceInfo}. */
|
|
678
|
+
export type BranchListItem = WorkspaceInfo;
|
|
679
|
+
export interface BookmarkRecord {
|
|
631
680
|
name: string;
|
|
632
|
-
|
|
681
|
+
checkpoint_id: string;
|
|
682
|
+
/** @deprecated Same as `checkpoint_id`. */
|
|
683
|
+
commit_id?: string;
|
|
633
684
|
branch: string;
|
|
634
|
-
|
|
685
|
+
date?: string;
|
|
686
|
+
/** @deprecated */
|
|
687
|
+
date_key?: string;
|
|
635
688
|
message?: string;
|
|
636
689
|
author?: string;
|
|
637
690
|
created_at: number;
|
|
638
691
|
}
|
|
639
|
-
|
|
692
|
+
/** @deprecated Use {@link BookmarkRecord}. */
|
|
693
|
+
export type TagRecord = BookmarkRecord;
|
|
694
|
+
export interface CompareEntry {
|
|
640
695
|
identifier: string;
|
|
641
696
|
action: 'added' | 'modified' | 'deleted';
|
|
642
697
|
from_content?: string;
|
|
643
698
|
to_content?: string;
|
|
644
699
|
}
|
|
645
|
-
|
|
700
|
+
/** @deprecated Use {@link CompareEntry}. */
|
|
701
|
+
export type DiffEntry = CompareEntry;
|
|
702
|
+
export interface CompareRef {
|
|
646
703
|
branch?: string;
|
|
647
|
-
/**
|
|
704
|
+
/** Human-readable date (preferred). */
|
|
705
|
+
date?: string;
|
|
706
|
+
checkpoint_id?: string;
|
|
707
|
+
/** @deprecated Undocumented fallback. */
|
|
648
708
|
date_key?: string;
|
|
709
|
+
/** @deprecated Use {@link CompareRef.checkpoint_id}. */
|
|
649
710
|
commit_id?: string;
|
|
650
711
|
}
|
|
651
|
-
|
|
652
|
-
|
|
712
|
+
/** @deprecated Use {@link CompareRef}. */
|
|
713
|
+
export type DiffRef = CompareRef;
|
|
714
|
+
export interface CompareResult {
|
|
715
|
+
changes: CompareEntry[];
|
|
653
716
|
from: {
|
|
654
717
|
branch?: string;
|
|
718
|
+
date?: string;
|
|
655
719
|
date_key?: string;
|
|
656
720
|
};
|
|
657
721
|
to: {
|
|
658
722
|
branch?: string;
|
|
723
|
+
date?: string;
|
|
659
724
|
date_key?: string;
|
|
660
725
|
};
|
|
661
726
|
total_changes: number;
|
|
662
727
|
}
|
|
663
|
-
|
|
728
|
+
/** @deprecated Use {@link CompareResult}. */
|
|
729
|
+
export type DiffResult = CompareResult;
|
|
730
|
+
export interface PublishConflict {
|
|
664
731
|
identifier: string;
|
|
665
732
|
source_action: string;
|
|
666
733
|
target_action: string;
|
|
667
734
|
}
|
|
668
|
-
|
|
735
|
+
/** @deprecated Use {@link PublishConflict}. */
|
|
736
|
+
export type MergeConflict = PublishConflict;
|
|
737
|
+
export interface PublishResult {
|
|
669
738
|
status: 'completed' | 'conflicts';
|
|
670
|
-
|
|
739
|
+
checkpoint?: CheckpointRecord;
|
|
740
|
+
/** @deprecated Alias of {@link PublishResult.checkpoint}. */
|
|
741
|
+
commit?: CheckpointRecord;
|
|
671
742
|
merged_identifiers?: string[];
|
|
672
|
-
conflicts?:
|
|
743
|
+
conflicts?: PublishConflict[];
|
|
673
744
|
auto_mergeable?: string[];
|
|
674
745
|
message?: string;
|
|
675
746
|
}
|
|
747
|
+
/** @deprecated Use {@link PublishResult}. */
|
|
748
|
+
export type MergeResult = PublishResult;
|
|
676
749
|
export declare class XCiteDBError extends Error {
|
|
677
750
|
readonly status: number;
|
|
678
751
|
readonly body?: unknown | undefined;
|