@burtson-labs/bandit-engine 2.1.1 → 2.1.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.d.mts CHANGED
@@ -1,5 +1,5 @@
1
- import { F as FeatureKey, a as FeatureEvaluation, S as SubscriptionTier, b as FeatureFlagConfig, T as TrialUsage } from './public-D8UsefSk.mjs';
2
- export { A as AIChatRequest, c as AIChatResponse, d as AIGenerateRequest, e as AIGenerateResponse, f as AIMessage, g as AIModel, h as AIProviderConfig, C as ChatConfig, i as ChatModal, j as ChatModalProps, k as ChatProvider, D as DEFAULT_TIER_FEATURES, l as FeatureMatrix, O as OSS_DEFAULT_FEATURES, P as PackageSettings, V as VoiceModelsResponse, m as VoiceService, v as voiceService } from './public-D8UsefSk.mjs';
1
+ import { F as FeatureKey, a as FeatureEvaluation, S as SubscriptionTier, b as FeatureFlagConfig, T as TrialUsage, A as AIMessage } from './public-ByjnoHLe.mjs';
2
+ export { c as AIChatRequest, d as AIChatResponse, e as AIGenerateRequest, f as AIGenerateResponse, g as AIModel, h as AIProviderConfig, C as ChatConfig, i as ChatModal, j as ChatModalProps, k as ChatProvider, D as DEFAULT_TIER_FEATURES, l as FeatureMatrix, O as OSS_DEFAULT_FEATURES, P as PackageSettings, V as VoiceModelsResponse, m as VoiceService, v as voiceService } from './public-ByjnoHLe.mjs';
3
3
  import * as react_jsx_runtime from 'react/jsx-runtime';
4
4
  import React, { ReactNode } from 'react';
5
5
  import { Theme } from '@mui/material/styles';
@@ -1589,4 +1589,294 @@ declare const useVectorStore: () => {
1589
1589
  initializeVectorService: () => Promise<void>;
1590
1590
  };
1591
1591
 
1592
- export { AUTH_TOKEN_CHANGED_EVENT, type AuthSessionConfig, type AuthSessionHandlers, Chat, type CreateMemoryOptions, DebugLogger, FeatureEvaluation, FeatureFlagConfig, FeatureFlagContext, type FeatureFlagContextValue, FeatureFlagProvider, type FeatureFlagProviderProps, FeatureFlagService, FeatureKey, FeedbackButton, type FeedbackButtonProps, type FeedbackCategories, FeedbackModal, type FeedbackModalProps, type FeedbackPriorities, type FeedbackRequest, type FeedbackResponse, type FileUploadResult, type GatewayQueryOptions, InterestsEditor, type JwtClaims, type LogContext, MANAGEMENT_SECTIONS, Management, type ManagementAccess, type ManagementAccessInput, type ManagementLink, type ManagementProps, type ManagementRequest, type ManagementSectionDef, type ManagementSectionId, type MemorySearchFilters, type MigrationProgress, type MigrationStatus, type NotificationConfig, type NotificationContextType, NotificationProvider, type NotificationProviderProps, NotificationService, SYSTEM_FLAGS, type SearchOptions, type SearchResult, StreamingTTSClient, SubscriptionExpiredGuard, type SubscriptionExpiredGuardProps, SubscriptionExpiredModal, type SubscriptionExpiredModalProps, SubscriptionTier, TOKEN_KEY, type TTSOptions, type TTSProgress, TTSState, type TokenPersistence, type TokenStorageMode, TrialUsage, type UploadRequest, type UseTTSReturn, VectorDatabaseService, type VectorDocument, type VectorMemory, type VectorMemoryMetadata, VectorMigrationService, type VectorStoreStatus, type VoiceState, authenticationService, debugLogger, defineCustomElement, featureFlagService, getCriticalConfig, getFeatureMatrix, getStreamingTTSClient, getSystemConstants, getTTSState, handleHttpError, handleSubscriptionUpgrade, handleValidationError, initializeCoreSystem, isWorkspaceAdminRole, notificationService, pauseTTS, previewTierUpgrade, resolveManagementSections, resumeTTS, showInfoNotification, showSuccessNotification, speakStream as speakWithStreaming, stopTTS, syncSubscriptionWithAPI, updateSubscriptionTier, useFeatureFlag, useFeatureVisibility, useFeatures, useGatewayHealth, useGatewayMemory, useGatewayModels, useGlobalTTS, useManagementAccess, useNotification, useNotificationService, useTTS, useVectorStore, useVoiceStore, useVoices, validateEnvironment, validateSystemIntegrity, vectorDatabaseService, vectorMigrationService };
1592
+ /**
1593
+ * Meeting transcripts as text: WebVTT (Teams, Zoom, Meet exports), SubRip
1594
+ * (.srt), the plain "Speaker: words" layout most tools paste, and the Teams
1595
+ * .docx layout (timing line, speaker line, text). Everything here is pure and
1596
+ * runs on the main thread; a transcript of a two-hour meeting is a few hundred
1597
+ * kilobytes at most.
1598
+ */
1599
+ interface TranscriptSegment {
1600
+ /** Seconds from the start of the recording, when the transcript says. */
1601
+ start?: number;
1602
+ end?: number;
1603
+ speaker?: string;
1604
+ text: string;
1605
+ }
1606
+ type TranscriptFormat = "vtt" | "srt" | "text";
1607
+ interface ParsedTranscript {
1608
+ segments: TranscriptSegment[];
1609
+ /** Distinct speaker labels, in order of first appearance. */
1610
+ speakers: string[];
1611
+ format: TranscriptFormat;
1612
+ }
1613
+ /** A subtitle/transcript file: only ever a meeting transcript. */
1614
+ declare const isTranscriptFileName: (name: string) => boolean;
1615
+ /** An audio or video file, by MIME type or by extension when the browser gives none. */
1616
+ declare const isRecordingFile: (file: {
1617
+ name: string;
1618
+ type?: string;
1619
+ }) => boolean;
1620
+ /** A file the composer hands to meeting notes rather than to the model as a document. */
1621
+ declare const isMeetingFile: (file: {
1622
+ name: string;
1623
+ type?: string;
1624
+ }) => boolean;
1625
+ /**
1626
+ * Parse transcript text in whatever layout it arrived. Unparseable input
1627
+ * still yields one segment per paragraph, so notes can be made from any text.
1628
+ */
1629
+ declare const parseTranscript: (text: string, fileName?: string) => ParsedTranscript;
1630
+ /**
1631
+ * The text the model reads: one line per speaker turn, `[mm:ss] Name: words`.
1632
+ * Consecutive segments by the same speaker merge into a turn so the prompt
1633
+ * carries the words, not one timestamp per subtitle cue.
1634
+ */
1635
+ declare const transcriptToText: (segments: TranscriptSegment[]) => string;
1636
+ /**
1637
+ * Whether pasted text reads like a meeting transcript: a WebVTT header, cue
1638
+ * timings, or a run of `Name:` turns from at least two speakers.
1639
+ */
1640
+ declare const looksLikeTranscript: (text: string) => boolean;
1641
+
1642
+ /**
1643
+ * Structured notes from a transcript, and their Markdown and HTML renderings.
1644
+ *
1645
+ * The model is asked for one JSON object. A transcript longer than one
1646
+ * request's worth is split on line boundaries; each part yields partial notes
1647
+ * and a second pass merges them (map-reduce), so an hour-long meeting fits a
1648
+ * model with a modest context window. Nothing here knows which model answers:
1649
+ * the caller passes a `chat` function, which the chat uses to route through
1650
+ * the engine's normal provider.
1651
+ */
1652
+ interface ActionItem {
1653
+ task: string;
1654
+ owner?: string;
1655
+ due?: string;
1656
+ }
1657
+ interface MeetingNotes {
1658
+ title: string;
1659
+ /** The meeting's date as the transcript states it (ISO when possible). */
1660
+ date?: string;
1661
+ attendees: string[];
1662
+ summary: string;
1663
+ decisions: string[];
1664
+ actionItems: ActionItem[];
1665
+ openQuestions: string[];
1666
+ }
1667
+ interface NotesMeta {
1668
+ /** The uploaded file or pasted source. */
1669
+ sourceName?: string;
1670
+ durationSeconds?: number;
1671
+ wordCount?: number;
1672
+ /** True when Bandit transcribed a recording (no speaker labels available). */
1673
+ transcribed?: boolean;
1674
+ /** When the notes were made. */
1675
+ createdAt?: Date;
1676
+ }
1677
+ type ChatFn = (messages: AIMessage[], options: {
1678
+ maxTokens: number;
1679
+ }) => Promise<string>;
1680
+ interface NotesHints {
1681
+ fileName?: string;
1682
+ speakers?: string[];
1683
+ transcribed?: boolean;
1684
+ /** What the person typed alongside the upload, if anything. */
1685
+ note?: string;
1686
+ }
1687
+ /** Split on line boundaries so no speaker turn is cut in half. */
1688
+ declare const chunkTranscript: (text: string, maxChars?: number) => string[];
1689
+ /** Parse the model's answer into notes, tolerating fences, prose and trailing commas. */
1690
+ declare const parseNotesJson: (raw: string) => MeetingNotes | null;
1691
+ interface GenerateNotesOptions {
1692
+ chat: ChatFn;
1693
+ hints?: NotesHints;
1694
+ onProgress?: (progress: {
1695
+ done: number;
1696
+ total: number;
1697
+ }) => void;
1698
+ chunkChars?: number;
1699
+ signal?: AbortSignal;
1700
+ }
1701
+ /**
1702
+ * Notes for a whole transcript. Short transcripts take one request; long ones
1703
+ * are summarized part by part and merged (in rounds, if there are many parts).
1704
+ */
1705
+ declare const generateMeetingNotes: (transcript: string, options: GenerateNotesOptions) => Promise<MeetingNotes>;
1706
+ /** The notes as the chat shows them. */
1707
+ declare const notesToMarkdown: (notes: MeetingNotes, meta?: NotesMeta) => string;
1708
+ /**
1709
+ * The notes as a self-contained page for Stash, so a share link opens a
1710
+ * readable document rather than raw Markdown. No scripts, no remote assets.
1711
+ */
1712
+ declare const notesToHtml: (notes: MeetingNotes, meta?: NotesMeta) => string;
1713
+
1714
+ /** Nominal chunk length. Whisper on CPU transcribes about one second per second. */
1715
+ declare const CHUNK_SECONDS = 45;
1716
+ /** Upload cap for one recording. Compressed speech at 64 kbit/s is 28 MB an hour. */
1717
+ declare const MAX_RECORDING_BYTES: number;
1718
+ /**
1719
+ * Decoded audio is held in memory as 32-bit floats (16 kHz mono is 3.84 MB a
1720
+ * minute, plus the browser's own decode buffer at the file's native rate).
1721
+ * Half an hour keeps that well inside what a desktop tab can allocate.
1722
+ */
1723
+ declare const MAX_RECORDING_SECONDS: number;
1724
+ /** Decodes a container (mp3, m4a, mp4, webm, wav...) into per-channel PCM. */
1725
+ type AudioDecoder = (data: ArrayBuffer) => Promise<{
1726
+ sampleRate: number;
1727
+ channels: Float32Array[];
1728
+ }>;
1729
+
1730
+ type TranscribeChunk = (blob: Blob, signal?: AbortSignal) => Promise<string>;
1731
+ interface TranscribeProgress {
1732
+ done: number;
1733
+ total: number;
1734
+ }
1735
+ interface TranscribeRecordingOptions {
1736
+ signal?: AbortSignal;
1737
+ onProgress?: (progress: TranscribeProgress) => void;
1738
+ concurrency?: number;
1739
+ /** Test seams: the speech-to-text call and the audio decoder. */
1740
+ transcribeChunk?: TranscribeChunk;
1741
+ decode?: AudioDecoder;
1742
+ }
1743
+ interface RecordingTranscript {
1744
+ segments: TranscriptSegment[];
1745
+ durationSeconds: number;
1746
+ chunkCount: number;
1747
+ }
1748
+ declare class SpeechToTextError extends Error {
1749
+ readonly status?: number | undefined;
1750
+ constructor(message: string, status?: number | undefined);
1751
+ }
1752
+ /**
1753
+ * Transcribe a recording: decode it in the browser, cut it into chunks, send
1754
+ * each through speech-to-text, and stitch the text back together with the
1755
+ * chunk's time offsets. Speaker labels are not produced (Whisper does not
1756
+ * separate speakers); the notes say so.
1757
+ */
1758
+ declare const transcribeRecording: (file: Blob, options?: TranscribeRecordingOptions) => Promise<RecordingTranscript>;
1759
+
1760
+ /**
1761
+ * The whole meeting-notes turn: read or transcribe the source, write the
1762
+ * notes through the chat's model, render them, and file them in Stash with a
1763
+ * share link. The chat calls this in place of a model turn and shows progress
1764
+ * in the reply while it runs.
1765
+ */
1766
+ type MeetingNotesInput = {
1767
+ kind: "file";
1768
+ file: File;
1769
+ note?: string;
1770
+ } | {
1771
+ kind: "text";
1772
+ text: string;
1773
+ sourceName?: string;
1774
+ note?: string;
1775
+ };
1776
+ type MeetingNotesStage = "reading" | "transcribing" | "summarizing" | "saving";
1777
+ interface MeetingNotesProgress {
1778
+ stage: MeetingNotesStage;
1779
+ /** Short status for the chip under the reply, e.g. "Transcribing 3 of 12". */
1780
+ label: string;
1781
+ done?: number;
1782
+ total?: number;
1783
+ }
1784
+ interface MeetingNotesSource {
1785
+ name?: string;
1786
+ durationSeconds?: number;
1787
+ wordCount: number;
1788
+ /** True when Bandit transcribed a recording. */
1789
+ transcribed: boolean;
1790
+ speakers: string[];
1791
+ }
1792
+ interface MeetingNotesResult {
1793
+ notes: MeetingNotes;
1794
+ /** The reply for the chat: the notes plus a Stash footer. */
1795
+ markdown: string;
1796
+ html: string;
1797
+ transcriptText: string;
1798
+ source: MeetingNotesSource;
1799
+ stash?: {
1800
+ key: string;
1801
+ shareUrl?: string;
1802
+ expiresAt?: string;
1803
+ };
1804
+ /** Why the notes could not be filed, when they couldn't; the notes still exist. */
1805
+ stashError?: string;
1806
+ }
1807
+ interface RunMeetingNotesOptions {
1808
+ signal?: AbortSignal;
1809
+ onProgress?: (progress: MeetingNotesProgress) => void;
1810
+ /** Whether to file the notes in Stash (default: when Stash is reachable). */
1811
+ save?: boolean;
1812
+ /** Test seams. */
1813
+ chat?: ChatFn;
1814
+ transcribeChunk?: TranscribeChunk;
1815
+ decode?: AudioDecoder;
1816
+ now?: () => Date;
1817
+ }
1818
+ /** A failure the person can act on, phrased for the chat. */
1819
+ declare class MeetingNotesError extends Error {
1820
+ constructor(message: string);
1821
+ }
1822
+ /** The user-facing line for a failed run. */
1823
+ declare const meetingNotesErrorMessage: (error: unknown) => string;
1824
+ /** What the transcript shows as the person's message for this turn. */
1825
+ declare const describeMeetingInput: (input: MeetingNotesInput) => string;
1826
+ /**
1827
+ * Make meeting notes from a recording, a transcript file or pasted text.
1828
+ * Rejects with an `AbortError` when `signal` fires, a {@link MeetingNotesError}
1829
+ * for anything the person can act on, and the underlying error otherwise.
1830
+ */
1831
+ declare const runMeetingNotes: (input: MeetingNotesInput, options?: RunMeetingNotesOptions) => Promise<MeetingNotesResult>;
1832
+
1833
+ /**
1834
+ * Bandit Stash: the shareable documents a signed-in person keeps (S3Api's
1835
+ * `/api/artifact` routes). The base URL is the host's `fileStorageApiUrl`
1836
+ * package setting (the S3Api base including `/api`, the same one knowledge
1837
+ * uploads use); a host without it has no Stash and callers stay quiet about it.
1838
+ *
1839
+ * Writes go under a per-owner prefix the server derives from the token, so a
1840
+ * document is private to the person (or to their team with `scope: "team"`).
1841
+ * A share link is a separate, expiring, revocable token minted on request.
1842
+ */
1843
+ interface StashSaveResult {
1844
+ key: string;
1845
+ /** The owner's own URL for the object (needs the session token). */
1846
+ url?: string;
1847
+ size?: number;
1848
+ }
1849
+ interface StashShareLink {
1850
+ url: string;
1851
+ token?: string;
1852
+ expiresAt?: string;
1853
+ }
1854
+ declare class StashError extends Error {
1855
+ readonly status?: number | undefined;
1856
+ constructor(message: string, status?: number | undefined);
1857
+ }
1858
+ /** True when there is a Stash to write to and a session to write as. */
1859
+ declare const stashAvailable: () => boolean;
1860
+ /**
1861
+ * Save a document to Stash. The server names the object after `name` (a
1862
+ * sanitized copy after an unguessable id), so the Stash page shows a real name.
1863
+ */
1864
+ declare const saveToStash: (args: {
1865
+ name: string;
1866
+ content: string | Blob;
1867
+ contentType: string;
1868
+ scope?: "private" | "team";
1869
+ signal?: AbortSignal;
1870
+ }) => Promise<StashSaveResult>;
1871
+ /**
1872
+ * Mint a share link for one of the caller's Stash documents. Anyone with the
1873
+ * link can read it until it expires (the server's default, seven days, unless
1874
+ * `expiryMinutes` says otherwise) or the owner revokes it in Stash.
1875
+ */
1876
+ declare const createStashShareLink: (args: {
1877
+ key: string;
1878
+ expiryMinutes?: number;
1879
+ signal?: AbortSignal;
1880
+ }) => Promise<StashShareLink>;
1881
+
1882
+ export { AIMessage, AUTH_TOKEN_CHANGED_EVENT, type ActionItem, type AuthSessionConfig, type AuthSessionHandlers, Chat, type CreateMemoryOptions, DebugLogger, FeatureEvaluation, FeatureFlagConfig, FeatureFlagContext, type FeatureFlagContextValue, FeatureFlagProvider, type FeatureFlagProviderProps, FeatureFlagService, FeatureKey, FeedbackButton, type FeedbackButtonProps, type FeedbackCategories, FeedbackModal, type FeedbackModalProps, type FeedbackPriorities, type FeedbackRequest, type FeedbackResponse, type FileUploadResult, type GatewayQueryOptions, InterestsEditor, type JwtClaims, type LogContext, MANAGEMENT_SECTIONS, MAX_RECORDING_BYTES, MAX_RECORDING_SECONDS, Management, type ManagementAccess, type ManagementAccessInput, type ManagementLink, type ManagementProps, type ManagementRequest, type ManagementSectionDef, type ManagementSectionId, type MeetingNotes, type ChatFn as MeetingNotesChatFn, MeetingNotesError, type MeetingNotesInput, type MeetingNotesProgress, type MeetingNotesResult, type MeetingNotesSource, type MeetingNotesStage, type MemorySearchFilters, type MigrationProgress, type MigrationStatus, type NotesMeta, type NotificationConfig, type NotificationContextType, NotificationProvider, type NotificationProviderProps, NotificationService, type ParsedTranscript, CHUNK_SECONDS as RECORDING_CHUNK_SECONDS, type RecordingTranscript, type RunMeetingNotesOptions, SYSTEM_FLAGS, type SearchOptions, type SearchResult, SpeechToTextError, StashError, type StashSaveResult, type StashShareLink, StreamingTTSClient, SubscriptionExpiredGuard, type SubscriptionExpiredGuardProps, SubscriptionExpiredModal, type SubscriptionExpiredModalProps, SubscriptionTier, TOKEN_KEY, type TTSOptions, type TTSProgress, TTSState, type TokenPersistence, type TokenStorageMode, type TranscriptFormat, type TranscriptSegment, TrialUsage, type UploadRequest, type UseTTSReturn, VectorDatabaseService, type VectorDocument, type VectorMemory, type VectorMemoryMetadata, VectorMigrationService, type VectorStoreStatus, type VoiceState, authenticationService, chunkTranscript, createStashShareLink, debugLogger, defineCustomElement, describeMeetingInput, featureFlagService, generateMeetingNotes, getCriticalConfig, getFeatureMatrix, getStreamingTTSClient, getSystemConstants, getTTSState, handleHttpError, handleSubscriptionUpgrade, handleValidationError, initializeCoreSystem, isMeetingFile, isRecordingFile, isTranscriptFileName, isWorkspaceAdminRole, looksLikeTranscript, meetingNotesErrorMessage, notesToHtml, notesToMarkdown, notificationService, parseNotesJson, parseTranscript, pauseTTS, previewTierUpgrade, resolveManagementSections, resumeTTS, runMeetingNotes, saveToStash, showInfoNotification, showSuccessNotification, speakStream as speakWithStreaming, stashAvailable, stopTTS, syncSubscriptionWithAPI, transcribeRecording, transcriptToText, updateSubscriptionTier, useFeatureFlag, useFeatureVisibility, useFeatures, useGatewayHealth, useGatewayMemory, useGatewayModels, useGlobalTTS, useManagementAccess, useNotification, useNotificationService, useTTS, useVectorStore, useVoiceStore, useVoices, validateEnvironment, validateSystemIntegrity, vectorDatabaseService, vectorMigrationService };
package/dist/index.d.ts CHANGED
@@ -1,5 +1,5 @@
1
- import { F as FeatureKey, a as FeatureEvaluation, S as SubscriptionTier, b as FeatureFlagConfig, T as TrialUsage } from './public-D8UsefSk.js';
2
- export { A as AIChatRequest, c as AIChatResponse, d as AIGenerateRequest, e as AIGenerateResponse, f as AIMessage, g as AIModel, h as AIProviderConfig, C as ChatConfig, i as ChatModal, j as ChatModalProps, k as ChatProvider, D as DEFAULT_TIER_FEATURES, l as FeatureMatrix, O as OSS_DEFAULT_FEATURES, P as PackageSettings, V as VoiceModelsResponse, m as VoiceService, v as voiceService } from './public-D8UsefSk.js';
1
+ import { F as FeatureKey, a as FeatureEvaluation, S as SubscriptionTier, b as FeatureFlagConfig, T as TrialUsage, A as AIMessage } from './public-ByjnoHLe.js';
2
+ export { c as AIChatRequest, d as AIChatResponse, e as AIGenerateRequest, f as AIGenerateResponse, g as AIModel, h as AIProviderConfig, C as ChatConfig, i as ChatModal, j as ChatModalProps, k as ChatProvider, D as DEFAULT_TIER_FEATURES, l as FeatureMatrix, O as OSS_DEFAULT_FEATURES, P as PackageSettings, V as VoiceModelsResponse, m as VoiceService, v as voiceService } from './public-ByjnoHLe.js';
3
3
  import * as react_jsx_runtime from 'react/jsx-runtime';
4
4
  import React, { ReactNode } from 'react';
5
5
  import { Theme } from '@mui/material/styles';
@@ -1589,4 +1589,294 @@ declare const useVectorStore: () => {
1589
1589
  initializeVectorService: () => Promise<void>;
1590
1590
  };
1591
1591
 
1592
- export { AUTH_TOKEN_CHANGED_EVENT, type AuthSessionConfig, type AuthSessionHandlers, Chat, type CreateMemoryOptions, DebugLogger, FeatureEvaluation, FeatureFlagConfig, FeatureFlagContext, type FeatureFlagContextValue, FeatureFlagProvider, type FeatureFlagProviderProps, FeatureFlagService, FeatureKey, FeedbackButton, type FeedbackButtonProps, type FeedbackCategories, FeedbackModal, type FeedbackModalProps, type FeedbackPriorities, type FeedbackRequest, type FeedbackResponse, type FileUploadResult, type GatewayQueryOptions, InterestsEditor, type JwtClaims, type LogContext, MANAGEMENT_SECTIONS, Management, type ManagementAccess, type ManagementAccessInput, type ManagementLink, type ManagementProps, type ManagementRequest, type ManagementSectionDef, type ManagementSectionId, type MemorySearchFilters, type MigrationProgress, type MigrationStatus, type NotificationConfig, type NotificationContextType, NotificationProvider, type NotificationProviderProps, NotificationService, SYSTEM_FLAGS, type SearchOptions, type SearchResult, StreamingTTSClient, SubscriptionExpiredGuard, type SubscriptionExpiredGuardProps, SubscriptionExpiredModal, type SubscriptionExpiredModalProps, SubscriptionTier, TOKEN_KEY, type TTSOptions, type TTSProgress, TTSState, type TokenPersistence, type TokenStorageMode, TrialUsage, type UploadRequest, type UseTTSReturn, VectorDatabaseService, type VectorDocument, type VectorMemory, type VectorMemoryMetadata, VectorMigrationService, type VectorStoreStatus, type VoiceState, authenticationService, debugLogger, defineCustomElement, featureFlagService, getCriticalConfig, getFeatureMatrix, getStreamingTTSClient, getSystemConstants, getTTSState, handleHttpError, handleSubscriptionUpgrade, handleValidationError, initializeCoreSystem, isWorkspaceAdminRole, notificationService, pauseTTS, previewTierUpgrade, resolveManagementSections, resumeTTS, showInfoNotification, showSuccessNotification, speakStream as speakWithStreaming, stopTTS, syncSubscriptionWithAPI, updateSubscriptionTier, useFeatureFlag, useFeatureVisibility, useFeatures, useGatewayHealth, useGatewayMemory, useGatewayModels, useGlobalTTS, useManagementAccess, useNotification, useNotificationService, useTTS, useVectorStore, useVoiceStore, useVoices, validateEnvironment, validateSystemIntegrity, vectorDatabaseService, vectorMigrationService };
1592
+ /**
1593
+ * Meeting transcripts as text: WebVTT (Teams, Zoom, Meet exports), SubRip
1594
+ * (.srt), the plain "Speaker: words" layout most tools paste, and the Teams
1595
+ * .docx layout (timing line, speaker line, text). Everything here is pure and
1596
+ * runs on the main thread; a transcript of a two-hour meeting is a few hundred
1597
+ * kilobytes at most.
1598
+ */
1599
+ interface TranscriptSegment {
1600
+ /** Seconds from the start of the recording, when the transcript says. */
1601
+ start?: number;
1602
+ end?: number;
1603
+ speaker?: string;
1604
+ text: string;
1605
+ }
1606
+ type TranscriptFormat = "vtt" | "srt" | "text";
1607
+ interface ParsedTranscript {
1608
+ segments: TranscriptSegment[];
1609
+ /** Distinct speaker labels, in order of first appearance. */
1610
+ speakers: string[];
1611
+ format: TranscriptFormat;
1612
+ }
1613
+ /** A subtitle/transcript file: only ever a meeting transcript. */
1614
+ declare const isTranscriptFileName: (name: string) => boolean;
1615
+ /** An audio or video file, by MIME type or by extension when the browser gives none. */
1616
+ declare const isRecordingFile: (file: {
1617
+ name: string;
1618
+ type?: string;
1619
+ }) => boolean;
1620
+ /** A file the composer hands to meeting notes rather than to the model as a document. */
1621
+ declare const isMeetingFile: (file: {
1622
+ name: string;
1623
+ type?: string;
1624
+ }) => boolean;
1625
+ /**
1626
+ * Parse transcript text in whatever layout it arrived. Unparseable input
1627
+ * still yields one segment per paragraph, so notes can be made from any text.
1628
+ */
1629
+ declare const parseTranscript: (text: string, fileName?: string) => ParsedTranscript;
1630
+ /**
1631
+ * The text the model reads: one line per speaker turn, `[mm:ss] Name: words`.
1632
+ * Consecutive segments by the same speaker merge into a turn so the prompt
1633
+ * carries the words, not one timestamp per subtitle cue.
1634
+ */
1635
+ declare const transcriptToText: (segments: TranscriptSegment[]) => string;
1636
+ /**
1637
+ * Whether pasted text reads like a meeting transcript: a WebVTT header, cue
1638
+ * timings, or a run of `Name:` turns from at least two speakers.
1639
+ */
1640
+ declare const looksLikeTranscript: (text: string) => boolean;
1641
+
1642
+ /**
1643
+ * Structured notes from a transcript, and their Markdown and HTML renderings.
1644
+ *
1645
+ * The model is asked for one JSON object. A transcript longer than one
1646
+ * request's worth is split on line boundaries; each part yields partial notes
1647
+ * and a second pass merges them (map-reduce), so an hour-long meeting fits a
1648
+ * model with a modest context window. Nothing here knows which model answers:
1649
+ * the caller passes a `chat` function, which the chat uses to route through
1650
+ * the engine's normal provider.
1651
+ */
1652
+ interface ActionItem {
1653
+ task: string;
1654
+ owner?: string;
1655
+ due?: string;
1656
+ }
1657
+ interface MeetingNotes {
1658
+ title: string;
1659
+ /** The meeting's date as the transcript states it (ISO when possible). */
1660
+ date?: string;
1661
+ attendees: string[];
1662
+ summary: string;
1663
+ decisions: string[];
1664
+ actionItems: ActionItem[];
1665
+ openQuestions: string[];
1666
+ }
1667
+ interface NotesMeta {
1668
+ /** The uploaded file or pasted source. */
1669
+ sourceName?: string;
1670
+ durationSeconds?: number;
1671
+ wordCount?: number;
1672
+ /** True when Bandit transcribed a recording (no speaker labels available). */
1673
+ transcribed?: boolean;
1674
+ /** When the notes were made. */
1675
+ createdAt?: Date;
1676
+ }
1677
+ type ChatFn = (messages: AIMessage[], options: {
1678
+ maxTokens: number;
1679
+ }) => Promise<string>;
1680
+ interface NotesHints {
1681
+ fileName?: string;
1682
+ speakers?: string[];
1683
+ transcribed?: boolean;
1684
+ /** What the person typed alongside the upload, if anything. */
1685
+ note?: string;
1686
+ }
1687
+ /** Split on line boundaries so no speaker turn is cut in half. */
1688
+ declare const chunkTranscript: (text: string, maxChars?: number) => string[];
1689
+ /** Parse the model's answer into notes, tolerating fences, prose and trailing commas. */
1690
+ declare const parseNotesJson: (raw: string) => MeetingNotes | null;
1691
+ interface GenerateNotesOptions {
1692
+ chat: ChatFn;
1693
+ hints?: NotesHints;
1694
+ onProgress?: (progress: {
1695
+ done: number;
1696
+ total: number;
1697
+ }) => void;
1698
+ chunkChars?: number;
1699
+ signal?: AbortSignal;
1700
+ }
1701
+ /**
1702
+ * Notes for a whole transcript. Short transcripts take one request; long ones
1703
+ * are summarized part by part and merged (in rounds, if there are many parts).
1704
+ */
1705
+ declare const generateMeetingNotes: (transcript: string, options: GenerateNotesOptions) => Promise<MeetingNotes>;
1706
+ /** The notes as the chat shows them. */
1707
+ declare const notesToMarkdown: (notes: MeetingNotes, meta?: NotesMeta) => string;
1708
+ /**
1709
+ * The notes as a self-contained page for Stash, so a share link opens a
1710
+ * readable document rather than raw Markdown. No scripts, no remote assets.
1711
+ */
1712
+ declare const notesToHtml: (notes: MeetingNotes, meta?: NotesMeta) => string;
1713
+
1714
+ /** Nominal chunk length. Whisper on CPU transcribes about one second per second. */
1715
+ declare const CHUNK_SECONDS = 45;
1716
+ /** Upload cap for one recording. Compressed speech at 64 kbit/s is 28 MB an hour. */
1717
+ declare const MAX_RECORDING_BYTES: number;
1718
+ /**
1719
+ * Decoded audio is held in memory as 32-bit floats (16 kHz mono is 3.84 MB a
1720
+ * minute, plus the browser's own decode buffer at the file's native rate).
1721
+ * Half an hour keeps that well inside what a desktop tab can allocate.
1722
+ */
1723
+ declare const MAX_RECORDING_SECONDS: number;
1724
+ /** Decodes a container (mp3, m4a, mp4, webm, wav...) into per-channel PCM. */
1725
+ type AudioDecoder = (data: ArrayBuffer) => Promise<{
1726
+ sampleRate: number;
1727
+ channels: Float32Array[];
1728
+ }>;
1729
+
1730
+ type TranscribeChunk = (blob: Blob, signal?: AbortSignal) => Promise<string>;
1731
+ interface TranscribeProgress {
1732
+ done: number;
1733
+ total: number;
1734
+ }
1735
+ interface TranscribeRecordingOptions {
1736
+ signal?: AbortSignal;
1737
+ onProgress?: (progress: TranscribeProgress) => void;
1738
+ concurrency?: number;
1739
+ /** Test seams: the speech-to-text call and the audio decoder. */
1740
+ transcribeChunk?: TranscribeChunk;
1741
+ decode?: AudioDecoder;
1742
+ }
1743
+ interface RecordingTranscript {
1744
+ segments: TranscriptSegment[];
1745
+ durationSeconds: number;
1746
+ chunkCount: number;
1747
+ }
1748
+ declare class SpeechToTextError extends Error {
1749
+ readonly status?: number | undefined;
1750
+ constructor(message: string, status?: number | undefined);
1751
+ }
1752
+ /**
1753
+ * Transcribe a recording: decode it in the browser, cut it into chunks, send
1754
+ * each through speech-to-text, and stitch the text back together with the
1755
+ * chunk's time offsets. Speaker labels are not produced (Whisper does not
1756
+ * separate speakers); the notes say so.
1757
+ */
1758
+ declare const transcribeRecording: (file: Blob, options?: TranscribeRecordingOptions) => Promise<RecordingTranscript>;
1759
+
1760
+ /**
1761
+ * The whole meeting-notes turn: read or transcribe the source, write the
1762
+ * notes through the chat's model, render them, and file them in Stash with a
1763
+ * share link. The chat calls this in place of a model turn and shows progress
1764
+ * in the reply while it runs.
1765
+ */
1766
+ type MeetingNotesInput = {
1767
+ kind: "file";
1768
+ file: File;
1769
+ note?: string;
1770
+ } | {
1771
+ kind: "text";
1772
+ text: string;
1773
+ sourceName?: string;
1774
+ note?: string;
1775
+ };
1776
+ type MeetingNotesStage = "reading" | "transcribing" | "summarizing" | "saving";
1777
+ interface MeetingNotesProgress {
1778
+ stage: MeetingNotesStage;
1779
+ /** Short status for the chip under the reply, e.g. "Transcribing 3 of 12". */
1780
+ label: string;
1781
+ done?: number;
1782
+ total?: number;
1783
+ }
1784
+ interface MeetingNotesSource {
1785
+ name?: string;
1786
+ durationSeconds?: number;
1787
+ wordCount: number;
1788
+ /** True when Bandit transcribed a recording. */
1789
+ transcribed: boolean;
1790
+ speakers: string[];
1791
+ }
1792
+ interface MeetingNotesResult {
1793
+ notes: MeetingNotes;
1794
+ /** The reply for the chat: the notes plus a Stash footer. */
1795
+ markdown: string;
1796
+ html: string;
1797
+ transcriptText: string;
1798
+ source: MeetingNotesSource;
1799
+ stash?: {
1800
+ key: string;
1801
+ shareUrl?: string;
1802
+ expiresAt?: string;
1803
+ };
1804
+ /** Why the notes could not be filed, when they couldn't; the notes still exist. */
1805
+ stashError?: string;
1806
+ }
1807
+ interface RunMeetingNotesOptions {
1808
+ signal?: AbortSignal;
1809
+ onProgress?: (progress: MeetingNotesProgress) => void;
1810
+ /** Whether to file the notes in Stash (default: when Stash is reachable). */
1811
+ save?: boolean;
1812
+ /** Test seams. */
1813
+ chat?: ChatFn;
1814
+ transcribeChunk?: TranscribeChunk;
1815
+ decode?: AudioDecoder;
1816
+ now?: () => Date;
1817
+ }
1818
+ /** A failure the person can act on, phrased for the chat. */
1819
+ declare class MeetingNotesError extends Error {
1820
+ constructor(message: string);
1821
+ }
1822
+ /** The user-facing line for a failed run. */
1823
+ declare const meetingNotesErrorMessage: (error: unknown) => string;
1824
+ /** What the transcript shows as the person's message for this turn. */
1825
+ declare const describeMeetingInput: (input: MeetingNotesInput) => string;
1826
+ /**
1827
+ * Make meeting notes from a recording, a transcript file or pasted text.
1828
+ * Rejects with an `AbortError` when `signal` fires, a {@link MeetingNotesError}
1829
+ * for anything the person can act on, and the underlying error otherwise.
1830
+ */
1831
+ declare const runMeetingNotes: (input: MeetingNotesInput, options?: RunMeetingNotesOptions) => Promise<MeetingNotesResult>;
1832
+
1833
+ /**
1834
+ * Bandit Stash: the shareable documents a signed-in person keeps (S3Api's
1835
+ * `/api/artifact` routes). The base URL is the host's `fileStorageApiUrl`
1836
+ * package setting (the S3Api base including `/api`, the same one knowledge
1837
+ * uploads use); a host without it has no Stash and callers stay quiet about it.
1838
+ *
1839
+ * Writes go under a per-owner prefix the server derives from the token, so a
1840
+ * document is private to the person (or to their team with `scope: "team"`).
1841
+ * A share link is a separate, expiring, revocable token minted on request.
1842
+ */
1843
+ interface StashSaveResult {
1844
+ key: string;
1845
+ /** The owner's own URL for the object (needs the session token). */
1846
+ url?: string;
1847
+ size?: number;
1848
+ }
1849
+ interface StashShareLink {
1850
+ url: string;
1851
+ token?: string;
1852
+ expiresAt?: string;
1853
+ }
1854
+ declare class StashError extends Error {
1855
+ readonly status?: number | undefined;
1856
+ constructor(message: string, status?: number | undefined);
1857
+ }
1858
+ /** True when there is a Stash to write to and a session to write as. */
1859
+ declare const stashAvailable: () => boolean;
1860
+ /**
1861
+ * Save a document to Stash. The server names the object after `name` (a
1862
+ * sanitized copy after an unguessable id), so the Stash page shows a real name.
1863
+ */
1864
+ declare const saveToStash: (args: {
1865
+ name: string;
1866
+ content: string | Blob;
1867
+ contentType: string;
1868
+ scope?: "private" | "team";
1869
+ signal?: AbortSignal;
1870
+ }) => Promise<StashSaveResult>;
1871
+ /**
1872
+ * Mint a share link for one of the caller's Stash documents. Anyone with the
1873
+ * link can read it until it expires (the server's default, seven days, unless
1874
+ * `expiryMinutes` says otherwise) or the owner revokes it in Stash.
1875
+ */
1876
+ declare const createStashShareLink: (args: {
1877
+ key: string;
1878
+ expiryMinutes?: number;
1879
+ signal?: AbortSignal;
1880
+ }) => Promise<StashShareLink>;
1881
+
1882
+ export { AIMessage, AUTH_TOKEN_CHANGED_EVENT, type ActionItem, type AuthSessionConfig, type AuthSessionHandlers, Chat, type CreateMemoryOptions, DebugLogger, FeatureEvaluation, FeatureFlagConfig, FeatureFlagContext, type FeatureFlagContextValue, FeatureFlagProvider, type FeatureFlagProviderProps, FeatureFlagService, FeatureKey, FeedbackButton, type FeedbackButtonProps, type FeedbackCategories, FeedbackModal, type FeedbackModalProps, type FeedbackPriorities, type FeedbackRequest, type FeedbackResponse, type FileUploadResult, type GatewayQueryOptions, InterestsEditor, type JwtClaims, type LogContext, MANAGEMENT_SECTIONS, MAX_RECORDING_BYTES, MAX_RECORDING_SECONDS, Management, type ManagementAccess, type ManagementAccessInput, type ManagementLink, type ManagementProps, type ManagementRequest, type ManagementSectionDef, type ManagementSectionId, type MeetingNotes, type ChatFn as MeetingNotesChatFn, MeetingNotesError, type MeetingNotesInput, type MeetingNotesProgress, type MeetingNotesResult, type MeetingNotesSource, type MeetingNotesStage, type MemorySearchFilters, type MigrationProgress, type MigrationStatus, type NotesMeta, type NotificationConfig, type NotificationContextType, NotificationProvider, type NotificationProviderProps, NotificationService, type ParsedTranscript, CHUNK_SECONDS as RECORDING_CHUNK_SECONDS, type RecordingTranscript, type RunMeetingNotesOptions, SYSTEM_FLAGS, type SearchOptions, type SearchResult, SpeechToTextError, StashError, type StashSaveResult, type StashShareLink, StreamingTTSClient, SubscriptionExpiredGuard, type SubscriptionExpiredGuardProps, SubscriptionExpiredModal, type SubscriptionExpiredModalProps, SubscriptionTier, TOKEN_KEY, type TTSOptions, type TTSProgress, TTSState, type TokenPersistence, type TokenStorageMode, type TranscriptFormat, type TranscriptSegment, TrialUsage, type UploadRequest, type UseTTSReturn, VectorDatabaseService, type VectorDocument, type VectorMemory, type VectorMemoryMetadata, VectorMigrationService, type VectorStoreStatus, type VoiceState, authenticationService, chunkTranscript, createStashShareLink, debugLogger, defineCustomElement, describeMeetingInput, featureFlagService, generateMeetingNotes, getCriticalConfig, getFeatureMatrix, getStreamingTTSClient, getSystemConstants, getTTSState, handleHttpError, handleSubscriptionUpgrade, handleValidationError, initializeCoreSystem, isMeetingFile, isRecordingFile, isTranscriptFileName, isWorkspaceAdminRole, looksLikeTranscript, meetingNotesErrorMessage, notesToHtml, notesToMarkdown, notificationService, parseNotesJson, parseTranscript, pauseTTS, previewTierUpgrade, resolveManagementSections, resumeTTS, runMeetingNotes, saveToStash, showInfoNotification, showSuccessNotification, speakStream as speakWithStreaming, stashAvailable, stopTTS, syncSubscriptionWithAPI, transcribeRecording, transcriptToText, updateSubscriptionTier, useFeatureFlag, useFeatureVisibility, useFeatures, useGatewayHealth, useGatewayMemory, useGatewayModels, useGlobalTTS, useManagementAccess, useNotification, useNotificationService, useTTS, useVectorStore, useVoiceStore, useVoices, validateEnvironment, validateSystemIntegrity, vectorDatabaseService, vectorMigrationService };