@novalabai/adk 2.7.0 → 2.8.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/client.d.ts +3 -0
- package/dist/client.d.ts.map +1 -1
- package/dist/client.js +4 -0
- package/dist/client.js.map +1 -1
- package/dist/core/errors.d.ts +18 -0
- package/dist/core/errors.d.ts.map +1 -1
- package/dist/core/errors.js +21 -1
- package/dist/core/errors.js.map +1 -1
- package/dist/core/http.d.ts +8 -0
- package/dist/core/http.d.ts.map +1 -1
- package/dist/core/http.js +70 -3
- package/dist/core/http.js.map +1 -1
- package/dist/index.d.ts +7 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +7 -2
- package/dist/index.js.map +1 -1
- package/dist/resources/billing.d.ts +14 -2
- package/dist/resources/billing.d.ts.map +1 -1
- package/dist/resources/billing.js +15 -1
- package/dist/resources/billing.js.map +1 -1
- package/dist/resources/chat.d.ts +27 -0
- package/dist/resources/chat.d.ts.map +1 -1
- package/dist/resources/chat.js +31 -0
- package/dist/resources/chat.js.map +1 -1
- package/dist/resources/history.d.ts +33 -1
- package/dist/resources/history.d.ts.map +1 -1
- package/dist/resources/history.js +43 -3
- package/dist/resources/history.js.map +1 -1
- package/dist/resources/voice.d.ts +47 -0
- package/dist/resources/voice.d.ts.map +1 -0
- package/dist/resources/voice.js +64 -0
- package/dist/resources/voice.js.map +1 -0
- package/dist/types/billing.d.ts +17 -0
- package/dist/types/billing.d.ts.map +1 -1
- package/dist/types/chat-stream.d.ts +166 -0
- package/dist/types/chat-stream.d.ts.map +1 -0
- package/dist/types/chat-stream.js +48 -0
- package/dist/types/chat-stream.js.map +1 -0
- package/dist/types/chat.d.ts +4 -0
- package/dist/types/chat.d.ts.map +1 -1
- package/dist/types/voice.d.ts +16 -0
- package/dist/types/voice.d.ts.map +1 -0
- package/dist/types/voice.js +4 -0
- package/dist/types/voice.js.map +1 -0
- package/package.json +1 -1
package/dist/resources/chat.js
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.ChatResource = void 0;
|
|
4
|
+
const chat_stream_js_1 = require("../types/chat-stream.js");
|
|
4
5
|
const fallback_js_1 = require("../core/fallback.js");
|
|
5
6
|
/**
|
|
6
7
|
* Conversational chat powered by Nova's full AI pipeline.
|
|
@@ -68,6 +69,36 @@ class ChatResource {
|
|
|
68
69
|
async deleteSession(sessionId) {
|
|
69
70
|
return this.http.delete(`/chat/sessions/${sessionId}`);
|
|
70
71
|
}
|
|
72
|
+
/**
|
|
73
|
+
* Stream chat events from /v1/chat/stream as they arrive.
|
|
74
|
+
*
|
|
75
|
+
* Yields a discriminated-union of events: `token` (per-token text),
|
|
76
|
+
* `pipeline` (per-step status), `design` / `document` / `pdf` /
|
|
77
|
+
* `pptx` / `pptx_visual` / `image` / `audio` (artifacts),
|
|
78
|
+
* `guardian` (credential redaction), and a final `done`.
|
|
79
|
+
*
|
|
80
|
+
* @example
|
|
81
|
+
* ```typescript
|
|
82
|
+
* let full = '';
|
|
83
|
+
* for await (const ev of nova.chat.stream({ message: 'create a 10-slide deck for Acme AI' })) {
|
|
84
|
+
* switch (ev.type) {
|
|
85
|
+
* case 'token': full += ev.content; process.stdout.write(ev.content); break;
|
|
86
|
+
* case 'pdf': await fs.writeFile('deck.pdf', Buffer.from(ev.pdf_base64, 'base64')); break;
|
|
87
|
+
* case 'pptx': if (ev.variant === 'editable') {
|
|
88
|
+
* await fs.writeFile(ev.filename, Buffer.from(ev.pptx_base64, 'base64'));
|
|
89
|
+
* } break;
|
|
90
|
+
* case 'pptx_visual':
|
|
91
|
+
* await fs.writeFile(ev.filename, Buffer.from(ev.pptx_base64, 'base64')); break;
|
|
92
|
+
* case 'done': console.log(`\\nDone — ${ev.model_used}, ${ev.agents_used} agents`); break;
|
|
93
|
+
* }
|
|
94
|
+
* }
|
|
95
|
+
* ```
|
|
96
|
+
*/
|
|
97
|
+
async *stream(params) {
|
|
98
|
+
for await (const raw of this.http.postStream('/chat/stream', params)) {
|
|
99
|
+
yield (0, chat_stream_js_1.parseChatEvent)(raw);
|
|
100
|
+
}
|
|
101
|
+
}
|
|
71
102
|
}
|
|
72
103
|
exports.ChatResource = ChatResource;
|
|
73
104
|
//# sourceMappingURL=chat.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"chat.js","sourceRoot":"","sources":["../../src/resources/chat.ts"],"names":[],"mappings":";;;
|
|
1
|
+
{"version":3,"file":"chat.js","sourceRoot":"","sources":["../../src/resources/chat.ts"],"names":[],"mappings":";;;AASA,4DAAyD;AACzD,qDAAgF;AAEhF;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AACH,MAAa,YAAY;IACN,IAAI,CAAa;IAElC,YAAY,IAAgB;QAC1B,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC;IACnB,CAAC;IAED;;;;;OAKG;IACH,KAAK,CAAC,IAAI,CAAC,MAAyB;QAClC,OAAO,IAAI,CAAC,IAAI,CAAC,IAAI,CAAe,OAAO,EAAE,MAAM,CAAC,CAAC;IACvD,CAAC;IAED;;;;;;;;;;OAUG;IACH,KAAK,CAAC,gBAAgB,CACpB,MAAyB,EACzB,cAAyB;QAEzB,MAAM,OAAO,GAAG,MAAM,CAAC,KAAK,IAAI,MAAM,CAAC;QACvC,MAAM,KAAK,GAAG,cAAc,IAAI,CAAC,GAAG,oCAAsB,CAAC,CAAC;QAE5D,OAAO,IAAA,+BAAiB,EACtB,CAAC,KAAK,EAAE,EAAE,CAAC,IAAI,CAAC,IAAI,CAAC,IAAI,CAAe,OAAO,EAAE,EAAE,GAAG,MAAM,EAAE,KAAK,EAAE,CAAC,EACtE,OAAO,EACP,KAAK,EACL,EAAE,mBAAmB,EAAE,IAAI,EAAE,CAC9B,CAAC;IACJ,CAAC;IAED,qCAAqC;IACrC,KAAK,CAAC,QAAQ;QACZ,OAAO,IAAI,CAAC,IAAI,CAAC,GAAG,CAAkB,gBAAgB,CAAC,CAAC;IAC1D,CAAC;IAED,8CAA8C;IAC9C,KAAK,CAAC,OAAO,CAAC,SAAiB;QAC7B,OAAO,IAAI,CAAC,IAAI,CAAC,GAAG,CAAc,kBAAkB,SAAS,UAAU,CAAC,CAAC;IAC3E,CAAC;IAED,0DAA0D;IAC1D,KAAK,CAAC,aAAa,CAAC,SAAiB;QACnC,OAAO,IAAI,CAAC,IAAI,CAAC,MAAM,CAAC,kBAAkB,SAAS,EAAE,CAAC,CAAC;IACzD,CAAC;IAED;;;;;;;;;;;;;;;;;;;;;;;;OAwBG;IACH,KAAK,CAAC,CAAC,MAAM,CAAC,MAAwB;QACpC,IAAI,KAAK,EAAE,MAAM,GAAG,IAAI,IAAI,CAAC,IAAI,CAAC,UAAU,CAAC,cAAc,EAAE,MAAM,CAAC,EAAE,CAAC;YACrE,MAAM,IAAA,+BAAc,EAAC,GAAG,CAAC,CAAC;QAC5B,CAAC;IACH,CAAC;CACF;AAxFD,oCAwFC"}
|
|
@@ -4,7 +4,14 @@ import type { AgentRunResult } from '../types/agents.js';
|
|
|
4
4
|
export declare class HistoryResource {
|
|
5
5
|
private readonly http;
|
|
6
6
|
constructor(http: HttpClient);
|
|
7
|
-
/** List history entries with optional filters.
|
|
7
|
+
/** List history entries with optional filters.
|
|
8
|
+
*
|
|
9
|
+
* The server returns a paginated envelope `{total, page, per_page, entries}`,
|
|
10
|
+
* not a bare array. Older versions of this SDK declared the return type as
|
|
11
|
+
* `HistoryEntry[]` and downstream code that did `for (const e of data)`
|
|
12
|
+
* iterated nothing useful. Now we unwrap `entries` if present and still
|
|
13
|
+
* tolerate a bare-array response from older API builds.
|
|
14
|
+
*/
|
|
8
15
|
list(params?: HistoryQueryParams): Promise<HistoryEntry[]>;
|
|
9
16
|
/** Get a single history entry by ID. */
|
|
10
17
|
get(id: string): Promise<HistoryEntry>;
|
|
@@ -14,6 +21,31 @@ export declare class HistoryResource {
|
|
|
14
21
|
replay(id: string): Promise<AgentRunResult>;
|
|
15
22
|
/** Get aggregated history statistics. */
|
|
16
23
|
stats(): Promise<HistoryStats>;
|
|
24
|
+
/** Approve the action linked to a history entry (status='approval_needed').
|
|
25
|
+
*
|
|
26
|
+
* Returns the executed approval result. Throws NovaAPIError 404 with
|
|
27
|
+
* code='no_approval' when the entry doesn't have a paired pending
|
|
28
|
+
* approval (already decided, or never required one).
|
|
29
|
+
*/
|
|
30
|
+
approve(entryId: string, opts?: {
|
|
31
|
+
note?: string;
|
|
32
|
+
}): Promise<unknown>;
|
|
33
|
+
/** Reject the action linked to a history entry. Same shape as approve(). */
|
|
34
|
+
reject(entryId: string, opts?: {
|
|
35
|
+
note?: string;
|
|
36
|
+
}): Promise<unknown>;
|
|
37
|
+
/** Get the approval state for a history entry.
|
|
38
|
+
*
|
|
39
|
+
* Returns `{status, approval, history_id}`. `status` is one of:
|
|
40
|
+
* 'pending' | 'approved' | 'rejected' | 'expired' | 'not_required'
|
|
41
|
+
* `not_required` means the entry never had a paired approval —
|
|
42
|
+
* useful to disambiguate from a missing entry (which would be 404).
|
|
43
|
+
*/
|
|
44
|
+
approvalStatus(entryId: string): Promise<{
|
|
45
|
+
status: 'pending' | 'approved' | 'rejected' | 'expired' | 'not_required';
|
|
46
|
+
approval: Record<string, unknown> | null;
|
|
47
|
+
history_id: string;
|
|
48
|
+
}>;
|
|
17
49
|
/** Export history entries (same filters as list, returns raw array). */
|
|
18
50
|
export(params?: HistoryExportParams): Promise<HistoryEntry[]>;
|
|
19
51
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"history.d.ts","sourceRoot":"","sources":["../../src/resources/history.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAClD,OAAO,KAAK,EACV,YAAY,EACZ,kBAAkB,EAClB,YAAY,EACZ,mBAAmB,EACnB,mBAAmB,EACpB,MAAM,qBAAqB,CAAC;AAC7B,OAAO,KAA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AC;IAMzE;;;;;;OAMG;IACG,cAAc,CAAC,OAAO,EAAE,MAAM,GAAG,OAAO,CAAC;QAC7C,MAAM,EAAE,SAAS,GAAG,UAAU,GAAG,UAAU,GAAG,SAAS,GAAG,cAAc,CAAC;QACzE,QAAQ,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,IAAI,CAAC;QACzC,UAAU,EAAE,MAAM,CAAC;KACpB,CAAC;IAIF,wEAAwE;IAClE,MAAM,CAAC,MAAM,CAAC,EAAE,mBAAmB,GAAG,OAAO,CAAC,YAAY,EAAE,CAAC;CAQpE"}
|
|
@@ -6,9 +6,19 @@ class HistoryResource {
|
|
|
6
6
|
constructor(http) {
|
|
7
7
|
this.http = http;
|
|
8
8
|
}
|
|
9
|
-
/** List history entries with optional filters.
|
|
9
|
+
/** List history entries with optional filters.
|
|
10
|
+
*
|
|
11
|
+
* The server returns a paginated envelope `{total, page, per_page, entries}`,
|
|
12
|
+
* not a bare array. Older versions of this SDK declared the return type as
|
|
13
|
+
* `HistoryEntry[]` and downstream code that did `for (const e of data)`
|
|
14
|
+
* iterated nothing useful. Now we unwrap `entries` if present and still
|
|
15
|
+
* tolerate a bare-array response from older API builds.
|
|
16
|
+
*/
|
|
10
17
|
async list(params) {
|
|
11
|
-
|
|
18
|
+
const data = await this.http.get('/history', params);
|
|
19
|
+
if (Array.isArray(data))
|
|
20
|
+
return data;
|
|
21
|
+
return data?.entries ?? [];
|
|
12
22
|
}
|
|
13
23
|
/** Get a single history entry by ID. */
|
|
14
24
|
async get(id) {
|
|
@@ -26,9 +36,39 @@ class HistoryResource {
|
|
|
26
36
|
async stats() {
|
|
27
37
|
return this.http.get('/history/stats');
|
|
28
38
|
}
|
|
39
|
+
/** Approve the action linked to a history entry (status='approval_needed').
|
|
40
|
+
*
|
|
41
|
+
* Returns the executed approval result. Throws NovaAPIError 404 with
|
|
42
|
+
* code='no_approval' when the entry doesn't have a paired pending
|
|
43
|
+
* approval (already decided, or never required one).
|
|
44
|
+
*/
|
|
45
|
+
async approve(entryId, opts) {
|
|
46
|
+
return this.http.post(`/history/${encodeURIComponent(entryId)}/approve`, {
|
|
47
|
+
note: opts?.note ?? null,
|
|
48
|
+
});
|
|
49
|
+
}
|
|
50
|
+
/** Reject the action linked to a history entry. Same shape as approve(). */
|
|
51
|
+
async reject(entryId, opts) {
|
|
52
|
+
return this.http.post(`/history/${encodeURIComponent(entryId)}/reject`, {
|
|
53
|
+
note: opts?.note ?? null,
|
|
54
|
+
});
|
|
55
|
+
}
|
|
56
|
+
/** Get the approval state for a history entry.
|
|
57
|
+
*
|
|
58
|
+
* Returns `{status, approval, history_id}`. `status` is one of:
|
|
59
|
+
* 'pending' | 'approved' | 'rejected' | 'expired' | 'not_required'
|
|
60
|
+
* `not_required` means the entry never had a paired approval —
|
|
61
|
+
* useful to disambiguate from a missing entry (which would be 404).
|
|
62
|
+
*/
|
|
63
|
+
async approvalStatus(entryId) {
|
|
64
|
+
return this.http.get(`/history/${encodeURIComponent(entryId)}/approval-status`);
|
|
65
|
+
}
|
|
29
66
|
/** Export history entries (same filters as list, returns raw array). */
|
|
30
67
|
async export(params) {
|
|
31
|
-
|
|
68
|
+
const data = await this.http.get('/history/export', params);
|
|
69
|
+
if (Array.isArray(data))
|
|
70
|
+
return data;
|
|
71
|
+
return data?.entries ?? [];
|
|
32
72
|
}
|
|
33
73
|
}
|
|
34
74
|
exports.HistoryResource = HistoryResource;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"history.js","sourceRoot":"","sources":["../../src/resources/history.ts"],"names":[],"mappings":";;;AAUA,MAAa,eAAe;IACT,IAAI,CAAa;IAElC,YAAY,IAAgB;QAC1B,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC;IACnB,CAAC;IAED
|
|
1
|
+
{"version":3,"file":"history.js","sourceRoot":"","sources":["../../src/resources/history.ts"],"names":[],"mappings":";;;AAUA,MAAa,eAAe;IACT,IAAI,CAAa;IAElC,YAAY,IAAgB;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AAkB,CAAC,OAAO,CAAC,SAAS,EAAE;YACtE,IAAI,EAAE,IAAI,EAAE,IAAI,IAAI,IAAI;SACzB,CAAC,CAAC;IACL,CAAC;IAED;;;;;;OAMG;IACH,KAAK,CAAC,cAAc,CAAC,OAAe;QAKlC,OAAO,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC,YAAY,kBAAkB,CAAC,OAAO,CAAC,kBAAkB,CAAC,CAAC;IAClF,CAAC;IAED,wEAAwE;IACxE,KAAK,CAAC,MAAM,CAAC,MAA4B;QACvC,MAAM,IAAI,GAAG,MAAM,IAAI,CAAC,IAAI,CAAC,GAAG,CAC9B,iBAAiB,EACjB,MAA+D,CAChE,CAAC;QACF,IAAI,KAAK,CAAC,OAAO,CAAC,IAAI,CAAC;YAAE,OAAO,IAAI,CAAC;QACrC,OAAO,IAAI,EAAE,OAAO,IAAI,EAAE,CAAC;IAC7B,CAAC;CACF;AAvFD,0CAuFC"}
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
import type { HttpClient } from '../core/http.js';
|
|
2
|
+
import type { TranscribeResponse } from '../types/voice.js';
|
|
3
|
+
export interface TranscribeParams {
|
|
4
|
+
/** The audio blob to transcribe (browser File / Blob / Node Buffer / Uint8Array) */
|
|
5
|
+
content: Blob | Uint8Array;
|
|
6
|
+
/** Filename — used for extension-based MIME detection if contentType isn't set */
|
|
7
|
+
filename: string;
|
|
8
|
+
/** Optional MIME type override */
|
|
9
|
+
contentType?: string;
|
|
10
|
+
}
|
|
11
|
+
/**
|
|
12
|
+
* Speech-to-text via Whisper (V1).
|
|
13
|
+
*
|
|
14
|
+
* Audio is NOT persisted server-side — only the transcript text is
|
|
15
|
+
* retained downstream (typically in chat history when the user submits
|
|
16
|
+
* the resulting message).
|
|
17
|
+
*
|
|
18
|
+
* @example
|
|
19
|
+
* ```typescript
|
|
20
|
+
* // Browser
|
|
21
|
+
* const blob = audioRecorder.stop();
|
|
22
|
+
* const result = await nova.voice.transcribe({
|
|
23
|
+
* content: blob,
|
|
24
|
+
* filename: 'recording.webm',
|
|
25
|
+
* contentType: 'audio/webm',
|
|
26
|
+
* });
|
|
27
|
+
* if (result.error) {
|
|
28
|
+
* showToast(`Transcription failed: ${result.error}`);
|
|
29
|
+
* } else {
|
|
30
|
+
* composer.value = result.text;
|
|
31
|
+
* }
|
|
32
|
+
*
|
|
33
|
+
* // Node
|
|
34
|
+
* import { readFile } from 'node:fs/promises';
|
|
35
|
+
* const bytes = await readFile('./recording.webm');
|
|
36
|
+
* const result = await nova.voice.transcribe({
|
|
37
|
+
* content: bytes,
|
|
38
|
+
* filename: 'recording.webm',
|
|
39
|
+
* });
|
|
40
|
+
* ```
|
|
41
|
+
*/
|
|
42
|
+
export declare class VoiceResource {
|
|
43
|
+
private readonly http;
|
|
44
|
+
constructor(http: HttpClient);
|
|
45
|
+
transcribe(params: TranscribeParams): Promise<TranscribeResponse>;
|
|
46
|
+
}
|
|
47
|
+
//# sourceMappingURL=voice.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"voice.d.ts","sourceRoot":"","sources":["../../src/resources/voice.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAClD,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,mBAAmB,CAAC;AAE5D,MAAM,WAAW,gBAAgB;IAC/B,oFAAoF;IACpF,OAAO,EAAE,IAAI,GAAG,UAAU,CAAC;IAC3B,kFAAkF;IAClF,QAAQ,EAAE,MAAM,CAAC;IACjB,kCAAkC;IAClC,WAAW,CAAC,EAAE,MAAM,CAAC;CACtB;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA8BG;AACH,qBAAa,aAAa;IACxB,OAAO,CAAC,QAAQ,CAAC,IAAI,CAAa;gBAEtB,IAAI,EAAE,UAAU;IAItB,UAAU,CAAC,MAAM,EAAE,gBAAgB,GAAG,OAAO,CAAC,kBAAkB,CAAC;CASxE"}
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.VoiceResource = void 0;
|
|
4
|
+
/**
|
|
5
|
+
* Speech-to-text via Whisper (V1).
|
|
6
|
+
*
|
|
7
|
+
* Audio is NOT persisted server-side — only the transcript text is
|
|
8
|
+
* retained downstream (typically in chat history when the user submits
|
|
9
|
+
* the resulting message).
|
|
10
|
+
*
|
|
11
|
+
* @example
|
|
12
|
+
* ```typescript
|
|
13
|
+
* // Browser
|
|
14
|
+
* const blob = audioRecorder.stop();
|
|
15
|
+
* const result = await nova.voice.transcribe({
|
|
16
|
+
* content: blob,
|
|
17
|
+
* filename: 'recording.webm',
|
|
18
|
+
* contentType: 'audio/webm',
|
|
19
|
+
* });
|
|
20
|
+
* if (result.error) {
|
|
21
|
+
* showToast(`Transcription failed: ${result.error}`);
|
|
22
|
+
* } else {
|
|
23
|
+
* composer.value = result.text;
|
|
24
|
+
* }
|
|
25
|
+
*
|
|
26
|
+
* // Node
|
|
27
|
+
* import { readFile } from 'node:fs/promises';
|
|
28
|
+
* const bytes = await readFile('./recording.webm');
|
|
29
|
+
* const result = await nova.voice.transcribe({
|
|
30
|
+
* content: bytes,
|
|
31
|
+
* filename: 'recording.webm',
|
|
32
|
+
* });
|
|
33
|
+
* ```
|
|
34
|
+
*/
|
|
35
|
+
class VoiceResource {
|
|
36
|
+
http;
|
|
37
|
+
constructor(http) {
|
|
38
|
+
this.http = http;
|
|
39
|
+
}
|
|
40
|
+
async transcribe(params) {
|
|
41
|
+
const form = new FormData();
|
|
42
|
+
const ctype = params.contentType ?? guessAudioMime(params.filename);
|
|
43
|
+
const blob = params.content instanceof Blob
|
|
44
|
+
? params.content
|
|
45
|
+
: new Blob([params.content], { type: ctype });
|
|
46
|
+
form.append('file', blob, params.filename);
|
|
47
|
+
return this.http.postMultipart('/voice/transcribe', form);
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
exports.VoiceResource = VoiceResource;
|
|
51
|
+
function guessAudioMime(filename) {
|
|
52
|
+
const dot = filename.lastIndexOf('.');
|
|
53
|
+
const ext = dot >= 0 ? filename.slice(dot + 1).toLowerCase() : '';
|
|
54
|
+
const map = {
|
|
55
|
+
webm: 'audio/webm',
|
|
56
|
+
mp4: 'audio/mp4',
|
|
57
|
+
m4a: 'audio/m4a',
|
|
58
|
+
mp3: 'audio/mpeg',
|
|
59
|
+
wav: 'audio/wav',
|
|
60
|
+
ogg: 'audio/ogg',
|
|
61
|
+
};
|
|
62
|
+
return map[ext] ?? 'application/octet-stream';
|
|
63
|
+
}
|
|
64
|
+
//# sourceMappingURL=voice.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"voice.js","sourceRoot":"","sources":["../../src/resources/voice.ts"],"names":[],"mappings":";;;AAYA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA8BG;AACH,MAAa,aAAa;IACP,IAAI,CAAa;IAElC,YAAY,IAAgB;QAC1B,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC;IACnB,CAAC;IAED,KAAK,CAAC,UAAU,CAAC,MAAwB;QACvC,MAAM,IAAI,GAAG,IAAI,QAAQ,EAAE,CAAC;QAC5B,MAAM,KAAK,GAAG,MAAM,CAAC,WAAW,IAAI,cAAc,CAAC,MAAM,CAAC,QAAQ,CAAC,CAAC;QACpE,MAAM,IAAI,GAAG,MAAM,CAAC,OAAO,YAAY,IAAI;YACzC,CAAC,CAAC,MAAM,CAAC,OAAO;YAChB,CAAC,CAAC,IAAI,IAAI,CAAC,CAAC,MAAM,CAAC,OAAqB,CAAC,EAAE,EAAE,IAAI,EAAE,KAAK,EAAE,CAAC,CAAC;QAC9D,IAAI,CAAC,MAAM,CAAC,MAAM,EAAE,IAAI,EAAE,MAAM,CAAC,QAAQ,CAAC,CAAC;QAC3C,OAAO,IAAI,CAAC,IAAI,CAAC,aAAa,CAAqB,mBAAmB,EAAE,IAAI,CAAC,CAAC;IAChF,CAAC;CACF;AAhBD,sCAgBC;AAED,SAAS,cAAc,CAAC,QAAgB;IACtC,MAAM,GAAG,GAAG,QAAQ,CAAC,WAAW,CAAC,GAAG,CAAC,CAAC;IACtC,MAAM,GAAG,GAAG,GAAG,IAAI,CAAC,CAAC,CAAC,CAAC,QAAQ,CAAC,KAAK,CAAC,GAAG,GAAG,CAAC,CAAC,CAAC,WAAW,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;IAClE,MAAM,GAAG,GAA2B;QAClC,IAAI,EAAE,YAAY;QAClB,GAAG,EAAE,WAAW;QAChB,GAAG,EAAE,WAAW;QAChB,GAAG,EAAE,YAAY;QACjB,GAAG,EAAE,WAAW;QAChB,GAAG,EAAE,WAAW;KACjB,CAAC;IACF,OAAO,GAAG,CAAC,GAAG,CAAC,IAAI,0BAA0B,CAAC;AAChD,CAAC"}
|
package/dist/types/billing.d.ts
CHANGED
|
@@ -24,6 +24,23 @@ export interface Plan {
|
|
|
24
24
|
overage_allowed: boolean;
|
|
25
25
|
overage_per_call_cents: number;
|
|
26
26
|
features: PlanFeatures;
|
|
27
|
+
/**
|
|
28
|
+
* Which product line this plan belongs to (PR #91 dual-pricing).
|
|
29
|
+
* - 'api' → API-only plans for developers/SDK callers
|
|
30
|
+
* - 'app' → Workspace plans for dashboard end-users
|
|
31
|
+
* - 'all' → Legacy combined plans (still honored for existing subscribers)
|
|
32
|
+
*/
|
|
33
|
+
product?: 'api' | 'app' | 'all';
|
|
34
|
+
/** One-line marketing tagline shown under the plan name */
|
|
35
|
+
tagline?: string;
|
|
36
|
+
/** 'account' (flat) or 'seat' (per-user) — affects price-period display */
|
|
37
|
+
billing_unit?: 'account' | 'seat';
|
|
38
|
+
}
|
|
39
|
+
/** Plans split by product line — returned by /v1/billing/plans?grouped=true */
|
|
40
|
+
export interface GroupedPlans {
|
|
41
|
+
api_plans: Plan[];
|
|
42
|
+
app_plans: Plan[];
|
|
43
|
+
all_access_plans: Plan[];
|
|
27
44
|
}
|
|
28
45
|
export interface SubscriptionInfo {
|
|
29
46
|
plan: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"billing.d.ts","sourceRoot":"","sources":["../../src/types/billing.ts"],"names":[],"mappings":"AAAA,sCAAsC;AAEtC,MAAM,WAAW,YAAY;IAC3B,cAAc,EAAE,OAAO,CAAC;IACxB,SAAS,EAAE,MAAM,CAAC;IAClB,GAAG,EAAE,OAAO,CAAC;IACb,SAAS,EAAE,OAAO,CAAC;IACnB,aAAa,EAAE,OAAO,CAAC;IACvB,mBAAmB,EAAE,OAAO,CAAC;CAC9B;AAED,MAAM,WAAW,IAAI;IACnB,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,MAAM,CAAC;IACb,WAAW,EAAE,MAAM,CAAC;IACpB,SAAS,EAAE,MAAM,CAAC;IAClB,QAAQ,EAAE,MAAM,CAAC;IACjB,iBAAiB,EAAE,MAAM,CAAC;IAC1B,cAAc,EAAE,MAAM,CAAC;IACvB,YAAY,EAAE,MAAM,CAAC;IACrB,cAAc,EAAE,MAAM,CAAC;IACvB,aAAa,EAAE,MAAM,CAAC;IACtB,aAAa,EAAE,MAAM,CAAC;IACtB,MAAM,EAAE,MAAM,GAAG,MAAM,EAAE,CAAC;IAC1B,OAAO,EAAE,MAAM,CAAC;IAChB,eAAe,EAAE,OAAO,CAAC;IACzB,sBAAsB,EAAE,MAAM,CAAC;IAC/B,QAAQ,EAAE,YAAY,CAAC;
|
|
1
|
+
{"version":3,"file":"billing.d.ts","sourceRoot":"","sources":["../../src/types/billing.ts"],"names":[],"mappings":"AAAA,sCAAsC;AAEtC,MAAM,WAAW,YAAY;IAC3B,cAAc,EAAE,OAAO,CAAC;IACxB,SAAS,EAAE,MAAM,CAAC;IAClB,GAAG,EAAE,OAAO,CAAC;IACb,SAAS,EAAE,OAAO,CAAC;IACnB,aAAa,EAAE,OAAO,CAAC;IACvB,mBAAmB,EAAE,OAAO,CAAC;CAC9B;AAED,MA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AAC,EAAE,MAAM,CAAC;IACZ,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAED,MAAM,WAAW,SAAS;IACxB,WAAW,EAAE,OAAO,CAAC;IACrB,QAAQ,EAAE,MAAM,CAAC;IACjB,MAAM,EAAE,MAAM,CAAC;CAChB;AAED,MAAM,WAAW,wBAAwB;IACvC,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,YAAY,EAAE,MAAM,CAAC;IACrB,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,mBAAmB,EAAE,MAAM,CAAC;IAC5B,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,mBAAmB,CAAC,EAAE,MAAM,CAAC;IAC7B,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,gBAAgB,CAAC,EAAE,OAAO,CAAC;IAC3B,aAAa,CAAC,EAAE,MAAM,EAAE,CAAC;IACzB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,UAAU,CAAC,EAAE,MAAM,CAAC;CACrB"}
|
|
@@ -0,0 +1,166 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Types for Nova's streaming chat API (POST /v1/chat/stream).
|
|
3
|
+
*
|
|
4
|
+
* Server emits a series of SSE events as the chat pipeline progresses.
|
|
5
|
+
* Token chunks stream first, then artifacts (design HTML, PDF, PPT,
|
|
6
|
+
* etc.) land as discrete events, then a terminal `done` event closes
|
|
7
|
+
* the turn. Each event is a discriminated union member keyed on `type`.
|
|
8
|
+
*/
|
|
9
|
+
/** Body for POST /v1/chat/stream. */
|
|
10
|
+
export interface ChatStreamParams {
|
|
11
|
+
message: string;
|
|
12
|
+
/** auto / claude / gpt-4o / gemini / ollama-* / etc. */
|
|
13
|
+
model?: string;
|
|
14
|
+
session_id?: string;
|
|
15
|
+
history?: Array<{
|
|
16
|
+
role: string;
|
|
17
|
+
content: string;
|
|
18
|
+
}>;
|
|
19
|
+
/** Last design HTML for follow-up modifications */
|
|
20
|
+
previous_design_html?: string;
|
|
21
|
+
/** Last tool HTML for follow-up modifications */
|
|
22
|
+
previous_tool_html?: string;
|
|
23
|
+
/** 'deck' / 'web' / 'component' — narrows follow-up routing */
|
|
24
|
+
previous_artifact_type?: string;
|
|
25
|
+
/** File IDs from /v1/files/upload to reference this turn */
|
|
26
|
+
attachment_ids?: string[];
|
|
27
|
+
}
|
|
28
|
+
export interface TokenEvent {
|
|
29
|
+
type: 'token';
|
|
30
|
+
content: string;
|
|
31
|
+
}
|
|
32
|
+
export interface PipelineEvent {
|
|
33
|
+
type: 'pipeline';
|
|
34
|
+
step: Record<string, unknown>;
|
|
35
|
+
}
|
|
36
|
+
export interface MetaEvent {
|
|
37
|
+
type: 'meta';
|
|
38
|
+
session_id?: string;
|
|
39
|
+
turn?: number;
|
|
40
|
+
model?: string;
|
|
41
|
+
}
|
|
42
|
+
export interface DesignEvent {
|
|
43
|
+
type: 'design';
|
|
44
|
+
design: Record<string, unknown>;
|
|
45
|
+
artifact_type?: string;
|
|
46
|
+
}
|
|
47
|
+
export interface DesignChunkEvent {
|
|
48
|
+
type: 'design_chunk';
|
|
49
|
+
chunk: string;
|
|
50
|
+
}
|
|
51
|
+
export interface DocumentEvent {
|
|
52
|
+
type: 'document';
|
|
53
|
+
document: Record<string, unknown>;
|
|
54
|
+
}
|
|
55
|
+
export interface ProgressEvent {
|
|
56
|
+
type: 'progress';
|
|
57
|
+
progress?: Record<string, unknown>;
|
|
58
|
+
}
|
|
59
|
+
export interface ImageEvent {
|
|
60
|
+
type: 'image';
|
|
61
|
+
image: unknown;
|
|
62
|
+
}
|
|
63
|
+
export interface VideoEvent {
|
|
64
|
+
type: 'video';
|
|
65
|
+
video: unknown;
|
|
66
|
+
}
|
|
67
|
+
export interface AudioEvent {
|
|
68
|
+
type: 'audio';
|
|
69
|
+
/** Usually a `data:audio/mpeg;base64,...` URL playable in <audio> */
|
|
70
|
+
audio: string;
|
|
71
|
+
voice?: string;
|
|
72
|
+
model?: string;
|
|
73
|
+
}
|
|
74
|
+
export interface FilesEvent {
|
|
75
|
+
type: 'files';
|
|
76
|
+
files: Array<{
|
|
77
|
+
path: string;
|
|
78
|
+
content: string;
|
|
79
|
+
}>;
|
|
80
|
+
stack?: string;
|
|
81
|
+
}
|
|
82
|
+
export interface PdfEvent {
|
|
83
|
+
type: 'pdf';
|
|
84
|
+
pdf_base64: string;
|
|
85
|
+
filename: string;
|
|
86
|
+
}
|
|
87
|
+
export interface PptxEvent {
|
|
88
|
+
type: 'pptx';
|
|
89
|
+
pptx_base64: string;
|
|
90
|
+
filename: string;
|
|
91
|
+
/** 'editable' = native python-pptx, real text boxes; 'visual' = image-based */
|
|
92
|
+
variant: 'editable' | 'visual';
|
|
93
|
+
}
|
|
94
|
+
export interface PptxVisualEvent {
|
|
95
|
+
type: 'pptx_visual';
|
|
96
|
+
pptx_base64: string;
|
|
97
|
+
filename: string;
|
|
98
|
+
}
|
|
99
|
+
export interface GuardianEvent {
|
|
100
|
+
type: 'guardian';
|
|
101
|
+
severity: 'low' | 'medium' | 'high';
|
|
102
|
+
kinds: string[];
|
|
103
|
+
content: string;
|
|
104
|
+
}
|
|
105
|
+
export interface AgentHealthEvent {
|
|
106
|
+
type: 'agent_health';
|
|
107
|
+
/** One entry per tracked agent: { agent_id, status, last_event_at, ... } */
|
|
108
|
+
agents: Array<Record<string, unknown>>;
|
|
109
|
+
/** Aggregate system state: redis_status, phase, etc. */
|
|
110
|
+
system: Record<string, unknown>;
|
|
111
|
+
/** Number of open Repair Agent cases at the moment of emission */
|
|
112
|
+
open_cases: number;
|
|
113
|
+
}
|
|
114
|
+
export interface A2AEvent {
|
|
115
|
+
type: 'a2a';
|
|
116
|
+
/** Calling agent (usually 'chat') */
|
|
117
|
+
from: string;
|
|
118
|
+
/** Target specialist agent name */
|
|
119
|
+
to: string;
|
|
120
|
+
/** The sub-task that was delegated */
|
|
121
|
+
request: string;
|
|
122
|
+
/** The specialist's reply */
|
|
123
|
+
response: string;
|
|
124
|
+
}
|
|
125
|
+
export interface DoneEvent {
|
|
126
|
+
type: 'done';
|
|
127
|
+
full_response: string;
|
|
128
|
+
model_used?: string;
|
|
129
|
+
pipeline?: Array<Record<string, unknown>>;
|
|
130
|
+
agents_used?: number;
|
|
131
|
+
turn?: number;
|
|
132
|
+
/** Set when the auto-agent fallback fired this turn */
|
|
133
|
+
auto_agent_spec?: Record<string, unknown>;
|
|
134
|
+
}
|
|
135
|
+
export interface ErrorEvent {
|
|
136
|
+
type: 'error';
|
|
137
|
+
message: string;
|
|
138
|
+
code?: string;
|
|
139
|
+
}
|
|
140
|
+
/** Per-conversation voice override — fired when the user says
|
|
141
|
+
* "switch to my Spanish voice" / "use the alloy voice". The dashboard
|
|
142
|
+
* mirrors the choice into local storage so the next Talk-to-Nova
|
|
143
|
+
* session uses it. */
|
|
144
|
+
export interface VoiceSetEvent {
|
|
145
|
+
type: 'voice_set';
|
|
146
|
+
/** Resolved voice name (stock voice or clone display name) */
|
|
147
|
+
voice: string;
|
|
148
|
+
/** Clone identifier when the resolved voice is a user clone */
|
|
149
|
+
clone_id: string | null;
|
|
150
|
+
}
|
|
151
|
+
/** Server-side keep-alive emitted every ~15s of idle time. No-op for callers
|
|
152
|
+
* — its purpose is just to keep the TCP connection alive across iOS Safari /
|
|
153
|
+
* cellular NAT / corporate proxies that drop idle SSE streams. */
|
|
154
|
+
export interface HeartbeatEvent {
|
|
155
|
+
type: 'heartbeat';
|
|
156
|
+
}
|
|
157
|
+
export type ChatStreamEvent = TokenEvent | PipelineEvent | MetaEvent | DesignEvent | DesignChunkEvent | DocumentEvent | ProgressEvent | ImageEvent | VideoEvent | AudioEvent | FilesEvent | PdfEvent | PptxEvent | PptxVisualEvent | GuardianEvent | AgentHealthEvent | A2AEvent | VoiceSetEvent | HeartbeatEvent | DoneEvent | ErrorEvent;
|
|
158
|
+
/** Parse a raw SSE payload object into a typed event.
|
|
159
|
+
*
|
|
160
|
+
* Unknown event types fall through to a synthetic MetaEvent so callers
|
|
161
|
+
* don't crash on new server-emitted variants they haven't pulled the
|
|
162
|
+
* SDK update for. Callers can always check `event.type` in a
|
|
163
|
+
* `switch (event.type) { ... default: ... }` to handle the unknown case.
|
|
164
|
+
*/
|
|
165
|
+
export declare function parseChatEvent(raw: Record<string, any>): ChatStreamEvent;
|
|
166
|
+
//# sourceMappingURL=chat-stream.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"chat-stream.d.ts","sourceRoot":"","sources":["../../src/types/chat-stream.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,qCAAqC;AACrC,MAAM,WAAW,gBAAgB;IAC/B,OAAO,EAAE,MAAM,CAAC;IAChB,wDAAwD;IACxD,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,OAAO,CAAC,EAAE,KAAK,CAAC;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,OAAO,EAAE,MAAM,CAAA;KAAE,CAAC,CAAC;IACnD,mDAAmD;IACnD,oBAAoB,CAAC,EAAE,MAAM,CAAC;IAC9B,iDAAiD;IACjD,kBAAkB,CAAC,EAAE,MAAM,CAAC;IAC5B,+DAA+D;IAC/D,sBAAsB,CAAC,EAAE,MAAM,CAAC;IAChC,4DAA4D;IAC5D,cAAc,CAAC,EAAE,MAAM,EAAE,CAAC;CAC3B;AAED,MAAM,WAAW,UAAU;IACzB,IAAI,EAAE,OAAO,CAAC;IACd,OAAO,EAAE,MAAM,CAAC;CACjB;AAED,MAAM,WAAW,aAAa;IAC5B,IAAI,EAAE,UAAU,CAAC;IACjB,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;CAC/B;AAED,MAAM,WAAW,SAAS;IACxB,IAAI,EAAE,MAAM,CAAC;IACb,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,KA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AAM,CAAC;IACd,uDAAuD;IACvD,eAAe,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;CAC3C;AAED,MAAM,WAAW,UAAU;IACzB,IAAI,EAAE,OAAO,CAAC;IACd,OAAO,EAAE,MAAM,CAAC;IAChB,IAAI,CAAC,EAAE,MAAM,CAAC;CACf;AAED;;;uBAGuB;AACvB,MAAM,WAAW,aAAa;IAC5B,IAAI,EAAE,WAAW,CAAC;IAClB,8DAA8D;IAC9D,KAAK,EAAE,MAAM,CAAC;IACd,+DAA+D;IAC/D,QAAQ,EAAE,MAAM,GAAG,IAAI,CAAC;CACzB;AAED;;mEAEmE;AACnE,MAAM,WAAW,cAAc;IAC7B,IAAI,EAAE,WAAW,CAAC;CACnB;AAED,MAAM,MAAM,eAAe,GACvB,UAAU,GACV,aAAa,GACb,SAAS,GACT,WAAW,GACX,gBAAgB,GAChB,aAAa,GACb,aAAa,GACb,UAAU,GACV,UAAU,GACV,UAAU,GACV,UAAU,GACV,QAAQ,GACR,SAAS,GACT,eAAe,GACf,aAAa,GACb,gBAAgB,GAChB,QAAQ,GACR,aAAa,GACb,cAAc,GACd,SAAS,GACT,UAAU,CAAC;AAEf;;;;;;GAMG;AACH,wBAAgB,cAAc,CAAC,GAAG,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,GAAG,eAAe,CA4BxE"}
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* Types for Nova's streaming chat API (POST /v1/chat/stream).
|
|
4
|
+
*
|
|
5
|
+
* Server emits a series of SSE events as the chat pipeline progresses.
|
|
6
|
+
* Token chunks stream first, then artifacts (design HTML, PDF, PPT,
|
|
7
|
+
* etc.) land as discrete events, then a terminal `done` event closes
|
|
8
|
+
* the turn. Each event is a discriminated union member keyed on `type`.
|
|
9
|
+
*/
|
|
10
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
11
|
+
exports.parseChatEvent = parseChatEvent;
|
|
12
|
+
/** Parse a raw SSE payload object into a typed event.
|
|
13
|
+
*
|
|
14
|
+
* Unknown event types fall through to a synthetic MetaEvent so callers
|
|
15
|
+
* don't crash on new server-emitted variants they haven't pulled the
|
|
16
|
+
* SDK update for. Callers can always check `event.type` in a
|
|
17
|
+
* `switch (event.type) { ... default: ... }` to handle the unknown case.
|
|
18
|
+
*/
|
|
19
|
+
function parseChatEvent(raw) {
|
|
20
|
+
const t = (raw.type ?? '');
|
|
21
|
+
switch (t) {
|
|
22
|
+
case 'token':
|
|
23
|
+
case 'pipeline':
|
|
24
|
+
case 'meta':
|
|
25
|
+
case 'design':
|
|
26
|
+
case 'design_chunk':
|
|
27
|
+
case 'document':
|
|
28
|
+
case 'progress':
|
|
29
|
+
case 'image':
|
|
30
|
+
case 'video':
|
|
31
|
+
case 'audio':
|
|
32
|
+
case 'files':
|
|
33
|
+
case 'pdf':
|
|
34
|
+
case 'pptx':
|
|
35
|
+
case 'pptx_visual':
|
|
36
|
+
case 'guardian':
|
|
37
|
+
case 'agent_health':
|
|
38
|
+
case 'a2a':
|
|
39
|
+
case 'voice_set':
|
|
40
|
+
case 'heartbeat':
|
|
41
|
+
case 'done':
|
|
42
|
+
case 'error':
|
|
43
|
+
return raw;
|
|
44
|
+
default:
|
|
45
|
+
return { type: 'meta', ...raw };
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
//# sourceMappingURL=chat-stream.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"chat-stream.js","sourceRoot":"","sources":["../../src/types/chat-stream.ts"],"names":[],"mappings":";AAAA;;;;;;;GAOG;;AAoMH,wCA4BC;AAnCD;;;;;;GAMG;AACH,SAAgB,cAAc,CAAC,GAAwB;IACrD,MAAM,CAAC,GAAG,CAAC,GAAG,CAAC,IAAI,IAAI,EAAE,CAA4B,CAAC;IACtD,QAAQ,CAAC,EAAE,CAAC;QACV,KAAK,OAAO,CAAC;QACb,KAAK,UAAU,CAAC;QAChB,KAAK,MAAM,CAAC;QACZ,KAAK,QAAQ,CAAC;QACd,KAAK,cAAc,CAAC;QACpB,KAAK,UAAU,CAAC;QAChB,KAAK,UAAU,CAAC;QAChB,KAAK,OAAO,CAAC;QACb,KAAK,OAAO,CAAC;QACb,KAAK,OAAO,CAAC;QACb,KAAK,OAAO,CAAC;QACb,KAAK,KAAK,CAAC;QACX,KAAK,MAAM,CAAC;QACZ,KAAK,aAAa,CAAC;QACnB,KAAK,UAAU,CAAC;QAChB,KAAK,cAAc,CAAC;QACpB,KAAK,KAAK,CAAC;QACX,KAAK,WAAW,CAAC;QACjB,KAAK,WAAW,CAAC;QACjB,KAAK,MAAM,CAAC;QACZ,KAAK,OAAO;YACV,OAAO,GAAsB,CAAC;QAChC;YACE,OAAO,EAAE,IAAI,EAAE,MAAM,EAAE,GAAG,GAAG,EAAe,CAAC;IACjD,CAAC;AACH,CAAC"}
|
package/dist/types/chat.d.ts
CHANGED
|
@@ -44,10 +44,14 @@ export interface ChatResponse {
|
|
|
44
44
|
session_id: string;
|
|
45
45
|
model_used: string;
|
|
46
46
|
tokens_used: number;
|
|
47
|
+
/** Confidence score (0-100). */
|
|
48
|
+
confidence?: number;
|
|
47
49
|
cost?: number;
|
|
48
50
|
sources?: string[];
|
|
49
51
|
trust?: ChatTrustScores;
|
|
50
52
|
turn: number;
|
|
53
|
+
/** Request duration in seconds. */
|
|
54
|
+
duration?: number;
|
|
51
55
|
pipeline?: PipelineStep[];
|
|
52
56
|
agents_used?: number;
|
|
53
57
|
document?: ChatDocument;
|
package/dist/types/chat.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"chat.d.ts","sourceRoot":"","sources":["../../src/types/chat.ts"],"names":[],"mappings":"AAAA,6CAA6C;AAC7C,MAAM,WAAW,iBAAiB;IAChC,0BAA0B;IAC1B,OAAO,EAAE,MAAM,CAAC;IAChB,wFAAwF;IACxF,KAAK,CAAC,EAAE,MAAM,CA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AQ,EAAE,MAAM,CAAC;IACjB,KAAK,EAAE,MAAM,CAAC;IACd,OAAO,EAAE,MAAM,CAAC;IAChB,WAAW,EAAE,MAAM,CAAC;CACrB;AAED,6BAA6B;AAC7B,MAAM,WAAW,eAAe;IAC9B,QAAQ,EAAE,WAAW,EAAE,CAAC;IACxB,KAAK,EAAE,MAAM,CAAC;CACf;AAED,4BAA4B;AAC5B,MAAM,WAAW,kBAAkB;IACjC,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,EAAE,MAAM,CAAC;IAChB,SAAS,EAAE,MAAM,CAAC;IAClB,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB;AAED,kCAAkC;AAClC,MAAM,WAAW,WAAW;IAC1B,UAAU,EAAE,MAAM,CAAC;IACnB,QAAQ,EAAE,kBAAkB,EAAE,CAAC;IAC/B,KAAK,EAAE,MAAM,CAAC;CACf"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
/** Types for Nova's voice API (V1 — speech-to-text). */
|
|
2
|
+
export interface TranscribeResponse {
|
|
3
|
+
/** Transcribed text. Empty when error is non-null. */
|
|
4
|
+
text: string;
|
|
5
|
+
/** Server-side transcription duration in ms */
|
|
6
|
+
duration_ms: number;
|
|
7
|
+
/** Whisper model that handled the request, e.g. 'whisper-1' */
|
|
8
|
+
model_used: string;
|
|
9
|
+
/**
|
|
10
|
+
* Set when transcription failed: 'no_api_key', 'audio_empty',
|
|
11
|
+
* 'audio_too_large', 'http_<status>', or an exception class name.
|
|
12
|
+
* When error is set, text is empty — surface this to the user.
|
|
13
|
+
*/
|
|
14
|
+
error: string | null;
|
|
15
|
+
}
|
|
16
|
+
//# sourceMappingURL=voice.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"voice.d.ts","sourceRoot":"","sources":["../../src/types/voice.ts"],"names":[],"mappings":"AAAA,wDAAwD;AAExD,MAAM,WAAW,kBAAkB;IACjC,sDAAsD;IACtD,IAAI,EAAE,MAAM,CAAC;IACb,+CAA+C;IAC/C,WAAW,EAAE,MAAM,CAAC;IACpB,+DAA+D;IAC/D,UAAU,EAAE,MAAM,CAAC;IACnB;;;;OAIG;IACH,KAAK,EAAE,MAAM,GAAG,IAAI,CAAC;CACtB"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"voice.js","sourceRoot":"","sources":["../../src/types/voice.ts"],"names":[],"mappings":";AAAA,wDAAwD"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@novalabai/adk",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.8.2",
|
|
4
4
|
"description": "NovaLab Agent Development Kit — Build, test, and deploy Nova AI agents with multi-agent orchestration, smart model routing, trust layer, and confidence scoring",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"types": "dist/index.d.ts",
|