ai-world-sdk 1.1.0 → 1.1.1

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/config.d.ts CHANGED
@@ -2,6 +2,14 @@
2
2
  * Global SDK Configuration
3
3
  * 全局 SDK 配置
4
4
  */
5
+ /**
6
+ * SDK 特征码 - 用于在构建后的 JS 文件中识别 SDK 版本
7
+ * 格式: AI_WORLD_SDK_V:版本号
8
+ * 后端通过扫描插件的 JS 文件来检测此特征码
9
+ *
10
+ * 注意: {VERSION} 占位符会在构建时被替换为实际版本号
11
+ */
12
+ export declare const SDK_SIGNATURE = "AI_WORLD_SDK_V:1.1.1";
5
13
  /**
6
14
  * 版本兼容性错误
7
15
  */
@@ -16,6 +24,8 @@ declare class SDKConfig {
16
24
  private _pluginId;
17
25
  private _versionCompatible;
18
26
  private _versionCheckPromise;
27
+ readonly sdkSignature = "AI_WORLD_SDK_V:1.1.1";
28
+ readonly sdkVersion = "1.1.1";
19
29
  constructor();
20
30
  /**
21
31
  * Set global base URL
package/dist/config.js CHANGED
@@ -4,10 +4,18 @@
4
4
  * 全局 SDK 配置
5
5
  */
6
6
  Object.defineProperty(exports, "__esModule", { value: true });
7
- exports.sdkConfig = exports.VersionCompatibilityError = void 0;
7
+ exports.sdkConfig = exports.VersionCompatibilityError = exports.SDK_SIGNATURE = void 0;
8
8
  // SDK 版本号(构建时自动从 package.json 更新)
9
9
  // 此版本号会在运行 npm run build 时自动从 package.json 读取并更新
10
- const SDK_VERSION = "1.1.0";
10
+ const SDK_VERSION = "1.1.1";
11
+ /**
12
+ * SDK 特征码 - 用于在构建后的 JS 文件中识别 SDK 版本
13
+ * 格式: AI_WORLD_SDK_V:版本号
14
+ * 后端通过扫描插件的 JS 文件来检测此特征码
15
+ *
16
+ * 注意: {VERSION} 占位符会在构建时被替换为实际版本号
17
+ */
18
+ exports.SDK_SIGNATURE = "AI_WORLD_SDK_V:1.1.1";
11
19
  /**
12
20
  * 版本兼容性错误
13
21
  */
@@ -27,6 +35,13 @@ class SDKConfig {
27
35
  this._pluginId = null;
28
36
  this._versionCompatible = null; // null 表示未检查,true/false 表示检查结果
29
37
  this._versionCheckPromise = null; // 版本检查的 Promise,避免重复请求
38
+ // SDK 版本标识(用于后端扫描检测)
39
+ this.sdkSignature = exports.SDK_SIGNATURE;
40
+ this.sdkVersion = SDK_VERSION;
41
+ // 在全局对象上注册 SDK 版本信息(用于后端扫描检测)
42
+ if (typeof globalThis !== "undefined") {
43
+ globalThis.__AI_WORLD_SDK_VERSION__ = SDK_VERSION;
44
+ }
30
45
  // 通过cookie获取token
31
46
  try {
32
47
  const cookieString = typeof document !== 'undefined' ? document.cookie : '';
package/dist/index.d.ts CHANGED
@@ -25,7 +25,7 @@ export { GeminiImageGenerationClient, type GeminiImageGenerationConfig, type Gem
25
25
  export { VideoGenerationClient, type VideoGenerationConfig, type VideoGenerationRequest, type ContentGenerationTaskID, type ContentGenerationTask, };
26
26
  export { DownloadClient, type DownloadConfig, type DownloadOptions, type StreamDownloadOptions, };
27
27
  export { AuthClient, getCurrentUserInfo, type AuthConfig, type UserInfo, };
28
- export { sdkConfig, VersionCompatibilityError } from "./config";
28
+ export { sdkConfig, VersionCompatibilityError, SDK_SIGNATURE } from "./config";
29
29
  /**
30
30
  * Create a chat model instance based on model name
31
31
  */
package/dist/index.js CHANGED
@@ -6,7 +6,7 @@
6
6
  * @see https://github.com/langchain-ai/langchainjs
7
7
  */
8
8
  Object.defineProperty(exports, "__esModule", { value: true });
9
- exports.VersionCompatibilityError = exports.sdkConfig = exports.getCurrentUserInfo = exports.AuthClient = exports.DownloadClient = exports.VideoGenerationClient = exports.GeminiImageGenerationClient = exports.DoubaoImageGenerationClient = exports.ChatAnthropic = exports.ChatGoogleGenerativeAI = exports.ChatOpenAI = exports.BaseChatModel = exports.AIMessageChunk = exports.SystemMessage = exports.AIMessage = exports.HumanMessage = void 0;
9
+ exports.SDK_SIGNATURE = exports.VersionCompatibilityError = exports.sdkConfig = exports.getCurrentUserInfo = exports.AuthClient = exports.DownloadClient = exports.VideoGenerationClient = exports.GeminiImageGenerationClient = exports.DoubaoImageGenerationClient = exports.ChatAnthropic = exports.ChatGoogleGenerativeAI = exports.ChatOpenAI = exports.BaseChatModel = exports.AIMessageChunk = exports.SystemMessage = exports.AIMessage = exports.HumanMessage = void 0;
10
10
  exports.createChatModel = createChatModel;
11
11
  const openai_1 = require("./chat_models/openai");
12
12
  const google_1 = require("./chat_models/google");
@@ -40,6 +40,7 @@ Object.defineProperty(exports, "ChatAnthropic", { enumerable: true, get: functio
40
40
  var config_2 = require("./config");
41
41
  Object.defineProperty(exports, "sdkConfig", { enumerable: true, get: function () { return config_2.sdkConfig; } });
42
42
  Object.defineProperty(exports, "VersionCompatibilityError", { enumerable: true, get: function () { return config_2.VersionCompatibilityError; } });
43
+ Object.defineProperty(exports, "SDK_SIGNATURE", { enumerable: true, get: function () { return config_2.SDK_SIGNATURE; } });
43
44
  /**
44
45
  * Create a chat model instance based on model name
45
46
  */
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ai-world-sdk",
3
- "version": "1.1.0",
3
+ "version": "1.1.1",
4
4
  "description": "TypeScript SDK for AI World Platform - Chat Models, Image Generation, and Video Generation",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
@@ -8,7 +8,7 @@
8
8
  "update-version": "node scripts/update-version.js",
9
9
  "build": "npm run update-version && rm -rf dist && tsc",
10
10
  "prepublishOnly": "npm run build",
11
- "publish": "npm run build && npm publish --access public",
11
+ "publish": "npm publish --access public",
12
12
  "test": "jest",
13
13
  "test:watch": "jest --watch",
14
14
  "test:genimi-non-stream": "jest -t 'ChatGoogleGenerativeAI - 非流式调用'",