@naturali/cli 0.42.1 → 0.43.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.
Files changed (2) hide show
  1. package/dist/index.mjs +130 -1
  2. 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.42.1";
17
+ var version = "0.43.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) };
@@ -765,6 +765,62 @@ var ApiKeys = class {
765
765
  });
766
766
  }
767
767
  };
768
+ var Assistant = class {
769
+ /**
770
+ * List linked identities
771
+ *
772
+ * Lists the caller's assistant grants — one per channel identity that may operate their account. Grants belong to the account, so this is the caller's own set regardless of which projects they own.
773
+ *
774
+ */
775
+ static listAssistantGrants(options) {
776
+ return (options?.client ?? client).get({
777
+ url: "/v1/assistant/grants",
778
+ ...options
779
+ });
780
+ }
781
+ /**
782
+ * Revoke a linked identity
783
+ *
784
+ * Revokes the grant, disabling the Assistant for that identity. The grant is resolved on every inbound message, so the next one from that identity is refused before the agent is invoked — revocation is immediate, not eventual. The identity is free to link again afterwards.
785
+ *
786
+ */
787
+ static revokeAssistantGrant(options) {
788
+ return (options.client ?? client).delete({
789
+ url: "/v1/assistant/grants/{grant_id}",
790
+ ...options
791
+ });
792
+ }
793
+ /**
794
+ * Resolve a pending link
795
+ *
796
+ * Resolves a link token **without consuming it**, so the confirmation screen can name the identity being linked ("@user on Discord") before anyone commits to it. Naming it is what makes a link pasted into the wrong hands fail the human check as well as the server-side binding.
797
+ * Reading is deliberately separate from redeeming: a single-use nonce must not be burned by a link preview, a URL scanner or a browser prefetch.
798
+ *
799
+ */
800
+ static previewAssistantLink(options) {
801
+ return (options.client ?? client).get({
802
+ url: "/v1/assistant/link",
803
+ ...options
804
+ });
805
+ }
806
+ /**
807
+ * Redeem a link token
808
+ *
809
+ * Redeems a link token and creates the grant, binding the channel identity the token carries to the authenticated account. The identity is read from the token server-side — nothing in this request can point the link at a different one.
810
+ * The token is the idempotency key: it is single-use, so a replay of this request fails rather than creating a second grant.
811
+ *
812
+ */
813
+ static redeemAssistantLink(options) {
814
+ return (options.client ?? client).post({
815
+ url: "/v1/assistant/link",
816
+ ...options,
817
+ headers: {
818
+ "Content-Type": "application/json",
819
+ ...options.headers
820
+ }
821
+ });
822
+ }
823
+ };
768
824
  var Auth = class {
769
825
  /**
770
826
  * Email a sign-in code
@@ -2103,6 +2159,7 @@ const API_BASE_URL$1 = "https://api.naturali.ai";
2103
2159
  var NaturaliClient = class {
2104
2160
  agents;
2105
2161
  apiKeys;
2162
+ assistant;
2106
2163
  auth;
2107
2164
  boards;
2108
2165
  channels;
@@ -2129,6 +2186,7 @@ var NaturaliClient = class {
2129
2186
  }));
2130
2187
  this.agents = bindResource(Agents, this.http);
2131
2188
  this.apiKeys = bindResource(ApiKeys, this.http);
2189
+ this.assistant = bindResource(Assistant, this.http);
2132
2190
  this.auth = bindResource(Auth, this.http);
2133
2191
  this.boards = bindResource(Boards, this.http);
2134
2192
  this.channels = bindResource(Channels, this.http);
@@ -2150,6 +2208,7 @@ var NaturaliClient = class {
2150
2208
  var src_exports = /* @__PURE__ */ __exportAll({
2151
2209
  Agents: () => Agents,
2152
2210
  ApiKeys: () => ApiKeys,
2211
+ Assistant: () => Assistant,
2153
2212
  Auth: () => Auth,
2154
2213
  Boards: () => Boards,
2155
2214
  Channels: () => Channels,
@@ -2940,6 +2999,76 @@ const routes = {
2940
2999
  "in": "path"
2941
3000
  }]
2942
3001
  },
3002
+ "list-assistant-grants": {
3003
+ serviceClass: "Assistant",
3004
+ operationId: "listAssistantGrants",
3005
+ description: "Lists the caller's assistant grants — one per channel identity that may operate their account. Grants belong to the account, so this is the caller's own set regardless of which projects they own.",
3006
+ moduleDocsUrl: "https://docs.naturali.ai/docs/modules/assistant",
3007
+ httpMethod: "get",
3008
+ pathParams: [],
3009
+ queryParams: ["limit", "cursor"],
3010
+ flags: [{
3011
+ "name": "limit",
3012
+ "description": "Maximum items per page.",
3013
+ "required": false,
3014
+ "type": "integer",
3015
+ "in": "query"
3016
+ }, {
3017
+ "name": "cursor",
3018
+ "description": "Opaque pagination cursor from a previous response's next_cursor.",
3019
+ "required": false,
3020
+ "type": "string",
3021
+ "in": "query"
3022
+ }]
3023
+ },
3024
+ "revoke-assistant-grant": {
3025
+ serviceClass: "Assistant",
3026
+ operationId: "revokeAssistantGrant",
3027
+ description: "Revokes the grant, disabling the Assistant for that identity. The grant is resolved on every inbound message, so the next one from that identity is refused before the agent is invoked — revocation is immediate, not eventual. The identity is free to link again afterwards.",
3028
+ moduleDocsUrl: "https://docs.naturali.ai/docs/modules/assistant",
3029
+ httpMethod: "delete",
3030
+ pathParams: ["grant_id"],
3031
+ queryParams: [],
3032
+ flags: [{
3033
+ "name": "grant_id",
3034
+ "description": "Grant public ID (agr_ prefix).",
3035
+ "required": true,
3036
+ "type": "string",
3037
+ "in": "path"
3038
+ }]
3039
+ },
3040
+ "preview-assistant-link": {
3041
+ serviceClass: "Assistant",
3042
+ operationId: "previewAssistantLink",
3043
+ description: "Resolves a link token **without consuming it**, so the confirmation screen can name the identity being linked (\"@user on Discord\") before anyone commits to it. Naming it is what makes a link pasted into the wrong hands fail the human check as well as the server-side binding. Reading is deliberately separate from redeeming: a single-use nonce must not be burned by a link preview, a URL scanner or a browser prefetch.",
3044
+ moduleDocsUrl: "https://docs.naturali.ai/docs/modules/assistant",
3045
+ httpMethod: "get",
3046
+ pathParams: [],
3047
+ queryParams: ["token"],
3048
+ flags: [{
3049
+ "name": "token",
3050
+ "description": "The single-use token from the link the Assistant sent on the channel.",
3051
+ "required": true,
3052
+ "type": "string",
3053
+ "in": "query"
3054
+ }]
3055
+ },
3056
+ "redeem-assistant-link": {
3057
+ serviceClass: "Assistant",
3058
+ operationId: "redeemAssistantLink",
3059
+ description: "Redeems a link token and creates the grant, binding the channel identity the token carries to the authenticated account. The identity is read from the token server-side — nothing in this request can point the link at a different one. The token is the idempotency key: it is single-use, so a replay of this request fails rather than creating a second grant.",
3060
+ moduleDocsUrl: "https://docs.naturali.ai/docs/modules/assistant",
3061
+ httpMethod: "post",
3062
+ pathParams: [],
3063
+ queryParams: [],
3064
+ flags: [{
3065
+ "name": "token",
3066
+ "description": "The single-use token from the link the Assistant sent on the channel.",
3067
+ "required": true,
3068
+ "type": "string",
3069
+ "in": "body"
3070
+ }]
3071
+ },
2943
3072
  "request-sign-in-code": {
2944
3073
  serviceClass: "Auth",
2945
3074
  operationId: "requestSignInCode",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@naturali/cli",
3
- "version": "0.42.1",
3
+ "version": "0.43.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.42.1"
33
+ "@naturali/sdk": "0.43.0"
34
34
  },
35
35
  "scripts": {
36
36
  "generate": "tsx scripts/generate.ts",