@gmickel/gno 2.7.1 → 2.8.0

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 (76) hide show
  1. package/README.md +3 -2
  2. package/assets/skill/SKILL.md +8 -1
  3. package/assets/skill/cli-reference.md +8 -1
  4. package/assets/skill/examples.md +2 -1
  5. package/assets/skill/mcp-reference.md +3 -1
  6. package/assets/spa-production.json.gz +0 -0
  7. package/browser-extension/artifacts/{gno-browser-clipper-v2.7.1.zip → gno-browser-clipper-v2.8.0.zip} +0 -0
  8. package/browser-extension/artifacts/gno-browser-clipper-v2.8.0.zip.sha256 +1 -0
  9. package/browser-extension/dist/manifest.json +1 -1
  10. package/package.json +1 -1
  11. package/spec/cli.md +48 -6
  12. package/spec/db/schema.sql +0 -1
  13. package/spec/mcp.md +18 -3
  14. package/spec/output-schemas/audit-report.schema.json +18 -4
  15. package/spec/output-schemas/backlinks.schema.json +4 -0
  16. package/spec/output-schemas/collection-list.schema.json +13 -0
  17. package/spec/output-schemas/graph.schema.json +2 -0
  18. package/spec/output-schemas/links-list.schema.json +4 -0
  19. package/spec/output-schemas/status.schema.json +15 -0
  20. package/src/cli/commands/audit.ts +23 -4
  21. package/src/cli/commands/collection/list.ts +39 -5
  22. package/src/cli/commands/embed.ts +3 -3
  23. package/src/cli/commands/links.ts +34 -131
  24. package/src/cli/commands/shared.ts +7 -0
  25. package/src/cli/commands/status.ts +5 -0
  26. package/src/cli/program.ts +12 -2
  27. package/src/config/loader.ts +43 -0
  28. package/src/config/types.ts +8 -0
  29. package/src/core/audit-contract.ts +16 -4
  30. package/src/core/audit-freshness.ts +11 -1
  31. package/src/core/audit-links.ts +145 -25
  32. package/src/core/audit-provenance.ts +11 -4
  33. package/src/core/audit-workspace.ts +19 -4
  34. package/src/core/audit.ts +67 -15
  35. package/src/core/context-compiler.ts +3 -0
  36. package/src/core/context-evidence.ts +11 -0
  37. package/src/core/graph-edge-confidence.ts +23 -1
  38. package/src/core/host-paths.ts +1 -0
  39. package/src/core/knowledge-impact.ts +28 -0
  40. package/src/core/link-workspace.ts +324 -0
  41. package/src/core/retrieval-replay-candidate.ts +6 -0
  42. package/src/core/retrieval-trace-request.ts +3 -0
  43. package/src/index.ts +14 -1
  44. package/src/ingestion/graph-reconciliation.ts +77 -15
  45. package/src/ingestion/source-availability/darwin-path.ts +9 -3
  46. package/src/ingestion/sync.ts +22 -1
  47. package/src/ingestion/types.ts +14 -0
  48. package/src/llm/inference-scope.ts +4 -3
  49. package/src/mcp/http-egress.ts +42 -3
  50. package/src/mcp/tools/audit.ts +11 -2
  51. package/src/mcp/tools/changes.ts +1 -0
  52. package/src/mcp/tools/links.ts +3 -0
  53. package/src/mcp/tools/sessions.ts +33 -4
  54. package/src/mcp/tools/status.ts +3 -0
  55. package/src/pipeline/expansion.ts +19 -31
  56. package/src/pipeline/graph-retrieval.ts +22 -2
  57. package/src/pipeline/hybrid.ts +1 -1
  58. package/src/pipeline/types.ts +6 -3
  59. package/src/serve/findings-pass.ts +1 -1
  60. package/src/serve/public/pages/GraphView.tsx +2 -0
  61. package/src/serve/routes/changes.ts +6 -1
  62. package/src/serve/routes/links.ts +13 -0
  63. package/src/serve/routes/sessions.ts +41 -53
  64. package/src/sessions/config-refresh.ts +111 -0
  65. package/src/store/migrations/033-drop-documents-active-index.ts +30 -0
  66. package/src/store/migrations/034-collection-link-workspace.ts +47 -0
  67. package/src/store/migrations/index.ts +4 -0
  68. package/src/store/sqlite/adapter.ts +390 -231
  69. package/src/store/sqlite/eligibility.ts +8 -2
  70. package/src/store/sqlite/graph-link-resolver.ts +252 -5
  71. package/src/store/sqlite/graph-neighbors.ts +147 -40
  72. package/src/store/sqlite/graph-reference-state.ts +13 -2
  73. package/src/store/sqlite/workspace-link-resolver.ts +654 -0
  74. package/src/store/types.ts +49 -3
  75. package/src/store/vector/stats.ts +1 -1
  76. package/browser-extension/artifacts/gno-browser-clipper-v2.7.1.zip.sha256 +0 -1
@@ -20,6 +20,7 @@ import type {
20
20
  FileRefactorRecoveryReceipt,
21
21
  FileRefactorRecoveryReceiptDraft,
22
22
  } from "../core/file-refactor-journal";
23
+ import type { LinkWorkspaceSource } from "../core/link-workspace";
23
24
  import type { MetadataPredicate, TypedMetadata } from "../core/typed-metadata";
24
25
  import type {
25
26
  ChunkingPolicyToken,
@@ -113,6 +114,14 @@ export interface CollectionRow {
113
114
  egressPolicy: EgressPolicy;
114
115
  /** Whether policy was explicit or supplied by a safe default. */
115
116
  egressPolicySource: EgressPolicySource;
117
+ /** Canonical collection root (real path), when resolvable. */
118
+ realPath?: string | null;
119
+ /** Effective link workspace root; null means collection-scoped links. */
120
+ workspaceRoot?: string | null;
121
+ /** How the workspace root was established. */
122
+ workspaceSource?: LinkWorkspaceSource;
123
+ /** Collection-relative prefixes of nested vaults with their own workspace. */
124
+ workspaceNested?: string[];
116
125
  syncedAt: string;
117
126
  }
118
127
 
@@ -351,6 +360,8 @@ export interface BacklinkRow {
351
360
  sourceDocUri: string;
352
361
  /** Source document title */
353
362
  sourceDocTitle: string | null;
363
+ /** Collection of the source document */
364
+ sourceCollection?: string;
354
365
  /** Link display text */
355
366
  linkText: string | null;
356
367
  /** 1-based line number in source */
@@ -793,6 +804,10 @@ export interface CollectionStatus {
793
804
  egressPolicy: EgressPolicy;
794
805
  /** Whether policy was explicit or supplied by a safe default. */
795
806
  egressPolicySource: EgressPolicySource;
807
+ /** Effective link workspace root (host path); null when collection-scoped. */
808
+ workspaceRoot?: string | null;
809
+ /** How the link workspace was established. */
810
+ workspaceSource?: LinkWorkspaceSource;
796
811
  totalDocuments: number;
797
812
  activeDocuments: number;
798
813
  errorDocuments: number;
@@ -876,6 +891,10 @@ export interface GraphEdgeAudit {
876
891
  resolution:
877
892
  | "exact-title"
878
893
  | "exact-path"
894
+ /** Only file with that name (or path suffix) in its link workspace. */
895
+ | "exact-name"
896
+ /** Won over same-named files by the same-folder / shallower tie-break. */
897
+ | "tie-break"
879
898
  | "path-fallback"
880
899
  | "ambiguous-fallback"
881
900
  | "similarity";
@@ -1066,6 +1085,12 @@ export interface GetGraphNeighborsOptions {
1066
1085
  seedDocumentIds: number[];
1067
1086
  /** Filter neighbors to a single collection */
1068
1087
  collection?: string;
1088
+ /**
1089
+ * Graph allowlist: every edge's resolved source and target must be in one
1090
+ * of these collections. Takes precedence over `collection`; empty denies
1091
+ * all. Undefined (with no `collection`) is unrestricted.
1092
+ */
1093
+ collections?: string[];
1069
1094
  /** Max edges to return (default 10000) */
1070
1095
  limitEdges?: number;
1071
1096
  }
@@ -1113,6 +1138,11 @@ export interface GraphQueryEdge {
1113
1138
  export interface GraphQueryOptions {
1114
1139
  direction?: GraphQueryDirection;
1115
1140
  edgeType?: DocEdgeType;
1141
+ /**
1142
+ * Collection allowlist: only documents in these collections are visited
1143
+ * (the root must be in scope too). Undefined means every collection.
1144
+ */
1145
+ collections?: string[];
1116
1146
  maxDepth?: number;
1117
1147
  maxNodes?: number;
1118
1148
  frontierLimit?: number;
@@ -1599,6 +1629,14 @@ export interface StorePort {
1599
1629
  */
1600
1630
  getCollections(): Promise<StoreResult<CollectionRow[]>>;
1601
1631
 
1632
+ /**
1633
+ * Re-detect nested vaults below a collection root from its indexed
1634
+ * document directories; returns whether stored membership changed.
1635
+ */
1636
+ refreshCollectionNestedWorkspaces?(
1637
+ collection: string
1638
+ ): Promise<StoreResult<boolean>>;
1639
+
1602
1640
  /**
1603
1641
  * Get all contexts from DB.
1604
1642
  */
@@ -2242,18 +2280,26 @@ export interface StorePort {
2242
2280
  ): Promise<StoreResult<BacklinkRow[]>>;
2243
2281
 
2244
2282
  /**
2245
- * Resolve link targets to their documents.
2246
- * Returns array of resolved docs (or null for unresolved) matching input order.
2283
+ * Resolve link targets to their documents with the shared link resolver.
2284
+ * With `source`, plain wiki links from a document inside a link workspace
2285
+ * resolve across the workspace. Returns resolved docs (or null for
2286
+ * unresolved and tied links) matching input order.
2247
2287
  */
2248
2288
  resolveLinks(
2249
2289
  targets: Array<{
2250
2290
  targetRefNorm: string;
2251
2291
  targetCollection: string;
2252
2292
  linkType: "wiki" | "markdown";
2293
+ source?: { collection: string; relPath: string; explicit: boolean };
2253
2294
  }>
2254
2295
  ): Promise<
2255
2296
  StoreResult<
2256
- Array<{ docid: string; uri: string; title: string | null } | null>
2297
+ Array<{
2298
+ docid: string;
2299
+ uri: string;
2300
+ title: string | null;
2301
+ collection?: string;
2302
+ } | null>
2257
2303
  >
2258
2304
  >;
2259
2305
 
@@ -34,7 +34,7 @@ export function createVectorStatsPort(db: Database): VectorStatsPort {
34
34
  return {
35
35
  sql: `
36
36
  EXISTS (
37
- SELECT 1 FROM documents d
37
+ SELECT 1 FROM documents d INDEXED BY idx_documents_mirror_hash
38
38
  WHERE d.mirror_hash = c.mirror_hash AND d.active = 1 AND d.collection = ?
39
39
  )
40
40
  `,
@@ -1 +0,0 @@
1
- 0566f9eb5eb5db6a1632063e63f37dab01a9d2a0aa3dde5658356926a53c395e gno-browser-clipper-v2.7.1.zip