@pillar-ai/sdk 0.1.28 → 0.1.30
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/client.d.ts +2 -0
- package/dist/cli/sync.js +15 -3
- package/dist/components/Button/EdgeTrigger.d.ts +5 -0
- package/dist/components/Button/FloatingButton.d.ts +46 -0
- package/dist/components/PagePilot/styles.d.ts +1 -1
- package/dist/components/Panel/Panel.d.ts +5 -0
- 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/context.d.ts +6 -2
- package/dist/components/index.d.ts +0 -1
- 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 +0 -1
- package/dist/core/config.d.ts +48 -0
- package/dist/pillar.esm.js +1 -1
- package/dist/store/suggestions.d.ts +1 -1
- package/dist/store/tooltips.d.ts +21 -0
- package/dist/tools/types.d.ts +29 -14
- package/dist/utils/helpdesk.d.ts +33 -0
- package/dist/utils/markdown.d.ts +9 -0
- package/dist/utils/normalize-tool-result.d.ts +10 -0
- package/package.json +1 -1
|
@@ -23,7 +23,7 @@ export declare const hasSuggestions: import("@preact/signals-core").ReadonlySign
|
|
|
23
23
|
export declare const hasPool: import("@preact/signals-core").ReadonlySignal<boolean>;
|
|
24
24
|
/**
|
|
25
25
|
* Sort suggestions by relevance to the current page.
|
|
26
|
-
*
|
|
26
|
+
* First filters by path pattern, then scores by keyword matching.
|
|
27
27
|
*
|
|
28
28
|
* @param pool - Full pool of suggestions from backend
|
|
29
29
|
* @param pathname - Current page pathname (e.g., '/dashboards/new')
|
|
@@ -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;
|
package/dist/tools/types.d.ts
CHANGED
|
@@ -491,19 +491,18 @@ export interface ToolExecuteResult {
|
|
|
491
491
|
* @example
|
|
492
492
|
* ```ts
|
|
493
493
|
* pillar.defineTool({
|
|
494
|
-
* name: '
|
|
495
|
-
* description: '
|
|
496
|
-
*
|
|
494
|
+
* name: 'get_signing_secret',
|
|
495
|
+
* description: 'Retrieve the webhook signing secret',
|
|
496
|
+
* outputSchema: {
|
|
497
497
|
* type: 'object',
|
|
498
498
|
* properties: {
|
|
499
|
-
*
|
|
500
|
-
*
|
|
499
|
+
* signing_secret: { type: 'string', sensitive: true },
|
|
500
|
+
* algorithm: { type: 'string' },
|
|
501
501
|
* },
|
|
502
|
-
* required: ['productId', 'quantity'],
|
|
503
502
|
* },
|
|
504
|
-
* execute: async (
|
|
505
|
-
* await
|
|
506
|
-
* return {
|
|
503
|
+
* execute: async () => {
|
|
504
|
+
* const secret = await api.getSigningSecret();
|
|
505
|
+
* return { signing_secret: secret.value, algorithm: 'HMAC-SHA256' };
|
|
507
506
|
* },
|
|
508
507
|
* });
|
|
509
508
|
* ```
|
|
@@ -563,15 +562,31 @@ export interface ToolSchema<TInput = Record<string, unknown>> {
|
|
|
563
562
|
* @default true
|
|
564
563
|
*/
|
|
565
564
|
autoComplete?: boolean;
|
|
565
|
+
/**
|
|
566
|
+
* Context required for this tool to be available.
|
|
567
|
+
*
|
|
568
|
+
* When set, the tool is only offered to users whose current context
|
|
569
|
+
* (set via `pillar.setContext()`) matches every key/value pair.
|
|
570
|
+
*
|
|
571
|
+
* @example { userRole: 'admin' }
|
|
572
|
+
* @example { plan: 'enterprise', betaAccess: true }
|
|
573
|
+
*/
|
|
574
|
+
requiredContext?: Record<string, unknown>;
|
|
566
575
|
/**
|
|
567
576
|
* Handler function executed when the AI invokes this tool.
|
|
568
577
|
*
|
|
569
|
-
*
|
|
570
|
-
*
|
|
571
|
-
*
|
|
572
|
-
*
|
|
578
|
+
* Return a plain object matching the `outputSchema`. The SDK sends
|
|
579
|
+
* it directly to the backend with no wrapping — what you return is
|
|
580
|
+
* what the agent sees.
|
|
581
|
+
*
|
|
582
|
+
* To signal failure, throw an error. The SDK catches it and sends
|
|
583
|
+
* `{ success: false, error: message }` to the agent automatically.
|
|
584
|
+
*
|
|
585
|
+
* For backward compatibility the SDK also accepts the legacy
|
|
586
|
+
* `{ success, data }` envelope and unwraps it, but new tools should
|
|
587
|
+
* return flat data.
|
|
573
588
|
*/
|
|
574
|
-
execute: (input: TInput) => Promise<ToolExecuteResult | unknown | void> | ToolExecuteResult | unknown | void;
|
|
589
|
+
execute: (input: TInput) => Promise<ToolExecuteResult | Record<string, unknown> | void> | ToolExecuteResult | Record<string, unknown> | void;
|
|
575
590
|
/**
|
|
576
591
|
* Whether to also register this tool with WebMCP (navigator.modelContext).
|
|
577
592
|
*
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Help Desk Utilities
|
|
3
|
+
* Functions to trigger external help desk widgets (Intercom, Pylon, Zendesk, Freshdesk)
|
|
4
|
+
*/
|
|
5
|
+
import type { HelpDeskProvider } from '../core/config';
|
|
6
|
+
declare global {
|
|
7
|
+
interface Window {
|
|
8
|
+
Intercom?: (command: string, ...args: unknown[]) => void;
|
|
9
|
+
Pylon?: (command: string, ...args: unknown[]) => void;
|
|
10
|
+
zE?: (widget: string, command: string, ...args: unknown[]) => void;
|
|
11
|
+
FreshworksWidget?: (command: string, ...args: unknown[]) => void;
|
|
12
|
+
}
|
|
13
|
+
}
|
|
14
|
+
/**
|
|
15
|
+
* Context to pass to help desk when escalating
|
|
16
|
+
*/
|
|
17
|
+
export interface HelpDeskContext {
|
|
18
|
+
conversationSummary?: string;
|
|
19
|
+
currentPage?: string;
|
|
20
|
+
userId?: string;
|
|
21
|
+
}
|
|
22
|
+
/**
|
|
23
|
+
* Trigger the appropriate help desk widget based on provider
|
|
24
|
+
*/
|
|
25
|
+
export declare function triggerHelpDesk(provider: HelpDeskProvider, context?: HelpDeskContext): boolean;
|
|
26
|
+
/**
|
|
27
|
+
* Open email client with optional subject and body
|
|
28
|
+
*/
|
|
29
|
+
export declare function openEmail(emailAddress: string, subject?: string, body?: string): void;
|
|
30
|
+
/**
|
|
31
|
+
* Open a URL in a new tab
|
|
32
|
+
*/
|
|
33
|
+
export declare function openUrl(url: string): void;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Normalize a tool handler's return value into the payload sent to the backend.
|
|
3
|
+
*
|
|
4
|
+
* Accepted handler return shapes:
|
|
5
|
+
* { success: true, data: { ... } } → returns the data object
|
|
6
|
+
* { success: false, error: "..." } → forwarded as-is (backend reads error)
|
|
7
|
+
* { key: "val", ... } → passed through unchanged
|
|
8
|
+
* "string" / number / array → passed through unchanged
|
|
9
|
+
*/
|
|
10
|
+
export declare function normalizeToolResult(raw: unknown): unknown;
|
package/package.json
CHANGED