agent-hustle-demo 1.0.1
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 +429 -0
- package/dist/HustleChat-BC9wvWVA.d.ts +90 -0
- package/dist/HustleChat-BcrKkkyn.d.cts +90 -0
- package/dist/browser/hustle-react.js +14854 -0
- package/dist/browser/hustle-react.js.map +1 -0
- package/dist/components/index.cjs +3141 -0
- package/dist/components/index.cjs.map +1 -0
- package/dist/components/index.d.cts +20 -0
- package/dist/components/index.d.ts +20 -0
- package/dist/components/index.js +3112 -0
- package/dist/components/index.js.map +1 -0
- package/dist/hooks/index.cjs +845 -0
- package/dist/hooks/index.cjs.map +1 -0
- package/dist/hooks/index.d.cts +6 -0
- package/dist/hooks/index.d.ts +6 -0
- package/dist/hooks/index.js +838 -0
- package/dist/hooks/index.js.map +1 -0
- package/dist/hustle-Kj0X8qXC.d.cts +193 -0
- package/dist/hustle-Kj0X8qXC.d.ts +193 -0
- package/dist/index-ChUsRBwL.d.ts +152 -0
- package/dist/index-DE1N7C3W.d.cts +152 -0
- package/dist/index-DuPFrMZy.d.cts +214 -0
- package/dist/index-kFIdHjNw.d.ts +214 -0
- package/dist/index.cjs +3746 -0
- package/dist/index.cjs.map +1 -0
- package/dist/index.d.cts +271 -0
- package/dist/index.d.ts +271 -0
- package/dist/index.js +3697 -0
- package/dist/index.js.map +1 -0
- package/dist/providers/index.cjs +844 -0
- package/dist/providers/index.cjs.map +1 -0
- package/dist/providers/index.d.cts +5 -0
- package/dist/providers/index.d.ts +5 -0
- package/dist/providers/index.js +838 -0
- package/dist/providers/index.js.map +1 -0
- package/package.json +80 -0
- package/src/components/AuthStatus.tsx +352 -0
- package/src/components/ConnectButton.tsx +421 -0
- package/src/components/HustleChat.tsx +1273 -0
- package/src/components/MarkdownContent.tsx +431 -0
- package/src/components/index.ts +15 -0
- package/src/hooks/index.ts +40 -0
- package/src/hooks/useEmblemAuth.ts +27 -0
- package/src/hooks/useHustle.ts +36 -0
- package/src/hooks/usePlugins.ts +135 -0
- package/src/index.ts +142 -0
- package/src/plugins/index.ts +48 -0
- package/src/plugins/migrateFun.ts +211 -0
- package/src/plugins/predictionMarket.ts +411 -0
- package/src/providers/EmblemAuthProvider.tsx +319 -0
- package/src/providers/HustleProvider.tsx +540 -0
- package/src/providers/index.ts +6 -0
- package/src/styles/index.ts +2 -0
- package/src/styles/tokens.ts +447 -0
- package/src/types/auth.ts +85 -0
- package/src/types/hustle.ts +217 -0
- package/src/types/index.ts +49 -0
- package/src/types/plugin.ts +180 -0
- package/src/utils/index.ts +122 -0
- package/src/utils/pluginRegistry.ts +375 -0
package/dist/index.d.cts
ADDED
|
@@ -0,0 +1,271 @@
|
|
|
1
|
+
export { b as AuthSession, A as AuthUser, c as EmblemAuthConfig, d as EmblemAuthContextValue, E as EmblemAuthProvider, e as EmblemAuthProviderProps, H as HustleProvider, V as VaultInfo, r as resetAuthSDK, u as useEmblemAuth, a as useHustle } from './index-DE1N7C3W.cjs';
|
|
2
|
+
export { A as AuthStatus, b as AuthStatusProps, C as ConnectButton, a as ConnectButtonProps, H as HustleChat, c as HustleChatProps } from './HustleChat-BcrKkkyn.cjs';
|
|
3
|
+
export { A as Attachment, C as ChatMessage, b as ChatOptions, d as ChatResponse, H as HustleConfig, h as HustleContextValue, i as HustleProviderProps, M as Model, c as StreamChunk, g as StreamEndEvent, S as StreamOptions, T as ToolCall, f as ToolEndEvent, a as ToolResult, e as ToolStartEvent } from './hustle-Kj0X8qXC.cjs';
|
|
4
|
+
import { S as StoredPlugin, H as HustlePlugin, a as HydratedPlugin } from './index-DuPFrMZy.cjs';
|
|
5
|
+
export { C as ClientToolDefinition, E as ErrorContext, d as HustleRequest, J as JSONSchema, b as JSONSchemaProperty, e as PluginHooks, P as ProcessedResponse, f as SerializedHooks, c as SerializedToolDefinition, T as ToolExecutor, U as UsePluginsReturn, u as usePlugins } from './index-DuPFrMZy.cjs';
|
|
6
|
+
import 'react/jsx-runtime';
|
|
7
|
+
import 'emblem-auth-sdk';
|
|
8
|
+
import 'react';
|
|
9
|
+
import 'hustle-incognito';
|
|
10
|
+
|
|
11
|
+
/**
|
|
12
|
+
* Plugin Registry
|
|
13
|
+
*
|
|
14
|
+
* Manages plugin storage and state in localStorage.
|
|
15
|
+
*
|
|
16
|
+
* Storage model:
|
|
17
|
+
* - Installed plugins are GLOBAL (hustle-plugins) - install once, available everywhere
|
|
18
|
+
* - Enabled/disabled state is INSTANCE-SCOPED (hustle-plugin-state-{instanceId})
|
|
19
|
+
*
|
|
20
|
+
* Executor functions are serialized as strings (executorCode) and
|
|
21
|
+
* reconstituted at runtime via new Function().
|
|
22
|
+
*
|
|
23
|
+
* SECURITY TODO: Add signature verification before executing stored code.
|
|
24
|
+
* Plugins should be signed by trusted publishers and verified before
|
|
25
|
+
* any eval/Function execution occurs.
|
|
26
|
+
*/
|
|
27
|
+
|
|
28
|
+
type PluginChangeCallback = (plugins: StoredPlugin[]) => void;
|
|
29
|
+
/**
|
|
30
|
+
* Hydrate a stored plugin - reconstitute executors from executorCode
|
|
31
|
+
*
|
|
32
|
+
* FIXME: Add signature verification before execution
|
|
33
|
+
*/
|
|
34
|
+
declare function hydratePlugin(stored: StoredPlugin): HydratedPlugin;
|
|
35
|
+
/**
|
|
36
|
+
* Plugin Registry class
|
|
37
|
+
*
|
|
38
|
+
* Manages plugin persistence with:
|
|
39
|
+
* - Global plugin installations (with serialized executorCode)
|
|
40
|
+
* - Instance-scoped enabled/disabled state
|
|
41
|
+
*/
|
|
42
|
+
declare class PluginRegistry {
|
|
43
|
+
private listeners;
|
|
44
|
+
/**
|
|
45
|
+
* Get listeners for a specific instance
|
|
46
|
+
*/
|
|
47
|
+
private getListeners;
|
|
48
|
+
/**
|
|
49
|
+
* Load installed plugins (global)
|
|
50
|
+
*/
|
|
51
|
+
private loadInstalledPlugins;
|
|
52
|
+
/**
|
|
53
|
+
* Save installed plugins (global)
|
|
54
|
+
* Serializes executors as executorCode strings
|
|
55
|
+
*/
|
|
56
|
+
private saveInstalledPlugins;
|
|
57
|
+
/**
|
|
58
|
+
* Load enabled state for an instance
|
|
59
|
+
*/
|
|
60
|
+
private loadEnabledState;
|
|
61
|
+
/**
|
|
62
|
+
* Save enabled state for an instance
|
|
63
|
+
*/
|
|
64
|
+
private saveEnabledState;
|
|
65
|
+
/**
|
|
66
|
+
* Load plugins with instance-specific enabled state
|
|
67
|
+
* Combines global plugin list with per-instance enabled state
|
|
68
|
+
*/
|
|
69
|
+
loadFromStorage(instanceId?: string): StoredPlugin[];
|
|
70
|
+
/**
|
|
71
|
+
* Register a new plugin (global - available to all instances)
|
|
72
|
+
* Serializes executors as executorCode for persistence
|
|
73
|
+
*
|
|
74
|
+
* @param plugin The plugin to install
|
|
75
|
+
* @param enabled Initial enabled state for this instance (default: true)
|
|
76
|
+
* @param instanceId Instance to set initial enabled state for
|
|
77
|
+
*/
|
|
78
|
+
register(plugin: HustlePlugin, enabled?: boolean, instanceId?: string): void;
|
|
79
|
+
/**
|
|
80
|
+
* Unregister a plugin (global - removes from all instances)
|
|
81
|
+
*/
|
|
82
|
+
unregister(pluginName: string, instanceId?: string): void;
|
|
83
|
+
/**
|
|
84
|
+
* Enable or disable a plugin (instance-scoped)
|
|
85
|
+
*/
|
|
86
|
+
setEnabled(pluginName: string, enabled: boolean, instanceId?: string): void;
|
|
87
|
+
/**
|
|
88
|
+
* Check if a plugin is installed (global)
|
|
89
|
+
*/
|
|
90
|
+
isRegistered(pluginName: string): boolean;
|
|
91
|
+
/**
|
|
92
|
+
* Get a specific plugin with instance-specific enabled state
|
|
93
|
+
*/
|
|
94
|
+
getPlugin(pluginName: string, instanceId?: string): StoredPlugin | undefined;
|
|
95
|
+
/**
|
|
96
|
+
* Get all enabled plugins for an instance (hydrated with executors)
|
|
97
|
+
*/
|
|
98
|
+
getEnabledPlugins(instanceId?: string): HydratedPlugin[];
|
|
99
|
+
/**
|
|
100
|
+
* Subscribe to plugin changes for a specific instance
|
|
101
|
+
*/
|
|
102
|
+
onChange(callback: PluginChangeCallback, instanceId?: string): () => void;
|
|
103
|
+
/**
|
|
104
|
+
* Notify all listeners for a specific instance
|
|
105
|
+
*/
|
|
106
|
+
private notifyListeners;
|
|
107
|
+
/**
|
|
108
|
+
* Clear enabled state for an instance (plugins remain installed globally)
|
|
109
|
+
*/
|
|
110
|
+
clear(instanceId?: string): void;
|
|
111
|
+
/**
|
|
112
|
+
* Clear all installed plugins globally
|
|
113
|
+
*/
|
|
114
|
+
clearAll(): void;
|
|
115
|
+
}
|
|
116
|
+
declare const pluginRegistry: PluginRegistry;
|
|
117
|
+
|
|
118
|
+
/**
|
|
119
|
+
* Utility functions for Emblem Auth + Hustle SDK integration
|
|
120
|
+
*/
|
|
121
|
+
/**
|
|
122
|
+
* Truncate a wallet address for display
|
|
123
|
+
* @example truncateAddress('0x1234567890abcdef1234567890abcdef12345678') => '0x1234...5678'
|
|
124
|
+
*/
|
|
125
|
+
declare function truncateAddress(address: string, startChars?: number, endChars?: number): string;
|
|
126
|
+
/**
|
|
127
|
+
* Copy text to clipboard
|
|
128
|
+
* @returns true if successful, false otherwise
|
|
129
|
+
*/
|
|
130
|
+
declare function copyToClipboard(text: string): Promise<boolean>;
|
|
131
|
+
/**
|
|
132
|
+
* Generate a unique ID
|
|
133
|
+
*/
|
|
134
|
+
declare function generateId(prefix?: string): string;
|
|
135
|
+
/**
|
|
136
|
+
* Decode JWT payload (without verification)
|
|
137
|
+
* @returns Decoded payload object or null if invalid
|
|
138
|
+
*/
|
|
139
|
+
declare function decodeJwtPayload(token: string): Record<string, unknown> | null;
|
|
140
|
+
/**
|
|
141
|
+
* Check if a JWT is expired
|
|
142
|
+
* @returns true if expired or invalid, false if valid
|
|
143
|
+
*/
|
|
144
|
+
declare function isJwtExpired(token: string): boolean;
|
|
145
|
+
/**
|
|
146
|
+
* Format file size for display
|
|
147
|
+
* @example formatFileSize(1024) => '1 KB'
|
|
148
|
+
*/
|
|
149
|
+
declare function formatFileSize(bytes: number): string;
|
|
150
|
+
/**
|
|
151
|
+
* Create a debounced function
|
|
152
|
+
*/
|
|
153
|
+
declare function debounce<T extends (...args: unknown[]) => unknown>(fn: T, delay: number): (...args: Parameters<T>) => void;
|
|
154
|
+
/**
|
|
155
|
+
* Storage keys for persistence
|
|
156
|
+
*/
|
|
157
|
+
declare const STORAGE_KEYS: {
|
|
158
|
+
readonly AUTH_SESSION: "emblem_auth_session";
|
|
159
|
+
readonly HUSTLE_SETTINGS: "hustle_settings";
|
|
160
|
+
readonly CHAT_HISTORY: "hustle_chat_history";
|
|
161
|
+
readonly PLUGINS: "hustle-plugins";
|
|
162
|
+
};
|
|
163
|
+
/**
|
|
164
|
+
* Default configuration values
|
|
165
|
+
*/
|
|
166
|
+
declare const DEFAULTS: {
|
|
167
|
+
readonly HUSTLE_API_URL: "https://agenthustle.ai";
|
|
168
|
+
readonly EMBLEM_API_URL: "https://api.emblemvault.ai";
|
|
169
|
+
readonly EMBLEM_MODAL_URL: "https://emblemvault.ai/connect";
|
|
170
|
+
};
|
|
171
|
+
|
|
172
|
+
/**
|
|
173
|
+
* Prediction Market Alpha Plugin
|
|
174
|
+
*
|
|
175
|
+
* Provides AI tools for searching and analyzing prediction markets
|
|
176
|
+
* using the Dome API (https://api.domeapi.io)
|
|
177
|
+
*
|
|
178
|
+
* Supported platforms: Polymarket, Kalshi
|
|
179
|
+
*
|
|
180
|
+
* Get specific market details:
|
|
181
|
+
* - "Get details on the [market-slug] market"
|
|
182
|
+
* - "Tell me more about that Bitcoin prediction market"
|
|
183
|
+
*
|
|
184
|
+
* Get prices/odds:
|
|
185
|
+
* - "What are the current odds on [market]?"
|
|
186
|
+
* - "What's the probability showing for [market]?"
|
|
187
|
+
*
|
|
188
|
+
* Get trading activity:
|
|
189
|
+
* - "Show me recent trades on that market"
|
|
190
|
+
* - "What's the trading activity like?"
|
|
191
|
+
* - "What prediction market platforms are supported?"
|
|
192
|
+
* - "Search Kalshi for markets about crypto"
|
|
193
|
+
* - "Show me prediction markets on Polymarket about politics"
|
|
194
|
+
* - "Get details on [ticker] from Kalshi"
|
|
195
|
+
*/
|
|
196
|
+
|
|
197
|
+
/**
|
|
198
|
+
* Prediction Market Alpha Plugin
|
|
199
|
+
*
|
|
200
|
+
* Tools:
|
|
201
|
+
* - get_supported_platforms: List supported prediction market platforms
|
|
202
|
+
* - search_prediction_markets: Search for markets on Polymarket or Kalshi
|
|
203
|
+
* - get_market_details: Get detailed info about a specific market
|
|
204
|
+
* - get_market_prices: Get current prices/odds for a market
|
|
205
|
+
* - get_market_trades: Get recent trading activity
|
|
206
|
+
*/
|
|
207
|
+
declare const predictionMarketPlugin: HustlePlugin;
|
|
208
|
+
|
|
209
|
+
/**
|
|
210
|
+
* Migrate.fun Knowledge Base Plugin
|
|
211
|
+
*
|
|
212
|
+
* Provides AI tools for answering questions about token migrations
|
|
213
|
+
* using an embedded knowledge base from real support conversations.
|
|
214
|
+
*
|
|
215
|
+
* Supported topics: Bonk Fun, Pump Fun, Raydium migrations,
|
|
216
|
+
* costs/fees, timelines, post-migration steps, technical details.
|
|
217
|
+
*
|
|
218
|
+
* Example prompts:
|
|
219
|
+
* - "How does a migration to Pump Fun work?"
|
|
220
|
+
* - "What does Migrate Fun cost?"
|
|
221
|
+
* - "What steps do I need to do after the migration?"
|
|
222
|
+
* - "How long is the migration period?"
|
|
223
|
+
* - "What is the claim period for migrations?"
|
|
224
|
+
* - "Has Migrate Fun been audited?"
|
|
225
|
+
* - "What happens to tokens on exchanges during migration?"
|
|
226
|
+
* - "Can I change the total supply when migrating?"
|
|
227
|
+
*
|
|
228
|
+
* System prompt suggestion (for optimal results):
|
|
229
|
+
* You are a support agent for Migrate.fun, the token migration platform on Solana.
|
|
230
|
+
* You have the `search_migrate_fun_docs` tool - ALWAYS use it when users ask about migrations.
|
|
231
|
+
* Key facts: 3.75% fee, 90-day claim period, supports Bonk Fun/Pump Fun/Raydium, audited by Halborn.
|
|
232
|
+
* For complex questions: direct to https://x.com/MigrateFun
|
|
233
|
+
*/
|
|
234
|
+
|
|
235
|
+
/**
|
|
236
|
+
* Migrate.fun Knowledge Base Plugin
|
|
237
|
+
*
|
|
238
|
+
* Tools:
|
|
239
|
+
* - search_migrate_fun_docs: Search the knowledge base for migration Q&A
|
|
240
|
+
*/
|
|
241
|
+
declare const migrateFunPlugin: HustlePlugin;
|
|
242
|
+
|
|
243
|
+
/**
|
|
244
|
+
* Plugin Registry
|
|
245
|
+
*
|
|
246
|
+
* Available plugins that can be installed by users.
|
|
247
|
+
* This is a hardcoded registry for the PoC - in the future
|
|
248
|
+
* this could be fetched from a remote plugin marketplace.
|
|
249
|
+
*
|
|
250
|
+
* NOTE: Plugins no longer need to be pre-registered. Executor code
|
|
251
|
+
* is now serialized to localStorage as executorCode strings and
|
|
252
|
+
* reconstituted at runtime via eval().
|
|
253
|
+
*/
|
|
254
|
+
|
|
255
|
+
/**
|
|
256
|
+
* Available plugin with display metadata
|
|
257
|
+
*/
|
|
258
|
+
interface AvailablePlugin extends HustlePlugin {
|
|
259
|
+
/** Short description for UI display */
|
|
260
|
+
description: string;
|
|
261
|
+
}
|
|
262
|
+
/**
|
|
263
|
+
* All available plugins that can be installed
|
|
264
|
+
*/
|
|
265
|
+
declare const availablePlugins: AvailablePlugin[];
|
|
266
|
+
/**
|
|
267
|
+
* Get an available plugin by name
|
|
268
|
+
*/
|
|
269
|
+
declare function getAvailablePlugin(name: string): AvailablePlugin | undefined;
|
|
270
|
+
|
|
271
|
+
export { type AvailablePlugin, DEFAULTS, HustlePlugin, HydratedPlugin, STORAGE_KEYS, StoredPlugin, availablePlugins, copyToClipboard, debounce, decodeJwtPayload, formatFileSize, generateId, getAvailablePlugin, hydratePlugin, isJwtExpired, migrateFunPlugin, pluginRegistry, predictionMarketPlugin, truncateAddress };
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,271 @@
|
|
|
1
|
+
export { b as AuthSession, A as AuthUser, c as EmblemAuthConfig, d as EmblemAuthContextValue, E as EmblemAuthProvider, e as EmblemAuthProviderProps, H as HustleProvider, V as VaultInfo, r as resetAuthSDK, u as useEmblemAuth, a as useHustle } from './index-ChUsRBwL.js';
|
|
2
|
+
export { A as AuthStatus, b as AuthStatusProps, C as ConnectButton, a as ConnectButtonProps, H as HustleChat, c as HustleChatProps } from './HustleChat-BC9wvWVA.js';
|
|
3
|
+
export { A as Attachment, C as ChatMessage, b as ChatOptions, d as ChatResponse, H as HustleConfig, h as HustleContextValue, i as HustleProviderProps, M as Model, c as StreamChunk, g as StreamEndEvent, S as StreamOptions, T as ToolCall, f as ToolEndEvent, a as ToolResult, e as ToolStartEvent } from './hustle-Kj0X8qXC.js';
|
|
4
|
+
import { S as StoredPlugin, H as HustlePlugin, a as HydratedPlugin } from './index-kFIdHjNw.js';
|
|
5
|
+
export { C as ClientToolDefinition, E as ErrorContext, d as HustleRequest, J as JSONSchema, b as JSONSchemaProperty, e as PluginHooks, P as ProcessedResponse, f as SerializedHooks, c as SerializedToolDefinition, T as ToolExecutor, U as UsePluginsReturn, u as usePlugins } from './index-kFIdHjNw.js';
|
|
6
|
+
import 'react/jsx-runtime';
|
|
7
|
+
import 'emblem-auth-sdk';
|
|
8
|
+
import 'react';
|
|
9
|
+
import 'hustle-incognito';
|
|
10
|
+
|
|
11
|
+
/**
|
|
12
|
+
* Plugin Registry
|
|
13
|
+
*
|
|
14
|
+
* Manages plugin storage and state in localStorage.
|
|
15
|
+
*
|
|
16
|
+
* Storage model:
|
|
17
|
+
* - Installed plugins are GLOBAL (hustle-plugins) - install once, available everywhere
|
|
18
|
+
* - Enabled/disabled state is INSTANCE-SCOPED (hustle-plugin-state-{instanceId})
|
|
19
|
+
*
|
|
20
|
+
* Executor functions are serialized as strings (executorCode) and
|
|
21
|
+
* reconstituted at runtime via new Function().
|
|
22
|
+
*
|
|
23
|
+
* SECURITY TODO: Add signature verification before executing stored code.
|
|
24
|
+
* Plugins should be signed by trusted publishers and verified before
|
|
25
|
+
* any eval/Function execution occurs.
|
|
26
|
+
*/
|
|
27
|
+
|
|
28
|
+
type PluginChangeCallback = (plugins: StoredPlugin[]) => void;
|
|
29
|
+
/**
|
|
30
|
+
* Hydrate a stored plugin - reconstitute executors from executorCode
|
|
31
|
+
*
|
|
32
|
+
* FIXME: Add signature verification before execution
|
|
33
|
+
*/
|
|
34
|
+
declare function hydratePlugin(stored: StoredPlugin): HydratedPlugin;
|
|
35
|
+
/**
|
|
36
|
+
* Plugin Registry class
|
|
37
|
+
*
|
|
38
|
+
* Manages plugin persistence with:
|
|
39
|
+
* - Global plugin installations (with serialized executorCode)
|
|
40
|
+
* - Instance-scoped enabled/disabled state
|
|
41
|
+
*/
|
|
42
|
+
declare class PluginRegistry {
|
|
43
|
+
private listeners;
|
|
44
|
+
/**
|
|
45
|
+
* Get listeners for a specific instance
|
|
46
|
+
*/
|
|
47
|
+
private getListeners;
|
|
48
|
+
/**
|
|
49
|
+
* Load installed plugins (global)
|
|
50
|
+
*/
|
|
51
|
+
private loadInstalledPlugins;
|
|
52
|
+
/**
|
|
53
|
+
* Save installed plugins (global)
|
|
54
|
+
* Serializes executors as executorCode strings
|
|
55
|
+
*/
|
|
56
|
+
private saveInstalledPlugins;
|
|
57
|
+
/**
|
|
58
|
+
* Load enabled state for an instance
|
|
59
|
+
*/
|
|
60
|
+
private loadEnabledState;
|
|
61
|
+
/**
|
|
62
|
+
* Save enabled state for an instance
|
|
63
|
+
*/
|
|
64
|
+
private saveEnabledState;
|
|
65
|
+
/**
|
|
66
|
+
* Load plugins with instance-specific enabled state
|
|
67
|
+
* Combines global plugin list with per-instance enabled state
|
|
68
|
+
*/
|
|
69
|
+
loadFromStorage(instanceId?: string): StoredPlugin[];
|
|
70
|
+
/**
|
|
71
|
+
* Register a new plugin (global - available to all instances)
|
|
72
|
+
* Serializes executors as executorCode for persistence
|
|
73
|
+
*
|
|
74
|
+
* @param plugin The plugin to install
|
|
75
|
+
* @param enabled Initial enabled state for this instance (default: true)
|
|
76
|
+
* @param instanceId Instance to set initial enabled state for
|
|
77
|
+
*/
|
|
78
|
+
register(plugin: HustlePlugin, enabled?: boolean, instanceId?: string): void;
|
|
79
|
+
/**
|
|
80
|
+
* Unregister a plugin (global - removes from all instances)
|
|
81
|
+
*/
|
|
82
|
+
unregister(pluginName: string, instanceId?: string): void;
|
|
83
|
+
/**
|
|
84
|
+
* Enable or disable a plugin (instance-scoped)
|
|
85
|
+
*/
|
|
86
|
+
setEnabled(pluginName: string, enabled: boolean, instanceId?: string): void;
|
|
87
|
+
/**
|
|
88
|
+
* Check if a plugin is installed (global)
|
|
89
|
+
*/
|
|
90
|
+
isRegistered(pluginName: string): boolean;
|
|
91
|
+
/**
|
|
92
|
+
* Get a specific plugin with instance-specific enabled state
|
|
93
|
+
*/
|
|
94
|
+
getPlugin(pluginName: string, instanceId?: string): StoredPlugin | undefined;
|
|
95
|
+
/**
|
|
96
|
+
* Get all enabled plugins for an instance (hydrated with executors)
|
|
97
|
+
*/
|
|
98
|
+
getEnabledPlugins(instanceId?: string): HydratedPlugin[];
|
|
99
|
+
/**
|
|
100
|
+
* Subscribe to plugin changes for a specific instance
|
|
101
|
+
*/
|
|
102
|
+
onChange(callback: PluginChangeCallback, instanceId?: string): () => void;
|
|
103
|
+
/**
|
|
104
|
+
* Notify all listeners for a specific instance
|
|
105
|
+
*/
|
|
106
|
+
private notifyListeners;
|
|
107
|
+
/**
|
|
108
|
+
* Clear enabled state for an instance (plugins remain installed globally)
|
|
109
|
+
*/
|
|
110
|
+
clear(instanceId?: string): void;
|
|
111
|
+
/**
|
|
112
|
+
* Clear all installed plugins globally
|
|
113
|
+
*/
|
|
114
|
+
clearAll(): void;
|
|
115
|
+
}
|
|
116
|
+
declare const pluginRegistry: PluginRegistry;
|
|
117
|
+
|
|
118
|
+
/**
|
|
119
|
+
* Utility functions for Emblem Auth + Hustle SDK integration
|
|
120
|
+
*/
|
|
121
|
+
/**
|
|
122
|
+
* Truncate a wallet address for display
|
|
123
|
+
* @example truncateAddress('0x1234567890abcdef1234567890abcdef12345678') => '0x1234...5678'
|
|
124
|
+
*/
|
|
125
|
+
declare function truncateAddress(address: string, startChars?: number, endChars?: number): string;
|
|
126
|
+
/**
|
|
127
|
+
* Copy text to clipboard
|
|
128
|
+
* @returns true if successful, false otherwise
|
|
129
|
+
*/
|
|
130
|
+
declare function copyToClipboard(text: string): Promise<boolean>;
|
|
131
|
+
/**
|
|
132
|
+
* Generate a unique ID
|
|
133
|
+
*/
|
|
134
|
+
declare function generateId(prefix?: string): string;
|
|
135
|
+
/**
|
|
136
|
+
* Decode JWT payload (without verification)
|
|
137
|
+
* @returns Decoded payload object or null if invalid
|
|
138
|
+
*/
|
|
139
|
+
declare function decodeJwtPayload(token: string): Record<string, unknown> | null;
|
|
140
|
+
/**
|
|
141
|
+
* Check if a JWT is expired
|
|
142
|
+
* @returns true if expired or invalid, false if valid
|
|
143
|
+
*/
|
|
144
|
+
declare function isJwtExpired(token: string): boolean;
|
|
145
|
+
/**
|
|
146
|
+
* Format file size for display
|
|
147
|
+
* @example formatFileSize(1024) => '1 KB'
|
|
148
|
+
*/
|
|
149
|
+
declare function formatFileSize(bytes: number): string;
|
|
150
|
+
/**
|
|
151
|
+
* Create a debounced function
|
|
152
|
+
*/
|
|
153
|
+
declare function debounce<T extends (...args: unknown[]) => unknown>(fn: T, delay: number): (...args: Parameters<T>) => void;
|
|
154
|
+
/**
|
|
155
|
+
* Storage keys for persistence
|
|
156
|
+
*/
|
|
157
|
+
declare const STORAGE_KEYS: {
|
|
158
|
+
readonly AUTH_SESSION: "emblem_auth_session";
|
|
159
|
+
readonly HUSTLE_SETTINGS: "hustle_settings";
|
|
160
|
+
readonly CHAT_HISTORY: "hustle_chat_history";
|
|
161
|
+
readonly PLUGINS: "hustle-plugins";
|
|
162
|
+
};
|
|
163
|
+
/**
|
|
164
|
+
* Default configuration values
|
|
165
|
+
*/
|
|
166
|
+
declare const DEFAULTS: {
|
|
167
|
+
readonly HUSTLE_API_URL: "https://agenthustle.ai";
|
|
168
|
+
readonly EMBLEM_API_URL: "https://api.emblemvault.ai";
|
|
169
|
+
readonly EMBLEM_MODAL_URL: "https://emblemvault.ai/connect";
|
|
170
|
+
};
|
|
171
|
+
|
|
172
|
+
/**
|
|
173
|
+
* Prediction Market Alpha Plugin
|
|
174
|
+
*
|
|
175
|
+
* Provides AI tools for searching and analyzing prediction markets
|
|
176
|
+
* using the Dome API (https://api.domeapi.io)
|
|
177
|
+
*
|
|
178
|
+
* Supported platforms: Polymarket, Kalshi
|
|
179
|
+
*
|
|
180
|
+
* Get specific market details:
|
|
181
|
+
* - "Get details on the [market-slug] market"
|
|
182
|
+
* - "Tell me more about that Bitcoin prediction market"
|
|
183
|
+
*
|
|
184
|
+
* Get prices/odds:
|
|
185
|
+
* - "What are the current odds on [market]?"
|
|
186
|
+
* - "What's the probability showing for [market]?"
|
|
187
|
+
*
|
|
188
|
+
* Get trading activity:
|
|
189
|
+
* - "Show me recent trades on that market"
|
|
190
|
+
* - "What's the trading activity like?"
|
|
191
|
+
* - "What prediction market platforms are supported?"
|
|
192
|
+
* - "Search Kalshi for markets about crypto"
|
|
193
|
+
* - "Show me prediction markets on Polymarket about politics"
|
|
194
|
+
* - "Get details on [ticker] from Kalshi"
|
|
195
|
+
*/
|
|
196
|
+
|
|
197
|
+
/**
|
|
198
|
+
* Prediction Market Alpha Plugin
|
|
199
|
+
*
|
|
200
|
+
* Tools:
|
|
201
|
+
* - get_supported_platforms: List supported prediction market platforms
|
|
202
|
+
* - search_prediction_markets: Search for markets on Polymarket or Kalshi
|
|
203
|
+
* - get_market_details: Get detailed info about a specific market
|
|
204
|
+
* - get_market_prices: Get current prices/odds for a market
|
|
205
|
+
* - get_market_trades: Get recent trading activity
|
|
206
|
+
*/
|
|
207
|
+
declare const predictionMarketPlugin: HustlePlugin;
|
|
208
|
+
|
|
209
|
+
/**
|
|
210
|
+
* Migrate.fun Knowledge Base Plugin
|
|
211
|
+
*
|
|
212
|
+
* Provides AI tools for answering questions about token migrations
|
|
213
|
+
* using an embedded knowledge base from real support conversations.
|
|
214
|
+
*
|
|
215
|
+
* Supported topics: Bonk Fun, Pump Fun, Raydium migrations,
|
|
216
|
+
* costs/fees, timelines, post-migration steps, technical details.
|
|
217
|
+
*
|
|
218
|
+
* Example prompts:
|
|
219
|
+
* - "How does a migration to Pump Fun work?"
|
|
220
|
+
* - "What does Migrate Fun cost?"
|
|
221
|
+
* - "What steps do I need to do after the migration?"
|
|
222
|
+
* - "How long is the migration period?"
|
|
223
|
+
* - "What is the claim period for migrations?"
|
|
224
|
+
* - "Has Migrate Fun been audited?"
|
|
225
|
+
* - "What happens to tokens on exchanges during migration?"
|
|
226
|
+
* - "Can I change the total supply when migrating?"
|
|
227
|
+
*
|
|
228
|
+
* System prompt suggestion (for optimal results):
|
|
229
|
+
* You are a support agent for Migrate.fun, the token migration platform on Solana.
|
|
230
|
+
* You have the `search_migrate_fun_docs` tool - ALWAYS use it when users ask about migrations.
|
|
231
|
+
* Key facts: 3.75% fee, 90-day claim period, supports Bonk Fun/Pump Fun/Raydium, audited by Halborn.
|
|
232
|
+
* For complex questions: direct to https://x.com/MigrateFun
|
|
233
|
+
*/
|
|
234
|
+
|
|
235
|
+
/**
|
|
236
|
+
* Migrate.fun Knowledge Base Plugin
|
|
237
|
+
*
|
|
238
|
+
* Tools:
|
|
239
|
+
* - search_migrate_fun_docs: Search the knowledge base for migration Q&A
|
|
240
|
+
*/
|
|
241
|
+
declare const migrateFunPlugin: HustlePlugin;
|
|
242
|
+
|
|
243
|
+
/**
|
|
244
|
+
* Plugin Registry
|
|
245
|
+
*
|
|
246
|
+
* Available plugins that can be installed by users.
|
|
247
|
+
* This is a hardcoded registry for the PoC - in the future
|
|
248
|
+
* this could be fetched from a remote plugin marketplace.
|
|
249
|
+
*
|
|
250
|
+
* NOTE: Plugins no longer need to be pre-registered. Executor code
|
|
251
|
+
* is now serialized to localStorage as executorCode strings and
|
|
252
|
+
* reconstituted at runtime via eval().
|
|
253
|
+
*/
|
|
254
|
+
|
|
255
|
+
/**
|
|
256
|
+
* Available plugin with display metadata
|
|
257
|
+
*/
|
|
258
|
+
interface AvailablePlugin extends HustlePlugin {
|
|
259
|
+
/** Short description for UI display */
|
|
260
|
+
description: string;
|
|
261
|
+
}
|
|
262
|
+
/**
|
|
263
|
+
* All available plugins that can be installed
|
|
264
|
+
*/
|
|
265
|
+
declare const availablePlugins: AvailablePlugin[];
|
|
266
|
+
/**
|
|
267
|
+
* Get an available plugin by name
|
|
268
|
+
*/
|
|
269
|
+
declare function getAvailablePlugin(name: string): AvailablePlugin | undefined;
|
|
270
|
+
|
|
271
|
+
export { type AvailablePlugin, DEFAULTS, HustlePlugin, HydratedPlugin, STORAGE_KEYS, StoredPlugin, availablePlugins, copyToClipboard, debounce, decodeJwtPayload, formatFileSize, generateId, getAvailablePlugin, hydratePlugin, isJwtExpired, migrateFunPlugin, pluginRegistry, predictionMarketPlugin, truncateAddress };
|