@mikedown/core 0.2.0 → 0.3.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.
Files changed (42) hide show
  1. package/CHANGELOG.md +8 -0
  2. package/README.md +121 -2
  3. package/dist/ai/engines-page.d.ts +130 -0
  4. package/dist/ai/engines-page.js +10 -0
  5. package/dist/ai/engines-page.js.map +1 -0
  6. package/dist/ai/index.d.ts +1531 -0
  7. package/dist/ai/index.js +395 -0
  8. package/dist/ai/index.js.map +1 -0
  9. package/dist/ai-ui-C7ENTWWU.js +3370 -0
  10. package/dist/ai-ui-C7ENTWWU.js.map +1 -0
  11. package/dist/chunk-7A5HEPLK.js +4910 -0
  12. package/dist/chunk-7A5HEPLK.js.map +1 -0
  13. package/dist/chunk-GWCRPPCX.js +18 -0
  14. package/dist/chunk-GWCRPPCX.js.map +1 -0
  15. package/dist/chunk-JZWKEBCI.js +3899 -0
  16. package/dist/chunk-JZWKEBCI.js.map +1 -0
  17. package/dist/chunk-L4FO63DF.js +113 -0
  18. package/dist/chunk-L4FO63DF.js.map +1 -0
  19. package/dist/chunk-LXZG7IKN.js +39 -0
  20. package/dist/chunk-LXZG7IKN.js.map +1 -0
  21. package/dist/chunk-QDVY7WW6.js +165 -0
  22. package/dist/chunk-QDVY7WW6.js.map +1 -0
  23. package/dist/chunk-QWKT57TR.js +62 -0
  24. package/dist/chunk-QWKT57TR.js.map +1 -0
  25. package/dist/chunk-TSP7BAV3.js +22 -0
  26. package/dist/chunk-TSP7BAV3.js.map +1 -0
  27. package/dist/index.d.ts +19 -463
  28. package/dist/index.js +6511 -1258
  29. package/dist/index.js.map +1 -1
  30. package/dist/schema-DYzxkuSb.d.ts +46 -0
  31. package/dist/shared/anchoring.js +4 -16
  32. package/dist/shared/anchoring.js.map +1 -1
  33. package/dist/shared/imagePaste.js +3 -57
  34. package/dist/shared/imagePaste.js.map +1 -1
  35. package/dist/shared/sha1.js +3 -57
  36. package/dist/shared/sha1.js.map +1 -1
  37. package/dist/shared/wordCount.js +4 -12
  38. package/dist/shared/wordCount.js.map +1 -1
  39. package/dist/styles.css +3642 -127
  40. package/dist/types-CgEeIUhi.d.ts +432 -0
  41. package/dist/types-CsVNVSNY.d.ts +597 -0
  42. package/package.json +11 -1
@@ -0,0 +1,432 @@
1
+ /**
2
+ * AI provider layer contracts: the settings shape (engines, models, routing,
3
+ * features) and the `ai` host group.
4
+ *
5
+ * Everything under `packages/core/src/ai/` is pure: no network, no DOM, no
6
+ * provider SDK. Inference runs in the host (VS Code extension host, the
7
+ * Desktop Rust side, or an npm consumer's own backend); core only resolves
8
+ * which engine and model should serve a request and renders the UI.
9
+ *
10
+ * Open-ended by design: `routing.tasks` and `features` are open maps, and the
11
+ * parser keeps keys it does not understand on every object (top level,
12
+ * engines, models, routes, feature entries), so a newer version's settings
13
+ * survive a save from an older one. Those extra keys ride along at runtime
14
+ * and are not part of these types.
15
+ */
16
+ /**
17
+ * How the host talks to an engine. `openai-compatible` covers oMLX, vLLM,
18
+ * llama.cpp server and the hosted OpenAI-style APIs (OpenRouter, Groq,
19
+ * Gemini, Mistral, DeepSeek, xAI). `vscode-lm` is a model VS Code itself
20
+ * offers (GitHub Copilot, through `vscode.lm`): no address, no key, VS Code
21
+ * host only (see `AI_HOST_ENGINE_KINDS`). A settings file written by a newer
22
+ * version may carry a kind this one does not know; such engines are kept on
23
+ * save but never routed (see `isKnownEngineKind`).
24
+ */
25
+ type AiEngineKind = 'openai-compatible' | 'lmstudio' | 'ollama' | 'anthropic' | 'openai' | 'vscode-lm';
26
+ declare const AI_ENGINE_KINDS: readonly AiEngineKind[];
27
+ /**
28
+ * Kinds only one host can run (no base URL, no key: the host's own model
29
+ * API). A host runs one only when it reports a status for the engine
30
+ * (`listEngines`); elsewhere such an engine is kept and never routed, the
31
+ * same as an unknown kind. The kind picker offers them only to an engine
32
+ * that already has one.
33
+ */
34
+ declare const AI_HOST_ENGINE_KINDS: readonly AiEngineKind[];
35
+ /** `auto` derives local or cloud from the base URL (see `detectLocality`). */
36
+ type AiLocalitySetting = 'auto' | 'local' | 'cloud';
37
+ type AiLocality = 'local' | 'cloud';
38
+ /** Where a model's capability values came from. Re-discovery refreshes `endpoint` and `heuristic`, never `user`. */
39
+ type AiCapabilitiesSource = 'endpoint' | 'heuristic' | 'user';
40
+ interface AiModelCapabilities {
41
+ /** Chat/instruct completion. */
42
+ chat: boolean;
43
+ /** SSE token streaming (assumed true unless the probe says otherwise). */
44
+ stream: boolean;
45
+ /** Image inputs. */
46
+ vision: boolean;
47
+ /** JSON mode or reliable structured output. */
48
+ json: boolean;
49
+ /** Function calling. */
50
+ tools: boolean;
51
+ /** Fill-in-the-middle / raw completion (ghost text). */
52
+ fim: boolean;
53
+ /** Embeddings endpoint. */
54
+ embed: boolean;
55
+ /** Context window in tokens; null when unknown (treated as `DEFAULT_CONTEXT_TOKENS`). */
56
+ contextTokens: number | null;
57
+ }
58
+ /** The boolean capability flags, for chips and requirement checks. */
59
+ type AiCapabilityFlag = Exclude<keyof AiModelCapabilities, 'contextTokens'>;
60
+ declare const AI_CAPABILITY_FLAGS: readonly AiCapabilityFlag[];
61
+ /** Context window assumed when neither the endpoint nor the id says (OPEN-10). */
62
+ declare const DEFAULT_CONTEXT_TOKENS = 8192;
63
+ interface AiModelConfig {
64
+ /** The id the endpoint knows the model by (sent as `model`). Unique within its engine. */
65
+ id: string;
66
+ /** Display name. Absent means show the id. */
67
+ label?: string;
68
+ enabled: boolean;
69
+ capabilities: AiModelCapabilities;
70
+ capabilitiesSource: AiCapabilitiesSource;
71
+ /**
72
+ * Merged into the request body last, so it wins (OPEN-6): thinking controls
73
+ * such as `reasoning_effort`, `thinking_budget`, `chat_template_kwargs`.
74
+ */
75
+ requestOverrides?: Record<string, unknown>;
76
+ /** The last discovery did not list this model. Kept (greyed), never routed. */
77
+ missing?: boolean;
78
+ /** Added by hand. A discovery that does not list it leaves it alone (no `missing`). */
79
+ manual?: boolean;
80
+ }
81
+ interface AiApiKeyFile {
82
+ path: string;
83
+ jsonPath: string;
84
+ }
85
+ interface AiEngineConfig {
86
+ /** Stable, generated once, never shown. */
87
+ id: string;
88
+ name: string;
89
+ kind: AiEngineKind;
90
+ /** e.g. `http://127.0.0.1:8000/v1` or `https://api.anthropic.com`. */
91
+ baseUrl: string;
92
+ enabled: boolean;
93
+ locality: AiLocalitySetting;
94
+ /** Environment variable the host reads when no key is stored. The key itself is never in settings. */
95
+ apiKeyEnv?: string;
96
+ /**
97
+ * A JSON file in the user's home folder the host reads when no key is stored and
98
+ * `apiKeyEnv` is unset. `path` may start with `~/`; `jsonPath` is a dotted path to
99
+ * a string value (`auth.api_key`). The key itself is never in settings.
100
+ */
101
+ apiKeyFile?: AiApiKeyFile;
102
+ /** `auto` lists models from the endpoint and merges them with manual ones; `manual` never asks. */
103
+ discovery: 'auto' | 'manual';
104
+ models: AiModelConfig[];
105
+ }
106
+ interface AiRoute {
107
+ engineId: string;
108
+ modelId: string;
109
+ }
110
+ /**
111
+ * What to do when a task's route is unusable. `none` disables the surface,
112
+ * `default` tries the default route, `anyLocal` then any usable local
113
+ * model, `any` then cloud engines that pass the gate.
114
+ */
115
+ type AiFallbackMode = 'none' | 'default' | 'anyLocal' | 'any';
116
+ declare const AI_FALLBACK_MODES: readonly AiFallbackMode[];
117
+ interface AiRouting {
118
+ /** Null until the user picks one. */
119
+ default: AiRoute | null;
120
+ fallback: AiFallbackMode;
121
+ /** Open map keyed by task id (see `AI_TASKS`). An absent task uses `default`. */
122
+ tasks: Record<string, AiRoute>;
123
+ }
124
+ /** One feature's saved state. Absent fields fall back to the feature registry. */
125
+ interface AiFeatureSetting {
126
+ enabled?: boolean;
127
+ /** Task override, e.g. `{ task: 'vision' }`. */
128
+ task?: string;
129
+ }
130
+ /** Open map keyed by feature id (see `AI_FEATURES`). */
131
+ type AiFeatureSettings = Record<string, AiFeatureSetting>;
132
+ /** Everything under `mikedown.ai.*`. Built by `parseAiSettings`, saved by `serializeAiSettings`. */
133
+ interface AiSettings {
134
+ /** Master switch. Default false. */
135
+ enabled: boolean;
136
+ /** Global gate for cloud engines. Default false; per-workspace consent applies on top. */
137
+ allowCloud: boolean;
138
+ engines: AiEngineConfig[];
139
+ routing: AiRouting;
140
+ features: AiFeatureSettings;
141
+ /** CIDR ranges (and `.suffix` host names) that count as local. Default RFC 1918. */
142
+ localNetworks: string[];
143
+ /** The AI button on the toolbar (hosts with AI support only). Default true. */
144
+ showToolbarButton: boolean;
145
+ }
146
+ type AiMessagePart = {
147
+ type: 'text';
148
+ text: string;
149
+ } | {
150
+ type: 'image';
151
+ mime: string;
152
+ bytes: Uint8Array;
153
+ };
154
+ interface AiMessage {
155
+ role: 'system' | 'user' | 'assistant';
156
+ content: string | AiMessagePart[];
157
+ }
158
+ interface AiCompletionRequest {
159
+ requestId: string;
160
+ /** Feature id, for logging and consent copy. */
161
+ feature: string;
162
+ /** Task id, informational for tier-1 hosts. */
163
+ task: string;
164
+ /** Resolved by core; tier-1 hosts may ignore it. */
165
+ route?: AiRoute;
166
+ messages: AiMessage[];
167
+ format?: 'text' | 'json';
168
+ maxTokens?: number;
169
+ temperature?: number;
170
+ /**
171
+ * Per-request body fields (the popover's thinking dial). The host merges
172
+ * them over the model's configured `requestOverrides`, deeply, so the
173
+ * request wins. Tier-1 hosts may ignore them.
174
+ */
175
+ requestOverrides?: Record<string, unknown>;
176
+ }
177
+ interface AiServedBy {
178
+ engineId?: string;
179
+ /** e.g. "oMLX (Mac Studio)". */
180
+ engineName: string;
181
+ modelId: string;
182
+ isLocal: boolean;
183
+ }
184
+ type AiFinishReason = 'stop' | 'length' | 'cancelled' | 'error';
185
+ interface AiUsage {
186
+ promptTokens?: number;
187
+ completionTokens?: number;
188
+ }
189
+ /**
190
+ * How long a completion took, measured by the host from sending the request.
191
+ * Optional on the wire: an older host sends none.
192
+ */
193
+ interface AiTiming {
194
+ /** To the end of the answer. */
195
+ totalMs: number;
196
+ /** To the first output, answer or reasoning. Absent when the server did not stream. */
197
+ firstTokenMs?: number;
198
+ /** Characters of output (answer plus reasoning), to estimate tokens when the engine reports no usage. */
199
+ outputChars?: number;
200
+ }
201
+ interface AiCompletionResult {
202
+ text: string;
203
+ served: AiServedBy;
204
+ usage?: AiUsage;
205
+ finishReason?: AiFinishReason;
206
+ timing?: AiTiming;
207
+ }
208
+ /** One model as the host last saw it. */
209
+ interface AiEngineStatusModel {
210
+ id: string;
211
+ label?: string;
212
+ capabilities: AiModelCapabilities;
213
+ source: AiCapabilitiesSource;
214
+ missing?: boolean;
215
+ /** Loaded in memory right now (LM Studio, Ollama report it). */
216
+ loaded?: boolean;
217
+ /** What the server says the model takes, in bytes (oMLX, LM Studio, Ollama report it). */
218
+ sizeBytes?: number;
219
+ /** The server says it is a mixture of experts (LM Studio `arch`, oMLX `config_model_type`). */
220
+ moe?: boolean;
221
+ }
222
+ /** Where a host found an engine's key: its secret store, a variable, or a key file. */
223
+ type AiKeySource = 'stored' | 'env' | 'file';
224
+ interface AiEngineStatus {
225
+ engineId: string;
226
+ /** Null = never probed. */
227
+ ok: boolean | null;
228
+ isLocal: boolean;
229
+ hasKey: boolean;
230
+ /**
231
+ * Where the key came from, when `hasKey` and the host knows: its secret store,
232
+ * the engine's `apiKeyEnv` variable, or its `apiKeyFile`. Absent for no key or
233
+ * a host that does not say (the engine form then guesses from the engine's
234
+ * settings).
235
+ */
236
+ keySource?: AiKeySource;
237
+ latencyMs?: number;
238
+ error?: string;
239
+ models: AiEngineStatusModel[];
240
+ }
241
+ /**
242
+ * One local model server as `detectLocalServers` found it: whether its preset's
243
+ * address answered, and how many models it listed when it did.
244
+ */
245
+ interface AiLocalServerProbe {
246
+ presetId: string;
247
+ baseUrl: string;
248
+ ok: boolean;
249
+ /** Models the server listed (embedding models left out where the server says which they are). */
250
+ models?: number;
251
+ latencyMs?: number;
252
+ }
253
+ /**
254
+ * A model API built into the host (VS Code's `vscode.lm`, which GitHub
255
+ * Copilot serves), as `detectHostEngines` found it. Nothing is saved.
256
+ */
257
+ interface AiHostEngineProbe {
258
+ /** The preset to add it from (`vscodelm`). */
259
+ presetId: string;
260
+ kind: AiEngineKind;
261
+ /** At least one chat model is available right now. */
262
+ ok: boolean;
263
+ /** Chat models available. */
264
+ models: number;
265
+ /** Why none is available, when the host knows (no Copilot extension, signed out). */
266
+ error?: string;
267
+ }
268
+ /**
269
+ * What a host can tell about this machine, for the setup wizard's "can it
270
+ * run models locally" hint (`recommendSetupPath`, `modelSizeHint`). A rough
271
+ * call, not a benchmark: VS Code reads no GPU at all.
272
+ */
273
+ interface AiHardwareInfo {
274
+ /** Node's `process.arch` names: `arm64`, `x64`. */
275
+ arch: string;
276
+ /** Node's `process.platform` names: `darwin`, `win32`, `linux`. */
277
+ platform: string;
278
+ totalMemoryBytes: number;
279
+ /** macOS on arm64: the GPU shares `totalMemoryBytes` (unified memory). */
280
+ appleSilicon: boolean;
281
+ /** CPU brand string, when the host read one ("Apple M2 Max"). */
282
+ cpu?: string;
283
+ /** A discrete GPU, when the host could read one (Desktop: NVIDIA through `nvidia-smi`; Apple Silicon reports `apple`). */
284
+ gpu?: {
285
+ vendor: 'nvidia' | 'amd' | 'apple' | 'other';
286
+ vramBytes?: number;
287
+ name?: string;
288
+ };
289
+ }
290
+ type AiErrorCode = 'unreachable' | 'auth' | 'modelNotFound' | 'modelLoadFailed' | 'contextOverflow' | 'rateLimited' | 'cloudBlocked' | 'consentDenied' | 'cancelled' | 'badOutput' | 'unknown';
291
+ declare const AI_ERROR_CODES: readonly AiErrorCode[];
292
+ /** What `MikeDownAiHost` methods reject with. A plain object, so it crosses postMessage and Tauri events. */
293
+ interface AiError {
294
+ code: AiErrorCode;
295
+ message: string;
296
+ /** The engine the failed request went to (or the router turned down), when known. */
297
+ engineId?: string;
298
+ }
299
+ /**
300
+ * The `ai` group on `MikeDownHost`. Absent turns every AI surface off.
301
+ *
302
+ * Tier 1 (`complete` only): core shows the master switch, feature toggles and
303
+ * the indicator from whatever `served` the host reports. Tier 2 (plus the
304
+ * registry methods): core shows the full AI tab and routes.
305
+ */
306
+ interface MikeDownAiHost {
307
+ complete(req: AiCompletionRequest, onToken: (delta: string) => void, signal: AbortSignal): Promise<AiCompletionResult>;
308
+ embed?(texts: string[], route?: AiRoute, signal?: AbortSignal): Promise<number[][]>;
309
+ transcribe?(audio: {
310
+ mime: string;
311
+ bytes: Uint8Array;
312
+ }, signal?: AbortSignal): Promise<string>;
313
+ listEngines?(): Promise<AiEngineStatus[]>;
314
+ /**
315
+ * Look for model servers on this machine at the local presets' default
316
+ * addresses (`localDetectCandidates()`), one GET each, capped at
317
+ * `AI_LOCAL_DETECT_TIMEOUT_MS`. Only on request (the first-run panel, the
318
+ * quick-start cards), never in the background. The host looks each preset
319
+ * up by id itself and sends a key (oMLX's key file) only to the preset's
320
+ * own address. One result per candidate, in order. Nothing is saved.
321
+ */
322
+ detectLocalServers?(candidates: {
323
+ presetId: string;
324
+ baseUrl: string;
325
+ }[], signal: AbortSignal): Promise<AiLocalServerProbe[]>;
326
+ /**
327
+ * Model APIs built into the host that need no address or key (VS Code:
328
+ * `vscode.lm`, GitHub Copilot's models), one result per `AI_HOST_ENGINE_KINDS`
329
+ * kind the host runs. Lists models only; sends no text. Absent: the host
330
+ * has none, and the `host` preset family stays hidden.
331
+ */
332
+ detectHostEngines?(): Promise<AiHostEngineProbe[]>;
333
+ /**
334
+ * This machine's memory, CPU and (where the host can read it) GPU, for the
335
+ * setup wizard's local hint. Static, so hosts may answer from a cache; null
336
+ * when the host cannot tell.
337
+ */
338
+ hardwareInfo?(): Promise<AiHardwareInfo | null>;
339
+ testEngine?(engineId: string): Promise<AiEngineStatus>;
340
+ discoverModels?(engineId: string): Promise<AiEngineStatus>;
341
+ /** Store (or with null, delete) an engine's key. Never part of `saveSettings`. */
342
+ setSecret?(engineId: string, apiKey: string | null): Promise<void>;
343
+ /**
344
+ * False when the host process may not see variables set in a shell profile
345
+ * (MikeDown Desktop opened from the Dock or Start menu), so `apiKeyEnv` is
346
+ * unreliable there and the engine form points at the key file or a pasted
347
+ * key instead. Absent: the host reads them (VS Code resolves the shell
348
+ * environment) or does not say.
349
+ */
350
+ readonly shellEnv?: boolean;
351
+ /**
352
+ * Host UI asking to use a cloud engine in this workspace. Absent means the
353
+ * host decides on its own. `about` names the request that asked, so the
354
+ * dialog can say what is sent (`aiConsentText`).
355
+ */
356
+ requestCloudConsent?(engineId: string, about?: AiConsentAbout): Promise<AiConsentReply>;
357
+ /**
358
+ * The cloud consents for this workspace or folder, for the Cloud consents
359
+ * list on the AI tab: the stored answers, plus this session's "Don't
360
+ * allow" (`deny`), so it can be forgotten without a restart. "Allow once"
361
+ * leaves nothing to list.
362
+ */
363
+ listConsents?(): Promise<AiConsentRecord[]>;
364
+ /** Forget the answer for an engine (stored or this session's), so the next request asks again. */
365
+ forgetConsent?(engineId: string): Promise<void>;
366
+ }
367
+ /**
368
+ * What `requestCloudConsent` resolves to: `true` allowed for the workspace
369
+ * (remembered), `'once'` allowed for this request only (the next one asks
370
+ * again), `false` declined for this request (a host may also stop asking for
371
+ * the session; it then answers `false` without a dialog), `'never'` a stored
372
+ * refusal from an older version (the host answers it without asking). A host
373
+ * that only knows allow and decline keeps returning booleans.
374
+ */
375
+ type AiConsentReply = boolean | 'once' | 'never';
376
+ /** One stored cloud consent answer (`MikeDownAiHost.listConsents`). */
377
+ interface AiConsentRecord {
378
+ engineId: string;
379
+ /** `allow` and `never` (older versions) are stored; `deny` is this session's "Don't allow". */
380
+ answer: 'allow' | 'never' | 'deny';
381
+ /** Unix milliseconds. */
382
+ at: number;
383
+ /** What the answer covers: VS Code's workspace, Desktop's folder. */
384
+ scope: 'workspace' | 'folder';
385
+ }
386
+ /**
387
+ * What a request sends to the engine, for the privacy copy (`whatIsSent`):
388
+ * the selection with its neighbouring paragraphs, the whole document, or the
389
+ * document with its frontmatter and the workspace's tag names.
390
+ */
391
+ type AiSendsScope = 'selection' | 'document' | 'documentAndTags';
392
+ /** The request behind a consent prompt. `sends` overrides the feature's own scope (whole-document Translate). */
393
+ interface AiConsentAbout {
394
+ feature?: string;
395
+ sends?: AiSendsScope;
396
+ }
397
+ /** A model as one discovery call reported it, before merging into settings. */
398
+ interface AiDiscoveredModel {
399
+ id: string;
400
+ label?: string;
401
+ /** Endpoint values; anything absent is filled from the id heuristics on merge. */
402
+ capabilities: Partial<AiModelCapabilities>;
403
+ /** `endpoint` when the server described the model, `heuristic` when only its id was listed. */
404
+ source: 'endpoint' | 'heuristic';
405
+ loaded?: boolean;
406
+ /** Bytes the model takes, as the server reports it (oMLX `estimated_size`, LM Studio `size_bytes`, Ollama `size`). */
407
+ sizeBytes?: number;
408
+ /** The server says it is a mixture of experts: an architecture name with `moe` in it (LM Studio `arch`, oMLX `config_model_type`). */
409
+ moe?: boolean;
410
+ }
411
+ /**
412
+ * Host-side adapter shape. TypeScript in the extension (`src/ai/providers/`),
413
+ * a Rust trait with the same shape on Desktop. Declared here so both hosts
414
+ * share one contract; core never implements it.
415
+ */
416
+ interface ProviderAdapter {
417
+ readonly kind: AiEngineKind;
418
+ /** Discovery plus capability detection. */
419
+ listModels(engine: AiEngineConfig, apiKey: string | null, signal: AbortSignal): Promise<AiDiscoveredModel[]>;
420
+ /** Test connection: reachability, auth, latency. */
421
+ probe(engine: AiEngineConfig, apiKey: string | null, signal: AbortSignal): Promise<{
422
+ ok: boolean;
423
+ latencyMs: number;
424
+ error?: AiError;
425
+ }>;
426
+ /** Streaming completion against one model. */
427
+ complete(engine: AiEngineConfig, apiKey: string | null, model: AiModelConfig, req: AiCompletionRequest, onToken: (delta: string) => void, signal: AbortSignal): Promise<AiCompletionResult>;
428
+ embed?(engine: AiEngineConfig, apiKey: string | null, model: AiModelConfig, texts: string[], signal: AbortSignal): Promise<number[][]>;
429
+ }
430
+
431
+ export { AI_HOST_ENGINE_KINDS as B, DEFAULT_CONTEXT_TOKENS as Q, AI_CAPABILITY_FLAGS as w, AI_ENGINE_KINDS as x, AI_ERROR_CODES as y, AI_FALLBACK_MODES as z };
432
+ export type { AiSettings as A, AiCapabilitiesSource as C, AiConsentAbout as D, AiConsentReply as E, AiEngineStatusModel as F, AiFallbackMode as G, AiFeatureSetting as H, AiKeySource as I, AiLocalitySetting as J, AiMessagePart as K, AiRoute as L, MikeDownAiHost as M, AiRouting as N, AiServedBy as O, AiTiming as P, ProviderAdapter as R, AiEngineStatus as a, AiModelCapabilities as b, AiCapabilityFlag as c, AiSendsScope as d, AiFeatureSettings as e, AiLocality as f, AiEngineConfig as g, AiEngineKind as h, AiModelConfig as i, AiDiscoveredModel as j, AiApiKeyFile as k, AiFinishReason as l, AiUsage as m, AiErrorCode as n, AiCompletionResult as o, AiCompletionRequest as p, AiMessage as q, AiError as r, AiConsentRecord as s, AiLocalServerProbe as t, AiHardwareInfo as u, AiHostEngineProbe as v };