@lightdash-tools/client 0.5.0 → 0.7.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 +2 -2
- package/dist/agentops/apply-agent-change.d.ts +3 -0
- package/dist/agentops/apply-agent-change.js +63 -0
- package/dist/agentops/apply-bundle-diff.d.ts +13 -0
- package/dist/agentops/apply-bundle-diff.js +44 -0
- package/dist/agentops/apply-bundle-diff.test.d.ts +1 -0
- package/dist/agentops/apply-bundle-diff.test.js +397 -0
- package/dist/agentops/apply-context.d.ts +14 -0
- package/dist/agentops/apply-context.js +6 -0
- package/dist/agentops/apply-evaluation-change.d.ts +3 -0
- package/dist/agentops/apply-evaluation-change.js +78 -0
- package/dist/agentops/fetch-bundle-state.d.ts +6 -0
- package/dist/agentops/fetch-bundle-state.js +20 -0
- package/dist/agentops/fetch-bundle-state.test.d.ts +1 -0
- package/dist/agentops/fetch-bundle-state.test.js +44 -0
- package/dist/agentops/index.d.ts +3 -0
- package/dist/agentops/index.js +9 -0
- package/dist/agentops/resolve-evaluation-run.d.ts +15 -0
- package/dist/agentops/resolve-evaluation-run.js +48 -0
- package/dist/api/v1/ai-agents/admin.d.ts +16 -0
- package/dist/api/v1/ai-agents/admin.js +29 -0
- package/dist/api/v1/ai-agents/agents.d.ts +18 -0
- package/dist/api/v1/ai-agents/agents.js +31 -0
- package/dist/api/v1/ai-agents/artifacts.d.ts +26 -0
- package/dist/api/v1/ai-agents/artifacts.js +41 -0
- package/dist/api/v1/ai-agents/artifacts.test.d.ts +1 -0
- package/dist/api/v1/ai-agents/artifacts.test.js +69 -0
- package/dist/api/v1/ai-agents/discovery.d.ts +28 -0
- package/dist/api/v1/ai-agents/discovery.js +46 -0
- package/dist/api/v1/ai-agents/discovery.test.d.ts +1 -0
- package/dist/api/v1/ai-agents/discovery.test.js +90 -0
- package/dist/api/v1/ai-agents/evaluations.d.ts +39 -0
- package/dist/api/v1/ai-agents/evaluations.js +70 -0
- package/dist/api/v1/ai-agents/facade.d.ts +79 -0
- package/dist/api/v1/ai-agents/facade.js +193 -0
- package/dist/api/v1/ai-agents/feedback.d.ts +10 -0
- package/dist/api/v1/ai-agents/feedback.js +15 -0
- package/dist/api/v1/ai-agents/feedback.test.d.ts +1 -0
- package/dist/api/v1/ai-agents/feedback.test.js +23 -0
- package/dist/api/v1/ai-agents/index.d.ts +1 -0
- package/dist/api/v1/ai-agents/index.js +5 -0
- package/dist/api/v1/ai-agents/mcp-servers.d.ts +20 -0
- package/dist/api/v1/ai-agents/mcp-servers.js +35 -0
- package/dist/api/v1/ai-agents/mcp-servers.test.d.ts +1 -0
- package/dist/api/v1/ai-agents/mcp-servers.test.js +66 -0
- package/dist/api/v1/ai-agents/request-options.d.ts +12 -0
- package/dist/api/v1/ai-agents/request-options.js +20 -0
- package/dist/api/v1/ai-agents/sql-approval.d.ts +10 -0
- package/dist/api/v1/ai-agents/sql-approval.js +15 -0
- package/dist/api/v1/ai-agents/sql-approval.test.d.ts +1 -0
- package/dist/api/v1/ai-agents/sql-approval.test.js +25 -0
- package/dist/api/v1/ai-agents/threads.d.ts +56 -0
- package/dist/api/v1/ai-agents/threads.js +97 -0
- package/dist/api/v1/ai-agents/threads.test.d.ts +1 -0
- package/dist/api/v1/ai-agents/threads.test.js +39 -0
- package/dist/api/v1/ai-agents.test.js +172 -89
- package/dist/api/v1/analytics.d.ts +10 -0
- package/dist/api/v1/analytics.js +14 -0
- package/dist/api/v1/analytics.test.d.ts +4 -0
- package/dist/api/v1/analytics.test.js +27 -0
- package/dist/api/v1/charts.d.ts +5 -2
- package/dist/api/v1/charts.js +18 -30
- package/dist/api/v1/charts.test.js +19 -28
- package/dist/api/v1/dashboards.d.ts +11 -2
- package/dist/api/v1/dashboards.js +19 -14
- package/dist/api/v1/dashboards.test.js +54 -12
- package/dist/api/v1/explores.d.ts +4 -2
- package/dist/api/v1/explores.js +20 -29
- package/dist/api/v1/explores.test.js +31 -21
- package/dist/api/v1/groups.d.ts +1 -1
- package/dist/api/v1/groups.js +25 -51
- package/dist/api/v1/groups.test.js +15 -24
- package/dist/api/v1/metrics.d.ts +2 -2
- package/dist/api/v1/metrics.js +4 -17
- package/dist/api/v1/metrics.test.js +6 -15
- package/dist/api/v1/organizations.d.ts +1 -1
- package/dist/api/v1/organizations.js +2 -13
- package/dist/api/v1/organizations.test.js +3 -12
- package/dist/api/v1/project-access.d.ts +1 -1
- package/dist/api/v1/project-access.js +18 -45
- package/dist/api/v1/project-access.test.js +27 -36
- package/dist/api/v1/projects.d.ts +1 -1
- package/dist/api/v1/projects.js +6 -21
- package/dist/api/v1/projects.test.js +9 -18
- package/dist/api/v1/query.d.ts +5 -2
- package/dist/api/v1/query.js +8 -18
- package/dist/api/v1/query.test.js +6 -15
- package/dist/api/v1/schedulers.d.ts +2 -2
- package/dist/api/v1/schedulers.js +4 -17
- package/dist/api/v1/schedulers.test.js +6 -15
- package/dist/api/v1/spaces.d.ts +1 -1
- package/dist/api/v1/spaces.js +18 -45
- package/dist/api/v1/spaces.test.js +27 -36
- package/dist/api/v1/tags.d.ts +1 -1
- package/dist/api/v1/tags.js +4 -17
- package/dist/api/v1/tags.test.js +6 -15
- package/dist/api/v1/users.d.ts +3 -1
- package/dist/api/v1/users.js +22 -39
- package/dist/api/v1/users.test.js +44 -30
- package/dist/api/v1/validation.d.ts +5 -2
- package/dist/api/v1/validation.js +8 -18
- package/dist/api/v1/validation.test.js +6 -15
- package/dist/api/v2/content.d.ts +2 -2
- package/dist/api/v2/content.js +3 -14
- package/dist/api/v2/content.test.js +3 -12
- package/dist/api/v2/dashboards.d.ts +10 -0
- package/dist/api/v2/dashboards.js +14 -0
- package/dist/api/v2/dashboards.test.d.ts +4 -0
- package/dist/api/v2/dashboards.test.js +27 -0
- package/dist/api/v2/organization-roles.d.ts +1 -1
- package/dist/api/v2/organization-roles.js +21 -50
- package/dist/api/v2/organization-roles.test.js +33 -42
- package/dist/api/v2/project-role-assignments.d.ts +1 -1
- package/dist/api/v2/project-role-assignments.js +12 -33
- package/dist/api/v2/project-role-assignments.test.js +18 -27
- package/dist/api/v2/query.d.ts +1 -1
- package/dist/api/v2/query.js +10 -29
- package/dist/api/v2/query.test.js +15 -24
- package/dist/api/v2/validation.d.ts +28 -0
- package/dist/api/v2/validation.js +23 -0
- package/dist/client.d.ts +20 -14
- package/dist/client.js +22 -16
- package/dist/config.d.ts +35 -10
- package/dist/http/axios-client.d.ts +4 -4
- package/dist/http/http-client.d.ts +3 -3
- package/dist/http/http-client.js +19 -40
- package/dist/http/interceptors.d.ts +3 -3
- package/dist/http/interceptors.js +16 -3
- package/dist/http/rate-limiter.js +2 -13
- package/dist/http/rate-limiter.test.js +15 -24
- package/dist/index.d.ts +7 -2
- package/dist/index.js +12 -1
- package/dist/index.test.js +13 -5
- package/dist/pagination/fetch-all-pages.js +18 -29
- package/dist/pagination/fetch-all-pages.test.js +15 -24
- package/dist/types/api.d.ts +1 -1
- package/dist/utils/env.d.ts +11 -2
- package/dist/utils/env.js +41 -8
- package/dist/utils/env.test.js +14 -4
- package/dist/utils/logger.js +5 -4
- package/dist/utils/retry.js +17 -28
- package/dist/utils/retry.test.js +9 -18
- package/dist/utils/secret-string.test.d.ts +1 -0
- package/dist/utils/secret-string.test.js +25 -0
- package/package.json +12 -4
- package/src/agentops/apply-agent-change.ts +82 -0
- package/src/agentops/apply-bundle-diff.test.ts +453 -0
- package/src/agentops/apply-bundle-diff.ts +63 -0
- package/src/agentops/apply-context.ts +23 -0
- package/src/agentops/apply-evaluation-change.ts +125 -0
- package/src/agentops/fetch-bundle-state.test.ts +51 -0
- package/src/agentops/fetch-bundle-state.ts +33 -0
- package/src/agentops/index.ts +11 -0
- package/src/agentops/resolve-evaluation-run.ts +94 -0
- package/src/api/v1/ai-agents/admin.ts +41 -0
- package/src/api/v1/ai-agents/agents.ts +40 -0
- package/src/api/v1/ai-agents/artifacts.test.ts +84 -0
- package/src/api/v1/ai-agents/artifacts.ts +92 -0
- package/src/api/v1/ai-agents/discovery.test.ts +102 -0
- package/src/api/v1/ai-agents/discovery.ts +79 -0
- package/src/api/v1/ai-agents/evaluations.ts +152 -0
- package/src/api/v1/ai-agents/facade.ts +489 -0
- package/src/api/v1/ai-agents/feedback.test.ts +30 -0
- package/src/api/v1/ai-agents/feedback.ts +24 -0
- package/src/api/v1/ai-agents/index.ts +1 -0
- package/src/api/v1/ai-agents/mcp-servers.test.ts +81 -0
- package/src/api/v1/ai-agents/mcp-servers.ts +67 -0
- package/src/api/v1/ai-agents/request-options.ts +32 -0
- package/src/api/v1/ai-agents/sql-approval.test.ts +32 -0
- package/src/api/v1/ai-agents/sql-approval.ts +24 -0
- package/src/api/v1/ai-agents/threads.test.ts +55 -0
- package/src/api/v1/ai-agents/threads.ts +216 -0
- package/src/api/v1/ai-agents.test.ts +189 -13
- package/src/api/v1/analytics.test.ts +32 -0
- package/src/api/v1/analytics.ts +16 -0
- package/src/api/v1/charts.test.ts +8 -6
- package/src/api/v1/charts.ts +8 -4
- package/src/api/v1/dashboards.test.ts +57 -0
- package/src/api/v1/dashboards.ts +41 -2
- package/src/api/v1/explores.test.ts +22 -0
- package/src/api/v1/explores.ts +13 -2
- package/src/api/v1/groups.test.ts +2 -0
- package/src/api/v1/groups.ts +9 -7
- package/src/api/v1/metrics.test.ts +2 -0
- package/src/api/v1/metrics.ts +3 -2
- package/src/api/v1/organizations.test.ts +2 -0
- package/src/api/v1/organizations.ts +2 -1
- package/src/api/v1/project-access.test.ts +3 -1
- package/src/api/v1/project-access.ts +2 -1
- package/src/api/v1/projects.test.ts +2 -0
- package/src/api/v1/projects.ts +2 -1
- package/src/api/v1/query.test.ts +2 -0
- package/src/api/v1/query.ts +6 -2
- package/src/api/v1/schedulers.test.ts +2 -0
- package/src/api/v1/schedulers.ts +3 -2
- package/src/api/v1/spaces.test.ts +2 -0
- package/src/api/v1/spaces.ts +2 -1
- package/src/api/v1/tags.test.ts +2 -0
- package/src/api/v1/tags.ts +2 -1
- package/src/api/v1/users.test.ts +26 -0
- package/src/api/v1/users.ts +8 -2
- package/src/api/v1/validation.test.ts +2 -0
- package/src/api/v1/validation.ts +6 -2
- package/src/api/v2/content.test.ts +2 -0
- package/src/api/v2/content.ts +3 -2
- package/src/api/v2/dashboards.test.ts +32 -0
- package/src/api/v2/dashboards.ts +18 -0
- package/src/api/v2/organization-roles.test.ts +2 -0
- package/src/api/v2/organization-roles.ts +2 -1
- package/src/api/v2/project-role-assignments.test.ts +2 -0
- package/src/api/v2/project-role-assignments.ts +2 -1
- package/src/api/v2/query.test.ts +2 -0
- package/src/api/v2/query.ts +2 -1
- package/src/api/v2/validation.ts +48 -0
- package/src/client.test.ts +1 -0
- package/src/client.ts +27 -17
- package/src/config.ts +38 -10
- package/src/errors.test.ts +1 -0
- package/src/http/axios-client.ts +8 -5
- package/src/http/http-client.ts +8 -6
- package/src/http/interceptors.ts +23 -10
- package/src/http/rate-limiter.test.ts +1 -0
- package/src/http/rate-limiter.ts +3 -1
- package/src/index.test.ts +16 -7
- package/src/index.ts +16 -1
- package/src/pagination/fetch-all-pages.test.ts +2 -0
- package/src/types/api.ts +1 -1
- package/src/utils/env.test.ts +16 -4
- package/src/utils/env.ts +61 -10
- package/src/utils/logger.ts +6 -4
- package/src/utils/retry.test.ts +1 -0
- package/src/utils/retry.ts +2 -1
- package/src/utils/secret-string.test.ts +27 -0
- package/tsconfig.json +4 -2
- package/dist/api/v1/ai-agents.d.ts +0 -63
- package/dist/api/v1/ai-agents.js +0 -173
- package/src/api/v1/ai-agents.ts +0 -252
|
@@ -1,63 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* AI agents API client.
|
|
3
|
-
*
|
|
4
|
-
* Admin endpoints → /api/v1/aiAgents/admin/...
|
|
5
|
-
* Project-scoped → /api/v1/projects/{projectUuid}/aiAgents/...
|
|
6
|
-
*/
|
|
7
|
-
import type { AiAgentSummary, AiAgentsAdminThreadsResult, GetAdminThreadsParams, GetAiOrganizationSettingsResult, UpdateAiOrganizationSettings, UpdateAiOrganizationSettingsResult, AiAgent, CreateAiAgent, UpdateAiAgent, AiAgentThreadSummary, AiAgentThread, CreateAgentThreadBody, GenerateAgentThreadBody, GenerateAgentThreadResult, CreateEvaluationBody, CreateEvaluationResult, UpdateEvaluationBody, AppendEvaluationBody, AiAgentEvaluationSummary, AiAgentEvaluation, AiAgentEvaluationRunSummary, AiAgentEvaluationRun } from '@lightdash-tools/common';
|
|
8
|
-
import { BaseApiClient } from '../base-client';
|
|
9
|
-
export declare class AiAgentsClient extends BaseApiClient {
|
|
10
|
-
/** List all AI agent threads across the org (admin). Supports pagination and filters. */
|
|
11
|
-
getAdminThreads(params?: GetAdminThreadsParams): Promise<AiAgentsAdminThreadsResult>;
|
|
12
|
-
/** List all AI agents across the org (admin). */
|
|
13
|
-
listAdminAgents(): Promise<AiAgentSummary[]>;
|
|
14
|
-
/** Get AI organization settings. */
|
|
15
|
-
getAiOrganizationSettings(): Promise<GetAiOrganizationSettingsResult>;
|
|
16
|
-
/** Update AI organization settings. */
|
|
17
|
-
updateAiOrganizationSettings(body: UpdateAiOrganizationSettings): Promise<UpdateAiOrganizationSettingsResult>;
|
|
18
|
-
/** List all agents in a project (GET /projects/{projectUuid}/aiAgents). */
|
|
19
|
-
listAgents(projectUuid: string): Promise<AiAgentSummary[]>;
|
|
20
|
-
/** Get a single agent by UUID (GET /projects/{projectUuid}/aiAgents/{agentUuid}). */
|
|
21
|
-
getAgent(projectUuid: string, agentUuid: string): Promise<AiAgent>;
|
|
22
|
-
/** Create a new agent in a project (POST /projects/{projectUuid}/aiAgents). */
|
|
23
|
-
createAgent(projectUuid: string, body: CreateAiAgent): Promise<AiAgent>;
|
|
24
|
-
/** Update an existing agent (PATCH /projects/{projectUuid}/aiAgents/{agentUuid}). */
|
|
25
|
-
updateAgent(projectUuid: string, agentUuid: string, body: UpdateAiAgent): Promise<AiAgent>;
|
|
26
|
-
/** Delete an agent (DELETE /projects/{projectUuid}/aiAgents/{agentUuid}). */
|
|
27
|
-
deleteAgent(projectUuid: string, agentUuid: string): Promise<void>;
|
|
28
|
-
/** List all threads for an agent (GET /projects/{projectUuid}/aiAgents/{agentUuid}/threads). */
|
|
29
|
-
listAgentThreads(projectUuid: string, agentUuid: string): Promise<AiAgentThreadSummary[]>;
|
|
30
|
-
/**
|
|
31
|
-
* Create a new thread (POST /projects/{projectUuid}/aiAgents/{agentUuid}/threads).
|
|
32
|
-
* Pass `prompt` in the body to trigger an immediate generation.
|
|
33
|
-
*/
|
|
34
|
-
createAgentThread(projectUuid: string, agentUuid: string, body?: CreateAgentThreadBody): Promise<AiAgentThreadSummary>;
|
|
35
|
-
/** Get a thread with its messages (GET …/threads/{threadUuid}). */
|
|
36
|
-
getAgentThread(projectUuid: string, agentUuid: string, threadUuid: string): Promise<AiAgentThread>;
|
|
37
|
-
/**
|
|
38
|
-
* Generate a response in a thread (POST …/threads/{threadUuid}/generate).
|
|
39
|
-
* Use this to send a prompt and receive the agent's reply.
|
|
40
|
-
*/
|
|
41
|
-
generateAgentThreadResponse(projectUuid: string, agentUuid: string, threadUuid: string, body: GenerateAgentThreadBody): Promise<GenerateAgentThreadResult>;
|
|
42
|
-
/** List all evaluations for an agent (GET …/{agentUuid}/evaluations). */
|
|
43
|
-
listEvaluations(projectUuid: string, agentUuid: string): Promise<AiAgentEvaluationSummary[]>;
|
|
44
|
-
/** Create a new evaluation (POST …/{agentUuid}/evaluations). */
|
|
45
|
-
createEvaluation(projectUuid: string, agentUuid: string, body: CreateEvaluationBody): Promise<CreateEvaluationResult>;
|
|
46
|
-
/** Get a full evaluation with prompts (GET …/evaluations/{evalUuid}). */
|
|
47
|
-
getEvaluation(projectUuid: string, agentUuid: string, evalUuid: string): Promise<AiAgentEvaluation>;
|
|
48
|
-
/** Update an evaluation's title, description, or prompts (PATCH …/evaluations/{evalUuid}). */
|
|
49
|
-
updateEvaluation(projectUuid: string, agentUuid: string, evalUuid: string, body: UpdateEvaluationBody): Promise<AiAgentEvaluation>;
|
|
50
|
-
/** Append additional prompts to an existing evaluation (POST …/evaluations/{evalUuid}/append). */
|
|
51
|
-
appendToEvaluation(projectUuid: string, agentUuid: string, evalUuid: string, body: AppendEvaluationBody): Promise<void>;
|
|
52
|
-
/** Delete an evaluation (DELETE …/evaluations/{evalUuid}). */
|
|
53
|
-
deleteEvaluation(projectUuid: string, agentUuid: string, evalUuid: string): Promise<void>;
|
|
54
|
-
/**
|
|
55
|
-
* Trigger a new evaluation run (POST …/evaluations/{evalUuid}/run).
|
|
56
|
-
* Returns a run summary with the new runUuid and initial status.
|
|
57
|
-
*/
|
|
58
|
-
runEvaluation(projectUuid: string, agentUuid: string, evalUuid: string): Promise<AiAgentEvaluationRunSummary>;
|
|
59
|
-
/** List all runs for an evaluation (GET …/evaluations/{evalUuid}/runs). */
|
|
60
|
-
listEvaluationRuns(projectUuid: string, agentUuid: string, evalUuid: string): Promise<AiAgentEvaluationRunSummary[]>;
|
|
61
|
-
/** Get detailed results of a specific run (GET …/evaluations/{evalUuid}/runs/{runUuid}). */
|
|
62
|
-
getEvaluationRunResults(projectUuid: string, agentUuid: string, evalUuid: string, runUuid: string): Promise<AiAgentEvaluationRun>;
|
|
63
|
-
}
|
package/dist/api/v1/ai-agents.js
DELETED
|
@@ -1,173 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
/**
|
|
3
|
-
* AI agents API client.
|
|
4
|
-
*
|
|
5
|
-
* Admin endpoints → /api/v1/aiAgents/admin/...
|
|
6
|
-
* Project-scoped → /api/v1/projects/{projectUuid}/aiAgents/...
|
|
7
|
-
*/
|
|
8
|
-
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
9
|
-
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
10
|
-
return new (P || (P = Promise))(function (resolve, reject) {
|
|
11
|
-
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
12
|
-
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
13
|
-
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
14
|
-
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
15
|
-
});
|
|
16
|
-
};
|
|
17
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
18
|
-
exports.AiAgentsClient = void 0;
|
|
19
|
-
const base_client_1 = require("../base-client");
|
|
20
|
-
class AiAgentsClient extends base_client_1.BaseApiClient {
|
|
21
|
-
// ─── Admin: threads ──────────────────────────────────────────────────────────
|
|
22
|
-
/** List all AI agent threads across the org (admin). Supports pagination and filters. */
|
|
23
|
-
getAdminThreads(params) {
|
|
24
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
25
|
-
return this.http.get('/aiAgents/admin/threads', {
|
|
26
|
-
params,
|
|
27
|
-
});
|
|
28
|
-
});
|
|
29
|
-
}
|
|
30
|
-
// ─── Admin: agents ───────────────────────────────────────────────────────────
|
|
31
|
-
/** List all AI agents across the org (admin). */
|
|
32
|
-
listAdminAgents() {
|
|
33
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
34
|
-
return this.http.get('/aiAgents/admin/agents');
|
|
35
|
-
});
|
|
36
|
-
}
|
|
37
|
-
// ─── Admin: settings ─────────────────────────────────────────────────────────
|
|
38
|
-
/** Get AI organization settings. */
|
|
39
|
-
getAiOrganizationSettings() {
|
|
40
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
41
|
-
return this.http.get('/aiAgents/admin/settings');
|
|
42
|
-
});
|
|
43
|
-
}
|
|
44
|
-
/** Update AI organization settings. */
|
|
45
|
-
updateAiOrganizationSettings(body) {
|
|
46
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
47
|
-
return this.http.patch('/aiAgents/admin/settings', body);
|
|
48
|
-
});
|
|
49
|
-
}
|
|
50
|
-
// ─── Project-scoped: agent CRUD ──────────────────────────────────────────────
|
|
51
|
-
/** List all agents in a project (GET /projects/{projectUuid}/aiAgents). */
|
|
52
|
-
listAgents(projectUuid) {
|
|
53
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
54
|
-
return this.http.get(`/projects/${projectUuid}/aiAgents`);
|
|
55
|
-
});
|
|
56
|
-
}
|
|
57
|
-
/** Get a single agent by UUID (GET /projects/{projectUuid}/aiAgents/{agentUuid}). */
|
|
58
|
-
getAgent(projectUuid, agentUuid) {
|
|
59
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
60
|
-
return this.http.get(`/projects/${projectUuid}/aiAgents/${agentUuid}`);
|
|
61
|
-
});
|
|
62
|
-
}
|
|
63
|
-
/** Create a new agent in a project (POST /projects/{projectUuid}/aiAgents). */
|
|
64
|
-
createAgent(projectUuid, body) {
|
|
65
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
66
|
-
return this.http.post(`/projects/${projectUuid}/aiAgents`, body);
|
|
67
|
-
});
|
|
68
|
-
}
|
|
69
|
-
/** Update an existing agent (PATCH /projects/{projectUuid}/aiAgents/{agentUuid}). */
|
|
70
|
-
updateAgent(projectUuid, agentUuid, body) {
|
|
71
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
72
|
-
return this.http.patch(`/projects/${projectUuid}/aiAgents/${agentUuid}`, body);
|
|
73
|
-
});
|
|
74
|
-
}
|
|
75
|
-
/** Delete an agent (DELETE /projects/{projectUuid}/aiAgents/{agentUuid}). */
|
|
76
|
-
deleteAgent(projectUuid, agentUuid) {
|
|
77
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
78
|
-
yield this.http.delete(`/projects/${projectUuid}/aiAgents/${agentUuid}`);
|
|
79
|
-
});
|
|
80
|
-
}
|
|
81
|
-
// ─── Project-scoped: threads ─────────────────────────────────────────────────
|
|
82
|
-
/** List all threads for an agent (GET /projects/{projectUuid}/aiAgents/{agentUuid}/threads). */
|
|
83
|
-
listAgentThreads(projectUuid, agentUuid) {
|
|
84
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
85
|
-
return this.http.get(`/projects/${projectUuid}/aiAgents/${agentUuid}/threads`);
|
|
86
|
-
});
|
|
87
|
-
}
|
|
88
|
-
/**
|
|
89
|
-
* Create a new thread (POST /projects/{projectUuid}/aiAgents/{agentUuid}/threads).
|
|
90
|
-
* Pass `prompt` in the body to trigger an immediate generation.
|
|
91
|
-
*/
|
|
92
|
-
createAgentThread(projectUuid, agentUuid, body) {
|
|
93
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
94
|
-
return this.http.post(`/projects/${projectUuid}/aiAgents/${agentUuid}/threads`, body !== null && body !== void 0 ? body : {});
|
|
95
|
-
});
|
|
96
|
-
}
|
|
97
|
-
/** Get a thread with its messages (GET …/threads/{threadUuid}). */
|
|
98
|
-
getAgentThread(projectUuid, agentUuid, threadUuid) {
|
|
99
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
100
|
-
return this.http.get(`/projects/${projectUuid}/aiAgents/${agentUuid}/threads/${threadUuid}`);
|
|
101
|
-
});
|
|
102
|
-
}
|
|
103
|
-
/**
|
|
104
|
-
* Generate a response in a thread (POST …/threads/{threadUuid}/generate).
|
|
105
|
-
* Use this to send a prompt and receive the agent's reply.
|
|
106
|
-
*/
|
|
107
|
-
generateAgentThreadResponse(projectUuid, agentUuid, threadUuid, body) {
|
|
108
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
109
|
-
return this.http.post(`/projects/${projectUuid}/aiAgents/${agentUuid}/threads/${threadUuid}/generate`, body);
|
|
110
|
-
});
|
|
111
|
-
}
|
|
112
|
-
// ─── Project-scoped: evaluations ─────────────────────────────────────────────
|
|
113
|
-
/** List all evaluations for an agent (GET …/{agentUuid}/evaluations). */
|
|
114
|
-
listEvaluations(projectUuid, agentUuid) {
|
|
115
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
116
|
-
return this.http.get(`/projects/${projectUuid}/aiAgents/${agentUuid}/evaluations`);
|
|
117
|
-
});
|
|
118
|
-
}
|
|
119
|
-
/** Create a new evaluation (POST …/{agentUuid}/evaluations). */
|
|
120
|
-
createEvaluation(projectUuid, agentUuid, body) {
|
|
121
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
122
|
-
return this.http.post(`/projects/${projectUuid}/aiAgents/${agentUuid}/evaluations`, body);
|
|
123
|
-
});
|
|
124
|
-
}
|
|
125
|
-
/** Get a full evaluation with prompts (GET …/evaluations/{evalUuid}). */
|
|
126
|
-
getEvaluation(projectUuid, agentUuid, evalUuid) {
|
|
127
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
128
|
-
return this.http.get(`/projects/${projectUuid}/aiAgents/${agentUuid}/evaluations/${evalUuid}`);
|
|
129
|
-
});
|
|
130
|
-
}
|
|
131
|
-
/** Update an evaluation's title, description, or prompts (PATCH …/evaluations/{evalUuid}). */
|
|
132
|
-
updateEvaluation(projectUuid, agentUuid, evalUuid, body) {
|
|
133
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
134
|
-
return this.http.patch(`/projects/${projectUuid}/aiAgents/${agentUuid}/evaluations/${evalUuid}`, body);
|
|
135
|
-
});
|
|
136
|
-
}
|
|
137
|
-
/** Append additional prompts to an existing evaluation (POST …/evaluations/{evalUuid}/append). */
|
|
138
|
-
appendToEvaluation(projectUuid, agentUuid, evalUuid, body) {
|
|
139
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
140
|
-
yield this.http.post(`/projects/${projectUuid}/aiAgents/${agentUuid}/evaluations/${evalUuid}/append`, body);
|
|
141
|
-
});
|
|
142
|
-
}
|
|
143
|
-
/** Delete an evaluation (DELETE …/evaluations/{evalUuid}). */
|
|
144
|
-
deleteEvaluation(projectUuid, agentUuid, evalUuid) {
|
|
145
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
146
|
-
yield this.http.delete(`/projects/${projectUuid}/aiAgents/${agentUuid}/evaluations/${evalUuid}`);
|
|
147
|
-
});
|
|
148
|
-
}
|
|
149
|
-
// ─── Project-scoped: evaluation runs ─────────────────────────────────────────
|
|
150
|
-
/**
|
|
151
|
-
* Trigger a new evaluation run (POST …/evaluations/{evalUuid}/run).
|
|
152
|
-
* Returns a run summary with the new runUuid and initial status.
|
|
153
|
-
*/
|
|
154
|
-
runEvaluation(projectUuid, agentUuid, evalUuid) {
|
|
155
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
156
|
-
return this.http.post(`/projects/${projectUuid}/aiAgents/${agentUuid}/evaluations/${evalUuid}/run`, {});
|
|
157
|
-
});
|
|
158
|
-
}
|
|
159
|
-
/** List all runs for an evaluation (GET …/evaluations/{evalUuid}/runs). */
|
|
160
|
-
listEvaluationRuns(projectUuid, agentUuid, evalUuid) {
|
|
161
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
162
|
-
const response = yield this.http.get(`/projects/${projectUuid}/aiAgents/${agentUuid}/evaluations/${evalUuid}/runs`);
|
|
163
|
-
return response.data.runs;
|
|
164
|
-
});
|
|
165
|
-
}
|
|
166
|
-
/** Get detailed results of a specific run (GET …/evaluations/{evalUuid}/runs/{runUuid}). */
|
|
167
|
-
getEvaluationRunResults(projectUuid, agentUuid, evalUuid, runUuid) {
|
|
168
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
169
|
-
return this.http.get(`/projects/${projectUuid}/aiAgents/${agentUuid}/evaluations/${evalUuid}/runs/${runUuid}`);
|
|
170
|
-
});
|
|
171
|
-
}
|
|
172
|
-
}
|
|
173
|
-
exports.AiAgentsClient = AiAgentsClient;
|
package/src/api/v1/ai-agents.ts
DELETED
|
@@ -1,252 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* AI agents API client.
|
|
3
|
-
*
|
|
4
|
-
* Admin endpoints → /api/v1/aiAgents/admin/...
|
|
5
|
-
* Project-scoped → /api/v1/projects/{projectUuid}/aiAgents/...
|
|
6
|
-
*/
|
|
7
|
-
|
|
8
|
-
import type {
|
|
9
|
-
AiAgentSummary,
|
|
10
|
-
AiAgentsAdminThreadsResult,
|
|
11
|
-
GetAdminThreadsParams,
|
|
12
|
-
GetAiOrganizationSettingsResult,
|
|
13
|
-
UpdateAiOrganizationSettings,
|
|
14
|
-
UpdateAiOrganizationSettingsResult,
|
|
15
|
-
AiAgent,
|
|
16
|
-
CreateAiAgent,
|
|
17
|
-
UpdateAiAgent,
|
|
18
|
-
AiAgentThreadSummary,
|
|
19
|
-
AiAgentThread,
|
|
20
|
-
CreateAgentThreadBody,
|
|
21
|
-
GenerateAgentThreadBody,
|
|
22
|
-
GenerateAgentThreadResult,
|
|
23
|
-
CreateEvaluationBody,
|
|
24
|
-
CreateEvaluationResult,
|
|
25
|
-
UpdateEvaluationBody,
|
|
26
|
-
AppendEvaluationBody,
|
|
27
|
-
AiAgentEvaluationSummary,
|
|
28
|
-
AiAgentEvaluation,
|
|
29
|
-
AiAgentEvaluationRunSummary,
|
|
30
|
-
AiAgentEvaluationRunsListResponse,
|
|
31
|
-
AiAgentEvaluationRun,
|
|
32
|
-
} from '@lightdash-tools/common';
|
|
33
|
-
import { BaseApiClient } from '../base-client';
|
|
34
|
-
|
|
35
|
-
export class AiAgentsClient extends BaseApiClient {
|
|
36
|
-
// ─── Admin: threads ──────────────────────────────────────────────────────────
|
|
37
|
-
|
|
38
|
-
/** List all AI agent threads across the org (admin). Supports pagination and filters. */
|
|
39
|
-
async getAdminThreads(params?: GetAdminThreadsParams): Promise<AiAgentsAdminThreadsResult> {
|
|
40
|
-
return this.http.get<AiAgentsAdminThreadsResult>('/aiAgents/admin/threads', {
|
|
41
|
-
params,
|
|
42
|
-
});
|
|
43
|
-
}
|
|
44
|
-
|
|
45
|
-
// ─── Admin: agents ───────────────────────────────────────────────────────────
|
|
46
|
-
|
|
47
|
-
/** List all AI agents across the org (admin). */
|
|
48
|
-
async listAdminAgents(): Promise<AiAgentSummary[]> {
|
|
49
|
-
return this.http.get<AiAgentSummary[]>('/aiAgents/admin/agents');
|
|
50
|
-
}
|
|
51
|
-
|
|
52
|
-
// ─── Admin: settings ─────────────────────────────────────────────────────────
|
|
53
|
-
|
|
54
|
-
/** Get AI organization settings. */
|
|
55
|
-
async getAiOrganizationSettings(): Promise<GetAiOrganizationSettingsResult> {
|
|
56
|
-
return this.http.get<GetAiOrganizationSettingsResult>('/aiAgents/admin/settings');
|
|
57
|
-
}
|
|
58
|
-
|
|
59
|
-
/** Update AI organization settings. */
|
|
60
|
-
async updateAiOrganizationSettings(
|
|
61
|
-
body: UpdateAiOrganizationSettings,
|
|
62
|
-
): Promise<UpdateAiOrganizationSettingsResult> {
|
|
63
|
-
return this.http.patch<UpdateAiOrganizationSettingsResult>('/aiAgents/admin/settings', body);
|
|
64
|
-
}
|
|
65
|
-
|
|
66
|
-
// ─── Project-scoped: agent CRUD ──────────────────────────────────────────────
|
|
67
|
-
|
|
68
|
-
/** List all agents in a project (GET /projects/{projectUuid}/aiAgents). */
|
|
69
|
-
async listAgents(projectUuid: string): Promise<AiAgentSummary[]> {
|
|
70
|
-
return this.http.get<AiAgentSummary[]>(`/projects/${projectUuid}/aiAgents`);
|
|
71
|
-
}
|
|
72
|
-
|
|
73
|
-
/** Get a single agent by UUID (GET /projects/{projectUuid}/aiAgents/{agentUuid}). */
|
|
74
|
-
async getAgent(projectUuid: string, agentUuid: string): Promise<AiAgent> {
|
|
75
|
-
return this.http.get<AiAgent>(`/projects/${projectUuid}/aiAgents/${agentUuid}`);
|
|
76
|
-
}
|
|
77
|
-
|
|
78
|
-
/** Create a new agent in a project (POST /projects/{projectUuid}/aiAgents). */
|
|
79
|
-
async createAgent(projectUuid: string, body: CreateAiAgent): Promise<AiAgent> {
|
|
80
|
-
return this.http.post<AiAgent>(`/projects/${projectUuid}/aiAgents`, body);
|
|
81
|
-
}
|
|
82
|
-
|
|
83
|
-
/** Update an existing agent (PATCH /projects/{projectUuid}/aiAgents/{agentUuid}). */
|
|
84
|
-
async updateAgent(projectUuid: string, agentUuid: string, body: UpdateAiAgent): Promise<AiAgent> {
|
|
85
|
-
return this.http.patch<AiAgent>(`/projects/${projectUuid}/aiAgents/${agentUuid}`, body);
|
|
86
|
-
}
|
|
87
|
-
|
|
88
|
-
/** Delete an agent (DELETE /projects/{projectUuid}/aiAgents/{agentUuid}). */
|
|
89
|
-
async deleteAgent(projectUuid: string, agentUuid: string): Promise<void> {
|
|
90
|
-
await this.http.delete(`/projects/${projectUuid}/aiAgents/${agentUuid}`);
|
|
91
|
-
}
|
|
92
|
-
|
|
93
|
-
// ─── Project-scoped: threads ─────────────────────────────────────────────────
|
|
94
|
-
|
|
95
|
-
/** List all threads for an agent (GET /projects/{projectUuid}/aiAgents/{agentUuid}/threads). */
|
|
96
|
-
async listAgentThreads(projectUuid: string, agentUuid: string): Promise<AiAgentThreadSummary[]> {
|
|
97
|
-
return this.http.get<AiAgentThreadSummary[]>(
|
|
98
|
-
`/projects/${projectUuid}/aiAgents/${agentUuid}/threads`,
|
|
99
|
-
);
|
|
100
|
-
}
|
|
101
|
-
|
|
102
|
-
/**
|
|
103
|
-
* Create a new thread (POST /projects/{projectUuid}/aiAgents/{agentUuid}/threads).
|
|
104
|
-
* Pass `prompt` in the body to trigger an immediate generation.
|
|
105
|
-
*/
|
|
106
|
-
async createAgentThread(
|
|
107
|
-
projectUuid: string,
|
|
108
|
-
agentUuid: string,
|
|
109
|
-
body?: CreateAgentThreadBody,
|
|
110
|
-
): Promise<AiAgentThreadSummary> {
|
|
111
|
-
return this.http.post<AiAgentThreadSummary>(
|
|
112
|
-
`/projects/${projectUuid}/aiAgents/${agentUuid}/threads`,
|
|
113
|
-
body ?? {},
|
|
114
|
-
);
|
|
115
|
-
}
|
|
116
|
-
|
|
117
|
-
/** Get a thread with its messages (GET …/threads/{threadUuid}). */
|
|
118
|
-
async getAgentThread(
|
|
119
|
-
projectUuid: string,
|
|
120
|
-
agentUuid: string,
|
|
121
|
-
threadUuid: string,
|
|
122
|
-
): Promise<AiAgentThread> {
|
|
123
|
-
return this.http.get<AiAgentThread>(
|
|
124
|
-
`/projects/${projectUuid}/aiAgents/${agentUuid}/threads/${threadUuid}`,
|
|
125
|
-
);
|
|
126
|
-
}
|
|
127
|
-
|
|
128
|
-
/**
|
|
129
|
-
* Generate a response in a thread (POST …/threads/{threadUuid}/generate).
|
|
130
|
-
* Use this to send a prompt and receive the agent's reply.
|
|
131
|
-
*/
|
|
132
|
-
async generateAgentThreadResponse(
|
|
133
|
-
projectUuid: string,
|
|
134
|
-
agentUuid: string,
|
|
135
|
-
threadUuid: string,
|
|
136
|
-
body: GenerateAgentThreadBody,
|
|
137
|
-
): Promise<GenerateAgentThreadResult> {
|
|
138
|
-
return this.http.post<GenerateAgentThreadResult>(
|
|
139
|
-
`/projects/${projectUuid}/aiAgents/${agentUuid}/threads/${threadUuid}/generate`,
|
|
140
|
-
body,
|
|
141
|
-
);
|
|
142
|
-
}
|
|
143
|
-
|
|
144
|
-
// ─── Project-scoped: evaluations ─────────────────────────────────────────────
|
|
145
|
-
|
|
146
|
-
/** List all evaluations for an agent (GET …/{agentUuid}/evaluations). */
|
|
147
|
-
async listEvaluations(
|
|
148
|
-
projectUuid: string,
|
|
149
|
-
agentUuid: string,
|
|
150
|
-
): Promise<AiAgentEvaluationSummary[]> {
|
|
151
|
-
return this.http.get<AiAgentEvaluationSummary[]>(
|
|
152
|
-
`/projects/${projectUuid}/aiAgents/${agentUuid}/evaluations`,
|
|
153
|
-
);
|
|
154
|
-
}
|
|
155
|
-
|
|
156
|
-
/** Create a new evaluation (POST …/{agentUuid}/evaluations). */
|
|
157
|
-
async createEvaluation(
|
|
158
|
-
projectUuid: string,
|
|
159
|
-
agentUuid: string,
|
|
160
|
-
body: CreateEvaluationBody,
|
|
161
|
-
): Promise<CreateEvaluationResult> {
|
|
162
|
-
return this.http.post<CreateEvaluationResult>(
|
|
163
|
-
`/projects/${projectUuid}/aiAgents/${agentUuid}/evaluations`,
|
|
164
|
-
body,
|
|
165
|
-
);
|
|
166
|
-
}
|
|
167
|
-
|
|
168
|
-
/** Get a full evaluation with prompts (GET …/evaluations/{evalUuid}). */
|
|
169
|
-
async getEvaluation(
|
|
170
|
-
projectUuid: string,
|
|
171
|
-
agentUuid: string,
|
|
172
|
-
evalUuid: string,
|
|
173
|
-
): Promise<AiAgentEvaluation> {
|
|
174
|
-
return this.http.get<AiAgentEvaluation>(
|
|
175
|
-
`/projects/${projectUuid}/aiAgents/${agentUuid}/evaluations/${evalUuid}`,
|
|
176
|
-
);
|
|
177
|
-
}
|
|
178
|
-
|
|
179
|
-
/** Update an evaluation's title, description, or prompts (PATCH …/evaluations/{evalUuid}). */
|
|
180
|
-
async updateEvaluation(
|
|
181
|
-
projectUuid: string,
|
|
182
|
-
agentUuid: string,
|
|
183
|
-
evalUuid: string,
|
|
184
|
-
body: UpdateEvaluationBody,
|
|
185
|
-
): Promise<AiAgentEvaluation> {
|
|
186
|
-
return this.http.patch<AiAgentEvaluation>(
|
|
187
|
-
`/projects/${projectUuid}/aiAgents/${agentUuid}/evaluations/${evalUuid}`,
|
|
188
|
-
body,
|
|
189
|
-
);
|
|
190
|
-
}
|
|
191
|
-
|
|
192
|
-
/** Append additional prompts to an existing evaluation (POST …/evaluations/{evalUuid}/append). */
|
|
193
|
-
async appendToEvaluation(
|
|
194
|
-
projectUuid: string,
|
|
195
|
-
agentUuid: string,
|
|
196
|
-
evalUuid: string,
|
|
197
|
-
body: AppendEvaluationBody,
|
|
198
|
-
): Promise<void> {
|
|
199
|
-
await this.http.post(
|
|
200
|
-
`/projects/${projectUuid}/aiAgents/${agentUuid}/evaluations/${evalUuid}/append`,
|
|
201
|
-
body,
|
|
202
|
-
);
|
|
203
|
-
}
|
|
204
|
-
|
|
205
|
-
/** Delete an evaluation (DELETE …/evaluations/{evalUuid}). */
|
|
206
|
-
async deleteEvaluation(projectUuid: string, agentUuid: string, evalUuid: string): Promise<void> {
|
|
207
|
-
await this.http.delete(
|
|
208
|
-
`/projects/${projectUuid}/aiAgents/${agentUuid}/evaluations/${evalUuid}`,
|
|
209
|
-
);
|
|
210
|
-
}
|
|
211
|
-
|
|
212
|
-
// ─── Project-scoped: evaluation runs ─────────────────────────────────────────
|
|
213
|
-
|
|
214
|
-
/**
|
|
215
|
-
* Trigger a new evaluation run (POST …/evaluations/{evalUuid}/run).
|
|
216
|
-
* Returns a run summary with the new runUuid and initial status.
|
|
217
|
-
*/
|
|
218
|
-
async runEvaluation(
|
|
219
|
-
projectUuid: string,
|
|
220
|
-
agentUuid: string,
|
|
221
|
-
evalUuid: string,
|
|
222
|
-
): Promise<AiAgentEvaluationRunSummary> {
|
|
223
|
-
return this.http.post<AiAgentEvaluationRunSummary>(
|
|
224
|
-
`/projects/${projectUuid}/aiAgents/${agentUuid}/evaluations/${evalUuid}/run`,
|
|
225
|
-
{},
|
|
226
|
-
);
|
|
227
|
-
}
|
|
228
|
-
|
|
229
|
-
/** List all runs for an evaluation (GET …/evaluations/{evalUuid}/runs). */
|
|
230
|
-
async listEvaluationRuns(
|
|
231
|
-
projectUuid: string,
|
|
232
|
-
agentUuid: string,
|
|
233
|
-
evalUuid: string,
|
|
234
|
-
): Promise<AiAgentEvaluationRunSummary[]> {
|
|
235
|
-
const response = await this.http.get<AiAgentEvaluationRunsListResponse>(
|
|
236
|
-
`/projects/${projectUuid}/aiAgents/${agentUuid}/evaluations/${evalUuid}/runs`,
|
|
237
|
-
);
|
|
238
|
-
return response.data.runs;
|
|
239
|
-
}
|
|
240
|
-
|
|
241
|
-
/** Get detailed results of a specific run (GET …/evaluations/{evalUuid}/runs/{runUuid}). */
|
|
242
|
-
async getEvaluationRunResults(
|
|
243
|
-
projectUuid: string,
|
|
244
|
-
agentUuid: string,
|
|
245
|
-
evalUuid: string,
|
|
246
|
-
runUuid: string,
|
|
247
|
-
): Promise<AiAgentEvaluationRun> {
|
|
248
|
-
return this.http.get<AiAgentEvaluationRun>(
|
|
249
|
-
`/projects/${projectUuid}/aiAgents/${agentUuid}/evaluations/${evalUuid}/runs/${runUuid}`,
|
|
250
|
-
);
|
|
251
|
-
}
|
|
252
|
-
}
|