needle-cloud 1.10.3-dev.14eac62 → 1.10.3-dev.2679141

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.
@@ -62,11 +62,6 @@ export namespace Auth {
62
62
  * Initiate the sign-in process
63
63
  */
64
64
  function signIn(): Promise<void>;
65
- /**
66
- * Get the user's default team/org ID from their Logto custom_data.
67
- * @returns {string | undefined}
68
- */
69
- function getDefaultTeamId(): string;
70
65
  /**
71
66
  * Sign out the current user
72
67
  */
@@ -1,78 +1,77 @@
1
1
  /**
2
2
  * List recent AI chats for the authenticated user.
3
- * @param {ChatAuthOpts} [opts]
3
+ * @param {{ org?: string }} [opts]
4
4
  * @returns {Promise<import("@needle-tools/cloud-sdk/types/api.ai").RecentChatsResponse>}
5
5
  */
6
- export function listChats(opts?: ChatAuthOpts): Promise<import("@needle-tools/cloud-sdk/types/api.ai").RecentChatsResponse>;
6
+ export function listChats(opts?: {
7
+ org?: string;
8
+ }): Promise<import("@needle-tools/cloud-sdk/types/api.ai").RecentChatsResponse>;
7
9
  /**
8
10
  * Read an AI chat by slug. Returns JSON with messages by default.
9
11
  * When `reconnect: true`, attempts to reconnect to an active SSE stream.
10
12
  * @overload
11
13
  * @param {string} slug
12
- * @param {ChatAuthOpts & { offset?: number, limit?: number, personal?: boolean, reconnect?: false }} [opts]
14
+ * @param {{ org?: string, offset?: number, limit?: number, personal?: boolean, reconnect?: false }} [opts]
13
15
  * @returns {Promise<import("@needle-tools/cloud-sdk/types/api.ai").AIChatGETResponse>}
14
16
  */
15
17
  /**
16
18
  * @overload
17
19
  * @param {string} slug
18
- * @param {ChatAuthOpts & { personal?: boolean, reconnect: true, signal?: AbortSignal }} opts
20
+ * @param {{ org?: string, personal?: boolean, reconnect: true, signal?: AbortSignal }} opts
19
21
  * @returns {Promise<AsyncGenerator<import("@needle-tools/cloud-sdk/types/api.ai").ChatStreamEvent> | null>}
20
22
  */
21
23
  /**
22
24
  * @param {string} slug
23
- * @param {ChatAuthOpts & { offset?: number, limit?: number, personal?: boolean, reconnect?: boolean, signal?: AbortSignal }} [opts]
25
+ * @param {{ org?: string, offset?: number, limit?: number, personal?: boolean, reconnect?: boolean, signal?: AbortSignal }} [opts]
24
26
  * @returns {Promise<import("@needle-tools/cloud-sdk/types/api.ai").AIChatGETResponse | AsyncGenerator<import("@needle-tools/cloud-sdk/types/api.ai").ChatStreamEvent> | null>}
25
27
  */
26
- export function readChat(slug: string, opts?: ChatAuthOpts & {
28
+ export function readChat(slug: string, opts?: {
29
+ org?: string;
27
30
  offset?: number;
28
31
  limit?: number;
29
32
  personal?: boolean;
30
33
  reconnect?: boolean;
31
34
  signal?: AbortSignal;
32
35
  }): Promise<import("@needle-tools/cloud-sdk/types/api.ai").AIChatGETResponse | AsyncGenerator<import("@needle-tools/cloud-sdk/types/api.ai").ChatStreamEvent> | null>;
33
- /**
34
- * @typedef {import("@needle-tools/cloud-sdk/types/api.ai").ClientToolDefinition} ClientToolDefinition
35
- * @typedef {import("@needle-tools/cloud-sdk/types/api.ai").ClientContext} ClientContext
36
- * @typedef {import("@needle-tools/cloud-sdk/types/api.ai").ChatStreamEvent} ChatStreamEvent
37
- * @typedef {import("@needle-tools/cloud-sdk/types/api.ai").AIChatSyncResponse} AIChatSyncResponse
38
- */
39
36
  /**
40
37
  * Send a message to an AI chat.
41
38
  * @overload
42
39
  * @param {string} slug
43
40
  * @param {string} message
44
- * @param {ChatAuthOpts & { stream?: false, source?: string, personal?: boolean, full_url?: string, pathname?: string, client_tools?: ClientToolDefinition[], context?: ClientContext[] }} [opts]
45
- * @returns {Promise<AIChatSyncResponse>}
41
+ * @param {{ org?: string, stream?: false, source?: string, personal?: boolean, full_url?: string, pathname?: string, client_tools?: import("@needle-tools/cloud-sdk/types/api.ai").ClientToolDefinition[], context?: import("@needle-tools/cloud-sdk/types/api.ai").ClientContext[] }} [opts]
42
+ * @returns {Promise<import("@needle-tools/cloud-sdk/types/api.ai").AIChatSyncResponse>}
46
43
  */
47
44
  /**
48
45
  * @overload
49
46
  * @param {string} slug
50
47
  * @param {string} message
51
- * @param {ChatAuthOpts & { stream: true, source?: string, personal?: boolean, full_url?: string, pathname?: string, client_tools?: ClientToolDefinition[], context?: ClientContext[] }} opts
52
- * @returns {Promise<AsyncGenerator<ChatStreamEvent>>}
48
+ * @param {{ org?: string, stream: true, source?: string, personal?: boolean, full_url?: string, pathname?: string, client_tools?: import("@needle-tools/cloud-sdk/types/api.ai").ClientToolDefinition[], context?: import("@needle-tools/cloud-sdk/types/api.ai").ClientContext[] }} opts
49
+ * @returns {Promise<AsyncGenerator<import("@needle-tools/cloud-sdk/types/api.ai").ChatStreamEvent>>}
53
50
  */
54
51
  /**
55
52
  * @param {string} slug
56
53
  * @param {string} message
57
- * @param {ChatAuthOpts & { stream?: boolean, source?: string, personal?: boolean, full_url?: string, pathname?: string, client_tools?: ClientToolDefinition[], context?: ClientContext[] }} [opts]
58
- * @returns {Promise<AIChatSyncResponse | AsyncGenerator<ChatStreamEvent>>}
54
+ * @param {{ org?: string, stream?: boolean, source?: string, personal?: boolean, full_url?: string, pathname?: string, client_tools?: import("@needle-tools/cloud-sdk/types/api.ai").ClientToolDefinition[], context?: import("@needle-tools/cloud-sdk/types/api.ai").ClientContext[] }} [opts]
55
+ * @returns {Promise<import("@needle-tools/cloud-sdk/types/api.ai").AIChatSyncResponse | AsyncGenerator<import("@needle-tools/cloud-sdk/types/api.ai").ChatStreamEvent>>}
59
56
  */
60
- export function sendChatMessage(slug: string, message: string, opts?: ChatAuthOpts & {
57
+ export function sendChatMessage(slug: string, message: string, opts?: {
58
+ org?: string;
61
59
  stream?: boolean;
62
60
  source?: string;
63
61
  personal?: boolean;
64
62
  full_url?: string;
65
63
  pathname?: string;
66
- client_tools?: ClientToolDefinition[];
67
- context?: ClientContext[];
68
- }): Promise<AIChatSyncResponse | AsyncGenerator<ChatStreamEvent>>;
64
+ client_tools?: import("@needle-tools/cloud-sdk/types/api.ai").ClientToolDefinition[];
65
+ context?: import("@needle-tools/cloud-sdk/types/api.ai").ClientContext[];
66
+ }): Promise<import("@needle-tools/cloud-sdk/types/api.ai").AIChatSyncResponse | AsyncGenerator<import("@needle-tools/cloud-sdk/types/api.ai").ChatStreamEvent>>;
69
67
  /**
70
68
  * Interrupt an active AI generation for the given chat slug.
71
69
  * @param {string} slug
72
- * @param {ChatAuthOpts & { personal?: boolean }} [opts]
70
+ * @param {{ org?: string, personal?: boolean }} [opts]
73
71
  * @returns {Promise<void>}
74
72
  */
75
- export function interruptChat(slug: string, opts?: ChatAuthOpts & {
73
+ export function interruptChat(slug: string, opts?: {
74
+ org?: string;
76
75
  personal?: boolean;
77
76
  }): Promise<void>;
78
77
  /**
@@ -80,20 +79,13 @@ export function interruptChat(slug: string, opts?: ChatAuthOpts & {
80
79
  * Call this when you receive a `client_tool_request` event from the SSE stream.
81
80
  * @param {string} requestId - The `request_id` from the `client_tool_request` event
82
81
  * @param {{ result?: any, error?: string }} outcome - The tool result or error
83
- * @param {ChatAuthOpts & { personal?: boolean }} [opts]
82
+ * @param {{ org?: string, personal?: boolean }} [opts]
84
83
  * @returns {Promise<void>}
85
84
  */
86
85
  export function submitToolResult(requestId: string, outcome: {
87
86
  result?: any;
88
87
  error?: string;
89
- }, opts?: ChatAuthOpts & {
88
+ }, opts?: {
89
+ org?: string;
90
90
  personal?: boolean;
91
91
  }): Promise<void>;
92
- export type ChatAuthOpts = {
93
- org?: string;
94
- authToken?: string;
95
- };
96
- export type ClientToolDefinition = import("@needle-tools/cloud-sdk/types/api.ai").ClientToolDefinition;
97
- export type ClientContext = import("@needle-tools/cloud-sdk/types/api.ai").ClientContext;
98
- export type ChatStreamEvent = import("@needle-tools/cloud-sdk/types/api.ai").ChatStreamEvent;
99
- export type AIChatSyncResponse = import("@needle-tools/cloud-sdk/types/api.ai").AIChatSyncResponse;
@@ -1,6 +1,5 @@
1
1
  /**
2
2
  * @param {string | null | undefined} [org]
3
- * @param {string | null | undefined} [authToken] - Explicit auth token. If provided, skips Auth.requestAccessToken().
4
3
  * @returns {Promise<import("../web.types").AuthData>}
5
4
  */
6
- export function getAuthHeader(org?: string | null | undefined, authToken?: string | null | undefined): Promise<import("../web.types").AuthData>;
5
+ export function getAuthHeader(org?: string | null | undefined): Promise<import("../web.types").AuthData>;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "needle-cloud",
3
- "version": "1.10.3-dev.14eac62",
3
+ "version": "1.10.3-dev.2679141",
4
4
  "type": "module",
5
5
  "bin": {
6
6
  "needle-cloud": "./bin/cli.js"