cribsheet 0.24.0.dev3__py3-none-any.whl → 0.24.0.dev4__py3-none-any.whl

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.
crib/app.py CHANGED
@@ -2543,6 +2543,22 @@ class Crib:
2543
2543
  `budget_s` bounds the WORK: files not reached are deferred
2544
2544
  (`complete=False, remaining=N`) — re-invoke to continue (finished files
2545
2545
  re-skip via the content-hash gate)."""
2546
+ res = await self._project_index(project, cwd, budget_s, wait_s)
2547
+ # every answer, a running handle included, says what the repo's facet
2548
+ # mappings hold (the sweep below is code; mapped facets index apart)
2549
+ if "facets" not in res and res.get("project"):
2550
+ if fs := self._mapping_summary(res["project"]):
2551
+ res = {**res, "facets": fs}
2552
+ return res
2553
+
2554
+ async def _project_index(
2555
+ self,
2556
+ project: str | None = None,
2557
+ cwd: Path | None = None,
2558
+ budget_s: float | None = None,
2559
+ wait_s: float | None = None,
2560
+ ) -> dict[str, Any]:
2561
+ """The body of `project_index` (which adds the facet summary)."""
2546
2562
  link, created = self._ensure_crib(cwd, project, want_code=True, want_docs=False)
2547
2563
  proj = project or link.project
2548
2564
  await self._sync_mappings(proj, link)
crib/cli.py CHANGED
@@ -469,6 +469,17 @@ def _emit_projects(rows: Any, as_json: bool) -> None:
469
469
  print(line)
470
470
 
471
471
 
472
+ def _emit_facet_summary(d: Any) -> None:
473
+ """One line per facet mapping a setup/index answer reports (`facets`)."""
474
+ for noun, f in (d.get("facets") or {}).items():
475
+ how = ", ".join(w for w in ("read-only" if f.get("read_only") else "",
476
+ "ids derived" if f.get("ids") == "derived" else "") if w)
477
+ state = (f"{f['items']} item(s) indexed" if "items" in f
478
+ else f"waiting {f.get('waiting', '')}")
479
+ print(f" facet {noun}: {f.get('dir')} {f.get('glob')}"
480
+ f"{f' ({how})' if how else ''}: {state}")
481
+
482
+
472
483
  def _emit_project(d: Any, verb: str | None, as_json: bool) -> None:
473
484
  """Human summary for `crib project <verb>`."""
474
485
  if as_json:
@@ -586,6 +597,11 @@ def _emit_project(d: Any, verb: str | None, as_json: bool) -> None:
586
597
  print(f"{proj}: nothing running")
587
598
  return
588
599
  # setup / index
600
+ if d.get("running"): # a daemon-side sweep still going (joined or started)
601
+ print(f"{proj}: indexing in progress — {d.get('done')}/{d.get('total')} files "
602
+ f"(`crib project wait` to follow it, `crib project status` to look)")
603
+ _emit_facet_summary(d)
604
+ return
589
605
  made = " (created .crib)" if d.get("crib_created") else ""
590
606
  docs = f", {d['docs_imported']} docs imported" if d.get("docs_imported") else ""
591
607
  fails = (
@@ -596,13 +612,7 @@ def _emit_project(d: Any, verb: str | None, as_json: bool) -> None:
596
612
  f"{d.get('symbols', 0)} symbols, {d.get('described', 0)} described"
597
613
  f"{fails}{docs}{made}"
598
614
  )
599
- for noun, f in (d.get("facets") or {}).items():
600
- how = ", ".join(w for w in ("read-only" if f.get("read_only") else "",
601
- "ids derived" if f.get("ids") == "derived" else "") if w)
602
- state = (f"{f['items']} item(s) indexed" if "items" in f
603
- else f"waiting {f.get('waiting', '')}")
604
- print(f" facet {noun}: {f.get('dir')} {f.get('glob')}"
605
- f"{f' ({how})' if how else ''}: {state}")
615
+ _emit_facet_summary(d)
606
616
  errs = d.get("errors") or []
607
617
  if errs:
608
618
  print(f" {len(errs)} file(s) errored (first: {errs[0].get('file', '')})")
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.5
2
2
  Name: cribsheet
3
- Version: 0.24.0-dev3
3
+ Version: 0.24.0-dev4
4
4
  Summary: Local MCP server: markdown memory with a DuckDB embedding index
5
5
  Requires-Python: >=3.14
6
6
  Requires-Dist: duckdb<3,>=2.0
@@ -1,9 +1,9 @@
1
1
  crib/__init__.py,sha256=KzW14Xf3xyTCrmhsSbcFleJVCU6u6-WFidcrLB4YZSw,1001
2
2
  crib/__main__.py,sha256=umIc03A2oA7s2oiL80Ts_QnS-0zj9fjV3IQ103AmNXg,232
3
- crib/app.py,sha256=v6WH79kAizMJNpO1II1_MxAU36uAX06zxkMXbHNlNh4,320318
3
+ crib/app.py,sha256=zFgt1LxkqwaVMBUHP77dXgfeDEFzBvEF4jcfEjjlELk,321012
4
4
  crib/chunk.py,sha256=G5Ftt4zHQ0tx4__ecysFnW64otciPFcqpZ3Y-c_G6JE,15166
5
5
  crib/claudemem.py,sha256=Xf4mVgTFbXHdhhqteTIRz2zirc4irf0wim8AeMybudI,4804
6
- crib/cli.py,sha256=nWC-DFW7YX-dm7O3BKUFHyBcKmlDxEH2awDQD3aNruw,163743
6
+ crib/cli.py,sha256=iIp5S4cN9AFcsYH63NhnDRx6Ivdw6RQjwsexo90-VRM,164191
7
7
  crib/client.py,sha256=-PRVFFLjbI-D-libZ_wMdDFdcXkyHmc9AYikzxd9PmI,6605
8
8
  crib/codeindex.py,sha256=HYavhLOEieD62iNQasC__kAaMEN6ld1uP2oHmoJjyEI,89916
9
9
  crib/codeindexer.py,sha256=-eocU6ThZdNJar-cGaNJUgB5b6fd21QsjIRx56UFy-I,36737
@@ -56,7 +56,7 @@ crib/util.py,sha256=EmDszxT0SIjIkgcppD6pDJxbkp3eU-7blYRwri5b_m4,3282
56
56
  crib/verbs.py,sha256=wl0GruLY9EKnAzAOY_ecHuigkrKwiIvKcVO-tPo6AJc,53808
57
57
  crib/versions.py,sha256=P517DveKCh2jKb3o5IOxkzki8ddwmc-QeuiYMvsBb88,3646
58
58
  crib/watch.py,sha256=Uzy_BgvaTUCMzokTvgmX7vIEdGDh4Rb_M8MReYlAcCw,36361
59
- cribsheet-0.24.0.dev3.dist-info/METADATA,sha256=TYLl0S_S2YaEAouIvNpMcujr8x1aAb2emivutgbu-ec,21224
60
- cribsheet-0.24.0.dev3.dist-info/WHEEL,sha256=2iZrJkDIkeDh0k9SikKMqFuRP-ua6mb4Ir1AsER4BEw,87
61
- cribsheet-0.24.0.dev3.dist-info/entry_points.txt,sha256=CjLxgcZdPGI6U4VRZmrwQ2kL1gUkNykYNkLzT8EQkfQ,39
62
- cribsheet-0.24.0.dev3.dist-info/RECORD,,
59
+ cribsheet-0.24.0.dev4.dist-info/METADATA,sha256=jNLI1P3PsgslZ4oxQNdzzPods-THgl_a7Ux95ycN9Qk,21224
60
+ cribsheet-0.24.0.dev4.dist-info/WHEEL,sha256=2iZrJkDIkeDh0k9SikKMqFuRP-ua6mb4Ir1AsER4BEw,87
61
+ cribsheet-0.24.0.dev4.dist-info/entry_points.txt,sha256=CjLxgcZdPGI6U4VRZmrwQ2kL1gUkNykYNkLzT8EQkfQ,39
62
+ cribsheet-0.24.0.dev4.dist-info/RECORD,,