@uluops/ops-sdk 1.8.1 → 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.
Files changed (69) hide show
  1. package/CHANGELOG.md +56 -1
  2. package/README.md +83 -52
  3. package/dist/client.d.ts +15 -46
  4. package/dist/client.d.ts.map +1 -1
  5. package/dist/client.js +17 -11
  6. package/dist/client.js.map +1 -1
  7. package/dist/config/constants.d.ts +2 -2
  8. package/dist/config/constants.js +1 -1
  9. package/dist/config/validators.d.ts +141 -3
  10. package/dist/config/validators.d.ts.map +1 -1
  11. package/dist/config/validators.js +146 -6
  12. package/dist/config/validators.js.map +1 -1
  13. package/dist/errors/errors.d.ts +1 -0
  14. package/dist/errors/errors.d.ts.map +1 -1
  15. package/dist/errors/errors.js +2 -0
  16. package/dist/errors/errors.js.map +1 -1
  17. package/dist/http/http-client.d.ts +17 -2
  18. package/dist/http/http-client.d.ts.map +1 -1
  19. package/dist/http/http-client.js +6 -1
  20. package/dist/http/http-client.js.map +1 -1
  21. package/dist/index.d.ts +1 -0
  22. package/dist/index.d.ts.map +1 -1
  23. package/dist/index.js.map +1 -1
  24. package/dist/operations/analytics.d.ts +87 -30
  25. package/dist/operations/analytics.d.ts.map +1 -1
  26. package/dist/operations/analytics.js +89 -33
  27. package/dist/operations/analytics.js.map +1 -1
  28. package/dist/operations/auth.d.ts +46 -8
  29. package/dist/operations/auth.d.ts.map +1 -1
  30. package/dist/operations/auth.js +46 -8
  31. package/dist/operations/auth.js.map +1 -1
  32. package/dist/operations/issues.d.ts +86 -16
  33. package/dist/operations/issues.d.ts.map +1 -1
  34. package/dist/operations/issues.js +86 -16
  35. package/dist/operations/issues.js.map +1 -1
  36. package/dist/operations/projects.d.ts +64 -10
  37. package/dist/operations/projects.d.ts.map +1 -1
  38. package/dist/operations/projects.js +69 -17
  39. package/dist/operations/projects.js.map +1 -1
  40. package/dist/operations/runs.d.ts +103 -19
  41. package/dist/operations/runs.d.ts.map +1 -1
  42. package/dist/operations/runs.js +111 -24
  43. package/dist/operations/runs.js.map +1 -1
  44. package/dist/operations/taxonomy.d.ts +3 -3
  45. package/dist/operations/taxonomy.d.ts.map +1 -1
  46. package/dist/operations/taxonomy.js +1 -1
  47. package/dist/types/analytics.d.ts +15 -21
  48. package/dist/types/analytics.d.ts.map +1 -1
  49. package/dist/types/index.d.ts +0 -1
  50. package/dist/types/index.d.ts.map +1 -1
  51. package/dist/types/index.js +1 -2
  52. package/dist/types/index.js.map +1 -1
  53. package/dist/types/projects.d.ts +0 -6
  54. package/dist/types/projects.d.ts.map +1 -1
  55. package/dist/types/response-schemas.d.ts +8 -38
  56. package/dist/types/response-schemas.d.ts.map +1 -1
  57. package/dist/types/response-schemas.js +9 -7
  58. package/dist/types/response-schemas.js.map +1 -1
  59. package/dist/types/runs.d.ts +3 -9
  60. package/dist/types/runs.d.ts.map +1 -1
  61. package/dist/types/schemas.d.ts +3 -24
  62. package/dist/types/schemas.d.ts.map +1 -1
  63. package/dist/types/schemas.js +2 -4
  64. package/dist/types/schemas.js.map +1 -1
  65. package/package.json +4 -4
  66. package/dist/operations/admin.d.ts +0 -89
  67. package/dist/operations/admin.d.ts.map +0 -1
  68. package/dist/operations/admin.js +0 -134
  69. package/dist/operations/admin.js.map +0 -1
package/CHANGELOG.md CHANGED
@@ -4,6 +4,57 @@ All notable changes to `@uluops/ops-sdk` will be documented in this file.
4
4
 
5
5
  The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/).
6
6
 
7
+ ## [Unreleased]
8
+
9
+ ## [1.8.4] - 2026-05-18
10
+
11
+ ### Fixed
12
+ - **Breaking (type only):** `AgentPerformance.avgScore` and `AgentInfo.avgScore` renamed to `averageScore` — aligns with `AgentPerformanceResponseSchema` field name. Callers accessing `.avgScore` must update to `.averageScore`
13
+ - `SaveRunInputSchema` now validates `definitionId` (UUID format) — was accepted by TypeScript interface but bypassed Zod client-side validation
14
+ - `AgentInputSchema` now validates `definitionVersion` — field was silently stripped by Zod on save
15
+ - `runs.save()` auto-generates idempotency key via `randomUUID()` when caller does not provide one — prevents duplicate runs on retry
16
+ - Broken README import paths: `SaveRunInput` from `types/runs` (was `types/schemas`), `Credentials` from `config` (was `types/auth`)
17
+ - Debug-mode unauthenticated warning no longer fires when email/password login is planned
18
+ - `deleteProject`/`softDelete` deduplicated via private `deleteWithConfirmation` helper
19
+ - `buildIssueListParams` widening cast removed — `QueryParams` assignable to `object` directly
20
+ - `listIssuesWithCount` JSDoc upgraded to `@remarks` with full reliability caveat documentation
21
+ - `toApiQuery` JSDoc now documents the `'all'` stripping convention with `StatusFilter`/`PriorityFilter` context
22
+ - Ghost `dist/operations/admin.*` artifacts cleaned; build script now runs `rm -rf dist` before `tsc`
23
+ - `response-schemas.ts` barrel removed from public `@uluops/ops-sdk/types` export (semver protection)
24
+ - `getByMetric` now throws `InputValidationError` instead of bare `Error`
25
+ - `validateUuid`/`validateRequiredString` now populate `errors[]` with synthetic Zod-compatible issues
26
+ - `npm audit` gate added to `prepublishOnly` script
27
+
28
+ ### Added
29
+ - `npm audit --audit-level=high` in `prepublishOnly` — blocks publish on high-severity vulnerabilities
30
+ - SDK_VERSION sync test — asserts `constants.ts` matches `package.json` via `createRequire`
31
+ - Tests for `getAgentRunsAnalysis`, `getAgentLifecycle`, `getAvatar` (3 previously untested public functions)
32
+ - Response validation tests for `listByProject` and `getLatest` operations
33
+ - `redactSensitive` boundary test at length=5
34
+ - README: exports table expanded to 12 rows, sign-up URL, `AnalyticsMetric` type example, analysis output shapes
35
+ - CHANGELOG: `[Unreleased]` section, missing `[1.7.0]` entry restored
36
+ - JSDoc enriched on 6 analytics/project operations, `runs.save()` `@example`, `isValidMetric()` `@example`
37
+
38
+ ## [1.8.3] - 2026-05-18
39
+
40
+ ### Fixed
41
+ - `TaxonomySchema` type alias renamed to `TaxonomyResponse` — "Schema" suffix was inconsistent with codebase convention where it means Zod runtime object. Deprecated `TaxonomySchema` alias preserved for backward compatibility.
42
+ - `diff()`, `getLatest()`, `getDetails()` now route query parameters through `toApiQuery()` for consistent camelCase→snake_case conversion, matching all other operations
43
+ - `InputValidationError` now exported from `@uluops/ops-sdk/errors` barrel — previously only accessible via `@uluops/ops-sdk/config`
44
+ - JSDoc on `AgentInput`, `RecommendationInput`, `RunSummaryInput` updated from stale `save_features_list` references to `save_run`
45
+ - Removed `category_performance` from `ANALYTICS_METRICS` — API does not support this metric
46
+
47
+ ## [1.8.2] - 2026-05-18
48
+
49
+ ### Added
50
+ - `client.auth.getAvatar()` — was implemented in `operations/auth.ts` but missing from the `OpsClient.auth` namespace
51
+
52
+ ### Fixed
53
+ - `SDK_VERSION` constant synced to match `package.json` (was stuck at `1.4.0`)
54
+
55
+ ### Removed
56
+ - Deprecated `validateSaveFeaturesListInput` alias — use `validateSaveRunInput` directly
57
+
7
58
  ## [1.8.1] - 2026-05-12
8
59
 
9
60
  ### Changed
@@ -35,10 +86,14 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/).
35
86
  ## [1.7.1] - 2026-05-10
36
87
 
37
88
  ### Added
38
- - `analysisRecords` and `analysisSummary` fields on `UpdateRunInput` — enables post-hoc enrichment of runs with structured analysis data (replace semantics)
39
89
  - `agentName` field on `AnalysisRecordInput` and `AnalysisSummaryInput` — per-item agent attribution, overrides run-level default
40
90
  - `analysisSummary` on `UpdateRunInput` accepts single object or array of per-agent summaries
41
91
 
92
+ ## [1.7.0] - 2026-05-10
93
+
94
+ ### Added
95
+ - `analysisRecords` and `analysisSummary` fields on `UpdateRunInput` — enables post-hoc enrichment of runs with structured analysis data (replace semantics)
96
+
42
97
  ## [1.6.0] - 2026-05-06
43
98
 
44
99
  ### Added
package/README.md CHANGED
@@ -11,7 +11,7 @@
11
11
 
12
12
  Official TypeScript SDK with Zod runtime validation for the UluOps validation tracker API. Track validation runs, manage issues, analyze trends, and integrate AI validation pipelines into your workflow.
13
13
 
14
- **Current version: 1.8.0** | [Changelog](./CHANGELOG.md)
14
+ **Current version: 1.8.4** | [Changelog](./CHANGELOG.md)
15
15
 
16
16
  ## Quick Start
17
17
 
@@ -71,7 +71,7 @@ const burndown = await client.analytics.getBurndown({
71
71
  });
72
72
 
73
73
  for (const [domain, trend] of Object.entries(burndown.trends)) {
74
- console.log(`${domain}: ${trend.direction} (rate: ${trend.rate})`);
74
+ console.log(`${domain}: ${trend.trend} (avg daily change: ${trend.avgDailyChange})`);
75
75
  }
76
76
  ```
77
77
 
@@ -139,7 +139,7 @@ pnpm add @uluops/ops-sdk
139
139
 
140
140
  ## Authentication
141
141
 
142
- The SDK supports two authentication methods:
142
+ The SDK supports two authentication methods. To get an API key, visit the [UluOps Dashboard](https://app.uluops.ai) or create one programmatically via `client.auth.createApiKey()`.
143
143
 
144
144
  ### API Key Authentication (Recommended)
145
145
 
@@ -227,8 +227,16 @@ import { loadCredentials, DEFAULT_BASE_URL } from '@uluops/ops-sdk/config';
227
227
 
228
228
  | Export Path | Contents |
229
229
  |------------|----------|
230
- | `@uluops/ops-sdk` | Main `OpsClient`, `OpsHttpClient`, auth strategies |
231
- | `@uluops/ops-sdk/types` | All TypeScript types and Zod schemas |
230
+ | `@uluops/ops-sdk` | Main `OpsClient`, `OpsHttpClient`, auth strategies, config helpers, all types |
231
+ | `@uluops/ops-sdk/types` | All TypeScript types and Zod input schemas |
232
+ | `@uluops/ops-sdk/types/projects` | Project types only |
233
+ | `@uluops/ops-sdk/types/issues` | Issue types only |
234
+ | `@uluops/ops-sdk/types/runs` | Run types only |
235
+ | `@uluops/ops-sdk/types/analytics` | Analytics types only |
236
+ | `@uluops/ops-sdk/types/enums` | Priority, Status, Severity enums |
237
+ | `@uluops/ops-sdk/types/responses` | API response types |
238
+ | `@uluops/ops-sdk/types/schemas` | Zod input validation schemas |
239
+ | `@uluops/ops-sdk/types/auth` | Auth/credential types |
232
240
  | `@uluops/ops-sdk/errors` | Error classes and utilities |
233
241
  | `@uluops/ops-sdk/config` | Configuration loaders and constants |
234
242
 
@@ -243,8 +251,8 @@ import type { Run } from '@uluops/ops-sdk/types/runs';
243
251
  import type { BurndownResult } from '@uluops/ops-sdk/types/analytics';
244
252
  import type { Priority, Status, Severity } from '@uluops/ops-sdk/types/enums';
245
253
  import type { ApiResponse } from '@uluops/ops-sdk/types/responses';
246
- import type { SaveRunInput } from '@uluops/ops-sdk/types/schemas';
247
- import type { Credentials } from '@uluops/ops-sdk/types/auth';
254
+ import type { SaveRunInput } from '@uluops/ops-sdk/types/runs';
255
+ import type { Credentials } from '@uluops/ops-sdk/config';
248
256
  ```
249
257
 
250
258
  ## API Reference
@@ -410,6 +418,15 @@ await client.auth.resetPassword({
410
418
  });
411
419
  ```
412
420
 
421
+ #### `client.auth.getAvatar()`
422
+
423
+ Get the current user's avatar as binary data.
424
+
425
+ ```typescript
426
+ const { data, contentType } = await client.auth.getAvatar();
427
+ // data: ArrayBuffer, contentType: e.g. 'image/png'
428
+ ```
429
+
413
430
  #### `client.auth.deleteAvatar()`
414
431
 
415
432
  Delete the current user's avatar.
@@ -677,7 +694,7 @@ Save a new validation run.
677
694
  | `project` | `string` | Yes | Project name or ID |
678
695
  | `workflowType` | `string` | Yes | Workflow type (e.g., `'post-implementation'`) |
679
696
  | `agents` | `AgentInput[]` | Yes | Array of agent results |
680
- | `recommendations` | `Recommendation[]` | No | Array of issues/recommendations |
697
+ | `recommendations` | `Recommendation[]` | Yes | Array of issues/recommendations (use `[]` for empty) |
681
698
  | `summary` | `object` | No | Summary statistics |
682
699
  | `rawMarkdown` | `string` | No | Raw markdown report |
683
700
  | `idempotencyKey` | `string` | No | Key for duplicate prevention |
@@ -685,6 +702,8 @@ Save a new validation run.
685
702
  | `definitionName` | `string` | No | Definition name (e.g., `'code-validator'`) |
686
703
  | `definitionVersion` | `string` | No | Definition version (e.g., `'1.2.0'`) |
687
704
  | `definitionHash` | `string` | No | SHA-256 content hash of the definition |
705
+ | `definitionId` | `string` | No | Registry definition UUID for direct identity linkage |
706
+ | `timestamp` | `string` | No | ISO 8601 timestamp override (defaults to server time) |
688
707
  | `analysisRecords` | `AnalysisRecordInput[]` | No | Structured analysis records (v0.2.0) |
689
708
  | `analysisSummary` | `AnalysisSummaryInput \| AnalysisSummaryInput[]` | No | Single or per-agent array of analysis summaries (v1.8.1) |
690
709
  | `analysisSummary.explorationMaps` | `ExplorationMap[]` | No | Structural maps from explorer agents (v1.8.0) |
@@ -739,8 +758,8 @@ Preview what a save would do without persisting.
739
758
  const preview = await client.runs.validate({
740
759
  project: 'my-project',
741
760
  workflowType: 'post-implementation',
742
- agents: [...],
743
- recommendations: [...],
761
+ agents: [{ name: 'code-validator', score: 90, decision: 'PASS' }],
762
+ recommendations: [{ agent: 'code-validator', title: 'Unused import', priority: 'backlog', failure_code: 'STR-OMI/L' }],
744
763
  });
745
764
 
746
765
  console.log('Would create:', preview.wouldCreate);
@@ -832,7 +851,7 @@ const result = await client.runs.archive({
832
851
  keepLast: 10,
833
852
  reason: 'Quarterly cleanup',
834
853
  });
835
- console.log(`Archived ${result.archivedCount} runs`);
854
+ console.log(`Archived ${result.archived} runs`);
836
855
  ```
837
856
 
838
857
  #### `client.runs.update(input)`
@@ -924,7 +943,7 @@ const { data, total } = await client.runs.getProjectAnalysis('my-project', {
924
943
  agentName: 'nietzsche-analyst',
925
944
  limit: 10,
926
945
  });
927
- // Track active/reactive ratio trend over time
946
+ // data[0]: { decision, score, categoryScores, systemMetrics, runNumber, runTimestamp, workflowType }
928
947
  data.forEach(s => console.log(s.decision, s.systemMetrics));
929
948
  ```
930
949
 
@@ -942,10 +961,12 @@ Cross-project query for analysis records with filters (v0.3.0).
942
961
 
943
962
  ```typescript
944
963
  // Find all calcified conventions across all projects
945
- const { data } = await client.runs.queryAnalysisRecords({
964
+ const { data, total } = await client.runs.queryAnalysisRecords({
946
965
  recordType: 'convention',
947
966
  classification: 'CALCIFIED',
948
967
  });
968
+ // data[0]: { recordType, recordId, title, classification, severity, data: { ... } }
969
+ console.log(`Found ${total} records`);
949
970
  ```
950
971
 
951
972
  #### `client.runs.getAgentRunsAnalysis(agentName, query)`
@@ -961,11 +982,11 @@ Get analysis summaries with run context for a specific agent. Returns analysis d
961
982
  | `query.offset` | `number` | No | Pagination offset |
962
983
 
963
984
  ```typescript
964
- const { data, total } = await client.runs.getAgentRunsAnalysis('epictetus-validator', {
985
+ const { items, total } = await client.runs.getAgentRunsAnalysis('epictetus-validator', {
965
986
  project: 'my-project',
966
987
  limit: 10,
967
988
  });
968
- // data[0]: { decision, score, categoryScores, runNumber, runTimestamp, workflowType, snapshotScore, ... }
989
+ // items[0]: { decision, score, categoryScores, runNumber, runTimestamp, workflowType, snapshotScore, ... }
969
990
  ```
970
991
 
971
992
  ---
@@ -989,7 +1010,7 @@ Create a user-submitted issue.
989
1010
  | `lineNumber` | `number` | No | Line number |
990
1011
  | `description` | `string` | No | Detailed description |
991
1012
  | `failureCode` | `string` | No | Taxonomy code (e.g., `'SEM-VAL/H'`) |
992
- | `validator` | `string` | No | Validator name (defaults to `'user-submitted'`) |
1013
+ | `agent` | `string` | No | Agent name (defaults to `'user-submitted'`) |
993
1014
 
994
1015
  ```typescript
995
1016
  const issue = await client.issues.create({
@@ -1044,7 +1065,7 @@ Get detailed issue information with occurrences and notes.
1044
1065
  const details = await client.issues.getDetails('issue-uuid-here');
1045
1066
  console.log('Occurrences:', details.occurrences);
1046
1067
  console.log('Notes:', details.notes);
1047
- console.log('Related issues:', details.relatedIssues);
1068
+ console.log('History:', details.history);
1048
1069
  ```
1049
1070
 
1050
1071
  #### `client.issues.getByFingerprint(fingerprint, project)`
@@ -1079,7 +1100,7 @@ Get status change history for an issue.
1079
1100
  ```typescript
1080
1101
  const history = await client.issues.getHistory('issue-uuid');
1081
1102
  for (const entry of history) {
1082
- console.log(`${entry.fromStatus} -> ${entry.toStatus} at ${entry.changedAt}`);
1103
+ console.log(`${entry.oldStatus} -> ${entry.newStatus} at ${entry.changedAt}`);
1083
1104
  }
1084
1105
  ```
1085
1106
 
@@ -1201,7 +1222,24 @@ Get performance metrics by agent.
1201
1222
  ```typescript
1202
1223
  const performance = await client.analytics.getAgentPerformance({ days: 30 });
1203
1224
  for (const agent of performance) {
1204
- console.log(`${agent.agent}: avg=${agent.avgScore}, pass=${agent.passRate}`);
1225
+ console.log(`${agent.name}: avg=${agent.avgScore}, pass=${agent.passRate}`);
1226
+ }
1227
+ ```
1228
+
1229
+ #### `client.analytics.getAgentLifecycle(agentName, query)`
1230
+
1231
+ Get version trajectory for a specific agent across time.
1232
+
1233
+ | Parameter | Type | Required | Description |
1234
+ |-----------|------|----------|-------------|
1235
+ | `agentName` | `string` | Yes | Agent name |
1236
+ | `query.project` | `string` | No | Filter by project |
1237
+ | `query.days` | `number` | No | Time window (default: 30) |
1238
+
1239
+ ```typescript
1240
+ const lifecycle = await client.analytics.getAgentLifecycle('code-validator', { days: 90 });
1241
+ for (const entry of lifecycle) {
1242
+ console.log(`v${entry.definitionVersion}: avg=${entry.avgScore}, runs=${entry.runs}, pass=${entry.passRate}`);
1205
1243
  }
1206
1244
  ```
1207
1245
 
@@ -1228,7 +1266,7 @@ Get issue resolution rates by project.
1228
1266
  ```typescript
1229
1267
  const rates = await client.analytics.getResolutionRates();
1230
1268
  for (const rate of rates) {
1231
- console.log(`${rate.project}: ${rate.rate * 100}% resolved`);
1269
+ console.log(`${rate.project}: ${rate.resolutionRate * 100}% resolved`);
1232
1270
  }
1233
1271
  ```
1234
1272
 
@@ -1245,7 +1283,7 @@ Get files with the most issues.
1245
1283
  ```typescript
1246
1284
  const hotspots = await client.analytics.getFileHotspots({ limit: 10 });
1247
1285
  for (const hotspot of hotspots) {
1248
- console.log(`${hotspot.filePath}: ${hotspot.issueCount} issues`);
1286
+ console.log(`${hotspot.filePath}: ${hotspot.totalIssues} issues`);
1249
1287
  }
1250
1288
  ```
1251
1289
 
@@ -1266,10 +1304,10 @@ for (const d of distribution) {
1266
1304
  Get comprehensive taxonomy analytics.
1267
1305
 
1268
1306
  ```typescript
1269
- const { data, computedAt } = await client.analytics.getFullTaxonomy();
1270
- console.log('By domain:', data.byDomain);
1271
- console.log('By mode:', data.byMode);
1272
- console.log('By severity:', data.bySeverity);
1307
+ const taxonomy = await client.analytics.getFullTaxonomy();
1308
+ console.log('By domain:', taxonomy.byDomain);
1309
+ console.log('By mode:', taxonomy.byMode);
1310
+ console.log('By severity:', taxonomy.bySeverity);
1273
1311
  ```
1274
1312
 
1275
1313
  #### `client.analytics.getBurndown(query)`
@@ -1286,7 +1324,7 @@ Get burndown time series by failure domain.
1286
1324
  const burndown = await client.analytics.getBurndown({ days: 30 });
1287
1325
  console.log('Time series:', burndown.timeSeries);
1288
1326
  console.log('Trends:', burndown.trends);
1289
- // { STR: { direction: 'declining', rate: -0.05 }, ... }
1327
+ // { STR: { trend: 'declining', avgDailyChange: -0.05, netChange: -12, confidence: 'high' }, ... }
1290
1328
  ```
1291
1329
 
1292
1330
  #### `client.analytics.getVelocity(query)`
@@ -1301,10 +1339,10 @@ Get velocity metrics per failure mode.
1301
1339
 
1302
1340
  ```typescript
1303
1341
  const velocity = await client.analytics.getVelocity({ alertThreshold: 10 });
1304
- for (const mode of velocity.modes) {
1305
- console.log(`${mode.mode}: velocity=${mode.velocity}, trend=${mode.trend}`);
1342
+ for (const item of velocity.items) {
1343
+ console.log(`${item.failureCode}: velocity=${item.velocityPercent}%, alert=${item.alert}`);
1306
1344
  }
1307
- console.log('Alerts:', velocity.alerts);
1345
+ console.log('Summary:', velocity.summary);
1308
1346
  ```
1309
1347
 
1310
1348
  #### `client.analytics.getDiscovery(query)`
@@ -1337,9 +1375,9 @@ Get agent-taxonomy coverage matrix.
1337
1375
  ```typescript
1338
1376
  const matrix = await client.analytics.getAgentMatrix();
1339
1377
  console.log('Coverage matrix:', matrix.matrix);
1340
- console.log('Blind spots:', matrix.blindSpots); // Domains not detected
1341
- console.log('Single points:', matrix.singlePoints); // Only one agent detects
1342
- console.log('High overlap:', matrix.highOverlap); // 3+ agents detect
1378
+ console.log('Blind spots:', matrix.analysis.blindSpots); // Domains not detected
1379
+ console.log('Single points:', matrix.analysis.singlePoints); // Only one agent detects
1380
+ console.log('High overlap:', matrix.analysis.highOverlap); // 3+ agents detect
1343
1381
  ```
1344
1382
 
1345
1383
  #### `client.analytics.getTrendSummary(query)`
@@ -1349,7 +1387,7 @@ Get general trend summary.
1349
1387
  ```typescript
1350
1388
  const trends = await client.analytics.getTrendSummary();
1351
1389
  for (const trend of trends) {
1352
- console.log(`${trend.metric}: ${trend.value} (${trend.change > 0 ? '+' : ''}${trend.change})`);
1390
+ console.log(`${trend.period}: ${trend.newIssues} new, ${trend.resolvedIssues} resolved`);
1353
1391
  }
1354
1392
  ```
1355
1393
 
@@ -1357,10 +1395,13 @@ for (const trend of trends) {
1357
1395
 
1358
1396
  Get analytics by specific metric name.
1359
1397
 
1360
- Available metrics: `agent_performance`, `resolution_rates`, `cross_project_patterns`, `file_hotspots`, `regression_analysis`, `trend_summary`, `cost_analysis`, `taxonomy_distribution`, `category_performance`.
1398
+ Available metrics: `agent_performance`, `resolution_rates`, `cross_project_patterns`, `file_hotspots`, `regression_analysis`, `trend_summary`, `cost_analysis`, `taxonomy_distribution`.
1361
1399
 
1362
1400
  ```typescript
1363
- const costData = await client.analytics.getByMetric('cost_analysis', { days: 30 });
1401
+ import type { AnalyticsMetric } from '@uluops/ops-sdk';
1402
+
1403
+ const metric: AnalyticsMetric = 'cost_analysis'; // IDE autocomplete for valid metrics
1404
+ const costData = await client.analytics.getByMetric(metric, { days: 30 });
1364
1405
  const regressions = await client.analytics.getByMetric('regression_analysis', { project: 'my-project' });
1365
1406
  ```
1366
1407
 
@@ -1375,18 +1416,7 @@ for (const v of agents) {
1375
1416
  }
1376
1417
  ```
1377
1418
 
1378
- #### Deprecated Aliases
1379
-
1380
- The following analytics methods were renamed from "validator" to "agent" terminology. The old names still work but will be removed in a future major version:
1381
1419
 
1382
- | Deprecated | Replacement |
1383
- |-----------|-------------|
1384
- | `getValidatorPerformance` | `getAgentPerformance` |
1385
- | `getValidatorReliability` | `getAgentReliability` |
1386
- | `getValidatorMatrix` | `getAgentMatrix` |
1387
- | `listValidators` | `listAgents` |
1388
-
1389
- Similarly, `client.issues.edit()` is deprecated in favor of `client.issues.update()`.
1390
1420
 
1391
1421
  ---
1392
1422
 
@@ -1513,7 +1543,7 @@ try {
1513
1543
  | `ServiceUnavailableError` | 503 | Server unavailable |
1514
1544
  | `NetworkError` | - | Connection error |
1515
1545
  | `TimeoutError` | - | Request timeout |
1516
- | `InputValidationError` | - | Client-side Zod validation failure (import from `@uluops/ops-sdk/config`) |
1546
+ | `InputValidationError` | - | Client-side Zod validation failure |
1517
1547
 
1518
1548
  ### Automatic Retries
1519
1549
 
@@ -1543,7 +1573,8 @@ Requests exceeding these limits will receive a `413 Payload Too Large` or `422 U
1543
1573
  The SDK includes Zod-based runtime validators for all mutating operations. Import them from `@uluops/ops-sdk/config`:
1544
1574
 
1545
1575
  ```typescript
1546
- import { validateCreateProjectInput, InputValidationError } from '@uluops/ops-sdk/config';
1576
+ import { InputValidationError } from '@uluops/ops-sdk/errors';
1577
+ import { validateCreateProjectInput } from '@uluops/ops-sdk/config';
1547
1578
 
1548
1579
  try {
1549
1580
  const validated = validateCreateProjectInput({ name: '' }); // throws
@@ -1616,7 +1647,7 @@ console.log(config.baseUrl);
1616
1647
 
1617
1648
  ### Invalid API Key Format
1618
1649
 
1619
- ```
1650
+ ```text
1620
1651
  Error: Invalid API key format. Keys must start with 'ulr_'
1621
1652
  ```
1622
1653
 
@@ -1629,7 +1660,7 @@ console.log(key); // ulr_abc123...
1629
1660
 
1630
1661
  ### Authentication Errors
1631
1662
 
1632
- ```
1663
+ ```text
1633
1664
  UnauthorizedError: Authentication required
1634
1665
  ```
1635
1666
 
@@ -1645,7 +1676,7 @@ echo $ULUOPS_API_KEY
1645
1676
 
1646
1677
  ### Connection Errors
1647
1678
 
1648
- ```
1679
+ ```text
1649
1680
  NetworkError: connect ECONNREFUSED 127.0.0.1:3100
1650
1681
  ```
1651
1682
 
@@ -1666,7 +1697,7 @@ const client = new OpsClient({
1666
1697
 
1667
1698
  ### Rate Limiting
1668
1699
 
1669
- ```
1700
+ ```text
1670
1701
  RateLimitError: Rate limit exceeded. Retry after 60 seconds
1671
1702
  ```
1672
1703
 
package/dist/client.d.ts CHANGED
@@ -1,38 +1,19 @@
1
+ import { type HttpClientConfig } from './http/http-client.js';
1
2
  import * as analyticsOps from './operations/analytics.js';
2
3
  import type { RegisterInput, LoginInput, LoginResponse, RegisterResponse, UpdateProfileInput, ChangePasswordInput, ResetPasswordInput, CreateApiKeyInput, ApiKeyCreatedResponse, PublicApiKey, PublicSession, AuthUser, PublicUser } from './types/auth.js';
3
- import type { Project, CreateProjectInput, UpdateProjectInput, DeleteProjectInput, RenameProjectInput, ProjectSummaryResponse, PaginatedIssues, ProjectTrends, ProjectTrendsQuery, ListProjectIssuesQuery, BulkIssueStatusUpdate, MergeIssuesInput, MergeIssuesResult } from './types/projects.js';
4
+ import type { Project, CreateProjectInput, UpdateProjectInput, DeleteProjectInput, RenameProjectInput, ProjectSummaryResponse, PaginatedIssues, ProjectTrends, ProjectTrendsQuery, ListProjectIssuesQuery, BulkIssueStatusUpdate, BulkIssueStatusResult, MergeIssuesInput, MergeIssuesResult } from './types/projects.js';
4
5
  import { type z } from 'zod';
5
6
  import type { Run, SaveRunInput, SaveRunResponse, ValidateRunResponse, RunDiffQuery, RunDiffResult, ArchiveRunsInput, ArchiveRunsResult, UpdateRunInput, UpdateRunByNumberInput, ListRunsQuery, RunDetails, ProjectAnalysisQuery, AnalysisRecordsQuery, AgentRunsAnalysisQuery } from './types/runs.js';
6
7
  import type { RunSummaryResponseSchema, RunAnalysisResponseSchema, ProjectAnalysisListResponseSchema, AnalysisRecordsListResponseSchema, AgentRunsAnalysisResponseSchema } from './types/response-schemas.js';
7
8
  import type { Issue, CreateUserIssueInput, UpdateIssueInput, UpdateIssueStatusInput, CreateIssueNoteInput, IssueNote, StatusHistory, IssueDetails, IssueSearchQuery, ListIssuesQuery, BulkStatusUpdateItem, StatusUpdateResult } from './types/issues.js';
8
- import type { AnalyticsQuery, AgentInfo, AgentReliabilityQuery, BurndownQuery, VelocityQuery, DiscoveryQuery, AgentMatrixQuery, TaxonomySchema } from './types/analytics.js';
9
- import { AgentPerformanceResponseSchema, AgentReliabilityResultResponseSchema, ResolutionRateResponseSchema, FileHotspotResponseSchema, TaxonomyDistributionResponseSchema, FullTaxonomyAnalyticsResponseSchema, BurndownResultResponseSchema, VelocityResultResponseSchema, DiscoveryResultResponseSchema, AgentMatrixResultResponseSchema, TrendSummaryResponseSchema } from './types/response-schemas.js';
9
+ import type { AnalyticsQuery, AgentInfo, AgentLifecycleEntry, AgentReliabilityQuery, BurndownQuery, VelocityQuery, DiscoveryQuery, AgentMatrixQuery, TaxonomyResponse } from './types/analytics.js';
10
+ import { AgentPerformanceResponseSchema, AgentReliabilityResultResponseSchema, ResolutionRateResponseSchema, FileHotspotResponseSchema, TaxonomyDistributionResponseSchema, FullTaxonomyAnalyticsResponseSchema, BurndownResultResponseSchema, VelocityResultResponseSchema, DiscoveryResultResponseSchema, AgentMatrixResultResponseSchema, TrendSummaryResponseSchema, BulkStatusUpdateResultResponseSchema } from './types/response-schemas.js';
10
11
  import type { MessageResponse, DeleteResult } from './types/responses.js';
11
12
  /**
12
- * OpsClient configuration options
13
+ * OpsClient configuration options.
14
+ * All HTTP-level options (baseUrl, timeout, retries, debug, auth) are available.
13
15
  */
14
- export interface OpsClientConfig {
15
- /** API key for authentication (preferred) */
16
- apiKey?: string;
17
- /** Email for session-based auth */
18
- email?: string;
19
- /** Password for session-based auth */
20
- password?: string;
21
- /** Existing session token */
22
- sessionToken?: string;
23
- /** API base URL (defaults to https://api.uluops.ai/api/v1/ops; localhost:3100 when NODE_ENV=development) */
24
- baseUrl?: string;
25
- /** Request timeout in ms */
26
- timeout?: number;
27
- /** Number of retries for transient errors */
28
- retries?: number;
29
- /** Enable debug logging */
30
- debug?: boolean;
31
- /** Callback when session token is refreshed */
32
- onTokenRefresh?: (token: string) => void;
33
- /** Org slug for multi-tenancy — sets X-Org-Slug header on all requests */
34
- orgSlug?: string;
35
- }
16
+ export type OpsClientConfig = HttpClientConfig;
36
17
  /**
37
18
  * Main SDK client for the UluOps validation tracker API.
38
19
  *
@@ -94,6 +75,10 @@ export declare class OpsClient {
94
75
  updateProfile: (input: UpdateProfileInput) => Promise<{
95
76
  user: PublicUser;
96
77
  }>;
78
+ getAvatar: () => Promise<{
79
+ data: ArrayBuffer;
80
+ contentType: string;
81
+ }>;
97
82
  deleteAvatar: () => Promise<void>;
98
83
  listApiKeys: () => Promise<PublicApiKey[]>;
99
84
  createApiKey: (input?: CreateApiKeyInput) => Promise<ApiKeyCreatedResponse>;
@@ -115,10 +100,7 @@ export declare class OpsClient {
115
100
  getTrends: (idOrName: string, query?: ProjectTrendsQuery) => Promise<ProjectTrends>;
116
101
  listIssues: (idOrName: string, query?: ListProjectIssuesQuery) => Promise<Issue[]>;
117
102
  listIssuesWithCount: (idOrName: string, query?: ListProjectIssuesQuery) => Promise<PaginatedIssues>;
118
- bulkUpdateIssueStatus: (idOrName: string, updates: BulkIssueStatusUpdate[]) => Promise<{
119
- updated: number;
120
- failed: string[];
121
- }>;
103
+ bulkUpdateIssueStatus: (idOrName: string, updates: BulkIssueStatusUpdate[]) => Promise<BulkIssueStatusResult>;
122
104
  mergeIssues: (idOrName: string, input: MergeIssuesInput) => Promise<MergeIssuesResult>;
123
105
  };
124
106
  /** Validation run save, preview, diff, archive, and retrieval */
@@ -150,22 +132,17 @@ export declare class OpsClient {
150
132
  getHistory: (issueId: string) => Promise<StatusHistory[]>;
151
133
  updateStatus: (issueId: string, input: UpdateIssueStatusInput) => Promise<Issue>;
152
134
  update: (issueId: string, input: UpdateIssueInput) => Promise<Issue>;
153
- /** @deprecated Use update instead */
154
- edit: (issueId: string, input: UpdateIssueInput) => Promise<Issue>;
155
135
  addNote: (issueId: string, input: CreateIssueNoteInput) => Promise<IssueNote>;
156
136
  restore: (issueId: string) => Promise<Issue>;
157
137
  undoLastChange: (issueId: string) => Promise<Issue>;
158
- bulkUpdateStatus: (updates: BulkStatusUpdateItem[]) => Promise<{
159
- updated: number;
160
- failed: string[];
161
- }>;
138
+ bulkUpdateStatus: (updates: BulkStatusUpdateItem[]) => Promise<z.infer<typeof BulkStatusUpdateResultResponseSchema>>;
162
139
  listByProject: (projectId: string, query?: ListIssuesQuery) => Promise<Issue[]>;
163
140
  };
164
141
  /** Agent performance, taxonomy analytics, burndown, velocity, and discovery */
165
142
  readonly analytics: {
166
143
  getAgentPerformance: (query?: AnalyticsQuery) => Promise<z.infer<typeof AgentPerformanceResponseSchema>[]>;
167
144
  getAgentReliability: (query?: AgentReliabilityQuery) => Promise<z.infer<typeof AgentReliabilityResultResponseSchema>>;
168
- getAgentLifecycle: (agentName: string, query?: AnalyticsQuery) => Promise<unknown>;
145
+ getAgentLifecycle: (agentName: string, query?: AnalyticsQuery) => Promise<AgentLifecycleEntry[]>;
169
146
  getResolutionRates: (query?: AnalyticsQuery) => Promise<z.infer<typeof ResolutionRateResponseSchema>[]>;
170
147
  getFileHotspots: (query?: AnalyticsQuery) => Promise<z.infer<typeof FileHotspotResponseSchema>[]>;
171
148
  getTaxonomyDistribution: (query?: AnalyticsQuery) => Promise<z.infer<typeof TaxonomyDistributionResponseSchema>[]>;
@@ -181,18 +158,10 @@ export declare class OpsClient {
181
158
  */
182
159
  getByMetric: (metric: analyticsOps.AnalyticsMetric, query?: AnalyticsQuery) => Promise<unknown>;
183
160
  listAgents: (query?: AnalyticsQuery) => Promise<AgentInfo[]>;
184
- /** @deprecated Use getAgentPerformance instead */
185
- getValidatorPerformance: (query?: AnalyticsQuery) => Promise<z.infer<typeof AgentPerformanceResponseSchema>[]>;
186
- /** @deprecated Use getAgentReliability instead */
187
- getValidatorReliability: (query?: AgentReliabilityQuery) => Promise<z.infer<typeof AgentReliabilityResultResponseSchema>>;
188
- /** @deprecated Use getAgentMatrix instead */
189
- getValidatorMatrix: (query?: AgentMatrixQuery) => Promise<z.infer<typeof AgentMatrixResultResponseSchema>>;
190
- /** @deprecated Use listAgents instead */
191
- listValidators: (query?: AnalyticsQuery) => Promise<AgentInfo[]>;
192
161
  };
193
162
  /** Failure taxonomy schema (domains, modes, severities) */
194
163
  readonly taxonomy: {
195
- get: () => Promise<TaxonomySchema>;
164
+ get: () => Promise<TaxonomyResponse>;
196
165
  };
197
166
  }
198
167
  //# sourceMappingURL=client.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"client.d.ts","sourceRoot":"","sources":["../src/client.ts"],"names":[],"mappings":"AAMA,OAAO,KAAK,YAAY,MAAM,2BAA2B,CAAC;AAE1D,OAAO,KAAK,EACV,aAAa,EACb,UAAU,EACV,aAAa,EACb,gBAAgB,EAChB,kBAAkB,EAClB,mBAAmB,EACnB,kBAAkB,EAClB,iBAAiB,EACjB,qBAAqB,EACrB,YAAY,EACZ,aAAa,EACb,QAAQ,EACR,UAAU,EACX,MAAM,iBAAiB,CAAC;AAEzB,OAAO,KAAK,EACV,OAAO,EACP,kBAAkB,EAClB,kBAAkB,EAClB,kBAAkB,EAClB,kBAAkB,EAClB,sBAAsB,EACtB,eAAe,EACf,aAAa,EACb,kBAAkB,EAClB,sBAAsB,EACtB,qBAAqB,EACrB,gBAAgB,EAChB,iBAAiB,EAClB,MAAM,qBAAqB,CAAC;AAE7B,OAAO,EAAE,KAAK,CAAC,EAAE,MAAM,KAAK,CAAC;AAC7B,OAAO,KAAK,EACV,GAAG,EACH,YAAY,EACZ,eAAe,EACf,mBAAmB,EACnB,YAAY,EACZ,aAAa,EACb,gBAAgB,EAChB,iBAAiB,EACjB,cAAc,EACd,sBAAsB,EACtB,aAAa,EACb,UAAU,EACV,oBAAoB,EACpB,oBAAoB,EACpB,sBAAsB,EACvB,MAAM,iBAAiB,CAAC;AACzB,OAAO,KAAK,EACV,wBAAwB,EACxB,yBAAyB,EACzB,iCAAiC,EACjC,iCAAiC,EACjC,+BAA+B,EAChC,MAAM,6BAA6B,CAAC;AAErC,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D,QAAQ,CAAC,QAAQ;mBACN,OAAO,CAAC,gBAAgB,CAAC;MAElC;CAEH"}
package/dist/client.js CHANGED
@@ -1,5 +1,6 @@
1
1
  import { OpsHttpClient } from './http/http-client.js';
2
2
  import { JwtSessionAuth } from './http/auth-strategy.js';
3
+ import { loadCredentials } from './config/loaders.js';
3
4
  import * as authOps from './operations/auth.js';
4
5
  import * as projectOps from './operations/projects.js';
5
6
  import * as runOps from './operations/runs.js';
@@ -27,7 +28,22 @@ import * as taxonomyOps from './operations/taxonomy.js';
27
28
  export class OpsClient {
28
29
  httpClient;
29
30
  constructor(config = {}) {
31
+ // Auto-load credentials from env vars / .env / ~/.uluops/credentials.json
32
+ // if no explicit auth was provided in config
33
+ const hasExplicitAuth = config.apiKey || config.sessionToken || (config.email && config.password);
34
+ if (!hasExplicitAuth) {
35
+ const creds = loadCredentials();
36
+ if (creds.apiKey)
37
+ config = { ...config, apiKey: creds.apiKey };
38
+ else if (creds.sessionToken)
39
+ config = { ...config, sessionToken: creds.sessionToken };
40
+ else if (creds.email && creds.password)
41
+ config = { ...config, email: creds.email, password: creds.password };
42
+ }
30
43
  this.httpClient = new OpsHttpClient(config);
44
+ if (config.debug && !this.isAuthenticated() && !(config.email && config.password)) {
45
+ console.warn('[ops-sdk] No credentials found — call client.login() or set ULUOPS_API_KEY before making API requests.');
46
+ }
31
47
  }
32
48
  // ============================================
33
49
  // SESSION MANAGEMENT
@@ -81,6 +97,7 @@ export class OpsClient {
81
97
  getMe: () => authOps.getMe(this.httpClient),
82
98
  getProfile: () => authOps.getProfile(this.httpClient),
83
99
  updateProfile: (input) => authOps.updateProfile(this.httpClient, input),
100
+ getAvatar: () => authOps.getAvatar(this.httpClient),
84
101
  deleteAvatar: () => authOps.deleteAvatar(this.httpClient),
85
102
  listApiKeys: () => authOps.listApiKeys(this.httpClient),
86
103
  createApiKey: (input) => authOps.createApiKey(this.httpClient, input),
@@ -144,8 +161,6 @@ export class OpsClient {
144
161
  getHistory: (issueId) => issueOps.getHistory(this.httpClient, issueId),
145
162
  updateStatus: (issueId, input) => issueOps.updateStatus(this.httpClient, issueId, input),
146
163
  update: (issueId, input) => issueOps.update(this.httpClient, issueId, input),
147
- /** @deprecated Use update instead */
148
- edit: (issueId, input) => issueOps.update(this.httpClient, issueId, input),
149
164
  addNote: (issueId, input) => issueOps.addNote(this.httpClient, issueId, input),
150
165
  restore: (issueId) => issueOps.restore(this.httpClient, issueId),
151
166
  undoLastChange: (issueId) => issueOps.undoLastChange(this.httpClient, issueId),
@@ -175,15 +190,6 @@ export class OpsClient {
175
190
  */
176
191
  getByMetric: (metric, query) => analyticsOps.getByMetric(this.httpClient, metric, query),
177
192
  listAgents: (query) => analyticsOps.listAgents(this.httpClient, query),
178
- // Backwards-compatible aliases
179
- /** @deprecated Use getAgentPerformance instead */
180
- getValidatorPerformance: (query) => analyticsOps.getAgentPerformance(this.httpClient, query),
181
- /** @deprecated Use getAgentReliability instead */
182
- getValidatorReliability: (query) => analyticsOps.getAgentReliability(this.httpClient, query),
183
- /** @deprecated Use getAgentMatrix instead */
184
- getValidatorMatrix: (query) => analyticsOps.getAgentMatrix(this.httpClient, query),
185
- /** @deprecated Use listAgents instead */
186
- listValidators: (query) => analyticsOps.listAgents(this.httpClient, query),
187
193
  };
188
194
  // ============================================
189
195
  // TAXONOMY OPERATIONS