@swarmvaultai/engine 0.1.22 → 0.1.24

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.
package/dist/index.d.ts CHANGED
@@ -53,6 +53,7 @@ type PageManager = "system" | "human";
53
53
  type ApprovalEntryStatus = "pending" | "accepted" | "rejected";
54
54
  type ApprovalChangeType = "create" | "update" | "delete" | "promote";
55
55
  type SourceKind = "markdown" | "text" | "pdf" | "image" | "html" | "binary" | "code";
56
+ type SourceCaptureType = "arxiv" | "doi" | "tweet" | "article" | "url";
56
57
  type CodeLanguage = "javascript" | "jsx" | "typescript" | "tsx" | "python" | "go" | "rust" | "java" | "csharp" | "c" | "cpp" | "php" | "ruby" | "powershell";
57
58
  type CodeSymbolKind = "function" | "class" | "interface" | "type_alias" | "enum" | "variable" | "struct" | "trait";
58
59
  type OrchestrationRole = "research" | "audit" | "context" | "safety";
@@ -163,6 +164,11 @@ interface VaultConfig {
163
164
  agents: AgentType[];
164
165
  schedules?: Record<string, ScheduleJobConfig>;
165
166
  orchestration?: OrchestrationConfig;
167
+ benchmark?: {
168
+ enabled?: boolean;
169
+ questions?: string[];
170
+ maxQuestions?: number;
171
+ };
166
172
  webSearch?: {
167
173
  providers: Record<string, WebSearchProviderConfig>;
168
174
  tasks: {
@@ -265,6 +271,7 @@ interface SourceManifest {
265
271
  title: string;
266
272
  originType: "file" | "url";
267
273
  sourceKind: SourceKind;
274
+ sourceType?: SourceCaptureType;
268
275
  language?: CodeLanguage;
269
276
  originalPath?: string;
270
277
  repoRelativePath?: string;
@@ -394,12 +401,24 @@ interface GraphEdge {
394
401
  evidenceClass: EvidenceClass;
395
402
  confidence: number;
396
403
  provenance: string[];
404
+ similarityReasons?: Array<"shared_concept" | "shared_entity" | "shared_tag" | "shared_symbol" | "shared_rationale_theme" | "shared_source_type">;
405
+ }
406
+ interface GraphHyperedge {
407
+ id: string;
408
+ label: string;
409
+ relation: "participate_in" | "implement" | "form";
410
+ nodeIds: string[];
411
+ evidenceClass: EvidenceClass;
412
+ confidence: number;
413
+ sourcePageIds: string[];
414
+ why: string;
397
415
  }
398
416
  interface GraphPage {
399
417
  id: string;
400
418
  path: string;
401
419
  title: string;
402
420
  kind: PageKind;
421
+ sourceType?: SourceCaptureType;
403
422
  sourceIds: string[];
404
423
  projectIds: string[];
405
424
  nodeIds: string[];
@@ -425,6 +444,7 @@ interface GraphArtifact {
425
444
  generatedAt: string;
426
445
  nodes: GraphNode[];
427
446
  edges: GraphEdge[];
447
+ hyperedges: GraphHyperedge[];
428
448
  communities?: Array<{
429
449
  id: string;
430
450
  label: string;
@@ -434,7 +454,7 @@ interface GraphArtifact {
434
454
  pages: GraphPage[];
435
455
  }
436
456
  interface GraphQueryMatch {
437
- type: "node" | "page";
457
+ type: "node" | "page" | "hyperedge";
438
458
  id: string;
439
459
  label: string;
440
460
  score: number;
@@ -446,6 +466,7 @@ interface GraphQueryResult {
446
466
  seedPageIds: string[];
447
467
  visitedNodeIds: string[];
448
468
  visitedEdgeIds: string[];
469
+ hyperedgeIds: string[];
449
470
  pageIds: string[];
450
471
  communities: string[];
451
472
  summary: string;
@@ -481,6 +502,7 @@ interface GraphExplainResult {
481
502
  label: string;
482
503
  };
483
504
  neighbors: GraphExplainNeighbor[];
505
+ hyperedges: GraphHyperedge[];
484
506
  summary: string;
485
507
  }
486
508
  interface ApprovalEntry {
@@ -554,6 +576,7 @@ interface SearchResult {
554
576
  kind?: PageKind;
555
577
  status?: PageStatus;
556
578
  projectIds: string[];
579
+ sourceType?: SourceCaptureType;
557
580
  }
558
581
  interface QueryOptions {
559
582
  question: string;
@@ -771,7 +794,7 @@ interface AddOptions extends IngestOptions {
771
794
  contributor?: string;
772
795
  }
773
796
  interface AddResult {
774
- captureType: "arxiv" | "tweet" | "url";
797
+ captureType: SourceCaptureType;
775
798
  manifest: SourceManifest;
776
799
  normalizedUrl: string;
777
800
  title: string;
@@ -782,10 +805,20 @@ interface BenchmarkQuestionResult {
782
805
  queryTokens: number;
783
806
  reduction: number;
784
807
  visitedNodeIds: string[];
808
+ visitedEdgeIds: string[];
785
809
  pageIds: string[];
786
810
  }
811
+ interface BenchmarkSummary {
812
+ questionCount: number;
813
+ uniqueVisitedNodes: number;
814
+ finalContextTokens: number;
815
+ naiveCorpusTokens: number;
816
+ avgReduction: number;
817
+ reductionRatio: number;
818
+ }
787
819
  interface BenchmarkArtifact {
788
820
  generatedAt: string;
821
+ graphHash: string;
789
822
  corpusWords: number;
790
823
  corpusTokens: number;
791
824
  nodes: number;
@@ -794,9 +827,81 @@ interface BenchmarkArtifact {
794
827
  reductionRatio: number;
795
828
  sampleQuestions: string[];
796
829
  perQuestion: BenchmarkQuestionResult[];
830
+ questionResults: BenchmarkQuestionResult[];
831
+ summary: BenchmarkSummary;
797
832
  }
798
833
  interface BenchmarkOptions {
799
834
  questions?: string[];
835
+ maxQuestions?: number;
836
+ }
837
+ interface GraphReportArtifact {
838
+ generatedAt: string;
839
+ graphHash: string;
840
+ overview: {
841
+ nodes: number;
842
+ edges: number;
843
+ pages: number;
844
+ communities: number;
845
+ };
846
+ benchmark?: {
847
+ generatedAt: string;
848
+ stale: boolean;
849
+ summary: BenchmarkSummary;
850
+ questionCount: number;
851
+ };
852
+ godNodes: Array<{
853
+ nodeId: string;
854
+ label: string;
855
+ pageId?: string;
856
+ degree?: number;
857
+ bridgeScore?: number;
858
+ }>;
859
+ bridgeNodes: Array<{
860
+ nodeId: string;
861
+ label: string;
862
+ pageId?: string;
863
+ degree?: number;
864
+ bridgeScore?: number;
865
+ }>;
866
+ thinCommunities: Array<{
867
+ id: string;
868
+ label: string;
869
+ nodeCount: number;
870
+ pageId?: string;
871
+ path?: string;
872
+ title?: string;
873
+ }>;
874
+ surprisingConnections: Array<{
875
+ id: string;
876
+ sourceNodeId: string;
877
+ sourceLabel: string;
878
+ targetNodeId: string;
879
+ targetLabel: string;
880
+ relation: string;
881
+ evidenceClass: EvidenceClass;
882
+ confidence: number;
883
+ pathNodeIds: string[];
884
+ pathEdgeIds: string[];
885
+ pathRelations: string[];
886
+ pathEvidenceClasses: EvidenceClass[];
887
+ pathSummary: string;
888
+ why: string;
889
+ explanation: string;
890
+ }>;
891
+ groupPatterns: GraphHyperedge[];
892
+ suggestedQuestions: string[];
893
+ communityPages: Array<{
894
+ id: string;
895
+ path: string;
896
+ title: string;
897
+ }>;
898
+ recentResearchSources: Array<{
899
+ pageId: string;
900
+ path: string;
901
+ title: string;
902
+ sourceType: SourceCaptureType;
903
+ updatedAt: string;
904
+ }>;
800
905
  }
801
906
  interface ScheduledCompileTask {
802
907
  type: "compile";
@@ -972,6 +1077,8 @@ declare function queryGraphVault(rootDir: string, question: string, options?: {
972
1077
  declare function benchmarkVault(rootDir: string, options?: BenchmarkOptions): Promise<BenchmarkArtifact>;
973
1078
  declare function pathGraphVault(rootDir: string, from: string, to: string): Promise<GraphPathResult>;
974
1079
  declare function explainGraphVault(rootDir: string, target: string): Promise<GraphExplainResult>;
1080
+ declare function listGraphHyperedges(rootDir: string, target?: string, limit?: number): Promise<GraphHyperedge[]>;
1081
+ declare function readGraphReport(rootDir: string): Promise<GraphReportArtifact | null>;
975
1082
  declare function listGodNodes(rootDir: string, limit?: number): Promise<GraphNode[]>;
976
1083
  declare function listPages(rootDir: string): Promise<GraphPage[]>;
977
1084
  declare function readPage(rootDir: string, relativePath: string): Promise<{
@@ -1025,4 +1132,4 @@ declare function getWatchStatus(rootDir: string): Promise<WatchStatusResult>;
1025
1132
  declare function createWebSearchAdapter(id: string, config: WebSearchProviderConfig, rootDir: string): Promise<WebSearchAdapter>;
1026
1133
  declare function getWebSearchAdapterForTask(rootDir: string, task: "deepLintProvider"): Promise<WebSearchAdapter>;
1027
1134
 
1028
- export { type AddOptions, type AddResult, type AgentType, type AnalyzedTerm, type ApprovalChangeType, type ApprovalDetail, type ApprovalEntry, type ApprovalEntryDetail, type ApprovalEntryStatus, type ApprovalManifest, type ApprovalSummary, type BenchmarkArtifact, type BenchmarkOptions, type BenchmarkQuestionResult, type CandidateRecord, type ChartDatum, type ChartSpec, type ClaimStatus, type CodeAnalysis, type CodeDiagnostic, type CodeImport, type CodeIndexArtifact, type CodeIndexEntry, type CodeLanguage, type CodeSymbol, type CodeSymbolKind, type CommandRoleExecutorConfig, type CompileOptions, type CompileResult, type CompileState, type DirectoryIngestResult, type DirectoryIngestSkip, type EvidenceClass, type ExploreOptions, type ExploreResult, type ExploreStepResult, type ExtractionClaim, type ExtractionKind, type ExtractionTerm, type Freshness, type GenerationAttachment, type GenerationRequest, type GenerationResponse, type GitHookStatus, type GraphArtifact, type GraphEdge, type GraphExplainNeighbor, type GraphExplainResult, type GraphExportFormat, type GraphExportResult, type GraphNode, type GraphPage, type GraphPathResult, type GraphQueryMatch, type GraphQueryResult, type ImageGenerationRequest, type ImageGenerationResponse, type ImageVisionExtraction, type InboxImportResult, type InboxImportSkip, type IngestOptions, type InitOptions, type InstallAgentOptions, type LintFinding, type LintOptions, type OrchestrationConfig, type OrchestrationFinding, type OrchestrationProposal, type OrchestrationRole, type OrchestrationRoleConfig, type OrchestrationRoleResult, type OutputAsset, type OutputAssetRole, type OutputFormat, type OutputOrigin, type PageKind, type PageManager, type PageStatus, type PendingSemanticRefreshEntry, type Polarity, type ProviderAdapter, type ProviderCapability, type ProviderConfig, type ProviderRoleExecutorConfig, type ProviderType, type QueryOptions, type QueryResult, type RepoSyncResult, type ResolvedPaths, type ReviewActionResult, type RoleExecutorConfig, type SceneElement, type SceneSpec, type ScheduleController, type ScheduleJobConfig, type ScheduleStateRecord, type ScheduleTriggerConfig, type ScheduledCompileTask, type ScheduledExploreTask, type ScheduledLintTask, type ScheduledQueryTask, type ScheduledRunResult, type ScheduledTaskConfig, type SearchResult, type SourceAnalysis, type SourceAttachment, type SourceClaim, type SourceExtractionArtifact, type SourceKind, type SourceManifest, type SourceRationale, type VaultConfig, type WatchController, type WatchOptions, type WatchRepoSyncResult, type WatchRunRecord, type WatchStatusResult, type WebSearchAdapter, type WebSearchProviderConfig, type WebSearchProviderType, type WebSearchResult, acceptApproval, addInput, agentTypeSchema, archiveCandidate, assertProviderCapability, benchmarkVault, bootstrapDemo, compileVault, createMcpServer, createProvider, createWebSearchAdapter, defaultVaultConfig, defaultVaultSchema, explainGraphVault, exploreVault, exportGraphFormat, exportGraphHtml, getGitHookStatus, getProviderForTask, getWatchStatus, getWebSearchAdapterForTask, getWorkspaceInfo, importInbox, ingestDirectory, ingestInput, initVault, initWorkspace, installAgent, installConfiguredAgents, installGitHooks, lintVault, listApprovals, listCandidates, listGodNodes, listManifests, listPages, listSchedules, listTrackedRepoRoots, loadVaultConfig, loadVaultSchema, loadVaultSchemas, pathGraphVault, promoteCandidate, providerCapabilitySchema, providerTypeSchema, queryGraphVault, queryVault, readApproval, readExtractedText, readPage, rejectApproval, resolvePaths, runSchedule, runWatchCycle, searchVault, serveSchedules, startGraphServer, startMcpServer, syncTrackedRepos, syncTrackedReposForWatch, uninstallGitHooks, watchVault, webSearchProviderTypeSchema };
1135
+ export { type AddOptions, type AddResult, type AgentType, type AnalyzedTerm, type ApprovalChangeType, type ApprovalDetail, type ApprovalEntry, type ApprovalEntryDetail, type ApprovalEntryStatus, type ApprovalManifest, type ApprovalSummary, type BenchmarkArtifact, type BenchmarkOptions, type BenchmarkQuestionResult, type BenchmarkSummary, type CandidateRecord, type ChartDatum, type ChartSpec, type ClaimStatus, type CodeAnalysis, type CodeDiagnostic, type CodeImport, type CodeIndexArtifact, type CodeIndexEntry, type CodeLanguage, type CodeSymbol, type CodeSymbolKind, type CommandRoleExecutorConfig, type CompileOptions, type CompileResult, type CompileState, type DirectoryIngestResult, type DirectoryIngestSkip, type EvidenceClass, type ExploreOptions, type ExploreResult, type ExploreStepResult, type ExtractionClaim, type ExtractionKind, type ExtractionTerm, type Freshness, type GenerationAttachment, type GenerationRequest, type GenerationResponse, type GitHookStatus, type GraphArtifact, type GraphEdge, type GraphExplainNeighbor, type GraphExplainResult, type GraphExportFormat, type GraphExportResult, type GraphHyperedge, type GraphNode, type GraphPage, type GraphPathResult, type GraphQueryMatch, type GraphQueryResult, type GraphReportArtifact, type ImageGenerationRequest, type ImageGenerationResponse, type ImageVisionExtraction, type InboxImportResult, type InboxImportSkip, type IngestOptions, type InitOptions, type InstallAgentOptions, type LintFinding, type LintOptions, type OrchestrationConfig, type OrchestrationFinding, type OrchestrationProposal, type OrchestrationRole, type OrchestrationRoleConfig, type OrchestrationRoleResult, type OutputAsset, type OutputAssetRole, type OutputFormat, type OutputOrigin, type PageKind, type PageManager, type PageStatus, type PendingSemanticRefreshEntry, type Polarity, type ProviderAdapter, type ProviderCapability, type ProviderConfig, type ProviderRoleExecutorConfig, type ProviderType, type QueryOptions, type QueryResult, type RepoSyncResult, type ResolvedPaths, type ReviewActionResult, type RoleExecutorConfig, type SceneElement, type SceneSpec, type ScheduleController, type ScheduleJobConfig, type ScheduleStateRecord, type ScheduleTriggerConfig, type ScheduledCompileTask, type ScheduledExploreTask, type ScheduledLintTask, type ScheduledQueryTask, type ScheduledRunResult, type ScheduledTaskConfig, type SearchResult, type SourceAnalysis, type SourceAttachment, type SourceCaptureType, type SourceClaim, type SourceExtractionArtifact, type SourceKind, type SourceManifest, type SourceRationale, type VaultConfig, type WatchController, type WatchOptions, type WatchRepoSyncResult, type WatchRunRecord, type WatchStatusResult, type WebSearchAdapter, type WebSearchProviderConfig, type WebSearchProviderType, type WebSearchResult, acceptApproval, addInput, agentTypeSchema, archiveCandidate, assertProviderCapability, benchmarkVault, bootstrapDemo, compileVault, createMcpServer, createProvider, createWebSearchAdapter, defaultVaultConfig, defaultVaultSchema, explainGraphVault, exploreVault, exportGraphFormat, exportGraphHtml, getGitHookStatus, getProviderForTask, getWatchStatus, getWebSearchAdapterForTask, getWorkspaceInfo, importInbox, ingestDirectory, ingestInput, initVault, initWorkspace, installAgent, installConfiguredAgents, installGitHooks, lintVault, listApprovals, listCandidates, listGodNodes, listGraphHyperedges, listManifests, listPages, listSchedules, listTrackedRepoRoots, loadVaultConfig, loadVaultSchema, loadVaultSchemas, pathGraphVault, promoteCandidate, providerCapabilitySchema, providerTypeSchema, queryGraphVault, queryVault, readApproval, readExtractedText, readGraphReport, readPage, rejectApproval, resolvePaths, runSchedule, runWatchCycle, searchVault, serveSchedules, startGraphServer, startMcpServer, syncTrackedRepos, syncTrackedReposForWatch, uninstallGitHooks, watchVault, webSearchProviderTypeSchema };