@pillar-ai/sdk 0.1.34 → 0.2.0
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 +5 -5
- package/dist/api/mcp-client.d.ts +0 -4
- package/dist/cli/sync.js +0 -0
- package/dist/components/Cards/ConfirmActionCard.d.ts +16 -5
- package/dist/components/Panel/TaskButton.d.ts +2 -0
- package/dist/core/Pillar.d.ts +44 -2
- package/dist/core/config.d.ts +7 -1
- package/dist/core/events.d.ts +26 -13
- package/dist/index.d.ts +6 -4
- package/dist/pillar.esm.js +1 -1
- package/dist/store/chat.d.ts +5 -0
- package/dist/tools/types.d.ts +8 -1
- package/package.json +1 -1
- package/dist/actions/definitions/analytics.d.ts +0 -18
- package/dist/actions/definitions/content.d.ts +0 -40
- package/dist/actions/definitions/index.d.ts +0 -26
- package/dist/actions/definitions/navigation.d.ts +0 -65
- package/dist/actions/definitions/settings.d.ts +0 -162
- package/dist/actions/definitions/sources.d.ts +0 -44
- package/dist/actions/definitions/support.d.ts +0 -15
- package/dist/actions/definitions/team.d.ts +0 -120
- package/dist/actions/index.d.ts +0 -33
- package/dist/actions/registry.d.ts +0 -98
- package/dist/actions/types.d.ts +0 -530
- package/dist/api/ag-ui-adapter.d.ts +0 -76
- package/dist/api/ag-ui-bridge.d.ts +0 -49
- package/dist/api/ag-ui-client.d.ts +0 -102
- package/dist/api/ag-ui-handler.d.ts +0 -89
- package/dist/button/FloatingButton.d.ts +0 -44
- package/dist/components/Button/FloatingButton.d.ts +0 -46
- package/dist/components/DevTools/DOMScannerPreview.d.ts +0 -21
- package/dist/components/DevTools/styles.d.ts +0 -5
- package/dist/components/PagePilot/PagePilotBanner.d.ts +0 -7
- package/dist/components/PagePilot/PagePilotManager.d.ts +0 -47
- package/dist/components/PagePilot/index.d.ts +0 -6
- package/dist/components/PagePilot/styles.d.ts +0 -6
- package/dist/components/Panel/styles.d.ts +0 -20
- package/dist/components/Plan/InlinePlanView.d.ts +0 -24
- package/dist/components/Plan/PlanDocument.d.ts +0 -18
- package/dist/components/Plan/PlanStepItem.d.ts +0 -23
- package/dist/components/Plan/PlanView.d.ts +0 -10
- package/dist/components/Plan/index.d.ts +0 -9
- package/dist/components/Progress/AGUIProgress.d.ts +0 -15
- package/dist/components/Progress/ReasoningDisclosure.d.ts +0 -16
- package/dist/components/TextSelection/styles.d.ts +0 -5
- package/dist/components/Tooltips/Tooltip.d.ts +0 -46
- package/dist/components/Tooltips/TooltipManager.d.ts +0 -41
- package/dist/components/Tooltips/index.d.ts +0 -6
- package/dist/components/Tooltips/styles.d.ts +0 -5
- package/dist/components/Views/ArticleChatView.d.ts +0 -9
- package/dist/components/Views/ArticleView.d.ts +0 -10
- package/dist/components/Views/CategoryView.d.ts +0 -11
- package/dist/components/Views/DeveloperView.d.ts +0 -6
- package/dist/components/Views/SearchView.d.ts +0 -10
- package/dist/components/shared/ArticleCard.d.ts +0 -17
- package/dist/components/shared/CategoryCard.d.ts +0 -17
- package/dist/content/extensions/AccordionNode.d.ts +0 -10
- package/dist/content/extensions/CalloutNode.d.ts +0 -11
- package/dist/content/extensions/index.d.ts +0 -5
- package/dist/content/index.d.ts +0 -5
- package/dist/content/renderer.d.ts +0 -24
- package/dist/core/plan-executor.d.ts +0 -148
- package/dist/core/plan.d.ts +0 -192
- package/dist/hooks/useInlineCard.d.ts +0 -35
- package/dist/panel/Panel.d.ts +0 -53
- package/dist/panel/PanelUI.d.ts +0 -43
- package/dist/panel/components/ArticleCard.d.ts +0 -10
- package/dist/panel/components/CategoryCard.d.ts +0 -10
- package/dist/panel/components/ChatInput.d.ts +0 -36
- package/dist/panel/components/Header.d.ts +0 -16
- package/dist/panel/components/SearchInput.d.ts +0 -11
- package/dist/panel/styles.d.ts +0 -5
- package/dist/panel/views/ArticleView.d.ts +0 -21
- package/dist/panel/views/CategoryView.d.ts +0 -20
- package/dist/panel/views/ChatView.d.ts +0 -30
- package/dist/panel/views/HomeView.d.ts +0 -18
- package/dist/panel/views/SearchView.d.ts +0 -22
- package/dist/store/developer.d.ts +0 -19
- package/dist/store/plan-persistence.d.ts +0 -47
- package/dist/store/plan.d.ts +0 -45
- package/dist/store/tooltips.d.ts +0 -21
- package/dist/tooltips/Tooltip.d.ts +0 -63
- package/dist/tooltips/TooltipManager.d.ts +0 -42
- package/dist/tooltips/styles.d.ts +0 -5
- package/dist/ui/config.d.ts +0 -96
- package/dist/ui/executor.d.ts +0 -75
- package/dist/ui/index.d.ts +0 -11
- package/dist/ui/scanner.d.ts +0 -105
- package/dist/ui/types.d.ts +0 -293
- package/dist/utils/markdown.d.ts +0 -9
package/dist/store/chat.d.ts
CHANGED
|
@@ -41,6 +41,7 @@ export interface StoredChatMessage extends ChatMessage {
|
|
|
41
41
|
images?: ChatImage[];
|
|
42
42
|
progressEvents?: ProgressEvent[];
|
|
43
43
|
segments?: MessageSegment[];
|
|
44
|
+
hidden?: boolean;
|
|
44
45
|
}
|
|
45
46
|
export declare const messages: import("@preact/signals-core").Signal<StoredChatMessage[]>;
|
|
46
47
|
export declare const conversationId: import("@preact/signals-core").Signal<string | null>;
|
|
@@ -177,6 +178,7 @@ export declare const currentSources: import("@preact/signals-core").Signal<Artic
|
|
|
177
178
|
export declare const currentActions: import("@preact/signals-core").Signal<TaskButtonData[]>;
|
|
178
179
|
export declare const prefillText: import("@preact/signals-core").Signal<string>;
|
|
179
180
|
export declare const pendingMessage: import("@preact/signals-core").Signal<string | null>;
|
|
181
|
+
export declare const pendingHiddenMessage: import("@preact/signals-core").Signal<string | null>;
|
|
180
182
|
export declare const submitPendingTrigger: import("@preact/signals-core").Signal<number>;
|
|
181
183
|
export declare const focusInputTrigger: import("@preact/signals-core").Signal<number>;
|
|
182
184
|
export declare const userContext: import("@preact/signals-core").Signal<UserContextItem[]>;
|
|
@@ -201,6 +203,7 @@ export declare const removePendingImage: (id: string) => void;
|
|
|
201
203
|
export declare const clearPendingImages: () => void;
|
|
202
204
|
export declare const hasMessages: import("@preact/signals-core").ReadonlySignal<boolean>;
|
|
203
205
|
export declare const addUserMessage: (content: string, userContext?: UserContextItem[], images?: ChatImage[]) => void;
|
|
206
|
+
export declare const addHiddenUserMessage: (content: string) => void;
|
|
204
207
|
export declare const addAssistantMessage: (content: string, messageId?: string) => void;
|
|
205
208
|
export declare const updateLastAssistantMessage: (content: string | undefined, messageId?: string, actions?: TaskButtonData[], sources?: ArticleSummary[]) => void;
|
|
206
209
|
export declare const setActionPending: (messageIndex: number, actionName: string) => void;
|
|
@@ -257,6 +260,8 @@ export declare const setPrefillText: (text: string) => void;
|
|
|
257
260
|
export declare const clearPrefillText: () => void;
|
|
258
261
|
export declare const setPendingMessage: (message: string) => void;
|
|
259
262
|
export declare const clearPendingMessage: () => void;
|
|
263
|
+
export declare const setPendingHiddenMessage: (message: string) => void;
|
|
264
|
+
export declare const clearPendingHiddenMessage: () => void;
|
|
260
265
|
export declare const triggerSubmitPending: () => void;
|
|
261
266
|
export declare const triggerInputFocus: () => void;
|
|
262
267
|
export declare const addUserContext: <T extends Omit<UserContextItem, "id">>(item: T) => void;
|
package/dist/tools/types.d.ts
CHANGED
|
@@ -575,7 +575,7 @@ export interface ToolSchemaBase<TInput = Record<string, unknown>> {
|
|
|
575
575
|
* name: 'show_results',
|
|
576
576
|
* description: 'Display search results inline',
|
|
577
577
|
* type: 'inline_ui',
|
|
578
|
-
* render: (container, data
|
|
578
|
+
* render: (container, data) => {
|
|
579
579
|
* container.innerHTML = `<div>${data.items.length} results</div>`;
|
|
580
580
|
* return () => { container.innerHTML = ''; };
|
|
581
581
|
* },
|
|
@@ -643,6 +643,13 @@ export interface ExecutableToolSchema<TInput = Record<string, unknown>> extends
|
|
|
643
643
|
execute: (input: TInput) => Promise<ToolExecuteResult | Record<string, unknown> | void> | ToolExecuteResult | Record<string, unknown> | void;
|
|
644
644
|
/** Not applicable for executable tools. Only `inline_ui` tools use `render`. */
|
|
645
645
|
render?: never;
|
|
646
|
+
/**
|
|
647
|
+
* When true, the SDK shows a confirmation UI before calling `execute`.
|
|
648
|
+
* The user must click Confirm to proceed, or Cancel to dismiss.
|
|
649
|
+
*
|
|
650
|
+
* @default false
|
|
651
|
+
*/
|
|
652
|
+
needsConfirmation?: boolean;
|
|
646
653
|
}
|
|
647
654
|
/**
|
|
648
655
|
* Unified tool definition that co-locates metadata and handler.
|
package/package.json
CHANGED
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
export declare const analyticsActions: {
|
|
2
|
-
view_search_analytics: {
|
|
3
|
-
description: string;
|
|
4
|
-
type: "navigate";
|
|
5
|
-
path: string;
|
|
6
|
-
autoRun: true;
|
|
7
|
-
autoComplete: true;
|
|
8
|
-
handler: () => void;
|
|
9
|
-
};
|
|
10
|
-
view_ai_analytics: {
|
|
11
|
-
description: string;
|
|
12
|
-
type: "navigate";
|
|
13
|
-
path: string;
|
|
14
|
-
autoRun: true;
|
|
15
|
-
autoComplete: true;
|
|
16
|
-
handler: () => void;
|
|
17
|
-
};
|
|
18
|
-
};
|
|
@@ -1,40 +0,0 @@
|
|
|
1
|
-
export declare const contentActions: {
|
|
2
|
-
view_all_articles: {
|
|
3
|
-
description: string;
|
|
4
|
-
type: "navigate";
|
|
5
|
-
path: string;
|
|
6
|
-
autoRun: true;
|
|
7
|
-
autoComplete: true;
|
|
8
|
-
handler: () => void;
|
|
9
|
-
};
|
|
10
|
-
view_article: {
|
|
11
|
-
description: string;
|
|
12
|
-
type: "trigger_action";
|
|
13
|
-
autoRun: false;
|
|
14
|
-
autoComplete: false;
|
|
15
|
-
defaultData: {
|
|
16
|
-
action: string;
|
|
17
|
-
};
|
|
18
|
-
handler: () => void;
|
|
19
|
-
};
|
|
20
|
-
filter_stale: {
|
|
21
|
-
description: string;
|
|
22
|
-
type: "trigger_action";
|
|
23
|
-
autoRun: false;
|
|
24
|
-
autoComplete: false;
|
|
25
|
-
defaultData: {
|
|
26
|
-
action: string;
|
|
27
|
-
};
|
|
28
|
-
handler: () => void;
|
|
29
|
-
};
|
|
30
|
-
view_categories: {
|
|
31
|
-
description: string;
|
|
32
|
-
type: "trigger_action";
|
|
33
|
-
autoRun: false;
|
|
34
|
-
autoComplete: false;
|
|
35
|
-
defaultData: {
|
|
36
|
-
action: string;
|
|
37
|
-
};
|
|
38
|
-
handler: () => void;
|
|
39
|
-
};
|
|
40
|
-
};
|
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Action Definitions Index
|
|
3
|
-
*
|
|
4
|
-
* Imports and registers all action definitions for the Pillar Admin app.
|
|
5
|
-
* These are code-first action definitions that get synced to the backend
|
|
6
|
-
* during CI/CD builds.
|
|
7
|
-
*
|
|
8
|
-
* To use in your app:
|
|
9
|
-
* 1. Import this file early in your app initialization
|
|
10
|
-
* 2. Or create your own action definitions using defineActions()
|
|
11
|
-
*
|
|
12
|
-
* The action metadata is extracted via `npm run extract-actions` and
|
|
13
|
-
* synced to the backend via `npm run sync-actions`.
|
|
14
|
-
*/
|
|
15
|
-
import './navigation';
|
|
16
|
-
import './settings';
|
|
17
|
-
import './sources';
|
|
18
|
-
import './analytics';
|
|
19
|
-
import './team';
|
|
20
|
-
import './support';
|
|
21
|
-
export { navigationActions } from './navigation';
|
|
22
|
-
export { settingsActions } from './settings';
|
|
23
|
-
export { sourcesActions } from './sources';
|
|
24
|
-
export { analyticsActions } from './analytics';
|
|
25
|
-
export { teamActions } from './team';
|
|
26
|
-
export { supportActions } from './support';
|
|
@@ -1,65 +0,0 @@
|
|
|
1
|
-
export declare const navigationActions: {
|
|
2
|
-
open_knowledge: {
|
|
3
|
-
description: string;
|
|
4
|
-
examples: string[];
|
|
5
|
-
type: "navigate";
|
|
6
|
-
path: string;
|
|
7
|
-
autoRun: true;
|
|
8
|
-
autoComplete: true;
|
|
9
|
-
handler: () => void;
|
|
10
|
-
};
|
|
11
|
-
open_settings: {
|
|
12
|
-
description: string;
|
|
13
|
-
examples: string[];
|
|
14
|
-
type: "navigate";
|
|
15
|
-
path: string;
|
|
16
|
-
autoRun: true;
|
|
17
|
-
autoComplete: true;
|
|
18
|
-
handler: () => void;
|
|
19
|
-
};
|
|
20
|
-
open_actions: {
|
|
21
|
-
description: string;
|
|
22
|
-
examples: string[];
|
|
23
|
-
type: "navigate";
|
|
24
|
-
path: string;
|
|
25
|
-
autoRun: true;
|
|
26
|
-
autoComplete: true;
|
|
27
|
-
handler: () => void;
|
|
28
|
-
};
|
|
29
|
-
open_analytics: {
|
|
30
|
-
description: string;
|
|
31
|
-
examples: string[];
|
|
32
|
-
type: "navigate";
|
|
33
|
-
path: string;
|
|
34
|
-
autoRun: true;
|
|
35
|
-
autoComplete: true;
|
|
36
|
-
handler: () => void;
|
|
37
|
-
};
|
|
38
|
-
open_ai_tester: {
|
|
39
|
-
description: string;
|
|
40
|
-
examples: string[];
|
|
41
|
-
type: "navigate";
|
|
42
|
-
path: string;
|
|
43
|
-
autoRun: true;
|
|
44
|
-
autoComplete: true;
|
|
45
|
-
handler: () => void;
|
|
46
|
-
};
|
|
47
|
-
open_configure: {
|
|
48
|
-
description: string;
|
|
49
|
-
examples: string[];
|
|
50
|
-
type: "navigate";
|
|
51
|
-
path: string;
|
|
52
|
-
autoRun: true;
|
|
53
|
-
autoComplete: true;
|
|
54
|
-
handler: () => void;
|
|
55
|
-
};
|
|
56
|
-
create_new_action: {
|
|
57
|
-
description: string;
|
|
58
|
-
examples: string[];
|
|
59
|
-
type: "navigate";
|
|
60
|
-
path: string;
|
|
61
|
-
autoRun: true;
|
|
62
|
-
autoComplete: true;
|
|
63
|
-
handler: () => void;
|
|
64
|
-
};
|
|
65
|
-
};
|
|
@@ -1,162 +0,0 @@
|
|
|
1
|
-
export declare const settingsActions: {
|
|
2
|
-
open_branding_settings: {
|
|
3
|
-
description: string;
|
|
4
|
-
examples: string[];
|
|
5
|
-
type: "navigate";
|
|
6
|
-
path: string;
|
|
7
|
-
autoRun: true;
|
|
8
|
-
autoComplete: true;
|
|
9
|
-
handler: () => void;
|
|
10
|
-
};
|
|
11
|
-
open_layout_settings: {
|
|
12
|
-
description: string;
|
|
13
|
-
examples: string[];
|
|
14
|
-
type: "navigate";
|
|
15
|
-
path: string;
|
|
16
|
-
autoRun: true;
|
|
17
|
-
autoComplete: true;
|
|
18
|
-
handler: () => void;
|
|
19
|
-
};
|
|
20
|
-
open_header_settings: {
|
|
21
|
-
description: string;
|
|
22
|
-
examples: string[];
|
|
23
|
-
type: "navigate";
|
|
24
|
-
path: string;
|
|
25
|
-
autoRun: true;
|
|
26
|
-
autoComplete: true;
|
|
27
|
-
handler: () => void;
|
|
28
|
-
};
|
|
29
|
-
open_footer_settings: {
|
|
30
|
-
description: string;
|
|
31
|
-
examples: string[];
|
|
32
|
-
type: "navigate";
|
|
33
|
-
path: string;
|
|
34
|
-
autoRun: true;
|
|
35
|
-
autoComplete: true;
|
|
36
|
-
handler: () => void;
|
|
37
|
-
};
|
|
38
|
-
open_features_settings: {
|
|
39
|
-
description: string;
|
|
40
|
-
examples: string[];
|
|
41
|
-
type: "navigate";
|
|
42
|
-
path: string;
|
|
43
|
-
autoRun: true;
|
|
44
|
-
autoComplete: true;
|
|
45
|
-
handler: () => void;
|
|
46
|
-
};
|
|
47
|
-
open_ai_settings: {
|
|
48
|
-
description: string;
|
|
49
|
-
examples: string[];
|
|
50
|
-
type: "navigate";
|
|
51
|
-
path: string;
|
|
52
|
-
autoRun: true;
|
|
53
|
-
autoComplete: true;
|
|
54
|
-
handler: () => void;
|
|
55
|
-
};
|
|
56
|
-
open_seo_settings: {
|
|
57
|
-
description: string;
|
|
58
|
-
examples: string[];
|
|
59
|
-
type: "navigate";
|
|
60
|
-
path: string;
|
|
61
|
-
autoRun: true;
|
|
62
|
-
autoComplete: true;
|
|
63
|
-
handler: () => void;
|
|
64
|
-
};
|
|
65
|
-
enable_ai_assistant: {
|
|
66
|
-
description: string;
|
|
67
|
-
type: "trigger_action";
|
|
68
|
-
autoRun: false;
|
|
69
|
-
autoComplete: false;
|
|
70
|
-
defaultData: {
|
|
71
|
-
action: string;
|
|
72
|
-
target: string;
|
|
73
|
-
};
|
|
74
|
-
handler: () => void;
|
|
75
|
-
};
|
|
76
|
-
disable_ai_assistant: {
|
|
77
|
-
description: string;
|
|
78
|
-
type: "trigger_action";
|
|
79
|
-
autoRun: false;
|
|
80
|
-
autoComplete: false;
|
|
81
|
-
defaultData: {
|
|
82
|
-
action: string;
|
|
83
|
-
target: string;
|
|
84
|
-
};
|
|
85
|
-
handler: () => void;
|
|
86
|
-
};
|
|
87
|
-
enable_dark_mode: {
|
|
88
|
-
description: string;
|
|
89
|
-
examples: string[];
|
|
90
|
-
type: "trigger_action";
|
|
91
|
-
autoRun: true;
|
|
92
|
-
autoComplete: true;
|
|
93
|
-
defaultData: {
|
|
94
|
-
action: string;
|
|
95
|
-
theme: string;
|
|
96
|
-
};
|
|
97
|
-
handler: () => void;
|
|
98
|
-
};
|
|
99
|
-
disable_dark_mode: {
|
|
100
|
-
description: string;
|
|
101
|
-
examples: string[];
|
|
102
|
-
type: "trigger_action";
|
|
103
|
-
autoRun: true;
|
|
104
|
-
autoComplete: true;
|
|
105
|
-
defaultData: {
|
|
106
|
-
action: string;
|
|
107
|
-
theme: string;
|
|
108
|
-
};
|
|
109
|
-
handler: () => void;
|
|
110
|
-
};
|
|
111
|
-
toggle_dark_mode: {
|
|
112
|
-
description: string;
|
|
113
|
-
examples: string[];
|
|
114
|
-
type: "trigger_action";
|
|
115
|
-
autoRun: true;
|
|
116
|
-
autoComplete: true;
|
|
117
|
-
defaultData: {
|
|
118
|
-
action: string;
|
|
119
|
-
};
|
|
120
|
-
handler: () => void;
|
|
121
|
-
};
|
|
122
|
-
change_theme: {
|
|
123
|
-
description: string;
|
|
124
|
-
type: "trigger_action";
|
|
125
|
-
autoRun: true;
|
|
126
|
-
autoComplete: true;
|
|
127
|
-
defaultData: {
|
|
128
|
-
action: string;
|
|
129
|
-
};
|
|
130
|
-
handler: () => void;
|
|
131
|
-
};
|
|
132
|
-
update_logo: {
|
|
133
|
-
description: string;
|
|
134
|
-
type: "trigger_action";
|
|
135
|
-
autoRun: true;
|
|
136
|
-
autoComplete: true;
|
|
137
|
-
defaultData: {
|
|
138
|
-
action: string;
|
|
139
|
-
};
|
|
140
|
-
handler: () => void;
|
|
141
|
-
};
|
|
142
|
-
add_footer_link: {
|
|
143
|
-
description: string;
|
|
144
|
-
type: "trigger_action";
|
|
145
|
-
autoRun: true;
|
|
146
|
-
autoComplete: true;
|
|
147
|
-
defaultData: {
|
|
148
|
-
action: string;
|
|
149
|
-
};
|
|
150
|
-
handler: () => void;
|
|
151
|
-
};
|
|
152
|
-
configure_suggested_questions: {
|
|
153
|
-
description: string;
|
|
154
|
-
type: "trigger_action";
|
|
155
|
-
autoRun: true;
|
|
156
|
-
autoComplete: true;
|
|
157
|
-
defaultData: {
|
|
158
|
-
action: string;
|
|
159
|
-
};
|
|
160
|
-
handler: () => void;
|
|
161
|
-
};
|
|
162
|
-
};
|
|
@@ -1,44 +0,0 @@
|
|
|
1
|
-
export declare const sourcesActions: {
|
|
2
|
-
add_new_source: {
|
|
3
|
-
description: string;
|
|
4
|
-
examples: string[];
|
|
5
|
-
type: "navigate";
|
|
6
|
-
path: string;
|
|
7
|
-
autoRun: true;
|
|
8
|
-
autoComplete: true;
|
|
9
|
-
dataSchema: {
|
|
10
|
-
type: "object";
|
|
11
|
-
properties: {
|
|
12
|
-
type: {
|
|
13
|
-
type: "string";
|
|
14
|
-
description: string;
|
|
15
|
-
};
|
|
16
|
-
url: {
|
|
17
|
-
type: "string";
|
|
18
|
-
description: string;
|
|
19
|
-
};
|
|
20
|
-
name: {
|
|
21
|
-
type: "string";
|
|
22
|
-
description: string;
|
|
23
|
-
};
|
|
24
|
-
};
|
|
25
|
-
};
|
|
26
|
-
handler: () => void;
|
|
27
|
-
};
|
|
28
|
-
crawl_website: {
|
|
29
|
-
description: string;
|
|
30
|
-
type: "navigate";
|
|
31
|
-
path: string;
|
|
32
|
-
autoRun: true;
|
|
33
|
-
autoComplete: true;
|
|
34
|
-
handler: () => void;
|
|
35
|
-
};
|
|
36
|
-
connect_cloud_storage: {
|
|
37
|
-
description: string;
|
|
38
|
-
type: "navigate";
|
|
39
|
-
path: string;
|
|
40
|
-
autoRun: true;
|
|
41
|
-
autoComplete: true;
|
|
42
|
-
handler: () => void;
|
|
43
|
-
};
|
|
44
|
-
};
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
export declare const supportActions: {
|
|
2
|
-
escalate: {
|
|
3
|
-
description: string;
|
|
4
|
-
examples: string[];
|
|
5
|
-
type: "external_link";
|
|
6
|
-
externalUrl: string;
|
|
7
|
-
handler: () => void;
|
|
8
|
-
};
|
|
9
|
-
defer: {
|
|
10
|
-
description: string;
|
|
11
|
-
examples: string[];
|
|
12
|
-
type: "trigger_action";
|
|
13
|
-
handler: () => void;
|
|
14
|
-
};
|
|
15
|
-
};
|
|
@@ -1,120 +0,0 @@
|
|
|
1
|
-
export declare const teamActions: {
|
|
2
|
-
open_team_settings: {
|
|
3
|
-
description: string;
|
|
4
|
-
type: "navigate";
|
|
5
|
-
path: string;
|
|
6
|
-
autoRun: true;
|
|
7
|
-
autoComplete: true;
|
|
8
|
-
handler: () => void;
|
|
9
|
-
};
|
|
10
|
-
invite_team_member: {
|
|
11
|
-
description: string;
|
|
12
|
-
type: "inline_ui";
|
|
13
|
-
autoRun: false;
|
|
14
|
-
autoComplete: false;
|
|
15
|
-
defaultData: {
|
|
16
|
-
card_type: string;
|
|
17
|
-
emails: never[];
|
|
18
|
-
role: string;
|
|
19
|
-
};
|
|
20
|
-
dataSchema: {
|
|
21
|
-
type: "object";
|
|
22
|
-
properties: {
|
|
23
|
-
emails: {
|
|
24
|
-
type: "array";
|
|
25
|
-
description: string;
|
|
26
|
-
};
|
|
27
|
-
role: {
|
|
28
|
-
type: "string";
|
|
29
|
-
description: string;
|
|
30
|
-
enum: string[];
|
|
31
|
-
};
|
|
32
|
-
};
|
|
33
|
-
required: string[];
|
|
34
|
-
};
|
|
35
|
-
requiredContext: {
|
|
36
|
-
userRole: string;
|
|
37
|
-
};
|
|
38
|
-
handler: () => void;
|
|
39
|
-
};
|
|
40
|
-
view_pending_invitations: {
|
|
41
|
-
description: string;
|
|
42
|
-
type: "trigger_action";
|
|
43
|
-
autoRun: true;
|
|
44
|
-
autoComplete: true;
|
|
45
|
-
defaultData: {
|
|
46
|
-
action: string;
|
|
47
|
-
};
|
|
48
|
-
requiredContext: {
|
|
49
|
-
userRole: string;
|
|
50
|
-
};
|
|
51
|
-
handler: () => void;
|
|
52
|
-
};
|
|
53
|
-
resend_invitation: {
|
|
54
|
-
description: string;
|
|
55
|
-
type: "trigger_action";
|
|
56
|
-
autoRun: false;
|
|
57
|
-
autoComplete: false;
|
|
58
|
-
defaultData: {
|
|
59
|
-
action: string;
|
|
60
|
-
};
|
|
61
|
-
requiredContext: {
|
|
62
|
-
userRole: string;
|
|
63
|
-
};
|
|
64
|
-
handler: () => void;
|
|
65
|
-
};
|
|
66
|
-
cancel_invitation: {
|
|
67
|
-
description: string;
|
|
68
|
-
type: "trigger_action";
|
|
69
|
-
autoRun: false;
|
|
70
|
-
autoComplete: false;
|
|
71
|
-
defaultData: {
|
|
72
|
-
action: string;
|
|
73
|
-
};
|
|
74
|
-
requiredContext: {
|
|
75
|
-
userRole: string;
|
|
76
|
-
};
|
|
77
|
-
handler: () => void;
|
|
78
|
-
};
|
|
79
|
-
remove_team_member: {
|
|
80
|
-
description: string;
|
|
81
|
-
type: "trigger_action";
|
|
82
|
-
autoRun: false;
|
|
83
|
-
autoComplete: false;
|
|
84
|
-
defaultData: {
|
|
85
|
-
action: string;
|
|
86
|
-
};
|
|
87
|
-
requiredContext: {
|
|
88
|
-
userRole: string;
|
|
89
|
-
};
|
|
90
|
-
handler: () => void;
|
|
91
|
-
};
|
|
92
|
-
promote_to_admin: {
|
|
93
|
-
description: string;
|
|
94
|
-
type: "trigger_action";
|
|
95
|
-
autoRun: false;
|
|
96
|
-
autoComplete: false;
|
|
97
|
-
defaultData: {
|
|
98
|
-
action: string;
|
|
99
|
-
role: string;
|
|
100
|
-
};
|
|
101
|
-
requiredContext: {
|
|
102
|
-
userRole: string;
|
|
103
|
-
};
|
|
104
|
-
handler: () => void;
|
|
105
|
-
};
|
|
106
|
-
demote_to_member: {
|
|
107
|
-
description: string;
|
|
108
|
-
type: "trigger_action";
|
|
109
|
-
autoRun: false;
|
|
110
|
-
autoComplete: false;
|
|
111
|
-
defaultData: {
|
|
112
|
-
action: string;
|
|
113
|
-
role: string;
|
|
114
|
-
};
|
|
115
|
-
requiredContext: {
|
|
116
|
-
userRole: string;
|
|
117
|
-
};
|
|
118
|
-
handler: () => void;
|
|
119
|
-
};
|
|
120
|
-
};
|
package/dist/actions/index.d.ts
DELETED
|
@@ -1,33 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Actions Module - Code-first action definitions for Pillar SDK.
|
|
3
|
-
*
|
|
4
|
-
* This module enables developers to define actions in their application code
|
|
5
|
-
* rather than in the admin UI. Action metadata is synced to the server during
|
|
6
|
-
* CI/CD builds via the `pillar-sync` CLI.
|
|
7
|
-
*
|
|
8
|
-
* @example
|
|
9
|
-
* ```ts
|
|
10
|
-
* // 1. Define actions in your app (e.g., lib/pillar/actions.ts)
|
|
11
|
-
* import type { SyncActionDefinitions } from '@pillar-ai/sdk';
|
|
12
|
-
*
|
|
13
|
-
* export const actions: SyncActionDefinitions = {
|
|
14
|
-
* open_settings: {
|
|
15
|
-
* description: 'Navigate to settings page',
|
|
16
|
-
* type: 'navigate',
|
|
17
|
-
* path: '/settings',
|
|
18
|
-
* autoRun: true,
|
|
19
|
-
* },
|
|
20
|
-
* };
|
|
21
|
-
*
|
|
22
|
-
* // 2. Sync actions via CI/CD
|
|
23
|
-
* // npx pillar-sync --actions ./lib/pillar/actions.ts
|
|
24
|
-
*
|
|
25
|
-
* // 3. Register handlers at runtime
|
|
26
|
-
* pillar.onTask('open_settings', () => router.push('/settings'));
|
|
27
|
-
* pillar.onTask('navigate', ({ path }) => router.push(path));
|
|
28
|
-
* ```
|
|
29
|
-
*
|
|
30
|
-
* @module actions
|
|
31
|
-
*/
|
|
32
|
-
export type { ActionType, ActionDataSchema, ActionDefinition, ActionDefinitions, ActionManifest, ActionManifestEntry, ClientInfo, Platform, SyncActionDefinition, SyncActionDefinitions, ActionTypeDataMap, NavigateActionData, TriggerActionData, InlineUIData, ExternalLinkData, CopyTextData, ActionDataType, ActionNames, TypedTaskHandler, TypedOnTask, TypedPillarMethods, ActionResult, ActionSchema, } from './types';
|
|
33
|
-
export { setClientInfo, getClientInfo, getHandler, getActionDefinition, hasAction, getActionNames, getManifest, clearRegistry, getActionCount, } from './registry';
|
|
@@ -1,98 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Action Registry - Manages code-defined action handlers.
|
|
3
|
-
*
|
|
4
|
-
* This module provides the registration and lookup mechanism for
|
|
5
|
-
* actions defined in code. Actions are registered at runtime via
|
|
6
|
-
* `pillar.onTask()` and can be looked up by name using `getHandler()`.
|
|
7
|
-
*
|
|
8
|
-
* Action metadata is synced to the server during CI/CD builds using
|
|
9
|
-
* the `pillar-sync` CLI with a barrel file export pattern:
|
|
10
|
-
*
|
|
11
|
-
* @example
|
|
12
|
-
* ```ts
|
|
13
|
-
* // lib/pillar/actions/index.ts
|
|
14
|
-
* import type { SyncActionDefinitions } from '@pillar-ai/sdk';
|
|
15
|
-
*
|
|
16
|
-
* export const actions = {
|
|
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 SyncActionDefinitions;
|
|
24
|
-
*
|
|
25
|
-
* export default actions;
|
|
26
|
-
*
|
|
27
|
-
* // Sync via CI/CD:
|
|
28
|
-
* // npx pillar-sync --actions ./lib/pillar/actions/index.ts
|
|
29
|
-
* ```
|
|
30
|
-
*/
|
|
31
|
-
import type { ActionDefinition, ActionManifest, 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 action handler by name.
|
|
50
|
-
*
|
|
51
|
-
* @param name - Action name (e.g., "open_settings")
|
|
52
|
-
* @returns Handler function or undefined if not found
|
|
53
|
-
*/
|
|
54
|
-
export declare function getHandler(name: string): ActionDefinition['handler'] | undefined;
|
|
55
|
-
/**
|
|
56
|
-
* Get a registered action definition by name.
|
|
57
|
-
*
|
|
58
|
-
* @param name - Action name
|
|
59
|
-
* @returns Action definition or undefined if not found
|
|
60
|
-
*/
|
|
61
|
-
export declare function getActionDefinition(name: string): ActionDefinition | undefined;
|
|
62
|
-
/**
|
|
63
|
-
* Check if an action is registered.
|
|
64
|
-
*
|
|
65
|
-
* @param name - Action name
|
|
66
|
-
* @returns True if registered
|
|
67
|
-
*/
|
|
68
|
-
export declare function hasAction(name: string): boolean;
|
|
69
|
-
/**
|
|
70
|
-
* Get all registered action names.
|
|
71
|
-
*
|
|
72
|
-
* @returns Array of action names
|
|
73
|
-
*/
|
|
74
|
-
export declare function getActionNames(): string[];
|
|
75
|
-
/**
|
|
76
|
-
* Get the action manifest for syncing to the server.
|
|
77
|
-
*
|
|
78
|
-
* Extracts metadata from all registered actions (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 Action manifest object
|
|
85
|
-
*/
|
|
86
|
-
export declare function getManifest(platform: Platform, version: string, gitSha?: string): ActionManifest;
|
|
87
|
-
/**
|
|
88
|
-
* Clear all registered actions.
|
|
89
|
-
*
|
|
90
|
-
* Primarily for testing purposes.
|
|
91
|
-
*/
|
|
92
|
-
export declare function clearRegistry(): void;
|
|
93
|
-
/**
|
|
94
|
-
* Get the count of registered actions.
|
|
95
|
-
*
|
|
96
|
-
* @returns Number of registered actions
|
|
97
|
-
*/
|
|
98
|
-
export declare function getActionCount(): number;
|