ocx 1.0.1 → 1.0.3

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.js CHANGED
@@ -4510,7 +4510,7 @@ var {
4510
4510
  // src/commands/add.ts
4511
4511
  import { createHash } from "crypto";
4512
4512
  import { existsSync } from "fs";
4513
- import { mkdir, readFile, writeFile } from "fs/promises";
4513
+ import { mkdir, writeFile } from "fs/promises";
4514
4514
  import { dirname, join } from "path";
4515
4515
 
4516
4516
  // ../../node_modules/.bun/zod@3.25.76/node_modules/zod/v3/external.js
@@ -10552,17 +10552,15 @@ function registerAddCommand(program2) {
10552
10552
  }
10553
10553
  async function runAdd(componentNames, options2) {
10554
10554
  const cwd = options2.cwd ?? process.cwd();
10555
- const configPath = join(cwd, "ocx.jsonc");
10556
10555
  const lockPath = join(cwd, "ocx.lock");
10557
- if (!existsSync(configPath)) {
10556
+ const config = await readOcxConfig(cwd);
10557
+ if (!config) {
10558
10558
  throw new ConfigError("No ocx.jsonc found. Run 'ocx init' first.");
10559
10559
  }
10560
- const configContent = await readFile(configPath, "utf-8");
10561
- const config = ocxConfigSchema.parse(JSON.parse(configContent));
10562
10560
  let lock = { lockVersion: 1, installed: {} };
10563
- if (existsSync(lockPath)) {
10564
- const lockContent = await readFile(lockPath, "utf-8");
10565
- lock = ocxLockSchema.parse(JSON.parse(lockContent));
10561
+ const existingLock = await readOcxLock(cwd);
10562
+ if (existingLock) {
10563
+ lock = existingLock;
10566
10564
  }
10567
10565
  const spin = options2.quiet ? null : createSpinner({ text: "Resolving dependencies..." });
10568
10566
  spin?.start();
@@ -11929,7 +11927,7 @@ function registerSearchCommand(program2) {
11929
11927
  }
11930
11928
 
11931
11929
  // src/index.ts
11932
- var version = typeof __VERSION__ !== "undefined" ? __VERSION__ : "0.0.0-dev";
11930
+ var version = "1.0.3";
11933
11931
  async function main2() {
11934
11932
  const program2 = new Command().name("ocx").description("OpenCode Extensions - Install agents, skills, plugins, and commands").version(version);
11935
11933
  registerInitCommand(program2);
@@ -11944,4 +11942,4 @@ main2().catch((err) => {
11944
11942
  handleError(err);
11945
11943
  });
11946
11944
 
11947
- //# debugId=B972029F0864960D64756E2164756E21
11945
+ //# debugId=B5313F446113C01D64756E2164756E21