@guidekit/core 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 ADDED
@@ -0,0 +1,75 @@
1
+ # @guidekit/core
2
+
3
+ Core engine for the GuideKit SDK. Provides DOM intelligence, LLM orchestration, context management, and the typed event system that powers all GuideKit integrations.
4
+
5
+ ## Installation
6
+
7
+ ```bash
8
+ npm install @guidekit/core
9
+ ```
10
+
11
+ ## Overview
12
+
13
+ `@guidekit/core` is the foundation layer used by `@guidekit/react` and `@guidekit/vanilla`. You typically do not need to use it directly unless you are building a custom integration.
14
+
15
+ ## API
16
+
17
+ ### GuideKitCore
18
+
19
+ The main class that orchestrates all SDK subsystems.
20
+
21
+ ```typescript
22
+ import { GuideKitCore } from '@guidekit/core';
23
+
24
+ const core = new GuideKitCore({
25
+ tokenEndpoint: '/api/guidekit/token',
26
+ agent: { name: 'Guide', greeting: 'Hello!' },
27
+ options: { mode: 'text', debug: false },
28
+ });
29
+
30
+ await core.init();
31
+
32
+ // Send a text message
33
+ const response = await core.sendText('How do I reset my password?');
34
+
35
+ // Clean up
36
+ core.destroy();
37
+ ```
38
+
39
+ ### EventBus
40
+
41
+ Typed event system with namespace subscriptions and error isolation.
42
+
43
+ ```typescript
44
+ core.events.on('status:change', (status) => {
45
+ console.log('Status:', status);
46
+ });
47
+
48
+ core.events.on('error', (error) => {
49
+ console.log(error.code, error.suggestion);
50
+ });
51
+ ```
52
+
53
+ ### Error Hierarchy
54
+
55
+ All errors extend `GuideKitError` with structured metadata:
56
+
57
+ - `code` — One of 28 canonical error codes
58
+ - `suggestion` — Actionable fix for the user
59
+ - `recoverable` — Whether the SDK can continue operating
60
+ - `docsUrl` — Link to the relevant documentation page
61
+
62
+ ## Key Subsystems
63
+
64
+ - **DOM Scanner** — TreeWalker-based page model with `data-guidekit-ignore` support
65
+ - **Context Manager** — Token budgeting and truncation for LLM context windows
66
+ - **LLM Orchestrator** — Streaming responses with tool calling (Gemini adapter)
67
+ - **Resource Manager** — AbortController pattern and lifecycle tracking
68
+
69
+ ## Documentation
70
+
71
+ Full documentation: [guidekit.dev/docs](https://guidekit.dev/docs)
72
+
73
+ ## License
74
+
75
+ [MIT](../../LICENSE)