@swarmvaultai/engine 0.1.19 → 0.1.22

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
@@ -47,12 +47,13 @@ type Polarity = "positive" | "negative" | "neutral";
47
47
  type OutputOrigin = "query" | "explore";
48
48
  type OutputFormat = "markdown" | "report" | "slides" | "chart" | "image";
49
49
  type OutputAssetRole = "primary" | "preview" | "manifest" | "poster";
50
+ type GraphExportFormat = "html" | "svg" | "graphml" | "cypher";
50
51
  type PageStatus = "draft" | "candidate" | "active" | "archived";
51
52
  type PageManager = "system" | "human";
52
53
  type ApprovalEntryStatus = "pending" | "accepted" | "rejected";
53
54
  type ApprovalChangeType = "create" | "update" | "delete" | "promote";
54
55
  type SourceKind = "markdown" | "text" | "pdf" | "image" | "html" | "binary" | "code";
55
- 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";
56
57
  type CodeSymbolKind = "function" | "class" | "interface" | "type_alias" | "enum" | "variable" | "struct" | "trait";
57
58
  type OrchestrationRole = "research" | "audit" | "context" | "safety";
58
59
  declare const webSearchProviderTypeSchema: z.ZodEnum<{
@@ -193,9 +194,13 @@ interface ResolvedPaths {
193
194
  searchDbPath: string;
194
195
  compileStatePath: string;
195
196
  codeIndexPath: string;
197
+ benchmarkPath: string;
196
198
  jobsLogPath: string;
197
199
  sessionsDir: string;
198
200
  approvalsDir: string;
201
+ watchDir: string;
202
+ watchStatusPath: string;
203
+ pendingSemanticRefreshPath: string;
199
204
  configPath: string;
200
205
  }
201
206
  interface SourceAttachment {
@@ -203,6 +208,37 @@ interface SourceAttachment {
203
208
  mimeType: string;
204
209
  originalPath?: string;
205
210
  }
211
+ type ExtractionKind = "plain_text" | "html_readability" | "pdf_text" | "image_vision";
212
+ interface ExtractionTerm {
213
+ name: string;
214
+ description: string;
215
+ }
216
+ interface ExtractionClaim {
217
+ text: string;
218
+ confidence: number;
219
+ polarity: Polarity;
220
+ }
221
+ interface ImageVisionExtraction {
222
+ title?: string;
223
+ summary: string;
224
+ text: string;
225
+ concepts: ExtractionTerm[];
226
+ entities: ExtractionTerm[];
227
+ claims: ExtractionClaim[];
228
+ questions: string[];
229
+ }
230
+ interface SourceExtractionArtifact {
231
+ extractor: ExtractionKind;
232
+ sourceKind: SourceKind;
233
+ mimeType: string;
234
+ producedAt: string;
235
+ providerId?: string;
236
+ providerModel?: string;
237
+ warnings?: string[];
238
+ pageCount?: number;
239
+ metadata?: Record<string, string>;
240
+ vision?: ImageVisionExtraction;
241
+ }
206
242
  interface IngestOptions {
207
243
  includeAssets?: boolean;
208
244
  maxAssetSize?: number;
@@ -235,6 +271,8 @@ interface SourceManifest {
235
271
  url?: string;
236
272
  storedPath: string;
237
273
  extractedTextPath?: string;
274
+ extractedMetadataPath?: string;
275
+ extractionHash?: string;
238
276
  mimeType: string;
239
277
  contentHash: string;
240
278
  createdAt: string;
@@ -318,6 +356,7 @@ interface SourceAnalysis {
318
356
  analysisVersion: number;
319
357
  sourceId: string;
320
358
  sourceHash: string;
359
+ extractionHash?: string;
321
360
  schemaHash: string;
322
361
  title: string;
323
362
  summary: string;
@@ -562,6 +601,28 @@ interface InboxImportResult {
562
601
  interface WatchOptions {
563
602
  lint?: boolean;
564
603
  debounceMs?: number;
604
+ repo?: boolean;
605
+ }
606
+ interface PendingSemanticRefreshEntry {
607
+ id: string;
608
+ repoRoot: string;
609
+ path: string;
610
+ changeType: "added" | "modified" | "removed";
611
+ detectedAt: string;
612
+ sourceId?: string;
613
+ sourceKind?: SourceKind;
614
+ }
615
+ interface RepoSyncResult {
616
+ repoRoots: string[];
617
+ scannedCount: number;
618
+ imported: SourceManifest[];
619
+ updated: SourceManifest[];
620
+ removed: SourceManifest[];
621
+ skipped: DirectoryIngestSkip[];
622
+ }
623
+ interface WatchRepoSyncResult extends RepoSyncResult {
624
+ pendingSemanticRefresh: PendingSemanticRefreshEntry[];
625
+ staleSourceIds: string[];
565
626
  }
566
627
  interface WatchRunRecord {
567
628
  startedAt: string;
@@ -573,13 +634,33 @@ interface WatchRunRecord {
573
634
  scannedCount: number;
574
635
  attachmentCount: number;
575
636
  changedPages: string[];
637
+ repoImportedCount?: number;
638
+ repoUpdatedCount?: number;
639
+ repoRemovedCount?: number;
640
+ repoScannedCount?: number;
641
+ pendingSemanticRefreshCount?: number;
642
+ pendingSemanticRefreshPaths?: string[];
576
643
  lintFindingCount?: number;
577
644
  success: boolean;
578
645
  error?: string;
579
646
  }
647
+ interface WatchStatusResult {
648
+ generatedAt: string;
649
+ watchedRepoRoots: string[];
650
+ lastRun?: WatchRunRecord;
651
+ pendingSemanticRefresh: PendingSemanticRefreshEntry[];
652
+ }
580
653
  interface WatchController {
581
654
  close(): Promise<void>;
582
655
  }
656
+ interface InstallAgentOptions {
657
+ claudeHook?: boolean;
658
+ }
659
+ interface GitHookStatus {
660
+ repoRoot: string | null;
661
+ postCommit: "installed" | "not_installed" | "other_content";
662
+ postCheckout: "installed" | "not_installed" | "other_content";
663
+ }
583
664
  interface CompileState {
584
665
  generatedAt: string;
585
666
  rootSchemaHash: string;
@@ -681,6 +762,42 @@ interface SceneSpec {
681
762
  height?: number;
682
763
  elements: SceneElement[];
683
764
  }
765
+ interface GraphExportResult {
766
+ format: GraphExportFormat;
767
+ outputPath: string;
768
+ }
769
+ interface AddOptions extends IngestOptions {
770
+ author?: string;
771
+ contributor?: string;
772
+ }
773
+ interface AddResult {
774
+ captureType: "arxiv" | "tweet" | "url";
775
+ manifest: SourceManifest;
776
+ normalizedUrl: string;
777
+ title: string;
778
+ fallback: boolean;
779
+ }
780
+ interface BenchmarkQuestionResult {
781
+ question: string;
782
+ queryTokens: number;
783
+ reduction: number;
784
+ visitedNodeIds: string[];
785
+ pageIds: string[];
786
+ }
787
+ interface BenchmarkArtifact {
788
+ generatedAt: string;
789
+ corpusWords: number;
790
+ corpusTokens: number;
791
+ nodes: number;
792
+ edges: number;
793
+ avgQueryTokens: number;
794
+ reductionRatio: number;
795
+ sampleQuestions: string[];
796
+ perQuestion: BenchmarkQuestionResult[];
797
+ }
798
+ interface BenchmarkOptions {
799
+ questions?: string[];
800
+ }
684
801
  interface ScheduledCompileTask {
685
802
  type: "compile";
686
803
  approve?: boolean;
@@ -776,7 +893,7 @@ interface ScheduleController {
776
893
  close(): Promise<void>;
777
894
  }
778
895
 
779
- declare function installAgent(rootDir: string, agent: AgentType): Promise<string>;
896
+ declare function installAgent(rootDir: string, agent: AgentType, options?: InstallAgentOptions): Promise<string>;
780
897
  declare function installConfiguredAgents(rootDir: string): Promise<string[]>;
781
898
 
782
899
  declare function defaultVaultConfig(): VaultConfig;
@@ -791,7 +908,17 @@ declare function initWorkspace(rootDir: string): Promise<{
791
908
  paths: ResolvedPaths;
792
909
  }>;
793
910
 
911
+ declare function exportGraphFormat(rootDir: string, format: Exclude<GraphExportFormat, "html">, outputPath: string): Promise<GraphExportResult>;
912
+
913
+ declare function getGitHookStatus(rootDir: string): Promise<GitHookStatus>;
914
+ declare function installGitHooks(rootDir: string): Promise<GitHookStatus>;
915
+ declare function uninstallGitHooks(rootDir: string): Promise<GitHookStatus>;
916
+
917
+ declare function listTrackedRepoRoots(rootDir: string): Promise<string[]>;
918
+ declare function syncTrackedRepos(rootDir: string, options?: IngestOptions, repoRoots?: string[]): Promise<RepoSyncResult>;
919
+ declare function syncTrackedReposForWatch(rootDir: string, options?: IngestOptions, repoRoots?: string[]): Promise<WatchRepoSyncResult>;
794
920
  declare function ingestInput(rootDir: string, input: string, options?: IngestOptions): Promise<SourceManifest>;
921
+ declare function addInput(rootDir: string, input: string, options?: AddOptions): Promise<AddResult>;
795
922
  declare function ingestDirectory(rootDir: string, inputDir: string, options?: IngestOptions): Promise<DirectoryIngestResult>;
796
923
  declare function importInbox(rootDir: string, inputDir?: string): Promise<InboxImportResult>;
797
924
  declare function listManifests(rootDir: string): Promise<SourceManifest[]>;
@@ -842,6 +969,7 @@ declare function queryGraphVault(rootDir: string, question: string, options?: {
842
969
  traversal?: "bfs" | "dfs";
843
970
  budget?: number;
844
971
  }): Promise<GraphQueryResult>;
972
+ declare function benchmarkVault(rootDir: string, options?: BenchmarkOptions): Promise<BenchmarkArtifact>;
845
973
  declare function pathGraphVault(rootDir: string, from: string, to: string): Promise<GraphPathResult>;
846
974
  declare function explainGraphVault(rootDir: string, target: string): Promise<GraphExplainResult>;
847
975
  declare function listGodNodes(rootDir: string, limit?: number): Promise<GraphNode[]>;
@@ -876,9 +1004,25 @@ declare function startGraphServer(rootDir: string, port?: number): Promise<{
876
1004
  }>;
877
1005
  declare function exportGraphHtml(rootDir: string, outputPath: string): Promise<string>;
878
1006
 
1007
+ type WatchCycleResult = {
1008
+ watchedRepoRoots: string[];
1009
+ importedCount: number;
1010
+ scannedCount: number;
1011
+ attachmentCount: number;
1012
+ repoImportedCount: number;
1013
+ repoUpdatedCount: number;
1014
+ repoRemovedCount: number;
1015
+ repoScannedCount: number;
1016
+ pendingSemanticRefreshCount: number;
1017
+ pendingSemanticRefreshPaths: string[];
1018
+ changedPages: string[];
1019
+ lintFindingCount?: number;
1020
+ };
1021
+ declare function runWatchCycle(rootDir: string, options?: WatchOptions): Promise<WatchCycleResult>;
879
1022
  declare function watchVault(rootDir: string, options?: WatchOptions): Promise<WatchController>;
1023
+ declare function getWatchStatus(rootDir: string): Promise<WatchStatusResult>;
880
1024
 
881
1025
  declare function createWebSearchAdapter(id: string, config: WebSearchProviderConfig, rootDir: string): Promise<WebSearchAdapter>;
882
1026
  declare function getWebSearchAdapterForTask(rootDir: string, task: "deepLintProvider"): Promise<WebSearchAdapter>;
883
1027
 
884
- 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 EvidenceClass, type ExploreOptions, type ExploreResult, type ExploreStepResult, type Freshness, type GenerationAttachment, type GenerationRequest, type GenerationResponse, type GraphArtifact, type GraphEdge, type GraphExplainNeighbor, type GraphExplainResult, type GraphNode, type GraphPage, type GraphPathResult, type GraphQueryMatch, type GraphQueryResult, 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 SourceRationale, 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, explainGraphVault, exploreVault, exportGraphHtml, getProviderForTask, getWebSearchAdapterForTask, getWorkspaceInfo, importInbox, ingestDirectory, ingestInput, initVault, initWorkspace, installAgent, installConfiguredAgents, lintVault, listApprovals, listCandidates, listGodNodes, listManifests, listPages, listSchedules, loadVaultConfig, loadVaultSchema, loadVaultSchemas, pathGraphVault, promoteCandidate, providerCapabilitySchema, providerTypeSchema, queryGraphVault, queryVault, readApproval, readExtractedText, readPage, rejectApproval, resolvePaths, runSchedule, searchVault, serveSchedules, startGraphServer, startMcpServer, watchVault, webSearchProviderTypeSchema };
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 };