memshell-party-cli 0.1.0 → 0.2.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/dist/index.d.ts CHANGED
@@ -267,6 +267,58 @@ declare function createMcpServer(client: MemPartyClient): McpServer;
267
267
  /** Start the MCP server over stdio. */
268
268
  declare function startMcpStdio(client: MemPartyClient): Promise<void>;
269
269
 
270
+ /** Shared types for the shell connection testers. */
271
+ type ConnectTool = "behinder" | "godzilla" | "suo5";
272
+ interface ConnectTestResult {
273
+ ok: boolean;
274
+ tool: ConnectTool;
275
+ url: string;
276
+ /** Human-readable success detail (echo size, session id, protocol variant...). */
277
+ detail?: string;
278
+ /** Human-readable failure reason. */
279
+ error?: string;
280
+ durationMs: number;
281
+ }
282
+ interface CommonConnectOptions {
283
+ /**
284
+ * MemShellParty shells are gated by a header check:
285
+ * the request must carry `headerName` containing `headerValue`
286
+ * (both are reported by `memparty gen --json` as shellToolConfig).
287
+ */
288
+ headerName?: string;
289
+ headerValue?: string;
290
+ /** Extra request headers (already merged with the gate header). */
291
+ extraHeaders?: Record<string, string>;
292
+ timeoutMs?: number;
293
+ insecure?: boolean;
294
+ }
295
+
296
+ interface BehinderConnectOptions extends CommonConnectOptions {
297
+ /** Request body encoding. Default: try base64, then raw AES bytes. */
298
+ requestEncoding?: "base64" | "raw";
299
+ }
300
+ declare function testBehinder(url: string, pass: string, options?: BehinderConnectOptions): Promise<ConnectTestResult>;
301
+
302
+ declare function testGodzilla(url: string, pass: string, key: string, options?: CommonConnectOptions): Promise<ConnectTestResult>;
303
+
304
+ type Suo5Mode = "auto" | "v2" | "v1";
305
+ interface Suo5ConnectOptions extends CommonConnectOptions {
306
+ mode?: Suo5Mode;
307
+ }
308
+ /** suo5's `Marshal`: [klen u8][key][vlen u32 BE][value] per entry. */
309
+ declare function marshalSuo5Map(entries: Array<[string, Buffer]>): Buffer;
310
+ declare function unmarshalSuo5Map(data: Buffer): Map<string, Buffer>;
311
+ /** suo5's `DataFrame.MarshalBinaryBase64`. */
312
+ declare function marshalFrameBase64(data: Buffer): Buffer;
313
+ interface Suo5Frame {
314
+ data: Buffer;
315
+ /** offset just past this frame */
316
+ next: number;
317
+ }
318
+ /** suo5's `ReadFrameBase64` over a flat buffer. Throws on truncation. */
319
+ declare function unmarshalFrameBase64(buf: Buffer, offset?: number): Suo5Frame;
320
+ declare function testSuo5(url: string, options?: Suo5ConnectOptions): Promise<ConnectTestResult>;
321
+
270
322
  declare const CLI_VERSION: string;
271
323
 
272
- export { ApiError, type ApiErrorResponse, CLI_VERSION, type CommandConfigVO, DEFAULT_API_URL, ENV_VAR, type FetchLike, type InjectorConfig, JDK_VERSIONS, type MainConfig, MemPartyClient, type MemPartyClientOptions, type MemShellGenerateRequest, type MemShellGenerateResponse, type MemShellOptions, type MemShellResult, type OutputOptions, type OutputResult, type PackerOption, type PackerTree, type ProbeConfig, type ProbeContent, type ProbeContentConfig, type ProbeMethod, type ProbeOptions, type ProbeShellGenerateRequest, type ProbeShellGenerateResponse, type ProbeShellResult, type ServerConfig, type ShellConfig, type ShellToolConfig, type VersionInfo, buildMemShellRequest, buildProbeRequest, createMcpServer, emitPayload, resolveApiUrl, resolveJreVersion, shouldDecode, startMcpStdio };
324
+ export { ApiError, type ApiErrorResponse, type BehinderConnectOptions, CLI_VERSION, type CommandConfigVO, type CommonConnectOptions, type ConnectTestResult, type ConnectTool, DEFAULT_API_URL, ENV_VAR, type FetchLike, type InjectorConfig, JDK_VERSIONS, type MainConfig, MemPartyClient, type MemPartyClientOptions, type MemShellGenerateRequest, type MemShellGenerateResponse, type MemShellOptions, type MemShellResult, type OutputOptions, type OutputResult, type PackerOption, type PackerTree, type ProbeConfig, type ProbeContent, type ProbeContentConfig, type ProbeMethod, type ProbeOptions, type ProbeShellGenerateRequest, type ProbeShellGenerateResponse, type ProbeShellResult, type ServerConfig, type ShellConfig, type ShellToolConfig, type Suo5ConnectOptions, type Suo5Mode, type VersionInfo, buildMemShellRequest, buildProbeRequest, createMcpServer, emitPayload, marshalFrameBase64, marshalSuo5Map, resolveApiUrl, resolveJreVersion, shouldDecode, startMcpStdio, testBehinder, testGodzilla, testSuo5, unmarshalFrameBase64, unmarshalSuo5Map };