@quilltap/plugin-types 2.5.7 → 2.6.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/CHANGELOG.md +15 -0
- package/dist/{index-CQ7ywmZs.d.mts → index-BhR1AYGC.d.mts} +144 -11
- package/dist/{index-BWH34znL.d.mts → index-j7yKh7Ue.d.mts} +46 -1
- package/dist/{index-BWH34znL.d.ts → index-j7yKh7Ue.d.ts} +46 -1
- package/dist/{index-AfZh6up3.d.ts → index-jf_ehLA9.d.ts} +144 -11
- package/dist/index.d.mts +4 -4
- package/dist/index.d.ts +4 -4
- package/dist/index.js +1 -1
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +1 -1
- package/dist/index.mjs.map +1 -1
- package/dist/llm/index.d.mts +1 -1
- package/dist/llm/index.d.ts +1 -1
- package/dist/plugins/index.d.mts +2 -2
- package/dist/plugins/index.d.ts +2 -2
- package/dist/providers/index.d.mts +1 -1
- package/dist/providers/index.d.ts +1 -1
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -5,6 +5,21 @@ All notable changes to this project will be documented in this file.
|
|
|
5
5
|
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
|
|
6
6
|
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
|
7
7
|
|
|
8
|
+
## [2.6.0] - 2026-08-29
|
|
9
|
+
|
|
10
|
+
### Added
|
|
11
|
+
|
|
12
|
+
- `ImageLoraSpec` — the provider-neutral shape for one LoRA adapter (`source`, optional `scale`, `triggerPhrase`, `label`). The host stores and edits this shape; each plugin translates it into its own wire dialect (NanoGPT's indexed `lora_url_N`/`lora_scale_N` pairs, fal's `loras: [{path, scale}]`, a ComfyUI `LoraLoader` chain, a `<lora:name:weight>` prompt tag).
|
|
13
|
+
- `ImageLoraSupport` — the capability declaration (`maxLoras`, optional `scale` bounds, `sourceKinds`, `supportsPrivateWeightsToken`). Declaring it is the whole opt-in: the host then shows the LoRA editor, caps the list, and passes it through. It is readable per-model on `ImageGenerationModelInfo.loraSupport` and provider-wide on `ImageProviderConstraints.loraSupport`, resolved exact id → longest-prefix family → provider → none, mirroring `orientationSupport`.
|
|
14
|
+
- `ImageGenParams.loras?: ImageLoraSpec[]` — the canonical adapter list, already capped by the host. A plugin that declares no `loraSupport` never receives the key, so no existing plugin changes behaviour.
|
|
15
|
+
- `ImageGenParams.profileParameters?: Record<string, unknown>` — the image profile's residual parameters bag, mirroring `LLMParams.profileParameters`. The plugin decides which keys reach the wire, so per-model options (`num_inference_steps`, `guidance_scale`, `hf_api_token`, …) travel without the host enumerating them.
|
|
16
|
+
- `getImageProviderOptionsSchema?` optional method on `TextProviderPlugin` — the sibling of `getProviderOptionsSchema` for the *image*-profile editor, sharing the same `ProviderOptionsSchema` type and renderer. Unlike the text hook, `context.modelName` is authoritative here: image gateways legitimately return a different schema per model, and the host refetches on every model change.
|
|
17
|
+
|
|
18
|
+
### Changed
|
|
19
|
+
|
|
20
|
+
- `ProviderOptionField.appliesToModels` is no longer reserved — the host renderer now honours it, gating a field to the listed model ids (exact match, `*` glob, or longest-prefix family). Renderers that ignore it still render unconditionally, so the field remains backwards-compatible.
|
|
21
|
+
- `PLUGIN_TYPES_VERSION` re-synced to the package version.
|
|
22
|
+
|
|
8
23
|
## [2.5.7] - 2026-08-19
|
|
9
24
|
|
|
10
25
|
### Added
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { T as TextProvider, e as ImageProvider, b as EmbeddingProvider,
|
|
1
|
+
import { T as TextProvider, e as ImageProvider, b as EmbeddingProvider, k as LocalEmbeddingProvider, r as ToolFormatOptions, q as ToolCallRequest } from './index-j7yKh7Ue.mjs';
|
|
2
2
|
import { ScoringProvider } from './providers/index.mjs';
|
|
3
3
|
|
|
4
4
|
/**
|
|
@@ -90,12 +90,14 @@ interface ProviderOptionField {
|
|
|
90
90
|
*/
|
|
91
91
|
affects?: ProviderOptionDirective;
|
|
92
92
|
/**
|
|
93
|
-
*
|
|
94
|
-
*
|
|
95
|
-
*
|
|
96
|
-
*
|
|
93
|
+
* Restrict this field to a subset of models: a list of matchers, each an
|
|
94
|
+
* exact model id, a `*` glob (`flux-2-*`), or a family prefix (the longest
|
|
95
|
+
* matching prefix wins, so `flux-lora` also covers `flux-lora/inpainting`).
|
|
96
|
+
* The field renders when *any* matcher hits, and unconditionally when the
|
|
97
|
+
* list is omitted or the host does not know the selected model.
|
|
97
98
|
*
|
|
98
|
-
*
|
|
99
|
+
* Renderers that don't understand this field render unconditionally, so
|
|
100
|
+
* declaring it never breaks an older host.
|
|
99
101
|
*/
|
|
100
102
|
appliesToModels?: string[];
|
|
101
103
|
}
|
|
@@ -119,10 +121,14 @@ interface ProviderOptionsSchema {
|
|
|
119
121
|
groups: ProviderOptionGroup[];
|
|
120
122
|
}
|
|
121
123
|
/**
|
|
122
|
-
* Options passed to `getProviderOptionsSchema
|
|
123
|
-
*
|
|
124
|
-
*
|
|
125
|
-
*
|
|
124
|
+
* Options passed to `getProviderOptionsSchema` and
|
|
125
|
+
* `getImageProviderOptionsSchema`.
|
|
126
|
+
*
|
|
127
|
+
* The text hook's renderer still does not pass `modelName`, so text plugins
|
|
128
|
+
* should treat it as advisory and return the same schema regardless. The
|
|
129
|
+
* *image* hook does pass it, and refetches whenever the selected model
|
|
130
|
+
* changes — image gateways routing to hundreds of models legitimately answer
|
|
131
|
+
* differently per model.
|
|
126
132
|
*/
|
|
127
133
|
interface ProviderOptionsSchemaContext {
|
|
128
134
|
modelName?: string;
|
|
@@ -303,6 +309,23 @@ interface ModelInfo {
|
|
|
303
309
|
supportsImages?: boolean;
|
|
304
310
|
/** Whether this model supports tool/function calling */
|
|
305
311
|
supportsTools?: boolean;
|
|
312
|
+
/**
|
|
313
|
+
* Whether this model is capable of a reasoning ("thinking") turn at all.
|
|
314
|
+
*
|
|
315
|
+
* Distinct from `thinksByDefault`: a model may be capable of thinking yet
|
|
316
|
+
* only do so when the profile asks for it.
|
|
317
|
+
*/
|
|
318
|
+
supportsThinking?: boolean;
|
|
319
|
+
/**
|
|
320
|
+
* Whether this model runs a thinking turn **without being asked** — i.e.
|
|
321
|
+
* with no thinking option set on the connection profile.
|
|
322
|
+
*
|
|
323
|
+
* The two facts are separate because providers differ: DeepSeek's V4 tier
|
|
324
|
+
* reasons out of the box, while Anthropic's extended thinking and Ollama's
|
|
325
|
+
* thinking channel are opt-in per profile. The host uses this as the
|
|
326
|
+
* fallback answer when the profile sets no thinking option of its own.
|
|
327
|
+
*/
|
|
328
|
+
thinksByDefault?: boolean;
|
|
306
329
|
/** Description of the model */
|
|
307
330
|
description?: string;
|
|
308
331
|
/** Pricing information */
|
|
@@ -313,6 +336,37 @@ interface ModelInfo {
|
|
|
313
336
|
output: number;
|
|
314
337
|
};
|
|
315
338
|
}
|
|
339
|
+
/**
|
|
340
|
+
* How the host can tell whether a connection profile on this provider will
|
|
341
|
+
* run a reasoning ("thinking") turn.
|
|
342
|
+
*
|
|
343
|
+
* Thinking changes what a request may look like. Two providers are already on
|
|
344
|
+
* record refusing an assistant `[Name]` prefill *only* while thinking: Ollama
|
|
345
|
+
* never opens the reasoning block behind a prefilled turn, and DeepSeek 400s
|
|
346
|
+
* on continuing a thinking turn whose `reasoning_content` it never saw. The
|
|
347
|
+
* host needs a per-profile answer to seed the right multi-character turn
|
|
348
|
+
* anchor, and only the plugin knows which option key it reads.
|
|
349
|
+
*
|
|
350
|
+
* Deliberately declarative rather than a predicate function: the same answer
|
|
351
|
+
* is needed in the connection-profile editor, which runs in the browser and
|
|
352
|
+
* cannot call into a server-side plugin. A rule serialises; a closure does
|
|
353
|
+
* not.
|
|
354
|
+
*
|
|
355
|
+
* The rule answers only the *explicit* half — "has this profile switched
|
|
356
|
+
* thinking on or off?". When the profile says nothing, the host falls back to
|
|
357
|
+
* the selected model's `thinksByDefault` flag.
|
|
358
|
+
*/
|
|
359
|
+
interface ThinkingTurnRule {
|
|
360
|
+
/**
|
|
361
|
+
* The `parameters` key on the connection profile that switches thinking on
|
|
362
|
+
* or off. Must match a field key from `getProviderOptionsSchema()`.
|
|
363
|
+
*/
|
|
364
|
+
optionKey: string;
|
|
365
|
+
/** Values of that key meaning thinking is ON. */
|
|
366
|
+
enabledValues?: (string | number | boolean)[];
|
|
367
|
+
/** Values of that key meaning thinking is OFF. */
|
|
368
|
+
disabledValues?: (string | number | boolean)[];
|
|
369
|
+
}
|
|
316
370
|
/**
|
|
317
371
|
* Information about an embedding model
|
|
318
372
|
*/
|
|
@@ -364,6 +418,38 @@ interface ImageOrientationSupport {
|
|
|
364
418
|
landscape: OrientationMapping;
|
|
365
419
|
square?: OrientationMapping;
|
|
366
420
|
}
|
|
421
|
+
/**
|
|
422
|
+
* What a provider (or one of its models) can do with LoRA adapters.
|
|
423
|
+
*
|
|
424
|
+
* Declaring this is the whole opt-in: the host shows the LoRA editor, stores
|
|
425
|
+
* the list on the profile, caps it, and hands it to `generateImage` as
|
|
426
|
+
* `ImageGenParams.loras`. A plugin that declares nothing never sees the key,
|
|
427
|
+
* so adding LoRA support to one provider costs every other provider zero
|
|
428
|
+
* lines.
|
|
429
|
+
*/
|
|
430
|
+
interface ImageLoraSupport {
|
|
431
|
+
/** How many adapters this model accepts in one request. */
|
|
432
|
+
maxLoras: number;
|
|
433
|
+
/**
|
|
434
|
+
* Bounds for `ImageLoraSpec.scale`, used by the editor's slider. Omitted
|
|
435
|
+
* means the host offers a permissive 0–2 range and the provider's own
|
|
436
|
+
* default applies when the user leaves it alone.
|
|
437
|
+
*/
|
|
438
|
+
scale?: {
|
|
439
|
+
min: number;
|
|
440
|
+
max: number;
|
|
441
|
+
default: number;
|
|
442
|
+
step?: number;
|
|
443
|
+
};
|
|
444
|
+
/** What the plugin accepts in `ImageLoraSpec.source`. */
|
|
445
|
+
sourceKinds: Array<'url' | 'hf-repo' | 'provider-id'>;
|
|
446
|
+
/**
|
|
447
|
+
* Whether this model can take a token for private or gated weights (e.g.
|
|
448
|
+
* NanoGPT's pruna family and its `hf_api_token`). The token itself travels
|
|
449
|
+
* as an ordinary options-schema field in `profileParameters`, not here.
|
|
450
|
+
*/
|
|
451
|
+
supportsPrivateWeightsToken?: boolean;
|
|
452
|
+
}
|
|
367
453
|
/**
|
|
368
454
|
* Information about an image generation model
|
|
369
455
|
*/
|
|
@@ -383,6 +469,12 @@ interface ImageGenerationModelInfo {
|
|
|
383
469
|
* Required for providers (OpenAI, Z.AI) whose legal sizes differ by model.
|
|
384
470
|
*/
|
|
385
471
|
orientationSupport?: ImageOrientationSupport;
|
|
472
|
+
/**
|
|
473
|
+
* Per-model LoRA support, overriding any provider-level default. Resolution
|
|
474
|
+
* mirrors orientation: exact id, then longest-prefix family match, then the
|
|
475
|
+
* provider-level `ImageProviderConstraints.loraSupport`, then none.
|
|
476
|
+
*/
|
|
477
|
+
loraSupport?: ImageLoraSupport;
|
|
386
478
|
}
|
|
387
479
|
/**
|
|
388
480
|
* Information about a style or LoRA available for an image provider
|
|
@@ -436,6 +528,14 @@ interface ImageProviderConstraints {
|
|
|
436
528
|
* (e.g. Grok, Z.AI).
|
|
437
529
|
*/
|
|
438
530
|
orientationSupport?: ImageOrientationSupport;
|
|
531
|
+
/**
|
|
532
|
+
* Default LoRA support when no per-model override applies. Declare it only
|
|
533
|
+
* for providers where *every* image model takes adapters — otherwise leave
|
|
534
|
+
* it off and put `loraSupport` on the individual
|
|
535
|
+
* `ImageGenerationModelInfo` entries, so models that can't take a LoRA
|
|
536
|
+
* never offer the editor.
|
|
537
|
+
*/
|
|
538
|
+
loraSupport?: ImageLoraSupport;
|
|
439
539
|
}
|
|
440
540
|
/**
|
|
441
541
|
* Icon component props
|
|
@@ -668,6 +768,15 @@ interface TextProviderPlugin {
|
|
|
668
768
|
* Falls back to 8192 if not specified
|
|
669
769
|
*/
|
|
670
770
|
defaultContextWindow?: number;
|
|
771
|
+
/**
|
|
772
|
+
* How to tell whether a profile on this provider will run a thinking turn
|
|
773
|
+
* (optional).
|
|
774
|
+
*
|
|
775
|
+
* Omit it and the host judges by the selected model's `thinksByDefault`
|
|
776
|
+
* flag alone. Declare it when the provider has a profile option that turns
|
|
777
|
+
* reasoning on or off, so an explicit choice outranks the model default.
|
|
778
|
+
*/
|
|
779
|
+
thinkingTurnRule?: ThinkingTurnRule;
|
|
671
780
|
/**
|
|
672
781
|
* Describe provider-specific configuration fields the connection-profile
|
|
673
782
|
* editor should render (optional).
|
|
@@ -684,6 +793,30 @@ interface TextProviderPlugin {
|
|
|
684
793
|
* @returns A schema, or undefined when this provider has no extra options
|
|
685
794
|
*/
|
|
686
795
|
getProviderOptionsSchema?: (context?: ProviderOptionsSchemaContext) => ProviderOptionsSchema | undefined;
|
|
796
|
+
/**
|
|
797
|
+
* Describe provider-specific fields the *image*-profile editor should
|
|
798
|
+
* render (optional). The sibling of `getProviderOptionsSchema`, sharing its
|
|
799
|
+
* schema type and its renderer — the difference is only which profile's
|
|
800
|
+
* `parameters` bag the values land in.
|
|
801
|
+
*
|
|
802
|
+
* Field keys must match what the plugin reads off
|
|
803
|
+
* `ImageGenParams.profileParameters` at call time, with two exceptions the
|
|
804
|
+
* host owns outright: `size` and `aspectRatio` keep their existing storage
|
|
805
|
+
* keys so profiles written by the old hand-rolled panel keep working.
|
|
806
|
+
*
|
|
807
|
+
* Unlike the text hook, `context.modelName` here is *not* advisory: image
|
|
808
|
+
* providers routing to hundreds of models legitimately return a different
|
|
809
|
+
* schema per model (different legal sizes, different `n` ceiling), and the
|
|
810
|
+
* host refetches whenever the selected model changes.
|
|
811
|
+
*
|
|
812
|
+
* LoRA adapters are deliberately not options-schema fields — they are a
|
|
813
|
+
* structured repeating pair with their own editor, declared through
|
|
814
|
+
* `ImageLoraSupport`.
|
|
815
|
+
*
|
|
816
|
+
* @param context Optional render context (the selected model, etc.)
|
|
817
|
+
* @returns A schema, or undefined when this provider has no extra options
|
|
818
|
+
*/
|
|
819
|
+
getImageProviderOptionsSchema?: (context?: ProviderOptionsSchemaContext) => ProviderOptionsSchema | undefined;
|
|
687
820
|
}
|
|
688
821
|
/**
|
|
689
822
|
* @deprecated Use `TextProviderPlugin` instead. This alias is kept for backward compatibility.
|
|
@@ -1667,4 +1800,4 @@ interface ModerationProviderPluginExport {
|
|
|
1667
1800
|
moderationPlugin: ModerationProviderPlugin;
|
|
1668
1801
|
}
|
|
1669
1802
|
|
|
1670
|
-
export type {
|
|
1803
|
+
export type { SearchProviderMetadata as $, AttachmentSupport as A, ProviderConfigRequirements as B, CheapModelConfig as C, ProviderMetadata as D, Effects as E, FontDefinition as F, ProviderOptionDirective as G, ProviderOptionEnumValue as H, IconProps as I, ProviderOptionField as J, ProviderOptionFieldType as K, LLMProviderPlugin as L, MessageFormatSupport as M, ProviderOptionGroup as N, OrientationMapping as O, PluginAuthor as P, ProviderOptionShowIf as Q, ProviderOptionsSchema as R, ProviderOptionsSchemaContext as S, ProviderPluginExport as T, ScoringProviderConfigRequirements as U, ScoringProviderMetadata as V, ScoringProviderPlugin as W, ScoringProviderPluginExport as X, SearchOutput as Y, SearchProviderConfig as Z, SearchProviderConfigRequirements as _, ColorPalette as a, SearchProviderPlugin as a0, SearchProviderPluginExport as a1, SearchResult as a2, Spacing as a3, SubsystemOverrides as a4, TextProviderPlugin as a5, ThemeMetadata as a6, ThemePlugin as a7, ThemePluginExport as a8, ThemeTokens as a9, ThinkingTurnRule as aa, ToolFormatType as ab, Typography as ac, ModerationProviderConfig as ad, EmbeddedFont as b, EmbeddingModelInfo as c, ImageGenerationModelInfo as d, ImageLoraSupport as e, ImageOrientationSupport as f, ImageProviderConstraints as g, ImageStyleInfo as h, InstalledPluginInfo as i, ModelInfo as j, ModerationCategoryResult as k, ModerationProviderConfigRequirements as l, ModerationProviderMetadata as m, ModerationProviderPlugin as n, ModerationProviderPluginExport as o, ModerationResult as p, OrientationStrategy as q, PluginCapability as r, PluginCategory as s, PluginCompatibility as t, PluginIconData as u, PluginManifest as v, PluginPermissions as w, PluginStatus as x, ProviderCapabilities as y, ProviderConfig as z };
|
|
@@ -479,6 +479,35 @@ interface TextProvider {
|
|
|
479
479
|
* orientation-gating design.
|
|
480
480
|
*/
|
|
481
481
|
type ImageOrientation = 'portrait' | 'landscape' | 'square';
|
|
482
|
+
/**
|
|
483
|
+
* One LoRA (low-rank adaptation) adapter riding an image request.
|
|
484
|
+
*
|
|
485
|
+
* Provider-neutral by design: the host stores and edits this shape, and each
|
|
486
|
+
* plugin translates it into whatever its own API calls the same idea —
|
|
487
|
+
* NanoGPT's indexed `lora_url_N`/`lora_scale_N` pairs, fal's
|
|
488
|
+
* `loras: [{path, scale}]` array, a ComfyUI `LoraLoader` chain, or a
|
|
489
|
+
* `<lora:name:weight>` prompt tag. A plugin that declares no
|
|
490
|
+
* {@link ImageLoraSupport} never receives this shape at all.
|
|
491
|
+
*/
|
|
492
|
+
interface ImageLoraSpec {
|
|
493
|
+
/**
|
|
494
|
+
* URL to weights (typically `.safetensors`), an `owner/repo` reference, or
|
|
495
|
+
* a provider-scoped identifier — the plugin decides what it accepts, and
|
|
496
|
+
* says so through `ImageLoraSupport.sourceKinds`.
|
|
497
|
+
*/
|
|
498
|
+
source: string;
|
|
499
|
+
/** Strength/scale. Omitted means "the provider's own default". */
|
|
500
|
+
scale?: number;
|
|
501
|
+
/**
|
|
502
|
+
* Optional trigger phrase injected into the prompt when this LoRA rides a
|
|
503
|
+
* request. Reuses the host's existing style-trigger-phrase plumbing, so a
|
|
504
|
+
* LoRA that needs its magic word gets it without the plugin touching the
|
|
505
|
+
* prompt.
|
|
506
|
+
*/
|
|
507
|
+
triggerPhrase?: string;
|
|
508
|
+
/** Display label for the editor UI; never sent on the wire. */
|
|
509
|
+
label?: string;
|
|
510
|
+
}
|
|
482
511
|
/**
|
|
483
512
|
* Image generation parameters
|
|
484
513
|
*/
|
|
@@ -513,6 +542,22 @@ interface ImageGenParams {
|
|
|
513
542
|
guidanceScale?: number;
|
|
514
543
|
/** Inference steps for diffusion models */
|
|
515
544
|
steps?: number;
|
|
545
|
+
/**
|
|
546
|
+
* LoRA adapters to apply, in the order the user arranged them. The host only
|
|
547
|
+
* sets this for providers that declared `loraSupport` for the selected
|
|
548
|
+
* model, and has already capped the list at the declared `maxLoras`; a
|
|
549
|
+
* plugin that declares nothing never sees the key.
|
|
550
|
+
*/
|
|
551
|
+
loras?: ImageLoraSpec[];
|
|
552
|
+
/**
|
|
553
|
+
* The profile's residual `parameters` bag, minus the keys the host owns
|
|
554
|
+
* (`size`, `quality`, `loras`, …). Mirrors `LLMParams.profileParameters`:
|
|
555
|
+
* the plugin — not the host — decides which of these keys reach the wire,
|
|
556
|
+
* so schema-driven per-model options (`num_inference_steps`,
|
|
557
|
+
* `guidance_scale`, `hf_api_token`, …) travel without the host enumerating
|
|
558
|
+
* them.
|
|
559
|
+
*/
|
|
560
|
+
profileParameters?: Record<string, unknown>;
|
|
516
561
|
}
|
|
517
562
|
/**
|
|
518
563
|
* Generated image result
|
|
@@ -726,4 +771,4 @@ interface LocalEmbeddingProvider extends Omit<EmbeddingProvider, 'generateEmbedd
|
|
|
726
771
|
*/
|
|
727
772
|
declare function isLocalEmbeddingProvider(provider: EmbeddingProvider | LocalEmbeddingProvider): provider is LocalEmbeddingProvider;
|
|
728
773
|
|
|
729
|
-
export { type AnthropicToolDefinition as A, type CacheUsage as C, type EmbeddingOptions as E, type FileAttachment as F, type GeneratedImage as G, type ImageGenParams as I, type JSONSchemaDefinition as J, type LLMMessage as L, type ModelMetadata as M, type OpenAIToolDefinition as O, type ResponseFormat as R, type StreamChunk as S, type TextProvider as T, type UniversalTool as U, type AttachmentResults as a, type EmbeddingProvider as b, type EmbeddingResult as c, type GoogleToolDefinition as d, type ImageProvider as e, type ImageGenResponse as f, type
|
|
774
|
+
export { type AnthropicToolDefinition as A, type CacheUsage as C, type EmbeddingOptions as E, type FileAttachment as F, type GeneratedImage as G, type ImageGenParams as I, type JSONSchemaDefinition as J, type LLMMessage as L, type ModelMetadata as M, type OpenAIToolDefinition as O, type ResponseFormat as R, type StreamChunk as S, type TextProvider as T, type UniversalTool as U, type AttachmentResults as a, type EmbeddingProvider as b, type EmbeddingResult as c, type GoogleToolDefinition as d, type ImageProvider as e, type ImageGenResponse as f, type ImageLoraSpec as g, type ImageOrientation as h, type LLMParams as i, type LLMResponse as j, type LocalEmbeddingProvider as k, type LocalEmbeddingProviderState as l, type ModelWarning as m, type ModelWarningLevel as n, type TokenUsage as o, type ToolCall as p, type ToolCallRequest as q, type ToolFormatOptions as r, type ToolResult as s, isLocalEmbeddingProvider as t };
|
|
@@ -479,6 +479,35 @@ interface TextProvider {
|
|
|
479
479
|
* orientation-gating design.
|
|
480
480
|
*/
|
|
481
481
|
type ImageOrientation = 'portrait' | 'landscape' | 'square';
|
|
482
|
+
/**
|
|
483
|
+
* One LoRA (low-rank adaptation) adapter riding an image request.
|
|
484
|
+
*
|
|
485
|
+
* Provider-neutral by design: the host stores and edits this shape, and each
|
|
486
|
+
* plugin translates it into whatever its own API calls the same idea —
|
|
487
|
+
* NanoGPT's indexed `lora_url_N`/`lora_scale_N` pairs, fal's
|
|
488
|
+
* `loras: [{path, scale}]` array, a ComfyUI `LoraLoader` chain, or a
|
|
489
|
+
* `<lora:name:weight>` prompt tag. A plugin that declares no
|
|
490
|
+
* {@link ImageLoraSupport} never receives this shape at all.
|
|
491
|
+
*/
|
|
492
|
+
interface ImageLoraSpec {
|
|
493
|
+
/**
|
|
494
|
+
* URL to weights (typically `.safetensors`), an `owner/repo` reference, or
|
|
495
|
+
* a provider-scoped identifier — the plugin decides what it accepts, and
|
|
496
|
+
* says so through `ImageLoraSupport.sourceKinds`.
|
|
497
|
+
*/
|
|
498
|
+
source: string;
|
|
499
|
+
/** Strength/scale. Omitted means "the provider's own default". */
|
|
500
|
+
scale?: number;
|
|
501
|
+
/**
|
|
502
|
+
* Optional trigger phrase injected into the prompt when this LoRA rides a
|
|
503
|
+
* request. Reuses the host's existing style-trigger-phrase plumbing, so a
|
|
504
|
+
* LoRA that needs its magic word gets it without the plugin touching the
|
|
505
|
+
* prompt.
|
|
506
|
+
*/
|
|
507
|
+
triggerPhrase?: string;
|
|
508
|
+
/** Display label for the editor UI; never sent on the wire. */
|
|
509
|
+
label?: string;
|
|
510
|
+
}
|
|
482
511
|
/**
|
|
483
512
|
* Image generation parameters
|
|
484
513
|
*/
|
|
@@ -513,6 +542,22 @@ interface ImageGenParams {
|
|
|
513
542
|
guidanceScale?: number;
|
|
514
543
|
/** Inference steps for diffusion models */
|
|
515
544
|
steps?: number;
|
|
545
|
+
/**
|
|
546
|
+
* LoRA adapters to apply, in the order the user arranged them. The host only
|
|
547
|
+
* sets this for providers that declared `loraSupport` for the selected
|
|
548
|
+
* model, and has already capped the list at the declared `maxLoras`; a
|
|
549
|
+
* plugin that declares nothing never sees the key.
|
|
550
|
+
*/
|
|
551
|
+
loras?: ImageLoraSpec[];
|
|
552
|
+
/**
|
|
553
|
+
* The profile's residual `parameters` bag, minus the keys the host owns
|
|
554
|
+
* (`size`, `quality`, `loras`, …). Mirrors `LLMParams.profileParameters`:
|
|
555
|
+
* the plugin — not the host — decides which of these keys reach the wire,
|
|
556
|
+
* so schema-driven per-model options (`num_inference_steps`,
|
|
557
|
+
* `guidance_scale`, `hf_api_token`, …) travel without the host enumerating
|
|
558
|
+
* them.
|
|
559
|
+
*/
|
|
560
|
+
profileParameters?: Record<string, unknown>;
|
|
516
561
|
}
|
|
517
562
|
/**
|
|
518
563
|
* Generated image result
|
|
@@ -726,4 +771,4 @@ interface LocalEmbeddingProvider extends Omit<EmbeddingProvider, 'generateEmbedd
|
|
|
726
771
|
*/
|
|
727
772
|
declare function isLocalEmbeddingProvider(provider: EmbeddingProvider | LocalEmbeddingProvider): provider is LocalEmbeddingProvider;
|
|
728
773
|
|
|
729
|
-
export { type AnthropicToolDefinition as A, type CacheUsage as C, type EmbeddingOptions as E, type FileAttachment as F, type GeneratedImage as G, type ImageGenParams as I, type JSONSchemaDefinition as J, type LLMMessage as L, type ModelMetadata as M, type OpenAIToolDefinition as O, type ResponseFormat as R, type StreamChunk as S, type TextProvider as T, type UniversalTool as U, type AttachmentResults as a, type EmbeddingProvider as b, type EmbeddingResult as c, type GoogleToolDefinition as d, type ImageProvider as e, type ImageGenResponse as f, type
|
|
774
|
+
export { type AnthropicToolDefinition as A, type CacheUsage as C, type EmbeddingOptions as E, type FileAttachment as F, type GeneratedImage as G, type ImageGenParams as I, type JSONSchemaDefinition as J, type LLMMessage as L, type ModelMetadata as M, type OpenAIToolDefinition as O, type ResponseFormat as R, type StreamChunk as S, type TextProvider as T, type UniversalTool as U, type AttachmentResults as a, type EmbeddingProvider as b, type EmbeddingResult as c, type GoogleToolDefinition as d, type ImageProvider as e, type ImageGenResponse as f, type ImageLoraSpec as g, type ImageOrientation as h, type LLMParams as i, type LLMResponse as j, type LocalEmbeddingProvider as k, type LocalEmbeddingProviderState as l, type ModelWarning as m, type ModelWarningLevel as n, type TokenUsage as o, type ToolCall as p, type ToolCallRequest as q, type ToolFormatOptions as r, type ToolResult as s, isLocalEmbeddingProvider as t };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { T as TextProvider, e as ImageProvider, b as EmbeddingProvider,
|
|
1
|
+
import { T as TextProvider, e as ImageProvider, b as EmbeddingProvider, k as LocalEmbeddingProvider, r as ToolFormatOptions, q as ToolCallRequest } from './index-j7yKh7Ue.js';
|
|
2
2
|
import { ScoringProvider } from './providers/index.js';
|
|
3
3
|
|
|
4
4
|
/**
|
|
@@ -90,12 +90,14 @@ interface ProviderOptionField {
|
|
|
90
90
|
*/
|
|
91
91
|
affects?: ProviderOptionDirective;
|
|
92
92
|
/**
|
|
93
|
-
*
|
|
94
|
-
*
|
|
95
|
-
*
|
|
96
|
-
*
|
|
93
|
+
* Restrict this field to a subset of models: a list of matchers, each an
|
|
94
|
+
* exact model id, a `*` glob (`flux-2-*`), or a family prefix (the longest
|
|
95
|
+
* matching prefix wins, so `flux-lora` also covers `flux-lora/inpainting`).
|
|
96
|
+
* The field renders when *any* matcher hits, and unconditionally when the
|
|
97
|
+
* list is omitted or the host does not know the selected model.
|
|
97
98
|
*
|
|
98
|
-
*
|
|
99
|
+
* Renderers that don't understand this field render unconditionally, so
|
|
100
|
+
* declaring it never breaks an older host.
|
|
99
101
|
*/
|
|
100
102
|
appliesToModels?: string[];
|
|
101
103
|
}
|
|
@@ -119,10 +121,14 @@ interface ProviderOptionsSchema {
|
|
|
119
121
|
groups: ProviderOptionGroup[];
|
|
120
122
|
}
|
|
121
123
|
/**
|
|
122
|
-
* Options passed to `getProviderOptionsSchema
|
|
123
|
-
*
|
|
124
|
-
*
|
|
125
|
-
*
|
|
124
|
+
* Options passed to `getProviderOptionsSchema` and
|
|
125
|
+
* `getImageProviderOptionsSchema`.
|
|
126
|
+
*
|
|
127
|
+
* The text hook's renderer still does not pass `modelName`, so text plugins
|
|
128
|
+
* should treat it as advisory and return the same schema regardless. The
|
|
129
|
+
* *image* hook does pass it, and refetches whenever the selected model
|
|
130
|
+
* changes — image gateways routing to hundreds of models legitimately answer
|
|
131
|
+
* differently per model.
|
|
126
132
|
*/
|
|
127
133
|
interface ProviderOptionsSchemaContext {
|
|
128
134
|
modelName?: string;
|
|
@@ -303,6 +309,23 @@ interface ModelInfo {
|
|
|
303
309
|
supportsImages?: boolean;
|
|
304
310
|
/** Whether this model supports tool/function calling */
|
|
305
311
|
supportsTools?: boolean;
|
|
312
|
+
/**
|
|
313
|
+
* Whether this model is capable of a reasoning ("thinking") turn at all.
|
|
314
|
+
*
|
|
315
|
+
* Distinct from `thinksByDefault`: a model may be capable of thinking yet
|
|
316
|
+
* only do so when the profile asks for it.
|
|
317
|
+
*/
|
|
318
|
+
supportsThinking?: boolean;
|
|
319
|
+
/**
|
|
320
|
+
* Whether this model runs a thinking turn **without being asked** — i.e.
|
|
321
|
+
* with no thinking option set on the connection profile.
|
|
322
|
+
*
|
|
323
|
+
* The two facts are separate because providers differ: DeepSeek's V4 tier
|
|
324
|
+
* reasons out of the box, while Anthropic's extended thinking and Ollama's
|
|
325
|
+
* thinking channel are opt-in per profile. The host uses this as the
|
|
326
|
+
* fallback answer when the profile sets no thinking option of its own.
|
|
327
|
+
*/
|
|
328
|
+
thinksByDefault?: boolean;
|
|
306
329
|
/** Description of the model */
|
|
307
330
|
description?: string;
|
|
308
331
|
/** Pricing information */
|
|
@@ -313,6 +336,37 @@ interface ModelInfo {
|
|
|
313
336
|
output: number;
|
|
314
337
|
};
|
|
315
338
|
}
|
|
339
|
+
/**
|
|
340
|
+
* How the host can tell whether a connection profile on this provider will
|
|
341
|
+
* run a reasoning ("thinking") turn.
|
|
342
|
+
*
|
|
343
|
+
* Thinking changes what a request may look like. Two providers are already on
|
|
344
|
+
* record refusing an assistant `[Name]` prefill *only* while thinking: Ollama
|
|
345
|
+
* never opens the reasoning block behind a prefilled turn, and DeepSeek 400s
|
|
346
|
+
* on continuing a thinking turn whose `reasoning_content` it never saw. The
|
|
347
|
+
* host needs a per-profile answer to seed the right multi-character turn
|
|
348
|
+
* anchor, and only the plugin knows which option key it reads.
|
|
349
|
+
*
|
|
350
|
+
* Deliberately declarative rather than a predicate function: the same answer
|
|
351
|
+
* is needed in the connection-profile editor, which runs in the browser and
|
|
352
|
+
* cannot call into a server-side plugin. A rule serialises; a closure does
|
|
353
|
+
* not.
|
|
354
|
+
*
|
|
355
|
+
* The rule answers only the *explicit* half — "has this profile switched
|
|
356
|
+
* thinking on or off?". When the profile says nothing, the host falls back to
|
|
357
|
+
* the selected model's `thinksByDefault` flag.
|
|
358
|
+
*/
|
|
359
|
+
interface ThinkingTurnRule {
|
|
360
|
+
/**
|
|
361
|
+
* The `parameters` key on the connection profile that switches thinking on
|
|
362
|
+
* or off. Must match a field key from `getProviderOptionsSchema()`.
|
|
363
|
+
*/
|
|
364
|
+
optionKey: string;
|
|
365
|
+
/** Values of that key meaning thinking is ON. */
|
|
366
|
+
enabledValues?: (string | number | boolean)[];
|
|
367
|
+
/** Values of that key meaning thinking is OFF. */
|
|
368
|
+
disabledValues?: (string | number | boolean)[];
|
|
369
|
+
}
|
|
316
370
|
/**
|
|
317
371
|
* Information about an embedding model
|
|
318
372
|
*/
|
|
@@ -364,6 +418,38 @@ interface ImageOrientationSupport {
|
|
|
364
418
|
landscape: OrientationMapping;
|
|
365
419
|
square?: OrientationMapping;
|
|
366
420
|
}
|
|
421
|
+
/**
|
|
422
|
+
* What a provider (or one of its models) can do with LoRA adapters.
|
|
423
|
+
*
|
|
424
|
+
* Declaring this is the whole opt-in: the host shows the LoRA editor, stores
|
|
425
|
+
* the list on the profile, caps it, and hands it to `generateImage` as
|
|
426
|
+
* `ImageGenParams.loras`. A plugin that declares nothing never sees the key,
|
|
427
|
+
* so adding LoRA support to one provider costs every other provider zero
|
|
428
|
+
* lines.
|
|
429
|
+
*/
|
|
430
|
+
interface ImageLoraSupport {
|
|
431
|
+
/** How many adapters this model accepts in one request. */
|
|
432
|
+
maxLoras: number;
|
|
433
|
+
/**
|
|
434
|
+
* Bounds for `ImageLoraSpec.scale`, used by the editor's slider. Omitted
|
|
435
|
+
* means the host offers a permissive 0–2 range and the provider's own
|
|
436
|
+
* default applies when the user leaves it alone.
|
|
437
|
+
*/
|
|
438
|
+
scale?: {
|
|
439
|
+
min: number;
|
|
440
|
+
max: number;
|
|
441
|
+
default: number;
|
|
442
|
+
step?: number;
|
|
443
|
+
};
|
|
444
|
+
/** What the plugin accepts in `ImageLoraSpec.source`. */
|
|
445
|
+
sourceKinds: Array<'url' | 'hf-repo' | 'provider-id'>;
|
|
446
|
+
/**
|
|
447
|
+
* Whether this model can take a token for private or gated weights (e.g.
|
|
448
|
+
* NanoGPT's pruna family and its `hf_api_token`). The token itself travels
|
|
449
|
+
* as an ordinary options-schema field in `profileParameters`, not here.
|
|
450
|
+
*/
|
|
451
|
+
supportsPrivateWeightsToken?: boolean;
|
|
452
|
+
}
|
|
367
453
|
/**
|
|
368
454
|
* Information about an image generation model
|
|
369
455
|
*/
|
|
@@ -383,6 +469,12 @@ interface ImageGenerationModelInfo {
|
|
|
383
469
|
* Required for providers (OpenAI, Z.AI) whose legal sizes differ by model.
|
|
384
470
|
*/
|
|
385
471
|
orientationSupport?: ImageOrientationSupport;
|
|
472
|
+
/**
|
|
473
|
+
* Per-model LoRA support, overriding any provider-level default. Resolution
|
|
474
|
+
* mirrors orientation: exact id, then longest-prefix family match, then the
|
|
475
|
+
* provider-level `ImageProviderConstraints.loraSupport`, then none.
|
|
476
|
+
*/
|
|
477
|
+
loraSupport?: ImageLoraSupport;
|
|
386
478
|
}
|
|
387
479
|
/**
|
|
388
480
|
* Information about a style or LoRA available for an image provider
|
|
@@ -436,6 +528,14 @@ interface ImageProviderConstraints {
|
|
|
436
528
|
* (e.g. Grok, Z.AI).
|
|
437
529
|
*/
|
|
438
530
|
orientationSupport?: ImageOrientationSupport;
|
|
531
|
+
/**
|
|
532
|
+
* Default LoRA support when no per-model override applies. Declare it only
|
|
533
|
+
* for providers where *every* image model takes adapters — otherwise leave
|
|
534
|
+
* it off and put `loraSupport` on the individual
|
|
535
|
+
* `ImageGenerationModelInfo` entries, so models that can't take a LoRA
|
|
536
|
+
* never offer the editor.
|
|
537
|
+
*/
|
|
538
|
+
loraSupport?: ImageLoraSupport;
|
|
439
539
|
}
|
|
440
540
|
/**
|
|
441
541
|
* Icon component props
|
|
@@ -668,6 +768,15 @@ interface TextProviderPlugin {
|
|
|
668
768
|
* Falls back to 8192 if not specified
|
|
669
769
|
*/
|
|
670
770
|
defaultContextWindow?: number;
|
|
771
|
+
/**
|
|
772
|
+
* How to tell whether a profile on this provider will run a thinking turn
|
|
773
|
+
* (optional).
|
|
774
|
+
*
|
|
775
|
+
* Omit it and the host judges by the selected model's `thinksByDefault`
|
|
776
|
+
* flag alone. Declare it when the provider has a profile option that turns
|
|
777
|
+
* reasoning on or off, so an explicit choice outranks the model default.
|
|
778
|
+
*/
|
|
779
|
+
thinkingTurnRule?: ThinkingTurnRule;
|
|
671
780
|
/**
|
|
672
781
|
* Describe provider-specific configuration fields the connection-profile
|
|
673
782
|
* editor should render (optional).
|
|
@@ -684,6 +793,30 @@ interface TextProviderPlugin {
|
|
|
684
793
|
* @returns A schema, or undefined when this provider has no extra options
|
|
685
794
|
*/
|
|
686
795
|
getProviderOptionsSchema?: (context?: ProviderOptionsSchemaContext) => ProviderOptionsSchema | undefined;
|
|
796
|
+
/**
|
|
797
|
+
* Describe provider-specific fields the *image*-profile editor should
|
|
798
|
+
* render (optional). The sibling of `getProviderOptionsSchema`, sharing its
|
|
799
|
+
* schema type and its renderer — the difference is only which profile's
|
|
800
|
+
* `parameters` bag the values land in.
|
|
801
|
+
*
|
|
802
|
+
* Field keys must match what the plugin reads off
|
|
803
|
+
* `ImageGenParams.profileParameters` at call time, with two exceptions the
|
|
804
|
+
* host owns outright: `size` and `aspectRatio` keep their existing storage
|
|
805
|
+
* keys so profiles written by the old hand-rolled panel keep working.
|
|
806
|
+
*
|
|
807
|
+
* Unlike the text hook, `context.modelName` here is *not* advisory: image
|
|
808
|
+
* providers routing to hundreds of models legitimately return a different
|
|
809
|
+
* schema per model (different legal sizes, different `n` ceiling), and the
|
|
810
|
+
* host refetches whenever the selected model changes.
|
|
811
|
+
*
|
|
812
|
+
* LoRA adapters are deliberately not options-schema fields — they are a
|
|
813
|
+
* structured repeating pair with their own editor, declared through
|
|
814
|
+
* `ImageLoraSupport`.
|
|
815
|
+
*
|
|
816
|
+
* @param context Optional render context (the selected model, etc.)
|
|
817
|
+
* @returns A schema, or undefined when this provider has no extra options
|
|
818
|
+
*/
|
|
819
|
+
getImageProviderOptionsSchema?: (context?: ProviderOptionsSchemaContext) => ProviderOptionsSchema | undefined;
|
|
687
820
|
}
|
|
688
821
|
/**
|
|
689
822
|
* @deprecated Use `TextProviderPlugin` instead. This alias is kept for backward compatibility.
|
|
@@ -1667,4 +1800,4 @@ interface ModerationProviderPluginExport {
|
|
|
1667
1800
|
moderationPlugin: ModerationProviderPlugin;
|
|
1668
1801
|
}
|
|
1669
1802
|
|
|
1670
|
-
export type {
|
|
1803
|
+
export type { SearchProviderMetadata as $, AttachmentSupport as A, ProviderConfigRequirements as B, CheapModelConfig as C, ProviderMetadata as D, Effects as E, FontDefinition as F, ProviderOptionDirective as G, ProviderOptionEnumValue as H, IconProps as I, ProviderOptionField as J, ProviderOptionFieldType as K, LLMProviderPlugin as L, MessageFormatSupport as M, ProviderOptionGroup as N, OrientationMapping as O, PluginAuthor as P, ProviderOptionShowIf as Q, ProviderOptionsSchema as R, ProviderOptionsSchemaContext as S, ProviderPluginExport as T, ScoringProviderConfigRequirements as U, ScoringProviderMetadata as V, ScoringProviderPlugin as W, ScoringProviderPluginExport as X, SearchOutput as Y, SearchProviderConfig as Z, SearchProviderConfigRequirements as _, ColorPalette as a, SearchProviderPlugin as a0, SearchProviderPluginExport as a1, SearchResult as a2, Spacing as a3, SubsystemOverrides as a4, TextProviderPlugin as a5, ThemeMetadata as a6, ThemePlugin as a7, ThemePluginExport as a8, ThemeTokens as a9, ThinkingTurnRule as aa, ToolFormatType as ab, Typography as ac, ModerationProviderConfig as ad, EmbeddedFont as b, EmbeddingModelInfo as c, ImageGenerationModelInfo as d, ImageLoraSupport as e, ImageOrientationSupport as f, ImageProviderConstraints as g, ImageStyleInfo as h, InstalledPluginInfo as i, ModelInfo as j, ModerationCategoryResult as k, ModerationProviderConfigRequirements as l, ModerationProviderMetadata as m, ModerationProviderPlugin as n, ModerationProviderPluginExport as o, ModerationResult as p, OrientationStrategy as q, PluginCapability as r, PluginCategory as s, PluginCompatibility as t, PluginIconData as u, PluginManifest as v, PluginPermissions as w, PluginStatus as x, ProviderCapabilities as y, ProviderConfig as z };
|
package/dist/index.d.mts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { U as UniversalTool } from './index-
|
|
2
|
-
export { A as AnthropicToolDefinition, a as AttachmentResults, C as CacheUsage, E as EmbeddingOptions, b as EmbeddingProvider, c as EmbeddingResult, F as FileAttachment, G as GeneratedImage, d as GoogleToolDefinition, I as ImageGenParams, e as ImageGenProvider, f as ImageGenResponse, g as ImageOrientation, e as ImageProvider, J as JSONSchemaDefinition, L as LLMMessage,
|
|
1
|
+
import { U as UniversalTool } from './index-j7yKh7Ue.mjs';
|
|
2
|
+
export { A as AnthropicToolDefinition, a as AttachmentResults, C as CacheUsage, E as EmbeddingOptions, b as EmbeddingProvider, c as EmbeddingResult, F as FileAttachment, G as GeneratedImage, d as GoogleToolDefinition, I as ImageGenParams, e as ImageGenProvider, f as ImageGenResponse, g as ImageLoraSpec, h as ImageOrientation, e as ImageProvider, J as JSONSchemaDefinition, L as LLMMessage, i as LLMParams, T as LLMProvider, j as LLMResponse, k as LocalEmbeddingProvider, l as LocalEmbeddingProviderState, M as ModelMetadata, m as ModelWarning, n as ModelWarningLevel, O as OpenAIToolDefinition, R as ResponseFormat, S as StreamChunk, T as TextProvider, o as TokenUsage, p as ToolCall, q as ToolCallRequest, r as ToolFormatOptions, s as ToolResult, t as isLocalEmbeddingProvider } from './index-j7yKh7Ue.mjs';
|
|
3
3
|
export { CategoryScore, ScoringInput, ScoringProvider, ScoringResult, ScoringTask } from './providers/index.mjs';
|
|
4
|
-
export { A as AttachmentSupport, C as CheapModelConfig, a as ColorPalette, E as Effects, b as EmbeddedFont, c as EmbeddingModelInfo, F as FontDefinition, I as IconProps, d as ImageGenerationModelInfo, e as
|
|
4
|
+
export { A as AttachmentSupport, C as CheapModelConfig, a as ColorPalette, E as Effects, b as EmbeddedFont, c as EmbeddingModelInfo, F as FontDefinition, I as IconProps, d as ImageGenerationModelInfo, e as ImageLoraSupport, f as ImageOrientationSupport, g as ImageProviderConstraints, h as ImageStyleInfo, i as InstalledPluginInfo, L as LLMProviderPlugin, M as MessageFormatSupport, j as ModelInfo, k as ModerationCategoryResult, l as ModerationProviderConfigRequirements, m as ModerationProviderMetadata, n as ModerationProviderPlugin, o as ModerationProviderPluginExport, p as ModerationResult, O as OrientationMapping, q as OrientationStrategy, P as PluginAuthor, r as PluginCapability, s as PluginCategory, t as PluginCompatibility, u as PluginIconData, v as PluginManifest, w as PluginPermissions, x as PluginStatus, y as ProviderCapabilities, z as ProviderConfig, B as ProviderConfigRequirements, D as ProviderMetadata, G as ProviderOptionDirective, H as ProviderOptionEnumValue, J as ProviderOptionField, K as ProviderOptionFieldType, N as ProviderOptionGroup, Q as ProviderOptionShowIf, R as ProviderOptionsSchema, S as ProviderOptionsSchemaContext, T as ProviderPluginExport, U as ScoringProviderConfigRequirements, V as ScoringProviderMetadata, W as ScoringProviderPlugin, X as ScoringProviderPluginExport, Y as SearchOutput, Z as SearchProviderConfig, _ as SearchProviderConfigRequirements, $ as SearchProviderMetadata, a0 as SearchProviderPlugin, a1 as SearchProviderPluginExport, a2 as SearchResult, a3 as Spacing, a4 as SubsystemOverrides, a5 as TextProviderPlugin, a6 as ThemeMetadata, a7 as ThemePlugin, a8 as ThemePluginExport, a9 as ThemeTokens, aa as ThinkingTurnRule, ab as ToolFormatType, ac as Typography } from './index-BhR1AYGC.mjs';
|
|
5
5
|
export { ApiKeyError, AttachmentError, ConfigurationError, LogContext, LogLevel, ModelNotFoundError, PluginError, PluginLogger, ProviderApiError, RateLimitError, ToolExecutionError, createConsoleLogger, createNoopLogger } from './common/index.mjs';
|
|
6
6
|
|
|
7
7
|
/**
|
|
@@ -690,6 +690,6 @@ type CharacterPluginDataMap = Record<string, unknown>;
|
|
|
690
690
|
* Version of the plugin-types package.
|
|
691
691
|
* Can be used at runtime to check compatibility.
|
|
692
692
|
*/
|
|
693
|
-
declare const PLUGIN_TYPES_VERSION = "2.
|
|
693
|
+
declare const PLUGIN_TYPES_VERSION = "2.6.0";
|
|
694
694
|
|
|
695
695
|
export { type CharacterPluginDataEntry, type CharacterPluginDataMap, type NarrationDelimiters, PLUGIN_TYPES_VERSION, type RoleplayTemplateConfig, type RoleplayTemplateMetadata, type RoleplayTemplatePlugin, type RoleplayTemplatePluginExport, type SystemPromptData, type SystemPromptMetadata, type SystemPromptPlugin, type SystemPromptPluginExport, type ToolExecutionContext, type ToolExecutionResult, type ToolHierarchyInfo, type ToolMetadata, type ToolPlugin, type ToolPluginExport, UniversalTool };
|
package/dist/index.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { U as UniversalTool } from './index-
|
|
2
|
-
export { A as AnthropicToolDefinition, a as AttachmentResults, C as CacheUsage, E as EmbeddingOptions, b as EmbeddingProvider, c as EmbeddingResult, F as FileAttachment, G as GeneratedImage, d as GoogleToolDefinition, I as ImageGenParams, e as ImageGenProvider, f as ImageGenResponse, g as ImageOrientation, e as ImageProvider, J as JSONSchemaDefinition, L as LLMMessage,
|
|
1
|
+
import { U as UniversalTool } from './index-j7yKh7Ue.js';
|
|
2
|
+
export { A as AnthropicToolDefinition, a as AttachmentResults, C as CacheUsage, E as EmbeddingOptions, b as EmbeddingProvider, c as EmbeddingResult, F as FileAttachment, G as GeneratedImage, d as GoogleToolDefinition, I as ImageGenParams, e as ImageGenProvider, f as ImageGenResponse, g as ImageLoraSpec, h as ImageOrientation, e as ImageProvider, J as JSONSchemaDefinition, L as LLMMessage, i as LLMParams, T as LLMProvider, j as LLMResponse, k as LocalEmbeddingProvider, l as LocalEmbeddingProviderState, M as ModelMetadata, m as ModelWarning, n as ModelWarningLevel, O as OpenAIToolDefinition, R as ResponseFormat, S as StreamChunk, T as TextProvider, o as TokenUsage, p as ToolCall, q as ToolCallRequest, r as ToolFormatOptions, s as ToolResult, t as isLocalEmbeddingProvider } from './index-j7yKh7Ue.js';
|
|
3
3
|
export { CategoryScore, ScoringInput, ScoringProvider, ScoringResult, ScoringTask } from './providers/index.js';
|
|
4
|
-
export { A as AttachmentSupport, C as CheapModelConfig, a as ColorPalette, E as Effects, b as EmbeddedFont, c as EmbeddingModelInfo, F as FontDefinition, I as IconProps, d as ImageGenerationModelInfo, e as
|
|
4
|
+
export { A as AttachmentSupport, C as CheapModelConfig, a as ColorPalette, E as Effects, b as EmbeddedFont, c as EmbeddingModelInfo, F as FontDefinition, I as IconProps, d as ImageGenerationModelInfo, e as ImageLoraSupport, f as ImageOrientationSupport, g as ImageProviderConstraints, h as ImageStyleInfo, i as InstalledPluginInfo, L as LLMProviderPlugin, M as MessageFormatSupport, j as ModelInfo, k as ModerationCategoryResult, l as ModerationProviderConfigRequirements, m as ModerationProviderMetadata, n as ModerationProviderPlugin, o as ModerationProviderPluginExport, p as ModerationResult, O as OrientationMapping, q as OrientationStrategy, P as PluginAuthor, r as PluginCapability, s as PluginCategory, t as PluginCompatibility, u as PluginIconData, v as PluginManifest, w as PluginPermissions, x as PluginStatus, y as ProviderCapabilities, z as ProviderConfig, B as ProviderConfigRequirements, D as ProviderMetadata, G as ProviderOptionDirective, H as ProviderOptionEnumValue, J as ProviderOptionField, K as ProviderOptionFieldType, N as ProviderOptionGroup, Q as ProviderOptionShowIf, R as ProviderOptionsSchema, S as ProviderOptionsSchemaContext, T as ProviderPluginExport, U as ScoringProviderConfigRequirements, V as ScoringProviderMetadata, W as ScoringProviderPlugin, X as ScoringProviderPluginExport, Y as SearchOutput, Z as SearchProviderConfig, _ as SearchProviderConfigRequirements, $ as SearchProviderMetadata, a0 as SearchProviderPlugin, a1 as SearchProviderPluginExport, a2 as SearchResult, a3 as Spacing, a4 as SubsystemOverrides, a5 as TextProviderPlugin, a6 as ThemeMetadata, a7 as ThemePlugin, a8 as ThemePluginExport, a9 as ThemeTokens, aa as ThinkingTurnRule, ab as ToolFormatType, ac as Typography } from './index-jf_ehLA9.js';
|
|
5
5
|
export { ApiKeyError, AttachmentError, ConfigurationError, LogContext, LogLevel, ModelNotFoundError, PluginError, PluginLogger, ProviderApiError, RateLimitError, ToolExecutionError, createConsoleLogger, createNoopLogger } from './common/index.js';
|
|
6
6
|
|
|
7
7
|
/**
|
|
@@ -690,6 +690,6 @@ type CharacterPluginDataMap = Record<string, unknown>;
|
|
|
690
690
|
* Version of the plugin-types package.
|
|
691
691
|
* Can be used at runtime to check compatibility.
|
|
692
692
|
*/
|
|
693
|
-
declare const PLUGIN_TYPES_VERSION = "2.
|
|
693
|
+
declare const PLUGIN_TYPES_VERSION = "2.6.0";
|
|
694
694
|
|
|
695
695
|
export { type CharacterPluginDataEntry, type CharacterPluginDataMap, type NarrationDelimiters, PLUGIN_TYPES_VERSION, type RoleplayTemplateConfig, type RoleplayTemplateMetadata, type RoleplayTemplatePlugin, type RoleplayTemplatePluginExport, type SystemPromptData, type SystemPromptMetadata, type SystemPromptPlugin, type SystemPromptPluginExport, type ToolExecutionContext, type ToolExecutionResult, type ToolHierarchyInfo, type ToolMetadata, type ToolPlugin, type ToolPluginExport, UniversalTool };
|
package/dist/index.js
CHANGED
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/providers/embedding.ts","../src/common/errors.ts","../src/common/logger.ts","../src/index.ts"],"names":[],"mappings":";;;AAyLO,SAAS,yBACd,QAAA,EACoC;AACpC,EAAA,OAAO,WAAA,IAAe,QAAA,IAAY,WAAA,IAAe,QAAA,IAAY,UAAA,IAAc,QAAA;AAC7E;;;AClLO,IAAM,WAAA,GAAN,cAA0B,KAAA,CAAM;AAAA,EACrC,WAAA,CACE,OAAA,EACgB,IAAA,EACA,UAAA,EAChB;AACA,IAAA,KAAA,CAAM,OAAO,CAAA;AAHG,IAAA,IAAA,CAAA,IAAA,GAAA,IAAA;AACA,IAAA,IAAA,CAAA,UAAA,GAAA,UAAA;AAGhB,IAAA,IAAA,CAAK,IAAA,GAAO,aAAA;AAAA,EACd;AACF;AAOO,IAAM,WAAA,GAAN,cAA0B,WAAA,CAAY;AAAA,EAC3C,WAAA,CAAY,SAAiB,UAAA,EAAqB;AAChD,IAAA,KAAA,CAAM,OAAA,EAAS,iBAAiB,UAAU,CAAA;AAC1C,IAAA,IAAA,CAAK,IAAA,GAAO,aAAA;AAAA,EACd;AACF;AAOO,IAAM,gBAAA,GAAN,cAA+B,WAAA,CAAY;AAAA,EAChD,WAAA,CACE,OAAA,EACgB,UAAA,EACA,QAAA,EAChB,UAAA,EACA;AACA,IAAA,KAAA,CAAM,OAAA,EAAS,sBAAsB,UAAU,CAAA;AAJ/B,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* Embedding Provider — Shape 3: Text -> Vector\n *\n * Send text to an embedding model, receive a numeric vector representation.\n * Used for semantic search, RAG, and similarity matching.\n *\n * @module @quilltap/plugin-types/providers/embedding\n */\n\n/**\n * Result of an embedding operation\n */\nexport interface EmbeddingResult {\n /** The embedding vector (array of floating point numbers) */\n embedding: number[];\n /** The model used to generate the embedding */\n model: string;\n /** Number of dimensions in the embedding vector */\n dimensions: number;\n /** Token usage information (if available) */\n usage?: {\n promptTokens: number;\n totalTokens: number;\n cost?: number;\n };\n}\n\n/**\n * Options for embedding generation\n */\nexport interface EmbeddingOptions {\n /** Desired dimensions for the embedding (if model supports variable dimensions) */\n dimensions?: number;\n}\n\n/**\n * Embedding provider interface — Shape 3: Text -> Vector\n *\n * Sends text to an embedding model and receives a numeric vector\n * representation for use in semantic search, RAG, and similarity matching.\n */\nexport interface EmbeddingProvider {\n /**\n * Generate an embedding for a single text\n *\n * @param text The text to embed\n * @param model The model to use\n * @param apiKey The API key for authentication\n * @param options Optional configuration\n * @returns The embedding result\n */\n generateEmbedding(\n text: string,\n model: string,\n apiKey: string,\n options?: EmbeddingOptions\n ): Promise<EmbeddingResult>;\n\n /**\n * Generate embeddings for multiple texts in a batch\n *\n * @param texts Array of texts to embed\n * @param model The model to use\n * @param apiKey The API key for authentication\n * @param options Optional configuration\n * @returns Array of embedding results\n */\n generateBatchEmbeddings?(\n texts: string[],\n model: string,\n apiKey: string,\n options?: EmbeddingOptions\n ): Promise<EmbeddingResult[]>;\n\n /**\n * Get available embedding models\n *\n * @param apiKey The API key for authentication\n * @returns Array of model IDs\n */\n getAvailableModels?(apiKey: string): Promise<string[]>;\n\n /**\n * Check if the provider is available and properly configured\n *\n * @param apiKey Optional API key to validate\n * @returns True if the provider is ready to use\n */\n isAvailable?(apiKey?: string): Promise<boolean>;\n}\n\n/**\n * Serializable state for local embedding providers\n *\n * Used by providers like TF-IDF that maintain vocabulary state\n */\nexport interface LocalEmbeddingProviderState {\n /** The vocabulary as an array of [term, index] pairs */\n vocabulary: [string, number][];\n /** The IDF (Inverse Document Frequency) weights */\n idf: number[];\n /** Average document length across the corpus */\n avgDocLength: number;\n /** Size of the vocabulary */\n vocabularySize: number;\n /** Whether bigrams are included in the vocabulary */\n includeBigrams: boolean;\n /** Timestamp when the vocabulary was fitted */\n fittedAt: string;\n}\n\n/**\n * Local embedding provider interface\n *\n * Extended interface for local/offline embedding providers that\n * maintain vocabulary state (like TF-IDF). These providers don't\n * require API keys and can work entirely offline.\n */\nexport interface LocalEmbeddingProvider extends Omit<EmbeddingProvider, 'generateEmbedding' | 'generateBatchEmbeddings'> {\n /**\n * Generate an embedding for a single text\n * Local providers don't need apiKey parameter\n *\n * @param text The text to embed\n * @returns The embedding result\n */\n generateEmbedding(text: string): EmbeddingResult;\n\n /**\n * Generate embeddings for multiple texts in a batch\n *\n * @param texts Array of texts to embed\n * @returns Array of embedding results\n */\n generateBatchEmbeddings(texts: string[]): EmbeddingResult[];\n\n /**\n * Fit the vocabulary on a corpus of documents\n *\n * This method analyzes the corpus to build vocabulary, calculate IDF weights,\n * and other statistics needed for embedding generation.\n *\n * @param documents Array of text documents to analyze\n */\n fitCorpus(documents: string[]): void;\n\n /**\n * Check if the vocabulary has been fitted\n *\n * @returns True if fitCorpus has been called with documents\n */\n isFitted(): boolean;\n\n /**\n * Load state from a serialized representation\n *\n * @param state The serialized provider state\n */\n loadState(state: LocalEmbeddingProviderState): void;\n\n /**\n * Get the current state for serialization\n *\n * @returns The provider state, or null if not fitted\n */\n getState(): LocalEmbeddingProviderState | null;\n\n /**\n * Get the vocabulary size\n *\n * @returns Number of terms in the vocabulary\n */\n getVocabularySize(): number;\n\n /**\n * Get the embedding dimensions\n *\n * @returns Number of dimensions in generated embeddings\n */\n getDimensions(): number;\n}\n\n/**\n * Type guard to check if a provider is a local embedding provider\n */\nexport function isLocalEmbeddingProvider(\n provider: EmbeddingProvider | LocalEmbeddingProvider\n): provider is LocalEmbeddingProvider {\n return 'fitCorpus' in provider && 'loadState' in provider && 'getState' in provider;\n}\n","/**\n * Common error types for Quilltap plugin development\n *\n * @module @quilltap/plugin-types/common/errors\n */\n\n/**\n * Base plugin error\n *\n * All plugin-specific errors should extend this class.\n */\nexport class PluginError extends Error {\n constructor(\n message: string,\n public readonly code: string,\n public readonly pluginName?: string\n ) {\n super(message);\n this.name = 'PluginError';\n }\n}\n\n/**\n * API key validation error\n *\n * Thrown when an API key is invalid or has insufficient permissions.\n */\nexport class ApiKeyError extends PluginError {\n constructor(message: string, pluginName?: string) {\n super(message, 'API_KEY_ERROR', pluginName);\n this.name = 'ApiKeyError';\n }\n}\n\n/**\n * Provider API error\n *\n * Thrown when the provider API returns an error.\n */\nexport class ProviderApiError extends PluginError {\n constructor(\n message: string,\n public readonly statusCode?: number,\n public readonly response?: unknown,\n pluginName?: string\n ) {\n super(message, 'PROVIDER_API_ERROR', pluginName);\n this.name = 'ProviderApiError';\n }\n}\n\n/**\n * Rate limit error\n *\n * Thrown when the provider rate limits the request.\n */\nexport class RateLimitError extends ProviderApiError {\n public override readonly code = 'RATE_LIMIT_ERROR';\n\n constructor(\n message: string,\n public readonly retryAfter?: number,\n pluginName?: string\n ) {\n super(message, 429, undefined, pluginName);\n this.name = 'RateLimitError';\n }\n}\n\n/**\n * Configuration error\n *\n * Thrown when plugin configuration is invalid.\n */\nexport class ConfigurationError extends PluginError {\n constructor(message: string, pluginName?: string) {\n super(message, 'CONFIGURATION_ERROR', pluginName);\n this.name = 'ConfigurationError';\n }\n}\n\n/**\n * Model not found error\n *\n * Thrown when a requested model is not available.\n */\nexport class ModelNotFoundError extends PluginError {\n constructor(\n message: string,\n public readonly modelId?: string,\n pluginName?: string\n ) {\n super(message, 'MODEL_NOT_FOUND', pluginName);\n this.name = 'ModelNotFoundError';\n }\n}\n\n/**\n * Attachment error\n *\n * Thrown when there's an issue processing file attachments.\n */\nexport class AttachmentError extends PluginError {\n constructor(\n message: string,\n public readonly attachmentId?: string,\n pluginName?: string\n ) {\n super(message, 'ATTACHMENT_ERROR', pluginName);\n this.name = 'AttachmentError';\n }\n}\n\n/**\n * Tool execution error\n *\n * Thrown when a tool call fails to execute.\n */\nexport class ToolExecutionError extends PluginError {\n constructor(\n message: string,\n public readonly toolName?: string,\n pluginName?: string\n ) {\n super(message, 'TOOL_EXECUTION_ERROR', pluginName);\n this.name = 'ToolExecutionError';\n }\n}\n","/**\n * Logger types for Quilltap plugin development\n *\n * @module @quilltap/plugin-types/common/logger\n */\n\n/**\n * Log level type\n */\nexport type LogLevel = 'debug' | 'info' | 'warn' | 'error';\n\n/**\n * Log context metadata\n */\nexport interface LogContext {\n /** Context identifier (e.g., module name) */\n context?: string;\n /** Additional metadata */\n [key: string]: unknown;\n}\n\n/**\n * Logger interface that plugins can implement or receive\n *\n * This interface is compatible with Quilltap's built-in logger.\n * Plugins can use this interface to accept a logger from the host\n * application or implement their own logging.\n */\nexport interface PluginLogger {\n /**\n * Log a debug message\n * @param message Message to log\n * @param context Optional context metadata\n */\n debug(message: string, context?: LogContext): void;\n\n /**\n * Log an info message\n * @param message Message to log\n * @param context Optional context metadata\n */\n info(message: string, context?: LogContext): void;\n\n /**\n * Log a warning message\n * @param message Message to log\n * @param context Optional context metadata\n */\n warn(message: string, context?: LogContext): void;\n\n /**\n * Log an error message\n * @param message Message to log\n * @param context Optional context metadata\n * @param error Optional error object\n */\n error(message: string, context?: LogContext, error?: Error): void;\n}\n\n/**\n * Simple console-based logger for standalone plugin development\n *\n * This logger writes to the console and is useful for local\n * plugin development and testing.\n *\n * @param prefix Prefix to add to all log messages\n * @param minLevel Minimum log level to output (default: 'info')\n * @returns A PluginLogger instance\n *\n * @example\n * ```typescript\n * const logger = createConsoleLogger('my-plugin', 'debug');\n * logger.debug('Initializing plugin', { version: '1.0.0' });\n * logger.info('Plugin ready');\n * logger.error('Failed to connect', { endpoint: 'api.example.com' }, new Error('Connection refused'));\n * ```\n */\nexport function createConsoleLogger(prefix: string, minLevel: LogLevel = 'info'): PluginLogger {\n const levels: LogLevel[] = ['debug', 'info', 'warn', 'error'];\n const shouldLog = (level: LogLevel): boolean =>\n levels.indexOf(level) >= levels.indexOf(minLevel);\n\n const formatContext = (context?: LogContext): string => {\n if (!context) return '';\n const entries = Object.entries(context)\n .filter(([key]) => key !== 'context')\n .map(([key, value]) => `${key}=${JSON.stringify(value)}`)\n .join(' ');\n return entries ? ` ${entries}` : '';\n };\n\n return {\n debug: (message: string, context?: LogContext): void => {\n if (shouldLog('debug')) {\n console.debug(`[${prefix}] ${message}${formatContext(context)}`);\n }\n },\n\n info: (message: string, context?: LogContext): void => {\n if (shouldLog('info')) {\n console.info(`[${prefix}] ${message}${formatContext(context)}`);\n }\n },\n\n warn: (message: string, context?: LogContext): void => {\n if (shouldLog('warn')) {\n console.warn(`[${prefix}] ${message}${formatContext(context)}`);\n }\n },\n\n error: (message: string, context?: LogContext, error?: Error): void => {\n if (shouldLog('error')) {\n console.error(\n `[${prefix}] ${message}${formatContext(context)}`,\n error ? `\\n${error.stack || error.message}` : ''\n );\n }\n },\n };\n}\n\n/**\n * No-op logger for production or when logging is disabled\n *\n * @returns A PluginLogger that does nothing\n */\nexport function createNoopLogger(): PluginLogger {\n const noop = (): void => {};\n return {\n debug: noop,\n info: noop,\n warn: noop,\n error: noop,\n };\n}\n","/**\n * @quilltap/plugin-types\n *\n * Type definitions for Quilltap plugin development.\n *\n * This package provides TypeScript types and interfaces for building\n * Quilltap plugins, including LLM providers, authentication providers,\n * and utility plugins.\n *\n * @packageDocumentation\n * @module @quilltap/plugin-types\n */\n\n// ============================================================================\n// Provider Interfaces — The Four Canonical Shapes\n// ============================================================================\n\nexport type {\n // Shape 1: Text -> Text\n TextProvider,\n LLMMessage,\n JSONSchemaDefinition,\n ResponseFormat,\n LLMParams,\n LLMResponse,\n StreamChunk,\n\n // Shape 2: Text -> Image\n ImageProvider,\n ImageOrientation,\n ImageGenParams,\n GeneratedImage,\n ImageGenResponse,\n\n // Shape 3: Text -> Vector\n EmbeddingProvider,\n EmbeddingResult,\n EmbeddingOptions,\n LocalEmbeddingProviderState,\n LocalEmbeddingProvider,\n\n // Shape 4: Text + Candidates -> Scores\n ScoringProvider,\n ScoringTask,\n ScoringInput,\n CategoryScore,\n ScoringResult,\n\n // Common types shared across shapes\n FileAttachment,\n TokenUsage,\n CacheUsage,\n AttachmentResults,\n ModelWarningLevel,\n ModelWarning,\n ModelMetadata,\n} from './providers';\n\nexport { isLocalEmbeddingProvider } from './providers';\n\n// ============================================================================\n// Deprecated Provider Aliases (backward compatibility)\n// ============================================================================\n\n/**\n * @deprecated Use `TextProvider` instead\n */\nexport type { TextProvider as LLMProvider } from './providers';\n\n/**\n * @deprecated Use `ImageProvider` instead\n */\nexport type { ImageProvider as ImageGenProvider } from './providers';\n\n// ============================================================================\n// LLM Tool Types\n// ============================================================================\n\nexport type {\n // Tool definitions\n OpenAIToolDefinition,\n UniversalTool,\n AnthropicToolDefinition,\n GoogleToolDefinition,\n\n // Tool calls\n ToolCall,\n ToolCallRequest,\n ToolResult,\n ToolFormatOptions,\n} from './llm/tools';\n\n// ============================================================================\n// Plugin Types\n// ============================================================================\n\nexport type {\n // Text provider plugin types (primary)\n TextProviderPlugin,\n ProviderMetadata,\n ProviderConfigRequirements,\n ProviderCapabilities,\n AttachmentSupport,\n ModelInfo,\n EmbeddingModelInfo,\n ImageGenerationModelInfo,\n ImageStyleInfo,\n ImageProviderConstraints,\n OrientationStrategy,\n OrientationMapping,\n ImageOrientationSupport,\n IconProps,\n PluginIconData,\n ProviderPluginExport,\n // Runtime configuration types\n MessageFormatSupport,\n CheapModelConfig,\n ToolFormatType,\n // Deprecated alias\n LLMProviderPlugin,\n} from './plugins/provider';\n\nexport type {\n // Provider options schema (rendered by the connection-profile editor)\n ProviderOptionFieldType,\n ProviderOptionEnumValue,\n ProviderOptionDirective,\n ProviderOptionShowIf,\n ProviderOptionField,\n ProviderOptionGroup,\n ProviderOptionsSchema,\n ProviderOptionsSchemaContext,\n} from './plugins/provider-options';\n\nexport type {\n // Scoring provider plugin types (primary)\n ScoringProviderMetadata,\n ScoringProviderConfigRequirements,\n ScoringProviderPlugin,\n ScoringProviderPluginExport,\n} from './plugins/scoring-provider';\n\nexport type {\n // Manifest types\n PluginCapability,\n PluginCategory,\n PluginStatus,\n PluginAuthor,\n PluginCompatibility,\n ProviderConfig,\n SearchProviderConfig,\n PluginPermissions,\n PluginManifest,\n InstalledPluginInfo,\n} from './plugins/manifest';\n\nexport type {\n // Theme plugin types\n ColorPalette,\n Typography,\n Spacing,\n Effects,\n ThemeTokens,\n FontDefinition,\n EmbeddedFont,\n ThemeMetadata,\n SubsystemOverrides,\n ThemePlugin,\n ThemePluginExport,\n} from './plugins/theme';\n\nexport type {\n // Roleplay template plugin types\n NarrationDelimiters,\n RoleplayTemplateConfig,\n RoleplayTemplateMetadata,\n RoleplayTemplatePlugin,\n RoleplayTemplatePluginExport,\n} from './plugins/roleplay-template';\n\nexport type {\n // System prompt plugin types\n SystemPromptData,\n SystemPromptMetadata,\n SystemPromptPlugin,\n SystemPromptPluginExport,\n} from './plugins/system-prompt';\n\nexport type {\n // Tool plugin types\n ToolMetadata,\n ToolHierarchyInfo,\n ToolExecutionContext,\n ToolExecutionResult,\n ToolPlugin,\n ToolPluginExport,\n} from './plugins/tool';\n\nexport type {\n // Search provider plugin types\n SearchProviderMetadata,\n SearchProviderConfigRequirements,\n SearchResult,\n SearchOutput,\n SearchProviderPlugin,\n SearchProviderPluginExport,\n} from './plugins/search-provider';\n\nexport type {\n // Moderation provider plugin types (deprecated, use scoring)\n ModerationProviderMetadata,\n ModerationProviderConfigRequirements,\n ModerationCategoryResult,\n ModerationResult,\n ModerationProviderPlugin,\n ModerationProviderPluginExport,\n} from './plugins/moderation-provider';\n\n// ============================================================================\n// Common Types\n// ============================================================================\n\nexport type { LogLevel, LogContext, PluginLogger } from './common/logger';\n\nexport type {\n CharacterPluginDataEntry,\n CharacterPluginDataMap,\n} from './common/character-plugin-data';\n\n// Error classes (these are values, not just types)\nexport {\n PluginError,\n ApiKeyError,\n ProviderApiError,\n RateLimitError,\n ConfigurationError,\n ModelNotFoundError,\n AttachmentError,\n ToolExecutionError,\n} from './common/errors';\n\n// Logger factories\nexport { createConsoleLogger, createNoopLogger } from './common/logger';\n\n// ============================================================================\n// Version\n// ============================================================================\n\n/**\n * Version of the plugin-types package.\n * Can be used at runtime to check compatibility.\n */\nexport const PLUGIN_TYPES_VERSION = '2.5.7';\n"]}
|
|
1
|
+
{"version":3,"sources":["../src/providers/embedding.ts","../src/common/errors.ts","../src/common/logger.ts","../src/index.ts"],"names":[],"mappings":";;;AAyLO,SAAS,yBACd,QAAA,EACoC;AACpC,EAAA,OAAO,WAAA,IAAe,QAAA,IAAY,WAAA,IAAe,QAAA,IAAY,UAAA,IAAc,QAAA;AAC7E;;;AClLO,IAAM,WAAA,GAAN,cAA0B,KAAA,CAAM;AAAA,EACrC,WAAA,CACE,OAAA,EACgB,IAAA,EACA,UAAA,EAChB;AACA,IAAA,KAAA,CAAM,OAAO,CAAA;AAHG,IAAA,IAAA,CAAA,IAAA,GAAA,IAAA;AACA,IAAA,IAAA,CAAA,UAAA,GAAA,UAAA;AAGhB,IAAA,IAAA,CAAK,IAAA,GAAO,aAAA;AAAA,EACd;AACF;AAOO,IAAM,WAAA,GAAN,cAA0B,WAAA,CAAY;AAAA,EAC3C,WAAA,CAAY,SAAiB,UAAA,EAAqB;AAChD,IAAA,KAAA,CAAM,OAAA,EAAS,iBAAiB,UAAU,CAAA;AAC1C,IAAA,IAAA,CAAK,IAAA,GAAO,aAAA;AAAA,EACd;AACF;AAOO,IAAM,gBAAA,GAAN,cAA+B,WAAA,CAAY;AAAA,EAChD,WAAA,CACE,OAAA,EACgB,UAAA,EACA,QAAA,EAChB,UAAA,EACA;AACA,IAAA,KAAA,CAAM,OAAA,EAAS,sBAAsB,UAAU,CAAA;AAJ/B,IAAA,IAAA,CAAA,UAAA,GAAA,UAAA;AACA,IAAA,IAAA,CAAA,QAAA,GAAA,QAAA;AAIhB,IAAA,I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A,KAA+B;AACrD,MAAA,IAAI,SAAA,CAAU,MAAM,CAAA,EAAG;AACrB,QAAA,OAAA,CAAQ,IAAA,CAAK,IAAI,MAAM,CAAA,EAAA,EAAK,OAAO,CAAA,EAAG,aAAA,CAAc,OAAO,CAAC,CAAA,CAAE,CAAA;AAAA,MAChE;AAAA,IACF,CAAA;AAAA,IAEA,IAAA,EAAM,CAAC,OAAA,EAAiB,OAAA,KAA+B;AACrD,MAAA,IAAI,SAAA,CAAU,MAAM,CAAA,EAAG;AACrB,QAAA,OAAA,CAAQ,IAAA,CAAK,IAAI,MAAM,CAAA,EAAA,EAAK,OAAO,CAAA,EAAG,aAAA,CAAc,OAAO,CAAC,CAAA,CAAE,CAAA;AAAA,MAChE;AAAA,IACF,CAAA;AAAA,IAEA,KAAA,EAAO,CAAC,OAAA,EAAiB,OAAA,EAAsB,KAAA,KAAwB;AACrE,MAAA,IAAI,SAAA,CAAU,OAAO,CAAA,EAAG;AACtB,QAAA,OAAA,CAAQ,KAAA;AAAA,UACN,IAAI,MAAM,CAAA,EAAA,EAAK,OAAO,CAAA,EAAG,aAAA,CAAc,OAAO,CAAC,CAAA,CAAA;AAAA,UAC/C,KAAA,GAAQ;AAAA,EAAK,KAAA,CAAM,KAAA,IAAS,KAAA,CAAM,OAAO,CAAA,CAAA,GAAK;AAAA,SAChD;AAAA,MACF;AAAA,IACF;AAAA,GACF;AACF;AAOO,SAAS,gBAAA,GAAiC;AAC/C,EAAA,MAAM,OAAO,MAAY;AAAA,EAAC,CAAA;AAC1B,EAAA,OAAO;AAAA,IACL,KAAA,EAAO,IAAA;AAAA,IACP,IAAA,EAAM,IAAA;AAAA,IACN,IAAA,EAAM,IAAA;AAAA,IACN,KAAA,EAAO;AAAA,GACT;AACF;;;ACyHO,IAAM,oBAAA,GAAuB","file":"index.js","sourcesContent":["/**\n * Embedding Provider — Shape 3: Text -> Vector\n *\n * Send text to an embedding model, receive a numeric vector representation.\n * Used for semantic search, RAG, and similarity matching.\n *\n * @module @quilltap/plugin-types/providers/embedding\n */\n\n/**\n * Result of an embedding operation\n */\nexport interface EmbeddingResult {\n /** The embedding vector (array of floating point numbers) */\n embedding: number[];\n /** The model used to generate the embedding */\n model: string;\n /** Number of dimensions in the embedding vector */\n dimensions: number;\n /** Token usage information (if available) */\n usage?: {\n promptTokens: number;\n totalTokens: number;\n cost?: number;\n };\n}\n\n/**\n * Options for embedding generation\n */\nexport interface EmbeddingOptions {\n /** Desired dimensions for the embedding (if model supports variable dimensions) */\n dimensions?: number;\n}\n\n/**\n * Embedding provider interface — Shape 3: Text -> Vector\n *\n * Sends text to an embedding model and receives a numeric vector\n * representation for use in semantic search, RAG, and similarity matching.\n */\nexport interface EmbeddingProvider {\n /**\n * Generate an embedding for a single text\n *\n * @param text The text to embed\n * @param model The model to use\n * @param apiKey The API key for authentication\n * @param options Optional configuration\n * @returns The embedding result\n */\n generateEmbedding(\n text: string,\n model: string,\n apiKey: string,\n options?: EmbeddingOptions\n ): Promise<EmbeddingResult>;\n\n /**\n * Generate embeddings for multiple texts in a batch\n *\n * @param texts Array of texts to embed\n * @param model The model to use\n * @param apiKey The API key for authentication\n * @param options Optional configuration\n * @returns Array of embedding results\n */\n generateBatchEmbeddings?(\n texts: string[],\n model: string,\n apiKey: string,\n options?: EmbeddingOptions\n ): Promise<EmbeddingResult[]>;\n\n /**\n * Get available embedding models\n *\n * @param apiKey The API key for authentication\n * @returns Array of model IDs\n */\n getAvailableModels?(apiKey: string): Promise<string[]>;\n\n /**\n * Check if the provider is available and properly configured\n *\n * @param apiKey Optional API key to validate\n * @returns True if the provider is ready to use\n */\n isAvailable?(apiKey?: string): Promise<boolean>;\n}\n\n/**\n * Serializable state for local embedding providers\n *\n * Used by providers like TF-IDF that maintain vocabulary state\n */\nexport interface LocalEmbeddingProviderState {\n /** The vocabulary as an array of [term, index] pairs */\n vocabulary: [string, number][];\n /** The IDF (Inverse Document Frequency) weights */\n idf: number[];\n /** Average document length across the corpus */\n avgDocLength: number;\n /** Size of the vocabulary */\n vocabularySize: number;\n /** Whether bigrams are included in the vocabulary */\n includeBigrams: boolean;\n /** Timestamp when the vocabulary was fitted */\n fittedAt: string;\n}\n\n/**\n * Local embedding provider interface\n *\n * Extended interface for local/offline embedding providers that\n * maintain vocabulary state (like TF-IDF). These providers don't\n * require API keys and can work entirely offline.\n */\nexport interface LocalEmbeddingProvider extends Omit<EmbeddingProvider, 'generateEmbedding' | 'generateBatchEmbeddings'> {\n /**\n * Generate an embedding for a single text\n * Local providers don't need apiKey parameter\n *\n * @param text The text to embed\n * @returns The embedding result\n */\n generateEmbedding(text: string): EmbeddingResult;\n\n /**\n * Generate embeddings for multiple texts in a batch\n *\n * @param texts Array of texts to embed\n * @returns Array of embedding results\n */\n generateBatchEmbeddings(texts: string[]): EmbeddingResult[];\n\n /**\n * Fit the vocabulary on a corpus of documents\n *\n * This method analyzes the corpus to build vocabulary, calculate IDF weights,\n * and other statistics needed for embedding generation.\n *\n * @param documents Array of text documents to analyze\n */\n fitCorpus(documents: string[]): void;\n\n /**\n * Check if the vocabulary has been fitted\n *\n * @returns True if fitCorpus has been called with documents\n */\n isFitted(): boolean;\n\n /**\n * Load state from a serialized representation\n *\n * @param state The serialized provider state\n */\n loadState(state: LocalEmbeddingProviderState): void;\n\n /**\n * Get the current state for serialization\n *\n * @returns The provider state, or null if not fitted\n */\n getState(): LocalEmbeddingProviderState | null;\n\n /**\n * Get the vocabulary size\n *\n * @returns Number of terms in the vocabulary\n */\n getVocabularySize(): number;\n\n /**\n * Get the embedding dimensions\n *\n * @returns Number of dimensions in generated embeddings\n */\n getDimensions(): number;\n}\n\n/**\n * Type guard to check if a provider is a local embedding provider\n */\nexport function isLocalEmbeddingProvider(\n provider: EmbeddingProvider | LocalEmbeddingProvider\n): provider is LocalEmbeddingProvider {\n return 'fitCorpus' in provider && 'loadState' in provider && 'getState' in provider;\n}\n","/**\n * Common error types for Quilltap plugin development\n *\n * @module @quilltap/plugin-types/common/errors\n */\n\n/**\n * Base plugin error\n *\n * All plugin-specific errors should extend this class.\n */\nexport class PluginError extends Error {\n constructor(\n message: string,\n public readonly code: string,\n public readonly pluginName?: string\n ) {\n super(message);\n this.name = 'PluginError';\n }\n}\n\n/**\n * API key validation error\n *\n * Thrown when an API key is invalid or has insufficient permissions.\n */\nexport class ApiKeyError extends PluginError {\n constructor(message: string, pluginName?: string) {\n super(message, 'API_KEY_ERROR', pluginName);\n this.name = 'ApiKeyError';\n }\n}\n\n/**\n * Provider API error\n *\n * Thrown when the provider API returns an error.\n */\nexport class ProviderApiError extends PluginError {\n constructor(\n message: string,\n public readonly statusCode?: number,\n public readonly response?: unknown,\n pluginName?: string\n ) {\n super(message, 'PROVIDER_API_ERROR', pluginName);\n this.name = 'ProviderApiError';\n }\n}\n\n/**\n * Rate limit error\n *\n * Thrown when the provider rate limits the request.\n */\nexport class RateLimitError extends ProviderApiError {\n public override readonly code = 'RATE_LIMIT_ERROR';\n\n constructor(\n message: string,\n public readonly retryAfter?: number,\n pluginName?: string\n ) {\n super(message, 429, undefined, pluginName);\n this.name = 'RateLimitError';\n }\n}\n\n/**\n * Configuration error\n *\n * Thrown when plugin configuration is invalid.\n */\nexport class ConfigurationError extends PluginError {\n constructor(message: string, pluginName?: string) {\n super(message, 'CONFIGURATION_ERROR', pluginName);\n this.name = 'ConfigurationError';\n }\n}\n\n/**\n * Model not found error\n *\n * Thrown when a requested model is not available.\n */\nexport class ModelNotFoundError extends PluginError {\n constructor(\n message: string,\n public readonly modelId?: string,\n pluginName?: string\n ) {\n super(message, 'MODEL_NOT_FOUND', pluginName);\n this.name = 'ModelNotFoundError';\n }\n}\n\n/**\n * Attachment error\n *\n * Thrown when there's an issue processing file attachments.\n */\nexport class AttachmentError extends PluginError {\n constructor(\n message: string,\n public readonly attachmentId?: string,\n pluginName?: string\n ) {\n super(message, 'ATTACHMENT_ERROR', pluginName);\n this.name = 'AttachmentError';\n }\n}\n\n/**\n * Tool execution error\n *\n * Thrown when a tool call fails to execute.\n */\nexport class ToolExecutionError extends PluginError {\n constructor(\n message: string,\n public readonly toolName?: string,\n pluginName?: string\n ) {\n super(message, 'TOOL_EXECUTION_ERROR', pluginName);\n this.name = 'ToolExecutionError';\n }\n}\n","/**\n * Logger types for Quilltap plugin development\n *\n * @module @quilltap/plugin-types/common/logger\n */\n\n/**\n * Log level type\n */\nexport type LogLevel = 'debug' | 'info' | 'warn' | 'error';\n\n/**\n * Log context metadata\n */\nexport interface LogContext {\n /** Context identifier (e.g., module name) */\n context?: string;\n /** Additional metadata */\n [key: string]: unknown;\n}\n\n/**\n * Logger interface that plugins can implement or receive\n *\n * This interface is compatible with Quilltap's built-in logger.\n * Plugins can use this interface to accept a logger from the host\n * application or implement their own logging.\n */\nexport interface PluginLogger {\n /**\n * Log a debug message\n * @param message Message to log\n * @param context Optional context metadata\n */\n debug(message: string, context?: LogContext): void;\n\n /**\n * Log an info message\n * @param message Message to log\n * @param context Optional context metadata\n */\n info(message: string, context?: LogContext): void;\n\n /**\n * Log a warning message\n * @param message Message to log\n * @param context Optional context metadata\n */\n warn(message: string, context?: LogContext): void;\n\n /**\n * Log an error message\n * @param message Message to log\n * @param context Optional context metadata\n * @param error Optional error object\n */\n error(message: string, context?: LogContext, error?: Error): void;\n}\n\n/**\n * Simple console-based logger for standalone plugin development\n *\n * This logger writes to the console and is useful for local\n * plugin development and testing.\n *\n * @param prefix Prefix to add to all log messages\n * @param minLevel Minimum log level to output (default: 'info')\n * @returns A PluginLogger instance\n *\n * @example\n * ```typescript\n * const logger = createConsoleLogger('my-plugin', 'debug');\n * logger.debug('Initializing plugin', { version: '1.0.0' });\n * logger.info('Plugin ready');\n * logger.error('Failed to connect', { endpoint: 'api.example.com' }, new Error('Connection refused'));\n * ```\n */\nexport function createConsoleLogger(prefix: string, minLevel: LogLevel = 'info'): PluginLogger {\n const levels: LogLevel[] = ['debug', 'info', 'warn', 'error'];\n const shouldLog = (level: LogLevel): boolean =>\n levels.indexOf(level) >= levels.indexOf(minLevel);\n\n const formatContext = (context?: LogContext): string => {\n if (!context) return '';\n const entries = Object.entries(context)\n .filter(([key]) => key !== 'context')\n .map(([key, value]) => `${key}=${JSON.stringify(value)}`)\n .join(' ');\n return entries ? ` ${entries}` : '';\n };\n\n return {\n debug: (message: string, context?: LogContext): void => {\n if (shouldLog('debug')) {\n console.debug(`[${prefix}] ${message}${formatContext(context)}`);\n }\n },\n\n info: (message: string, context?: LogContext): void => {\n if (shouldLog('info')) {\n console.info(`[${prefix}] ${message}${formatContext(context)}`);\n }\n },\n\n warn: (message: string, context?: LogContext): void => {\n if (shouldLog('warn')) {\n console.warn(`[${prefix}] ${message}${formatContext(context)}`);\n }\n },\n\n error: (message: string, context?: LogContext, error?: Error): void => {\n if (shouldLog('error')) {\n console.error(\n `[${prefix}] ${message}${formatContext(context)}`,\n error ? `\\n${error.stack || error.message}` : ''\n );\n }\n },\n };\n}\n\n/**\n * No-op logger for production or when logging is disabled\n *\n * @returns A PluginLogger that does nothing\n */\nexport function createNoopLogger(): PluginLogger {\n const noop = (): void => {};\n return {\n debug: noop,\n info: noop,\n warn: noop,\n error: noop,\n };\n}\n","/**\n * @quilltap/plugin-types\n *\n * Type definitions for Quilltap plugin development.\n *\n * This package provides TypeScript types and interfaces for building\n * Quilltap plugins, including LLM providers, authentication providers,\n * and utility plugins.\n *\n * @packageDocumentation\n * @module @quilltap/plugin-types\n */\n\n// ============================================================================\n// Provider Interfaces — The Four Canonical Shapes\n// ============================================================================\n\nexport type {\n // Shape 1: Text -> Text\n TextProvider,\n LLMMessage,\n JSONSchemaDefinition,\n ResponseFormat,\n LLMParams,\n LLMResponse,\n StreamChunk,\n\n // Shape 2: Text -> Image\n ImageProvider,\n ImageOrientation,\n ImageGenParams,\n ImageLoraSpec,\n GeneratedImage,\n ImageGenResponse,\n\n // Shape 3: Text -> Vector\n EmbeddingProvider,\n EmbeddingResult,\n EmbeddingOptions,\n LocalEmbeddingProviderState,\n LocalEmbeddingProvider,\n\n // Shape 4: Text + Candidates -> Scores\n ScoringProvider,\n ScoringTask,\n ScoringInput,\n CategoryScore,\n ScoringResult,\n\n // Common types shared across shapes\n FileAttachment,\n TokenUsage,\n CacheUsage,\n AttachmentResults,\n ModelWarningLevel,\n ModelWarning,\n ModelMetadata,\n} from './providers';\n\nexport { isLocalEmbeddingProvider } from './providers';\n\n// ============================================================================\n// Deprecated Provider Aliases (backward compatibility)\n// ============================================================================\n\n/**\n * @deprecated Use `TextProvider` instead\n */\nexport type { TextProvider as LLMProvider } from './providers';\n\n/**\n * @deprecated Use `ImageProvider` instead\n */\nexport type { ImageProvider as ImageGenProvider } from './providers';\n\n// ============================================================================\n// LLM Tool Types\n// ============================================================================\n\nexport type {\n // Tool definitions\n OpenAIToolDefinition,\n UniversalTool,\n AnthropicToolDefinition,\n GoogleToolDefinition,\n\n // Tool calls\n ToolCall,\n ToolCallRequest,\n ToolResult,\n ToolFormatOptions,\n} from './llm/tools';\n\n// ============================================================================\n// Plugin Types\n// ============================================================================\n\nexport type {\n // Text provider plugin types (primary)\n TextProviderPlugin,\n ProviderMetadata,\n ProviderConfigRequirements,\n ProviderCapabilities,\n AttachmentSupport,\n ModelInfo,\n ThinkingTurnRule,\n EmbeddingModelInfo,\n ImageGenerationModelInfo,\n ImageStyleInfo,\n ImageLoraSupport,\n ImageProviderConstraints,\n OrientationStrategy,\n OrientationMapping,\n ImageOrientationSupport,\n IconProps,\n PluginIconData,\n ProviderPluginExport,\n // Runtime configuration types\n MessageFormatSupport,\n CheapModelConfig,\n ToolFormatType,\n // Deprecated alias\n LLMProviderPlugin,\n} from './plugins/provider';\n\nexport type {\n // Provider options schema (rendered by the connection-profile editor)\n ProviderOptionFieldType,\n ProviderOptionEnumValue,\n ProviderOptionDirective,\n ProviderOptionShowIf,\n ProviderOptionField,\n ProviderOptionGroup,\n ProviderOptionsSchema,\n ProviderOptionsSchemaContext,\n} from './plugins/provider-options';\n\nexport type {\n // Scoring provider plugin types (primary)\n ScoringProviderMetadata,\n ScoringProviderConfigRequirements,\n ScoringProviderPlugin,\n ScoringProviderPluginExport,\n} from './plugins/scoring-provider';\n\nexport type {\n // Manifest types\n PluginCapability,\n PluginCategory,\n PluginStatus,\n PluginAuthor,\n PluginCompatibility,\n ProviderConfig,\n SearchProviderConfig,\n PluginPermissions,\n PluginManifest,\n InstalledPluginInfo,\n} from './plugins/manifest';\n\nexport type {\n // Theme plugin types\n ColorPalette,\n Typography,\n Spacing,\n Effects,\n ThemeTokens,\n FontDefinition,\n EmbeddedFont,\n ThemeMetadata,\n SubsystemOverrides,\n ThemePlugin,\n ThemePluginExport,\n} from './plugins/theme';\n\nexport type {\n // Roleplay template plugin types\n NarrationDelimiters,\n RoleplayTemplateConfig,\n RoleplayTemplateMetadata,\n RoleplayTemplatePlugin,\n RoleplayTemplatePluginExport,\n} from './plugins/roleplay-template';\n\nexport type {\n // System prompt plugin types\n SystemPromptData,\n SystemPromptMetadata,\n SystemPromptPlugin,\n SystemPromptPluginExport,\n} from './plugins/system-prompt';\n\nexport type {\n // Tool plugin types\n ToolMetadata,\n ToolHierarchyInfo,\n ToolExecutionContext,\n ToolExecutionResult,\n ToolPlugin,\n ToolPluginExport,\n} from './plugins/tool';\n\nexport type {\n // Search provider plugin types\n SearchProviderMetadata,\n SearchProviderConfigRequirements,\n SearchResult,\n SearchOutput,\n SearchProviderPlugin,\n SearchProviderPluginExport,\n} from './plugins/search-provider';\n\nexport type {\n // Moderation provider plugin types (deprecated, use scoring)\n ModerationProviderMetadata,\n ModerationProviderConfigRequirements,\n ModerationCategoryResult,\n ModerationResult,\n ModerationProviderPlugin,\n ModerationProviderPluginExport,\n} from './plugins/moderation-provider';\n\n// ============================================================================\n// Common Types\n// ============================================================================\n\nexport type { LogLevel, LogContext, PluginLogger } from './common/logger';\n\nexport type {\n CharacterPluginDataEntry,\n CharacterPluginDataMap,\n} from './common/character-plugin-data';\n\n// Error classes (these are values, not just types)\nexport {\n PluginError,\n ApiKeyError,\n ProviderApiError,\n RateLimitError,\n ConfigurationError,\n ModelNotFoundError,\n AttachmentError,\n ToolExecutionError,\n} from './common/errors';\n\n// Logger factories\nexport { createConsoleLogger, createNoopLogger } from './common/logger';\n\n// ============================================================================\n// Version\n// ============================================================================\n\n/**\n * Version of the plugin-types package.\n * Can be used at runtime to check compatibility.\n */\nexport const PLUGIN_TYPES_VERSION = '2.6.0';\n"]}
|
package/dist/index.mjs
CHANGED
|
@@ -110,7 +110,7 @@ function createNoopLogger() {
|
|
|
110
110
|
}
|
|
111
111
|
|
|
112
112
|
// src/index.ts
|
|
113
|
-
var PLUGIN_TYPES_VERSION = "2.
|
|
113
|
+
var PLUGIN_TYPES_VERSION = "2.6.0";
|
|
114
114
|
|
|
115
115
|
export { ApiKeyError, AttachmentError, ConfigurationError, ModelNotFoundError, PLUGIN_TYPES_VERSION, PluginError, ProviderApiError, RateLimitError, ToolExecutionError, createConsoleLogger, createNoopLogger, isLocalEmbeddingProvider };
|
|
116
116
|
//# sourceMappingURL=index.mjs.map
|
package/dist/index.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/providers/embedding.ts","../src/common/errors.ts","../src/common/logger.ts","../src/index.ts"],"names":[],"mappings":";AAyLO,SAAS,yBACd,QAAA,EACoC;AACpC,EAAA,OAAO,WAAA,IAAe,QAAA,IAAY,WAAA,IAAe,QAAA,IAAY,UAAA,IAAc,QAAA;AAC7E;;;AClLO,IAAM,WAAA,GAAN,cAA0B,KAAA,CAAM;AAAA,EACrC,WAAA,CACE,OAAA,EACgB,IAAA,EACA,UAAA,EAChB;AACA,IAAA,KAAA,CAAM,OAAO,CAAA;AAHG,IAAA,IAAA,CAAA,IAAA,GAAA,IAAA;AACA,IAAA,IAAA,CAAA,UAAA,GAAA,UAAA;AAGhB,IAAA,IAAA,CAAK,IAAA,GAAO,aAAA;AAAA,EACd;AACF;AAOO,IAAM,WAAA,GAAN,cAA0B,WAAA,CAAY;AAAA,EAC3C,WAAA,CAAY,SAAiB,UAAA,EAAqB;AACh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AAAA,GACF;AACF;AAOO,SAAS,gBAAA,GAAiC;AAC/C,EAAA,MAAM,OAAO,MAAY;AAAA,EAAC,CAAA;AAC1B,EAAA,OAAO;AAAA,IACL,KAAA,EAAO,IAAA;AAAA,IACP,IAAA,EAAM,IAAA;AAAA,IACN,IAAA,EAAM,IAAA;AAAA,IACN,KAAA,EAAO;AAAA,GACT;AACF;;;ACsHO,IAAM,oBAAA,GAAuB","file":"index.mjs","sourcesContent":["/**\n * Embedding Provider — Shape 3: Text -> Vector\n *\n * Send text to an embedding model, receive a numeric vector representation.\n * Used for semantic search, RAG, and similarity matching.\n *\n * @module @quilltap/plugin-types/providers/embedding\n */\n\n/**\n * Result of an embedding operation\n */\nexport interface EmbeddingResult {\n /** The embedding vector (array of floating point numbers) */\n embedding: number[];\n /** The model used to generate the embedding */\n model: string;\n /** Number of dimensions in the embedding vector */\n dimensions: number;\n /** Token usage information (if available) */\n usage?: {\n promptTokens: number;\n totalTokens: number;\n cost?: number;\n };\n}\n\n/**\n * Options for embedding generation\n */\nexport interface EmbeddingOptions {\n /** Desired dimensions for the embedding (if model supports variable dimensions) */\n dimensions?: number;\n}\n\n/**\n * Embedding provider interface — Shape 3: Text -> Vector\n *\n * Sends text to an embedding model and receives a numeric vector\n * representation for use in semantic search, RAG, and similarity matching.\n */\nexport interface EmbeddingProvider {\n /**\n * Generate an embedding for a single text\n *\n * @param text The text to embed\n * @param model The model to use\n * @param apiKey The API key for authentication\n * @param options Optional configuration\n * @returns The embedding result\n */\n generateEmbedding(\n text: string,\n model: string,\n apiKey: string,\n options?: EmbeddingOptions\n ): Promise<EmbeddingResult>;\n\n /**\n * Generate embeddings for multiple texts in a batch\n *\n * @param texts Array of texts to embed\n * @param model The model to use\n * @param apiKey The API key for authentication\n * @param options Optional configuration\n * @returns Array of embedding results\n */\n generateBatchEmbeddings?(\n texts: string[],\n model: string,\n apiKey: string,\n options?: EmbeddingOptions\n ): Promise<EmbeddingResult[]>;\n\n /**\n * Get available embedding models\n *\n * @param apiKey The API key for authentication\n * @returns Array of model IDs\n */\n getAvailableModels?(apiKey: string): Promise<string[]>;\n\n /**\n * Check if the provider is available and properly configured\n *\n * @param apiKey Optional API key to validate\n * @returns True if the provider is ready to use\n */\n isAvailable?(apiKey?: string): Promise<boolean>;\n}\n\n/**\n * Serializable state for local embedding providers\n *\n * Used by providers like TF-IDF that maintain vocabulary state\n */\nexport interface LocalEmbeddingProviderState {\n /** The vocabulary as an array of [term, index] pairs */\n vocabulary: [string, number][];\n /** The IDF (Inverse Document Frequency) weights */\n idf: number[];\n /** Average document length across the corpus */\n avgDocLength: number;\n /** Size of the vocabulary */\n vocabularySize: number;\n /** Whether bigrams are included in the vocabulary */\n includeBigrams: boolean;\n /** Timestamp when the vocabulary was fitted */\n fittedAt: string;\n}\n\n/**\n * Local embedding provider interface\n *\n * Extended interface for local/offline embedding providers that\n * maintain vocabulary state (like TF-IDF). These providers don't\n * require API keys and can work entirely offline.\n */\nexport interface LocalEmbeddingProvider extends Omit<EmbeddingProvider, 'generateEmbedding' | 'generateBatchEmbeddings'> {\n /**\n * Generate an embedding for a single text\n * Local providers don't need apiKey parameter\n *\n * @param text The text to embed\n * @returns The embedding result\n */\n generateEmbedding(text: string): EmbeddingResult;\n\n /**\n * Generate embeddings for multiple texts in a batch\n *\n * @param texts Array of texts to embed\n * @returns Array of embedding results\n */\n generateBatchEmbeddings(texts: string[]): EmbeddingResult[];\n\n /**\n * Fit the vocabulary on a corpus of documents\n *\n * This method analyzes the corpus to build vocabulary, calculate IDF weights,\n * and other statistics needed for embedding generation.\n *\n * @param documents Array of text documents to analyze\n */\n fitCorpus(documents: string[]): void;\n\n /**\n * Check if the vocabulary has been fitted\n *\n * @returns True if fitCorpus has been called with documents\n */\n isFitted(): boolean;\n\n /**\n * Load state from a serialized representation\n *\n * @param state The serialized provider state\n */\n loadState(state: LocalEmbeddingProviderState): void;\n\n /**\n * Get the current state for serialization\n *\n * @returns The provider state, or null if not fitted\n */\n getState(): LocalEmbeddingProviderState | null;\n\n /**\n * Get the vocabulary size\n *\n * @returns Number of terms in the vocabulary\n */\n getVocabularySize(): number;\n\n /**\n * Get the embedding dimensions\n *\n * @returns Number of dimensions in generated embeddings\n */\n getDimensions(): number;\n}\n\n/**\n * Type guard to check if a provider is a local embedding provider\n */\nexport function isLocalEmbeddingProvider(\n provider: EmbeddingProvider | LocalEmbeddingProvider\n): provider is LocalEmbeddingProvider {\n return 'fitCorpus' in provider && 'loadState' in provider && 'getState' in provider;\n}\n","/**\n * Common error types for Quilltap plugin development\n *\n * @module @quilltap/plugin-types/common/errors\n */\n\n/**\n * Base plugin error\n *\n * All plugin-specific errors should extend this class.\n */\nexport class PluginError extends Error {\n constructor(\n message: string,\n public readonly code: string,\n public readonly pluginName?: string\n ) {\n super(message);\n this.name = 'PluginError';\n }\n}\n\n/**\n * API key validation error\n *\n * Thrown when an API key is invalid or has insufficient permissions.\n */\nexport class ApiKeyError extends PluginError {\n constructor(message: string, pluginName?: string) {\n super(message, 'API_KEY_ERROR', pluginName);\n this.name = 'ApiKeyError';\n }\n}\n\n/**\n * Provider API error\n *\n * Thrown when the provider API returns an error.\n */\nexport class ProviderApiError extends PluginError {\n constructor(\n message: string,\n public readonly statusCode?: number,\n public readonly response?: unknown,\n pluginName?: string\n ) {\n super(message, 'PROVIDER_API_ERROR', pluginName);\n this.name = 'ProviderApiError';\n }\n}\n\n/**\n * Rate limit error\n *\n * Thrown when the provider rate limits the request.\n */\nexport class RateLimitError extends ProviderApiError {\n public override readonly code = 'RATE_LIMIT_ERROR';\n\n constructor(\n message: string,\n public readonly retryAfter?: number,\n pluginName?: string\n ) {\n super(message, 429, undefined, pluginName);\n this.name = 'RateLimitError';\n }\n}\n\n/**\n * Configuration error\n *\n * Thrown when plugin configuration is invalid.\n */\nexport class ConfigurationError extends PluginError {\n constructor(message: string, pluginName?: string) {\n super(message, 'CONFIGURATION_ERROR', pluginName);\n this.name = 'ConfigurationError';\n }\n}\n\n/**\n * Model not found error\n *\n * Thrown when a requested model is not available.\n */\nexport class ModelNotFoundError extends PluginError {\n constructor(\n message: string,\n public readonly modelId?: string,\n pluginName?: string\n ) {\n super(message, 'MODEL_NOT_FOUND', pluginName);\n this.name = 'ModelNotFoundError';\n }\n}\n\n/**\n * Attachment error\n *\n * Thrown when there's an issue processing file attachments.\n */\nexport class AttachmentError extends PluginError {\n constructor(\n message: string,\n public readonly attachmentId?: string,\n pluginName?: string\n ) {\n super(message, 'ATTACHMENT_ERROR', pluginName);\n this.name = 'AttachmentError';\n }\n}\n\n/**\n * Tool execution error\n *\n * Thrown when a tool call fails to execute.\n */\nexport class ToolExecutionError extends PluginError {\n constructor(\n message: string,\n public readonly toolName?: string,\n pluginName?: string\n ) {\n super(message, 'TOOL_EXECUTION_ERROR', pluginName);\n this.name = 'ToolExecutionError';\n }\n}\n","/**\n * Logger types for Quilltap plugin development\n *\n * @module @quilltap/plugin-types/common/logger\n */\n\n/**\n * Log level type\n */\nexport type LogLevel = 'debug' | 'info' | 'warn' | 'error';\n\n/**\n * Log context metadata\n */\nexport interface LogContext {\n /** Context identifier (e.g., module name) */\n context?: string;\n /** Additional metadata */\n [key: string]: unknown;\n}\n\n/**\n * Logger interface that plugins can implement or receive\n *\n * This interface is compatible with Quilltap's built-in logger.\n * Plugins can use this interface to accept a logger from the host\n * application or implement their own logging.\n */\nexport interface PluginLogger {\n /**\n * Log a debug message\n * @param message Message to log\n * @param context Optional context metadata\n */\n debug(message: string, context?: LogContext): void;\n\n /**\n * Log an info message\n * @param message Message to log\n * @param context Optional context metadata\n */\n info(message: string, context?: LogContext): void;\n\n /**\n * Log a warning message\n * @param message Message to log\n * @param context Optional context metadata\n */\n warn(message: string, context?: LogContext): void;\n\n /**\n * Log an error message\n * @param message Message to log\n * @param context Optional context metadata\n * @param error Optional error object\n */\n error(message: string, context?: LogContext, error?: Error): void;\n}\n\n/**\n * Simple console-based logger for standalone plugin development\n *\n * This logger writes to the console and is useful for local\n * plugin development and testing.\n *\n * @param prefix Prefix to add to all log messages\n * @param minLevel Minimum log level to output (default: 'info')\n * @returns A PluginLogger instance\n *\n * @example\n * ```typescript\n * const logger = createConsoleLogger('my-plugin', 'debug');\n * logger.debug('Initializing plugin', { version: '1.0.0' });\n * logger.info('Plugin ready');\n * logger.error('Failed to connect', { endpoint: 'api.example.com' }, new Error('Connection refused'));\n * ```\n */\nexport function createConsoleLogger(prefix: string, minLevel: LogLevel = 'info'): PluginLogger {\n const levels: LogLevel[] = ['debug', 'info', 'warn', 'error'];\n const shouldLog = (level: LogLevel): boolean =>\n levels.indexOf(level) >= levels.indexOf(minLevel);\n\n const formatContext = (context?: LogContext): string => {\n if (!context) return '';\n const entries = Object.entries(context)\n .filter(([key]) => key !== 'context')\n .map(([key, value]) => `${key}=${JSON.stringify(value)}`)\n .join(' ');\n return entries ? ` ${entries}` : '';\n };\n\n return {\n debug: (message: string, context?: LogContext): void => {\n if (shouldLog('debug')) {\n console.debug(`[${prefix}] ${message}${formatContext(context)}`);\n }\n },\n\n info: (message: string, context?: LogContext): void => {\n if (shouldLog('info')) {\n console.info(`[${prefix}] ${message}${formatContext(context)}`);\n }\n },\n\n warn: (message: string, context?: LogContext): void => {\n if (shouldLog('warn')) {\n console.warn(`[${prefix}] ${message}${formatContext(context)}`);\n }\n },\n\n error: (message: string, context?: LogContext, error?: Error): void => {\n if (shouldLog('error')) {\n console.error(\n `[${prefix}] ${message}${formatContext(context)}`,\n error ? `\\n${error.stack || error.message}` : ''\n );\n }\n },\n };\n}\n\n/**\n * No-op logger for production or when logging is disabled\n *\n * @returns A PluginLogger that does nothing\n */\nexport function createNoopLogger(): PluginLogger {\n const noop = (): void => {};\n return {\n debug: noop,\n info: noop,\n warn: noop,\n error: noop,\n };\n}\n","/**\n * @quilltap/plugin-types\n *\n * Type definitions for Quilltap plugin development.\n *\n * This package provides TypeScript types and interfaces for building\n * Quilltap plugins, including LLM providers, authentication providers,\n * and utility plugins.\n *\n * @packageDocumentation\n * @module @quilltap/plugin-types\n */\n\n// ============================================================================\n// Provider Interfaces — The Four Canonical Shapes\n// ============================================================================\n\nexport type {\n // Shape 1: Text -> Text\n TextProvider,\n LLMMessage,\n JSONSchemaDefinition,\n ResponseFormat,\n LLMParams,\n LLMResponse,\n StreamChunk,\n\n // Shape 2: Text -> Image\n ImageProvider,\n ImageOrientation,\n ImageGenParams,\n GeneratedImage,\n ImageGenResponse,\n\n // Shape 3: Text -> Vector\n EmbeddingProvider,\n EmbeddingResult,\n EmbeddingOptions,\n LocalEmbeddingProviderState,\n LocalEmbeddingProvider,\n\n // Shape 4: Text + Candidates -> Scores\n ScoringProvider,\n ScoringTask,\n ScoringInput,\n CategoryScore,\n ScoringResult,\n\n // Common types shared across shapes\n FileAttachment,\n TokenUsage,\n CacheUsage,\n AttachmentResults,\n ModelWarningLevel,\n ModelWarning,\n ModelMetadata,\n} from './providers';\n\nexport { isLocalEmbeddingProvider } from './providers';\n\n// ============================================================================\n// Deprecated Provider Aliases (backward compatibility)\n// ============================================================================\n\n/**\n * @deprecated Use `TextProvider` instead\n */\nexport type { TextProvider as LLMProvider } from './providers';\n\n/**\n * @deprecated Use `ImageProvider` instead\n */\nexport type { ImageProvider as ImageGenProvider } from './providers';\n\n// ============================================================================\n// LLM Tool Types\n// ============================================================================\n\nexport type {\n // Tool definitions\n OpenAIToolDefinition,\n UniversalTool,\n AnthropicToolDefinition,\n GoogleToolDefinition,\n\n // Tool calls\n ToolCall,\n ToolCallRequest,\n ToolResult,\n ToolFormatOptions,\n} from './llm/tools';\n\n// ============================================================================\n// Plugin Types\n// ============================================================================\n\nexport type {\n // Text provider plugin types (primary)\n TextProviderPlugin,\n ProviderMetadata,\n ProviderConfigRequirements,\n ProviderCapabilities,\n AttachmentSupport,\n ModelInfo,\n EmbeddingModelInfo,\n ImageGenerationModelInfo,\n ImageStyleInfo,\n ImageProviderConstraints,\n OrientationStrategy,\n OrientationMapping,\n ImageOrientationSupport,\n IconProps,\n PluginIconData,\n ProviderPluginExport,\n // Runtime configuration types\n MessageFormatSupport,\n CheapModelConfig,\n ToolFormatType,\n // Deprecated alias\n LLMProviderPlugin,\n} from './plugins/provider';\n\nexport type {\n // Provider options schema (rendered by the connection-profile editor)\n ProviderOptionFieldType,\n ProviderOptionEnumValue,\n ProviderOptionDirective,\n ProviderOptionShowIf,\n ProviderOptionField,\n ProviderOptionGroup,\n ProviderOptionsSchema,\n ProviderOptionsSchemaContext,\n} from './plugins/provider-options';\n\nexport type {\n // Scoring provider plugin types (primary)\n ScoringProviderMetadata,\n ScoringProviderConfigRequirements,\n ScoringProviderPlugin,\n ScoringProviderPluginExport,\n} from './plugins/scoring-provider';\n\nexport type {\n // Manifest types\n PluginCapability,\n PluginCategory,\n PluginStatus,\n PluginAuthor,\n PluginCompatibility,\n ProviderConfig,\n SearchProviderConfig,\n PluginPermissions,\n PluginManifest,\n InstalledPluginInfo,\n} from './plugins/manifest';\n\nexport type {\n // Theme plugin types\n ColorPalette,\n Typography,\n Spacing,\n Effects,\n ThemeTokens,\n FontDefinition,\n EmbeddedFont,\n ThemeMetadata,\n SubsystemOverrides,\n ThemePlugin,\n ThemePluginExport,\n} from './plugins/theme';\n\nexport type {\n // Roleplay template plugin types\n NarrationDelimiters,\n RoleplayTemplateConfig,\n RoleplayTemplateMetadata,\n RoleplayTemplatePlugin,\n RoleplayTemplatePluginExport,\n} from './plugins/roleplay-template';\n\nexport type {\n // System prompt plugin types\n SystemPromptData,\n SystemPromptMetadata,\n SystemPromptPlugin,\n SystemPromptPluginExport,\n} from './plugins/system-prompt';\n\nexport type {\n // Tool plugin types\n ToolMetadata,\n ToolHierarchyInfo,\n ToolExecutionContext,\n ToolExecutionResult,\n ToolPlugin,\n ToolPluginExport,\n} from './plugins/tool';\n\nexport type {\n // Search provider plugin types\n SearchProviderMetadata,\n SearchProviderConfigRequirements,\n SearchResult,\n SearchOutput,\n SearchProviderPlugin,\n SearchProviderPluginExport,\n} from './plugins/search-provider';\n\nexport type {\n // Moderation provider plugin types (deprecated, use scoring)\n ModerationProviderMetadata,\n ModerationProviderConfigRequirements,\n ModerationCategoryResult,\n ModerationResult,\n ModerationProviderPlugin,\n ModerationProviderPluginExport,\n} from './plugins/moderation-provider';\n\n// ============================================================================\n// Common Types\n// ============================================================================\n\nexport type { LogLevel, LogContext, PluginLogger } from './common/logger';\n\nexport type {\n CharacterPluginDataEntry,\n CharacterPluginDataMap,\n} from './common/character-plugin-data';\n\n// Error classes (these are values, not just types)\nexport {\n PluginError,\n ApiKeyError,\n ProviderApiError,\n RateLimitError,\n ConfigurationError,\n ModelNotFoundError,\n AttachmentError,\n ToolExecutionError,\n} from './common/errors';\n\n// Logger factories\nexport { createConsoleLogger, createNoopLogger } from './common/logger';\n\n// ============================================================================\n// Version\n// ============================================================================\n\n/**\n * Version of the plugin-types package.\n * Can be used at runtime to check compatibility.\n */\nexport const PLUGIN_TYPES_VERSION = '2.5.7';\n"]}
|
|
1
|
+
{"version":3,"sources":["../src/providers/embedding.ts","../src/common/errors.ts","../src/common/logger.ts","../src/index.ts"],"names":[],"mappings":";AAyLO,SAAS,yBACd,QAAA,EACoC;AACpC,EAAA,OAAO,WAAA,IAAe,QAAA,IAAY,WAAA,IAAe,QAAA,IAAY,UAAA,IAAc,QAAA;AAC7E;;;AClLO,IAAM,WAAA,GAAN,cAA0B,KAAA,CAAM;AAAA,EACrC,WAAA,CACE,OAAA,EACgB,IAAA,EACA,UAAA,EAChB;AACA,IAAA,KAAA,CAAM,OAAO,CAAA;AAHG,IAAA,IAAA,CAAA,IAAA,GAAA,IAAA;AACA,IAAA,IAAA,CAAA,UAAA,GAAA,UAAA;AAGhB,IAAA,IAAA,CAAK,IAAA,GAAO,aAAA;AAAA,EACd;AACF;AAOO,IAAM,WAAA,GAAN,cAA0B,WAAA,CAAY;AAAA,EAC3C,WAAA,CAAY,SAAiB,UAAA,EAAqB;AAChD,IAAA,KAAA,CAAM,OAAA,EAAS,iBAAiB,UAAU,CAAA;AAC1C,IAAA,IAAA,CAAK,IAAA,GAAO,a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AAC1B,EAAA,OAAO;AAAA,IACL,KAAA,EAAO,IAAA;AAAA,IACP,IAAA,EAAM,IAAA;AAAA,IACN,IAAA,EAAM,IAAA;AAAA,IACN,KAAA,EAAO;AAAA,GACT;AACF;;;ACyHO,IAAM,oBAAA,GAAuB","file":"index.mjs","sourcesContent":["/**\n * Embedding Provider — Shape 3: Text -> Vector\n *\n * Send text to an embedding model, receive a numeric vector representation.\n * Used for semantic search, RAG, and similarity matching.\n *\n * @module @quilltap/plugin-types/providers/embedding\n */\n\n/**\n * Result of an embedding operation\n */\nexport interface EmbeddingResult {\n /** The embedding vector (array of floating point numbers) */\n embedding: number[];\n /** The model used to generate the embedding */\n model: string;\n /** Number of dimensions in the embedding vector */\n dimensions: number;\n /** Token usage information (if available) */\n usage?: {\n promptTokens: number;\n totalTokens: number;\n cost?: number;\n };\n}\n\n/**\n * Options for embedding generation\n */\nexport interface EmbeddingOptions {\n /** Desired dimensions for the embedding (if model supports variable dimensions) */\n dimensions?: number;\n}\n\n/**\n * Embedding provider interface — Shape 3: Text -> Vector\n *\n * Sends text to an embedding model and receives a numeric vector\n * representation for use in semantic search, RAG, and similarity matching.\n */\nexport interface EmbeddingProvider {\n /**\n * Generate an embedding for a single text\n *\n * @param text The text to embed\n * @param model The model to use\n * @param apiKey The API key for authentication\n * @param options Optional configuration\n * @returns The embedding result\n */\n generateEmbedding(\n text: string,\n model: string,\n apiKey: string,\n options?: EmbeddingOptions\n ): Promise<EmbeddingResult>;\n\n /**\n * Generate embeddings for multiple texts in a batch\n *\n * @param texts Array of texts to embed\n * @param model The model to use\n * @param apiKey The API key for authentication\n * @param options Optional configuration\n * @returns Array of embedding results\n */\n generateBatchEmbeddings?(\n texts: string[],\n model: string,\n apiKey: string,\n options?: EmbeddingOptions\n ): Promise<EmbeddingResult[]>;\n\n /**\n * Get available embedding models\n *\n * @param apiKey The API key for authentication\n * @returns Array of model IDs\n */\n getAvailableModels?(apiKey: string): Promise<string[]>;\n\n /**\n * Check if the provider is available and properly configured\n *\n * @param apiKey Optional API key to validate\n * @returns True if the provider is ready to use\n */\n isAvailable?(apiKey?: string): Promise<boolean>;\n}\n\n/**\n * Serializable state for local embedding providers\n *\n * Used by providers like TF-IDF that maintain vocabulary state\n */\nexport interface LocalEmbeddingProviderState {\n /** The vocabulary as an array of [term, index] pairs */\n vocabulary: [string, number][];\n /** The IDF (Inverse Document Frequency) weights */\n idf: number[];\n /** Average document length across the corpus */\n avgDocLength: number;\n /** Size of the vocabulary */\n vocabularySize: number;\n /** Whether bigrams are included in the vocabulary */\n includeBigrams: boolean;\n /** Timestamp when the vocabulary was fitted */\n fittedAt: string;\n}\n\n/**\n * Local embedding provider interface\n *\n * Extended interface for local/offline embedding providers that\n * maintain vocabulary state (like TF-IDF). These providers don't\n * require API keys and can work entirely offline.\n */\nexport interface LocalEmbeddingProvider extends Omit<EmbeddingProvider, 'generateEmbedding' | 'generateBatchEmbeddings'> {\n /**\n * Generate an embedding for a single text\n * Local providers don't need apiKey parameter\n *\n * @param text The text to embed\n * @returns The embedding result\n */\n generateEmbedding(text: string): EmbeddingResult;\n\n /**\n * Generate embeddings for multiple texts in a batch\n *\n * @param texts Array of texts to embed\n * @returns Array of embedding results\n */\n generateBatchEmbeddings(texts: string[]): EmbeddingResult[];\n\n /**\n * Fit the vocabulary on a corpus of documents\n *\n * This method analyzes the corpus to build vocabulary, calculate IDF weights,\n * and other statistics needed for embedding generation.\n *\n * @param documents Array of text documents to analyze\n */\n fitCorpus(documents: string[]): void;\n\n /**\n * Check if the vocabulary has been fitted\n *\n * @returns True if fitCorpus has been called with documents\n */\n isFitted(): boolean;\n\n /**\n * Load state from a serialized representation\n *\n * @param state The serialized provider state\n */\n loadState(state: LocalEmbeddingProviderState): void;\n\n /**\n * Get the current state for serialization\n *\n * @returns The provider state, or null if not fitted\n */\n getState(): LocalEmbeddingProviderState | null;\n\n /**\n * Get the vocabulary size\n *\n * @returns Number of terms in the vocabulary\n */\n getVocabularySize(): number;\n\n /**\n * Get the embedding dimensions\n *\n * @returns Number of dimensions in generated embeddings\n */\n getDimensions(): number;\n}\n\n/**\n * Type guard to check if a provider is a local embedding provider\n */\nexport function isLocalEmbeddingProvider(\n provider: EmbeddingProvider | LocalEmbeddingProvider\n): provider is LocalEmbeddingProvider {\n return 'fitCorpus' in provider && 'loadState' in provider && 'getState' in provider;\n}\n","/**\n * Common error types for Quilltap plugin development\n *\n * @module @quilltap/plugin-types/common/errors\n */\n\n/**\n * Base plugin error\n *\n * All plugin-specific errors should extend this class.\n */\nexport class PluginError extends Error {\n constructor(\n message: string,\n public readonly code: string,\n public readonly pluginName?: string\n ) {\n super(message);\n this.name = 'PluginError';\n }\n}\n\n/**\n * API key validation error\n *\n * Thrown when an API key is invalid or has insufficient permissions.\n */\nexport class ApiKeyError extends PluginError {\n constructor(message: string, pluginName?: string) {\n super(message, 'API_KEY_ERROR', pluginName);\n this.name = 'ApiKeyError';\n }\n}\n\n/**\n * Provider API error\n *\n * Thrown when the provider API returns an error.\n */\nexport class ProviderApiError extends PluginError {\n constructor(\n message: string,\n public readonly statusCode?: number,\n public readonly response?: unknown,\n pluginName?: string\n ) {\n super(message, 'PROVIDER_API_ERROR', pluginName);\n this.name = 'ProviderApiError';\n }\n}\n\n/**\n * Rate limit error\n *\n * Thrown when the provider rate limits the request.\n */\nexport class RateLimitError extends ProviderApiError {\n public override readonly code = 'RATE_LIMIT_ERROR';\n\n constructor(\n message: string,\n public readonly retryAfter?: number,\n pluginName?: string\n ) {\n super(message, 429, undefined, pluginName);\n this.name = 'RateLimitError';\n }\n}\n\n/**\n * Configuration error\n *\n * Thrown when plugin configuration is invalid.\n */\nexport class ConfigurationError extends PluginError {\n constructor(message: string, pluginName?: string) {\n super(message, 'CONFIGURATION_ERROR', pluginName);\n this.name = 'ConfigurationError';\n }\n}\n\n/**\n * Model not found error\n *\n * Thrown when a requested model is not available.\n */\nexport class ModelNotFoundError extends PluginError {\n constructor(\n message: string,\n public readonly modelId?: string,\n pluginName?: string\n ) {\n super(message, 'MODEL_NOT_FOUND', pluginName);\n this.name = 'ModelNotFoundError';\n }\n}\n\n/**\n * Attachment error\n *\n * Thrown when there's an issue processing file attachments.\n */\nexport class AttachmentError extends PluginError {\n constructor(\n message: string,\n public readonly attachmentId?: string,\n pluginName?: string\n ) {\n super(message, 'ATTACHMENT_ERROR', pluginName);\n this.name = 'AttachmentError';\n }\n}\n\n/**\n * Tool execution error\n *\n * Thrown when a tool call fails to execute.\n */\nexport class ToolExecutionError extends PluginError {\n constructor(\n message: string,\n public readonly toolName?: string,\n pluginName?: string\n ) {\n super(message, 'TOOL_EXECUTION_ERROR', pluginName);\n this.name = 'ToolExecutionError';\n }\n}\n","/**\n * Logger types for Quilltap plugin development\n *\n * @module @quilltap/plugin-types/common/logger\n */\n\n/**\n * Log level type\n */\nexport type LogLevel = 'debug' | 'info' | 'warn' | 'error';\n\n/**\n * Log context metadata\n */\nexport interface LogContext {\n /** Context identifier (e.g., module name) */\n context?: string;\n /** Additional metadata */\n [key: string]: unknown;\n}\n\n/**\n * Logger interface that plugins can implement or receive\n *\n * This interface is compatible with Quilltap's built-in logger.\n * Plugins can use this interface to accept a logger from the host\n * application or implement their own logging.\n */\nexport interface PluginLogger {\n /**\n * Log a debug message\n * @param message Message to log\n * @param context Optional context metadata\n */\n debug(message: string, context?: LogContext): void;\n\n /**\n * Log an info message\n * @param message Message to log\n * @param context Optional context metadata\n */\n info(message: string, context?: LogContext): void;\n\n /**\n * Log a warning message\n * @param message Message to log\n * @param context Optional context metadata\n */\n warn(message: string, context?: LogContext): void;\n\n /**\n * Log an error message\n * @param message Message to log\n * @param context Optional context metadata\n * @param error Optional error object\n */\n error(message: string, context?: LogContext, error?: Error): void;\n}\n\n/**\n * Simple console-based logger for standalone plugin development\n *\n * This logger writes to the console and is useful for local\n * plugin development and testing.\n *\n * @param prefix Prefix to add to all log messages\n * @param minLevel Minimum log level to output (default: 'info')\n * @returns A PluginLogger instance\n *\n * @example\n * ```typescript\n * const logger = createConsoleLogger('my-plugin', 'debug');\n * logger.debug('Initializing plugin', { version: '1.0.0' });\n * logger.info('Plugin ready');\n * logger.error('Failed to connect', { endpoint: 'api.example.com' }, new Error('Connection refused'));\n * ```\n */\nexport function createConsoleLogger(prefix: string, minLevel: LogLevel = 'info'): PluginLogger {\n const levels: LogLevel[] = ['debug', 'info', 'warn', 'error'];\n const shouldLog = (level: LogLevel): boolean =>\n levels.indexOf(level) >= levels.indexOf(minLevel);\n\n const formatContext = (context?: LogContext): string => {\n if (!context) return '';\n const entries = Object.entries(context)\n .filter(([key]) => key !== 'context')\n .map(([key, value]) => `${key}=${JSON.stringify(value)}`)\n .join(' ');\n return entries ? ` ${entries}` : '';\n };\n\n return {\n debug: (message: string, context?: LogContext): void => {\n if (shouldLog('debug')) {\n console.debug(`[${prefix}] ${message}${formatContext(context)}`);\n }\n },\n\n info: (message: string, context?: LogContext): void => {\n if (shouldLog('info')) {\n console.info(`[${prefix}] ${message}${formatContext(context)}`);\n }\n },\n\n warn: (message: string, context?: LogContext): void => {\n if (shouldLog('warn')) {\n console.warn(`[${prefix}] ${message}${formatContext(context)}`);\n }\n },\n\n error: (message: string, context?: LogContext, error?: Error): void => {\n if (shouldLog('error')) {\n console.error(\n `[${prefix}] ${message}${formatContext(context)}`,\n error ? `\\n${error.stack || error.message}` : ''\n );\n }\n },\n };\n}\n\n/**\n * No-op logger for production or when logging is disabled\n *\n * @returns A PluginLogger that does nothing\n */\nexport function createNoopLogger(): PluginLogger {\n const noop = (): void => {};\n return {\n debug: noop,\n info: noop,\n warn: noop,\n error: noop,\n };\n}\n","/**\n * @quilltap/plugin-types\n *\n * Type definitions for Quilltap plugin development.\n *\n * This package provides TypeScript types and interfaces for building\n * Quilltap plugins, including LLM providers, authentication providers,\n * and utility plugins.\n *\n * @packageDocumentation\n * @module @quilltap/plugin-types\n */\n\n// ============================================================================\n// Provider Interfaces — The Four Canonical Shapes\n// ============================================================================\n\nexport type {\n // Shape 1: Text -> Text\n TextProvider,\n LLMMessage,\n JSONSchemaDefinition,\n ResponseFormat,\n LLMParams,\n LLMResponse,\n StreamChunk,\n\n // Shape 2: Text -> Image\n ImageProvider,\n ImageOrientation,\n ImageGenParams,\n ImageLoraSpec,\n GeneratedImage,\n ImageGenResponse,\n\n // Shape 3: Text -> Vector\n EmbeddingProvider,\n EmbeddingResult,\n EmbeddingOptions,\n LocalEmbeddingProviderState,\n LocalEmbeddingProvider,\n\n // Shape 4: Text + Candidates -> Scores\n ScoringProvider,\n ScoringTask,\n ScoringInput,\n CategoryScore,\n ScoringResult,\n\n // Common types shared across shapes\n FileAttachment,\n TokenUsage,\n CacheUsage,\n AttachmentResults,\n ModelWarningLevel,\n ModelWarning,\n ModelMetadata,\n} from './providers';\n\nexport { isLocalEmbeddingProvider } from './providers';\n\n// ============================================================================\n// Deprecated Provider Aliases (backward compatibility)\n// ============================================================================\n\n/**\n * @deprecated Use `TextProvider` instead\n */\nexport type { TextProvider as LLMProvider } from './providers';\n\n/**\n * @deprecated Use `ImageProvider` instead\n */\nexport type { ImageProvider as ImageGenProvider } from './providers';\n\n// ============================================================================\n// LLM Tool Types\n// ============================================================================\n\nexport type {\n // Tool definitions\n OpenAIToolDefinition,\n UniversalTool,\n AnthropicToolDefinition,\n GoogleToolDefinition,\n\n // Tool calls\n ToolCall,\n ToolCallRequest,\n ToolResult,\n ToolFormatOptions,\n} from './llm/tools';\n\n// ============================================================================\n// Plugin Types\n// ============================================================================\n\nexport type {\n // Text provider plugin types (primary)\n TextProviderPlugin,\n ProviderMetadata,\n ProviderConfigRequirements,\n ProviderCapabilities,\n AttachmentSupport,\n ModelInfo,\n ThinkingTurnRule,\n EmbeddingModelInfo,\n ImageGenerationModelInfo,\n ImageStyleInfo,\n ImageLoraSupport,\n ImageProviderConstraints,\n OrientationStrategy,\n OrientationMapping,\n ImageOrientationSupport,\n IconProps,\n PluginIconData,\n ProviderPluginExport,\n // Runtime configuration types\n MessageFormatSupport,\n CheapModelConfig,\n ToolFormatType,\n // Deprecated alias\n LLMProviderPlugin,\n} from './plugins/provider';\n\nexport type {\n // Provider options schema (rendered by the connection-profile editor)\n ProviderOptionFieldType,\n ProviderOptionEnumValue,\n ProviderOptionDirective,\n ProviderOptionShowIf,\n ProviderOptionField,\n ProviderOptionGroup,\n ProviderOptionsSchema,\n ProviderOptionsSchemaContext,\n} from './plugins/provider-options';\n\nexport type {\n // Scoring provider plugin types (primary)\n ScoringProviderMetadata,\n ScoringProviderConfigRequirements,\n ScoringProviderPlugin,\n ScoringProviderPluginExport,\n} from './plugins/scoring-provider';\n\nexport type {\n // Manifest types\n PluginCapability,\n PluginCategory,\n PluginStatus,\n PluginAuthor,\n PluginCompatibility,\n ProviderConfig,\n SearchProviderConfig,\n PluginPermissions,\n PluginManifest,\n InstalledPluginInfo,\n} from './plugins/manifest';\n\nexport type {\n // Theme plugin types\n ColorPalette,\n Typography,\n Spacing,\n Effects,\n ThemeTokens,\n FontDefinition,\n EmbeddedFont,\n ThemeMetadata,\n SubsystemOverrides,\n ThemePlugin,\n ThemePluginExport,\n} from './plugins/theme';\n\nexport type {\n // Roleplay template plugin types\n NarrationDelimiters,\n RoleplayTemplateConfig,\n RoleplayTemplateMetadata,\n RoleplayTemplatePlugin,\n RoleplayTemplatePluginExport,\n} from './plugins/roleplay-template';\n\nexport type {\n // System prompt plugin types\n SystemPromptData,\n SystemPromptMetadata,\n SystemPromptPlugin,\n SystemPromptPluginExport,\n} from './plugins/system-prompt';\n\nexport type {\n // Tool plugin types\n ToolMetadata,\n ToolHierarchyInfo,\n ToolExecutionContext,\n ToolExecutionResult,\n ToolPlugin,\n ToolPluginExport,\n} from './plugins/tool';\n\nexport type {\n // Search provider plugin types\n SearchProviderMetadata,\n SearchProviderConfigRequirements,\n SearchResult,\n SearchOutput,\n SearchProviderPlugin,\n SearchProviderPluginExport,\n} from './plugins/search-provider';\n\nexport type {\n // Moderation provider plugin types (deprecated, use scoring)\n ModerationProviderMetadata,\n ModerationProviderConfigRequirements,\n ModerationCategoryResult,\n ModerationResult,\n ModerationProviderPlugin,\n ModerationProviderPluginExport,\n} from './plugins/moderation-provider';\n\n// ============================================================================\n// Common Types\n// ============================================================================\n\nexport type { LogLevel, LogContext, PluginLogger } from './common/logger';\n\nexport type {\n CharacterPluginDataEntry,\n CharacterPluginDataMap,\n} from './common/character-plugin-data';\n\n// Error classes (these are values, not just types)\nexport {\n PluginError,\n ApiKeyError,\n ProviderApiError,\n RateLimitError,\n ConfigurationError,\n ModelNotFoundError,\n AttachmentError,\n ToolExecutionError,\n} from './common/errors';\n\n// Logger factories\nexport { createConsoleLogger, createNoopLogger } from './common/logger';\n\n// ============================================================================\n// Version\n// ============================================================================\n\n/**\n * Version of the plugin-types package.\n * Can be used at runtime to check compatibility.\n */\nexport const PLUGIN_TYPES_VERSION = '2.6.0';\n"]}
|
package/dist/llm/index.d.mts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export { A as AnthropicToolDefinition, a as AttachmentResults, C as CacheUsage, E as EmbeddingOptions, b as EmbeddingProvider, c as EmbeddingResult, F as FileAttachment, G as GeneratedImage, d as GoogleToolDefinition, I as ImageGenParams, e as ImageGenProvider, f as ImageGenResponse, e as ImageProvider, J as JSONSchemaDefinition, L as LLMMessage,
|
|
1
|
+
export { A as AnthropicToolDefinition, a as AttachmentResults, C as CacheUsage, E as EmbeddingOptions, b as EmbeddingProvider, c as EmbeddingResult, F as FileAttachment, G as GeneratedImage, d as GoogleToolDefinition, I as ImageGenParams, e as ImageGenProvider, f as ImageGenResponse, e as ImageProvider, J as JSONSchemaDefinition, L as LLMMessage, i as LLMParams, T as LLMProvider, j as LLMResponse, k as LocalEmbeddingProvider, l as LocalEmbeddingProviderState, M as ModelMetadata, m as ModelWarning, n as ModelWarningLevel, O as OpenAIToolDefinition, R as ResponseFormat, S as StreamChunk, T as TextProvider, o as TokenUsage, p as ToolCall, q as ToolCallRequest, r as ToolFormatOptions, s as ToolResult, U as UniversalTool, t as isLocalEmbeddingProvider } from '../index-j7yKh7Ue.mjs';
|
package/dist/llm/index.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export { A as AnthropicToolDefinition, a as AttachmentResults, C as CacheUsage, E as EmbeddingOptions, b as EmbeddingProvider, c as EmbeddingResult, F as FileAttachment, G as GeneratedImage, d as GoogleToolDefinition, I as ImageGenParams, e as ImageGenProvider, f as ImageGenResponse, e as ImageProvider, J as JSONSchemaDefinition, L as LLMMessage,
|
|
1
|
+
export { A as AnthropicToolDefinition, a as AttachmentResults, C as CacheUsage, E as EmbeddingOptions, b as EmbeddingProvider, c as EmbeddingResult, F as FileAttachment, G as GeneratedImage, d as GoogleToolDefinition, I as ImageGenParams, e as ImageGenProvider, f as ImageGenResponse, e as ImageProvider, J as JSONSchemaDefinition, L as LLMMessage, i as LLMParams, T as LLMProvider, j as LLMResponse, k as LocalEmbeddingProvider, l as LocalEmbeddingProviderState, M as ModelMetadata, m as ModelWarning, n as ModelWarningLevel, O as OpenAIToolDefinition, R as ResponseFormat, S as StreamChunk, T as TextProvider, o as TokenUsage, p as ToolCall, q as ToolCallRequest, r as ToolFormatOptions, s as ToolResult, U as UniversalTool, t as isLocalEmbeddingProvider } from '../index-j7yKh7Ue.js';
|
package/dist/plugins/index.d.mts
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
export { A as AttachmentSupport, a as ColorPalette, E as Effects, b as EmbeddedFont, c as EmbeddingModelInfo, F as FontDefinition, I as IconProps, d as ImageGenerationModelInfo, e as
|
|
2
|
-
import '../index-
|
|
1
|
+
export { A as AttachmentSupport, a as ColorPalette, E as Effects, b as EmbeddedFont, c as EmbeddingModelInfo, F as FontDefinition, I as IconProps, d as ImageGenerationModelInfo, e as ImageLoraSupport, f as ImageOrientationSupport, g as ImageProviderConstraints, i as InstalledPluginInfo, L as LLMProviderPlugin, j as ModelInfo, k as ModerationCategoryResult, ad as ModerationProviderConfig, l as ModerationProviderConfigRequirements, m as ModerationProviderMetadata, n as ModerationProviderPlugin, o as ModerationProviderPluginExport, p as ModerationResult, O as OrientationMapping, q as OrientationStrategy, P as PluginAuthor, r as PluginCapability, s as PluginCategory, t as PluginCompatibility, v as PluginManifest, w as PluginPermissions, x as PluginStatus, y as ProviderCapabilities, z as ProviderConfig, B as ProviderConfigRequirements, D as ProviderMetadata, G as ProviderOptionDirective, H as ProviderOptionEnumValue, J as ProviderOptionField, K as ProviderOptionFieldType, N as ProviderOptionGroup, Q as ProviderOptionShowIf, R as ProviderOptionsSchema, S as ProviderOptionsSchemaContext, T as ProviderPluginExport, U as ScoringProviderConfigRequirements, V as ScoringProviderMetadata, W as ScoringProviderPlugin, X as ScoringProviderPluginExport, Y as SearchOutput, Z as SearchProviderConfig, _ as SearchProviderConfigRequirements, $ as SearchProviderMetadata, a0 as SearchProviderPlugin, a1 as SearchProviderPluginExport, a2 as SearchResult, a3 as Spacing, a5 as TextProviderPlugin, a6 as ThemeMetadata, a7 as ThemePlugin, a8 as ThemePluginExport, a9 as ThemeTokens, aa as ThinkingTurnRule, ac as Typography } from '../index-BhR1AYGC.mjs';
|
|
2
|
+
import '../index-j7yKh7Ue.mjs';
|
|
3
3
|
import '../providers/index.mjs';
|
package/dist/plugins/index.d.ts
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
export { A as AttachmentSupport, a as ColorPalette, E as Effects, b as EmbeddedFont, c as EmbeddingModelInfo, F as FontDefinition, I as IconProps, d as ImageGenerationModelInfo, e as
|
|
2
|
-
import '../index-
|
|
1
|
+
export { A as AttachmentSupport, a as ColorPalette, E as Effects, b as EmbeddedFont, c as EmbeddingModelInfo, F as FontDefinition, I as IconProps, d as ImageGenerationModelInfo, e as ImageLoraSupport, f as ImageOrientationSupport, g as ImageProviderConstraints, i as InstalledPluginInfo, L as LLMProviderPlugin, j as ModelInfo, k as ModerationCategoryResult, ad as ModerationProviderConfig, l as ModerationProviderConfigRequirements, m as ModerationProviderMetadata, n as ModerationProviderPlugin, o as ModerationProviderPluginExport, p as ModerationResult, O as OrientationMapping, q as OrientationStrategy, P as PluginAuthor, r as PluginCapability, s as PluginCategory, t as PluginCompatibility, v as PluginManifest, w as PluginPermissions, x as PluginStatus, y as ProviderCapabilities, z as ProviderConfig, B as ProviderConfigRequirements, D as ProviderMetadata, G as ProviderOptionDirective, H as ProviderOptionEnumValue, J as ProviderOptionField, K as ProviderOptionFieldType, N as ProviderOptionGroup, Q as ProviderOptionShowIf, R as ProviderOptionsSchema, S as ProviderOptionsSchemaContext, T as ProviderPluginExport, U as ScoringProviderConfigRequirements, V as ScoringProviderMetadata, W as ScoringProviderPlugin, X as ScoringProviderPluginExport, Y as SearchOutput, Z as SearchProviderConfig, _ as SearchProviderConfigRequirements, $ as SearchProviderMetadata, a0 as SearchProviderPlugin, a1 as SearchProviderPluginExport, a2 as SearchResult, a3 as Spacing, a5 as TextProviderPlugin, a6 as ThemeMetadata, a7 as ThemePlugin, a8 as ThemePluginExport, a9 as ThemeTokens, aa as ThinkingTurnRule, ac as Typography } from '../index-jf_ehLA9.js';
|
|
2
|
+
import '../index-j7yKh7Ue.js';
|
|
3
3
|
import '../providers/index.js';
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export { a as AttachmentResults, C as CacheUsage, E as EmbeddingOptions, b as EmbeddingProvider, c as EmbeddingResult, F as FileAttachment, G as GeneratedImage, I as ImageGenParams, f as ImageGenResponse, g as ImageOrientation, e as ImageProvider, J as JSONSchemaDefinition, L as LLMMessage,
|
|
1
|
+
export { a as AttachmentResults, C as CacheUsage, E as EmbeddingOptions, b as EmbeddingProvider, c as EmbeddingResult, F as FileAttachment, G as GeneratedImage, I as ImageGenParams, f as ImageGenResponse, g as ImageLoraSpec, h as ImageOrientation, e as ImageProvider, J as JSONSchemaDefinition, L as LLMMessage, i as LLMParams, j as LLMResponse, k as LocalEmbeddingProvider, l as LocalEmbeddingProviderState, M as ModelMetadata, m as ModelWarning, n as ModelWarningLevel, R as ResponseFormat, S as StreamChunk, T as TextProvider, o as TokenUsage, t as isLocalEmbeddingProvider } from '../index-j7yKh7Ue.mjs';
|
|
2
2
|
|
|
3
3
|
/**
|
|
4
4
|
* Scoring Provider — Shape 4: Text + Candidates -> Scores
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export { a as AttachmentResults, C as CacheUsage, E as EmbeddingOptions, b as EmbeddingProvider, c as EmbeddingResult, F as FileAttachment, G as GeneratedImage, I as ImageGenParams, f as ImageGenResponse, g as ImageOrientation, e as ImageProvider, J as JSONSchemaDefinition, L as LLMMessage,
|
|
1
|
+
export { a as AttachmentResults, C as CacheUsage, E as EmbeddingOptions, b as EmbeddingProvider, c as EmbeddingResult, F as FileAttachment, G as GeneratedImage, I as ImageGenParams, f as ImageGenResponse, g as ImageLoraSpec, h as ImageOrientation, e as ImageProvider, J as JSONSchemaDefinition, L as LLMMessage, i as LLMParams, j as LLMResponse, k as LocalEmbeddingProvider, l as LocalEmbeddingProviderState, M as ModelMetadata, m as ModelWarning, n as ModelWarningLevel, R as ResponseFormat, S as StreamChunk, T as TextProvider, o as TokenUsage, t as isLocalEmbeddingProvider } from '../index-j7yKh7Ue.js';
|
|
2
2
|
|
|
3
3
|
/**
|
|
4
4
|
* Scoring Provider — Shape 4: Text + Candidates -> Scores
|