@hasna/recordings 0.1.23 → 0.1.24

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.
Files changed (47) hide show
  1. package/LICENSE +191 -170
  2. package/README.md +16 -7
  3. package/dist/cli/index.js +114 -64
  4. package/dist/cli/storage.d.ts +3 -0
  5. package/dist/cli/storage.d.ts.map +1 -0
  6. package/dist/db/pg-migrations.d.ts +1 -1
  7. package/dist/db/storage-config.d.ts +27 -0
  8. package/dist/db/storage-config.d.ts.map +1 -0
  9. package/dist/db/storage-sync.d.ts +36 -0
  10. package/dist/db/storage-sync.d.ts.map +1 -0
  11. package/dist/index.d.ts +2 -2
  12. package/dist/index.d.ts.map +1 -1
  13. package/dist/index.js +110 -50
  14. package/dist/lib/enhancer.d.ts.map +1 -1
  15. package/dist/lib/transcriber.d.ts +1 -0
  16. package/dist/lib/transcriber.d.ts.map +1 -1
  17. package/dist/mcp/http.d.ts +13 -0
  18. package/dist/mcp/http.d.ts.map +1 -0
  19. package/dist/mcp/index.d.ts +2 -1
  20. package/dist/mcp/index.d.ts.map +1 -1
  21. package/dist/mcp/index.js +519 -408
  22. package/dist/mcp/storage-tools.d.ts +3 -0
  23. package/dist/mcp/storage-tools.d.ts.map +1 -0
  24. package/dist/storage.d.ts +7 -0
  25. package/dist/storage.d.ts.map +1 -0
  26. package/dist/storage.js +5656 -0
  27. package/dist/version.d.ts +1 -1
  28. package/package.json +8 -3
  29. package/scripts/install_macos_app.sh +17 -0
  30. package/src/native/Recordings/App/RecordingsApp.swift +3 -2
  31. package/src/native/Recordings/RecordingsLib/MenuBarPopover.swift +101 -80
  32. package/src/native/Recordings/RecordingsLib/OpenAIAPIKeyStore.swift +26 -0
  33. package/src/native/Recordings/RecordingsLib/RealtimeTranscriptionClient.swift +13 -1
  34. package/src/native/Recordings/RecordingsLib/RecordingEngine.swift +92 -31
  35. package/src/native/Recordings/RecordingsLib/SettingsView.swift +5 -1
  36. package/src/native/Recordings/RecordingsTests/CLIRunnerTests.swift +12 -0
  37. package/src/native/Recordings/RecordingsTests/OpenAIAPIKeyStoreTests.swift +49 -0
  38. package/src/native/Recordings/RecordingsTests/PasteTargetTests.swift +54 -0
  39. package/src/native/Recordings/RecordingsTests/TranscriptResolutionTests.swift +58 -0
  40. package/dist/cli/cloud.d.ts +0 -3
  41. package/dist/cli/cloud.d.ts.map +0 -1
  42. package/dist/db/cloud-config.d.ts +0 -14
  43. package/dist/db/cloud-config.d.ts.map +0 -1
  44. package/dist/db/cloud-sync.d.ts +0 -29
  45. package/dist/db/cloud-sync.d.ts.map +0 -1
  46. package/dist/mcp/cloud-tools.d.ts +0 -3
  47. package/dist/mcp/cloud-tools.d.ts.map +0 -1
package/dist/index.js CHANGED
@@ -5355,59 +5355,86 @@ class PgAdapterAsync {
5355
5355
  await this.pool.end();
5356
5356
  }
5357
5357
  }
5358
- // src/db/cloud-config.ts
5358
+ // src/db/storage-config.ts
5359
5359
  import { existsSync as existsSync2, readFileSync as readFileSync2 } from "fs";
5360
5360
  import { homedir as homedir2 } from "os";
5361
5361
  import { join as join2 } from "path";
5362
- var CONFIG_PATH = join2(homedir2(), ".hasna", "recordings", "cloud", "config.json");
5363
- function isMode(value) {
5364
- return value === "local" || value === "hybrid" || value === "cloud";
5362
+ var STORAGE_CONFIG_PATH = join2(homedir2(), ".hasna", "recordings", "storage", "config.json");
5363
+ var RECORDINGS_STORAGE_ENV = "HASNA_RECORDINGS_DATABASE_URL";
5364
+ var RECORDINGS_STORAGE_FALLBACK_ENV = "RECORDINGS_DATABASE_URL";
5365
+ var RECORDINGS_STORAGE_MODE_ENV = "HASNA_RECORDINGS_STORAGE_MODE";
5366
+ var RECORDINGS_STORAGE_MODE_FALLBACK_ENV = "RECORDINGS_STORAGE_MODE";
5367
+ var STORAGE_DATABASE_ENV = [RECORDINGS_STORAGE_ENV, RECORDINGS_STORAGE_FALLBACK_ENV];
5368
+ var STORAGE_MODE_ENV = [RECORDINGS_STORAGE_MODE_ENV, RECORDINGS_STORAGE_MODE_FALLBACK_ENV];
5369
+ function readEnv(name) {
5370
+ const value = process.env[name]?.trim();
5371
+ return value || undefined;
5365
5372
  }
5366
- function envConnectionString() {
5367
- return process.env["HASNA_RECORDINGS_CLOUD_DATABASE_URL"] ?? process.env["OPEN_RECORDINGS_CLOUD_DATABASE_URL"] ?? process.env["RECORDINGS_CLOUD_DATABASE_URL"];
5373
+ function normalizeMode(value) {
5374
+ const normalized = value?.trim().toLowerCase();
5375
+ if (normalized === "local" || normalized === "hybrid" || normalized === "remote")
5376
+ return normalized;
5377
+ return;
5368
5378
  }
5369
- function getCloudConfig() {
5379
+ function getStorageDatabaseEnvName() {
5380
+ for (const name of STORAGE_DATABASE_ENV) {
5381
+ if (readEnv(name))
5382
+ return name;
5383
+ }
5384
+ return null;
5385
+ }
5386
+ function getStorageDatabaseEnv() {
5387
+ const name = getStorageDatabaseEnvName();
5388
+ return name ? { name } : null;
5389
+ }
5390
+ function getStorageDatabaseUrl() {
5391
+ const env = getStorageDatabaseEnv();
5392
+ return env ? readEnv(env.name) : undefined;
5393
+ }
5394
+ function getStorageConfig() {
5370
5395
  const config = {
5371
5396
  mode: "local",
5372
5397
  rds: {
5373
5398
  host: "",
5374
5399
  port: 5432,
5375
5400
  username: "",
5376
- password_env: "RECORDINGS_CLOUD_DATABASE_PASSWORD",
5401
+ password_env: "RECORDINGS_DATABASE_PASSWORD",
5377
5402
  ssl: true
5378
5403
  }
5379
5404
  };
5380
- if (existsSync2(CONFIG_PATH)) {
5405
+ if (existsSync2(STORAGE_CONFIG_PATH)) {
5381
5406
  try {
5382
- const raw = JSON.parse(readFileSync2(CONFIG_PATH, "utf-8"));
5383
- config.mode = raw.mode ?? config.mode;
5407
+ const raw = JSON.parse(readFileSync2(STORAGE_CONFIG_PATH, "utf-8"));
5408
+ config.mode = normalizeMode(raw.mode) ?? config.mode;
5384
5409
  config.rds = { ...config.rds, ...raw.rds ?? {} };
5385
5410
  } catch {}
5386
5411
  }
5387
- const modeOverride = process.env["HASNA_RECORDINGS_CLOUD_MODE"] ?? process.env["OPEN_RECORDINGS_CLOUD_MODE"] ?? process.env["RECORDINGS_CLOUD_MODE"];
5388
- if (isMode(modeOverride)) {
5389
- config.mode = modeOverride;
5390
- } else if (envConnectionString() && config.mode === "local") {
5412
+ const modeOverride = readEnv(RECORDINGS_STORAGE_MODE_ENV) ?? readEnv(RECORDINGS_STORAGE_MODE_FALLBACK_ENV);
5413
+ const normalizedMode = normalizeMode(modeOverride);
5414
+ if (normalizedMode) {
5415
+ config.mode = normalizedMode;
5416
+ } else if (getStorageDatabaseUrl() && config.mode === "local") {
5391
5417
  config.mode = "hybrid";
5392
5418
  }
5393
5419
  return config;
5394
5420
  }
5395
- function getConnectionString(dbName = "recordings") {
5396
- const direct = envConnectionString();
5421
+ function getStorageConnectionString(dbName = "recordings") {
5422
+ const direct = getStorageDatabaseUrl();
5397
5423
  if (direct)
5398
5424
  return direct;
5399
- const config = getCloudConfig();
5425
+ const config = getStorageConfig();
5400
5426
  const { host, port, username, password_env, ssl } = config.rds;
5401
5427
  if (!host || !username) {
5402
- throw new Error("Cloud database is not configured. Set HASNA_RECORDINGS_CLOUD_DATABASE_URL or configure ~/.hasna/recordings/cloud/config.json.");
5428
+ throw new Error("Storage database is not configured. Set HASNA_RECORDINGS_DATABASE_URL or configure ~/.hasna/recordings/storage/config.json.");
5403
5429
  }
5404
5430
  const password = process.env[password_env];
5405
5431
  if (!password) {
5406
- throw new Error(`Cloud database password is not set. Export ${password_env}.`);
5432
+ throw new Error(`Storage database password is not set. Export ${password_env}.`);
5407
5433
  }
5408
5434
  const sslParam = ssl ? "?sslmode=require" : "";
5409
5435
  return `postgres://${username}:${encodeURIComponent(password)}@${host}:${port}/${dbName}${sslParam}`;
5410
5436
  }
5437
+ var getConnectionString = getStorageConnectionString;
5411
5438
  // src/db/pg-migrations.ts
5412
5439
  var PG_MIGRATIONS = [
5413
5440
  `CREATE TABLE IF NOT EXISTS projects (
@@ -5476,14 +5503,15 @@ var PG_MIGRATIONS = [
5476
5503
  `ALTER TABLE agents ADD COLUMN IF NOT EXISTS active_project_id TEXT REFERENCES projects(id) ON DELETE SET NULL`
5477
5504
  ];
5478
5505
 
5479
- // src/db/cloud-sync.ts
5480
- var CLOUD_TABLES = [
5506
+ // src/db/storage-sync.ts
5507
+ var STORAGE_TABLES = [
5481
5508
  "projects",
5482
5509
  "agents",
5483
5510
  "recordings",
5484
5511
  "recording_tags",
5485
5512
  "feedback"
5486
5513
  ];
5514
+ var RECORDINGS_STORAGE_TABLES = STORAGE_TABLES;
5487
5515
  var TABLE_KEYS = {
5488
5516
  projects: ["id"],
5489
5517
  agents: ["id"],
@@ -5536,21 +5564,26 @@ function upsertSqlite(db, table, rows) {
5536
5564
  }
5537
5565
  return written;
5538
5566
  }
5539
- async function getCloudPg() {
5540
- return new PgAdapterAsync(getConnectionString("recordings"));
5567
+ async function getStoragePg() {
5568
+ return new PgAdapterAsync(getStorageConnectionString("recordings"));
5541
5569
  }
5542
- async function runCloudMigrations(remote) {
5570
+ async function runStorageMigrations(remote) {
5543
5571
  for (const migration of PG_MIGRATIONS) {
5544
5572
  await remote.exec(migration);
5545
5573
  }
5546
5574
  }
5547
- function getCloudStatus(db = getDatabase()) {
5548
- const config = getCloudConfig();
5575
+ function getStorageStatus(db = getDatabase()) {
5576
+ const config = getStorageConfig();
5577
+ const activeEnv = getStorageDatabaseEnv();
5549
5578
  return {
5579
+ configured: Boolean(activeEnv),
5550
5580
  mode: config.mode,
5551
- enabled: config.mode === "hybrid" || config.mode === "cloud",
5581
+ enabled: config.mode === "hybrid" || config.mode === "remote",
5582
+ env: STORAGE_DATABASE_ENV,
5583
+ activeEnv: activeEnv?.name ?? null,
5584
+ service: "recordings",
5552
5585
  db_path: getDbPath(),
5553
- tables: CLOUD_TABLES.map((table) => {
5586
+ tables: STORAGE_TABLES.map((table) => {
5554
5587
  try {
5555
5588
  const row = db.query(`SELECT COUNT(*) as count FROM ${quoteId(table)}`).get();
5556
5589
  return { table, rows: row.count };
@@ -5560,12 +5593,12 @@ function getCloudStatus(db = getDatabase()) {
5560
5593
  })
5561
5594
  };
5562
5595
  }
5563
- async function pushCloudChanges(tables = [...CLOUD_TABLES]) {
5596
+ async function pushStorageChanges(tables = [...STORAGE_TABLES]) {
5564
5597
  const db = getDatabase();
5565
- const remote = await getCloudPg();
5598
+ const remote = await getStoragePg();
5566
5599
  const results = [];
5567
5600
  try {
5568
- await runCloudMigrations(remote);
5601
+ await runStorageMigrations(remote);
5569
5602
  for (const table of tables) {
5570
5603
  const result = { table, direction: "push", rows_read: 0, rows_written: 0, errors: [] };
5571
5604
  try {
@@ -5582,12 +5615,12 @@ async function pushCloudChanges(tables = [...CLOUD_TABLES]) {
5582
5615
  }
5583
5616
  return results;
5584
5617
  }
5585
- async function pullCloudChanges(tables = [...CLOUD_TABLES]) {
5618
+ async function pullStorageChanges(tables = [...STORAGE_TABLES]) {
5586
5619
  const db = getDatabase();
5587
- const remote = await getCloudPg();
5620
+ const remote = await getStoragePg();
5588
5621
  const results = [];
5589
5622
  try {
5590
- await runCloudMigrations(remote);
5623
+ await runStorageMigrations(remote);
5591
5624
  for (const table of tables) {
5592
5625
  const result = { table, direction: "pull", rows_read: 0, rows_written: 0, errors: [] };
5593
5626
  try {
@@ -5604,17 +5637,23 @@ async function pullCloudChanges(tables = [...CLOUD_TABLES]) {
5604
5637
  }
5605
5638
  return results;
5606
5639
  }
5607
- async function syncCloudChanges(tables = [...CLOUD_TABLES]) {
5640
+ async function syncStorageChanges(tables = [...STORAGE_TABLES]) {
5608
5641
  return {
5609
- push: await pushCloudChanges(tables),
5610
- pull: await pullCloudChanges(tables)
5642
+ push: await pushStorageChanges(tables),
5643
+ pull: await pullStorageChanges(tables)
5611
5644
  };
5612
5645
  }
5613
- function parseCloudTables(raw) {
5646
+ function parseStorageTables(raw) {
5614
5647
  if (!raw)
5615
- return [...CLOUD_TABLES];
5648
+ return [...STORAGE_TABLES];
5616
5649
  const requested = raw.split(",").map((table) => table.trim()).filter(Boolean);
5617
- return requested.length > 0 ? requested : [...CLOUD_TABLES];
5650
+ if (requested.length === 0)
5651
+ return [...STORAGE_TABLES];
5652
+ const allowed = new Set(STORAGE_TABLES);
5653
+ const invalid = requested.filter((table) => !allowed.has(table));
5654
+ if (invalid.length > 0)
5655
+ throw new Error(`Unknown recordings sync table(s): ${invalid.join(", ")}`);
5656
+ return requested;
5618
5657
  }
5619
5658
  // src/db/pg-migrate.ts
5620
5659
  async function applyPgMigrations(connectionString) {
@@ -5889,7 +5928,7 @@ async function transcribeAudio(audioPath, config, options = {}) {
5889
5928
  };
5890
5929
  } catch (error) {
5891
5930
  const msg = error instanceof Error ? error.message : String(error);
5892
- throw new TranscriptionError(`Transcription failed: ${msg}`);
5931
+ throw new TranscriptionError(`Transcription failed: ${describeTranscriptionFailure(msg)}`);
5893
5932
  }
5894
5933
  }
5895
5934
  async function transcribeBuffer(buffer, filename, config, options = {}) {
@@ -5915,8 +5954,17 @@ async function transcribeBuffer(buffer, filename, config, options = {}) {
5915
5954
  };
5916
5955
  } catch (error) {
5917
5956
  const msg = error instanceof Error ? error.message : String(error);
5918
- throw new TranscriptionError(`Transcription failed: ${msg}`);
5957
+ throw new TranscriptionError(`Transcription failed: ${describeTranscriptionFailure(msg)}`);
5958
+ }
5959
+ }
5960
+ function describeTranscriptionFailure(message) {
5961
+ if (/401|incorrect api key|invalid_api_key/i.test(message)) {
5962
+ return "OpenAI API key invalid or expired (401). Update it in ~/.hasna/recordings/config.json, the OPENAI_API_KEY env var, or the Recordings app Settings.";
5963
+ }
5964
+ if (/429|exceeded your current quota|insufficient_quota/i.test(message)) {
5965
+ return "OpenAI quota exceeded (429). Check the OpenAI account plan and billing.";
5919
5966
  }
5967
+ return message;
5920
5968
  }
5921
5969
  function buildVerbatimPrompt(context) {
5922
5970
  const base = "Transcribe the speaker's words verbatim. Output only words that were spoken. Do not summarize, paraphrase, rewrite, clean up grammar, add explanations, or infer missing words. Preserve names, acronyms, technical terms, punctuation, and casing when audible.";
@@ -6057,7 +6105,7 @@ ${systemPrompt}` : basePrompt;
6057
6105
  };
6058
6106
  } catch (error) {
6059
6107
  const msg = error instanceof Error ? error.message : String(error);
6060
- throw new EnhancementError(`Enhancement failed: ${msg}`);
6108
+ throw new EnhancementError(`Enhancement failed: ${describeTranscriptionFailure(msg)}`);
6061
6109
  }
6062
6110
  }
6063
6111
  async function processText(rawText, config, systemPrompt) {
@@ -6217,7 +6265,7 @@ async function recordDuration(seconds, config) {
6217
6265
  export {
6218
6266
  transcribeBuffer,
6219
6267
  transcribeAudio,
6220
- syncCloudChanges,
6268
+ syncStorageChanges,
6221
6269
  stopRecording,
6222
6270
  startRecording,
6223
6271
  shortUuid,
@@ -6228,16 +6276,22 @@ export {
6228
6276
  registerProject,
6229
6277
  registerAgent,
6230
6278
  recordDuration,
6231
- pushCloudChanges,
6232
- pullCloudChanges,
6279
+ pushStorageChanges,
6280
+ pullStorageChanges,
6233
6281
  processText,
6234
- parseCloudTables,
6282
+ parseStorageTables,
6235
6283
  needsEnhancement,
6236
6284
  loadConfig,
6237
6285
  listRecordings,
6238
6286
  listProjects,
6239
6287
  listAgents,
6240
6288
  isRecording,
6289
+ getStorageStatus,
6290
+ getStorageDatabaseUrl,
6291
+ getStorageDatabaseEnvName,
6292
+ getStorageDatabaseEnv,
6293
+ getStorageConnectionString,
6294
+ getStorageConfig,
6241
6295
  getRecordingStats,
6242
6296
  getRecording,
6243
6297
  getProject,
@@ -6246,8 +6300,6 @@ export {
6246
6300
  getDataDir,
6247
6301
  getCurrentFile,
6248
6302
  getConnectionString,
6249
- getCloudStatus,
6250
- getCloudConfig,
6251
6303
  getAgent,
6252
6304
  ensureDataDir,
6253
6305
  enhanceText,
@@ -6257,8 +6309,16 @@ export {
6257
6309
  checkRecordingDeps,
6258
6310
  applyPgMigrations,
6259
6311
  TranscriptionError,
6312
+ STORAGE_TABLES,
6313
+ STORAGE_MODE_ENV,
6314
+ STORAGE_DATABASE_ENV,
6260
6315
  RecordingNotFoundError,
6261
6316
  RecordingError,
6317
+ RECORDINGS_STORAGE_TABLES,
6318
+ RECORDINGS_STORAGE_MODE_FALLBACK_ENV,
6319
+ RECORDINGS_STORAGE_MODE_ENV,
6320
+ RECORDINGS_STORAGE_FALLBACK_ENV,
6321
+ RECORDINGS_STORAGE_ENV,
6262
6322
  PgAdapterAsync,
6263
6323
  EnhancementError,
6264
6324
  DEFAULT_CONFIG
@@ -1 +1 @@
1
- {"version":3,"file":"enhancer.d.ts","sourceRoot":"","sources":["../../src/lib/enhancer.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EACV,gBAAgB,EAChB,iBAAiB,EAClB,MAAM,mBAAmB,CAAC;AAiB3B,wBAAgB,sBAAsB,IAAI,IAAI,CAE7C;AAED;;;;;;;GAOG;AACH,wBAAgB,gBAAgB,CAC9B,IAAI,EAAE,MAAM,EACZ,MAAM,EAAE,gBAAgB,GACvB;IAAE,KAAK,EAAE,OAAO,CAAC;IAAC,MAAM,EAAE,MAAM,CAAC;IAAC,WAAW,EAAE,MAAM,CAAA;CAAE,CAmCzD;AAoBD,wBAAsB,WAAW,CAC/B,OAAO,EAAE,MAAM,EACf,WAAW,EAAE,MAAM,EACnB,MAAM,EAAE,gBAAgB,EACxB,YAAY,CAAC,EAAE,MAAM,GACpB,OAAO,CAAC,iBAAiB,CAAC,CAwD5B;AAED;;GAEG;AACH,wBAAsB,WAAW,CAC/B,OAAO,EAAE,MAAM,EACf,MAAM,EAAE,gBAAgB,EACxB,YAAY,CAAC,EAAE,MAAM,GACpB,OAAO,CAAC;IACT,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,KAAK,GAAG,UAAU,CAAC;IACzB,iBAAiB,EAAE,MAAM,GAAG,IAAI,CAAC;CAClC,CAAC,CAkBD"}
1
+ {"version":3,"file":"enhancer.d.ts","sourceRoot":"","sources":["../../src/lib/enhancer.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EACV,gBAAgB,EAChB,iBAAiB,EAClB,MAAM,mBAAmB,CAAC;AAkB3B,wBAAgB,sBAAsB,IAAI,IAAI,CAE7C;AAED;;;;;;;GAOG;AACH,wBAAgB,gBAAgB,CAC9B,IAAI,EAAE,MAAM,EACZ,MAAM,EAAE,gBAAgB,GACvB;IAAE,KAAK,EAAE,OAAO,CAAC;IAAC,MAAM,EAAE,MAAM,CAAC;IAAC,WAAW,EAAE,MAAM,CAAA;CAAE,CAmCzD;AAoBD,wBAAsB,WAAW,CAC/B,OAAO,EAAE,MAAM,EACf,WAAW,EAAE,MAAM,EACnB,MAAM,EAAE,gBAAgB,EACxB,YAAY,CAAC,EAAE,MAAM,GACpB,OAAO,CAAC,iBAAiB,CAAC,CAwD5B;AAED;;GAEG;AACH,wBAAsB,WAAW,CAC/B,OAAO,EAAE,MAAM,EACf,MAAM,EAAE,gBAAgB,EACxB,YAAY,CAAC,EAAE,MAAM,GACpB,OAAO,CAAC;IACT,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,KAAK,GAAG,UAAU,CAAC;IACzB,iBAAiB,EAAE,MAAM,GAAG,IAAI,CAAC;CAClC,CAAC,CAkBD"}
@@ -7,5 +7,6 @@ export declare function resetClient(): void;
7
7
  export declare function transcribeAudio(audioPath: string, config: RecordingsConfig, options?: Pick<TranscriptionOptions, "prompt">): Promise<TranscriptionResult>;
8
8
  export declare function transcribeBuffer(buffer: Buffer, filename: string, config: RecordingsConfig, options?: Pick<TranscriptionOptions, "prompt">): Promise<TranscriptionResult>;
9
9
  export declare function transcribeAudioStream(audioPath: string, config: RecordingsConfig, options?: TranscriptionOptions): Promise<TranscriptionResult>;
10
+ export declare function describeTranscriptionFailure(message: string): string;
10
11
  export declare function buildVerbatimPrompt(context?: string): string;
11
12
  //# sourceMappingURL=transcriber.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"transcriber.d.ts","sourceRoot":"","sources":["../../src/lib/transcriber.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,gBAAgB,EAAE,mBAAmB,EAAE,MAAM,mBAAmB,CAAC;AAK/E,MAAM,WAAW,oBAAoB;IACnC,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,OAAO,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,KAAK,IAAI,CAAC;CACtD;AAaD,wBAAgB,WAAW,IAAI,IAAI,CAElC;AAED,wBAAsB,eAAe,CACnC,SAAS,EAAE,MAAM,EACjB,MAAM,EAAE,gBAAgB,EACxB,OAAO,GAAE,IAAI,CAAC,oBAAoB,EAAE,QAAQ,CAAM,GACjD,OAAO,CAAC,mBAAmB,CAAC,CA4B9B;AAED,wBAAsB,gBAAgB,CACpC,MAAM,EAAE,MAAM,EACd,QAAQ,EAAE,MAAM,EAChB,MAAM,EAAE,gBAAgB,EACxB,OAAO,GAAE,IAAI,CAAC,oBAAoB,EAAE,QAAQ,CAAM,GACjD,OAAO,CAAC,mBAAmB,CAAC,CA6B9B;AAED,wBAAsB,qBAAqB,CACzC,SAAS,EAAE,MAAM,EACjB,MAAM,EAAE,gBAAgB,EACxB,OAAO,GAAE,oBAAyB,GACjC,OAAO,CAAC,mBAAmB,CAAC,CA6C9B;AAED,wBAAgB,mBAAmB,CAAC,OAAO,CAAC,EAAE,MAAM,GAAG,MAAM,CAM5D"}
1
+ {"version":3,"file":"transcriber.d.ts","sourceRoot":"","sources":["../../src/lib/transcriber.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,gBAAgB,EAAE,mBAAmB,EAAE,MAAM,mBAAmB,CAAC;AAK/E,MAAM,WAAW,oBAAoB;IACnC,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,OAAO,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,KAAK,IAAI,CAAC;CACtD;AAaD,wBAAgB,WAAW,IAAI,IAAI,CAElC;AAED,wBAAsB,eAAe,CACnC,SAAS,EAAE,MAAM,EACjB,MAAM,EAAE,gBAAgB,EACxB,OAAO,GAAE,IAAI,CAAC,oBAAoB,EAAE,QAAQ,CAAM,GACjD,OAAO,CAAC,mBAAmB,CAAC,CA4B9B;AAED,wBAAsB,gBAAgB,CACpC,MAAM,EAAE,MAAM,EACd,QAAQ,EAAE,MAAM,EAChB,MAAM,EAAE,gBAAgB,EACxB,OAAO,GAAE,IAAI,CAAC,oBAAoB,EAAE,QAAQ,CAAM,GACjD,OAAO,CAAC,mBAAmB,CAAC,CA6B9B;AAED,wBAAsB,qBAAqB,CACzC,SAAS,EAAE,MAAM,EACjB,MAAM,EAAE,gBAAgB,EACxB,OAAO,GAAE,oBAAyB,GACjC,OAAO,CAAC,mBAAmB,CAAC,CA6C9B;AAED,wBAAgB,4BAA4B,CAAC,OAAO,EAAE,MAAM,GAAG,MAAM,CAQpE;AAED,wBAAgB,mBAAmB,CAAC,OAAO,CAAC,EAAE,MAAM,GAAG,MAAM,CAM5D"}
@@ -0,0 +1,13 @@
1
+ import type { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js";
2
+ export declare const DEFAULT_MCP_HTTP_PORT = 8873;
3
+ export declare const MCP_HTTP_HOST = "127.0.0.1";
4
+ export declare function isHttpMode(args: string[]): boolean;
5
+ export declare function isStdioMode(args: string[]): boolean;
6
+ export declare function resolveMcpHttpPort(args: string[]): number;
7
+ export declare function handleMcpRequest(req: Request, buildServer: () => McpServer): Promise<Response>;
8
+ export declare function startMcpHttpServer(options: {
9
+ name: string;
10
+ port: number;
11
+ buildServer: () => McpServer;
12
+ }): ReturnType<typeof Bun.serve>;
13
+ //# sourceMappingURL=http.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"http.d.ts","sourceRoot":"","sources":["../../src/mcp/http.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,yCAAyC,CAAC;AAEzE,eAAO,MAAM,qBAAqB,OAAO,CAAC;AAC1C,eAAO,MAAM,aAAa,cAAc,CAAC;AAEzC,wBAAgB,UAAU,CAAC,IAAI,EAAE,MAAM,EAAE,GAAG,OAAO,CAElD;AAED,wBAAgB,WAAW,CAAC,IAAI,EAAE,MAAM,EAAE,GAAG,OAAO,CAEnD;AAED,wBAAgB,kBAAkB,CAAC,IAAI,EAAE,MAAM,EAAE,GAAG,MAAM,CAQzD;AAED,wBAAsB,gBAAgB,CACpC,GAAG,EAAE,OAAO,EACZ,WAAW,EAAE,MAAM,SAAS,GAC3B,OAAO,CAAC,QAAQ,CAAC,CAOnB;AAED,wBAAgB,kBAAkB,CAAC,OAAO,EAAE;IAC1C,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,CAAC;IACb,WAAW,EAAE,MAAM,SAAS,CAAC;CAC9B,GAAG,UAAU,CAAC,OAAO,GAAG,CAAC,KAAK,CAAC,CAoB/B"}
@@ -1,3 +1,4 @@
1
1
  #!/usr/bin/env bun
2
- export {};
2
+ import { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js";
3
+ export declare function buildServer(): McpServer;
3
4
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/mcp/index.ts"],"names":[],"mappings":""}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/mcp/index.ts"],"names":[],"mappings":";AACA,OAAO,EAAE,SAAS,EAAE,MAAM,yCAAyC,CAAC;AAgCpE,wBAAgB,WAAW,IAAI,SAAS,CAyevC"}