clikit-plugin 0.2.25 → 0.2.26

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/cli.d.ts CHANGED
@@ -7,6 +7,5 @@ interface ScaffoldStats {
7
7
  export declare function resolveProjectDir(env?: NodeJS.ProcessEnv, cwd?: string): string;
8
8
  export declare function upsertPluginEntry(existingPlugins: string[], pluginName: string, version: string): string[];
9
9
  export declare function scaffoldProjectOpencode(projectDir: string, packageRoot?: string): ScaffoldStats;
10
- export declare function scaffoldGlobalPluginAssets(configDir: string, packageRoot?: string): ScaffoldStats;
11
10
  export {};
12
11
  //# sourceMappingURL=cli.d.ts.map
package/dist/cli.d.ts.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"cli.d.ts","sourceRoot":"","sources":["../src/cli.ts"],"names":[],"mappings":";AASA,UAAU,aAAa;IACrB,MAAM,EAAE,MAAM,CAAC;IACf,OAAO,EAAE,MAAM,CAAC;IAChB,cAAc,EAAE,MAAM,EAAE,CAAC;CAC1B;AA4BD,wBAAgB,iBAAiB,CAC/B,GAAG,GAAE,MAAM,CAAC,UAAwB,EACpC,GAAG,GAAE,MAAsB,GAC1B,MAAM,CAiBR;AAED,wBAAgB,iBAAiB,CAAC,eAAe,EAAE,MAAM,EAAE,EAAE,UAAU,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,GAAG,MAAM,EAAE,CAM1G;AA0CD,wBAAgB,uBAAuB,CAAC,UAAU,EAAE,MAAM,EAAE,WAAW,SAAmB,GAAG,aAAa,CA0DzG;AAED,wBAAgB,0BAA0B,CAAC,SAAS,EAAE,MAAM,EAAE,WAAW,SAAmB,GAAG,aAAa,CAqB3G"}
1
+ {"version":3,"file":"cli.d.ts","sourceRoot":"","sources":["../src/cli.ts"],"names":[],"mappings":";AASA,UAAU,aAAa;IACrB,MAAM,EAAE,MAAM,CAAC;IACf,OAAO,EAAE,MAAM,CAAC;IAChB,cAAc,EAAE,MAAM,EAAE,CAAC;CAC1B;AA4BD,wBAAgB,iBAAiB,CAC/B,GAAG,GAAE,MAAM,CAAC,UAAwB,EACpC,GAAG,GAAE,MAAsB,GAC1B,MAAM,CAiBR;AAED,wBAAgB,iBAAiB,CAAC,eAAe,EAAE,MAAM,EAAE,EAAE,UAAU,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,GAAG,MAAM,EAAE,CAM1G;AA0CD,wBAAgB,uBAAuB,CAAC,UAAU,EAAE,MAAM,EAAE,WAAW,SAAmB,GAAG,aAAa,CA0DzG"}
package/dist/cli.js CHANGED
@@ -122,16 +122,17 @@ export default CliKitPlugin;
122
122
  }
123
123
  return stats;
124
124
  }
125
- function scaffoldGlobalPluginAssets(configDir, packageRoot = getPackageRoot()) {
126
- const pluginsDir = path.join(configDir, "plugins");
127
- const stats = {
128
- copied: 0,
129
- skipped: 0,
130
- missingSources: []
131
- };
132
- copyFileIfMissing(path.join(packageRoot, "dist", "index.js"), path.join(pluginsDir, "clikit.js"), stats);
133
- copyDirectoryFilesIfMissing(path.join(packageRoot, "src", "agents"), path.join(pluginsDir, "agents"), stats);
134
- return stats;
125
+ function removeLegacyGlobalPluginAssets(configDir) {
126
+ const legacyPluginPath = path.join(configDir, "plugins", "clikit.js");
127
+ const legacyAgentsDir = path.join(configDir, "plugins", "agents");
128
+ if (fs.existsSync(legacyPluginPath)) {
129
+ fs.rmSync(legacyPluginPath, { force: true });
130
+ console.log(`\u2713 Removed legacy local plugin file: ${legacyPluginPath}`);
131
+ }
132
+ if (fs.existsSync(legacyAgentsDir)) {
133
+ fs.rmSync(legacyAgentsDir, { recursive: true, force: true });
134
+ console.log(`\u2713 Removed legacy local agents directory: ${legacyAgentsDir}`);
135
+ }
135
136
  }
136
137
  function getRealHome() {
137
138
  if (process.env.SNAP_REAL_HOME) {
@@ -249,19 +250,12 @@ async function install() {
249
250
  return 1;
250
251
  }
251
252
  console.log(`
252
- [3/5] Installing global plugin assets...`);
253
+ [3/5] Cleaning legacy local plugin assets...`);
253
254
  try {
254
- const stats = scaffoldGlobalPluginAssets(getConfigDir());
255
- console.log(`\u2713 Global plugin assets ready in ${path.join(getConfigDir(), "plugins")}`);
256
- console.log(` Copied: ${stats.copied}, Skipped existing: ${stats.skipped}`);
257
- if (stats.missingSources.length > 0) {
258
- console.log(" Missing bundled sources (skipped):");
259
- for (const missing of stats.missingSources) {
260
- console.log(` - ${missing}`);
261
- }
262
- }
255
+ removeLegacyGlobalPluginAssets(getConfigDir());
256
+ console.log("\u2713 Global install mode uses npm plugin from opencode config");
263
257
  } catch (err) {
264
- console.error(`\u2717 Failed to install global plugin assets: ${err}`);
258
+ console.error(`\u2717 Failed to clean legacy assets: ${err}`);
265
259
  return 1;
266
260
  }
267
261
  console.log(`
@@ -361,6 +355,5 @@ if (import.meta.main) {
361
355
  export {
362
356
  upsertPluginEntry,
363
357
  scaffoldProjectOpencode,
364
- scaffoldGlobalPluginAssets,
365
358
  resolveProjectDir
366
359
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "clikit-plugin",
3
- "version": "0.2.25",
3
+ "version": "0.2.26",
4
4
  "description": "OpenCode plugin with 10 agents, 19 commands, 48 skills, 14 hooks",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",