pi-weave 0.1.11 → 0.1.13

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.
Files changed (75) hide show
  1. package/README.md +148 -132
  2. package/package.json +1 -2
  3. package/src/core/cache/workspace.ts +26 -9
  4. package/src/core/concurrency.ts +3 -6
  5. package/src/core/frontmatter.ts +0 -53
  6. package/src/core/graph/build.ts +12 -8
  7. package/src/core/graph/current.ts +4 -6
  8. package/src/core/graph/model.ts +1 -1
  9. package/src/core/graph/wikilinks.ts +3 -3
  10. package/src/core/index.ts +26 -27
  11. package/src/core/paths.ts +0 -7
  12. package/src/core/slug.ts +13 -0
  13. package/src/core/types.ts +1 -0
  14. package/src/core/vault.ts +45 -467
  15. package/src/core/view/detail.ts +1 -1
  16. package/src/core/view/health.ts +1 -1
  17. package/src/core/view/tree.ts +15 -3
  18. package/src/pi/index.ts +6 -85
  19. package/src/pi/summarize.ts +2 -2
  20. package/src/pi/viewer/tui/bodyStore.ts +4 -7
  21. package/src/pi/viewer/tui/branding.ts +7 -148
  22. package/src/pi/viewer/tui/run.ts +3 -17
  23. package/src/pi/viewer/tui/surface/base.ts +24 -3
  24. package/src/pi/viewer/tui/surface/explore.ts +41 -6
  25. package/src/pi/viewer/tui/workspace.ts +23 -351
  26. package/src/pi/viewer/tui/workspaceRoot.ts +31 -172
  27. package/src/pi/viewer/web/run.ts +7 -117
  28. package/src/web/client/api.dom.ts +2 -2
  29. package/src/web/client/api.ts +14 -176
  30. package/src/web/client/bootstrap.ts +5 -14
  31. package/src/web/client/context/context.model.ts +9 -11
  32. package/src/web/client/dist/app.js +77 -167
  33. package/src/web/client/graph/dynamics.ts +5 -65
  34. package/src/web/client/graph/renderer.dom.ts +7 -8
  35. package/src/web/client/graph/renderer.ts +9 -35
  36. package/src/web/client/main.tsx +1 -1
  37. package/src/web/client/note/Note.tsx +37 -60
  38. package/src/web/client/note/note.model.ts +23 -0
  39. package/src/web/client/search/SearchPalette.tsx +45 -36
  40. package/src/web/client/search/search.model.ts +33 -454
  41. package/src/web/client/shell/Columns.tsx +13 -81
  42. package/src/web/client/shell/Header.tsx +2 -10
  43. package/src/web/client/shell/Shell.tsx +50 -123
  44. package/src/web/client/shell/StatusBar.tsx +1 -4
  45. package/src/web/client/shell/icons.model.ts +4 -7
  46. package/src/web/client/shell/keys.model.ts +5 -42
  47. package/src/web/client/shell/keys.ts +2 -2
  48. package/src/web/client/shell/shell.model.ts +10 -133
  49. package/src/web/client/shell/theme.model.ts +2 -2
  50. package/src/web/client/shell/theme.ts +33 -121
  51. package/src/web/client/state.ts +9 -89
  52. package/src/web/client/tree/Tree.tsx +24 -97
  53. package/src/web/client/tree/tree.model.ts +8 -56
  54. package/src/web/client/workspace.ts +72 -242
  55. package/src/web/server/page.ts +8 -10
  56. package/src/web/server/routes.ts +30 -415
  57. package/src/web/server/server.ts +6 -145
  58. package/src/web/shared/layout.ts +72 -624
  59. package/src/web/shared/wire.ts +10 -178
  60. package/src/core/sessions.ts +0 -929
  61. package/src/pi/sessionScan.ts +0 -104
  62. package/src/pi/viewer/tui/explorer.ts +0 -586
  63. package/src/web/client/live.model.ts +0 -275
  64. package/src/web/client/live.ts +0 -151
  65. package/src/web/client/note/Editor.tsx +0 -109
  66. package/src/web/client/note/editor.controller.ts +0 -151
  67. package/src/web/client/note/editor.model.ts +0 -686
  68. package/src/web/client/search/search.ts +0 -107
  69. package/src/web/client/shell/Divider.tsx +0 -44
  70. package/src/web/client/shell/cssvars.ts +0 -70
  71. package/src/web/client/shell/drag.model.ts +0 -170
  72. package/src/web/client/shell/layout.model.ts +0 -500
  73. package/src/web/client/shell/viewport.ts +0 -29
  74. package/src/web/server/sse.ts +0 -321
  75. package/src/web/server/watcher.ts +0 -507
package/src/core/index.ts CHANGED
@@ -3,24 +3,32 @@
3
3
  *
4
4
  * NO harness imports allowed in this tree (see docs/design.md §21).
5
5
  */
6
- export * from "./types";
7
- export * from "./slug";
8
- export * from "./frontmatter";
9
- export * from "./languages";
10
- export * from "./mutex";
11
- export * from "./paths";
12
- export * from "./git";
13
- export * from "./vault";
14
- export * from "./repoIndex";
15
- export * from "./summaries";
16
- export * from "./sessions";
17
- export * from "./concurrency";
18
- export * from "./workspace";
19
- export * from "./openInEditor";
20
- export * from "./graph/model";
21
- export * from "./graph/wikilinks";
22
- export * from "./view";
23
- export { buildGraph, dataTimestamp, DEFAULT_MAX_NOTES, type BuildGraphInput } from "./graph/build";
6
+ export type { WorkspaceStatus } from "./types";
7
+ export { NOTES_DIR, repoIndexDir, resolveVaultRoot } from "./paths";
8
+ export { findGitRoot } from "./git";
9
+ export {
10
+ assessStaleness,
11
+ buildRepoIndex,
12
+ readRepoIndex,
13
+ summarizeIndex,
14
+ writeRepoIndex,
15
+ } from "./repoIndex";
16
+ export { runDeepScan, type DeepScanOptions, type DeepScanResult, type SummarizeFn } from "./summaries";
17
+ export {
18
+ addNote,
19
+ appendToNote,
20
+ extractRawTail,
21
+ finalizeNote,
22
+ formatNote,
23
+ formatRawAppend,
24
+ getNote,
25
+ listNotes,
26
+ resolveNotePath,
27
+ searchNotes,
28
+ } from "./vault";
29
+ export { withMutationQueue } from "./mutex";
30
+ export { formatDashboard, formatStatusLine, getWorkspaceStatus } from "./workspace";
31
+ export { WorkspaceCache } from "./cache/workspace";
24
32
  export {
25
33
  buildCurrentGraph,
26
34
  readNoteForView,
@@ -28,12 +36,3 @@ export {
28
36
  readRepositorySide,
29
37
  type ViewNote,
30
38
  } from "./graph/current";
31
- export {
32
- classifyPath,
33
- DEFAULT_STALENESS_TTL_MS,
34
- WorkspaceCache,
35
- type CacheStats,
36
- type InvalidationScope,
37
- type WorkspaceCacheOptions,
38
- type WorkspaceSnapshot,
39
- } from "./cache/workspace";
package/src/core/paths.ts CHANGED
@@ -14,13 +14,6 @@ import { join } from "node:path";
14
14
  export const OKF_DIR = ".okf";
15
15
  export const OKF_MANIFEST = "okf.json";
16
16
  export const NOTES_DIR = "notes";
17
- /**
18
- * Vault collection for generated session memory (docs/session-scan.md).
19
- * A sibling of `notes/` rather than a subdirectory of it: session notes are
20
- * machine-derived memory, not hand-curated knowledge, so they stay out of
21
- * the note graph's flat listing — and out of its slug namespace.
22
- */
23
- export const SESSIONS_DIR = "sessions";
24
17
  export const REPOSITORY_DIR = "repository";
25
18
  export const VAULT_ENV_VAR = "PI_WEAVE_VAULT";
26
19
 
package/src/core/slug.ts CHANGED
@@ -15,6 +15,19 @@ export function slugify(title: string): string {
15
15
  return slug.length > 0 ? slug : "note";
16
16
  }
17
17
 
18
+ /**
19
+ * Slugify each segment of a relative path while preserving directory separators.
20
+ */
21
+ export function slugifyPath(path: string): string {
22
+ const parts = path
23
+ .split(/[\/\\]+/)
24
+ .map((s) => s.trim())
25
+ .filter((s) => s.length > 0)
26
+ .map(slugify)
27
+ .filter((s) => s.length > 0);
28
+ return parts.length > 0 ? parts.join("/") : "note";
29
+ }
30
+
18
31
  /**
19
32
  * Find a free slug in the vault given a desired base, appending -2, -3, ...
20
33
  * `exists` is injected so this stays pure and trivially testable.
package/src/core/types.ts CHANGED
@@ -174,6 +174,7 @@ export interface VaultStatus {
174
174
  root: string;
175
175
  exists: boolean;
176
176
  noteCount: number;
177
+ folders?: string[];
177
178
  }
178
179
 
179
180
  /** Status of the repository half of the workspace. */