@sutrata/editor 0.1.2 → 0.2.0

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 (118) hide show
  1. package/dist/ai/VoiceConfirmDialog.d.ts +1 -0
  2. package/dist/ai/VoiceConfirmDialog.js +6 -6
  3. package/dist/ai/VoiceToolbar.d.ts +1 -0
  4. package/dist/ai/VoiceToolbar.js +22 -16
  5. package/dist/ai/clean-response.d.ts +7 -0
  6. package/dist/ai/clean-response.js +58 -0
  7. package/dist/ai/format-transcript.d.ts +3 -0
  8. package/dist/ai/format-transcript.js +7 -0
  9. package/dist/ai/prompts.d.ts +8 -1
  10. package/dist/ai/prompts.js +34 -7
  11. package/dist/autocomplete/suggestions.js +1 -1
  12. package/dist/context/DocumentContext.d.ts +28 -4
  13. package/dist/context/DocumentContext.js +67 -37
  14. package/dist/editor/EditorView.js +32 -4
  15. package/dist/editor/SelectionMenu.js +5 -3
  16. package/dist/editor/external-decorations-plugin.d.ts +23 -0
  17. package/dist/editor/external-decorations-plugin.js +151 -0
  18. package/dist/editor/omitted-scene-plugin.d.ts +9 -0
  19. package/dist/editor/omitted-scene-plugin.js +44 -0
  20. package/dist/editor/plugins.js +4 -0
  21. package/dist/editor/private-metadata-plugin.d.ts +10 -0
  22. package/dist/editor/private-metadata-plugin.js +60 -0
  23. package/dist/editor/prosemirror-to-sutra.js +179 -74
  24. package/dist/editor/scene-heading-view.js +2 -0
  25. package/dist/editor/schema.js +69 -12
  26. package/dist/editor/sutra-to-prosemirror.d.ts +2 -0
  27. package/dist/editor/sutra-to-prosemirror.js +32 -34
  28. package/dist/extensions/ai-provider.d.ts +44 -0
  29. package/dist/extensions/ai-provider.js +27 -0
  30. package/dist/extensions/collab.d.ts +21 -0
  31. package/dist/extensions/collab.js +6 -0
  32. package/dist/extensions/command-registry.d.ts +49 -0
  33. package/dist/extensions/command-registry.js +28 -0
  34. package/dist/extensions/decorations.d.ts +48 -0
  35. package/dist/extensions/decorations.js +6 -0
  36. package/dist/extensions/export-registry.d.ts +59 -0
  37. package/dist/extensions/export-registry.js +10 -0
  38. package/dist/extensions/panel-registry.d.ts +30 -0
  39. package/dist/extensions/panel-registry.js +16 -0
  40. package/dist/extensions/registries.d.ts +15 -0
  41. package/dist/extensions/registries.js +12 -0
  42. package/dist/extensions/registry-store.d.ts +26 -0
  43. package/dist/extensions/registry-store.js +35 -0
  44. package/dist/extensions/session.d.ts +29 -0
  45. package/dist/extensions/session.js +20 -0
  46. package/dist/extensions/speech-provider.d.ts +35 -0
  47. package/dist/extensions/speech-provider.js +17 -0
  48. package/dist/file/builtin-exporters.d.ts +9 -0
  49. package/dist/file/builtin-exporters.js +72 -0
  50. package/dist/file/docx-exporter.js +7 -4
  51. package/dist/file/docx-importer.d.ts +9 -0
  52. package/dist/file/docx-importer.js +47 -19
  53. package/dist/file/scene-number.d.ts +5 -0
  54. package/dist/file/scene-number.js +8 -0
  55. package/dist/file/workflow-reports.js +13 -7
  56. package/dist/findreplace/FindReplace.js +5 -2
  57. package/dist/import/AIImportDialog.d.ts +11 -0
  58. package/dist/import/AIImportDialog.js +112 -0
  59. package/dist/import/ai-import.d.ts +51 -0
  60. package/dist/import/ai-import.js +200 -0
  61. package/dist/import/apply-import.d.ts +7 -0
  62. package/dist/import/apply-import.js +35 -0
  63. package/dist/import/extract.d.ts +17 -0
  64. package/dist/import/extract.js +18 -0
  65. package/dist/index.d.ts +17 -2
  66. package/dist/index.js +7 -0
  67. package/dist/locales/bn.json +8 -0
  68. package/dist/locales/en.json +8 -0
  69. package/dist/locales/gu.json +8 -0
  70. package/dist/locales/hi.json +8 -0
  71. package/dist/locales/kn.json +8 -0
  72. package/dist/locales/ml.json +8 -0
  73. package/dist/locales/mr.json +8 -0
  74. package/dist/locales/or.json +8 -0
  75. package/dist/locales/pa.json +8 -0
  76. package/dist/locales/si.json +8 -0
  77. package/dist/locales/ta.json +8 -0
  78. package/dist/locales/te.json +8 -0
  79. package/dist/navigator/SceneNavigator.js +125 -131
  80. package/dist/navigator/StatisticsDialog.js +5 -1
  81. package/dist/navigator/scene-edits.d.ts +18 -0
  82. package/dist/navigator/scene-edits.js +143 -0
  83. package/dist/navigator/scene-list.js +4 -4
  84. package/dist/navigator/scene-numbering.d.ts +37 -0
  85. package/dist/navigator/scene-numbering.js +88 -0
  86. package/dist/settings/SettingsDialog.js +8 -120
  87. package/dist/shell/AppBar.js +21 -2
  88. package/dist/shell/AppShell.js +18 -4
  89. package/dist/shell/ElementToolbar.d.ts +5 -0
  90. package/dist/shell/ElementToolbar.js +35 -25
  91. package/dist/shell/LanguageStatus.js +6 -0
  92. package/dist/shell/StatusBar.js +11 -6
  93. package/dist/shell/builtin-commands.d.ts +10 -0
  94. package/dist/shell/builtin-commands.js +43 -0
  95. package/dist/shell/icons.d.ts +6 -0
  96. package/dist/shell/icons.js +6 -0
  97. package/dist/shell/use-commands.d.ts +7 -0
  98. package/dist/shell/use-commands.js +24 -0
  99. package/dist/shell/use-panel-context.d.ts +3 -0
  100. package/dist/shell/use-panel-context.js +39 -0
  101. package/dist/source/SourceView.js +18 -1
  102. package/dist/styles/screenplay.css +113 -1
  103. package/dist/titlepage/ExportDialog.d.ts +5 -0
  104. package/dist/titlepage/ExportDialog.js +59 -96
  105. package/package.json +4 -4
  106. package/dist/ai/OnboardingDialog.d.ts +0 -6
  107. package/dist/ai/OnboardingDialog.js +0 -115
  108. package/dist/ai/ai-client.d.ts +0 -71
  109. package/dist/ai/ai-client.js +0 -494
  110. package/dist/ai/generated-providers.json +0 -3696
  111. package/dist/ai/voice-service.d.ts +0 -15
  112. package/dist/ai/voice-service.js +0 -81
  113. package/dist/editor/character-view.d.ts +0 -35
  114. package/dist/editor/character-view.js +0 -112
  115. package/dist/editor/transliterate-input.d.ts +0 -10
  116. package/dist/editor/transliterate-input.js +0 -88
  117. package/dist/extensions/types.d.ts +0 -73
  118. package/dist/extensions/types.js +0 -12
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sutrata/editor",
3
- "version": "0.1.2",
3
+ "version": "0.2.0",
4
4
  "description": "React + ProseMirror screenplay editor for Sutra, with first-class support for Indic and other complex scripts.",
5
5
  "license": "GPL-3.0-or-later",
6
6
  "keywords": [
@@ -46,7 +46,7 @@
46
46
  "prosemirror-state": "^1.4.3",
47
47
  "prosemirror-transform": "^1.9.0",
48
48
  "prosemirror-view": "^1.33.0",
49
- "@sutrata/parser": "0.1.1"
49
+ "@sutrata/parser": "0.2.0"
50
50
  },
51
51
  "peerDependencies": {
52
52
  "react": "^18.3.0",
@@ -59,6 +59,7 @@
59
59
  "@types/react": "^18.3.0",
60
60
  "@types/react-dom": "^18.3.0",
61
61
  "@vitejs/plugin-react": "^4.3.0",
62
+ "fast-check": "^4.10.2",
62
63
  "jsdom": "^29.1.1",
63
64
  "react": "^18.3.0",
64
65
  "react-dom": "^18.3.0",
@@ -66,8 +67,7 @@
66
67
  "vitest": "^1.6.0"
67
68
  },
68
69
  "scripts": {
69
- "build": "node scripts/generate-providers.mjs && tsc && node scripts/copy-assets.mjs",
70
- "generate:providers": "node scripts/generate-providers.mjs",
70
+ "build": "node -e \"require('fs').rmSync('dist', { recursive: true, force: true })\" && tsc && node scripts/copy-assets.mjs",
71
71
  "test": "vitest run",
72
72
  "test:watch": "vitest"
73
73
  }
@@ -1,6 +0,0 @@
1
- import React from 'react';
2
- interface Props {
3
- onClose: () => void;
4
- }
5
- export declare function OnboardingDialog({ onClose }: Props): React.JSX.Element;
6
- export {};
@@ -1,115 +0,0 @@
1
- import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
- import { useState, useEffect, useRef } from 'react';
3
- import { getApiKey, setApiKey, deleteApiKey, getAIConfig, saveAIConfig, fetchProviders, testConnection, listModels } from './ai-client';
4
- import { SparklesIcon } from '../shell/icons';
5
- export function OnboardingDialog({ onClose }) {
6
- const [activeTab, setActiveTab] = useState('intro');
7
- const [providers, setProviders] = useState([]);
8
- const [providerId, setProviderId] = useState('anthropic');
9
- const [keyInput, setKeyInput] = useState('');
10
- const [showKey, setShowKey] = useState(false);
11
- const [testStatus, setTestStatus] = useState('idle');
12
- const [testError, setTestError] = useState('');
13
- const [config, setConfig] = useState(getAIConfig);
14
- // Custom provider state
15
- const [customId, setCustomId] = useState('');
16
- const [customName, setCustomName] = useState('');
17
- const [customBaseUrl, setCustomBaseUrl] = useState('');
18
- const [customModels, setCustomModels] = useState('');
19
- const dialogRef = useRef(null);
20
- useEffect(() => {
21
- void fetchProviders(config).then(setProviders);
22
- // eslint-disable-next-line react-hooks/exhaustive-deps
23
- }, [config.customProviders]);
24
- useEffect(() => {
25
- dialogRef.current?.focus();
26
- void loadKeyForProvider(providerId);
27
- }, [providerId]);
28
- const loadKeyForProvider = async (pid) => {
29
- setTestStatus('idle');
30
- setTestError('');
31
- const key = await getApiKey(pid);
32
- setKeyInput(key || '');
33
- };
34
- const handleTestKey = async () => {
35
- if (!keyInput.trim()) {
36
- setTestStatus('error');
37
- setTestError('Please enter an API key to test.');
38
- return;
39
- }
40
- setTestStatus('testing');
41
- setTestError('');
42
- try {
43
- const ok = await testConnection(providerId, keyInput.trim(), config);
44
- if (ok) {
45
- setTestStatus('success');
46
- }
47
- else {
48
- setTestStatus('error');
49
- setTestError('Connection failed: empty or invalid response from endpoint.');
50
- }
51
- }
52
- catch (e) {
53
- setTestStatus('error');
54
- setTestError(e.message || String(e));
55
- }
56
- };
57
- const handleSaveKey = async () => {
58
- const trimmed = keyInput.trim();
59
- if (trimmed) {
60
- await setApiKey(providerId, trimmed);
61
- const provider = providers.find(p => p.id === providerId);
62
- let preferredModel = provider?.models[0]?.id || '';
63
- if (provider) {
64
- const liveModels = await listModels(provider, trimmed);
65
- preferredModel = liveModels[0]?.id || preferredModel;
66
- }
67
- const updated = { ...config, preferredProvider: providerId, preferredModel };
68
- setConfig(updated);
69
- saveAIConfig(updated);
70
- setTestStatus('success');
71
- }
72
- else {
73
- await deleteApiKey(providerId);
74
- setTestStatus('idle');
75
- }
76
- };
77
- const handleAddCustomProvider = () => {
78
- if (!customId || !customName || !customBaseUrl || !customModels) {
79
- alert('Please fill out all custom provider fields.');
80
- return;
81
- }
82
- const modelsList = customModels.split(',').map(m => {
83
- const parts = m.trim().split(':');
84
- const id = parts[0]?.trim() || '';
85
- const name = parts[1]?.trim() || id;
86
- return { id, name };
87
- }).filter(m => m.id);
88
- const newCustom = {
89
- id: customId.trim().toLowerCase(),
90
- name: customName.trim(),
91
- baseUrl: customBaseUrl.trim(),
92
- models: modelsList,
93
- };
94
- const updated = { ...config };
95
- const index = updated.customProviders.findIndex(p => p.id === newCustom.id);
96
- if (index >= 0) {
97
- updated.customProviders[index] = newCustom;
98
- }
99
- else {
100
- updated.customProviders.push(newCustom);
101
- }
102
- setConfig(updated);
103
- saveAIConfig(updated);
104
- setCustomId('');
105
- setCustomName('');
106
- setCustomBaseUrl('');
107
- setCustomModels('');
108
- alert(`Custom provider "${newCustom.name}" added. You can now configure its key in the API Keys tab.`);
109
- };
110
- const handleFinish = () => {
111
- localStorage.setItem('sutrata_onboarding_completed', 'true');
112
- onClose();
113
- };
114
- return (_jsx("div", { className: "cs-dialog-overlay", onClick: onClose, style: { zIndex: 300 }, children: _jsxs("div", { ref: dialogRef, className: "cs-dialog cs-onboarding-dialog", role: "dialog", "aria-modal": "true", "aria-label": "Intelligence Setup", onClick: e => e.stopPropagation(), tabIndex: -1, children: [_jsxs("div", { className: "cs-dialog-header", children: [_jsxs("div", { style: { display: 'flex', alignItems: 'center', gap: '8px' }, children: [_jsx(SparklesIcon, { size: 16 }), _jsx("span", { className: "cs-dialog-title", children: "Intelligence & Dictation Setup" })] }), _jsx("button", { type: "button", className: "cs-fr-close", onClick: onClose, "aria-label": "Close", children: "\u00D7" })] }), _jsxs("div", { className: "cs-tabs-header", children: [_jsx("button", { type: "button", className: `cs-tab-btn ${activeTab === 'intro' ? 'active' : ''}`, onClick: () => setActiveTab('intro'), children: "Overview" }), _jsx("button", { type: "button", className: `cs-tab-btn ${activeTab === 'keys' ? 'active' : ''}`, onClick: () => setActiveTab('keys'), children: "API Keys" }), _jsx("button", { type: "button", className: `cs-tab-btn ${activeTab === 'custom' ? 'active' : ''}`, onClick: () => setActiveTab('custom'), children: "Custom Endpoints" })] }), _jsxs("div", { className: "cs-onboarding-body", children: [activeTab === 'intro' && (_jsxs("div", { className: "cs-onboarding-section", children: [_jsx("h3", { className: "cs-onboarding-h3", children: "Client-Side AI Formatting & Voice" }), _jsx("p", { className: "cs-onboarding-desc", children: "Sutrata connects directly from your device to high-performance inference APIs. Your screenplays and audio transcripts are processed strictly with your own API credentials." }), _jsxs("div", { className: "cs-onboarding-card", children: [_jsxs("div", { className: "cs-onboarding-step", children: [_jsx("div", { className: "cs-onboarding-step-num", children: "1" }), _jsxs("div", { children: [_jsx("strong", { children: "Get a Free-Tier Key:" }), " Obtain a free API key from Google AI Studio (Gemini/Gemma) or Groq (Llama 3.3)."] })] }), _jsxs("div", { className: "cs-onboarding-step", children: [_jsx("div", { className: "cs-onboarding-step-num", children: "2" }), _jsxs("div", { children: [_jsx("strong", { children: "Enter Your Key:" }), " Save the key in the API Keys tab. It is encrypted in your local OS keyring or stored securely in your browser session."] })] }), _jsxs("div", { className: "cs-onboarding-step", children: [_jsx("div", { className: "cs-onboarding-step-num", children: "3" }), _jsxs("div", { children: [_jsx("strong", { children: "Start Dictating:" }), " Speak naturally into Sutrata; the formatting engine parses characters, dialogue, and scenes automatically."] })] })] }), _jsx("div", { className: "cs-dialog-actions", style: { display: 'flex', justifyContent: 'flex-end', marginTop: '16px' }, children: _jsx("button", { type: "button", className: "cs-voice-btn-primary", onClick: () => setActiveTab('keys'), children: "Configure API Keys \u2192" }) })] })), activeTab === 'keys' && (_jsxs("div", { className: "cs-onboarding-section", children: [_jsxs("div", { className: "cs-settings-row", style: { marginBottom: '12px' }, children: [_jsx("label", { className: "cs-settings-label", htmlFor: "cs-ob-provider", children: "Active Provider:" }), _jsx("select", { id: "cs-ob-provider", className: "cs-settings-select", value: providerId, onChange: e => setProviderId(e.target.value), children: providers.map(p => (_jsx("option", { value: p.id, children: p.name }, p.id))) })] }), _jsxs("div", { style: { display: 'flex', flexDirection: 'column', gap: '6px', marginBottom: '16px' }, children: [_jsxs("label", { className: "cs-settings-label", htmlFor: "cs-ob-key", children: ["API Key for ", providerId, ":"] }), _jsxs("div", { style: { display: 'flex', gap: '8px' }, children: [_jsx("input", { id: "cs-ob-key", type: showKey ? 'text' : 'password', className: "cs-voice-textarea", style: { flex: 1, minHeight: '34px', padding: '6px 10px', height: '34px' }, value: keyInput, onChange: e => setKeyInput(e.target.value), placeholder: `Enter ${providerId} API key...` }), _jsx("button", { type: "button", className: "cs-voice-btn-ghost", onClick: () => setShowKey(!showKey), style: { padding: '0 10px', height: '34px' }, children: showKey ? 'Hide' : 'Show' })] })] }), _jsxs("div", { style: { display: 'flex', gap: '8px', alignItems: 'center', marginBottom: '16px' }, children: [_jsx("button", { type: "button", className: "cs-voice-btn-primary", onClick: handleSaveKey, children: "Save Key" }), _jsx("button", { type: "button", className: "cs-voice-btn-secondary", onClick: handleTestKey, disabled: testStatus === 'testing', children: testStatus === 'testing' ? 'Testing...' : 'Test Connection' }), testStatus === 'success' && (_jsx("span", { style: { color: '#10b981', fontSize: '13px', fontWeight: 500 }, children: "\u2713 Verified connection" })), testStatus === 'error' && (_jsx("span", { style: { color: '#ef4444', fontSize: '12px' }, children: testError }))] }), _jsxs("div", { className: "cs-dialog-actions", style: { display: 'flex', justifyContent: 'space-between', marginTop: '20px' }, children: [_jsx("button", { type: "button", className: "cs-voice-btn-ghost", onClick: () => setActiveTab('intro'), children: "\u2190 Back" }), _jsx("button", { type: "button", className: "cs-voice-btn-primary", onClick: handleFinish, children: "Done & Close" })] })] })), activeTab === 'custom' && (_jsxs("div", { className: "cs-onboarding-section", children: [_jsx("p", { className: "cs-onboarding-desc", children: "Connect to local OpenAI-compatible endpoints such as Ollama, vLLM, or LM Studio." }), _jsxs("div", { style: { display: 'flex', flexDirection: 'column', gap: '10px', marginBottom: '16px' }, children: [_jsxs("div", { children: [_jsx("label", { className: "cs-settings-label", htmlFor: "cs-ob-custom-id", children: "Provider ID (e.g. ollama):" }), _jsx("input", { id: "cs-ob-custom-id", type: "text", className: "cs-voice-textarea", style: { width: '100%', height: '34px', minHeight: '34px', padding: '6px 10px' }, value: customId, onChange: e => setCustomId(e.target.value), placeholder: "ollama" })] }), _jsxs("div", { children: [_jsx("label", { className: "cs-settings-label", htmlFor: "cs-ob-custom-name", children: "Display Name:" }), _jsx("input", { id: "cs-ob-custom-name", type: "text", className: "cs-voice-textarea", style: { width: '100%', height: '34px', minHeight: '34px', padding: '6px 10px' }, value: customName, onChange: e => setCustomName(e.target.value), placeholder: "Local Ollama" })] }), _jsxs("div", { children: [_jsx("label", { className: "cs-settings-label", htmlFor: "cs-ob-custom-url", children: "Base URL:" }), _jsx("input", { id: "cs-ob-custom-url", type: "text", className: "cs-voice-textarea", style: { width: '100%', height: '34px', minHeight: '34px', padding: '6px 10px' }, value: customBaseUrl, onChange: e => setCustomBaseUrl(e.target.value), placeholder: "http://localhost:11434/v1" })] }), _jsxs("div", { children: [_jsx("label", { className: "cs-settings-label", htmlFor: "cs-ob-custom-models", children: "Models (id:name comma-separated):" }), _jsx("input", { id: "cs-ob-custom-models", type: "text", className: "cs-voice-textarea", style: { width: '100%', height: '34px', minHeight: '34px', padding: '6px 10px' }, value: customModels, onChange: e => setCustomModels(e.target.value), placeholder: "llama3:Llama 3, mistral:Mistral 7B" })] })] }), _jsxs("div", { style: { display: 'flex', justifyContent: 'space-between', marginTop: '16px' }, children: [_jsx("button", { type: "button", className: "cs-voice-btn-secondary", onClick: handleAddCustomProvider, children: "Register Endpoint" }), _jsx("button", { type: "button", className: "cs-voice-btn-primary", onClick: () => setActiveTab('keys'), children: "Go to API Keys \u2192" })] })] }))] })] }) }));
115
- }
@@ -1,71 +0,0 @@
1
- export interface AIConfig {
2
- preferredProvider: string;
3
- preferredModel: string;
4
- customProviders: CustomProvider[];
5
- }
6
- export interface CustomProvider {
7
- id: string;
8
- name: string;
9
- baseUrl: string;
10
- models: {
11
- id: string;
12
- name: string;
13
- }[];
14
- }
15
- export interface ModelConfig {
16
- id: string;
17
- name: string;
18
- }
19
- export interface ProviderConfig {
20
- id: string;
21
- name: string;
22
- baseUrl: string;
23
- models: ModelConfig[];
24
- }
25
- /** Opaque JSON Schema object — forwarded into provider request bodies and/or
26
- * embedded in the prompt text; see callAIStructured. */
27
- export type JsonSchema = Record<string, unknown>;
28
- export declare function getApiKey(provider: string): Promise<string | null>;
29
- export declare function setApiKey(provider: string, key: string): Promise<void>;
30
- export declare function deleteApiKey(provider: string): Promise<void>;
31
- export declare function getAIConfig(): AIConfig;
32
- export declare function saveAIConfig(config: AIConfig): void;
33
- export declare function fetchProviders(config?: AIConfig): Promise<ProviderConfig[]>;
34
- /**
35
- * Parses a structured AI response into T, tolerating a model that wraps the
36
- * JSON in a markdown fence or adds stray text around it despite being asked
37
- * not to (some providers don't strictly honor response_format hints).
38
- */
39
- export declare function extractJson<T>(raw: string): T;
40
- export declare function cleanVoiceResponse(text: string): string;
41
- export declare function subscribeToAICalls(callback: (calls: {
42
- providerName: string;
43
- model: string;
44
- }[]) => void): () => void;
45
- export declare function formatActiveCalls(calls: {
46
- providerName: string;
47
- model: string;
48
- }[]): string;
49
- export declare function callAI(prompt: string, systemPrompt: string, config: AIConfig, options?: {
50
- clean?: 'voice';
51
- }): Promise<string>;
52
- /**
53
- * Like callAI, but requests and validates a JSON response matching `schema`
54
- * instead of returning free text — the explicit contract that replaced
55
- * sniffing the system prompt for keywords like "duration"/"synopsis".
56
- */
57
- export declare function callAIStructured<T = unknown>(prompt: string, systemPrompt: string, config: AIConfig, schema: JsonSchema): Promise<T>;
58
- /** Any provider (from the fetched + custom list) with a stored API key. */
59
- export declare function hasConfiguredApiKey(config: AIConfig): Promise<boolean>;
60
- /**
61
- * Fetches the provider's live model list so Settings/Onboarding show
62
- * current models instead of a potentially stale static one. Never throws —
63
- * falls back to `provider.models` on any error (missing endpoint, bad key,
64
- * network failure), since this is a progressive enhancement.
65
- */
66
- export declare function listModels(provider: ProviderConfig, apiKey: string): Promise<ModelConfig[]>;
67
- export declare function testConnection(providerId: string, apiKey: string, config: AIConfig): Promise<boolean>;
68
- export declare function mockActiveCallsList(calls: {
69
- providerName: string;
70
- model: string;
71
- }[]): void;