@everworker/oneringai 0.1.3 → 0.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +41 -27
- package/dist/{ImageModel-BkAX5Rr5.d.ts → IProvider-DcYJ3YE-.d.ts} +25 -358
- package/dist/{ImageModel-DtN780fU.d.cts → IProvider-c4QCbPjn.d.cts} +25 -358
- package/dist/ImageModel-BJ2mVPGV.d.ts +337 -0
- package/dist/ImageModel-BWN6VVS6.d.cts +337 -0
- package/dist/Vendor-DYh_bzwo.d.cts +31 -0
- package/dist/Vendor-DYh_bzwo.d.ts +31 -0
- package/dist/capabilities/agents/index.d.cts +3 -2
- package/dist/capabilities/agents/index.d.ts +3 -2
- package/dist/capabilities/images/index.cjs +8 -1
- package/dist/capabilities/images/index.cjs.map +1 -1
- package/dist/capabilities/images/index.d.cts +3 -2
- package/dist/capabilities/images/index.d.ts +3 -2
- package/dist/capabilities/images/index.js +8 -1
- package/dist/capabilities/images/index.js.map +1 -1
- package/dist/{index-BmOYeqU7.d.ts → index-B5UaeEvK.d.ts} +10 -5
- package/dist/{index-DCzFlLoN.d.cts → index-MJ14lkui.d.cts} +10 -5
- package/dist/index.cjs +2020 -1094
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +733 -417
- package/dist/index.d.ts +733 -417
- package/dist/index.js +1898 -986
- package/dist/index.js.map +1 -1
- package/dist/shared/index.cjs +1780 -0
- package/dist/shared/index.cjs.map +1 -0
- package/dist/shared/index.d.cts +266 -0
- package/dist/shared/index.d.ts +266 -0
- package/dist/shared/index.js +1760 -0
- package/dist/shared/index.js.map +1 -0
- package/package.json +6 -4
- package/dist/IProvider-BP49c93d.d.cts +0 -22
- package/dist/IProvider-BP49c93d.d.ts +0 -22
|
@@ -1,34 +1,4 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
/**
|
|
4
|
-
* Supported AI Vendors
|
|
5
|
-
*
|
|
6
|
-
* Use this enum instead of string literals for type safety.
|
|
7
|
-
* These map to specific provider implementations.
|
|
8
|
-
*/
|
|
9
|
-
declare const Vendor: {
|
|
10
|
-
readonly OpenAI: "openai";
|
|
11
|
-
readonly Anthropic: "anthropic";
|
|
12
|
-
readonly Google: "google";
|
|
13
|
-
readonly GoogleVertex: "google-vertex";
|
|
14
|
-
readonly Groq: "groq";
|
|
15
|
-
readonly Together: "together";
|
|
16
|
-
readonly Perplexity: "perplexity";
|
|
17
|
-
readonly Grok: "grok";
|
|
18
|
-
readonly DeepSeek: "deepseek";
|
|
19
|
-
readonly Mistral: "mistral";
|
|
20
|
-
readonly Ollama: "ollama";
|
|
21
|
-
readonly Custom: "custom";
|
|
22
|
-
};
|
|
23
|
-
type Vendor = (typeof Vendor)[keyof typeof Vendor];
|
|
24
|
-
/**
|
|
25
|
-
* All vendor values as array (useful for validation)
|
|
26
|
-
*/
|
|
27
|
-
declare const VENDORS: ("openai" | "anthropic" | "google" | "google-vertex" | "groq" | "together" | "perplexity" | "grok" | "deepseek" | "mistral" | "ollama" | "custom")[];
|
|
28
|
-
/**
|
|
29
|
-
* Check if a string is a valid vendor
|
|
30
|
-
*/
|
|
31
|
-
declare function isVendor(value: string): value is Vendor;
|
|
1
|
+
import { V as Vendor } from './Vendor-DYh_bzwo.cjs';
|
|
32
2
|
|
|
33
3
|
/**
|
|
34
4
|
* Connector - Represents authenticated connection to ANY API
|
|
@@ -72,6 +42,8 @@ interface OAuthConnectorAuth {
|
|
|
72
42
|
audience?: string;
|
|
73
43
|
refreshBeforeExpiry?: number;
|
|
74
44
|
storageKey?: string;
|
|
45
|
+
/** Vendor-specific extra credentials */
|
|
46
|
+
extra?: Record<string, string>;
|
|
75
47
|
}
|
|
76
48
|
/**
|
|
77
49
|
* Static API key authentication
|
|
@@ -82,6 +54,11 @@ interface APIKeyConnectorAuth {
|
|
|
82
54
|
apiKey: string;
|
|
83
55
|
headerName?: string;
|
|
84
56
|
headerPrefix?: string;
|
|
57
|
+
/**
|
|
58
|
+
* Vendor-specific extra credentials beyond the primary API key.
|
|
59
|
+
* E.g., Slack Socket Mode needs { appToken: 'xapp-...', signingSecret: '...' }
|
|
60
|
+
*/
|
|
61
|
+
extra?: Record<string, string>;
|
|
85
62
|
}
|
|
86
63
|
/**
|
|
87
64
|
* JWT Bearer token authentication
|
|
@@ -97,6 +74,8 @@ interface JWTConnectorAuth {
|
|
|
97
74
|
issuer?: string;
|
|
98
75
|
subject?: string;
|
|
99
76
|
audience?: string;
|
|
77
|
+
/** Vendor-specific extra credentials */
|
|
78
|
+
extra?: Record<string, string>;
|
|
100
79
|
}
|
|
101
80
|
/**
|
|
102
81
|
* Complete connector configuration
|
|
@@ -503,336 +482,24 @@ declare class Connector {
|
|
|
503
482
|
}
|
|
504
483
|
|
|
505
484
|
/**
|
|
506
|
-
*
|
|
507
|
-
* This file provides the foundation for Image, Audio, and Video model registries
|
|
508
|
-
*/
|
|
509
|
-
|
|
510
|
-
/**
|
|
511
|
-
* Aspect ratios - normalized across all visual modalities (images, video)
|
|
512
|
-
*/
|
|
513
|
-
type AspectRatio$1 = '1:1' | '16:9' | '9:16' | '4:3' | '3:4' | '21:9' | '3:2' | '2:3';
|
|
514
|
-
/**
|
|
515
|
-
* Quality levels - normalized across vendors
|
|
516
|
-
* Providers map these to vendor-specific quality settings
|
|
517
|
-
*/
|
|
518
|
-
type QualityLevel = 'draft' | 'standard' | 'high' | 'ultra';
|
|
519
|
-
/**
|
|
520
|
-
* Audio output formats
|
|
521
|
-
*/
|
|
522
|
-
type AudioFormat = 'mp3' | 'opus' | 'aac' | 'flac' | 'wav' | 'pcm' | 'ogg';
|
|
523
|
-
/**
|
|
524
|
-
* Output format preference for media
|
|
525
|
-
*/
|
|
526
|
-
type OutputFormat = 'url' | 'base64' | 'buffer';
|
|
527
|
-
/**
|
|
528
|
-
* Source links for model documentation and maintenance
|
|
529
|
-
* Used to track where information came from and when it was last verified
|
|
530
|
-
*/
|
|
531
|
-
interface ISourceLinks {
|
|
532
|
-
/** Official documentation URL */
|
|
533
|
-
documentation: string;
|
|
534
|
-
/** Pricing page URL */
|
|
535
|
-
pricing?: string;
|
|
536
|
-
/** API reference URL */
|
|
537
|
-
apiReference?: string;
|
|
538
|
-
/** Additional reference (e.g., blog post, announcement) */
|
|
539
|
-
additional?: string;
|
|
540
|
-
/** Last verified date (YYYY-MM-DD) */
|
|
541
|
-
lastVerified: string;
|
|
542
|
-
}
|
|
543
|
-
/**
|
|
544
|
-
* Vendor-specific option schema for validation and documentation
|
|
545
|
-
* Used to describe vendor-specific options that fall outside semantic options
|
|
546
|
-
*/
|
|
547
|
-
interface VendorOptionSchema {
|
|
548
|
-
/** Data type of the option */
|
|
549
|
-
type: 'string' | 'number' | 'boolean' | 'enum' | 'array';
|
|
550
|
-
/** Description of the option */
|
|
551
|
-
description: string;
|
|
552
|
-
/** Whether the option is required */
|
|
553
|
-
required?: boolean;
|
|
554
|
-
/** UI display label */
|
|
555
|
-
label?: string;
|
|
556
|
-
/** Valid values for enum/string types */
|
|
557
|
-
enum?: string[];
|
|
558
|
-
/** Default value */
|
|
559
|
-
default?: unknown;
|
|
560
|
-
/** Minimum value for numbers */
|
|
561
|
-
min?: number;
|
|
562
|
-
/** Maximum value for numbers */
|
|
563
|
-
max?: number;
|
|
564
|
-
/** Step value for number sliders */
|
|
565
|
-
step?: number;
|
|
566
|
-
/** UI control type hint */
|
|
567
|
-
controlType?: 'select' | 'radio' | 'slider' | 'checkbox' | 'text' | 'textarea';
|
|
568
|
-
}
|
|
569
|
-
/**
|
|
570
|
-
* Base model description - shared by all registries
|
|
571
|
-
* Every model registry (Image, TTS, STT, Video) extends this
|
|
572
|
-
*/
|
|
573
|
-
interface IBaseModelDescription {
|
|
574
|
-
/** Model identifier (e.g., "dall-e-3", "tts-1") */
|
|
575
|
-
name: string;
|
|
576
|
-
/** Display name for UI (e.g., "DALL-E 3", "TTS-1") */
|
|
577
|
-
displayName: string;
|
|
578
|
-
/** Vendor/provider */
|
|
579
|
-
provider: Vendor;
|
|
580
|
-
/** Model description */
|
|
581
|
-
description?: string;
|
|
582
|
-
/** Whether the model is currently available */
|
|
583
|
-
isActive: boolean;
|
|
584
|
-
/** Release date (YYYY-MM-DD) */
|
|
585
|
-
releaseDate?: string;
|
|
586
|
-
/** Deprecation date if scheduled (YYYY-MM-DD) */
|
|
587
|
-
deprecationDate?: string;
|
|
588
|
-
/** Documentation/pricing links for maintenance */
|
|
589
|
-
sources: ISourceLinks;
|
|
590
|
-
}
|
|
591
|
-
|
|
592
|
-
/**
|
|
593
|
-
* Image generation provider interface
|
|
594
|
-
*/
|
|
595
|
-
|
|
596
|
-
interface ImageGenerateOptions {
|
|
597
|
-
model: string;
|
|
598
|
-
prompt: string;
|
|
599
|
-
size?: string;
|
|
600
|
-
aspectRatio?: string;
|
|
601
|
-
quality?: 'standard' | 'hd' | 'low' | 'medium' | 'high' | 'auto';
|
|
602
|
-
style?: 'vivid' | 'natural';
|
|
603
|
-
n?: number;
|
|
604
|
-
response_format?: 'url' | 'b64_json';
|
|
605
|
-
}
|
|
606
|
-
interface ImageEditOptions {
|
|
607
|
-
model: string;
|
|
608
|
-
image: Buffer | string;
|
|
609
|
-
prompt: string;
|
|
610
|
-
mask?: Buffer | string;
|
|
611
|
-
size?: string;
|
|
612
|
-
n?: number;
|
|
613
|
-
response_format?: 'url' | 'b64_json';
|
|
614
|
-
}
|
|
615
|
-
interface ImageVariationOptions {
|
|
616
|
-
model: string;
|
|
617
|
-
image: Buffer | string;
|
|
618
|
-
n?: number;
|
|
619
|
-
size?: string;
|
|
620
|
-
response_format?: 'url' | 'b64_json';
|
|
621
|
-
}
|
|
622
|
-
interface ImageResponse {
|
|
623
|
-
created: number;
|
|
624
|
-
data: Array<{
|
|
625
|
-
url?: string;
|
|
626
|
-
b64_json?: string;
|
|
627
|
-
revised_prompt?: string;
|
|
628
|
-
}>;
|
|
629
|
-
}
|
|
630
|
-
interface IImageProvider extends IProvider {
|
|
631
|
-
/**
|
|
632
|
-
* Generate images from text prompt
|
|
633
|
-
*/
|
|
634
|
-
generateImage(options: ImageGenerateOptions): Promise<ImageResponse>;
|
|
635
|
-
/**
|
|
636
|
-
* Edit an existing image (optional - not all providers support)
|
|
637
|
-
*/
|
|
638
|
-
editImage?(options: ImageEditOptions): Promise<ImageResponse>;
|
|
639
|
-
/**
|
|
640
|
-
* Create variations of an image (optional)
|
|
641
|
-
*/
|
|
642
|
-
createVariation?(options: ImageVariationOptions): Promise<ImageResponse>;
|
|
643
|
-
/**
|
|
644
|
-
* List available models
|
|
645
|
-
*/
|
|
646
|
-
listModels?(): Promise<string[]>;
|
|
647
|
-
}
|
|
648
|
-
|
|
649
|
-
/**
|
|
650
|
-
* Options for creating an ImageGeneration instance
|
|
651
|
-
*/
|
|
652
|
-
interface ImageGenerationCreateOptions {
|
|
653
|
-
/** Connector name or instance */
|
|
654
|
-
connector: string | Connector;
|
|
655
|
-
}
|
|
656
|
-
/**
|
|
657
|
-
* Simplified options for quick generation
|
|
485
|
+
* Base provider interface
|
|
658
486
|
*/
|
|
659
|
-
interface
|
|
660
|
-
|
|
661
|
-
|
|
662
|
-
|
|
663
|
-
|
|
664
|
-
/**
|
|
665
|
-
|
|
666
|
-
/** Quality setting */
|
|
667
|
-
quality?: 'standard' | 'hd';
|
|
668
|
-
/** Style setting (DALL-E 3 only) */
|
|
669
|
-
style?: 'vivid' | 'natural';
|
|
670
|
-
/** Number of images to generate */
|
|
671
|
-
n?: number;
|
|
672
|
-
/** Response format */
|
|
673
|
-
response_format?: 'url' | 'b64_json';
|
|
487
|
+
interface ProviderCapabilities {
|
|
488
|
+
text: boolean;
|
|
489
|
+
images: boolean;
|
|
490
|
+
videos: boolean;
|
|
491
|
+
audio: boolean;
|
|
492
|
+
/** Optional feature flags for specific capabilities */
|
|
493
|
+
features?: Record<string, boolean>;
|
|
674
494
|
}
|
|
675
|
-
|
|
676
|
-
|
|
677
|
-
|
|
678
|
-
|
|
679
|
-
private provider;
|
|
680
|
-
private connector;
|
|
681
|
-
private defaultModel;
|
|
682
|
-
private constructor();
|
|
683
|
-
/**
|
|
684
|
-
* Create an ImageGeneration instance
|
|
685
|
-
*/
|
|
686
|
-
static create(options: ImageGenerationCreateOptions): ImageGeneration;
|
|
687
|
-
/**
|
|
688
|
-
* Generate images from a text prompt
|
|
689
|
-
*/
|
|
690
|
-
generate(options: SimpleGenerateOptions): Promise<ImageResponse>;
|
|
691
|
-
/**
|
|
692
|
-
* Edit an existing image
|
|
693
|
-
* Note: Not all models/vendors support this
|
|
694
|
-
*/
|
|
695
|
-
edit(options: ImageEditOptions): Promise<ImageResponse>;
|
|
696
|
-
/**
|
|
697
|
-
* Create variations of an existing image
|
|
698
|
-
* Note: Only DALL-E 2 supports this
|
|
699
|
-
*/
|
|
700
|
-
createVariation(options: ImageVariationOptions): Promise<ImageResponse>;
|
|
701
|
-
/**
|
|
702
|
-
* List available models for this provider
|
|
703
|
-
*/
|
|
704
|
-
listModels(): Promise<string[]>;
|
|
705
|
-
/**
|
|
706
|
-
* Get information about a specific model
|
|
707
|
-
*/
|
|
708
|
-
getModelInfo(modelName: string): IImageModelDescription | undefined;
|
|
709
|
-
/**
|
|
710
|
-
* Get the underlying provider
|
|
711
|
-
*/
|
|
712
|
-
getProvider(): IImageProvider;
|
|
713
|
-
/**
|
|
714
|
-
* Get the current connector
|
|
715
|
-
*/
|
|
716
|
-
getConnector(): Connector;
|
|
717
|
-
/**
|
|
718
|
-
* Get the default model for this vendor
|
|
719
|
-
*/
|
|
720
|
-
private getDefaultModel;
|
|
495
|
+
interface IProvider {
|
|
496
|
+
readonly name: string;
|
|
497
|
+
readonly vendor?: string;
|
|
498
|
+
readonly capabilities: ProviderCapabilities;
|
|
721
499
|
/**
|
|
722
|
-
*
|
|
500
|
+
* Validate that the provider configuration is correct
|
|
723
501
|
*/
|
|
724
|
-
|
|
725
|
-
}
|
|
726
|
-
|
|
727
|
-
/**
|
|
728
|
-
* Image generation model registry with comprehensive metadata
|
|
729
|
-
*/
|
|
730
|
-
|
|
731
|
-
/**
|
|
732
|
-
* Supported image sizes by model
|
|
733
|
-
*/
|
|
734
|
-
type ImageSize = '256x256' | '512x512' | '1024x1024' | '1024x1536' | '1536x1024' | '1792x1024' | '1024x1792' | 'auto';
|
|
735
|
-
/**
|
|
736
|
-
* Supported aspect ratios
|
|
737
|
-
*/
|
|
738
|
-
type AspectRatio = '1:1' | '3:4' | '4:3' | '9:16' | '16:9' | '3:2' | '2:3';
|
|
739
|
-
/**
|
|
740
|
-
* Image model capabilities
|
|
741
|
-
*/
|
|
742
|
-
interface ImageModelCapabilities {
|
|
743
|
-
/** Supported image sizes */
|
|
744
|
-
sizes: readonly ImageSize[];
|
|
745
|
-
/** Supported aspect ratios (Google) */
|
|
746
|
-
aspectRatios?: readonly AspectRatio[];
|
|
747
|
-
/** Maximum number of images per request */
|
|
748
|
-
maxImagesPerRequest: number;
|
|
749
|
-
/** Supported output formats */
|
|
750
|
-
outputFormats: readonly string[];
|
|
751
|
-
/** Feature support flags */
|
|
752
|
-
features: {
|
|
753
|
-
/** Text-to-image generation */
|
|
754
|
-
generation: boolean;
|
|
755
|
-
/** Image editing/inpainting */
|
|
756
|
-
editing: boolean;
|
|
757
|
-
/** Image variations */
|
|
758
|
-
variations: boolean;
|
|
759
|
-
/** Style control */
|
|
760
|
-
styleControl: boolean;
|
|
761
|
-
/** Quality control (standard/hd) */
|
|
762
|
-
qualityControl: boolean;
|
|
763
|
-
/** Transparent backgrounds */
|
|
764
|
-
transparency: boolean;
|
|
765
|
-
/** Prompt revision/enhancement */
|
|
766
|
-
promptRevision: boolean;
|
|
767
|
-
};
|
|
768
|
-
/** Model limits */
|
|
769
|
-
limits: {
|
|
770
|
-
/** Maximum prompt length in characters */
|
|
771
|
-
maxPromptLength: number;
|
|
772
|
-
/** Rate limit (requests per minute) */
|
|
773
|
-
maxRequestsPerMinute?: number;
|
|
774
|
-
};
|
|
775
|
-
/** Vendor-specific options schema */
|
|
776
|
-
vendorOptions?: Record<string, VendorOptionSchema>;
|
|
777
|
-
}
|
|
778
|
-
/**
|
|
779
|
-
* Image model pricing
|
|
780
|
-
*/
|
|
781
|
-
interface ImageModelPricing {
|
|
782
|
-
/** Cost per image at standard quality */
|
|
783
|
-
perImageStandard?: number;
|
|
784
|
-
/** Cost per image at HD quality */
|
|
785
|
-
perImageHD?: number;
|
|
786
|
-
/** Cost per image (flat rate) */
|
|
787
|
-
perImage?: number;
|
|
788
|
-
currency: 'USD';
|
|
789
|
-
}
|
|
790
|
-
/**
|
|
791
|
-
* Complete image model description
|
|
792
|
-
*/
|
|
793
|
-
interface IImageModelDescription extends IBaseModelDescription {
|
|
794
|
-
capabilities: ImageModelCapabilities;
|
|
795
|
-
pricing?: ImageModelPricing;
|
|
502
|
+
validateConfig(): Promise<boolean>;
|
|
796
503
|
}
|
|
797
|
-
declare const IMAGE_MODELS: {
|
|
798
|
-
readonly openai: {
|
|
799
|
-
/** GPT-Image-1: Latest OpenAI image model with best quality */
|
|
800
|
-
readonly GPT_IMAGE_1: "gpt-image-1";
|
|
801
|
-
/** DALL-E 3: High quality image generation */
|
|
802
|
-
readonly DALL_E_3: "dall-e-3";
|
|
803
|
-
/** DALL-E 2: Fast, supports editing and variations */
|
|
804
|
-
readonly DALL_E_2: "dall-e-2";
|
|
805
|
-
};
|
|
806
|
-
readonly google: {
|
|
807
|
-
/** Imagen 4.0: Latest Google image generation model */
|
|
808
|
-
readonly IMAGEN_4_GENERATE: "imagen-4.0-generate-001";
|
|
809
|
-
/** Imagen 4.0 Ultra: Highest quality */
|
|
810
|
-
readonly IMAGEN_4_ULTRA: "imagen-4.0-ultra-generate-001";
|
|
811
|
-
/** Imagen 4.0 Fast: Optimized for speed */
|
|
812
|
-
readonly IMAGEN_4_FAST: "imagen-4.0-fast-generate-001";
|
|
813
|
-
};
|
|
814
|
-
readonly grok: {
|
|
815
|
-
/** Grok Imagine Image: xAI image generation with editing support */
|
|
816
|
-
readonly GROK_IMAGINE_IMAGE: "grok-imagine-image";
|
|
817
|
-
/** Grok 2 Image: xAI image generation (text-only input) */
|
|
818
|
-
readonly GROK_2_IMAGE_1212: "grok-2-image-1212";
|
|
819
|
-
};
|
|
820
|
-
};
|
|
821
|
-
/**
|
|
822
|
-
* Complete image model registry
|
|
823
|
-
* Last full audit: January 2026
|
|
824
|
-
*/
|
|
825
|
-
declare const IMAGE_MODEL_REGISTRY: Record<string, IImageModelDescription>;
|
|
826
|
-
declare const getImageModelInfo: (modelName: string) => IImageModelDescription | undefined;
|
|
827
|
-
declare const getImageModelsByVendor: (vendor: Vendor) => IImageModelDescription[];
|
|
828
|
-
declare const getActiveImageModels: () => IImageModelDescription[];
|
|
829
|
-
/**
|
|
830
|
-
* Get image models that support a specific feature
|
|
831
|
-
*/
|
|
832
|
-
declare function getImageModelsWithFeature(feature: keyof IImageModelDescription['capabilities']['features']): IImageModelDescription[];
|
|
833
|
-
/**
|
|
834
|
-
* Calculate estimated cost for image generation
|
|
835
|
-
*/
|
|
836
|
-
declare function calculateImageCost(modelName: string, imageCount: number, quality?: 'standard' | 'hd'): number | null;
|
|
837
504
|
|
|
838
|
-
export { type
|
|
505
|
+
export { type APIKeyConnectorAuth as A, type ConnectorAccessContext as C, DEFAULT_CONNECTOR_TIMEOUT as D, type IConnectorRegistry as I, type JWTConnectorAuth as J, type OAuthConnectorAuth as O, type ProviderCapabilities as P, type StoredToken as S, type IConnectorAccessPolicy as a, Connector as b, type IProvider as c, type ConnectorFetchOptions as d, type ITokenStorage as e, type ConnectorConfig as f, type ConnectorAuth as g, type ConnectorConfigResult as h, DEFAULT_MAX_RETRIES as i, DEFAULT_RETRYABLE_STATUSES as j, DEFAULT_BASE_DELAY_MS as k, DEFAULT_MAX_DELAY_MS as l };
|