skillwiki 0.10.45 → 0.10.46

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.
@@ -2,7 +2,7 @@
2
2
  import {
3
3
  atomicWriteText,
4
4
  buildRootIndexUniverse
5
- } from "./chunk-CTN66CDX.js";
5
+ } from "./chunk-UHZBOOMK.js";
6
6
  import {
7
7
  authorizeRawOperation,
8
8
  buildSourceReferenceIndex,
@@ -22,7 +22,7 @@ import {
22
22
  resolveExistingRegularFileInsideVault,
23
23
  stripFencedBlocks,
24
24
  writeLogEvent
25
- } from "./chunk-RPZIGMMH.js";
25
+ } from "./chunk-PLUHIOCQ.js";
26
26
  import {
27
27
  ExitCode,
28
28
  FleetManifestSchema,
@@ -40,7 +40,7 @@ import {
40
40
  scanVault,
41
41
  splitFrontmatter,
42
42
  vaultIoConcurrency
43
- } from "./chunk-APDMYPM6.js";
43
+ } from "./chunk-EVQASYII.js";
44
44
 
45
45
  // src/utils/managed-write-preflight.ts
46
46
  import { existsSync as existsSync11 } from "fs";
@@ -2994,7 +2994,7 @@ function buildCliSurface() {
2994
2994
  program.command("update").option("--tag <tag>");
2995
2995
  program.command("self-update").option("--check");
2996
2996
  program.command("transcripts").option("--since <date>").option("--wiki <name>");
2997
- program.command("project-index").option("--apply").option("--wiki <name>");
2997
+ program.command("project-index").option("--apply").option("--check").option("--wiki <name>");
2998
2998
  program.command("compound");
2999
2999
  program.command("tag");
3000
3000
  program.command("tag-sync").option("--dry-run").option("--wiki <name>");
@@ -6,7 +6,7 @@ import {
6
6
  import {
7
7
  renderRootIndex,
8
8
  writeRootIndexProjection
9
- } from "./chunk-NL2MUWNF.js";
9
+ } from "./chunk-GAU4D25O.js";
10
10
  import {
11
11
  CONFIG_KEYS,
12
12
  acquireOwnedSyncLock,
@@ -35,15 +35,15 @@ import {
35
35
  snapshotterAliasForLocalHost,
36
36
  toUndirectedWeighted,
37
37
  writeDotenv
38
- } from "./chunk-5LTXERHO.js";
38
+ } from "./chunk-4SINVFR3.js";
39
39
  import {
40
40
  atomicWriteText,
41
41
  prepareTypedPage
42
- } from "./chunk-CTN66CDX.js";
42
+ } from "./chunk-UHZBOOMK.js";
43
43
  import {
44
44
  eventPathFor,
45
45
  writeLogEvent
46
- } from "./chunk-RPZIGMMH.js";
46
+ } from "./chunk-PLUHIOCQ.js";
47
47
  import {
48
48
  CompoundSchema,
49
49
  ExitCode,
@@ -64,7 +64,7 @@ import {
64
64
  scanVault,
65
65
  splitFrontmatter,
66
66
  systemdPropertyFor
67
- } from "./chunk-APDMYPM6.js";
67
+ } from "./chunk-EVQASYII.js";
68
68
 
69
69
  // src/commands/log-append.ts
70
70
  import { readFile, stat } from "fs/promises";
@@ -687,6 +687,7 @@ var DEFAULT_DEPS = {
687
687
  };
688
688
  var LAYER2_DIRS = ["entities", "concepts", "comparisons", "queries", "meta"];
689
689
  var PROJECT_LOCAL_DIRS = ["requirements", "work", "architecture", "history"];
690
+ var PROJECT_INDEX_STALE_EXIT_CODE = 3;
690
691
  async function scanMarkdownTree(rootAbs, rootRel) {
691
692
  const found = [];
692
693
  let entries;
@@ -862,6 +863,12 @@ Autogenerated by \`skillwiki project-index\` on ${today}.
862
863
  }
863
864
  async function runProjectIndex(input, deps = DEFAULT_DEPS) {
864
865
  const slug = input.slug;
866
+ if (input.check && input.apply) {
867
+ return {
868
+ exitCode: ExitCode.USAGE,
869
+ result: err("USAGE", { message: "--check and --apply are mutually exclusive" })
870
+ };
871
+ }
865
872
  const projectDir = join4(input.vault, "projects", slug);
866
873
  const rendered = await renderProjectIndex(input.vault, slug);
867
874
  if (!rendered.ok) {
@@ -890,7 +897,7 @@ async function runProjectIndex(input, deps = DEFAULT_DEPS) {
890
897
  const action = `${entries.length} entries found (use --apply to write)`;
891
898
  const staleHint = stale ? " (STALE \u2014 existing index outdated)" : existing ? " (up to date)" : "";
892
899
  return {
893
- exitCode: ExitCode.OK,
900
+ exitCode: input.check && stale ? PROJECT_INDEX_STALE_EXIT_CODE : ExitCode.OK,
894
901
  result: ok({
895
902
  slug,
896
903
  entries,
@@ -4986,7 +4993,7 @@ async function runQuery(input) {
4986
4993
  }).filter((r) => r.score > 0).sort((a, b) => b.score - a.score || a.path.localeCompare(b.path)).slice(0, limit);
4987
4994
  let pendingSources;
4988
4995
  if (input.includePending) {
4989
- const { runSourcesPending } = await import("./sources-Z4VMD2YO.js");
4996
+ const { runSourcesPending } = await import("./sources-CMV5DKS5.js");
4990
4997
  const pending = await runSourcesPending({
4991
4998
  vault: input.vault,
4992
4999
  match: input.text,
@@ -74,6 +74,7 @@ function err(error, detail) {
74
74
  }
75
75
 
76
76
  // ../shared/src/schemas.ts
77
+ import { isAbsolute } from "path";
77
78
  import { z } from "zod";
78
79
  var isoDate = z.string().refine((s) => {
79
80
  if (!/^\d{4}-\d{2}-\d{2}$/.test(s)) return false;
@@ -205,7 +206,7 @@ var endpointName = z.string().min(1).regex(/^[A-Za-z0-9_.-]+$/, "must be a hostn
205
206
  var ipAddress = z.string().min(1).regex(/^[0-9a-fA-F:.]+$/, "must be an IP address token");
206
207
  var sshAlias = z.string().min(1).regex(/^[A-Za-z0-9_.@-]+$/, "must be an SSH alias token");
207
208
  var sshUser = z.string().min(1).regex(/^[A-Za-z0-9_.-]+$/, "must be an SSH user token");
208
- var absolutePath = z.string().min(1).regex(/^\//, "must be an absolute path");
209
+ var absolutePath = z.string().min(1).refine((value) => isAbsolute(value), "must be an absolute path");
209
210
  var FleetAccessProfileSchema = z.object({
210
211
  status: z.enum(["local", "configured", "planned", "absent", "unknown"]),
211
212
  ssh_aliases: z.array(sshAlias).optional(),
@@ -3,11 +3,11 @@ import {
3
3
  ROOT_INDEX_SECTION_ORDER,
4
4
  atomicWriteText,
5
5
  buildRootIndexUniverse
6
- } from "./chunk-CTN66CDX.js";
6
+ } from "./chunk-UHZBOOMK.js";
7
7
  import {
8
8
  err,
9
9
  ok
10
- } from "./chunk-APDMYPM6.js";
10
+ } from "./chunk-EVQASYII.js";
11
11
 
12
12
  // src/utils/index-projection.ts
13
13
  import { readFile } from "fs/promises";
@@ -6,7 +6,7 @@ import {
6
6
  readPage,
7
7
  scanSensitiveContent,
8
8
  splitFrontmatter
9
- } from "./chunk-APDMYPM6.js";
9
+ } from "./chunk-EVQASYII.js";
10
10
 
11
11
  // src/utils/log-events.ts
12
12
  import { mkdir, open, readFile, readdir } from "fs/promises";
@@ -8,7 +8,7 @@ import {
8
8
  readLogEvents,
9
9
  resolveExistingRegularFileInsideVault,
10
10
  writeLogEvent
11
- } from "./chunk-RPZIGMMH.js";
11
+ } from "./chunk-PLUHIOCQ.js";
12
12
  import {
13
13
  ExitCode,
14
14
  RawSourceSchema,
@@ -19,7 +19,7 @@ import {
19
19
  scanSensitiveContent,
20
20
  scanVault,
21
21
  splitFrontmatter
22
- } from "./chunk-APDMYPM6.js";
22
+ } from "./chunk-EVQASYII.js";
23
23
 
24
24
  // src/utils/source-lifecycle.ts
25
25
  import { basename } from "path";
@@ -8,7 +8,7 @@ import {
8
8
  ok,
9
9
  scanSensitiveContent,
10
10
  scanVault
11
- } from "./chunk-APDMYPM6.js";
11
+ } from "./chunk-EVQASYII.js";
12
12
 
13
13
  // src/utils/atomic-write.ts
14
14
  import { randomBytes } from "crypto";
package/dist/cli.js CHANGED
@@ -40,7 +40,7 @@ import {
40
40
  scanConflictMarkerBlocksInText,
41
41
  snapshotterHealthChecks,
42
42
  upsertIndexEntry
43
- } from "./chunk-OWKNUKCC.js";
43
+ } from "./chunk-5JYOYMST.js";
44
44
  import {
45
45
  normalizeDistTag,
46
46
  readCache,
@@ -53,7 +53,7 @@ import {
53
53
  UNMANAGED_START,
54
54
  renderRootIndex,
55
55
  writeRootIndexProjection
56
- } from "./chunk-NL2MUWNF.js";
56
+ } from "./chunk-GAU4D25O.js";
57
57
  import {
58
58
  FLEET_REL_PATH,
59
59
  VAULT_COMMIT_PATHSPEC,
@@ -127,12 +127,12 @@ import {
127
127
  supersedeStaleReviewRequiredJournals,
128
128
  taxonomyCommentForPage,
129
129
  writeDotenv
130
- } from "./chunk-5LTXERHO.js";
130
+ } from "./chunk-4SINVFR3.js";
131
131
  import {
132
132
  assertTargetInsideVault,
133
133
  atomicWriteText,
134
134
  prepareTypedPage
135
- } from "./chunk-CTN66CDX.js";
135
+ } from "./chunk-UHZBOOMK.js";
136
136
  import {
137
137
  applySourceDisposition,
138
138
  decodeSourceActionApproval,
@@ -140,7 +140,7 @@ import {
140
140
  inventorySources,
141
141
  planSourceDisposition,
142
142
  runSourcesPending
143
- } from "./chunk-DHGHISVY.js";
143
+ } from "./chunk-QNSD72FH.js";
144
144
  import {
145
145
  authorizeRawOperation,
146
146
  buildSourceReferenceIndex,
@@ -156,7 +156,7 @@ import {
156
156
  resolveExistingRegularFileInsideVault,
157
157
  validateLogEvent,
158
158
  writeLogEvent
159
- } from "./chunk-RPZIGMMH.js";
159
+ } from "./chunk-PLUHIOCQ.js";
160
160
  import {
161
161
  ExitCode,
162
162
  MetaSchema,
@@ -173,7 +173,7 @@ import {
173
173
  scanSensitiveContent,
174
174
  scanVault,
175
175
  splitFrontmatter
176
- } from "./chunk-APDMYPM6.js";
176
+ } from "./chunk-EVQASYII.js";
177
177
 
178
178
  // src/cli.ts
179
179
  import { join as join38 } from "path";
@@ -3407,7 +3407,7 @@ ${fmRewritten}
3407
3407
  }
3408
3408
  let indexUpdated = false;
3409
3409
  if (!isRaw) {
3410
- const { renderRootIndex: renderRootIndex2, writeRootIndexProjection: writeRootIndexProjection2 } = await import("./index-projection-RWF5M7U7.js");
3410
+ const { renderRootIndex: renderRootIndex2, writeRootIndexProjection: writeRootIndexProjection2 } = await import("./index-projection-BJNZUPH6.js");
3411
3411
  const before = await readFile7(join18(input.vault, "index.md"), "utf8").catch(() => "");
3412
3412
  const fullTarget = relPath.replace(/\.md$/, "");
3413
3413
  const bare = fullTarget.split("/").pop() ?? fullTarget;
@@ -3527,7 +3527,7 @@ async function runRemove(input) {
3527
3527
  if (relPath.endsWith(".md") && !relPath.startsWith("raw/")) {
3528
3528
  const { readFile: readFile20 } = await import("fs/promises");
3529
3529
  const { join: pathJoin } = await import("path");
3530
- const { renderRootIndex: renderRootIndex2, writeRootIndexProjection: writeRootIndexProjection2 } = await import("./index-projection-RWF5M7U7.js");
3530
+ const { renderRootIndex: renderRootIndex2, writeRootIndexProjection: writeRootIndexProjection2 } = await import("./index-projection-BJNZUPH6.js");
3531
3531
  const before = await readFile20(pathJoin(input.vault, "index.md"), "utf8").catch(() => "");
3532
3532
  const fullTarget = relPath.replace(/\.md$/, "");
3533
3533
  const bare = fullTarget.split("/").pop() ?? fullTarget;
@@ -9479,7 +9479,7 @@ async function emitManagedVaultWrite(vault, command, mutate, opts) {
9479
9479
  if (dirty) {
9480
9480
  return emit(dirty, void 0, { postCommit: false });
9481
9481
  }
9482
- const { runManagedWriteTransaction: runManagedWriteTransaction2 } = await import("./managed-write-preflight-BVDVX63J.js");
9482
+ const { runManagedWriteTransaction: runManagedWriteTransaction2 } = await import("./managed-write-preflight-DWK3PJCO.js");
9483
9483
  const run = await runManagedWriteTransaction2({
9484
9484
  vault,
9485
9485
  command,
@@ -10110,7 +10110,11 @@ program.command("transcripts [vault]").description("list transcript files in raw
10110
10110
  if (!v.ok) emit({ exitCode: v.exitCode, result: v.payload });
10111
10111
  else emit(await runTranscripts({ vault: v.vault, since: opts.since }), v.vault);
10112
10112
  });
10113
- program.command("project-index <slug> [vault]").description("generate a knowledge index for a project workspace").option("--apply", "write knowledge.md to the project directory", false).option("--wiki <name>", "wiki profile name").action(async (slug, vault, opts) => {
10113
+ program.command("project-index <slug> [vault]").description("generate a knowledge index for a project workspace").option("--apply", "write knowledge.md to the project directory", false).option("--check", "check-only: exit 0 when the existing index is fresh, 3 when stale (no writes; mutually exclusive with --apply)", false).option("--wiki <name>", "wiki profile name").action(async (slug, vault, opts) => {
10114
+ if (opts.check && opts.apply) {
10115
+ emit({ exitCode: ExitCode.USAGE, result: err("USAGE", "--check and --apply are mutually exclusive") });
10116
+ return;
10117
+ }
10114
10118
  const v = await resolveVaultArg(vault, opts.wiki);
10115
10119
  if (!v.ok) emit({ exitCode: v.exitCode, result: v.payload });
10116
10120
  else if (opts.apply) return emitGuardedVaultWrite(
@@ -10118,7 +10122,7 @@ program.command("project-index <slug> [vault]").description("generate a knowledg
10118
10122
  "project-index --apply",
10119
10123
  () => runProjectIndex({ vault: v.vault, slug, apply: true })
10120
10124
  );
10121
- else emit(await runProjectIndex({ vault: v.vault, slug, apply: false }), v.vault);
10125
+ else emit(await runProjectIndex({ vault: v.vault, slug, apply: false, check: opts.check }), v.vault);
10122
10126
  });
10123
10127
  var compoundCmd = program.command("compound").description("manage project compound entries");
10124
10128
  compoundCmd.command("promote [vault]").description("promote retros with Generalize?: yes to compound entries").requiredOption("--project <slug>", "project slug (e.g., llm-wiki)").option("--dry-run", "preview promotions without writing files", false).option("--wiki <name>", "wiki profile name").action(async (vault, opts) => {
@@ -4,9 +4,9 @@ import {
4
4
  UNMANAGED_START,
5
5
  renderRootIndex,
6
6
  writeRootIndexProjection
7
- } from "./chunk-NL2MUWNF.js";
8
- import "./chunk-CTN66CDX.js";
9
- import "./chunk-APDMYPM6.js";
7
+ } from "./chunk-GAU4D25O.js";
8
+ import "./chunk-UHZBOOMK.js";
9
+ import "./chunk-EVQASYII.js";
10
10
  export {
11
11
  UNMANAGED_END,
12
12
  UNMANAGED_START,
@@ -2,10 +2,10 @@
2
2
  import {
3
3
  runManagedWritePreflight,
4
4
  runManagedWriteTransaction
5
- } from "./chunk-5LTXERHO.js";
6
- import "./chunk-CTN66CDX.js";
7
- import "./chunk-RPZIGMMH.js";
8
- import "./chunk-APDMYPM6.js";
5
+ } from "./chunk-4SINVFR3.js";
6
+ import "./chunk-UHZBOOMK.js";
7
+ import "./chunk-PLUHIOCQ.js";
8
+ import "./chunk-EVQASYII.js";
9
9
  export {
10
10
  runManagedWritePreflight,
11
11
  runManagedWriteTransaction
@@ -1,13 +1,13 @@
1
1
  #!/usr/bin/env node
2
2
  import {
3
3
  runSkillwikiMcpStdio
4
- } from "./chunk-OWKNUKCC.js";
4
+ } from "./chunk-5JYOYMST.js";
5
5
  import "./chunk-7I2TPIV5.js";
6
- import "./chunk-NL2MUWNF.js";
7
- import "./chunk-5LTXERHO.js";
8
- import "./chunk-CTN66CDX.js";
9
- import "./chunk-RPZIGMMH.js";
10
- import "./chunk-APDMYPM6.js";
6
+ import "./chunk-GAU4D25O.js";
7
+ import "./chunk-4SINVFR3.js";
8
+ import "./chunk-UHZBOOMK.js";
9
+ import "./chunk-PLUHIOCQ.js";
10
+ import "./chunk-EVQASYII.js";
11
11
 
12
12
  // src/mcp-entry.ts
13
13
  runSkillwikiMcpStdio().catch((error) => {
@@ -0,0 +1,9 @@
1
+ #!/usr/bin/env node
2
+ import {
3
+ runSourcesPending
4
+ } from "./chunk-QNSD72FH.js";
5
+ import "./chunk-PLUHIOCQ.js";
6
+ import "./chunk-EVQASYII.js";
7
+ export {
8
+ runSourcesPending
9
+ };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "skillwiki",
3
- "version": "0.10.45",
3
+ "version": "0.10.46",
4
4
  "type": "module",
5
5
  "bin": {
6
6
  "skillwiki": "dist/cli.js",
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@skillwiki/skills",
3
- "version": "0.10.45",
3
+ "version": "0.10.46",
4
4
  "private": true,
5
5
  "files": [
6
6
  "wiki-*",
@@ -1,9 +0,0 @@
1
- #!/usr/bin/env node
2
- import {
3
- runSourcesPending
4
- } from "./chunk-DHGHISVY.js";
5
- import "./chunk-RPZIGMMH.js";
6
- import "./chunk-APDMYPM6.js";
7
- export {
8
- runSourcesPending
9
- };