@pillar-ai/sdk 0.1.15 → 0.1.16
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 +18 -12
- package/dist/api/client.d.ts +31 -28
- package/dist/api/mcp-client.d.ts +8 -21
- package/dist/components/Button/EdgeTrigger.d.ts +18 -0
- package/dist/components/Cards/ConfirmActionCard.d.ts +0 -4
- package/dist/components/Cards/index.d.ts +1 -1
- package/dist/components/DevTools/index.d.ts +1 -1
- package/dist/components/PagePilot/index.d.ts +0 -1
- package/dist/components/Panel/Header.d.ts +2 -1
- package/dist/components/Panel/Panel.d.ts +10 -4
- package/dist/components/Panel/TaskButton.d.ts +0 -4
- package/dist/components/Panel/UnifiedChatInput.d.ts +2 -2
- package/dist/components/Panel/WorkflowChecklist.d.ts +0 -1
- package/dist/components/Panel/index.d.ts +2 -3
- package/dist/components/Panel/styles.d.ts +1 -1
- package/dist/components/Progress/ProgressRow.d.ts +2 -1
- package/dist/components/TextSelection/index.d.ts +0 -1
- package/dist/components/index.d.ts +1 -1
- package/dist/core/config.d.ts +14 -1
- package/dist/pillar.esm.js +1 -1
- package/dist/store/chat.d.ts +7 -3
- package/dist/store/panel.d.ts +9 -0
- package/dist/styles/panel-styles.d.ts +6 -0
- package/dist/styles/theme.d.ts +13 -0
- package/dist/types/dom-scanner.d.ts +19 -0
- package/dist/utils/dom-scanner.d.ts +15 -2
- package/dist/utils/markdown-components.d.ts +0 -1
- package/dist/utils/preact-markdown.d.ts +0 -1
- package/package.json +10 -7
package/dist/store/chat.d.ts
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
* Chat Store
|
|
3
3
|
* Signal-based state for chat messages and interaction
|
|
4
4
|
*/
|
|
5
|
-
import type { ArticleSummary, ChatMessage, ConversationSummary, HistoryMessage } from "../api/client";
|
|
5
|
+
import type { ArticleSummary, ChatMessage, ConversationSummary, HistoryMessage, DisplayStep } from "../api/client";
|
|
6
6
|
import type { ChatImage } from "../api/mcp-client";
|
|
7
7
|
import type { TaskButtonData } from "../components/Panel/TaskButton";
|
|
8
8
|
import type { UserContextItem } from "../types/user-context";
|
|
@@ -54,7 +54,7 @@ export interface InterruptedSession {
|
|
|
54
54
|
conversationId: string;
|
|
55
55
|
userMessage: string;
|
|
56
56
|
partialResponse: string;
|
|
57
|
-
|
|
57
|
+
displayTrace: DisplayStep[];
|
|
58
58
|
elapsedMs: number;
|
|
59
59
|
}
|
|
60
60
|
export declare const interruptedSession: import("@preact/signals-core").Signal<InterruptedSession | null>;
|
|
@@ -157,6 +157,7 @@ export declare const submitPendingTrigger: import("@preact/signals-core").Signal
|
|
|
157
157
|
export declare const focusInputTrigger: import("@preact/signals-core").Signal<number>;
|
|
158
158
|
export declare const userContext: import("@preact/signals-core").Signal<UserContextItem[]>;
|
|
159
159
|
export declare const pendingUserContext: import("@preact/signals-core").Signal<UserContextItem[]>;
|
|
160
|
+
export declare const pendingImagesForNavigation: import("@preact/signals-core").Signal<ChatImage[]>;
|
|
160
161
|
export type ImageUploadStatus = "uploading" | "ready" | "error";
|
|
161
162
|
export interface PendingImage {
|
|
162
163
|
id: string;
|
|
@@ -165,12 +166,13 @@ export interface PendingImage {
|
|
|
165
166
|
status: ImageUploadStatus;
|
|
166
167
|
url?: string;
|
|
167
168
|
error?: string;
|
|
169
|
+
path?: string;
|
|
168
170
|
}
|
|
169
171
|
export declare const pendingImages: import("@preact/signals-core").Signal<PendingImage[]>;
|
|
170
172
|
export declare const isUploadingImages: import("@preact/signals-core").ReadonlySignal<boolean>;
|
|
171
173
|
export declare const getReadyImages: () => ChatImage[];
|
|
172
174
|
export declare const addPendingImage: (image: PendingImage) => void;
|
|
173
|
-
export declare const updateImageStatus: (id: string, status: ImageUploadStatus, url?: string, error?: string) => void;
|
|
175
|
+
export declare const updateImageStatus: (id: string, status: ImageUploadStatus, url?: string, error?: string, path?: string) => void;
|
|
174
176
|
export declare const removePendingImage: (id: string) => void;
|
|
175
177
|
export declare const clearPendingImages: () => void;
|
|
176
178
|
export declare const hasMessages: import("@preact/signals-core").ReadonlySignal<boolean>;
|
|
@@ -238,6 +240,8 @@ export declare const removeUserContext: (id: string) => void;
|
|
|
238
240
|
export declare const clearUserContext: () => void;
|
|
239
241
|
export declare const setPendingUserContext: (items: UserContextItem[]) => void;
|
|
240
242
|
export declare const clearPendingUserContext: () => void;
|
|
243
|
+
export declare const setPendingImagesForNavigation: (images: ChatImage[]) => void;
|
|
244
|
+
export declare const clearPendingImagesForNavigation: () => void;
|
|
241
245
|
export declare const resetChat: () => void;
|
|
242
246
|
/**
|
|
243
247
|
* Start loading a conversation from history.
|
package/dist/store/panel.d.ts
CHANGED
|
@@ -3,6 +3,15 @@
|
|
|
3
3
|
* Signal-based state for panel open/close and configuration
|
|
4
4
|
*/
|
|
5
5
|
import type { PanelPosition, PanelMode } from '../core/config';
|
|
6
|
+
/**
|
|
7
|
+
* Load panel width from localStorage.
|
|
8
|
+
* Returns null if not set or on error.
|
|
9
|
+
*/
|
|
10
|
+
export declare function loadPanelWidth(): number | null;
|
|
11
|
+
/**
|
|
12
|
+
* Save panel width to localStorage.
|
|
13
|
+
*/
|
|
14
|
+
export declare function savePanelWidth(w: number): void;
|
|
6
15
|
export declare const isOpen: import("@preact/signals-core").Signal<boolean>;
|
|
7
16
|
export declare const activeTab: import("@preact/signals-core").Signal<string>;
|
|
8
17
|
export declare const position: import("@preact/signals-core").Signal<PanelPosition>;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Theme CSS Generation
|
|
3
|
+
* Runtime functions for generating CSS variable overrides from theme config.
|
|
4
|
+
*/
|
|
5
|
+
import type { ResolvedThemeConfig, ThemeColors } from "../core/config";
|
|
6
|
+
/**
|
|
7
|
+
* Generate CSS variable overrides from theme colors
|
|
8
|
+
*/
|
|
9
|
+
export declare function generateThemeVariables(colors: ThemeColors, prefix?: string): string;
|
|
10
|
+
/**
|
|
11
|
+
* Generate custom theme CSS from config
|
|
12
|
+
*/
|
|
13
|
+
export declare function generateThemeCSS(theme: ResolvedThemeConfig): string;
|
|
@@ -42,6 +42,25 @@ export interface CompactScanResult {
|
|
|
42
42
|
/** Title of the page */
|
|
43
43
|
title: string;
|
|
44
44
|
}
|
|
45
|
+
/** Result of a delta scan showing only changes since the last scan */
|
|
46
|
+
export interface DeltaScanResult {
|
|
47
|
+
/** Formatted delta string for LLM context, or null if no changes */
|
|
48
|
+
content: string | null;
|
|
49
|
+
/** Ref IDs of elements no longer on the page */
|
|
50
|
+
removedRefs: string[];
|
|
51
|
+
/** Number of new interactable elements found */
|
|
52
|
+
newInteractableCount: number;
|
|
53
|
+
/** Total interactable elements currently on the page */
|
|
54
|
+
totalInteractableCount: number;
|
|
55
|
+
/** Whether any changes were detected */
|
|
56
|
+
hasChanges: boolean;
|
|
57
|
+
/** Timestamp when scan was performed */
|
|
58
|
+
timestamp: number;
|
|
59
|
+
/** URL of the page that was scanned */
|
|
60
|
+
url: string;
|
|
61
|
+
/** Title of the page */
|
|
62
|
+
title: string;
|
|
63
|
+
}
|
|
45
64
|
/** HTML tags that are inherently interactable */
|
|
46
65
|
export declare const INTERACTABLE_TAGS: Set<string>;
|
|
47
66
|
/** ARIA roles that indicate interactability */
|
|
@@ -2,10 +2,10 @@
|
|
|
2
2
|
* DOM Scanner Utilities
|
|
3
3
|
* Scans the DOM and outputs compact text representation for LLM context
|
|
4
4
|
*/
|
|
5
|
-
import { type CompactScanResult, type InteractionType, type ScanOptions } from "../types/dom-scanner";
|
|
5
|
+
import { type CompactScanResult, type DeltaScanResult, type InteractionType, type ScanOptions } from "../types/dom-scanner";
|
|
6
6
|
/**
|
|
7
7
|
* Clear all pillar refs from the DOM.
|
|
8
|
-
* Called before
|
|
8
|
+
* Called before full scans to remove stale refs and reset counter.
|
|
9
9
|
*/
|
|
10
10
|
export declare function clearPillarRefs(): void;
|
|
11
11
|
/**
|
|
@@ -68,3 +68,16 @@ export declare function buildSelectorFromRef(shortRef: string): string;
|
|
|
68
68
|
* ```
|
|
69
69
|
*/
|
|
70
70
|
export declare function scanPageDirect(options?: ScanOptions): CompactScanResult;
|
|
71
|
+
/**
|
|
72
|
+
* Delta DOM scanner that only returns changes since the last scan.
|
|
73
|
+
* Reuses existing refs on elements, assigns new refs only to new elements.
|
|
74
|
+
* Compares output lines against the previous scan to find new content.
|
|
75
|
+
*
|
|
76
|
+
* Must be called after an initial `scanPageDirect()` which establishes
|
|
77
|
+
* the baseline. If called without a prior scan, behaves like a full scan
|
|
78
|
+
* but without the header/footer framing.
|
|
79
|
+
*
|
|
80
|
+
* @param options - Scan options
|
|
81
|
+
* @returns Delta scan result with only new lines and removed ref IDs
|
|
82
|
+
*/
|
|
83
|
+
export declare function scanPageDelta(options?: ScanOptions): DeltaScanResult;
|
|
@@ -50,4 +50,3 @@ export interface ProgressIndicatorProps {
|
|
|
50
50
|
isActive?: boolean;
|
|
51
51
|
}
|
|
52
52
|
export declare function ProgressIndicator({ message, isActive, }: ProgressIndicatorProps): VNode;
|
|
53
|
-
export declare const MARKDOWN_COMPONENT_STYLES = "\n/* Collapsible Section */\n._pillar-collapsible {\n margin: 2px 0;\n}\n\n._pillar-collapsible-header {\n display: flex;\n align-items: center;\n gap: 6px;\n padding: 4px 0;\n background: transparent;\n border: none;\n border-radius: 4px;\n cursor: pointer;\n font-size: 13px;\n font-weight: 500;\n color: var(--pillar-text-secondary, #6b7280);\n font-family: inherit;\n width: 100%;\n text-align: left;\n transition: background-color 0.15s ease;\n}\n\n._pillar-collapsible-header:hover {\n background: var(--pillar-bg-hover, rgba(0, 0, 0, 0.05));\n}\n\n._pillar-collapsible-icon {\n font-size: 10px;\n color: var(--pillar-text-muted, #9ca3af);\n}\n\n._pillar-collapsible-title {\n flex: 1;\n}\n\n._pillar-collapsible-content-wrapper {\n display: grid;\n grid-template-rows: 0fr;\n transition: grid-template-rows 0.2s ease;\n}\n\n._pillar-collapsible-content-wrapper--expanded {\n grid-template-rows: 1fr;\n}\n\n._pillar-collapsible-content {\n overflow: hidden;\n padding-left: 18px;\n font-size: 13px;\n color: var(--pillar-text-secondary, #6b7280);\n line-height: 1.4;\n}\n\n._pillar-collapsible-content-wrapper--expanded ._pillar-collapsible-content {\n padding-top: 2px;\n padding-bottom: 4px;\n}\n\n/* Source List */\n._pillar-source-list {\n display: flex;\n flex-direction: column;\n gap: 4px;\n margin: 4px 0;\n}\n\n._pillar-source-item {\n display: block;\n padding: 4px 8px;\n font-size: 12px;\n color: var(--pillar-primary, #2563eb);\n text-decoration: none;\n border-radius: 4px;\n transition: background-color 0.15s ease;\n}\n\n._pillar-source-item:hover {\n background: var(--pillar-bg-hover, rgba(0, 0, 0, 0.05));\n text-decoration: underline;\n}\n\n/* Task List */\n._pillar-task-list {\n list-style: none;\n padding: 0;\n margin: 8px 0;\n}\n\n._pillar-task-item {\n display: flex;\n align-items: center;\n gap: 8px;\n padding: 4px 0;\n font-size: 13px;\n}\n\n._pillar-task-item--completed ._pillar-task-text {\n text-decoration: line-through;\n color: var(--pillar-text-placeholder, #9ca3af);\n}\n\n._pillar-task-checkbox {\n width: 16px;\n height: 16px;\n cursor: pointer;\n}\n\n/* Code Block */\n._pillar-code-block {\n margin: 8px 0;\n border-radius: 8px;\n overflow: hidden;\n background: var(--pillar-bg-code, #1e1e1e);\n}\n\n._pillar-code-header {\n display: flex;\n justify-content: space-between;\n align-items: center;\n padding: 8px 12px;\n background: var(--pillar-bg-code-header, #2d2d2d);\n border-bottom: 1px solid var(--pillar-border-code, #404040);\n}\n\n._pillar-code-language {\n font-size: 11px;\n font-weight: 500;\n color: var(--pillar-text-code-header, #a0a0a0);\n text-transform: uppercase;\n}\n\n._pillar-code-copy {\n padding: 4px 8px;\n font-size: 11px;\n font-family: inherit;\n background: transparent;\n border: 1px solid var(--pillar-border-code, #404040);\n border-radius: 4px;\n color: var(--pillar-text-code-header, #a0a0a0);\n cursor: pointer;\n transition: all 0.15s ease;\n}\n\n._pillar-code-copy:hover {\n background: var(--pillar-bg-code-hover, #404040);\n color: #fff;\n}\n\n._pillar-code-pre {\n margin: 0;\n padding: 12px;\n overflow-x: auto;\n font-family: 'SF Mono', Monaco, 'Cascadia Code', 'Roboto Mono', Consolas, monospace;\n font-size: 13px;\n line-height: 1.5;\n}\n\n._pillar-code-content {\n color: var(--pillar-text-code, #e0e0e0);\n}\n\n/* Action Buttons */\n._pillar-action-buttons {\n display: flex;\n flex-wrap: wrap;\n gap: 8px;\n margin: 8px 0;\n}\n\n._pillar-action-button {\n padding: 8px 16px;\n font-size: 13px;\n font-weight: 500;\n font-family: inherit;\n background: var(--pillar-primary, #2563eb);\n color: #fff;\n border: none;\n border-radius: 6px;\n cursor: pointer;\n transition: all 0.15s ease;\n}\n\n._pillar-action-button:hover {\n background: var(--pillar-primary-hover, #1d4ed8);\n}\n\n/* Progress Indicator */\n._pillar-progress-indicator {\n display: flex;\n align-items: center;\n gap: 6px;\n padding: 4px 0;\n font-size: 13px;\n color: var(--pillar-text-secondary, #6b7280);\n}\n\n._pillar-progress-indicator--active ._pillar-loading-spinner {\n display: inline-block;\n}\n\n/* Streaming Thinking Content */\n._pillar-progress-row--streaming {\n margin: 2px 0;\n}\n\n._pillar-thinking-header {\n display: flex;\n align-items: center;\n gap: 6px;\n padding: 4px 0;\n font-size: 13px;\n font-weight: 500;\n color: var(--pillar-text-secondary, #6b7280);\n}\n\n._pillar-thinking-icon {\n display: flex;\n align-items: center;\n justify-content: center;\n width: 16px;\n height: 16px;\n}\n\n._pillar-spinner {\n width: 12px;\n height: 12px;\n border: 2px solid var(--pillar-border, #e5e7eb);\n border-top-color: var(--pillar-primary, #2563eb);\n border-radius: 50%;\n animation: pillar-spin 0.8s linear infinite;\n}\n\n@keyframes pillar-spin {\n to { transform: rotate(360deg); }\n}\n\n._pillar-thinking-label {\n flex: 1;\n}\n\n._pillar-thinking-content {\n padding: 6px 10px;\n font-size: 13px;\n line-height: 1.4;\n color: var(--pillar-text-secondary, #6b7280);\n background: var(--pillar-bg-tertiary, #f9fafb);\n border-radius: 4px;\n margin-top: 2px;\n max-height: 150px;\n overflow-y: auto;\n}\n";
|
|
@@ -14,4 +14,3 @@ export interface PreactMarkdownProps {
|
|
|
14
14
|
* Supports custom component markers in code blocks and HTML-like syntax.
|
|
15
15
|
*/
|
|
16
16
|
export declare function PreactMarkdown({ content, class: className }: PreactMarkdownProps): VNode;
|
|
17
|
-
export declare const PREACT_MARKDOWN_STYLES = "\n/* Base markdown container */\n._pillar-markdown {\n font-size: 14px;\n line-height: 1.6;\n color: var(--pillar-text, #1a1a1a);\n}\n\n/* Headings */\n._pillar-md-heading {\n margin: 16px 0 8px 0;\n font-weight: 600;\n line-height: 1.3;\n}\n\n._pillar-md-h1 { font-size: 1.5em; }\n._pillar-md-h2 { font-size: 1.3em; }\n._pillar-md-h3 { font-size: 1.15em; }\n._pillar-md-h4 { font-size: 1em; }\n._pillar-md-h5 { font-size: 0.95em; }\n._pillar-md-h6 { font-size: 0.9em; }\n\n/* Paragraphs */\n._pillar-md-paragraph {\n margin: 8px 0;\n}\n\n/* Links */\n._pillar-md-link {\n color: var(--pillar-primary, #2563eb);\n text-decoration: none;\n}\n\n._pillar-md-link:hover {\n text-decoration: underline;\n}\n\n/* Inline code */\n._pillar-md-code-inline {\n padding: 2px 6px;\n font-family: 'SF Mono', Monaco, 'Cascadia Code', 'Roboto Mono', Consolas, monospace;\n font-size: 0.9em;\n background: var(--pillar-bg-code-inline, #f3f4f6);\n border-radius: 4px;\n}\n\n/* Lists */\n._pillar-md-list {\n margin: 8px 0;\n padding-left: 24px;\n}\n\n._pillar-md-list-item {\n margin: 4px 0;\n}\n\n/* Task list items */\n._pillar-md-task-item {\n display: flex;\n align-items: flex-start;\n gap: 8px;\n list-style: none;\n margin-left: -24px;\n}\n\n._pillar-md-task-checkbox {\n margin-top: 4px;\n}\n\n._pillar-md-task-text--checked {\n text-decoration: line-through;\n color: var(--pillar-text-placeholder, #9ca3af);\n}\n\n/* Blockquote */\n._pillar-md-blockquote {\n margin: 8px 0;\n padding: 8px 16px;\n border-left: 3px solid var(--pillar-border, #e5e7eb);\n color: var(--pillar-text-muted, #6b7280);\n background: var(--pillar-bg-secondary, #f9fafb);\n}\n\n/* Horizontal rule */\n._pillar-md-hr {\n margin: 16px 0;\n border: none;\n border-top: 1px solid var(--pillar-border, #e5e7eb);\n}\n\n/* Tables */\n._pillar-md-table-wrapper {\n overflow-x: auto;\n margin: 8px 0;\n}\n\n._pillar-md-table {\n width: 100%;\n border-collapse: collapse;\n font-size: 13px;\n}\n\n._pillar-md-th,\n._pillar-md-td {\n padding: 8px 12px;\n border: 1px solid var(--pillar-border, #e5e7eb);\n text-align: left;\n}\n\n._pillar-md-th {\n background: var(--pillar-bg-secondary, #f9fafb);\n font-weight: 600;\n}\n\n/* Images */\n._pillar-md-image {\n max-width: 100%;\n height: auto;\n border-radius: 8px;\n margin: 8px 0;\n}\n";
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@pillar-ai/sdk",
|
|
3
|
-
"version": "0.1.
|
|
4
|
-
"description": "
|
|
3
|
+
"version": "0.1.16",
|
|
4
|
+
"description": "Product copilot SDK for SaaS and web apps — AI assistant that executes tasks, not just answers questions",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/pillar.esm.js",
|
|
7
7
|
"module": "./dist/pillar.esm.js",
|
|
@@ -32,12 +32,15 @@
|
|
|
32
32
|
"prepublishOnly": "npm run build"
|
|
33
33
|
},
|
|
34
34
|
"keywords": [
|
|
35
|
-
"
|
|
36
|
-
"
|
|
37
|
-
"support",
|
|
38
|
-
"chat",
|
|
35
|
+
"copilot",
|
|
36
|
+
"assistant",
|
|
39
37
|
"ai",
|
|
40
|
-
"
|
|
38
|
+
"sdk",
|
|
39
|
+
"saas",
|
|
40
|
+
"embedded",
|
|
41
|
+
"agent",
|
|
42
|
+
"support",
|
|
43
|
+
"chat"
|
|
41
44
|
],
|
|
42
45
|
"author": "Pillar Team",
|
|
43
46
|
"license": "MIT",
|