@uluops/ops-sdk 1.8.3 → 1.8.4
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/CHANGELOG.md +36 -1
- package/README.md +70 -49
- package/dist/client.d.ts +10 -45
- package/dist/client.d.ts.map +1 -1
- package/dist/client.js +16 -11
- package/dist/client.js.map +1 -1
- package/dist/config/constants.d.ts +2 -2
- package/dist/config/constants.js +1 -1
- package/dist/config/validators.d.ts +141 -1
- package/dist/config/validators.d.ts.map +1 -1
- package/dist/config/validators.js +146 -4
- package/dist/config/validators.js.map +1 -1
- package/dist/http/http-client.d.ts +17 -2
- package/dist/http/http-client.d.ts.map +1 -1
- package/dist/http/http-client.js +6 -1
- package/dist/http/http-client.js.map +1 -1
- package/dist/index.d.ts +1 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js.map +1 -1
- package/dist/operations/analytics.d.ts +86 -29
- package/dist/operations/analytics.d.ts.map +1 -1
- package/dist/operations/analytics.js +89 -32
- package/dist/operations/analytics.js.map +1 -1
- package/dist/operations/auth.d.ts +46 -8
- package/dist/operations/auth.d.ts.map +1 -1
- package/dist/operations/auth.js +46 -8
- package/dist/operations/auth.js.map +1 -1
- package/dist/operations/issues.d.ts +86 -16
- package/dist/operations/issues.d.ts.map +1 -1
- package/dist/operations/issues.js +86 -16
- package/dist/operations/issues.js.map +1 -1
- package/dist/operations/projects.d.ts +64 -10
- package/dist/operations/projects.d.ts.map +1 -1
- package/dist/operations/projects.js +69 -17
- package/dist/operations/projects.js.map +1 -1
- package/dist/operations/runs.d.ts +103 -19
- package/dist/operations/runs.d.ts.map +1 -1
- package/dist/operations/runs.js +107 -20
- package/dist/operations/runs.js.map +1 -1
- package/dist/types/analytics.d.ts +13 -21
- package/dist/types/analytics.d.ts.map +1 -1
- package/dist/types/index.d.ts +0 -1
- package/dist/types/index.d.ts.map +1 -1
- package/dist/types/index.js +1 -2
- package/dist/types/index.js.map +1 -1
- package/dist/types/projects.d.ts +0 -6
- package/dist/types/projects.d.ts.map +1 -1
- package/dist/types/response-schemas.d.ts +8 -38
- package/dist/types/response-schemas.d.ts.map +1 -1
- package/dist/types/response-schemas.js +9 -7
- package/dist/types/response-schemas.js.map +1 -1
- package/dist/types/runs.d.ts +0 -6
- package/dist/types/runs.d.ts.map +1 -1
- package/dist/types/schemas.d.ts +3 -24
- package/dist/types/schemas.d.ts.map +1 -1
- package/dist/types/schemas.js +2 -4
- package/dist/types/schemas.js.map +1 -1
- package/package.json +4 -4
- package/dist/operations/admin.d.ts +0 -89
- package/dist/operations/admin.d.ts.map +0 -1
- package/dist/operations/admin.js +0 -134
- package/dist/operations/admin.js.map +0 -1
|
@@ -4,47 +4,77 @@ import { ProjectResponseSchema, ProjectSummaryResponseSchema, ProjectTrendsRespo
|
|
|
4
4
|
import { validateCreateProjectInput, validateDeleteProjectInput, validateRenameProjectInput, } from '../config/validators.js';
|
|
5
5
|
import { buildIssueListParams } from './query-utils.js';
|
|
6
6
|
/**
|
|
7
|
-
* List all projects
|
|
7
|
+
* List all projects accessible to the current user.
|
|
8
|
+
*
|
|
9
|
+
* @param client - HTTP client instance
|
|
10
|
+
* @returns Array of projects with metadata (runCount, issueCount, etc.)
|
|
8
11
|
*/
|
|
9
12
|
export async function list(client) {
|
|
10
13
|
return client.get('/projects', undefined, { schema: z.array(ProjectResponseSchema) });
|
|
11
14
|
}
|
|
12
15
|
/**
|
|
13
|
-
* Get a
|
|
16
|
+
* Get a project by UUID or name.
|
|
17
|
+
*
|
|
18
|
+
* @param client - HTTP client instance
|
|
19
|
+
* @param idOrName - Project UUID or name string
|
|
20
|
+
* @returns Project record
|
|
21
|
+
* @throws {NotFoundError} If project does not exist
|
|
14
22
|
*/
|
|
15
23
|
export async function get(client, idOrName) {
|
|
16
24
|
return client.get(`/projects/${encodeURIComponent(idOrName)}`, undefined, { schema: ProjectResponseSchema });
|
|
17
25
|
}
|
|
18
26
|
/**
|
|
19
|
-
* Create a new project
|
|
27
|
+
* Create a new project.
|
|
28
|
+
*
|
|
29
|
+
* @param client - HTTP client instance
|
|
30
|
+
* @param input - Project data: `{ name: string }` (1-200 chars, unique)
|
|
31
|
+
* @returns Created project
|
|
32
|
+
* @throws {InputValidationError} If name is empty or exceeds 200 chars
|
|
33
|
+
* @throws {ConflictError} If a project with that name already exists
|
|
20
34
|
*/
|
|
21
35
|
export async function create(client, input) {
|
|
22
36
|
validateCreateProjectInput(input);
|
|
23
37
|
return client.post('/projects', input, { schema: ProjectResponseSchema });
|
|
24
38
|
}
|
|
25
39
|
/**
|
|
26
|
-
* Update a project
|
|
40
|
+
* Update a project's mutable fields (name, description).
|
|
41
|
+
* Unlike create/delete, does not run client-side Zod validation — input is validated server-side only.
|
|
42
|
+
*
|
|
43
|
+
* @param client - HTTP client instance
|
|
44
|
+
* @param idOrName - Project UUID or name
|
|
45
|
+
* @param input - Fields to update
|
|
46
|
+
* @returns Updated project
|
|
27
47
|
*/
|
|
28
48
|
export async function update(client, idOrName, input) {
|
|
29
49
|
return client.patch(`/projects/${encodeURIComponent(idOrName)}`, input, { schema: ProjectResponseSchema });
|
|
30
50
|
}
|
|
31
51
|
/**
|
|
32
|
-
*
|
|
52
|
+
* Permanently delete a project. Irreversible — use softDelete for recoverable removal.
|
|
53
|
+
*
|
|
54
|
+
* @param client - HTTP client instance
|
|
55
|
+
* @param idOrName - Project UUID or name
|
|
56
|
+
* @param input - Confirmation: `{ confirm: true, confirmationPhrase: string }`
|
|
57
|
+
* @returns `{ deleted: true }`
|
|
58
|
+
* @throws {InputValidationError} If confirm is not `true` or phrase is missing
|
|
33
59
|
*/
|
|
34
60
|
export async function deleteProject(client, idOrName, input) {
|
|
35
|
-
|
|
36
|
-
await client.delete(`/projects/${encodeURIComponent(idOrName)}`, {
|
|
37
|
-
confirm: input.confirm,
|
|
38
|
-
confirmationPhrase: input.confirmationPhrase,
|
|
39
|
-
});
|
|
40
|
-
return { deleted: true };
|
|
61
|
+
return deleteWithConfirmation(client, `/projects/${encodeURIComponent(idOrName)}`, input);
|
|
41
62
|
}
|
|
42
63
|
/**
|
|
43
|
-
* Soft delete a project
|
|
64
|
+
* Soft delete a project. Can be restored via `restore()`.
|
|
65
|
+
*
|
|
66
|
+
* @param client - HTTP client instance
|
|
67
|
+
* @param idOrName - Project UUID or name
|
|
68
|
+
* @param input - Confirmation: `{ confirm: true, confirmationPhrase: string }`
|
|
69
|
+
* @returns `{ deleted: true }`
|
|
70
|
+
* @throws {InputValidationError} If confirm is not `true` or phrase is missing
|
|
44
71
|
*/
|
|
45
72
|
export async function softDelete(client, idOrName, input) {
|
|
73
|
+
return deleteWithConfirmation(client, `/projects/${encodeURIComponent(idOrName)}/soft`, input);
|
|
74
|
+
}
|
|
75
|
+
async function deleteWithConfirmation(client, path, input) {
|
|
46
76
|
validateDeleteProjectInput(input);
|
|
47
|
-
await client.delete(
|
|
77
|
+
await client.delete(path, {
|
|
48
78
|
confirm: input.confirm,
|
|
49
79
|
confirmationPhrase: input.confirmationPhrase,
|
|
50
80
|
});
|
|
@@ -57,7 +87,12 @@ export async function restore(client, idOrName) {
|
|
|
57
87
|
return client.post(`/projects/${encodeURIComponent(idOrName)}/restore`, undefined, { schema: ProjectResponseSchema });
|
|
58
88
|
}
|
|
59
89
|
/**
|
|
60
|
-
* Rename a project by name
|
|
90
|
+
* Rename a project by name.
|
|
91
|
+
*
|
|
92
|
+
* @param client - HTTP client instance
|
|
93
|
+
* @param input - `{ oldName: string, newName: string }` (newName 1-200 chars)
|
|
94
|
+
* @returns Renamed project
|
|
95
|
+
* @throws {InputValidationError} If names are empty or newName exceeds 200 chars
|
|
61
96
|
*/
|
|
62
97
|
export async function rename(client, input) {
|
|
63
98
|
validateRenameProjectInput(input);
|
|
@@ -87,9 +122,16 @@ export async function listIssues(client, idOrName, query) {
|
|
|
87
122
|
/**
|
|
88
123
|
* List issues in a project with count (preserves pagination count from API envelope).
|
|
89
124
|
*
|
|
125
|
+
* @remarks
|
|
90
126
|
* Uses `requestRaw` to access the `count` field outside the `data` envelope.
|
|
91
|
-
*
|
|
127
|
+
* This bypasses automatic retry, token refresh, and Zod schema validation.
|
|
92
128
|
* For retry-safe access without count, use {@link listIssues}.
|
|
129
|
+
* For retry-safe pagination count, call `getSummary()` separately for `totalIssues`.
|
|
130
|
+
*
|
|
131
|
+
* @param client - HTTP client instance
|
|
132
|
+
* @param idOrName - Project UUID or name
|
|
133
|
+
* @param query - Optional filters: status, priority, agent, limit, offset
|
|
134
|
+
* @returns `{ issues, count }` — count reflects total matching issues for pagination
|
|
93
135
|
*/
|
|
94
136
|
export async function listIssuesWithCount(client, idOrName, query) {
|
|
95
137
|
const response = await client.requestRaw('GET', `/projects/${encodeURIComponent(idOrName)}/issues`, buildIssueListParams(query));
|
|
@@ -99,13 +141,23 @@ export async function listIssuesWithCount(client, idOrName, query) {
|
|
|
99
141
|
return { issues: response.data ?? [], count: response.count ?? response.data?.length ?? 0 };
|
|
100
142
|
}
|
|
101
143
|
/**
|
|
102
|
-
* Bulk update issue statuses
|
|
144
|
+
* Bulk update issue statuses within a project. Each item may succeed or fail independently.
|
|
145
|
+
*
|
|
146
|
+
* @param client - HTTP client instance
|
|
147
|
+
* @param idOrName - Project UUID or name
|
|
148
|
+
* @param updates - Array of `{ issueId, status, reason? }`
|
|
149
|
+
* @returns Per-item results with success/failure status
|
|
103
150
|
*/
|
|
104
151
|
export async function bulkUpdateIssueStatus(client, idOrName, updates) {
|
|
105
152
|
return client.patch(`/projects/${encodeURIComponent(idOrName)}/issues/status`, { updates }, { schema: BulkStatusUpdateResultResponseSchema });
|
|
106
153
|
}
|
|
107
154
|
/**
|
|
108
|
-
* Merge
|
|
155
|
+
* Merge duplicate issues into a target issue. Source issues are closed.
|
|
156
|
+
*
|
|
157
|
+
* @param client - HTTP client instance
|
|
158
|
+
* @param idOrName - Project UUID or name
|
|
159
|
+
* @param input - `{ targetIssueId, sourceIssueIds, strategy? }` — strategy: 'keep_target' or 'keep_highest_priority'
|
|
160
|
+
* @returns Merge result with counts
|
|
109
161
|
*/
|
|
110
162
|
export async function mergeIssues(client, idOrName, input) {
|
|
111
163
|
return client.post(`/projects/${encodeURIComponent(idOrName)}/issues/merge`, {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"projects.js","sourceRoot":"","sources":["../../src/operations/projects.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,OAAO,EAAE,UAAU,EAAE,MAAM,wBAAwB,CAAC;AAmBpD,OAAO,EACL,qBAAqB,EACrB,4BAA4B,EAC5B,2BAA2B,EAC3B,mBAAmB,EACnB,oCAAoC,EACpC,+BAA+B,GAChC,MAAM,8BAA8B,CAAC;AACtC,OAAO,EACL,0BAA0B,EAC1B,0BAA0B,EAC1B,0BAA0B,GAC3B,MAAM,yBAAyB,CAAC;AACjC,OAAO,EAAE,oBAAoB,EAAE,MAAM,kBAAkB,CAAC;AAExD
|
|
1
|
+
{"version":3,"file":"projects.js","sourceRoot":"","sources":["../../src/operations/projects.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,OAAO,EAAE,UAAU,EAAE,MAAM,wBAAwB,CAAC;AAmBpD,OAAO,EACL,qBAAqB,EACrB,4BAA4B,EAC5B,2BAA2B,EAC3B,mBAAmB,EACnB,oCAAoC,EACpC,+BAA+B,GAChC,MAAM,8BAA8B,CAAC;AACtC,OAAO,EACL,0BAA0B,EAC1B,0BAA0B,EAC1B,0BAA0B,GAC3B,MAAM,yBAAyB,CAAC;AACjC,OAAO,EAAE,oBAAoB,EAAE,MAAM,kBAAkB,CAAC;AAExD;;;;;GAKG;AACH,MAAM,CAAC,KAAK,UAAU,IAAI,CAAC,MAAqB;IAC9C,OAAO,MAAM,CAAC,GAAG,CAAC,WAAW,EAAE,SAAS,EAAE,EAAE,MAAM,EAAE,CAAC,CAAC,KAAK,CAAC,qBAAqB,CAAC,EAAE,CAAC,CAAC;AACxF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I,CAChB,aAAa,kBAAkB,CAAC,QAAQ,CAAC,eAAe,EACxD;QACE,aAAa,EAAE,KAAK,CAAC,aAAa;QAClC,cAAc,EAAE,KAAK,CAAC,cAAc;QACpC,QAAQ,EAAE,KAAK,CAAC,QAAQ;KACzB,EACD,EAAE,MAAM,EAAE,+BAA+B,EAAE,CAC5C,CAAC;AACJ,CAAC"}
|
|
@@ -4,70 +4,154 @@ import type { Run, SaveRunInput, SaveRunResponse, ValidateRunResponse, RunDiffQu
|
|
|
4
4
|
import type { DeleteResult } from '../types/responses.js';
|
|
5
5
|
import { RunSummaryResponseSchema, RunAnalysisResponseSchema, ProjectAnalysisListResponseSchema, AnalysisRecordsListResponseSchema, AgentRunsAnalysisResponseSchema } from '../types/response-schemas.js';
|
|
6
6
|
/**
|
|
7
|
-
* Save validation run
|
|
7
|
+
* Save a validation run with agent scores and recommendations.
|
|
8
|
+
* Input is validated client-side via Zod before the network request.
|
|
8
9
|
*
|
|
9
|
-
*
|
|
10
|
-
*
|
|
10
|
+
* @param client - HTTP client instance
|
|
11
|
+
* @param input - Run data (project, workflowType, agents, recommendations required)
|
|
12
|
+
* @returns Save result with run metadata and issue correlation (new/recurring/regressions)
|
|
13
|
+
* @throws {InputValidationError} If input fails client-side Zod validation
|
|
14
|
+
* @throws {ConflictError} If idempotencyKey was already used
|
|
15
|
+
* @example
|
|
16
|
+
* ```typescript
|
|
17
|
+
* const result = await client.runs.save({
|
|
18
|
+
* project: 'my-project',
|
|
19
|
+
* workflowType: 'post-implementation',
|
|
20
|
+
* agents: [{ name: 'code-validator', score: 85, decision: 'PASS' }],
|
|
21
|
+
* recommendations: [{ agent: 'code-validator', title: 'Missing null check', priority: 'suggested', failure_code: 'SEM-VAL/M' }],
|
|
22
|
+
* });
|
|
23
|
+
* console.log(result.run.runNumber, result.correlation.newIssues);
|
|
24
|
+
* ```
|
|
11
25
|
*/
|
|
12
26
|
export declare function save(client: OpsHttpClient, input: SaveRunInput): Promise<SaveRunResponse>;
|
|
13
27
|
/**
|
|
14
|
-
*
|
|
28
|
+
* Preview what a save would produce without persisting. Returns projected
|
|
29
|
+
* issue correlation (what would be created, updated, regressed).
|
|
15
30
|
*
|
|
16
|
-
*
|
|
17
|
-
*
|
|
31
|
+
* @param client - HTTP client instance
|
|
32
|
+
* @param input - Same shape as save() input
|
|
33
|
+
* @returns Preview with projected new/recurring/regression counts
|
|
34
|
+
* @throws {InputValidationError} If input fails client-side Zod validation
|
|
18
35
|
*/
|
|
19
36
|
export declare function validate(client: OpsHttpClient, input: SaveRunInput): Promise<ValidateRunResponse>;
|
|
20
37
|
/**
|
|
21
|
-
* Compare two runs
|
|
38
|
+
* Compare two runs to see fixed, new, and unchanged issues.
|
|
39
|
+
*
|
|
40
|
+
* @param client - HTTP client instance
|
|
41
|
+
* @param query - Diff parameters: project, baseRun number, compareRun number
|
|
42
|
+
* @returns Diff result with fixed/new/unchanged issues and agent score changes
|
|
22
43
|
*/
|
|
23
44
|
export declare function diff(client: OpsHttpClient, query: RunDiffQuery): Promise<RunDiffResult>;
|
|
24
45
|
/**
|
|
25
|
-
* Archive old runs
|
|
46
|
+
* Archive old runs by run number, date, or retention count.
|
|
47
|
+
*
|
|
48
|
+
* @param client - HTTP client instance
|
|
49
|
+
* @param input - Archive criteria: project (required), plus beforeRunNumber, beforeDate, keepLast, reason
|
|
50
|
+
* @returns Archive result with count of archived runs
|
|
51
|
+
* @throws {InputValidationError} If input fails client-side Zod validation
|
|
26
52
|
*/
|
|
27
53
|
export declare function archive(client: OpsHttpClient, input: ArchiveRunsInput): Promise<ArchiveRunsResult>;
|
|
28
54
|
/**
|
|
29
|
-
* Update run metadata by project and run number
|
|
55
|
+
* Update run metadata by project and run number. Supports post-hoc
|
|
56
|
+
* enrichment with analysis records and summaries.
|
|
57
|
+
*
|
|
58
|
+
* @param client - HTTP client instance
|
|
59
|
+
* @param input - Update payload with project + runNumber identifier
|
|
60
|
+
* @returns Updated run
|
|
30
61
|
*/
|
|
31
62
|
export declare function update(client: OpsHttpClient, input: UpdateRunByNumberInput): Promise<Run>;
|
|
32
63
|
/**
|
|
33
|
-
* List runs for a project
|
|
64
|
+
* List runs for a project with optional filters.
|
|
65
|
+
*
|
|
66
|
+
* @param client - HTTP client instance
|
|
67
|
+
* @param projectId - Project ID or name
|
|
68
|
+
* @param query - Optional filters: workflowType, limit, offset
|
|
69
|
+
* @returns Array of run summaries
|
|
34
70
|
*/
|
|
35
71
|
export declare function listByProject(client: OpsHttpClient, projectId: string, query?: ListRunsQuery): Promise<z.infer<typeof RunSummaryResponseSchema>[]>;
|
|
36
72
|
/**
|
|
37
|
-
* Get the
|
|
73
|
+
* Get the most recent run for a project, optionally filtered by workflow type.
|
|
74
|
+
*
|
|
75
|
+
* @param client - HTTP client instance
|
|
76
|
+
* @param projectId - Project ID or name
|
|
77
|
+
* @param workflowType - Optional workflow type filter (e.g. 'post-implementation')
|
|
78
|
+
* @returns Latest run
|
|
79
|
+
* @throws {NotFoundError} If no runs exist for the project/workflow
|
|
38
80
|
*/
|
|
39
81
|
export declare function getLatest(client: OpsHttpClient, projectId: string, workflowType?: string): Promise<Run>;
|
|
40
82
|
/**
|
|
41
|
-
* Get full run details
|
|
83
|
+
* Get full run details including agents, recommendations, and analysis data.
|
|
84
|
+
*
|
|
85
|
+
* @param client - HTTP client instance
|
|
86
|
+
* @param projectId - Project ID or name
|
|
87
|
+
* @param runNumber - Specific run number (omit for latest)
|
|
88
|
+
* @returns Run details with nested agents and recommendations arrays
|
|
42
89
|
*/
|
|
43
90
|
export declare function getDetails(client: OpsHttpClient, projectId: string, runNumber?: number): Promise<RunDetails>;
|
|
44
91
|
/**
|
|
45
|
-
* Get a run by
|
|
92
|
+
* Get a run by its UUID.
|
|
93
|
+
*
|
|
94
|
+
* @param client - HTTP client instance
|
|
95
|
+
* @param runId - Run UUID
|
|
96
|
+
* @returns Run record
|
|
97
|
+
* @throws {NotFoundError} If run does not exist
|
|
46
98
|
*/
|
|
47
99
|
export declare function get(client: OpsHttpClient, runId: string): Promise<Run>;
|
|
48
100
|
/**
|
|
49
|
-
* Update
|
|
101
|
+
* Update run metadata by UUID. Supports post-hoc enrichment with
|
|
102
|
+
* analysis records, summaries, and exploration maps.
|
|
103
|
+
*
|
|
104
|
+
* @param client - HTTP client instance
|
|
105
|
+
* @param runId - Run UUID
|
|
106
|
+
* @param input - Fields to update (all optional except identifier)
|
|
107
|
+
* @returns Updated run
|
|
50
108
|
*/
|
|
51
109
|
export declare function updateById(client: OpsHttpClient, runId: string, input: UpdateRunInput): Promise<Run>;
|
|
52
110
|
/**
|
|
53
|
-
*
|
|
111
|
+
* Permanently delete a run. Requires the run ID as a confirmation header.
|
|
112
|
+
*
|
|
113
|
+
* @param client - HTTP client instance
|
|
114
|
+
* @param runId - Run UUID (also sent as X-Confirm-Delete header)
|
|
115
|
+
* @returns `{ deleted: true }` on success
|
|
54
116
|
*/
|
|
55
117
|
export declare function deleteRun(client: OpsHttpClient, runId: string): Promise<DeleteResult>;
|
|
56
118
|
/**
|
|
57
|
-
* Get analysis records and summaries for a specific run
|
|
119
|
+
* Get structured analysis records and summaries for a specific run.
|
|
120
|
+
* Includes convention inventories, tension maps, decay vectors, exploration maps, etc.
|
|
121
|
+
*
|
|
122
|
+
* @param client - HTTP client instance
|
|
123
|
+
* @param runId - Run UUID
|
|
124
|
+
* @returns Analysis data with records and summaries arrays
|
|
58
125
|
*/
|
|
59
126
|
export declare function getAnalysis(client: OpsHttpClient, runId: string): Promise<z.infer<typeof RunAnalysisResponseSchema>>;
|
|
60
127
|
/**
|
|
61
|
-
* Get analysis summaries for a project over time
|
|
128
|
+
* Get analysis summaries for a project over time. Filter by agent name,
|
|
129
|
+
* agent type, or decision to track specific analytical trajectories.
|
|
130
|
+
*
|
|
131
|
+
* @param client - HTTP client instance
|
|
132
|
+
* @param projectId - Project ID or name
|
|
133
|
+
* @param query - Optional filters: agentName, agentType, decision, limit, offset
|
|
134
|
+
* @returns Paginated analysis summaries with `{ data, total }`
|
|
62
135
|
*/
|
|
63
136
|
export declare function getProjectAnalysis(client: OpsHttpClient, projectId: string, query?: ProjectAnalysisQuery): Promise<z.infer<typeof ProjectAnalysisListResponseSchema>>;
|
|
64
137
|
/**
|
|
65
|
-
* Query analysis records across projects
|
|
138
|
+
* Query analysis records across projects. Filter by record type
|
|
139
|
+
* (convention, tension, decay_vector), classification, agent, or severity.
|
|
140
|
+
*
|
|
141
|
+
* @param client - HTTP client instance
|
|
142
|
+
* @param query - Optional filters: recordType, classification, agentName, severity, limit, offset
|
|
143
|
+
* @returns Paginated analysis records with `{ data, total }`
|
|
66
144
|
*/
|
|
67
145
|
export declare function queryAnalysisRecords(client: OpsHttpClient, query?: AnalysisRecordsQuery): Promise<z.infer<typeof AnalysisRecordsListResponseSchema>>;
|
|
68
146
|
/**
|
|
69
147
|
* Get analysis summaries with run context for a specific agent.
|
|
70
|
-
* Returns
|
|
148
|
+
* Returns decision, score, category scores alongside run metadata
|
|
149
|
+
* (run number, timestamp, workflow type, snapshot score).
|
|
150
|
+
*
|
|
151
|
+
* @param client - HTTP client instance
|
|
152
|
+
* @param agentName - Agent name (e.g. 'epictetus-validator')
|
|
153
|
+
* @param query - Query with required `project`, optional `decision`, `limit`, `offset`
|
|
154
|
+
* @returns `{ items: AgentRunSummary[], total: number }`
|
|
71
155
|
*/
|
|
72
156
|
export declare function getAgentRunsAnalysis(client: OpsHttpClient, agentName: string, query: AgentRunsAnalysisQuery): Promise<z.infer<typeof AgentRunsAnalysisResponseSchema>>;
|
|
73
157
|
//# sourceMappingURL=runs.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"runs.d.ts","sourceRoot":"","sources":["../../src/operations/runs.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"runs.d.ts","sourceRoot":"","sources":["../../src/operations/runs.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,KAAK,EAAE,aAAa,EAAE,MAA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AC,OAAO,iCAAiC,CAAC,CAAC,CAM5D;AAED;;;;;;;;;GASG;AACH,wBAAsB,oBAAoB,CACxC,MAAM,EAAE,aAAa,EACrB,SAAS,EAAE,MAAM,EACjB,KAAK,EAAE,sBAAsB,GAC5B,OAAO,CAAC,CAAC,CAAC,KAAK,CAAC,OAAO,+BAA+B,CAAC,CAAC,CAM1D"}
|
package/dist/operations/runs.js
CHANGED
|
@@ -1,15 +1,32 @@
|
|
|
1
|
+
import { randomUUID } from 'node:crypto';
|
|
1
2
|
import { z } from 'zod';
|
|
2
3
|
import { toApiQuery } from '../http/http-client.js';
|
|
3
4
|
import { RunResponseSchema, RunSummaryResponseSchema, SaveRunResponseSchema, ValidateRunResponseSchema, RunDiffResultResponseSchema, ArchiveRunsResultResponseSchema, DeleteResultResponseSchema, RunDetailsResponseSchema, RunAnalysisResponseSchema, ProjectAnalysisListResponseSchema, AnalysisRecordsListResponseSchema, AgentRunsAnalysisResponseSchema, } from '../types/response-schemas.js';
|
|
4
5
|
import { validateSaveRunInput, validateArchiveRunsInput, } from '../config/validators.js';
|
|
5
6
|
/**
|
|
6
|
-
* Save validation run
|
|
7
|
+
* Save a validation run with agent scores and recommendations.
|
|
8
|
+
* Input is validated client-side via Zod before the network request.
|
|
7
9
|
*
|
|
8
|
-
*
|
|
9
|
-
*
|
|
10
|
+
* @param client - HTTP client instance
|
|
11
|
+
* @param input - Run data (project, workflowType, agents, recommendations required)
|
|
12
|
+
* @returns Save result with run metadata and issue correlation (new/recurring/regressions)
|
|
13
|
+
* @throws {InputValidationError} If input fails client-side Zod validation
|
|
14
|
+
* @throws {ConflictError} If idempotencyKey was already used
|
|
15
|
+
* @example
|
|
16
|
+
* ```typescript
|
|
17
|
+
* const result = await client.runs.save({
|
|
18
|
+
* project: 'my-project',
|
|
19
|
+
* workflowType: 'post-implementation',
|
|
20
|
+
* agents: [{ name: 'code-validator', score: 85, decision: 'PASS' }],
|
|
21
|
+
* recommendations: [{ agent: 'code-validator', title: 'Missing null check', priority: 'suggested', failure_code: 'SEM-VAL/M' }],
|
|
22
|
+
* });
|
|
23
|
+
* console.log(result.run.runNumber, result.correlation.newIssues);
|
|
24
|
+
* ```
|
|
10
25
|
*/
|
|
11
26
|
export async function save(client, input) {
|
|
12
27
|
validateSaveRunInput(input);
|
|
28
|
+
// Generate idempotency key if not provided — prevents duplicate runs on retry
|
|
29
|
+
const idempotencyKey = input.idempotencyKey ?? randomUUID();
|
|
13
30
|
return client.post('/runs', {
|
|
14
31
|
project: input.project,
|
|
15
32
|
workflowType: input.workflowType,
|
|
@@ -18,7 +35,7 @@ export async function save(client, input) {
|
|
|
18
35
|
timestamp: input.timestamp,
|
|
19
36
|
rawMarkdown: input.rawMarkdown,
|
|
20
37
|
summary: input.summary,
|
|
21
|
-
idempotencyKey
|
|
38
|
+
idempotencyKey,
|
|
22
39
|
definitionType: input.definitionType,
|
|
23
40
|
definitionName: input.definitionName,
|
|
24
41
|
definitionVersion: input.definitionVersion,
|
|
@@ -30,10 +47,13 @@ export async function save(client, input) {
|
|
|
30
47
|
}, { retryMutations: true, schema: SaveRunResponseSchema });
|
|
31
48
|
}
|
|
32
49
|
/**
|
|
33
|
-
*
|
|
50
|
+
* Preview what a save would produce without persisting. Returns projected
|
|
51
|
+
* issue correlation (what would be created, updated, regressed).
|
|
34
52
|
*
|
|
35
|
-
*
|
|
36
|
-
*
|
|
53
|
+
* @param client - HTTP client instance
|
|
54
|
+
* @param input - Same shape as save() input
|
|
55
|
+
* @returns Preview with projected new/recurring/regression counts
|
|
56
|
+
* @throws {InputValidationError} If input fails client-side Zod validation
|
|
37
57
|
*/
|
|
38
58
|
export async function validate(client, input) {
|
|
39
59
|
validateSaveRunInput(input);
|
|
@@ -45,7 +65,11 @@ export async function validate(client, input) {
|
|
|
45
65
|
}, { schema: ValidateRunResponseSchema });
|
|
46
66
|
}
|
|
47
67
|
/**
|
|
48
|
-
* Compare two runs
|
|
68
|
+
* Compare two runs to see fixed, new, and unchanged issues.
|
|
69
|
+
*
|
|
70
|
+
* @param client - HTTP client instance
|
|
71
|
+
* @param query - Diff parameters: project, baseRun number, compareRun number
|
|
72
|
+
* @returns Diff result with fixed/new/unchanged issues and agent score changes
|
|
49
73
|
*/
|
|
50
74
|
export async function diff(client, query) {
|
|
51
75
|
return client.get('/runs/diff', toApiQuery({
|
|
@@ -55,7 +79,12 @@ export async function diff(client, query) {
|
|
|
55
79
|
}), { schema: RunDiffResultResponseSchema });
|
|
56
80
|
}
|
|
57
81
|
/**
|
|
58
|
-
* Archive old runs
|
|
82
|
+
* Archive old runs by run number, date, or retention count.
|
|
83
|
+
*
|
|
84
|
+
* @param client - HTTP client instance
|
|
85
|
+
* @param input - Archive criteria: project (required), plus beforeRunNumber, beforeDate, keepLast, reason
|
|
86
|
+
* @returns Archive result with count of archived runs
|
|
87
|
+
* @throws {InputValidationError} If input fails client-side Zod validation
|
|
59
88
|
*/
|
|
60
89
|
export async function archive(client, input) {
|
|
61
90
|
validateArchiveRunsInput(input);
|
|
@@ -68,7 +97,12 @@ export async function archive(client, input) {
|
|
|
68
97
|
}, { schema: ArchiveRunsResultResponseSchema });
|
|
69
98
|
}
|
|
70
99
|
/**
|
|
71
|
-
* Update run metadata by project and run number
|
|
100
|
+
* Update run metadata by project and run number. Supports post-hoc
|
|
101
|
+
* enrichment with analysis records and summaries.
|
|
102
|
+
*
|
|
103
|
+
* @param client - HTTP client instance
|
|
104
|
+
* @param input - Update payload with project + runNumber identifier
|
|
105
|
+
* @returns Updated run
|
|
72
106
|
*/
|
|
73
107
|
export async function update(client, input) {
|
|
74
108
|
return client.patch('/runs/update', {
|
|
@@ -87,31 +121,58 @@ export async function update(client, input) {
|
|
|
87
121
|
}, { schema: RunResponseSchema });
|
|
88
122
|
}
|
|
89
123
|
/**
|
|
90
|
-
* List runs for a project
|
|
124
|
+
* List runs for a project with optional filters.
|
|
125
|
+
*
|
|
126
|
+
* @param client - HTTP client instance
|
|
127
|
+
* @param projectId - Project ID or name
|
|
128
|
+
* @param query - Optional filters: workflowType, limit, offset
|
|
129
|
+
* @returns Array of run summaries
|
|
91
130
|
*/
|
|
92
131
|
export async function listByProject(client, projectId, query) {
|
|
93
132
|
return client.get(`/runs/project/${encodeURIComponent(projectId)}`, toApiQuery(query), { schema: z.array(RunSummaryResponseSchema) });
|
|
94
133
|
}
|
|
95
134
|
/**
|
|
96
|
-
* Get the
|
|
135
|
+
* Get the most recent run for a project, optionally filtered by workflow type.
|
|
136
|
+
*
|
|
137
|
+
* @param client - HTTP client instance
|
|
138
|
+
* @param projectId - Project ID or name
|
|
139
|
+
* @param workflowType - Optional workflow type filter (e.g. 'post-implementation')
|
|
140
|
+
* @returns Latest run
|
|
141
|
+
* @throws {NotFoundError} If no runs exist for the project/workflow
|
|
97
142
|
*/
|
|
98
143
|
export async function getLatest(client, projectId, workflowType) {
|
|
99
144
|
return client.get(`/runs/project/${encodeURIComponent(projectId)}/latest`, workflowType ? toApiQuery({ workflowType }) : undefined, { schema: RunResponseSchema });
|
|
100
145
|
}
|
|
101
146
|
/**
|
|
102
|
-
* Get full run details
|
|
147
|
+
* Get full run details including agents, recommendations, and analysis data.
|
|
148
|
+
*
|
|
149
|
+
* @param client - HTTP client instance
|
|
150
|
+
* @param projectId - Project ID or name
|
|
151
|
+
* @param runNumber - Specific run number (omit for latest)
|
|
152
|
+
* @returns Run details with nested agents and recommendations arrays
|
|
103
153
|
*/
|
|
104
154
|
export async function getDetails(client, projectId, runNumber) {
|
|
105
155
|
return client.get(`/runs/project/${encodeURIComponent(projectId)}/details`, runNumber !== undefined ? toApiQuery({ runNumber }) : undefined, { schema: RunDetailsResponseSchema });
|
|
106
156
|
}
|
|
107
157
|
/**
|
|
108
|
-
* Get a run by
|
|
158
|
+
* Get a run by its UUID.
|
|
159
|
+
*
|
|
160
|
+
* @param client - HTTP client instance
|
|
161
|
+
* @param runId - Run UUID
|
|
162
|
+
* @returns Run record
|
|
163
|
+
* @throws {NotFoundError} If run does not exist
|
|
109
164
|
*/
|
|
110
165
|
export async function get(client, runId) {
|
|
111
166
|
return client.get(`/runs/${encodeURIComponent(runId)}`, undefined, { schema: RunResponseSchema });
|
|
112
167
|
}
|
|
113
168
|
/**
|
|
114
|
-
* Update
|
|
169
|
+
* Update run metadata by UUID. Supports post-hoc enrichment with
|
|
170
|
+
* analysis records, summaries, and exploration maps.
|
|
171
|
+
*
|
|
172
|
+
* @param client - HTTP client instance
|
|
173
|
+
* @param runId - Run UUID
|
|
174
|
+
* @param input - Fields to update (all optional except identifier)
|
|
175
|
+
* @returns Updated run
|
|
115
176
|
*/
|
|
116
177
|
export async function updateById(client, runId, input) {
|
|
117
178
|
return client.patch(`/runs/${encodeURIComponent(runId)}`, {
|
|
@@ -128,7 +189,11 @@ export async function updateById(client, runId, input) {
|
|
|
128
189
|
}, { schema: RunResponseSchema });
|
|
129
190
|
}
|
|
130
191
|
/**
|
|
131
|
-
*
|
|
192
|
+
* Permanently delete a run. Requires the run ID as a confirmation header.
|
|
193
|
+
*
|
|
194
|
+
* @param client - HTTP client instance
|
|
195
|
+
* @param runId - Run UUID (also sent as X-Confirm-Delete header)
|
|
196
|
+
* @returns `{ deleted: true }` on success
|
|
132
197
|
*/
|
|
133
198
|
export async function deleteRun(client, runId) {
|
|
134
199
|
return client.request('DELETE', `/runs/${encodeURIComponent(runId)}`, undefined, {
|
|
@@ -140,26 +205,48 @@ export async function deleteRun(client, runId) {
|
|
|
140
205
|
// Analysis Operations (v1.4.0)
|
|
141
206
|
// ─────────────────────────────────────────────────────────────────
|
|
142
207
|
/**
|
|
143
|
-
* Get analysis records and summaries for a specific run
|
|
208
|
+
* Get structured analysis records and summaries for a specific run.
|
|
209
|
+
* Includes convention inventories, tension maps, decay vectors, exploration maps, etc.
|
|
210
|
+
*
|
|
211
|
+
* @param client - HTTP client instance
|
|
212
|
+
* @param runId - Run UUID
|
|
213
|
+
* @returns Analysis data with records and summaries arrays
|
|
144
214
|
*/
|
|
145
215
|
export async function getAnalysis(client, runId) {
|
|
146
216
|
return client.get(`/runs/${encodeURIComponent(runId)}/analysis`, undefined, { schema: RunAnalysisResponseSchema });
|
|
147
217
|
}
|
|
148
218
|
/**
|
|
149
|
-
* Get analysis summaries for a project over time
|
|
219
|
+
* Get analysis summaries for a project over time. Filter by agent name,
|
|
220
|
+
* agent type, or decision to track specific analytical trajectories.
|
|
221
|
+
*
|
|
222
|
+
* @param client - HTTP client instance
|
|
223
|
+
* @param projectId - Project ID or name
|
|
224
|
+
* @param query - Optional filters: agentName, agentType, decision, limit, offset
|
|
225
|
+
* @returns Paginated analysis summaries with `{ data, total }`
|
|
150
226
|
*/
|
|
151
227
|
export async function getProjectAnalysis(client, projectId, query) {
|
|
152
228
|
return client.get(`/projects/${encodeURIComponent(projectId)}/analysis`, toApiQuery(query), { schema: ProjectAnalysisListResponseSchema });
|
|
153
229
|
}
|
|
154
230
|
/**
|
|
155
|
-
* Query analysis records across projects
|
|
231
|
+
* Query analysis records across projects. Filter by record type
|
|
232
|
+
* (convention, tension, decay_vector), classification, agent, or severity.
|
|
233
|
+
*
|
|
234
|
+
* @param client - HTTP client instance
|
|
235
|
+
* @param query - Optional filters: recordType, classification, agentName, severity, limit, offset
|
|
236
|
+
* @returns Paginated analysis records with `{ data, total }`
|
|
156
237
|
*/
|
|
157
238
|
export async function queryAnalysisRecords(client, query) {
|
|
158
239
|
return client.get('/analysis/records', toApiQuery(query), { schema: AnalysisRecordsListResponseSchema });
|
|
159
240
|
}
|
|
160
241
|
/**
|
|
161
242
|
* Get analysis summaries with run context for a specific agent.
|
|
162
|
-
* Returns
|
|
243
|
+
* Returns decision, score, category scores alongside run metadata
|
|
244
|
+
* (run number, timestamp, workflow type, snapshot score).
|
|
245
|
+
*
|
|
246
|
+
* @param client - HTTP client instance
|
|
247
|
+
* @param agentName - Agent name (e.g. 'epictetus-validator')
|
|
248
|
+
* @param query - Query with required `project`, optional `decision`, `limit`, `offset`
|
|
249
|
+
* @returns `{ items: AgentRunSummary[], total: number }`
|
|
163
250
|
*/
|
|
164
251
|
export async function getAgentRunsAnalysis(client, agentName, query) {
|
|
165
252
|
return client.get(`/agents/${encodeURIComponent(agentName)}/runs-analysis`, toApiQuery(query), { schema: AgentRunsAnalysisResponseSchema });
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"runs.js","sourceRoot":"","sources":["../../src/operations/runs.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,OAAO,EAAE,UAAU,EAAE,MAAM,wBAAwB,CAAC;AAmBpD,OAAO,EACL,iBAAiB,EACjB,wBAAwB,EACxB,qBAAqB,EACrB,yBAAyB,EACzB,2BAA2B,EAC3B,+BAA+B,EAC/B,0BAA0B,EAC1B,wBAAwB,EACxB,yBAAyB,EACzB,iCAAiC,EACjC,iCAAiC,EACjC,+BAA+B,GAChC,MAAM,8BAA8B,CAAC;AACtC,OAAO,EACL,oBAAoB,EACpB,wBAAwB,GACzB,MAAM,yBAAyB,CAAC;AAEjC
|
|
1
|
+
{"version":3,"file":"runs.js","sourceRoot":"","sources":["../../src/operations/runs.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AACzC,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,OAAO,EAAE,UAAU,EAAE,MAAM,wBAAwB,CAAC;AAmBpD,OAAO,EACL,iBAAiB,EACjB,wBAAwB,EACxB,qBAAqB,EACrB,yBAAyB,EACzB,2BAA2B,EAC3B,+BAA+B,EAC/B,0BAA0B,EAC1B,wBAAwB,EACxB,yBAAyB,EACzB,iCAAiC,EACjC,iCAAiC,EACjC,+BAA+B,GAChC,MAAM,8BAA8B,CAAC;AACtC,OAAO,EACL,oBAAoB,EACpB,wBAAwB,GACzB,MAAM,yBAAyB,CAAC;AAEjC;;;;;;;;;;;;;;;;;;;GAmBG;AACH,MAAM,CAAC,KAAK,UAAU,IAAI,CACxB,MAAqB,EACrB,KAAmB;IAEnB,o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