@admin-layout/demo-perplexity-browser 12.2.4-alpha.1 → 12.2.4-alpha.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/lib/api/index.d.ts +2 -0
- package/lib/api/index.d.ts.map +1 -0
- package/lib/api/llm.d.ts +34 -0
- package/lib/api/llm.d.ts.map +1 -0
- package/lib/api/llm.js +200 -0
- package/lib/api/llm.js.map +1 -0
- package/lib/api/stt.d.ts +21 -0
- package/lib/api/stt.d.ts.map +1 -0
- package/lib/api/stt.js +111 -0
- package/lib/api/stt.js.map +1 -0
- package/lib/components/AttachmentPreview.d.ts +10 -0
- package/lib/components/AttachmentPreview.d.ts.map +1 -0
- package/lib/components/AttachmentPreview.js +50 -0
- package/lib/components/AttachmentPreview.js.map +1 -0
- package/lib/components/AudioRecorder.d.ts +8 -0
- package/lib/components/AudioRecorder.d.ts.map +1 -0
- package/lib/components/AudioRecorder.js +221 -0
- package/lib/components/AudioRecorder.js.map +1 -0
- package/lib/components/AudioVisualizer.d.ts +7 -0
- package/lib/components/AudioVisualizer.d.ts.map +1 -0
- package/lib/components/AudioVisualizer.js +116 -0
- package/lib/components/AudioVisualizer.js.map +1 -0
- package/lib/components/ChatFiles.d.ts +8 -0
- package/lib/components/ChatFiles.d.ts.map +1 -0
- package/lib/components/ChatFiles.js +76 -0
- package/lib/components/ChatFiles.js.map +1 -0
- package/lib/components/ChatScreenshot.d.ts +7 -0
- package/lib/components/ChatScreenshot.d.ts.map +1 -0
- package/lib/components/ChatScreenshot.js +113 -0
- package/lib/components/ChatScreenshot.js.map +1 -0
- package/lib/components/SearchBar.d.ts +9 -1
- package/lib/components/SearchBar.d.ts.map +1 -1
- package/lib/components/SearchBar.js +176 -240
- package/lib/components/SearchBar.js.map +1 -1
- package/lib/config/constants.d.ts +108 -0
- package/lib/config/constants.d.ts.map +1 -0
- package/lib/config/constants.js +115 -0
- package/lib/config/constants.js.map +1 -0
- package/lib/config/env.d.ts +20 -0
- package/lib/config/env.d.ts.map +1 -0
- package/lib/config/env.js +22 -0
- package/lib/config/env.js.map +1 -0
- package/lib/config/index.d.ts +4 -0
- package/lib/config/index.d.ts.map +1 -0
- package/lib/config/providers.d.ts +54 -0
- package/lib/config/providers.d.ts.map +1 -0
- package/lib/config/providers.js +65 -0
- package/lib/config/providers.js.map +1 -0
- package/lib/pages/home/HomePage.d.ts +1 -3
- package/lib/pages/home/HomePage.d.ts.map +1 -1
- package/lib/pages/home/HomePage.js +232 -4
- package/lib/pages/home/HomePage.js.map +1 -1
- package/lib/platform/browser.d.ts +18 -0
- package/lib/platform/browser.d.ts.map +1 -0
- package/lib/platform/context.d.ts +76 -0
- package/lib/platform/context.d.ts.map +1 -0
- package/lib/platform/index.d.ts +25 -0
- package/lib/platform/index.d.ts.map +1 -0
- package/lib/platform/tauri.d.ts +35 -0
- package/lib/platform/tauri.d.ts.map +1 -0
- package/lib/platform/types.d.ts +164 -0
- package/lib/platform/types.d.ts.map +1 -0
- package/lib/state/chatMachine.d.ts +554 -0
- package/lib/state/chatMachine.d.ts.map +1 -0
- package/lib/state/chatMachine.js +458 -0
- package/lib/state/chatMachine.js.map +1 -0
- package/lib/state/index.d.ts +3 -0
- package/lib/state/index.d.ts.map +1 -0
- package/lib/state/useChatWithPlatform.d.ts +43 -0
- package/lib/state/useChatWithPlatform.d.ts.map +1 -0
- package/lib/types/chat.d.ts +56 -0
- package/lib/types/chat.d.ts.map +1 -0
- package/lib/types/index.d.ts +2 -0
- package/lib/types/index.d.ts.map +1 -0
- package/lib/utils/chatStorage.d.ts +25 -0
- package/lib/utils/chatStorage.d.ts.map +1 -0
- package/lib/utils/chatStorage.js +17 -0
- package/lib/utils/chatStorage.js.map +1 -0
- package/package.json +9 -5
|
@@ -0,0 +1,115 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Perplexity Demo Module Configuration
|
|
3
|
+
*/
|
|
4
|
+
// ============= Storage Keys =============
|
|
5
|
+
// ============= File Constraints =============
|
|
6
|
+
// Max number of files that can be attached to a message
|
|
7
|
+
const MAX_FILES = 6;
|
|
8
|
+
// Max file size in bytes (15MB)
|
|
9
|
+
const MAX_FILE_SIZE_BYTES = 15 * 1024 * 1024;
|
|
10
|
+
// Accepted file types
|
|
11
|
+
const ACCEPTED_FILE_TYPES = {
|
|
12
|
+
DOCUMENTS: ['.pdf', '.doc', '.docx', '.txt', '.md'],
|
|
13
|
+
IMAGES: ['.png', '.jpg', '.jpeg', '.gif', '.webp']
|
|
14
|
+
};
|
|
15
|
+
// Combined accepted file types for file input
|
|
16
|
+
const ACCEPTED_FILE_TYPES_STRING = [...ACCEPTED_FILE_TYPES.DOCUMENTS, ...ACCEPTED_FILE_TYPES.IMAGES].join(',');
|
|
17
|
+
// ============= LLM Configuration =============
|
|
18
|
+
/**
|
|
19
|
+
* Centralized LLM Provider Configuration
|
|
20
|
+
* All API endpoints, models, and provider settings
|
|
21
|
+
*/
|
|
22
|
+
const LLM_CONFIG = {
|
|
23
|
+
// API Endpoints
|
|
24
|
+
ENDPOINTS: {
|
|
25
|
+
GROQ_BASE: 'https://api.groq.com/openai/v1',
|
|
26
|
+
GROQ_STT: 'https://api.groq.com/openai/v1/audio/transcriptions',
|
|
27
|
+
OPENROUTER_BASE: 'https://openrouter.ai/api/v1',
|
|
28
|
+
TOGETHER_BASE: 'https://api.together.xyz/v1'
|
|
29
|
+
},
|
|
30
|
+
// Environment Variable Keys
|
|
31
|
+
ENV_KEYS: {
|
|
32
|
+
GROQ_API_KEY: 'GROQ_API_KEY',
|
|
33
|
+
OPENROUTER_API_KEY: 'OPENROUTER_API_KEY',
|
|
34
|
+
TOGETHER_API_KEY: 'TOGETHER_API_KEY'
|
|
35
|
+
},
|
|
36
|
+
// Models
|
|
37
|
+
MODELS: {
|
|
38
|
+
// Groq Models
|
|
39
|
+
GROQ_VISION_SCOUT: {
|
|
40
|
+
id: 'meta-llama/llama-4-scout-17b-16e-instruct',
|
|
41
|
+
name: 'Meta Llama 4 Scout 17B (Vision)',
|
|
42
|
+
contextWindow: 128000,
|
|
43
|
+
supportsVision: true,
|
|
44
|
+
description: 'Vision-capable model for image and file processing'
|
|
45
|
+
},
|
|
46
|
+
GROQ_GPT_OSS: {
|
|
47
|
+
id: 'openai/gpt-oss-120B',
|
|
48
|
+
name: 'GPT OSS 120B',
|
|
49
|
+
contextWindow: 128000,
|
|
50
|
+
supportsVision: false,
|
|
51
|
+
description: 'Best quality text-only model'
|
|
52
|
+
},
|
|
53
|
+
// OpenRouter Models
|
|
54
|
+
OPENROUTER_LLAMA_8B: {
|
|
55
|
+
id: 'meta-llama/llama-3.1-8b-instruct:free',
|
|
56
|
+
name: 'Llama 3.1 8B (Free)',
|
|
57
|
+
contextWindow: 131072,
|
|
58
|
+
supportsVision: false,
|
|
59
|
+
description: 'Free tier model'
|
|
60
|
+
},
|
|
61
|
+
OPENROUTER_GEMMA_9B: {
|
|
62
|
+
id: 'google/gemma-2-9b-it:free',
|
|
63
|
+
name: 'Gemma 2 9B (Free)',
|
|
64
|
+
contextWindow: 8192,
|
|
65
|
+
supportsVision: false,
|
|
66
|
+
description: 'Free tier model'
|
|
67
|
+
},
|
|
68
|
+
OPENROUTER_MISTRAL_7B: {
|
|
69
|
+
id: 'mistralai/mistral-7b-instruct:free',
|
|
70
|
+
name: 'Mistral 7B (Free)',
|
|
71
|
+
contextWindow: 32768,
|
|
72
|
+
supportsVision: false,
|
|
73
|
+
description: 'Free tier model'
|
|
74
|
+
},
|
|
75
|
+
OPENROUTER_QWEN_7B: {
|
|
76
|
+
id: 'qwen/qwen-2-7b-instruct:free',
|
|
77
|
+
name: 'Qwen 2 7B (Free)',
|
|
78
|
+
contextWindow: 32768,
|
|
79
|
+
supportsVision: false,
|
|
80
|
+
description: 'Free tier model'
|
|
81
|
+
},
|
|
82
|
+
// Together.ai Models
|
|
83
|
+
TOGETHER_LLAMA_8B: {
|
|
84
|
+
id: 'meta-llama/Meta-Llama-3.1-8B-Instruct-Turbo',
|
|
85
|
+
name: 'Llama 3.1 8B Turbo',
|
|
86
|
+
contextWindow: 131072,
|
|
87
|
+
supportsVision: false,
|
|
88
|
+
description: 'Fast and efficient'
|
|
89
|
+
},
|
|
90
|
+
TOGETHER_LLAMA_70B: {
|
|
91
|
+
id: 'meta-llama/Meta-Llama-3.1-70B-Instruct-Turbo',
|
|
92
|
+
name: 'Llama 3.1 70B Turbo',
|
|
93
|
+
contextWindow: 131072,
|
|
94
|
+
supportsVision: false,
|
|
95
|
+
description: 'Best quality'
|
|
96
|
+
},
|
|
97
|
+
TOGETHER_MIXTRAL: {
|
|
98
|
+
id: 'mistralai/Mixtral-8x7B-Instruct-v0.1',
|
|
99
|
+
name: 'Mixtral 8x7B',
|
|
100
|
+
contextWindow: 32768,
|
|
101
|
+
supportsVision: false,
|
|
102
|
+
description: 'Good balance'
|
|
103
|
+
}
|
|
104
|
+
},
|
|
105
|
+
// Speech-to-Text Configuration
|
|
106
|
+
STT: {
|
|
107
|
+
MODEL: 'whisper-large-v3-turbo',
|
|
108
|
+
DEFAULT_LANGUAGE: 'en'
|
|
109
|
+
},
|
|
110
|
+
// Default Provider Configuration
|
|
111
|
+
DEFAULTS: {
|
|
112
|
+
PROVIDER_ID: 'groq',
|
|
113
|
+
MODEL_ID: 'openai/gpt-oss-120B' // Default to fast text model
|
|
114
|
+
}
|
|
115
|
+
};export{ACCEPTED_FILE_TYPES,ACCEPTED_FILE_TYPES_STRING,LLM_CONFIG,MAX_FILES,MAX_FILE_SIZE_BYTES};//# sourceMappingURL=constants.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"constants.js","sources":["../../src/config/constants.ts"],"sourcesContent":[null],"names":[],"mappings":"AAAA;;AAEG;AAEH;AAUA;AAEA;AACO,MAAM,SAAS,GAAG;AAEzB;MACa,mBAAmB,GAAG,EAAE,GAAG,IAAI,GAAG;AAE/C;AACO,MAAM,mBAAmB,GAAG;WAC/B,EAAS,CAAA,MAAG,EAAM,MAAE,EAAM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EAAA;AACA,MAAA,WAAA,EAAA;AACH,KAAA;AACD,IAAA,qBAAA,EAAA;AACI,MAAA,EAAA,EAAA,oCAAI;AACJ,MAAA,IAAA,EAAA,mBAAM;AACN,MAAA,aAAA,EAAA;AACA,MAAA,cAAA,EAAA;AACA,MAAA,WAAA,EAAA;AACH,KAAA;AACD,IAAA,kBAAA,EAAA;AACI,MAAA,EAAA,EAAA,8BAAI;AACJ,MAAA,IAAA,EAAA,kBAAM;AACN,MAAA,aAAA,EAAA;AACA,MAAA,cAAA,EAAA;AACA,MAAA,WAAA,EAAA;AACH,KAAA;;AAGD,IAAA,iBAAA,EAAA;AACI,MAAA,EAAA,EAAA,6CAAI;AACJ,MAAA,IAAA,EAAA,oBAAM;AACN,MAAA,aAAA,EAAA,MAAe;AACf,MAAA,cAAA,EAAA;AACA,MAAA,WAAA,EAAA;AACH,KAAA;AACD,IAAA,kBAAA,EAAA;AACI,MAAA,EAAA,EAAA,8CAAI;AACJ,MAAA,IAAA,EAAA,qBAAM;AACN,MAAA,aAAA,EAAA,MAAe;AACf,MAAA,cAAA,EAAA;AACA,MAAA,WAAA,EAAA;AACH,KAAA;AACD,IAAA,gBAAA,EAAA;AACI,MAAA,EAAA,EAAA,sCAAI;AACJ,MAAA,IAAA,EAAA,cAAM;AACN,MAAA,aAAA,EAAA;AACA,MAAA,cAAA,EAAA;AACA,MAAA,WAAA,EAAA;AACH;AACJ,GAAA;;AAGD,EAAA,GAAA,EAAG;AACC,IAAA,KAAA,EAAA,wBAAO;AACP,IAAA,gBAAA,EAAA;AACH,GAAA;;AAGD,EAAA,QAAA,EAAQ;AACJ,IAAA,WAAA,EAAA,MAAa;YACb,EAAA,qBAAU;AACb;"}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Environment variable access utilities for perplexity-demo module
|
|
3
|
+
* Provides access to build-time env variables
|
|
4
|
+
*/
|
|
5
|
+
/**
|
|
6
|
+
* Get environment variable from window.__ENV__ (injected at build time)
|
|
7
|
+
*/
|
|
8
|
+
export declare function getEnvVar(key: string): string | undefined;
|
|
9
|
+
/**
|
|
10
|
+
* Get API key from environment variable
|
|
11
|
+
*
|
|
12
|
+
* @param envKey - The environment variable name (e.g., 'GROQ_API_KEY')
|
|
13
|
+
* @returns The API key or empty string if not found
|
|
14
|
+
*/
|
|
15
|
+
export declare function getApiKey(envKey: string): string;
|
|
16
|
+
/**
|
|
17
|
+
* Check if API key is available
|
|
18
|
+
*/
|
|
19
|
+
export declare function hasApiKey(envKey: string): boolean;
|
|
20
|
+
//# sourceMappingURL=env.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"env.d.ts","sourceRoot":"","sources":["../../src/config/env.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH;;GAEG;AACH,wBAAgB,SAAS,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,GAAG,SAAS,CAKzD;AAED;;;;;GAKG;AACH,wBAAgB,SAAS,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,CAEhD;AAED;;GAEG;AACH,wBAAgB,SAAS,CAAC,MAAM,EAAE,MAAM,GAAG,OAAO,CAEjD"}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Environment variable access utilities for perplexity-demo module
|
|
3
|
+
* Provides access to build-time env variables
|
|
4
|
+
*/
|
|
5
|
+
/**
|
|
6
|
+
* Get environment variable from window.__ENV__ (injected at build time)
|
|
7
|
+
*/
|
|
8
|
+
function getEnvVar(key) {
|
|
9
|
+
if (typeof window !== 'undefined') {
|
|
10
|
+
return window.__ENV__?.[key];
|
|
11
|
+
}
|
|
12
|
+
return undefined;
|
|
13
|
+
}
|
|
14
|
+
/**
|
|
15
|
+
* Get API key from environment variable
|
|
16
|
+
*
|
|
17
|
+
* @param envKey - The environment variable name (e.g., 'GROQ_API_KEY')
|
|
18
|
+
* @returns The API key or empty string if not found
|
|
19
|
+
*/
|
|
20
|
+
function getApiKey(envKey) {
|
|
21
|
+
return getEnvVar(envKey) || '';
|
|
22
|
+
}export{getApiKey,getEnvVar};//# sourceMappingURL=env.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"env.js","sources":["../../src/config/env.ts"],"sourcesContent":[null],"names":[],"mappings":"AAAA;;;AAGG;AAEH;;AAEG;AACG,SAAU,SAAS,CAAC,GAAW,EAAA;AACjC,EAAA,IAAA,OAAI,MAAO,KAAM,WAAK,EAAW;AAC7B,IAAA,OAAA,cAAuB,GAAA,GAAS,CAAC;;AAErC,EAAA,OAAA;AACJ;AAEA;;;;;AAKG;AACG,SAAU,SAAS,CAAC,MAAc,EAAA;AACpC,EAAA,OAAA,gBAAiB,CAAA,IAAO,EAAI;AAChC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/config/index.ts"],"names":[],"mappings":"AAAA,cAAc,aAAa,CAAC;AAC5B,cAAc,aAAa,CAAC;AAC5B,cAAc,OAAO,CAAC"}
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
export interface LLMProvider {
|
|
2
|
+
id: string;
|
|
3
|
+
name: string;
|
|
4
|
+
baseUrl: string;
|
|
5
|
+
defaultModel: string;
|
|
6
|
+
models: LLMModel[];
|
|
7
|
+
envKey: string;
|
|
8
|
+
description?: string;
|
|
9
|
+
}
|
|
10
|
+
export interface LLMModel {
|
|
11
|
+
id: string;
|
|
12
|
+
name: string;
|
|
13
|
+
contextWindow?: number;
|
|
14
|
+
supportsVision?: boolean;
|
|
15
|
+
description?: string;
|
|
16
|
+
}
|
|
17
|
+
export interface SelectedProviderConfig {
|
|
18
|
+
providerId: string;
|
|
19
|
+
modelId: string;
|
|
20
|
+
}
|
|
21
|
+
export declare const DEFAULT_PROVIDERS: LLMProvider[];
|
|
22
|
+
/**
|
|
23
|
+
* Get all available providers
|
|
24
|
+
*/
|
|
25
|
+
export declare function getAllProviders(): LLMProvider[];
|
|
26
|
+
/**
|
|
27
|
+
* Get a specific provider by ID
|
|
28
|
+
*/
|
|
29
|
+
export declare function getProviderById(providerId: string): LLMProvider | undefined;
|
|
30
|
+
/**
|
|
31
|
+
* Get the default provider configuration (Groq with vision model)
|
|
32
|
+
*/
|
|
33
|
+
export declare function getSelectedProviderConfig(): SelectedProviderConfig;
|
|
34
|
+
/**
|
|
35
|
+
* Get the API key for a specific provider from env
|
|
36
|
+
*/
|
|
37
|
+
export declare function getProviderApiKey(providerId: string): string;
|
|
38
|
+
/**
|
|
39
|
+
* Check if a provider has a valid API key configured
|
|
40
|
+
*/
|
|
41
|
+
export declare function isProviderConfigured(providerId: string): boolean;
|
|
42
|
+
/**
|
|
43
|
+
* Get the default provider (Groq) with its API key from env
|
|
44
|
+
*/
|
|
45
|
+
export declare function getCurrentProviderWithKey(): {
|
|
46
|
+
provider: LLMProvider;
|
|
47
|
+
model: LLMModel;
|
|
48
|
+
apiKey: string;
|
|
49
|
+
} | null;
|
|
50
|
+
/**
|
|
51
|
+
* Get list of providers that have API keys configured in env
|
|
52
|
+
*/
|
|
53
|
+
export declare function getConfiguredProviders(): LLMProvider[];
|
|
54
|
+
//# sourceMappingURL=providers.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"providers.d.ts","sourceRoot":"","sources":["../../src/config/providers.ts"],"names":[],"mappings":"AAGA,MAAM,WAAW,WAAW;IACxB,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,EAAE,MAAM,CAAC;IAChB,YAAY,EAAE,MAAM,CAAC;IACrB,MAAM,EAAE,QAAQ,EAAE,CAAC;IACnB,MAAM,EAAE,MAAM,CAAC;IACf,WAAW,CAAC,EAAE,MAAM,CAAC;CACxB;AAED,MAAM,WAAW,QAAQ;IACrB,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,MAAM,CAAC;IACb,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,cAAc,CAAC,EAAE,OAAO,CAAC;IACzB,WAAW,CAAC,EAAE,MAAM,CAAC;CACxB;AAED,MAAM,WAAW,sBAAsB;IACnC,UAAU,EAAE,MAAM,CAAC;IACnB,OAAO,EAAE,MAAM,CAAC;CACnB;AAID,eAAO,MAAM,iBAAiB,EAAE,WAAW,EAqC1C,CAAC;AAIF;;GAEG;AACH,wBAAgB,eAAe,IAAI,WAAW,EAAE,CAE/C;AAED;;GAEG;AACH,wBAAgB,eAAe,CAAC,UAAU,EAAE,MAAM,GAAG,WAAW,GAAG,SAAS,CAE3E;AAED;;GAEG;AACH,wBAAgB,yBAAyB,IAAI,sBAAsB,CAMlE;AAED;;GAEG;AACH,wBAAgB,iBAAiB,CAAC,UAAU,EAAE,MAAM,GAAG,MAAM,CAK5D;AAED;;GAEG;AACH,wBAAgB,oBAAoB,CAAC,UAAU,EAAE,MAAM,GAAG,OAAO,CAEhE;AAED;;GAEG;AACH,wBAAgB,yBAAyB,IAAI;IACzC,QAAQ,EAAE,WAAW,CAAC;IACtB,KAAK,EAAE,QAAQ,CAAC;IAChB,MAAM,EAAE,MAAM,CAAC;CAClB,GAAG,IAAI,CAUP;AAED;;GAEG;AACH,wBAAgB,sBAAsB,IAAI,WAAW,EAAE,CAEtD"}
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
import {getApiKey}from'./env.js';import {LLM_CONFIG}from'./constants.js';// ============= Default Providers =============
|
|
2
|
+
const DEFAULT_PROVIDERS = [{
|
|
3
|
+
id: 'groq',
|
|
4
|
+
name: 'Groq',
|
|
5
|
+
baseUrl: LLM_CONFIG.ENDPOINTS.GROQ_BASE,
|
|
6
|
+
defaultModel: LLM_CONFIG.DEFAULTS.MODEL_ID,
|
|
7
|
+
envKey: LLM_CONFIG.ENV_KEYS.GROQ_API_KEY,
|
|
8
|
+
description: 'Fast inference with Llama models including vision support',
|
|
9
|
+
models: [LLM_CONFIG.MODELS.GROQ_VISION_SCOUT, LLM_CONFIG.MODELS.GROQ_GPT_OSS]
|
|
10
|
+
}, {
|
|
11
|
+
id: 'openrouter',
|
|
12
|
+
name: 'OpenRouter',
|
|
13
|
+
baseUrl: LLM_CONFIG.ENDPOINTS.OPENROUTER_BASE,
|
|
14
|
+
defaultModel: LLM_CONFIG.MODELS.OPENROUTER_LLAMA_8B.id,
|
|
15
|
+
envKey: LLM_CONFIG.ENV_KEYS.OPENROUTER_API_KEY,
|
|
16
|
+
description: 'Access to multiple providers with free models available',
|
|
17
|
+
models: [LLM_CONFIG.MODELS.OPENROUTER_LLAMA_8B, LLM_CONFIG.MODELS.OPENROUTER_GEMMA_9B, LLM_CONFIG.MODELS.OPENROUTER_MISTRAL_7B, LLM_CONFIG.MODELS.OPENROUTER_QWEN_7B]
|
|
18
|
+
}, {
|
|
19
|
+
id: 'together',
|
|
20
|
+
name: 'Together.ai',
|
|
21
|
+
baseUrl: LLM_CONFIG.ENDPOINTS.TOGETHER_BASE,
|
|
22
|
+
defaultModel: LLM_CONFIG.MODELS.TOGETHER_LLAMA_8B.id,
|
|
23
|
+
envKey: LLM_CONFIG.ENV_KEYS.TOGETHER_API_KEY,
|
|
24
|
+
description: 'Fast inference with various open models',
|
|
25
|
+
models: [LLM_CONFIG.MODELS.TOGETHER_LLAMA_8B, LLM_CONFIG.MODELS.TOGETHER_LLAMA_70B, LLM_CONFIG.MODELS.TOGETHER_MIXTRAL]
|
|
26
|
+
}];
|
|
27
|
+
/**
|
|
28
|
+
* Get a specific provider by ID
|
|
29
|
+
*/
|
|
30
|
+
function getProviderById(providerId) {
|
|
31
|
+
return DEFAULT_PROVIDERS.find(p => p.id === providerId);
|
|
32
|
+
}
|
|
33
|
+
/**
|
|
34
|
+
* Get the default provider configuration (Groq with vision model)
|
|
35
|
+
*/
|
|
36
|
+
function getSelectedProviderConfig() {
|
|
37
|
+
// Default to Groq with llama-4-scout-17b (vision model)
|
|
38
|
+
return {
|
|
39
|
+
providerId: LLM_CONFIG.DEFAULTS.PROVIDER_ID,
|
|
40
|
+
modelId: LLM_CONFIG.DEFAULTS.MODEL_ID
|
|
41
|
+
};
|
|
42
|
+
}
|
|
43
|
+
/**
|
|
44
|
+
* Get the API key for a specific provider from env
|
|
45
|
+
*/
|
|
46
|
+
function getProviderApiKey(providerId) {
|
|
47
|
+
const provider = getProviderById(providerId);
|
|
48
|
+
if (!provider) return '';
|
|
49
|
+
return getApiKey(provider.envKey);
|
|
50
|
+
}
|
|
51
|
+
/**
|
|
52
|
+
* Get the default provider (Groq) with its API key from env
|
|
53
|
+
*/
|
|
54
|
+
function getCurrentProviderWithKey() {
|
|
55
|
+
const config = getSelectedProviderConfig();
|
|
56
|
+
const provider = getProviderById(config.providerId);
|
|
57
|
+
if (!provider) return null;
|
|
58
|
+
const apiKey = getProviderApiKey(provider.id);
|
|
59
|
+
const model = provider.models.find(m => m.id === config.modelId) || provider.models[0];
|
|
60
|
+
return {
|
|
61
|
+
provider,
|
|
62
|
+
model,
|
|
63
|
+
apiKey
|
|
64
|
+
};
|
|
65
|
+
}export{DEFAULT_PROVIDERS,getCurrentProviderWithKey,getProviderApiKey,getProviderById,getSelectedProviderConfig};//# sourceMappingURL=providers.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"providers.js","sources":["../../src/config/providers.ts"],"sourcesContent":[null],"names":[],"mappings":"yEA0BA;AAEO,MAAM,iBAAiB,GAAkB,CAAA;AAC5C,EAAA,EAAA,EAAA,MAAA;AACI,EAAA,IAAA,EAAA,MAAI;AACJ,EAAA,OAAA,EAAA,UAAY,CAAA,SAAA,CAAA,SAAA;AACZ,EAAA,YAAA,EAAO,UAAE,CAAU,QAAC,CAAA,QAAU;AAC9B,EAAA,MAAA,EAAA,UAAY,CAAA,QAAE,CAAA,YAAoB;AAClC,EAAA,WAAA,EAAM,2DAAkC;AACxC,EAAA,MAAA,EAAA,CAAA,UAAa,CAAA,MAAA,CAAA,iBAAA,EAAA,UAAA,CAAA,MAAA,CAAA,YAAA;AACb,CAAA,EAAA;AACH,EAAA,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A;;;AAUb;AACH;AACI,kCAAiC,GAAA;AACjC,EAAA,MAAI,MAAC,GAAQ,yBAAA,EAAA;AAAE,EAAA,MAAA,WAAU,eAAA,CAAA,MAAA,CAAA,UAAA,CAAA;AAEzB,EAAA,IAAA,CAAA,iBAAiB,IAAA;AACrB,EAAC,MAAA,MAAA,GAAA,iBAAA,CAAA,QAAA,CAAA,EAAA,CAAA;AAED,EAAA,MAAA,KAAA,GAAA,QAAA,CAAA,MAAA,CAAA,IAAA,CAAA,CAAA,IAAA,CAAA,CAAA,EAAA,KAAA,MAAA,CAAA,OAAA,CAAA,IAAA,QAAA,CAAA,MAAA,CAAA,CAAA,CAAA;;AAEG,IAAA,QAAA;AACH,IAAA,KAAM;AACF,IAAA;AACJ,GAAC;AAED"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"HomePage.d.ts","sourceRoot":"","sources":["../../../src/pages/home/HomePage.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"HomePage.d.ts","sourceRoot":"","sources":["../../../src/pages/home/HomePage.tsx"],"names":[],"mappings":"AAgJA,MAAM,CAAC,OAAO,UAAU,QAAQ,4CAsH/B"}
|
|
@@ -1,6 +1,234 @@
|
|
|
1
|
-
import {jsx}from'react/jsx-runtime';import {PerplexitySearch}from'../../components/SearchBar.js';const
|
|
1
|
+
import {jsxs,jsx,Fragment}from'react/jsx-runtime';import {useMachine}from'@xstate/react';import {Trash2,Loader2,AlertCircle,RefreshCw}from'lucide-react';import {useRef,useEffect,useCallback,memo,useMemo}from'react';import {marked}from'marked';import {AttachmentPreview}from'../../components/AttachmentPreview.js';import {PerplexitySearch}from'../../components/SearchBar.js';import {chatMachine}from'../../state/chatMachine.js';import {loadChat}from'../../utils/chatStorage.js';import {cn}from'../../utils/index.js';const MessageBubble = memo(function MessageBubble({
|
|
2
|
+
role,
|
|
3
|
+
content,
|
|
4
|
+
attachments
|
|
5
|
+
}) {
|
|
6
|
+
const isUser = role === 'user';
|
|
7
|
+
const hasAttachments = attachments && attachments.length > 0;
|
|
8
|
+
// Parse markdown for assistant messages (completed messages only)
|
|
9
|
+
const htmlContent = useMemo(() => {
|
|
10
|
+
if (isUser) return null;
|
|
11
|
+
return marked.parse(content, {
|
|
12
|
+
async: false
|
|
13
|
+
});
|
|
14
|
+
}, [content, isUser]);
|
|
15
|
+
return jsxs("div", {
|
|
16
|
+
className: cn('flex gap-4', isUser ? 'justify-end' : 'justify-start'),
|
|
17
|
+
children: [!isUser && jsx("div", {
|
|
18
|
+
className: "flex-shrink-0 w-8 h-8 rounded-full bg-primary/10 flex items-center justify-center text-primary font-semibold text-xs",
|
|
19
|
+
children: "AI"
|
|
20
|
+
}), jsxs("div", {
|
|
21
|
+
className: cn('rounded-2xl px-4 py-3', isUser ? 'bg-primary text-primary-foreground' : 'bg-muted'),
|
|
22
|
+
children: [hasAttachments && jsx("div", {
|
|
23
|
+
className: "flex flex-wrap gap-2 mb-2",
|
|
24
|
+
children: attachments.map(attachment => jsx(AttachmentPreview, {
|
|
25
|
+
attachment: attachment,
|
|
26
|
+
isCancellable: false,
|
|
27
|
+
showPreview: !!attachments && attachments.length === 1 && !!attachments[0].dataUrl && attachments[0].dataUrl.startsWith('data:image/')
|
|
28
|
+
}, attachment.id))
|
|
29
|
+
}), isUser ? jsx("div", {
|
|
30
|
+
className: "text-sm whitespace-pre-wrap break-words leading-relaxed",
|
|
31
|
+
children: content
|
|
32
|
+
}) : jsx("div", {
|
|
33
|
+
className: "text-sm prose prose-sm dark:prose-invert max-w-none leading-relaxed prose-p:my-2 prose-pre:my-2 prose-ul:my-2 prose-ol:my-2",
|
|
34
|
+
dangerouslySetInnerHTML: {
|
|
35
|
+
__html: htmlContent || ''
|
|
36
|
+
}
|
|
37
|
+
})]
|
|
38
|
+
}), isUser && jsx("div", {
|
|
39
|
+
className: "flex-shrink-0 w-8 h-8 rounded-full bg-primary flex items-center justify-center text-primary-foreground font-semibold text-xs",
|
|
40
|
+
children: "You"
|
|
41
|
+
})]
|
|
42
|
+
});
|
|
43
|
+
});
|
|
44
|
+
// Using shared AttachmentPreview component for chats (isCancellable=false)
|
|
45
|
+
const StreamingMessage = memo(function StreamingMessage({
|
|
46
|
+
content
|
|
47
|
+
}) {
|
|
48
|
+
// During streaming, show plain text to avoid blocking the main thread
|
|
49
|
+
// Markdown parsing is expensive and causes UI freezes with rapid updates
|
|
50
|
+
// The final message will be parsed when it's added to the messages array
|
|
51
|
+
return jsxs("div", {
|
|
52
|
+
className: "flex gap-4 justify-start",
|
|
53
|
+
children: [jsx("div", {
|
|
54
|
+
className: "flex-shrink-0 w-8 h-8 rounded-full bg-primary/10 flex items-center justify-center text-primary font-semibold text-xs",
|
|
55
|
+
children: "AI"
|
|
56
|
+
}), jsx("div", {
|
|
57
|
+
className: "rounded-2xl px-4 py-3 bg-muted",
|
|
58
|
+
children: jsxs("div", {
|
|
59
|
+
className: "text-sm max-w-none leading-relaxed",
|
|
60
|
+
children: [jsx("div", {
|
|
61
|
+
className: "whitespace-pre-wrap break-words",
|
|
62
|
+
children: content
|
|
63
|
+
}), jsx("span", {
|
|
64
|
+
className: "inline-block w-2 h-4 bg-primary/50 ml-1 animate-pulse"
|
|
65
|
+
})]
|
|
66
|
+
})
|
|
67
|
+
})]
|
|
68
|
+
});
|
|
69
|
+
});
|
|
70
|
+
const LoadingIndicator = memo(function LoadingIndicator() {
|
|
71
|
+
return jsxs("div", {
|
|
72
|
+
className: "flex gap-4 justify-start",
|
|
73
|
+
children: [jsx("div", {
|
|
74
|
+
className: "flex-shrink-0 w-8 h-8 rounded-full bg-primary/10 flex items-center justify-center text-primary font-semibold text-xs",
|
|
75
|
+
children: "AI"
|
|
76
|
+
}), jsx("div", {
|
|
77
|
+
className: "rounded-2xl px-4 py-3 bg-muted",
|
|
78
|
+
children: jsxs("div", {
|
|
79
|
+
className: "flex items-center gap-2 text-sm text-muted-foreground",
|
|
80
|
+
children: [jsx(Loader2, {
|
|
81
|
+
className: "h-4 w-4 animate-spin"
|
|
82
|
+
}), jsx("span", {
|
|
83
|
+
children: "Thinking..."
|
|
84
|
+
})]
|
|
85
|
+
})
|
|
86
|
+
})]
|
|
87
|
+
});
|
|
88
|
+
});
|
|
89
|
+
const ErrorMessage = memo(function ErrorMessage({
|
|
90
|
+
error,
|
|
91
|
+
onRetry
|
|
92
|
+
}) {
|
|
2
93
|
return jsx("div", {
|
|
3
|
-
className: "
|
|
4
|
-
children:
|
|
94
|
+
className: "rounded-2xl px-4 py-3 bg-destructive/10 border border-destructive/50",
|
|
95
|
+
children: jsxs("div", {
|
|
96
|
+
className: "flex items-start justify-between gap-3",
|
|
97
|
+
children: [jsxs("div", {
|
|
98
|
+
className: "flex items-start gap-2",
|
|
99
|
+
children: [jsx(AlertCircle, {
|
|
100
|
+
className: "h-5 w-5 text-destructive flex-shrink-0 mt-0.5"
|
|
101
|
+
}), jsxs("div", {
|
|
102
|
+
className: "flex-1",
|
|
103
|
+
children: [jsx("p", {
|
|
104
|
+
className: "text-sm font-medium text-destructive mb-1",
|
|
105
|
+
children: "Something went wrong"
|
|
106
|
+
}), jsx("p", {
|
|
107
|
+
className: "text-sm text-destructive/80",
|
|
108
|
+
children: error
|
|
109
|
+
})]
|
|
110
|
+
})]
|
|
111
|
+
}), jsxs("button", {
|
|
112
|
+
onClick: onRetry,
|
|
113
|
+
className: "flex items-center gap-1 px-3 py-1.5 text-sm rounded-lg border border-destructive/50 text-destructive hover:bg-destructive/10 transition-colors",
|
|
114
|
+
children: [jsx(RefreshCw, {
|
|
115
|
+
className: "h-4 w-4"
|
|
116
|
+
}), "Retry"]
|
|
117
|
+
})]
|
|
118
|
+
})
|
|
119
|
+
});
|
|
120
|
+
});
|
|
121
|
+
function HomePage() {
|
|
122
|
+
const [state, send] = useMachine(chatMachine);
|
|
123
|
+
const scrollRef = useRef(null);
|
|
124
|
+
const hasLoadedRef = useRef(false);
|
|
125
|
+
const {
|
|
126
|
+
messages,
|
|
127
|
+
response,
|
|
128
|
+
isStreaming,
|
|
129
|
+
error
|
|
130
|
+
} = state.context;
|
|
131
|
+
const hasMessages = messages.length > 0 || response;
|
|
132
|
+
const isLoading = state.matches('sending');
|
|
133
|
+
// Load persisted messages on mount (once)
|
|
134
|
+
useEffect(() => {
|
|
135
|
+
if (hasLoadedRef.current) return;
|
|
136
|
+
hasLoadedRef.current = true;
|
|
137
|
+
loadChat().then(storedMessages => {
|
|
138
|
+
if (storedMessages && storedMessages.length > 0) {
|
|
139
|
+
send({
|
|
140
|
+
type: 'LOAD_MESSAGES',
|
|
141
|
+
messages: storedMessages
|
|
142
|
+
});
|
|
143
|
+
}
|
|
144
|
+
});
|
|
145
|
+
}, [send]);
|
|
146
|
+
// Auto-scroll to bottom when messages update
|
|
147
|
+
useEffect(() => {
|
|
148
|
+
if (scrollRef.current) {
|
|
149
|
+
scrollRef.current.scrollTop = scrollRef.current.scrollHeight;
|
|
150
|
+
}
|
|
151
|
+
}, [messages, response]);
|
|
152
|
+
const handleSubmit = useCallback((query, mode, attachments) => {
|
|
153
|
+
console.log('📤 [CHAT] Submitting query:', query, 'mode:', mode, 'attachments:', attachments?.length ?? 0);
|
|
154
|
+
// Convert attachments to message format
|
|
155
|
+
const messageAttachments = attachments?.map(a => ({
|
|
156
|
+
id: a.id,
|
|
157
|
+
name: a.name,
|
|
158
|
+
// Map mime types and 'screenshot' marker to UI-level 'file'|'screenshot'
|
|
159
|
+
type: a.type === 'screenshot' ? 'screenshot' : 'file',
|
|
160
|
+
dataUrl: a.dataUrl
|
|
161
|
+
}));
|
|
162
|
+
send({
|
|
163
|
+
type: 'SEND_MESSAGE',
|
|
164
|
+
content: query,
|
|
165
|
+
attachments: messageAttachments
|
|
166
|
+
});
|
|
167
|
+
}, [send]);
|
|
168
|
+
const handleClear = useCallback(() => {
|
|
169
|
+
send({
|
|
170
|
+
type: 'CLEAR_MESSAGES'
|
|
171
|
+
});
|
|
172
|
+
}, [send]);
|
|
173
|
+
const handleRetry = useCallback(() => {
|
|
174
|
+
send({
|
|
175
|
+
type: 'RETRY'
|
|
176
|
+
});
|
|
177
|
+
}, [send]);
|
|
178
|
+
return jsxs("div", {
|
|
179
|
+
className: "flex h-screen flex-col bg-background overflow-hidden",
|
|
180
|
+
children: [hasMessages && jsx("div", {
|
|
181
|
+
className: "absolute top-4 left-4 z-10",
|
|
182
|
+
children: jsx("button", {
|
|
183
|
+
onClick: handleClear,
|
|
184
|
+
className: "p-2 rounded-lg text-muted-foreground hover:text-foreground hover:bg-muted transition-colors",
|
|
185
|
+
title: "Clear conversation",
|
|
186
|
+
children: jsx(Trash2, {
|
|
187
|
+
className: "h-4 w-4"
|
|
188
|
+
})
|
|
189
|
+
})
|
|
190
|
+
}), !hasMessages && jsxs("div", {
|
|
191
|
+
className: "flex-1 flex flex-col items-center justify-center px-6",
|
|
192
|
+
children: [jsx("header", {
|
|
193
|
+
className: "text-center mb-8",
|
|
194
|
+
children: jsx("p", {
|
|
195
|
+
className: "text-balance text-3xl font-semibold tracking-tight text-foreground",
|
|
196
|
+
children: "perplexity"
|
|
197
|
+
})
|
|
198
|
+
}), jsx("div", {
|
|
199
|
+
className: "w-full max-w-[38rem]",
|
|
200
|
+
children: jsx(PerplexitySearch, {
|
|
201
|
+
onSubmit: handleSubmit,
|
|
202
|
+
isLoading: isLoading
|
|
203
|
+
})
|
|
204
|
+
})]
|
|
205
|
+
}), hasMessages && jsxs(Fragment, {
|
|
206
|
+
children: [jsx("div", {
|
|
207
|
+
className: "flex-1 overflow-y-auto px-6 pt-16 pb-4",
|
|
208
|
+
ref: scrollRef,
|
|
209
|
+
children: jsxs("div", {
|
|
210
|
+
className: "max-w-[46rem] mx-auto space-y-6",
|
|
211
|
+
children: [messages.map((message, index) => jsx(MessageBubble, {
|
|
212
|
+
role: message.role,
|
|
213
|
+
content: message.content,
|
|
214
|
+
attachments: message.attachments
|
|
215
|
+
}, index)), response && isLoading && jsx(StreamingMessage, {
|
|
216
|
+
content: response
|
|
217
|
+
}), isLoading && !response && jsx(LoadingIndicator, {}), state.matches('error') && error && jsx(ErrorMessage, {
|
|
218
|
+
error: error,
|
|
219
|
+
onRetry: handleRetry
|
|
220
|
+
})]
|
|
221
|
+
})
|
|
222
|
+
}), jsx("div", {
|
|
223
|
+
className: "shrink-0 bg-card px-6 py-4",
|
|
224
|
+
children: jsx("div", {
|
|
225
|
+
className: "max-w-[46rem] mx-auto",
|
|
226
|
+
children: jsx(PerplexitySearch, {
|
|
227
|
+
onSubmit: handleSubmit,
|
|
228
|
+
isLoading: isLoading
|
|
229
|
+
})
|
|
230
|
+
})
|
|
231
|
+
})]
|
|
232
|
+
})]
|
|
5
233
|
});
|
|
6
|
-
}
|
|
234
|
+
}export{HomePage as default};//# sourceMappingURL=HomePage.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"HomePage.js","sources":["../../../src/pages/home/HomePage.tsx"],"sourcesContent":[null],"names":["_jsx"],"mappings":"
|
|
1
|
+
{"version":3,"file":"HomePage.js","sources":["../../../src/pages/home/HomePage.tsx"],"sourcesContent":[null],"names":["_jsxs","_jsx"],"mappings":"mgBA8BA,MAAM,aAAa,GAAG,IAAI,CAAC,SAAS,aAAa,CAAC;AAC9C,EAAA,IAAA;SACA;;AAGA,CAAA,EAAA;AACI,EAAA,MAAA,MAAI,GAAA,IAAM,KAAA,MAAA;AAAE,EAAA,MAAA,iBAAY,WAAA,IAAA,WAAA,CAAA,MAAA,GAAA,CAAA;AACxB;AACJ,EAAA,MAAI,WAAS,GAAA,OAAS,CAAA,MAAA;AAEtB,IAAA,IAAA,MACI,EAAA,OAAA,IAAK;iCAiBuB;AACA,MAAA,KAAA,EAAA;AACA,KAAA,CAAA;AAsBpC,EAAE,CAAC,EAAA,CAAA,OAAA,EAAA,MAAA,CAAA,CAAA;AAEH,EAAA,OAAAA,IAAA,CAAA,KAAA,EAAA;AAEA,IAAA,SAAM,EAAA,EAAA,CAAA,YAAwB,WAAS,aAAA,GAAiB,eAAgC,CAAA;IACpF,QAAA,EAAA,CAAA,C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AE;eACR,EAAI,gCAAQ;cACZ,EAAAD,IAAA,CAAA,KAAA,EAAA;AACA,QAAA,SAAI,EAAG,oCAAyB;gBAChC,EAAA,CAAOC,GAAI,CAAA,KAAA,EAAO;AACrB,UAAC,SAAE,EAAA,iCAAA;AAEJ,UAAA,QAAO,EAAI;AACf,SACC,CAAA,EAAIA,GACP,CAAA,MAAA,EAAA;AAEF,UAAM,SAAA,EAAW;AACb,SAAA,CAAA;AACJ,OAAG;AAEH,KAAA,CAAA;AACI,GAAA,CAAA;AACJ,CAAA,CAAA;MAEA,uBACS,CAAA;AA+Db,EAAC,OAAAD,IAAA,CAAA,KAAA,EAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Browser Platform Services Implementation
|
|
3
|
+
*
|
|
4
|
+
* This module provides browser-specific implementations for storage, screenshot,
|
|
5
|
+
* and microphone functionality using Web APIs (IndexedDB, MediaDevices, etc.)
|
|
6
|
+
*/
|
|
7
|
+
import type { IPlatformServices, IStorageService, IScreenshotService, IMicrophoneService, PlatformInfo } from './types';
|
|
8
|
+
export declare class BrowserPlatformServices implements IPlatformServices {
|
|
9
|
+
readonly platform: PlatformInfo;
|
|
10
|
+
readonly storage: IStorageService;
|
|
11
|
+
readonly screenshot: IScreenshotService;
|
|
12
|
+
readonly microphone: IMicrophoneService;
|
|
13
|
+
constructor();
|
|
14
|
+
initialize(): Promise<void>;
|
|
15
|
+
dispose(): Promise<void>;
|
|
16
|
+
}
|
|
17
|
+
export declare function getBrowserPlatformServices(): BrowserPlatformServices;
|
|
18
|
+
//# sourceMappingURL=browser.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"browser.d.ts","sourceRoot":"","sources":["../../src/platform/browser.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAGH,OAAO,KAAK,EACR,iBAAiB,EACjB,eAAe,EACf,kBAAkB,EAClB,kBAAkB,EAClB,YAAY,EAQf,MAAM,SAAS,CAAC;AA2UjB,qBAAa,uBAAwB,YAAW,iBAAiB;IAC7D,SAAgB,QAAQ,EAAE,YAAY,CAGpC;IAEF,SAAgB,OAAO,EAAE,eAAe,CAAC;IACzC,SAAgB,UAAU,EAAE,kBAAkB,CAAC;IAC/C,SAAgB,UAAU,EAAE,kBAAkB,CAAC;;IAQzC,UAAU,IAAI,OAAO,CAAC,IAAI,CAAC;IAI3B,OAAO,IAAI,OAAO,CAAC,IAAI,CAAC;CAKjC;AAKD,wBAAgB,0BAA0B,IAAI,uBAAuB,CAKpE"}
|