CreateLokvisOptions
Defined in: packages/sdk/src/index.ts:77
createLokvis 配置
Extends
Section titled “Extends”Properties
Section titled “Properties”enableOpfs?
Section titled “enableOpfs?”
optionalenableOpfs?:boolean
Defined in: packages/runtime/src/types.ts:48
是否启用 OPFS(默认 true,降级时关闭)
Inherited from
Section titled “Inherited from”enableIndexedDB?
Section titled “enableIndexedDB?”
optionalenableIndexedDB?:boolean
Defined in: packages/runtime/src/types.ts:50
是否启用 IndexedDB 元数据存储
Inherited from
Section titled “Inherited from”storageQuota?
Section titled “storageQuota?”
optionalstorageQuota?:number
Defined in: packages/runtime/src/types.ts:52
存储配额(字节)
Inherited from
Section titled “Inherited from”enableLog?
Section titled “enableLog?”
optionalenableLog?:boolean
Defined in: packages/runtime/src/types.ts:54
是否启用日志
Inherited from
Section titled “Inherited from”engineStrategy?
Section titled “engineStrategy?”
optionalengineStrategy?:EngineSelectionStrategy
Defined in: packages/runtime/src/types.ts:60
引擎选择策略(默认 ‘first’)。 当多个引擎实现同一能力且未显式指定 preferredEngine 时,据此选择: ‘first’(注册顺序)/‘fastest’(性能最优)/‘balanced’(匹配能力声明性能,无则最快)。
Inherited from
Section titled “Inherited from”assetStore?
Section titled “assetStore?”
optionalassetStore?:AssetStore
Defined in: packages/runtime/src/types.ts:66
注入自定义 AssetStore(测试或精细控制用)。 默认由 createRuntime 通过 createAssetStore 工厂自动创建, 按 OPFS → IndexedDB → Memory 降级。
Inherited from
Section titled “Inherited from”historyStore?
Section titled “historyStore?”
optionalhistoryStore?:HistoryStore
Defined in: packages/runtime/src/types.ts:72
注入自定义 HistoryStore(W7.2 历史持久化)。 默认由 createRuntime 在 enableIndexedDB 时通过 createHistoryStore 自动创建; IndexedDB 不可用时为 undefined,历史退化为仅内存模式。
Inherited from
Section titled “Inherited from”historyStoreOptions?
Section titled “historyStoreOptions?”
optionalhistoryStoreOptions?:HistoryStoreOptions
Defined in: packages/runtime/src/types.ts:77
HistoryStore 工厂选项(W7.2,仅 historyStore 未注入时生效)。 测试可注入 kvStore 或自定义 dbName。
Inherited from
Section titled “Inherited from”RuntimeConfig.historyStoreOptions
isPro?
Section titled “isPro?”
optionalisPro?:boolean
Defined in: packages/runtime/src/types.ts:88
是否启用 Pro 模式(W6.2 / PROJECT_PLAN 17.4)。
- false(默认):批量上限 10 文件、并发 4、workflow 槽位 5
- true:批量无上限、并发 16、workflow 槽位无限 由 cloud 侧 createLokvis({ auth }) 注入 session 后置为 true。
注:isPro 仅控制本地批量/槽位门控(四环)。AI 调用配额由
@lokvis/cloud-bridge 的 CloudBilling 据 plan 精确判定
(‘pro’ 解锁四环但 AI 配额为 0,需 ‘cloud_pro’ 才有 AI 配额)。
Inherited from
Section titled “Inherited from”
optionalplan?:Plan
Defined in: packages/runtime/src/types.ts:99
用户订阅计划(G1)。比 isPro 更细粒度,用于 AI 调用计费判定。
- ‘free’(默认):免费用户,isPro=false
- ‘pro’:Pro 订阅($9/月),isPro=true(解锁四环),AI 配额=0
- ‘cloud_pro’:Cloud Pro 订阅,isPro=true,AI 配额=10/天
- ‘enterprise’:企业版,isPro=true,AI 配额=∞
由 SDK 据 auth.plan 注入;未传时默认 ‘free’。
isPro 派生自 plan !== 'free'(在 SDK resolvePlan 中计算)。
Inherited from
Section titled “Inherited from”memoryBudget?
Section titled “memoryBudget?”
optionalmemoryBudget?:number
Defined in: packages/runtime/src/types.ts:104
内存预算(字节,W3.3 MemoryGuard)。 默认 512MB。BatchProcessor 据此在内存压力高时收缩并发槽位。
Inherited from
Section titled “Inherited from”plugins?
Section titled “plugins?”
optionalplugins?:PluginLoadEntry[]
Defined in: packages/sdk/src/index.ts:79
预加载的插件列表
optionalauth?:LokvisAuthSession
Defined in: packages/sdk/src/index.ts:89
Cloud 注入的认证信息(W17.3)。
- 传入非空
session或token且未显式isPro: false时,runtime.isPro自动置为true(批量/槽位无上限) - 不传
auth:保持 free 模式(isPro = false)
SDK 仅做 presence 推导,不做 token 校验(校验由 cloud 网关完成)。