@vibesdotdev/integrations-cohere 0.0.0-stage → 1.0.0-rc.4
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/LICENSE +126 -0
- package/README.md +39 -2
- package/dist/ai/index.d.ts +3 -0
- package/dist/ai/index.d.ts.map +1 -0
- package/dist/ai/index.js +3 -0
- package/dist/ai/index.js.map +1 -0
- package/dist/ai/metadata/assets/logos/providers/cohere-wordmark.svg +13 -0
- package/dist/ai/metadata/assets/logos/providers/cohere.svg +14 -0
- package/dist/ai/metadata/providers/cohere.json +31 -0
- package/dist/ai/provider.plugin.d.ts +6 -0
- package/dist/ai/provider.plugin.d.ts.map +1 -0
- package/dist/ai/provider.plugin.js +106 -0
- package/dist/ai/provider.plugin.js.map +1 -0
- package/dist/ai/providers/cloud/api/cohere/config/config.cohere.descriptor.d.ts +4206 -0
- package/dist/ai/providers/cloud/api/cohere/config/config.cohere.descriptor.d.ts.map +1 -0
- package/dist/ai/providers/cloud/api/cohere/config/config.cohere.descriptor.js +43 -0
- package/dist/ai/providers/cloud/api/cohere/config/config.cohere.descriptor.js.map +1 -0
- package/dist/ai/providers/cloud/api/cohere/config/schemas/index.d.ts +13 -0
- package/dist/ai/providers/cloud/api/cohere/config/schemas/index.d.ts.map +1 -0
- package/dist/ai/providers/cloud/api/cohere/config/schemas/index.js +9 -0
- package/dist/ai/providers/cloud/api/cohere/config/schemas/index.js.map +1 -0
- package/dist/ai/providers/cloud/api/cohere/index.d.ts +3 -0
- package/dist/ai/providers/cloud/api/cohere/index.d.ts.map +1 -0
- package/dist/ai/providers/cloud/api/cohere/index.js +3 -0
- package/dist/ai/providers/cloud/api/cohere/index.js.map +1 -0
- package/dist/ai/providers/cloud/api/cohere/provider.cohere.descriptor.d.ts +183 -0
- package/dist/ai/providers/cloud/api/cohere/provider.cohere.descriptor.d.ts.map +1 -0
- package/dist/ai/providers/cloud/api/cohere/provider.cohere.descriptor.js +55 -0
- package/dist/ai/providers/cloud/api/cohere/provider.cohere.descriptor.js.map +1 -0
- package/dist/ai/providers/cohere/cohere.provider.impl.d.ts +19 -0
- package/dist/ai/providers/cohere/cohere.provider.impl.d.ts.map +1 -0
- package/dist/ai/providers/cohere/cohere.provider.impl.js +143 -0
- package/dist/ai/providers/cohere/cohere.provider.impl.js.map +1 -0
- package/dist/ai/providers/cohere/detection/index.d.ts +2 -0
- package/dist/ai/providers/cohere/detection/index.d.ts.map +1 -0
- package/dist/ai/providers/cohere/detection/index.js +2 -0
- package/dist/ai/providers/cohere/detection/index.js.map +1 -0
- package/dist/ai/providers/cohere/detection/system.d.ts +4 -0
- package/dist/ai/providers/cohere/detection/system.d.ts.map +1 -0
- package/dist/ai/providers/cohere/detection/system.js +16 -0
- package/dist/ai/providers/cohere/detection/system.js.map +1 -0
- package/dist/ai/providers/cohere/index.d.ts +4 -0
- package/dist/ai/providers/cohere/index.d.ts.map +1 -0
- package/dist/ai/providers/cohere/index.js +4 -0
- package/dist/ai/providers/cohere/index.js.map +1 -0
- package/dist/ai/providers/cohere/recommendations.d.ts +23 -0
- package/dist/ai/providers/cohere/recommendations.d.ts.map +1 -0
- package/dist/ai/providers/cohere/recommendations.js +20 -0
- package/dist/ai/providers/cohere/recommendations.js.map +1 -0
- package/dist/index.d.ts +2 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +2 -0
- package/dist/index.js.map +1 -0
- package/package.json +98 -4
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"config.cohere.descriptor.d.ts","sourceRoot":"","sources":["../../../../../../../src/ai/providers/cloud/api/cohere/config/config.cohere.descriptor.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;yBA2Co0qD,CAAC;;;;yBAA6V,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;6BAAo8E,CAAC;;;;6BAA6W,CAAC;;;;;;;;;;;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;;;;;;;;;;;;;;;;;;;;;;;;;yBAAwzE,CAAC;;;;yBAA6V,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;6BAAo8E,CAAC;;;;6BAA6W,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;yBAA2nF,CAAC;;;;yBAA6V,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;6BAAo7E,CAAC;;;;6BAA6W,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAvCtiupB,wBAsCG"}
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import { createProviderConfigDescriptor } from '@vibesdotdev/ai/providers-runtime/core/config-descriptor';
|
|
2
|
+
import cohereProviderDescriptor from "../provider.cohere.descriptor.js";
|
|
3
|
+
import { cohereConnectionSchema } from "./schemas/index.js";
|
|
4
|
+
export default createProviderConfigDescriptor({
|
|
5
|
+
provider: cohereProviderDescriptor,
|
|
6
|
+
schema: cohereConnectionSchema,
|
|
7
|
+
optionLabel: 'Cohere',
|
|
8
|
+
optionDescription: 'Cohere text and embedding API',
|
|
9
|
+
optionIcon: '🔷',
|
|
10
|
+
fields: {
|
|
11
|
+
'configuration.apiKey': {
|
|
12
|
+
ui: {
|
|
13
|
+
label: 'API Key',
|
|
14
|
+
description: 'Your Cohere API key',
|
|
15
|
+
placeholder: 'co-...',
|
|
16
|
+
component: 'secret',
|
|
17
|
+
group: 'connection',
|
|
18
|
+
order: 10
|
|
19
|
+
}
|
|
20
|
+
},
|
|
21
|
+
'configuration.baseUrl': {
|
|
22
|
+
ui: {
|
|
23
|
+
label: 'Base URL',
|
|
24
|
+
description: 'API endpoint for custom deployments',
|
|
25
|
+
placeholder: 'https://api.cohere.ai/compatibility/v1',
|
|
26
|
+
component: 'input',
|
|
27
|
+
group: 'connection',
|
|
28
|
+
order: 11
|
|
29
|
+
}
|
|
30
|
+
},
|
|
31
|
+
'configuration.timeout': {
|
|
32
|
+
ui: {
|
|
33
|
+
label: 'Timeout',
|
|
34
|
+
description: 'Request timeout in milliseconds',
|
|
35
|
+
placeholder: '60000',
|
|
36
|
+
component: 'number',
|
|
37
|
+
group: 'connection',
|
|
38
|
+
order: 12
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
});
|
|
43
|
+
//# sourceMappingURL=config.cohere.descriptor.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"config.cohere.descriptor.js","sourceRoot":"","sources":["../../../../../../../src/ai/providers/cloud/api/cohere/config/config.cohere.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,QAAQ;IACrB,iBAAiB,EAAE,+BAA+B;IAClD,UAAU,EAAE,IAAI;IAChB,MAAM,EAAE;QACP,sBAAsB,EAAE;YACvB,EAAE,EAAE;gBACH,KAAK,EAAE,SAAS;gBAChB,WAAW,EAAE,qBAAqB;gBAClC,WAAW,EAAE,QAAQ;gBACrB,SAAS,EAAE,QAAQ;gBACnB,KAAK,EAAE,YAAY;gBACnB,KAAK,EAAE,EAAE;aACT;SACD;QACD,uBAAuB,EAAE;YACxB,EAAE,EAAE;gBACH,KAAK,EAAE,UAAU;gBACjB,WAAW,EAAE,qCAAqC;gBAClD,WAAW,EAAE,wCAAwC;gBACrD,SAAS,EAAE,OAAO;gBAClB,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,13 @@
|
|
|
1
|
+
import * as z from 'zod/v4';
|
|
2
|
+
export declare const cohereConnectionSchema: z.ZodObject<{
|
|
3
|
+
authMethod: z.ZodDefault<z.ZodLiteral<"api-key">>;
|
|
4
|
+
apiKey: z.ZodObject<{
|
|
5
|
+
source: z.ZodLiteral<"secret">;
|
|
6
|
+
key: z.ZodString;
|
|
7
|
+
store: z.ZodOptional<z.ZodString>;
|
|
8
|
+
}, z.core.$strict>;
|
|
9
|
+
baseUrl: z.ZodDefault<z.ZodString>;
|
|
10
|
+
timeout: z.ZodDefault<z.ZodNumber>;
|
|
11
|
+
}, z.core.$strip>;
|
|
12
|
+
export type CohereConnection = z.infer<typeof cohereConnectionSchema>;
|
|
13
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../../../src/ai/providers/cloud/api/cohere/config/schemas/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,CAAC,MAAM,QAAQ,CAAC;AAG5B,eAAO,MAAM,sBAAsB;;;;;;;;;iBAKjC,CAAC;AAEH,MAAM,MAAM,gBAAgB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,sBAAsB,CAAC,CAAC"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import * as z from 'zod/v4';
|
|
2
|
+
import { SecretReferenceSchema } from '@vibesdotdev/ai/providers-runtime';
|
|
3
|
+
export const cohereConnectionSchema = z.object({
|
|
4
|
+
authMethod: z.literal('api-key').default('api-key'),
|
|
5
|
+
apiKey: SecretReferenceSchema,
|
|
6
|
+
baseUrl: z.string().url().default('https://api.cohere.ai/compatibility/v1'),
|
|
7
|
+
timeout: z.number().int().positive().max(600000).default(60000)
|
|
8
|
+
});
|
|
9
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../../../../src/ai/providers/cloud/api/cohere/config/schemas/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,CAAC,MAAM,QAAQ,CAAC;AAC5B,OAAO,EAAE,qBAAqB,EAAE,MAAM,mCAAmC,CAAC;AAE1E,MAAM,CAAC,MAAM,sBAAsB,GAAG,CAAC,CAAC,MAAM,CAAC;IAC9C,UAAU,EAAE,CAAC,CAAC,OAAO,CAAC,SAAS,CAAC,CAAC,OAAO,CAAC,SAAS,CAAC;IACnD,MAAM,EAAE,qBAAqB;IAC7B,OAAO,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,EAAE,CAAC,OAAO,CAAC,wCAAwC,CAAC;IAC3E,OAAO,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,EAAE,CAAC,QAAQ,EAAE,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC,OAAO,CAAC,KAAK,CAAC;CAC/D,CAAC,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../src/ai/providers/cloud/api/cohere/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,IAAI,wBAAwB,EAAE,MAAM,iCAAiC,CAAC;AACtF,OAAO,EAAE,OAAO,IAAI,sBAAsB,EAAE,MAAM,sCAAsC,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../../src/ai/providers/cloud/api/cohere/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,IAAI,wBAAwB,EAAE,MAAM,iCAAiC,CAAC;AACtF,OAAO,EAAE,OAAO,IAAI,sBAAsB,EAAE,MAAM,sCAAsC,CAAC"}
|
|
@@ -0,0 +1,183 @@
|
|
|
1
|
+
declare const cohereProviderDescriptor: {
|
|
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" | "api_key" | "bearer" | "oauth" | "basic" | undefined;
|
|
16
|
+
authMethods?: {
|
|
17
|
+
[x: string]: unknown;
|
|
18
|
+
id: string;
|
|
19
|
+
type: "none" | "api_key" | "bearer" | "oauth" | "basic";
|
|
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 cohereProviderDescriptor;
|
|
183
|
+
//# sourceMappingURL=provider.cohere.descriptor.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"provider.cohere.descriptor.d.ts","sourceRoot":"","sources":["../../../../../../src/ai/providers/cloud/api/cohere/provider.cohere.descriptor.ts"],"names":[],"mappings":"AAGA,QAAA,MAAM,wBAAwB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAmD5B,CAAC;AAEH,eAAe,wBAAwB,CAAC"}
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
import { createAIProviderTypeDescriptor } from '@vibesdotdev/ai/providers-runtime/core/type-descriptor';
|
|
2
|
+
import { cohereConnectionSchema } from "./config/schemas/index.js";
|
|
3
|
+
const cohereProviderDescriptor = createAIProviderTypeDescriptor({
|
|
4
|
+
id: 'cohere',
|
|
5
|
+
version: '0.1.0-rc.0',
|
|
6
|
+
name: 'Cohere',
|
|
7
|
+
description: 'Text generation (streaming and tool calls) and text embeddings over the OpenAI-compatible endpoint.',
|
|
8
|
+
connectionSchema: cohereConnectionSchema,
|
|
9
|
+
defaults: cohereConnectionSchema.omit({ apiKey: true }).parse({}),
|
|
10
|
+
capabilities: {
|
|
11
|
+
modalities: ['text', 'embedding'],
|
|
12
|
+
authType: 'bearer',
|
|
13
|
+
streaming: true,
|
|
14
|
+
tools: true,
|
|
15
|
+
vision: false,
|
|
16
|
+
jsonMode: false,
|
|
17
|
+
functionCalling: true
|
|
18
|
+
},
|
|
19
|
+
category: 'cloud',
|
|
20
|
+
hardware: ['consumer', 'cloud'],
|
|
21
|
+
icon: '🔷',
|
|
22
|
+
docsUrl: 'https://docs.cohere.com',
|
|
23
|
+
priority: 100,
|
|
24
|
+
enabled: true,
|
|
25
|
+
tags: ['cloud', 'rag', 'search', 'embedding', 'enterprise'],
|
|
26
|
+
variants: [
|
|
27
|
+
{
|
|
28
|
+
id: 'chat',
|
|
29
|
+
label: 'Cohere OpenAI-compatible chat',
|
|
30
|
+
description: 'Command family via Cohere /compatibility/v1/chat/completions.',
|
|
31
|
+
transport: 'fetch',
|
|
32
|
+
specId: 'openai-chat',
|
|
33
|
+
modalities: ['text'],
|
|
34
|
+
endpoint: '{baseUrl}',
|
|
35
|
+
auth: { kind: 'bearer', token: { source: 'secret', key: 'COHERE_API_KEY' } },
|
|
36
|
+
modelIdRule: { kind: 'strip-prefix' },
|
|
37
|
+
priority: 10,
|
|
38
|
+
enabled: true
|
|
39
|
+
},
|
|
40
|
+
{
|
|
41
|
+
id: 'embedding',
|
|
42
|
+
label: 'Cohere OpenAI-compatible embeddings',
|
|
43
|
+
transport: 'fetch',
|
|
44
|
+
specId: 'openai-embedding',
|
|
45
|
+
modalities: ['embedding'],
|
|
46
|
+
endpoint: '{baseUrl}',
|
|
47
|
+
auth: { kind: 'bearer', token: { source: 'secret', key: 'COHERE_API_KEY' } },
|
|
48
|
+
modelIdRule: { kind: 'strip-prefix' },
|
|
49
|
+
priority: 10,
|
|
50
|
+
enabled: true
|
|
51
|
+
}
|
|
52
|
+
],
|
|
53
|
+
});
|
|
54
|
+
export default cohereProviderDescriptor;
|
|
55
|
+
//# sourceMappingURL=provider.cohere.descriptor.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"provider.cohere.descriptor.js","sourceRoot":"","sources":["../../../../../../src/ai/providers/cloud/api/cohere/provider.cohere.descriptor.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,8BAA8B,EAAE,MAAM,wDAAwD,CAAC;AACxG,OAAO,EAAE,sBAAsB,EAAE,MAAM,2BAA2B,CAAC;AAEnE,MAAM,wBAAwB,GAAG,8BAA8B,CAAC;IAC/D,EAAE,EAAE,QAAQ;IACZ,OAAO,EAAE,YAAY;IACrB,IAAI,EAAE,QAAQ;IACd,WAAW,EACV,qGAAqG;I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E,EAAE,IAAI,EAAE,QAAQ,EAAE,KAAK,EAAE,EAAE,MAAM,EAAE,QAAQ,EAAE,GAAG,EAAE,gBAAgB,EAAE,EAAE;YAC5E,WAAW,EAAE,EAAE,IAAI,EAAE,cAAc,EAAE;YACrC,QAAQ,EAAE,EAAE;YACZ,OAAO,EAAE,IAAI;SACb;KACD;CACD,CAAC,CAAC;AAEH,eAAe,wBAAwB,CAAC"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import type { ProviderOperationOptions, AIProviderTypeContext, AIProviderTypeInterface, ConnectionValidationResult, DetectedProviderInstance, ModelRecommendation, ProviderGenerateOptions, ProviderGenerateResult, ProviderHealthCheckResult } 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 CohereProviderType 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 readConnection;
|
|
15
|
+
checkHealth(config: ConfigurationRecord, options?: ProviderOperationOptions): Promise<ProviderHealthCheckResult>;
|
|
16
|
+
validateConnection(config: ConfigurationRecord): Promise<ConnectionValidationResult>;
|
|
17
|
+
dispose(): Promise<void>;
|
|
18
|
+
}
|
|
19
|
+
//# sourceMappingURL=cohere.provider.impl.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"cohere.provider.impl.d.ts","sourceRoot":"","sources":["../../../../src/ai/providers/cohere/cohere.provider.impl.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EACX,wBAAwB,EACxB,qBAAqB,EACrB,uBAAuB,EACvB,0BAA0B,EAC1B,wBAAwB,EACxB,mBAAmB,EACnB,uBAAuB,EACvB,sBAAsB,EACtB,yBAAyB,EACzB,MAAM,0CAA0C,CAAC;AAClD,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,oCAAoC,CAAC;AAC5E,OAAO,KAAK,EAAE,iBAAiB,EAAE,QAAQ,EAAE,MAAM,gCAAgC,CAAC;AAClF,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,+DAA+D,CAAC;AAC1G,OAAO,KAAK,EAAE,wBAAwB,EAAE,MAAM,2DAA2D,CAAC;AAI1G,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,mCAAmC,CAAC;AAG7E,qBAAa,kBAAmB,YAAW,uBAAuB;IAEhE,QAAQ,CAAC,UAAU,EAAE,wBAAwB;IAC7C,OAAO,CAAC,QAAQ,CAAC,OAAO;gBADf,UAAU,EAAE,wBAAwB,EAC5B,OAAO,EAAE,qBAAqB;IAEhD,QAAQ,CAAC,CAAC,SAAS,QAAQ,EAC1B,QAAQ,EAAE,oBAAoB,EAC9B,KAAK,EAAE,iBAAiB,EACxB,OAAO,EAAE,iBAAiB,CAAC,CAAC,CAAC,EAC7B,OAAO,CAAC,EAAE,uBAAuB,GAC/B,OAAO,CAAC,sBAAsB,CAAC,CAAC,CAAC,CAAC;IAsC/B,eAAe,IAAI,OAAO,CAAC,wBAAwB,EAAE,CAAC;IAItD,eAAe,IAAI,OAAO,CAAC,mBAAmB,EAAE,CAAC;IA+BvD,OAAO,CAAC,cAAc;IAYhB,WAAW,CAChB,MAAM,EAAE,mBAAmB,EAC3B,OAAO,CAAC,EAAE,wBAAwB,GAChC,OAAO,CAAC,yBAAyB,CAAC;IAoC/B,kBAAkB,CAAC,MAAM,EAAE,mBAAmB,GAAG,OAAO,CAAC,0BAA0B,CAAC;IAQpF,OAAO,IAAI,OAAO,CAAC,IAAI,CAAC;CAC9B"}
|
|
@@ -0,0 +1,143 @@
|
|
|
1
|
+
import { detectCohereSystem } from "./detection/system.js";
|
|
2
|
+
import { assertNoPlaintextCredentials, resolveSecretReference } from '@vibesdotdev/ai/providers-runtime';
|
|
3
|
+
import { probeProviderHealth } from '@vibesdotdev/ai/providers-runtime/client';
|
|
4
|
+
import { getVibesAIClient } from '@vibesdotdev/ai/client';
|
|
5
|
+
import { AnyGenerationRequestSchema } from '@vibesdotdev/ai/generation/execution/schemas/request';
|
|
6
|
+
import { CapabilityError, CaughtFailureSchema, isCapabilityError, valueFreeFailure } from '@vibesdotdev/kernel';
|
|
7
|
+
import { cohereConnectionSchema } from "../cloud/api/cohere/config/schemas/index.js";
|
|
8
|
+
export class CohereProviderType {
|
|
9
|
+
descriptor;
|
|
10
|
+
context;
|
|
11
|
+
constructor(descriptor, context) {
|
|
12
|
+
this.descriptor = descriptor;
|
|
13
|
+
this.context = context;
|
|
14
|
+
}
|
|
15
|
+
async generate(provider, model, request, options) {
|
|
16
|
+
const connection = this.readConnection(provider.configuration);
|
|
17
|
+
const ai = await getVibesAIClient(this.context.runtime);
|
|
18
|
+
const metadata = { ...options?.metadata };
|
|
19
|
+
if (options?.specId !== undefined)
|
|
20
|
+
metadata.specId = options.specId;
|
|
21
|
+
if (options?.capability !== undefined)
|
|
22
|
+
metadata.capability = options.capability;
|
|
23
|
+
if (options?.scope !== undefined)
|
|
24
|
+
metadata.scope = options.scope;
|
|
25
|
+
const timeoutMs = options?.timeoutMs ?? connection.timeout;
|
|
26
|
+
try {
|
|
27
|
+
const response = await this.context.runtime.lifecycle.wait(async (signal) => ai.requestGeneration(AnyGenerationRequestSchema.parse({
|
|
28
|
+
...request,
|
|
29
|
+
signal,
|
|
30
|
+
modality: request.modality ?? model.modalities[0],
|
|
31
|
+
provider: { ...provider, configuration: connection },
|
|
32
|
+
model
|
|
33
|
+
}), {
|
|
34
|
+
timeoutMs,
|
|
35
|
+
signal,
|
|
36
|
+
metadata,
|
|
37
|
+
workspacePath: options?.workspacePath,
|
|
38
|
+
surface: options?.surface,
|
|
39
|
+
executionPolicy: options?.executionPolicy
|
|
40
|
+
}), { timeoutMs, signal: request.signal, reason: 'Cohere generation' });
|
|
41
|
+
return { response, adapterId: 'runtime', generationMethod: 'runtime' };
|
|
42
|
+
}
|
|
43
|
+
catch (error) {
|
|
44
|
+
const failure = CaughtFailureSchema.parse(error);
|
|
45
|
+
throw new CapabilityError('Cohere generation failed.', isCapabilityError(failure) ? failure.code : 'UNAVAILABLE', {
|
|
46
|
+
reason: isCapabilityError(failure) ? failure.reason : 'cohere-generation-failed',
|
|
47
|
+
cause: valueFreeFailure(failure)
|
|
48
|
+
});
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
async detectInstalled() {
|
|
52
|
+
const detected = await detectCohereSystem(this.context.runtime);
|
|
53
|
+
return detected ? [{ name: detected.name, source: 'system', config: { authMethod: 'api-key', ...detected.configuration } }] : [];
|
|
54
|
+
}
|
|
55
|
+
async recommendModels() {
|
|
56
|
+
return [
|
|
57
|
+
{
|
|
58
|
+
modelId: 'cohere:command-r7b',
|
|
59
|
+
modelName: 'Command R7B',
|
|
60
|
+
score: 95,
|
|
61
|
+
reason: 'Compact high-performance model for reasoning and tool use',
|
|
62
|
+
capabilities: ['chat', 'tools'],
|
|
63
|
+
contextWindow: 128_000,
|
|
64
|
+
useCaseFit: 95
|
|
65
|
+
},
|
|
66
|
+
{
|
|
67
|
+
modelId: 'cohere:command-r-plus',
|
|
68
|
+
modelName: 'Command R+',
|
|
69
|
+
score: 90,
|
|
70
|
+
reason: 'Advanced model for complex tasks and long-context reasoning',
|
|
71
|
+
capabilities: ['chat', 'tools'],
|
|
72
|
+
contextWindow: 128_000,
|
|
73
|
+
useCaseFit: 90
|
|
74
|
+
},
|
|
75
|
+
{
|
|
76
|
+
modelId: 'cohere:command-r',
|
|
77
|
+
modelName: 'Command R',
|
|
78
|
+
score: 85,
|
|
79
|
+
reason: 'Balanced model for general chat and tool-use workflows',
|
|
80
|
+
capabilities: ['chat', 'tools'],
|
|
81
|
+
contextWindow: 128_000,
|
|
82
|
+
useCaseFit: 85
|
|
83
|
+
}
|
|
84
|
+
];
|
|
85
|
+
}
|
|
86
|
+
readConnection(config) {
|
|
87
|
+
assertNoPlaintextCredentials(config);
|
|
88
|
+
const parsed = cohereConnectionSchema.safeParse(config);
|
|
89
|
+
if (!parsed.success) {
|
|
90
|
+
throw new CapabilityError('Invalid Cohere connection configuration.', 'INVALID_INPUT', {
|
|
91
|
+
reason: 'cohere-connection-invalid',
|
|
92
|
+
details: { fields: parsed.error.issues.map((issue) => issue.path.join('.')) }
|
|
93
|
+
});
|
|
94
|
+
}
|
|
95
|
+
return parsed.data;
|
|
96
|
+
}
|
|
97
|
+
async checkHealth(config, options) {
|
|
98
|
+
const connection = this.readConnection(config);
|
|
99
|
+
const start = Date.now();
|
|
100
|
+
const apiKey = options?.resolveCredential
|
|
101
|
+
? await options.resolveCredential(connection.apiKey)
|
|
102
|
+
: await resolveSecretReference(connection.apiKey, this.context.runtime);
|
|
103
|
+
if (!apiKey.trim()) {
|
|
104
|
+
throw new CapabilityError('Cohere credential is unavailable.', 'UNAVAILABLE', {
|
|
105
|
+
reason: 'credential-not-set'
|
|
106
|
+
});
|
|
107
|
+
}
|
|
108
|
+
const result = await probeProviderHealth({
|
|
109
|
+
runtime: this.context.runtime,
|
|
110
|
+
url: connection.baseUrl.replace(/\/$/, '') + '/models',
|
|
111
|
+
headers: { authorization: `Bearer ${apiKey}` },
|
|
112
|
+
timeoutMs: options?.timeout ?? connection.timeout,
|
|
113
|
+
signal: options?.signal
|
|
114
|
+
});
|
|
115
|
+
if (!result.ok) {
|
|
116
|
+
const failure = new CapabilityError(result.message, 'UNAVAILABLE', {
|
|
117
|
+
reason: 'cohere-health-failed',
|
|
118
|
+
cause: result.cause,
|
|
119
|
+
details: { healthCode: result.code, status: result.status }
|
|
120
|
+
});
|
|
121
|
+
return {
|
|
122
|
+
healthy: false, message: result.message, error: failure,
|
|
123
|
+
latencyMs: Date.now() - start, checkedAt: new Date()
|
|
124
|
+
};
|
|
125
|
+
}
|
|
126
|
+
return {
|
|
127
|
+
healthy: true, message: 'Cohere API connection successful',
|
|
128
|
+
latencyMs: Date.now() - start, checkedAt: new Date(),
|
|
129
|
+
availableModalities: ['text', 'embedding']
|
|
130
|
+
};
|
|
131
|
+
}
|
|
132
|
+
async validateConnection(config) {
|
|
133
|
+
const parsed = cohereConnectionSchema.safeParse(config);
|
|
134
|
+
if (parsed.success)
|
|
135
|
+
return { valid: true };
|
|
136
|
+
return {
|
|
137
|
+
valid: false,
|
|
138
|
+
errors: parsed.error.issues.map((issue) => `Invalid ${issue.path.join('.')}`)
|
|
139
|
+
};
|
|
140
|
+
}
|
|
141
|
+
async dispose() { }
|
|
142
|
+
}
|
|
143
|
+
//# sourceMappingURL=cohere.provider.impl.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"cohere.provider.impl.js","sourceRoot":"","sources":["../../../../src/ai/providers/cohere/cohere.provider.impl.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,kBAAkB,EAAE,MAAM,uBAAuB,CAAC;AAC3D,OAAO,EAAE,4BAA4B,EAAE,sBAAsB,EAAE,MAAM,mCAAmC,CAAC;AACzG,OAAO,EAAE,mBAAmB,EAAE,MAAM,0CAA0C,CAAC;AAgB/E,OAAO,EAAE,gBAAgB,EAAE,MAAM,wBAAwB,CAAC;AAC1D,OAAO,EAAE,0BAA0B,EAAE,MAAM,sDAAsD,CAAC;AAClG,O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,EAAE,MAAM,CAAC,MAAM,EAAE;aAC3D,CAAC,CAAC;YACH,OAAO;gBACN,OAAO,EAAE,KAAK,EAAE,OAAO,EAAE,MAAM,CAAC,OAAO,EAAE,KAAK,EAAE,OAAO;gBACvD,SAAS,EAAE,IAAI,CAAC,GAAG,EAAE,GAAG,KAAK,EAAE,SAAS,EAAE,IAAI,IAAI,EAAE;aACpD,CAAC;QACH,CAAC;QACD,OAAO;YACN,OAAO,EAAE,IAAI,EAAE,OAAO,EAAE,kCAAkC;YAC1D,SAAS,EAAE,IAAI,CAAC,GAAG,EAAE,GAAG,KAAK,EAAE,SAAS,EAAE,IAAI,IAAI,EAAE;YACpD,mBAAmB,EAAE,CAAC,MAAM,EAAE,WAAW,CAAC;SAC1C,CAAC;IACH,CAAC;IAED,KAAK,CAAC,kBAAkB,CAAC,MAA2B;QACnD,MAAM,MAAM,GAAG,sBAAsB,CAAC,SAAS,CAAC,MAAM,CAAC,CAAC;QACxD,IAAI,MAAM,CAAC,OAAO;YAAE,OAAO,EAAE,KAAK,EAAE,IAAI,EAAE,CAAC;QAC3C,OAAO;YACN,KAAK,EAAE,KAAK;YACZ,MAAM,EAAE,MAAM,CAAC,KAAK,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,WAAW,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC;SAC7E,CAAC;IACH,CAAC;IACD,KAAK,CAAC,OAAO,KAAmB,CAAC;CACjC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/ai/providers/cohere/detection/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,kBAAkB,EAAE,MAAM,aAAa,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../src/ai/providers/cohere/detection/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,kBAAkB,EAAE,MAAM,aAAa,CAAC"}
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import type { RuntimeRef } from '@vibesdotdev/kernel';
|
|
2
|
+
import type { DetectedProvider } from '@vibesdotdev/ai/providers-runtime/client/types';
|
|
3
|
+
export declare function detectCohereSystem(runtime: RuntimeRef): Promise<DetectedProvider | null>;
|
|
4
|
+
//# sourceMappingURL=system.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"system.d.ts","sourceRoot":"","sources":["../../../../../src/ai/providers/cohere/detection/system.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,qBAAqB,CAAC;AACtD,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,gDAAgD,CAAC;AAEvF,wBAAsB,kBAAkB,CAAC,OAAO,EAAE,UAAU,GAAG,OAAO,CAAC,gBAAgB,GAAG,IAAI,CAAC,CAa9F"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
export async function detectCohereSystem(runtime) {
|
|
2
|
+
const credential = await runtime.resolveCredential({ source: 'secret', key: 'COHERE_API_KEY' });
|
|
3
|
+
if (!credential.ok) {
|
|
4
|
+
if (credential.error.reason === 'credential-not-set')
|
|
5
|
+
return null;
|
|
6
|
+
throw credential.error;
|
|
7
|
+
}
|
|
8
|
+
if (!credential.value.trim())
|
|
9
|
+
return null;
|
|
10
|
+
return {
|
|
11
|
+
providerType: 'cohere', name: 'Cohere',
|
|
12
|
+
description: 'Credential reference available from COHERE_API_KEY', status: 'available',
|
|
13
|
+
configuration: { apiKey: { source: 'secret', key: 'COHERE_API_KEY' } }
|
|
14
|
+
};
|
|
15
|
+
}
|
|
16
|
+
//# sourceMappingURL=system.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"system.js","sourceRoot":"","sources":["../../../../../src/ai/providers/cohere/detection/system.ts"],"names":[],"mappings":"AAGA,MAAM,CAAC,KAAK,UAAU,kBAAkB,CAAC,OAAmB;IAC3D,MAAM,UAAU,GAAG,MAAM,OAAO,CAAC,iBAAiB,CAAC,EAAE,MAAM,EAAE,QAAQ,EAAE,GAAG,EAAE,gBAAgB,EAAE,CAAC,CAAC;IAChG,IAAI,CAAC,UAAU,CAAC,EAAE,EAAE,CAAC;QACpB,IAAI,UAAU,CAAC,KAAK,CAAC,MAAM,KAAK,oBAAoB;YAAE,OAAO,IAAI,CAAC;QAClE,MAAM,UAAU,CAAC,KAAK,CAAC;IACxB,CAAC;IACD,IAAI,CAAC,UAAU,CAAC,KAAK,CAAC,IAAI,EAAE;QAAE,OAAO,IAAI,CAAC;IAE1C,OAAO;QACN,YAAY,EAAE,QAAQ,EAAE,IAAI,EAAE,QAAQ;QACtC,WAAW,EAAE,oDAAoD,EAAE,MAAM,EAAE,WAAW;QACtF,aAAa,EAAE,EAAE,MAAM,EAAE,EAAE,MAAM,EAAE,QAAQ,EAAE,GAAG,EAAE,gBAAgB,EAAE,EAAE;KACtE,CAAC;AACH,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/ai/providers/cohere/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,kBAAkB,EAAE,MAAM,2BAA2B,CAAC;AAC/D,OAAO,EAAE,kBAAkB,EAAE,MAAM,uBAAuB,CAAC;AAC3D,OAAO,EAAE,oBAAoB,EAAE,MAAM,sBAAsB,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/ai/providers/cohere/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,kBAAkB,EAAE,MAAM,2BAA2B,CAAC;AAC/D,OAAO,EAAE,kBAAkB,EAAE,MAAM,uBAAuB,CAAC;AAC3D,OAAO,EAAE,oBAAoB,EAAE,MAAM,sBAAsB,CAAC"}
|