@jarel/myskills 0.1.0-beta.3 → 0.1.0-beta.4

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.
Files changed (3) hide show
  1. package/README.md +1 -1
  2. package/dist/index.js +32 -15
  3. package/package.json +3 -3
package/README.md CHANGED
@@ -174,7 +174,7 @@ Update the CLI with:
174
174
  npm install -g @jarel/myskills@alpha
175
175
  ```
176
176
 
177
- The `0.1.0-beta.3` source manifest is configured for the `beta` dist-tag. The release-verification workflow packs and installs the candidate without publishing it.
177
+ The `0.1.0-beta.4` source manifest is configured for the `beta` dist-tag. The release-verification workflow packs and installs the candidate without publishing it.
178
178
 
179
179
  `validate`, `scan`, and `submit` accept a manifest file, package directory, or local `.zip` package. `login` prompts for the API URL when one is not supplied; the default is the local API at `http://localhost:3001`, and custom hosted URLs can be entered manually. Successful login stores the selected API URL in local CLI config so later commands can omit `--api-url`. API URL resolution is `--api-url`, then `MYSKILLS_API_URL`, then saved config, then `http://localhost:3001`.
180
180
 
package/dist/index.js CHANGED
@@ -1385,7 +1385,7 @@ var require_yauzl = __commonJS({
1385
1385
 
1386
1386
  // src/cli.ts
1387
1387
  import { createHash } from "node:crypto";
1388
- import { cp, mkdir, readFile as readFile3, rm, stat, writeFile } from "node:fs/promises";
1388
+ import { cp, mkdir, readFile as readFile2, rm, stat, writeFile } from "node:fs/promises";
1389
1389
  import path3 from "node:path";
1390
1390
 
1391
1391
  // ../../node_modules/zod/v4/classic/external.js
@@ -17185,7 +17185,8 @@ var architecturePatternMigrationLimits = {
17185
17185
  };
17186
17186
 
17187
17187
  // src/codex-readonly-adapter.ts
17188
- import { open, lstat as lstat2, readFile as readFile2, readdir as readdir2 } from "node:fs/promises";
17188
+ import { constants as fsConstants } from "node:fs";
17189
+ import { open, lstat as lstat2, readdir as readdir2 } from "node:fs/promises";
17189
17190
  import path2 from "node:path";
17190
17191
  var codexAdapterProfiles = ["personal", "work", "shared"];
17191
17192
  var codexAdapterDescriptor = Object.freeze({
@@ -17454,10 +17455,14 @@ var CodexReadOnlyArchitectureTargetAdapter = class {
17454
17455
  }
17455
17456
  async #readMetadataFile(relativeName) {
17456
17457
  const filePath = path2.join(this.#root, relativeName);
17458
+ let handle;
17457
17459
  try {
17458
- const entry = await lstat2(filePath);
17459
- if (entry.isSymbolicLink() || !entry.isFile() || entry.size > MAX_METADATA_BYTES) return { status: "invalid" };
17460
- const text = await readFile2(filePath, "utf8");
17460
+ handle = await open(filePath, fsConstants.O_RDONLY | fsConstants.O_NOFOLLOW | fsConstants.O_NONBLOCK);
17461
+ const entry = await handle.stat();
17462
+ if (!entry.isFile()) return { status: "invalid" };
17463
+ const { buffer, bytesRead } = await readBounded(handle, MAX_METADATA_BYTES);
17464
+ if (bytesRead > MAX_METADATA_BYTES) return { status: "invalid" };
17465
+ const text = buffer.toString("utf8", 0, bytesRead);
17461
17466
  let value;
17462
17467
  try {
17463
17468
  value = JSON.parse(text);
@@ -17468,6 +17473,8 @@ var CodexReadOnlyArchitectureTargetAdapter = class {
17468
17473
  } catch (error51) {
17469
17474
  if (isMissingFileError(error51)) return { status: "missing" };
17470
17475
  return { status: "invalid" };
17476
+ } finally {
17477
+ await handle?.close().catch(() => void 0);
17471
17478
  }
17472
17479
  }
17473
17480
  async #readSkills(profileResolutions, routerPolicy, findings) {
@@ -17663,9 +17670,9 @@ function parseRouterPolicyEntry(value, findings) {
17663
17670
  async function readFrontmatter(filePath) {
17664
17671
  let handle;
17665
17672
  try {
17666
- const entry = await lstat2(filePath);
17667
- if (entry.isSymbolicLink() || !entry.isFile()) return { status: "invalid" };
17668
- handle = await open(filePath, "r");
17673
+ handle = await open(filePath, fsConstants.O_RDONLY | fsConstants.O_NOFOLLOW | fsConstants.O_NONBLOCK);
17674
+ const entry = await handle.stat();
17675
+ if (!entry.isFile()) return { status: "invalid" };
17669
17676
  const openingDelimiter = await readOpeningDelimiter(handle);
17670
17677
  if (!openingDelimiter.valid) return { status: "missing" };
17671
17678
  const lines = [];
@@ -17685,6 +17692,16 @@ async function readFrontmatter(filePath) {
17685
17692
  await handle?.close().catch(() => void 0);
17686
17693
  }
17687
17694
  }
17695
+ async function readBounded(handle, maximumBytes) {
17696
+ const buffer = Buffer.alloc(maximumBytes + 1);
17697
+ let bytesRead = 0;
17698
+ while (bytesRead < buffer.length) {
17699
+ const result = await handle.read(buffer, bytesRead, buffer.length - bytesRead, bytesRead);
17700
+ if (result.bytesRead === 0) break;
17701
+ bytesRead += result.bytesRead;
17702
+ }
17703
+ return { buffer, bytesRead };
17704
+ }
17688
17705
  async function readOpeningDelimiter(handle) {
17689
17706
  const buffer = Buffer.alloc(4);
17690
17707
  const result = await handle.read(buffer, 0, buffer.length, null);
@@ -17799,7 +17816,7 @@ function isMissingFileError(error51) {
17799
17816
 
17800
17817
  // src/cli.ts
17801
17818
  var DEFAULT_API_URL = "http://localhost:3001";
17802
- var CLI_VERSION = "0.1.0-beta.3";
17819
+ var CLI_VERSION = "0.1.0-beta.4";
17803
17820
  var CLI_VISIBILITY_SCOPES = ["public", "authenticated", "organization", "team", "private", "explicit-users"];
17804
17821
  var LOGIN_AUTH_METHODS = ["password", "api-key"];
17805
17822
  var OBSERVED_IDENTIFIER_PATTERN = /^[A-Za-z0-9][A-Za-z0-9._:-]{0,127}$/;
@@ -18801,7 +18818,7 @@ async function readCodexAdapterContext(parsed) {
18801
18818
  }
18802
18819
  let text;
18803
18820
  try {
18804
- text = await readFile3(path3.resolve(contextPath), "utf8");
18821
+ text = await readFile2(path3.resolve(contextPath), "utf8");
18805
18822
  } catch {
18806
18823
  throw new CliError("The context JSON file could not be read.", 2, "CODEX_TARGET_CONTEXT_INVALID");
18807
18824
  }
@@ -18948,7 +18965,7 @@ async function submissionPayload(packagePath, manifest) {
18948
18965
  manifest,
18949
18966
  archive: {
18950
18967
  filename: path3.basename(packagePath),
18951
- contentBase64: (await readFile3(packagePath)).toString("base64")
18968
+ contentBase64: (await readFile2(packagePath)).toString("base64")
18952
18969
  }
18953
18970
  };
18954
18971
  }
@@ -19234,7 +19251,7 @@ function installRoot(parsed, runtime) {
19234
19251
  }
19235
19252
  async function readInstallRegistry(root) {
19236
19253
  try {
19237
- return parseInstallRegistry(await readFile3(installRegistryPath(root), "utf8"), root);
19254
+ return parseInstallRegistry(await readFile2(installRegistryPath(root), "utf8"), root);
19238
19255
  } catch (error51) {
19239
19256
  if (isNodeError(error51) && error51.code === "ENOENT") {
19240
19257
  return { version: 1, installations: {} };
@@ -19911,7 +19928,7 @@ async function readObservedStateFixture(inputPath) {
19911
19928
  const resolvedPath = path3.resolve(inputPath);
19912
19929
  let text;
19913
19930
  try {
19914
- text = await readFile3(resolvedPath, "utf8");
19931
+ text = await readFile2(resolvedPath, "utf8");
19915
19932
  } catch {
19916
19933
  throw new CliError("Observed-state fixture could not be read.", 2, "OBSERVED_STATE_INVALID");
19917
19934
  }
@@ -21099,7 +21116,7 @@ function isNodeError2(error51) {
21099
21116
  }
21100
21117
 
21101
21118
  // src/token-store.ts
21102
- import { chmod, mkdir as mkdir2, readFile as readFile4, rm as rm2, writeFile as writeFile2 } from "node:fs/promises";
21119
+ import { chmod, mkdir as mkdir2, readFile as readFile3, rm as rm2, writeFile as writeFile2 } from "node:fs/promises";
21103
21120
  import os2 from "node:os";
21104
21121
  import path5 from "node:path";
21105
21122
  var KEYRING_SERVICE = "ai.jarel.myskills.cli";
@@ -21200,7 +21217,7 @@ function tokenFilePath(env) {
21200
21217
  }
21201
21218
  async function readPayload2(filePath) {
21202
21219
  try {
21203
- const raw = await readFile4(filePath, "utf8");
21220
+ const raw = await readFile3(filePath, "utf8");
21204
21221
  return parsePayload2(raw);
21205
21222
  } catch (error51) {
21206
21223
  if (isNodeError3(error51) && error51.code === "ENOENT") {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@jarel/myskills",
3
- "version": "0.1.0-beta.3",
3
+ "version": "0.1.0-beta.4",
4
4
  "description": "Command-line client for publishing, discovering, installing, updating, and rolling back MySkills packages.",
5
5
  "license": "Apache-2.0",
6
6
  "private": false,
@@ -41,8 +41,8 @@
41
41
  "test": "node ../../scripts/run-node-tests.mjs --import tsx --extensions .test.ts"
42
42
  },
43
43
  "devDependencies": {
44
- "@myskills-app/core": "0.1.0-beta.3",
45
- "@myskills-app/skill-package": "0.1.0-beta.3",
44
+ "@myskills-app/core": "0.1.0-beta.4",
45
+ "@myskills-app/skill-package": "0.1.0-beta.4",
46
46
  "esbuild": "^0.28.2",
47
47
  "tsx": "^4.23.12"
48
48
  },