@speakai/mcp-server 1.0.3 → 1.0.4
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.js +808 -166
- package/package.json +3 -1
package/dist/index.js
CHANGED
|
@@ -6,6 +6,9 @@ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
|
6
6
|
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
7
7
|
var __getProtoOf = Object.getPrototypeOf;
|
|
8
8
|
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
9
|
+
var __esm = (fn, res) => function __init() {
|
|
10
|
+
return fn && (res = (0, fn[__getOwnPropNames(fn)[0]])(fn = 0)), res;
|
|
11
|
+
};
|
|
9
12
|
var __export = (target, all) => {
|
|
10
13
|
for (var name in all)
|
|
11
14
|
__defProp(target, name, { get: all[name], enumerable: true });
|
|
@@ -28,45 +31,32 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
|
|
|
28
31
|
));
|
|
29
32
|
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
30
33
|
|
|
31
|
-
// src/
|
|
32
|
-
var
|
|
33
|
-
__export(
|
|
34
|
+
// src/client.ts
|
|
35
|
+
var client_exports = {};
|
|
36
|
+
__export(client_exports, {
|
|
34
37
|
createSpeakClient: () => createSpeakClient,
|
|
35
38
|
formatAxiosError: () => formatAxiosError,
|
|
36
|
-
|
|
39
|
+
speakClient: () => speakClient
|
|
37
40
|
});
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
var media_exports = {};
|
|
44
|
-
__export(media_exports, {
|
|
45
|
-
register: () => register
|
|
46
|
-
});
|
|
47
|
-
var import_zod = require("zod");
|
|
48
|
-
|
|
49
|
-
// src/client.ts
|
|
50
|
-
var import_axios = __toESM(require("axios"));
|
|
51
|
-
var BASE_URL = process.env.SPEAK_BASE_URL ?? "https://api.speakai.co";
|
|
52
|
-
var API_KEY = process.env.SPEAK_API_KEY ?? "";
|
|
53
|
-
if (!API_KEY && !process.env.SPEAK_MCP_LIBRARY_MODE) {
|
|
54
|
-
process.stderr.write(
|
|
55
|
-
"[speak-mcp] Warning: SPEAK_API_KEY is not set. All requests will fail.\n"
|
|
56
|
-
);
|
|
41
|
+
function getBaseUrl() {
|
|
42
|
+
return process.env.SPEAK_BASE_URL ?? "https://api.speakai.co";
|
|
43
|
+
}
|
|
44
|
+
function getApiKey() {
|
|
45
|
+
return process.env.SPEAK_API_KEY ?? "";
|
|
57
46
|
}
|
|
58
|
-
var accessToken = process.env.SPEAK_ACCESS_TOKEN ?? "";
|
|
59
|
-
var refreshToken = "";
|
|
60
|
-
var tokenExpiresAt = 0;
|
|
61
47
|
async function authenticate() {
|
|
48
|
+
const apiKey = getApiKey();
|
|
49
|
+
if (!apiKey) {
|
|
50
|
+
throw new Error("SPEAK_API_KEY is not set. Run 'speak-mcp config set-key' or set the environment variable.");
|
|
51
|
+
}
|
|
62
52
|
try {
|
|
63
53
|
const res = await import_axios.default.post(
|
|
64
|
-
`${
|
|
54
|
+
`${getBaseUrl()}/v1/auth/accessToken`,
|
|
65
55
|
{},
|
|
66
56
|
{
|
|
67
57
|
headers: {
|
|
68
58
|
"Content-Type": "application/json",
|
|
69
|
-
"x-speakai-key":
|
|
59
|
+
"x-speakai-key": apiKey
|
|
70
60
|
}
|
|
71
61
|
}
|
|
72
62
|
);
|
|
@@ -89,12 +79,12 @@ async function refreshAccessToken() {
|
|
|
89
79
|
}
|
|
90
80
|
try {
|
|
91
81
|
const res = await import_axios.default.post(
|
|
92
|
-
`${
|
|
82
|
+
`${getBaseUrl()}/v1/auth/refreshToken`,
|
|
93
83
|
{ refreshToken },
|
|
94
84
|
{
|
|
95
85
|
headers: {
|
|
96
86
|
"Content-Type": "application/json",
|
|
97
|
-
"x-speakai-key":
|
|
87
|
+
"x-speakai-key": getApiKey(),
|
|
98
88
|
"x-access-token": accessToken
|
|
99
89
|
}
|
|
100
90
|
}
|
|
@@ -118,35 +108,6 @@ async function ensureAuthenticated() {
|
|
|
118
108
|
}
|
|
119
109
|
}
|
|
120
110
|
}
|
|
121
|
-
var speakClient = import_axios.default.create({
|
|
122
|
-
baseURL: BASE_URL,
|
|
123
|
-
headers: { "Content-Type": "application/json" },
|
|
124
|
-
timeout: 6e4
|
|
125
|
-
});
|
|
126
|
-
speakClient.interceptors.request.use(
|
|
127
|
-
async (config) => {
|
|
128
|
-
await ensureAuthenticated();
|
|
129
|
-
config.headers.set("x-speakai-key", API_KEY);
|
|
130
|
-
config.headers.set("x-access-token", accessToken);
|
|
131
|
-
return config;
|
|
132
|
-
}
|
|
133
|
-
);
|
|
134
|
-
speakClient.interceptors.response.use(
|
|
135
|
-
(response) => response,
|
|
136
|
-
async (error) => {
|
|
137
|
-
const originalRequest = error.config;
|
|
138
|
-
const retryCount = originalRequest._retryCount ?? 0;
|
|
139
|
-
if (error.response?.status === 401 && retryCount < 2) {
|
|
140
|
-
originalRequest._retryCount = retryCount + 1;
|
|
141
|
-
tokenExpiresAt = 0;
|
|
142
|
-
await ensureAuthenticated();
|
|
143
|
-
originalRequest.headers["x-speakai-key"] = API_KEY;
|
|
144
|
-
originalRequest.headers["x-access-token"] = accessToken;
|
|
145
|
-
return speakClient(originalRequest);
|
|
146
|
-
}
|
|
147
|
-
return Promise.reject(error);
|
|
148
|
-
}
|
|
149
|
-
);
|
|
150
111
|
function createSpeakClient(options) {
|
|
151
112
|
return import_axios.default.create({
|
|
152
113
|
baseURL: options.baseUrl,
|
|
@@ -168,11 +129,54 @@ function formatAxiosError(error) {
|
|
|
168
129
|
if (error instanceof Error) return error.message;
|
|
169
130
|
return String(error);
|
|
170
131
|
}
|
|
132
|
+
var import_axios, accessToken, refreshToken, tokenExpiresAt, speakClient;
|
|
133
|
+
var init_client = __esm({
|
|
134
|
+
"src/client.ts"() {
|
|
135
|
+
"use strict";
|
|
136
|
+
import_axios = __toESM(require("axios"));
|
|
137
|
+
accessToken = process.env.SPEAK_ACCESS_TOKEN ?? "";
|
|
138
|
+
refreshToken = "";
|
|
139
|
+
tokenExpiresAt = 0;
|
|
140
|
+
speakClient = import_axios.default.create({
|
|
141
|
+
headers: { "Content-Type": "application/json" },
|
|
142
|
+
timeout: 6e4
|
|
143
|
+
});
|
|
144
|
+
speakClient.interceptors.request.use(
|
|
145
|
+
async (config) => {
|
|
146
|
+
config.baseURL = getBaseUrl();
|
|
147
|
+
await ensureAuthenticated();
|
|
148
|
+
config.headers.set("x-speakai-key", getApiKey());
|
|
149
|
+
config.headers.set("x-access-token", accessToken);
|
|
150
|
+
return config;
|
|
151
|
+
}
|
|
152
|
+
);
|
|
153
|
+
speakClient.interceptors.response.use(
|
|
154
|
+
(response) => response,
|
|
155
|
+
async (error) => {
|
|
156
|
+
const originalRequest = error.config;
|
|
157
|
+
const retryCount = originalRequest._retryCount ?? 0;
|
|
158
|
+
if (error.response?.status === 401 && retryCount < 2) {
|
|
159
|
+
originalRequest._retryCount = retryCount + 1;
|
|
160
|
+
tokenExpiresAt = 0;
|
|
161
|
+
await ensureAuthenticated();
|
|
162
|
+
originalRequest.headers["x-speakai-key"] = getApiKey();
|
|
163
|
+
originalRequest.headers["x-access-token"] = accessToken;
|
|
164
|
+
return speakClient(originalRequest);
|
|
165
|
+
}
|
|
166
|
+
return Promise.reject(error);
|
|
167
|
+
}
|
|
168
|
+
);
|
|
169
|
+
}
|
|
170
|
+
});
|
|
171
171
|
|
|
172
172
|
// src/tools/media.ts
|
|
173
|
-
|
|
173
|
+
var media_exports = {};
|
|
174
|
+
__export(media_exports, {
|
|
175
|
+
register: () => register
|
|
176
|
+
});
|
|
177
|
+
function register(server, client) {
|
|
174
178
|
const api = client ?? speakClient;
|
|
175
|
-
|
|
179
|
+
server.tool(
|
|
176
180
|
"get_signed_upload_url",
|
|
177
181
|
"Get a pre-signed S3 URL for direct media file upload. Use this before uploading a file directly to Speak AI storage.",
|
|
178
182
|
{
|
|
@@ -198,7 +202,7 @@ function register(server2, client) {
|
|
|
198
202
|
}
|
|
199
203
|
}
|
|
200
204
|
);
|
|
201
|
-
|
|
205
|
+
server.tool(
|
|
202
206
|
"upload_media",
|
|
203
207
|
"Upload a media file to Speak AI by providing a publicly accessible URL. Speak AI will fetch and process the file asynchronously.",
|
|
204
208
|
{
|
|
@@ -233,7 +237,7 @@ function register(server2, client) {
|
|
|
233
237
|
}
|
|
234
238
|
}
|
|
235
239
|
);
|
|
236
|
-
|
|
240
|
+
server.tool(
|
|
237
241
|
"list_media",
|
|
238
242
|
"List all media files in the workspace with optional filtering, pagination, and sorting.",
|
|
239
243
|
{
|
|
@@ -264,7 +268,7 @@ function register(server2, client) {
|
|
|
264
268
|
}
|
|
265
269
|
}
|
|
266
270
|
);
|
|
267
|
-
|
|
271
|
+
server.tool(
|
|
268
272
|
"get_media_insights",
|
|
269
273
|
"Retrieve AI-generated insights for a media file, including topics, sentiment, action items, and summaries.",
|
|
270
274
|
{
|
|
@@ -286,7 +290,7 @@ function register(server2, client) {
|
|
|
286
290
|
}
|
|
287
291
|
}
|
|
288
292
|
);
|
|
289
|
-
|
|
293
|
+
server.tool(
|
|
290
294
|
"get_transcript",
|
|
291
295
|
"Retrieve the full transcript for a media file, including speaker labels and timestamps.",
|
|
292
296
|
{
|
|
@@ -308,7 +312,7 @@ function register(server2, client) {
|
|
|
308
312
|
}
|
|
309
313
|
}
|
|
310
314
|
);
|
|
311
|
-
|
|
315
|
+
server.tool(
|
|
312
316
|
"update_transcript_speakers",
|
|
313
317
|
"Update or rename speaker labels in a media transcript.",
|
|
314
318
|
{
|
|
@@ -339,7 +343,7 @@ function register(server2, client) {
|
|
|
339
343
|
}
|
|
340
344
|
}
|
|
341
345
|
);
|
|
342
|
-
|
|
346
|
+
server.tool(
|
|
343
347
|
"get_media_status",
|
|
344
348
|
"Check the processing status of a media file (e.g. pending, transcribing, completed, failed).",
|
|
345
349
|
{
|
|
@@ -361,7 +365,7 @@ function register(server2, client) {
|
|
|
361
365
|
}
|
|
362
366
|
}
|
|
363
367
|
);
|
|
364
|
-
|
|
368
|
+
server.tool(
|
|
365
369
|
"update_media_metadata",
|
|
366
370
|
"Update metadata fields (name, description, tags, status) for an existing media file.",
|
|
367
371
|
{
|
|
@@ -390,7 +394,7 @@ function register(server2, client) {
|
|
|
390
394
|
}
|
|
391
395
|
}
|
|
392
396
|
);
|
|
393
|
-
|
|
397
|
+
server.tool(
|
|
394
398
|
"delete_media",
|
|
395
399
|
"Permanently delete a media file and all associated transcripts and insights.",
|
|
396
400
|
{
|
|
@@ -413,16 +417,23 @@ function register(server2, client) {
|
|
|
413
417
|
}
|
|
414
418
|
);
|
|
415
419
|
}
|
|
420
|
+
var import_zod;
|
|
421
|
+
var init_media = __esm({
|
|
422
|
+
"src/tools/media.ts"() {
|
|
423
|
+
"use strict";
|
|
424
|
+
import_zod = require("zod");
|
|
425
|
+
init_client();
|
|
426
|
+
}
|
|
427
|
+
});
|
|
416
428
|
|
|
417
429
|
// src/tools/text.ts
|
|
418
430
|
var text_exports = {};
|
|
419
431
|
__export(text_exports, {
|
|
420
432
|
register: () => register2
|
|
421
433
|
});
|
|
422
|
-
|
|
423
|
-
function register2(server2, client) {
|
|
434
|
+
function register2(server, client) {
|
|
424
435
|
const api = client ?? speakClient;
|
|
425
|
-
|
|
436
|
+
server.tool(
|
|
426
437
|
"create_text_note",
|
|
427
438
|
"Create a new text note in Speak AI for analysis. The content will be analyzed for insights, topics, and sentiment.",
|
|
428
439
|
{
|
|
@@ -455,7 +466,7 @@ function register2(server2, client) {
|
|
|
455
466
|
}
|
|
456
467
|
}
|
|
457
468
|
);
|
|
458
|
-
|
|
469
|
+
server.tool(
|
|
459
470
|
"get_text_insight",
|
|
460
471
|
"Retrieve AI-generated insights for a text note, including topics, sentiment, summaries, and action items.",
|
|
461
472
|
{
|
|
@@ -477,7 +488,7 @@ function register2(server2, client) {
|
|
|
477
488
|
}
|
|
478
489
|
}
|
|
479
490
|
);
|
|
480
|
-
|
|
491
|
+
server.tool(
|
|
481
492
|
"reanalyze_text",
|
|
482
493
|
"Trigger a re-analysis of an existing text note to regenerate insights with the latest AI models.",
|
|
483
494
|
{
|
|
@@ -499,7 +510,7 @@ function register2(server2, client) {
|
|
|
499
510
|
}
|
|
500
511
|
}
|
|
501
512
|
);
|
|
502
|
-
|
|
513
|
+
server.tool(
|
|
503
514
|
"update_text_note",
|
|
504
515
|
"Update an existing text note's name, content, or metadata. Updating text content will trigger re-analysis.",
|
|
505
516
|
{
|
|
@@ -530,16 +541,23 @@ function register2(server2, client) {
|
|
|
530
541
|
}
|
|
531
542
|
);
|
|
532
543
|
}
|
|
544
|
+
var import_zod2;
|
|
545
|
+
var init_text = __esm({
|
|
546
|
+
"src/tools/text.ts"() {
|
|
547
|
+
"use strict";
|
|
548
|
+
import_zod2 = require("zod");
|
|
549
|
+
init_client();
|
|
550
|
+
}
|
|
551
|
+
});
|
|
533
552
|
|
|
534
553
|
// src/tools/exports.ts
|
|
535
554
|
var exports_exports = {};
|
|
536
555
|
__export(exports_exports, {
|
|
537
556
|
register: () => register3
|
|
538
557
|
});
|
|
539
|
-
|
|
540
|
-
function register3(server2, client) {
|
|
558
|
+
function register3(server, client) {
|
|
541
559
|
const api = client ?? speakClient;
|
|
542
|
-
|
|
560
|
+
server.tool(
|
|
543
561
|
"export_media",
|
|
544
562
|
"Export a media file's transcript or insights in various formats (pdf, docx, srt, vtt, txt, csv, md).",
|
|
545
563
|
{
|
|
@@ -572,7 +590,7 @@ function register3(server2, client) {
|
|
|
572
590
|
}
|
|
573
591
|
}
|
|
574
592
|
);
|
|
575
|
-
|
|
593
|
+
server.tool(
|
|
576
594
|
"export_multiple_media",
|
|
577
595
|
"Export multiple media files at once, optionally merged into a single file.",
|
|
578
596
|
{
|
|
@@ -606,16 +624,23 @@ function register3(server2, client) {
|
|
|
606
624
|
}
|
|
607
625
|
);
|
|
608
626
|
}
|
|
627
|
+
var import_zod3;
|
|
628
|
+
var init_exports = __esm({
|
|
629
|
+
"src/tools/exports.ts"() {
|
|
630
|
+
"use strict";
|
|
631
|
+
import_zod3 = require("zod");
|
|
632
|
+
init_client();
|
|
633
|
+
}
|
|
634
|
+
});
|
|
609
635
|
|
|
610
636
|
// src/tools/folders.ts
|
|
611
637
|
var folders_exports = {};
|
|
612
638
|
__export(folders_exports, {
|
|
613
639
|
register: () => register4
|
|
614
640
|
});
|
|
615
|
-
|
|
616
|
-
function register4(server2, client) {
|
|
641
|
+
function register4(server, client) {
|
|
617
642
|
const api = client ?? speakClient;
|
|
618
|
-
|
|
643
|
+
server.tool(
|
|
619
644
|
"get_all_folder_views",
|
|
620
645
|
"Retrieve all saved views across all folders.",
|
|
621
646
|
{},
|
|
@@ -635,7 +660,7 @@ function register4(server2, client) {
|
|
|
635
660
|
}
|
|
636
661
|
}
|
|
637
662
|
);
|
|
638
|
-
|
|
663
|
+
server.tool(
|
|
639
664
|
"get_folder_views",
|
|
640
665
|
"Retrieve all saved views for a specific folder.",
|
|
641
666
|
{
|
|
@@ -657,7 +682,7 @@ function register4(server2, client) {
|
|
|
657
682
|
}
|
|
658
683
|
}
|
|
659
684
|
);
|
|
660
|
-
|
|
685
|
+
server.tool(
|
|
661
686
|
"create_folder_view",
|
|
662
687
|
"Create a new saved view for a folder with custom filters and display settings.",
|
|
663
688
|
{
|
|
@@ -684,7 +709,7 @@ function register4(server2, client) {
|
|
|
684
709
|
}
|
|
685
710
|
}
|
|
686
711
|
);
|
|
687
|
-
|
|
712
|
+
server.tool(
|
|
688
713
|
"update_folder_view",
|
|
689
714
|
"Update an existing saved view's name, filters, or display settings.",
|
|
690
715
|
{
|
|
@@ -712,7 +737,7 @@ function register4(server2, client) {
|
|
|
712
737
|
}
|
|
713
738
|
}
|
|
714
739
|
);
|
|
715
|
-
|
|
740
|
+
server.tool(
|
|
716
741
|
"clone_folder_view",
|
|
717
742
|
"Duplicate an existing folder view.",
|
|
718
743
|
{
|
|
@@ -734,7 +759,7 @@ function register4(server2, client) {
|
|
|
734
759
|
}
|
|
735
760
|
}
|
|
736
761
|
);
|
|
737
|
-
|
|
762
|
+
server.tool(
|
|
738
763
|
"list_folders",
|
|
739
764
|
"List all folders in the workspace with pagination and sorting.",
|
|
740
765
|
{
|
|
@@ -758,7 +783,7 @@ function register4(server2, client) {
|
|
|
758
783
|
}
|
|
759
784
|
}
|
|
760
785
|
);
|
|
761
|
-
|
|
786
|
+
server.tool(
|
|
762
787
|
"get_folder_info",
|
|
763
788
|
"Get detailed information about a specific folder including its contents.",
|
|
764
789
|
{
|
|
@@ -780,7 +805,7 @@ function register4(server2, client) {
|
|
|
780
805
|
}
|
|
781
806
|
}
|
|
782
807
|
);
|
|
783
|
-
|
|
808
|
+
server.tool(
|
|
784
809
|
"create_folder",
|
|
785
810
|
"Create a new folder in the workspace.",
|
|
786
811
|
{
|
|
@@ -803,7 +828,7 @@ function register4(server2, client) {
|
|
|
803
828
|
}
|
|
804
829
|
}
|
|
805
830
|
);
|
|
806
|
-
|
|
831
|
+
server.tool(
|
|
807
832
|
"clone_folder",
|
|
808
833
|
"Duplicate an existing folder and all of its contents.",
|
|
809
834
|
{
|
|
@@ -825,7 +850,7 @@ function register4(server2, client) {
|
|
|
825
850
|
}
|
|
826
851
|
}
|
|
827
852
|
);
|
|
828
|
-
|
|
853
|
+
server.tool(
|
|
829
854
|
"update_folder",
|
|
830
855
|
"Update a folder's name or other properties.",
|
|
831
856
|
{
|
|
@@ -848,7 +873,7 @@ function register4(server2, client) {
|
|
|
848
873
|
}
|
|
849
874
|
}
|
|
850
875
|
);
|
|
851
|
-
|
|
876
|
+
server.tool(
|
|
852
877
|
"delete_folder",
|
|
853
878
|
"Permanently delete a folder. Media within the folder will be moved, not deleted.",
|
|
854
879
|
{
|
|
@@ -871,16 +896,23 @@ function register4(server2, client) {
|
|
|
871
896
|
}
|
|
872
897
|
);
|
|
873
898
|
}
|
|
899
|
+
var import_zod4;
|
|
900
|
+
var init_folders = __esm({
|
|
901
|
+
"src/tools/folders.ts"() {
|
|
902
|
+
"use strict";
|
|
903
|
+
import_zod4 = require("zod");
|
|
904
|
+
init_client();
|
|
905
|
+
}
|
|
906
|
+
});
|
|
874
907
|
|
|
875
908
|
// src/tools/recorder.ts
|
|
876
909
|
var recorder_exports = {};
|
|
877
910
|
__export(recorder_exports, {
|
|
878
911
|
register: () => register5
|
|
879
912
|
});
|
|
880
|
-
|
|
881
|
-
function register5(server2, client) {
|
|
913
|
+
function register5(server, client) {
|
|
882
914
|
const api = client ?? speakClient;
|
|
883
|
-
|
|
915
|
+
server.tool(
|
|
884
916
|
"check_recorder_status",
|
|
885
917
|
"Check whether a recorder/survey is active and accepting submissions.",
|
|
886
918
|
{
|
|
@@ -900,7 +932,7 @@ function register5(server2, client) {
|
|
|
900
932
|
}
|
|
901
933
|
}
|
|
902
934
|
);
|
|
903
|
-
|
|
935
|
+
server.tool(
|
|
904
936
|
"create_recorder",
|
|
905
937
|
"Create a new recorder or survey for collecting audio/video submissions.",
|
|
906
938
|
{
|
|
@@ -922,7 +954,7 @@ function register5(server2, client) {
|
|
|
922
954
|
}
|
|
923
955
|
}
|
|
924
956
|
);
|
|
925
|
-
|
|
957
|
+
server.tool(
|
|
926
958
|
"list_recorders",
|
|
927
959
|
"List all recorders/surveys in the workspace.",
|
|
928
960
|
{
|
|
@@ -944,7 +976,7 @@ function register5(server2, client) {
|
|
|
944
976
|
}
|
|
945
977
|
}
|
|
946
978
|
);
|
|
947
|
-
|
|
979
|
+
server.tool(
|
|
948
980
|
"clone_recorder",
|
|
949
981
|
"Duplicate an existing recorder including all its settings and questions.",
|
|
950
982
|
{
|
|
@@ -964,7 +996,7 @@ function register5(server2, client) {
|
|
|
964
996
|
}
|
|
965
997
|
}
|
|
966
998
|
);
|
|
967
|
-
|
|
999
|
+
server.tool(
|
|
968
1000
|
"get_recorder_info",
|
|
969
1001
|
"Get detailed information about a specific recorder including its settings and questions.",
|
|
970
1002
|
{
|
|
@@ -984,7 +1016,7 @@ function register5(server2, client) {
|
|
|
984
1016
|
}
|
|
985
1017
|
}
|
|
986
1018
|
);
|
|
987
|
-
|
|
1019
|
+
server.tool(
|
|
988
1020
|
"get_recorder_recordings",
|
|
989
1021
|
"List all submissions/recordings collected by a specific recorder.",
|
|
990
1022
|
{
|
|
@@ -1004,7 +1036,7 @@ function register5(server2, client) {
|
|
|
1004
1036
|
}
|
|
1005
1037
|
}
|
|
1006
1038
|
);
|
|
1007
|
-
|
|
1039
|
+
server.tool(
|
|
1008
1040
|
"generate_recorder_url",
|
|
1009
1041
|
"Generate a shareable public URL for a recorder/survey.",
|
|
1010
1042
|
{
|
|
@@ -1024,7 +1056,7 @@ function register5(server2, client) {
|
|
|
1024
1056
|
}
|
|
1025
1057
|
}
|
|
1026
1058
|
);
|
|
1027
|
-
|
|
1059
|
+
server.tool(
|
|
1028
1060
|
"update_recorder_settings",
|
|
1029
1061
|
"Update configuration settings for a recorder (branding, permissions, etc.).",
|
|
1030
1062
|
{
|
|
@@ -1045,7 +1077,7 @@ function register5(server2, client) {
|
|
|
1045
1077
|
}
|
|
1046
1078
|
}
|
|
1047
1079
|
);
|
|
1048
|
-
|
|
1080
|
+
server.tool(
|
|
1049
1081
|
"update_recorder_questions",
|
|
1050
1082
|
"Update the survey questions for a recorder.",
|
|
1051
1083
|
{
|
|
@@ -1066,7 +1098,7 @@ function register5(server2, client) {
|
|
|
1066
1098
|
}
|
|
1067
1099
|
}
|
|
1068
1100
|
);
|
|
1069
|
-
|
|
1101
|
+
server.tool(
|
|
1070
1102
|
"delete_recorder",
|
|
1071
1103
|
"Permanently delete a recorder/survey. Existing recordings are preserved.",
|
|
1072
1104
|
{
|
|
@@ -1087,16 +1119,23 @@ function register5(server2, client) {
|
|
|
1087
1119
|
}
|
|
1088
1120
|
);
|
|
1089
1121
|
}
|
|
1122
|
+
var import_zod5;
|
|
1123
|
+
var init_recorder = __esm({
|
|
1124
|
+
"src/tools/recorder.ts"() {
|
|
1125
|
+
"use strict";
|
|
1126
|
+
import_zod5 = require("zod");
|
|
1127
|
+
init_client();
|
|
1128
|
+
}
|
|
1129
|
+
});
|
|
1090
1130
|
|
|
1091
1131
|
// src/tools/embed.ts
|
|
1092
1132
|
var embed_exports = {};
|
|
1093
1133
|
__export(embed_exports, {
|
|
1094
1134
|
register: () => register6
|
|
1095
1135
|
});
|
|
1096
|
-
|
|
1097
|
-
function register6(server2, client) {
|
|
1136
|
+
function register6(server, client) {
|
|
1098
1137
|
const api = client ?? speakClient;
|
|
1099
|
-
|
|
1138
|
+
server.tool(
|
|
1100
1139
|
"create_embed",
|
|
1101
1140
|
"Create an embeddable player/transcript widget for a media file.",
|
|
1102
1141
|
{
|
|
@@ -1117,7 +1156,7 @@ function register6(server2, client) {
|
|
|
1117
1156
|
}
|
|
1118
1157
|
}
|
|
1119
1158
|
);
|
|
1120
|
-
|
|
1159
|
+
server.tool(
|
|
1121
1160
|
"update_embed",
|
|
1122
1161
|
"Update settings for an existing embed widget.",
|
|
1123
1162
|
{
|
|
@@ -1138,7 +1177,7 @@ function register6(server2, client) {
|
|
|
1138
1177
|
}
|
|
1139
1178
|
}
|
|
1140
1179
|
);
|
|
1141
|
-
|
|
1180
|
+
server.tool(
|
|
1142
1181
|
"check_embed",
|
|
1143
1182
|
"Check if an embed exists for a media file and retrieve its configuration.",
|
|
1144
1183
|
{
|
|
@@ -1158,7 +1197,7 @@ function register6(server2, client) {
|
|
|
1158
1197
|
}
|
|
1159
1198
|
}
|
|
1160
1199
|
);
|
|
1161
|
-
|
|
1200
|
+
server.tool(
|
|
1162
1201
|
"get_embed_iframe_url",
|
|
1163
1202
|
"Get the iframe URL for embedding a media player/transcript on a webpage.",
|
|
1164
1203
|
{
|
|
@@ -1181,16 +1220,23 @@ function register6(server2, client) {
|
|
|
1181
1220
|
}
|
|
1182
1221
|
);
|
|
1183
1222
|
}
|
|
1223
|
+
var import_zod6;
|
|
1224
|
+
var init_embed = __esm({
|
|
1225
|
+
"src/tools/embed.ts"() {
|
|
1226
|
+
"use strict";
|
|
1227
|
+
import_zod6 = require("zod");
|
|
1228
|
+
init_client();
|
|
1229
|
+
}
|
|
1230
|
+
});
|
|
1184
1231
|
|
|
1185
1232
|
// src/tools/prompt.ts
|
|
1186
1233
|
var prompt_exports = {};
|
|
1187
1234
|
__export(prompt_exports, {
|
|
1188
1235
|
register: () => register7
|
|
1189
1236
|
});
|
|
1190
|
-
|
|
1191
|
-
function register7(server2, client) {
|
|
1237
|
+
function register7(server, client) {
|
|
1192
1238
|
const api = client ?? speakClient;
|
|
1193
|
-
|
|
1239
|
+
server.tool(
|
|
1194
1240
|
"list_prompts",
|
|
1195
1241
|
"List all available Magic Prompt templates for AI-powered questions about your media.",
|
|
1196
1242
|
{},
|
|
@@ -1208,7 +1254,7 @@ function register7(server2, client) {
|
|
|
1208
1254
|
}
|
|
1209
1255
|
}
|
|
1210
1256
|
);
|
|
1211
|
-
|
|
1257
|
+
server.tool(
|
|
1212
1258
|
"ask_magic_prompt",
|
|
1213
1259
|
"Ask an AI-powered question about a specific media file using Speak AI's Magic Prompt.",
|
|
1214
1260
|
{
|
|
@@ -1231,16 +1277,23 @@ function register7(server2, client) {
|
|
|
1231
1277
|
}
|
|
1232
1278
|
);
|
|
1233
1279
|
}
|
|
1280
|
+
var import_zod7;
|
|
1281
|
+
var init_prompt = __esm({
|
|
1282
|
+
"src/tools/prompt.ts"() {
|
|
1283
|
+
"use strict";
|
|
1284
|
+
import_zod7 = require("zod");
|
|
1285
|
+
init_client();
|
|
1286
|
+
}
|
|
1287
|
+
});
|
|
1234
1288
|
|
|
1235
1289
|
// src/tools/meeting.ts
|
|
1236
1290
|
var meeting_exports = {};
|
|
1237
1291
|
__export(meeting_exports, {
|
|
1238
1292
|
register: () => register8
|
|
1239
1293
|
});
|
|
1240
|
-
|
|
1241
|
-
function register8(server2, client) {
|
|
1294
|
+
function register8(server, client) {
|
|
1242
1295
|
const api = client ?? speakClient;
|
|
1243
|
-
|
|
1296
|
+
server.tool(
|
|
1244
1297
|
"list_meeting_events",
|
|
1245
1298
|
"List scheduled or completed meeting assistant events with filtering and pagination.",
|
|
1246
1299
|
{
|
|
@@ -1265,7 +1318,7 @@ function register8(server2, client) {
|
|
|
1265
1318
|
}
|
|
1266
1319
|
}
|
|
1267
1320
|
);
|
|
1268
|
-
|
|
1321
|
+
server.tool(
|
|
1269
1322
|
"schedule_meeting_event",
|
|
1270
1323
|
"Schedule the Speak AI meeting assistant to join and record an upcoming meeting.",
|
|
1271
1324
|
{
|
|
@@ -1290,7 +1343,7 @@ function register8(server2, client) {
|
|
|
1290
1343
|
}
|
|
1291
1344
|
}
|
|
1292
1345
|
);
|
|
1293
|
-
|
|
1346
|
+
server.tool(
|
|
1294
1347
|
"remove_assistant_from_meeting",
|
|
1295
1348
|
"Remove the Speak AI assistant from an active or scheduled meeting.",
|
|
1296
1349
|
{
|
|
@@ -1314,7 +1367,7 @@ function register8(server2, client) {
|
|
|
1314
1367
|
}
|
|
1315
1368
|
}
|
|
1316
1369
|
);
|
|
1317
|
-
|
|
1370
|
+
server.tool(
|
|
1318
1371
|
"delete_scheduled_assistant",
|
|
1319
1372
|
"Cancel and delete a scheduled meeting assistant event.",
|
|
1320
1373
|
{
|
|
@@ -1338,16 +1391,23 @@ function register8(server2, client) {
|
|
|
1338
1391
|
}
|
|
1339
1392
|
);
|
|
1340
1393
|
}
|
|
1394
|
+
var import_zod8;
|
|
1395
|
+
var init_meeting = __esm({
|
|
1396
|
+
"src/tools/meeting.ts"() {
|
|
1397
|
+
"use strict";
|
|
1398
|
+
import_zod8 = require("zod");
|
|
1399
|
+
init_client();
|
|
1400
|
+
}
|
|
1401
|
+
});
|
|
1341
1402
|
|
|
1342
1403
|
// src/tools/fields.ts
|
|
1343
1404
|
var fields_exports = {};
|
|
1344
1405
|
__export(fields_exports, {
|
|
1345
1406
|
register: () => register9
|
|
1346
1407
|
});
|
|
1347
|
-
|
|
1348
|
-
function register9(server2, client) {
|
|
1408
|
+
function register9(server, client) {
|
|
1349
1409
|
const api = client ?? speakClient;
|
|
1350
|
-
|
|
1410
|
+
server.tool(
|
|
1351
1411
|
"list_fields",
|
|
1352
1412
|
"List all custom fields defined in the workspace.",
|
|
1353
1413
|
{},
|
|
@@ -1365,7 +1425,7 @@ function register9(server2, client) {
|
|
|
1365
1425
|
}
|
|
1366
1426
|
}
|
|
1367
1427
|
);
|
|
1368
|
-
|
|
1428
|
+
server.tool(
|
|
1369
1429
|
"create_field",
|
|
1370
1430
|
"Create a new custom field for categorizing and tagging media.",
|
|
1371
1431
|
{
|
|
@@ -1387,7 +1447,7 @@ function register9(server2, client) {
|
|
|
1387
1447
|
}
|
|
1388
1448
|
}
|
|
1389
1449
|
);
|
|
1390
|
-
|
|
1450
|
+
server.tool(
|
|
1391
1451
|
"update_multiple_fields",
|
|
1392
1452
|
"Update multiple custom fields in a single batch operation.",
|
|
1393
1453
|
{
|
|
@@ -1407,7 +1467,7 @@ function register9(server2, client) {
|
|
|
1407
1467
|
}
|
|
1408
1468
|
}
|
|
1409
1469
|
);
|
|
1410
|
-
|
|
1470
|
+
server.tool(
|
|
1411
1471
|
"update_field",
|
|
1412
1472
|
"Update a specific custom field by ID.",
|
|
1413
1473
|
{
|
|
@@ -1431,16 +1491,23 @@ function register9(server2, client) {
|
|
|
1431
1491
|
}
|
|
1432
1492
|
);
|
|
1433
1493
|
}
|
|
1494
|
+
var import_zod9;
|
|
1495
|
+
var init_fields = __esm({
|
|
1496
|
+
"src/tools/fields.ts"() {
|
|
1497
|
+
"use strict";
|
|
1498
|
+
import_zod9 = require("zod");
|
|
1499
|
+
init_client();
|
|
1500
|
+
}
|
|
1501
|
+
});
|
|
1434
1502
|
|
|
1435
1503
|
// src/tools/automations.ts
|
|
1436
1504
|
var automations_exports = {};
|
|
1437
1505
|
__export(automations_exports, {
|
|
1438
1506
|
register: () => register10
|
|
1439
1507
|
});
|
|
1440
|
-
|
|
1441
|
-
function register10(server2, client) {
|
|
1508
|
+
function register10(server, client) {
|
|
1442
1509
|
const api = client ?? speakClient;
|
|
1443
|
-
|
|
1510
|
+
server.tool(
|
|
1444
1511
|
"list_automations",
|
|
1445
1512
|
"List all automation rules configured in the workspace.",
|
|
1446
1513
|
{},
|
|
@@ -1458,7 +1525,7 @@ function register10(server2, client) {
|
|
|
1458
1525
|
}
|
|
1459
1526
|
}
|
|
1460
1527
|
);
|
|
1461
|
-
|
|
1528
|
+
server.tool(
|
|
1462
1529
|
"get_automation",
|
|
1463
1530
|
"Get detailed information about a specific automation rule.",
|
|
1464
1531
|
{
|
|
@@ -1478,7 +1545,7 @@ function register10(server2, client) {
|
|
|
1478
1545
|
}
|
|
1479
1546
|
}
|
|
1480
1547
|
);
|
|
1481
|
-
|
|
1548
|
+
server.tool(
|
|
1482
1549
|
"create_automation",
|
|
1483
1550
|
"Create a new automation rule for automatic media processing workflows.",
|
|
1484
1551
|
{
|
|
@@ -1501,7 +1568,7 @@ function register10(server2, client) {
|
|
|
1501
1568
|
}
|
|
1502
1569
|
}
|
|
1503
1570
|
);
|
|
1504
|
-
|
|
1571
|
+
server.tool(
|
|
1505
1572
|
"update_automation",
|
|
1506
1573
|
"Update an existing automation rule's configuration.",
|
|
1507
1574
|
{
|
|
@@ -1528,7 +1595,7 @@ function register10(server2, client) {
|
|
|
1528
1595
|
}
|
|
1529
1596
|
}
|
|
1530
1597
|
);
|
|
1531
|
-
|
|
1598
|
+
server.tool(
|
|
1532
1599
|
"toggle_automation_status",
|
|
1533
1600
|
"Enable or disable an automation rule.",
|
|
1534
1601
|
{
|
|
@@ -1553,16 +1620,23 @@ function register10(server2, client) {
|
|
|
1553
1620
|
}
|
|
1554
1621
|
);
|
|
1555
1622
|
}
|
|
1623
|
+
var import_zod10;
|
|
1624
|
+
var init_automations = __esm({
|
|
1625
|
+
"src/tools/automations.ts"() {
|
|
1626
|
+
"use strict";
|
|
1627
|
+
import_zod10 = require("zod");
|
|
1628
|
+
init_client();
|
|
1629
|
+
}
|
|
1630
|
+
});
|
|
1556
1631
|
|
|
1557
1632
|
// src/tools/webhooks.ts
|
|
1558
1633
|
var webhooks_exports = {};
|
|
1559
1634
|
__export(webhooks_exports, {
|
|
1560
1635
|
register: () => register11
|
|
1561
1636
|
});
|
|
1562
|
-
|
|
1563
|
-
function register11(server2, client) {
|
|
1637
|
+
function register11(server, client) {
|
|
1564
1638
|
const api = client ?? speakClient;
|
|
1565
|
-
|
|
1639
|
+
server.tool(
|
|
1566
1640
|
"create_webhook",
|
|
1567
1641
|
"Create a new webhook to receive real-time notifications when events occur in Speak AI.",
|
|
1568
1642
|
{
|
|
@@ -1583,7 +1657,7 @@ function register11(server2, client) {
|
|
|
1583
1657
|
}
|
|
1584
1658
|
}
|
|
1585
1659
|
);
|
|
1586
|
-
|
|
1660
|
+
server.tool(
|
|
1587
1661
|
"list_webhooks",
|
|
1588
1662
|
"List all configured webhooks in the workspace.",
|
|
1589
1663
|
{},
|
|
@@ -1601,7 +1675,7 @@ function register11(server2, client) {
|
|
|
1601
1675
|
}
|
|
1602
1676
|
}
|
|
1603
1677
|
);
|
|
1604
|
-
|
|
1678
|
+
server.tool(
|
|
1605
1679
|
"update_webhook",
|
|
1606
1680
|
"Update an existing webhook's URL or subscribed events.",
|
|
1607
1681
|
{
|
|
@@ -1623,7 +1697,7 @@ function register11(server2, client) {
|
|
|
1623
1697
|
}
|
|
1624
1698
|
}
|
|
1625
1699
|
);
|
|
1626
|
-
|
|
1700
|
+
server.tool(
|
|
1627
1701
|
"delete_webhook",
|
|
1628
1702
|
"Delete a webhook and stop receiving notifications at its endpoint.",
|
|
1629
1703
|
{
|
|
@@ -1644,43 +1718,611 @@ function register11(server2, client) {
|
|
|
1644
1718
|
}
|
|
1645
1719
|
);
|
|
1646
1720
|
}
|
|
1721
|
+
var import_zod11;
|
|
1722
|
+
var init_webhooks = __esm({
|
|
1723
|
+
"src/tools/webhooks.ts"() {
|
|
1724
|
+
"use strict";
|
|
1725
|
+
import_zod11 = require("zod");
|
|
1726
|
+
init_client();
|
|
1727
|
+
}
|
|
1728
|
+
});
|
|
1647
1729
|
|
|
1648
1730
|
// src/tools/index.ts
|
|
1649
|
-
var
|
|
1650
|
-
|
|
1651
|
-
|
|
1652
|
-
|
|
1653
|
-
|
|
1654
|
-
recorder_exports,
|
|
1655
|
-
embed_exports,
|
|
1656
|
-
prompt_exports,
|
|
1657
|
-
meeting_exports,
|
|
1658
|
-
fields_exports,
|
|
1659
|
-
automations_exports,
|
|
1660
|
-
webhooks_exports
|
|
1661
|
-
];
|
|
1662
|
-
function registerAllTools(server2, client) {
|
|
1731
|
+
var tools_exports = {};
|
|
1732
|
+
__export(tools_exports, {
|
|
1733
|
+
registerAllTools: () => registerAllTools
|
|
1734
|
+
});
|
|
1735
|
+
function registerAllTools(server, client) {
|
|
1663
1736
|
for (const mod of modules) {
|
|
1664
|
-
mod.register(
|
|
1737
|
+
mod.register(server, client);
|
|
1665
1738
|
}
|
|
1666
1739
|
}
|
|
1740
|
+
var modules;
|
|
1741
|
+
var init_tools = __esm({
|
|
1742
|
+
"src/tools/index.ts"() {
|
|
1743
|
+
"use strict";
|
|
1744
|
+
init_media();
|
|
1745
|
+
init_text();
|
|
1746
|
+
init_exports();
|
|
1747
|
+
init_folders();
|
|
1748
|
+
init_recorder();
|
|
1749
|
+
init_embed();
|
|
1750
|
+
init_prompt();
|
|
1751
|
+
init_meeting();
|
|
1752
|
+
init_fields();
|
|
1753
|
+
init_automations();
|
|
1754
|
+
init_webhooks();
|
|
1755
|
+
modules = [
|
|
1756
|
+
media_exports,
|
|
1757
|
+
text_exports,
|
|
1758
|
+
exports_exports,
|
|
1759
|
+
folders_exports,
|
|
1760
|
+
recorder_exports,
|
|
1761
|
+
embed_exports,
|
|
1762
|
+
prompt_exports,
|
|
1763
|
+
meeting_exports,
|
|
1764
|
+
fields_exports,
|
|
1765
|
+
automations_exports,
|
|
1766
|
+
webhooks_exports
|
|
1767
|
+
];
|
|
1768
|
+
}
|
|
1769
|
+
});
|
|
1667
1770
|
|
|
1668
|
-
// src/
|
|
1669
|
-
var
|
|
1670
|
-
|
|
1671
|
-
|
|
1771
|
+
// src/cli/config.ts
|
|
1772
|
+
var config_exports = {};
|
|
1773
|
+
__export(config_exports, {
|
|
1774
|
+
getConfigPath: () => getConfigPath,
|
|
1775
|
+
loadConfig: () => loadConfig,
|
|
1776
|
+
resolveApiKey: () => resolveApiKey,
|
|
1777
|
+
resolveBaseUrl: () => resolveBaseUrl,
|
|
1778
|
+
saveConfig: () => saveConfig
|
|
1672
1779
|
});
|
|
1673
|
-
|
|
1674
|
-
|
|
1675
|
-
|
|
1676
|
-
|
|
1677
|
-
|
|
1780
|
+
function ensureDir() {
|
|
1781
|
+
if (!import_fs.default.existsSync(CONFIG_DIR)) {
|
|
1782
|
+
import_fs.default.mkdirSync(CONFIG_DIR, { recursive: true });
|
|
1783
|
+
}
|
|
1784
|
+
}
|
|
1785
|
+
function loadConfig() {
|
|
1786
|
+
try {
|
|
1787
|
+
if (import_fs.default.existsSync(CONFIG_FILE)) {
|
|
1788
|
+
return JSON.parse(import_fs.default.readFileSync(CONFIG_FILE, "utf-8"));
|
|
1789
|
+
}
|
|
1790
|
+
} catch {
|
|
1791
|
+
}
|
|
1792
|
+
return {};
|
|
1793
|
+
}
|
|
1794
|
+
function saveConfig(config) {
|
|
1795
|
+
ensureDir();
|
|
1796
|
+
import_fs.default.writeFileSync(CONFIG_FILE, JSON.stringify(config, null, 2) + "\n", {
|
|
1797
|
+
mode: 384
|
|
1798
|
+
// Owner read/write only
|
|
1799
|
+
});
|
|
1800
|
+
}
|
|
1801
|
+
function resolveApiKey() {
|
|
1802
|
+
if (process.env.SPEAK_API_KEY) return process.env.SPEAK_API_KEY;
|
|
1803
|
+
const config = loadConfig();
|
|
1804
|
+
if (config.apiKey) {
|
|
1805
|
+
process.env.SPEAK_API_KEY = config.apiKey;
|
|
1806
|
+
return config.apiKey;
|
|
1807
|
+
}
|
|
1808
|
+
return void 0;
|
|
1809
|
+
}
|
|
1810
|
+
function resolveBaseUrl() {
|
|
1811
|
+
if (process.env.SPEAK_BASE_URL) return process.env.SPEAK_BASE_URL;
|
|
1812
|
+
const config = loadConfig();
|
|
1813
|
+
if (config.baseUrl) {
|
|
1814
|
+
process.env.SPEAK_BASE_URL = config.baseUrl;
|
|
1815
|
+
return config.baseUrl;
|
|
1816
|
+
}
|
|
1817
|
+
return "https://api.speakai.co";
|
|
1818
|
+
}
|
|
1819
|
+
function getConfigPath() {
|
|
1820
|
+
return CONFIG_FILE;
|
|
1821
|
+
}
|
|
1822
|
+
var import_fs, import_path, import_os, CONFIG_DIR, CONFIG_FILE;
|
|
1823
|
+
var init_config = __esm({
|
|
1824
|
+
"src/cli/config.ts"() {
|
|
1825
|
+
"use strict";
|
|
1826
|
+
import_fs = __toESM(require("fs"));
|
|
1827
|
+
import_path = __toESM(require("path"));
|
|
1828
|
+
import_os = __toESM(require("os"));
|
|
1829
|
+
CONFIG_DIR = import_path.default.join(import_os.default.homedir(), ".speakai");
|
|
1830
|
+
CONFIG_FILE = import_path.default.join(CONFIG_DIR, "config.json");
|
|
1831
|
+
}
|
|
1832
|
+
});
|
|
1833
|
+
|
|
1834
|
+
// src/cli/format.ts
|
|
1835
|
+
function printJson(data) {
|
|
1836
|
+
console.log(JSON.stringify(data, null, 2));
|
|
1837
|
+
}
|
|
1838
|
+
function printTable(rows, columns) {
|
|
1839
|
+
if (rows.length === 0) {
|
|
1840
|
+
console.log("No results found.");
|
|
1841
|
+
return;
|
|
1842
|
+
}
|
|
1843
|
+
const widths = columns.map((col) => {
|
|
1844
|
+
const maxData = rows.reduce(
|
|
1845
|
+
(max, row) => Math.max(max, String(row[col.key] ?? "").length),
|
|
1846
|
+
0
|
|
1847
|
+
);
|
|
1848
|
+
return col.width ?? Math.max(col.label.length, Math.min(maxData, 50));
|
|
1849
|
+
});
|
|
1850
|
+
const header = columns.map((col, i) => col.label.padEnd(widths[i])).join(" ");
|
|
1851
|
+
console.log(header);
|
|
1852
|
+
console.log(widths.map((w) => "\u2500".repeat(w)).join("\u2500\u2500"));
|
|
1853
|
+
for (const row of rows) {
|
|
1854
|
+
const line = columns.map((col, i) => {
|
|
1855
|
+
const val = String(row[col.key] ?? "\u2014");
|
|
1856
|
+
return val.length > widths[i] ? val.slice(0, widths[i] - 1) + "\u2026" : val.padEnd(widths[i]);
|
|
1857
|
+
}).join(" ");
|
|
1858
|
+
console.log(line);
|
|
1859
|
+
}
|
|
1860
|
+
console.log(`
|
|
1861
|
+
${rows.length} result${rows.length === 1 ? "" : "s"}`);
|
|
1678
1862
|
}
|
|
1679
|
-
|
|
1680
|
-
|
|
1863
|
+
function printError(message) {
|
|
1864
|
+
console.error(`Error: ${message}`);
|
|
1865
|
+
}
|
|
1866
|
+
function printSuccess(message) {
|
|
1867
|
+
console.log(message);
|
|
1868
|
+
}
|
|
1869
|
+
var init_format = __esm({
|
|
1870
|
+
"src/cli/format.ts"() {
|
|
1871
|
+
"use strict";
|
|
1872
|
+
}
|
|
1873
|
+
});
|
|
1874
|
+
|
|
1875
|
+
// src/cli/index.ts
|
|
1876
|
+
var cli_exports = {};
|
|
1877
|
+
__export(cli_exports, {
|
|
1878
|
+
createCli: () => createCli
|
|
1879
|
+
});
|
|
1880
|
+
async function getClient() {
|
|
1881
|
+
const { speakClient: speakClient2 } = await Promise.resolve().then(() => (init_client(), client_exports));
|
|
1882
|
+
return speakClient2;
|
|
1883
|
+
}
|
|
1884
|
+
function requireApiKey() {
|
|
1885
|
+
const key = resolveApiKey();
|
|
1886
|
+
resolveBaseUrl();
|
|
1887
|
+
if (!key) {
|
|
1888
|
+
printError(
|
|
1889
|
+
'No API key configured. Run "speak-mcp config set-key" or set SPEAK_API_KEY.'
|
|
1890
|
+
);
|
|
1891
|
+
process.exit(1);
|
|
1892
|
+
}
|
|
1893
|
+
}
|
|
1894
|
+
function createCli() {
|
|
1895
|
+
const program = new import_commander.Command();
|
|
1896
|
+
program.name("speak-mcp").description(
|
|
1897
|
+
"Speak AI CLI & MCP Server \u2014 transcribe, analyze, and manage media from the command line"
|
|
1898
|
+
).version("1.0.0");
|
|
1899
|
+
const config = program.command("config").description("Manage configuration");
|
|
1900
|
+
config.command("set-key").description("Set your Speak AI API key").argument("[key]", "API key (omit for interactive prompt)").action(async (key) => {
|
|
1901
|
+
if (!key) {
|
|
1902
|
+
const rl = (0, import_readline.createInterface)({
|
|
1903
|
+
input: process.stdin,
|
|
1904
|
+
output: process.stdout
|
|
1905
|
+
});
|
|
1906
|
+
key = await new Promise(
|
|
1907
|
+
(resolve) => rl.question("Enter your Speak AI API key: ", (answer) => {
|
|
1908
|
+
rl.close();
|
|
1909
|
+
resolve(answer.trim());
|
|
1910
|
+
})
|
|
1911
|
+
);
|
|
1912
|
+
}
|
|
1913
|
+
if (!key) {
|
|
1914
|
+
printError("No key provided.");
|
|
1915
|
+
process.exit(1);
|
|
1916
|
+
}
|
|
1917
|
+
const cfg = loadConfig();
|
|
1918
|
+
cfg.apiKey = key;
|
|
1919
|
+
saveConfig(cfg);
|
|
1920
|
+
printSuccess(`API key saved to ${getConfigPath()}`);
|
|
1921
|
+
});
|
|
1922
|
+
config.command("show").description("Show current configuration").action(() => {
|
|
1923
|
+
const cfg = loadConfig();
|
|
1924
|
+
const envKey = process.env.SPEAK_API_KEY;
|
|
1925
|
+
console.log(`Config file: ${getConfigPath()}`);
|
|
1926
|
+
console.log(
|
|
1927
|
+
`API key: ${cfg.apiKey ? cfg.apiKey.slice(0, 8) + "..." : "(not set)"}`
|
|
1928
|
+
);
|
|
1929
|
+
console.log(
|
|
1930
|
+
`Base URL: ${cfg.baseUrl ?? "https://api.speakai.co (default)"}`
|
|
1931
|
+
);
|
|
1932
|
+
if (envKey) {
|
|
1933
|
+
console.log(
|
|
1934
|
+
`Env override: SPEAK_API_KEY=${envKey.slice(0, 8)}...`
|
|
1935
|
+
);
|
|
1936
|
+
}
|
|
1937
|
+
});
|
|
1938
|
+
config.command("set-url").description("Set custom API base URL").argument("<url>", "Base URL (e.g. https://api.speakai.co)").action((url) => {
|
|
1939
|
+
const cfg = loadConfig();
|
|
1940
|
+
cfg.baseUrl = url;
|
|
1941
|
+
saveConfig(cfg);
|
|
1942
|
+
printSuccess(`Base URL set to ${url}`);
|
|
1943
|
+
});
|
|
1944
|
+
program.command("list-media").alias("ls").description("List media files").option("-t, --type <type>", "Filter by type (audio, video, text)").option("-p, --page <n>", "Page number (0-based)", "0").option("-s, --page-size <n>", "Results per page", "20").option("--sort <field>", "Sort field", "createdAt:desc").option("-f, --folder <id>", "Filter by folder ID").option("-n, --name <filter>", "Filter by name").option("--favorites", "Show only favorites").option("--json", "Output raw JSON").action(async (opts) => {
|
|
1945
|
+
requireApiKey();
|
|
1946
|
+
const client = await getClient();
|
|
1947
|
+
try {
|
|
1948
|
+
const params = {
|
|
1949
|
+
page: parseInt(opts.page),
|
|
1950
|
+
pageSize: parseInt(opts.pageSize),
|
|
1951
|
+
sortBy: opts.sort,
|
|
1952
|
+
filterMedia: 2
|
|
1953
|
+
// 0=Uploaded, 1=Assigned, 2=Both
|
|
1954
|
+
};
|
|
1955
|
+
if (opts.type) params.mediaType = opts.type;
|
|
1956
|
+
if (opts.folder) params.folderId = opts.folder;
|
|
1957
|
+
if (opts.name) params.filterName = opts.name;
|
|
1958
|
+
if (opts.favorites) params.isFavorites = true;
|
|
1959
|
+
const res = await client.get("/v1/media", { params });
|
|
1960
|
+
const data = res.data?.data;
|
|
1961
|
+
if (opts.json) {
|
|
1962
|
+
printJson(data);
|
|
1963
|
+
return;
|
|
1964
|
+
}
|
|
1965
|
+
console.log(`Total: ${data.totalCount} | Page ${opts.page} of ${data.pages}
|
|
1681
1966
|
`);
|
|
1682
|
-
|
|
1967
|
+
printTable(data.mediaList ?? [], [
|
|
1968
|
+
{ key: "_id", label: "ID", width: 14 },
|
|
1969
|
+
{ key: "name", label: "Name", width: 40 },
|
|
1970
|
+
{ key: "mediaType", label: "Type", width: 6 },
|
|
1971
|
+
{ key: "state", label: "Status", width: 12 },
|
|
1972
|
+
{ key: "createdAt", label: "Created", width: 20 }
|
|
1973
|
+
]);
|
|
1974
|
+
} catch (err) {
|
|
1975
|
+
printError(err.response?.data?.message ?? err.message);
|
|
1976
|
+
process.exit(1);
|
|
1977
|
+
}
|
|
1978
|
+
});
|
|
1979
|
+
program.command("get-transcript").alias("transcript").description("Get transcript for a media file").argument("<mediaId>", "Media file ID").option("--json", "Output raw JSON").option("--plain", "Output plain text only (no timestamps)").action(async (mediaId, opts) => {
|
|
1980
|
+
requireApiKey();
|
|
1981
|
+
const client = await getClient();
|
|
1982
|
+
try {
|
|
1983
|
+
const res = await client.get(`/v1/media/transcript/${mediaId}`);
|
|
1984
|
+
const data = res.data?.data;
|
|
1985
|
+
if (opts.json) {
|
|
1986
|
+
printJson(data);
|
|
1987
|
+
return;
|
|
1988
|
+
}
|
|
1989
|
+
if (opts.plain) {
|
|
1990
|
+
const segments2 = data?.transcript ?? data ?? [];
|
|
1991
|
+
for (const seg of segments2) {
|
|
1992
|
+
console.log(seg.text ?? "");
|
|
1993
|
+
}
|
|
1994
|
+
return;
|
|
1995
|
+
}
|
|
1996
|
+
const segments = data?.transcript ?? data ?? [];
|
|
1997
|
+
let lastSpeaker = "";
|
|
1998
|
+
for (const seg of segments) {
|
|
1999
|
+
const speaker = seg.speakerId ?? "?";
|
|
2000
|
+
const start = seg.instances?.[0]?.start ?? "";
|
|
2001
|
+
const text = seg.text ?? "";
|
|
2002
|
+
if (speaker !== lastSpeaker) {
|
|
2003
|
+
console.log(`
|
|
2004
|
+
[Speaker ${speaker}] ${start}`);
|
|
2005
|
+
lastSpeaker = speaker;
|
|
2006
|
+
}
|
|
2007
|
+
process.stdout.write(text + " ");
|
|
2008
|
+
}
|
|
2009
|
+
console.log();
|
|
2010
|
+
} catch (err) {
|
|
2011
|
+
printError(err.response?.data?.message ?? err.message);
|
|
2012
|
+
process.exit(1);
|
|
2013
|
+
}
|
|
2014
|
+
});
|
|
2015
|
+
program.command("get-insights").alias("insights").description("Get AI-generated insights for a media file").argument("<mediaId>", "Media file ID").option("--json", "Output raw JSON").action(async (mediaId, opts) => {
|
|
2016
|
+
requireApiKey();
|
|
2017
|
+
const client = await getClient();
|
|
2018
|
+
try {
|
|
2019
|
+
const res = await client.get(`/v1/media/insight/${mediaId}`);
|
|
2020
|
+
const data = res.data?.data;
|
|
2021
|
+
if (opts.json) {
|
|
2022
|
+
printJson(data);
|
|
2023
|
+
return;
|
|
2024
|
+
}
|
|
2025
|
+
if (data?.summary) {
|
|
2026
|
+
console.log("\u2500\u2500 Summary \u2500\u2500");
|
|
2027
|
+
console.log(data.summary + "\n");
|
|
2028
|
+
}
|
|
2029
|
+
const categories = [
|
|
2030
|
+
"keywords",
|
|
2031
|
+
"topics",
|
|
2032
|
+
"people",
|
|
2033
|
+
"locations",
|
|
2034
|
+
"brands",
|
|
2035
|
+
"sentiment"
|
|
2036
|
+
];
|
|
2037
|
+
for (const cat of categories) {
|
|
2038
|
+
const items = data?.[cat];
|
|
2039
|
+
if (items && Array.isArray(items) && items.length > 0) {
|
|
2040
|
+
console.log(`\u2500\u2500 ${cat.charAt(0).toUpperCase() + cat.slice(1)} \u2500\u2500`);
|
|
2041
|
+
for (const item of items.slice(0, 20)) {
|
|
2042
|
+
const name = typeof item === "string" ? item : item.name ?? item.text ?? JSON.stringify(item);
|
|
2043
|
+
console.log(` ${name}`);
|
|
2044
|
+
}
|
|
2045
|
+
if (items.length > 20) console.log(` ... and ${items.length - 20} more`);
|
|
2046
|
+
console.log();
|
|
2047
|
+
}
|
|
2048
|
+
}
|
|
2049
|
+
if (data?.sentiment && !Array.isArray(data.sentiment)) {
|
|
2050
|
+
console.log("\u2500\u2500 Sentiment \u2500\u2500");
|
|
2051
|
+
printJson(data.sentiment);
|
|
2052
|
+
console.log();
|
|
2053
|
+
}
|
|
2054
|
+
} catch (err) {
|
|
2055
|
+
printError(err.response?.data?.message ?? err.message);
|
|
2056
|
+
process.exit(1);
|
|
2057
|
+
}
|
|
2058
|
+
});
|
|
2059
|
+
program.command("upload").description("Upload media from a URL").argument("<url>", "Publicly accessible media URL").option("-n, --name <name>", "Display name").option("-t, --type <type>", "Media type (audio or video)", "audio").option("-l, --language <lang>", "Source language (BCP-47)", "en-US").option("-f, --folder <id>", "Destination folder ID").option("--tags <tags>", "Comma-separated tags").option("--wait", "Wait for processing to complete").option("--json", "Output raw JSON").action(async (url, opts) => {
|
|
2060
|
+
requireApiKey();
|
|
2061
|
+
const client = await getClient();
|
|
2062
|
+
try {
|
|
2063
|
+
const body = {
|
|
2064
|
+
name: opts.name ?? url.split("/").pop()?.split("?")[0] ?? "Upload",
|
|
2065
|
+
url,
|
|
2066
|
+
mediaType: opts.type,
|
|
2067
|
+
sourceLanguage: opts.language
|
|
2068
|
+
};
|
|
2069
|
+
if (opts.folder) body.folderId = opts.folder;
|
|
2070
|
+
if (opts.tags) body.tags = opts.tags;
|
|
2071
|
+
const res = await client.post("/v1/media/upload", body);
|
|
2072
|
+
const data = res.data?.data;
|
|
2073
|
+
if (opts.json && !opts.wait) {
|
|
2074
|
+
printJson(data);
|
|
2075
|
+
return;
|
|
2076
|
+
}
|
|
2077
|
+
const mediaId = data?.mediaId;
|
|
2078
|
+
printSuccess(`Uploaded: ${mediaId} (state: ${data?.state})`);
|
|
2079
|
+
if (opts.wait && mediaId) {
|
|
2080
|
+
process.stdout.write("Processing");
|
|
2081
|
+
let status = data?.state;
|
|
2082
|
+
while (status !== "processed" && status !== "failed") {
|
|
2083
|
+
await new Promise((r) => setTimeout(r, 5e3));
|
|
2084
|
+
process.stdout.write(".");
|
|
2085
|
+
const statusRes = await client.get(`/v1/media/status/${mediaId}`);
|
|
2086
|
+
status = statusRes.data?.data?.state;
|
|
2087
|
+
}
|
|
2088
|
+
console.log();
|
|
2089
|
+
if (status === "processed") {
|
|
2090
|
+
printSuccess(`Done! Media ${mediaId} is ready.`);
|
|
2091
|
+
} else {
|
|
2092
|
+
printError(`Processing failed for ${mediaId}`);
|
|
2093
|
+
process.exit(1);
|
|
2094
|
+
}
|
|
2095
|
+
}
|
|
2096
|
+
} catch (err) {
|
|
2097
|
+
printError(err.response?.data?.message ?? err.message);
|
|
2098
|
+
process.exit(1);
|
|
2099
|
+
}
|
|
2100
|
+
});
|
|
2101
|
+
program.command("export").description("Export media transcript/insights").argument("<mediaId>", "Media file ID").option(
|
|
2102
|
+
"-f, --format <type>",
|
|
2103
|
+
"Export format (pdf, docx, srt, vtt, txt, csv, md)",
|
|
2104
|
+
"txt"
|
|
2105
|
+
).option("--speakers", "Include speaker names").option("--timestamps", "Include timestamps").option("--redacted", "Apply PII redaction").option("--json", "Output raw JSON").action(async (mediaId, opts) => {
|
|
2106
|
+
requireApiKey();
|
|
2107
|
+
const client = await getClient();
|
|
2108
|
+
try {
|
|
2109
|
+
const params = {};
|
|
2110
|
+
if (opts.speakers) params.isSpeakerNames = true;
|
|
2111
|
+
if (opts.timestamps) params.isTimeStamps = true;
|
|
2112
|
+
if (opts.redacted) params.isRedacted = true;
|
|
2113
|
+
const res = await client.post(
|
|
2114
|
+
`/v1/media/export/${mediaId}/${opts.format}`,
|
|
2115
|
+
null,
|
|
2116
|
+
{ params }
|
|
2117
|
+
);
|
|
2118
|
+
if (opts.json) {
|
|
2119
|
+
printJson(res.data);
|
|
2120
|
+
} else {
|
|
2121
|
+
printJson(res.data?.data ?? res.data);
|
|
2122
|
+
}
|
|
2123
|
+
} catch (err) {
|
|
2124
|
+
printError(err.response?.data?.message ?? err.message);
|
|
2125
|
+
process.exit(1);
|
|
2126
|
+
}
|
|
2127
|
+
});
|
|
2128
|
+
program.command("status").description("Check processing status of a media file").argument("<mediaId>", "Media file ID").option("--json", "Output raw JSON").action(async (mediaId, opts) => {
|
|
2129
|
+
requireApiKey();
|
|
2130
|
+
const client = await getClient();
|
|
2131
|
+
try {
|
|
2132
|
+
const res = await client.get(`/v1/media/status/${mediaId}`);
|
|
2133
|
+
const data = res.data?.data;
|
|
2134
|
+
if (opts.json) {
|
|
2135
|
+
printJson(data);
|
|
2136
|
+
return;
|
|
2137
|
+
}
|
|
2138
|
+
console.log(`Name: ${data?.name ?? "\u2014"}`);
|
|
2139
|
+
console.log(`Status: ${data?.state ?? "\u2014"}`);
|
|
2140
|
+
console.log(`Type: ${data?.mediaType ?? "\u2014"}`);
|
|
2141
|
+
const dur = data?.duration;
|
|
2142
|
+
const durStr = dur?.inSecond ? `${Math.round(dur.inSecond)}s` : typeof dur === "number" ? `${Math.round(dur)}s` : "\u2014";
|
|
2143
|
+
console.log(`Duration: ${durStr}`);
|
|
2144
|
+
console.log(`Created: ${data?.createdAt ?? "\u2014"}`);
|
|
2145
|
+
} catch (err) {
|
|
2146
|
+
printError(err.response?.data?.message ?? err.message);
|
|
2147
|
+
process.exit(1);
|
|
2148
|
+
}
|
|
2149
|
+
});
|
|
2150
|
+
program.command("create-text").description("Create a text note for AI analysis").argument("<name>", "Note title").option("-t, --text <text>", "Text content (or pipe via stdin)").option("-f, --folder <id>", "Folder ID").option("--tags <tags>", "Comma-separated tags").option("--json", "Output raw JSON").action(async (name, opts) => {
|
|
2151
|
+
requireApiKey();
|
|
2152
|
+
const client = await getClient();
|
|
2153
|
+
try {
|
|
2154
|
+
let text = opts.text;
|
|
2155
|
+
if (!text && !process.stdin.isTTY) {
|
|
2156
|
+
const chunks = [];
|
|
2157
|
+
for await (const chunk of process.stdin) {
|
|
2158
|
+
chunks.push(chunk);
|
|
2159
|
+
}
|
|
2160
|
+
text = Buffer.concat(chunks).toString("utf-8").trim();
|
|
2161
|
+
}
|
|
2162
|
+
if (!text) {
|
|
2163
|
+
printError("Provide text via --text or pipe via stdin");
|
|
2164
|
+
process.exit(1);
|
|
2165
|
+
}
|
|
2166
|
+
const body = { name, text, rawText: text };
|
|
2167
|
+
if (opts.folder) body.folderId = opts.folder;
|
|
2168
|
+
if (opts.tags) body.tags = opts.tags;
|
|
2169
|
+
const res = await client.post("/v1/text/create", body);
|
|
2170
|
+
const data = res.data?.data;
|
|
2171
|
+
if (opts.json) {
|
|
2172
|
+
printJson(data);
|
|
2173
|
+
} else {
|
|
2174
|
+
printSuccess(`Created text note: ${data?.mediaId ?? data?._id}`);
|
|
2175
|
+
}
|
|
2176
|
+
} catch (err) {
|
|
2177
|
+
printError(err.response?.data?.message ?? err.message);
|
|
2178
|
+
process.exit(1);
|
|
2179
|
+
}
|
|
2180
|
+
});
|
|
2181
|
+
program.command("list-folders").alias("folders").description("List all folders").option("--json", "Output raw JSON").action(async (opts) => {
|
|
2182
|
+
requireApiKey();
|
|
2183
|
+
const client = await getClient();
|
|
2184
|
+
try {
|
|
2185
|
+
const res = await client.get("/v1/folder", {
|
|
2186
|
+
params: { page: 0, pageSize: 100, sortBy: "createdAt:desc" }
|
|
2187
|
+
});
|
|
2188
|
+
const data = res.data?.data;
|
|
2189
|
+
if (opts.json) {
|
|
2190
|
+
printJson(data);
|
|
2191
|
+
return;
|
|
2192
|
+
}
|
|
2193
|
+
const folders = Array.isArray(data) ? data : data?.folderList ?? data?.folders ?? [];
|
|
2194
|
+
printTable(folders, [
|
|
2195
|
+
{ key: "_id", label: "ID", width: 14 },
|
|
2196
|
+
{ key: "name", label: "Name", width: 40 },
|
|
2197
|
+
{ key: "createdAt", label: "Created", width: 20 }
|
|
2198
|
+
]);
|
|
2199
|
+
} catch (err) {
|
|
2200
|
+
printError(err.response?.data?.message ?? err.message);
|
|
2201
|
+
process.exit(1);
|
|
2202
|
+
}
|
|
2203
|
+
});
|
|
2204
|
+
program.command("ask").description("Ask an AI question about a media file").argument("<mediaId>", "Media file ID").argument("<prompt>", "Your question").option("--assistant <type>", "Assistant type (general, researcher, marketer, sales, recruiter)", "general").option("--json", "Output raw JSON").action(async (mediaId, prompt, opts) => {
|
|
2205
|
+
requireApiKey();
|
|
2206
|
+
const client = await getClient();
|
|
2207
|
+
try {
|
|
2208
|
+
const res = await client.post("/v1/prompt", {
|
|
2209
|
+
mediaIds: [mediaId],
|
|
2210
|
+
prompt,
|
|
2211
|
+
assistantType: opts.assistant
|
|
2212
|
+
});
|
|
2213
|
+
const data = res.data?.data;
|
|
2214
|
+
if (opts.json) {
|
|
2215
|
+
printJson(data);
|
|
2216
|
+
} else {
|
|
2217
|
+
console.log(data?.answer ?? data?.message ?? JSON.stringify(data, null, 2));
|
|
2218
|
+
}
|
|
2219
|
+
} catch (err) {
|
|
2220
|
+
printError(err.response?.data?.message ?? err.message);
|
|
2221
|
+
process.exit(1);
|
|
2222
|
+
}
|
|
2223
|
+
});
|
|
2224
|
+
program.command("schedule-meeting").description("Schedule AI assistant to join a meeting").argument("<url>", "Meeting URL (Zoom, Meet, Teams)").option("-t, --title <title>", "Meeting title").option("-d, --date <datetime>", "Meeting date/time (ISO 8601, omit to join now)").option("-l, --language <lang>", "Meeting language", "en-US").option("--json", "Output raw JSON").action(async (url, opts) => {
|
|
2225
|
+
requireApiKey();
|
|
2226
|
+
const client = await getClient();
|
|
2227
|
+
try {
|
|
2228
|
+
const body = {
|
|
2229
|
+
meetingURL: url,
|
|
2230
|
+
title: opts.title ?? "Meeting",
|
|
2231
|
+
meetingLanguage: opts.language
|
|
2232
|
+
};
|
|
2233
|
+
if (opts.date) body.meetingDate = opts.date;
|
|
2234
|
+
const res = await client.post(
|
|
2235
|
+
"/v1/meeting-assistant/events/schedule",
|
|
2236
|
+
body
|
|
2237
|
+
);
|
|
2238
|
+
const data = res.data?.data;
|
|
2239
|
+
if (opts.json) {
|
|
2240
|
+
printJson(data);
|
|
2241
|
+
} else {
|
|
2242
|
+
printSuccess(`Meeting scheduled: ${data?._id ?? "OK"}`);
|
|
2243
|
+
if (!opts.date) console.log("Assistant will join immediately.");
|
|
2244
|
+
}
|
|
2245
|
+
} catch (err) {
|
|
2246
|
+
printError(err.response?.data?.message ?? err.message);
|
|
2247
|
+
process.exit(1);
|
|
2248
|
+
}
|
|
2249
|
+
});
|
|
2250
|
+
return program;
|
|
2251
|
+
}
|
|
2252
|
+
var import_commander, import_readline;
|
|
2253
|
+
var init_cli = __esm({
|
|
2254
|
+
"src/cli/index.ts"() {
|
|
2255
|
+
"use strict";
|
|
2256
|
+
import_commander = require("commander");
|
|
2257
|
+
import_readline = require("readline");
|
|
2258
|
+
init_config();
|
|
2259
|
+
init_format();
|
|
2260
|
+
}
|
|
2261
|
+
});
|
|
2262
|
+
|
|
2263
|
+
// src/index.ts
|
|
2264
|
+
var index_exports = {};
|
|
2265
|
+
__export(index_exports, {
|
|
2266
|
+
createSpeakClient: () => createSpeakClient,
|
|
2267
|
+
formatAxiosError: () => formatAxiosError,
|
|
2268
|
+
registerAllTools: () => registerAllTools
|
|
1683
2269
|
});
|
|
2270
|
+
module.exports = __toCommonJS(index_exports);
|
|
2271
|
+
init_tools();
|
|
2272
|
+
init_client();
|
|
2273
|
+
var args = process.argv.slice(2);
|
|
2274
|
+
var cliCommands = [
|
|
2275
|
+
"config",
|
|
2276
|
+
"list-media",
|
|
2277
|
+
"ls",
|
|
2278
|
+
"get-transcript",
|
|
2279
|
+
"transcript",
|
|
2280
|
+
"get-insights",
|
|
2281
|
+
"insights",
|
|
2282
|
+
"upload",
|
|
2283
|
+
"export",
|
|
2284
|
+
"status",
|
|
2285
|
+
"create-text",
|
|
2286
|
+
"list-folders",
|
|
2287
|
+
"folders",
|
|
2288
|
+
"ask",
|
|
2289
|
+
"schedule-meeting",
|
|
2290
|
+
"help"
|
|
2291
|
+
];
|
|
2292
|
+
var isCliMode = args.length > 0 && (args[0].startsWith("-") || cliCommands.includes(args[0]));
|
|
2293
|
+
if (isCliMode) {
|
|
2294
|
+
Promise.resolve().then(() => (init_config(), config_exports)).then(({ resolveApiKey: resolveApiKey2, resolveBaseUrl: resolveBaseUrl2 }) => {
|
|
2295
|
+
resolveApiKey2();
|
|
2296
|
+
resolveBaseUrl2();
|
|
2297
|
+
Promise.resolve().then(() => (init_cli(), cli_exports)).then(({ createCli: createCli2 }) => {
|
|
2298
|
+
const program = createCli2();
|
|
2299
|
+
program.parseAsync(process.argv).catch((err) => {
|
|
2300
|
+
console.error(`Error: ${err.message}`);
|
|
2301
|
+
process.exit(1);
|
|
2302
|
+
});
|
|
2303
|
+
});
|
|
2304
|
+
});
|
|
2305
|
+
} else {
|
|
2306
|
+
import("@modelcontextprotocol/sdk/server/mcp.js").then(({ McpServer }) => {
|
|
2307
|
+
import("@modelcontextprotocol/sdk/server/stdio.js").then(
|
|
2308
|
+
({ StdioServerTransport }) => {
|
|
2309
|
+
Promise.resolve().then(() => (init_tools(), tools_exports)).then(({ registerAllTools: registerAllTools2 }) => {
|
|
2310
|
+
const server = new McpServer({
|
|
2311
|
+
name: "speak-ai",
|
|
2312
|
+
version: "1.0.0"
|
|
2313
|
+
});
|
|
2314
|
+
registerAllTools2(server);
|
|
2315
|
+
const transport = new StdioServerTransport();
|
|
2316
|
+
server.connect(transport).then(() => {
|
|
2317
|
+
process.stderr.write(
|
|
2318
|
+
"[speak-mcp] Server started on stdio transport\n"
|
|
2319
|
+
);
|
|
2320
|
+
});
|
|
2321
|
+
});
|
|
2322
|
+
}
|
|
2323
|
+
);
|
|
2324
|
+
});
|
|
2325
|
+
}
|
|
1684
2326
|
// Annotate the CommonJS export names for ESM import in node:
|
|
1685
2327
|
0 && (module.exports = {
|
|
1686
2328
|
createSpeakClient,
|