@naturali/sdk 0.79.0 → 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 +123 -0
- package/dist/index.d.cts +2511 -1022
- package/dist/index.d.mts +2511 -1022
- package/dist/index.mjs +123 -1
- 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
|
|
@@ -4283,6 +4403,7 @@ var NaturaliClient = class {
|
|
|
4283
4403
|
evaluations;
|
|
4284
4404
|
exceptions;
|
|
4285
4405
|
files;
|
|
4406
|
+
formations;
|
|
4286
4407
|
generations;
|
|
4287
4408
|
guardrails;
|
|
4288
4409
|
ingestionRules;
|
|
@@ -4330,6 +4451,7 @@ var NaturaliClient = class {
|
|
|
4330
4451
|
this.evaluations = bindResource(Evaluations, this.http);
|
|
4331
4452
|
this.exceptions = bindResource(Exceptions, this.http);
|
|
4332
4453
|
this.files = bindResource(Files, this.http);
|
|
4454
|
+
this.formations = bindResource(Formations, this.http);
|
|
4333
4455
|
this.generations = bindResource(Generations, this.http);
|
|
4334
4456
|
this.guardrails = bindResource(Guardrails, this.http);
|
|
4335
4457
|
this.ingestionRules = bindResource(IngestionRules, this.http);
|
|
@@ -4353,4 +4475,4 @@ var NaturaliClient = class {
|
|
|
4353
4475
|
}
|
|
4354
4476
|
};
|
|
4355
4477
|
//#endregion
|
|
4356
|
-
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",
|