@naturali/sdk 0.78.6 → 0.80.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.cjs +127 -2
- package/dist/index.d.cts +2662 -1139
- package/dist/index.d.mts +2662 -1139
- package/dist/index.mjs +127 -3
- package/package.json +2 -2
package/dist/index.mjs
CHANGED
|
@@ -2461,6 +2461,126 @@ var Files = class {
|
|
|
2461
2461
|
});
|
|
2462
2462
|
}
|
|
2463
2463
|
};
|
|
2464
|
+
var Formations = class {
|
|
2465
|
+
/**
|
|
2466
|
+
* Validate a formation template
|
|
2467
|
+
*
|
|
2468
|
+
* Validates a formation template without creating any resources. Returns a list of errors and warnings. Accepts the template as a JSON object or as a YAML/JSON string.
|
|
2469
|
+
*
|
|
2470
|
+
*/
|
|
2471
|
+
static validateFormation(options) {
|
|
2472
|
+
return (options.client ?? client).post({
|
|
2473
|
+
url: "/v1/projects/{project_id}/formations/validate",
|
|
2474
|
+
...options,
|
|
2475
|
+
headers: {
|
|
2476
|
+
"Content-Type": "application/json",
|
|
2477
|
+
...options.headers
|
|
2478
|
+
}
|
|
2479
|
+
});
|
|
2480
|
+
}
|
|
2481
|
+
/**
|
|
2482
|
+
* Plan a formation deployment
|
|
2483
|
+
*
|
|
2484
|
+
* Computes a diff between the desired template and the current stack state without making any changes. Returns the list of planned actions.
|
|
2485
|
+
*
|
|
2486
|
+
*/
|
|
2487
|
+
static planFormation(options) {
|
|
2488
|
+
return (options.client ?? client).post({
|
|
2489
|
+
url: "/v1/projects/{project_id}/formations/plan",
|
|
2490
|
+
...options,
|
|
2491
|
+
headers: {
|
|
2492
|
+
"Content-Type": "application/json",
|
|
2493
|
+
...options.headers
|
|
2494
|
+
}
|
|
2495
|
+
});
|
|
2496
|
+
}
|
|
2497
|
+
/**
|
|
2498
|
+
* List formations
|
|
2499
|
+
*
|
|
2500
|
+
* Returns all formation stacks for a project
|
|
2501
|
+
*/
|
|
2502
|
+
static listFormations(options) {
|
|
2503
|
+
return (options.client ?? client).get({
|
|
2504
|
+
url: "/v1/projects/{project_id}/formations",
|
|
2505
|
+
...options
|
|
2506
|
+
});
|
|
2507
|
+
}
|
|
2508
|
+
/**
|
|
2509
|
+
* Create a new formation
|
|
2510
|
+
*
|
|
2511
|
+
* Validates the template, creates the formation record, then provisions all declared resources in dependency order.
|
|
2512
|
+
*
|
|
2513
|
+
* A **template-shape** error is refused with `400`. A **deploy** failure is not: the operation ran, so the formation is returned with `201` and `status: "failed"`, and `error` explains why (the resources created before the failure are rolled back). Read `status` — a `2xx` here means the deploy was attempted, not that it worked. The `builtin` CLI exits non-zero on that body so `create-formation && …` does not lie.
|
|
2514
|
+
*
|
|
2515
|
+
*/
|
|
2516
|
+
static createFormation(options) {
|
|
2517
|
+
return (options.client ?? client).post({
|
|
2518
|
+
url: "/v1/projects/{project_id}/formations",
|
|
2519
|
+
...options,
|
|
2520
|
+
headers: {
|
|
2521
|
+
"Content-Type": "application/json",
|
|
2522
|
+
...options.headers
|
|
2523
|
+
}
|
|
2524
|
+
});
|
|
2525
|
+
}
|
|
2526
|
+
/**
|
|
2527
|
+
* Delete an formation
|
|
2528
|
+
*
|
|
2529
|
+
* Deletes the formation stack and all its managed resources in reverse dependency order.
|
|
2530
|
+
*
|
|
2531
|
+
* A resource the platform refuses to delete on its own — most often an agent that has generation or trace history — fails the teardown with `409 FORMATION_DELETE_FAILED`, naming every blocking resource in `error.meta.failures`. Resolve the blockers (for an agent, `DELETE /v1/projects/{project_id}/agents/{agent_id}?force=true` also removes its generations and traces, and `deletion_policy: retain` exempts it from teardown entirely) and delete the formation again.
|
|
2532
|
+
*
|
|
2533
|
+
* A refusal the platform can foresee is found by a pre-flight, before the first delete: nothing is removed, and the formation stays `active` and intact for the retry. An unforeseeable error surfaces mid-teardown instead, where resources deleted before the blocker stay deleted and the formation is left in `delete_failed`. The error message states which happened.
|
|
2534
|
+
*
|
|
2535
|
+
*/
|
|
2536
|
+
static deleteFormation(options) {
|
|
2537
|
+
return (options.client ?? client).delete({
|
|
2538
|
+
url: "/v1/projects/{project_id}/formations/{formation_id}",
|
|
2539
|
+
...options
|
|
2540
|
+
});
|
|
2541
|
+
}
|
|
2542
|
+
/**
|
|
2543
|
+
* Get a specific formation
|
|
2544
|
+
*
|
|
2545
|
+
* Returns the formation stack including its current resources.
|
|
2546
|
+
*/
|
|
2547
|
+
static getFormation(options) {
|
|
2548
|
+
return (options.client ?? client).get({
|
|
2549
|
+
url: "/v1/projects/{project_id}/formations/{formation_id}",
|
|
2550
|
+
...options
|
|
2551
|
+
});
|
|
2552
|
+
}
|
|
2553
|
+
/**
|
|
2554
|
+
* Update an formation
|
|
2555
|
+
*
|
|
2556
|
+
* Applies a new template to the formation. Resources are created, updated, or deleted to reconcile the current state with the desired state.
|
|
2557
|
+
*
|
|
2558
|
+
* A **template-shape** error is refused with `400`. A **deploy** failure is not: the operation ran, so the formation is returned with `200` and `status: "failed"`, and `error` explains why. Read `status` — a `2xx` here means the deploy was attempted, not that it worked. The `builtin` CLI exits non-zero on that body so `update-formation && …` does not lie.
|
|
2559
|
+
*
|
|
2560
|
+
*/
|
|
2561
|
+
static updateFormation(options) {
|
|
2562
|
+
return (options.client ?? client).put({
|
|
2563
|
+
url: "/v1/projects/{project_id}/formations/{formation_id}",
|
|
2564
|
+
...options,
|
|
2565
|
+
headers: {
|
|
2566
|
+
"Content-Type": "application/json",
|
|
2567
|
+
...options.headers
|
|
2568
|
+
}
|
|
2569
|
+
});
|
|
2570
|
+
}
|
|
2571
|
+
/**
|
|
2572
|
+
* List formation operation events
|
|
2573
|
+
*
|
|
2574
|
+
* Returns all operations (create, update, delete) with their event logs for the formation, ordered chronologically.
|
|
2575
|
+
*
|
|
2576
|
+
*/
|
|
2577
|
+
static listFormationEvents(options) {
|
|
2578
|
+
return (options.client ?? client).get({
|
|
2579
|
+
url: "/v1/projects/{project_id}/formations/{formation_id}/events",
|
|
2580
|
+
...options
|
|
2581
|
+
});
|
|
2582
|
+
}
|
|
2583
|
+
};
|
|
2464
2584
|
var Generations = class {
|
|
2465
2585
|
/**
|
|
2466
2586
|
* List generations
|
|
@@ -3121,7 +3241,9 @@ var Orchestrations = class {
|
|
|
3121
3241
|
/**
|
|
3122
3242
|
* List orchestration runs
|
|
3123
3243
|
*
|
|
3124
|
-
* Returns orchestration runs the caller can access, optionally filtered by orchestration.
|
|
3244
|
+
* Returns orchestration runs the caller can access, optionally filtered by orchestration, by parent run, or by whether the run has a parent at all.
|
|
3245
|
+
*
|
|
3246
|
+
* Note when aggregating: a run's `usage` covers its whole subtree, so summing it over a list that contains both a parent and its children counts the children more than once. Pass `nested=false` to sum over runs a caller started.
|
|
3125
3247
|
*/
|
|
3126
3248
|
static listOrchestrationRuns(options) {
|
|
3127
3249
|
return (options.client ?? client).get({
|
|
@@ -3771,7 +3893,7 @@ var Tools = class {
|
|
|
3771
3893
|
*
|
|
3772
3894
|
* Directly invokes a tool and returns its output. Supported for `http`, `mcp`, and `pipeline` tools. `client` tools cannot be invoked server-side and will return 422. A `pipeline` tool runs its declared steps in order and returns the mapped `output` (or the last step's output); `action` is ignored and `input` is the pipeline input.
|
|
3773
3895
|
* For `mcp` tools the `action` field is required and identifies which tool name to invoke. For `http` tools `action` is ignored. When an `mcp` tool declares an `actions` allowlist, an action outside it is rejected with `400 VALIDATION_FAILED` ("not available on this tool") before any outbound request is made.
|
|
3774
|
-
* `preset_parameters` stored on the tool are
|
|
3896
|
+
* `preset_parameters` stored on the tool are pinned over the caller-supplied `input` before execution: a key the tool presets keeps its preset value even when `input` sets it. Keys the presets do not name are taken from `input` as sent.
|
|
3775
3897
|
*
|
|
3776
3898
|
*/
|
|
3777
3899
|
static callTool(options) {
|
|
@@ -4281,6 +4403,7 @@ var NaturaliClient = class {
|
|
|
4281
4403
|
evaluations;
|
|
4282
4404
|
exceptions;
|
|
4283
4405
|
files;
|
|
4406
|
+
formations;
|
|
4284
4407
|
generations;
|
|
4285
4408
|
guardrails;
|
|
4286
4409
|
ingestionRules;
|
|
@@ -4328,6 +4451,7 @@ var NaturaliClient = class {
|
|
|
4328
4451
|
this.evaluations = bindResource(Evaluations, this.http);
|
|
4329
4452
|
this.exceptions = bindResource(Exceptions, this.http);
|
|
4330
4453
|
this.files = bindResource(Files, this.http);
|
|
4454
|
+
this.formations = bindResource(Formations, this.http);
|
|
4331
4455
|
this.generations = bindResource(Generations, this.http);
|
|
4332
4456
|
this.guardrails = bindResource(Guardrails, this.http);
|
|
4333
4457
|
this.ingestionRules = bindResource(IngestionRules, this.http);
|
|
@@ -4351,4 +4475,4 @@ var NaturaliClient = class {
|
|
|
4351
4475
|
}
|
|
4352
4476
|
};
|
|
4353
4477
|
//#endregion
|
|
4354
|
-
export { Activity, Actors, AgentVersions, Agents, AiProviders, ApiKeys, Approvals, Assistant, AuditLog, Auth, Channels, Conversations, Documents, Embeddings, Evaluations, Exceptions, Files, Generations, Guardrails, IngestionRules, Knowledge, Memories, MemoryEntries, ModelRoutes, Models, NaturaliClient, Orchestrations, Projects, Quotas, Secrets, Sessions, Tasks, Tools, Traces, Triggers, Users, Webhooks, Workflows, createClient, createConfig };
|
|
4478
|
+
export { Activity, Actors, AgentVersions, Agents, AiProviders, ApiKeys, Approvals, Assistant, AuditLog, Auth, Channels, Conversations, Documents, Embeddings, Evaluations, Exceptions, Files, Formations, Generations, Guardrails, IngestionRules, Knowledge, Memories, MemoryEntries, ModelRoutes, Models, NaturaliClient, Orchestrations, Projects, Quotas, Secrets, Sessions, Tasks, Tools, Traces, Triggers, Users, Webhooks, Workflows, createClient, createConfig };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@naturali/sdk",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.80.0",
|
|
4
4
|
"description": "TypeScript SDK for the naturali.ai API, generated from its OpenAPI specs",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"sideEffects": false,
|
|
@@ -37,7 +37,7 @@
|
|
|
37
37
|
"tsx": "^4.23.1",
|
|
38
38
|
"typescript": "~6.0.3",
|
|
39
39
|
"vitest": "^4.1.10",
|
|
40
|
-
"@naturali/api": "0.
|
|
40
|
+
"@naturali/api": "0.80.0"
|
|
41
41
|
},
|
|
42
42
|
"scripts": {
|
|
43
43
|
"generate": "tsx scripts/generate.ts",
|