@axiom-lattice/client-sdk 4.0.0 → 4.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 +37 -0
- package/dist/__tests__/web-apps.test.d.ts +8 -0
- package/dist/__tests__/web-apps.test.d.ts.map +1 -0
- package/dist/__tests__/web-apps.test.js +166 -0
- package/dist/__tests__/web-apps.test.js.map +1 -0
- package/dist/abstract-client.d.ts +48 -1
- package/dist/abstract-client.d.ts.map +1 -1
- package/dist/abstract-client.js +96 -0
- package/dist/abstract-client.js.map +1 -1
- package/dist/index.d.ts +60 -3
- package/dist/index.js +101 -0
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +101 -0
- package/dist/index.mjs.map +1 -1
- package/dist/types.d.ts +12 -1
- package/dist/types.d.ts.map +1 -1
- package/dist/types.js.map +1 -1
- package/package.json +2 -2
package/dist/index.d.ts
CHANGED
|
@@ -1,10 +1,20 @@
|
|
|
1
|
-
import { Message, MessageChunk, DatabaseConfigEntry, MetricsServerConfigEntry, DataSource, McpServerConfigEntry, McpTool, LocalA2ATemplateDefinition, TaskItem, CreateDatabaseConfigRequest, UpdateDatabaseConfigRequest, CreateMetricsServerConfigRequest, UpdateMetricsServerConfigRequest, CreateMcpServerConfigRequest, UpdateMcpServerConfigRequest, ConnectionEntry, CreateTaskRequest, UpdateTaskRequest, TaskWorkItem, LocalA2AProviderState, Skill, CreateSkillRequest, CreateShareRequest, ShareResult, ShareRecord } from '@axiom-lattice/protocols';
|
|
2
|
-
export { LocalA2AProviderId, LocalA2AProviderState, LocalA2AProviderStatus, LocalA2ATemplateDefinition, LocalRuntimeConfig } from '@axiom-lattice/protocols';
|
|
1
|
+
import { AgentWebApp, Message, MessageChunk, DatabaseConfigEntry, MetricsServerConfigEntry, DataSource, McpServerConfigEntry, McpTool, LocalA2ATemplateDefinition, TaskItem, CreateDatabaseConfigRequest, UpdateDatabaseConfigRequest, CreateMetricsServerConfigRequest, UpdateMetricsServerConfigRequest, CreateMcpServerConfigRequest, UpdateMcpServerConfigRequest, ConnectionEntry, CreateTaskRequest, UpdateTaskRequest, TaskWorkItem, LocalA2AProviderState, CreateAgentWebAppInput, UpdateAgentWebAppInput, Skill, CreateSkillRequest, CreateShareRequest, ShareResult, ShareRecord } from '@axiom-lattice/protocols';
|
|
2
|
+
export { AgentWebApp, AgentWebAppAppearance, AgentWebAppFeatures, AgentWebAppScope, AgentWebAppStatus, CreateAgentWebAppInput, LocalA2AProviderId, LocalA2AProviderState, LocalA2AProviderStatus, LocalA2ATemplateDefinition, LocalRuntimeConfig, UpdateAgentWebAppInput } from '@axiom-lattice/protocols';
|
|
3
3
|
|
|
4
4
|
/**
|
|
5
5
|
* Core types for the Axiom Lattice Client SDK
|
|
6
6
|
*/
|
|
7
7
|
|
|
8
|
+
/** Optional filters for listing Agent Web Apps. */
|
|
9
|
+
interface ListAgentWebAppsParams {
|
|
10
|
+
/** Return only publications for this assistant. */
|
|
11
|
+
assistantId?: string;
|
|
12
|
+
}
|
|
13
|
+
/** Agent Web App list data, unwrapped from the gateway response envelope. */
|
|
14
|
+
interface AgentWebAppsListResponse {
|
|
15
|
+
records: AgentWebApp[];
|
|
16
|
+
total: number;
|
|
17
|
+
}
|
|
8
18
|
/**
|
|
9
19
|
* Tool interface for API responses
|
|
10
20
|
* Represents a tool configuration stored in the database
|
|
@@ -978,6 +988,7 @@ declare abstract class AbstractClient {
|
|
|
978
988
|
tenantId: string;
|
|
979
989
|
protected registeredTools: Map<string, RegisterToolOptions>;
|
|
980
990
|
private onUnauthorizedHandler?;
|
|
991
|
+
private hydrateAgentWebApp;
|
|
981
992
|
/**
|
|
982
993
|
* Server tools namespace for managing tools via API
|
|
983
994
|
*/
|
|
@@ -1375,6 +1386,52 @@ declare abstract class AbstractClient {
|
|
|
1375
1386
|
*/
|
|
1376
1387
|
rotate: (id: string) => Promise<A2AKeyListItem>;
|
|
1377
1388
|
};
|
|
1389
|
+
/** Agent Web Apps namespace for managing React SDK publications. */
|
|
1390
|
+
webApps: {
|
|
1391
|
+
/**
|
|
1392
|
+
* Lists Agent Web Apps, optionally filtered by assistant.
|
|
1393
|
+
* @param params - Optional assistant filter
|
|
1394
|
+
* @returns A promise that resolves to the publication records and total
|
|
1395
|
+
*/
|
|
1396
|
+
list: (params?: ListAgentWebAppsParams) => Promise<AgentWebAppsListResponse>;
|
|
1397
|
+
/**
|
|
1398
|
+
* Retrieves an Agent Web App by ID.
|
|
1399
|
+
* @param id - Agent Web App identifier
|
|
1400
|
+
* @returns A promise that resolves to the publication
|
|
1401
|
+
*/
|
|
1402
|
+
get: (id: string) => Promise<AgentWebApp>;
|
|
1403
|
+
/**
|
|
1404
|
+
* Creates an Agent Web App.
|
|
1405
|
+
* @param input - Publication configuration
|
|
1406
|
+
* @returns A promise that resolves to the created publication
|
|
1407
|
+
*/
|
|
1408
|
+
create: (input: CreateAgentWebAppInput) => Promise<AgentWebApp>;
|
|
1409
|
+
/**
|
|
1410
|
+
* Updates editable fields on an Agent Web App.
|
|
1411
|
+
* @param id - Agent Web App identifier
|
|
1412
|
+
* @param input - Fields to update
|
|
1413
|
+
* @returns A promise that resolves to the updated publication
|
|
1414
|
+
*/
|
|
1415
|
+
update: (id: string, input: UpdateAgentWebAppInput) => Promise<AgentWebApp>;
|
|
1416
|
+
/**
|
|
1417
|
+
* Enables an Agent Web App.
|
|
1418
|
+
* @param id - Agent Web App identifier
|
|
1419
|
+
* @returns A promise that resolves to the enabled publication
|
|
1420
|
+
*/
|
|
1421
|
+
enable: (id: string) => Promise<AgentWebApp>;
|
|
1422
|
+
/**
|
|
1423
|
+
* Disables an Agent Web App.
|
|
1424
|
+
* @param id - Agent Web App identifier
|
|
1425
|
+
* @returns A promise that resolves to the disabled publication
|
|
1426
|
+
*/
|
|
1427
|
+
disable: (id: string) => Promise<AgentWebApp>;
|
|
1428
|
+
/**
|
|
1429
|
+
* Permanently deletes an Agent Web App.
|
|
1430
|
+
* @param id - Agent Web App identifier
|
|
1431
|
+
* @returns A promise that resolves when the publication is deleted
|
|
1432
|
+
*/
|
|
1433
|
+
delete: (id: string) => Promise<void>;
|
|
1434
|
+
};
|
|
1378
1435
|
/**
|
|
1379
1436
|
* Skills namespace for managing skills
|
|
1380
1437
|
*/
|
|
@@ -1967,4 +2024,4 @@ declare function createSimpleMessageMerger(): {
|
|
|
1967
2024
|
reset: () => void;
|
|
1968
2025
|
};
|
|
1969
2026
|
|
|
1970
|
-
export { A2AKeyListItem, A2AKeysListResponse, AbortAgentParams, AbstractClient, AgentState, ApiError, ArchiveInput, Assistant, AssistantListResponse, AssistantResponse, AuthenticationError, ChatResponse, ChatSendOptions, ChatStreamOptions, Client, ClientConfig, CompleteTaskInput, CompleteTaskResponse, CreateA2AKeyInput, CreateAssistantOptions, CreateProjectRequest, CreateThreadOptions, CreateWorkspaceRequest, DatabaseConfigResponse, DatabaseConfigsListResponse, DatasourcesListResponse, ExportBundle, ExportConfigResult, ExportConfirmationRequired, ExportDownload, ExportEntityIds, ExportEntityPreview, ExportEntityPreviewMap, ExportImportClient, ExportJobResult, ExportableEntity, ExportableTypeInfo, FileItem, GetMessagesOptions, GetScheduledTasksOptions, ImportApplyResult, ImportConflict, ImportEntityResult, ImportInsertion, ImportPreviewError, ImportPreviewResult, ImportResolution, ImportResolutions, ImportSource, ListThreadsOptions, LocalA2ATemplatesListResponse, McpServerResponse, McpServersListResponse, MetricsConfigResponse, MetricsConfigsListResponse, NetworkError, PendingMessage, Project, ProjectKind, RegisterToolOptions, RemovePendingMessageOptions, ResourcesClient, ResumeStreamOptions, RetryConfig, RunOptions, ScheduleExecutionType, ScheduledTask, ScheduledTaskStatus, ScheduledTasksListResponse, StorageType, StreamCallbacks, StreamEvent, TaskLifecycleWarning, TaskResponse, TasksListResponse, TestConnectionResponse, TestMcpServerResponse, Thread, ThreadListResponse, ThreadResponse, Tool, ToolResponse, ToolsListResponse, Transport, UpdateAssistantOptions, UpdateProjectRequest, UpdateThreadOptions, UpdateWorkspaceRequest, WeChatClient, Workspace, WorkspaceClient, createSimpleMessageMerger };
|
|
2027
|
+
export { A2AKeyListItem, A2AKeysListResponse, AbortAgentParams, AbstractClient, AgentState, AgentWebAppsListResponse, ApiError, ArchiveInput, Assistant, AssistantListResponse, AssistantResponse, AuthenticationError, ChatResponse, ChatSendOptions, ChatStreamOptions, Client, ClientConfig, CompleteTaskInput, CompleteTaskResponse, CreateA2AKeyInput, CreateAssistantOptions, CreateProjectRequest, CreateThreadOptions, CreateWorkspaceRequest, DatabaseConfigResponse, DatabaseConfigsListResponse, DatasourcesListResponse, ExportBundle, ExportConfigResult, ExportConfirmationRequired, ExportDownload, ExportEntityIds, ExportEntityPreview, ExportEntityPreviewMap, ExportImportClient, ExportJobResult, ExportableEntity, ExportableTypeInfo, FileItem, GetMessagesOptions, GetScheduledTasksOptions, ImportApplyResult, ImportConflict, ImportEntityResult, ImportInsertion, ImportPreviewError, ImportPreviewResult, ImportResolution, ImportResolutions, ImportSource, ListAgentWebAppsParams, ListThreadsOptions, LocalA2ATemplatesListResponse, McpServerResponse, McpServersListResponse, MetricsConfigResponse, MetricsConfigsListResponse, NetworkError, PendingMessage, Project, ProjectKind, RegisterToolOptions, RemovePendingMessageOptions, ResourcesClient, ResumeStreamOptions, RetryConfig, RunOptions, ScheduleExecutionType, ScheduledTask, ScheduledTaskStatus, ScheduledTasksListResponse, StorageType, StreamCallbacks, StreamEvent, TaskLifecycleWarning, TaskResponse, TasksListResponse, TestConnectionResponse, TestMcpServerResponse, Thread, ThreadListResponse, ThreadResponse, Tool, ToolResponse, ToolsListResponse, Transport, UpdateAssistantOptions, UpdateProjectRequest, UpdateThreadOptions, UpdateWorkspaceRequest, WeChatClient, Workspace, WorkspaceClient, createSimpleMessageMerger };
|
package/dist/index.js
CHANGED
|
@@ -2224,6 +2224,86 @@ var AbstractClient = class {
|
|
|
2224
2224
|
return response.data;
|
|
2225
2225
|
}
|
|
2226
2226
|
};
|
|
2227
|
+
/** Agent Web Apps namespace for managing React SDK publications. */
|
|
2228
|
+
this.webApps = {
|
|
2229
|
+
/**
|
|
2230
|
+
* Lists Agent Web Apps, optionally filtered by assistant.
|
|
2231
|
+
* @param params - Optional assistant filter
|
|
2232
|
+
* @returns A promise that resolves to the publication records and total
|
|
2233
|
+
*/
|
|
2234
|
+
list: async (params) => {
|
|
2235
|
+
const searchParams = new URLSearchParams();
|
|
2236
|
+
if (params?.assistantId) {
|
|
2237
|
+
searchParams.set("assistantId", params.assistantId);
|
|
2238
|
+
}
|
|
2239
|
+
const query = searchParams.toString();
|
|
2240
|
+
const response = await this.makeRequest(`/api/web-apps${query ? `?${query}` : ""}`);
|
|
2241
|
+
return {
|
|
2242
|
+
records: response.data.records.map((record) => this.hydrateAgentWebApp(record)),
|
|
2243
|
+
total: response.data.total
|
|
2244
|
+
};
|
|
2245
|
+
},
|
|
2246
|
+
/**
|
|
2247
|
+
* Retrieves an Agent Web App by ID.
|
|
2248
|
+
* @param id - Agent Web App identifier
|
|
2249
|
+
* @returns A promise that resolves to the publication
|
|
2250
|
+
*/
|
|
2251
|
+
get: async (id) => {
|
|
2252
|
+
const response = await this.makeRequest(`/api/web-apps/${encodeURIComponent(id)}`);
|
|
2253
|
+
return this.hydrateAgentWebApp(response.data);
|
|
2254
|
+
},
|
|
2255
|
+
/**
|
|
2256
|
+
* Creates an Agent Web App.
|
|
2257
|
+
* @param input - Publication configuration
|
|
2258
|
+
* @returns A promise that resolves to the created publication
|
|
2259
|
+
*/
|
|
2260
|
+
create: async (input) => {
|
|
2261
|
+
const response = await this.makeRequest("/api/web-apps", { method: "POST", body: input });
|
|
2262
|
+
return this.hydrateAgentWebApp(response.data);
|
|
2263
|
+
},
|
|
2264
|
+
/**
|
|
2265
|
+
* Updates editable fields on an Agent Web App.
|
|
2266
|
+
* @param id - Agent Web App identifier
|
|
2267
|
+
* @param input - Fields to update
|
|
2268
|
+
* @returns A promise that resolves to the updated publication
|
|
2269
|
+
*/
|
|
2270
|
+
update: async (id, input) => {
|
|
2271
|
+
const response = await this.makeRequest(`/api/web-apps/${encodeURIComponent(id)}`, {
|
|
2272
|
+
method: "PATCH",
|
|
2273
|
+
body: input
|
|
2274
|
+
});
|
|
2275
|
+
return this.hydrateAgentWebApp(response.data);
|
|
2276
|
+
},
|
|
2277
|
+
/**
|
|
2278
|
+
* Enables an Agent Web App.
|
|
2279
|
+
* @param id - Agent Web App identifier
|
|
2280
|
+
* @returns A promise that resolves to the enabled publication
|
|
2281
|
+
*/
|
|
2282
|
+
enable: async (id) => {
|
|
2283
|
+
const response = await this.makeRequest(`/api/web-apps/${encodeURIComponent(id)}/enable`, { method: "POST" });
|
|
2284
|
+
return this.hydrateAgentWebApp(response.data);
|
|
2285
|
+
},
|
|
2286
|
+
/**
|
|
2287
|
+
* Disables an Agent Web App.
|
|
2288
|
+
* @param id - Agent Web App identifier
|
|
2289
|
+
* @returns A promise that resolves to the disabled publication
|
|
2290
|
+
*/
|
|
2291
|
+
disable: async (id) => {
|
|
2292
|
+
const response = await this.makeRequest(`/api/web-apps/${encodeURIComponent(id)}/disable`, { method: "POST" });
|
|
2293
|
+
return this.hydrateAgentWebApp(response.data);
|
|
2294
|
+
},
|
|
2295
|
+
/**
|
|
2296
|
+
* Permanently deletes an Agent Web App.
|
|
2297
|
+
* @param id - Agent Web App identifier
|
|
2298
|
+
* @returns A promise that resolves when the publication is deleted
|
|
2299
|
+
*/
|
|
2300
|
+
delete: async (id) => {
|
|
2301
|
+
await this.makeRequest(
|
|
2302
|
+
`/api/web-apps/${encodeURIComponent(id)}`,
|
|
2303
|
+
{ method: "DELETE" }
|
|
2304
|
+
);
|
|
2305
|
+
}
|
|
2306
|
+
};
|
|
2227
2307
|
/**
|
|
2228
2308
|
* Skills namespace for managing skills
|
|
2229
2309
|
*/
|
|
@@ -2796,6 +2876,27 @@ var AbstractClient = class {
|
|
|
2796
2876
|
}
|
|
2797
2877
|
};
|
|
2798
2878
|
}
|
|
2879
|
+
hydrateAgentWebApp(value) {
|
|
2880
|
+
if (!value || typeof value !== "object" || Array.isArray(value)) {
|
|
2881
|
+
throw new ApiError("Invalid Agent Web App response", 500, value);
|
|
2882
|
+
}
|
|
2883
|
+
const record = value;
|
|
2884
|
+
const hydrateDate = (field) => {
|
|
2885
|
+
const raw = record[field];
|
|
2886
|
+
const date = raw instanceof Date ? new Date(raw.getTime()) : new Date(
|
|
2887
|
+
typeof raw === "string" || typeof raw === "number" ? raw : Number.NaN
|
|
2888
|
+
);
|
|
2889
|
+
if (Number.isNaN(date.getTime())) {
|
|
2890
|
+
throw new ApiError(`Invalid Agent Web App ${field}`, 500, value);
|
|
2891
|
+
}
|
|
2892
|
+
return date;
|
|
2893
|
+
};
|
|
2894
|
+
return {
|
|
2895
|
+
...record,
|
|
2896
|
+
createdAt: hydrateDate("createdAt"),
|
|
2897
|
+
updatedAt: hydrateDate("updatedAt")
|
|
2898
|
+
};
|
|
2899
|
+
}
|
|
2799
2900
|
/**
|
|
2800
2901
|
* Set handler for 401 unauthorized errors
|
|
2801
2902
|
* @param handler - Callback function to handle unauthorized errors
|