@dtelecom/agents-js 0.1.0 → 0.1.2
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.mts +3 -69
- package/dist/index.d.ts +3 -69
- package/dist/index.js +1 -10
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +3 -11
- package/dist/index.mjs.map +1 -1
- package/dist/memory/index.d.mts +70 -0
- package/dist/memory/index.d.ts +70 -0
- package/dist/memory/index.js +486 -0
- package/dist/memory/index.js.map +1 -0
- package/dist/memory/index.mjs +12 -0
- package/dist/memory/index.mjs.map +1 -0
- package/dist/providers/index.d.mts +1 -1
- package/dist/providers/index.d.ts +1 -1
- package/dist/{types-Cs5uUoTC.d.mts → types-EvtHMokR.d.mts} +1 -1
- package/dist/{types-Cs5uUoTC.d.ts → types-EvtHMokR.d.ts} +1 -1
- package/package.json +6 -1
package/dist/index.d.mts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import * as _dtelecom_server_sdk_node from '@dtelecom/server-sdk-node';
|
|
2
2
|
import { Room, AudioSource, RemoteAudioTrack, AudioFrame } from '@dtelecom/server-sdk-node';
|
|
3
3
|
import { EventEmitter } from 'events';
|
|
4
|
-
import { A as AgentConfig, a as AgentStartOptions, M as Message, L as LLMPlugin, P as PipelineOptions, b as AgentState, S as STTStream, T as TranscriptionResult } from './types-
|
|
5
|
-
export { c as AgentEvents, d as AudioOutput, D as DataMessageHandler,
|
|
4
|
+
import { A as AgentConfig, a as AgentStartOptions, M as Message, L as LLMPlugin, P as PipelineOptions, b as AgentState, S as STTStream, T as TranscriptionResult } from './types-EvtHMokR.mjs';
|
|
5
|
+
export { c as AgentEvents, d as AudioOutput, D as DataMessageHandler, e as LLMChunk, f as MemoryConfig, g as PipelineEvents, R as RespondMode, h as STTPlugin, i as STTStreamOptions, j as TTSPlugin } from './types-EvtHMokR.mjs';
|
|
6
6
|
|
|
7
7
|
declare class VoiceAgent extends EventEmitter {
|
|
8
8
|
private readonly config;
|
|
@@ -263,72 +263,6 @@ declare class AudioInput {
|
|
|
263
263
|
close(): void;
|
|
264
264
|
}
|
|
265
265
|
|
|
266
|
-
/**
|
|
267
|
-
* MemoryStore — SQLite + sqlite-vec database layer for room memory.
|
|
268
|
-
*
|
|
269
|
-
* Single .db file stores:
|
|
270
|
-
* - turns: every spoken turn (full transcript)
|
|
271
|
-
* - sessions: meeting metadata + LLM-generated summaries
|
|
272
|
-
* - turn_vectors: embedding index for semantic turn search
|
|
273
|
-
* - session_vectors: embedding index for session summary search
|
|
274
|
-
*/
|
|
275
|
-
interface TurnRow {
|
|
276
|
-
id: number;
|
|
277
|
-
room: string;
|
|
278
|
-
session_id: string;
|
|
279
|
-
speaker: string;
|
|
280
|
-
text: string;
|
|
281
|
-
is_agent: number;
|
|
282
|
-
created_at: number;
|
|
283
|
-
}
|
|
284
|
-
interface SessionRow {
|
|
285
|
-
id: string;
|
|
286
|
-
room: string;
|
|
287
|
-
started_at: number;
|
|
288
|
-
ended_at: number | null;
|
|
289
|
-
participants: string | null;
|
|
290
|
-
summary: string | null;
|
|
291
|
-
turn_count: number;
|
|
292
|
-
}
|
|
293
|
-
interface SearchResult {
|
|
294
|
-
speaker: string;
|
|
295
|
-
text: string;
|
|
296
|
-
created_at: number;
|
|
297
|
-
session_id: string;
|
|
298
|
-
distance: number;
|
|
299
|
-
}
|
|
300
|
-
interface SessionSearchResult {
|
|
301
|
-
session_id: string;
|
|
302
|
-
summary: string;
|
|
303
|
-
started_at: number;
|
|
304
|
-
distance: number;
|
|
305
|
-
}
|
|
306
|
-
declare class MemoryStore {
|
|
307
|
-
private db;
|
|
308
|
-
constructor(dbPath: string);
|
|
309
|
-
private createTables;
|
|
310
|
-
/** Insert a turn and its embedding vector. */
|
|
311
|
-
insertTurn(room: string, sessionId: string, speaker: string, text: string, isAgent: boolean, embedding: Float32Array): number;
|
|
312
|
-
/** Create a new session record. */
|
|
313
|
-
insertSession(id: string, room: string): void;
|
|
314
|
-
/** Update a session with summary and end time. */
|
|
315
|
-
updateSessionSummary(sessionId: string, summary: string, turnCount: number, participants: string[], embedding: Float32Array): void;
|
|
316
|
-
/** End a session without summary (e.g., too few turns). */
|
|
317
|
-
endSession(sessionId: string, turnCount: number, participants: string[]): void;
|
|
318
|
-
/** KNN search turns by embedding similarity. */
|
|
319
|
-
searchTurns(room: string, queryEmbedding: Float32Array, limit: number): SearchResult[];
|
|
320
|
-
/** KNN search session summaries by embedding similarity. */
|
|
321
|
-
searchSessions(room: string, queryEmbedding: Float32Array, limit: number): SessionSearchResult[];
|
|
322
|
-
/** Get the last N turns from a specific session. */
|
|
323
|
-
getRecentTurns(room: string, sessionId: string, limit: number): TurnRow[];
|
|
324
|
-
/** Get all turns for a session (for summarization). */
|
|
325
|
-
getSessionTurns(sessionId: string): TurnRow[];
|
|
326
|
-
/** Get total turn count for a session. */
|
|
327
|
-
getSessionTurnCount(sessionId: string): number;
|
|
328
|
-
/** Close the database. */
|
|
329
|
-
close(): void;
|
|
330
|
-
}
|
|
331
|
-
|
|
332
266
|
type LogLevel = 'debug' | 'info' | 'warn' | 'error' | 'silent';
|
|
333
267
|
declare function setLogLevel(level: LogLevel): void;
|
|
334
268
|
declare function getLogLevel(): LogLevel;
|
|
@@ -340,4 +274,4 @@ interface Logger {
|
|
|
340
274
|
}
|
|
341
275
|
declare function createLogger(tag: string): Logger;
|
|
342
276
|
|
|
343
|
-
export { AgentConfig, AgentStartOptions, AgentState, AudioInput, BargeIn, BaseSTTStream, ContextManager, type ContextManagerOptions, LLMPlugin, type LogLevel, type Logger,
|
|
277
|
+
export { AgentConfig, AgentStartOptions, AgentState, AudioInput, BargeIn, BaseSTTStream, ContextManager, type ContextManagerOptions, LLMPlugin, type LogLevel, type Logger, Message, Pipeline, PipelineOptions, RoomConnection, type RoomConnectionOptions, STTStream, SentenceSplitter, TranscriptionResult, TurnDetector, type TurnDetectorOptions, VoiceAgent, createLogger, getLogLevel, setLogLevel };
|
package/dist/index.d.ts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import * as _dtelecom_server_sdk_node from '@dtelecom/server-sdk-node';
|
|
2
2
|
import { Room, AudioSource, RemoteAudioTrack, AudioFrame } from '@dtelecom/server-sdk-node';
|
|
3
3
|
import { EventEmitter } from 'events';
|
|
4
|
-
import { A as AgentConfig, a as AgentStartOptions, M as Message, L as LLMPlugin, P as PipelineOptions, b as AgentState, S as STTStream, T as TranscriptionResult } from './types-
|
|
5
|
-
export { c as AgentEvents, d as AudioOutput, D as DataMessageHandler,
|
|
4
|
+
import { A as AgentConfig, a as AgentStartOptions, M as Message, L as LLMPlugin, P as PipelineOptions, b as AgentState, S as STTStream, T as TranscriptionResult } from './types-EvtHMokR.js';
|
|
5
|
+
export { c as AgentEvents, d as AudioOutput, D as DataMessageHandler, e as LLMChunk, f as MemoryConfig, g as PipelineEvents, R as RespondMode, h as STTPlugin, i as STTStreamOptions, j as TTSPlugin } from './types-EvtHMokR.js';
|
|
6
6
|
|
|
7
7
|
declare class VoiceAgent extends EventEmitter {
|
|
8
8
|
private readonly config;
|
|
@@ -263,72 +263,6 @@ declare class AudioInput {
|
|
|
263
263
|
close(): void;
|
|
264
264
|
}
|
|
265
265
|
|
|
266
|
-
/**
|
|
267
|
-
* MemoryStore — SQLite + sqlite-vec database layer for room memory.
|
|
268
|
-
*
|
|
269
|
-
* Single .db file stores:
|
|
270
|
-
* - turns: every spoken turn (full transcript)
|
|
271
|
-
* - sessions: meeting metadata + LLM-generated summaries
|
|
272
|
-
* - turn_vectors: embedding index for semantic turn search
|
|
273
|
-
* - session_vectors: embedding index for session summary search
|
|
274
|
-
*/
|
|
275
|
-
interface TurnRow {
|
|
276
|
-
id: number;
|
|
277
|
-
room: string;
|
|
278
|
-
session_id: string;
|
|
279
|
-
speaker: string;
|
|
280
|
-
text: string;
|
|
281
|
-
is_agent: number;
|
|
282
|
-
created_at: number;
|
|
283
|
-
}
|
|
284
|
-
interface SessionRow {
|
|
285
|
-
id: string;
|
|
286
|
-
room: string;
|
|
287
|
-
started_at: number;
|
|
288
|
-
ended_at: number | null;
|
|
289
|
-
participants: string | null;
|
|
290
|
-
summary: string | null;
|
|
291
|
-
turn_count: number;
|
|
292
|
-
}
|
|
293
|
-
interface SearchResult {
|
|
294
|
-
speaker: string;
|
|
295
|
-
text: string;
|
|
296
|
-
created_at: number;
|
|
297
|
-
session_id: string;
|
|
298
|
-
distance: number;
|
|
299
|
-
}
|
|
300
|
-
interface SessionSearchResult {
|
|
301
|
-
session_id: string;
|
|
302
|
-
summary: string;
|
|
303
|
-
started_at: number;
|
|
304
|
-
distance: number;
|
|
305
|
-
}
|
|
306
|
-
declare class MemoryStore {
|
|
307
|
-
private db;
|
|
308
|
-
constructor(dbPath: string);
|
|
309
|
-
private createTables;
|
|
310
|
-
/** Insert a turn and its embedding vector. */
|
|
311
|
-
insertTurn(room: string, sessionId: string, speaker: string, text: string, isAgent: boolean, embedding: Float32Array): number;
|
|
312
|
-
/** Create a new session record. */
|
|
313
|
-
insertSession(id: string, room: string): void;
|
|
314
|
-
/** Update a session with summary and end time. */
|
|
315
|
-
updateSessionSummary(sessionId: string, summary: string, turnCount: number, participants: string[], embedding: Float32Array): void;
|
|
316
|
-
/** End a session without summary (e.g., too few turns). */
|
|
317
|
-
endSession(sessionId: string, turnCount: number, participants: string[]): void;
|
|
318
|
-
/** KNN search turns by embedding similarity. */
|
|
319
|
-
searchTurns(room: string, queryEmbedding: Float32Array, limit: number): SearchResult[];
|
|
320
|
-
/** KNN search session summaries by embedding similarity. */
|
|
321
|
-
searchSessions(room: string, queryEmbedding: Float32Array, limit: number): SessionSearchResult[];
|
|
322
|
-
/** Get the last N turns from a specific session. */
|
|
323
|
-
getRecentTurns(room: string, sessionId: string, limit: number): TurnRow[];
|
|
324
|
-
/** Get all turns for a session (for summarization). */
|
|
325
|
-
getSessionTurns(sessionId: string): TurnRow[];
|
|
326
|
-
/** Get total turn count for a session. */
|
|
327
|
-
getSessionTurnCount(sessionId: string): number;
|
|
328
|
-
/** Close the database. */
|
|
329
|
-
close(): void;
|
|
330
|
-
}
|
|
331
|
-
|
|
332
266
|
type LogLevel = 'debug' | 'info' | 'warn' | 'error' | 'silent';
|
|
333
267
|
declare function setLogLevel(level: LogLevel): void;
|
|
334
268
|
declare function getLogLevel(): LogLevel;
|
|
@@ -340,4 +274,4 @@ interface Logger {
|
|
|
340
274
|
}
|
|
341
275
|
declare function createLogger(tag: string): Logger;
|
|
342
276
|
|
|
343
|
-
export { AgentConfig, AgentStartOptions, AgentState, AudioInput, BargeIn, BaseSTTStream, ContextManager, type ContextManagerOptions, LLMPlugin, type LogLevel, type Logger,
|
|
277
|
+
export { AgentConfig, AgentStartOptions, AgentState, AudioInput, BargeIn, BaseSTTStream, ContextManager, type ContextManagerOptions, LLMPlugin, type LogLevel, type Logger, Message, Pipeline, PipelineOptions, RoomConnection, type RoomConnectionOptions, STTStream, SentenceSplitter, TranscriptionResult, TurnDetector, type TurnDetectorOptions, VoiceAgent, createLogger, getLogLevel, setLogLevel };
|
package/dist/index.js
CHANGED
|
@@ -519,11 +519,8 @@ __export(src_exports, {
|
|
|
519
519
|
BargeIn: () => BargeIn,
|
|
520
520
|
BaseSTTStream: () => BaseSTTStream,
|
|
521
521
|
ContextManager: () => ContextManager,
|
|
522
|
-
Embedder: () => Embedder,
|
|
523
|
-
MemoryStore: () => MemoryStore,
|
|
524
522
|
Pipeline: () => Pipeline,
|
|
525
523
|
RoomConnection: () => RoomConnection,
|
|
526
|
-
RoomMemory: () => RoomMemory,
|
|
527
524
|
SentenceSplitter: () => SentenceSplitter,
|
|
528
525
|
TurnDetector: () => TurnDetector,
|
|
529
526
|
VoiceAgent: () => VoiceAgent,
|
|
@@ -665,7 +662,7 @@ var import_fs = require("fs");
|
|
|
665
662
|
var import_path = require("path");
|
|
666
663
|
init_logger();
|
|
667
664
|
var log3 = createLogger("AudioOutput");
|
|
668
|
-
var SAMPLE_RATE =
|
|
665
|
+
var SAMPLE_RATE = 48e3;
|
|
669
666
|
var CHANNELS = 1;
|
|
670
667
|
var FRAME_DURATION_MS = 20;
|
|
671
668
|
var SAMPLES_PER_FRAME = SAMPLE_RATE * FRAME_DURATION_MS / 1e3;
|
|
@@ -1724,9 +1721,6 @@ var BaseSTTStream = class extends import_events3.EventEmitter {
|
|
|
1724
1721
|
};
|
|
1725
1722
|
|
|
1726
1723
|
// src/index.ts
|
|
1727
|
-
init_embedder();
|
|
1728
|
-
init_memory_store();
|
|
1729
|
-
init_room_memory();
|
|
1730
1724
|
init_logger();
|
|
1731
1725
|
// Annotate the CommonJS export names for ESM import in node:
|
|
1732
1726
|
0 && (module.exports = {
|
|
@@ -1735,11 +1729,8 @@ init_logger();
|
|
|
1735
1729
|
BargeIn,
|
|
1736
1730
|
BaseSTTStream,
|
|
1737
1731
|
ContextManager,
|
|
1738
|
-
Embedder,
|
|
1739
|
-
MemoryStore,
|
|
1740
1732
|
Pipeline,
|
|
1741
1733
|
RoomConnection,
|
|
1742
|
-
RoomMemory,
|
|
1743
1734
|
SentenceSplitter,
|
|
1744
1735
|
TurnDetector,
|
|
1745
1736
|
VoiceAgent,
|