@opencode/ai 0.0.0-dev-20482 → 0.0.0-dev-20484

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.
@@ -106,7 +106,14 @@ const fromRequest = Effect.fn("CohereChat.fromRequest")(function* (request) {
106
106
  const options = yield* ProviderShared.validateWith(Schema.decodeUnknownEffect(Options))(request.providerOptions ?? {});
107
107
  const flattened = ProviderShared.flattenToolRequest(request);
108
108
  const messages = request.system.length
109
- ? [{ role: "system", content: ProviderShared.joinText(request.system) }]
109
+ ? [
110
+ {
111
+ role: "system",
112
+ content: request.system.length === 1
113
+ ? request.system[0].text
114
+ : request.system.map((part) => ({ type: "text", text: part.text })),
115
+ },
116
+ ]
110
117
  : [];
111
118
  for (const message of flattened.request.messages) {
112
119
  if (message.role === "system") {
@@ -382,7 +382,7 @@ const fromRequest = Effect.fn("Gemini.fromRequest")(function* (request) {
382
382
  contents: yield* lowerMessages(flattened.request),
383
383
  safetySettings: options.safetySettings,
384
384
  serviceTier: options.serviceTier,
385
- systemInstruction: request.system.length === 0 ? undefined : { parts: [{ text: ProviderShared.joinText(request.system) }] },
385
+ systemInstruction: request.system.length === 0 ? undefined : { parts: request.system.map((part) => ({ text: part.text })) },
386
386
  tools: hasTools
387
387
  ? [
388
388
  {
@@ -36,7 +36,10 @@ declare const MistralBody: Schema.Struct<{
36
36
  readonly model: Schema.String;
37
37
  readonly messages: Schema.$Array<Schema.toTaggedUnion<"role", readonly [Schema.Struct<{
38
38
  readonly role: Schema.Literal<"system">;
39
- readonly content: Schema.String;
39
+ readonly content: Schema.Union<readonly [Schema.String, Schema.$Array<Schema.Struct<{
40
+ readonly type: Schema.Literal<"text">;
41
+ readonly text: Schema.String;
42
+ }>>]>;
40
43
  }>, Schema.Struct<{
41
44
  readonly role: Schema.Literal<"user">;
42
45
  readonly content: Schema.Union<readonly [Schema.String, Schema.$Array<Schema.Union<readonly [Schema.Struct<{
@@ -123,7 +126,10 @@ export declare const fromRequest: (request: LLMRequest<import("../schema/options
123
126
  model: string & import("effect/Brand").Brand<"AI.ModelID">;
124
127
  messages: ({
125
128
  readonly role: "system";
126
- readonly content: string;
129
+ readonly content: string | readonly {
130
+ readonly type: "text";
131
+ readonly text: string;
132
+ }[];
127
133
  } | {
128
134
  readonly role: "user";
129
135
  readonly content: string | readonly ({
@@ -237,7 +243,10 @@ export declare const protocol: Protocol<{
237
243
  readonly model: string;
238
244
  readonly messages: readonly ({
239
245
  readonly role: "system";
240
- readonly content: string;
246
+ readonly content: string | readonly {
247
+ readonly type: "text";
248
+ readonly text: string;
249
+ }[];
241
250
  } | {
242
251
  readonly role: "user";
243
252
  readonly content: string | readonly ({
@@ -371,7 +380,10 @@ export declare const httpTransport: HttpTransport.HttpJsonTransport<{
371
380
  readonly model: string;
372
381
  readonly messages: readonly ({
373
382
  readonly role: "system";
374
- readonly content: string;
383
+ readonly content: string | readonly {
384
+ readonly type: "text";
385
+ readonly text: string;
386
+ }[];
375
387
  } | {
376
388
  readonly role: "user";
377
389
  readonly content: string | readonly ({
@@ -459,7 +471,10 @@ export declare const route: Route<{
459
471
  readonly model: string;
460
472
  readonly messages: readonly ({
461
473
  readonly role: "system";
462
- readonly content: string;
474
+ readonly content: string | readonly {
475
+ readonly type: "text";
476
+ readonly text: string;
477
+ }[];
463
478
  } | {
464
479
  readonly role: "user";
465
480
  readonly content: string | readonly ({
@@ -39,7 +39,10 @@ const MistralAssistantToolCall = Schema.Struct({
39
39
  function: Schema.Struct({ name: Schema.String, arguments: Schema.String }),
40
40
  });
41
41
  const MistralMessage = Schema.Union([
42
- Schema.Struct({ role: Schema.Literal("system"), content: Schema.String }),
42
+ Schema.Struct({
43
+ role: Schema.Literal("system"),
44
+ content: Schema.Union([Schema.String, Schema.Array(MistralTextContent)]),
45
+ }),
43
46
  Schema.Struct({
44
47
  role: Schema.Literal("user"),
45
48
  content: Schema.Union([Schema.String, Schema.Array(MistralUserContent)]),
@@ -243,7 +246,16 @@ const lowerToolResults = Effect.fn("MistralChat.lowerToolResults")(function* (me
243
246
  });
244
247
  const lowerMessages = Effect.fn("MistralChat.lowerMessages")(function* (request) {
245
248
  const normalizeID = MistralToolID.normalizer(request);
246
- const messages = request.system.length === 0 ? [] : [{ role: "system", content: ProviderShared.joinText(request.system) }];
249
+ const messages = request.system.length === 0
250
+ ? []
251
+ : [
252
+ {
253
+ role: "system",
254
+ content: request.system.length === 1
255
+ ? request.system[0].text
256
+ : request.system.map((part) => ({ type: "text", text: part.text })),
257
+ },
258
+ ];
247
259
  for (const message of request.messages) {
248
260
  if (message.role === "system") {
249
261
  const update = yield* ProviderShared.wrappedSystemUpdate("Mistral Chat", message);
@@ -17,7 +17,10 @@ export declare const route: import("../route/client.js").Route<{
17
17
  readonly model: string;
18
18
  readonly messages: readonly ({
19
19
  readonly role: "system";
20
- readonly content: string;
20
+ readonly content: string | readonly {
21
+ readonly type: "text";
22
+ readonly text: string;
23
+ }[];
21
24
  } | {
22
25
  readonly role: "user";
23
26
  readonly content: string | readonly ({
@@ -105,7 +108,10 @@ export declare const routes: import("../route/client.js").Route<{
105
108
  readonly model: string;
106
109
  readonly messages: readonly ({
107
110
  readonly role: "system";
108
- readonly content: string;
111
+ readonly content: string | readonly {
112
+ readonly type: "text";
113
+ readonly text: string;
114
+ }[];
109
115
  } | {
110
116
  readonly role: "user";
111
117
  readonly content: string | readonly ({
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "$schema": "https://json.schemastore.org/package.json",
3
- "version": "0.0.0-dev-20482",
3
+ "version": "0.0.0-dev-20484",
4
4
  "name": "@opencode/ai",
5
5
  "type": "module",
6
6
  "license": "MIT",
@@ -34,7 +34,7 @@
34
34
  "devDependencies": {
35
35
  "@clack/prompts": "1.0.0-alpha.1",
36
36
  "@effect/platform-node": "4.0.0-rc.112",
37
- "@opencode/http-recorder": "0.0.0-dev-20482",
37
+ "@opencode/http-recorder": "0.0.0-dev-20484",
38
38
  "@tsconfig/bun": "1.0.9",
39
39
  "@types/bun": "1.4.0",
40
40
  "@typescript/native-preview": "7.0.0-dev.20251207.1",
@@ -44,7 +44,7 @@
44
44
  "@aws-sdk/credential-providers": "3.1057.0",
45
45
  "@smithy/eventstream-codec": "4.2.14",
46
46
  "@smithy/util-utf8": "4.2.2",
47
- "@opencode/schema": "0.0.0-dev-20482",
47
+ "@opencode/schema": "0.0.0-dev-20484",
48
48
  "aws4fetch": "1.0.20",
49
49
  "effect": "4.0.0-rc.112",
50
50
  "google-auth-library": "10.5.0"