skillwiki 0.10.50 → 0.10.51

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.
@@ -35,7 +35,7 @@ import {
35
35
  snapshotterAliasForLocalHost,
36
36
  toUndirectedWeighted,
37
37
  writeDotenv
38
- } from "./chunk-EUTNN4RN.js";
38
+ } from "./chunk-UPQ6XJSV.js";
39
39
  import {
40
40
  atomicWriteText,
41
41
  prepareTypedPage
@@ -605,7 +605,7 @@ function safeUserName() {
605
605
  }
606
606
 
607
607
  // src/commands/sync.ts
608
- import { existsSync as existsSync8 } from "fs";
608
+ import { existsSync as existsSync8, readFileSync as readFileSync5 } from "fs";
609
609
  import { join as join17 } from "path";
610
610
  import { execFileSync as execFileSync3 } from "child_process";
611
611
 
@@ -6081,17 +6081,43 @@ var MANAGED_WRITER_SPECS = [
6081
6081
  // never match.
6082
6082
  ["rclone", /(?:^rclone(?:\.exe)?$)|(?:\brclone(?:\.exe)?\s+(?:copy|sync|move|delete|purge|deletefile|copyto|moveto|dedupe|mkdir|rmdir|rmdirs|touch|settier|bisync|copyurl)(?:\s|$))/i],
6083
6083
  // Writing helper scripts on Unix; Windows image name only.
6084
+ // The invoking process tree is excluded separately so snapshot/pull
6085
+ // children can run managed writes without live-writer-overlap.
6084
6086
  ["vault-sync", /(?:^vault-sync(?:\.exe)?$)|(?:wiki-(?:snapshot|pull-with-auto-resolve|git-repair-v3)\.sh(?:\s|$))/i]
6085
6087
  ];
6086
6088
  var MANAGED_WRITER_KINDS = MANAGED_WRITER_SPECS.map(([kind]) => kind);
6089
+ function collectManagedWriterAncestorPids(startPid, readStatus = readProcStatus) {
6090
+ const ids = /* @__PURE__ */ new Set();
6091
+ let pid = startPid;
6092
+ for (let i = 0; i < 64; i++) {
6093
+ if (!Number.isInteger(pid) || pid <= 1) break;
6094
+ const status = readStatus(pid);
6095
+ if (status == null) break;
6096
+ const match = status.match(/^PPid:\s+(\d+)/m);
6097
+ if (!match) break;
6098
+ const ppid = Number(match[1]);
6099
+ if (!Number.isInteger(ppid) || ppid <= 0 || ids.has(ppid)) break;
6100
+ ids.add(ppid);
6101
+ pid = ppid;
6102
+ }
6103
+ return ids;
6104
+ }
6105
+ function readProcStatus(pid) {
6106
+ try {
6107
+ return readFileSync5(`/proc/${pid}/status`, "utf8");
6108
+ } catch {
6109
+ return null;
6110
+ }
6111
+ }
6087
6112
  function classifyStash(ageMinutes, sessionId, currentSession) {
6088
6113
  if (sessionId && sessionId === currentSession) return "self_or_local_recovery_stash";
6089
6114
  if (sessionId && ageMinutes <= STASH_RECENT_MINUTES) return "recent_known_peer_stash";
6090
6115
  if (ageMinutes > STASH_RECENT_MINUTES) return "stale_stash_backlog";
6091
6116
  return "unknown_stash_ownership";
6092
6117
  }
6093
- function classifyManagedWriterProcesses(snapshot, currentPid = process.pid) {
6118
+ function classifyManagedWriterProcesses(snapshot, currentPid = process.pid, ancestorPids = collectManagedWriterAncestorPids(currentPid)) {
6094
6119
  const kinds = /* @__PURE__ */ new Set();
6120
+ const ancestors = ancestorPids instanceof Set ? ancestorPids : new Set(ancestorPids);
6095
6121
  let count = 0;
6096
6122
  for (const line of snapshot.split(/\r?\n/)) {
6097
6123
  const trimmed = line.trim();
@@ -6108,7 +6134,7 @@ function classifyManagedWriterProcesses(snapshot, currentPid = process.pid) {
6108
6134
  pid = Number(pidMatch[1]);
6109
6135
  processName = pidMatch[2];
6110
6136
  }
6111
- if (pid === currentPid) continue;
6137
+ if (pid === currentPid || ancestors.has(pid)) continue;
6112
6138
  const kind = MANAGED_WRITER_SPECS.find(([, pattern]) => pattern.test(processName))?.[0];
6113
6139
  if (!kind) continue;
6114
6140
  count += 1;
@@ -6287,7 +6313,7 @@ import { randomBytes as randomBytes2 } from "crypto";
6287
6313
  import {
6288
6314
  existsSync as existsSync9,
6289
6315
  mkdirSync as mkdirSync4,
6290
- readFileSync as readFileSync5,
6316
+ readFileSync as readFileSync6,
6291
6317
  unlinkSync as unlinkSync3,
6292
6318
  writeFileSync as writeFileSync4
6293
6319
  } from "fs";
@@ -6300,7 +6326,7 @@ function managedWriteLockPath(vault) {
6300
6326
  }
6301
6327
  function readLockRecord(path) {
6302
6328
  try {
6303
- return JSON.parse(readFileSync5(path, "utf8"));
6329
+ return JSON.parse(readFileSync6(path, "utf8"));
6304
6330
  } catch {
6305
6331
  return null;
6306
6332
  }
@@ -6421,7 +6447,7 @@ function acquireManagedWriteLock(vault, command, options = {}) {
6421
6447
  }
6422
6448
  function releaseManagedWriteLock(handle) {
6423
6449
  try {
6424
- const parsed = JSON.parse(readFileSync5(handle.path, "utf8"));
6450
+ const parsed = JSON.parse(readFileSync6(handle.path, "utf8"));
6425
6451
  if (parsed.owner_token !== handle.ownerToken || parsed.acquired !== handle.acquired) {
6426
6452
  return err("SYNC_LOCK_HELD", {
6427
6453
  path: handle.path,
@@ -6440,7 +6466,7 @@ import {
6440
6466
  existsSync as existsSync10,
6441
6467
  mkdirSync as mkdirSync5,
6442
6468
  readdirSync,
6443
- readFileSync as readFileSync6,
6469
+ readFileSync as readFileSync7,
6444
6470
  renameSync as renameSync2,
6445
6471
  writeFileSync as writeFileSync5
6446
6472
  } from "fs";
@@ -6475,7 +6501,7 @@ function readJournal(vault, opId) {
6475
6501
  const path = join19(dir, `${opId}.env`);
6476
6502
  if (!existsSync10(path)) return null;
6477
6503
  try {
6478
- return parseJournalEnv(readFileSync6(path, "utf8"));
6504
+ return parseJournalEnv(readFileSync7(path, "utf8"));
6479
6505
  } catch {
6480
6506
  return null;
6481
6507
  }
@@ -6623,11 +6649,11 @@ function supersedeStaleReviewRequiredJournals(vault, opts = {}) {
6623
6649
  }
6624
6650
 
6625
6651
  // src/utils/snapshot-worktree.ts
6626
- import { readFileSync as readFileSync7 } from "fs";
6652
+ import { readFileSync as readFileSync8 } from "fs";
6627
6653
  import { join as join20, resolve as resolve5 } from "path";
6628
6654
  function readSkillWikiConfig(path) {
6629
6655
  try {
6630
- return parseDotenvText(readFileSync7(path, "utf8"));
6656
+ return parseDotenvText(readFileSync8(path, "utf8"));
6631
6657
  } catch {
6632
6658
  return {};
6633
6659
  }
@@ -6636,7 +6662,7 @@ function readSnapshotProfile(path) {
6636
6662
  const allowed = /* @__PURE__ */ new Set(["WIKI_GIT_WORKTREE", "SNAPSHOT_WORKTREE", "GIT_DIR"]);
6637
6663
  const profile = {};
6638
6664
  try {
6639
- for (const rawLine of readFileSync7(path, "utf8").split(/\r?\n/)) {
6665
+ for (const rawLine of readFileSync8(path, "utf8").split(/\r?\n/)) {
6640
6666
  const line = rawLine.trim();
6641
6667
  if (line.length === 0 || line.startsWith("#")) continue;
6642
6668
  const eq = line.indexOf("=");
package/dist/cli.js CHANGED
@@ -50,7 +50,7 @@ import {
50
50
  snapshotterHealthChecks,
51
51
  upsertIndexEntry,
52
52
  vectorIndexStatus
53
- } from "./chunk-MKZKMSYM.js";
53
+ } from "./chunk-3IBRZTLF.js";
54
54
  import {
55
55
  normalizeDistTag,
56
56
  readCache,
@@ -145,7 +145,7 @@ import {
145
145
  supersedeStaleReviewRequiredJournals,
146
146
  taxonomyCommentForPage,
147
147
  writeDotenv
148
- } from "./chunk-EUTNN4RN.js";
148
+ } from "./chunk-UPQ6XJSV.js";
149
149
  import {
150
150
  assertTargetInsideVault,
151
151
  atomicWriteText,
@@ -10076,7 +10076,7 @@ async function emitManagedVaultWrite(vault, command, mutate, opts) {
10076
10076
  if (dirty) {
10077
10077
  return emit(dirty, void 0, { postCommit: false });
10078
10078
  }
10079
- const { runManagedWriteTransaction: runManagedWriteTransaction2 } = await import("./managed-write-preflight-SJDRNJSU.js");
10079
+ const { runManagedWriteTransaction: runManagedWriteTransaction2 } = await import("./managed-write-preflight-7GDFRPUT.js");
10080
10080
  const run = await runManagedWriteTransaction2({
10081
10081
  vault,
10082
10082
  command,
@@ -2,7 +2,7 @@
2
2
  import {
3
3
  runManagedWritePreflight,
4
4
  runManagedWriteTransaction
5
- } from "./chunk-EUTNN4RN.js";
5
+ } from "./chunk-UPQ6XJSV.js";
6
6
  import "./chunk-74OSLCXE.js";
7
7
  import "./chunk-GAHMWLWU.js";
8
8
  import "./chunk-IJ7DD7QZ.js";
@@ -1,10 +1,10 @@
1
1
  #!/usr/bin/env node
2
2
  import {
3
3
  runSkillwikiMcpStdio
4
- } from "./chunk-MKZKMSYM.js";
4
+ } from "./chunk-3IBRZTLF.js";
5
5
  import "./chunk-7I2TPIV5.js";
6
6
  import "./chunk-O3HCB7R2.js";
7
- import "./chunk-EUTNN4RN.js";
7
+ import "./chunk-UPQ6XJSV.js";
8
8
  import "./chunk-74OSLCXE.js";
9
9
  import "./chunk-HBQTTYXZ.js";
10
10
  import "./chunk-GAHMWLWU.js";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "skillwiki",
3
- "version": "0.10.50",
3
+ "version": "0.10.51",
4
4
  "type": "module",
5
5
  "bin": {
6
6
  "skillwiki": "dist/cli.js",
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "skillwiki",
3
- "version": "0.10.50",
3
+ "version": "0.10.51",
4
4
  "skills": "./",
5
5
  "description": "Project-aware Karpathy-style knowledge base for Claude Code: 20 prompt-only skills (wiki-*, proj-*, using-skillwiki) backed by the deterministic `skillwiki` CLI.",
6
6
  "author": {
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "skillwiki",
3
- "version": "0.10.50",
3
+ "version": "0.10.51",
4
4
  "description": "Project-aware Karpathy-style knowledge base for Codex with 20 prompt-only skills backed by the deterministic skillwiki CLI.",
5
5
  "author": {
6
6
  "name": "karlorz",
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@skillwiki/skills",
3
- "version": "0.10.50",
3
+ "version": "0.10.51",
4
4
  "private": true,
5
5
  "files": [
6
6
  "wiki-*",