latticesql 1.16.4 → 2.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +32 -0
- package/dist/cli.js +4860 -715
- package/dist/index.cjs +646 -3
- package/dist/index.d.cts +306 -1
- package/dist/index.d.ts +306 -1
- package/dist/index.js +634 -3
- package/package.json +9 -2
package/dist/index.d.cts
CHANGED
|
@@ -746,6 +746,16 @@ interface LatticeOptions {
|
|
|
746
746
|
* backends, or pre-opened connections.
|
|
747
747
|
*/
|
|
748
748
|
adapter?: StorageAdapter;
|
|
749
|
+
/**
|
|
750
|
+
* When true, `render()` skips both the full-table read and the file write
|
|
751
|
+
* for tables registered without a `render` spec — those compile to a no-op
|
|
752
|
+
* that would only emit an empty `.schema-only/<table>.md`. Off by default,
|
|
753
|
+
* preserving the original behavior (the table is still scanned and an empty
|
|
754
|
+
* schema-only file written). Enable this to avoid reading large tables off
|
|
755
|
+
* the wire just to produce empty files. Tables with an explicit `render`
|
|
756
|
+
* (or `outputFile`) are unaffected.
|
|
757
|
+
*/
|
|
758
|
+
renderSkipsEmpty?: boolean;
|
|
749
759
|
}
|
|
750
760
|
/**
|
|
751
761
|
* Retention policy for the change log.
|
|
@@ -1720,6 +1730,12 @@ declare class Lattice {
|
|
|
1720
1730
|
private _registerTable;
|
|
1721
1731
|
defineMulti(name: string, def: MultiTableDefinition): this;
|
|
1722
1732
|
defineEntityContext(table: string, def: EntityContextDefinition): this;
|
|
1733
|
+
/**
|
|
1734
|
+
* Register or REPLACE an entity context (overwrites instead of throwing on a
|
|
1735
|
+
* redefine — see {@link SchemaManager.redefineEntityContext}). Used to refresh
|
|
1736
|
+
* a canonical context at runtime after a related schema change.
|
|
1737
|
+
*/
|
|
1738
|
+
redefineEntityContext(table: string, def: EntityContextDefinition): this;
|
|
1723
1739
|
/**
|
|
1724
1740
|
* All entity contexts currently registered on this Lattice — both those
|
|
1725
1741
|
* declared in `lattice.config.yml` and those added programmatically via
|
|
@@ -4080,4 +4096,293 @@ declare function isPostgresUrl(url: string): boolean;
|
|
|
4080
4096
|
*/
|
|
4081
4097
|
declare function registerDirectViaPostgres(cloudUrl: string, email: string, name: string, teamName: string): Promise<DirectRegisterResult>;
|
|
4082
4098
|
|
|
4083
|
-
|
|
4099
|
+
/** A content block in the Anthropic message format used here. */
|
|
4100
|
+
type ContentBlock = {
|
|
4101
|
+
type: 'text';
|
|
4102
|
+
text: string;
|
|
4103
|
+
} | {
|
|
4104
|
+
type: 'tool_use';
|
|
4105
|
+
id: string;
|
|
4106
|
+
name: string;
|
|
4107
|
+
input: Record<string, unknown>;
|
|
4108
|
+
} | {
|
|
4109
|
+
type: 'tool_result';
|
|
4110
|
+
tool_use_id: string;
|
|
4111
|
+
content: string;
|
|
4112
|
+
is_error?: boolean;
|
|
4113
|
+
};
|
|
4114
|
+
interface LlmMessage {
|
|
4115
|
+
role: 'user' | 'assistant';
|
|
4116
|
+
content: string | ContentBlock[];
|
|
4117
|
+
}
|
|
4118
|
+
interface ToolUse {
|
|
4119
|
+
id: string;
|
|
4120
|
+
name: string;
|
|
4121
|
+
input: Record<string, unknown>;
|
|
4122
|
+
}
|
|
4123
|
+
interface TurnResult {
|
|
4124
|
+
stopReason: string;
|
|
4125
|
+
text: string;
|
|
4126
|
+
toolUses: ToolUse[];
|
|
4127
|
+
}
|
|
4128
|
+
/** Minimal tool shape passed to the model (decoupled from the GUI tool catalog). */
|
|
4129
|
+
interface LlmTool {
|
|
4130
|
+
name: string;
|
|
4131
|
+
description?: string;
|
|
4132
|
+
input_schema: unknown;
|
|
4133
|
+
}
|
|
4134
|
+
interface TurnParams {
|
|
4135
|
+
model: string;
|
|
4136
|
+
system: string;
|
|
4137
|
+
messages: LlmMessage[];
|
|
4138
|
+
tools: LlmTool[];
|
|
4139
|
+
/** Called with each streamed text delta. */
|
|
4140
|
+
onText: (delta: string) => void;
|
|
4141
|
+
}
|
|
4142
|
+
/** The slice of the Anthropic client the AI features depend on. */
|
|
4143
|
+
interface LlmClient {
|
|
4144
|
+
runTurn(params: TurnParams): Promise<TurnResult>;
|
|
4145
|
+
}
|
|
4146
|
+
/**
|
|
4147
|
+
* How to authenticate to Anthropic: a raw API key, or an OAuth Bearer token
|
|
4148
|
+
* (from a connected Claude subscription). `betaHeader` carries an optional
|
|
4149
|
+
* `anthropic-beta` value (sourced from env for the OAuth path — not hardcoded).
|
|
4150
|
+
*/
|
|
4151
|
+
interface ClaudeAuth {
|
|
4152
|
+
apiKey?: string | undefined;
|
|
4153
|
+
authToken?: string | undefined;
|
|
4154
|
+
betaHeader?: string | undefined;
|
|
4155
|
+
}
|
|
4156
|
+
|
|
4157
|
+
/** Generate a 1-2 sentence description of a document's text. */
|
|
4158
|
+
declare function summarizeText(client: LlmClient, text: string, name: string): Promise<string>;
|
|
4159
|
+
/** A candidate record an ingested file might relate to. */
|
|
4160
|
+
interface CatalogRecord {
|
|
4161
|
+
id: string;
|
|
4162
|
+
label: string;
|
|
4163
|
+
}
|
|
4164
|
+
interface CatalogEntity {
|
|
4165
|
+
table: string;
|
|
4166
|
+
description?: string;
|
|
4167
|
+
records: CatalogRecord[];
|
|
4168
|
+
}
|
|
4169
|
+
interface ClassifyMatch {
|
|
4170
|
+
table: string;
|
|
4171
|
+
id: string;
|
|
4172
|
+
}
|
|
4173
|
+
/** Extract the first ```json fenced block (or a bare array) and parse it. */
|
|
4174
|
+
declare function parseMatches(raw: string, catalog: CatalogEntity[]): ClassifyMatch[];
|
|
4175
|
+
/** An existing entity the extractor may reuse: its name + column names. */
|
|
4176
|
+
interface SchemaEntity {
|
|
4177
|
+
table: string;
|
|
4178
|
+
columns: string[];
|
|
4179
|
+
}
|
|
4180
|
+
/** A structured object the document represents, to create + link the file to. */
|
|
4181
|
+
interface ExtractedObject {
|
|
4182
|
+
/** Target entity (snake_case). May be new — see {@link isNew}. */
|
|
4183
|
+
entity: string;
|
|
4184
|
+
/** True when {@link entity} should be created (it isn't in the schema yet). */
|
|
4185
|
+
isNew: boolean;
|
|
4186
|
+
/** Columns for a new entity (snake_case); ignored when reusing one. */
|
|
4187
|
+
columns: string[];
|
|
4188
|
+
/** Column → value for the row to create. */
|
|
4189
|
+
values: Record<string, string>;
|
|
4190
|
+
/** Short human label for the object. */
|
|
4191
|
+
label: string;
|
|
4192
|
+
}
|
|
4193
|
+
/** Parse + sanitize the extractor's JSON. Caps at 3 objects; drops invalid ones. */
|
|
4194
|
+
declare function parseObjects(raw: string): ExtractedObject[];
|
|
4195
|
+
/**
|
|
4196
|
+
* Ask the model to extract the structured objects a document represents, given
|
|
4197
|
+
* the user's current schema. Reuses existing entities or proposes new ones.
|
|
4198
|
+
* Best-effort; returns [] on any failure. The caller decides (by aggressiveness)
|
|
4199
|
+
* whether to materialize them and gates new-entity creation.
|
|
4200
|
+
*/
|
|
4201
|
+
declare function extractObjects(client: LlmClient, text: string, name: string, existing: SchemaEntity[], temperature?: number): Promise<ExtractedObject[]>;
|
|
4202
|
+
/**
|
|
4203
|
+
* Ask the model which catalog records the document relates to. Returns only
|
|
4204
|
+
* matches that validate against the supplied catalog (no hallucinated ids).
|
|
4205
|
+
*/
|
|
4206
|
+
declare function classifyLinks(client: LlmClient, text: string, name: string, catalog: CatalogEntity[]): Promise<ClassifyMatch[]>;
|
|
4207
|
+
|
|
4208
|
+
/**
|
|
4209
|
+
* The context organizer. Given an ingested source (a `files` row's text), it
|
|
4210
|
+
* sorts it into the user's OWN schema by default — summarizing it and linking
|
|
4211
|
+
* it to the existing records it relates to — and creates a new knowledge
|
|
4212
|
+
* object ONLY when nothing in the user's schema fits. Every action is an
|
|
4213
|
+
* ordinary, user-editable row, and the result carries a plain-language
|
|
4214
|
+
* {@link OrganizeResult.message} the caller can show ("…created a new note…
|
|
4215
|
+
* you can change this anytime").
|
|
4216
|
+
*
|
|
4217
|
+
* AI-gated: with no {@link OrganizeOptions.client} (no key/auth configured),
|
|
4218
|
+
* it is a no-op (`skipped: true`) and writes nothing.
|
|
4219
|
+
*/
|
|
4220
|
+
interface OrganizeOptions {
|
|
4221
|
+
/** The `files` row id being organized. */
|
|
4222
|
+
fileId: string;
|
|
4223
|
+
/** Extracted text of the source. */
|
|
4224
|
+
text: string;
|
|
4225
|
+
/** Original file/source name. */
|
|
4226
|
+
name: string;
|
|
4227
|
+
/** The user's existing records the source may relate to. */
|
|
4228
|
+
catalog: CatalogEntity[];
|
|
4229
|
+
/** LLM client. `null` ⇒ AI disabled ⇒ no-op. */
|
|
4230
|
+
client: LlmClient | null;
|
|
4231
|
+
/**
|
|
4232
|
+
* Junction table that records a (file → row) link. Must have columns
|
|
4233
|
+
* `file_id`, `table_name`, `row_id`, `relevance`. Default `'file_links'`.
|
|
4234
|
+
*/
|
|
4235
|
+
linkTable?: string;
|
|
4236
|
+
/**
|
|
4237
|
+
* Table to create a fallback knowledge object in when nothing fits. Must
|
|
4238
|
+
* have `title` + `body` columns. Default `'notes'`.
|
|
4239
|
+
*/
|
|
4240
|
+
fallbackTable?: string;
|
|
4241
|
+
/** Create a fallback object when nothing was attached. Default `true`. */
|
|
4242
|
+
createIfNecessary?: boolean;
|
|
4243
|
+
/**
|
|
4244
|
+
* Host-supplied linker: attach the file to an existing record and return
|
|
4245
|
+
* `true` if a link was actually created. Defaults to inserting into
|
|
4246
|
+
* {@link linkTable}. The GUI supplies junction-table linking here.
|
|
4247
|
+
*/
|
|
4248
|
+
linkExisting?: (match: ClassifyMatch) => Promise<boolean>;
|
|
4249
|
+
/**
|
|
4250
|
+
* Host-supplied fallback creator: create a new knowledge object and return
|
|
4251
|
+
* its `{ table, id }`, or `null` to skip creation. Defaults to inserting into
|
|
4252
|
+
* {@link fallbackTable}.
|
|
4253
|
+
*/
|
|
4254
|
+
createFallback?: (title: string, body: string) => Promise<{
|
|
4255
|
+
table: string;
|
|
4256
|
+
id: string;
|
|
4257
|
+
} | null>;
|
|
4258
|
+
}
|
|
4259
|
+
interface OrganizedLink {
|
|
4260
|
+
table: string;
|
|
4261
|
+
id: string;
|
|
4262
|
+
}
|
|
4263
|
+
interface OrganizedCreation {
|
|
4264
|
+
table: string;
|
|
4265
|
+
id: string;
|
|
4266
|
+
title: string;
|
|
4267
|
+
}
|
|
4268
|
+
interface OrganizeResult {
|
|
4269
|
+
/** True when AI was disabled (no client) — nothing was written. */
|
|
4270
|
+
skipped: boolean;
|
|
4271
|
+
/** The 1–2 sentence description (empty when skipped). */
|
|
4272
|
+
description: string;
|
|
4273
|
+
/** Existing records the source was linked to. */
|
|
4274
|
+
linked: OrganizedLink[];
|
|
4275
|
+
/** New knowledge objects created because nothing fit. */
|
|
4276
|
+
created: OrganizedCreation[];
|
|
4277
|
+
/** Plain-language summary for the user (empty when skipped). */
|
|
4278
|
+
message: string;
|
|
4279
|
+
}
|
|
4280
|
+
declare function organizeSource(db: Lattice, opts: OrganizeOptions): Promise<OrganizeResult>;
|
|
4281
|
+
|
|
4282
|
+
/**
|
|
4283
|
+
* Fetch a URL and extract readable text from it. For HTML, uses Mozilla
|
|
4284
|
+
* Readability (the article-extraction algorithm) with a stripped-DOM fallback;
|
|
4285
|
+
* for non-HTML text types, returns the raw text. SSRF-guarded. Network access
|
|
4286
|
+
* is injectable (`opts.fetcher`) so callers/tests can stub it.
|
|
4287
|
+
*
|
|
4288
|
+
* This is the back-end crawler behind cloud references — record a URL with
|
|
4289
|
+
* `referenceUrl`, then `crawlUrl` to fill `extracted_text` for the organizer.
|
|
4290
|
+
*/
|
|
4291
|
+
interface CrawlResult {
|
|
4292
|
+
url: string;
|
|
4293
|
+
title: string;
|
|
4294
|
+
text: string;
|
|
4295
|
+
excerpt: string;
|
|
4296
|
+
mime: string;
|
|
4297
|
+
byteLength: number;
|
|
4298
|
+
}
|
|
4299
|
+
interface CrawlOptions {
|
|
4300
|
+
fetcher?: typeof fetch;
|
|
4301
|
+
allowPrivate?: boolean;
|
|
4302
|
+
maxBytes?: number;
|
|
4303
|
+
timeoutMs?: number;
|
|
4304
|
+
userAgent?: string;
|
|
4305
|
+
/**
|
|
4306
|
+
* Disable the Playwright JS-render fallback (used when the static HTML yields
|
|
4307
|
+
* little text and Playwright is installed). Default false. The fallback
|
|
4308
|
+
* degrades silently when Playwright or a browser is absent.
|
|
4309
|
+
*/
|
|
4310
|
+
noJs?: boolean;
|
|
4311
|
+
}
|
|
4312
|
+
declare function crawlUrl(rawUrl: string, opts?: CrawlOptions): Promise<CrawlResult>;
|
|
4313
|
+
|
|
4314
|
+
/**
|
|
4315
|
+
* The enrich pass: when a knowledge object (e.g. a `notes` row the organizer
|
|
4316
|
+
* created) has accumulated several linked sources but only a thin body, this
|
|
4317
|
+
* synthesizes the sources into a single coherent body and updates the row — but
|
|
4318
|
+
* only if the result is genuinely better than what's there. AI-gated: a no-op
|
|
4319
|
+
* without an LLM client.
|
|
4320
|
+
*
|
|
4321
|
+
* It operates over the same generic link table the organizer writes
|
|
4322
|
+
* (`file_links`: file_id, table_name, row_id), so it stays schema-agnostic.
|
|
4323
|
+
*/
|
|
4324
|
+
interface EnrichOptions {
|
|
4325
|
+
client: LlmClient | null;
|
|
4326
|
+
/** Table holding the knowledge objects to enrich. Default `'notes'`. */
|
|
4327
|
+
knowledgeTable?: string;
|
|
4328
|
+
/** Column on the knowledge object holding its prose body. Default `'body'`. */
|
|
4329
|
+
bodyColumn?: string;
|
|
4330
|
+
/** Generic (file → row) link table. Default `'file_links'`. */
|
|
4331
|
+
linkTable?: string;
|
|
4332
|
+
/** Table holding the source files. Default `'files'`. */
|
|
4333
|
+
sourceTable?: string;
|
|
4334
|
+
/** Column on the source table holding extracted text. Default `'extracted_text'`. */
|
|
4335
|
+
sourceTextColumn?: string;
|
|
4336
|
+
/** Minimum linked sources before an object is eligible. Default `2`. */
|
|
4337
|
+
minSources?: number;
|
|
4338
|
+
/** A body shorter than this many chars is considered "thin". Default `500`. */
|
|
4339
|
+
thinBodyChars?: number;
|
|
4340
|
+
/** Cap on objects enriched per pass. Default `40`. */
|
|
4341
|
+
maxObjects?: number;
|
|
4342
|
+
}
|
|
4343
|
+
interface EnrichResult {
|
|
4344
|
+
/** True when AI was disabled — nothing was examined or written. */
|
|
4345
|
+
skipped: boolean;
|
|
4346
|
+
/** Ids of knowledge objects whose body was rewritten. */
|
|
4347
|
+
enriched: string[];
|
|
4348
|
+
/** How many eligible objects were examined. */
|
|
4349
|
+
examined: number;
|
|
4350
|
+
}
|
|
4351
|
+
declare function enrichKnowledge(db: Lattice, opts: EnrichOptions): Promise<EnrichResult>;
|
|
4352
|
+
|
|
4353
|
+
interface VisionSenderInput {
|
|
4354
|
+
media_type: string;
|
|
4355
|
+
data: string;
|
|
4356
|
+
prompt: string;
|
|
4357
|
+
model: string;
|
|
4358
|
+
}
|
|
4359
|
+
interface VisionOptions {
|
|
4360
|
+
model?: string;
|
|
4361
|
+
prompt?: string;
|
|
4362
|
+
/** Cap on the normalized JPEG size (bytes). Default ~1.4 MB. */
|
|
4363
|
+
maxBytes?: number;
|
|
4364
|
+
/** Injectable model call (test seam). Defaults to a real Anthropic vision call. */
|
|
4365
|
+
sender?: (input: VisionSenderInput) => Promise<string>;
|
|
4366
|
+
}
|
|
4367
|
+
declare function describeImage(auth: ClaudeAuth, path: string, opts?: VisionOptions): Promise<string>;
|
|
4368
|
+
interface PdfSenderInput {
|
|
4369
|
+
data: string;
|
|
4370
|
+
prompt: string;
|
|
4371
|
+
model: string;
|
|
4372
|
+
}
|
|
4373
|
+
interface PdfOptions {
|
|
4374
|
+
model?: string;
|
|
4375
|
+
prompt?: string;
|
|
4376
|
+
/** Max PDF size sent to the model (bytes). Default 30 MB (API limit ~32 MB). */
|
|
4377
|
+
maxBytes?: number;
|
|
4378
|
+
/** Injectable model call (test seam). Defaults to a real Anthropic document call. */
|
|
4379
|
+
sender?: (input: PdfSenderInput) => Promise<string>;
|
|
4380
|
+
}
|
|
4381
|
+
/**
|
|
4382
|
+
* Read a PDF with Claude's native document support — works on text PDFs AND
|
|
4383
|
+
* scanned/image-only PDFs (no text layer), which `markitdown` cannot extract.
|
|
4384
|
+
* AI-gated; the model call is injectable for tests.
|
|
4385
|
+
*/
|
|
4386
|
+
declare function describePdf(auth: ClaudeAuth, path: string, opts?: PdfOptions): Promise<string>;
|
|
4387
|
+
|
|
4388
|
+
export { type AddWorkspaceOptions, type AdoptNativeOptions, type AdoptResult, type ApplyWriteResult, type AuditEvent, type AutoUpdateResult, type BelongsToRelation, type BelongsToSource, type BlobMetadata, type BuiltinTemplateName, CONFIG_SUBDIR, type CatalogEntity, type CatalogRecord, type ChangeEntry, type ChangelogOptions, type ClassifyMatch, type CleanupOptions, type CleanupResult, type CloudProbeResult, type CountOptions, type CrawlOptions, type CrawlResult, type CustomSource, DEFAULT_ENTRY_TYPES, DEFAULT_TYPE_ALIASES, type DirectRegisterResult, type EmbeddingsConfig, type EnrichOptions, type EnrichResult, type EnrichedSource, type EnrichmentLookup, type EntityContextDefinition, type EntityContextManifestEntry, type EntityFileManifestInfo, type EntityFileSource, type EntityFileSpec, type EntityProfileField, type EntityProfileSection, type EntityProfileTemplate, type EntityRenderSpec, type EntityRenderTemplate, type EntitySectionPerRow, type EntitySectionsTemplate, type EntityTableColumn, type EntityTableTemplate, type ExtractedObject, type FilesRow, type Filter, type FilterOp, type FtsConfig, type FtsGroup, type FtsHit, type FtsOptions, type FtsResult, type HasManyRelation, type HasManySource, InMemoryStateStore, type InitOptions, type InviteResponse, LOCAL_DB_RELPATH, Lattice, type LatticeConfig, type LatticeConfigInput, type LatticeEntityDef, type LatticeEntityRenderSpec, type LatticeFieldDef, type LatticeFieldType, type LatticeManifest, type LatticeOptions, type LinkOptions, type LlmClient, type LlmMessage, type ManyToManySource, type MarkdownTableColumn, type MemberSummary, type MigrateResult, type Migration, type MigrationOptions, type MigrationProgress, type MigrationResult, type MultiTableDefinition, NATIVE_ENTITY_DEFS, NATIVE_ENTITY_NAMES, NATIVE_REGISTRY_TABLE, type OrderBySpec, type OrganizeOptions, type OrganizeResult, type OrganizedCreation, type OrganizedLink, type ParseError, type ParseResult, type ParsedConfig, type PdfOptions, type PdfSenderInput, type PkLookup, PostgresAdapter, type PostgresAdapterOptions, type PreparedStatement, type PrimaryKey, type QueryOptions, READ_ONLY_HEADER, ROOT_DIRNAME, type ReadOnlyHeaderOptions, type ReconcileOptions, type ReconcileResult, type RedeemResponse, type RefKind, type RefProvider, type ReferenceMetadata, ReferenceUnavailableError, type RegisterResponse, type Relation, type RenderHooks, type RenderResult, type RenderSpec, type ReportConfig, type ReportResult, type ReportSection, type ReportSectionResult, type ResolveOptions, type ReverseSeedDetection, type ReverseSeedResult, type ReverseSeedTableResult, type ReverseSyncError, type ReverseSyncResult, type ReverseSyncUpdate, type RewardScores, type Row, SQLiteAdapter, type SchemaEntity, type SearchOptions, type SearchResult, type SecurityOptions, type SeedConfig, type SeedLinkSpec, SeedReconciliationError, type SeedResult, type SelfSource, type SessionEntry, type SessionParseOptions, type SessionWriteEntry, type SessionWriteOp, type SessionWriteParseResult, type SourceHandle, type SourceMetadata, type SourceQueryOptions, type StopFn, type StorageAdapter, type SyncResult, type TableDefinition, type TeamConnection, type TeamSummary, TeamsClient, TeamsHttpError, type TemplateRenderSpec, type TurnParams, type TurnResult, type UnresolvedLink, type UpsertByNaturalKeyOptions, type UserIdentity, type UserPreferences, type VisionOptions, type VisionSenderInput, WORKSPACES_SUBDIR, type WatchOptions, type WorkspacePaths, type WorkspaceRecord, type WorkspaceRegistry, type WriteHook, type WriteHookContext, type WritebackDefinition, type WritebackStateStore, type WritebackValidationResult, addWorkspace, adoptNativeEntities, analyticsEnabled, applyTokenBudget, applyWriteEntry, archiveLocalSqlite, assertSafeUrl, attachBlob, autoFtsColumns, autoUpdate, classifyLinks, configDir, contentHash, crawlUrl, createReadOnlyHeader, createSQLiteStateStore, decrypt, defaultWorkspaceYaml, deleteDbCredential, deleteToken, deriveCanonicalContexts, deriveKey, describeImage, describePdf, encrypt, enrichKnowledge, ensureFtsIndex, ensureLatticeRoot, entityFileNames, estimateTokens, extractObjects, findLatticeRoot, fixSchemaConflicts, frontmatter, ftsTableName, fullTextSearch, generateEntryId, generateWriteEntryId, getActiveWorkspace, getDbCredential, getOrCreateMasterKey, getWorkspace, hasFtsIndex, hashFile, importLegacyUserConfig, isEncrypted, isNativeEntity, isPostgresUrl, isPrivateIp, isV1EntityFiles, listDbCredentials, listNativeBindings, listTokens, listWorkspaces, manifestPath, markdownTable, migrateLatticeData, normalizeEntityFiles, openTargetLatticeForMigration, organizeSource, parseConfigFile, parseConfigString, parseMarkdownEntries, parseMatches, parseObjects, parseSessionMD, parseSessionWrites, probeCloud, providerForUrl, readIdentity, readManifest, readPreferences, readRegistry, readToken, referenceLocalFile, referenceUrl, registerDirectViaPostgres, registerNativeEntities, registryPath, resolveLatticeRoot, resolveSource, resolveWorkspacePaths, rootConfigDir, saveDbCredential, saveDbCredentialForTeam, setActiveWorkspace, slugify, summarizeText, toSafeDirName, truncate, validateEntryId, workspaceBlobsDir, workspaceConfigPath, workspaceContextDir, workspaceDataDir, workspaceDbPath, workspaceDir, workspacesDir, writeIdentity, writeManifest, writePreferences, writeRegistry, writeToken };
|
package/dist/index.d.ts
CHANGED
|
@@ -746,6 +746,16 @@ interface LatticeOptions {
|
|
|
746
746
|
* backends, or pre-opened connections.
|
|
747
747
|
*/
|
|
748
748
|
adapter?: StorageAdapter;
|
|
749
|
+
/**
|
|
750
|
+
* When true, `render()` skips both the full-table read and the file write
|
|
751
|
+
* for tables registered without a `render` spec — those compile to a no-op
|
|
752
|
+
* that would only emit an empty `.schema-only/<table>.md`. Off by default,
|
|
753
|
+
* preserving the original behavior (the table is still scanned and an empty
|
|
754
|
+
* schema-only file written). Enable this to avoid reading large tables off
|
|
755
|
+
* the wire just to produce empty files. Tables with an explicit `render`
|
|
756
|
+
* (or `outputFile`) are unaffected.
|
|
757
|
+
*/
|
|
758
|
+
renderSkipsEmpty?: boolean;
|
|
749
759
|
}
|
|
750
760
|
/**
|
|
751
761
|
* Retention policy for the change log.
|
|
@@ -1720,6 +1730,12 @@ declare class Lattice {
|
|
|
1720
1730
|
private _registerTable;
|
|
1721
1731
|
defineMulti(name: string, def: MultiTableDefinition): this;
|
|
1722
1732
|
defineEntityContext(table: string, def: EntityContextDefinition): this;
|
|
1733
|
+
/**
|
|
1734
|
+
* Register or REPLACE an entity context (overwrites instead of throwing on a
|
|
1735
|
+
* redefine — see {@link SchemaManager.redefineEntityContext}). Used to refresh
|
|
1736
|
+
* a canonical context at runtime after a related schema change.
|
|
1737
|
+
*/
|
|
1738
|
+
redefineEntityContext(table: string, def: EntityContextDefinition): this;
|
|
1723
1739
|
/**
|
|
1724
1740
|
* All entity contexts currently registered on this Lattice — both those
|
|
1725
1741
|
* declared in `lattice.config.yml` and those added programmatically via
|
|
@@ -4080,4 +4096,293 @@ declare function isPostgresUrl(url: string): boolean;
|
|
|
4080
4096
|
*/
|
|
4081
4097
|
declare function registerDirectViaPostgres(cloudUrl: string, email: string, name: string, teamName: string): Promise<DirectRegisterResult>;
|
|
4082
4098
|
|
|
4083
|
-
|
|
4099
|
+
/** A content block in the Anthropic message format used here. */
|
|
4100
|
+
type ContentBlock = {
|
|
4101
|
+
type: 'text';
|
|
4102
|
+
text: string;
|
|
4103
|
+
} | {
|
|
4104
|
+
type: 'tool_use';
|
|
4105
|
+
id: string;
|
|
4106
|
+
name: string;
|
|
4107
|
+
input: Record<string, unknown>;
|
|
4108
|
+
} | {
|
|
4109
|
+
type: 'tool_result';
|
|
4110
|
+
tool_use_id: string;
|
|
4111
|
+
content: string;
|
|
4112
|
+
is_error?: boolean;
|
|
4113
|
+
};
|
|
4114
|
+
interface LlmMessage {
|
|
4115
|
+
role: 'user' | 'assistant';
|
|
4116
|
+
content: string | ContentBlock[];
|
|
4117
|
+
}
|
|
4118
|
+
interface ToolUse {
|
|
4119
|
+
id: string;
|
|
4120
|
+
name: string;
|
|
4121
|
+
input: Record<string, unknown>;
|
|
4122
|
+
}
|
|
4123
|
+
interface TurnResult {
|
|
4124
|
+
stopReason: string;
|
|
4125
|
+
text: string;
|
|
4126
|
+
toolUses: ToolUse[];
|
|
4127
|
+
}
|
|
4128
|
+
/** Minimal tool shape passed to the model (decoupled from the GUI tool catalog). */
|
|
4129
|
+
interface LlmTool {
|
|
4130
|
+
name: string;
|
|
4131
|
+
description?: string;
|
|
4132
|
+
input_schema: unknown;
|
|
4133
|
+
}
|
|
4134
|
+
interface TurnParams {
|
|
4135
|
+
model: string;
|
|
4136
|
+
system: string;
|
|
4137
|
+
messages: LlmMessage[];
|
|
4138
|
+
tools: LlmTool[];
|
|
4139
|
+
/** Called with each streamed text delta. */
|
|
4140
|
+
onText: (delta: string) => void;
|
|
4141
|
+
}
|
|
4142
|
+
/** The slice of the Anthropic client the AI features depend on. */
|
|
4143
|
+
interface LlmClient {
|
|
4144
|
+
runTurn(params: TurnParams): Promise<TurnResult>;
|
|
4145
|
+
}
|
|
4146
|
+
/**
|
|
4147
|
+
* How to authenticate to Anthropic: a raw API key, or an OAuth Bearer token
|
|
4148
|
+
* (from a connected Claude subscription). `betaHeader` carries an optional
|
|
4149
|
+
* `anthropic-beta` value (sourced from env for the OAuth path — not hardcoded).
|
|
4150
|
+
*/
|
|
4151
|
+
interface ClaudeAuth {
|
|
4152
|
+
apiKey?: string | undefined;
|
|
4153
|
+
authToken?: string | undefined;
|
|
4154
|
+
betaHeader?: string | undefined;
|
|
4155
|
+
}
|
|
4156
|
+
|
|
4157
|
+
/** Generate a 1-2 sentence description of a document's text. */
|
|
4158
|
+
declare function summarizeText(client: LlmClient, text: string, name: string): Promise<string>;
|
|
4159
|
+
/** A candidate record an ingested file might relate to. */
|
|
4160
|
+
interface CatalogRecord {
|
|
4161
|
+
id: string;
|
|
4162
|
+
label: string;
|
|
4163
|
+
}
|
|
4164
|
+
interface CatalogEntity {
|
|
4165
|
+
table: string;
|
|
4166
|
+
description?: string;
|
|
4167
|
+
records: CatalogRecord[];
|
|
4168
|
+
}
|
|
4169
|
+
interface ClassifyMatch {
|
|
4170
|
+
table: string;
|
|
4171
|
+
id: string;
|
|
4172
|
+
}
|
|
4173
|
+
/** Extract the first ```json fenced block (or a bare array) and parse it. */
|
|
4174
|
+
declare function parseMatches(raw: string, catalog: CatalogEntity[]): ClassifyMatch[];
|
|
4175
|
+
/** An existing entity the extractor may reuse: its name + column names. */
|
|
4176
|
+
interface SchemaEntity {
|
|
4177
|
+
table: string;
|
|
4178
|
+
columns: string[];
|
|
4179
|
+
}
|
|
4180
|
+
/** A structured object the document represents, to create + link the file to. */
|
|
4181
|
+
interface ExtractedObject {
|
|
4182
|
+
/** Target entity (snake_case). May be new — see {@link isNew}. */
|
|
4183
|
+
entity: string;
|
|
4184
|
+
/** True when {@link entity} should be created (it isn't in the schema yet). */
|
|
4185
|
+
isNew: boolean;
|
|
4186
|
+
/** Columns for a new entity (snake_case); ignored when reusing one. */
|
|
4187
|
+
columns: string[];
|
|
4188
|
+
/** Column → value for the row to create. */
|
|
4189
|
+
values: Record<string, string>;
|
|
4190
|
+
/** Short human label for the object. */
|
|
4191
|
+
label: string;
|
|
4192
|
+
}
|
|
4193
|
+
/** Parse + sanitize the extractor's JSON. Caps at 3 objects; drops invalid ones. */
|
|
4194
|
+
declare function parseObjects(raw: string): ExtractedObject[];
|
|
4195
|
+
/**
|
|
4196
|
+
* Ask the model to extract the structured objects a document represents, given
|
|
4197
|
+
* the user's current schema. Reuses existing entities or proposes new ones.
|
|
4198
|
+
* Best-effort; returns [] on any failure. The caller decides (by aggressiveness)
|
|
4199
|
+
* whether to materialize them and gates new-entity creation.
|
|
4200
|
+
*/
|
|
4201
|
+
declare function extractObjects(client: LlmClient, text: string, name: string, existing: SchemaEntity[], temperature?: number): Promise<ExtractedObject[]>;
|
|
4202
|
+
/**
|
|
4203
|
+
* Ask the model which catalog records the document relates to. Returns only
|
|
4204
|
+
* matches that validate against the supplied catalog (no hallucinated ids).
|
|
4205
|
+
*/
|
|
4206
|
+
declare function classifyLinks(client: LlmClient, text: string, name: string, catalog: CatalogEntity[]): Promise<ClassifyMatch[]>;
|
|
4207
|
+
|
|
4208
|
+
/**
|
|
4209
|
+
* The context organizer. Given an ingested source (a `files` row's text), it
|
|
4210
|
+
* sorts it into the user's OWN schema by default — summarizing it and linking
|
|
4211
|
+
* it to the existing records it relates to — and creates a new knowledge
|
|
4212
|
+
* object ONLY when nothing in the user's schema fits. Every action is an
|
|
4213
|
+
* ordinary, user-editable row, and the result carries a plain-language
|
|
4214
|
+
* {@link OrganizeResult.message} the caller can show ("…created a new note…
|
|
4215
|
+
* you can change this anytime").
|
|
4216
|
+
*
|
|
4217
|
+
* AI-gated: with no {@link OrganizeOptions.client} (no key/auth configured),
|
|
4218
|
+
* it is a no-op (`skipped: true`) and writes nothing.
|
|
4219
|
+
*/
|
|
4220
|
+
interface OrganizeOptions {
|
|
4221
|
+
/** The `files` row id being organized. */
|
|
4222
|
+
fileId: string;
|
|
4223
|
+
/** Extracted text of the source. */
|
|
4224
|
+
text: string;
|
|
4225
|
+
/** Original file/source name. */
|
|
4226
|
+
name: string;
|
|
4227
|
+
/** The user's existing records the source may relate to. */
|
|
4228
|
+
catalog: CatalogEntity[];
|
|
4229
|
+
/** LLM client. `null` ⇒ AI disabled ⇒ no-op. */
|
|
4230
|
+
client: LlmClient | null;
|
|
4231
|
+
/**
|
|
4232
|
+
* Junction table that records a (file → row) link. Must have columns
|
|
4233
|
+
* `file_id`, `table_name`, `row_id`, `relevance`. Default `'file_links'`.
|
|
4234
|
+
*/
|
|
4235
|
+
linkTable?: string;
|
|
4236
|
+
/**
|
|
4237
|
+
* Table to create a fallback knowledge object in when nothing fits. Must
|
|
4238
|
+
* have `title` + `body` columns. Default `'notes'`.
|
|
4239
|
+
*/
|
|
4240
|
+
fallbackTable?: string;
|
|
4241
|
+
/** Create a fallback object when nothing was attached. Default `true`. */
|
|
4242
|
+
createIfNecessary?: boolean;
|
|
4243
|
+
/**
|
|
4244
|
+
* Host-supplied linker: attach the file to an existing record and return
|
|
4245
|
+
* `true` if a link was actually created. Defaults to inserting into
|
|
4246
|
+
* {@link linkTable}. The GUI supplies junction-table linking here.
|
|
4247
|
+
*/
|
|
4248
|
+
linkExisting?: (match: ClassifyMatch) => Promise<boolean>;
|
|
4249
|
+
/**
|
|
4250
|
+
* Host-supplied fallback creator: create a new knowledge object and return
|
|
4251
|
+
* its `{ table, id }`, or `null` to skip creation. Defaults to inserting into
|
|
4252
|
+
* {@link fallbackTable}.
|
|
4253
|
+
*/
|
|
4254
|
+
createFallback?: (title: string, body: string) => Promise<{
|
|
4255
|
+
table: string;
|
|
4256
|
+
id: string;
|
|
4257
|
+
} | null>;
|
|
4258
|
+
}
|
|
4259
|
+
interface OrganizedLink {
|
|
4260
|
+
table: string;
|
|
4261
|
+
id: string;
|
|
4262
|
+
}
|
|
4263
|
+
interface OrganizedCreation {
|
|
4264
|
+
table: string;
|
|
4265
|
+
id: string;
|
|
4266
|
+
title: string;
|
|
4267
|
+
}
|
|
4268
|
+
interface OrganizeResult {
|
|
4269
|
+
/** True when AI was disabled (no client) — nothing was written. */
|
|
4270
|
+
skipped: boolean;
|
|
4271
|
+
/** The 1–2 sentence description (empty when skipped). */
|
|
4272
|
+
description: string;
|
|
4273
|
+
/** Existing records the source was linked to. */
|
|
4274
|
+
linked: OrganizedLink[];
|
|
4275
|
+
/** New knowledge objects created because nothing fit. */
|
|
4276
|
+
created: OrganizedCreation[];
|
|
4277
|
+
/** Plain-language summary for the user (empty when skipped). */
|
|
4278
|
+
message: string;
|
|
4279
|
+
}
|
|
4280
|
+
declare function organizeSource(db: Lattice, opts: OrganizeOptions): Promise<OrganizeResult>;
|
|
4281
|
+
|
|
4282
|
+
/**
|
|
4283
|
+
* Fetch a URL and extract readable text from it. For HTML, uses Mozilla
|
|
4284
|
+
* Readability (the article-extraction algorithm) with a stripped-DOM fallback;
|
|
4285
|
+
* for non-HTML text types, returns the raw text. SSRF-guarded. Network access
|
|
4286
|
+
* is injectable (`opts.fetcher`) so callers/tests can stub it.
|
|
4287
|
+
*
|
|
4288
|
+
* This is the back-end crawler behind cloud references — record a URL with
|
|
4289
|
+
* `referenceUrl`, then `crawlUrl` to fill `extracted_text` for the organizer.
|
|
4290
|
+
*/
|
|
4291
|
+
interface CrawlResult {
|
|
4292
|
+
url: string;
|
|
4293
|
+
title: string;
|
|
4294
|
+
text: string;
|
|
4295
|
+
excerpt: string;
|
|
4296
|
+
mime: string;
|
|
4297
|
+
byteLength: number;
|
|
4298
|
+
}
|
|
4299
|
+
interface CrawlOptions {
|
|
4300
|
+
fetcher?: typeof fetch;
|
|
4301
|
+
allowPrivate?: boolean;
|
|
4302
|
+
maxBytes?: number;
|
|
4303
|
+
timeoutMs?: number;
|
|
4304
|
+
userAgent?: string;
|
|
4305
|
+
/**
|
|
4306
|
+
* Disable the Playwright JS-render fallback (used when the static HTML yields
|
|
4307
|
+
* little text and Playwright is installed). Default false. The fallback
|
|
4308
|
+
* degrades silently when Playwright or a browser is absent.
|
|
4309
|
+
*/
|
|
4310
|
+
noJs?: boolean;
|
|
4311
|
+
}
|
|
4312
|
+
declare function crawlUrl(rawUrl: string, opts?: CrawlOptions): Promise<CrawlResult>;
|
|
4313
|
+
|
|
4314
|
+
/**
|
|
4315
|
+
* The enrich pass: when a knowledge object (e.g. a `notes` row the organizer
|
|
4316
|
+
* created) has accumulated several linked sources but only a thin body, this
|
|
4317
|
+
* synthesizes the sources into a single coherent body and updates the row — but
|
|
4318
|
+
* only if the result is genuinely better than what's there. AI-gated: a no-op
|
|
4319
|
+
* without an LLM client.
|
|
4320
|
+
*
|
|
4321
|
+
* It operates over the same generic link table the organizer writes
|
|
4322
|
+
* (`file_links`: file_id, table_name, row_id), so it stays schema-agnostic.
|
|
4323
|
+
*/
|
|
4324
|
+
interface EnrichOptions {
|
|
4325
|
+
client: LlmClient | null;
|
|
4326
|
+
/** Table holding the knowledge objects to enrich. Default `'notes'`. */
|
|
4327
|
+
knowledgeTable?: string;
|
|
4328
|
+
/** Column on the knowledge object holding its prose body. Default `'body'`. */
|
|
4329
|
+
bodyColumn?: string;
|
|
4330
|
+
/** Generic (file → row) link table. Default `'file_links'`. */
|
|
4331
|
+
linkTable?: string;
|
|
4332
|
+
/** Table holding the source files. Default `'files'`. */
|
|
4333
|
+
sourceTable?: string;
|
|
4334
|
+
/** Column on the source table holding extracted text. Default `'extracted_text'`. */
|
|
4335
|
+
sourceTextColumn?: string;
|
|
4336
|
+
/** Minimum linked sources before an object is eligible. Default `2`. */
|
|
4337
|
+
minSources?: number;
|
|
4338
|
+
/** A body shorter than this many chars is considered "thin". Default `500`. */
|
|
4339
|
+
thinBodyChars?: number;
|
|
4340
|
+
/** Cap on objects enriched per pass. Default `40`. */
|
|
4341
|
+
maxObjects?: number;
|
|
4342
|
+
}
|
|
4343
|
+
interface EnrichResult {
|
|
4344
|
+
/** True when AI was disabled — nothing was examined or written. */
|
|
4345
|
+
skipped: boolean;
|
|
4346
|
+
/** Ids of knowledge objects whose body was rewritten. */
|
|
4347
|
+
enriched: string[];
|
|
4348
|
+
/** How many eligible objects were examined. */
|
|
4349
|
+
examined: number;
|
|
4350
|
+
}
|
|
4351
|
+
declare function enrichKnowledge(db: Lattice, opts: EnrichOptions): Promise<EnrichResult>;
|
|
4352
|
+
|
|
4353
|
+
interface VisionSenderInput {
|
|
4354
|
+
media_type: string;
|
|
4355
|
+
data: string;
|
|
4356
|
+
prompt: string;
|
|
4357
|
+
model: string;
|
|
4358
|
+
}
|
|
4359
|
+
interface VisionOptions {
|
|
4360
|
+
model?: string;
|
|
4361
|
+
prompt?: string;
|
|
4362
|
+
/** Cap on the normalized JPEG size (bytes). Default ~1.4 MB. */
|
|
4363
|
+
maxBytes?: number;
|
|
4364
|
+
/** Injectable model call (test seam). Defaults to a real Anthropic vision call. */
|
|
4365
|
+
sender?: (input: VisionSenderInput) => Promise<string>;
|
|
4366
|
+
}
|
|
4367
|
+
declare function describeImage(auth: ClaudeAuth, path: string, opts?: VisionOptions): Promise<string>;
|
|
4368
|
+
interface PdfSenderInput {
|
|
4369
|
+
data: string;
|
|
4370
|
+
prompt: string;
|
|
4371
|
+
model: string;
|
|
4372
|
+
}
|
|
4373
|
+
interface PdfOptions {
|
|
4374
|
+
model?: string;
|
|
4375
|
+
prompt?: string;
|
|
4376
|
+
/** Max PDF size sent to the model (bytes). Default 30 MB (API limit ~32 MB). */
|
|
4377
|
+
maxBytes?: number;
|
|
4378
|
+
/** Injectable model call (test seam). Defaults to a real Anthropic document call. */
|
|
4379
|
+
sender?: (input: PdfSenderInput) => Promise<string>;
|
|
4380
|
+
}
|
|
4381
|
+
/**
|
|
4382
|
+
* Read a PDF with Claude's native document support — works on text PDFs AND
|
|
4383
|
+
* scanned/image-only PDFs (no text layer), which `markitdown` cannot extract.
|
|
4384
|
+
* AI-gated; the model call is injectable for tests.
|
|
4385
|
+
*/
|
|
4386
|
+
declare function describePdf(auth: ClaudeAuth, path: string, opts?: PdfOptions): Promise<string>;
|
|
4387
|
+
|
|
4388
|
+
export { type AddWorkspaceOptions, type AdoptNativeOptions, type AdoptResult, type ApplyWriteResult, type AuditEvent, type AutoUpdateResult, type BelongsToRelation, type BelongsToSource, type BlobMetadata, type BuiltinTemplateName, CONFIG_SUBDIR, type CatalogEntity, type CatalogRecord, type ChangeEntry, type ChangelogOptions, type ClassifyMatch, type CleanupOptions, type CleanupResult, type CloudProbeResult, type CountOptions, type CrawlOptions, type CrawlResult, type CustomSource, DEFAULT_ENTRY_TYPES, DEFAULT_TYPE_ALIASES, type DirectRegisterResult, type EmbeddingsConfig, type EnrichOptions, type EnrichResult, type EnrichedSource, type EnrichmentLookup, type EntityContextDefinition, type EntityContextManifestEntry, type EntityFileManifestInfo, type EntityFileSource, type EntityFileSpec, type EntityProfileField, type EntityProfileSection, type EntityProfileTemplate, type EntityRenderSpec, type EntityRenderTemplate, type EntitySectionPerRow, type EntitySectionsTemplate, type EntityTableColumn, type EntityTableTemplate, type ExtractedObject, type FilesRow, type Filter, type FilterOp, type FtsConfig, type FtsGroup, type FtsHit, type FtsOptions, type FtsResult, type HasManyRelation, type HasManySource, InMemoryStateStore, type InitOptions, type InviteResponse, LOCAL_DB_RELPATH, Lattice, type LatticeConfig, type LatticeConfigInput, type LatticeEntityDef, type LatticeEntityRenderSpec, type LatticeFieldDef, type LatticeFieldType, type LatticeManifest, type LatticeOptions, type LinkOptions, type LlmClient, type LlmMessage, type ManyToManySource, type MarkdownTableColumn, type MemberSummary, type MigrateResult, type Migration, type MigrationOptions, type MigrationProgress, type MigrationResult, type MultiTableDefinition, NATIVE_ENTITY_DEFS, NATIVE_ENTITY_NAMES, NATIVE_REGISTRY_TABLE, type OrderBySpec, type OrganizeOptions, type OrganizeResult, type OrganizedCreation, type OrganizedLink, type ParseError, type ParseResult, type ParsedConfig, type PdfOptions, type PdfSenderInput, type PkLookup, PostgresAdapter, type PostgresAdapterOptions, type PreparedStatement, type PrimaryKey, type QueryOptions, READ_ONLY_HEADER, ROOT_DIRNAME, type ReadOnlyHeaderOptions, type ReconcileOptions, type ReconcileResult, type RedeemResponse, type RefKind, type RefProvider, type ReferenceMetadata, ReferenceUnavailableError, type RegisterResponse, type Relation, type RenderHooks, type RenderResult, type RenderSpec, type ReportConfig, type ReportResult, type ReportSection, type ReportSectionResult, type ResolveOptions, type ReverseSeedDetection, type ReverseSeedResult, type ReverseSeedTableResult, type ReverseSyncError, type ReverseSyncResult, type ReverseSyncUpdate, type RewardScores, type Row, SQLiteAdapter, type SchemaEntity, type SearchOptions, type SearchResult, type SecurityOptions, type SeedConfig, type SeedLinkSpec, SeedReconciliationError, type SeedResult, type SelfSource, type SessionEntry, type SessionParseOptions, type SessionWriteEntry, type SessionWriteOp, type SessionWriteParseResult, type SourceHandle, type SourceMetadata, type SourceQueryOptions, type StopFn, type StorageAdapter, type SyncResult, type TableDefinition, type TeamConnection, type TeamSummary, TeamsClient, TeamsHttpError, type TemplateRenderSpec, type TurnParams, type TurnResult, type UnresolvedLink, type UpsertByNaturalKeyOptions, type UserIdentity, type UserPreferences, type VisionOptions, type VisionSenderInput, WORKSPACES_SUBDIR, type WatchOptions, type WorkspacePaths, type WorkspaceRecord, type WorkspaceRegistry, type WriteHook, type WriteHookContext, type WritebackDefinition, type WritebackStateStore, type WritebackValidationResult, addWorkspace, adoptNativeEntities, analyticsEnabled, applyTokenBudget, applyWriteEntry, archiveLocalSqlite, assertSafeUrl, attachBlob, autoFtsColumns, autoUpdate, classifyLinks, configDir, contentHash, crawlUrl, createReadOnlyHeader, createSQLiteStateStore, decrypt, defaultWorkspaceYaml, deleteDbCredential, deleteToken, deriveCanonicalContexts, deriveKey, describeImage, describePdf, encrypt, enrichKnowledge, ensureFtsIndex, ensureLatticeRoot, entityFileNames, estimateTokens, extractObjects, findLatticeRoot, fixSchemaConflicts, frontmatter, ftsTableName, fullTextSearch, generateEntryId, generateWriteEntryId, getActiveWorkspace, getDbCredential, getOrCreateMasterKey, getWorkspace, hasFtsIndex, hashFile, importLegacyUserConfig, isEncrypted, isNativeEntity, isPostgresUrl, isPrivateIp, isV1EntityFiles, listDbCredentials, listNativeBindings, listTokens, listWorkspaces, manifestPath, markdownTable, migrateLatticeData, normalizeEntityFiles, openTargetLatticeForMigration, organizeSource, parseConfigFile, parseConfigString, parseMarkdownEntries, parseMatches, parseObjects, parseSessionMD, parseSessionWrites, probeCloud, providerForUrl, readIdentity, readManifest, readPreferences, readRegistry, readToken, referenceLocalFile, referenceUrl, registerDirectViaPostgres, registerNativeEntities, registryPath, resolveLatticeRoot, resolveSource, resolveWorkspacePaths, rootConfigDir, saveDbCredential, saveDbCredentialForTeam, setActiveWorkspace, slugify, summarizeText, toSafeDirName, truncate, validateEntryId, workspaceBlobsDir, workspaceConfigPath, workspaceContextDir, workspaceDataDir, workspaceDbPath, workspaceDir, workspacesDir, writeIdentity, writeManifest, writePreferences, writeRegistry, writeToken };
|