memshell-party-cli 0.5.0 → 0.6.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
@@ -669,6 +669,26 @@ declare function renderCryptoProbe(cipher: MimicCipher): string;
669
669
  /** True when a working javac is available (used to skip integration tests). */
670
670
  declare function hasJavac(): boolean;
671
671
 
672
+ type SkillScope = "user" | "claude" | "project";
673
+ declare const SKILL_NAME = "memshell-party";
674
+ /** Locate the bundled skill directory (handles both src/ and dist/ layouts). */
675
+ declare function skillSourceDir(): string;
676
+ declare function skillTargetDir(scope: SkillScope, projectDir?: string): string;
677
+ interface SkillInstallResult {
678
+ scope: SkillScope;
679
+ dir: string;
680
+ /** Top-level entries after the copy. */
681
+ files: string[];
682
+ }
683
+ interface InstallSkillOptions {
684
+ /** Base dir for project scope (default: cwd). */
685
+ projectDir?: string;
686
+ /** Override the bundled skill source (tests). */
687
+ sourceDir?: string;
688
+ }
689
+ /** Copy the bundled skill into each scope's directory. Overwrites. */
690
+ declare function installSkill(scopes: SkillScope[], opts?: InstallSkillOptions): SkillInstallResult[];
691
+
672
692
  type Suo5Mode = "auto" | "v2" | "v1";
673
693
  interface Suo5ConnectOptions extends CommonConnectOptions {
674
694
  mode?: Suo5Mode;
@@ -689,4 +709,4 @@ declare function testSuo5(url: string, options?: Suo5ConnectOptions): Promise<Co
689
709
 
690
710
  declare const CLI_VERSION: string;
691
711
 
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 };
712
+ 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 };
package/dist/index.js CHANGED
@@ -3104,6 +3104,45 @@ async function buildCustomMemshell(input, client, deps = {}) {
3104
3104
  `, "utf8");
3105
3105
  return result;
3106
3106
  }
3107
+
3108
+ // src/core/skill-install.ts
3109
+ import { cpSync, existsSync as existsSync6, mkdirSync as mkdirSync5, readdirSync as readdirSync2 } from "fs";
3110
+ import { homedir as homedir5 } from "os";
3111
+ import { join as join7 } from "path";
3112
+ import { fileURLToPath as fileURLToPath2 } from "url";
3113
+ var SKILL_NAME = "memshell-party";
3114
+ function skillSourceDir() {
3115
+ const candidates = [
3116
+ new URL(`../skills/${SKILL_NAME}`, import.meta.url),
3117
+ // dist/*.js
3118
+ new URL(`../../skills/${SKILL_NAME}`, import.meta.url)
3119
+ // src/core/*.ts
3120
+ ];
3121
+ for (const candidate of candidates) {
3122
+ const p = fileURLToPath2(candidate);
3123
+ if (existsSync6(p)) return p;
3124
+ }
3125
+ throw new Error(`bundled skill not found (expected skills/${SKILL_NAME} in the package)`);
3126
+ }
3127
+ function skillTargetDir(scope, projectDir) {
3128
+ switch (scope) {
3129
+ case "user":
3130
+ return join7(homedir5(), ".agents", "skills", SKILL_NAME);
3131
+ case "claude":
3132
+ return join7(homedir5(), ".claude", "skills", SKILL_NAME);
3133
+ case "project":
3134
+ return join7(projectDir ?? process.cwd(), "skills", SKILL_NAME);
3135
+ }
3136
+ }
3137
+ function installSkill(scopes, opts = {}) {
3138
+ const src = opts.sourceDir ?? skillSourceDir();
3139
+ return scopes.map((scope) => {
3140
+ const dir = skillTargetDir(scope, opts.projectDir);
3141
+ mkdirSync5(dir, { recursive: true });
3142
+ cpSync(src, dir, { recursive: true });
3143
+ return { scope, dir, files: readdirSync2(dir).sort() };
3144
+ });
3145
+ }
3107
3146
  export {
3108
3147
  ApiError,
3109
3148
  CLI_VERSION,
@@ -3113,6 +3152,7 @@ export {
3113
3152
  LEGACY_CIPHER,
3114
3153
  MemPartyClient,
3115
3154
  OUTPUT_LIMIT,
3155
+ SKILL_NAME,
3116
3156
  autoSaveShell,
3117
3157
  buildCustomMemshell,
3118
3158
  buildMemShellRequest,
@@ -3126,6 +3166,7 @@ export {
3126
3166
  formatOp,
3127
3167
  getProject,
3128
3168
  hasJavac,
3169
+ installSkill,
3129
3170
  listProjects,
3130
3171
  logOp,
3131
3172
  marshalFrameBase64,
@@ -3145,6 +3186,8 @@ export {
3145
3186
  saveShell,
3146
3187
  saveShellMeta,
3147
3188
  shouldDecode,
3189
+ skillSourceDir,
3190
+ skillTargetDir,
3148
3191
  startMcpStdio,
3149
3192
  targetStorePath,
3150
3193
  testBehinder,