skillwiki 0.10.102 → 0.10.104

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.
@@ -40,7 +40,7 @@ import {
40
40
  snapshotterAliasForLocalHost,
41
41
  toUndirectedWeighted,
42
42
  writeDotenv
43
- } from "./chunk-7UK67FAZ.js";
43
+ } from "./chunk-PVIOU7BN.js";
44
44
  import {
45
45
  atomicWriteText,
46
46
  prepareTypedPage
@@ -3794,7 +3794,9 @@ function parseLatestRunFile(text) {
3794
3794
  if (!status) return null;
3795
3795
  const finishedAt = typeof parsed.finished_at === "string" && parsed.finished_at.length > 0 ? parsed.finished_at : void 0;
3796
3796
  const failureClass = parsed.failure_class != null && String(parsed.failure_class).length > 0 ? String(parsed.failure_class) : void 0;
3797
- return { status, finishedAt, failureClass };
3797
+ const runDate = typeof parsed.run_date === "string" && parsed.run_date.length > 0 ? parsed.run_date : void 0;
3798
+ const selectedCandidateCount = typeof parsed.selected_candidate_count === "number" && Number.isInteger(parsed.selected_candidate_count) && parsed.selected_candidate_count >= 0 ? parsed.selected_candidate_count : void 0;
3799
+ return { status, runDate, selectedCandidateCount, finishedAt, failureClass };
3798
3800
  } catch {
3799
3801
  return null;
3800
3802
  }
@@ -3802,17 +3804,21 @@ function parseLatestRunFile(text) {
3802
3804
  function readSatelliteLatestRunFromText(text) {
3803
3805
  return parseLatestRunFile(text);
3804
3806
  }
3805
- function readSatelliteLatestRun(vault) {
3806
- const latestPath = satelliteLatestRunPath(vault);
3807
- if (!existsSync13(latestPath)) return null;
3807
+ function readSatelliteLatestRunAt(path) {
3808
+ if (!existsSync13(path)) return null;
3808
3809
  try {
3809
- return parseLatestRunFile(readFileSync9(latestPath, "utf8"));
3810
+ return parseLatestRunFile(readFileSync9(path, "utf8"));
3810
3811
  } catch {
3811
3812
  return null;
3812
3813
  }
3813
3814
  }
3814
3815
  function evaluateSatelliteRunHealth(vault, now) {
3815
- const run = readSatelliteLatestRun(vault);
3816
+ return evaluateSatelliteRunHealthAt(satelliteLatestRunPath(vault), now);
3817
+ }
3818
+ function evaluateSatelliteRunHealthAt(path, now) {
3819
+ return evaluateSatelliteRunHealthState(readSatelliteLatestRunAt(path), now);
3820
+ }
3821
+ function evaluateSatelliteRunHealthState(run, now) {
3816
3822
  if (!run) {
3817
3823
  return { failed: false, stale: false };
3818
3824
  }
@@ -7964,7 +7970,8 @@ export {
7964
7970
  satelliteLatestRunPath,
7965
7971
  isFailedRunStatus,
7966
7972
  readSatelliteLatestRunFromText,
7967
- evaluateSatelliteRunHealth,
7973
+ readSatelliteLatestRunAt,
7974
+ evaluateSatelliteRunHealthState,
7968
7975
  DEFAULT_MCP_URL,
7969
7976
  runDoctor,
7970
7977
  readCliPackageJson,
@@ -2949,6 +2949,9 @@ async function runAudit(input) {
2949
2949
  }));
2950
2950
  const sources = (fm.data.sources ?? []).map((s) => s.replace(/^\^\[/, "").replace(/\]$/, ""));
2951
2951
  const referenced = new Set(resolved.map((m) => m.target));
2952
+ for (const source of sources) {
2953
+ if (/^https?:\/\//i.test(source) && body.includes(source)) referenced.add(source);
2954
+ }
2952
2955
  const unused_sources = sources.filter((s) => !referenced.has(s));
2953
2956
  const missing_from_sources = [...referenced].filter((t) => !sources.includes(t));
2954
2957
  const broken = resolved.filter((m) => !m.resolved);
@@ -3355,7 +3358,7 @@ function buildCliSurface() {
3355
3358
  program.command("backup");
3356
3359
  program.command("seed").option("--wiki <name>");
3357
3360
  program.command("observe").requiredOption("--text <text>").option("--kind <kind>").option("--project <slug>").option("--severity <level>").option("--capture-budget <n>").option("--wiki <name>");
3358
- program.command("session-brief").option("--project <slug>").option("--write").option("--wiki <name>");
3361
+ program.command("session-brief").option("--project <slug>").option("--write").option("--agent-memory-run-state <path>").option("--wiki <name>");
3359
3362
  program.command("memory");
3360
3363
  program.command("ingest").requiredOption("--vault <path>").requiredOption("--type <type>").requiredOption("--title <title>").option("--tags <csv>").option("--provenance <provenance>").option("--dry-run");
3361
3364
  program.command("fleet");
package/dist/cli.js CHANGED
@@ -16,7 +16,7 @@ import {
16
16
  countEventLedgerFiles,
17
17
  detectFuseMount,
18
18
  evaluateDirtyVolumeGate,
19
- evaluateSatelliteRunHealth,
19
+ evaluateSatelliteRunHealthState,
20
20
  findPlugin,
21
21
  guardProtectedVaultWrite,
22
22
  isEventLedgerPath,
@@ -27,6 +27,7 @@ import {
27
27
  nonEmptyEnvValue,
28
28
  pruneVectorIndex,
29
29
  readCliPackageJson,
30
+ readSatelliteLatestRunAt,
30
31
  readSatelliteLatestRunFromText,
31
32
  readVaultSyncConfig,
32
33
  redactMcpSecret,
@@ -62,7 +63,7 @@ import {
62
63
  snapshotterHealthChecks,
63
64
  upsertIndexEntry,
64
65
  vectorIndexStatus
65
- } from "./chunk-PIXBNB74.js";
66
+ } from "./chunk-2BPOEEMW.js";
66
67
  import {
67
68
  normalizeDistTag,
68
69
  readCache,
@@ -167,7 +168,7 @@ import {
167
168
  supersedeStaleReviewRequiredJournals,
168
169
  taxonomyCommentForPage,
169
170
  writeDotenv
170
- } from "./chunk-7UK67FAZ.js";
171
+ } from "./chunk-PVIOU7BN.js";
171
172
  import {
172
173
  assertTargetInsideVault,
173
174
  atomicWriteText,
@@ -5354,29 +5355,33 @@ async function runSessionBrief(input) {
5354
5355
  const generatedAt = now.toISOString().replace(/\.\d{3}Z$/, "Z");
5355
5356
  const today = generatedAt.slice(0, 10);
5356
5357
  const project = await resolveProject(input);
5358
+ const collectorRunPath = input.agentMemoryRunState ?? satelliteLatestRunPath(input.vault);
5359
+ const collectorRun = readSatelliteLatestRunAt(collectorRunPath);
5360
+ const collectorHealth = evaluateSatelliteRunHealthState(collectorRun, now);
5357
5361
  try {
5362
+ const expectedPacketPath = collectorRun?.runDate != null ? `queries/${collectorRun.runDate}-agent-memory-trends-packet.md` : void 0;
5363
+ const packetExists = expectedPacketPath != null && scan.data.typedKnowledge.some((page) => page.relPath === expectedPacketPath);
5358
5364
  const [
5359
5365
  transcripts,
5360
5366
  workItems,
5361
5367
  digests,
5362
5368
  baseHealthWarnings,
5363
- satelliteHealth,
5364
5369
  sessionPins,
5365
5370
  memoryTopics,
5366
5371
  pendingSources
5367
5372
  ] = await Promise.all([
5368
5373
  loadTranscriptInfo(scan.data.raw),
5369
5374
  loadWorkItems(scan.data.workItems),
5370
- loadTrendDigests(scan.data.typedKnowledge),
5375
+ loadTrendPages(scan.data.typedKnowledge, /^queries\/\d{4}-\d{2}-\d{2}-agent-memory-trends-digest\.md$/),
5371
5376
  loadHealthWarnings(input.vault),
5372
- loadSatelliteHealth(input.vault),
5373
5377
  loadSessionPins(input.vault, project),
5374
5378
  project ? loadMemoryTopics(input.vault, project) : Promise.resolve([]),
5375
5379
  loadPendingSources(scanRoot, today)
5376
5380
  ]);
5381
+ const collectorReceipt = buildCollectorReceipt(collectorRun, collectorHealth, packetExists);
5377
5382
  const healthWarnings = [
5378
5383
  ...baseHealthWarnings,
5379
- ...satelliteHealthWarnings(satelliteHealth)
5384
+ ...collectorReceipt.healthWarnings
5380
5385
  ];
5381
5386
  const claimed = collectClaimedTranscripts(
5382
5387
  workItems.map((w) => ({ relDir: w.path, source: w.source, sources: w.sources, closes: w.closes }))
@@ -5401,6 +5406,7 @@ async function runSessionBrief(input) {
5401
5406
  unclaimedCaptures,
5402
5407
  pendingSources,
5403
5408
  activeWork,
5409
+ collectorReceipt: collectorReceipt.lines,
5404
5410
  latestDigest,
5405
5411
  projectLogs,
5406
5412
  memoryTopics,
@@ -5533,9 +5539,9 @@ async function loadWorkItems(workItemPages) {
5533
5539
  }
5534
5540
  return out;
5535
5541
  }
5536
- async function loadTrendDigests(typedPages) {
5542
+ async function loadTrendPages(typedPages, pathPattern) {
5537
5543
  const out = [];
5538
- for (const page of typedPages.filter((p) => p.relPath.startsWith("queries/") && p.relPath.includes("agent-memory-trends"))) {
5544
+ for (const page of typedPages.filter((p) => pathPattern.test(p.relPath))) {
5539
5545
  const text = await readPage(page);
5540
5546
  const fm = extractFrontmatter(text);
5541
5547
  if (!fm.ok) continue;
@@ -5586,7 +5592,8 @@ function renderBrief(input) {
5586
5592
  appendSection(lines, "Unclaimed Captures", input.unclaimedCaptures, "No unclaimed task or bug captures found.");
5587
5593
  appendSection(lines, "Recent Pending Sources", input.pendingSources, "No pending articles or papers found.");
5588
5594
  appendSection(lines, "Recent Session Logs", input.project ? input.projectLogs : input.latestLogs, "No recent session logs found.");
5589
- appendSection(lines, "Latest Agent Memory Trends", input.latestDigest, "No agent memory trends digest found.");
5595
+ appendTextSection(lines, "Latest Collector Run", input.collectorReceipt, "No collector receipt is available.");
5596
+ appendSection(lines, "Latest Judged Agent Memory Trends", input.latestDigest, "No judged agent memory trends digest found.");
5590
5597
  appendMemoryTopicsSection(lines, input.project, input.memoryTopics);
5591
5598
  appendTextSection(lines, "Health Warnings", input.healthWarnings, "No high-level health warnings found.");
5592
5599
  lines.push(
@@ -5644,13 +5651,42 @@ function appendTextSection(lines, title, items, empty) {
5644
5651
  }
5645
5652
  lines.push("");
5646
5653
  }
5647
- async function loadSatelliteHealth(vaultPath) {
5648
- const health = evaluateSatelliteRunHealth(vaultPath, /* @__PURE__ */ new Date());
5649
- if (!health.failed && !health.stale) {
5650
- const runPath2 = satelliteLatestRunPath(vaultPath);
5651
- const hasRun = await readIfExists(runPath2);
5652
- if (!hasRun) return null;
5654
+ function buildCollectorReceipt(run, health, packetExists) {
5655
+ const healthWarning = satelliteHealthWarning(health);
5656
+ const healthWarnings = healthWarning ? [healthWarning] : [];
5657
+ if (!run) return { lines: [], healthWarnings };
5658
+ const finished = run.finishedAt ? ` at ${run.finishedAt}` : "";
5659
+ if (health.failed) {
5660
+ return { lines: [`Collector run failed${finished}.`], healthWarnings };
5661
+ }
5662
+ if (health.stale) {
5663
+ return { lines: [`Collector receipt is stale${finished}.`], healthWarnings };
5664
+ }
5665
+ if (run.status !== "success" || run.selectedCandidateCount === void 0 || !run.runDate) {
5666
+ return { lines: [], healthWarnings };
5667
+ }
5668
+ if (run.selectedCandidateCount === 0) {
5669
+ return {
5670
+ lines: [`${run.runDate} Quiet night \u2014 collector succeeded, 0 selected; no packet published${finished}.`],
5671
+ healthWarnings
5672
+ };
5673
+ }
5674
+ const packetPath = `queries/${run.runDate}-agent-memory-trends-packet.md`;
5675
+ if (packetExists) {
5676
+ return {
5677
+ lines: [`${run.runDate} Collector succeeded; ${run.selectedCandidateCount} selected; packet: [[${packetPath.replace(/\.md$/, "")}]]${finished}.`],
5678
+ healthWarnings
5679
+ };
5653
5680
  }
5681
+ return {
5682
+ lines: [`${run.runDate} Collector succeeded with ${run.selectedCandidateCount} selected, but the packet is missing${finished}.`],
5683
+ healthWarnings: [
5684
+ ...healthWarnings,
5685
+ `agent-memory-trends: collector selected ${run.selectedCandidateCount} candidate(s) but ${packetPath} is missing`
5686
+ ]
5687
+ };
5688
+ }
5689
+ function satelliteHealthWarning(health) {
5654
5690
  if (health.failed) {
5655
5691
  const fc = health.failureClass && health.failureClass.length > 0 ? health.failureClass : "unknown";
5656
5692
  return `agent-memory-trends: last run failed (${fc})`;
@@ -5666,9 +5702,6 @@ async function loadSatelliteHealth(vaultPath) {
5666
5702
  }
5667
5703
  return null;
5668
5704
  }
5669
- function satelliteHealthWarnings(warning) {
5670
- return warning ? [warning] : [];
5671
- }
5672
5705
  async function loadHealthWarnings(vault) {
5673
5706
  const text = await readIfExists(join27(vault, ".skillwiki", "health.json"));
5674
5707
  if (!text) return [];
@@ -11174,7 +11207,7 @@ async function emitManagedVaultWrite(vault, command, mutate, opts) {
11174
11207
  if (dirty) {
11175
11208
  return emit(dirty, void 0, { postCommit: false });
11176
11209
  }
11177
- const { runManagedWriteTransaction: runManagedWriteTransaction2 } = await import("./managed-write-preflight-NS7OQ2Y7.js");
11210
+ const { runManagedWriteTransaction: runManagedWriteTransaction2 } = await import("./managed-write-preflight-ATDFVLJV.js");
11178
11211
  const run = await runManagedWriteTransaction2({
11179
11212
  vault,
11180
11213
  command,
@@ -12216,7 +12249,7 @@ program.command("observe [vault]").description("create a raw transcript observat
12216
12249
  })
12217
12250
  );
12218
12251
  });
12219
- program.command("session-brief [vault]").description("render or refresh the bounded startup session brief").option("--project <slug>", "project slug, or auto for deterministic detection", "auto").option("--write", "write meta/latest-session-brief.md and local cache files", false).option("--wiki <name>", "wiki profile name").action(async (vault, opts) => {
12252
+ program.command("session-brief [vault]").description("render or refresh the bounded startup session brief").option("--project <slug>", "project slug, or auto for deterministic detection", "auto").option("--write", "write meta/latest-session-brief.md and local cache files", false).option("--agent-memory-run-state <path>", "explicit agent-memory latest-run JSON path").option("--wiki <name>", "wiki profile name").action(async (vault, opts) => {
12220
12253
  const v = await resolveVaultArg(vault, opts.wiki);
12221
12254
  if (!v.ok) emit({ exitCode: v.exitCode, result: v.payload });
12222
12255
  else if (opts.write) return emitManagedVaultWrite(
@@ -12226,6 +12259,7 @@ program.command("session-brief [vault]").description("render or refresh the boun
12226
12259
  vault: v.vault,
12227
12260
  project: opts.project,
12228
12261
  write: true,
12262
+ agentMemoryRunState: opts.agentMemoryRunState,
12229
12263
  cwd: process.cwd(),
12230
12264
  env: { SKILLWIKI_PROJECT: process.env.SKILLWIKI_PROJECT }
12231
12265
  }),
@@ -12235,6 +12269,7 @@ program.command("session-brief [vault]").description("render or refresh the boun
12235
12269
  vault: v.vault,
12236
12270
  project: opts.project,
12237
12271
  write: false,
12272
+ agentMemoryRunState: opts.agentMemoryRunState,
12238
12273
  cwd: process.cwd(),
12239
12274
  env: { SKILLWIKI_PROJECT: process.env.SKILLWIKI_PROJECT }
12240
12275
  }), v.vault, { postCommit: false });
@@ -6,7 +6,7 @@ import {
6
6
  runManagedWritePeerGate,
7
7
  runManagedWritePreflight,
8
8
  runManagedWriteTransaction
9
- } from "./chunk-7UK67FAZ.js";
9
+ } from "./chunk-PVIOU7BN.js";
10
10
  import "./chunk-KDH352MC.js";
11
11
  import "./chunk-F5GFUYPF.js";
12
12
  import "./chunk-QM64LUEY.js";
@@ -1,10 +1,10 @@
1
1
  #!/usr/bin/env node
2
2
  import {
3
3
  runSkillwikiMcpStdio
4
- } from "./chunk-PIXBNB74.js";
4
+ } from "./chunk-2BPOEEMW.js";
5
5
  import "./chunk-7I2TPIV5.js";
6
6
  import "./chunk-XYXTV2YD.js";
7
- import "./chunk-7UK67FAZ.js";
7
+ import "./chunk-PVIOU7BN.js";
8
8
  import "./chunk-KDH352MC.js";
9
9
  import "./chunk-H42EY6E7.js";
10
10
  import "./chunk-F5GFUYPF.js";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "skillwiki",
3
- "version": "0.10.102",
3
+ "version": "0.10.104",
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.102",
3
+ "version": "0.10.104",
4
4
  "skills": "./",
5
5
  "description": "Project-aware Karpathy-style knowledge base for Claude Code: 22 prompt-only skills (wiki-*, proj-*, using-skillwiki, skillwiki-mcp, skillwiki-connect) backed by the deterministic `skillwiki` CLI.",
6
6
  "author": {
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "skillwiki",
3
- "version": "0.10.102",
3
+ "version": "0.10.104",
4
4
  "description": "Project-aware Karpathy-style knowledge base for Codex with 22 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",
3
- "version": "0.10.102",
3
+ "version": "0.10.104",
4
4
  "description": "Project-aware Karpathy-style knowledge base: 22 prompt-only skills (wiki-*, proj-*, using-skillwiki, skillwiki-mcp, skillwiki-connect) backed by HTTP MCP wiki_capture.",
5
5
  "author": {
6
6
  "name": "karlorz"
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@skillwiki/skills",
3
- "version": "0.10.102",
3
+ "version": "0.10.104",
4
4
  "private": true,
5
5
  "files": [
6
6
  "wiki-*",