infra-kit 0.1.67 → 0.1.71

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.
@@ -6,23 +6,25 @@ interface ToolHandlerArgs {
6
6
  handler: (params: any) => Promise<ToolsExecutionResult>
7
7
  }
8
8
 
9
- export const createToolHandler = (args: ToolHandlerArgs) => async (params: unknown) => {
10
- const { toolName, handler } = args
9
+ export const createToolHandler = (args: ToolHandlerArgs) => {
10
+ return async (params: unknown) => {
11
+ const { toolName, handler } = args
11
12
 
12
- logger.info({ msg: `Tool execution started: ${toolName}`, params })
13
- try {
14
- const payload = await handler({ ...(params as object), confirmedCommand: true })
13
+ logger.info({ msg: `Tool execution started: ${toolName}`, params })
14
+ try {
15
+ const payload = await handler({ ...(params as object), confirmedCommand: true })
15
16
 
16
- logger.info({ msg: `Tool execution successful: ${toolName}` })
17
+ logger.info({ msg: `Tool execution successful: ${toolName}` })
17
18
 
18
- return payload
19
- } catch (error) {
20
- logger.error({
21
- err: error,
22
- params,
23
- msg: `Tool execution failed: ${toolName}`,
24
- })
19
+ return payload
20
+ } catch (error) {
21
+ logger.error({
22
+ err: error,
23
+ params,
24
+ msg: `Tool execution failed: ${toolName}`,
25
+ })
25
26
 
26
- throw error
27
+ throw error
28
+ }
27
29
  }
28
30
  }
@@ -16,6 +16,7 @@ export const sortVersions = (versions: string[]): string[] => {
16
16
 
17
17
  if (majA !== majB) return (majA ?? 0) - (majB ?? 0)
18
18
  if (minA !== minB) return (minA ?? 0) - (minB ?? 0)
19
+
19
20
  return (patchA ?? 0) - (patchB ?? 0)
20
21
  })
21
22
  }