@vibesdotdev/integrations-custom 0.0.0-stage → 1.0.0-rc.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (63) hide show
  1. package/LICENSE +126 -0
  2. package/README.md +18 -2
  3. package/dist/ai/index.d.ts +4 -0
  4. package/dist/ai/index.d.ts.map +1 -0
  5. package/dist/ai/index.js +4 -0
  6. package/dist/ai/index.js.map +1 -0
  7. package/dist/ai/provider.plugin.d.ts +6 -0
  8. package/dist/ai/provider.plugin.d.ts.map +1 -0
  9. package/dist/ai/provider.plugin.js +88 -0
  10. package/dist/ai/provider.plugin.js.map +1 -0
  11. package/dist/ai/providers/cloud/api/custom/config/config.custom.descriptor.d.ts +4194 -0
  12. package/dist/ai/providers/cloud/api/custom/config/config.custom.descriptor.d.ts.map +1 -0
  13. package/dist/ai/providers/cloud/api/custom/config/config.custom.descriptor.js +53 -0
  14. package/dist/ai/providers/cloud/api/custom/config/config.custom.descriptor.js.map +1 -0
  15. package/dist/ai/providers/cloud/api/custom/config/schemas/index.d.ts +29 -0
  16. package/dist/ai/providers/cloud/api/custom/config/schemas/index.d.ts.map +1 -0
  17. package/dist/ai/providers/cloud/api/custom/config/schemas/index.js +15 -0
  18. package/dist/ai/providers/cloud/api/custom/config/schemas/index.js.map +1 -0
  19. package/dist/ai/providers/cloud/api/custom/index.d.ts +5 -0
  20. package/dist/ai/providers/cloud/api/custom/index.d.ts.map +1 -0
  21. package/dist/ai/providers/cloud/api/custom/index.js +4 -0
  22. package/dist/ai/providers/cloud/api/custom/index.js.map +1 -0
  23. package/dist/ai/providers/cloud/api/custom/provider.custom.descriptor.d.ts +183 -0
  24. package/dist/ai/providers/cloud/api/custom/provider.custom.descriptor.d.ts.map +1 -0
  25. package/dist/ai/providers/cloud/api/custom/provider.custom.descriptor.js +72 -0
  26. package/dist/ai/providers/cloud/api/custom/provider.custom.descriptor.js.map +1 -0
  27. package/dist/ai/providers/custom/custom.provider.impl.d.ts +25 -0
  28. package/dist/ai/providers/custom/custom.provider.impl.d.ts.map +1 -0
  29. package/dist/ai/providers/custom/custom.provider.impl.js +182 -0
  30. package/dist/ai/providers/custom/custom.provider.impl.js.map +1 -0
  31. package/dist/ai/providers/custom/detection/index.d.ts +2 -0
  32. package/dist/ai/providers/custom/detection/index.d.ts.map +1 -0
  33. package/dist/ai/providers/custom/detection/index.js +2 -0
  34. package/dist/ai/providers/custom/detection/index.js.map +1 -0
  35. package/dist/ai/providers/custom/detection/system.d.ts +5 -0
  36. package/dist/ai/providers/custom/detection/system.d.ts.map +1 -0
  37. package/dist/ai/providers/custom/detection/system.js +30 -0
  38. package/dist/ai/providers/custom/detection/system.js.map +1 -0
  39. package/dist/ai/providers/custom/docs/ai.providers.custom.docs.descriptor.d.ts +4 -0
  40. package/dist/ai/providers/custom/docs/ai.providers.custom.docs.descriptor.d.ts.map +1 -0
  41. package/dist/ai/providers/custom/docs/ai.providers.custom.docs.descriptor.js +25 -0
  42. package/dist/ai/providers/custom/docs/ai.providers.custom.docs.descriptor.js.map +1 -0
  43. package/dist/ai/providers/custom/index.d.ts +5 -0
  44. package/dist/ai/providers/custom/index.d.ts.map +1 -0
  45. package/dist/ai/providers/custom/index.js +5 -0
  46. package/dist/ai/providers/custom/index.js.map +1 -0
  47. package/dist/ai/providers/custom/recommendations.d.ts +22 -0
  48. package/dist/ai/providers/custom/recommendations.d.ts.map +1 -0
  49. package/dist/ai/providers/custom/recommendations.js +70 -0
  50. package/dist/ai/providers/custom/recommendations.js.map +1 -0
  51. package/dist/index.d.ts +2 -0
  52. package/dist/index.d.ts.map +1 -0
  53. package/dist/index.js +2 -0
  54. package/dist/index.js.map +1 -0
  55. package/dist/schemas/catalog.d.ts +8 -0
  56. package/dist/schemas/catalog.d.ts.map +1 -0
  57. package/dist/schemas/catalog.js +3 -0
  58. package/dist/schemas/catalog.js.map +1 -0
  59. package/dist/schemas/detection.d.ts +7 -0
  60. package/dist/schemas/detection.d.ts.map +1 -0
  61. package/dist/schemas/detection.js +4 -0
  62. package/dist/schemas/detection.js.map +1 -0
  63. package/package.json +71 -4
@@ -0,0 +1 @@
1
+ {"version":3,"file":"config.custom.descriptor.d.ts","sourceRoot":"","sources":["../../../../../../../src/ai/providers/cloud/api/custom/config/config.custom.descriptor.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;yBAqD65pD,CAAC;;;;yBAA6V,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;6BAAo8E,CAAC;;;;6BAA6W,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iCAAilF,CAAC;;;;iCAA6X,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;6BAA2uF,CAAC;;;;6BAA6W,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iCAAgkF,CAAC;;;;iCAA6X,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;yBAA8vF,CAAC;;;;yBAA6V,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;6BAAo7E,CAAC;;;;6BAA6W,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iCAAilF,CAAC;;;;iCAA6X,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;6BAA4vF,CAAC;;;;6BAA6W,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iCAAgjF,CAAC;;;;iCAA6X,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;yBAA+wF,CAAC;;;;yBAA6V,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;6BAAo7E,CAAC;;;;6BAA6W,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iCAAgkF,CAAC;;;;iCAA6X,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;6BAA+vF,CAAC;;;;6BAA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;;;;;;;qBAAsnF,CAAC;;;;qBAA6U,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;yBAAwzE,CAAC;;;;yBAA6V,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;6BAAq9E,CAAC;;;;6BAA6W,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;yBAAwnF,CAAC;;;;yBAA6V,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;6BAAo7E,CAAC;;;;6BAA6W,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;qBAAuoF,CAAC;;;;qBAA6U,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;yBAAwzE,CAAC;;;;yBAA6V,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;6BAAo8E,CAAC;;;;6BAA6W,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;yBAA2nF,CAAC;;;;yBAA6V,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;6BAAo7E,CAAC;;;;6BAA6W,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAjD/ntpB,wBAgDG"}
@@ -0,0 +1,53 @@
1
+ import { createProviderConfigDescriptor } from '@vibesdotdev/ai/providers-runtime/core/config-descriptor';
2
+ import customProviderDescriptor from "../provider.custom.descriptor.js";
3
+ import { customConnectionSchema } from "./schemas/index.js";
4
+ export default createProviderConfigDescriptor({
5
+ provider: customProviderDescriptor,
6
+ schema: customConnectionSchema,
7
+ optionLabel: 'Custom OpenAI-Compatible',
8
+ optionDescription: 'Bring-your-own OpenAI-compatible endpoint',
9
+ optionIcon: '🔌',
10
+ fields: {
11
+ 'configuration.baseUrl': {
12
+ ui: {
13
+ label: 'Base URL',
14
+ description: 'OpenAI-compatible API origin, including any path prefix such as /v1',
15
+ placeholder: 'https://example.invalid/v1',
16
+ component: 'input',
17
+ group: 'connection',
18
+ order: 10
19
+ }
20
+ },
21
+ 'configuration.authType': {
22
+ ui: {
23
+ label: 'Auth type',
24
+ description: 'How the endpoint authenticates. none skips the credential field.',
25
+ placeholder: 'bearer',
26
+ component: 'select',
27
+ group: 'connection',
28
+ order: 11
29
+ }
30
+ },
31
+ 'configuration.apiKey': {
32
+ ui: {
33
+ label: 'API credential',
34
+ description: 'CredentialReference resolved at runtime. Never paste a raw secret.',
35
+ placeholder: 'CUSTOM_API_KEY',
36
+ component: 'secret',
37
+ group: 'connection',
38
+ order: 12
39
+ }
40
+ },
41
+ 'configuration.timeout': {
42
+ ui: {
43
+ label: 'Timeout',
44
+ description: 'Request timeout in milliseconds',
45
+ placeholder: '60000',
46
+ component: 'number',
47
+ group: 'connection',
48
+ order: 13
49
+ }
50
+ }
51
+ }
52
+ });
53
+ //# sourceMappingURL=config.custom.descriptor.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"config.custom.descriptor.js","sourceRoot":"","sources":["../../../../../../../src/ai/providers/cloud/api/custom/config/config.custom.descriptor.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,8BAA8B,EAAE,MAAM,0DAA0D,CAAC;AAC1G,OAAO,wBAAwB,MAAM,kCAAkC,CAAC;AACxE,OAAO,EAAE,sBAAsB,EAAE,MAAM,oBAAoB,CAAC;AAE5D,eAAe,8BAA8B,CAAC;IAC7C,QAAQ,EAAE,wBAAwB;IAClC,MAAM,EAAE,sBAAsB;IAC9B,WAAW,EAAE,0BAA0B;IACvC,iBAAiB,EAAE,2CAA2C;IAC9D,UAAU,EAAE,IAAI;IAChB,MAAM,EAAE;QACP,uBAAuB,EAAE;YACxB,EAAE,EAAE;gBACH,KAAK,EAAE,UAAU;gBACjB,WAAW,EAAE,qEAAqE;gBAClF,WAAW,EAAE,4BAA4B;gBACzC,SAAS,EAAE,OAAO;gBAClB,KAAK,EAAE,YAAY;gBACnB,KAAK,EAAE,EAAE;aACT;SACD;QACD,wBAAwB,EAAE;YACzB,EAAE,EAAE;gBACH,KAAK,EAAE,WAAW;gBAClB,WAAW,EAAE,kEAAkE;gBAC/E,WAAW,EAAE,QAAQ;gBACrB,SAAS,EAAE,QAAQ;gBACnB,KAAK,EAAE,YAAY;gBACnB,KAAK,EAAE,EAAE;aACT;SACD;QACD,sBAAsB,EAAE;YACvB,EAAE,EAAE;gBACH,KAAK,EAAE,gBAAgB;gBACvB,WAAW,EAAE,oEAAoE;gBACjF,WAAW,EAAE,gBAAgB;gBAC7B,SAAS,EAAE,QAAQ;gBACnB,KAAK,EAAE,YAAY;gBACnB,KAAK,EAAE,EAAE;aACT;SACD;QACD,uBAAuB,EAAE;YACxB,EAAE,EAAE;gBACH,KAAK,EAAE,SAAS;gBAChB,WAAW,EAAE,iCAAiC;gBAC9C,WAAW,EAAE,OAAO;gBACpB,SAAS,EAAE,QAAQ;gBACnB,KAAK,EAAE,YAAY;gBACnB,KAAK,EAAE,EAAE;aACT;SACD;KACD;CACD,CAAC,CAAC"}
@@ -0,0 +1,29 @@
1
+ import * as z from 'zod/v4';
2
+ export declare const customAuthTypeSchema: z.ZodEnum<{
3
+ none: "none";
4
+ bearer: "bearer";
5
+ api_key: "api_key";
6
+ basic: "basic";
7
+ }>;
8
+ export declare const customConnectionSchema: z.ZodObject<{
9
+ baseUrl: z.ZodString;
10
+ apiKey: z.ZodOptional<z.ZodDiscriminatedUnion<[z.ZodObject<{
11
+ source: z.ZodLiteral<"secret">;
12
+ key: z.ZodString;
13
+ store: z.ZodOptional<z.ZodString>;
14
+ }, z.core.$strict>, z.ZodObject<{
15
+ source: z.ZodLiteral<"inline">;
16
+ value: z.ZodString;
17
+ }, z.core.$strip>], "source">>;
18
+ authType: z.ZodDefault<z.ZodEnum<{
19
+ none: "none";
20
+ bearer: "bearer";
21
+ api_key: "api_key";
22
+ basic: "basic";
23
+ }>>;
24
+ headers: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
25
+ timeout: z.ZodDefault<z.ZodNumber>;
26
+ }, z.core.$strip>;
27
+ export type CustomAuthType = z.infer<typeof customAuthTypeSchema>;
28
+ export type CustomConnection = z.infer<typeof customConnectionSchema>;
29
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../../../src/ai/providers/cloud/api/custom/config/schemas/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,CAAC,MAAM,QAAQ,CAAC;AAG5B,eAAO,MAAM,oBAAoB;;;;;EAAiD,CAAC;AAEnF,eAAO,MAAM,sBAAsB;;;;;;;;;;;;;;;;;;iBAUjC,CAAC;AAEH,MAAM,MAAM,cAAc,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,oBAAoB,CAAC,CAAC;AAClE,MAAM,MAAM,gBAAgB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,sBAAsB,CAAC,CAAC"}
@@ -0,0 +1,15 @@
1
+ import * as z from 'zod/v4';
2
+ import { CredentialReferenceSchema } from '@vibesdotdev/ai/providers-runtime';
3
+ export const customAuthTypeSchema = z.enum(['none', 'bearer', 'api_key', 'basic']);
4
+ export const customConnectionSchema = z.object({
5
+ baseUrl: z.string().url().min(1, 'Base URL is required'),
6
+ apiKey: CredentialReferenceSchema.optional(),
7
+ authType: customAuthTypeSchema.default('bearer'),
8
+ headers: z.record(z.string().regex(/^[!#$%&'*+.^_`|~0-9A-Za-z-]+$/), z.string().regex(/^[^\r\n]*$/)).optional(),
9
+ timeout: z.number().int().positive().default(60000)
10
+ }).superRefine((config, ctx) => {
11
+ if (config.authType !== 'none' && !config.apiKey) {
12
+ ctx.addIssue({ code: 'custom', path: ['apiKey'], message: 'A credential reference is required for authentication' });
13
+ }
14
+ });
15
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../../../../src/ai/providers/cloud/api/custom/config/schemas/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,CAAC,MAAM,QAAQ,CAAC;AAC5B,OAAO,EAAE,yBAAyB,EAAE,MAAM,mCAAmC,CAAC;AAE9E,MAAM,CAAC,MAAM,oBAAoB,GAAG,CAAC,CAAC,IAAI,CAAC,CAAC,MAAM,EAAE,QAAQ,EAAE,SAAS,EAAE,OAAO,CAAC,CAAC,CAAC;AAEnF,MAAM,CAAC,MAAM,sBAAsB,GAAG,CAAC,CAAC,MAAM,CAAC;IAC9C,OAAO,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,EAAE,CAAC,GAAG,CAAC,CAAC,EAAE,sBAAsB,CAAC;IACxD,MAAM,EAAE,yBAAyB,CAAC,QAAQ,EAAE;IAC5C,QAAQ,EAAE,oBAAoB,CAAC,OAAO,CAAC,QAAQ,CAAC;IAChD,OAAO,EAAE,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,MAAM,EAAE,CAAC,KAAK,CAAC,+BAA+B,CAAC,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,KAAK,CAAC,YAAY,CAAC,CAAC,CAAC,QAAQ,EAAE;IAC/G,OAAO,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,EAAE,CAAC,QAAQ,EAAE,CAAC,OAAO,CAAC,KAAK,CAAC;CACnD,CAAC,CAAC,WAAW,CAAC,CAAC,MAAM,EAAE,GAAG,EAAE,EAAE;IAC9B,IAAI,MAAM,CAAC,QAAQ,KAAK,MAAM,IAAI,CAAC,MAAM,CAAC,MAAM,EAAE,CAAC;QAClD,GAAG,CAAC,QAAQ,CAAC,EAAE,IAAI,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC,QAAQ,CAAC,EAAE,OAAO,EAAE,uDAAuD,EAAE,CAAC,CAAC;IACtH,CAAC;AACF,CAAC,CAAC,CAAC"}
@@ -0,0 +1,5 @@
1
+ export { default as customProviderDescriptor } from './provider.custom.descriptor.ts';
2
+ export { default as customProviderConfigDescriptor } from './config/config.custom.descriptor.ts';
3
+ export { customConnectionSchema, customAuthTypeSchema } from './config/schemas/index.ts';
4
+ export type { CustomConnection, CustomAuthType } from './config/schemas/index.ts';
5
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../src/ai/providers/cloud/api/custom/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,IAAI,wBAAwB,EAAE,MAAM,iCAAiC,CAAC;AACtF,OAAO,EAAE,OAAO,IAAI,8BAA8B,EAAE,MAAM,sCAAsC,CAAC;AACjG,OAAO,EAAE,sBAAsB,EAAE,oBAAoB,EAAE,MAAM,2BAA2B,CAAC;AACzF,YAAY,EAAE,gBAAgB,EAAE,cAAc,EAAE,MAAM,2BAA2B,CAAC"}
@@ -0,0 +1,4 @@
1
+ export { default as customProviderDescriptor } from "./provider.custom.descriptor.js";
2
+ export { default as customProviderConfigDescriptor } from "./config/config.custom.descriptor.js";
3
+ export { customConnectionSchema, customAuthTypeSchema } from "./config/schemas/index.js";
4
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../../src/ai/providers/cloud/api/custom/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,IAAI,wBAAwB,EAAE,MAAM,iCAAiC,CAAC;AACtF,OAAO,EAAE,OAAO,IAAI,8BAA8B,EAAE,MAAM,sCAAsC,CAAC;AACjG,OAAO,EAAE,sBAAsB,EAAE,oBAAoB,EAAE,MAAM,2BAA2B,CAAC"}
@@ -0,0 +1,183 @@
1
+ declare const _default: {
2
+ id: string;
3
+ kind: "ai/provider";
4
+ name: string;
5
+ version: string;
6
+ connectionSchema: unknown;
7
+ priority: number;
8
+ enabled: boolean;
9
+ description?: string | undefined;
10
+ defaults?: Record<string, unknown> | undefined;
11
+ baseUrlTemplate?: string | undefined;
12
+ capabilities?: {
13
+ [x: string]: unknown;
14
+ modalities?: ("vision" | "image" | "text" | "audio" | "video" | "embedding" | "transcription" | "evaluation")[] | undefined;
15
+ authType?: "none" | "bearer" | "api_key" | "basic" | "oauth" | undefined;
16
+ authMethods?: {
17
+ [x: string]: unknown;
18
+ id: string;
19
+ type: "none" | "bearer" | "api_key" | "basic" | "oauth";
20
+ label: string;
21
+ credentialFields: string[];
22
+ enabled: boolean;
23
+ description?: string | undefined;
24
+ tokenSource?: "none" | "runtime" | "credential" | "oauth-browser" | "oauth-device-code" | undefined;
25
+ recommended?: boolean | undefined;
26
+ docsUrl?: string | undefined;
27
+ scopes?: string[] | undefined;
28
+ execution?: {
29
+ credentialCustodies: ("consumer" | "server")[];
30
+ billingOwners: ("user" | "organization" | "platform")[];
31
+ } | undefined;
32
+ }[] | undefined;
33
+ streaming?: boolean | undefined;
34
+ tools?: boolean | undefined;
35
+ vision?: boolean | undefined;
36
+ jsonMode?: boolean | undefined;
37
+ functionCalling?: boolean | undefined;
38
+ contextWindow?: number | undefined;
39
+ maxOutputTokens?: number | undefined;
40
+ } | undefined;
41
+ category?: "cloud" | "local" | "hybrid" | undefined;
42
+ hardware?: ("cloud" | "consumer")[] | undefined;
43
+ icon?: string | undefined;
44
+ branding?: {
45
+ [x: string]: unknown;
46
+ logo?: {
47
+ [x: string]: unknown;
48
+ kind: "wordmark" | "mark" | "lockup" | "badge";
49
+ format: "svg";
50
+ path: string;
51
+ sourceUrl: string;
52
+ sourcePageUrl: string;
53
+ source: "official-brand-page" | "official-brand-kit" | "official-homepage-inline" | "official-cdn" | "official-github";
54
+ theme: "any" | "light" | "dark";
55
+ usageNotes?: string | undefined;
56
+ licenseNotes?: string | undefined;
57
+ } | undefined;
58
+ darkLogo?: {
59
+ [x: string]: unknown;
60
+ kind: "wordmark" | "mark" | "lockup" | "badge";
61
+ format: "svg";
62
+ path: string;
63
+ sourceUrl: string;
64
+ sourcePageUrl: string;
65
+ source: "official-brand-page" | "official-brand-kit" | "official-homepage-inline" | "official-cdn" | "official-github";
66
+ theme: "any" | "light" | "dark";
67
+ usageNotes?: string | undefined;
68
+ licenseNotes?: string | undefined;
69
+ } | undefined;
70
+ wordmark?: {
71
+ [x: string]: unknown;
72
+ kind: "wordmark" | "mark" | "lockup" | "badge";
73
+ format: "svg";
74
+ path: string;
75
+ sourceUrl: string;
76
+ sourcePageUrl: string;
77
+ source: "official-brand-page" | "official-brand-kit" | "official-homepage-inline" | "official-cdn" | "official-github";
78
+ theme: "any" | "light" | "dark";
79
+ usageNotes?: string | undefined;
80
+ licenseNotes?: string | undefined;
81
+ } | undefined;
82
+ darkWordmark?: {
83
+ [x: string]: unknown;
84
+ kind: "wordmark" | "mark" | "lockup" | "badge";
85
+ format: "svg";
86
+ path: string;
87
+ sourceUrl: string;
88
+ sourcePageUrl: string;
89
+ source: "official-brand-page" | "official-brand-kit" | "official-homepage-inline" | "official-cdn" | "official-github";
90
+ theme: "any" | "light" | "dark";
91
+ usageNotes?: string | undefined;
92
+ licenseNotes?: string | undefined;
93
+ } | undefined;
94
+ sourcePageUrl?: string | undefined;
95
+ usageNotes?: string | undefined;
96
+ } | undefined;
97
+ docsUrl?: string | undefined;
98
+ tags?: string[] | undefined;
99
+ variants?: {
100
+ id: string;
101
+ label: string;
102
+ transport: string;
103
+ specId: string;
104
+ endpoint: string;
105
+ auth: {
106
+ kind: "none";
107
+ } | {
108
+ kind: "bearer";
109
+ token: string | {
110
+ source: "secret";
111
+ key: string;
112
+ store?: string | undefined;
113
+ };
114
+ scheme?: string | undefined;
115
+ } | {
116
+ kind: "api-key-header";
117
+ header: string;
118
+ value: string | {
119
+ source: "secret";
120
+ key: string;
121
+ store?: string | undefined;
122
+ };
123
+ } | {
124
+ kind: "basic";
125
+ username: string;
126
+ password: string | {
127
+ source: "secret";
128
+ key: string;
129
+ store?: string | undefined;
130
+ };
131
+ } | {
132
+ kind: "cf-binding";
133
+ bindingName: string;
134
+ };
135
+ modelIdRule: {
136
+ kind: "strip-prefix";
137
+ } | {
138
+ kind: "passthrough";
139
+ } | {
140
+ kind: "explicit";
141
+ modelMap: Record<string, string>;
142
+ };
143
+ priority: number;
144
+ enabled: boolean;
145
+ description?: string | undefined;
146
+ modalities?: ("image" | "text" | "audio" | "video" | "embedding" | "transcription" | "evaluation" | "speech" | "ocr")[] | undefined;
147
+ inheritEnv?: string[] | undefined;
148
+ requiredConfiguration?: string[] | undefined;
149
+ authMethodId?: string | undefined;
150
+ execution?: {
151
+ generationLocations: ("consumer" | "server")[];
152
+ headless: boolean;
153
+ } | undefined;
154
+ tags?: string[] | undefined;
155
+ models?: {
156
+ tags?: string[] | undefined;
157
+ } | undefined;
158
+ additionalHeaders?: Record<string, string> | undefined;
159
+ capabilities?: {
160
+ supportsToolChoiceRequired?: boolean | undefined;
161
+ } | undefined;
162
+ }[] | undefined;
163
+ localDiscovery?: {
164
+ defaultRootDir: string;
165
+ modelGlob: string;
166
+ descriptorFilename?: string | undefined;
167
+ } | undefined;
168
+ loadedModels?: {
169
+ path: string;
170
+ listPath: string;
171
+ idField: string;
172
+ loadedField: string;
173
+ loginPath?: string | undefined;
174
+ loginKeyField?: string | undefined;
175
+ } | undefined;
176
+ cloudStorageDiscovery?: {
177
+ requiredCapabilities: string[];
178
+ modelGlob?: string | undefined;
179
+ descriptorFilename?: string | undefined;
180
+ } | undefined;
181
+ };
182
+ export default _default;
183
+ //# sourceMappingURL=provider.custom.descriptor.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"provider.custom.descriptor.d.ts","sourceRoot":"","sources":["../../../../../../src/ai/providers/cloud/api/custom/provider.custom.descriptor.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAQA,wBAgEG"}
@@ -0,0 +1,72 @@
1
+ /**
2
+ * Custom OpenAI-compatible provider type descriptor.
3
+ *
4
+ * Pure data: does not construct a client or resolve credentials.
5
+ */
6
+ import { createAIProviderTypeDescriptor } from '@vibesdotdev/ai/providers-runtime/core/type-descriptor';
7
+ import { customConnectionSchema } from "./config/schemas/index.js";
8
+ export default createAIProviderTypeDescriptor({
9
+ id: 'custom',
10
+ version: '0.1.0-rc.0',
11
+ name: 'Custom OpenAI-Compatible',
12
+ description: 'Bring your own OpenAI-compatible endpoint for self-hosted, proxied, or vendor-specific APIs. ' +
13
+ 'Credentials stay as CredentialReference values until the runtime boundary resolves them.',
14
+ connectionSchema: customConnectionSchema,
15
+ defaults: {
16
+ authType: 'bearer',
17
+ timeout: 60000
18
+ },
19
+ capabilities: {
20
+ modalities: ['text'],
21
+ authType: 'bearer',
22
+ authMethods: [
23
+ {
24
+ id: 'api-key', type: 'bearer', label: 'API key',
25
+ description: 'Bearer token stored as a credential reference.',
26
+ tokenSource: 'credential', credentialFields: ['apiKey'], recommended: true, enabled: true
27
+ },
28
+ {
29
+ id: 'none', type: 'none', label: 'No authentication',
30
+ description: 'An endpoint already configured to serve without authentication.',
31
+ tokenSource: 'none', credentialFields: [], enabled: true
32
+ }
33
+ ],
34
+ streaming: true,
35
+ tools: true,
36
+ vision: false,
37
+ jsonMode: true,
38
+ functionCalling: true
39
+ },
40
+ category: 'hybrid',
41
+ hardware: ['consumer', 'cloud'],
42
+ icon: '🔌',
43
+ docsUrl: 'https://platform.openai.com/docs/api-reference',
44
+ priority: 40,
45
+ enabled: true,
46
+ tags: ['custom', 'openai-compatible', 'self-hosted', 'byo'],
47
+ variants: [
48
+ {
49
+ id: 'openai-chat',
50
+ label: 'Custom OpenAI-compatible chat',
51
+ description: 'Text generation via a user-supplied OpenAI-compatible /chat/completions endpoint.',
52
+ transport: 'fetch',
53
+ specId: 'openai-chat',
54
+ endpoint: '{baseUrl}',
55
+ auth: { kind: 'bearer', token: { source: 'secret', key: 'CUSTOM_API_KEY' } },
56
+ authMethodId: 'api-key',
57
+ tags: ['auth:api-key'],
58
+ modelIdRule: { kind: 'strip-prefix' },
59
+ priority: 10,
60
+ enabled: true
61
+ },
62
+ {
63
+ id: 'openai-chat-no-auth',
64
+ label: 'Custom OpenAI-compatible chat (no authentication)',
65
+ description: 'Text chat on an explicitly unauthenticated endpoint.',
66
+ transport: 'fetch', specId: 'openai-chat', endpoint: '{baseUrl}',
67
+ auth: { kind: 'none' }, authMethodId: 'none', tags: ['auth:none'],
68
+ modelIdRule: { kind: 'strip-prefix' }, priority: 5, enabled: true
69
+ }
70
+ ]
71
+ });
72
+ //# sourceMappingURL=provider.custom.descriptor.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"provider.custom.descriptor.js","sourceRoot":"","sources":["../../../../../../src/ai/providers/cloud/api/custom/provider.custom.descriptor.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,OAAO,EAAE,8BAA8B,EAAE,MAAM,wDAAwD,CAAC;AACxG,OAAO,EAAE,sBAAsB,EAAE,MAAM,2BAA2B,CAAC;AAEnE,eAAe,8BAA8B,CAAC;IAC7C,EAAE,EAAE,QAAQ;IACZ,OAAO,EAAE,YAAY;IACrB,IAAI,EAAE,0BAA0B;IAChC,WAAW,EACV,+FAA+F;QAC/F,0FAA0F;IAC3F,gBAAgB,EAAE,sBAAsB;IACxC,QAAQ,EAAE;QACT,QAAQ,EAAE,QAAQ;QAClB,OAAO,EAAE,KAAK;KACd;IACD,YAAY,EAAE;QACb,UAAU,EAAE,CAAC,MAAM,CAAC;QACpB,QAAQ,EAAE,QAAQ;QAClB,WAAW,EAAE;YACZ;gBACC,EAAE,EAAE,SAAS,EAAE,IAAI,EAAE,QAAQ,EAAE,KAAK,EAAE,SAAS;gBAC/C,WAAW,EAAE,gDAAgD;gBAC7D,WAAW,EAAE,YAAY,EAAE,gBAAgB,EAAE,CAAC,QAAQ,CAAC,EAAE,WAAW,EAAE,IAAI,EAAE,OAAO,EAAE,IAAI;aACzF;YACD;gBACC,EAAE,EAAE,MAAM,EAAE,I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I,EAAE,CAAC,WAAW,CAAC;YACjE,WAAW,EAAE,EAAE,IAAI,EAAE,cAAc,EAAE,EAAE,QAAQ,EAAE,CAAC,EAAE,OAAO,EAAE,IAAI;SACjE;KACD;CACD,CAAC,CAAC"}
@@ -0,0 +1,25 @@
1
+ import type { AIProviderTypeContext, AIProviderTypeInterface, ConnectionValidationResult, DetectedProviderInstance, ModelRecommendation, ProviderGenerateOptions, ProviderGenerateResult, ProviderHealthCheckResult, ProviderOperationOptions } from '@vibesdotdev/ai/interfaces/provider-type';
2
+ import type { GenerationRequest } from '@vibesdotdev/ai/interfaces/adapter';
3
+ import type { AIModelDescriptor, Modality } from '@vibesdotdev/ai/models/schemas';
4
+ import type { AIProviderDescriptor } from '@vibesdotdev/ai/providers-runtime/schemas/provider-descriptor';
5
+ import type { AIProviderTypeDescriptor } from '@vibesdotdev/ai/providers-runtime/schemas/type-descriptor';
6
+ import { type ConfigurationRecord } from '@vibesdotdev/ai/providers-runtime';
7
+ export declare class CustomProviderType implements AIProviderTypeInterface {
8
+ readonly descriptor: AIProviderTypeDescriptor;
9
+ private readonly context;
10
+ constructor(descriptor: AIProviderTypeDescriptor, context: AIProviderTypeContext);
11
+ generate<T extends Modality>(provider: AIProviderDescriptor, model: AIModelDescriptor, request: GenerationRequest<T>, options?: ProviderGenerateOptions): Promise<ProviderGenerateResult<T>>;
12
+ detectInstalled(): Promise<DetectedProviderInstance[]>;
13
+ recommendModels(): Promise<ModelRecommendation[]>;
14
+ private resolveCredential;
15
+ private authorizationHeader;
16
+ private requestHeaders;
17
+ listModels(providerInstance: AIProviderDescriptor, options?: ProviderOperationOptions & {
18
+ modality?: string;
19
+ live?: boolean;
20
+ }): Promise<AIModelDescriptor[]>;
21
+ checkHealth(config: ConfigurationRecord, options?: ProviderOperationOptions): Promise<ProviderHealthCheckResult>;
22
+ validateConnection(config: ConfigurationRecord): Promise<ConnectionValidationResult>;
23
+ dispose(): Promise<void>;
24
+ }
25
+ //# sourceMappingURL=custom.prov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AE,wBAAwB,GAAG;QAAE,QAAQ,CAAC,EAAE,MAAM,CAAC;QAAC,IAAI,CAAC,EAAE,OAAO,CAAA;KAAE,GACxE,OAAO,CAAC,iBAAiB,EAAE,CAAC;IA2CzB,WAAW,CAChB,MAAM,EAAE,mBAAmB,EAC3B,OAAO,CAAC,EAAE,wBAAwB,GAChC,OAAO,CAAC,yBAAyB,CAAC;IA0C/B,kBAAkB,CAAC,MAAM,EAAE,mBAAmB,GAAG,OAAO,CAAC,0BAA0B,CAAC;IAQpF,OAAO,IAAI,OAAO,CAAC,IAAI,CAAC;CAC9B"}
@@ -0,0 +1,182 @@
1
+ import { assertNoPlaintextCredentials, resolveSecretReference } from '@vibesdotdev/ai/providers-runtime';
2
+ import { fetchAIProvider } from '@vibesdotdev/ai/providers-runtime/client';
3
+ import { getVibesAIClient } from '@vibesdotdev/ai/client';
4
+ import { customConnectionSchema } from "../cloud/api/custom/config/schemas/index.js";
5
+ import { customCatalogSchema } from "../../../schemas/catalog.js";
6
+ import { AnyGenerationRequestSchema } from '@vibesdotdev/ai/generation/execution/schemas/request';
7
+ import { createAIModelDescriptor } from '@vibesdotdev/ai/models/schemas';
8
+ import { getVibesModelId } from '@vibesdotdev/ai/metadata/ids';
9
+ import { isCredentialReference } from '@vibesdotdev/ai/providers-runtime';
10
+ import { CapabilityError, isCapabilityError, settle } from '@vibesdotdev/kernel';
11
+ import { detectCustomSystem } from "./detection/system.js";
12
+ function connection(config) {
13
+ const parsed = customConnectionSchema.safeParse(config);
14
+ if (!parsed.success)
15
+ throw new CapabilityError('Invalid custom endpoint configuration', 'INVALID_INPUT', {
16
+ reason: 'custom-configuration-invalid'
17
+ });
18
+ return parsed.data;
19
+ }
20
+ export class CustomProviderType {
21
+ descriptor;
22
+ context;
23
+ constructor(descriptor, context) {
24
+ this.descriptor = descriptor;
25
+ this.context = context;
26
+ }
27
+ async generate(provider, model, request, options) {
28
+ const ai = await getVibesAIClient(this.context.runtime);
29
+ const response = await ai.requestGeneration({
30
+ ...AnyGenerationRequestSchema.parse(request), provider, model
31
+ }, {
32
+ ...options,
33
+ metadata: { ...options?.metadata, scope: options?.scope, specId: options?.specId, capability: options?.capability }
34
+ });
35
+ return { response, adapterId: 'ai/generation', generationMethod: 'runtime' };
36
+ }
37
+ async detectInstalled() {
38
+ const detected = await detectCustomSystem(this.context.runtime);
39
+ return detected
40
+ ? [{ name: detected.name, source: 'system', config: detected.configuration ?? {} }]
41
+ : [];
42
+ }
43
+ async recommendModels() {
44
+ return [
45
+ {
46
+ modelId: 'custom:configured-model',
47
+ modelName: 'Configured custom model',
48
+ score: 70,
49
+ reason: 'Use the model id advertised by the configured OpenAI-compatible endpoint',
50
+ capabilities: ['chat', 'tools'],
51
+ useCaseFit: 70
52
+ }
53
+ ];
54
+ }
55
+ async resolveCredential(config, options) {
56
+ const reference = config.apiKey;
57
+ assertNoPlaintextCredentials({ apiKey: reference });
58
+ if (!isCredentialReference(reference) || reference.source === 'inline')
59
+ return undefined;
60
+ if (options?.resolveCredential)
61
+ return options.resolveCredential(reference);
62
+ return resolveSecretReference(reference, this.context.runtime);
63
+ }
64
+ authorizationHeader(authType, secret) {
65
+ if (authType === 'none' || !secret)
66
+ return undefined;
67
+ if (authType === 'api_key')
68
+ return secret;
69
+ if (authType === 'basic') {
70
+ return secret.startsWith('Basic ') ? secret : `Basic ${secret}`;
71
+ }
72
+ return secret.startsWith('Bearer ') ? secret : `Bearer ${secret}`;
73
+ }
74
+ async requestHeaders(config, options) {
75
+ const authType = config.authType;
76
+ const secret = authType === 'none' ? undefined : await this.resolveCredential(config, options);
77
+ if (authType !== 'none' && !secret)
78
+ throw new CapabilityError('Custom endpoint credential is unavailable', 'AUTH_REQUIRED', {
79
+ reason: 'custom-credential-unavailable'
80
+ });
81
+ const headers = new Headers(config.headers);
82
+ const authorization = this.authorizationHeader(authType, secret);
83
+ if (authorization)
84
+ headers.set('authorization', authorization);
85
+ return headers;
86
+ }
87
+ async listModels(providerInstance, options) {
88
+ // This provider executes over an OpenAI-compatible text API. A /models
89
+ // response declares no model's kind, so each listed model is a text model
90
+ // of that endpoint that claims no capability (not chat, vision, tool use
91
+ // or embedding) and no model type: it stays unclassified.
92
+ if (options?.modality && options.modality !== 'text')
93
+ return [];
94
+ const config = connection(providerInstance.configuration ?? {});
95
+ const baseUrl = config.baseUrl;
96
+ const headers = await this.requestHeaders(config, options);
97
+ const wait = {
98
+ timeoutMs: options?.timeout ?? config.timeout,
99
+ reason: 'custom model catalog'
100
+ };
101
+ if (options?.signal)
102
+ wait.signal = options.signal;
103
+ const fetched = await settle(() => this.context.runtime.lifecycle.wait(async (signal) => {
104
+ const response = await fetchAIProvider(this.context, `${baseUrl.replace(/\/+$/, '')}/models`, { headers, signal });
105
+ if (!response.ok)
106
+ throw new CapabilityError(`Custom model catalog returned HTTP ${response.status}`, 'UNAVAILABLE', {
107
+ reason: 'custom-catalog-failed'
108
+ });
109
+ const decoded = await settle(() => response.json());
110
+ const catalog = customCatalogSchema.safeParse(decoded.ok ? decoded.value : undefined);
111
+ if (!catalog.success)
112
+ throw new CapabilityError('Custom model catalog must contain data entries with non-empty model ids', 'INVALID_INPUT', {
113
+ reason: 'custom-catalog-malformed'
114
+ });
115
+ return catalog.data;
116
+ }, wait));
117
+ if (!fetched.ok) {
118
+ if (isCapabilityError(fetched.cause))
119
+ throw fetched.cause;
120
+ throw new CapabilityError('Custom model catalog request failed', 'UNAVAILABLE', { reason: 'custom-catalog-failed' });
121
+ }
122
+ const catalog = fetched.value;
123
+ return [...new Set(catalog.data.map((model) => model.id))].map((wireId) => createAIModelDescriptor({
124
+ id: getVibesModelId(providerInstance.id, wireId),
125
+ providerId: providerInstance.id,
126
+ name: wireId,
127
+ modalities: ['text'],
128
+ capabilities: [],
129
+ configuration: { modelId: wireId },
130
+ enabled: true
131
+ }));
132
+ }
133
+ async checkHealth(config, options) {
134
+ const start = Date.now();
135
+ const parsed = customConnectionSchema.safeParse(config);
136
+ if (!parsed.success)
137
+ return {
138
+ healthy: false, message: 'Invalid custom endpoint configuration',
139
+ error: { code: 'INVALID_CONFIGURATION', message: 'Check the custom connection schema' },
140
+ checkedAt: new Date()
141
+ };
142
+ const configured = parsed.data;
143
+ const headers = await this.requestHeaders(configured, options);
144
+ const endpointBaseUrl = configured.baseUrl.replace(/\/+$/, '');
145
+ const probed = await settle(async () => {
146
+ const wait = { timeoutMs: options?.timeout ?? configured.timeout, reason: 'custom health probe' };
147
+ if (options?.signal)
148
+ wait.signal = options.signal;
149
+ return this.context.runtime.lifecycle.wait((signal) => fetchAIProvider(this.context, `${endpointBaseUrl}/models`, { headers, signal }), wait);
150
+ });
151
+ if (!probed.ok) {
152
+ // An unreachable endpoint is this probe's answer: the cause is reported in it.
153
+ return {
154
+ healthy: false,
155
+ latencyMs: Date.now() - start,
156
+ message: 'Custom endpoint is unavailable',
157
+ error: { code: 'CONNECTION_ERROR', message: 'Custom endpoint request failed or exceeded its deadline' },
158
+ checkedAt: new Date()
159
+ };
160
+ }
161
+ const response = probed.value;
162
+ return {
163
+ healthy: response.ok,
164
+ latencyMs: Date.now() - start,
165
+ message: response.ok
166
+ ? 'Custom OpenAI-compatible endpoint responded'
167
+ : `Custom endpoint returned ${response.status}`,
168
+ error: response.ok ? undefined : { code: 'API_ERROR', message: 'Custom endpoint refused the health request' },
169
+ checkedAt: new Date(),
170
+ availableModalities: response.ok ? ['text'] : undefined
171
+ };
172
+ }
173
+ async validateConnection(config) {
174
+ const parsed = customConnectionSchema.safeParse(config);
175
+ return parsed.success ? { valid: true } : {
176
+ valid: false,
177
+ errors: parsed.error.issues.map((issue) => `Invalid ${issue.path.join('.')}`)
178
+ };
179
+ }
180
+ async dispose() { }
181
+ }
182
+ //# sourceMappingURL=custom.provider.impl.js.map