openclaw-plugin-model-fetch 0.0.0-stage → 0.2.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.
@@ -0,0 +1,531 @@
1
+ import { fetchWithSsrFGuard, ssrfPolicyFromAllowPrivateNetwork, } from "openclaw/plugin-sdk/ssrf-runtime";
2
+ import { readResponseWithLimit } from "openclaw/plugin-sdk/media-runtime";
3
+ import { jsonResult } from "openclaw/plugin-sdk/tool-results";
4
+ import { modelFetchConfigSchema, modelFetchFilterSchema, modelFetchParameters, modelFetchResultSchema, } from "./schemas.js";
5
+ export const MODEL_FETCH_TOOL_NAME = "model_fetch";
6
+ const CONFIG_PATH = "models.providers.<providerId>.models";
7
+ const RESPONSE_LIMIT_BYTES = 2 * 1024 * 1024;
8
+ const REQUEST_TIMEOUT_MS = 30_000;
9
+ export { modelFetchConfigSchema, modelFetchFilterSchema, modelFetchParameters, modelFetchResultSchema, };
10
+ function toModelRef(providerId, modelId) {
11
+ return `${providerId}/${modelId}`;
12
+ }
13
+ function normalizeAllowList(value) {
14
+ if (!Array.isArray(value))
15
+ return [];
16
+ const normalized = [];
17
+ const seen = new Set();
18
+ for (const item of value) {
19
+ if (typeof item !== "string")
20
+ continue;
21
+ const ref = item.trim();
22
+ if (!ref || seen.has(ref))
23
+ continue;
24
+ seen.add(ref);
25
+ normalized.push(ref);
26
+ }
27
+ return normalized;
28
+ }
29
+ function normalizeAgentIds(value) {
30
+ if (!Array.isArray(value))
31
+ return [];
32
+ const normalized = [];
33
+ const seen = new Set();
34
+ for (const item of value) {
35
+ if (typeof item !== "string")
36
+ continue;
37
+ const id = item.trim();
38
+ if (!id || seen.has(id))
39
+ continue;
40
+ seen.add(id);
41
+ normalized.push(id);
42
+ }
43
+ return normalized;
44
+ }
45
+ function hasProviderScopedRule(allow, providerId) {
46
+ const prefix = `${providerId}/`;
47
+ const wildcard = `${providerId}/*`;
48
+ return allow.some((ref) => ref === wildcard || ref.startsWith(prefix));
49
+ }
50
+ function reconcileModelRefs(allowValue, providerId, modelRefs) {
51
+ if (!Array.isArray(allowValue) || allowValue.length === 0) {
52
+ return { changed: false };
53
+ }
54
+ const selectedRefs = new Set(modelRefs);
55
+ const providerPrefix = `${providerId}/`;
56
+ const next = [];
57
+ const existing = new Set();
58
+ let changed = false;
59
+ for (const item of allowValue) {
60
+ if (typeof item !== "string") {
61
+ changed = true;
62
+ continue;
63
+ }
64
+ const ref = item.trim();
65
+ if (!ref || existing.has(ref)) {
66
+ changed = true;
67
+ continue;
68
+ }
69
+ existing.add(ref);
70
+ if (ref.startsWith(providerPrefix) &&
71
+ !ref.includes("*") &&
72
+ !selectedRefs.has(ref)) {
73
+ changed = true;
74
+ continue;
75
+ }
76
+ next.push(ref);
77
+ }
78
+ for (const ref of modelRefs) {
79
+ if (existing.has(ref))
80
+ continue;
81
+ existing.add(ref);
82
+ next.push(ref);
83
+ changed = true;
84
+ }
85
+ return changed ? { changed: true, next } : { changed: false };
86
+ }
87
+ export function syncConfiguredModelPolicyAllow(draft, providerId, models, options = {}) {
88
+ const cfg = draft;
89
+ const modelRefs = models.map((model) => toModelRef(providerId, model.id));
90
+ const defaultsResult = reconcileModelRefs(cfg.agents?.defaults?.modelPolicy?.allow, providerId, modelRefs);
91
+ let defaultsUpdated = false;
92
+ if (defaultsResult.changed) {
93
+ cfg.agents ??= {};
94
+ cfg.agents.defaults ??= {};
95
+ cfg.agents.defaults.modelPolicy ??= {};
96
+ cfg.agents.defaults.modelPolicy.allow = defaultsResult.next;
97
+ defaultsUpdated = true;
98
+ }
99
+ const agentEntries = cfg.agents?.entries;
100
+ if (!agentEntries) {
101
+ return { defaultsUpdated, syncedAgents: [] };
102
+ }
103
+ const selectedAgents = normalizeAgentIds(options.targetAgents);
104
+ const forcedAgentSet = selectedAgents.length > 0 ? new Set(selectedAgents) : null;
105
+ const syncedAgents = [];
106
+ for (const [agentId, entry] of Object.entries(agentEntries)) {
107
+ if (!entry?.modelPolicy)
108
+ continue;
109
+ const normalized = normalizeAllowList(entry.modelPolicy.allow);
110
+ const shouldSync = forcedAgentSet?.has(agentId) ?? hasProviderScopedRule(normalized, providerId);
111
+ if (!shouldSync)
112
+ continue;
113
+ const result = reconcileModelRefs(entry.modelPolicy.allow, providerId, modelRefs);
114
+ const selectedWithAllowlist = forcedAgentSet?.has(agentId) === true && normalized.length > 0;
115
+ if (result.changed) {
116
+ agentEntries[agentId] = {
117
+ ...entry,
118
+ modelPolicy: {
119
+ ...entry.modelPolicy,
120
+ allow: result.next,
121
+ },
122
+ };
123
+ }
124
+ if (result.changed || selectedWithAllowlist) {
125
+ syncedAgents.push(agentId);
126
+ }
127
+ }
128
+ return { defaultsUpdated, syncedAgents };
129
+ }
130
+ export function syncAgentModelEntries(draft, providerId, models, options = {}) {
131
+ const cfg = draft;
132
+ const modelRefs = models.map((model) => toModelRef(providerId, model.id));
133
+ const selectedAgents = normalizeAgentIds(options.targetAgents);
134
+ if (selectedAgents.length === 0)
135
+ return { syncedAgents: [] };
136
+ const agentEntries = cfg.agents?.entries;
137
+ if (!agentEntries)
138
+ return { syncedAgents: [] };
139
+ const syncedAgents = [];
140
+ for (const agentId of selectedAgents) {
141
+ const entry = agentEntries[agentId];
142
+ if (!entry)
143
+ continue;
144
+ const selectedRefs = new Set(modelRefs);
145
+ const providerPrefix = `${providerId}/`;
146
+ const modelsConfig = { ...(entry.models ?? {}) };
147
+ let changed = false;
148
+ for (const ref of Object.keys(modelsConfig)) {
149
+ if (!ref.startsWith(providerPrefix) || selectedRefs.has(ref))
150
+ continue;
151
+ delete modelsConfig[ref];
152
+ changed = true;
153
+ }
154
+ for (const ref of modelRefs) {
155
+ if (modelsConfig[ref])
156
+ continue;
157
+ modelsConfig[ref] = {};
158
+ changed = true;
159
+ }
160
+ if (!changed)
161
+ continue;
162
+ agentEntries[agentId] = {
163
+ ...entry,
164
+ models: modelsConfig,
165
+ };
166
+ syncedAgents.push(agentId);
167
+ }
168
+ return { syncedAgents };
169
+ }
170
+ function isRecord(value) {
171
+ return typeof value === "object" && value !== null && !Array.isArray(value);
172
+ }
173
+ function parseFilter(value) {
174
+ if (!isRecord(value))
175
+ return {};
176
+ const filter = value.filter;
177
+ if (!isRecord(filter))
178
+ return {};
179
+ const manualIds = Array.isArray(filter.manualIds)
180
+ ? filter.manualIds.filter((id) => typeof id === "string" && id.trim().length > 0)
181
+ : undefined;
182
+ return {
183
+ includeRegex: typeof filter.includeRegex === "string" ? filter.includeRegex : undefined,
184
+ excludeRegex: typeof filter.excludeRegex === "string" ? filter.excludeRegex : undefined,
185
+ manualIds,
186
+ replace: typeof filter.replace === "boolean" ? filter.replace : undefined,
187
+ };
188
+ }
189
+ function parseTargetAgents(value) {
190
+ if (!isRecord(value))
191
+ return [];
192
+ return normalizeAgentIds(value.targetAgents);
193
+ }
194
+ export function resolveProviderFilter(providerId, runtimeConfig, factoryConfig) {
195
+ const cfg = runtimeConfig;
196
+ const runtimeEntry = cfg?.plugins?.entries?.["model-fetch"];
197
+ const runtimePluginConfig = isRecord(runtimeEntry) ? runtimeEntry.config : undefined;
198
+ const source = isRecord(runtimePluginConfig) && isRecord(runtimePluginConfig.providers)
199
+ ? runtimePluginConfig.providers
200
+ : factoryConfig?.providers;
201
+ const providerEntry = isRecord(source) ? source[providerId] : undefined;
202
+ return parseFilter(providerEntry);
203
+ }
204
+ export function resolveProviderTargetAgents(providerId, runtimeConfig, factoryConfig) {
205
+ const cfg = runtimeConfig;
206
+ const runtimeEntry = cfg?.plugins?.entries?.["model-fetch"];
207
+ const runtimePluginConfig = isRecord(runtimeEntry) ? runtimeEntry.config : undefined;
208
+ const source = isRecord(runtimePluginConfig) && isRecord(runtimePluginConfig.providers)
209
+ ? runtimePluginConfig.providers
210
+ : factoryConfig?.providers;
211
+ const providerEntry = isRecord(source) ? source[providerId] : undefined;
212
+ return parseTargetAgents(providerEntry);
213
+ }
214
+ function compileRegex(pattern, field) {
215
+ if (pattern === undefined || pattern === "")
216
+ return undefined;
217
+ try {
218
+ return new RegExp(pattern);
219
+ }
220
+ catch (error) {
221
+ const message = error instanceof Error ? error.message : String(error);
222
+ throw new Error(`Invalid ${field} regex "${pattern}": ${message}`);
223
+ }
224
+ }
225
+ export function selectFetchedModels(models, filter) {
226
+ const include = compileRegex(filter.includeRegex, "includeRegex");
227
+ const exclude = compileRegex(filter.excludeRegex, "excludeRegex");
228
+ const manualIds = new Set((filter.manualIds ?? []).map((id) => id.trim()).filter(Boolean));
229
+ const seen = new Set();
230
+ const selected = [];
231
+ for (const model of models) {
232
+ const id = model.id.trim();
233
+ if (!id || seen.has(id))
234
+ continue;
235
+ const isManual = manualIds.has(id);
236
+ const matchesInclude = include ? include.test(id) : true;
237
+ const matchesExclude = exclude ? exclude.test(id) : false;
238
+ const manualOnlySelection = include === undefined && manualIds.size > 0;
239
+ if (manualOnlySelection ? !isManual : ((!matchesInclude || matchesExclude) && !isManual)) {
240
+ continue;
241
+ }
242
+ seen.add(id);
243
+ selected.push(model);
244
+ }
245
+ return selected;
246
+ }
247
+ export function resolveEffectiveFilter(persisted, temporary) {
248
+ return {
249
+ includeRegex: temporary.includeRegex ?? persisted.includeRegex,
250
+ excludeRegex: temporary.excludeRegex ?? persisted.excludeRegex,
251
+ manualIds: temporary.manualIds ?? persisted.manualIds,
252
+ // Default to replacement mode. Persisted legacy `replace: false` should not disable
253
+ // replacement unless the current tool call explicitly asks for additive mode.
254
+ replace: temporary.replace ?? true,
255
+ };
256
+ }
257
+ export function createDefaultModel(id, name) {
258
+ return {
259
+ id,
260
+ name: name?.trim() || id,
261
+ reasoning: false,
262
+ input: ["text"],
263
+ cost: {
264
+ input: 0,
265
+ output: 0,
266
+ cacheRead: 0,
267
+ cacheWrite: 0,
268
+ },
269
+ contextWindow: 128_000,
270
+ maxTokens: 8_192,
271
+ };
272
+ }
273
+ export function mergeModels({ existing, selected, filter, }) {
274
+ const selectedById = new Map(selected.map((model) => [model.id, model]));
275
+ const manualIds = new Set((filter.manualIds ?? []).map((id) => id.trim()).filter(Boolean));
276
+ const existingById = new Map(existing.map((model) => [model.id, model]));
277
+ const next = [];
278
+ const keepExisting = (model) => {
279
+ if (!filter.replace)
280
+ return true;
281
+ return selectedById.has(model.id) || manualIds.has(model.id);
282
+ };
283
+ for (const model of existing) {
284
+ if (!keepExisting(model))
285
+ continue;
286
+ next.push(model);
287
+ }
288
+ let added = 0;
289
+ for (const model of selected) {
290
+ if (existingById.has(model.id))
291
+ continue;
292
+ next.push(model);
293
+ added += 1;
294
+ }
295
+ const selectedIds = [
296
+ ...new Set([
297
+ ...selected.map((model) => model.id),
298
+ ...[...manualIds].filter((id) => existingById.has(id)),
299
+ ]),
300
+ ];
301
+ const unchanged = selected.filter((model) => existingById.has(model.id)).length;
302
+ const removed = existing.length - next.filter((model) => existingById.has(model.id)).length;
303
+ return {
304
+ models: next,
305
+ added,
306
+ unchanged,
307
+ removed,
308
+ selectedIds,
309
+ };
310
+ }
311
+ function normalizeBaseUrl(baseUrl) {
312
+ return baseUrl.trim().replace(/\/+$/, "");
313
+ }
314
+ function joinUrl(baseUrl, path) {
315
+ return `${normalizeBaseUrl(baseUrl)}${path}`;
316
+ }
317
+ export function buildModelsEndpoint(providerId, provider) {
318
+ const api = provider.api;
319
+ const base = normalizeBaseUrl(provider.baseUrl);
320
+ if (api === "ollama") {
321
+ const ollamaBase = base.replace(/\/v1$/i, "");
322
+ return joinUrl(ollamaBase.endsWith("/api") ? ollamaBase : `${ollamaBase}/api`, "/tags");
323
+ }
324
+ if (api === "anthropic-messages") {
325
+ return joinUrl(/\/v1$/i.test(base) ? base : `${base}/v1`, "/models");
326
+ }
327
+ const isOpenRouter = providerId.toLowerCase() === "openrouter" ||
328
+ base.toLowerCase().endsWith("openrouter.ai/api/v1");
329
+ if (isOpenRouter) {
330
+ return joinUrl(base.endsWith("/api/v1") ? base : "https://openrouter.ai/api/v1", "/models");
331
+ }
332
+ return joinUrl(base.replace(/\/models$/i, ""), "/models");
333
+ }
334
+ function readNumber(value) {
335
+ return typeof value === "number" && Number.isFinite(value) && value > 0
336
+ ? Math.floor(value)
337
+ : undefined;
338
+ }
339
+ function readContextWindow(row) {
340
+ const direct = readNumber(row.context_window) ??
341
+ readNumber(row.contextWindow) ??
342
+ readNumber(row.context_length) ??
343
+ readNumber(row.contextLength);
344
+ if (direct !== undefined)
345
+ return direct;
346
+ if (isRecord(row.top_provider))
347
+ return readNumber(row.top_provider.context_length);
348
+ if (isRecord(row.details))
349
+ return readNumber(row.details.context_length);
350
+ return undefined;
351
+ }
352
+ export function mapFetchedRows(providerId, provider, rows) {
353
+ const models = [];
354
+ const seen = new Set();
355
+ const isOllama = provider.api === "ollama";
356
+ for (const row of rows) {
357
+ if (!isRecord(row))
358
+ continue;
359
+ const rawId = isOllama ? row.name : row.id;
360
+ if (typeof rawId !== "string" || !rawId.trim())
361
+ continue;
362
+ const id = rawId.trim();
363
+ if (seen.has(id))
364
+ continue;
365
+ seen.add(id);
366
+ const model = createDefaultModel(id, typeof row.name === "string" && row.name.trim()
367
+ ? row.name
368
+ : typeof row.display_name === "string"
369
+ ? row.display_name
370
+ : undefined);
371
+ const contextWindow = readContextWindow(row);
372
+ if (contextWindow !== undefined)
373
+ model.contextWindow = contextWindow;
374
+ models.push(model);
375
+ }
376
+ return models;
377
+ }
378
+ function extractRows(body, provider) {
379
+ if (!isRecord(body))
380
+ return [];
381
+ if (provider.api === "ollama")
382
+ return Array.isArray(body.models) ? body.models : [];
383
+ return Array.isArray(body.data) ? body.data : [];
384
+ }
385
+ export async function fetchProviderModels({ providerId, provider, apiKey, signal, guardedFetch = fetchWithSsrFGuard, }) {
386
+ const endpoint = buildModelsEndpoint(providerId, provider);
387
+ const headers = {
388
+ Accept: "application/json",
389
+ };
390
+ if (apiKey) {
391
+ if (provider.api === "anthropic-messages")
392
+ headers["x-api-key"] = apiKey;
393
+ else
394
+ headers.Authorization = `Bearer ${apiKey}`;
395
+ }
396
+ if (provider.api === "anthropic-messages")
397
+ headers["anthropic-version"] = "2023-06-01";
398
+ const guarded = await guardedFetch({
399
+ url: endpoint,
400
+ init: { method: "GET", headers },
401
+ timeoutMs: REQUEST_TIMEOUT_MS,
402
+ signal,
403
+ policy: ssrfPolicyFromAllowPrivateNetwork(provider.request?.allowPrivateNetwork === true),
404
+ auditContext: "model-fetch.models",
405
+ });
406
+ try {
407
+ if (!guarded.response.ok) {
408
+ const buffer = await readResponseWithLimit(guarded.response, 4096, { signal });
409
+ const snippet = buffer.toString("utf8").slice(0, 500);
410
+ throw new Error(`Model list request failed with HTTP ${guarded.response.status}: ${snippet}`);
411
+ }
412
+ const buffer = await readResponseWithLimit(guarded.response, RESPONSE_LIMIT_BYTES, { signal });
413
+ let body;
414
+ try {
415
+ body = JSON.parse(buffer.toString("utf8"));
416
+ }
417
+ catch {
418
+ throw new Error("Model list response was not valid JSON.");
419
+ }
420
+ return mapFetchedRows(providerId, provider, extractRows(body, provider));
421
+ }
422
+ finally {
423
+ await guarded.release();
424
+ }
425
+ }
426
+ export function getProvider(config, providerId) {
427
+ const cfg = config;
428
+ const provider = cfg?.models?.providers?.[providerId];
429
+ if (!provider) {
430
+ throw new Error(`Provider "${providerId}" is not configured. Add it under models.providers before fetching models.`);
431
+ }
432
+ if (typeof provider.baseUrl !== "string" || !provider.baseUrl.trim()) {
433
+ throw new Error(`Provider "${providerId}" is missing a valid models.providers baseUrl.`);
434
+ }
435
+ return provider;
436
+ }
437
+ function currentConfig(api, toolContext) {
438
+ return (toolContext?.getRuntimeConfig?.() ??
439
+ toolContext?.runtimeConfig ??
440
+ toolContext?.config ??
441
+ api.runtime.config.current());
442
+ }
443
+ export async function resolveApiKey(api, providerId, provider, config) {
444
+ if (provider.api === "ollama")
445
+ return undefined;
446
+ const runtime = api.runtime;
447
+ const resolver = runtime.modelAuth?.resolveApiKeyForProvider;
448
+ if (!resolver)
449
+ return undefined;
450
+ const auth = await resolver({ provider: providerId, cfg: config });
451
+ return auth.apiKey;
452
+ }
453
+ export async function runModelFetch({ api, toolContext, factoryConfig, fetchModels = fetchProviderModels, params, signal, }) {
454
+ const providerId = params.provider.trim();
455
+ if (!providerId)
456
+ throw new Error("Provider id is required.");
457
+ const config = currentConfig(api, toolContext);
458
+ const provider = getProvider(config, providerId);
459
+ const persistedFilter = resolveProviderFilter(providerId, config, factoryConfig);
460
+ const effectiveFilter = resolveEffectiveFilter(persistedFilter, params);
461
+ const apiKey = await resolveApiKey(api, providerId, provider, config);
462
+ const fetched = await fetchModels({
463
+ providerId,
464
+ provider,
465
+ apiKey,
466
+ signal,
467
+ });
468
+ const selected = selectFetchedModels(fetched, effectiveFilter);
469
+ const merge = mergeModels({
470
+ existing: provider.models ?? [],
471
+ selected,
472
+ filter: effectiveFilter,
473
+ });
474
+ let persisted = false;
475
+ let configPath = CONFIG_PATH;
476
+ if (!params.dryRun) {
477
+ const runtime = api.runtime;
478
+ const result = await runtime.config.mutateConfigFile({
479
+ base: "source",
480
+ afterWrite: { mode: "auto" },
481
+ mutate: (draft) => {
482
+ const cfg = draft;
483
+ cfg.models ??= {};
484
+ cfg.models.providers ??= {};
485
+ const target = cfg.models.providers[providerId] ?? { ...provider };
486
+ target.models = merge.models;
487
+ cfg.models.providers[providerId] = target;
488
+ const targetAgents = resolveProviderTargetAgents(providerId, cfg, factoryConfig);
489
+ const syncResult = syncConfiguredModelPolicyAllow(cfg, providerId, merge.models, {
490
+ targetAgents,
491
+ });
492
+ syncAgentModelEntries(cfg, providerId, merge.models, {
493
+ targetAgents: syncResult.syncedAgents,
494
+ });
495
+ },
496
+ });
497
+ configPath = result.path;
498
+ persisted = true;
499
+ }
500
+ return {
501
+ provider: providerId,
502
+ fetched: fetched.length,
503
+ selected: merge.selectedIds,
504
+ added: merge.added,
505
+ unchanged: merge.unchanged,
506
+ removed: merge.removed,
507
+ replace: effectiveFilter.replace === true,
508
+ dryRun: params.dryRun === true,
509
+ configPath,
510
+ persisted,
511
+ };
512
+ }
513
+ export function createModelFetchTool({ api, toolContext, factoryConfig, fetchModels = fetchProviderModels, }) {
514
+ return {
515
+ name: MODEL_FETCH_TOOL_NAME,
516
+ label: "Fetch Provider Models",
517
+ description: "Fetch a configured provider's model list, apply that provider's independent regex/manual selection strategy, and persist the selected models to OpenClaw config for WebUI use.",
518
+ parameters: modelFetchParameters,
519
+ resultContentSource: "network",
520
+ execute: async (_toolCallId, params, signal) => {
521
+ return jsonResult(await runModelFetch({
522
+ api,
523
+ toolContext,
524
+ factoryConfig,
525
+ fetchModels,
526
+ params,
527
+ signal,
528
+ }));
529
+ },
530
+ };
531
+ }
@@ -0,0 +1,33 @@
1
+ import type { OpenClawPluginApi } from "openclaw/plugin-sdk/core";
2
+ import { fetchProviderModels, type ModelFetchConfig } from "./model-fetch.js";
3
+ import type { ApplyStrategyInput, ApplyStrategyOutput, FetchModelsOutput, ListProvidersOutput, ModelFetchParams, PreviewApplyOutput, SaveStrategyInput, SaveStrategyOutput } from "./schemas.js";
4
+ export type ModelFetchOperations = ReturnType<typeof createModelFetchOperations>;
5
+ export declare function createModelFetchOperations({ api, factoryConfig, fetchModels, now, }: {
6
+ api: OpenClawPluginApi;
7
+ factoryConfig?: ModelFetchConfig;
8
+ fetchModels?: typeof fetchProviderModels;
9
+ now?: () => Date;
10
+ }): {
11
+ listProviders: () => Promise<ListProvidersOutput>;
12
+ fetchModels: (providerId: string) => Promise<FetchModelsOutput>;
13
+ saveStrategy: ({ provider, filter, targetAgents, }: SaveStrategyInput) => Promise<SaveStrategyOutput>;
14
+ previewApply: (provider: string) => Promise<PreviewApplyOutput>;
15
+ applyStrategy: ({ provider, fingerprint, expectedRemovals, targetAgents, }: ApplyStrategyInput) => Promise<ApplyStrategyOutput>;
16
+ refreshProvider: (params: ModelFetchParams) => Promise<{
17
+ provider: string;
18
+ fetched: number;
19
+ selected: string[];
20
+ added: number;
21
+ unchanged: number;
22
+ removed: number;
23
+ replace: boolean;
24
+ dryRun: boolean;
25
+ configPath: string;
26
+ persisted: boolean;
27
+ }>;
28
+ };
29
+ export declare function registerModelFetchOperations(api: OpenClawPluginApi, options?: {
30
+ factoryConfig?: ModelFetchConfig;
31
+ fetchModels?: typeof fetchProviderModels;
32
+ now?: () => Date;
33
+ }): ModelFetchOperations;