@protoboxai/sdk 1.0.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.
- package/README.md +51 -0
- package/dist/adapters/openai.d.ts +106 -0
- package/dist/adapters/openai.js +185 -0
- package/dist/client.d.ts +60 -0
- package/dist/client.js +307 -0
- package/dist/errors/index.d.ts +179 -0
- package/dist/errors/index.js +319 -0
- package/dist/index.d.ts +23 -0
- package/dist/index.js +62 -0
- package/dist/live/index.d.ts +5 -0
- package/dist/live/index.js +10 -0
- package/dist/live/live-chat.d.ts +71 -0
- package/dist/live/live-chat.js +95 -0
- package/dist/live/typed-emitter.d.ts +15 -0
- package/dist/live/typed-emitter.js +40 -0
- package/dist/live/types.d.ts +24 -0
- package/dist/live/types.js +6 -0
- package/dist/modules/auth.d.ts +76 -0
- package/dist/modules/auth.js +59 -0
- package/dist/modules/chat.d.ts +164 -0
- package/dist/modules/chat.js +168 -0
- package/dist/modules/health.d.ts +45 -0
- package/dist/modules/health.js +22 -0
- package/dist/modules/knowledge.d.ts +202 -0
- package/dist/modules/knowledge.js +147 -0
- package/dist/modules/mcp.d.ts +138 -0
- package/dist/modules/mcp.js +110 -0
- package/dist/modules/prompts.d.ts +128 -0
- package/dist/modules/prompts.js +93 -0
- package/dist/modules/tools.d.ts +222 -0
- package/dist/modules/tools.js +302 -0
- package/dist/modules/toolsets.d.ts +173 -0
- package/dist/modules/toolsets.js +216 -0
- package/dist/modules/workspace.d.ts +48 -0
- package/dist/modules/workspace.js +49 -0
- package/dist/types/api.d.ts +4 -0
- package/dist/types/api.js +21 -0
- package/dist/types/config.d.ts +81 -0
- package/dist/types/config.js +3 -0
- package/dist/types/tool-calls.d.ts +60 -0
- package/dist/types/tool-calls.js +8 -0
- package/dist/types/tools.d.ts +321 -0
- package/dist/types/tools.js +9 -0
- package/dist/types/toolsets.d.ts +151 -0
- package/dist/types/toolsets.js +8 -0
- package/package.json +52 -0
|
@@ -0,0 +1,151 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Toolset Types for @chanl/sdk
|
|
3
|
+
*
|
|
4
|
+
* Based on chanl-api/src/tools/dto/toolset-*.dto.ts and schemas/toolset.schema.ts
|
|
5
|
+
*/
|
|
6
|
+
/**
|
|
7
|
+
* Toolset entity representing a collection of MCP tools
|
|
8
|
+
*/
|
|
9
|
+
export interface Toolset {
|
|
10
|
+
/** Toolset ID */
|
|
11
|
+
id: string;
|
|
12
|
+
/** Workspace ID this toolset belongs to */
|
|
13
|
+
workspaceId: string;
|
|
14
|
+
/** Unique name for the toolset */
|
|
15
|
+
name: string;
|
|
16
|
+
/** Description of the toolset purpose */
|
|
17
|
+
description: string;
|
|
18
|
+
/** Array of tool IDs in this toolset */
|
|
19
|
+
tools: string[];
|
|
20
|
+
/** Tool count in this toolset */
|
|
21
|
+
toolCount: number;
|
|
22
|
+
/** Custom tool name/description overrides */
|
|
23
|
+
toolOverrides?: Record<string, {
|
|
24
|
+
name?: string;
|
|
25
|
+
description?: string;
|
|
26
|
+
}>;
|
|
27
|
+
/** Whether the toolset is enabled */
|
|
28
|
+
enabled: boolean;
|
|
29
|
+
/** Whether the toolset is publicly visible */
|
|
30
|
+
isPublic: boolean;
|
|
31
|
+
/** Registry ID for MCP registry publishing */
|
|
32
|
+
registryId?: string;
|
|
33
|
+
/** Version string */
|
|
34
|
+
version: string;
|
|
35
|
+
/** Tags for categorizing toolsets */
|
|
36
|
+
tags?: string[];
|
|
37
|
+
/** User ID who created the toolset */
|
|
38
|
+
createdBy: string;
|
|
39
|
+
/** User ID who last modified the toolset */
|
|
40
|
+
updatedBy?: string;
|
|
41
|
+
/** Creation timestamp */
|
|
42
|
+
createdAt: string;
|
|
43
|
+
/** Last update timestamp */
|
|
44
|
+
updatedAt: string;
|
|
45
|
+
}
|
|
46
|
+
/**
|
|
47
|
+
* Input for creating a new toolset
|
|
48
|
+
*/
|
|
49
|
+
export interface CreateToolsetInput {
|
|
50
|
+
/** Unique name for the toolset within the workspace */
|
|
51
|
+
name: string;
|
|
52
|
+
/** Description of the toolset purpose */
|
|
53
|
+
description: string;
|
|
54
|
+
/** Array of tool IDs to include in this toolset */
|
|
55
|
+
tools?: string[];
|
|
56
|
+
/** Whether the toolset is enabled (default: true) */
|
|
57
|
+
enabled?: boolean;
|
|
58
|
+
/** Whether the toolset is publicly visible (default: false) */
|
|
59
|
+
isPublic?: boolean;
|
|
60
|
+
/** Registry ID for MCP registry publishing */
|
|
61
|
+
registryId?: string;
|
|
62
|
+
/** Version string for the toolset (default: '1.0.0') */
|
|
63
|
+
version?: string;
|
|
64
|
+
/** Tags for categorizing toolsets */
|
|
65
|
+
tags?: string[];
|
|
66
|
+
}
|
|
67
|
+
/**
|
|
68
|
+
* Input for updating an existing toolset
|
|
69
|
+
*/
|
|
70
|
+
export interface UpdateToolsetInput {
|
|
71
|
+
/** Updated name */
|
|
72
|
+
name?: string;
|
|
73
|
+
/** Updated description */
|
|
74
|
+
description?: string;
|
|
75
|
+
/** Updated tool IDs */
|
|
76
|
+
tools?: string[];
|
|
77
|
+
/** Updated enabled status */
|
|
78
|
+
enabled?: boolean;
|
|
79
|
+
/** Updated public visibility */
|
|
80
|
+
isPublic?: boolean;
|
|
81
|
+
/** Updated registry ID */
|
|
82
|
+
registryId?: string;
|
|
83
|
+
/** Updated version */
|
|
84
|
+
version?: string;
|
|
85
|
+
/** Updated tags */
|
|
86
|
+
tags?: string[];
|
|
87
|
+
}
|
|
88
|
+
/**
|
|
89
|
+
* Filters for listing toolsets
|
|
90
|
+
*/
|
|
91
|
+
export interface ToolsetFilters {
|
|
92
|
+
/** Search by toolset name or description */
|
|
93
|
+
search?: string;
|
|
94
|
+
/** Filter by enabled status */
|
|
95
|
+
enabled?: boolean;
|
|
96
|
+
/** Filter by public visibility */
|
|
97
|
+
isPublic?: boolean;
|
|
98
|
+
/** Filter by tag */
|
|
99
|
+
tag?: string;
|
|
100
|
+
/** Page number (1-indexed) */
|
|
101
|
+
page?: number;
|
|
102
|
+
/** Number of items per page (default: 20) */
|
|
103
|
+
limit?: number;
|
|
104
|
+
}
|
|
105
|
+
/**
|
|
106
|
+
* Input for managing tools in a toolset
|
|
107
|
+
*/
|
|
108
|
+
export interface ManageToolsInput {
|
|
109
|
+
/** Tool IDs to add */
|
|
110
|
+
add?: string[];
|
|
111
|
+
/** Tool IDs to remove */
|
|
112
|
+
remove?: string[];
|
|
113
|
+
}
|
|
114
|
+
/**
|
|
115
|
+
* Tool override configuration
|
|
116
|
+
*/
|
|
117
|
+
export interface ToolOverride {
|
|
118
|
+
/** Custom tool name */
|
|
119
|
+
name?: string;
|
|
120
|
+
/** Custom tool description */
|
|
121
|
+
description?: string;
|
|
122
|
+
}
|
|
123
|
+
/**
|
|
124
|
+
* Response for listing toolsets
|
|
125
|
+
*/
|
|
126
|
+
export interface ToolsetListResponse {
|
|
127
|
+
/** Array of toolsets (API may return as 'items' or 'data') */
|
|
128
|
+
items?: Toolset[];
|
|
129
|
+
data?: Toolset[];
|
|
130
|
+
total: number;
|
|
131
|
+
pagination?: {
|
|
132
|
+
page: number;
|
|
133
|
+
limit: number;
|
|
134
|
+
total: number;
|
|
135
|
+
totalPages: number;
|
|
136
|
+
hasNext: boolean;
|
|
137
|
+
hasPrev: boolean;
|
|
138
|
+
};
|
|
139
|
+
}
|
|
140
|
+
/**
|
|
141
|
+
* Response for single toolset operations
|
|
142
|
+
* Note: API returns toolset directly in data, not nested as { toolset: ... }
|
|
143
|
+
*/
|
|
144
|
+
export type ToolsetResponse = Toolset;
|
|
145
|
+
/**
|
|
146
|
+
* Response for toolset deletion
|
|
147
|
+
*/
|
|
148
|
+
export interface ToolsetDeleteResponse {
|
|
149
|
+
deleted: boolean;
|
|
150
|
+
}
|
|
151
|
+
//# sourceMappingURL=toolsets.d.ts.map
|
package/package.json
ADDED
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@protoboxai/sdk",
|
|
3
|
+
"version": "1.0.0",
|
|
4
|
+
"description": "TypeScript SDK for Protobox — MCP servers, tools, agents, knowledge resources, prompts, and chat",
|
|
5
|
+
"main": "dist/index.js",
|
|
6
|
+
"types": "dist/index.d.ts",
|
|
7
|
+
"scripts": {
|
|
8
|
+
"build": "tsc",
|
|
9
|
+
"dev": "tsc --watch",
|
|
10
|
+
"clean": "rimraf dist",
|
|
11
|
+
"prebuild": "npm run clean",
|
|
12
|
+
"test": "vitest run",
|
|
13
|
+
"test:watch": "vitest",
|
|
14
|
+
"typecheck": "tsc --noEmit",
|
|
15
|
+
"lint": "eslint src/**/*.ts",
|
|
16
|
+
"format": "prettier --write src/**/*.ts"
|
|
17
|
+
},
|
|
18
|
+
"keywords": [
|
|
19
|
+
"protobox",
|
|
20
|
+
"mcp",
|
|
21
|
+
"ai-agents",
|
|
22
|
+
"api",
|
|
23
|
+
"sdk",
|
|
24
|
+
"typescript",
|
|
25
|
+
"knowledge-base",
|
|
26
|
+
"tools"
|
|
27
|
+
],
|
|
28
|
+
"author": "Protobox",
|
|
29
|
+
"license": "MIT",
|
|
30
|
+
"dependencies": {
|
|
31
|
+
"form-data": "^4.0.0"
|
|
32
|
+
},
|
|
33
|
+
"devDependencies": {
|
|
34
|
+
"@types/node": "^20.3.1",
|
|
35
|
+
"@typescript-eslint/eslint-plugin": "^6.0.0",
|
|
36
|
+
"@typescript-eslint/parser": "^6.0.0",
|
|
37
|
+
"eslint": "^8.42.0",
|
|
38
|
+
"prettier": "^3.0.0",
|
|
39
|
+
"rimraf": "^5.0.0",
|
|
40
|
+
"typescript": "^5.1.3",
|
|
41
|
+
"vitest": "^2.1.8"
|
|
42
|
+
},
|
|
43
|
+
"files": [
|
|
44
|
+
"dist/**/*.js",
|
|
45
|
+
"dist/**/*.d.ts",
|
|
46
|
+
"README.md"
|
|
47
|
+
],
|
|
48
|
+
"publishConfig": {
|
|
49
|
+
"registry": "https://registry.npmjs.org",
|
|
50
|
+
"access": "public"
|
|
51
|
+
}
|
|
52
|
+
}
|