@nekzus/liop-studio 1.0.0-alpha.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/LICENSE +201 -0
- package/NOTICE +33 -0
- package/README.md +44 -0
- package/bin/liop-studio.js +35 -0
- package/dist/cli/index.d.ts +3 -0
- package/dist/cli/index.js +2291 -0
- package/dist/cli/index.js.map +1 -0
- package/dist/index-DLA-Sm4s.d.ts +152 -0
- package/dist/index.d.ts +173 -0
- package/dist/index.js +2234 -0
- package/dist/index.js.map +1 -0
- package/dist/server/index.d.ts +4 -0
- package/dist/server/index.js +2094 -0
- package/dist/server/index.js.map +1 -0
- package/package.json +57 -0
- package/ui/README.md +73 -0
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,173 @@
|
|
|
1
|
+
import { T as TargetConnectionConfig, S as ScanReport, a as ScannedTargetNode, E as EnrichedTool, b as StudioTransport, c as TargetTransportType, d as ExecutionResult } from './index-DLA-Sm4s.js';
|
|
2
|
+
export { e as ExecutionTelemetry, f as ServerOptions, g as createStudioServer } from './index-DLA-Sm4s.js';
|
|
3
|
+
import '@hono/node-server';
|
|
4
|
+
import 'hono/types';
|
|
5
|
+
import 'hono';
|
|
6
|
+
|
|
7
|
+
/**
|
|
8
|
+
* Autodetects target connection type from raw target string or arguments array
|
|
9
|
+
*/
|
|
10
|
+
declare function resolveTargetConfig(target: string | string[], options?: {
|
|
11
|
+
token?: string;
|
|
12
|
+
grpc?: boolean;
|
|
13
|
+
mesh?: boolean;
|
|
14
|
+
} | string): TargetConnectionConfig;
|
|
15
|
+
declare function runScan(targetStr: string, options: {
|
|
16
|
+
token?: string;
|
|
17
|
+
json?: boolean;
|
|
18
|
+
}): Promise<void>;
|
|
19
|
+
|
|
20
|
+
declare function formatScanTable(report: ScanReport): string;
|
|
21
|
+
|
|
22
|
+
declare class NetworkDiscoveryEngine {
|
|
23
|
+
private static instance;
|
|
24
|
+
private customTargets;
|
|
25
|
+
static getInstance(): NetworkDiscoveryEngine;
|
|
26
|
+
/**
|
|
27
|
+
* Register or update a custom target dynamically in the mesh topology.
|
|
28
|
+
*/
|
|
29
|
+
registerCustomTarget(node: ScannedTargetNode): void;
|
|
30
|
+
/**
|
|
31
|
+
* Retrieve all dynamically registered custom target nodes.
|
|
32
|
+
*/
|
|
33
|
+
getCustomTargets(): ScannedTargetNode[];
|
|
34
|
+
/**
|
|
35
|
+
* Clear registered custom targets.
|
|
36
|
+
*/
|
|
37
|
+
clearCustomTargets(): void;
|
|
38
|
+
/**
|
|
39
|
+
* Probe a specific HTTP/Health endpoint dynamically.
|
|
40
|
+
*/
|
|
41
|
+
probeHttpNode(host: string, port: number, timeoutMs?: number): Promise<{
|
|
42
|
+
name?: string;
|
|
43
|
+
version?: string;
|
|
44
|
+
tier?: 1 | 2 | 3;
|
|
45
|
+
peerId?: string;
|
|
46
|
+
multiaddrs?: string[];
|
|
47
|
+
tools?: string[];
|
|
48
|
+
enrichedTools?: EnrichedTool[];
|
|
49
|
+
rttMs: number;
|
|
50
|
+
} | null>;
|
|
51
|
+
/**
|
|
52
|
+
* Dynamically discover all active servers across the target host network.
|
|
53
|
+
*/
|
|
54
|
+
scanNetwork(host?: string): Promise<ScannedTargetNode[]>;
|
|
55
|
+
/**
|
|
56
|
+
* Find the associated HTTP probe info for a given gRPC target address.
|
|
57
|
+
*/
|
|
58
|
+
resolveNodeForGrpcTarget(targetAddress: string, latencyMs: number, status: "online" | "offline" | "degraded"): Promise<{
|
|
59
|
+
node: ScannedTargetNode;
|
|
60
|
+
tools: EnrichedTool[];
|
|
61
|
+
}>;
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
/**
|
|
65
|
+
* Validates and sanitizes a subprocess executable name (CWE-78 defense).
|
|
66
|
+
* Strictly forbids shell metacharacters and ensures shell: false execution.
|
|
67
|
+
*/
|
|
68
|
+
declare function sanitizeCommand(command: string, args?: string[]): string;
|
|
69
|
+
/**
|
|
70
|
+
* Validates an HTTP target URL against SSRF and cloud metadata exfiltration (CWE-918).
|
|
71
|
+
*/
|
|
72
|
+
declare function validateHttpTarget(targetUrl: string): URL;
|
|
73
|
+
declare const sanitizeUrl: typeof validateHttpTarget;
|
|
74
|
+
/**
|
|
75
|
+
* Validates Host headers to prevent DNS Rebinding attacks on local ports.
|
|
76
|
+
*/
|
|
77
|
+
declare function validateHostHeader(host: string | undefined, allowedHosts?: string[]): boolean;
|
|
78
|
+
|
|
79
|
+
interface GrpcTransportOptions {
|
|
80
|
+
target: string;
|
|
81
|
+
useTls?: boolean;
|
|
82
|
+
token?: string;
|
|
83
|
+
}
|
|
84
|
+
declare class GrpcTransport implements StudioTransport {
|
|
85
|
+
readonly type: TargetTransportType;
|
|
86
|
+
private client;
|
|
87
|
+
private connected;
|
|
88
|
+
private target;
|
|
89
|
+
private token?;
|
|
90
|
+
constructor(options: GrpcTransportOptions);
|
|
91
|
+
isConnected(): boolean;
|
|
92
|
+
connect(): Promise<void>;
|
|
93
|
+
disconnect(): Promise<void>;
|
|
94
|
+
scan(): Promise<ScanReport>;
|
|
95
|
+
listTools(): Promise<EnrichedTool[]>;
|
|
96
|
+
callTool(name: string, args: Record<string, unknown>, envelope?: string, onStep?: (phase: string, detail: string, status: "pending" | "running" | "success" | "failed", durationMs?: number) => Promise<void>): Promise<ExecutionResult>;
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
interface HttpTransportOptions {
|
|
100
|
+
url: string;
|
|
101
|
+
authToken?: string;
|
|
102
|
+
token?: string;
|
|
103
|
+
}
|
|
104
|
+
declare class HttpTransport implements StudioTransport {
|
|
105
|
+
readonly type: TargetTransportType;
|
|
106
|
+
private connected;
|
|
107
|
+
private targetUrl;
|
|
108
|
+
private authToken?;
|
|
109
|
+
private serverInfo?;
|
|
110
|
+
private cachedTools;
|
|
111
|
+
constructor(options: HttpTransportOptions);
|
|
112
|
+
isConnected(): boolean;
|
|
113
|
+
connect(): Promise<void>;
|
|
114
|
+
disconnect(): Promise<void>;
|
|
115
|
+
scan(): Promise<ScanReport>;
|
|
116
|
+
listTools(): Promise<EnrichedTool[]>;
|
|
117
|
+
callTool(name: string, args: Record<string, unknown>, envelope?: string, onStep?: (phase: string, detail: string, status: "pending" | "running" | "success" | "failed", durationMs?: number) => Promise<void>): Promise<ExecutionResult>;
|
|
118
|
+
private postJsonRpc;
|
|
119
|
+
}
|
|
120
|
+
|
|
121
|
+
interface MeshTransportOptions {
|
|
122
|
+
bootstrapNodes?: string[];
|
|
123
|
+
swarmKey?: string | Uint8Array;
|
|
124
|
+
nexusUrl?: string;
|
|
125
|
+
clientId?: string;
|
|
126
|
+
clientSecret?: string;
|
|
127
|
+
}
|
|
128
|
+
declare class MeshTransport implements StudioTransport {
|
|
129
|
+
readonly type: TargetTransportType;
|
|
130
|
+
private client;
|
|
131
|
+
private connected;
|
|
132
|
+
private options;
|
|
133
|
+
private cachedTools;
|
|
134
|
+
constructor(options?: MeshTransportOptions);
|
|
135
|
+
isConnected(): boolean;
|
|
136
|
+
connect(): Promise<void>;
|
|
137
|
+
disconnect(): Promise<void>;
|
|
138
|
+
scan(): Promise<ScanReport>;
|
|
139
|
+
listTools(): Promise<EnrichedTool[]>;
|
|
140
|
+
callTool(name: string, args: Record<string, unknown>, envelope?: string, onStep?: (phase: string, detail: string, status: "pending" | "running" | "success" | "failed", durationMs?: number) => Promise<void>): Promise<ExecutionResult>;
|
|
141
|
+
}
|
|
142
|
+
|
|
143
|
+
interface StdioTransportOptions {
|
|
144
|
+
command: string;
|
|
145
|
+
args?: string[];
|
|
146
|
+
env?: Record<string, string>;
|
|
147
|
+
cwd?: string;
|
|
148
|
+
}
|
|
149
|
+
declare class StdioTransport implements StudioTransport {
|
|
150
|
+
private options;
|
|
151
|
+
readonly type: TargetTransportType;
|
|
152
|
+
private child;
|
|
153
|
+
private connected;
|
|
154
|
+
private pendingRequests;
|
|
155
|
+
private nextRequestId;
|
|
156
|
+
private stdoutBuffer;
|
|
157
|
+
private serverInfo?;
|
|
158
|
+
private cachedTools;
|
|
159
|
+
constructor(options: StdioTransportOptions);
|
|
160
|
+
isConnected(): boolean;
|
|
161
|
+
connect(): Promise<void>;
|
|
162
|
+
disconnect(): Promise<void>;
|
|
163
|
+
scan(): Promise<ScanReport>;
|
|
164
|
+
listTools(): Promise<EnrichedTool[]>;
|
|
165
|
+
callTool(name: string, args: Record<string, unknown>, envelope?: string, onStep?: (phase: string, detail: string, status: "pending" | "running" | "success" | "failed", durationMs?: number) => Promise<void>): Promise<ExecutionResult>;
|
|
166
|
+
private handleStdoutChunk;
|
|
167
|
+
private sendJsonRpcRequest;
|
|
168
|
+
private sendJsonRpcNotification;
|
|
169
|
+
}
|
|
170
|
+
|
|
171
|
+
declare function createTransport(config: TargetConnectionConfig): StudioTransport;
|
|
172
|
+
|
|
173
|
+
export { EnrichedTool, ExecutionResult, GrpcTransport, type GrpcTransportOptions, HttpTransport, type HttpTransportOptions, MeshTransport, type MeshTransportOptions, NetworkDiscoveryEngine, ScanReport, ScannedTargetNode, StdioTransport, type StdioTransportOptions, StudioTransport, TargetConnectionConfig, TargetTransportType, createTransport, formatScanTable, resolveTargetConfig, runScan, sanitizeCommand, sanitizeUrl, validateHostHeader, validateHttpTarget };
|