@toolplex/client 0.1.5 → 0.1.7

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.
@@ -20,7 +20,21 @@ export async function handleLookupEntityTool(params) {
20
20
  if (params.entity_type === "server") {
21
21
  policyEnforcer.enforceUseServerPolicy(params.entity_id);
22
22
  }
23
- let lookupResponse = await apiService.lookupEntity(params.entity_type, params.entity_id);
23
+ const lookupResponse = await apiService.lookupEntity(params.entity_type, params.entity_id);
24
+ // Annotate installed server using resultAnnotators
25
+ if (params.entity_type === "server" &&
26
+ lookupResponse &&
27
+ typeof lookupResponse === "object" &&
28
+ lookupResponse.result &&
29
+ typeof lookupResponse.result === "object") {
30
+ try {
31
+ lookupResponse.result = annotateInstalledServer(lookupResponse.result, serversCache);
32
+ }
33
+ catch (err) {
34
+ await logger.warn(`Error annotating installed server: ${err}`);
35
+ // fallback: do not annotate
36
+ }
37
+ }
24
38
  if (!lookupResponse) {
25
39
  await logger.debug("No entity found");
26
40
  await telemetryLogger.log("client_lookup_entity", {
@@ -44,18 +58,6 @@ export async function handleLookupEntityTool(params) {
44
58
  ],
45
59
  };
46
60
  }
47
- // Use resultAnnotators to annotate if the server is installed
48
- if (params.entity_type === "server" &&
49
- lookupResponse &&
50
- typeof lookupResponse === "object") {
51
- try {
52
- lookupResponse = annotateInstalledServer(lookupResponse, serversCache);
53
- }
54
- catch (err) {
55
- await logger.warn(`Error annotating installed server: ${err}`);
56
- // fallback: do not annotate
57
- }
58
- }
59
61
  await logger.debug(`Found entity: ${JSON.stringify(lookupResponse)}`);
60
62
  await logger.debug("Lookup completed successfully");
61
63
  await telemetryLogger.log("client_lookup_entity", {
@@ -21,8 +21,8 @@ export async function handleSavePlaybook(params) {
21
21
  }
22
22
  // Enforce playbook policy before saving
23
23
  policyEnforcer.enforceSavePlaybookPolicy(params);
24
- const { description, actions, domain, keywords, requirements, privacy, source_playbook_id, fork_reason, } = params;
25
- const response = await apiService.createPlaybook(description, actions, domain, keywords, requirements, privacy, source_playbook_id, fork_reason);
24
+ const { playbook_name, description, actions, domain, keywords, requirements, privacy, source_playbook_id, fork_reason, } = params;
25
+ const response = await apiService.createPlaybook(playbook_name, description, actions, domain, keywords, requirements, privacy, source_playbook_id, fork_reason);
26
26
  await logger.info(`Playbook created successfully with ID: ${response.id}`);
27
27
  await telemetryLogger.log("client_save_playbook", {
28
28
  success: true,
@@ -25,7 +25,7 @@ export declare class ToolplexApiService {
25
25
  mcp_servers?: any[];
26
26
  playbooks?: any[];
27
27
  }>;
28
- createPlaybook(description: string, actions: Array<PlaybookAction>, domain?: string, keywords?: string[], requirements?: string[], privacy?: "public" | "private", sourcePlaybookId?: string, forkReason?: string): Promise<CreatePlaybookResponse>;
28
+ createPlaybook(playbook_name: string, description: string, actions: Array<PlaybookAction>, domain?: string, keywords?: string[], requirements?: string[], privacy?: "public" | "private", sourcePlaybookId?: string, forkReason?: string): Promise<CreatePlaybookResponse>;
29
29
  logPlaybookUsage(playbookId: string, success: boolean, errorMessage?: string): Promise<LogPlaybookUsageResponse>;
30
30
  submitFeedback(targetType: "server" | "playbook", targetId: string, vote: "up" | "down", message?: string, securityAssessment?: SecurityAssessment): Promise<SubmitFeedbackResponse>;
31
31
  getFeedbackSummary(): Promise<FeedbackSummaryResponse>;
@@ -136,8 +136,9 @@ export class ToolplexApiService {
136
136
  throw err;
137
137
  }
138
138
  }
139
- async createPlaybook(description, actions, domain, keywords, requirements, privacy, sourcePlaybookId, forkReason) {
139
+ async createPlaybook(playbook_name, description, actions, domain, keywords, requirements, privacy, sourcePlaybookId, forkReason) {
140
140
  const requestBody = {
141
+ playbook_name,
141
142
  description,
142
143
  actions,
143
144
  llm_context: this.clientContext.llmContext,
@@ -43,6 +43,7 @@ export interface LlmContext {
43
43
  chat_client?: string;
44
44
  }
45
45
  export interface CreatePlaybookRequest {
46
+ playbook_name: string;
46
47
  description: string;
47
48
  actions: Array<{
48
49
  do: string;
@@ -252,6 +252,7 @@ export declare const PlaybookActionSchema: z.ZodObject<{
252
252
  }>;
253
253
  export type PlaybookAction = z.infer<typeof PlaybookActionSchema>;
254
254
  export declare const SavePlaybookParamsSchema: z.ZodObject<{
255
+ playbook_name: z.ZodString;
255
256
  description: z.ZodString;
256
257
  actions: z.ZodEffects<z.ZodArray<z.ZodObject<{
257
258
  do: z.ZodString;
@@ -303,6 +304,7 @@ export declare const SavePlaybookParamsSchema: z.ZodObject<{
303
304
  fork_reason: z.ZodOptional<z.ZodString>;
304
305
  }, "strip", z.ZodTypeAny, {
305
306
  description: string;
307
+ playbook_name: string;
306
308
  actions: {
307
309
  do: string;
308
310
  args?: Record<string, {
@@ -319,6 +321,7 @@ export declare const SavePlaybookParamsSchema: z.ZodObject<{
319
321
  fork_reason?: string | undefined;
320
322
  }, {
321
323
  description: string;
324
+ playbook_name: string;
322
325
  actions: {
323
326
  do: string;
324
327
  args?: Record<string, {
@@ -111,6 +111,7 @@ export const PlaybookActionSchema = z.object({
111
111
  // SavePlaybookParams
112
112
  // --------------------
113
113
  export const SavePlaybookParamsSchema = z.object({
114
+ playbook_name: z.string(),
114
115
  description: z.string(),
115
116
  // Requires at least one action to have a "call" property
116
117
  actions: z
package/dist/version.d.ts CHANGED
@@ -1 +1 @@
1
- export declare const version = "0.1.5";
1
+ export declare const version = "0.1.7";
package/dist/version.js CHANGED
@@ -1 +1 @@
1
- export const version = '0.1.5';
1
+ export const version = '0.1.7';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@toolplex/client",
3
- "version": "0.1.5",
3
+ "version": "0.1.7",
4
4
  "author": "ToolPlex LLC",
5
5
  "license": "SEE LICENSE IN LICENSE",
6
6
  "description": "The official ToolPlex client for AI agent tool discovery and execution",