@newlandnpt/pep-cli 0.4.0 → 0.4.1

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/README.md CHANGED
@@ -137,6 +137,10 @@ pep skills add group/sub/project -p # move it into this project
137
137
  `pep skills list` prints each repository with the directory it lives in, which is what `-p` matches
138
138
  against.
139
139
 
140
+ Deleting a skill folder by hand is fine — `pep skills update` notices it is missing and writes it
141
+ again. It checks the disk, not just its own ledger, so it cannot report "already up to date" about
142
+ files that are no longer there.
143
+
140
144
  `pep auth token` writes only the access token to stdout, so agents can use it without parsing status
141
145
  text. Refresh occurs automatically shortly before expiry and the rotated refresh token replaces the old
142
146
  credential atomically.
package/dist/pep.cjs CHANGED
@@ -1195,6 +1195,15 @@ function hashSkill(files) {
1195
1195
  }
1196
1196
  return hash.digest("hex").slice(0, 32);
1197
1197
  }
1198
+ async function allPresent(directory, skills, linkedInto) {
1199
+ for (const skill of skills) {
1200
+ if (!await (0, import_promises4.stat)((0, import_node_path4.join)(directory, skill)).catch(() => null)) return false;
1201
+ if (linkedInto !== void 0 && !await (0, import_promises4.stat)((0, import_node_path4.join)(linkedInto, skill)).catch(() => null)) {
1202
+ return false;
1203
+ }
1204
+ }
1205
+ return true;
1206
+ }
1198
1207
  async function updateSkills(dependencies) {
1199
1208
  const doFetch = dependencies.fetch ?? globalThis.fetch;
1200
1209
  const name = dependencies.source;
@@ -1211,7 +1220,8 @@ async function updateSkills(dependencies) {
1211
1220
  const state = await dependencies.stateStore.read();
1212
1221
  const previous = state?.packages[name];
1213
1222
  const sameTarget = previous?.directory === dependencies.directory && previous?.linkedInto === dependencies.linkInto;
1214
- if (commit !== void 0 && commit === previous?.commit && sameTarget) {
1223
+ const intact = sameTarget && previous !== void 0 && await allPresent(previous.directory, Object.keys(previous.skills), previous.linkedInto);
1224
+ if (commit !== void 0 && commit === previous?.commit && intact) {
1215
1225
  await response.body?.cancel();
1216
1226
  return { status: "unchanged", name, commit };
1217
1227
  }
@@ -1292,7 +1302,7 @@ async function updateSkills(dependencies) {
1292
1302
  }
1293
1303
 
1294
1304
  // src/cli.ts
1295
- var VERSION = false ? "0.0.0-dev" : "0.4.0";
1305
+ var VERSION = false ? "0.0.0-dev" : "0.4.1";
1296
1306
  function usage() {
1297
1307
  return `PEP CLI ${VERSION}
1298
1308
 
@@ -1348,6 +1358,7 @@ it already lives and never moves anything. On update, -p and --dir instead NARRO
1348
1358
  repositories installed there: \`pep skills update -p\` refreshes only this project's, and reports
1349
1359
  nothing to do when the project has none. To move a repository, add it again with the new flag \u2014
1350
1360
  add is where the location is decided, and the copy in the old location is then removed.
1361
+ Deleting a skill folder by hand is fine: update notices it is gone and writes it again.
1351
1362
  Either way update only touches skills it wrote itself; anything you put there by hand is left alone.
1352
1363
 
1353
1364
  \`pep docs list\` prints the documents this account can read (path + description); feed a path
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@newlandnpt/pep-cli",
3
- "version": "0.4.0",
3
+ "version": "0.4.1",
4
4
  "description": "PEP CLI —— 凭 PEP 身份读取 Newland 开发者文档与 agent skills",
5
5
  "license": "UNLICENSED",
6
6
  "type": "module",