@naturali/cli 0.42.0 → 0.42.2

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 +128 -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.0";
17
+ var version = "0.42.2";
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
@@ -2150,6 +2206,7 @@ var NaturaliClient = class {
2150
2206
  var src_exports = /* @__PURE__ */ __exportAll({
2151
2207
  Agents: () => Agents,
2152
2208
  ApiKeys: () => ApiKeys,
2209
+ Assistant: () => Assistant,
2153
2210
  Auth: () => Auth,
2154
2211
  Boards: () => Boards,
2155
2212
  Channels: () => Channels,
@@ -2940,6 +2997,76 @@ const routes = {
2940
2997
  "in": "path"
2941
2998
  }]
2942
2999
  },
3000
+ "list-assistant-grants": {
3001
+ serviceClass: "Assistant",
3002
+ operationId: "listAssistantGrants",
3003
+ 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.",
3004
+ moduleDocsUrl: "https://docs.naturali.ai/docs/modules/assistant",
3005
+ httpMethod: "get",
3006
+ pathParams: [],
3007
+ queryParams: ["limit", "cursor"],
3008
+ flags: [{
3009
+ "name": "limit",
3010
+ "description": "Maximum items per page.",
3011
+ "required": false,
3012
+ "type": "integer",
3013
+ "in": "query"
3014
+ }, {
3015
+ "name": "cursor",
3016
+ "description": "Opaque pagination cursor from a previous response's next_cursor.",
3017
+ "required": false,
3018
+ "type": "string",
3019
+ "in": "query"
3020
+ }]
3021
+ },
3022
+ "revoke-assistant-grant": {
3023
+ serviceClass: "Assistant",
3024
+ operationId: "revokeAssistantGrant",
3025
+ 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.",
3026
+ moduleDocsUrl: "https://docs.naturali.ai/docs/modules/assistant",
3027
+ httpMethod: "delete",
3028
+ pathParams: ["grant_id"],
3029
+ queryParams: [],
3030
+ flags: [{
3031
+ "name": "grant_id",
3032
+ "description": "Grant public ID (agr_ prefix).",
3033
+ "required": true,
3034
+ "type": "string",
3035
+ "in": "path"
3036
+ }]
3037
+ },
3038
+ "preview-assistant-link": {
3039
+ serviceClass: "Assistant",
3040
+ operationId: "previewAssistantLink",
3041
+ 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.",
3042
+ moduleDocsUrl: "https://docs.naturali.ai/docs/modules/assistant",
3043
+ httpMethod: "get",
3044
+ pathParams: [],
3045
+ queryParams: ["token"],
3046
+ flags: [{
3047
+ "name": "token",
3048
+ "description": "The single-use token from the link the Assistant sent on the channel.",
3049
+ "required": true,
3050
+ "type": "string",
3051
+ "in": "query"
3052
+ }]
3053
+ },
3054
+ "redeem-assistant-link": {
3055
+ serviceClass: "Assistant",
3056
+ operationId: "redeemAssistantLink",
3057
+ 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.",
3058
+ moduleDocsUrl: "https://docs.naturali.ai/docs/modules/assistant",
3059
+ httpMethod: "post",
3060
+ pathParams: [],
3061
+ queryParams: [],
3062
+ flags: [{
3063
+ "name": "token",
3064
+ "description": "The single-use token from the link the Assistant sent on the channel.",
3065
+ "required": true,
3066
+ "type": "string",
3067
+ "in": "body"
3068
+ }]
3069
+ },
2943
3070
  "request-sign-in-code": {
2944
3071
  serviceClass: "Auth",
2945
3072
  operationId: "requestSignInCode",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@naturali/cli",
3
- "version": "0.42.0",
3
+ "version": "0.42.2",
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.0"
33
+ "@naturali/sdk": "0.42.2"
34
34
  },
35
35
  "scripts": {
36
36
  "generate": "tsx scripts/generate.ts",