@opencode/ai 0.0.0-dev-1126 → 0.0.0-dev-1136

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.
@@ -1,6 +1,6 @@
1
1
  import { Context } from "effect";
2
2
  import { MediaClient } from "./media-client.js";
3
- import { type ImageEvent, type ImageRequest, type ImageResponse } from "./image.js";
3
+ import type { ImageEvent, ImageRequest, ImageResponse } from "./image.js";
4
4
  export type Interface = MediaClient.Interface<ImageRequest, ImageEvent, ImageResponse>;
5
5
  declare const ImageClientService_base: Context.ServiceClass<ImageClientService, "@opencode/ImageClient", Interface>;
6
6
  export declare class ImageClientService extends ImageClientService_base {
@@ -1,6 +1,5 @@
1
1
  import { Context } from "effect";
2
2
  import { MediaClient } from "./media-client.js";
3
- import { ImageOutputEvent, ImageFinishEvent } from "./image.js";
4
3
  export class ImageClientService extends Context.Service()("@opencode/ImageClient") {
5
4
  }
6
5
  export const Service = ImageClientService;
@@ -9,11 +8,8 @@ export const ImageClient = {
9
8
  ...MediaClient.make(Service, {
10
9
  modality: "image",
11
10
  responseEvents: (response) => [
12
- ...response.images.map((image, index) => ImageOutputEvent.make({ index, image })),
13
- ImageFinishEvent.make({
14
- usage: response.usage,
15
- providerMetadata: response.providerMetadata,
16
- }),
11
+ ...response.images.map((image, index) => ({ type: "image", index, image })),
12
+ { type: "finish", usage: response.usage, providerMetadata: response.providerMetadata },
17
13
  ],
18
14
  }),
19
15
  };
@@ -1,6 +1,6 @@
1
1
  import { Context } from "effect";
2
2
  import { MediaClient } from "./media-client.js";
3
- import { type SpeechEvent, type SpeechRequest, type SpeechResponse } from "./speech.js";
3
+ import type { SpeechEvent, SpeechRequest, SpeechResponse } from "./speech.js";
4
4
  export type Interface = MediaClient.Interface<SpeechRequest, SpeechEvent, SpeechResponse>;
5
5
  declare const SpeechClientService_base: Context.ServiceClass<SpeechClientService, "@opencode/SpeechClient", Interface>;
6
6
  export declare class SpeechClientService extends SpeechClientService_base {
@@ -1,6 +1,5 @@
1
1
  import { Context } from "effect";
2
2
  import { MediaClient } from "./media-client.js";
3
- import { SpeechTimestampsEvent, SpeechFinishEvent, } from "./speech.js";
4
3
  export class SpeechClientService extends Context.Service()("@opencode/SpeechClient") {
5
4
  }
6
5
  export const Service = SpeechClientService;
@@ -9,12 +8,13 @@ export const SpeechClient = {
9
8
  ...MediaClient.make(Service, {
10
9
  modality: "speech",
11
10
  responseEvents: (response) => [
12
- ...(response.timestamps === undefined ? [] : [SpeechTimestampsEvent.make({ items: response.timestamps })]),
13
- SpeechFinishEvent.make({
11
+ ...(response.timestamps === undefined ? [] : [{ type: "timestamps", items: response.timestamps }]),
12
+ {
13
+ type: "finish",
14
14
  audio: response.audio,
15
15
  usage: response.usage,
16
16
  providerMetadata: response.providerMetadata,
17
- }),
17
+ },
18
18
  ],
19
19
  }),
20
20
  };
@@ -1,6 +1,6 @@
1
1
  import { Context } from "effect";
2
2
  import { MediaClient } from "./media-client.js";
3
- import { type TranscriptionEvent, type TranscriptionRequest, type TranscriptionResponse } from "./transcription.js";
3
+ import type { TranscriptionEvent, TranscriptionRequest, TranscriptionResponse } from "./transcription.js";
4
4
  export type Interface = MediaClient.Interface<TranscriptionRequest, TranscriptionEvent, TranscriptionResponse>;
5
5
  declare const TranscriptionClientService_base: Context.ServiceClass<TranscriptionClientService, "@opencode/TranscriptionClient", Interface>;
6
6
  export declare class TranscriptionClientService extends TranscriptionClientService_base {
@@ -1,6 +1,5 @@
1
1
  import { Context } from "effect";
2
2
  import { MediaClient } from "./media-client.js";
3
- import { TranscriptionFinishEvent, } from "./transcription.js";
4
3
  export class TranscriptionClientService extends Context.Service()("@opencode/TranscriptionClient") {
5
4
  }
6
5
  export const Service = TranscriptionClientService;
@@ -8,6 +7,6 @@ export const TranscriptionClient = {
8
7
  Service,
9
8
  ...MediaClient.make(Service, {
10
9
  modality: "transcription",
11
- responseEvents: (response) => [TranscriptionFinishEvent.make({ ...response })],
10
+ responseEvents: (response) => [{ type: "finish", ...response }],
12
11
  }),
13
12
  };
@@ -1,6 +1,6 @@
1
1
  import { Context } from "effect";
2
2
  import { MediaClient } from "./media-client.js";
3
- import { type VideoEvent, type VideoRequest, type VideoResponse } from "./video.js";
3
+ import type { VideoEvent, VideoRequest, VideoResponse } from "./video.js";
4
4
  export type Interface = MediaClient.Interface<VideoRequest, VideoEvent, VideoResponse>;
5
5
  declare const VideoClientService_base: Context.ServiceClass<VideoClientService, "@opencode/VideoClient", Interface>;
6
6
  export declare class VideoClientService extends VideoClientService_base {
@@ -1,6 +1,5 @@
1
1
  import { Context } from "effect";
2
2
  import { MediaClient } from "./media-client.js";
3
- import { VideoOutputEvent, VideoFinishEvent } from "./video.js";
4
3
  export class VideoClientService extends Context.Service()("@opencode/VideoClient") {
5
4
  }
6
5
  export const Service = VideoClientService;
@@ -9,11 +8,8 @@ export const VideoClient = {
9
8
  ...MediaClient.make(Service, {
10
9
  modality: "video",
11
10
  responseEvents: (response) => [
12
- ...response.videos.map((video, index) => VideoOutputEvent.make({ index, video })),
13
- VideoFinishEvent.make({
14
- usage: response.usage,
15
- providerMetadata: response.providerMetadata,
16
- }),
11
+ ...response.videos.map((video, index) => ({ type: "video", index, video })),
12
+ { type: "finish", usage: response.usage, providerMetadata: response.providerMetadata },
17
13
  ],
18
14
  }),
19
15
  };
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-1126",
3
+ "version": "0.0.0-dev-1136",
4
4
  "name": "@opencode/ai",
5
5
  "type": "module",
6
6
  "license": "MIT",
@@ -572,7 +572,7 @@
572
572
  "devDependencies": {
573
573
  "@clack/prompts": "1.0.0-alpha.1",
574
574
  "@effect/platform-node": "4.1.0",
575
- "@opencode/http-recorder": "0.0.0-dev-1126",
575
+ "@opencode/http-recorder": "0.0.0-dev-1136",
576
576
  "@tsconfig/bun": "1.0.9",
577
577
  "@types/bun": "1.4.3",
578
578
  "@typescript/native": "npm:typescript@7.1.0-beta",
@@ -582,7 +582,7 @@
582
582
  "@aws-sdk/credential-providers": "3.1057.0",
583
583
  "@smithy/eventstream-codec": "4.2.14",
584
584
  "@smithy/util-utf8": "4.2.2",
585
- "@opencode/schema": "0.0.0-dev-1126",
585
+ "@opencode/schema": "0.0.0-dev-1136",
586
586
  "aws4fetch": "1.0.20",
587
587
  "effect": "4.1.0",
588
588
  "google-auth-library": "10.5.0"