@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 CHANGED
@@ -2462,6 +2462,126 @@ var Files = class {
2462
2462
  });
2463
2463
  }
2464
2464
  };
2465
+ var Formations = class {
2466
+ /**
2467
+ * Validate a formation template
2468
+ *
2469
+ * 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.
2470
+ *
2471
+ */
2472
+ static validateFormation(options) {
2473
+ return (options.client ?? client).post({
2474
+ url: "/v1/projects/{project_id}/formations/validate",
2475
+ ...options,
2476
+ headers: {
2477
+ "Content-Type": "application/json",
2478
+ ...options.headers
2479
+ }
2480
+ });
2481
+ }
2482
+ /**
2483
+ * Plan a formation deployment
2484
+ *
2485
+ * Computes a diff between the desired template and the current stack state without making any changes. Returns the list of planned actions.
2486
+ *
2487
+ */
2488
+ static planFormation(options) {
2489
+ return (options.client ?? client).post({
2490
+ url: "/v1/projects/{project_id}/formations/plan",
2491
+ ...options,
2492
+ headers: {
2493
+ "Content-Type": "application/json",
2494
+ ...options.headers
2495
+ }
2496
+ });
2497
+ }
2498
+ /**
2499
+ * List formations
2500
+ *
2501
+ * Returns all formation stacks for a project
2502
+ */
2503
+ static listFormations(options) {
2504
+ return (options.client ?? client).get({
2505
+ url: "/v1/projects/{project_id}/formations",
2506
+ ...options
2507
+ });
2508
+ }
2509
+ /**
2510
+ * Create a new formation
2511
+ *
2512
+ * Validates the template, creates the formation record, then provisions all declared resources in dependency order.
2513
+ *
2514
+ * 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.
2515
+ *
2516
+ */
2517
+ static createFormation(options) {
2518
+ return (options.client ?? client).post({
2519
+ url: "/v1/projects/{project_id}/formations",
2520
+ ...options,
2521
+ headers: {
2522
+ "Content-Type": "application/json",
2523
+ ...options.headers
2524
+ }
2525
+ });
2526
+ }
2527
+ /**
2528
+ * Delete an formation
2529
+ *
2530
+ * Deletes the formation stack and all its managed resources in reverse dependency order.
2531
+ *
2532
+ * 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.
2533
+ *
2534
+ * 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.
2535
+ *
2536
+ */
2537
+ static deleteFormation(options) {
2538
+ return (options.client ?? client).delete({
2539
+ url: "/v1/projects/{project_id}/formations/{formation_id}",
2540
+ ...options
2541
+ });
2542
+ }
2543
+ /**
2544
+ * Get a specific formation
2545
+ *
2546
+ * Returns the formation stack including its current resources.
2547
+ */
2548
+ static getFormation(options) {
2549
+ return (options.client ?? client).get({
2550
+ url: "/v1/projects/{project_id}/formations/{formation_id}",
2551
+ ...options
2552
+ });
2553
+ }
2554
+ /**
2555
+ * Update an formation
2556
+ *
2557
+ * Applies a new template to the formation. Resources are created, updated, or deleted to reconcile the current state with the desired state.
2558
+ *
2559
+ * 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.
2560
+ *
2561
+ */
2562
+ static updateFormation(options) {
2563
+ return (options.client ?? client).put({
2564
+ url: "/v1/projects/{project_id}/formations/{formation_id}",
2565
+ ...options,
2566
+ headers: {
2567
+ "Content-Type": "application/json",
2568
+ ...options.headers
2569
+ }
2570
+ });
2571
+ }
2572
+ /**
2573
+ * List formation operation events
2574
+ *
2575
+ * Returns all operations (create, update, delete) with their event logs for the formation, ordered chronologically.
2576
+ *
2577
+ */
2578
+ static listFormationEvents(options) {
2579
+ return (options.client ?? client).get({
2580
+ url: "/v1/projects/{project_id}/formations/{formation_id}/events",
2581
+ ...options
2582
+ });
2583
+ }
2584
+ };
2465
2585
  var Generations = class {
2466
2586
  /**
2467
2587
  * List generations
@@ -4284,6 +4404,7 @@ var NaturaliClient = class {
4284
4404
  evaluations;
4285
4405
  exceptions;
4286
4406
  files;
4407
+ formations;
4287
4408
  generations;
4288
4409
  guardrails;
4289
4410
  ingestionRules;
@@ -4331,6 +4452,7 @@ var NaturaliClient = class {
4331
4452
  this.evaluations = bindResource(Evaluations, this.http);
4332
4453
  this.exceptions = bindResource(Exceptions, this.http);
4333
4454
  this.files = bindResource(Files, this.http);
4455
+ this.formations = bindResource(Formations, this.http);
4334
4456
  this.generations = bindResource(Generations, this.http);
4335
4457
  this.guardrails = bindResource(Guardrails, this.http);
4336
4458
  this.ingestionRules = bindResource(IngestionRules, this.http);
@@ -4371,6 +4493,7 @@ exports.Embeddings = Embeddings;
4371
4493
  exports.Evaluations = Evaluations;
4372
4494
  exports.Exceptions = Exceptions;
4373
4495
  exports.Files = Files;
4496
+ exports.Formations = Formations;
4374
4497
  exports.Generations = Generations;
4375
4498
  exports.Guardrails = Guardrails;
4376
4499
  exports.IngestionRules = IngestionRules;