@swarmvaultai/engine 0.1.18 → 0.1.21

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
@@ -39,19 +39,21 @@ declare const agentTypeSchema: z.ZodEnum<{
39
39
  opencode: "opencode";
40
40
  }>;
41
41
  type AgentType = z.infer<typeof agentTypeSchema>;
42
- type PageKind = "index" | "source" | "module" | "concept" | "entity" | "output" | "insight";
42
+ type PageKind = "index" | "source" | "module" | "concept" | "entity" | "output" | "insight" | "graph_report" | "community_summary";
43
43
  type Freshness = "fresh" | "stale";
44
44
  type ClaimStatus = "extracted" | "inferred" | "conflicted" | "stale";
45
+ type EvidenceClass = "extracted" | "inferred" | "ambiguous";
45
46
  type Polarity = "positive" | "negative" | "neutral";
46
47
  type OutputOrigin = "query" | "explore";
47
48
  type OutputFormat = "markdown" | "report" | "slides" | "chart" | "image";
48
49
  type OutputAssetRole = "primary" | "preview" | "manifest" | "poster";
50
+ type GraphExportFormat = "html" | "svg" | "graphml" | "cypher";
49
51
  type PageStatus = "draft" | "candidate" | "active" | "archived";
50
52
  type PageManager = "system" | "human";
51
53
  type ApprovalEntryStatus = "pending" | "accepted" | "rejected";
52
54
  type ApprovalChangeType = "create" | "update" | "delete" | "promote";
53
55
  type SourceKind = "markdown" | "text" | "pdf" | "image" | "html" | "binary" | "code";
54
- type CodeLanguage = "javascript" | "jsx" | "typescript" | "tsx" | "python" | "go" | "rust" | "java" | "csharp" | "c" | "cpp" | "php";
56
+ type CodeLanguage = "javascript" | "jsx" | "typescript" | "tsx" | "python" | "go" | "rust" | "java" | "csharp" | "c" | "cpp" | "php" | "ruby" | "powershell";
55
57
  type CodeSymbolKind = "function" | "class" | "interface" | "type_alias" | "enum" | "variable" | "struct" | "trait";
56
58
  type OrchestrationRole = "research" | "audit" | "context" | "safety";
57
59
  declare const webSearchProviderTypeSchema: z.ZodEnum<{
@@ -192,9 +194,13 @@ interface ResolvedPaths {
192
194
  searchDbPath: string;
193
195
  compileStatePath: string;
194
196
  codeIndexPath: string;
197
+ benchmarkPath: string;
195
198
  jobsLogPath: string;
196
199
  sessionsDir: string;
197
200
  approvalsDir: string;
201
+ watchDir: string;
202
+ watchStatusPath: string;
203
+ pendingSemanticRefreshPath: string;
198
204
  configPath: string;
199
205
  }
200
206
  interface SourceAttachment {
@@ -292,6 +298,13 @@ interface CodeAnalysis {
292
298
  exports: string[];
293
299
  diagnostics: CodeDiagnostic[];
294
300
  }
301
+ interface SourceRationale {
302
+ id: string;
303
+ text: string;
304
+ citation: string;
305
+ kind: "docstring" | "comment" | "marker";
306
+ symbolName?: string;
307
+ }
295
308
  interface CodeIndexEntry {
296
309
  sourceId: string;
297
310
  moduleId: string;
@@ -317,12 +330,13 @@ interface SourceAnalysis {
317
330
  entities: AnalyzedTerm[];
318
331
  claims: SourceClaim[];
319
332
  questions: string[];
333
+ rationales: SourceRationale[];
320
334
  code?: CodeAnalysis;
321
335
  producedAt: string;
322
336
  }
323
337
  interface GraphNode {
324
338
  id: string;
325
- type: "source" | "concept" | "entity" | "module" | "symbol";
339
+ type: "source" | "concept" | "entity" | "module" | "symbol" | "rationale";
326
340
  label: string;
327
341
  pageId?: string;
328
342
  freshness?: Freshness;
@@ -343,6 +357,7 @@ interface GraphEdge {
343
357
  target: string;
344
358
  relation: string;
345
359
  status: ClaimStatus;
360
+ evidenceClass: EvidenceClass;
346
361
  confidence: number;
347
362
  provenance: string[];
348
363
  }
@@ -384,6 +399,56 @@ interface GraphArtifact {
384
399
  sources: SourceManifest[];
385
400
  pages: GraphPage[];
386
401
  }
402
+ interface GraphQueryMatch {
403
+ type: "node" | "page";
404
+ id: string;
405
+ label: string;
406
+ score: number;
407
+ }
408
+ interface GraphQueryResult {
409
+ question: string;
410
+ traversal: "bfs" | "dfs";
411
+ seedNodeIds: string[];
412
+ seedPageIds: string[];
413
+ visitedNodeIds: string[];
414
+ visitedEdgeIds: string[];
415
+ pageIds: string[];
416
+ communities: string[];
417
+ summary: string;
418
+ matches: GraphQueryMatch[];
419
+ }
420
+ interface GraphPathResult {
421
+ from: string;
422
+ to: string;
423
+ resolvedFromNodeId?: string;
424
+ resolvedToNodeId?: string;
425
+ found: boolean;
426
+ nodeIds: string[];
427
+ edgeIds: string[];
428
+ pageIds: string[];
429
+ summary: string;
430
+ }
431
+ interface GraphExplainNeighbor {
432
+ nodeId: string;
433
+ label: string;
434
+ type: GraphNode["type"];
435
+ pageId?: string;
436
+ relation: string;
437
+ direction: "incoming" | "outgoing";
438
+ confidence: number;
439
+ evidenceClass: EvidenceClass;
440
+ }
441
+ interface GraphExplainResult {
442
+ target: string;
443
+ node: GraphNode;
444
+ page?: GraphPage;
445
+ community?: {
446
+ id: string;
447
+ label: string;
448
+ };
449
+ neighbors: GraphExplainNeighbor[];
450
+ summary: string;
451
+ }
387
452
  interface ApprovalEntry {
388
453
  pageId: string;
389
454
  title: string;
@@ -502,6 +567,28 @@ interface InboxImportResult {
502
567
  interface WatchOptions {
503
568
  lint?: boolean;
504
569
  debounceMs?: number;
570
+ repo?: boolean;
571
+ }
572
+ interface PendingSemanticRefreshEntry {
573
+ id: string;
574
+ repoRoot: string;
575
+ path: string;
576
+ changeType: "added" | "modified" | "removed";
577
+ detectedAt: string;
578
+ sourceId?: string;
579
+ sourceKind?: SourceKind;
580
+ }
581
+ interface RepoSyncResult {
582
+ repoRoots: string[];
583
+ scannedCount: number;
584
+ imported: SourceManifest[];
585
+ updated: SourceManifest[];
586
+ removed: SourceManifest[];
587
+ skipped: DirectoryIngestSkip[];
588
+ }
589
+ interface WatchRepoSyncResult extends RepoSyncResult {
590
+ pendingSemanticRefresh: PendingSemanticRefreshEntry[];
591
+ staleSourceIds: string[];
505
592
  }
506
593
  interface WatchRunRecord {
507
594
  startedAt: string;
@@ -513,13 +600,33 @@ interface WatchRunRecord {
513
600
  scannedCount: number;
514
601
  attachmentCount: number;
515
602
  changedPages: string[];
603
+ repoImportedCount?: number;
604
+ repoUpdatedCount?: number;
605
+ repoRemovedCount?: number;
606
+ repoScannedCount?: number;
607
+ pendingSemanticRefreshCount?: number;
608
+ pendingSemanticRefreshPaths?: string[];
516
609
  lintFindingCount?: number;
517
610
  success: boolean;
518
611
  error?: string;
519
612
  }
613
+ interface WatchStatusResult {
614
+ generatedAt: string;
615
+ watchedRepoRoots: string[];
616
+ lastRun?: WatchRunRecord;
617
+ pendingSemanticRefresh: PendingSemanticRefreshEntry[];
618
+ }
520
619
  interface WatchController {
521
620
  close(): Promise<void>;
522
621
  }
622
+ interface InstallAgentOptions {
623
+ claudeHook?: boolean;
624
+ }
625
+ interface GitHookStatus {
626
+ repoRoot: string | null;
627
+ postCommit: "installed" | "not_installed" | "other_content";
628
+ postCheckout: "installed" | "not_installed" | "other_content";
629
+ }
523
630
  interface CompileState {
524
631
  generatedAt: string;
525
632
  rootSchemaHash: string;
@@ -621,6 +728,42 @@ interface SceneSpec {
621
728
  height?: number;
622
729
  elements: SceneElement[];
623
730
  }
731
+ interface GraphExportResult {
732
+ format: GraphExportFormat;
733
+ outputPath: string;
734
+ }
735
+ interface AddOptions extends IngestOptions {
736
+ author?: string;
737
+ contributor?: string;
738
+ }
739
+ interface AddResult {
740
+ captureType: "arxiv" | "tweet" | "url";
741
+ manifest: SourceManifest;
742
+ normalizedUrl: string;
743
+ title: string;
744
+ fallback: boolean;
745
+ }
746
+ interface BenchmarkQuestionResult {
747
+ question: string;
748
+ queryTokens: number;
749
+ reduction: number;
750
+ visitedNodeIds: string[];
751
+ pageIds: string[];
752
+ }
753
+ interface BenchmarkArtifact {
754
+ generatedAt: string;
755
+ corpusWords: number;
756
+ corpusTokens: number;
757
+ nodes: number;
758
+ edges: number;
759
+ avgQueryTokens: number;
760
+ reductionRatio: number;
761
+ sampleQuestions: string[];
762
+ perQuestion: BenchmarkQuestionResult[];
763
+ }
764
+ interface BenchmarkOptions {
765
+ questions?: string[];
766
+ }
624
767
  interface ScheduledCompileTask {
625
768
  type: "compile";
626
769
  approve?: boolean;
@@ -716,7 +859,7 @@ interface ScheduleController {
716
859
  close(): Promise<void>;
717
860
  }
718
861
 
719
- declare function installAgent(rootDir: string, agent: AgentType): Promise<string>;
862
+ declare function installAgent(rootDir: string, agent: AgentType, options?: InstallAgentOptions): Promise<string>;
720
863
  declare function installConfiguredAgents(rootDir: string): Promise<string[]>;
721
864
 
722
865
  declare function defaultVaultConfig(): VaultConfig;
@@ -731,7 +874,17 @@ declare function initWorkspace(rootDir: string): Promise<{
731
874
  paths: ResolvedPaths;
732
875
  }>;
733
876
 
877
+ declare function exportGraphFormat(rootDir: string, format: Exclude<GraphExportFormat, "html">, outputPath: string): Promise<GraphExportResult>;
878
+
879
+ declare function getGitHookStatus(rootDir: string): Promise<GitHookStatus>;
880
+ declare function installGitHooks(rootDir: string): Promise<GitHookStatus>;
881
+ declare function uninstallGitHooks(rootDir: string): Promise<GitHookStatus>;
882
+
883
+ declare function listTrackedRepoRoots(rootDir: string): Promise<string[]>;
884
+ declare function syncTrackedRepos(rootDir: string, options?: IngestOptions, repoRoots?: string[]): Promise<RepoSyncResult>;
885
+ declare function syncTrackedReposForWatch(rootDir: string, options?: IngestOptions, repoRoots?: string[]): Promise<WatchRepoSyncResult>;
734
886
  declare function ingestInput(rootDir: string, input: string, options?: IngestOptions): Promise<SourceManifest>;
887
+ declare function addInput(rootDir: string, input: string, options?: AddOptions): Promise<AddResult>;
735
888
  declare function ingestDirectory(rootDir: string, inputDir: string, options?: IngestOptions): Promise<DirectoryIngestResult>;
736
889
  declare function importInbox(rootDir: string, inputDir?: string): Promise<InboxImportResult>;
737
890
  declare function listManifests(rootDir: string): Promise<SourceManifest[]>;
@@ -778,6 +931,14 @@ declare function compileVault(rootDir: string, options?: CompileOptions): Promis
778
931
  declare function queryVault(rootDir: string, options: QueryOptions): Promise<QueryResult>;
779
932
  declare function exploreVault(rootDir: string, options: ExploreOptions): Promise<ExploreResult>;
780
933
  declare function searchVault(rootDir: string, query: string, limit?: number): Promise<SearchResult[]>;
934
+ declare function queryGraphVault(rootDir: string, question: string, options?: {
935
+ traversal?: "bfs" | "dfs";
936
+ budget?: number;
937
+ }): Promise<GraphQueryResult>;
938
+ declare function benchmarkVault(rootDir: string, options?: BenchmarkOptions): Promise<BenchmarkArtifact>;
939
+ declare function pathGraphVault(rootDir: string, from: string, to: string): Promise<GraphPathResult>;
940
+ declare function explainGraphVault(rootDir: string, target: string): Promise<GraphExplainResult>;
941
+ declare function listGodNodes(rootDir: string, limit?: number): Promise<GraphNode[]>;
781
942
  declare function listPages(rootDir: string): Promise<GraphPage[]>;
782
943
  declare function readPage(rootDir: string, relativePath: string): Promise<{
783
944
  path: string;
@@ -809,9 +970,25 @@ declare function startGraphServer(rootDir: string, port?: number): Promise<{
809
970
  }>;
810
971
  declare function exportGraphHtml(rootDir: string, outputPath: string): Promise<string>;
811
972
 
973
+ type WatchCycleResult = {
974
+ watchedRepoRoots: string[];
975
+ importedCount: number;
976
+ scannedCount: number;
977
+ attachmentCount: number;
978
+ repoImportedCount: number;
979
+ repoUpdatedCount: number;
980
+ repoRemovedCount: number;
981
+ repoScannedCount: number;
982
+ pendingSemanticRefreshCount: number;
983
+ pendingSemanticRefreshPaths: string[];
984
+ changedPages: string[];
985
+ lintFindingCount?: number;
986
+ };
987
+ declare function runWatchCycle(rootDir: string, options?: WatchOptions): Promise<WatchCycleResult>;
812
988
  declare function watchVault(rootDir: string, options?: WatchOptions): Promise<WatchController>;
989
+ declare function getWatchStatus(rootDir: string): Promise<WatchStatusResult>;
813
990
 
814
991
  declare function createWebSearchAdapter(id: string, config: WebSearchProviderConfig, rootDir: string): Promise<WebSearchAdapter>;
815
992
  declare function getWebSearchAdapterForTask(rootDir: string, task: "deepLintProvider"): Promise<WebSearchAdapter>;
816
993
 
817
- export { type AgentType, type AnalyzedTerm, type ApprovalChangeType, type ApprovalDetail, type ApprovalEntry, type ApprovalEntryDetail, type ApprovalEntryStatus, type ApprovalManifest, type ApprovalSummary, 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 ExploreOptions, type ExploreResult, type ExploreStepResult, type Freshness, type GenerationAttachment, type GenerationRequest, type GenerationResponse, type GraphArtifact, type GraphEdge, type GraphNode, type GraphPage, type ImageGenerationRequest, type ImageGenerationResponse, type InboxImportResult, type InboxImportSkip, type IngestOptions, type InitOptions, 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 Polarity, type ProviderAdapter, type ProviderCapability, type ProviderConfig, type ProviderRoleExecutorConfig, type ProviderType, type QueryOptions, type QueryResult, 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 SourceKind, type SourceManifest, type VaultConfig, type WatchController, type WatchOptions, type WatchRunRecord, type WebSearchAdapter, type WebSearchProviderConfig, type WebSearchProviderType, type WebSearchResult, acceptApproval, agentTypeSchema, archiveCandidate, assertProviderCapability, bootstrapDemo, compileVault, createMcpServer, createProvider, createWebSearchAdapter, defaultVaultConfig, defaultVaultSchema, exploreVault, exportGraphHtml, getProviderForTask, getWebSearchAdapterForTask, getWorkspaceInfo, importInbox, ingestDirectory, ingestInput, initVault, initWorkspace, installAgent, installConfiguredAgents, lintVault, listApprovals, listCandidates, listManifests, listPages, listSchedules, loadVaultConfig, loadVaultSchema, loadVaultSchemas, promoteCandidate, providerCapabilitySchema, providerTypeSchema, queryVault, readApproval, readExtractedText, readPage, rejectApproval, resolvePaths, runSchedule, searchVault, serveSchedules, startGraphServer, startMcpServer, watchVault, webSearchProviderTypeSchema };
994
+ 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 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 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 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 };