@guidekit/vanilla 0.1.0-beta.1
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/README.md +58 -0
- package/dist/index.cjs +523 -0
- package/dist/index.cjs.map +1 -0
- package/dist/index.d.cts +76 -0
- package/dist/index.d.ts +76 -0
- package/dist/index.global.js +11623 -0
- package/dist/index.global.js.map +1 -0
- package/dist/index.js +478 -0
- package/dist/index.js.map +1 -0
- package/package.json +40 -0
package/dist/index.d.cts
ADDED
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
import { GuideKitCoreOptions, GuideKitErrorType, GuideKitEvent, HealthCheckResult, AgentState, GuideKitCore, PageModel } from '@guidekit/core';
|
|
2
|
+
|
|
3
|
+
interface GuideKitVanillaOptions {
|
|
4
|
+
tokenEndpoint?: string;
|
|
5
|
+
stt?: GuideKitCoreOptions['stt'];
|
|
6
|
+
tts?: GuideKitCoreOptions['tts'];
|
|
7
|
+
llm?: GuideKitCoreOptions['llm'];
|
|
8
|
+
agent?: GuideKitCoreOptions['agent'];
|
|
9
|
+
contentMap?: GuideKitCoreOptions['contentMap'];
|
|
10
|
+
options?: GuideKitCoreOptions['options'];
|
|
11
|
+
instanceId?: string;
|
|
12
|
+
rootElement?: HTMLElement;
|
|
13
|
+
/** Disable the built-in widget UI (for headless use). */
|
|
14
|
+
headless?: boolean;
|
|
15
|
+
onError?: (error: GuideKitErrorType) => void;
|
|
16
|
+
onEvent?: (event: GuideKitEvent) => void;
|
|
17
|
+
onReady?: () => void;
|
|
18
|
+
}
|
|
19
|
+
/**
|
|
20
|
+
* Initialize GuideKit. Must be called before any other methods.
|
|
21
|
+
* Idempotent — calling multiple times is safe (returns existing instance).
|
|
22
|
+
*/
|
|
23
|
+
declare function init(options: GuideKitVanillaOptions): Promise<void>;
|
|
24
|
+
/**
|
|
25
|
+
* Send a text message to the assistant. Returns the response.
|
|
26
|
+
*/
|
|
27
|
+
declare function sendText(message: string): Promise<string>;
|
|
28
|
+
/**
|
|
29
|
+
* Highlight an element on the page.
|
|
30
|
+
*/
|
|
31
|
+
declare function highlight(params: {
|
|
32
|
+
sectionId?: string;
|
|
33
|
+
selector?: string;
|
|
34
|
+
tooltip?: string;
|
|
35
|
+
position?: 'top' | 'bottom' | 'left' | 'right' | 'auto';
|
|
36
|
+
}): boolean;
|
|
37
|
+
/** Dismiss the current spotlight highlight. */
|
|
38
|
+
declare function dismissHighlight(): void;
|
|
39
|
+
/** Smooth scroll to a section by ID. */
|
|
40
|
+
declare function scrollToSection(sectionId: string, offset?: number): void;
|
|
41
|
+
/** Start a guided tour. */
|
|
42
|
+
declare function startTour(sectionIds: string[], mode?: 'auto' | 'manual'): void;
|
|
43
|
+
/** Stop the current tour. */
|
|
44
|
+
declare function stopTour(): void;
|
|
45
|
+
/** Navigate to a URL (same-origin only). */
|
|
46
|
+
declare function navigate(href: string): Promise<boolean>;
|
|
47
|
+
/** Set developer page context for the LLM. */
|
|
48
|
+
declare function setPageContext(context: Record<string, unknown>): void;
|
|
49
|
+
/** Register a custom action the LLM can invoke. */
|
|
50
|
+
declare function registerAction(actionId: string, action: {
|
|
51
|
+
description: string;
|
|
52
|
+
parameters: Record<string, unknown>;
|
|
53
|
+
handler: (params: Record<string, unknown>) => Promise<unknown>;
|
|
54
|
+
}): void;
|
|
55
|
+
/** Start voice input. */
|
|
56
|
+
declare function startListening(): Promise<void>;
|
|
57
|
+
/** Stop voice input. */
|
|
58
|
+
declare function stopListening(): void;
|
|
59
|
+
/** Get current agent state. */
|
|
60
|
+
declare function getAgentState(): AgentState;
|
|
61
|
+
/** Get current page model. */
|
|
62
|
+
declare function getPageModel(): PageModel | null;
|
|
63
|
+
/** Whether the SDK is ready. */
|
|
64
|
+
declare function isReady(): boolean;
|
|
65
|
+
/** Get/set quiet mode. */
|
|
66
|
+
declare function getQuietMode(): boolean;
|
|
67
|
+
declare function setQuietMode(value: boolean): void;
|
|
68
|
+
/** Check health of all connected services. */
|
|
69
|
+
declare function checkHealth(): Promise<HealthCheckResult>;
|
|
70
|
+
/** Destroy the instance and clean up. */
|
|
71
|
+
declare function destroy(): Promise<void>;
|
|
72
|
+
/** Get the underlying GuideKitCore instance (escape hatch). */
|
|
73
|
+
declare function getCore(): GuideKitCore | null;
|
|
74
|
+
declare const VERSION = "0.1.0-beta.1";
|
|
75
|
+
|
|
76
|
+
export { type GuideKitVanillaOptions, VERSION, checkHealth, destroy, dismissHighlight, getAgentState, getCore, getPageModel, getQuietMode, highlight, init, isReady, navigate, registerAction, scrollToSection, sendText, setPageContext, setQuietMode, startListening, startTour, stopListening, stopTour };
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
import { GuideKitCoreOptions, GuideKitErrorType, GuideKitEvent, HealthCheckResult, AgentState, GuideKitCore, PageModel } from '@guidekit/core';
|
|
2
|
+
|
|
3
|
+
interface GuideKitVanillaOptions {
|
|
4
|
+
tokenEndpoint?: string;
|
|
5
|
+
stt?: GuideKitCoreOptions['stt'];
|
|
6
|
+
tts?: GuideKitCoreOptions['tts'];
|
|
7
|
+
llm?: GuideKitCoreOptions['llm'];
|
|
8
|
+
agent?: GuideKitCoreOptions['agent'];
|
|
9
|
+
contentMap?: GuideKitCoreOptions['contentMap'];
|
|
10
|
+
options?: GuideKitCoreOptions['options'];
|
|
11
|
+
instanceId?: string;
|
|
12
|
+
rootElement?: HTMLElement;
|
|
13
|
+
/** Disable the built-in widget UI (for headless use). */
|
|
14
|
+
headless?: boolean;
|
|
15
|
+
onError?: (error: GuideKitErrorType) => void;
|
|
16
|
+
onEvent?: (event: GuideKitEvent) => void;
|
|
17
|
+
onReady?: () => void;
|
|
18
|
+
}
|
|
19
|
+
/**
|
|
20
|
+
* Initialize GuideKit. Must be called before any other methods.
|
|
21
|
+
* Idempotent — calling multiple times is safe (returns existing instance).
|
|
22
|
+
*/
|
|
23
|
+
declare function init(options: GuideKitVanillaOptions): Promise<void>;
|
|
24
|
+
/**
|
|
25
|
+
* Send a text message to the assistant. Returns the response.
|
|
26
|
+
*/
|
|
27
|
+
declare function sendText(message: string): Promise<string>;
|
|
28
|
+
/**
|
|
29
|
+
* Highlight an element on the page.
|
|
30
|
+
*/
|
|
31
|
+
declare function highlight(params: {
|
|
32
|
+
sectionId?: string;
|
|
33
|
+
selector?: string;
|
|
34
|
+
tooltip?: string;
|
|
35
|
+
position?: 'top' | 'bottom' | 'left' | 'right' | 'auto';
|
|
36
|
+
}): boolean;
|
|
37
|
+
/** Dismiss the current spotlight highlight. */
|
|
38
|
+
declare function dismissHighlight(): void;
|
|
39
|
+
/** Smooth scroll to a section by ID. */
|
|
40
|
+
declare function scrollToSection(sectionId: string, offset?: number): void;
|
|
41
|
+
/** Start a guided tour. */
|
|
42
|
+
declare function startTour(sectionIds: string[], mode?: 'auto' | 'manual'): void;
|
|
43
|
+
/** Stop the current tour. */
|
|
44
|
+
declare function stopTour(): void;
|
|
45
|
+
/** Navigate to a URL (same-origin only). */
|
|
46
|
+
declare function navigate(href: string): Promise<boolean>;
|
|
47
|
+
/** Set developer page context for the LLM. */
|
|
48
|
+
declare function setPageContext(context: Record<string, unknown>): void;
|
|
49
|
+
/** Register a custom action the LLM can invoke. */
|
|
50
|
+
declare function registerAction(actionId: string, action: {
|
|
51
|
+
description: string;
|
|
52
|
+
parameters: Record<string, unknown>;
|
|
53
|
+
handler: (params: Record<string, unknown>) => Promise<unknown>;
|
|
54
|
+
}): void;
|
|
55
|
+
/** Start voice input. */
|
|
56
|
+
declare function startListening(): Promise<void>;
|
|
57
|
+
/** Stop voice input. */
|
|
58
|
+
declare function stopListening(): void;
|
|
59
|
+
/** Get current agent state. */
|
|
60
|
+
declare function getAgentState(): AgentState;
|
|
61
|
+
/** Get current page model. */
|
|
62
|
+
declare function getPageModel(): PageModel | null;
|
|
63
|
+
/** Whether the SDK is ready. */
|
|
64
|
+
declare function isReady(): boolean;
|
|
65
|
+
/** Get/set quiet mode. */
|
|
66
|
+
declare function getQuietMode(): boolean;
|
|
67
|
+
declare function setQuietMode(value: boolean): void;
|
|
68
|
+
/** Check health of all connected services. */
|
|
69
|
+
declare function checkHealth(): Promise<HealthCheckResult>;
|
|
70
|
+
/** Destroy the instance and clean up. */
|
|
71
|
+
declare function destroy(): Promise<void>;
|
|
72
|
+
/** Get the underlying GuideKitCore instance (escape hatch). */
|
|
73
|
+
declare function getCore(): GuideKitCore | null;
|
|
74
|
+
declare const VERSION = "0.1.0-beta.1";
|
|
75
|
+
|
|
76
|
+
export { type GuideKitVanillaOptions, VERSION, checkHealth, destroy, dismissHighlight, getAgentState, getCore, getPageModel, getQuietMode, highlight, init, isReady, navigate, registerAction, scrollToSection, sendText, setPageContext, setQuietMode, startListening, startTour, stopListening, stopTour };
|