@pillar-ai/sdk 0.1.24 → 0.1.26
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/dist/actions/definitions/analytics.d.ts +18 -0
- package/dist/actions/definitions/content.d.ts +40 -0
- package/dist/actions/definitions/index.d.ts +26 -0
- package/dist/actions/definitions/navigation.d.ts +65 -0
- package/dist/actions/definitions/settings.d.ts +162 -0
- package/dist/actions/definitions/sources.d.ts +44 -0
- package/dist/actions/definitions/support.d.ts +15 -0
- package/dist/actions/definitions/team.d.ts +120 -0
- package/dist/api/ag-ui-adapter.d.ts +76 -0
- package/dist/api/ag-ui-bridge.d.ts +49 -0
- package/dist/api/ag-ui-client.d.ts +102 -0
- package/dist/api/ag-ui-handler.d.ts +89 -0
- package/dist/api/client.d.ts +14 -0
- package/dist/button/FloatingButton.d.ts +44 -0
- package/dist/cli/sync.js +37 -5
- package/dist/components/Button/EdgeTrigger.d.ts +1 -0
- package/dist/components/Button/FloatingButton.d.ts +46 -0
- package/dist/components/DevTools/DOMScannerPreview.d.ts +21 -0
- package/dist/components/Progress/AGUIProgress.d.ts +15 -0
- package/dist/components/ToolDebugPanel/ToolDebugPanel.d.ts +21 -0
- package/dist/components/ToolDebugPanel/index.d.ts +1 -0
- package/dist/components/Tooltips/Tooltip.d.ts +46 -0
- package/dist/components/Tooltips/TooltipManager.d.ts +41 -0
- package/dist/components/Tooltips/index.d.ts +6 -0
- package/dist/components/Tooltips/styles.d.ts +5 -0
- package/dist/components/Views/ArticleChatView.d.ts +9 -0
- package/dist/components/Views/ArticleView.d.ts +10 -0
- package/dist/components/Views/CategoryView.d.ts +11 -0
- package/dist/components/Views/DeveloperView.d.ts +6 -0
- package/dist/components/Views/SearchView.d.ts +10 -0
- package/dist/components/shared/ArticleCard.d.ts +17 -0
- package/dist/components/shared/CategoryCard.d.ts +17 -0
- package/dist/content/extensions/AccordionNode.d.ts +10 -0
- package/dist/content/extensions/CalloutNode.d.ts +11 -0
- package/dist/content/extensions/index.d.ts +5 -0
- package/dist/content/index.d.ts +5 -0
- package/dist/content/renderer.d.ts +24 -0
- package/dist/core/Pillar.d.ts +45 -1
- package/dist/core/config.d.ts +1 -1
- package/dist/core/events.d.ts +10 -1
- package/dist/index.d.ts +1 -1
- package/dist/panel/Panel.d.ts +53 -0
- package/dist/panel/PanelUI.d.ts +43 -0
- package/dist/panel/components/ArticleCard.d.ts +10 -0
- package/dist/panel/components/CategoryCard.d.ts +10 -0
- package/dist/panel/components/ChatInput.d.ts +36 -0
- package/dist/panel/components/Header.d.ts +16 -0
- package/dist/panel/components/SearchInput.d.ts +11 -0
- package/dist/panel/styles.d.ts +5 -0
- package/dist/panel/views/ArticleView.d.ts +21 -0
- package/dist/panel/views/CategoryView.d.ts +20 -0
- package/dist/panel/views/ChatView.d.ts +30 -0
- package/dist/panel/views/HomeView.d.ts +18 -0
- package/dist/panel/views/SearchView.d.ts +22 -0
- package/dist/pillar.esm.js +1 -1
- package/dist/store/developer.d.ts +19 -0
- package/dist/store/panel.d.ts +3 -2
- package/dist/store/tooltips.d.ts +21 -0
- package/dist/tooltips/Tooltip.d.ts +63 -0
- package/dist/tooltips/TooltipManager.d.ts +42 -0
- package/dist/tooltips/styles.d.ts +5 -0
- package/dist/ui/config.d.ts +96 -0
- package/dist/ui/executor.d.ts +75 -0
- package/dist/ui/index.d.ts +11 -0
- package/dist/ui/scanner.d.ts +105 -0
- package/dist/ui/types.d.ts +293 -0
- package/dist/utils/markdown.d.ts +9 -0
- package/package.json +4 -1
|
@@ -0,0 +1,102 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* AG-UI Protocol Client for Pillar SDK
|
|
3
|
+
*
|
|
4
|
+
* Implements the AG-UI specification for streaming agent interactions.
|
|
5
|
+
* Uses the @ag-ui/client HttpAgent for transport.
|
|
6
|
+
*
|
|
7
|
+
* Copyright (C) 2025 Pillar Team
|
|
8
|
+
*/
|
|
9
|
+
import type { ResolvedConfig } from '../core/config';
|
|
10
|
+
export interface AGUIStreamCallbacks {
|
|
11
|
+
/** Called when run starts */
|
|
12
|
+
onRunStarted?: (runId: string) => void;
|
|
13
|
+
/** Called when run completes successfully */
|
|
14
|
+
onRunFinished?: () => void;
|
|
15
|
+
/** Called on error */
|
|
16
|
+
onError?: (error: Error) => void;
|
|
17
|
+
/** Called when a step starts */
|
|
18
|
+
onStepStarted?: (stepName: string) => void;
|
|
19
|
+
/** Called when a step finishes */
|
|
20
|
+
onStepFinished?: (stepName: string) => void;
|
|
21
|
+
/** Called for text message streaming */
|
|
22
|
+
onTextContent?: (messageId: string, delta: string) => void;
|
|
23
|
+
/** Called when text message completes */
|
|
24
|
+
onTextComplete?: (messageId: string, fullContent: string) => void;
|
|
25
|
+
/** Called when tool call starts (for UI display) */
|
|
26
|
+
onToolCallStart?: (toolCallId: string, toolName: string) => void;
|
|
27
|
+
/** Called with tool call arguments */
|
|
28
|
+
onToolCallArgs?: (toolCallId: string, argsJson: string) => void;
|
|
29
|
+
/** Called when tool call completes */
|
|
30
|
+
onToolCallEnd?: (toolCallId: string) => void;
|
|
31
|
+
/** Called when tool result is available */
|
|
32
|
+
onToolCallResult?: (toolCallId: string, result: string) => void;
|
|
33
|
+
/** Called for state delta events (sources, actions, plan) */
|
|
34
|
+
onStateDelta?: (delta: unknown[]) => void;
|
|
35
|
+
/** Called for state snapshots */
|
|
36
|
+
onStateSnapshot?: (state: unknown) => void;
|
|
37
|
+
}
|
|
38
|
+
export interface ClientTool {
|
|
39
|
+
name: string;
|
|
40
|
+
description: string;
|
|
41
|
+
parameters: Record<string, unknown>;
|
|
42
|
+
/** Handler function - called when agent requests this tool */
|
|
43
|
+
handler?: (args: Record<string, unknown>) => Promise<unknown>;
|
|
44
|
+
}
|
|
45
|
+
export declare class AGUIClient {
|
|
46
|
+
private config;
|
|
47
|
+
private agent;
|
|
48
|
+
private currentRunId;
|
|
49
|
+
private currentThreadId;
|
|
50
|
+
private messageAccumulators;
|
|
51
|
+
private toolArgAccumulators;
|
|
52
|
+
private toolCallNames;
|
|
53
|
+
private registeredTools;
|
|
54
|
+
constructor(config: ResolvedConfig);
|
|
55
|
+
/**
|
|
56
|
+
* Get or create a persistent thread ID for this session.
|
|
57
|
+
*/
|
|
58
|
+
private getOrCreateThreadId;
|
|
59
|
+
private getBrowserLanguage;
|
|
60
|
+
/**
|
|
61
|
+
* Register a client-side tool that can be called by the agent.
|
|
62
|
+
*/
|
|
63
|
+
registerTool(tool: ClientTool): void;
|
|
64
|
+
/**
|
|
65
|
+
* Unregister a client-side tool.
|
|
66
|
+
*/
|
|
67
|
+
unregisterTool(toolName: string): void;
|
|
68
|
+
/**
|
|
69
|
+
* Send a message and stream the agent's response.
|
|
70
|
+
*/
|
|
71
|
+
chat(message: string, callbacks: AGUIStreamCallbacks, options?: {
|
|
72
|
+
history?: Array<{
|
|
73
|
+
role: 'user' | 'assistant';
|
|
74
|
+
content: string;
|
|
75
|
+
}>;
|
|
76
|
+
userContext?: Array<{
|
|
77
|
+
type: string;
|
|
78
|
+
[key: string]: unknown;
|
|
79
|
+
}>;
|
|
80
|
+
signal?: AbortSignal;
|
|
81
|
+
}): Promise<void>;
|
|
82
|
+
/**
|
|
83
|
+
* Execute a client-side tool if registered.
|
|
84
|
+
*/
|
|
85
|
+
private maybeExecuteClientTool;
|
|
86
|
+
/**
|
|
87
|
+
* Send tool execution result back to the server.
|
|
88
|
+
*/
|
|
89
|
+
sendToolResult(toolCallId: string, result: unknown, error?: string): Promise<void>;
|
|
90
|
+
/**
|
|
91
|
+
* Start a new conversation thread.
|
|
92
|
+
*/
|
|
93
|
+
newThread(): string;
|
|
94
|
+
/**
|
|
95
|
+
* Get current thread ID.
|
|
96
|
+
*/
|
|
97
|
+
get threadId(): string;
|
|
98
|
+
/**
|
|
99
|
+
* Get current run ID.
|
|
100
|
+
*/
|
|
101
|
+
get runId(): string | null;
|
|
102
|
+
}
|
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* AG-UI Event Handler
|
|
3
|
+
*
|
|
4
|
+
* Processes AG-UI protocol events and maintains UI state.
|
|
5
|
+
* Replaces the complex JSON-RPC parsing in mcp-client.ts.
|
|
6
|
+
*/
|
|
7
|
+
import type { AGUIEvent } from '@ag-ui/core';
|
|
8
|
+
/** A streaming text message being accumulated */
|
|
9
|
+
export interface StreamingMessage {
|
|
10
|
+
id: string;
|
|
11
|
+
role: 'user' | 'assistant';
|
|
12
|
+
content: string;
|
|
13
|
+
complete: boolean;
|
|
14
|
+
/** Which step this message belongs to (for thinking vs response) */
|
|
15
|
+
stepName?: string;
|
|
16
|
+
}
|
|
17
|
+
/** A tool call being tracked */
|
|
18
|
+
export interface ToolCallState {
|
|
19
|
+
id: string;
|
|
20
|
+
name: string;
|
|
21
|
+
args: string;
|
|
22
|
+
result?: unknown;
|
|
23
|
+
complete: boolean;
|
|
24
|
+
/** True if this tool executes on the client (query action) */
|
|
25
|
+
isClientSide?: boolean;
|
|
26
|
+
}
|
|
27
|
+
/** State delta data (sources, actions, plan, etc.) */
|
|
28
|
+
export interface StateDeltaData {
|
|
29
|
+
type: string;
|
|
30
|
+
data: unknown;
|
|
31
|
+
timestamp: number;
|
|
32
|
+
}
|
|
33
|
+
/** Complete AG-UI state */
|
|
34
|
+
export interface AGUIState {
|
|
35
|
+
/** Current run ID */
|
|
36
|
+
runId: string | null;
|
|
37
|
+
/** Thread ID (replaces conversation_id) */
|
|
38
|
+
threadId: string | null;
|
|
39
|
+
/** Current step name (e.g., "reasoning", "tool_execution") */
|
|
40
|
+
currentStep: string | null;
|
|
41
|
+
/** Streaming messages keyed by message ID */
|
|
42
|
+
messages: Map<string, StreamingMessage>;
|
|
43
|
+
/** Tool calls keyed by tool call ID */
|
|
44
|
+
toolCalls: Map<string, ToolCallState>;
|
|
45
|
+
/** State deltas received (sources, actions, plans) */
|
|
46
|
+
stateDeltas: StateDeltaData[];
|
|
47
|
+
/** Whether the run is complete */
|
|
48
|
+
isComplete: boolean;
|
|
49
|
+
/** Error if run failed */
|
|
50
|
+
error: Error | null;
|
|
51
|
+
}
|
|
52
|
+
export interface AGUIHandlerCallbacks {
|
|
53
|
+
/** Called whenever state changes */
|
|
54
|
+
onStateChange: (state: AGUIState) => void;
|
|
55
|
+
/** Called when an error occurs */
|
|
56
|
+
onError: (error: Error) => void;
|
|
57
|
+
/** Called when run completes successfully */
|
|
58
|
+
onComplete: () => void;
|
|
59
|
+
/** Called when a client-side tool needs execution */
|
|
60
|
+
onClientToolCall?: (toolCall: ToolCallState) => Promise<unknown>;
|
|
61
|
+
}
|
|
62
|
+
/**
|
|
63
|
+
* Create an AG-UI event handler.
|
|
64
|
+
*
|
|
65
|
+
* Returns an object with a handleEvent method that processes
|
|
66
|
+
* AG-UI events and updates internal state.
|
|
67
|
+
*/
|
|
68
|
+
export declare function createAGUIHandler(callbacks: AGUIHandlerCallbacks): {
|
|
69
|
+
handleEvent: (event: AGUIEvent) => Promise<void>;
|
|
70
|
+
reset: () => void;
|
|
71
|
+
getState: () => AGUIState;
|
|
72
|
+
};
|
|
73
|
+
/**
|
|
74
|
+
* Register a tool as client-side.
|
|
75
|
+
* Called when the SDK registers an action with returns: true.
|
|
76
|
+
*/
|
|
77
|
+
export declare function registerClientSideTool(toolName: string): void;
|
|
78
|
+
/**
|
|
79
|
+
* Unregister a client-side tool.
|
|
80
|
+
*/
|
|
81
|
+
export declare function unregisterClientSideTool(toolName: string): void;
|
|
82
|
+
/**
|
|
83
|
+
* Check if a tool executes on the client side.
|
|
84
|
+
*/
|
|
85
|
+
export declare function isClientSideTool(toolName: string): boolean;
|
|
86
|
+
/**
|
|
87
|
+
* Get all registered client-side tools.
|
|
88
|
+
*/
|
|
89
|
+
export declare function getClientSideTools(): string[];
|
package/dist/api/client.d.ts
CHANGED
|
@@ -232,6 +232,20 @@ export declare class APIClient {
|
|
|
232
232
|
conversation_id?: string;
|
|
233
233
|
[key: string]: unknown;
|
|
234
234
|
}): Promise<void>;
|
|
235
|
+
/**
|
|
236
|
+
* Track WebMCP tool execution.
|
|
237
|
+
* Called when a browser agent invokes a WebMCP-registered tool.
|
|
238
|
+
* Fire-and-forget - errors are logged but don't throw.
|
|
239
|
+
*
|
|
240
|
+
* @param toolName - The name of the tool that was executed
|
|
241
|
+
* @param status - 'success' or 'failure'
|
|
242
|
+
* @param details - Optional execution details
|
|
243
|
+
*/
|
|
244
|
+
trackWebMCPExecution(toolName: string, status: "success" | "failure", details?: {
|
|
245
|
+
duration_ms?: number;
|
|
246
|
+
error?: string;
|
|
247
|
+
input?: Record<string, unknown>;
|
|
248
|
+
}): Promise<void>;
|
|
235
249
|
/**
|
|
236
250
|
* Get contextual help suggestions based on product context.
|
|
237
251
|
* Returns relevant articles, videos, and actions.
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Floating Help Button
|
|
3
|
+
* A floating action button that opens the help panel
|
|
4
|
+
*/
|
|
5
|
+
import type { ResolvedConfig, FloatingButtonPosition } from '../core/config';
|
|
6
|
+
export declare class FloatingButton {
|
|
7
|
+
private config;
|
|
8
|
+
private onClick;
|
|
9
|
+
private element;
|
|
10
|
+
private stylesInjected;
|
|
11
|
+
private _isOpen;
|
|
12
|
+
constructor(config: ResolvedConfig, onClick: () => void);
|
|
13
|
+
/**
|
|
14
|
+
* Initialize the floating button
|
|
15
|
+
*/
|
|
16
|
+
init(): void;
|
|
17
|
+
/**
|
|
18
|
+
* Set the open state (to show/hide when panel opens)
|
|
19
|
+
*/
|
|
20
|
+
setOpen(isOpen: boolean): void;
|
|
21
|
+
/**
|
|
22
|
+
* Show the button
|
|
23
|
+
*/
|
|
24
|
+
show(): void;
|
|
25
|
+
/**
|
|
26
|
+
* Hide the button
|
|
27
|
+
*/
|
|
28
|
+
hide(): void;
|
|
29
|
+
/**
|
|
30
|
+
* Update button position
|
|
31
|
+
*/
|
|
32
|
+
setPosition(position: FloatingButtonPosition): void;
|
|
33
|
+
/**
|
|
34
|
+
* Update button label
|
|
35
|
+
*/
|
|
36
|
+
setLabel(label: string): void;
|
|
37
|
+
/**
|
|
38
|
+
* Destroy the button
|
|
39
|
+
*/
|
|
40
|
+
destroy(): void;
|
|
41
|
+
private createElement;
|
|
42
|
+
private updateIcon;
|
|
43
|
+
private handleClick;
|
|
44
|
+
}
|
package/dist/cli/sync.js
CHANGED
|
@@ -27,14 +27,19 @@ function printUsage() {
|
|
|
27
27
|
console.log(`
|
|
28
28
|
Pillar Tool Sync CLI
|
|
29
29
|
|
|
30
|
-
Scans for
|
|
31
|
-
|
|
30
|
+
Scans for tool definitions and syncs to the Pillar backend.
|
|
31
|
+
|
|
32
|
+
Supported patterns:
|
|
33
|
+
- React/Vue: usePillarTool()
|
|
34
|
+
- Angular: injectPillarTool()
|
|
35
|
+
- Vanilla JS: pillar.defineTool()
|
|
36
|
+
- Legacy: usePillarAction(), defineAction(), injectPillarAction()
|
|
32
37
|
|
|
33
38
|
Usage:
|
|
34
39
|
npx pillar-sync --scan <dir> [--local]
|
|
35
40
|
|
|
36
41
|
Arguments:
|
|
37
|
-
--scan <dir> Directory to scan for
|
|
42
|
+
--scan <dir> Directory to scan for tool definitions
|
|
38
43
|
--local Use localhost:8003 as the API URL (for local development)
|
|
39
44
|
--force Force sync even if manifest hash matches an existing deployment
|
|
40
45
|
--help Show this help message
|
|
@@ -230,7 +235,14 @@ async function scanTools(scanDir) {
|
|
|
230
235
|
}
|
|
231
236
|
const files = globFiles(absoluteDir, [".ts", ".tsx", ".js", ".jsx", ".mjs"]);
|
|
232
237
|
console.log(`[pillar-sync] Scanning ${files.length} files in ${scanDir}`);
|
|
233
|
-
const PATTERNS = [
|
|
238
|
+
const PATTERNS = [
|
|
239
|
+
"defineTool",
|
|
240
|
+
"usePillarTool",
|
|
241
|
+
"injectPillarTool",
|
|
242
|
+
"defineAction",
|
|
243
|
+
"usePillarAction",
|
|
244
|
+
"injectPillarAction"
|
|
245
|
+
];
|
|
234
246
|
const candidateFiles = files.filter((file) => {
|
|
235
247
|
const content = fs.readFileSync(file, "utf-8");
|
|
236
248
|
return PATTERNS.some((p) => content.includes(p));
|
|
@@ -313,7 +325,27 @@ async function scanTools(scanDir) {
|
|
|
313
325
|
);
|
|
314
326
|
visit2(sourceFile);
|
|
315
327
|
}
|
|
316
|
-
|
|
328
|
+
const toolsByName = /* @__PURE__ */ new Map();
|
|
329
|
+
for (const tool of tools) {
|
|
330
|
+
const existing = toolsByName.get(tool.name);
|
|
331
|
+
if (existing) {
|
|
332
|
+
existing.push(tool);
|
|
333
|
+
} else {
|
|
334
|
+
toolsByName.set(tool.name, [tool]);
|
|
335
|
+
}
|
|
336
|
+
}
|
|
337
|
+
const deduplicatedTools = [];
|
|
338
|
+
for (const [name, instances] of toolsByName) {
|
|
339
|
+
if (instances.length > 1) {
|
|
340
|
+
const locations = instances.map((t) => `${t.sourceFile}:${t.line}`).join(", ");
|
|
341
|
+
console.warn(
|
|
342
|
+
`[pillar-sync] \u26A0 Duplicate tool "${name}" found in ${instances.length} locations: ${locations}`
|
|
343
|
+
);
|
|
344
|
+
console.warn(`[pillar-sync] Using first definition from ${instances[0].sourceFile}:${instances[0].line}`);
|
|
345
|
+
}
|
|
346
|
+
deduplicatedTools.push(instances[0]);
|
|
347
|
+
}
|
|
348
|
+
return deduplicatedTools;
|
|
317
349
|
}
|
|
318
350
|
function findAgentGuidance(scanDir) {
|
|
319
351
|
const absoluteDir = path.resolve(process.cwd(), scanDir);
|
|
@@ -36,6 +36,7 @@ export declare class EdgeTrigger {
|
|
|
36
36
|
/**
|
|
37
37
|
* Handle tab click - sets active tab and opens panel
|
|
38
38
|
* For non-assistant tabs, emits event for customer's code to handle (e.g., Intercom, Zendesk)
|
|
39
|
+
* Tools tab (debug only) opens the panel with tool debugger
|
|
39
40
|
*/
|
|
40
41
|
private handleTabClick;
|
|
41
42
|
/**
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Floating Help Button Component
|
|
3
|
+
* A floating action button that opens the help panel
|
|
4
|
+
*/
|
|
5
|
+
import type { ResolvedConfig, FloatingButtonPosition } from '../../core/config';
|
|
6
|
+
/**
|
|
7
|
+
* FloatingButton class that manages the button lifecycle
|
|
8
|
+
* Uses Preact for rendering but maintains imperative control
|
|
9
|
+
*/
|
|
10
|
+
export declare class FloatingButton {
|
|
11
|
+
private config;
|
|
12
|
+
private onClick;
|
|
13
|
+
private container;
|
|
14
|
+
private stylesInjected;
|
|
15
|
+
private _isHidden;
|
|
16
|
+
constructor(config: ResolvedConfig, onClick: () => void);
|
|
17
|
+
/**
|
|
18
|
+
* Initialize the floating button
|
|
19
|
+
*/
|
|
20
|
+
init(): void;
|
|
21
|
+
/**
|
|
22
|
+
* Set the open state (to update icon when panel opens)
|
|
23
|
+
*/
|
|
24
|
+
setOpen(_isOpen: boolean): void;
|
|
25
|
+
/**
|
|
26
|
+
* Show the button
|
|
27
|
+
*/
|
|
28
|
+
show(): void;
|
|
29
|
+
/**
|
|
30
|
+
* Hide the button
|
|
31
|
+
*/
|
|
32
|
+
hide(): void;
|
|
33
|
+
/**
|
|
34
|
+
* Update button position
|
|
35
|
+
*/
|
|
36
|
+
setPosition(position: FloatingButtonPosition): void;
|
|
37
|
+
/**
|
|
38
|
+
* Update button label
|
|
39
|
+
*/
|
|
40
|
+
setLabel(label: string): void;
|
|
41
|
+
/**
|
|
42
|
+
* Destroy the button
|
|
43
|
+
*/
|
|
44
|
+
destroy(): void;
|
|
45
|
+
private render;
|
|
46
|
+
}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* DOM Scanner Preview Component
|
|
3
|
+
* Displays a tree visualization of the scanned DOM AST
|
|
4
|
+
* Used in dev mode to preview what will be sent to the LLM
|
|
5
|
+
*/
|
|
6
|
+
import { h } from 'preact';
|
|
7
|
+
import type { ScanResult } from '../../types/dom-scanner';
|
|
8
|
+
interface DOMScannerPreviewProps {
|
|
9
|
+
/** The scan result to display */
|
|
10
|
+
result: ScanResult;
|
|
11
|
+
/** Called when user confirms and wants to send the message */
|
|
12
|
+
onConfirm: () => void;
|
|
13
|
+
/** Called when user cancels */
|
|
14
|
+
onCancel: () => void;
|
|
15
|
+
}
|
|
16
|
+
/**
|
|
17
|
+
* DOM Scanner Preview Panel
|
|
18
|
+
* Shows a modal with the scanned DOM tree and statistics
|
|
19
|
+
*/
|
|
20
|
+
export declare function DOMScannerPreview({ result, onConfirm, onCancel }: DOMScannerPreviewProps): h.JSX.Element;
|
|
21
|
+
export default DOMScannerPreview;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* AG-UI Progress Component
|
|
3
|
+
*
|
|
4
|
+
* Displays real-time progress based on AG-UI state signals.
|
|
5
|
+
* Renders step indicators, thinking content, and tool call status.
|
|
6
|
+
*
|
|
7
|
+
* This component replaces the old markdown-based ProgressRow for live
|
|
8
|
+
* streaming. ProgressRow is still used for rendering stored history.
|
|
9
|
+
*/
|
|
10
|
+
import { VNode } from 'preact';
|
|
11
|
+
/**
|
|
12
|
+
* Render AG-UI progress state.
|
|
13
|
+
* Shows current step, streaming thinking messages, and active tool calls.
|
|
14
|
+
*/
|
|
15
|
+
export declare function AGUIProgress(): VNode | null;
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Tool Debug Panel Component
|
|
3
|
+
*
|
|
4
|
+
* Shows registered tools and allows testing execution.
|
|
5
|
+
* Only rendered when debug: true is passed to Pillar.init()
|
|
6
|
+
*
|
|
7
|
+
* Features:
|
|
8
|
+
* - Searchable list of all registered tools
|
|
9
|
+
* - Tool details with input schema
|
|
10
|
+
* - JSON editor for testing tool execution
|
|
11
|
+
* - Execute button with result display
|
|
12
|
+
*/
|
|
13
|
+
interface ToolDebugPanelProps {
|
|
14
|
+
/** Called when user wants to close the panel */
|
|
15
|
+
onClose?: () => void;
|
|
16
|
+
}
|
|
17
|
+
/**
|
|
18
|
+
* Tool Debug Panel Component
|
|
19
|
+
*/
|
|
20
|
+
export declare function ToolDebugPanel({ onClose }: ToolDebugPanelProps): import("preact").JSX.Element;
|
|
21
|
+
export default ToolDebugPanel;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { ToolDebugPanel, default } from "./ToolDebugPanel";
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Tooltip Component
|
|
3
|
+
* Individual tooltip rendered to document body
|
|
4
|
+
*/
|
|
5
|
+
import type { TooltipData } from '../../api/client';
|
|
6
|
+
import type { TooltipTrigger, TooltipPosition } from '../../core/config';
|
|
7
|
+
export interface TooltipOptions {
|
|
8
|
+
trigger: TooltipTrigger;
|
|
9
|
+
position: TooltipPosition;
|
|
10
|
+
onLearnMore?: (articleSlug: string) => void;
|
|
11
|
+
onShow?: () => void;
|
|
12
|
+
onHide?: () => void;
|
|
13
|
+
}
|
|
14
|
+
/**
|
|
15
|
+
* Tooltip class that manages a single tooltip instance
|
|
16
|
+
* Uses Preact for rendering but maintains imperative control
|
|
17
|
+
*/
|
|
18
|
+
export declare class Tooltip {
|
|
19
|
+
private id;
|
|
20
|
+
private data;
|
|
21
|
+
private anchor;
|
|
22
|
+
private options;
|
|
23
|
+
private container;
|
|
24
|
+
private iconElement;
|
|
25
|
+
private isVisible;
|
|
26
|
+
private hideTimeout;
|
|
27
|
+
constructor(data: TooltipData, anchor: HTMLElement, options: TooltipOptions);
|
|
28
|
+
init(): void;
|
|
29
|
+
show(): void;
|
|
30
|
+
hide(): void;
|
|
31
|
+
toggle(): void;
|
|
32
|
+
destroy(): void;
|
|
33
|
+
private renderTooltip;
|
|
34
|
+
private createIcon;
|
|
35
|
+
private bindEvents;
|
|
36
|
+
private unbindEvents;
|
|
37
|
+
private handleMouseEnter;
|
|
38
|
+
private handleMouseLeave;
|
|
39
|
+
private handleTooltipMouseEnter;
|
|
40
|
+
private handleTooltipMouseLeave;
|
|
41
|
+
private handleClick;
|
|
42
|
+
private handleDocumentClick;
|
|
43
|
+
private handleFocus;
|
|
44
|
+
private handleBlur;
|
|
45
|
+
private handleKeyDown;
|
|
46
|
+
}
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Tooltip Manager
|
|
3
|
+
* Scans DOM for tooltip elements and manages their lifecycle
|
|
4
|
+
*/
|
|
5
|
+
import type { EventEmitter } from '../../core/events';
|
|
6
|
+
import type { ResolvedConfig } from '../../core/config';
|
|
7
|
+
import type { APIClient } from '../../api/client';
|
|
8
|
+
export declare class TooltipManager {
|
|
9
|
+
private config;
|
|
10
|
+
private api;
|
|
11
|
+
private events;
|
|
12
|
+
private tooltips;
|
|
13
|
+
private tooltipData;
|
|
14
|
+
private observer;
|
|
15
|
+
private stylesInjected;
|
|
16
|
+
constructor(config: ResolvedConfig, api: APIClient, events: EventEmitter);
|
|
17
|
+
/**
|
|
18
|
+
* Initialize the tooltip manager
|
|
19
|
+
*/
|
|
20
|
+
init(): Promise<void>;
|
|
21
|
+
/**
|
|
22
|
+
* Scan DOM for tooltip elements and initialize them
|
|
23
|
+
*/
|
|
24
|
+
scan(): Promise<void>;
|
|
25
|
+
/**
|
|
26
|
+
* Show a specific tooltip
|
|
27
|
+
*/
|
|
28
|
+
show(tooltipId: string): void;
|
|
29
|
+
/**
|
|
30
|
+
* Hide a specific tooltip
|
|
31
|
+
*/
|
|
32
|
+
hide(tooltipId: string): void;
|
|
33
|
+
/**
|
|
34
|
+
* Destroy the tooltip manager
|
|
35
|
+
*/
|
|
36
|
+
destroy(): void;
|
|
37
|
+
private createTooltip;
|
|
38
|
+
private setupObserver;
|
|
39
|
+
private handleRemovedElement;
|
|
40
|
+
private getElementKey;
|
|
41
|
+
}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Tooltip CSS Styles
|
|
3
|
+
* Injected into the document head
|
|
4
|
+
*/
|
|
5
|
+
export declare const TOOLTIP_STYLES = "\n/* Pillar Tooltip Styles */\n.pillar-tooltip {\n position: absolute;\n z-index: 99999;\n max-width: 320px;\n padding: 12px 16px;\n font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;\n font-size: 14px;\n line-height: 1.5;\n color: #1a1a1a;\n background: #ffffff;\n border-radius: 8px;\n box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15), 0 0 0 1px rgba(0, 0, 0, 0.05);\n pointer-events: auto;\n opacity: 0;\n transform: scale(0.95);\n transition: opacity 0.15s ease, transform 0.15s ease;\n}\n\n.pillar-tooltip.pillar-tooltip--visible {\n opacity: 1;\n transform: scale(1);\n}\n\n.pillar-tooltip__content {\n margin: 0;\n}\n\n.pillar-tooltip__content p {\n margin: 0 0 8px;\n}\n\n.pillar-tooltip__content p:last-child {\n margin-bottom: 0;\n}\n\n.pillar-tooltip__content a {\n color: #2563eb;\n text-decoration: none;\n}\n\n.pillar-tooltip__content a:hover {\n text-decoration: underline;\n}\n\n.pillar-tooltip__learn-more {\n display: inline-flex;\n align-items: center;\n gap: 4px;\n margin-top: 12px;\n padding: 6px 12px;\n font-size: 13px;\n font-weight: 500;\n color: #2563eb;\n background: #eff6ff;\n border: none;\n border-radius: 6px;\n cursor: pointer;\n transition: background 0.15s ease;\n}\n\n.pillar-tooltip__learn-more:hover {\n background: #dbeafe;\n}\n\n.pillar-tooltip__learn-more svg {\n width: 14px;\n height: 14px;\n}\n\n/* Arrow */\n.pillar-tooltip__arrow {\n position: absolute;\n width: 12px;\n height: 12px;\n background: #ffffff;\n transform: rotate(45deg);\n box-shadow: -1px -1px 0 0 rgba(0, 0, 0, 0.05);\n}\n\n.pillar-tooltip--top .pillar-tooltip__arrow {\n bottom: -6px;\n box-shadow: 1px 1px 0 0 rgba(0, 0, 0, 0.05);\n}\n\n.pillar-tooltip--bottom .pillar-tooltip__arrow {\n top: -6px;\n}\n\n.pillar-tooltip--left .pillar-tooltip__arrow {\n right: -6px;\n box-shadow: 1px -1px 0 0 rgba(0, 0, 0, 0.05);\n}\n\n.pillar-tooltip--right .pillar-tooltip__arrow {\n left: -6px;\n box-shadow: -1px 1px 0 0 rgba(0, 0, 0, 0.05);\n}\n\n/* Tooltip Icon (for icon trigger) */\n.pillar-tooltip-icon {\n display: inline-flex;\n align-items: center;\n justify-content: center;\n width: 16px;\n height: 16px;\n margin-left: 4px;\n vertical-align: middle;\n color: #6b7280;\n cursor: help;\n transition: color 0.15s ease;\n}\n\n.pillar-tooltip-icon:hover {\n color: #2563eb;\n}\n\n.pillar-tooltip-icon svg {\n width: 100%;\n height: 100%;\n}\n\n/* Close button */\n.pillar-tooltip__close {\n position: absolute;\n top: 8px;\n right: 8px;\n display: flex;\n align-items: center;\n justify-content: center;\n width: 20px;\n height: 20px;\n padding: 0;\n color: #9ca3af;\n background: none;\n border: none;\n border-radius: 4px;\n cursor: pointer;\n transition: color 0.15s ease, background 0.15s ease;\n}\n\n.pillar-tooltip__close:hover {\n color: #1a1a1a;\n background: #f3f4f6;\n}\n\n.pillar-tooltip__close svg {\n width: 12px;\n height: 12px;\n}\n";
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Article Chat View Component
|
|
3
|
+
* Combined view with full article content at top and chat messages below
|
|
4
|
+
*/
|
|
5
|
+
interface ArticleChatViewProps {
|
|
6
|
+
slug: string;
|
|
7
|
+
}
|
|
8
|
+
export declare function ArticleChatView({ slug }: ArticleChatViewProps): import("preact").JSX.Element;
|
|
9
|
+
export {};
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Article View Component
|
|
3
|
+
* Displays article content using TipTap for rendering
|
|
4
|
+
*/
|
|
5
|
+
import { h } from 'preact';
|
|
6
|
+
interface ArticleViewProps {
|
|
7
|
+
slug: string;
|
|
8
|
+
}
|
|
9
|
+
export declare function ArticleView({ slug }: ArticleViewProps): h.JSX.Element;
|
|
10
|
+
export {};
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Category View Component
|
|
3
|
+
* Displays articles within a category
|
|
4
|
+
*/
|
|
5
|
+
import { h } from 'preact';
|
|
6
|
+
import type { CategoryData } from '../../api/client';
|
|
7
|
+
interface CategoryViewProps {
|
|
8
|
+
category: CategoryData;
|
|
9
|
+
}
|
|
10
|
+
export declare function CategoryView({ category }: CategoryViewProps): h.JSX.Element;
|
|
11
|
+
export {};
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Search View Component
|
|
3
|
+
* Displays search input and results
|
|
4
|
+
*/
|
|
5
|
+
import { h } from 'preact';
|
|
6
|
+
interface SearchViewProps {
|
|
7
|
+
initialQuery?: string;
|
|
8
|
+
}
|
|
9
|
+
export declare function SearchView({ initialQuery }: SearchViewProps): h.JSX.Element;
|
|
10
|
+
export {};
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Article Card Component
|
|
3
|
+
* Displays an article list item
|
|
4
|
+
*/
|
|
5
|
+
import { h } from 'preact';
|
|
6
|
+
import type { ArticleSummary } from '../../api/client';
|
|
7
|
+
interface ArticleCardProps {
|
|
8
|
+
article: ArticleSummary;
|
|
9
|
+
onClick: () => void;
|
|
10
|
+
}
|
|
11
|
+
export declare function ArticleCard({ article, onClick }: ArticleCardProps): h.JSX.Element;
|
|
12
|
+
interface ArticleListProps {
|
|
13
|
+
articles: ArticleSummary[];
|
|
14
|
+
onArticleClick: (article: ArticleSummary) => void;
|
|
15
|
+
}
|
|
16
|
+
export declare function ArticleList({ articles, onArticleClick }: ArticleListProps): h.JSX.Element;
|
|
17
|
+
export {};
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Category Card Component
|
|
3
|
+
* Displays a category list item
|
|
4
|
+
*/
|
|
5
|
+
import { h } from 'preact';
|
|
6
|
+
import type { CategoryData } from '../../api/client';
|
|
7
|
+
interface CategoryCardProps {
|
|
8
|
+
category: CategoryData;
|
|
9
|
+
onClick: () => void;
|
|
10
|
+
}
|
|
11
|
+
export declare function CategoryCard({ category, onClick }: CategoryCardProps): h.JSX.Element;
|
|
12
|
+
interface CategoryListProps {
|
|
13
|
+
categories: CategoryData[];
|
|
14
|
+
onCategoryClick: (category: CategoryData) => void;
|
|
15
|
+
}
|
|
16
|
+
export declare function CategoryList({ categories, onCategoryClick }: CategoryListProps): h.JSX.Element;
|
|
17
|
+
export {};
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Accordion Node Extension for TipTap (vanilla - HTML rendering only)
|
|
3
|
+
* Used to render collapsible accordion blocks in article content
|
|
4
|
+
*/
|
|
5
|
+
import { Node } from '@tiptap/core';
|
|
6
|
+
/**
|
|
7
|
+
* TipTap Accordion Node Extension (vanilla, no React)
|
|
8
|
+
* Renders accordion blocks using HTML details/summary elements
|
|
9
|
+
*/
|
|
10
|
+
export declare const AccordionNode: Node<any, any>;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Callout Node Extension for TipTap (vanilla - HTML rendering only)
|
|
3
|
+
* Used to render callout blocks in article content
|
|
4
|
+
*/
|
|
5
|
+
import { Node } from '@tiptap/core';
|
|
6
|
+
export type CalloutType = 'info' | 'warning' | 'tip' | 'error' | 'success';
|
|
7
|
+
/**
|
|
8
|
+
* TipTap Callout Node Extension (vanilla, no React)
|
|
9
|
+
* Renders callout blocks with type-specific styling classes
|
|
10
|
+
*/
|
|
11
|
+
export declare const CalloutNode: Node<any, any>;
|