@blinq_ai/widget 0.1.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.
@@ -0,0 +1,114 @@
1
+ type RuntimeMode = "native-webmcp-active" | "blinq-page-tools-active" | "read-only-fallback";
2
+ interface ToolCapability {
3
+ name: string;
4
+ description: string;
5
+ read_only: boolean;
6
+ }
7
+ interface RuntimeCapability {
8
+ mode: RuntimeMode;
9
+ native_webmcp_supported: boolean;
10
+ embedded_page_tools_supported: boolean;
11
+ write_requires_confirmation: boolean;
12
+ tool_capabilities: ToolCapability[];
13
+ }
14
+
15
+ interface BlinqWidgetInitOptions {
16
+ publicToken: string;
17
+ apiBaseUrl?: string;
18
+ mcpEndpoint?: string;
19
+ mount?: string | HTMLElement;
20
+ }
21
+ type BlinqWidgetConfigFile = BlinqWidgetInitOptions;
22
+ interface BlinqWidgetRuntimeStatus extends RuntimeCapability {
23
+ message: string;
24
+ }
25
+ declare class BlinqWidget {
26
+ private readonly options;
27
+ private readonly apiBaseUrl;
28
+ private sessionId;
29
+ private sessionToken;
30
+ private widgetConfig;
31
+ private runtimeStatus;
32
+ private registry;
33
+ private root;
34
+ private reactRoot;
35
+ private voiceController;
36
+ private history;
37
+ private items;
38
+ private minimized;
39
+ private isSending;
40
+ private inputValue;
41
+ private statusText;
42
+ private voiceSupported;
43
+ private voiceListening;
44
+ private voiceWaveform;
45
+ private voiceDurationMs;
46
+ private voiceStartedAt;
47
+ private lastVoiceSampleAt;
48
+ private confirmResolve;
49
+ private confirmItemId;
50
+ private activeRun;
51
+ private pendingAssistantIndicator;
52
+ private executedToolCounts;
53
+ private lastAutoResumeKey;
54
+ private readonly shellHandlers;
55
+ constructor(options: BlinqWidgetInitOptions);
56
+ init(): Promise<this>;
57
+ getRuntimeStatus(): BlinqWidgetRuntimeStatus | null;
58
+ destroy(): void;
59
+ private currentState;
60
+ private renderReactApp;
61
+ private startSession;
62
+ private render;
63
+ private preferredSpeechLanguage;
64
+ private setupVoiceInput;
65
+ private syncVoiceState;
66
+ private startVoiceVisualization;
67
+ private resetVoiceVisualization;
68
+ private updateVoiceVisualization;
69
+ private submitComposerMessage;
70
+ private toggleVoiceInput;
71
+ private minimizedStorageKey;
72
+ private sessionStorageKey;
73
+ private restoreStoredSessionId;
74
+ private persistSessionId;
75
+ private restoreMinimizedState;
76
+ private persistMinimizedState;
77
+ private setMinimized;
78
+ private historyStorageKey;
79
+ private restoreHistory;
80
+ private persistHistory;
81
+ private rememberMessage;
82
+ private recentHistoryForRequest;
83
+ private restoreConversationView;
84
+ private updateActionState;
85
+ private planItemId;
86
+ private upsertPlanItem;
87
+ private removeEmptyMessage;
88
+ private resolveConfirmation;
89
+ private confirmToolExecution;
90
+ private syncRuntimeStatus;
91
+ private setStatus;
92
+ private appendMessage;
93
+ private updateMessage;
94
+ private latestAssistantMessage;
95
+ private finalizeAssistantMessage;
96
+ private showThinkingIndicator;
97
+ private hideThinkingIndicator;
98
+ private currentPageContext;
99
+ private currentRoute;
100
+ private shouldAutoResumeActiveRun;
101
+ private handleToolRequest;
102
+ private streamChatStep;
103
+ sendMessage(message: string): Promise<string>;
104
+ private continueActiveRun;
105
+ respondToPlan(approved: boolean): Promise<void>;
106
+ endSession(): Promise<void>;
107
+ }
108
+ declare function init(options: BlinqWidgetInitOptions): Promise<BlinqWidget>;
109
+ declare function initFromConfig(config: BlinqWidgetConfigFile | {
110
+ default: BlinqWidgetConfigFile;
111
+ }): Promise<BlinqWidget>;
112
+ declare function createBlinqWidget(options: BlinqWidgetInitOptions): Promise<BlinqWidget>;
113
+
114
+ export { BlinqWidget, type BlinqWidgetConfigFile, type BlinqWidgetInitOptions, type BlinqWidgetRuntimeStatus, createBlinqWidget, init, initFromConfig };
package/dist/index.js ADDED
@@ -0,0 +1,13 @@
1
+ import {
2
+ BlinqWidget,
3
+ createBlinqWidget,
4
+ init,
5
+ initFromConfig
6
+ } from "./chunk-2BSH3PRA.js";
7
+ export {
8
+ BlinqWidget,
9
+ createBlinqWidget,
10
+ init,
11
+ initFromConfig
12
+ };
13
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":[],"sourcesContent":[],"mappings":"","names":[]}
package/package.json ADDED
@@ -0,0 +1,61 @@
1
+ {
2
+ "name": "@blinq_ai/widget",
3
+ "version": "0.1.0",
4
+ "description": "Blinq AI browser widget, SDK, and CLI.",
5
+ "repository": {
6
+ "type": "git",
7
+ "url": "git+ssh://git@github.com/blinq-app-kz/blind_app.git",
8
+ "directory": "widget"
9
+ },
10
+ "homepage": "https://github.com/blinq-app-kz/blind_app/tree/main/widget",
11
+ "bugs": {
12
+ "url": "https://github.com/blinq-app-kz/blind_app/issues"
13
+ },
14
+ "keywords": [
15
+ "blinq",
16
+ "widget",
17
+ "assistant",
18
+ "onboarding",
19
+ "support",
20
+ "webmcp"
21
+ ],
22
+ "type": "module",
23
+ "main": "./dist/index.cjs",
24
+ "module": "./dist/index.js",
25
+ "types": "./dist/index.d.ts",
26
+ "publishConfig": {
27
+ "access": "public"
28
+ },
29
+ "bin": {
30
+ "blinq-widget": "./dist/cli.js"
31
+ },
32
+ "exports": {
33
+ ".": {
34
+ "types": "./dist/index.d.ts",
35
+ "import": "./dist/index.js",
36
+ "require": "./dist/index.cjs"
37
+ },
38
+ "./browser": {
39
+ "import": "./dist/browser.js"
40
+ }
41
+ },
42
+ "files": [
43
+ "dist"
44
+ ],
45
+ "dependencies": {
46
+ "@assistant-ui/react": "^0.12.23",
47
+ "react": "19.2.4",
48
+ "react-dom": "19.2.4"
49
+ },
50
+ "scripts": {
51
+ "build": "tsup",
52
+ "typecheck": "tsc --noEmit"
53
+ },
54
+ "devDependencies": {
55
+ "@types/node": "^24.6.0",
56
+ "@types/react": "^19.2.14",
57
+ "@types/react-dom": "^19.2.3",
58
+ "tsup": "^8.5.0",
59
+ "typescript": "^5.9.3"
60
+ }
61
+ }