JSPM

  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 38
  • Score
    100M100P100Q90720F
  • License MIT

Core engine for GuideKit SDK — DOM intelligence, LLM orchestration, context management

Package Exports

  • @guidekit/core
  • @guidekit/core/rendering

Readme

@guidekit/core

npm version

Core engine for the GuideKit SDK. Provides DOM intelligence, LLM orchestration, context management, and the typed event system that powers all GuideKit integrations.

Installation

npm install @guidekit/core

Overview

@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.

API

GuideKitCore

The main class that orchestrates all SDK subsystems.

import { GuideKitCore } from '@guidekit/core';

const core = new GuideKitCore({
  tokenEndpoint: '/api/guidekit/token',
  agent: { name: 'Guide', greeting: 'Hello!' },
  options: { mode: 'text', debug: false },
});

await core.init();

// Send a text message
const response = await core.sendText('How do I reset my password?');

// Clean up
core.destroy();

EventBus

Typed event system with namespace subscriptions and error isolation.

core.events.on('status:change', (status) => {
  console.log('Status:', status);
});

core.events.on('error', (error) => {
  console.log(error.code, error.suggestion);
});

Error Hierarchy

All errors extend GuideKitError with structured metadata:

  • code — One of 28 canonical error codes
  • suggestion — Actionable fix for the user
  • recoverable — Whether the SDK can continue operating
  • docsUrl — Link to the relevant documentation page

Key Subsystems

  • DOM Scanner — TreeWalker-based page model with data-guidekit-ignore support
  • Context Manager — Token budgeting and truncation for LLM context windows
  • LLM Orchestrator — Streaming responses with tool calling (Gemini (default), custom adapters via LLMProviderAdapter)
  • Resource Manager — AbortController pattern and lifecycle tracking

Documentation

License

MIT