@naturali/cli 0.67.0 → 0.68.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/dist/index.mjs +1229 -20
  2. package/package.json +2 -2
package/dist/index.mjs CHANGED
@@ -14,7 +14,7 @@ var __exportAll = (all, no_symbols) => {
14
14
  };
15
15
  //#endregion
16
16
  //#region package.json
17
- var version = "0.67.0";
17
+ var version = "0.68.0";
18
18
  //#endregion
19
19
  //#region ../sdk/src/generated/core/bodySerializer.gen.ts
20
20
  const jsonBodySerializer = { bodySerializer: (body) => JSON.stringify(body, (_key, value) => typeof value === "bigint" ? value.toString() : value) };
@@ -1676,6 +1676,282 @@ var Conversations = class {
1676
1676
  });
1677
1677
  }
1678
1678
  };
1679
+ var Evaluations = class {
1680
+ /**
1681
+ * List datasets
1682
+ *
1683
+ * Returns the datasets defined in a project
1684
+ */
1685
+ static listDatasets(options) {
1686
+ return (options.client ?? client).get({
1687
+ url: "/v1/projects/{project_id}/datasets",
1688
+ ...options
1689
+ });
1690
+ }
1691
+ /**
1692
+ * Create a dataset
1693
+ *
1694
+ * Creates a project-scoped dataset — a named collection of test cases an eval runs an agent against. Names are unique per project.
1695
+ *
1696
+ * Datasets are operator-owned **fixtures**. The platform's content purge never deletes or mutates a dataset item, so erasing a generation cannot silently stop a test suite from being runnable.
1697
+ */
1698
+ static createDataset(options) {
1699
+ return (options.client ?? client).post({
1700
+ url: "/v1/projects/{project_id}/datasets",
1701
+ ...options,
1702
+ headers: {
1703
+ "Content-Type": "application/json",
1704
+ ...options.headers
1705
+ }
1706
+ });
1707
+ }
1708
+ /**
1709
+ * Delete a dataset
1710
+ *
1711
+ * Deletes a dataset, its items, and every eval bound to it. Results of runs that already scored those items keep their frozen copies of the input and expected output.
1712
+ */
1713
+ static deleteDataset(options) {
1714
+ return (options.client ?? client).delete({
1715
+ url: "/v1/projects/{project_id}/datasets/{dataset_id}",
1716
+ ...options
1717
+ });
1718
+ }
1719
+ /**
1720
+ * Get a dataset
1721
+ *
1722
+ * Returns a specific dataset
1723
+ */
1724
+ static getDataset(options) {
1725
+ return (options.client ?? client).get({
1726
+ url: "/v1/projects/{project_id}/datasets/{dataset_id}",
1727
+ ...options
1728
+ });
1729
+ }
1730
+ /**
1731
+ * Update a dataset
1732
+ *
1733
+ * Updates a dataset's name and/or description
1734
+ */
1735
+ static updateDataset(options) {
1736
+ return (options.client ?? client).put({
1737
+ url: "/v1/projects/{project_id}/datasets/{dataset_id}",
1738
+ ...options,
1739
+ headers: {
1740
+ "Content-Type": "application/json",
1741
+ ...options.headers
1742
+ }
1743
+ });
1744
+ }
1745
+ /**
1746
+ * List dataset items
1747
+ *
1748
+ * Returns the test cases in a dataset, oldest first
1749
+ */
1750
+ static listDatasetItems(options) {
1751
+ return (options.client ?? client).get({
1752
+ url: "/v1/projects/{project_id}/datasets/{dataset_id}/items",
1753
+ ...options
1754
+ });
1755
+ }
1756
+ /**
1757
+ * Add a dataset item
1758
+ *
1759
+ * Adds one test case. `input` is replayed verbatim as the generation's messages, so it must be a non-empty array of `{ role, content }`.
1760
+ */
1761
+ static createDatasetItem(options) {
1762
+ return (options.client ?? client).post({
1763
+ url: "/v1/projects/{project_id}/datasets/{dataset_id}/items",
1764
+ ...options,
1765
+ headers: {
1766
+ "Content-Type": "application/json",
1767
+ ...options.headers
1768
+ }
1769
+ });
1770
+ }
1771
+ /**
1772
+ * Curate a dataset item from a generation
1773
+ *
1774
+ * Promotes a real, completed generation into a test case: its input messages become the item's `input`, and its own answer becomes `expected_output` unless you supply one. Use it to build an evaluation set out of production traffic rather than hand-authoring fixtures.
1775
+ *
1776
+ * The item is a **copy**, not a view. It keeps working after the source generation's content is purged, and `source_generation_id` goes null if that generation is deleted — a purge can never quietly stop a suite from being runnable.
1777
+ *
1778
+ * Requires both `evaluations:CreateDataset` and `generations:GetGeneration`: the call copies content out of a generation, so a principal that may not read that generation may not curate it either.
1779
+ *
1780
+ * Only a **completed** generation can be promoted (`409 GENERATION_NOT_COMPLETED`), and only while its content is still available: an agent or project running with `trace_content_mode: none` never stored the input, and a purged or expired generation no longer has it (`409 GENERATION_CONTENT_UNAVAILABLE`). Generations that predate input recording answer the same way.
1781
+ */
1782
+ static createDatasetItemFromGeneration(options) {
1783
+ return (options.client ?? client).post({
1784
+ url: "/v1/projects/{project_id}/datasets/{dataset_id}/items/from-generation",
1785
+ ...options,
1786
+ headers: {
1787
+ "Content-Type": "application/json",
1788
+ ...options.headers
1789
+ }
1790
+ });
1791
+ }
1792
+ /**
1793
+ * Delete a dataset item
1794
+ *
1795
+ * Deletes a test case. Results of runs that already scored it stay readable; their `dataset_item_id` becomes null.
1796
+ */
1797
+ static deleteDatasetItem(options) {
1798
+ return (options.client ?? client).delete({
1799
+ url: "/v1/projects/{project_id}/datasets/{dataset_id}/items/{item_id}",
1800
+ ...options
1801
+ });
1802
+ }
1803
+ /**
1804
+ * Update a dataset item
1805
+ *
1806
+ * Updates a test case. Runs that already scored it are unaffected — each result carries its own frozen copy of the input and expected output.
1807
+ */
1808
+ static updateDatasetItem(options) {
1809
+ return (options.client ?? client).put({
1810
+ url: "/v1/projects/{project_id}/datasets/{dataset_id}/items/{item_id}",
1811
+ ...options,
1812
+ headers: {
1813
+ "Content-Type": "application/json",
1814
+ ...options.headers
1815
+ }
1816
+ });
1817
+ }
1818
+ /**
1819
+ * List evals
1820
+ *
1821
+ * Returns the evals defined in a project
1822
+ */
1823
+ static listEvals(options) {
1824
+ return (options.client ?? client).get({
1825
+ url: "/v1/projects/{project_id}/evals",
1826
+ ...options
1827
+ });
1828
+ }
1829
+ /**
1830
+ * Create an eval
1831
+ *
1832
+ * Binds an agent under test to a dataset and a list of scorers. The agent and the dataset must belong to the same project as the eval; a cross-project reference is rejected with 400.
1833
+ *
1834
+ * Scorer config is frozen here rather than read from the agent at run time, so two runs of the same eval are always judged by the same criteria and their comparison measures the agent instead of the config drifting underneath it. Each scorer `type` may appear at most once.
1835
+ */
1836
+ static createEval(options) {
1837
+ return (options.client ?? client).post({
1838
+ url: "/v1/projects/{project_id}/evals",
1839
+ ...options,
1840
+ headers: {
1841
+ "Content-Type": "application/json",
1842
+ ...options.headers
1843
+ }
1844
+ });
1845
+ }
1846
+ /**
1847
+ * Delete an eval
1848
+ *
1849
+ * Deletes an eval, its runs, and their results
1850
+ */
1851
+ static deleteEval(options) {
1852
+ return (options.client ?? client).delete({
1853
+ url: "/v1/projects/{project_id}/evals/{eval_id}",
1854
+ ...options
1855
+ });
1856
+ }
1857
+ /**
1858
+ * Get an eval
1859
+ *
1860
+ * Returns a specific eval
1861
+ */
1862
+ static getEval(options) {
1863
+ return (options.client ?? client).get({
1864
+ url: "/v1/projects/{project_id}/evals/{eval_id}",
1865
+ ...options
1866
+ });
1867
+ }
1868
+ /**
1869
+ * Update an eval
1870
+ *
1871
+ * Updates an eval. Changing `agent_id` re-validates the scorers against the new agent, since an `output_schema` scorer that was legal against the old one may not be.
1872
+ */
1873
+ static updateEval(options) {
1874
+ return (options.client ?? client).put({
1875
+ url: "/v1/projects/{project_id}/evals/{eval_id}",
1876
+ ...options,
1877
+ headers: {
1878
+ "Content-Type": "application/json",
1879
+ ...options.headers
1880
+ }
1881
+ });
1882
+ }
1883
+ /**
1884
+ * List eval runs
1885
+ *
1886
+ * Returns an eval's runs, newest first
1887
+ */
1888
+ static listEvalRuns(options) {
1889
+ return (options.client ?? client).get({
1890
+ url: "/v1/projects/{project_id}/evals/{eval_id}/runs",
1891
+ ...options
1892
+ });
1893
+ }
1894
+ /**
1895
+ * Start an eval run
1896
+ *
1897
+ * Runs the eval against its dataset, creating one real agent generation per item and scoring the outputs.
1898
+ *
1899
+ * `wait: true` executes the run synchronously and returns it terminal, with its scores. The dataset is capped at 25 items for a synchronous run; a larger one is rejected with 400 rather than partially scored.
1900
+ *
1901
+ * `wait: false` (the default) enqueues one task per item and returns immediately with `status: "queued"`. A worker executes the items and the run settles itself; poll `GET /evals/{eval_id}/runs/{eval_run_id}` for the terminal status. There is no item cap on a queued run.
1902
+ *
1903
+ * The whole run is pinned to **one** agent version, stamped on `agent_version`: pass one explicitly to evaluate a canary before promoting it, or omit it to use the active release's stable version (or the live draft when no release is in effect). Without the pin, release assignment would bucket each item independently and blend two configs into a single score.
1904
+ *
1905
+ * With `baseline_run_id`, the finished run's `aggregate_scores.baseline` carries per-scorer deltas against that run, computed over the items present and scorable in **both** runs, with the divergence counted. A delta over a shifted dataset is therefore never presented as a clean comparison.
1906
+ */
1907
+ static startEvalRun(options) {
1908
+ return (options.client ?? client).post({
1909
+ url: "/v1/projects/{project_id}/evals/{eval_id}/runs",
1910
+ ...options,
1911
+ headers: {
1912
+ "Content-Type": "application/json",
1913
+ ...options.headers
1914
+ }
1915
+ });
1916
+ }
1917
+ /**
1918
+ * Get an eval run
1919
+ *
1920
+ * Returns a run's status, counts, and aggregate scores
1921
+ */
1922
+ static getEvalRun(options) {
1923
+ return (options.client ?? client).get({
1924
+ url: "/v1/projects/{project_id}/evals/{eval_id}/runs/{eval_run_id}",
1925
+ ...options
1926
+ });
1927
+ }
1928
+ /**
1929
+ * List eval run results
1930
+ *
1931
+ * Returns the per-item results of a run, oldest first
1932
+ */
1933
+ static listEvalResults(options) {
1934
+ return (options.client ?? client).get({
1935
+ url: "/v1/projects/{project_id}/evals/{eval_id}/runs/{eval_run_id}/results",
1936
+ ...options
1937
+ });
1938
+ }
1939
+ /**
1940
+ * Cancel an eval run
1941
+ *
1942
+ * Cancels a queued or running run: its outstanding item tasks are dropped so it stops consuming provider budget, and the run settles as `canceled`.
1943
+ *
1944
+ * Results already written are kept — they are real measurements of generations that were really paid for — and `completed_count` / `errored_count` report what ran. `aggregate_scores` is deliberately left null: a partial roll-up in the same field a completed run uses would read as a whole-dataset verdict.
1945
+ *
1946
+ * A run that has already finished is rejected with 400.
1947
+ */
1948
+ static cancelEvalRun(options) {
1949
+ return (options.client ?? client).post({
1950
+ url: "/v1/projects/{project_id}/evals/{eval_id}/runs/{eval_run_id}/cancel",
1951
+ ...options
1952
+ });
1953
+ }
1954
+ };
1679
1955
  var Generations = class {
1680
1956
  /**
1681
1957
  * List generations
@@ -2253,6 +2529,58 @@ var Tools = class {
2253
2529
  });
2254
2530
  }
2255
2531
  };
2532
+ var Traces = class {
2533
+ /**
2534
+ * List traces
2535
+ *
2536
+ * Returns a paginated list of execution traces for the project.
2537
+ */
2538
+ static listTraces(options) {
2539
+ return (options.client ?? client).get({
2540
+ url: "/v1/projects/{project_id}/traces",
2541
+ ...options
2542
+ });
2543
+ }
2544
+ /**
2545
+ * Get a trace
2546
+ *
2547
+ * Returns a single trace by ID.
2548
+ */
2549
+ static getTrace(options) {
2550
+ return (options.client ?? client).get({
2551
+ url: "/v1/projects/{project_id}/traces/{trace_id}",
2552
+ ...options
2553
+ });
2554
+ }
2555
+ /**
2556
+ * Get trace tree
2557
+ *
2558
+ * Returns the full execution tree rooted at the given trace (or its root if the given trace is a child). Each node represents one agent's execution session. The `children` array contains traces triggered by sub-agent tool calls from that trace.
2559
+ *
2560
+ */
2561
+ static getTraceTree(options) {
2562
+ return (options.client ?? client).get({
2563
+ url: "/v1/projects/{project_id}/traces/{trace_id}/tree",
2564
+ ...options
2565
+ });
2566
+ }
2567
+ /**
2568
+ * Purge trace content
2569
+ *
2570
+ * Deletes the trace's steps object from storage and clears its content columns (`file_id`, `error`), cascading to every descendant trace and to all of their generations. A descendant holds its own steps object covering the same run, so the cascade is what makes the erasure complete rather than merely partial.
2571
+ *
2572
+ * The rows survive as auditable skeletons with `content_redacted_at` set — ids, timestamps, step counts, and the generations' usage-attribution fields are preserved, because the billing and audit ledger must outlive a tenant's erasure of the content. A purged trace therefore reads back as a skeleton, not a 404: a 404 would prove nothing.
2573
+ *
2574
+ * Idempotent — purging an already-purged trace succeeds and leaves the original `content_redacted_at` in place.
2575
+ *
2576
+ */
2577
+ static purgeTraceContent(options) {
2578
+ return (options.client ?? client).delete({
2579
+ url: "/v1/projects/{project_id}/traces/{trace_id}/content",
2580
+ ...options
2581
+ });
2582
+ }
2583
+ };
2256
2584
  var Users = class {
2257
2585
  /**
2258
2586
  * Get the current user
@@ -2458,12 +2786,14 @@ var NaturaliClient = class {
2458
2786
  channels;
2459
2787
  auth;
2460
2788
  conversations;
2789
+ evaluations;
2461
2790
  generations;
2462
2791
  modelRoutes;
2463
2792
  projects;
2464
2793
  secrets;
2465
2794
  sessions;
2466
2795
  tools;
2796
+ traces;
2467
2797
  users;
2468
2798
  webhooks;
2469
2799
  /** The underlying HTTP client, for interceptors or one-off requests. */
@@ -2485,12 +2815,14 @@ var NaturaliClient = class {
2485
2815
  this.channels = bindResource(Channels, this.http);
2486
2816
  this.auth = bindResource(Auth, this.http);
2487
2817
  this.conversations = bindResource(Conversations, this.http);
2818
+ this.evaluations = bindResource(Evaluations, this.http);
2488
2819
  this.generations = bindResource(Generations, this.http);
2489
2820
  this.modelRoutes = bindResource(ModelRoutes, this.http);
2490
2821
  this.projects = bindResource(Projects, this.http);
2491
2822
  this.secrets = bindResource(Secrets, this.http);
2492
2823
  this.sessions = bindResource(Sessions, this.http);
2493
2824
  this.tools = bindResource(Tools, this.http);
2825
+ this.traces = bindResource(Traces, this.http);
2494
2826
  this.users = bindResource(Users, this.http);
2495
2827
  this.webhooks = bindResource(Webhooks, this.http);
2496
2828
  }
@@ -2507,6 +2839,7 @@ var src_exports = /* @__PURE__ */ __exportAll({
2507
2839
  Auth: () => Auth,
2508
2840
  Channels: () => Channels,
2509
2841
  Conversations: () => Conversations,
2842
+ Evaluations: () => Evaluations,
2510
2843
  Generations: () => Generations,
2511
2844
  ModelRoutes: () => ModelRoutes,
2512
2845
  NaturaliClient: () => NaturaliClient,
@@ -2514,6 +2847,7 @@ var src_exports = /* @__PURE__ */ __exportAll({
2514
2847
  Secrets: () => Secrets,
2515
2848
  Sessions: () => Sessions,
2516
2849
  Tools: () => Tools,
2850
+ Traces: () => Traces,
2517
2851
  Users: () => Users,
2518
2852
  Webhooks: () => Webhooks,
2519
2853
  createClient: () => createClient,
@@ -6064,21 +6398,14 @@ const routes = {
6064
6398
  "in": "path"
6065
6399
  }]
6066
6400
  },
6067
- "list-generations": {
6068
- serviceClass: "Generations",
6069
- operationId: "listGenerations",
6070
- description: "Returns generations the caller can access, optionally filtered by agent, trace, and status. Replaces the former per-trace generations endpoint (use the trace_id query filter).",
6071
- moduleDocsUrl: "https://docs.naturali.ai/docs/modules/generations",
6401
+ "list-datasets": {
6402
+ serviceClass: "Evaluations",
6403
+ operationId: "listDatasets",
6404
+ description: "Returns the datasets defined in a project",
6405
+ moduleDocsUrl: "https://docs.naturali.ai/docs/modules/evaluations",
6072
6406
  httpMethod: "get",
6073
6407
  pathParams: ["project_id"],
6074
- queryParams: [
6075
- "agent_id",
6076
- "trace_id",
6077
- "initiator_generation_id",
6078
- "status",
6079
- "limit",
6080
- "offset"
6081
- ],
6408
+ queryParams: ["limit", "offset"],
6082
6409
  flags: [
6083
6410
  {
6084
6411
  "name": "project_id",
@@ -6088,17 +6415,791 @@ const routes = {
6088
6415
  "in": "path"
6089
6416
  },
6090
6417
  {
6091
- "name": "agent_id",
6092
- "description": "Filter by agent public ID",
6418
+ "name": "limit",
6419
+ "description": "Maximum number of results to return",
6093
6420
  "required": false,
6094
- "type": "string",
6421
+ "type": "integer",
6095
6422
  "in": "query"
6096
6423
  },
6097
6424
  {
6098
- "name": "trace_id",
6099
- "description": "Filter by trace public ID",
6425
+ "name": "offset",
6426
+ "description": "Number of results to skip",
6100
6427
  "required": false,
6101
- "type": "string",
6428
+ "type": "integer",
6429
+ "in": "query"
6430
+ }
6431
+ ]
6432
+ },
6433
+ "create-dataset": {
6434
+ serviceClass: "Evaluations",
6435
+ operationId: "createDataset",
6436
+ description: "Creates a project-scoped dataset — a named collection of test cases an eval runs an agent against. Names are unique per project. Datasets are operator-owned **fixtures**. The platform's content purge never deletes or mutates a dataset item, so erasing a generation cannot silently stop a test suite from being runnable.",
6437
+ moduleDocsUrl: "https://docs.naturali.ai/docs/modules/evaluations",
6438
+ httpMethod: "post",
6439
+ pathParams: ["project_id"],
6440
+ queryParams: [],
6441
+ flags: [
6442
+ {
6443
+ "name": "project_id",
6444
+ "description": "Project public ID (proj_ prefix).",
6445
+ "required": true,
6446
+ "type": "string",
6447
+ "in": "path"
6448
+ },
6449
+ {
6450
+ "name": "name",
6451
+ "description": "Unique name within the project",
6452
+ "required": true,
6453
+ "type": "string",
6454
+ "in": "body"
6455
+ },
6456
+ {
6457
+ "name": "description",
6458
+ "description": "What this suite covers",
6459
+ "required": false,
6460
+ "type": "string",
6461
+ "in": "body"
6462
+ }
6463
+ ]
6464
+ },
6465
+ "get-dataset": {
6466
+ serviceClass: "Evaluations",
6467
+ operationId: "getDataset",
6468
+ description: "Returns a specific dataset",
6469
+ moduleDocsUrl: "https://docs.naturali.ai/docs/modules/evaluations",
6470
+ httpMethod: "get",
6471
+ pathParams: ["project_id", "dataset_id"],
6472
+ queryParams: [],
6473
+ flags: [{
6474
+ "name": "project_id",
6475
+ "description": "Project public ID (proj_ prefix).",
6476
+ "required": true,
6477
+ "type": "string",
6478
+ "in": "path"
6479
+ }, {
6480
+ "name": "dataset_id",
6481
+ "description": "Dataset ID",
6482
+ "required": true,
6483
+ "type": "string",
6484
+ "in": "path"
6485
+ }]
6486
+ },
6487
+ "update-dataset": {
6488
+ serviceClass: "Evaluations",
6489
+ operationId: "updateDataset",
6490
+ description: "Updates a dataset's name and/or description",
6491
+ moduleDocsUrl: "https://docs.naturali.ai/docs/modules/evaluations",
6492
+ httpMethod: "put",
6493
+ pathParams: ["project_id", "dataset_id"],
6494
+ queryParams: [],
6495
+ flags: [
6496
+ {
6497
+ "name": "project_id",
6498
+ "description": "Project public ID (proj_ prefix).",
6499
+ "required": true,
6500
+ "type": "string",
6501
+ "in": "path"
6502
+ },
6503
+ {
6504
+ "name": "dataset_id",
6505
+ "description": "Dataset ID",
6506
+ "required": true,
6507
+ "type": "string",
6508
+ "in": "path"
6509
+ },
6510
+ {
6511
+ "name": "name",
6512
+ "description": "",
6513
+ "required": false,
6514
+ "type": "string",
6515
+ "in": "body"
6516
+ },
6517
+ {
6518
+ "name": "description",
6519
+ "description": "",
6520
+ "required": false,
6521
+ "type": "string",
6522
+ "in": "body"
6523
+ }
6524
+ ]
6525
+ },
6526
+ "delete-dataset": {
6527
+ serviceClass: "Evaluations",
6528
+ operationId: "deleteDataset",
6529
+ description: "Deletes a dataset, its items, and every eval bound to it. Results of runs that already scored those items keep their frozen copies of the input and expected output.",
6530
+ moduleDocsUrl: "https://docs.naturali.ai/docs/modules/evaluations",
6531
+ httpMethod: "delete",
6532
+ pathParams: ["project_id", "dataset_id"],
6533
+ queryParams: [],
6534
+ flags: [{
6535
+ "name": "project_id",
6536
+ "description": "Project public ID (proj_ prefix).",
6537
+ "required": true,
6538
+ "type": "string",
6539
+ "in": "path"
6540
+ }, {
6541
+ "name": "dataset_id",
6542
+ "description": "Dataset ID",
6543
+ "required": true,
6544
+ "type": "string",
6545
+ "in": "path"
6546
+ }]
6547
+ },
6548
+ "list-dataset-items": {
6549
+ serviceClass: "Evaluations",
6550
+ operationId: "listDatasetItems",
6551
+ description: "Returns the test cases in a dataset, oldest first",
6552
+ moduleDocsUrl: "https://docs.naturali.ai/docs/modules/evaluations",
6553
+ httpMethod: "get",
6554
+ pathParams: ["project_id", "dataset_id"],
6555
+ queryParams: ["limit", "offset"],
6556
+ flags: [
6557
+ {
6558
+ "name": "project_id",
6559
+ "description": "Project public ID (proj_ prefix).",
6560
+ "required": true,
6561
+ "type": "string",
6562
+ "in": "path"
6563
+ },
6564
+ {
6565
+ "name": "dataset_id",
6566
+ "description": "Dataset ID",
6567
+ "required": true,
6568
+ "type": "string",
6569
+ "in": "path"
6570
+ },
6571
+ {
6572
+ "name": "limit",
6573
+ "description": "Maximum number of results to return",
6574
+ "required": false,
6575
+ "type": "integer",
6576
+ "in": "query"
6577
+ },
6578
+ {
6579
+ "name": "offset",
6580
+ "description": "Number of results to skip",
6581
+ "required": false,
6582
+ "type": "integer",
6583
+ "in": "query"
6584
+ }
6585
+ ]
6586
+ },
6587
+ "create-dataset-item": {
6588
+ serviceClass: "Evaluations",
6589
+ operationId: "createDatasetItem",
6590
+ description: "Adds one test case. `input` is replayed verbatim as the generation's messages, so it must be a non-empty array of `{ role, content }`.",
6591
+ moduleDocsUrl: "https://docs.naturali.ai/docs/modules/evaluations",
6592
+ httpMethod: "post",
6593
+ pathParams: ["project_id", "dataset_id"],
6594
+ queryParams: [],
6595
+ flags: [
6596
+ {
6597
+ "name": "project_id",
6598
+ "description": "Project public ID (proj_ prefix).",
6599
+ "required": true,
6600
+ "type": "string",
6601
+ "in": "path"
6602
+ },
6603
+ {
6604
+ "name": "dataset_id",
6605
+ "description": "Dataset ID",
6606
+ "required": true,
6607
+ "type": "string",
6608
+ "in": "path"
6609
+ },
6610
+ {
6611
+ "name": "input",
6612
+ "description": "Messages replayed verbatim as the generation's input",
6613
+ "required": true,
6614
+ "type": "array",
6615
+ "in": "body"
6616
+ },
6617
+ {
6618
+ "name": "expected_output",
6619
+ "description": "Reference answer for exact_match / llm_judge scorers",
6620
+ "required": false,
6621
+ "type": "string",
6622
+ "in": "body"
6623
+ },
6624
+ {
6625
+ "name": "metadata",
6626
+ "description": "Free-form tags, opaque to the platform",
6627
+ "required": false,
6628
+ "type": "object",
6629
+ "in": "body"
6630
+ }
6631
+ ]
6632
+ },
6633
+ "create-dataset-item-from-generation": {
6634
+ serviceClass: "Evaluations",
6635
+ operationId: "createDatasetItemFromGeneration",
6636
+ description: "Promotes a real, completed generation into a test case: its input messages become the item's `input`, and its own answer becomes `expected_output` unless you supply one. Use it to build an evaluation set out of production traffic rather than hand-authoring fixtures. The item is a **copy**, not a view. It keeps working after the source generation's content is purged, and `source_generation_id` goes null if that generation is deleted — a purge can never quietly stop a suite from being runnable. Requires both `evaluations:CreateDataset` and `generations:GetGeneration`: the call copies content out of a generation, so a principal that may not read that generation may not curate it either. Only a **completed** generation can be promoted (`409 GENERATION_NOT_COMPLETED`), and only while its content is still available: an agent or project running with `trace_content_mode: none` never stored the input, and a purged or expired generation no longer has it (`409 GENERATION_CONTENT_UNAVAILABLE`). Generations that predate input recording answer the same way.",
6637
+ moduleDocsUrl: "https://docs.naturali.ai/docs/modules/evaluations",
6638
+ httpMethod: "post",
6639
+ pathParams: ["project_id", "dataset_id"],
6640
+ queryParams: [],
6641
+ flags: [
6642
+ {
6643
+ "name": "project_id",
6644
+ "description": "Project public ID (proj_ prefix).",
6645
+ "required": true,
6646
+ "type": "string",
6647
+ "in": "path"
6648
+ },
6649
+ {
6650
+ "name": "dataset_id",
6651
+ "description": "Dataset ID",
6652
+ "required": true,
6653
+ "type": "string",
6654
+ "in": "path"
6655
+ },
6656
+ {
6657
+ "name": "generation_id",
6658
+ "description": "The completed generation to promote. Must belong to the same project as the dataset.",
6659
+ "required": true,
6660
+ "type": "string",
6661
+ "in": "body"
6662
+ },
6663
+ {
6664
+ "name": "expected_output",
6665
+ "description": "Reference answer. Omit to use the generation's own answer; pass `null` to store the item with no reference answer.",
6666
+ "required": false,
6667
+ "type": "string",
6668
+ "in": "body"
6669
+ },
6670
+ {
6671
+ "name": "metadata",
6672
+ "description": "Free-form tags, opaque to the platform",
6673
+ "required": false,
6674
+ "type": "object",
6675
+ "in": "body"
6676
+ }
6677
+ ]
6678
+ },
6679
+ "update-dataset-item": {
6680
+ serviceClass: "Evaluations",
6681
+ operationId: "updateDatasetItem",
6682
+ description: "Updates a test case. Runs that already scored it are unaffected — each result carries its own frozen copy of the input and expected output.",
6683
+ moduleDocsUrl: "https://docs.naturali.ai/docs/modules/evaluations",
6684
+ httpMethod: "put",
6685
+ pathParams: [
6686
+ "project_id",
6687
+ "dataset_id",
6688
+ "item_id"
6689
+ ],
6690
+ queryParams: [],
6691
+ flags: [
6692
+ {
6693
+ "name": "project_id",
6694
+ "description": "Project public ID (proj_ prefix).",
6695
+ "required": true,
6696
+ "type": "string",
6697
+ "in": "path"
6698
+ },
6699
+ {
6700
+ "name": "dataset_id",
6701
+ "description": "Dataset ID",
6702
+ "required": true,
6703
+ "type": "string",
6704
+ "in": "path"
6705
+ },
6706
+ {
6707
+ "name": "item_id",
6708
+ "description": "Dataset item ID",
6709
+ "required": true,
6710
+ "type": "string",
6711
+ "in": "path"
6712
+ },
6713
+ {
6714
+ "name": "input",
6715
+ "description": "Messages replayed verbatim as the generation's input",
6716
+ "required": false,
6717
+ "type": "array",
6718
+ "in": "body"
6719
+ },
6720
+ {
6721
+ "name": "expected_output",
6722
+ "description": "",
6723
+ "required": false,
6724
+ "type": "string",
6725
+ "in": "body"
6726
+ },
6727
+ {
6728
+ "name": "metadata",
6729
+ "description": "",
6730
+ "required": false,
6731
+ "type": "object",
6732
+ "in": "body"
6733
+ }
6734
+ ]
6735
+ },
6736
+ "delete-dataset-item": {
6737
+ serviceClass: "Evaluations",
6738
+ operationId: "deleteDatasetItem",
6739
+ description: "Deletes a test case. Results of runs that already scored it stay readable; their `dataset_item_id` becomes null.",
6740
+ moduleDocsUrl: "https://docs.naturali.ai/docs/modules/evaluations",
6741
+ httpMethod: "delete",
6742
+ pathParams: [
6743
+ "project_id",
6744
+ "dataset_id",
6745
+ "item_id"
6746
+ ],
6747
+ queryParams: [],
6748
+ flags: [
6749
+ {
6750
+ "name": "project_id",
6751
+ "description": "Project public ID (proj_ prefix).",
6752
+ "required": true,
6753
+ "type": "string",
6754
+ "in": "path"
6755
+ },
6756
+ {
6757
+ "name": "dataset_id",
6758
+ "description": "Dataset ID",
6759
+ "required": true,
6760
+ "type": "string",
6761
+ "in": "path"
6762
+ },
6763
+ {
6764
+ "name": "item_id",
6765
+ "description": "Dataset item ID",
6766
+ "required": true,
6767
+ "type": "string",
6768
+ "in": "path"
6769
+ }
6770
+ ]
6771
+ },
6772
+ "list-evals": {
6773
+ serviceClass: "Evaluations",
6774
+ operationId: "listEvals",
6775
+ description: "Returns the evals defined in a project",
6776
+ moduleDocsUrl: "https://docs.naturali.ai/docs/modules/evaluations",
6777
+ httpMethod: "get",
6778
+ pathParams: ["project_id"],
6779
+ queryParams: ["limit", "offset"],
6780
+ flags: [
6781
+ {
6782
+ "name": "project_id",
6783
+ "description": "Project public ID (proj_ prefix).",
6784
+ "required": true,
6785
+ "type": "string",
6786
+ "in": "path"
6787
+ },
6788
+ {
6789
+ "name": "limit",
6790
+ "description": "Maximum number of results to return",
6791
+ "required": false,
6792
+ "type": "integer",
6793
+ "in": "query"
6794
+ },
6795
+ {
6796
+ "name": "offset",
6797
+ "description": "Number of results to skip",
6798
+ "required": false,
6799
+ "type": "integer",
6800
+ "in": "query"
6801
+ }
6802
+ ]
6803
+ },
6804
+ "create-eval": {
6805
+ serviceClass: "Evaluations",
6806
+ operationId: "createEval",
6807
+ description: "Binds an agent under test to a dataset and a list of scorers. The agent and the dataset must belong to the same project as the eval; a cross-project reference is rejected with 400. Scorer config is frozen here rather than read from the agent at run time, so two runs of the same eval are always judged by the same criteria and their comparison measures the agent instead of the config drifting underneath it. Each scorer `type` may appear at most once.",
6808
+ moduleDocsUrl: "https://docs.naturali.ai/docs/modules/evaluations",
6809
+ httpMethod: "post",
6810
+ pathParams: ["project_id"],
6811
+ queryParams: [],
6812
+ flags: [
6813
+ {
6814
+ "name": "project_id",
6815
+ "description": "Project public ID (proj_ prefix).",
6816
+ "required": true,
6817
+ "type": "string",
6818
+ "in": "path"
6819
+ },
6820
+ {
6821
+ "name": "name",
6822
+ "description": "Unique name within the project",
6823
+ "required": true,
6824
+ "type": "string",
6825
+ "in": "body"
6826
+ },
6827
+ {
6828
+ "name": "agent_id",
6829
+ "description": "The agent under test",
6830
+ "required": true,
6831
+ "type": "string",
6832
+ "in": "body"
6833
+ },
6834
+ {
6835
+ "name": "dataset_id",
6836
+ "description": "The dataset to run it against",
6837
+ "required": true,
6838
+ "type": "string",
6839
+ "in": "body"
6840
+ },
6841
+ {
6842
+ "name": "scorers",
6843
+ "description": "Scorer configs, a discriminated union on `type`. Each type may appear at most once. Every scorer produces `{ score: 0–1, passed: boolean }`; binary scorers emit 0 or 1.\n\n`exact_match` compares the trimmed output text to `expected_output`. `contains` looks for `value` in the output text. `json_logic` evaluates `expression` over `{ input, output, object, expected, item.metadata }`, where `object` is the structured output (absent when the agent has no `output_schema`). `output_schema` validates the structured output against the scorer's own `schema`, falling back to the agent's; it requires the agent to carry an `output_schema`, because without one the platform emits no structured output and every item would score 0.\n\n`llm_judge` grades the output with a model completion, returning a continuous score plus its `reasoning`. Its `pass_threshold` is required: a continuous score says nothing about where \"good enough\" is, and a defaulted cutoff would silently decide the gate.\n\n`tool` runs a custom scoring algorithm: a server-callable project tool the engine invokes once per item with the item's context. Unlike the built-in types it may appear several times, each under a distinct `name` — outcomes and aggregates key on the name.",
6844
+ "required": true,
6845
+ "type": "array",
6846
+ "in": "body"
6847
+ },
6848
+ {
6849
+ "name": "pass_threshold",
6850
+ "description": "0–1. The run passes iff its pass rate — passed items over non-errored items — is at least this. Null reports scores without gating on them.",
6851
+ "required": false,
6852
+ "type": "number",
6853
+ "in": "body"
6854
+ }
6855
+ ]
6856
+ },
6857
+ "get-eval": {
6858
+ serviceClass: "Evaluations",
6859
+ operationId: "getEval",
6860
+ description: "Returns a specific eval",
6861
+ moduleDocsUrl: "https://docs.naturali.ai/docs/modules/evaluations",
6862
+ httpMethod: "get",
6863
+ pathParams: ["project_id", "eval_id"],
6864
+ queryParams: [],
6865
+ flags: [{
6866
+ "name": "project_id",
6867
+ "description": "Project public ID (proj_ prefix).",
6868
+ "required": true,
6869
+ "type": "string",
6870
+ "in": "path"
6871
+ }, {
6872
+ "name": "eval_id",
6873
+ "description": "Eval ID",
6874
+ "required": true,
6875
+ "type": "string",
6876
+ "in": "path"
6877
+ }]
6878
+ },
6879
+ "update-eval": {
6880
+ serviceClass: "Evaluations",
6881
+ operationId: "updateEval",
6882
+ description: "Updates an eval. Changing `agent_id` re-validates the scorers against the new agent, since an `output_schema` scorer that was legal against the old one may not be.",
6883
+ moduleDocsUrl: "https://docs.naturali.ai/docs/modules/evaluations",
6884
+ httpMethod: "put",
6885
+ pathParams: ["project_id", "eval_id"],
6886
+ queryParams: [],
6887
+ flags: [
6888
+ {
6889
+ "name": "project_id",
6890
+ "description": "Project public ID (proj_ prefix).",
6891
+ "required": true,
6892
+ "type": "string",
6893
+ "in": "path"
6894
+ },
6895
+ {
6896
+ "name": "eval_id",
6897
+ "description": "Eval ID",
6898
+ "required": true,
6899
+ "type": "string",
6900
+ "in": "path"
6901
+ },
6902
+ {
6903
+ "name": "name",
6904
+ "description": "",
6905
+ "required": false,
6906
+ "type": "string",
6907
+ "in": "body"
6908
+ },
6909
+ {
6910
+ "name": "agent_id",
6911
+ "description": "",
6912
+ "required": false,
6913
+ "type": "string",
6914
+ "in": "body"
6915
+ },
6916
+ {
6917
+ "name": "dataset_id",
6918
+ "description": "",
6919
+ "required": false,
6920
+ "type": "string",
6921
+ "in": "body"
6922
+ },
6923
+ {
6924
+ "name": "scorers",
6925
+ "description": "Scorer configs, a discriminated union on `type`. Each type may appear at most once. Every scorer produces `{ score: 0–1, passed: boolean }`; binary scorers emit 0 or 1.\n\n`exact_match` compares the trimmed output text to `expected_output`. `contains` looks for `value` in the output text. `json_logic` evaluates `expression` over `{ input, output, object, expected, item.metadata }`, where `object` is the structured output (absent when the agent has no `output_schema`). `output_schema` validates the structured output against the scorer's own `schema`, falling back to the agent's; it requires the agent to carry an `output_schema`, because without one the platform emits no structured output and every item would score 0.\n\n`llm_judge` grades the output with a model completion, returning a continuous score plus its `reasoning`. Its `pass_threshold` is required: a continuous score says nothing about where \"good enough\" is, and a defaulted cutoff would silently decide the gate.\n\n`tool` runs a custom scoring algorithm: a server-callable project tool the engine invokes once per item with the item's context. Unlike the built-in types it may appear several times, each under a distinct `name` — outcomes and aggregates key on the name.",
6926
+ "required": false,
6927
+ "type": "array",
6928
+ "in": "body"
6929
+ },
6930
+ {
6931
+ "name": "pass_threshold",
6932
+ "description": "",
6933
+ "required": false,
6934
+ "type": "number",
6935
+ "in": "body"
6936
+ }
6937
+ ]
6938
+ },
6939
+ "delete-eval": {
6940
+ serviceClass: "Evaluations",
6941
+ operationId: "deleteEval",
6942
+ description: "Deletes an eval, its runs, and their results",
6943
+ moduleDocsUrl: "https://docs.naturali.ai/docs/modules/evaluations",
6944
+ httpMethod: "delete",
6945
+ pathParams: ["project_id", "eval_id"],
6946
+ queryParams: [],
6947
+ flags: [{
6948
+ "name": "project_id",
6949
+ "description": "Project public ID (proj_ prefix).",
6950
+ "required": true,
6951
+ "type": "string",
6952
+ "in": "path"
6953
+ }, {
6954
+ "name": "eval_id",
6955
+ "description": "Eval ID",
6956
+ "required": true,
6957
+ "type": "string",
6958
+ "in": "path"
6959
+ }]
6960
+ },
6961
+ "list-eval-runs": {
6962
+ serviceClass: "Evaluations",
6963
+ operationId: "listEvalRuns",
6964
+ description: "Returns an eval's runs, newest first",
6965
+ moduleDocsUrl: "https://docs.naturali.ai/docs/modules/evaluations",
6966
+ httpMethod: "get",
6967
+ pathParams: ["project_id", "eval_id"],
6968
+ queryParams: ["limit", "offset"],
6969
+ flags: [
6970
+ {
6971
+ "name": "project_id",
6972
+ "description": "Project public ID (proj_ prefix).",
6973
+ "required": true,
6974
+ "type": "string",
6975
+ "in": "path"
6976
+ },
6977
+ {
6978
+ "name": "eval_id",
6979
+ "description": "Eval ID",
6980
+ "required": true,
6981
+ "type": "string",
6982
+ "in": "path"
6983
+ },
6984
+ {
6985
+ "name": "limit",
6986
+ "description": "Maximum number of results to return",
6987
+ "required": false,
6988
+ "type": "integer",
6989
+ "in": "query"
6990
+ },
6991
+ {
6992
+ "name": "offset",
6993
+ "description": "Number of results to skip",
6994
+ "required": false,
6995
+ "type": "integer",
6996
+ "in": "query"
6997
+ }
6998
+ ]
6999
+ },
7000
+ "start-eval-run": {
7001
+ serviceClass: "Evaluations",
7002
+ operationId: "startEvalRun",
7003
+ description: "Runs the eval against its dataset, creating one real agent generation per item and scoring the outputs. `wait: true` executes the run synchronously and returns it terminal, with its scores. The dataset is capped at 25 items for a synchronous run; a larger one is rejected with 400 rather than partially scored. `wait: false` (the default) enqueues one task per item and returns immediately with `status: \"queued\"`. A worker executes the items and the run settles itself; poll `GET /evals/{eval_id}/runs/{eval_run_id}` for the terminal status. There is no item cap on a queued run. The whole run is pinned to **one** agent version, stamped on `agent_version`: pass one explicitly to evaluate a canary before promoting it, or omit it to use the active release's stable version (or the live draft when no release is in effect). Without the pin, release assignment would bucket each item independently and blend two configs into a single score. With `baseline_run_id`, the finished run's `aggregate_scores.baseline` carries per-scorer deltas against that run, computed over the items present and scorable in **both** runs, with the divergence counted. A delta over a shifted dataset is therefore never presented as a clean comparison.",
7004
+ moduleDocsUrl: "https://docs.naturali.ai/docs/modules/evaluations",
7005
+ httpMethod: "post",
7006
+ pathParams: ["project_id", "eval_id"],
7007
+ queryParams: [],
7008
+ flags: [
7009
+ {
7010
+ "name": "project_id",
7011
+ "description": "Project public ID (proj_ prefix).",
7012
+ "required": true,
7013
+ "type": "string",
7014
+ "in": "path"
7015
+ },
7016
+ {
7017
+ "name": "eval_id",
7018
+ "description": "Eval ID",
7019
+ "required": true,
7020
+ "type": "string",
7021
+ "in": "path"
7022
+ },
7023
+ {
7024
+ "name": "wait",
7025
+ "description": "True runs the eval synchronously (25-item cap) and returns a terminal run with its scores. False — the default — enqueues the items and returns a `queued` run immediately.",
7026
+ "required": false,
7027
+ "type": "boolean",
7028
+ "in": "body"
7029
+ },
7030
+ {
7031
+ "name": "agent_version",
7032
+ "description": "An archived agent version to evaluate. Defaults to the active release's stable version, or the live draft version when no release is in effect.",
7033
+ "required": false,
7034
+ "type": "integer",
7035
+ "in": "body"
7036
+ },
7037
+ {
7038
+ "name": "baseline_run_id",
7039
+ "description": "A terminal run of the same eval to compare against. The finished run's `aggregate_scores.baseline` reports per-scorer deltas over the item intersection. A run of a different eval is rejected with 400.",
7040
+ "required": false,
7041
+ "type": "string",
7042
+ "in": "body"
7043
+ }
7044
+ ]
7045
+ },
7046
+ "get-eval-run": {
7047
+ serviceClass: "Evaluations",
7048
+ operationId: "getEvalRun",
7049
+ description: "Returns a run's status, counts, and aggregate scores",
7050
+ moduleDocsUrl: "https://docs.naturali.ai/docs/modules/evaluations",
7051
+ httpMethod: "get",
7052
+ pathParams: [
7053
+ "project_id",
7054
+ "eval_id",
7055
+ "eval_run_id"
7056
+ ],
7057
+ queryParams: [],
7058
+ flags: [
7059
+ {
7060
+ "name": "project_id",
7061
+ "description": "Project public ID (proj_ prefix).",
7062
+ "required": true,
7063
+ "type": "string",
7064
+ "in": "path"
7065
+ },
7066
+ {
7067
+ "name": "eval_id",
7068
+ "description": "Eval ID",
7069
+ "required": true,
7070
+ "type": "string",
7071
+ "in": "path"
7072
+ },
7073
+ {
7074
+ "name": "eval_run_id",
7075
+ "description": "Eval run ID",
7076
+ "required": true,
7077
+ "type": "string",
7078
+ "in": "path"
7079
+ }
7080
+ ]
7081
+ },
7082
+ "list-eval-results": {
7083
+ serviceClass: "Evaluations",
7084
+ operationId: "listEvalResults",
7085
+ description: "Returns the per-item results of a run, oldest first",
7086
+ moduleDocsUrl: "https://docs.naturali.ai/docs/modules/evaluations",
7087
+ httpMethod: "get",
7088
+ pathParams: [
7089
+ "project_id",
7090
+ "eval_id",
7091
+ "eval_run_id"
7092
+ ],
7093
+ queryParams: ["limit", "offset"],
7094
+ flags: [
7095
+ {
7096
+ "name": "project_id",
7097
+ "description": "Project public ID (proj_ prefix).",
7098
+ "required": true,
7099
+ "type": "string",
7100
+ "in": "path"
7101
+ },
7102
+ {
7103
+ "name": "eval_id",
7104
+ "description": "Eval ID",
7105
+ "required": true,
7106
+ "type": "string",
7107
+ "in": "path"
7108
+ },
7109
+ {
7110
+ "name": "eval_run_id",
7111
+ "description": "Eval run ID",
7112
+ "required": true,
7113
+ "type": "string",
7114
+ "in": "path"
7115
+ },
7116
+ {
7117
+ "name": "limit",
7118
+ "description": "Maximum number of results to return",
7119
+ "required": false,
7120
+ "type": "integer",
7121
+ "in": "query"
7122
+ },
7123
+ {
7124
+ "name": "offset",
7125
+ "description": "Number of results to skip",
7126
+ "required": false,
7127
+ "type": "integer",
7128
+ "in": "query"
7129
+ }
7130
+ ]
7131
+ },
7132
+ "cancel-eval-run": {
7133
+ serviceClass: "Evaluations",
7134
+ operationId: "cancelEvalRun",
7135
+ description: "Cancels a queued or running run: its outstanding item tasks are dropped so it stops consuming provider budget, and the run settles as `canceled`. Results already written are kept — they are real measurements of generations that were really paid for — and `completed_count` / `errored_count` report what ran. `aggregate_scores` is deliberately left null: a partial roll-up in the same field a completed run uses would read as a whole-dataset verdict. A run that has already finished is rejected with 400.",
7136
+ moduleDocsUrl: "https://docs.naturali.ai/docs/modules/evaluations",
7137
+ httpMethod: "post",
7138
+ pathParams: [
7139
+ "project_id",
7140
+ "eval_id",
7141
+ "eval_run_id"
7142
+ ],
7143
+ queryParams: [],
7144
+ flags: [
7145
+ {
7146
+ "name": "project_id",
7147
+ "description": "Project public ID (proj_ prefix).",
7148
+ "required": true,
7149
+ "type": "string",
7150
+ "in": "path"
7151
+ },
7152
+ {
7153
+ "name": "eval_id",
7154
+ "description": "Eval ID",
7155
+ "required": true,
7156
+ "type": "string",
7157
+ "in": "path"
7158
+ },
7159
+ {
7160
+ "name": "eval_run_id",
7161
+ "description": "Eval run ID",
7162
+ "required": true,
7163
+ "type": "string",
7164
+ "in": "path"
7165
+ }
7166
+ ]
7167
+ },
7168
+ "list-generations": {
7169
+ serviceClass: "Generations",
7170
+ operationId: "listGenerations",
7171
+ description: "Returns generations the caller can access, optionally filtered by agent, trace, and status. Replaces the former per-trace generations endpoint (use the trace_id query filter).",
7172
+ moduleDocsUrl: "https://docs.naturali.ai/docs/modules/generations",
7173
+ httpMethod: "get",
7174
+ pathParams: ["project_id"],
7175
+ queryParams: [
7176
+ "agent_id",
7177
+ "trace_id",
7178
+ "initiator_generation_id",
7179
+ "status",
7180
+ "limit",
7181
+ "offset"
7182
+ ],
7183
+ flags: [
7184
+ {
7185
+ "name": "project_id",
7186
+ "description": "Project public ID (proj_ prefix).",
7187
+ "required": true,
7188
+ "type": "string",
7189
+ "in": "path"
7190
+ },
7191
+ {
7192
+ "name": "agent_id",
7193
+ "description": "Filter by agent public ID",
7194
+ "required": false,
7195
+ "type": "string",
7196
+ "in": "query"
7197
+ },
7198
+ {
7199
+ "name": "trace_id",
7200
+ "description": "Filter by trace public ID",
7201
+ "required": false,
7202
+ "type": "string",
6102
7203
  "in": "query"
6103
7204
  },
6104
7205
  {
@@ -7634,6 +8735,114 @@ const routes = {
7634
8735
  }
7635
8736
  ]
7636
8737
  },
8738
+ "list-traces": {
8739
+ serviceClass: "Traces",
8740
+ operationId: "listTraces",
8741
+ description: "Returns a paginated list of execution traces for the project.",
8742
+ moduleDocsUrl: "https://docs.naturali.ai/docs/modules/traces",
8743
+ httpMethod: "get",
8744
+ pathParams: ["project_id"],
8745
+ queryParams: ["limit", "offset"],
8746
+ flags: [
8747
+ {
8748
+ "name": "project_id",
8749
+ "description": "Project public ID (proj_ prefix).",
8750
+ "required": true,
8751
+ "type": "string",
8752
+ "in": "path"
8753
+ },
8754
+ {
8755
+ "name": "limit",
8756
+ "description": "Maximum number of results to return",
8757
+ "required": false,
8758
+ "type": "integer",
8759
+ "in": "query"
8760
+ },
8761
+ {
8762
+ "name": "offset",
8763
+ "description": "Number of results to skip",
8764
+ "required": false,
8765
+ "type": "integer",
8766
+ "in": "query"
8767
+ }
8768
+ ]
8769
+ },
8770
+ "get-trace": {
8771
+ serviceClass: "Traces",
8772
+ operationId: "getTrace",
8773
+ description: "Returns a single trace by ID.",
8774
+ moduleDocsUrl: "https://docs.naturali.ai/docs/modules/traces",
8775
+ httpMethod: "get",
8776
+ pathParams: ["project_id", "trace_id"],
8777
+ queryParams: [],
8778
+ flags: [{
8779
+ "name": "project_id",
8780
+ "description": "Project public ID (proj_ prefix).",
8781
+ "required": true,
8782
+ "type": "string",
8783
+ "in": "path"
8784
+ }, {
8785
+ "name": "trace_id",
8786
+ "description": "Public ID of the trace",
8787
+ "required": true,
8788
+ "type": "string",
8789
+ "in": "path"
8790
+ }]
8791
+ },
8792
+ "get-trace-tree": {
8793
+ serviceClass: "Traces",
8794
+ operationId: "getTraceTree",
8795
+ description: "Returns the full execution tree rooted at the given trace (or its root if the given trace is a child). Each node represents one agent's execution session. The `children` array contains traces triggered by sub-agent tool calls from that trace.",
8796
+ moduleDocsUrl: "https://docs.naturali.ai/docs/modules/traces",
8797
+ httpMethod: "get",
8798
+ pathParams: ["project_id", "trace_id"],
8799
+ queryParams: ["include"],
8800
+ flags: [
8801
+ {
8802
+ "name": "project_id",
8803
+ "description": "Project public ID (proj_ prefix).",
8804
+ "required": true,
8805
+ "type": "string",
8806
+ "in": "path"
8807
+ },
8808
+ {
8809
+ "name": "trace_id",
8810
+ "description": "Public ID of any trace in the tree (root or child)",
8811
+ "required": true,
8812
+ "type": "string",
8813
+ "in": "path"
8814
+ },
8815
+ {
8816
+ "name": "include",
8817
+ "description": "Comma-separated list of related resources to embed on each node. Supported value: `generations` — attaches all generations that belong to each trace node (including sub-agent generations linked via `initiator_generation_id`).\n",
8818
+ "required": false,
8819
+ "type": "string",
8820
+ "in": "query"
8821
+ }
8822
+ ]
8823
+ },
8824
+ "purge-trace-content": {
8825
+ serviceClass: "Traces",
8826
+ operationId: "purgeTraceContent",
8827
+ description: "Deletes the trace's steps object from storage and clears its content columns (`file_id`, `error`), cascading to every descendant trace and to all of their generations. A descendant holds its own steps object covering the same run, so the cascade is what makes the erasure complete rather than merely partial. The rows survive as auditable skeletons with `content_redacted_at` set — ids, timestamps, step counts, and the generations' usage-attribution fields are preserved, because the billing and audit ledger must outlive a tenant's erasure of the content. A purged trace therefore reads back as a skeleton, not a 404: a 404 would prove nothing. Idempotent — purging an already-purged trace succeeds and leaves the original `content_redacted_at` in place.",
8828
+ moduleDocsUrl: "https://docs.naturali.ai/docs/modules/traces",
8829
+ httpMethod: "delete",
8830
+ pathParams: ["project_id", "trace_id"],
8831
+ queryParams: [],
8832
+ flags: [{
8833
+ "name": "project_id",
8834
+ "description": "Project public ID (proj_ prefix).",
8835
+ "required": true,
8836
+ "type": "string",
8837
+ "in": "path"
8838
+ }, {
8839
+ "name": "trace_id",
8840
+ "description": "Public ID of the trace",
8841
+ "required": true,
8842
+ "type": "string",
8843
+ "in": "path"
8844
+ }]
8845
+ },
7637
8846
  "get-current-user": {
7638
8847
  serviceClass: "Users",
7639
8848
  operationId: "getCurrentUser",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@naturali/cli",
3
- "version": "0.67.0",
3
+ "version": "0.68.0",
4
4
  "description": "Command-line interface for the naturali.ai API, generated from its OpenAPI specs",
5
5
  "type": "module",
6
6
  "bin": {
@@ -30,7 +30,7 @@
30
30
  "tsx": "^4.23.1",
31
31
  "typescript": "~6.0.3",
32
32
  "vitest": "^4.1.10",
33
- "@naturali/sdk": "0.67.0"
33
+ "@naturali/sdk": "0.68.0"
34
34
  },
35
35
  "scripts": {
36
36
  "generate": "tsx scripts/generate.ts",