needle-cloud 1.10.3-dev.14eac62 → 1.10.3-dev.1778262641.01d1717

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.
@@ -73,6 +73,7 @@ export namespace Auth {
73
73
  function signOut(): Promise<void>;
74
74
  }
75
75
  export type UserInfoResponse = import("@logto/browser").UserInfoResponse;
76
+ export type LogtoUserCustomData = import("@needle-tools/cloud-sdk/types/logto").LogtoUserCustomData;
76
77
  export type ResourceUrl = "https://cloud.needle.tools/api" | ({} & string);
77
78
  export type AuthInitOpts = {
78
79
  appId?: string;
@@ -1,27 +1,27 @@
1
1
  /**
2
2
  * List recent AI chats for the authenticated user.
3
3
  * @param {ChatAuthOpts} [opts]
4
- * @returns {Promise<import("@needle-tools/cloud-sdk/types/api.ai").RecentChatsResponse>}
4
+ * @returns {Promise<RecentChatsResponse>}
5
5
  */
6
- export function listChats(opts?: ChatAuthOpts): Promise<import("@needle-tools/cloud-sdk/types/api.ai").RecentChatsResponse>;
6
+ export function listChats(opts?: ChatAuthOpts): Promise<RecentChatsResponse>;
7
7
  /**
8
8
  * Read an AI chat by slug. Returns JSON with messages by default.
9
9
  * When `reconnect: true`, attempts to reconnect to an active SSE stream.
10
10
  * @overload
11
11
  * @param {string} slug
12
12
  * @param {ChatAuthOpts & { offset?: number, limit?: number, personal?: boolean, reconnect?: false }} [opts]
13
- * @returns {Promise<import("@needle-tools/cloud-sdk/types/api.ai").AIChatGETResponse>}
13
+ * @returns {Promise<AIChatGETResponse>}
14
14
  */
15
15
  /**
16
16
  * @overload
17
17
  * @param {string} slug
18
18
  * @param {ChatAuthOpts & { personal?: boolean, reconnect: true, signal?: AbortSignal }} opts
19
- * @returns {Promise<AsyncGenerator<import("@needle-tools/cloud-sdk/types/api.ai").ChatStreamEvent> | null>}
19
+ * @returns {Promise<AsyncGenerator<ChatStreamEvent> | null>}
20
20
  */
21
21
  /**
22
22
  * @param {string} slug
23
23
  * @param {ChatAuthOpts & { offset?: number, limit?: number, personal?: boolean, reconnect?: boolean, signal?: AbortSignal }} [opts]
24
- * @returns {Promise<import("@needle-tools/cloud-sdk/types/api.ai").AIChatGETResponse | AsyncGenerator<import("@needle-tools/cloud-sdk/types/api.ai").ChatStreamEvent> | null>}
24
+ * @returns {Promise<AIChatGETResponse | AsyncGenerator<ChatStreamEvent> | null>}
25
25
  */
26
26
  export function readChat(slug: string, opts?: ChatAuthOpts & {
27
27
  offset?: number;
@@ -29,13 +29,7 @@ export function readChat(slug: string, opts?: ChatAuthOpts & {
29
29
  personal?: boolean;
30
30
  reconnect?: boolean;
31
31
  signal?: AbortSignal;
32
- }): 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
- */
32
+ }): Promise<AIChatGETResponse | AsyncGenerator<ChatStreamEvent> | null>;
39
33
  /**
40
34
  * Send a message to an AI chat.
41
35
  * @overload
@@ -93,7 +87,9 @@ export type ChatAuthOpts = {
93
87
  org?: string;
94
88
  authToken?: string;
95
89
  };
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;
90
+ export type RecentChatsResponse = import("../web.types.js").RecentChatsResponse;
91
+ export type AIChatGETResponse = import("../web.types.js").AIChatGETResponse;
92
+ export type ChatStreamEvent = import("../web.types.js").ChatStreamEvent;
93
+ export type ClientToolDefinition = import("../web.types.js").ClientToolDefinition;
94
+ export type ClientContext = import("../web.types.js").ClientContext;
95
+ export type AIChatSyncResponse = import("../web.types.js").AIChatSyncResponse;
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.1778262641.01d1717",
4
4
  "type": "module",
5
5
  "bin": {
6
6
  "needle-cloud": "./bin/cli.js"
@@ -11,6 +11,13 @@
11
11
  "types": "./dist/index.d.ts",
12
12
  "node": "./dist/cli.esm.js"
13
13
  },
14
+ "files": [
15
+ "bin/",
16
+ "dist/",
17
+ "README.md",
18
+ "CHANGELOG.md",
19
+ "package-lock.json"
20
+ ],
14
21
  "dependencies": {
15
22
  "@caporal/core": "^2.0.7",
16
23
  "@logto/browser": "^3.0.7",
@@ -30,8 +37,11 @@
30
37
  },
31
38
  "devDependencies": {
32
39
  "@needle-tools/cloud-sdk": "1.0.0-alpha",
40
+ "@rollup/plugin-alias": "^6.0.0",
33
41
  "concurrently": "^9.0.1",
34
- "microbundle": "^0.15.1"
42
+ "microbundle": "^0.15.1",
43
+ "rollup": "^4.60.3",
44
+ "rollup-plugin-dts": "^6.4.1"
35
45
  },
36
46
  "engines": {
37
47
  "node": ">= 18"
@@ -45,20 +55,14 @@
45
55
  "dev": "concurrently --kill-others \"npm run dev:web\" \"npm run dev:node\"",
46
56
  "dev:web": "microbundle watch -i ./src/index.js -o dist/index.js --format esm --generateTypes --target web --no-compress",
47
57
  "dev:node": "microbundle watch -i ./src/cli.js -o dist/cli.js --format esm --target node --no-compress",
48
- "dist": "npx --yes rimraf dist && npm run dist:web && npm run dist:node",
58
+ "dist": "npx --yes rimraf dist && npm run dist:web && npm run dist:types && npm run dist:node",
49
59
  "dist:web": "microbundle -i ./src/index.js -o dist/index.js --format esm --generateTypes --target web --sourcemap false --compress true --define api_endpoint=https://cloud.needle.tools/api,cloud_base_url=https://cloud.needle.tools,logto_endpoint=https://auth.needle.tools,logto_app_id=2stnsoa6a1b0gwc7lra55,logto_app_secret=seV1T6iKBKLlttjdk25I2px43ZCEHnPJ",
50
60
  "dist:web-preview": "microbundle -i ./src/index.js -o dist/index.js --format esm --generateTypes --target web --sourcemap false --compress true --define api_endpoint=https://cloud-staging.needle.tools/api,cloud_base_url=https://cloud-staging.needle.tools,logto_endpoint=https://auth.needle.tools,logto_app_id=2stnsoa6a1b0gwc7lra55,logto_app_secret=seV1T6iKBKLlttjdk25I2px43ZCEHnPJ",
61
+ "dist:types": "cp src/web/web.types.d.ts dist/web/web.types.d.ts && rollup -c rollup.dts.config.mjs && node tools/clean-intermediate-dts.mjs",
51
62
  "dist:node": "microbundle -i ./src/cli.js -o dist/cli.js --format esm --target node --generateTypes false --sourcemap false --compress --define api_endpoint=https://cloud.needle.tools/api,cloud_base_url=https://cloud.needle.tools,logto_endpoint=https://auth.needle.tools,logto_app_id=2stnsoa6a1b0gwc7lra55,logto_app_secret=seV1T6iKBKLlttjdk25I2px43ZCEHnPJ",
52
63
  "dist:node-preview": "microbundle -i ./src/cli.js -o dist/cli.js --format esm --target node --generateTypes false --sourcemap false --compress --define api_endpoint=https://cloud-staging.needle.tools/api,cloud_base_url=https://cloud-staging.needle.tools,logto_endpoint=https://auth.needle.tools,logto_app_id=2stnsoa6a1b0gwc7lra55,logto_app_secret=seV1T6iKBKLlttjdk25I2px43ZCEHnPJ",
53
64
  "dev:mcp": "npx --yes @modelcontextprotocol/inspector mcp-inspector http://localhost:8424/mcp"
54
65
  },
55
- "files": [
56
- "bin/",
57
- "dist/",
58
- "README.md",
59
- "CHANGELOG.md",
60
- "package-lock.json"
61
- ],
62
66
  "publishConfig": {
63
67
  "access": "public",
64
68
  "registry": "https://registry.npmjs.org/"