@elqnt/agents 3.6.0 → 4.0.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.
Files changed (68) hide show
  1. package/README.md +6 -0
  2. package/SKILL.md +724 -0
  3. package/dist/{agent-models-vL3a7oFB.d.mts → agent-models-B-wTMdwF.d.mts} +10 -1
  4. package/dist/{agent-models-vL3a7oFB.d.ts → agent-models-B-wTMdwF.d.ts} +10 -1
  5. package/dist/api/index.d.mts +2 -2
  6. package/dist/api/index.d.ts +2 -2
  7. package/dist/api/index.js +3 -4
  8. package/dist/api/index.js.map +1 -1
  9. package/dist/api/index.mjs +1 -2
  10. package/dist/api/server.d.mts +1 -1
  11. package/dist/api/server.d.ts +1 -1
  12. package/dist/api/server.js +1 -3
  13. package/dist/api/server.js.map +1 -1
  14. package/dist/api/server.mjs +0 -2
  15. package/dist/api/server.mjs.map +1 -1
  16. package/dist/{chunk-B2FNXJRV.js → chunk-2FZZW4O4.js} +5 -5
  17. package/dist/chunk-2FZZW4O4.js.map +1 -0
  18. package/dist/{chunk-3EHE4O57.mjs → chunk-6FKG2JBT.mjs} +1 -3
  19. package/dist/{chunk-3EHE4O57.mjs.map → chunk-6FKG2JBT.mjs.map} +1 -1
  20. package/dist/{chunk-IXUXNTSL.mjs → chunk-CCQNGD3U.mjs} +3 -3
  21. package/dist/{chunk-IXUXNTSL.mjs.map → chunk-CCQNGD3U.mjs.map} +1 -1
  22. package/dist/{chunk-ZS7DRNCT.js → chunk-DQATIIAV.js} +2 -4
  23. package/dist/chunk-DQATIIAV.js.map +1 -0
  24. package/dist/{chunk-OQ6FJAI2.mjs → chunk-NHIVBTLU.mjs} +1 -3
  25. package/dist/{chunk-OQ6FJAI2.mjs.map → chunk-NHIVBTLU.mjs.map} +1 -1
  26. package/dist/{chunk-ENKX5CU7.js → chunk-QH234LAO.js} +2 -4
  27. package/dist/chunk-QH234LAO.js.map +1 -0
  28. package/dist/{chunk-2JDVRL35.js → chunk-QXMZEZRM.js} +2 -4
  29. package/dist/chunk-QXMZEZRM.js.map +1 -0
  30. package/dist/{chunk-HYR7PXFU.mjs → chunk-YQFBZW6F.mjs} +1 -3
  31. package/dist/{chunk-HYR7PXFU.mjs.map → chunk-YQFBZW6F.mjs.map} +1 -1
  32. package/dist/hooks/index.d.mts +354 -142
  33. package/dist/hooks/index.d.ts +354 -142
  34. package/dist/hooks/index.js +1094 -6
  35. package/dist/hooks/index.js.map +1 -1
  36. package/dist/hooks/index.mjs +1107 -19
  37. package/dist/hooks/index.mjs.map +1 -1
  38. package/dist/index.d.mts +1 -3
  39. package/dist/index.d.ts +1 -3
  40. package/dist/index.js +5 -37
  41. package/dist/index.js.map +1 -1
  42. package/dist/index.mjs +6 -38
  43. package/dist/models/index.d.mts +1 -1
  44. package/dist/models/index.d.ts +1 -1
  45. package/dist/models/index.js +4 -3
  46. package/dist/models/index.js.map +1 -1
  47. package/dist/models/index.mjs +3 -2
  48. package/dist/transport/index.d.mts +3 -3
  49. package/dist/transport/index.d.ts +3 -3
  50. package/dist/transport/index.js +3 -4
  51. package/dist/transport/index.js.map +1 -1
  52. package/dist/transport/index.mjs +1 -2
  53. package/dist/{types-CuOOCeF8.d.ts → types-BzNzXaqk.d.ts} +2 -2
  54. package/dist/{types-Bv7_AOrZ.d.mts → types-CSyY6Qv7.d.mts} +2 -2
  55. package/dist/utils/index.d.mts +1 -1
  56. package/dist/utils/index.d.ts +1 -1
  57. package/dist/utils/index.js +3 -4
  58. package/dist/utils/index.js.map +1 -1
  59. package/dist/utils/index.mjs +1 -2
  60. package/package.json +8 -7
  61. package/dist/chunk-2JDVRL35.js.map +0 -1
  62. package/dist/chunk-B2FNXJRV.js.map +0 -1
  63. package/dist/chunk-ENKX5CU7.js.map +0 -1
  64. package/dist/chunk-G2T3H3V4.js +0 -1114
  65. package/dist/chunk-G2T3H3V4.js.map +0 -1
  66. package/dist/chunk-WYNGW5GI.mjs +0 -1114
  67. package/dist/chunk-WYNGW5GI.mjs.map +0 -1
  68. package/dist/chunk-ZS7DRNCT.js.map +0 -1
@@ -1,236 +1,357 @@
1
1
  import { ApiClientOptions } from '@elqnt/api-client';
2
- import { A as Agent, aI as AgentSummary, dt as Skill, dW as SubAgent, ei as ToolDefinition, Z as AgentJob, b0 as AgentWidget, dE as SkillUserConfig, dl as ResolveSkillConfigResponse, aB as AgentStatusUpdate, eH as TriggerBackgroundAgentRequest, eI as TriggerBackgroundAgentResponse, bd as BackgroundAgentStatusResponse } from '../agent-models-vL3a7oFB.js';
3
- export { bb as BackgroundAgentProgressEvent } from '../agent-models-vL3a7oFB.js';
2
+ import { A as Agent, aI as AgentSummary, du as Skill, dX as SubAgent, ej as ToolDefinition, Z as AgentJob, b1 as AgentWidget, dF as SkillUserConfig, dm as ResolveSkillConfigResponse, aB as AgentStatusUpdate, eI as TriggerBackgroundAgentRequest, eJ as TriggerBackgroundAgentResponse, be as BackgroundAgentStatusResponse } from '../agent-models-B-wTMdwF.js';
3
+ export { bc as BackgroundAgentProgressEvent } from '../agent-models-B-wTMdwF.js';
4
4
  import { DateFilter, SchedulerTask, SchedulerSchedule } from '../api/index.js';
5
- import { bb as UserIntegration, ap as IntegrationProviderTS, aA as IntegrationTypeTS, h as CreateSandboxRequest, aX as Sandbox } from '../sandbox-Djb8gA7e.js';
5
+ import { bb as UserIntegration, ap as IntegrationProviderTS, aA as IntegrationTypeTS, aX as Sandbox, h as CreateSandboxRequest } from '../sandbox-Djb8gA7e.js';
6
6
  import { a as StructuredOutputRequest, b as StructuredOutputResponse } from '../structured-Bs0IjwLD.js';
7
- import { ChatMessage, Attachment } from '@elqnt/chat/models';
8
- export { B as BGAgentTransport, a as BGAgentTransportConfig } from '../types-CuOOCeF8.js';
7
+ import { Attachment, ChatMessage } from '@elqnt/chat/models';
8
+ export { a as BGAgentTransport, c as BGAgentTransportConfig } from '../types-BzNzXaqk.js';
9
9
  import '@elqnt/types';
10
10
 
11
11
  type UseAgentsOptions = ApiClientOptions;
12
12
  /**
13
- * Hook for agent CRUD operations
13
+ * The exact, stable return surface of `useAgents`.
14
14
  *
15
- * @example
16
- * ```tsx
17
- * const { loading, error, listAgents, createAgent } = useAgents({
18
- * baseUrl: apiGatewayUrl,
19
- * orgId: selectedOrgId,
20
- * });
15
+ * This is the agent/consumer **contract**: the only methods that exist on the
16
+ * agents hook. Every method is imperative and DOES NOT throw — on failure it
17
+ * resolves to the documented default (`[]`, `null`, `false`) and sets `error`.
21
18
  *
22
- * const agents = await listAgents();
23
- * ```
19
+ * `exportAgent` follows the same no-throw contract: it returns the exported
20
+ * `Agent`, or `null` on failure (with `error` set). As a documented
21
+ * **side-effect** it also triggers a browser JSON download when an agent is
22
+ * returned. See `SKILL.md`.
24
23
  */
25
- declare function useAgents(options: UseAgentsOptions): {
24
+ interface UseAgentsReturn {
25
+ /** OR of all in-flight method loading flags. */
26
26
  loading: boolean;
27
+ /** First non-null method error, else null. */
27
28
  error: string | null;
29
+ /** GET /api/v1/agents — default []. */
28
30
  listAgents: () => Promise<Agent[]>;
31
+ /** GET /api/v1/agents/summary — default []. */
29
32
  listAgentSummaries: () => Promise<AgentSummary[]>;
33
+ /** GET /api/v1/agents/{agentId} — default null. */
30
34
  getAgent: (agentId: string) => Promise<Agent | null>;
35
+ /** POST /api/v1/agents, body Partial<Agent> — created agent, or null on error. */
31
36
  createAgent: (agent: Partial<Agent>) => Promise<Agent | null>;
37
+ /** PUT /api/v1/agents/{agentId}, body Partial<Agent> — updated agent, or null on error. */
32
38
  updateAgent: (agentId: string, agent: Partial<Agent>) => Promise<Agent | null>;
39
+ /** DELETE /api/v1/agents/{agentId} — true on success. */
33
40
  deleteAgent: (agentId: string) => Promise<boolean>;
41
+ /** GET /api/v1/agents/default — default null. */
34
42
  getDefaultAgent: () => Promise<Agent | null>;
35
- exportAgent: (agentId: string) => Promise<Agent>;
43
+ /**
44
+ * GET /api/v1/agents/{agentId}/export — returns the exported Agent, or null
45
+ * on error (non-throwing). Side-effect: triggers a JSON download when an
46
+ * agent is returned.
47
+ */
48
+ exportAgent: (agentId: string) => Promise<Agent | null>;
49
+ /** POST /api/v1/agents/import, body Agent — imported agent, or null on error. */
36
50
  importAgent: (agent: Agent) => Promise<Agent | null>;
37
- };
51
+ }
52
+ /**
53
+ * Hook for agent CRUD operations
54
+ *
55
+ * @example
56
+ * ```tsx
57
+ * const { loading, error, listAgents, createAgent } = useAgents({
58
+ * baseUrl: apiGatewayUrl,
59
+ * orgId: selectedOrgId,
60
+ * });
61
+ *
62
+ * const agents = await listAgents();
63
+ * ```
64
+ */
65
+ declare function useAgents(options: UseAgentsOptions): UseAgentsReturn;
38
66
 
39
67
  type UseSkillsOptions = ApiClientOptions;
40
68
  /**
41
- * Hook for skill CRUD operations
69
+ * The exact, stable return surface of `useSkills` (the standalone catalog
70
+ * `Skill` CRUD, keyed by name in v2). Imperative, non-throwing — on failure a
71
+ * method resolves to its default (`[]`, `null`, `false`) and sets `error`.
72
+ * See `SKILL.md`.
42
73
  */
43
- declare function useSkills(options: UseSkillsOptions): {
74
+ interface UseSkillsReturn {
75
+ /** OR of all in-flight method loading flags. */
44
76
  loading: boolean;
77
+ /** First non-null method error, else null. */
45
78
  error: string | null;
79
+ /** GET /api/v1/skills — default []. */
46
80
  listSkills: () => Promise<Skill[]>;
81
+ /** GET /api/v1/skills/{skillId} — default null. */
47
82
  getSkill: (skillId: string) => Promise<Skill | null>;
83
+ /** POST /api/v1/skills, body Partial<Skill> — created skill, or null on error. */
48
84
  createSkill: (skill: Partial<Skill>) => Promise<Skill | null>;
85
+ /** PUT /api/v1/skills/{skillId}, body Partial<Skill> — updated skill, or null on error. */
49
86
  updateSkill: (skillId: string, skill: Partial<Skill>) => Promise<Skill | null>;
87
+ /** DELETE /api/v1/skills/{skillId} — true on success. */
50
88
  deleteSkill: (skillId: string) => Promise<boolean>;
89
+ /** GET /api/v1/skills/categories — default []. */
51
90
  getCategories: () => Promise<string[]>;
52
- };
91
+ }
92
+ /**
93
+ * Hook for skill CRUD operations
94
+ */
95
+ declare function useSkills(options: UseSkillsOptions): UseSkillsReturn;
53
96
 
54
97
  type UseSubAgentsOptions = ApiClientOptions;
55
98
  /**
56
- * Hook for sub-agent CRUD operations
99
+ * The exact, stable return surface of `useSubAgents`. Imperative, non-throwing
100
+ * on failure a method resolves to its default (`[]`, `null`, `false`) and sets
101
+ * `error`. See `SKILL.md`.
57
102
  */
58
- declare function useSubAgents(options: UseSubAgentsOptions): {
103
+ interface UseSubAgentsReturn {
104
+ /** OR of all in-flight method loading flags. */
59
105
  loading: boolean;
106
+ /** First non-null method error, else null. */
60
107
  error: string | null;
108
+ /** GET /api/v1/subagents — default []. */
61
109
  listSubAgents: () => Promise<SubAgent[]>;
110
+ /** GET /api/v1/subagents/{subAgentId} — default null. */
62
111
  getSubAgent: (subAgentId: string) => Promise<SubAgent | null>;
112
+ /** POST /api/v1/subagents, body { subAgent } — created sub-agent, or null on error. */
63
113
  createSubAgent: (subAgent: Partial<SubAgent>) => Promise<SubAgent | null>;
114
+ /** PUT /api/v1/subagents/{subAgentId}, body { subAgent } — updated sub-agent, or null on error. */
64
115
  updateSubAgent: (subAgentId: string, subAgent: Partial<SubAgent>) => Promise<SubAgent | null>;
116
+ /** DELETE /api/v1/subagents/{subAgentId} — true on success. */
65
117
  deleteSubAgent: (subAgentId: string) => Promise<boolean>;
66
- };
118
+ }
119
+ /**
120
+ * Hook for sub-agent CRUD operations
121
+ */
122
+ declare function useSubAgents(options: UseSubAgentsOptions): UseSubAgentsReturn;
67
123
 
68
124
  type UseToolDefinitionsOptions = ApiClientOptions;
69
125
  /**
70
- * Hook for tool definition CRUD operations
71
- *
72
- * @example
73
- * ```tsx
74
- * const { loading, error, listToolDefinitions, createToolDefinition } = useToolDefinitions({
75
- * baseUrl: apiGatewayUrl,
76
- * orgId: selectedOrgId,
77
- * });
78
- *
79
- * const toolDefs = await listToolDefinitions();
80
- * ```
126
+ * The exact, stable return surface of `useToolDefinitions` (abstract tool
127
+ * templates agents customize into `AgentTool`s). Imperative, non-throwing —
128
+ * on failure a method resolves to its default (`[]`, `null`, `false`) and sets
129
+ * `error`. See `SKILL.md`.
81
130
  */
82
- declare function useToolDefinitions(options: UseToolDefinitionsOptions): {
131
+ interface UseToolDefinitionsReturn {
132
+ /** OR of all in-flight method loading flags. */
83
133
  loading: boolean;
134
+ /** First non-null method error, else null. */
84
135
  error: string | null;
136
+ /** GET /api/v1/tool-definitions — default []. */
85
137
  listToolDefinitions: () => Promise<ToolDefinition[]>;
138
+ /** GET /api/v1/tool-definitions/{toolDefId} — default null. */
86
139
  getToolDefinition: (toolDefId: string) => Promise<ToolDefinition | null>;
140
+ /** POST /api/v1/tool-definitions/by-ids, body { ids } — default []. */
87
141
  getToolDefinitionsByIds: (ids: string[]) => Promise<ToolDefinition[]>;
142
+ /** POST /api/v1/tool-definitions, body Partial<ToolDefinition> — created def, or null on error. */
88
143
  createToolDefinition: (toolDefinition: Partial<ToolDefinition>) => Promise<ToolDefinition | null>;
144
+ /** PUT /api/v1/tool-definitions/{toolDefId}, body Partial<ToolDefinition> — updated def, or null on error. */
89
145
  updateToolDefinition: (toolDefId: string, toolDefinition: Partial<ToolDefinition>) => Promise<ToolDefinition | null>;
146
+ /** DELETE /api/v1/tool-definitions/{toolDefId} — true on success. */
90
147
  deleteToolDefinition: (toolDefId: string) => Promise<boolean>;
91
- };
92
-
93
- type UseAgentJobsOptions = ApiClientOptions;
148
+ }
94
149
  /**
95
- * Hook for agent job CRUD operations
150
+ * Hook for tool definition CRUD operations
96
151
  *
97
152
  * @example
98
153
  * ```tsx
99
- * const { loading, error, listAgentJobs, createAgentJob, pauseAgentJob } = useAgentJobs({
154
+ * const { loading, error, listToolDefinitions, createToolDefinition } = useToolDefinitions({
100
155
  * baseUrl: apiGatewayUrl,
101
156
  * orgId: selectedOrgId,
102
157
  * });
103
158
  *
104
- * const jobs = await listAgentJobs();
105
- * await pauseAgentJob(jobId);
159
+ * const toolDefs = await listToolDefinitions();
106
160
  * ```
107
161
  */
108
- declare function useAgentJobs(options: UseAgentJobsOptions): {
162
+ declare function useToolDefinitions(options: UseToolDefinitionsOptions): UseToolDefinitionsReturn;
163
+
164
+ type UseAgentJobsOptions = ApiClientOptions;
165
+ /**
166
+ * The exact, stable return surface of `useAgentJobs`. Imperative, non-throwing —
167
+ * on failure each method resolves to the documented default and sets `error`.
168
+ */
169
+ interface UseAgentJobsReturn {
170
+ /** OR of all in-flight method loading flags. */
109
171
  loading: boolean;
172
+ /** First non-null method error, else null. */
110
173
  error: string | null;
174
+ /** GET /api/v1/agent-jobs — default []. */
111
175
  listAgentJobs: () => Promise<AgentJob[]>;
176
+ /** GET /api/v1/agent-jobs/{jobId} — default null. */
112
177
  getAgentJob: (jobId: string) => Promise<AgentJob | null>;
178
+ /** POST /api/v1/agent-jobs — created job, or null on error. */
113
179
  createAgentJob: (job: Partial<AgentJob>) => Promise<AgentJob | null>;
180
+ /** PUT /api/v1/agent-jobs/{jobId} — updated job, or null on error. */
114
181
  updateAgentJob: (jobId: string, job: Partial<AgentJob>) => Promise<AgentJob | null>;
182
+ /** DELETE /api/v1/agent-jobs/{jobId} — true on success. */
115
183
  deleteAgentJob: (jobId: string) => Promise<boolean>;
184
+ /** POST /api/v1/agent-jobs/{jobId}/pause — paused job, or null on error. */
116
185
  pauseAgentJob: (jobId: string) => Promise<AgentJob | null>;
186
+ /** POST /api/v1/agent-jobs/{jobId}/resume — resumed job, or null on error. */
117
187
  resumeAgentJob: (jobId: string) => Promise<AgentJob | null>;
118
- };
119
-
120
- interface UseWidgetsOptions extends ApiClientOptions {
121
- agentId: string;
122
188
  }
123
189
  /**
124
- * Hook for widget CRUD operations
190
+ * Hook for agent job CRUD operations
125
191
  *
126
192
  * @example
127
193
  * ```tsx
128
- * const { loading, error, listWidgets, createWidget } = useWidgets({
194
+ * const { loading, error, listAgentJobs, createAgentJob, pauseAgentJob } = useAgentJobs({
129
195
  * baseUrl: apiGatewayUrl,
130
196
  * orgId: selectedOrgId,
131
- * agentId: selectedAgentId,
132
197
  * });
133
198
  *
134
- * const widgets = await listWidgets();
199
+ * const jobs = await listAgentJobs();
200
+ * await pauseAgentJob(jobId);
135
201
  * ```
136
202
  */
137
- declare function useWidgets(options: UseWidgetsOptions): {
203
+ declare function useAgentJobs(options: UseAgentJobsOptions): UseAgentJobsReturn;
204
+
205
+ interface UseWidgetsOptions extends ApiClientOptions {
206
+ agentId: string;
207
+ }
208
+ /**
209
+ * The exact, stable return surface of `useWidgets` (chat-widget CRUD for one
210
+ * agent; the agent is fixed by `options.agentId`). Imperative, non-throwing —
211
+ * on failure a method resolves to its default (`[]`, `null`, `false`) and sets
212
+ * `error`. See `SKILL.md`.
213
+ */
214
+ interface UseWidgetsReturn {
215
+ /** OR of all in-flight method loading flags. */
138
216
  loading: boolean;
217
+ /** First non-null method error, else null. */
139
218
  error: string | null;
219
+ /** GET /api/v1/agents/{agentId}/widgets — default []. */
140
220
  listWidgets: () => Promise<AgentWidget[]>;
221
+ /** GET /api/v1/widgets/{widgetId} — default null. */
141
222
  getWidget: (widgetId: string) => Promise<AgentWidget | null>;
223
+ /** GET /api/v1/agents/{agentId}/widgets/default — default null. */
142
224
  getDefaultWidget: () => Promise<AgentWidget | null>;
225
+ /** POST /api/v1/agents/{agentId}/widgets, body { widget } — created widget, or null on error. */
143
226
  createWidget: (widget: Partial<AgentWidget>) => Promise<AgentWidget | null>;
227
+ /** PUT /api/v1/widgets/{widgetId}, body { widget } — updated widget, or null on error. */
144
228
  updateWidget: (widgetId: string, widget: Partial<AgentWidget>) => Promise<AgentWidget | null>;
229
+ /** DELETE /api/v1/widgets/{widgetId} — true on success. */
145
230
  deleteWidget: (widgetId: string) => Promise<boolean>;
231
+ /** POST /api/v1/widgets/{widgetId}/default, body { agentId } — true on success. */
146
232
  setDefaultWidget: (widgetId: string) => Promise<boolean>;
147
- };
148
-
149
- type UseSkillUserConfigOptions = ApiClientOptions;
233
+ }
150
234
  /**
151
- * Hook for skill user configuration operations
235
+ * Hook for widget CRUD operations
152
236
  *
153
237
  * @example
154
238
  * ```tsx
155
- * const { loading, error, getSkillUserConfig, updateSkillUserConfig } = useSkillUserConfig({
239
+ * const { loading, error, listWidgets, createWidget } = useWidgets({
156
240
  * baseUrl: apiGatewayUrl,
157
241
  * orgId: selectedOrgId,
242
+ * agentId: selectedAgentId,
158
243
  * });
159
244
  *
160
- * const config = await getSkillUserConfig(skillId);
161
- * await updateSkillUserConfig(skillId, { enabled: true });
245
+ * const widgets = await listWidgets();
162
246
  * ```
163
247
  */
164
- declare function useSkillUserConfig(options: UseSkillUserConfigOptions): {
248
+ declare function useWidgets(options: UseWidgetsOptions): UseWidgetsReturn;
249
+
250
+ type UseSkillUserConfigOptions = ApiClientOptions;
251
+ /**
252
+ * The exact, stable return surface of `useSkillUserConfig`. Imperative,
253
+ * non-throwing — on failure each method resolves to the documented default
254
+ * (`null` / `false` / `[]`) and sets `error`.
255
+ */
256
+ interface UseSkillUserConfigReturn {
257
+ /** OR of all in-flight method loading flags. */
165
258
  loading: boolean;
259
+ /** First non-null method error, else null. */
166
260
  error: string | null;
167
- getSkillUserConfig: (skillId: string, agentId?: string | undefined) => Promise<SkillUserConfig | null>;
261
+ /** GET .../skills/{skillId}/user-config default null. */
262
+ getSkillUserConfig: (skillId: string, agentId?: string) => Promise<SkillUserConfig | null>;
263
+ /** PUT .../skills/{skillId}/user-config — config or null on error. */
168
264
  updateSkillUserConfig: (skillId: string, data: {
169
265
  enabled?: boolean;
170
266
  displayOrder?: number;
171
267
  config?: Record<string, unknown>;
172
268
  agentId?: string;
173
269
  }) => Promise<SkillUserConfig | null>;
174
- deleteSkillUserConfig: (skillId: string, agentId?: string | undefined) => Promise<boolean>;
270
+ /** DELETE .../skills/{skillId}/user-config true on success. */
271
+ deleteSkillUserConfig: (skillId: string, agentId?: string) => Promise<boolean>;
272
+ /** GET .../skills/user-configs — default []. */
175
273
  listSkillUserConfigs: (params?: {
176
274
  agentId?: string;
177
275
  limit?: number;
178
276
  offset?: number;
179
- } | undefined) => Promise<SkillUserConfig[]>;
277
+ }) => Promise<SkillUserConfig[]>;
278
+ /** GET .../skills/{skillId}/resolve — default null. */
180
279
  resolveSkillConfig: (skillId: string, agentId: string) => Promise<ResolveSkillConfigResponse | null>;
181
- };
182
-
183
- type UseAnalyticsOptions = ApiClientOptions;
280
+ }
184
281
  /**
185
- * Hook for agent analytics operations
282
+ * Hook for skill user configuration operations
186
283
  *
187
284
  * @example
188
285
  * ```tsx
189
- * const { loading, error, getAgentChatsAnalytics, getAgentCSATAnalytics } = useAnalytics({
286
+ * const { loading, error, getSkillUserConfig, updateSkillUserConfig } = useSkillUserConfig({
190
287
  * baseUrl: apiGatewayUrl,
191
288
  * orgId: selectedOrgId,
192
289
  * });
193
290
  *
194
- * const chatsData = await getAgentChatsAnalytics({ from: '2024-01-01', to: '2024-12-31' });
291
+ * const config = await getSkillUserConfig(skillId);
292
+ * await updateSkillUserConfig(skillId, { enabled: true });
195
293
  * ```
196
294
  */
197
- declare function useAnalytics(options: UseAnalyticsOptions): {
295
+ declare function useSkillUserConfig(options: UseSkillUserConfigOptions): UseSkillUserConfigReturn;
296
+
297
+ type UseAnalyticsOptions = ApiClientOptions;
298
+ /**
299
+ * The exact, stable return surface of `useAnalytics`. Imperative, non-throwing —
300
+ * on failure each method resolves to `[]` and sets `error`.
301
+ */
302
+ interface UseAnalyticsReturn {
303
+ /** OR of all in-flight method loading flags. */
198
304
  loading: boolean;
305
+ /** First non-null method error, else null. */
199
306
  error: string | null;
307
+ /** POST /api/v1/agents/analytics/chats — default []. */
200
308
  getAgentChatsAnalytics: (params: {
201
309
  date_filter: DateFilter;
202
310
  agent_id?: string;
203
311
  }) => Promise<unknown[]>;
312
+ /** POST /api/v1/agents/analytics/csat — default []. */
204
313
  getAgentCSATAnalytics: (params: {
205
314
  date_filter: DateFilter;
206
315
  agent_id?: string;
207
316
  }) => Promise<unknown[]>;
317
+ /** GET /api/v1/agents/analytics/list — default []. */
208
318
  getAgentListAnalytics: () => Promise<unknown[]>;
319
+ /** POST /api/v1/agents/analytics/task-outcomes — default []. */
209
320
  getTaskOutcomes: (params: {
210
321
  date_filter: DateFilter;
211
322
  }) => Promise<unknown[]>;
212
- };
213
-
214
- type UseIntegrationsOptions = ApiClientOptions;
323
+ }
215
324
  /**
216
- * Hook for user integration operations (OAuth connections)
325
+ * Hook for agent analytics operations
217
326
  *
218
327
  * @example
219
328
  * ```tsx
220
- * const { loading, error, listIntegrations, connectIntegration, disconnectIntegration } = useIntegrations({
329
+ * const { loading, error, getAgentChatsAnalytics, getAgentCSATAnalytics } = useAnalytics({
221
330
  * baseUrl: apiGatewayUrl,
222
331
  * orgId: selectedOrgId,
223
332
  * });
224
333
  *
225
- * const integrations = await listIntegrations();
226
- * const { auth_url } = await connectIntegration({ provider: 'google', integrationType: 'email', redirectUri: '/callback' });
334
+ * const chatsData = await getAgentChatsAnalytics({ from: '2024-01-01', to: '2024-12-31' });
227
335
  * ```
228
336
  */
229
- declare function useIntegrations(options: UseIntegrationsOptions): {
337
+ declare function useAnalytics(options: UseAnalyticsOptions): UseAnalyticsReturn;
338
+
339
+ type UseIntegrationsOptions = ApiClientOptions;
340
+ /**
341
+ * The exact, stable return surface of `useIntegrations`. Imperative,
342
+ * non-throwing — on failure each method resolves to the documented default
343
+ * (`[]` / `null` / `false`) and sets `error`.
344
+ */
345
+ interface UseIntegrationsReturn {
346
+ /** OR of all in-flight method loading flags. */
230
347
  loading: boolean;
348
+ /** First non-null method error, else null. */
231
349
  error: string | null;
350
+ /** GET /api/v1/integrations — default []. */
232
351
  listIntegrations: () => Promise<UserIntegration[]>;
352
+ /** GET /api/v1/integrations/{provider}/{type} — default null. */
233
353
  getIntegration: (provider: IntegrationProviderTS, integrationType: IntegrationTypeTS) => Promise<UserIntegration | null>;
354
+ /** POST /api/v1/integrations/connect — { authUrl, state } or null on error. */
234
355
  connectIntegration: (params: {
235
356
  provider: IntegrationProviderTS;
236
357
  integrationType: IntegrationTypeTS;
@@ -239,66 +360,110 @@ declare function useIntegrations(options: UseIntegrationsOptions): {
239
360
  authUrl: string;
240
361
  state: string;
241
362
  } | null>;
363
+ /** POST /api/v1/integrations/disconnect — true on success. */
242
364
  disconnectIntegration: (params: {
243
365
  provider: IntegrationProviderTS;
244
366
  integrationType: IntegrationTypeTS;
245
367
  }) => Promise<boolean>;
368
+ /** POST /api/v1/integrations/refresh — integration or null on error. */
246
369
  refreshIntegration: (params: {
247
370
  provider: IntegrationProviderTS;
248
371
  integrationType: IntegrationTypeTS;
249
372
  }) => Promise<UserIntegration | null>;
373
+ /** POST /api/v1/integrations/triage — integration or null on error. */
250
374
  updateTriage: (params: {
251
375
  provider: IntegrationProviderTS;
252
376
  integrationType: IntegrationTypeTS;
253
377
  triageEnabled: boolean;
254
378
  }) => Promise<UserIntegration | null>;
379
+ /** POST /api/v1/integrations/triage/run — { success, emailsFound, instancesCreated } or null on error. */
255
380
  runEmailTriage: () => Promise<{
256
381
  success: boolean;
257
382
  emailsFound: number;
258
383
  instancesCreated: number;
259
384
  } | null>;
260
- };
261
-
262
- type UseSandboxOptions = ApiClientOptions;
385
+ }
263
386
  /**
264
- * Hook for sandbox operations (AI-generated HTML sandboxes)
387
+ * Hook for user integration operations (OAuth connections)
265
388
  *
266
389
  * @example
267
390
  * ```tsx
268
- * const { createSandbox, getSandbox, listSandboxes, loading, error } = useSandbox({
391
+ * const { loading, error, listIntegrations, connectIntegration, disconnectIntegration } = useIntegrations({
269
392
  * baseUrl: apiGatewayUrl,
270
393
  * orgId: selectedOrgId,
271
394
  * });
272
395
  *
273
- * const result = await createSandbox({ prompt: "Create a bar chart showing sales data" });
274
- * console.log(result.url); // sandbox URL
396
+ * const integrations = await listIntegrations();
397
+ * const { auth_url } = await connectIntegration({ provider: 'google', integrationType: 'email', redirectUri: '/callback' });
275
398
  * ```
276
399
  */
277
- declare function useSandbox(options: UseSandboxOptions): {
400
+ declare function useIntegrations(options: UseIntegrationsOptions): UseIntegrationsReturn;
401
+
402
+ type UseSandboxOptions = ApiClientOptions;
403
+ /** Result of a create/update sandbox call (id + url + optional record). */
404
+ interface SandboxMutationResult {
405
+ id: string;
406
+ url: string;
407
+ sandbox?: Sandbox;
408
+ }
409
+ /**
410
+ * The exact, stable return surface of `useSandbox`. Imperative, non-throwing —
411
+ * on failure each method resolves to the documented default and sets `error`.
412
+ */
413
+ interface UseSandboxReturn {
414
+ /** OR of all in-flight method loading flags. */
278
415
  loading: boolean;
416
+ /** First non-null method error, else null. */
279
417
  error: string | null;
280
- createSandbox: (request: Omit<CreateSandboxRequest, "orgId">) => Promise<{
281
- id: string;
282
- url: string;
283
- sandbox?: Sandbox;
284
- } | null>;
418
+ /** POST /api/v1/sandboxes — { id, url, sandbox? } or null on error. */
419
+ createSandbox: (request: Omit<CreateSandboxRequest, "orgId">) => Promise<SandboxMutationResult | null>;
420
+ /** GET /api/v1/sandboxes/{sandboxId} — default null. */
285
421
  getSandbox: (sandboxId: string) => Promise<Sandbox | null>;
422
+ /** PUT /api/v1/sandboxes/{sandboxId} — { id, url, sandbox? } or null on error. */
286
423
  updateSandbox: (sandboxId: string, request: {
287
424
  prompt: string;
288
425
  title?: string;
289
- }) => Promise<{
290
- id: string;
291
- url: string;
292
- sandbox?: Sandbox;
293
- } | null>;
294
- listSandboxes: (limit?: number | undefined) => Promise<{
426
+ }) => Promise<SandboxMutationResult | null>;
427
+ /** GET /api/v1/sandboxes — { sandboxes, total }; default { sandboxes: [], total: 0 }. */
428
+ listSandboxes: (limit?: number) => Promise<{
295
429
  sandboxes: Sandbox[];
296
430
  total: number;
297
431
  }>;
432
+ /** DELETE /api/v1/sandboxes/{sandboxId} — true on success. */
298
433
  deleteSandbox: (sandboxId: string) => Promise<boolean>;
299
- };
434
+ }
435
+ /**
436
+ * Hook for sandbox operations (AI-generated HTML sandboxes)
437
+ *
438
+ * @example
439
+ * ```tsx
440
+ * const { createSandbox, getSandbox, listSandboxes, loading, error } = useSandbox({
441
+ * baseUrl: apiGatewayUrl,
442
+ * orgId: selectedOrgId,
443
+ * });
444
+ *
445
+ * const result = await createSandbox({ prompt: "Create a bar chart showing sales data" });
446
+ * console.log(result.url); // sandbox URL
447
+ * ```
448
+ */
449
+ declare function useSandbox(options: UseSandboxOptions): UseSandboxReturn;
300
450
 
301
451
  type UseStructuredOutputOptions = ApiClientOptions;
452
+ /**
453
+ * The exact, stable return surface of `useStructuredOutput`. One-shot,
454
+ * non-throwing — `run` resolves to the structured response, or `null` on
455
+ * failure (with `error` set).
456
+ */
457
+ interface UseStructuredOutputReturn<T = unknown> {
458
+ /** POST /api/v1/structured-output — typed response, or null on error. */
459
+ run: (request: StructuredOutputRequest) => Promise<StructuredOutputResponse<T> | null>;
460
+ /** True while a request is in flight. */
461
+ loading: boolean;
462
+ /** Last error message, else null. */
463
+ error: string | null;
464
+ /** Clears the current error. */
465
+ clearError: () => void;
466
+ }
302
467
  /**
303
468
  * Hook for the one-shot structured-output LLM primitive.
304
469
  *
@@ -319,79 +484,106 @@ type UseStructuredOutputOptions = ApiClientOptions;
319
484
  * });
320
485
  * ```
321
486
  */
322
- declare function useStructuredOutput<T = unknown>(options: UseStructuredOutputOptions): {
323
- run: (request: StructuredOutputRequest) => Promise<StructuredOutputResponse<T> | null>;
324
- loading: boolean;
325
- error: string | null;
326
- clearError: () => void;
327
- };
487
+ declare function useStructuredOutput<T = unknown>(options: UseStructuredOutputOptions): UseStructuredOutputReturn<T>;
328
488
 
329
489
  type UseSchedulerTasksOptions = ApiClientOptions;
330
490
  /**
331
- * Hook for scheduler task operations
332
- *
333
- * @example
334
- * ```tsx
335
- * const { listTasks, createTask, snoozeTask, loading, error } = useSchedulerTasks({
336
- * baseUrl: apiGatewayUrl,
337
- * orgId: selectedOrgId,
338
- * });
339
- *
340
- * const tasks = await listTasks();
341
- * await snoozeTask(taskId, { amount: 30, unit: "minutes" });
342
- * ```
491
+ * The exact, stable return surface of `useSchedulerTasks`. Imperative,
492
+ * non-throwing — on failure each method resolves to the documented default
493
+ * (`[]` / `null` / `false`) and sets `error`.
343
494
  */
344
- declare function useSchedulerTasks(options: UseSchedulerTasksOptions): {
495
+ interface UseSchedulerTasksReturn {
496
+ /** OR of all in-flight method loading flags. */
345
497
  loading: boolean;
498
+ /** First non-null method error, else null. */
346
499
  error: string | null;
500
+ /** GET /api/v1/scheduler/tasks — default []. */
347
501
  listTasks: (params?: {
348
502
  status?: string;
349
503
  limit?: number;
350
504
  offset?: number;
351
- } | undefined) => Promise<SchedulerTask[]>;
505
+ }) => Promise<SchedulerTask[]>;
506
+ /** POST /api/v1/scheduler/tasks — created task, or null on error. */
352
507
  createTask: (task: Partial<SchedulerTask>) => Promise<SchedulerTask | null>;
508
+ /** GET /api/v1/scheduler/tasks/{taskId} — default null. */
353
509
  getTask: (taskId: string) => Promise<SchedulerTask | null>;
510
+ /** PUT /api/v1/scheduler/tasks/{taskId} — updated task, or null on error. */
354
511
  updateTask: (taskId: string, task: Partial<SchedulerTask>) => Promise<SchedulerTask | null>;
512
+ /** DELETE /api/v1/scheduler/tasks/{taskId} — true on success. */
355
513
  deleteTask: (taskId: string) => Promise<boolean>;
514
+ /** POST /api/v1/scheduler/tasks/{taskId}/snooze — task or null on error. */
356
515
  snoozeTask: (taskId: string, delay: {
357
516
  amount: number;
358
517
  unit: string;
359
518
  }) => Promise<SchedulerTask | null>;
519
+ /** POST /api/v1/scheduler/tasks/{taskId}/complete — task or null on error. */
360
520
  completeTask: (taskId: string) => Promise<SchedulerTask | null>;
521
+ /** POST /api/v1/scheduler/tasks/{taskId}/start — task or null on error. */
361
522
  startTask: (taskId: string) => Promise<SchedulerTask | null>;
362
- };
363
-
364
- type UseSchedulerSchedulesOptions = ApiClientOptions;
523
+ }
365
524
  /**
366
- * Hook for scheduler schedule operations (recurring jobs)
525
+ * Hook for scheduler task operations
367
526
  *
368
527
  * @example
369
528
  * ```tsx
370
- * const { listSchedules, createSchedule, pauseSchedule, loading, error } = useSchedulerSchedules({
529
+ * const { listTasks, createTask, snoozeTask, loading, error } = useSchedulerTasks({
371
530
  * baseUrl: apiGatewayUrl,
372
531
  * orgId: selectedOrgId,
373
532
  * });
374
533
  *
375
- * const schedules = await listSchedules();
376
- * await pauseSchedule(scheduleId);
534
+ * const tasks = await listTasks();
535
+ * await snoozeTask(taskId, { amount: 30, unit: "minutes" });
377
536
  * ```
378
537
  */
379
- declare function useSchedulerSchedules(options: UseSchedulerSchedulesOptions): {
538
+ declare function useSchedulerTasks(options: UseSchedulerTasksOptions): UseSchedulerTasksReturn;
539
+
540
+ type UseSchedulerSchedulesOptions = ApiClientOptions;
541
+ /**
542
+ * The exact, stable return surface of `useSchedulerSchedules`. Imperative,
543
+ * non-throwing — on failure each method resolves to the documented default
544
+ * (`[]` / `null` / `false`) and sets `error`.
545
+ */
546
+ interface UseSchedulerSchedulesReturn {
547
+ /** OR of all in-flight method loading flags. */
380
548
  loading: boolean;
549
+ /** First non-null method error, else null. */
381
550
  error: string | null;
551
+ /** GET /api/v1/scheduler/schedules — default []. */
382
552
  listSchedules: (params?: {
383
553
  status?: string;
384
554
  limit?: number;
385
555
  offset?: number;
386
- } | undefined) => Promise<SchedulerSchedule[]>;
556
+ }) => Promise<SchedulerSchedule[]>;
557
+ /** POST /api/v1/scheduler/schedules — created schedule, or null on error. */
387
558
  createSchedule: (schedule: Partial<SchedulerSchedule>) => Promise<SchedulerSchedule | null>;
559
+ /** GET /api/v1/scheduler/schedules/{scheduleId} — default null. */
388
560
  getSchedule: (scheduleId: string) => Promise<SchedulerSchedule | null>;
561
+ /** PUT /api/v1/scheduler/schedules/{scheduleId} — updated schedule, or null on error. */
389
562
  updateSchedule: (scheduleId: string, schedule: Partial<SchedulerSchedule>) => Promise<SchedulerSchedule | null>;
563
+ /** DELETE /api/v1/scheduler/schedules/{scheduleId} — true on success. */
390
564
  deleteSchedule: (scheduleId: string) => Promise<boolean>;
565
+ /** POST /api/v1/scheduler/schedules/{scheduleId}/pause — schedule or null on error. */
391
566
  pauseSchedule: (scheduleId: string) => Promise<SchedulerSchedule | null>;
567
+ /** POST /api/v1/scheduler/schedules/{scheduleId}/resume — schedule or null on error. */
392
568
  resumeSchedule: (scheduleId: string) => Promise<SchedulerSchedule | null>;
569
+ /** POST /api/v1/scheduler/schedules/{scheduleId}/run — schedule or null on error. */
393
570
  runSchedule: (scheduleId: string) => Promise<SchedulerSchedule | null>;
394
- };
571
+ }
572
+ /**
573
+ * Hook for scheduler schedule operations (recurring jobs)
574
+ *
575
+ * @example
576
+ * ```tsx
577
+ * const { listSchedules, createSchedule, pauseSchedule, loading, error } = useSchedulerSchedules({
578
+ * baseUrl: apiGatewayUrl,
579
+ * orgId: selectedOrgId,
580
+ * });
581
+ *
582
+ * const schedules = await listSchedules();
583
+ * await pauseSchedule(scheduleId);
584
+ * ```
585
+ */
586
+ declare function useSchedulerSchedules(options: UseSchedulerSchedulesOptions): UseSchedulerSchedulesReturn;
395
587
 
396
588
  /** Live state accumulated from SSE events for a single background agent */
397
589
  interface BGAgentLiveState {
@@ -425,6 +617,38 @@ interface WatchedChatState {
425
617
  metadata?: Record<string, unknown>;
426
618
  error?: string;
427
619
  }
620
+ /**
621
+ * The exact, stable return surface of `useBackgroundAgents`.
622
+ *
623
+ * This is a **realtime** hook (the allowed shape deviation): it holds SSE
624
+ * connection/stream state (`liveStates`, `watchedChats`) alongside the standard
625
+ * `{ loading, error, ...actions }`. The imperative methods are non-throwing — on
626
+ * failure they resolve to the documented default and set `error` (or log).
627
+ */
628
+ interface UseBackgroundAgentsReturn {
629
+ /** Live SSE-accumulated state per streamed jobId. */
630
+ liveStates: Record<string, BGAgentLiveState>;
631
+ /** Open an SSE stream for a job's progress (job runs via the jobs API). */
632
+ streamJob: (jobId: string) => void;
633
+ /** Create a background task via the chat system — returns chatKey, or null on error. */
634
+ createTask: (prompt: string, attachments?: Attachment[]) => Promise<string | null>;
635
+ /** Watch a chat for realtime updates via SSE. */
636
+ watchChat: (chatKey: string) => Promise<void>;
637
+ /** Stop watching a chat and tear down its SSE connection. */
638
+ unwatchChat: (chatKey: string) => void;
639
+ /** Live state per watched chatKey. */
640
+ watchedChats: Record<string, WatchedChatState>;
641
+ /** POST /api/v1/agents/background/trigger — response, or null on error. */
642
+ triggerAgent: (request: Pick<TriggerBackgroundAgentRequest, "name" | "prompt" | "agentName" | "context" | "enableSSE" | "description">) => Promise<TriggerBackgroundAgentResponse | null>;
643
+ /** GET /api/v1/agents/background/{jobId}/status — response, or null on error. */
644
+ checkStatus: (jobId: string) => Promise<BackgroundAgentStatusResponse | null>;
645
+ /** GET /api/v1/agents/summary — default []. */
646
+ listAgentSummaries: () => Promise<AgentSummary[]>;
647
+ /** OR of the imperative methods' in-flight loading flags. */
648
+ loading: boolean;
649
+ /** First non-null imperative-method error, else null. */
650
+ error: string | null;
651
+ }
428
652
  /**
429
653
  * Hook for triggering background agents, streaming progress via SSE, and checking status.
430
654
  *
@@ -446,19 +670,7 @@ interface WatchedChatState {
446
670
  * if (result?.jobId) streamJob(result.jobId);
447
671
  * ```
448
672
  */
449
- declare function useBackgroundAgents(options: UseBackgroundAgentsOptions): {
450
- liveStates: Record<string, BGAgentLiveState>;
451
- streamJob: (jobId: string) => void;
452
- createTask: (prompt: string, attachments?: Attachment[]) => Promise<string | null>;
453
- watchChat: (chatKey: string) => Promise<void>;
454
- unwatchChat: (chatKey: string) => void;
455
- watchedChats: Record<string, WatchedChatState>;
456
- triggerAgent: (request: Pick<TriggerBackgroundAgentRequest, "name" | "description" | "prompt" | "agentName" | "context" | "enableSSE">) => Promise<TriggerBackgroundAgentResponse | null>;
457
- checkStatus: (jobId: string) => Promise<BackgroundAgentStatusResponse | null>;
458
- listAgentSummaries: () => Promise<AgentSummary[]>;
459
- loading: boolean;
460
- error: string | null;
461
- };
673
+ declare function useBackgroundAgents(options: UseBackgroundAgentsOptions): UseBackgroundAgentsReturn;
462
674
 
463
675
  /**
464
676
  * Creates a ref that stays synchronized with the provided options.
@@ -480,4 +692,4 @@ declare function useBackgroundAgents(options: UseBackgroundAgentsOptions): {
480
692
  */
481
693
  declare function useOptionsRef<T>(options: T): React.MutableRefObject<T>;
482
694
 
483
- export { type BGAgentLiveState, type BackgroundStatus, type UseAgentJobsOptions, type UseAgentsOptions, type UseAnalyticsOptions, type UseBackgroundAgentsOptions, type UseIntegrationsOptions, type UseSandboxOptions, type UseSchedulerSchedulesOptions, type UseSchedulerTasksOptions, type UseSkillUserConfigOptions, type UseSkillsOptions, type UseStructuredOutputOptions, type UseSubAgentsOptions, type UseToolDefinitionsOptions, type UseWidgetsOptions, type WatchedChatState, useAgentJobs, useAgents, useAnalytics, useBackgroundAgents, useIntegrations, useOptionsRef, useSandbox, useSchedulerSchedules, useSchedulerTasks, useSkillUserConfig, useSkills, useStructuredOutput, useSubAgents, useToolDefinitions, useWidgets };
695
+ export { type BGAgentLiveState, type BackgroundStatus, type SandboxMutationResult, type UseAgentJobsOptions, type UseAgentJobsReturn, type UseAgentsOptions, type UseAgentsReturn, type UseAnalyticsOptions, type UseAnalyticsReturn, type UseBackgroundAgentsOptions, type UseBackgroundAgentsReturn, type UseIntegrationsOptions, type UseIntegrationsReturn, type UseSandboxOptions, type UseSandboxReturn, type UseSchedulerSchedulesOptions, type UseSchedulerSchedulesReturn, type UseSchedulerTasksOptions, type UseSchedulerTasksReturn, type UseSkillUserConfigOptions, type UseSkillUserConfigReturn, type UseSkillsOptions, type UseSkillsReturn, type UseStructuredOutputOptions, type UseStructuredOutputReturn, type UseSubAgentsOptions, type UseSubAgentsReturn, type UseToolDefinitionsOptions, type UseToolDefinitionsReturn, type UseWidgetsOptions, type UseWidgetsReturn, type WatchedChatState, useAgentJobs, useAgents, useAnalytics, useBackgroundAgents, useIntegrations, useOptionsRef, useSandbox, useSchedulerSchedules, useSchedulerTasks, useSkillUserConfig, useSkills, useStructuredOutput, useSubAgents, useToolDefinitions, useWidgets };