@pillar-ai/sdk 0.1.21 → 0.1.22
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/actions/index.d.ts +1 -1
- package/dist/actions/types.d.ts +0 -89
- 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/mcp-client.d.ts +46 -24
- package/dist/cli/sync.js +62 -43
- package/dist/components/Button/FloatingButton.d.ts +46 -0
- package/dist/components/PagePilot/styles.d.ts +1 -1
- package/dist/components/Panel/TabNavigation.d.ts +16 -0
- package/dist/components/Panel/styles.d.ts +1 -1
- package/dist/components/Progress/AGUIProgress.d.ts +15 -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 +10 -0
- package/dist/components/Views/ArticleView.d.ts +10 -0
- package/dist/components/Views/CategoryView.d.ts +11 -0
- package/dist/components/Views/HelpCenterArticles.d.ts +17 -0
- package/dist/components/Views/SearchView.d.ts +10 -0
- package/dist/components/Views/SupportView.d.ts +15 -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 +57 -38
- package/dist/core/config.d.ts +1 -1
- package/dist/core/events.d.ts +7 -1
- package/dist/index.d.ts +2 -2
- package/dist/pillar.esm.js +1 -1
- package/dist/store/chat.d.ts +2 -0
- package/dist/store/tooltips.d.ts +21 -0
- package/dist/tools/index.d.ts +27 -0
- package/dist/tools/registry.d.ts +106 -0
- package/dist/tools/types.d.ts +564 -0
- package/dist/utils/helpdesk.d.ts +33 -0
- package/dist/utils/markdown.d.ts +9 -0
- package/dist/utils/resilient-fetch.d.ts +25 -0
- package/package.json +3 -2
- package/src/actions/types.ts +0 -622
package/dist/store/chat.d.ts
CHANGED
|
@@ -44,6 +44,8 @@ export declare const historyInvalidationCounter: import("@preact/signals-core").
|
|
|
44
44
|
export declare const optimisticConversations: import("@preact/signals-core").Signal<ConversationSummary[]>;
|
|
45
45
|
/**
|
|
46
46
|
* Read the persisted conversation ID from localStorage (e.g. for restore on refresh).
|
|
47
|
+
* Returns null if no conversation is stored or if it's older than 3 minutes,
|
|
48
|
+
* so stale conversations are discarded and users get a fresh chat.
|
|
47
49
|
*/
|
|
48
50
|
export declare function getStoredConversationId(): string | null;
|
|
49
51
|
export declare const isLoading: import("@preact/signals-core").Signal<boolean>;
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Tooltips Store
|
|
3
|
+
* Signal-based state for tooltip visibility and data
|
|
4
|
+
*/
|
|
5
|
+
import type { TooltipData } from '../api/client';
|
|
6
|
+
export interface TooltipInstance {
|
|
7
|
+
id: string;
|
|
8
|
+
data: TooltipData;
|
|
9
|
+
anchor: HTMLElement;
|
|
10
|
+
isVisible: boolean;
|
|
11
|
+
}
|
|
12
|
+
export declare const tooltips: import("@preact/signals-core").Signal<Map<string, TooltipInstance>>;
|
|
13
|
+
export declare const visibleTooltipId: import("@preact/signals-core").Signal<string | null>;
|
|
14
|
+
export declare const visibleTooltip: import("@preact/signals-core").ReadonlySignal<TooltipInstance | null>;
|
|
15
|
+
export declare const tooltipCount: import("@preact/signals-core").ReadonlySignal<number>;
|
|
16
|
+
export declare const registerTooltip: (id: string, data: TooltipData, anchor: HTMLElement) => void;
|
|
17
|
+
export declare const unregisterTooltip: (id: string) => void;
|
|
18
|
+
export declare const showTooltip: (id: string) => void;
|
|
19
|
+
export declare const hideTooltip: (id: string) => void;
|
|
20
|
+
export declare const hideAllTooltips: () => void;
|
|
21
|
+
export declare const resetTooltips: () => void;
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Tools Module - Code-first tool definitions for Pillar SDK.
|
|
3
|
+
*
|
|
4
|
+
* This module enables developers to define tools in their application code
|
|
5
|
+
* rather than in the admin UI. Tool metadata is synced to the server during
|
|
6
|
+
* CI/CD builds via the `pillar-sync` CLI.
|
|
7
|
+
*
|
|
8
|
+
* @example
|
|
9
|
+
* ```ts
|
|
10
|
+
* // 1. Define tools in your app (e.g., hooks/usePillarTools.ts)
|
|
11
|
+
* import { usePillarTool } from '@pillar-ai/react';
|
|
12
|
+
*
|
|
13
|
+
* usePillarTool({
|
|
14
|
+
* name: 'open_settings',
|
|
15
|
+
* description: 'Navigate to settings page',
|
|
16
|
+
* type: 'navigate',
|
|
17
|
+
* execute: () => router.push('/settings'),
|
|
18
|
+
* });
|
|
19
|
+
*
|
|
20
|
+
* // 2. Sync tools via CI/CD
|
|
21
|
+
* // npx pillar-sync --scan ./src
|
|
22
|
+
* ```
|
|
23
|
+
*
|
|
24
|
+
* @module tools
|
|
25
|
+
*/
|
|
26
|
+
export type { ToolType, ToolDataSchema, ToolDataSchemaProperty, ToolDefinition, ToolDefinitions, ToolManifest, ToolManifestEntry, ClientInfo, Platform, SyncToolDefinition, SyncToolDefinitions, ToolTypeDataMap, NavigateToolData, TriggerToolData, InlineUIData, ExternalLinkData, CopyTextData, QueryToolData, ToolDataType, ToolNames, TypedTaskHandler, TypedOnTask, TypedPillarMethods, ToolExecuteResult, ToolSchema, ActionType, ActionDataSchema, ActionDataSchemaProperty, ActionDefinition, ActionDefinitions, ActionManifest, ActionManifestEntry, SyncActionDefinition, SyncActionDefinitions, NavigateActionData, TriggerActionData, QueryActionData, ActionTypeDataMap, ActionDataType, ActionNames, ActionResult, ActionSchema, } from './types';
|
|
27
|
+
export { setClientInfo, getClientInfo, getHandler, getToolDefinition, hasTool, getToolNames, getManifest, clearRegistry, getToolCount, getActionDefinition, hasAction, getActionNames, getActionCount, } from './registry';
|
|
@@ -0,0 +1,106 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Tool Registry - Manages code-defined tool handlers.
|
|
3
|
+
*
|
|
4
|
+
* This module provides the registration and lookup mechanism for
|
|
5
|
+
* tools defined in code. Tools are registered at runtime via
|
|
6
|
+
* `pillar.onTask()` and can be looked up by name using `getHandler()`.
|
|
7
|
+
*
|
|
8
|
+
* Tool metadata is synced to the server during CI/CD builds using
|
|
9
|
+
* the `pillar-sync` CLI with a scan pattern:
|
|
10
|
+
*
|
|
11
|
+
* @example
|
|
12
|
+
* ```ts
|
|
13
|
+
* // lib/pillar/tools/index.ts
|
|
14
|
+
* import type { SyncToolDefinitions } from '@pillar-ai/sdk';
|
|
15
|
+
*
|
|
16
|
+
* export const tools = {
|
|
17
|
+
* open_settings: {
|
|
18
|
+
* description: 'Navigate to the settings page',
|
|
19
|
+
* type: 'navigate' as const,
|
|
20
|
+
* path: '/settings',
|
|
21
|
+
* autoRun: true,
|
|
22
|
+
* },
|
|
23
|
+
* } as const satisfies SyncToolDefinitions;
|
|
24
|
+
*
|
|
25
|
+
* export default tools;
|
|
26
|
+
*
|
|
27
|
+
* // Sync via CI/CD:
|
|
28
|
+
* // npx pillar-sync --scan ./src
|
|
29
|
+
* ```
|
|
30
|
+
*/
|
|
31
|
+
import type { ToolDefinition, ToolManifest, ClientInfo, Platform } from './types';
|
|
32
|
+
/**
|
|
33
|
+
* Set client platform and version info.
|
|
34
|
+
*
|
|
35
|
+
* Called internally by Pillar.init() to set platform/version
|
|
36
|
+
* for API requests.
|
|
37
|
+
*
|
|
38
|
+
* @param platform - Platform identifier (web, ios, android, desktop)
|
|
39
|
+
* @param version - App version (semver or git SHA)
|
|
40
|
+
*/
|
|
41
|
+
export declare function setClientInfo(platform: Platform, version: string): void;
|
|
42
|
+
/**
|
|
43
|
+
* Get the current client info.
|
|
44
|
+
*
|
|
45
|
+
* @returns Client info or null if not set
|
|
46
|
+
*/
|
|
47
|
+
export declare function getClientInfo(): ClientInfo | null;
|
|
48
|
+
/**
|
|
49
|
+
* Get a registered tool handler by name.
|
|
50
|
+
*
|
|
51
|
+
* @param name - Tool name (e.g., "open_settings")
|
|
52
|
+
* @returns Handler function or undefined if not found
|
|
53
|
+
*/
|
|
54
|
+
export declare function getHandler(name: string): ToolDefinition['handler'] | undefined;
|
|
55
|
+
/**
|
|
56
|
+
* Get a registered tool definition by name.
|
|
57
|
+
*
|
|
58
|
+
* @param name - Tool name
|
|
59
|
+
* @returns Tool definition or undefined if not found
|
|
60
|
+
*/
|
|
61
|
+
export declare function getToolDefinition(name: string): ToolDefinition | undefined;
|
|
62
|
+
/**
|
|
63
|
+
* Check if a tool is registered.
|
|
64
|
+
*
|
|
65
|
+
* @param name - Tool name
|
|
66
|
+
* @returns True if registered
|
|
67
|
+
*/
|
|
68
|
+
export declare function hasTool(name: string): boolean;
|
|
69
|
+
/**
|
|
70
|
+
* Get all registered tool names.
|
|
71
|
+
*
|
|
72
|
+
* @returns Array of tool names
|
|
73
|
+
*/
|
|
74
|
+
export declare function getToolNames(): string[];
|
|
75
|
+
/**
|
|
76
|
+
* Get the tool manifest for syncing to the server.
|
|
77
|
+
*
|
|
78
|
+
* Extracts metadata from all registered tools (without handlers)
|
|
79
|
+
* for sending to the Pillar server during CI/CD.
|
|
80
|
+
*
|
|
81
|
+
* @param platform - Platform to include in manifest
|
|
82
|
+
* @param version - Version to include in manifest
|
|
83
|
+
* @param gitSha - Optional git commit SHA
|
|
84
|
+
* @returns Tool manifest object
|
|
85
|
+
*/
|
|
86
|
+
export declare function getManifest(platform: Platform, version: string, gitSha?: string): ToolManifest;
|
|
87
|
+
/**
|
|
88
|
+
* Clear all registered tools.
|
|
89
|
+
*
|
|
90
|
+
* Primarily for testing purposes.
|
|
91
|
+
*/
|
|
92
|
+
export declare function clearRegistry(): void;
|
|
93
|
+
/**
|
|
94
|
+
* Get the count of registered tools.
|
|
95
|
+
*
|
|
96
|
+
* @returns Number of registered tools
|
|
97
|
+
*/
|
|
98
|
+
export declare function getToolCount(): number;
|
|
99
|
+
/** @deprecated Use getToolDefinition instead */
|
|
100
|
+
export declare const getActionDefinition: typeof getToolDefinition;
|
|
101
|
+
/** @deprecated Use hasTool instead */
|
|
102
|
+
export declare const hasAction: typeof hasTool;
|
|
103
|
+
/** @deprecated Use getToolNames instead */
|
|
104
|
+
export declare const getActionNames: typeof getToolNames;
|
|
105
|
+
/** @deprecated Use getToolCount instead */
|
|
106
|
+
export declare const getActionCount: typeof getToolCount;
|