@palbase/backend 22.1.0 → 23.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/dist/bin/palbase-backend.cjs +439 -18
- package/dist/bin/palbase-backend.cjs.map +1 -1
- package/dist/bin/palbase-backend.js +4 -4
- package/dist/{chunk-SQC5EIWY.js → chunk-FSGSB42K.js} +11 -6
- package/dist/chunk-FSGSB42K.js.map +1 -0
- package/dist/{chunk-I3ON7MYF.js → chunk-HAF67F2H.js} +73 -16
- package/dist/chunk-HAF67F2H.js.map +1 -0
- package/dist/{chunk-QMVK4X3V.js → chunk-OMRTHM4X.js} +98 -98
- package/dist/chunk-OMRTHM4X.js.map +1 -0
- package/dist/{chunk-74XDEF5J.js → chunk-REZU6UKT.js} +432 -17
- package/dist/chunk-REZU6UKT.js.map +1 -0
- package/dist/{chunk-YL4C5NRY.js → chunk-Y5HXVUMP.js} +2 -2
- package/dist/{chunk-N32VDWKH.js → chunk-ZC6Q2BRD.js} +4 -59
- package/dist/chunk-ZC6Q2BRD.js.map +1 -0
- package/dist/db/env.cjs.map +1 -1
- package/dist/db/env.d.cts +3 -21
- package/dist/db/env.d.ts +3 -21
- package/dist/db/index.cjs +72 -15
- package/dist/db/index.cjs.map +1 -1
- package/dist/db/index.d.cts +3 -2
- package/dist/db/index.d.ts +3 -2
- package/dist/db/index.js +1 -1
- package/dist/{endpoint-BVT6jcVW.d.cts → endpoint-BavvbW4P.d.ts} +77 -7
- package/dist/{endpoint-BVT6jcVW.d.ts → endpoint-i8TTCohk.d.cts} +77 -7
- package/dist/engine/index.cjs +439 -18
- package/dist/engine/index.cjs.map +1 -1
- package/dist/engine/index.d.cts +6 -5
- package/dist/engine/index.d.ts +6 -5
- package/dist/engine/index.js +3 -3
- package/dist/{index-vwHoS0l2.d.ts → index-B3jmmItD.d.ts} +111 -5
- package/dist/{index-CCZqzych.d.ts → index-B7YBEG5w.d.ts} +96 -71
- package/dist/{index-BqCiHao8.d.cts → index-Bmvx1EvJ.d.cts} +111 -5
- package/dist/{index-BS1gW4nV.d.cts → index-E7OscPJT.d.cts} +96 -71
- package/dist/index.cjs +285 -1099
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +89 -1134
- package/dist/index.d.ts +89 -1134
- package/dist/index.js +107 -902
- package/dist/index.js.map +1 -1
- package/dist/openapi/index.cjs +3 -57
- package/dist/openapi/index.cjs.map +1 -1
- package/dist/openapi/index.d.cts +3 -2
- package/dist/openapi/index.d.ts +3 -2
- package/dist/openapi/index.js +5 -22
- package/dist/openapi/index.js.map +1 -1
- package/dist/{registry-Bsuf-orT.d.ts → registry-C3H2uPeZ.d.cts} +13 -169
- package/dist/{registry-BWttGlaT.d.cts → registry-DY3d9l1k.d.ts} +13 -169
- package/dist/{purchases/keys.cjs → stack.cjs} +4 -4
- package/dist/stack.cjs.map +1 -0
- package/dist/stack.d.cts +76 -0
- package/dist/stack.d.ts +76 -0
- package/dist/stack.js +1 -0
- package/docs/README.md +7 -6
- package/docs/llms-full.txt +7 -260
- package/docs/llms.txt +0 -2
- package/package.json +6 -6
- package/template/package.json +1 -1
- package/dist/chunk-74XDEF5J.js.map +0 -1
- package/dist/chunk-I3ON7MYF.js.map +0 -1
- package/dist/chunk-N32VDWKH.js.map +0 -1
- package/dist/chunk-QMVK4X3V.js.map +0 -1
- package/dist/chunk-SQC5EIWY.js.map +0 -1
- package/dist/purchases/keys.cjs.map +0 -1
- package/dist/purchases/keys.d.cts +0 -42
- package/dist/purchases/keys.d.ts +0 -42
- package/dist/purchases/keys.js +0 -1
- package/docs/config.md +0 -147
- package/docs/resources.md +0 -97
- package/template/config/secrets.ts +0 -24
- /package/dist/{chunk-YL4C5NRY.js.map → chunk-Y5HXVUMP.js.map} +0 -0
- /package/dist/{purchases/keys.js.map → stack.js.map} +0 -0
package/dist/engine/index.d.cts
CHANGED
|
@@ -1,7 +1,8 @@
|
|
|
1
|
-
export { A as App,
|
|
2
|
-
import '../endpoint-
|
|
3
|
-
import '../
|
|
1
|
+
export { A as App, h as AuthVerifier, B as BootRefused, i as CreateAppOptions, E as EgressPolicy, j as EngineConfig, M as ModuleClients, k as RateLimiter, l as RequestDatabase, m as RouteEntry, n as RuntimeHooks, o as ScrubResult, p as SqlDriver, q as SqlTx, r as buildRouteTable, s as createApp, t as createLazyTransaction, u as createOps, v as createRequestDatabase, w as effectiveAuth, x as hostAllowed, y as installEgressFence, z as loadConfig, G as makeMemoryCache, H as matchRoute, I as quoteIdent, J as scrubSecrets, K as withTables } from '../index-E7OscPJT.cjs';
|
|
2
|
+
import '../endpoint-i8TTCohk.cjs';
|
|
3
|
+
import '../stack.cjs';
|
|
4
4
|
import 'node:async_hooks';
|
|
5
|
-
import '../index-
|
|
6
|
-
import '../
|
|
5
|
+
import '../index-Bmvx1EvJ.cjs';
|
|
6
|
+
import '../db/env.cjs';
|
|
7
|
+
import '../registry-C3H2uPeZ.cjs';
|
|
7
8
|
import 'zod';
|
package/dist/engine/index.d.ts
CHANGED
|
@@ -1,7 +1,8 @@
|
|
|
1
|
-
export { A as App,
|
|
2
|
-
import '../endpoint-
|
|
3
|
-
import '../
|
|
1
|
+
export { A as App, h as AuthVerifier, B as BootRefused, i as CreateAppOptions, E as EgressPolicy, j as EngineConfig, M as ModuleClients, k as RateLimiter, l as RequestDatabase, m as RouteEntry, n as RuntimeHooks, o as ScrubResult, p as SqlDriver, q as SqlTx, r as buildRouteTable, s as createApp, t as createLazyTransaction, u as createOps, v as createRequestDatabase, w as effectiveAuth, x as hostAllowed, y as installEgressFence, z as loadConfig, G as makeMemoryCache, H as matchRoute, I as quoteIdent, J as scrubSecrets, K as withTables } from '../index-B7YBEG5w.js';
|
|
2
|
+
import '../endpoint-BavvbW4P.js';
|
|
3
|
+
import '../stack.js';
|
|
4
4
|
import 'node:async_hooks';
|
|
5
|
-
import '../index-
|
|
6
|
-
import '../
|
|
5
|
+
import '../index-B3jmmItD.js';
|
|
6
|
+
import '../db/env.js';
|
|
7
|
+
import '../registry-DY3d9l1k.js';
|
|
7
8
|
import 'zod';
|
package/dist/engine/index.js
CHANGED
|
@@ -16,10 +16,10 @@ import {
|
|
|
16
16
|
quoteIdent,
|
|
17
17
|
scrubSecrets,
|
|
18
18
|
withTables
|
|
19
|
-
} from "../chunk-
|
|
20
|
-
import "../chunk-
|
|
19
|
+
} from "../chunk-REZU6UKT.js";
|
|
20
|
+
import "../chunk-FSGSB42K.js";
|
|
21
21
|
import "../chunk-W5ODXPY3.js";
|
|
22
|
-
import "../chunk-
|
|
22
|
+
import "../chunk-OMRTHM4X.js";
|
|
23
23
|
import "../chunk-7D4SUZUM.js";
|
|
24
24
|
export {
|
|
25
25
|
AuthVerifier,
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Tables, TableTypes } from './db/env.js';
|
|
2
|
-
import { D as DBClient, b8 as TxPlanHandle, bh as TxTable, M as Materialized } from './endpoint-
|
|
2
|
+
import { D as DBClient, b8 as TxPlanHandle, bh as TxTable, M as Materialized } from './endpoint-BavvbW4P.js';
|
|
3
3
|
|
|
4
4
|
/** On delete action for foreign key references. */
|
|
5
5
|
type OnDeleteAction = 'cascade' | 'set null' | 'restrict' | 'no action';
|
|
@@ -347,12 +347,20 @@ interface EmbeddingModelRef {
|
|
|
347
347
|
apiKeyName?: string;
|
|
348
348
|
baseURL?: string;
|
|
349
349
|
}
|
|
350
|
+
/** Chat/damıtma modeli DESKRIPTORU (C-11, D-019) — memory beyanının extract'i.
|
|
351
|
+
* Embedding gibi düz veridir; çağrıyı worker yapar, anahtar vault'taki
|
|
352
|
+
* OPENAI_API_KEY'dir (D-017: aynı sağlayıcı, yeni dış sistem yok). */
|
|
353
|
+
interface ChatModelRef {
|
|
354
|
+
provider: "openai";
|
|
355
|
+
model: string;
|
|
356
|
+
}
|
|
350
357
|
declare const openai: {
|
|
351
358
|
embedding(model: string, opts?: {
|
|
352
359
|
dimensions?: number;
|
|
353
360
|
apiKeyName?: string;
|
|
354
361
|
baseURL?: string;
|
|
355
362
|
}): EmbeddingModelRef;
|
|
363
|
+
chat(model: string): ChatModelRef;
|
|
356
364
|
};
|
|
357
365
|
|
|
358
366
|
/**
|
|
@@ -400,12 +408,44 @@ interface VectorSearchDecl {
|
|
|
400
408
|
* eşleşme riski (Confluence-tipi sync yükleri için). */
|
|
401
409
|
staleness?: "null" | "keep";
|
|
402
410
|
}
|
|
403
|
-
/** Tablonun arama
|
|
404
|
-
*
|
|
405
|
-
*
|
|
411
|
+
/** Tablonun arama beyanı — İKİ biçim (D-007, tek yüzey):
|
|
412
|
+
*
|
|
413
|
+
* YENİ (önerilen): `{ from, model, ... }` — `from` kolonları hem FTS'e hem
|
|
414
|
+
* embed'e girer. Tabloda vector kolonu declare edilmişse SATIR-modu; yoksa
|
|
415
|
+
* CHUNK-modu otomatiktir (D-010): vektörler türev `__palbase_chunks`
|
|
416
|
+
* tablosunda yaşar, içerik otomatik bölünür. `text: false` FTS'i kapatır,
|
|
417
|
+
* `text: [..]` FTS kolonlarını from'dan ayırır. `chunks` yalnız ince ayar.
|
|
418
|
+
*
|
|
419
|
+
* ESKİ: `text: string[]` + `vector: {...}` — aynen çalışır, wire çıktısı
|
|
420
|
+
* bayt-aynı kalır (NFR-B1). İki biçim KARIŞTIRILAMAZ. */
|
|
406
421
|
interface SearchDecl {
|
|
407
|
-
text?: string[];
|
|
422
|
+
text?: string[] | boolean;
|
|
408
423
|
vector?: VectorSearchDecl | VectorSearchDecl[];
|
|
424
|
+
/** Yeni biçim: arama kaynağı kolonlar (FTS + embed). Varlığı yeni biçimi seçer. */
|
|
425
|
+
from?: string[];
|
|
426
|
+
/** Yeni biçim: auto-embed modeli (zorunlu — BYO için eski biçimi kullanın). */
|
|
427
|
+
model?: EmbeddingModelRef;
|
|
428
|
+
metric?: SearchMetric;
|
|
429
|
+
staleness?: "null" | "keep";
|
|
430
|
+
/** Chunk-modu ince ayarı (yalnız vector kolonsuz tabloda anlamlı). */
|
|
431
|
+
chunks?: {
|
|
432
|
+
size?: number;
|
|
433
|
+
overlap?: number;
|
|
434
|
+
};
|
|
435
|
+
/** Sorgu-yeniden-yazımı: tek yönlü eş anlamlı haritası (FR-026). */
|
|
436
|
+
synonyms?: Record<string, string[]>;
|
|
437
|
+
/** Geçerlilik kolonları türetilir; arama varsayılan yalnız günceli tarar (FR-029). */
|
|
438
|
+
validity?: boolean;
|
|
439
|
+
}
|
|
440
|
+
/** Hafıza beyanı (FR-032, D-019): kaynak tablonun yazımlarından platform
|
|
441
|
+
* fact damıtır ve `into` tablosuna yazar. Hedef NORMAL declared tablodur —
|
|
442
|
+
* kendi search/unique/validity beyanlarıyla. Okuma = Database.search(into).
|
|
443
|
+
* subject default "owner": fact'in kime ait olduğu kolonu (iki tabloda da). */
|
|
444
|
+
interface MemoryDecl {
|
|
445
|
+
from: string[];
|
|
446
|
+
into: string;
|
|
447
|
+
extract: ChatModelRef;
|
|
448
|
+
subject?: string;
|
|
409
449
|
}
|
|
410
450
|
interface TableInput<C extends ColumnMap = ColumnMap> {
|
|
411
451
|
columns: C;
|
|
@@ -448,6 +488,8 @@ interface TableInput<C extends ColumnMap = ColumnMap> {
|
|
|
448
488
|
}[];
|
|
449
489
|
/** Arama beyanı — bkz. SearchDecl. */
|
|
450
490
|
search?: SearchDecl;
|
|
491
|
+
/** Hafıza beyanı — bkz. MemoryDecl (FR-032). */
|
|
492
|
+
memory?: MemoryDecl;
|
|
451
493
|
}
|
|
452
494
|
/**
|
|
453
495
|
* A table definition — the runtime value the Go runtime's `schema_extract.js`
|
|
@@ -485,6 +527,8 @@ interface TableDef<C extends ColumnMap = ColumnMap> {
|
|
|
485
527
|
}[];
|
|
486
528
|
/** Arama beyanı, doğrulanmış ve taşınmış hali. */
|
|
487
529
|
search?: SearchDecl;
|
|
530
|
+
/** Hafıza beyanı, doğrulanmış ve taşınmış hali (FR-032). */
|
|
531
|
+
memory?: MemoryDecl;
|
|
488
532
|
}
|
|
489
533
|
/**
|
|
490
534
|
* A schema definition containing multiple tables, keyed by table name.
|
|
@@ -662,7 +706,52 @@ interface SearchParamsTyped<T extends TableTypes> {
|
|
|
662
706
|
/** Birden çok vektör kolonunda hedef seçimi (model geçişi, FR-013/using). */
|
|
663
707
|
using?: string;
|
|
664
708
|
mode?: "hybrid" | "text" | "vector";
|
|
709
|
+
/** Nihai (RRF-sonrası) skor alt eşiği — süzme LIMIT'ten önce uygulanır (FR-001). */
|
|
710
|
+
minScore?: number;
|
|
711
|
+
/** Chunk-modunda satır başına en iyi blok sayısı (1..10, vars. 3; FR-015). */
|
|
712
|
+
blocksPerRow?: number;
|
|
713
|
+
/** Tazelik çürümesi: nihai skor RRF-sonrası exp(-ln(2)*yaş/halfLife) ile çarpılır;
|
|
714
|
+
* field bir timestamp kolonu, halfLife "90s" | "15m" | "12h" | "30d" biçiminde (FR-004). */
|
|
715
|
+
recency?: {
|
|
716
|
+
field: Extract<keyof T["row"], string>;
|
|
717
|
+
halfLife: string;
|
|
718
|
+
};
|
|
719
|
+
/** Filtrelenmiş küme üzerinde kolon başına top-20 değer sayacı — dönüş
|
|
720
|
+
* dizisinin `_facets` özelliği (FR-027). */
|
|
721
|
+
facets?: Extract<keyof T["row"], string>[];
|
|
722
|
+
/** Satır-modunda FTS eşleşme vurgusu: sonuç satırına `_highlight` ekler;
|
|
723
|
+
* chunk-modda no-op — bloklar zaten eşleşen kesittir (FR-025). */
|
|
724
|
+
highlight?: boolean;
|
|
725
|
+
/** Validity'li tabloda zaman penceresi: varsayılan yalnız güncel versiyon;
|
|
726
|
+
* "all" tüm versiyonlar; {asOf} o anda geçerli olan (FR-029). */
|
|
727
|
+
validity?: "all" | {
|
|
728
|
+
asOf: string;
|
|
729
|
+
};
|
|
730
|
+
/** Alan-boost (FR-030): skor * (1 + w·x/(1+x)) — sayısal kolonla sınırlı
|
|
731
|
+
* çarpan, dış servissiz; bileşim RRF → boost → recency → minScore. */
|
|
732
|
+
boost?: {
|
|
733
|
+
field: Extract<keyof T["row"], string>;
|
|
734
|
+
weight: number;
|
|
735
|
+
};
|
|
665
736
|
}
|
|
737
|
+
/** search() dönüş dizisinin sorgu-düzeyi ekleri (FR-027): `_facets` dizinin
|
|
738
|
+
* ÖZELLİĞİDİR, satırlara kopyalanmaz (JSON'a satır başına şişme olmasın). */
|
|
739
|
+
type SearchFacets = Record<string, {
|
|
740
|
+
value: string | null;
|
|
741
|
+
count: number;
|
|
742
|
+
}[]>;
|
|
743
|
+
/** similar()/recommend() taşıyıcı opsiyonları (T018, FR-022): search'ün
|
|
744
|
+
* paramlarından query/vector/mode düşer — hedef vektörü metodun kendisi
|
|
745
|
+
* DB'den kurar; facets/highlight de düşer (T020) — engine bu ikisini
|
|
746
|
+
* similar/recommend'e geçirmez, tip vaadi gerçekle aynı kalır. */
|
|
747
|
+
type SimilarParamsTyped<T extends TableTypes> = Omit<SearchParamsTyped<T>, "query" | "vector" | "mode" | "facets" | "highlight">;
|
|
748
|
+
/** recommend() parametreleri (T018, FR-023). */
|
|
749
|
+
type RecommendParamsTyped<T extends TableTypes> = SimilarParamsTyped<T> & {
|
|
750
|
+
/** Kaynak beğeniler — hedef vektör bunların DB-içi avg'ı; boş olamaz. */
|
|
751
|
+
positive: string[];
|
|
752
|
+
/** İtilen örnekler — hedef pos.v + (pos.v - neg.v) ile yönlenir. */
|
|
753
|
+
negative?: string[];
|
|
754
|
+
};
|
|
666
755
|
/** Temel tablo erişimcisi — search'süz beş op. */
|
|
667
756
|
interface EnvTypedTableBase<T extends TableTypes> {
|
|
668
757
|
insert(data: T["insert"]): Promise<T["row"]>;
|
|
@@ -673,6 +762,11 @@ interface EnvTypedTableBase<T extends TableTypes> {
|
|
|
673
762
|
delete(id: string): Promise<void>;
|
|
674
763
|
findById(id: string): Promise<T["row"] | null>;
|
|
675
764
|
findMany(query?: Partial<T["row"]>): Promise<T["row"][]>;
|
|
765
|
+
/** Validity'li tabloda satırın yeni versiyonu (FR-029, C-9): eski satır
|
|
766
|
+
* kapanır (valid_to/superseded_by), yenisi TEK savepoint'te eklenir; dönüş
|
|
767
|
+
* yeni satır. Validity beyanı olmayan tabloda adlandırılmış çalışma-zamanı
|
|
768
|
+
* hatası — tip düzeyinde ayrım env `Tables` bayrağı taşımadığından yapılamaz. */
|
|
769
|
+
supersede(id: string, row: T["insert"]): Promise<T["row"]>;
|
|
676
770
|
}
|
|
677
771
|
/** Tablo erişimcisi: env girdisi `searchable: true` taşıyorsa (vector kolonu ya da
|
|
678
772
|
* search beyanı — env-gen üretir) `search()` üyesi VARDIR; yoksa üye hiç yoktur ve
|
|
@@ -682,6 +776,18 @@ type EnvTypedTable<T extends TableTypes> = EnvTypedTableBase<T> & (T extends {
|
|
|
682
776
|
} ? {
|
|
683
777
|
search(params: SearchParamsTyped<T>): Promise<Array<T["row"] & {
|
|
684
778
|
_score: number;
|
|
779
|
+
}> & {
|
|
780
|
+
_facets?: SearchFacets;
|
|
781
|
+
}>;
|
|
782
|
+
/** "Bu satıra benzeyenler" (FR-022): hedef vektör DB'den okunur,
|
|
783
|
+
* kaynak satır sonuçta yoktur; id yoksa adlandırılmış hata. */
|
|
784
|
+
similar(id: string, params?: SimilarParamsTyped<T>): Promise<Array<T["row"] & {
|
|
785
|
+
_score: number;
|
|
786
|
+
}>>;
|
|
787
|
+
/** positive/negative beğenilerden öneri (FR-023): hedef vektör DB-içi
|
|
788
|
+
* avg CTE'leriyle; kaynak id'ler sonuçta yoktur. */
|
|
789
|
+
recommend(params: RecommendParamsTyped<T>): Promise<Array<T["row"] & {
|
|
790
|
+
_score: number;
|
|
685
791
|
}>>;
|
|
686
792
|
} : Record<never, never>);
|
|
687
793
|
/** The `tables` map exposed on `Database`/`tx`, keyed by the env `Tables`
|
|
@@ -1,63 +1,8 @@
|
|
|
1
|
-
import { Buckets, BucketTypes } from './
|
|
1
|
+
import { Buckets, BucketTypes } from './stack.js';
|
|
2
2
|
import { AsyncLocalStorage } from 'node:async_hooks';
|
|
3
|
-
import { C as CacheClient, P as PalbaseDocsClient, a as PalbaseFlagsClient, L as Logger, b as PalbaseNotificationsClient, c as PalbaseRealtimeClient, D as DBClient, S as SecretsService, d as PalbaseStorageClient, e as PalbaseBucketClient, T as TxPlanBody, f as TxPlanResponse } from './endpoint-
|
|
4
|
-
import { E as EnvTypedDatabase } from './index-
|
|
5
|
-
import { R as RouteMeta } from './registry-
|
|
6
|
-
|
|
7
|
-
/**
|
|
8
|
-
* The purchases surface the decorators need, declared as a NARROW STRUCTURAL
|
|
9
|
-
* interface rather than an import of `@palstore/purchases`.
|
|
10
|
-
*
|
|
11
|
-
* `PurchasesClient` (palstore's `sk_` backend SDK) satisfies this shape as-is,
|
|
12
|
-
* so the runtime injects the real client with no adapter — but `@palbase/backend`
|
|
13
|
-
* itself gains no dependency on it. That matters: this package is published
|
|
14
|
-
* public and baked into the br-pod image from a tarball, so a dependency on an
|
|
15
|
-
* unpublished sibling would break `npm install palbase-backend.tgz`. It is also
|
|
16
|
-
* the pattern `withSpend` already uses for the same reason (`SpendCapableClient`
|
|
17
|
-
* in palstore's own spend.ts: "a narrow structural interface … so this file has
|
|
18
|
-
* no dependency on client.ts").
|
|
19
|
-
*
|
|
20
|
-
* The methods here are a SUBSET of `PurchasesClient` — only what the two
|
|
21
|
-
* decorators call. Grants, refunds, credits and customer-info reads stay off
|
|
22
|
-
* this interface: a tenant that wants them imports the palstore SDK directly.
|
|
23
|
-
*/
|
|
24
|
-
/** Store environment a subject is fixed to. Mirrors `StoreEnv` in `@palstore/purchases`. */
|
|
25
|
-
type StoreEnv = "production" | "sandbox";
|
|
26
|
-
/** Quota/credit state carried by a 429. Mirrors `LimitState` in `@palstore/purchases`
|
|
27
|
-
* (SPEC-purchases-v1 §11) — re-declared, not imported, for the reason above. */
|
|
28
|
-
interface LimitState {
|
|
29
|
-
key: string;
|
|
30
|
-
scope: string;
|
|
31
|
-
window: string;
|
|
32
|
-
used: number;
|
|
33
|
-
reserved: number;
|
|
34
|
-
max: number;
|
|
35
|
-
remaining: number;
|
|
36
|
-
resetAt: string;
|
|
37
|
-
}
|
|
38
|
-
/** Options for one spend. `idempotencyKey` is required by the server (§9). */
|
|
39
|
-
interface SpendOptions {
|
|
40
|
-
/** Defaults to 1. */
|
|
41
|
-
count?: number;
|
|
42
|
-
idempotencyKey: string;
|
|
43
|
-
}
|
|
44
|
-
interface PurchasesService {
|
|
45
|
-
/** Map a tenant-side user reference to its palstore subject, creating one on
|
|
46
|
-
* first sight. Server-authoritative — the caller never names a subject. */
|
|
47
|
-
resolveSubject(input: {
|
|
48
|
-
userRef: string;
|
|
49
|
-
storeEnv: StoreEnv;
|
|
50
|
-
}): Promise<{
|
|
51
|
-
subjectId: string;
|
|
52
|
-
}>;
|
|
53
|
-
/** Resolve silently when `entitlementKey` is active for `subjectId`; throw
|
|
54
|
-
* `EntitlementRequiredError` otherwise. Consumes nothing. */
|
|
55
|
-
require(subjectId: string, entitlementKey: string): Promise<void>;
|
|
56
|
-
/** Reserve → run `handler` → commit on success, cancel on throw, always
|
|
57
|
-
* rethrowing the handler's own error. The whole reason the decorators are a
|
|
58
|
-
* thin layer: this lifecycle is already written and tested in palstore's SDK. */
|
|
59
|
-
withSpend<T>(subjectId: string, key: string, opts: SpendOptions, handler: () => Promise<T>): Promise<T>;
|
|
60
|
-
}
|
|
3
|
+
import { C as CacheClient, P as PalbaseDocsClient, a as PalbaseFlagsClient, L as Logger, b as PalbaseNotificationsClient, c as PalbaseRealtimeClient, D as DBClient, S as SecretsService, d as PalbaseStorageClient, e as PalbaseBucketClient, T as TxPlanBody, f as TxPlanResponse } from './endpoint-BavvbW4P.js';
|
|
4
|
+
import { E as EnvTypedDatabase } from './index-B3jmmItD.js';
|
|
5
|
+
import { R as RouteMeta } from './registry-DY3d9l1k.js';
|
|
61
6
|
|
|
62
7
|
/**
|
|
63
8
|
* runtime.ts — request-scoped service singletons.
|
|
@@ -118,7 +63,6 @@ interface RuntimeServices {
|
|
|
118
63
|
Notifications: PalbaseNotificationsClient;
|
|
119
64
|
Flags: PalbaseFlagsClient;
|
|
120
65
|
Realtime: PalbaseRealtimeClient;
|
|
121
|
-
Purchases: PurchasesService;
|
|
122
66
|
}
|
|
123
67
|
/**
|
|
124
68
|
* The per-request ALS box.
|
|
@@ -239,15 +183,6 @@ declare const Secrets: SecretsService;
|
|
|
239
183
|
declare const Log: Logger;
|
|
240
184
|
/** Push / email / SMS / in-app notifications. */
|
|
241
185
|
declare const Notifications: PalbaseNotificationsClient;
|
|
242
|
-
/**
|
|
243
|
-
* Palstore purchases (entitlements + quota/credit spend).
|
|
244
|
-
*
|
|
245
|
-
* Reached by handlers through the `@RequireEntitlement` / `@Spend` decorators
|
|
246
|
-
* rather than called directly in the common case; exposed as a singleton for
|
|
247
|
-
* the cases the decorators deliberately do not cover (a dynamic spend count,
|
|
248
|
-
* which must run BEFORE the billable side-effect).
|
|
249
|
-
*/
|
|
250
|
-
declare const Purchases: PurchasesService;
|
|
251
186
|
/**
|
|
252
187
|
* Feature flags.
|
|
253
188
|
*
|
|
@@ -448,7 +383,97 @@ declare function createOps(tx: TxLike): {
|
|
|
448
383
|
limit?: number;
|
|
449
384
|
using?: string;
|
|
450
385
|
mode?: "hybrid" | "text" | "vector";
|
|
386
|
+
/** Nihai (RRF-sonrası) skor alt eşiği — süzme LIMIT'ten ÖNCE (FR-001). */
|
|
387
|
+
minScore?: number;
|
|
388
|
+
/** RRF-sonrası üstel tazelik çürümesi: _score * exp(-ln(2)*yaş/halfLife) (FR-004). */
|
|
389
|
+
recency?: {
|
|
390
|
+
field: string;
|
|
391
|
+
halfLife: string;
|
|
392
|
+
};
|
|
393
|
+
/** Chunk-modunda satır başına dönen en iyi blok sayısı (1..10, vars. 3; FR-015). */
|
|
394
|
+
blocksPerRow?: number;
|
|
395
|
+
/** Filtrelenmiş küme üzerinde kolon başına top-20 değer sayacı —
|
|
396
|
+
* dönüş dizisinin `_facets` özelliği (FR-027). */
|
|
397
|
+
facets?: string[];
|
|
398
|
+
/** Satır-modunda FTS eşleşme vurgusu: ts_headline ile `_highlight`
|
|
399
|
+
* alanı; chunk-modda no-op — bloklar zaten eşleşen kesittir (FR-025). */
|
|
400
|
+
highlight?: boolean;
|
|
401
|
+
/** Validity'li tabloda zaman penceresi: varsayılan yalnız güncel;
|
|
402
|
+
* "all" tüm versiyonlar; {asOf} o andaki geçerli versiyon (FR-029). */
|
|
403
|
+
validity?: "all" | {
|
|
404
|
+
asOf: string;
|
|
405
|
+
};
|
|
406
|
+
/** Alan-boost (FR-030): skor * (1 + w·x/(1+x)) — sınırlı, dış servissiz. */
|
|
407
|
+
boost?: {
|
|
408
|
+
field: string;
|
|
409
|
+
weight: number;
|
|
410
|
+
};
|
|
451
411
|
}): Promise<Row[]>;
|
|
412
|
+
/**
|
|
413
|
+
* similar (T018, FR-022): "bu satıra benzeyenler". Hedef vektör DB'den
|
|
414
|
+
* okunur — satır-modu satırın kendi kolonu, chunk-modu parent chunk'larının
|
|
415
|
+
* şema-nitelikli avg'ı — ve ana arama search'ün vector yoluyla koşar;
|
|
416
|
+
* kaynak satır sonuçtan düşer. İKİ tur BİLİNÇLİ (plan T018): target-CTE'li
|
|
417
|
+
* tek SQL'de "id yok" ile "0 komşu" ayrılamazdı; +1 küçük turla id-yokluğu
|
|
418
|
+
* adlandırılmış hataya çevrilir. Sonuç şekli search ile aynı (FR-015).
|
|
419
|
+
*/
|
|
420
|
+
similar(table: string, id: string, opts?: {
|
|
421
|
+
where?: Record<string, unknown>;
|
|
422
|
+
limit?: number;
|
|
423
|
+
using?: string;
|
|
424
|
+
minScore?: number;
|
|
425
|
+
recency?: {
|
|
426
|
+
field: string;
|
|
427
|
+
halfLife: string;
|
|
428
|
+
};
|
|
429
|
+
blocksPerRow?: number;
|
|
430
|
+
validity?: "all" | {
|
|
431
|
+
asOf: string;
|
|
432
|
+
};
|
|
433
|
+
boost?: {
|
|
434
|
+
field: string;
|
|
435
|
+
weight: number;
|
|
436
|
+
};
|
|
437
|
+
}): Promise<Row[]>;
|
|
438
|
+
/**
|
|
439
|
+
* recommend (T018, FR-023): positive/negative id kümelerinden öneri.
|
|
440
|
+
* Hedef vektör DB-İÇİ CTE'lerle türer: pos = avg(embedding of positives),
|
|
441
|
+
* negative varsa hedef = pos.v + (pos.v - neg.v) — pgvector avg agregası
|
|
442
|
+
* ve +/- operatörleri ŞEMA-NİTELİKLİ (M-1: search_path'e güvenilmez).
|
|
443
|
+
* Vektör matematiği istemciye inmez; bulunamayan positive/negative
|
|
444
|
+
* adlandırılmış hatadır ve kaynak id'ler sonuçtan düşer.
|
|
445
|
+
*/
|
|
446
|
+
recommend(table: string, opts: {
|
|
447
|
+
positive: unknown[];
|
|
448
|
+
negative?: unknown[];
|
|
449
|
+
where?: Record<string, unknown>;
|
|
450
|
+
limit?: number;
|
|
451
|
+
using?: string;
|
|
452
|
+
minScore?: number;
|
|
453
|
+
recency?: {
|
|
454
|
+
field: string;
|
|
455
|
+
halfLife: string;
|
|
456
|
+
};
|
|
457
|
+
blocksPerRow?: number;
|
|
458
|
+
validity?: "all" | {
|
|
459
|
+
asOf: string;
|
|
460
|
+
};
|
|
461
|
+
boost?: {
|
|
462
|
+
field: string;
|
|
463
|
+
weight: number;
|
|
464
|
+
};
|
|
465
|
+
}): Promise<Row[]>;
|
|
466
|
+
/**
|
|
467
|
+
* supersede (T021, FR-029, C-9): validity'li tabloda satırın YENİ
|
|
468
|
+
* versiyonunu TEK savepoint'te yazar — eski satır kapatılır
|
|
469
|
+
* (valid_to = now(), superseded_by = yeni pk), yeni satır eklenir, dönüş
|
|
470
|
+
* yeni satırdır. Yeni pk CLIENT'ta üretilir (row'da verilmemişse
|
|
471
|
+
* randomUUID — declared şemaların uuid().defaultRandom() standardı) ki
|
|
472
|
+
* kapatma UPDATE'i INSERT'ten ÖNCE koşabilsin: 0 satır = zaten superseded
|
|
473
|
+
* ya da yok → INSERT hiç denenmez; INSERT hatası ise savepoint'le
|
|
474
|
+
* kapatmayı da geri sarar — yarım supersede diye bir durum yoktur.
|
|
475
|
+
*/
|
|
476
|
+
supersede(table: string, id: string, row: Row): Promise<Row>;
|
|
452
477
|
/** A real SAVEPOINT inside the request's transaction. */
|
|
453
478
|
transaction<T>(cb: (t: unknown) => Promise<T>): Promise<T>;
|
|
454
479
|
/**
|
|
@@ -800,7 +825,7 @@ interface RuntimeHooks {
|
|
|
800
825
|
__requestALS: typeof __requestALS;
|
|
801
826
|
}
|
|
802
827
|
/** The module singletons the engine injects, minus the two it owns itself. */
|
|
803
|
-
type ModuleClients = Partial<Pick<RuntimeServices, "Documents" | "Storage" | "Notifications" | "Flags" | "Realtime" | "
|
|
828
|
+
type ModuleClients = Partial<Pick<RuntimeServices, "Documents" | "Storage" | "Notifications" | "Flags" | "Realtime" | "Secrets">>;
|
|
804
829
|
interface CreateAppOptions {
|
|
805
830
|
/**
|
|
806
831
|
* Vault'tan TEK secret okuma (FR-025): sorgu-anı embedding'in anahtarı
|
|
@@ -854,4 +879,4 @@ interface App {
|
|
|
854
879
|
*/
|
|
855
880
|
declare function createApp(opts: CreateAppOptions): Promise<App>;
|
|
856
881
|
|
|
857
|
-
export { type App as A, BootRefused as B, Cache as C, Database as D, type EgressPolicy as E, Flags as F,
|
|
882
|
+
export { type App as A, BootRefused as B, Cache as C, Database as D, type EgressPolicy as E, Flags as F, makeMemoryCache as G, matchRoute as H, quoteIdent as I, scrubSecrets as J, withTables as K, Log as L, type ModuleClients as M, Notifications as N, Realtime as R, Secrets as S, __getRuntime as _, Documents as a, type RequestStore as b, type RuntimeServices as c, Storage as d, __requestALS as e, __runWithRuntime as f, __setRuntime as g, AuthVerifier as h, type CreateAppOptions as i, type EngineConfig as j, RateLimiter as k, type RequestDatabase as l, type RouteEntry as m, type RuntimeHooks as n, type ScrubResult as o, type SqlDriver as p, type SqlTx as q, buildRouteTable as r, createApp as s, createLazyTransaction as t, createOps as u, createRequestDatabase as v, effectiveAuth as w, hostAllowed as x, installEgressFence as y, loadConfig as z };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Tables, TableTypes } from './db/env.cjs';
|
|
2
|
-
import { D as DBClient, b8 as TxPlanHandle, bh as TxTable, M as Materialized } from './endpoint-
|
|
2
|
+
import { D as DBClient, b8 as TxPlanHandle, bh as TxTable, M as Materialized } from './endpoint-i8TTCohk.cjs';
|
|
3
3
|
|
|
4
4
|
/** On delete action for foreign key references. */
|
|
5
5
|
type OnDeleteAction = 'cascade' | 'set null' | 'restrict' | 'no action';
|
|
@@ -347,12 +347,20 @@ interface EmbeddingModelRef {
|
|
|
347
347
|
apiKeyName?: string;
|
|
348
348
|
baseURL?: string;
|
|
349
349
|
}
|
|
350
|
+
/** Chat/damıtma modeli DESKRIPTORU (C-11, D-019) — memory beyanının extract'i.
|
|
351
|
+
* Embedding gibi düz veridir; çağrıyı worker yapar, anahtar vault'taki
|
|
352
|
+
* OPENAI_API_KEY'dir (D-017: aynı sağlayıcı, yeni dış sistem yok). */
|
|
353
|
+
interface ChatModelRef {
|
|
354
|
+
provider: "openai";
|
|
355
|
+
model: string;
|
|
356
|
+
}
|
|
350
357
|
declare const openai: {
|
|
351
358
|
embedding(model: string, opts?: {
|
|
352
359
|
dimensions?: number;
|
|
353
360
|
apiKeyName?: string;
|
|
354
361
|
baseURL?: string;
|
|
355
362
|
}): EmbeddingModelRef;
|
|
363
|
+
chat(model: string): ChatModelRef;
|
|
356
364
|
};
|
|
357
365
|
|
|
358
366
|
/**
|
|
@@ -400,12 +408,44 @@ interface VectorSearchDecl {
|
|
|
400
408
|
* eşleşme riski (Confluence-tipi sync yükleri için). */
|
|
401
409
|
staleness?: "null" | "keep";
|
|
402
410
|
}
|
|
403
|
-
/** Tablonun arama
|
|
404
|
-
*
|
|
405
|
-
*
|
|
411
|
+
/** Tablonun arama beyanı — İKİ biçim (D-007, tek yüzey):
|
|
412
|
+
*
|
|
413
|
+
* YENİ (önerilen): `{ from, model, ... }` — `from` kolonları hem FTS'e hem
|
|
414
|
+
* embed'e girer. Tabloda vector kolonu declare edilmişse SATIR-modu; yoksa
|
|
415
|
+
* CHUNK-modu otomatiktir (D-010): vektörler türev `__palbase_chunks`
|
|
416
|
+
* tablosunda yaşar, içerik otomatik bölünür. `text: false` FTS'i kapatır,
|
|
417
|
+
* `text: [..]` FTS kolonlarını from'dan ayırır. `chunks` yalnız ince ayar.
|
|
418
|
+
*
|
|
419
|
+
* ESKİ: `text: string[]` + `vector: {...}` — aynen çalışır, wire çıktısı
|
|
420
|
+
* bayt-aynı kalır (NFR-B1). İki biçim KARIŞTIRILAMAZ. */
|
|
406
421
|
interface SearchDecl {
|
|
407
|
-
text?: string[];
|
|
422
|
+
text?: string[] | boolean;
|
|
408
423
|
vector?: VectorSearchDecl | VectorSearchDecl[];
|
|
424
|
+
/** Yeni biçim: arama kaynağı kolonlar (FTS + embed). Varlığı yeni biçimi seçer. */
|
|
425
|
+
from?: string[];
|
|
426
|
+
/** Yeni biçim: auto-embed modeli (zorunlu — BYO için eski biçimi kullanın). */
|
|
427
|
+
model?: EmbeddingModelRef;
|
|
428
|
+
metric?: SearchMetric;
|
|
429
|
+
staleness?: "null" | "keep";
|
|
430
|
+
/** Chunk-modu ince ayarı (yalnız vector kolonsuz tabloda anlamlı). */
|
|
431
|
+
chunks?: {
|
|
432
|
+
size?: number;
|
|
433
|
+
overlap?: number;
|
|
434
|
+
};
|
|
435
|
+
/** Sorgu-yeniden-yazımı: tek yönlü eş anlamlı haritası (FR-026). */
|
|
436
|
+
synonyms?: Record<string, string[]>;
|
|
437
|
+
/** Geçerlilik kolonları türetilir; arama varsayılan yalnız günceli tarar (FR-029). */
|
|
438
|
+
validity?: boolean;
|
|
439
|
+
}
|
|
440
|
+
/** Hafıza beyanı (FR-032, D-019): kaynak tablonun yazımlarından platform
|
|
441
|
+
* fact damıtır ve `into` tablosuna yazar. Hedef NORMAL declared tablodur —
|
|
442
|
+
* kendi search/unique/validity beyanlarıyla. Okuma = Database.search(into).
|
|
443
|
+
* subject default "owner": fact'in kime ait olduğu kolonu (iki tabloda da). */
|
|
444
|
+
interface MemoryDecl {
|
|
445
|
+
from: string[];
|
|
446
|
+
into: string;
|
|
447
|
+
extract: ChatModelRef;
|
|
448
|
+
subject?: string;
|
|
409
449
|
}
|
|
410
450
|
interface TableInput<C extends ColumnMap = ColumnMap> {
|
|
411
451
|
columns: C;
|
|
@@ -448,6 +488,8 @@ interface TableInput<C extends ColumnMap = ColumnMap> {
|
|
|
448
488
|
}[];
|
|
449
489
|
/** Arama beyanı — bkz. SearchDecl. */
|
|
450
490
|
search?: SearchDecl;
|
|
491
|
+
/** Hafıza beyanı — bkz. MemoryDecl (FR-032). */
|
|
492
|
+
memory?: MemoryDecl;
|
|
451
493
|
}
|
|
452
494
|
/**
|
|
453
495
|
* A table definition — the runtime value the Go runtime's `schema_extract.js`
|
|
@@ -485,6 +527,8 @@ interface TableDef<C extends ColumnMap = ColumnMap> {
|
|
|
485
527
|
}[];
|
|
486
528
|
/** Arama beyanı, doğrulanmış ve taşınmış hali. */
|
|
487
529
|
search?: SearchDecl;
|
|
530
|
+
/** Hafıza beyanı, doğrulanmış ve taşınmış hali (FR-032). */
|
|
531
|
+
memory?: MemoryDecl;
|
|
488
532
|
}
|
|
489
533
|
/**
|
|
490
534
|
* A schema definition containing multiple tables, keyed by table name.
|
|
@@ -662,7 +706,52 @@ interface SearchParamsTyped<T extends TableTypes> {
|
|
|
662
706
|
/** Birden çok vektör kolonunda hedef seçimi (model geçişi, FR-013/using). */
|
|
663
707
|
using?: string;
|
|
664
708
|
mode?: "hybrid" | "text" | "vector";
|
|
709
|
+
/** Nihai (RRF-sonrası) skor alt eşiği — süzme LIMIT'ten önce uygulanır (FR-001). */
|
|
710
|
+
minScore?: number;
|
|
711
|
+
/** Chunk-modunda satır başına en iyi blok sayısı (1..10, vars. 3; FR-015). */
|
|
712
|
+
blocksPerRow?: number;
|
|
713
|
+
/** Tazelik çürümesi: nihai skor RRF-sonrası exp(-ln(2)*yaş/halfLife) ile çarpılır;
|
|
714
|
+
* field bir timestamp kolonu, halfLife "90s" | "15m" | "12h" | "30d" biçiminde (FR-004). */
|
|
715
|
+
recency?: {
|
|
716
|
+
field: Extract<keyof T["row"], string>;
|
|
717
|
+
halfLife: string;
|
|
718
|
+
};
|
|
719
|
+
/** Filtrelenmiş küme üzerinde kolon başına top-20 değer sayacı — dönüş
|
|
720
|
+
* dizisinin `_facets` özelliği (FR-027). */
|
|
721
|
+
facets?: Extract<keyof T["row"], string>[];
|
|
722
|
+
/** Satır-modunda FTS eşleşme vurgusu: sonuç satırına `_highlight` ekler;
|
|
723
|
+
* chunk-modda no-op — bloklar zaten eşleşen kesittir (FR-025). */
|
|
724
|
+
highlight?: boolean;
|
|
725
|
+
/** Validity'li tabloda zaman penceresi: varsayılan yalnız güncel versiyon;
|
|
726
|
+
* "all" tüm versiyonlar; {asOf} o anda geçerli olan (FR-029). */
|
|
727
|
+
validity?: "all" | {
|
|
728
|
+
asOf: string;
|
|
729
|
+
};
|
|
730
|
+
/** Alan-boost (FR-030): skor * (1 + w·x/(1+x)) — sayısal kolonla sınırlı
|
|
731
|
+
* çarpan, dış servissiz; bileşim RRF → boost → recency → minScore. */
|
|
732
|
+
boost?: {
|
|
733
|
+
field: Extract<keyof T["row"], string>;
|
|
734
|
+
weight: number;
|
|
735
|
+
};
|
|
665
736
|
}
|
|
737
|
+
/** search() dönüş dizisinin sorgu-düzeyi ekleri (FR-027): `_facets` dizinin
|
|
738
|
+
* ÖZELLİĞİDİR, satırlara kopyalanmaz (JSON'a satır başına şişme olmasın). */
|
|
739
|
+
type SearchFacets = Record<string, {
|
|
740
|
+
value: string | null;
|
|
741
|
+
count: number;
|
|
742
|
+
}[]>;
|
|
743
|
+
/** similar()/recommend() taşıyıcı opsiyonları (T018, FR-022): search'ün
|
|
744
|
+
* paramlarından query/vector/mode düşer — hedef vektörü metodun kendisi
|
|
745
|
+
* DB'den kurar; facets/highlight de düşer (T020) — engine bu ikisini
|
|
746
|
+
* similar/recommend'e geçirmez, tip vaadi gerçekle aynı kalır. */
|
|
747
|
+
type SimilarParamsTyped<T extends TableTypes> = Omit<SearchParamsTyped<T>, "query" | "vector" | "mode" | "facets" | "highlight">;
|
|
748
|
+
/** recommend() parametreleri (T018, FR-023). */
|
|
749
|
+
type RecommendParamsTyped<T extends TableTypes> = SimilarParamsTyped<T> & {
|
|
750
|
+
/** Kaynak beğeniler — hedef vektör bunların DB-içi avg'ı; boş olamaz. */
|
|
751
|
+
positive: string[];
|
|
752
|
+
/** İtilen örnekler — hedef pos.v + (pos.v - neg.v) ile yönlenir. */
|
|
753
|
+
negative?: string[];
|
|
754
|
+
};
|
|
666
755
|
/** Temel tablo erişimcisi — search'süz beş op. */
|
|
667
756
|
interface EnvTypedTableBase<T extends TableTypes> {
|
|
668
757
|
insert(data: T["insert"]): Promise<T["row"]>;
|
|
@@ -673,6 +762,11 @@ interface EnvTypedTableBase<T extends TableTypes> {
|
|
|
673
762
|
delete(id: string): Promise<void>;
|
|
674
763
|
findById(id: string): Promise<T["row"] | null>;
|
|
675
764
|
findMany(query?: Partial<T["row"]>): Promise<T["row"][]>;
|
|
765
|
+
/** Validity'li tabloda satırın yeni versiyonu (FR-029, C-9): eski satır
|
|
766
|
+
* kapanır (valid_to/superseded_by), yenisi TEK savepoint'te eklenir; dönüş
|
|
767
|
+
* yeni satır. Validity beyanı olmayan tabloda adlandırılmış çalışma-zamanı
|
|
768
|
+
* hatası — tip düzeyinde ayrım env `Tables` bayrağı taşımadığından yapılamaz. */
|
|
769
|
+
supersede(id: string, row: T["insert"]): Promise<T["row"]>;
|
|
676
770
|
}
|
|
677
771
|
/** Tablo erişimcisi: env girdisi `searchable: true` taşıyorsa (vector kolonu ya da
|
|
678
772
|
* search beyanı — env-gen üretir) `search()` üyesi VARDIR; yoksa üye hiç yoktur ve
|
|
@@ -682,6 +776,18 @@ type EnvTypedTable<T extends TableTypes> = EnvTypedTableBase<T> & (T extends {
|
|
|
682
776
|
} ? {
|
|
683
777
|
search(params: SearchParamsTyped<T>): Promise<Array<T["row"] & {
|
|
684
778
|
_score: number;
|
|
779
|
+
}> & {
|
|
780
|
+
_facets?: SearchFacets;
|
|
781
|
+
}>;
|
|
782
|
+
/** "Bu satıra benzeyenler" (FR-022): hedef vektör DB'den okunur,
|
|
783
|
+
* kaynak satır sonuçta yoktur; id yoksa adlandırılmış hata. */
|
|
784
|
+
similar(id: string, params?: SimilarParamsTyped<T>): Promise<Array<T["row"] & {
|
|
785
|
+
_score: number;
|
|
786
|
+
}>>;
|
|
787
|
+
/** positive/negative beğenilerden öneri (FR-023): hedef vektör DB-içi
|
|
788
|
+
* avg CTE'leriyle; kaynak id'ler sonuçta yoktur. */
|
|
789
|
+
recommend(params: RecommendParamsTyped<T>): Promise<Array<T["row"] & {
|
|
790
|
+
_score: number;
|
|
685
791
|
}>>;
|
|
686
792
|
} : Record<never, never>);
|
|
687
793
|
/** The `tables` map exposed on `Database`/`tx`, keyed by the env `Tables`
|