memshell-party-cli 0.5.0 → 0.7.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
@@ -149,6 +149,12 @@ declare class MemPartyClient {
149
149
  getPackerTree(): Promise<PackerTree>;
150
150
  getPackers(): Promise<string[]>;
151
151
  getCommandConfigs(): Promise<CommandConfigVO>;
152
+ /**
153
+ * Servers the ResponseBody probe can write a response on.
154
+ * Only exists on backend >= 2.9.0 — callers should fall back to the full
155
+ * server list when this endpoint 404s.
156
+ */
157
+ getProbeResponseBodyServers(): Promise<string[]>;
152
158
  getVersion(): Promise<VersionInfo>;
153
159
  generateMemShell(req: MemShellGenerateRequest): Promise<MemShellGenerateResponse>;
154
160
  generateProbe(req: ProbeShellGenerateRequest): Promise<ProbeShellGenerateResponse>;
@@ -476,9 +482,15 @@ declare function execGodzilla(url: string, pass: string, key: string, command: s
476
482
  interface ProfileTemplate {
477
483
  /** <title> of this page (metadata — the template is used verbatim). */
478
484
  title: string;
479
- /** Full HTML of a real page on the site (a response skin). */
485
+ /**
486
+ * Full body of a real response on the site (a response skin). Any text
487
+ * format is allowed — HTML, JSON, XML, JS… When it contains the literal
488
+ * placeholder `{{payload}}`, the ciphertext is substituted exactly there
489
+ * (works for every format); without a placeholder the template must be an
490
+ * HTML page and the cipher's marker fragment is injected before </body>.
491
+ */
480
492
  template: string;
481
- /** Content-Type this page is served with. */
493
+ /** Content-Type this page is served with (the shell answers with it). */
482
494
  contentType: string;
483
495
  /** Relative rotation weight (default 1). */
484
496
  weight?: number;
@@ -502,8 +514,25 @@ interface ProfileRequest {
502
514
  secretField: string;
503
515
  /** Where the ciphertext goes: form body (default), URL query, or a header. */
504
516
  secretIn?: "body" | "query" | "header";
517
+ /**
518
+ * Body serialization when secretIn=body: "form" (default, url-encoded) or
519
+ * "json" (a JSON object with Content-Type application/json — for API sites
520
+ * whose dominant traffic is JSON XHR). Ignored when bodyTemplate is set.
521
+ */
522
+ bodyStyle?: "form" | "json";
523
+ /**
524
+ * Full request body with the literal placeholder `{{payload}}` where the
525
+ * ciphertext goes (takes precedence over bodyStyle; secretIn must be body).
526
+ * Any text format — an OpenAI-style chat JSON, a GraphQL envelope, an XML
527
+ * SOAP message, a multipart/form-data body (pair it with a Content-Type
528
+ * header carrying the same boundary). Decoy macros {{hex:N}}, {{b64:N}},
529
+ * {{uuid}}, {{ts}}, {{int:A:B}} are rendered per request.
530
+ */
531
+ bodyTemplate?: string;
505
532
  /** Decoy fields sent alongside (e.g. csrftoken/j_username/agreement). */
506
533
  fields?: ProfileFormField[];
534
+ /** Extra/override request headers for this shape (e.g. Accept). */
535
+ headers?: Record<string, string>;
507
536
  /** Relative rotation weight (default 1) when `request` is an array. */
508
537
  weight?: number;
509
538
  }
@@ -659,9 +688,29 @@ interface FilterTemplateOptions {
659
688
  secret: string;
660
689
  /** Carrier field names (form fields / headers) that may hold the ciphertext. */
661
690
  fields: string[];
662
- /** Cover pages from the site profile (raw HTML, rotated per response). */
663
- templates: string[];
691
+ /**
692
+ * Lowercase Content-Type needles (contains-match): the body is read only
693
+ * when its Content-Type matches one — derived from the profile's body
694
+ * shapes. Empty = never touch the body stream: reading a body the shell
695
+ * doesn't own consumes it and breaks the app behind us.
696
+ */
697
+ bodyContentTypes: string[];
698
+ /** Cover bodies from the site profile (rotated per response, each with its contentType). */
699
+ templates: Array<{
700
+ template: string;
701
+ contentType: string;
702
+ }>;
664
703
  cipher: MimicCipher;
704
+ /**
705
+ * Base64 bytes of the body-wrapper classes (renderWrapperJava, compiled by
706
+ * the build's first phase). The filter self-defines them at runtime so the
707
+ * uploaded shell stays a single self-contained class — MemShellParty's
708
+ * Custom generator can only resolve one class.
709
+ */
710
+ wrapper: {
711
+ bodyB64: string;
712
+ streamB64: string;
713
+ };
665
714
  }
666
715
  declare function renderFilterJava(opts: FilterTemplateOptions): string;
667
716
  declare function renderCryptoProbe(cipher: MimicCipher): string;
@@ -669,6 +718,26 @@ declare function renderCryptoProbe(cipher: MimicCipher): string;
669
718
  /** True when a working javac is available (used to skip integration tests). */
670
719
  declare function hasJavac(): boolean;
671
720
 
721
+ type SkillScope = "user" | "claude" | "project";
722
+ declare const SKILL_NAME = "memshell-party";
723
+ /** Locate the bundled skill directory (handles both src/ and dist/ layouts). */
724
+ declare function skillSourceDir(): string;
725
+ declare function skillTargetDir(scope: SkillScope, projectDir?: string): string;
726
+ interface SkillInstallResult {
727
+ scope: SkillScope;
728
+ dir: string;
729
+ /** Top-level entries after the copy. */
730
+ files: string[];
731
+ }
732
+ interface InstallSkillOptions {
733
+ /** Base dir for project scope (default: cwd). */
734
+ projectDir?: string;
735
+ /** Override the bundled skill source (tests). */
736
+ sourceDir?: string;
737
+ }
738
+ /** Copy the bundled skill into each scope's directory. Overwrites. */
739
+ declare function installSkill(scopes: SkillScope[], opts?: InstallSkillOptions): SkillInstallResult[];
740
+
672
741
  type Suo5Mode = "auto" | "v2" | "v1";
673
742
  interface Suo5ConnectOptions extends CommonConnectOptions {
674
743
  mode?: Suo5Mode;
@@ -689,4 +758,4 @@ declare function testSuo5(url: string, options?: Suo5ConnectOptions): Promise<Co
689
758
 
690
759
  declare const CLI_VERSION: string;
691
760
 
692
- export { ApiError, type ApiErrorResponse, type BehinderConnectOptions, type BuildDeps, CLI_VERSION, type CommandConfigVO, type CommonConnectOptions, type ConnectTestResult, type ConnectTool, type ConnectionFlags, type CustomBuildInput, type CustomBuildResult, DEFAULT_API_URL, ENV_VAR, type ExecResult, type FetchLike, type FilterTemplateOptions, type GenerateClient, type GodzillaExecOptions, type InjectorConfig, JDK_VERSIONS, LEGACY_CIPHER, type MainConfig, MemPartyClient, type MemPartyClientOptions, type MemShellGenerateRequest, type MemShellGenerateResponse, type MemShellOptions, type MemShellResult, type MimicCipher, OUTPUT_LIMIT, type OpCategory, type OpFilter, type OpLogEntry, 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 ResolvedConnection, type ServerConfig, type ShellConfig, type ShellInput, type ShellToolConfig, type StoredProject, type StoredShell, type Suo5ConnectOptions, type Suo5Mode, type VersionInfo, autoSaveShell, buildCustomMemshell, buildMemShellRequest, buildProbeRequest, createMcpServer, defaultClassName, deriveMarkers, emitPayload, execBehinder, execGodzilla, formatOp, getProject, hasJavac, listProjects, logOp, marshalFrameBase64, marshalSuo5Map, opLogPath, profileSecretFields, readOps, removeProject, removeShell, renderCryptoProbe, renderFilterJava, resolveApiUrl, resolveCipher, resolveConnection, resolveJreVersion, saveProjectMeta, saveShell, saveShellMeta, shouldDecode, startMcpStdio, targetStorePath, testBehinder, testGodzilla, testSuo5, truncateOutput, unmarshalFrameBase64, unmarshalSuo5Map };
761
+ export { ApiError, type ApiErrorResponse, type BehinderConnectOptions, type BuildDeps, CLI_VERSION, type CommandConfigVO, type CommonConnectOptions, type ConnectTestResult, type ConnectTool, type ConnectionFlags, type CustomBuildInput, type CustomBuildResult, DEFAULT_API_URL, ENV_VAR, type ExecResult, type FetchLike, type FilterTemplateOptions, type GenerateClient, type GodzillaExecOptions, type InjectorConfig, type InstallSkillOptions, JDK_VERSIONS, LEGACY_CIPHER, type MainConfig, MemPartyClient, type MemPartyClientOptions, type MemShellGenerateRequest, type MemShellGenerateResponse, type MemShellOptions, type MemShellResult, type MimicCipher, OUTPUT_LIMIT, type OpCategory, type OpFilter, type OpLogEntry, 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 ResolvedConnection, SKILL_NAME, type ServerConfig, type ShellConfig, type ShellInput, type ShellToolConfig, type SkillInstallResult, type SkillScope, type StoredProject, type StoredShell, type Suo5ConnectOptions, type Suo5Mode, type VersionInfo, autoSaveShell, buildCustomMemshell, buildMemShellRequest, buildProbeRequest, createMcpServer, defaultClassName, deriveMarkers, emitPayload, execBehinder, execGodzilla, formatOp, getProject, hasJavac, installSkill, listProjects, logOp, marshalFrameBase64, marshalSuo5Map, opLogPath, profileSecretFields, readOps, removeProject, removeShell, renderCryptoProbe, renderFilterJava, resolveApiUrl, resolveCipher, resolveConnection, resolveJreVersion, saveProjectMeta, saveShell, saveShellMeta, shouldDecode, skillSourceDir, skillTargetDir, startMcpStdio, targetStorePath, testBehinder, testGodzilla, testSuo5, truncateOutput, unmarshalFrameBase64, unmarshalSuo5Map };