@absolutejs/meeting 0.0.1-beta.0 → 0.0.1-beta.10
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 +88 -0
- package/README.md +25 -1
- package/dist/bufferSource.d.ts +3 -0
- package/dist/emitter.d.ts +16 -0
- package/dist/index.d.ts +4 -2
- package/dist/index.js +131 -35
- package/dist/manager.d.ts +36 -0
- package/dist/manifest.d.ts +28 -0
- package/dist/manifest.js +268 -0
- package/dist/manifest.json +408 -0
- package/dist/meeting.d.ts +27 -1
- package/dist/source.d.ts +79 -1
- package/package.json +70 -35
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 { ChatMessage, MeetingCapabilities, 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;
|
|
@@ -8,8 +8,15 @@ export type MeetingEventMap = {
|
|
|
8
8
|
turn: {
|
|
9
9
|
turn: MeetingTurn;
|
|
10
10
|
};
|
|
11
|
+
/** Roster update. `status` mirrors the source: "joined"/absent on appear,
|
|
12
|
+
* "left" when a participant leaves the call. */
|
|
11
13
|
participant: {
|
|
12
14
|
participant: MeetingParticipant;
|
|
15
|
+
status?: "joined" | "left";
|
|
16
|
+
};
|
|
17
|
+
/** A text message arrived in the call chat. */
|
|
18
|
+
chat: {
|
|
19
|
+
message: ChatMessage;
|
|
13
20
|
};
|
|
14
21
|
end: {
|
|
15
22
|
reason?: string;
|
|
@@ -25,6 +32,25 @@ export type MeetingSession = {
|
|
|
25
32
|
start: () => Promise<void>;
|
|
26
33
|
/** Leave the call, finalize, and emit `end` with the full transcript. */
|
|
27
34
|
stop: (reason?: string) => Promise<void>;
|
|
35
|
+
/**
|
|
36
|
+
* Play audio INTO the call (the bot speaks). Delegates to the source; throws
|
|
37
|
+
* if the underlying adapter doesn't implement `speak`. See `SpeakAudio` for
|
|
38
|
+
* the formats each adapter accepts (Recall: mp3; Discord: pcm).
|
|
39
|
+
*/
|
|
40
|
+
speak: (audio: SpeakAudio) => Promise<void>;
|
|
41
|
+
/** Cut the bot's in-progress speech (barge-in). No-op when the source can't
|
|
42
|
+
* inject/stop audio or nothing is playing. */
|
|
43
|
+
stopSpeaking: () => Promise<void>;
|
|
44
|
+
/**
|
|
45
|
+
* Post a text message INTO the call chat. Delegates to the source; throws if
|
|
46
|
+
* the underlying adapter doesn't implement `sendChat`. `opts.system` is a hint
|
|
47
|
+
* for platforms that distinguish system messages (ignored elsewhere).
|
|
48
|
+
*/
|
|
49
|
+
sendChat: (text: string, opts?: {
|
|
50
|
+
system?: boolean;
|
|
51
|
+
}) => Promise<void>;
|
|
52
|
+
/** What the underlying source can do (speak / chat). */
|
|
53
|
+
readonly capabilities: MeetingCapabilities;
|
|
28
54
|
getTranscript: () => MeetingTurn[];
|
|
29
55
|
getParticipants: () => MeetingParticipant[];
|
|
30
56
|
};
|
package/dist/source.d.ts
CHANGED
|
@@ -7,6 +7,50 @@ export type MeetingParticipant = {
|
|
|
7
7
|
platform?: string;
|
|
8
8
|
metadata?: Record<string, unknown>;
|
|
9
9
|
};
|
|
10
|
+
/**
|
|
11
|
+
* A text message in the call's chat. `kind` distinguishes ordinary messages
|
|
12
|
+
* from emoji reactions and platform/system notices; everything but `text` is
|
|
13
|
+
* best-effort and may be absent depending on what the source can report.
|
|
14
|
+
*/
|
|
15
|
+
export type ChatMessage = {
|
|
16
|
+
/** The message body (or reaction emoji / system text). */
|
|
17
|
+
text: string;
|
|
18
|
+
/** What sort of chat event this is. Defaults to a normal "message". */
|
|
19
|
+
kind?: "message" | "reaction" | "system";
|
|
20
|
+
/** Resolved sender, when the source identified them. */
|
|
21
|
+
author?: MeetingParticipant;
|
|
22
|
+
/** Raw platform sender id, even when the full participant isn't resolved. */
|
|
23
|
+
authorId?: string;
|
|
24
|
+
/** Epoch ms the message was sent, when the source reports it. */
|
|
25
|
+
timestamp?: number;
|
|
26
|
+
/** Platform channel/thread id the message belongs to, when applicable. */
|
|
27
|
+
channelId?: string;
|
|
28
|
+
};
|
|
29
|
+
/**
|
|
30
|
+
* Which in-call outputs a source supports. Mirrors the optional `speak` /
|
|
31
|
+
* `sendChat` members so a consumer can branch on capabilities up front instead
|
|
32
|
+
* of probing for thrown "not implemented" errors.
|
|
33
|
+
*/
|
|
34
|
+
export type MeetingCapabilities = {
|
|
35
|
+
/** The bot can play audio INTO the call (`speak`). */
|
|
36
|
+
canSpeak: boolean;
|
|
37
|
+
/** The bot can post text into the call chat (`sendChat`). */
|
|
38
|
+
canChat: boolean;
|
|
39
|
+
};
|
|
40
|
+
/**
|
|
41
|
+
* Audio the bot wants to play INTO the call. Adapters declare which formats
|
|
42
|
+
* they accept (Recall: mp3; Discord: pcm); a TypeError is the right signal
|
|
43
|
+
* when an adapter is handed a format it cannot play.
|
|
44
|
+
*/
|
|
45
|
+
export type SpeakAudio = {
|
|
46
|
+
format: "mp3";
|
|
47
|
+
data: ArrayBuffer | Uint8Array;
|
|
48
|
+
} | {
|
|
49
|
+
format: "pcm";
|
|
50
|
+
data: ArrayBuffer | Uint8Array;
|
|
51
|
+
sampleRateHz: number;
|
|
52
|
+
channels: number;
|
|
53
|
+
};
|
|
10
54
|
export type MeetingSourceEventMap = {
|
|
11
55
|
/** A chunk of call audio (in `format`). `participant` is set when the source
|
|
12
56
|
* knows who is speaking for this chunk (per-user streams); otherwise omit it
|
|
@@ -15,9 +59,16 @@ export type MeetingSourceEventMap = {
|
|
|
15
59
|
chunk: AudioChunk;
|
|
16
60
|
participant?: string;
|
|
17
61
|
};
|
|
18
|
-
/** Roster update — someone joined / was identified.
|
|
62
|
+
/** Roster update — someone joined / left / was identified. `status` signals
|
|
63
|
+
* the transition: "joined" (or absent — the historical behavior) when a
|
|
64
|
+
* participant appears/is identified, "left" when they leave the call. */
|
|
19
65
|
participant: {
|
|
20
66
|
participant: MeetingParticipant;
|
|
67
|
+
status?: "joined" | "left";
|
|
68
|
+
};
|
|
69
|
+
/** A text message arrived in the call chat. */
|
|
70
|
+
chat: {
|
|
71
|
+
message: ChatMessage;
|
|
21
72
|
};
|
|
22
73
|
/** The call ended (everyone left, host stopped, etc.). */
|
|
23
74
|
end: {
|
|
@@ -41,4 +92,31 @@ export type MeetingSource = {
|
|
|
41
92
|
start: () => Promise<void>;
|
|
42
93
|
/** Leave the call / stop streaming. */
|
|
43
94
|
stop: (reason?: string) => Promise<void>;
|
|
95
|
+
/**
|
|
96
|
+
* Play audio INTO the call (the bot speaks). Optional — adapters that can't
|
|
97
|
+
* inject audio simply don't implement it; `meeting.speak()` will throw a
|
|
98
|
+
* clear error in that case. Resolves when playback finishes (or as soon as
|
|
99
|
+
* the platform has accepted it, for fire-and-forget transports).
|
|
100
|
+
*/
|
|
101
|
+
speak?: (audio: SpeakAudio) => Promise<void>;
|
|
102
|
+
/**
|
|
103
|
+
* Stop any in-progress `speak()` output immediately (barge-in / ducking).
|
|
104
|
+
* Optional — sources that can't inject audio (or can't stop it) omit it;
|
|
105
|
+
* `meeting.stopSpeaking()` then no-ops.
|
|
106
|
+
*/
|
|
107
|
+
stopSpeaking?: () => Promise<void>;
|
|
108
|
+
/**
|
|
109
|
+
* Post a text message INTO the call chat. Optional — adapters that can't write
|
|
110
|
+
* chat simply don't implement it; `meeting.sendChat()` will throw a clear
|
|
111
|
+
* error in that case. `opts.system` is a hint for platforms that distinguish
|
|
112
|
+
* system/announcement messages from ordinary ones (ignored elsewhere).
|
|
113
|
+
*/
|
|
114
|
+
sendChat?: (text: string, opts?: {
|
|
115
|
+
system?: boolean;
|
|
116
|
+
}) => Promise<void>;
|
|
117
|
+
/**
|
|
118
|
+
* What this source can do (speak / chat). Optional — when absent, consumers
|
|
119
|
+
* fall back to probing the presence of `speak` / `sendChat`.
|
|
120
|
+
*/
|
|
121
|
+
readonly capabilities?: MeetingCapabilities;
|
|
44
122
|
};
|
package/package.json
CHANGED
|
@@ -1,37 +1,72 @@
|
|
|
1
1
|
{
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
2
|
+
"name": "@absolutejs/meeting",
|
|
3
|
+
"version": "0.0.1-beta.10",
|
|
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
|
+
"repository": {
|
|
6
|
+
"type": "git",
|
|
7
|
+
"url": "git+https://github.com/absolutejs/meeting.git"
|
|
8
|
+
},
|
|
9
|
+
"homepage": "https://github.com/absolutejs/meeting",
|
|
10
|
+
"bugs": {
|
|
11
|
+
"url": "https://github.com/absolutejs/meeting/issues"
|
|
12
|
+
},
|
|
13
|
+
"files": [
|
|
14
|
+
"dist",
|
|
15
|
+
"README.md"
|
|
16
|
+
],
|
|
17
|
+
"main": "./dist/index.js",
|
|
18
|
+
"types": "./dist/index.d.ts",
|
|
19
|
+
"exports": {
|
|
20
|
+
".": {
|
|
21
|
+
"import": "./dist/index.js",
|
|
22
|
+
"types": "./dist/index.d.ts"
|
|
23
|
+
},
|
|
24
|
+
"./manifest": {
|
|
25
|
+
"import": "./dist/manifest.js",
|
|
26
|
+
"types": "./dist/manifest.d.ts"
|
|
27
|
+
},
|
|
28
|
+
"./manifest.json": "./dist/manifest.json"
|
|
29
|
+
},
|
|
30
|
+
"license": "BSL-1.1",
|
|
31
|
+
"author": "Alex Kahn",
|
|
32
|
+
"absolutejs": {
|
|
33
|
+
"manifestContract": 2,
|
|
34
|
+
"runtimePeers": {
|
|
35
|
+
"@absolutejs/voice": {
|
|
36
|
+
"artifactImports": [
|
|
37
|
+
"@absolutejs/voice"
|
|
38
|
+
],
|
|
39
|
+
"buildExternals": [
|
|
40
|
+
"@absolutejs/voice",
|
|
41
|
+
"@absolutejs/voice/*"
|
|
42
|
+
],
|
|
43
|
+
"optional": false,
|
|
44
|
+
"range": ">=0.0.22-beta.647 <0.1",
|
|
45
|
+
"tested": "0.0.22-beta.647"
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
},
|
|
49
|
+
"scripts": {
|
|
50
|
+
"build": "rm -rf dist && bun build ./src/index.ts ./src/manifest.ts --outdir dist --root src --target bun --external @absolutejs/manifest --external '@absolutejs/manifest/*' --external @absolutejs/voice --external '@absolutejs/voice/*' --external @sinclair/typebox --external '@sinclair/typebox/*' && tsc --emitDeclarationOnly --project tsconfig.json && absolute-manifest emit",
|
|
51
|
+
"format": "prettier --write \"./**/*.{js,ts,json,md}\"",
|
|
52
|
+
"release": "bun run check:package && npm publish --access public --tag beta",
|
|
53
|
+
"test": "bun test",
|
|
54
|
+
"typecheck": "bun run tsc --noEmit",
|
|
55
|
+
"verify-package": "absolute-manifest verify-package",
|
|
56
|
+
"check:package": "bun run format && bun run typecheck && bun run test && bun run verify-package && bun run build && bun run verify-package --artifacts"
|
|
57
|
+
},
|
|
58
|
+
"dependencies": {
|
|
59
|
+
"@absolutejs/manifest": "0.7.2",
|
|
60
|
+
"@sinclair/typebox": "0.34.52"
|
|
61
|
+
},
|
|
62
|
+
"devDependencies": {
|
|
63
|
+
"@absolutejs/voice": "0.0.22-beta.647",
|
|
64
|
+
"@types/bun": "1.3.14",
|
|
65
|
+
"elysia": "1.4.29",
|
|
66
|
+
"prettier": "3.9.6",
|
|
67
|
+
"typescript": "^5.9.3"
|
|
68
|
+
},
|
|
69
|
+
"peerDependencies": {
|
|
70
|
+
"@absolutejs/voice": ">=0.0.22-beta.647 <0.1"
|
|
71
|
+
}
|
|
37
72
|
}
|