@toolplex/client 0.1.35 → 0.1.37
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/mcp-server/policy/serverPolicy.js +5 -1
- package/dist/mcp-server/toolHandlers/initHandler.js +16 -0
- package/dist/mcp-server/toolplexApi/service.d.ts +1 -1
- package/dist/mcp-server/toolplexApi/types.d.ts +2 -1
- package/dist/shared/mcpServerTypes.d.ts +3 -3
- package/dist/shared/mcpServerTypes.js +1 -1
- package/dist/src/mcp-server/policy/serverPolicy.js +5 -1
- package/dist/src/mcp-server/toolHandlers/initHandler.js +16 -0
- package/dist/src/shared/mcpServerTypes.js +1 -1
- package/dist/version.d.ts +1 -1
- package/dist/version.js +1 -1
- package/package.json +1 -1
|
@@ -46,7 +46,11 @@ export class ServerPolicy {
|
|
|
46
46
|
this.enforceBlockedServerPolicy(serverId);
|
|
47
47
|
this.enforceAllowedServerPolicy(serverId);
|
|
48
48
|
// Check if desktop commander is disabled and this is the desktop commander server
|
|
49
|
-
if (
|
|
49
|
+
// Skip this check if the server is in the allowed list (admin explicitly approved it)
|
|
50
|
+
const allowedServers = this.clientContext.permissions.allowed_mcp_servers;
|
|
51
|
+
const isExplicitlyAllowed = allowedServers && allowedServers.includes(serverId);
|
|
52
|
+
if (!isExplicitlyAllowed &&
|
|
53
|
+
!this.clientContext.permissions.use_desktop_commander &&
|
|
50
54
|
serverId === this.clientContext.flags.desktop_commander_server_id) {
|
|
51
55
|
throw new Error("Desktop Commander is disabled for your account");
|
|
52
56
|
}
|
|
@@ -172,6 +172,22 @@ export async function handleInitialize(params) {
|
|
|
172
172
|
.replace("{ALLOWED_MCP_SERVERS}", clientContext.permissions.allowed_mcp_servers.join(", ")),
|
|
173
173
|
});
|
|
174
174
|
}
|
|
175
|
+
// For org users with no tools approved yet, add explicit message
|
|
176
|
+
if (clientContext.isOrgUser && allSucceeded.length === 0) {
|
|
177
|
+
result.content.push({
|
|
178
|
+
type: "text",
|
|
179
|
+
text: "IMPORTANT: No tools have been approved for this organization yet. You cannot use any tools until an admin approves them. Do NOT hallucinate or make up tool capabilities - simply inform the user that no tools are currently available and they should contact their admin.",
|
|
180
|
+
});
|
|
181
|
+
}
|
|
182
|
+
// Add custom prompt / agent instructions for org users
|
|
183
|
+
if (clientContext.permissions.custom_prompt) {
|
|
184
|
+
result.content.push({
|
|
185
|
+
type: "text",
|
|
186
|
+
text: "ORGANIZATION INSTRUCTIONS:\n" +
|
|
187
|
+
"The following instructions have been set by your organization's administrator. Follow these guidelines:\n\n" +
|
|
188
|
+
clientContext.permissions.custom_prompt,
|
|
189
|
+
});
|
|
190
|
+
}
|
|
175
191
|
result.content.push({
|
|
176
192
|
type: "text",
|
|
177
193
|
text: "Your Most Recently Used Playbooks:\n" +
|
|
@@ -22,7 +22,7 @@ export declare class ToolplexApiService {
|
|
|
22
22
|
}>): Promise<LogTelemetryBatchResponse>;
|
|
23
23
|
lookupEntity(entityType: "server" | "playbook" | "feedback", entityId: string, includeReadme?: boolean): Promise<any>;
|
|
24
24
|
search(query: string, expandedKeywords?: string[], filter?: string, size?: number, scope?: string): Promise<SearchResponse>;
|
|
25
|
-
createPlaybook(playbook_name: string, description: string, actions: Array<PlaybookAction>, domain?: string, keywords?: string[], requirements?: string[], privacy?: "public" | "private", sourcePlaybookId?: string, forkReason?: string): Promise<CreatePlaybookResponse>;
|
|
25
|
+
createPlaybook(playbook_name: string, description: string, actions: Array<PlaybookAction>, domain?: string, keywords?: string[], requirements?: string[], privacy?: "public" | "private" | "organization", sourcePlaybookId?: string, forkReason?: string): Promise<CreatePlaybookResponse>;
|
|
26
26
|
logPlaybookUsage(playbookId: string, success: boolean, errorMessage?: string): Promise<LogPlaybookUsageResponse>;
|
|
27
27
|
submitFeedback(targetType: "server" | "playbook", targetId: string, vote: "up" | "down", message?: string, securityAssessment?: SecurityAssessment): Promise<SubmitFeedbackResponse>;
|
|
28
28
|
getFeedbackSummary(): Promise<FeedbackSummaryResponse>;
|
|
@@ -5,6 +5,7 @@ export interface ClientPermissions {
|
|
|
5
5
|
use_desktop_commander: boolean;
|
|
6
6
|
enable_read_only_mode: boolean;
|
|
7
7
|
allowed_mcp_servers?: string[];
|
|
8
|
+
custom_prompt?: string;
|
|
8
9
|
}
|
|
9
10
|
export interface ClientFlags {
|
|
10
11
|
desktop_commander_server_id: string;
|
|
@@ -53,7 +54,7 @@ export interface CreatePlaybookRequest {
|
|
|
53
54
|
domain?: string;
|
|
54
55
|
keywords?: string[];
|
|
55
56
|
requirements?: string[];
|
|
56
|
-
privacy?: "public" | "private";
|
|
57
|
+
privacy?: "public" | "private" | "organization";
|
|
57
58
|
source_playbook_id?: string;
|
|
58
59
|
fork_reason?: string;
|
|
59
60
|
}
|
|
@@ -336,7 +336,7 @@ export declare const SavePlaybookParamsSchema: z.ZodObject<{
|
|
|
336
336
|
domain: z.ZodOptional<z.ZodString>;
|
|
337
337
|
keywords: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
338
338
|
requirements: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
339
|
-
privacy: z.ZodOptional<z.ZodEnum<["public", "private"]>>;
|
|
339
|
+
privacy: z.ZodOptional<z.ZodEnum<["public", "private", "organization"]>>;
|
|
340
340
|
source_playbook_id: z.ZodOptional<z.ZodString>;
|
|
341
341
|
fork_reason: z.ZodOptional<z.ZodString>;
|
|
342
342
|
validate_only: z.ZodOptional<z.ZodBoolean>;
|
|
@@ -354,7 +354,7 @@ export declare const SavePlaybookParamsSchema: z.ZodObject<{
|
|
|
354
354
|
domain?: string | undefined;
|
|
355
355
|
keywords?: string[] | undefined;
|
|
356
356
|
requirements?: string[] | undefined;
|
|
357
|
-
privacy?: "public" | "private" | undefined;
|
|
357
|
+
privacy?: "public" | "private" | "organization" | undefined;
|
|
358
358
|
source_playbook_id?: string | undefined;
|
|
359
359
|
fork_reason?: string | undefined;
|
|
360
360
|
validate_only?: boolean | undefined;
|
|
@@ -372,7 +372,7 @@ export declare const SavePlaybookParamsSchema: z.ZodObject<{
|
|
|
372
372
|
domain?: string | undefined;
|
|
373
373
|
keywords?: string[] | undefined;
|
|
374
374
|
requirements?: string[] | undefined;
|
|
375
|
-
privacy?: "public" | "private" | undefined;
|
|
375
|
+
privacy?: "public" | "private" | "organization" | undefined;
|
|
376
376
|
source_playbook_id?: string | undefined;
|
|
377
377
|
fork_reason?: string | undefined;
|
|
378
378
|
validate_only?: boolean | undefined;
|
|
@@ -125,7 +125,7 @@ export const SavePlaybookParamsSchema = z.object({
|
|
|
125
125
|
domain: z.string().optional(),
|
|
126
126
|
keywords: z.array(z.string()).optional(),
|
|
127
127
|
requirements: z.array(z.string()).optional(),
|
|
128
|
-
privacy: z.enum(["public", "private"]).optional(),
|
|
128
|
+
privacy: z.enum(["public", "private", "organization"]).optional(),
|
|
129
129
|
source_playbook_id: z.string().optional(),
|
|
130
130
|
fork_reason: z.string().optional(),
|
|
131
131
|
// Internal parameter for validation-only mode (not exposed to agent in tool definition)
|
|
@@ -46,7 +46,11 @@ export class ServerPolicy {
|
|
|
46
46
|
this.enforceBlockedServerPolicy(serverId);
|
|
47
47
|
this.enforceAllowedServerPolicy(serverId);
|
|
48
48
|
// Check if desktop commander is disabled and this is the desktop commander server
|
|
49
|
-
if (
|
|
49
|
+
// Skip this check if the server is in the allowed list (admin explicitly approved it)
|
|
50
|
+
const allowedServers = this.clientContext.permissions.allowed_mcp_servers;
|
|
51
|
+
const isExplicitlyAllowed = allowedServers && allowedServers.includes(serverId);
|
|
52
|
+
if (!isExplicitlyAllowed &&
|
|
53
|
+
!this.clientContext.permissions.use_desktop_commander &&
|
|
50
54
|
serverId === this.clientContext.flags.desktop_commander_server_id) {
|
|
51
55
|
throw new Error("Desktop Commander is disabled for your account");
|
|
52
56
|
}
|
|
@@ -172,6 +172,22 @@ export async function handleInitialize(params) {
|
|
|
172
172
|
.replace("{ALLOWED_MCP_SERVERS}", clientContext.permissions.allowed_mcp_servers.join(", ")),
|
|
173
173
|
});
|
|
174
174
|
}
|
|
175
|
+
// For org users with no tools approved yet, add explicit message
|
|
176
|
+
if (clientContext.isOrgUser && allSucceeded.length === 0) {
|
|
177
|
+
result.content.push({
|
|
178
|
+
type: "text",
|
|
179
|
+
text: "IMPORTANT: No tools have been approved for this organization yet. You cannot use any tools until an admin approves them. Do NOT hallucinate or make up tool capabilities - simply inform the user that no tools are currently available and they should contact their admin.",
|
|
180
|
+
});
|
|
181
|
+
}
|
|
182
|
+
// Add custom prompt / agent instructions for org users
|
|
183
|
+
if (clientContext.permissions.custom_prompt) {
|
|
184
|
+
result.content.push({
|
|
185
|
+
type: "text",
|
|
186
|
+
text: "ORGANIZATION INSTRUCTIONS:\n" +
|
|
187
|
+
"The following instructions have been set by your organization's administrator. Follow these guidelines:\n\n" +
|
|
188
|
+
clientContext.permissions.custom_prompt,
|
|
189
|
+
});
|
|
190
|
+
}
|
|
175
191
|
result.content.push({
|
|
176
192
|
type: "text",
|
|
177
193
|
text: "Your Most Recently Used Playbooks:\n" +
|
|
@@ -125,7 +125,7 @@ export const SavePlaybookParamsSchema = z.object({
|
|
|
125
125
|
domain: z.string().optional(),
|
|
126
126
|
keywords: z.array(z.string()).optional(),
|
|
127
127
|
requirements: z.array(z.string()).optional(),
|
|
128
|
-
privacy: z.enum(["public", "private"]).optional(),
|
|
128
|
+
privacy: z.enum(["public", "private", "organization"]).optional(),
|
|
129
129
|
source_playbook_id: z.string().optional(),
|
|
130
130
|
fork_reason: z.string().optional(),
|
|
131
131
|
// Internal parameter for validation-only mode (not exposed to agent in tool definition)
|
package/dist/version.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const version = "0.1.
|
|
1
|
+
export declare const version = "0.1.37";
|
package/dist/version.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export const version = '0.1.
|
|
1
|
+
export const version = '0.1.37';
|