@infersec/conduit 1.82.0 → 1.83.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,6 @@
1
+ import { Command } from "commander";
2
+ interface ToolCommandContext {
3
+ program: Command;
4
+ }
5
+ export declare function registerToolCommands({ program }: ToolCommandContext): void;
6
+ export {};
@@ -0,0 +1,8 @@
1
+ import type { ToolConfigurationOverrides } from "../toolConnection/configuration.js";
2
+ export interface ToolConnectCommandOptions {
3
+ apiUrl?: string;
4
+ key?: string;
5
+ path?: string;
6
+ readOnly?: boolean;
7
+ }
8
+ export declare function buildToolConfigurationOverrides(toolID: string, options: ToolConnectCommandOptions): ToolConfigurationOverrides;
@@ -0,0 +1,20 @@
1
+ import type { ULID } from "@infersec/definitions";
2
+ import type { Logger } from "@infersec/logger";
3
+ export interface ToolConnectionOptions {
4
+ apiKey: string;
5
+ apiURL: string;
6
+ logger: Logger;
7
+ readOnly: boolean;
8
+ rootPath: string;
9
+ toolID: ULID;
10
+ }
11
+ export declare class ToolConnection {
12
+ private abortController;
13
+ private apiClient;
14
+ private heartbeatInterval;
15
+ private logger;
16
+ private options;
17
+ constructor(options: ToolConnectionOptions);
18
+ start(): Promise<void>;
19
+ stop(): Promise<void>;
20
+ }
@@ -0,0 +1,17 @@
1
+ import { ULID } from "@infersec/definitions";
2
+ import { Logger } from "@infersec/logger";
3
+ export interface ToolAPIClient {
4
+ getToolConfiguration: () => Promise<{
5
+ type: string;
6
+ }>;
7
+ reportToolState: (state: {
8
+ available: boolean;
9
+ timestamp: string;
10
+ }) => Promise<void>;
11
+ }
12
+ export declare function createToolAPIClient({ apiKey, apiURL, logger, toolID }: {
13
+ apiKey: string;
14
+ apiURL: string;
15
+ logger: Logger;
16
+ toolID: ULID;
17
+ }): ToolAPIClient;
@@ -0,0 +1,18 @@
1
+ import { ULID } from "@infersec/definitions";
2
+ export interface ToolConfiguration {
3
+ apiKey: string;
4
+ apiURL: string;
5
+ readOnly: boolean;
6
+ rootPath: string;
7
+ toolID: ULID;
8
+ }
9
+ export interface ToolConfigurationOverrides {
10
+ apiKey?: string;
11
+ apiURL?: string;
12
+ readOnly?: boolean;
13
+ rootPath?: string;
14
+ toolID?: ULID;
15
+ }
16
+ export declare function getToolConfiguration({ overrides }?: {
17
+ overrides?: ToolConfigurationOverrides;
18
+ }): ToolConfiguration;
@@ -0,0 +1,11 @@
1
+ import { Logger } from "@infersec/logger";
2
+ import { type LocalToolServer } from "./mcp/server.js";
3
+ export interface ToolConnectionOptions {
4
+ apiURL: string;
5
+ apiKey: string;
6
+ logger: Logger;
7
+ signal?: AbortSignal;
8
+ toolServer: LocalToolServer;
9
+ toolID: string;
10
+ }
11
+ export declare function handleToolSSE({ apiURL, apiKey, logger, signal, toolServer, toolID }: ToolConnectionOptions): Promise<void>;
@@ -0,0 +1,88 @@
1
+ import { z } from "zod";
2
+ export type MCPContent = {
3
+ content: Array<{
4
+ text: string;
5
+ type: "text";
6
+ }>;
7
+ isError?: boolean;
8
+ };
9
+ export interface OperationContext {
10
+ basePath: string;
11
+ }
12
+ export type OperationHandler = (args: Record<string, unknown>, ctx: OperationContext) => Promise<MCPContent>;
13
+ export interface OperationDefinition {
14
+ handler: OperationHandler;
15
+ inputSchema: z.ZodRawShape;
16
+ isWrite: boolean;
17
+ metadata: {
18
+ description: string;
19
+ name: string;
20
+ };
21
+ }
22
+ export declare const listContentsSchema: {
23
+ path: z.ZodString;
24
+ };
25
+ export declare const readFileSchema: {
26
+ partial: z.ZodOptional<z.ZodObject<{
27
+ limit: z.ZodNumber;
28
+ section: z.ZodEnum<{
29
+ head: "head";
30
+ tail: "tail";
31
+ }>;
32
+ }, z.core.$strip>>;
33
+ path: z.ZodString;
34
+ };
35
+ export declare const writeFileSchema: {
36
+ contents: z.ZodUnion<readonly [z.ZodString, z.ZodObject<{
37
+ contents: z.ZodString;
38
+ line: z.ZodNumber;
39
+ mode: z.ZodEnum<{
40
+ replace: "replace";
41
+ insert: "insert";
42
+ }>;
43
+ }, z.core.$strip>]>;
44
+ path: z.ZodString;
45
+ };
46
+ export declare const createDirectorySchema: {
47
+ path: z.ZodString;
48
+ };
49
+ export declare const copyFileSchema: {
50
+ destination: z.ZodString;
51
+ source: z.ZodString;
52
+ };
53
+ export declare const moveFileSchema: {
54
+ destination: z.ZodString;
55
+ source: z.ZodString;
56
+ };
57
+ export declare const deleteSchema: {
58
+ path: z.ZodString;
59
+ };
60
+ export declare const findSchema: {
61
+ maxdepth: z.ZodOptional<z.ZodNumber>;
62
+ name: z.ZodOptional<z.ZodString>;
63
+ path: z.ZodOptional<z.ZodString>;
64
+ pattern: z.ZodOptional<z.ZodString>;
65
+ type: z.ZodOptional<z.ZodEnum<{
66
+ f: "f";
67
+ d: "d";
68
+ }>>;
69
+ };
70
+ export declare const grepSchema: {
71
+ glob: z.ZodOptional<z.ZodString>;
72
+ maxResults: z.ZodOptional<z.ZodNumber>;
73
+ path: z.ZodOptional<z.ZodString>;
74
+ pattern: z.ZodString;
75
+ };
76
+ export declare const fileInfoSchema: {
77
+ path: z.ZodString;
78
+ };
79
+ export declare const chmodSchema: {
80
+ mode: z.ZodString;
81
+ path: z.ZodString;
82
+ };
83
+ export declare const chownSchema: {
84
+ group: z.ZodOptional<z.ZodString>;
85
+ owner: z.ZodString;
86
+ path: z.ZodString;
87
+ };
88
+ export declare const FILESYSTEM_OPERATIONS: Array<OperationDefinition>;
@@ -0,0 +1,26 @@
1
+ import { Logger } from "@infersec/logger";
2
+ interface JSONRPCRequest {
3
+ id?: number;
4
+ jsonrpc: "2.0";
5
+ method: string;
6
+ params?: Record<string, unknown>;
7
+ }
8
+ interface JSONRPCResponse {
9
+ error?: {
10
+ code: number;
11
+ message: string;
12
+ };
13
+ id: number | null;
14
+ jsonrpc: "2.0";
15
+ result?: unknown;
16
+ }
17
+ export interface LocalToolServer {
18
+ close: () => Promise<void>;
19
+ handleRequest: (request: JSONRPCRequest) => Promise<JSONRPCResponse>;
20
+ }
21
+ export declare function createFilesystemToolServer({ basePath, logger, readOnly }: {
22
+ basePath: string;
23
+ logger: Logger;
24
+ readOnly: boolean;
25
+ }): LocalToolServer;
26
+ export {};
@@ -0,0 +1,4 @@
1
+ import { type ToolConfigurationOverrides } from "./configuration.js";
2
+ export declare function startToolAgent({ configurationOverrides }: {
3
+ configurationOverrides?: ToolConfigurationOverrides;
4
+ }): Promise<void>;
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@infersec/conduit",
3
3
  "description": "End user conduit agent for connecting local LLMs to the cloud.",
4
- "version": "1.82.0",
4
+ "version": "1.83.0",
5
5
  "bin": {
6
6
  "infersec-conduit": "./dist/cli.js"
7
7
  },
@@ -59,6 +59,7 @@
59
59
  "dependencies": {
60
60
  "@huggingface/hub": "^2.5.2",
61
61
  "@isaacs/brace-expansion": "^5.0.1",
62
+ "@modelcontextprotocol/sdk": "^1.29.0",
62
63
  "commander": "^13.1.0",
63
64
  "dockerode": "^4.0.6",
64
65
  "eventemitter3": "^5.0.1",