@absolutejs/meeting 0.0.1-beta.0 → 0.0.1-beta.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.
package/dist/index.d.ts CHANGED
@@ -2,4 +2,4 @@ export { createMeeting } from "./meeting";
2
2
  export type { MeetingSession, MeetingTurn, MeetingEventMap, CreateMeetingOptions, } from "./meeting";
3
3
  export { createBufferMeetingSource } from "./bufferSource";
4
4
  export type { BufferMeetingSourceOptions } from "./bufferSource";
5
- export type { MeetingSource, MeetingSourceEventMap, MeetingParticipant, } from "./source";
5
+ export type { MeetingSource, MeetingSourceEventMap, MeetingParticipant, SpeakAudio, } from "./source";
package/dist/index.js CHANGED
@@ -64,6 +64,12 @@ var createMeeting = async (options) => {
64
64
  listeners[event].delete(handler);
65
65
  };
66
66
  },
67
+ speak: async (audio) => {
68
+ if (!options.source.speak) {
69
+ throw new Error("meeting.speak: this source does not implement speak() \u2014 the bot can't play audio into the call");
70
+ }
71
+ await options.source.speak(audio);
72
+ },
67
73
  start: () => options.source.start(),
68
74
  stop: async (reason) => {
69
75
  await options.source.stop(reason);
package/dist/meeting.d.ts CHANGED
@@ -1,5 +1,5 @@
1
1
  import { type STTAdapter, type VoiceLanguageStrategy, type VoiceLexiconEntry, type VoicePhraseHint, type VoiceScribeTurn } from "@absolutejs/voice";
2
- import type { MeetingParticipant, MeetingSource } from "./source";
2
+ import type { MeetingParticipant, MeetingSource, SpeakAudio } from "./source";
3
3
  export type MeetingTurn = VoiceScribeTurn & {
4
4
  /** Resolved participant for this turn, when the source identified speakers. */
5
5
  participant?: MeetingParticipant;
@@ -25,6 +25,12 @@ export type MeetingSession = {
25
25
  start: () => Promise<void>;
26
26
  /** Leave the call, finalize, and emit `end` with the full transcript. */
27
27
  stop: (reason?: string) => Promise<void>;
28
+ /**
29
+ * Play audio INTO the call (the bot speaks). Delegates to the source; throws
30
+ * if the underlying adapter doesn't implement `speak`. See `SpeakAudio` for
31
+ * the formats each adapter accepts (Recall: mp3; Discord: pcm).
32
+ */
33
+ speak: (audio: SpeakAudio) => Promise<void>;
28
34
  getTranscript: () => MeetingTurn[];
29
35
  getParticipants: () => MeetingParticipant[];
30
36
  };
package/dist/source.d.ts CHANGED
@@ -7,6 +7,20 @@ export type MeetingParticipant = {
7
7
  platform?: string;
8
8
  metadata?: Record<string, unknown>;
9
9
  };
10
+ /**
11
+ * Audio the bot wants to play INTO the call. Adapters declare which formats
12
+ * they accept (Recall: mp3; Discord: pcm); a TypeError is the right signal
13
+ * when an adapter is handed a format it cannot play.
14
+ */
15
+ export type SpeakAudio = {
16
+ format: "mp3";
17
+ data: ArrayBuffer | Uint8Array;
18
+ } | {
19
+ format: "pcm";
20
+ data: ArrayBuffer | Uint8Array;
21
+ sampleRateHz: number;
22
+ channels: number;
23
+ };
10
24
  export type MeetingSourceEventMap = {
11
25
  /** A chunk of call audio (in `format`). `participant` is set when the source
12
26
  * knows who is speaking for this chunk (per-user streams); otherwise omit it
@@ -41,4 +55,11 @@ export type MeetingSource = {
41
55
  start: () => Promise<void>;
42
56
  /** Leave the call / stop streaming. */
43
57
  stop: (reason?: string) => Promise<void>;
58
+ /**
59
+ * Play audio INTO the call (the bot speaks). Optional — adapters that can't
60
+ * inject audio simply don't implement it; `meeting.speak()` will throw a
61
+ * clear error in that case. Resolves when playback finishes (or as soon as
62
+ * the platform has accepted it, for fire-and-forget transports).
63
+ */
64
+ speak?: (audio: SpeakAudio) => Promise<void>;
44
65
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@absolutejs/meeting",
3
- "version": "0.0.1-beta.0",
3
+ "version": "0.0.1-beta.1",
4
4
  "description": "Meeting-bot core for AbsoluteJS — join a call (via a source adapter), transcribe it live with the voice scribe, and surface diarized turns + participants for analysis",
5
5
  "repository": {
6
6
  "type": "git",