@icqqjs/sdk 0.1.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.
@@ -0,0 +1,2 @@
1
+ import { listMcpDiscoverableActions, validateMcpAction } from "@icqqjs/cli/mcp/action-contract";
2
+ export { listMcpDiscoverableActions, validateMcpAction };
@@ -0,0 +1,2 @@
1
+ import { listMcpDiscoverableActions, validateMcpAction } from "@icqqjs/cli/mcp/action-contract";
2
+ export { listMcpDiscoverableActions, validateMcpAction };
@@ -0,0 +1,10 @@
1
+ //#region src/capabilities.d.ts
2
+ declare const SDK_VERSION = "0.1.0";
3
+ declare const SDK_CAPABILITIES: readonly ["account.config", "account.paths", "daemon.lifecycle", "daemon.login", "ipc.client", "rpc.client", "mcp.contract"];
4
+ type SdkCapability = (typeof SDK_CAPABILITIES)[number];
5
+ declare function capabilities(): SdkCapability[];
6
+ declare function assertSdkCompatible(required: {
7
+ capabilities?: SdkCapability[];
8
+ }): void;
9
+ //#endregion
10
+ export { SDK_CAPABILITIES, SDK_VERSION, SdkCapability, assertSdkCompatible, capabilities };
@@ -0,0 +1,20 @@
1
+ //#region src/capabilities.ts
2
+ const SDK_VERSION = "0.1.0";
3
+ const SDK_CAPABILITIES = [
4
+ "account.config",
5
+ "account.paths",
6
+ "daemon.lifecycle",
7
+ "daemon.login",
8
+ "ipc.client",
9
+ "rpc.client",
10
+ "mcp.contract"
11
+ ];
12
+ function capabilities() {
13
+ return [...SDK_CAPABILITIES];
14
+ }
15
+ function assertSdkCompatible(required) {
16
+ const have = new Set(capabilities());
17
+ for (const cap of required.capabilities ?? []) if (!have.has(cap)) throw new Error(`SDK 缺少能力: ${cap}`);
18
+ }
19
+ //#endregion
20
+ export { SDK_CAPABILITIES, SDK_VERSION, assertSdkCompatible, capabilities };
@@ -0,0 +1,3 @@
1
+ import { forceStopDaemon, getDaemonPid, isDaemonRunning, janitorStaleDaemonArtifacts, spawnDaemon, stopDaemon } from "@icqqjs/cli/daemon/supervisor";
2
+ import { getAccountDir, getIcqqHome, getLogPath, getPidPath, getSocketPath, getTokenPath } from "@icqqjs/cli/paths";
3
+ export { forceStopDaemon, getAccountDir, getDaemonPid, getIcqqHome, getLogPath, getPidPath, getSocketPath, getTokenPath, isDaemonRunning, janitorStaleDaemonArtifacts, spawnDaemon, stopDaemon };
@@ -0,0 +1,3 @@
1
+ import { forceStopDaemon, getDaemonPid, isDaemonRunning, janitorStaleDaemonArtifacts, spawnDaemon, stopDaemon } from "@icqqjs/cli/daemon/supervisor";
2
+ import { getAccountDir, getIcqqHome, getLogPath, getPidPath, getSocketPath, getTokenPath } from "@icqqjs/cli/paths";
3
+ export { forceStopDaemon, getAccountDir, getDaemonPid, getIcqqHome, getLogPath, getPidPath, getSocketPath, getTokenPath, isDaemonRunning, janitorStaleDaemonArtifacts, spawnDaemon, stopDaemon };
@@ -0,0 +1,6 @@
1
+ import { forceStopDaemon, isDaemonRunning, spawnDaemon, stopDaemon } from "@icqqjs/cli/daemon/supervisor";
2
+ import { getAccountDir, getIcqqHome, getLogPath } from "@icqqjs/cli/paths";
3
+ import { AccountConfig, IcqqConfig, getAccountConfig, loadConfig, saveConfig, setAccountConfig } from "@icqqjs/cli/config";
4
+ import { LoginActions } from "@icqqjs/cli/daemon/login-actions";
5
+ import { IpcClient } from "@icqqjs/cli/ipc-client";
6
+ export { type AccountConfig, type IcqqConfig, IpcClient, LoginActions, forceStopDaemon, getAccountConfig, getAccountDir, getIcqqHome, getLogPath, isDaemonRunning, loadConfig, saveConfig, setAccountConfig, spawnDaemon, stopDaemon };
@@ -0,0 +1,6 @@
1
+ import { forceStopDaemon, isDaemonRunning, spawnDaemon, stopDaemon } from "@icqqjs/cli/daemon/supervisor";
2
+ import { getAccountDir, getIcqqHome, getLogPath } from "@icqqjs/cli/paths";
3
+ import { getAccountConfig, loadConfig, saveConfig, setAccountConfig } from "@icqqjs/cli/config";
4
+ import { LoginActions } from "@icqqjs/cli/daemon/login-actions";
5
+ import { IpcClient } from "@icqqjs/cli/ipc-client";
6
+ export { IpcClient, LoginActions, forceStopDaemon, getAccountConfig, getAccountDir, getIcqqHome, getLogPath, isDaemonRunning, loadConfig, saveConfig, setAccountConfig, spawnDaemon, stopDaemon };
@@ -0,0 +1,2 @@
1
+ import { SDK_CAPABILITIES, SDK_VERSION, SdkCapability, assertSdkCompatible, capabilities } from "./capabilities.mjs";
2
+ export { SDK_CAPABILITIES, SDK_VERSION, type SdkCapability, assertSdkCompatible, capabilities };
package/dist/index.mjs ADDED
@@ -0,0 +1,2 @@
1
+ import { SDK_CAPABILITIES, SDK_VERSION, assertSdkCompatible, capabilities } from "./capabilities.mjs";
2
+ export { SDK_CAPABILITIES, SDK_VERSION, assertSdkCompatible, capabilities };
@@ -0,0 +1,4 @@
1
+ import { LoginActions } from "@icqqjs/cli/daemon/login-actions";
2
+ import { IpcClient } from "@icqqjs/cli/ipc-client";
3
+ import { IpcEvent, IpcMessage, IpcRequest, IpcResponse } from "@icqqjs/cli/protocol";
4
+ export { IpcClient, type IpcEvent, type IpcMessage, type IpcRequest, type IpcResponse, LoginActions };
@@ -0,0 +1,3 @@
1
+ import { LoginActions } from "@icqqjs/cli/daemon/login-actions";
2
+ import { IpcClient } from "@icqqjs/cli/ipc-client";
3
+ export { IpcClient, LoginActions };
package/package.json ADDED
@@ -0,0 +1,43 @@
1
+ {
2
+ "name": "@icqqjs/sdk",
3
+ "version": "0.1.0",
4
+ "description": "Stable public SDK for icqq bot runtime, daemon lifecycle, and gateway integration",
5
+ "type": "module",
6
+ "main": "dist/index.mjs",
7
+ "exports": {
8
+ ".": "./dist/index.mjs",
9
+ "./gateway": "./dist/gateway/index.mjs",
10
+ "./daemon": "./dist/daemon/index.mjs",
11
+ "./protocol": "./dist/protocol/index.mjs",
12
+ "./bot": "./dist/bot/index.mjs"
13
+ },
14
+ "files": [
15
+ "dist"
16
+ ],
17
+ "engines": {
18
+ "node": ">=22"
19
+ },
20
+ "publishConfig": {
21
+ "registry": "https://registry.npmjs.org",
22
+ "access": "public"
23
+ },
24
+ "repository": {
25
+ "type": "git",
26
+ "url": "https://github.com/icqqjs/packages.git",
27
+ "directory": "packages/sdk"
28
+ },
29
+ "dependencies": {
30
+ "@icqqjs/cli": "1.10.0"
31
+ },
32
+ "devDependencies": {
33
+ "@types/node": "^25.5.0",
34
+ "tsdown": "^0.21.7",
35
+ "typescript": "^6.0.2",
36
+ "vitest": "^4.1.3"
37
+ },
38
+ "scripts": {
39
+ "build": "tsdown",
40
+ "typecheck": "tsc --noEmit",
41
+ "test": "vitest run"
42
+ }
43
+ }