@naturali/sdk 0.52.0 → 0.53.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.cjs +167 -3
- package/dist/index.d.cts +892 -65
- package/dist/index.d.mts +892 -65
- package/dist/index.mjs +167 -4
- package/package.json +2 -2
package/dist/index.cjs
CHANGED
|
@@ -1594,6 +1594,163 @@ var Models = class {
|
|
|
1594
1594
|
});
|
|
1595
1595
|
}
|
|
1596
1596
|
};
|
|
1597
|
+
var Orchestrations = class {
|
|
1598
|
+
/**
|
|
1599
|
+
* List orchestrations
|
|
1600
|
+
*
|
|
1601
|
+
* Lists the project's orchestration definitions.
|
|
1602
|
+
*/
|
|
1603
|
+
static listOrchestrations(options) {
|
|
1604
|
+
return (options.client ?? client).get({
|
|
1605
|
+
url: "/v1/projects/{project_id}/orchestrations",
|
|
1606
|
+
...options
|
|
1607
|
+
});
|
|
1608
|
+
}
|
|
1609
|
+
/**
|
|
1610
|
+
* Create an orchestration
|
|
1611
|
+
*
|
|
1612
|
+
* Creates a new orchestration (pipeline) definition in the project.
|
|
1613
|
+
*/
|
|
1614
|
+
static createOrchestration(options) {
|
|
1615
|
+
return (options.client ?? client).post({
|
|
1616
|
+
url: "/v1/projects/{project_id}/orchestrations",
|
|
1617
|
+
...options,
|
|
1618
|
+
headers: {
|
|
1619
|
+
"Content-Type": "application/json",
|
|
1620
|
+
...options.headers
|
|
1621
|
+
}
|
|
1622
|
+
});
|
|
1623
|
+
}
|
|
1624
|
+
/**
|
|
1625
|
+
* Validate an orchestration graph
|
|
1626
|
+
*
|
|
1627
|
+
* Statically validates a graph without persisting anything — the same checks `create`/`update` enforce (unique node ids, edges reference existing nodes, the graph is acyclic unless it contains a loop node, every `input_mapping` reference resolves). Returns blocking `errors` and non-blocking `warnings`.
|
|
1628
|
+
*
|
|
1629
|
+
*/
|
|
1630
|
+
static validateOrchestration(options) {
|
|
1631
|
+
return (options.client ?? client).post({
|
|
1632
|
+
url: "/v1/projects/{project_id}/orchestrations/validate",
|
|
1633
|
+
...options,
|
|
1634
|
+
headers: {
|
|
1635
|
+
"Content-Type": "application/json",
|
|
1636
|
+
...options.headers
|
|
1637
|
+
}
|
|
1638
|
+
});
|
|
1639
|
+
}
|
|
1640
|
+
/**
|
|
1641
|
+
* Delete an orchestration
|
|
1642
|
+
*
|
|
1643
|
+
* Deletes the orchestration definition and all of its runs.
|
|
1644
|
+
*/
|
|
1645
|
+
static deleteOrchestration(options) {
|
|
1646
|
+
return (options.client ?? client).delete({
|
|
1647
|
+
url: "/v1/projects/{project_id}/orchestrations/{orchestration_id}",
|
|
1648
|
+
...options
|
|
1649
|
+
});
|
|
1650
|
+
}
|
|
1651
|
+
/**
|
|
1652
|
+
* Get an orchestration
|
|
1653
|
+
*
|
|
1654
|
+
* Returns one orchestration with its nodes and edges. Belonging to another project responds `404`, not `403` — existence is not leaked.
|
|
1655
|
+
*
|
|
1656
|
+
*/
|
|
1657
|
+
static getOrchestration(options) {
|
|
1658
|
+
return (options.client ?? client).get({
|
|
1659
|
+
url: "/v1/projects/{project_id}/orchestrations/{orchestration_id}",
|
|
1660
|
+
...options
|
|
1661
|
+
});
|
|
1662
|
+
}
|
|
1663
|
+
/**
|
|
1664
|
+
* Update an orchestration
|
|
1665
|
+
*
|
|
1666
|
+
* Partially updates an orchestration's definition.
|
|
1667
|
+
*/
|
|
1668
|
+
static updateOrchestration(options) {
|
|
1669
|
+
return (options.client ?? client).patch({
|
|
1670
|
+
url: "/v1/projects/{project_id}/orchestrations/{orchestration_id}",
|
|
1671
|
+
...options,
|
|
1672
|
+
headers: {
|
|
1673
|
+
"Content-Type": "application/json",
|
|
1674
|
+
...options.headers
|
|
1675
|
+
}
|
|
1676
|
+
});
|
|
1677
|
+
}
|
|
1678
|
+
/**
|
|
1679
|
+
* List orchestration runs
|
|
1680
|
+
*
|
|
1681
|
+
* Lists runs of one orchestration. `orchestration_id` is required — it is what scopes the list to this project, since a run carries no cheaper project-level filter of its own.
|
|
1682
|
+
*
|
|
1683
|
+
*/
|
|
1684
|
+
static listOrchestrationRuns(options) {
|
|
1685
|
+
return (options.client ?? client).get({
|
|
1686
|
+
url: "/v1/projects/{project_id}/orchestration-runs",
|
|
1687
|
+
...options
|
|
1688
|
+
});
|
|
1689
|
+
}
|
|
1690
|
+
/**
|
|
1691
|
+
* Start an orchestration run
|
|
1692
|
+
*
|
|
1693
|
+
* Starts a new run of the orchestration named by `orchestration_id`, which must belong to this project. By default the run executes durably in the background and this returns immediately with `status: "queued"`; pass `wait: true` to block until the run reaches a terminal or `awaiting_input` state instead.
|
|
1694
|
+
*/
|
|
1695
|
+
static startOrchestrationRun(options) {
|
|
1696
|
+
return (options.client ?? client).post({
|
|
1697
|
+
url: "/v1/projects/{project_id}/orchestration-runs",
|
|
1698
|
+
...options,
|
|
1699
|
+
headers: {
|
|
1700
|
+
"Content-Type": "application/json",
|
|
1701
|
+
...options.headers
|
|
1702
|
+
}
|
|
1703
|
+
});
|
|
1704
|
+
}
|
|
1705
|
+
/**
|
|
1706
|
+
* Get an orchestration run
|
|
1707
|
+
*
|
|
1708
|
+
* Returns the status, state, and artifacts of one run.
|
|
1709
|
+
*/
|
|
1710
|
+
static getOrchestrationRun(options) {
|
|
1711
|
+
return (options.client ?? client).get({
|
|
1712
|
+
url: "/v1/projects/{project_id}/orchestration-runs/{orchestration_run_id}",
|
|
1713
|
+
...options
|
|
1714
|
+
});
|
|
1715
|
+
}
|
|
1716
|
+
/**
|
|
1717
|
+
* Cancel an orchestration run
|
|
1718
|
+
*
|
|
1719
|
+
* Cancels a run that has not yet reached a terminal state.
|
|
1720
|
+
*/
|
|
1721
|
+
static cancelOrchestrationRun(options) {
|
|
1722
|
+
return (options.client ?? client).post({
|
|
1723
|
+
url: "/v1/projects/{project_id}/orchestration-runs/{orchestration_run_id}/cancel",
|
|
1724
|
+
...options
|
|
1725
|
+
});
|
|
1726
|
+
}
|
|
1727
|
+
/**
|
|
1728
|
+
* Resume an orchestration run
|
|
1729
|
+
*
|
|
1730
|
+
* Re-drives an `awaiting_input` run from its last checkpoint. This does not satisfy the pause itself — a run parked on a human or webhook node re-parks on the same node. Use `human-input` to supply the awaited payload and advance the run.
|
|
1731
|
+
*/
|
|
1732
|
+
static resumeOrchestrationRun(options) {
|
|
1733
|
+
return (options.client ?? client).post({
|
|
1734
|
+
url: "/v1/projects/{project_id}/orchestration-runs/{orchestration_run_id}/resume",
|
|
1735
|
+
...options
|
|
1736
|
+
});
|
|
1737
|
+
}
|
|
1738
|
+
/**
|
|
1739
|
+
* Submit human input
|
|
1740
|
+
*
|
|
1741
|
+
* Provides human input to a run that is `awaiting_input` at a human node, and advances it.
|
|
1742
|
+
*/
|
|
1743
|
+
static submitHumanInput(options) {
|
|
1744
|
+
return (options.client ?? client).post({
|
|
1745
|
+
url: "/v1/projects/{project_id}/orchestration-runs/{orchestration_run_id}/human-input",
|
|
1746
|
+
...options,
|
|
1747
|
+
headers: {
|
|
1748
|
+
"Content-Type": "application/json",
|
|
1749
|
+
...options.headers
|
|
1750
|
+
}
|
|
1751
|
+
});
|
|
1752
|
+
}
|
|
1753
|
+
};
|
|
1597
1754
|
var Projects = class {
|
|
1598
1755
|
/**
|
|
1599
1756
|
* List projects
|
|
@@ -2043,7 +2200,9 @@ var Triggers = class {
|
|
|
2043
2200
|
/**
|
|
2044
2201
|
* List triggers
|
|
2045
2202
|
*
|
|
2046
|
-
* The project's schedule triggers.
|
|
2203
|
+
* The project's schedule triggers, of either fronted target kind.
|
|
2204
|
+
* `total` is the runtime's count of the project's schedule triggers, so it can exceed the rows returned when a trigger was authored directly against the runtime with a target this surface doesn't front (the same bypass `getTrigger` answers `404` for). Pass `target_type` — which is filtered and counted upstream — when an exact count matters.
|
|
2205
|
+
*
|
|
2047
2206
|
*/
|
|
2048
2207
|
static listTriggers(options) {
|
|
2049
2208
|
return (options.client ?? client).get({
|
|
@@ -2054,7 +2213,7 @@ var Triggers = class {
|
|
|
2054
2213
|
/**
|
|
2055
2214
|
* Create a trigger
|
|
2056
2215
|
*
|
|
2057
|
-
* Schedules `target_id`
|
|
2216
|
+
* Schedules `target_id` — an agent or an orchestration in this project, per `target_type` — to run on `cron`, a 5-field cron expression evaluated in UTC.
|
|
2058
2217
|
*
|
|
2059
2218
|
*/
|
|
2060
2219
|
static createTrigger(options) {
|
|
@@ -2090,7 +2249,7 @@ var Triggers = class {
|
|
|
2090
2249
|
/**
|
|
2091
2250
|
* Update a trigger
|
|
2092
2251
|
*
|
|
2093
|
-
* Retune the schedule, its target, or whether it fires at all. At least one field is required. `type`
|
|
2252
|
+
* Retune the schedule, its target, or whether it fires at all. At least one field is required. `type` is immutable; `target_type` may be changed only together with `target_id`.
|
|
2094
2253
|
*
|
|
2095
2254
|
*/
|
|
2096
2255
|
static updateTrigger(options) {
|
|
@@ -2318,12 +2477,14 @@ var NaturaliClient = class {
|
|
|
2318
2477
|
generations;
|
|
2319
2478
|
knowledge;
|
|
2320
2479
|
models;
|
|
2480
|
+
orchestrations;
|
|
2321
2481
|
projects;
|
|
2322
2482
|
providers;
|
|
2323
2483
|
sessions;
|
|
2324
2484
|
tasks;
|
|
2325
2485
|
tools;
|
|
2326
2486
|
traces;
|
|
2487
|
+
triggers;
|
|
2327
2488
|
webhooks;
|
|
2328
2489
|
/** The underlying HTTP client, for interceptors or one-off requests. */
|
|
2329
2490
|
http;
|
|
@@ -2345,12 +2506,14 @@ var NaturaliClient = class {
|
|
|
2345
2506
|
this.generations = bindResource(Generations, this.http);
|
|
2346
2507
|
this.knowledge = bindResource(Knowledge, this.http);
|
|
2347
2508
|
this.models = bindResource(Models, this.http);
|
|
2509
|
+
this.orchestrations = bindResource(Orchestrations, this.http);
|
|
2348
2510
|
this.projects = bindResource(Projects, this.http);
|
|
2349
2511
|
this.providers = bindResource(Providers, this.http);
|
|
2350
2512
|
this.sessions = bindResource(Sessions, this.http);
|
|
2351
2513
|
this.tasks = bindResource(Tasks, this.http);
|
|
2352
2514
|
this.tools = bindResource(Tools, this.http);
|
|
2353
2515
|
this.traces = bindResource(Traces, this.http);
|
|
2516
|
+
this.triggers = bindResource(Triggers, this.http);
|
|
2354
2517
|
this.webhooks = bindResource(Webhooks, this.http);
|
|
2355
2518
|
}
|
|
2356
2519
|
};
|
|
@@ -2366,6 +2529,7 @@ exports.Generations = Generations;
|
|
|
2366
2529
|
exports.Knowledge = Knowledge;
|
|
2367
2530
|
exports.Models = Models;
|
|
2368
2531
|
exports.NaturaliClient = NaturaliClient;
|
|
2532
|
+
exports.Orchestrations = Orchestrations;
|
|
2369
2533
|
exports.Projects = Projects;
|
|
2370
2534
|
exports.Providers = Providers;
|
|
2371
2535
|
exports.Sessions = Sessions;
|