@naturali/cli 0.48.1 → 0.49.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.mjs +248 -1
- 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.
|
|
17
|
+
var version = "0.49.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) };
|
|
@@ -620,6 +620,78 @@ const createClient = (config = {}) => {
|
|
|
620
620
|
const client = createClient(createConfig());
|
|
621
621
|
//#endregion
|
|
622
622
|
//#region ../sdk/src/generated/sdk.gen.ts
|
|
623
|
+
var Actors = class {
|
|
624
|
+
/**
|
|
625
|
+
* List actors
|
|
626
|
+
*
|
|
627
|
+
* Lists the project's actors. Filter by `external_id` to resolve your own key to an actor without creating one.
|
|
628
|
+
*
|
|
629
|
+
*/
|
|
630
|
+
static listActors(options) {
|
|
631
|
+
return (options.client ?? client).get({
|
|
632
|
+
url: "/v1/projects/{project_id}/actors",
|
|
633
|
+
...options
|
|
634
|
+
});
|
|
635
|
+
}
|
|
636
|
+
/**
|
|
637
|
+
* Create an actor
|
|
638
|
+
*
|
|
639
|
+
* Creates the actor, or returns the one that already carries this `external_id`. Idempotent on that key: a retry returns the existing actor with `200` rather than creating a second one, so this is safe as the first call your backend makes when it sees a new user.
|
|
640
|
+
* `external_id` may not start with a channel prefix (`whatsapp:`, `discord:`, …) or `address:` — those name actors that belong to an [address](/docs/api/addresses/get-address), which owns its own.
|
|
641
|
+
*
|
|
642
|
+
*/
|
|
643
|
+
static createActor(options) {
|
|
644
|
+
return (options.client ?? client).post({
|
|
645
|
+
url: "/v1/projects/{project_id}/actors",
|
|
646
|
+
...options,
|
|
647
|
+
headers: {
|
|
648
|
+
"Content-Type": "application/json",
|
|
649
|
+
...options.headers
|
|
650
|
+
}
|
|
651
|
+
});
|
|
652
|
+
}
|
|
653
|
+
/**
|
|
654
|
+
* Erase an actor
|
|
655
|
+
*
|
|
656
|
+
* Removes the actor and the sessions it holds. Erasure of one identity as this API knows it — narrower than "erase this human everywhere", since naturali does not know that two identities are the same person and does not claim to.
|
|
657
|
+
* An actor that belongs to an [address](/docs/api/addresses/get-address) responds `409`: erase it through `DELETE /v1/projects/{project_id}/addresses/{identifier}`, which also removes the address and its conversations. Deleting it here would leave those behind, pointing at an identity that no longer exists.
|
|
658
|
+
*
|
|
659
|
+
*/
|
|
660
|
+
static deleteActor(options) {
|
|
661
|
+
return (options.client ?? client).delete({
|
|
662
|
+
url: "/v1/projects/{project_id}/actors/{actor_id}",
|
|
663
|
+
...options
|
|
664
|
+
});
|
|
665
|
+
}
|
|
666
|
+
/**
|
|
667
|
+
* Get an actor
|
|
668
|
+
*
|
|
669
|
+
* Returns one actor. An actor belonging to another project responds `404`, not `403` — the API never confirms that an id exists elsewhere.
|
|
670
|
+
*
|
|
671
|
+
*/
|
|
672
|
+
static getActor(options) {
|
|
673
|
+
return (options.client ?? client).get({
|
|
674
|
+
url: "/v1/projects/{project_id}/actors/{actor_id}",
|
|
675
|
+
...options
|
|
676
|
+
});
|
|
677
|
+
}
|
|
678
|
+
/**
|
|
679
|
+
* Update an actor
|
|
680
|
+
*
|
|
681
|
+
* Updates the fields present in the body and leaves the rest alone. `external_id` is not updatable: it is the key callers converge on, and moving it would silently orphan every reference they hold.
|
|
682
|
+
*
|
|
683
|
+
*/
|
|
684
|
+
static updateActor(options) {
|
|
685
|
+
return (options.client ?? client).patch({
|
|
686
|
+
url: "/v1/projects/{project_id}/actors/{actor_id}",
|
|
687
|
+
...options,
|
|
688
|
+
headers: {
|
|
689
|
+
"Content-Type": "application/json",
|
|
690
|
+
...options.headers
|
|
691
|
+
}
|
|
692
|
+
});
|
|
693
|
+
}
|
|
694
|
+
};
|
|
623
695
|
var Channels = class {
|
|
624
696
|
/**
|
|
625
697
|
* List addresses
|
|
@@ -2151,6 +2223,7 @@ const API_BASE_URL$1 = "https://api.naturali.ai";
|
|
|
2151
2223
|
* is available as typed data.
|
|
2152
2224
|
*/
|
|
2153
2225
|
var NaturaliClient = class {
|
|
2226
|
+
actors;
|
|
2154
2227
|
agents;
|
|
2155
2228
|
apiKeys;
|
|
2156
2229
|
assistant;
|
|
@@ -2177,6 +2250,7 @@ var NaturaliClient = class {
|
|
|
2177
2250
|
...headers
|
|
2178
2251
|
}
|
|
2179
2252
|
}));
|
|
2253
|
+
this.actors = bindResource(Actors, this.http);
|
|
2180
2254
|
this.agents = bindResource(Agents, this.http);
|
|
2181
2255
|
this.apiKeys = bindResource(ApiKeys, this.http);
|
|
2182
2256
|
this.assistant = bindResource(Assistant, this.http);
|
|
@@ -2198,6 +2272,7 @@ var NaturaliClient = class {
|
|
|
2198
2272
|
//#endregion
|
|
2199
2273
|
//#region ../sdk/src/index.ts
|
|
2200
2274
|
var src_exports = /* @__PURE__ */ __exportAll({
|
|
2275
|
+
Actors: () => Actors,
|
|
2201
2276
|
Agents: () => Agents,
|
|
2202
2277
|
ApiKeys: () => ApiKeys,
|
|
2203
2278
|
Assistant: () => Assistant,
|
|
@@ -2580,6 +2655,178 @@ const dispatchCommand = async (args) => {
|
|
|
2580
2655
|
//#endregion
|
|
2581
2656
|
//#region src/generated/routes.ts
|
|
2582
2657
|
const routes = {
|
|
2658
|
+
"list-actors": {
|
|
2659
|
+
serviceClass: "Actors",
|
|
2660
|
+
operationId: "listActors",
|
|
2661
|
+
description: "Lists the project's actors. Filter by `external_id` to resolve your own key to an actor without creating one.",
|
|
2662
|
+
moduleDocsUrl: "https://docs.naturali.ai/docs/modules/actors",
|
|
2663
|
+
httpMethod: "get",
|
|
2664
|
+
pathParams: ["project_id"],
|
|
2665
|
+
queryParams: [
|
|
2666
|
+
"external_id",
|
|
2667
|
+
"limit",
|
|
2668
|
+
"offset"
|
|
2669
|
+
],
|
|
2670
|
+
flags: [
|
|
2671
|
+
{
|
|
2672
|
+
"name": "project_id",
|
|
2673
|
+
"description": "Project public ID (proj_ prefix).",
|
|
2674
|
+
"required": true,
|
|
2675
|
+
"type": "string",
|
|
2676
|
+
"in": "path"
|
|
2677
|
+
},
|
|
2678
|
+
{
|
|
2679
|
+
"name": "external_id",
|
|
2680
|
+
"description": "Return only the actor carrying this external ID.",
|
|
2681
|
+
"required": false,
|
|
2682
|
+
"type": "string",
|
|
2683
|
+
"in": "query"
|
|
2684
|
+
},
|
|
2685
|
+
{
|
|
2686
|
+
"name": "limit",
|
|
2687
|
+
"description": "Maximum items to return (1–100).",
|
|
2688
|
+
"required": false,
|
|
2689
|
+
"type": "integer",
|
|
2690
|
+
"in": "query"
|
|
2691
|
+
},
|
|
2692
|
+
{
|
|
2693
|
+
"name": "offset",
|
|
2694
|
+
"description": "Items to skip. This list pages by offset rather than by naturali's usual opaque cursor because the upstream ordering is offset-based; a cursor here would only imitate a keyset.\n",
|
|
2695
|
+
"required": false,
|
|
2696
|
+
"type": "integer",
|
|
2697
|
+
"in": "query"
|
|
2698
|
+
}
|
|
2699
|
+
]
|
|
2700
|
+
},
|
|
2701
|
+
"create-actor": {
|
|
2702
|
+
serviceClass: "Actors",
|
|
2703
|
+
operationId: "createActor",
|
|
2704
|
+
description: "Creates the actor, or returns the one that already carries this `external_id`. Idempotent on that key: a retry returns the existing actor with `200` rather than creating a second one, so this is safe as the first call your backend makes when it sees a new user. `external_id` may not start with a channel prefix (`whatsapp:`, `discord:`, …) or `address:` — those name actors that belong to an [address](/docs/api/addresses/get-address), which owns its own.",
|
|
2705
|
+
moduleDocsUrl: "https://docs.naturali.ai/docs/modules/actors",
|
|
2706
|
+
httpMethod: "post",
|
|
2707
|
+
pathParams: ["project_id"],
|
|
2708
|
+
queryParams: [],
|
|
2709
|
+
flags: [
|
|
2710
|
+
{
|
|
2711
|
+
"name": "project_id",
|
|
2712
|
+
"description": "Project public ID (proj_ prefix).",
|
|
2713
|
+
"required": true,
|
|
2714
|
+
"type": "string",
|
|
2715
|
+
"in": "path"
|
|
2716
|
+
},
|
|
2717
|
+
{
|
|
2718
|
+
"name": "external_id",
|
|
2719
|
+
"description": "Your own key for this person — the idempotency key this call converges on. May not start with a channel prefix (`whatsapp:`, `discord:`, …) or `address:`.\n",
|
|
2720
|
+
"required": true,
|
|
2721
|
+
"type": "string",
|
|
2722
|
+
"in": "body"
|
|
2723
|
+
},
|
|
2724
|
+
{
|
|
2725
|
+
"name": "name",
|
|
2726
|
+
"description": "A human-friendly name. Defaults to `external_id`.",
|
|
2727
|
+
"required": false,
|
|
2728
|
+
"type": "string",
|
|
2729
|
+
"in": "body"
|
|
2730
|
+
},
|
|
2731
|
+
{
|
|
2732
|
+
"name": "instructions",
|
|
2733
|
+
"description": "Persona instructions composed into the agent's prompt for this actor's turns. Treat as trusted input: text an end user controls reaches the agent's instructions verbatim.\n",
|
|
2734
|
+
"required": false,
|
|
2735
|
+
"type": "string",
|
|
2736
|
+
"in": "body"
|
|
2737
|
+
},
|
|
2738
|
+
{
|
|
2739
|
+
"name": "memory",
|
|
2740
|
+
"description": "Give the actor its own memory container, so an agent remembers it across sessions. Applied on creation only — a call that returns an existing actor leaves its memory as it was.\n",
|
|
2741
|
+
"required": false,
|
|
2742
|
+
"type": "boolean",
|
|
2743
|
+
"in": "body"
|
|
2744
|
+
}
|
|
2745
|
+
]
|
|
2746
|
+
},
|
|
2747
|
+
"get-actor": {
|
|
2748
|
+
serviceClass: "Actors",
|
|
2749
|
+
operationId: "getActor",
|
|
2750
|
+
description: "Returns one actor. An actor belonging to another project responds `404`, not `403` — the API never confirms that an id exists elsewhere.",
|
|
2751
|
+
moduleDocsUrl: "https://docs.naturali.ai/docs/modules/actors",
|
|
2752
|
+
httpMethod: "get",
|
|
2753
|
+
pathParams: ["project_id", "actor_id"],
|
|
2754
|
+
queryParams: [],
|
|
2755
|
+
flags: [{
|
|
2756
|
+
"name": "project_id",
|
|
2757
|
+
"description": "Project public ID (proj_ prefix).",
|
|
2758
|
+
"required": true,
|
|
2759
|
+
"type": "string",
|
|
2760
|
+
"in": "path"
|
|
2761
|
+
}, {
|
|
2762
|
+
"name": "actor_id",
|
|
2763
|
+
"description": "Actor public ID (actor_ prefix).",
|
|
2764
|
+
"required": true,
|
|
2765
|
+
"type": "string",
|
|
2766
|
+
"in": "path"
|
|
2767
|
+
}]
|
|
2768
|
+
},
|
|
2769
|
+
"update-actor": {
|
|
2770
|
+
serviceClass: "Actors",
|
|
2771
|
+
operationId: "updateActor",
|
|
2772
|
+
description: "Updates the fields present in the body and leaves the rest alone. `external_id` is not updatable: it is the key callers converge on, and moving it would silently orphan every reference they hold.",
|
|
2773
|
+
moduleDocsUrl: "https://docs.naturali.ai/docs/modules/actors",
|
|
2774
|
+
httpMethod: "patch",
|
|
2775
|
+
pathParams: ["project_id", "actor_id"],
|
|
2776
|
+
queryParams: [],
|
|
2777
|
+
flags: [
|
|
2778
|
+
{
|
|
2779
|
+
"name": "project_id",
|
|
2780
|
+
"description": "Project public ID (proj_ prefix).",
|
|
2781
|
+
"required": true,
|
|
2782
|
+
"type": "string",
|
|
2783
|
+
"in": "path"
|
|
2784
|
+
},
|
|
2785
|
+
{
|
|
2786
|
+
"name": "actor_id",
|
|
2787
|
+
"description": "Actor public ID (actor_ prefix).",
|
|
2788
|
+
"required": true,
|
|
2789
|
+
"type": "string",
|
|
2790
|
+
"in": "path"
|
|
2791
|
+
},
|
|
2792
|
+
{
|
|
2793
|
+
"name": "name",
|
|
2794
|
+
"description": "",
|
|
2795
|
+
"required": false,
|
|
2796
|
+
"type": "string",
|
|
2797
|
+
"in": "body"
|
|
2798
|
+
},
|
|
2799
|
+
{
|
|
2800
|
+
"name": "instructions",
|
|
2801
|
+
"description": "Null clears the persona instructions.",
|
|
2802
|
+
"required": false,
|
|
2803
|
+
"type": "string",
|
|
2804
|
+
"in": "body"
|
|
2805
|
+
}
|
|
2806
|
+
]
|
|
2807
|
+
},
|
|
2808
|
+
"delete-actor": {
|
|
2809
|
+
serviceClass: "Actors",
|
|
2810
|
+
operationId: "deleteActor",
|
|
2811
|
+
description: "Removes the actor and the sessions it holds. Erasure of one identity as this API knows it — narrower than \"erase this human everywhere\", since naturali does not know that two identities are the same person and does not claim to. An actor that belongs to an [address](/docs/api/addresses/get-address) responds `409`: erase it through `DELETE /v1/projects/{project_id}/addresses/{identifier}`, which also removes the address and its conversations. Deleting it here would leave those behind, pointing at an identity that no longer exists.",
|
|
2812
|
+
moduleDocsUrl: "https://docs.naturali.ai/docs/modules/actors",
|
|
2813
|
+
httpMethod: "delete",
|
|
2814
|
+
pathParams: ["project_id", "actor_id"],
|
|
2815
|
+
queryParams: [],
|
|
2816
|
+
flags: [{
|
|
2817
|
+
"name": "project_id",
|
|
2818
|
+
"description": "Project public ID (proj_ prefix).",
|
|
2819
|
+
"required": true,
|
|
2820
|
+
"type": "string",
|
|
2821
|
+
"in": "path"
|
|
2822
|
+
}, {
|
|
2823
|
+
"name": "actor_id",
|
|
2824
|
+
"description": "Actor public ID (actor_ prefix).",
|
|
2825
|
+
"required": true,
|
|
2826
|
+
"type": "string",
|
|
2827
|
+
"in": "path"
|
|
2828
|
+
}]
|
|
2829
|
+
},
|
|
2583
2830
|
"list-addresses": {
|
|
2584
2831
|
serviceClass: "Channels",
|
|
2585
2832
|
operationId: "listAddresses",
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@naturali/cli",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.49.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.
|
|
33
|
+
"@naturali/sdk": "0.49.0"
|
|
34
34
|
},
|
|
35
35
|
"scripts": {
|
|
36
36
|
"generate": "tsx scripts/generate.ts",
|