skillwiki 0.8.3-beta.1 → 0.8.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/cli.js CHANGED
@@ -4667,6 +4667,120 @@ function checkSyncLastPush(resolvedPath) {
4667
4667
  }
4668
4668
  return check("pass", "sync_last_push", "Vault sync recency", `Last push: ${dateStr} (${daysSince2} day(s) ago)`);
4669
4669
  }
4670
+ function hasOriginMain(resolvedPath) {
4671
+ try {
4672
+ execSync2("git rev-parse --verify --quiet origin/main", {
4673
+ cwd: resolvedPath,
4674
+ encoding: "utf8",
4675
+ stdio: ["pipe", "pipe", "pipe"]
4676
+ });
4677
+ return true;
4678
+ } catch {
4679
+ return false;
4680
+ }
4681
+ }
4682
+ function checkVaultGitDirty(resolvedPath) {
4683
+ if (resolvedPath === void 0) {
4684
+ return check("pass", "vault_git_dirty", "Vault git dirty state", "No vault path \u2014 check skipped");
4685
+ }
4686
+ if (!existsSync9(join27(resolvedPath, ".git"))) {
4687
+ return check("pass", "vault_git_dirty", "Vault git dirty state", "No git repo \u2014 check skipped");
4688
+ }
4689
+ try {
4690
+ const lines = execSync2("git status --porcelain", {
4691
+ cwd: resolvedPath,
4692
+ encoding: "utf8",
4693
+ stdio: ["pipe", "pipe", "pipe"]
4694
+ }).trim().split("\n").filter(Boolean);
4695
+ if (lines.length > 0) {
4696
+ return check("warn", "vault_git_dirty", "Vault git dirty state", `${lines.length} dirty file(s) in vault worktree`);
4697
+ }
4698
+ return check("pass", "vault_git_dirty", "Vault git dirty state", "Clean worktree");
4699
+ } catch {
4700
+ return check("warn", "vault_git_dirty", "Vault git dirty state", "Could not read git status");
4701
+ }
4702
+ }
4703
+ function checkVaultGitAhead(resolvedPath) {
4704
+ return checkVaultGitComparison(
4705
+ resolvedPath,
4706
+ "vault_git_ahead",
4707
+ "Vault commits ahead",
4708
+ "origin/main..HEAD",
4709
+ "ahead of origin/main",
4710
+ "0 commits ahead of origin/main"
4711
+ );
4712
+ }
4713
+ function checkVaultGitBehind(resolvedPath) {
4714
+ return checkVaultGitComparison(
4715
+ resolvedPath,
4716
+ "vault_git_behind",
4717
+ "Vault commits behind",
4718
+ "HEAD..origin/main",
4719
+ "behind origin/main",
4720
+ "0 commits behind origin/main"
4721
+ );
4722
+ }
4723
+ function checkVaultGitComparison(resolvedPath, id, label, range, nonZeroSuffix, zeroDetail) {
4724
+ if (resolvedPath === void 0) {
4725
+ return check("pass", id, label, "No vault path \u2014 check skipped");
4726
+ }
4727
+ if (!existsSync9(join27(resolvedPath, ".git"))) {
4728
+ return check("pass", id, label, "No git repo \u2014 check skipped");
4729
+ }
4730
+ if (!hasOriginMain(resolvedPath)) {
4731
+ return check("pass", id, label, "origin/main unavailable \u2014 check skipped");
4732
+ }
4733
+ try {
4734
+ const count = parseInt(execSync2(`git rev-list --count ${range}`, {
4735
+ cwd: resolvedPath,
4736
+ encoding: "utf8",
4737
+ stdio: ["pipe", "pipe", "pipe"]
4738
+ }).trim(), 10);
4739
+ if (count > 0) {
4740
+ return check("warn", id, label, `${count} commit(s) ${nonZeroSuffix}`);
4741
+ }
4742
+ return check("pass", id, label, zeroDetail);
4743
+ } catch {
4744
+ return check("warn", id, label, "Could not compare HEAD with origin/main");
4745
+ }
4746
+ }
4747
+ function pullLogPaths(home) {
4748
+ const paths = platform2() === "darwin" ? [
4749
+ join27(home, "Library", "Logs", "wiki-pull.log"),
4750
+ join27(home, ".local", "state", "vault-sync", "log", "wiki-pull.log")
4751
+ ] : [
4752
+ join27(home, ".local", "state", "vault-sync", "log", "wiki-pull.log"),
4753
+ join27(home, "Library", "Logs", "wiki-pull.log")
4754
+ ];
4755
+ return [...new Set(paths)];
4756
+ }
4757
+ function isRecentLogLine(line, nowMs) {
4758
+ const match = line.match(/^(\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}Z)/);
4759
+ if (!match) return true;
4760
+ const ts = Date.parse(match[1]);
4761
+ if (!Number.isFinite(ts)) return true;
4762
+ return nowMs - ts <= 24 * 60 * 60 * 1e3;
4763
+ }
4764
+ function checkVaultGitPullFailures(home) {
4765
+ const path = pullLogPaths(home).find((p) => existsSync9(p));
4766
+ if (!path) {
4767
+ return check("pass", "vault_git_pull_failures", "Vault pull failures", "No wiki-pull.log found \u2014 check skipped");
4768
+ }
4769
+ try {
4770
+ const lines = readFileSync7(path, "utf8").split(/\r?\n/).filter(Boolean);
4771
+ const now = Date.now();
4772
+ const failures = lines.filter(
4773
+ (line) => isRecentLogLine(line, now) && /(pre-push pull failed|FAIL .*pull|FAIL .*rebase|cannot pull with rebase|unstaged changes)/i.test(line)
4774
+ );
4775
+ if (failures.length > 0) {
4776
+ const sample = failures.slice(-2).map((line) => line.slice(0, 100)).join(" | ");
4777
+ return check("warn", "vault_git_pull_failures", "Vault pull failures", `${failures.length} recent pull failure(s): ${sample}`);
4778
+ }
4779
+ return check("pass", "vault_git_pull_failures", "Vault pull failures", "No recent pull failures logged");
4780
+ } catch {
4781
+ return check("warn", "vault_git_pull_failures", "Vault pull failures", `Could not read ${path}`);
4782
+ }
4783
+ }
4670
4784
  function checkS3MountPerf(resolvedPath) {
4671
4785
  if (resolvedPath === void 0) {
4672
4786
  return check("pass", "s3_mount_perf", "S3 mount performance", "No vault path \u2014 check skipped");
@@ -5344,6 +5458,10 @@ async function runDoctor(input) {
5344
5458
  checks.push(checkObsidianTemplates(resolvedPath));
5345
5459
  checks.push(checkVaultGitRemote(resolvedPath));
5346
5460
  checks.push(checkSyncLastPush(resolvedPath));
5461
+ checks.push(checkVaultGitDirty(resolvedPath));
5462
+ checks.push(checkVaultGitAhead(resolvedPath));
5463
+ checks.push(checkVaultGitBehind(resolvedPath));
5464
+ checks.push(checkVaultGitPullFailures(input.home));
5347
5465
  checks.push(checkDotStoreClean(resolvedPath));
5348
5466
  checks.push(checkS3MountPerf(resolvedPath));
5349
5467
  checks.push(checkS3MountFreshness(resolvedPath));
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "skillwiki",
3
- "version": "0.8.3-beta.1",
3
+ "version": "0.8.3",
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.8.3-beta.1",
3
+ "version": "0.8.3",
4
4
  "skills": "./",
5
5
  "description": "Project-aware Karpathy-style knowledge base for Claude Code: 18 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.8.3-beta.1",
3
+ "version": "0.8.3",
4
4
  "description": "Project-aware Karpathy-style knowledge base for Codex with 18 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.8.3-beta.1",
3
+ "version": "0.8.3",
4
4
  "private": true,
5
5
  "files": [
6
6
  "wiki-*",