@swarmvaultai/engine 1.3.0 → 1.4.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.
- package/LICENSE +21 -0
- package/README.md +3 -3
- package/dist/hooks/claude.js +0 -0
- package/dist/hooks/copilot.js +0 -0
- package/dist/hooks/gemini.js +0 -0
- package/dist/index.d.ts +7 -1
- package/dist/index.js +106 -4
- package/package.json +8 -9
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 SwarmVault
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
CHANGED
|
@@ -206,7 +206,7 @@ This matters because many "OpenAI-compatible" backends only implement part of th
|
|
|
206
206
|
### Compile + Query
|
|
207
207
|
|
|
208
208
|
- `compileVault(rootDir, { approve })` writes wiki pages, graph data, and search state using the vault schema as guidance, or stages a review bundle
|
|
209
|
-
- compile also writes graph orientation artifacts such as `wiki/graph/report.md`, `wiki/graph/share-card.md`, `wiki/graph/share-card.svg`, `wiki/graph/report.json`, and `wiki/graph/communities/<community>.md`
|
|
209
|
+
- compile also writes graph orientation artifacts such as `wiki/graph/report.md`, `wiki/graph/share-card.md`, `wiki/graph/share-card.svg`, `wiki/graph/share-kit/`, `wiki/graph/report.json`, and `wiki/graph/communities/<community>.md`
|
|
210
210
|
- compile propagates semantic tags onto page frontmatter and source-backed graph nodes, and records deterministic `contradicts` edges plus a Contradictions section in the graph report when conflicting claims are found
|
|
211
211
|
- `benchmarkVault(rootDir, { questions })` writes `state/benchmark.json` and folds the latest benchmark summary into `wiki/graph/report.md` and `wiki/graph/report.json`
|
|
212
212
|
- semantic graph query and embedding-backed similarity enrichment cache vectors under `state/embeddings.json` so graph-semantic refresh stays incremental
|
|
@@ -218,7 +218,7 @@ This matters because many "OpenAI-compatible" backends only implement part of th
|
|
|
218
218
|
- `explainGraphVault(rootDir, target)` returns node, community, neighbor, provenance, and group-pattern details
|
|
219
219
|
- `listGraphHyperedges(rootDir, target?, limit?)` returns graph hyperedges globally or for a specific node/page target
|
|
220
220
|
- `listGodNodes(rootDir, limit)` returns the most connected bridge-heavy graph nodes
|
|
221
|
-
- `buildGraphShareArtifact(...)`, `renderGraphShareMarkdown(...)`, and `
|
|
221
|
+
- `buildGraphShareArtifact(...)`, `renderGraphShareMarkdown(...)`, `renderGraphShareSvg(...)`, `renderGraphSharePreviewHtml(...)`, and `renderGraphShareBundleFiles(...)` produce the post-ready text, 1200x630 visual card, self-contained HTML preview, and portable share kit used by `wiki/graph/share-card.md`, `wiki/graph/share-card.svg`, `wiki/graph/share-kit/`, and the CLI `graph share` command
|
|
222
222
|
- project-aware compile also builds `wiki/projects/index.md` plus `wiki/projects/<project>/index.md` rollups without duplicating page trees
|
|
223
223
|
- human-authored insight pages in `wiki/insights/` are indexed into search and available to query without being rewritten by compile
|
|
224
224
|
- `chart` and `image` formats save wrapper markdown pages plus local output assets under `wiki/outputs/assets/<slug>/`
|
|
@@ -263,7 +263,7 @@ Running the engine produces a local workspace with these main areas:
|
|
|
263
263
|
- `raw/sources/`: immutable source copies
|
|
264
264
|
- `raw/assets/`: copied attachments referenced by ingested markdown bundles and remote URL ingests
|
|
265
265
|
- `wiki/`: generated markdown pages, the append-only `log.md` activity trail, staged candidates, saved query outputs, exploration hub pages, and a human-only `insights/` area
|
|
266
|
-
- `wiki/graph/`: generated graph report pages, markdown/SVG share cards, and per-community summaries derived from `state/graph.json`
|
|
266
|
+
- `wiki/graph/`: generated graph report pages, markdown/SVG share cards, the portable `share-kit/`, and per-community summaries derived from `state/graph.json`
|
|
267
267
|
- `wiki/graph/report.json`: machine-readable graph report data used by the viewer and export surfaces
|
|
268
268
|
- `wiki/outputs/assets/`: local chart/image artifacts and JSON manifests for saved visual outputs
|
|
269
269
|
- `wiki/code/`: generated module pages for ingested code sources
|
package/dist/hooks/claude.js
CHANGED
|
File without changes
|
package/dist/hooks/copilot.js
CHANGED
|
File without changes
|
package/dist/hooks/gemini.js
CHANGED
|
File without changes
|
package/dist/index.d.ts
CHANGED
|
@@ -1662,6 +1662,10 @@ interface GraphShareArtifact {
|
|
|
1662
1662
|
relatedPageIds: string[];
|
|
1663
1663
|
relatedSourceIds: string[];
|
|
1664
1664
|
}
|
|
1665
|
+
interface GraphShareBundleFile {
|
|
1666
|
+
relativePath: string;
|
|
1667
|
+
content: string;
|
|
1668
|
+
}
|
|
1665
1669
|
interface ScheduledCompileTask {
|
|
1666
1670
|
type: "compile";
|
|
1667
1671
|
approve?: boolean;
|
|
@@ -2010,6 +2014,8 @@ declare function buildGraphShareArtifact(input: {
|
|
|
2010
2014
|
}): GraphShareArtifact;
|
|
2011
2015
|
declare function renderGraphShareMarkdown(artifact: GraphShareArtifact): string;
|
|
2012
2016
|
declare function renderGraphShareSvg(artifact: GraphShareArtifact): string;
|
|
2017
|
+
declare function renderGraphSharePreviewHtml(artifact: GraphShareArtifact): string;
|
|
2018
|
+
declare function renderGraphShareBundleFiles(artifact: GraphShareArtifact): GraphShareBundleFile[];
|
|
2013
2019
|
|
|
2014
2020
|
declare function graphDiff(oldGraph: GraphArtifact, newGraph: GraphArtifact): GraphDiffResult;
|
|
2015
2021
|
/**
|
|
@@ -2614,4 +2620,4 @@ declare function createWebSearchAdapter(id: string, config: WebSearchProviderCon
|
|
|
2614
2620
|
type WebSearchTaskId = "deepLintProvider" | "queryProvider" | "exploreProvider";
|
|
2615
2621
|
declare function getWebSearchAdapterForTask(rootDir: string, task: WebSearchTaskId): Promise<WebSearchAdapter>;
|
|
2616
2622
|
|
|
2617
|
-
export { ALL_MIGRATIONS, type AddOptions, type AddResult, type AgentType, type AnalyzedTerm, type ApprovalBundleType, type ApprovalChangeType, type ApprovalDetail, type ApprovalDiffHunk, type ApprovalDiffLine, type ApprovalEntry, type ApprovalEntryDetail, type ApprovalEntryLabel, type ApprovalEntryStatus, type ApprovalFrontmatterChange, type ApprovalManifest, type ApprovalStructuredDiff, type ApprovalSummary, type AudioTranscriptionRequest, type AudioTranscriptionResponse, type BenchmarkArtifact, type BenchmarkByClassEntry, type BenchmarkOptions, type BenchmarkQuestionResult, type BenchmarkSummary, type BlastRadiusResult, type CandidatePromotionConfig, 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 ConsolidationConfig, type ConsolidationPromotion, type ConsolidationResult, DEFAULT_CONSOLIDATION_CONFIG, DEFAULT_HALF_LIFE_DAYS, DEFAULT_HALF_LIFE_DAYS_BY_SOURCE_CLASS, DEFAULT_PROMOTION_CONFIG, DEFAULT_REDACTION_PATTERNS, DEFAULT_STALE_THRESHOLD, type DegradationOutcome, type DirectoryIngestFailure, type DirectoryIngestResult, type DirectoryIngestSkip, type EmbeddingCacheArtifact, type EmbeddingCacheEntry, type EvidenceClass, type ExploreOptions, type ExploreResult, type ExploreStepResult, type ExtractionClaim, type ExtractionKind, type ExtractionTerm, type Freshness, type FreshnessConfig, type GenerationAttachment, type GenerationRequest, type GenerationResponse, type GitHookStatus, type GraphArtifact, type GraphDiffResult, type GraphEdge, type GraphExplainNeighbor, type GraphExplainResult, type GraphExportFormat, type GraphExportResult, type GraphHyperedge, type GraphNode, type GraphPage, type GraphPathResult, type GraphPushCounts, type GraphPushNeo4jOptions, type GraphPushResult, type GraphQueryMatch, type GraphQueryResult, type GraphReportArtifact, type GraphShareArtifact, type GuidedSessionMode, type GuidedSourceSessionAnswers, type GuidedSourceSessionQuestion, type GuidedSourceSessionRecord, type GuidedSourceSessionStatus, type ImageGenerationRequest, type ImageGenerationResponse, type ImageVisionExtraction, type InboxImportResult, type InboxImportSkip, type IngestOptions, type InitOptions, type InputIngestResult, type InstallAgentOptions, type InstallAgentResult, LARGE_REPO_NODE_THRESHOLD, LOCAL_WHISPER_MODEL_SIZES, type LintFinding, type LintOptions, type LocalWhisperAdapterOptions, type LocalWhisperBinaryDiscovery, LocalWhisperProviderAdapter, type LocalWhisperSetupStatus, type ManagedSourceAddOptions, type ManagedSourceAddResult, type ManagedSourceDeleteResult, type ManagedSourceKind, type ManagedSourceRecord, type ManagedSourceReloadOptions, type ManagedSourceReloadResult, type ManagedSourceStatus, type ManagedSourceSyncCounts, type ManagedSourcesArtifact, type MemoryTier, type MigrationPlan, type MigrationResult, type MigrationStep, type Neo4jGraphSinkConfig, OPENAI_COMPATIBLE_CAPABILITY_MATRIX, type OpenAiCompatiblePresetId, 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 PromotionDecision, type PromotionGateKind, type PromotionGateResult, type PromotionSession, type ProviderAdapter, type ProviderCapability, type ProviderConfig, type ProviderPresetCapability, type ProviderRegistrationOptions, type ProviderRegistrationResult, type ProviderRoleExecutorConfig, type ProviderType, type QueryOptions, type QueryResult, type RedactionMatchSummary, type RedactionPatternConfig, type RedactionSettings, type RedactionSummary, type RepoSyncResult, type ResolvedLargeRepoDefaults, type ResolvedPaths, type ReviewActionResult, type RoleExecutorConfig, type SceneElement, type SceneSpec, type ScheduleController, type ScheduleJobConfig, type ScheduleStateRecord, type ScheduleTriggerConfig, type ScheduledCompileTask, type ScheduledConsolidateTask, type ScheduledExploreTask, type ScheduledLintTask, type ScheduledQueryTask, type ScheduledRunResult, type ScheduledTaskConfig, type SearchResult, type SourceAnalysis, type SourceAttachment, type SourceCaptureType, type SourceClaim, type SourceClass, type SourceExtractionArtifact, type SourceGuideResult, type SourceKind, type SourceManifest, type SourceRationale, type SourceReviewResult, type SynthesizedHubEdge, type SynthesizedHubNode, type SynthesizedHyperedgeHubs, type VaultConfig, type VaultDashboardPack, type VaultProfileConfig, type VaultProfilePreset, type VaultVersionRecord, type WatchConfig, type WatchController, type WatchOptions, type WatchRepoSyncResult, type WatchRunRecord, type WatchStatusResult, type WebSearchAdapter, type WebSearchProviderConfig, type WebSearchProviderType, type WebSearchResult, type WhisperRunResult, type WhisperRunner, acceptApproval, addInput, addManagedSource, addWatchedRoot, agentTypeSchema, applyDecayToPages, archiveCandidate, assertProviderCapability, autoCommitWikiChanges, benchmarkVault, blastRadius, blastRadiusVault, bootstrapDemo, buildConfiguredRedactor, buildGraphShareArtifact, buildRedactor, compileVault, computeDecayScore, consolidateVault, createMcpServer, createProvider, createSupersessionEdge, createWebSearchAdapter, defaultVaultConfig, defaultVaultSchema, deleteManagedSource, detectVaultVersion, discoverLocalWhisperBinary, downloadWhisperModel, estimatePageTokens, estimateTokens, evaluateCandidateForPromotion, expectedModelPath, explainGraphVault, exploreVault, exportGraphFormat, exportGraphHtml, exportGraphReportHtml, exportObsidianCanvas, exportObsidianVault, getGitHookStatus, getProviderForTask, getWatchStatus, getWebSearchAdapterForTask, getWorkspaceInfo, graphDiff, guideManagedSource, guideSourceScope, importInbox, ingestDirectory, ingestInput, ingestInputDetailed, initVault, initWorkspace, installAgent, installConfiguredAgents, installGitHooks, lintVault, listApprovals, listCandidates, listGodNodes, listGraphHyperedges, listManagedSourceRecords, listManifests, listPages, listSchedules, listTrackedRepoRoots, listWatchedRoots, loadVaultConfig, loadVaultSchema, loadVaultSchemas, lookupPresetCapabilities, markSuperseded, modelDownloadUrl, pathGraphVault, persistDecayFrontmatter, planMigration, previewCandidatePromotions, promoteCandidate, providerCapabilitySchema, providerTypeSchema, pushGraphNeo4j, queryGraphVault, queryVault, readApproval, readExtractedText, readGraphReport, readPage, registerLocalWhisperProvider, rejectApproval, reloadManagedSources, removeWatchedRoot, renderGraphShareMarkdown, renderGraphShareSvg, resetDecay, resolveConsolidationConfig, resolveDecayConfig, resolveLargeRepoDefaults, resolvePaths, resolveRedactionPatterns, resolveWatchedRepoRoots, resumeSourceSession, reviewManagedSource, reviewSourceScope, runAutoPromotion, runConsolidation, runDecayPass, runMigration, runSchedule, runWatchCycle, searchVault, serveSchedules, stageGeneratedOutputPages, startGraphServer, startMcpServer, summarizeLocalWhisperSetup, syncTrackedRepos, syncTrackedReposForWatch, synthesizeHyperedgeHubs, trimToTokenBudget, uninstallGitHooks, watchVault, webSearchProviderTypeSchema, withCapabilityFallback };
|
|
2623
|
+
export { ALL_MIGRATIONS, type AddOptions, type AddResult, type AgentType, type AnalyzedTerm, type ApprovalBundleType, type ApprovalChangeType, type ApprovalDetail, type ApprovalDiffHunk, type ApprovalDiffLine, type ApprovalEntry, type ApprovalEntryDetail, type ApprovalEntryLabel, type ApprovalEntryStatus, type ApprovalFrontmatterChange, type ApprovalManifest, type ApprovalStructuredDiff, type ApprovalSummary, type AudioTranscriptionRequest, type AudioTranscriptionResponse, type BenchmarkArtifact, type BenchmarkByClassEntry, type BenchmarkOptions, type BenchmarkQuestionResult, type BenchmarkSummary, type BlastRadiusResult, type CandidatePromotionConfig, 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 ConsolidationConfig, type ConsolidationPromotion, type ConsolidationResult, DEFAULT_CONSOLIDATION_CONFIG, DEFAULT_HALF_LIFE_DAYS, DEFAULT_HALF_LIFE_DAYS_BY_SOURCE_CLASS, DEFAULT_PROMOTION_CONFIG, DEFAULT_REDACTION_PATTERNS, DEFAULT_STALE_THRESHOLD, type DegradationOutcome, type DirectoryIngestFailure, type DirectoryIngestResult, type DirectoryIngestSkip, type EmbeddingCacheArtifact, type EmbeddingCacheEntry, type EvidenceClass, type ExploreOptions, type ExploreResult, type ExploreStepResult, type ExtractionClaim, type ExtractionKind, type ExtractionTerm, type Freshness, type FreshnessConfig, type GenerationAttachment, type GenerationRequest, type GenerationResponse, type GitHookStatus, type GraphArtifact, type GraphDiffResult, type GraphEdge, type GraphExplainNeighbor, type GraphExplainResult, type GraphExportFormat, type GraphExportResult, type GraphHyperedge, type GraphNode, type GraphPage, type GraphPathResult, type GraphPushCounts, type GraphPushNeo4jOptions, type GraphPushResult, type GraphQueryMatch, type GraphQueryResult, type GraphReportArtifact, type GraphShareArtifact, type GraphShareBundleFile, type GuidedSessionMode, type GuidedSourceSessionAnswers, type GuidedSourceSessionQuestion, type GuidedSourceSessionRecord, type GuidedSourceSessionStatus, type ImageGenerationRequest, type ImageGenerationResponse, type ImageVisionExtraction, type InboxImportResult, type InboxImportSkip, type IngestOptions, type InitOptions, type InputIngestResult, type InstallAgentOptions, type InstallAgentResult, LARGE_REPO_NODE_THRESHOLD, LOCAL_WHISPER_MODEL_SIZES, type LintFinding, type LintOptions, type LocalWhisperAdapterOptions, type LocalWhisperBinaryDiscovery, LocalWhisperProviderAdapter, type LocalWhisperSetupStatus, type ManagedSourceAddOptions, type ManagedSourceAddResult, type ManagedSourceDeleteResult, type ManagedSourceKind, type ManagedSourceRecord, type ManagedSourceReloadOptions, type ManagedSourceReloadResult, type ManagedSourceStatus, type ManagedSourceSyncCounts, type ManagedSourcesArtifact, type MemoryTier, type MigrationPlan, type MigrationResult, type MigrationStep, type Neo4jGraphSinkConfig, OPENAI_COMPATIBLE_CAPABILITY_MATRIX, type OpenAiCompatiblePresetId, 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 PromotionDecision, type PromotionGateKind, type PromotionGateResult, type PromotionSession, type ProviderAdapter, type ProviderCapability, type ProviderConfig, type ProviderPresetCapability, type ProviderRegistrationOptions, type ProviderRegistrationResult, type ProviderRoleExecutorConfig, type ProviderType, type QueryOptions, type QueryResult, type RedactionMatchSummary, type RedactionPatternConfig, type RedactionSettings, type RedactionSummary, type RepoSyncResult, type ResolvedLargeRepoDefaults, type ResolvedPaths, type ReviewActionResult, type RoleExecutorConfig, type SceneElement, type SceneSpec, type ScheduleController, type ScheduleJobConfig, type ScheduleStateRecord, type ScheduleTriggerConfig, type ScheduledCompileTask, type ScheduledConsolidateTask, type ScheduledExploreTask, type ScheduledLintTask, type ScheduledQueryTask, type ScheduledRunResult, type ScheduledTaskConfig, type SearchResult, type SourceAnalysis, type SourceAttachment, type SourceCaptureType, type SourceClaim, type SourceClass, type SourceExtractionArtifact, type SourceGuideResult, type SourceKind, type SourceManifest, type SourceRationale, type SourceReviewResult, type SynthesizedHubEdge, type SynthesizedHubNode, type SynthesizedHyperedgeHubs, type VaultConfig, type VaultDashboardPack, type VaultProfileConfig, type VaultProfilePreset, type VaultVersionRecord, type WatchConfig, type WatchController, type WatchOptions, type WatchRepoSyncResult, type WatchRunRecord, type WatchStatusResult, type WebSearchAdapter, type WebSearchProviderConfig, type WebSearchProviderType, type WebSearchResult, type WhisperRunResult, type WhisperRunner, acceptApproval, addInput, addManagedSource, addWatchedRoot, agentTypeSchema, applyDecayToPages, archiveCandidate, assertProviderCapability, autoCommitWikiChanges, benchmarkVault, blastRadius, blastRadiusVault, bootstrapDemo, buildConfiguredRedactor, buildGraphShareArtifact, buildRedactor, compileVault, computeDecayScore, consolidateVault, createMcpServer, createProvider, createSupersessionEdge, createWebSearchAdapter, defaultVaultConfig, defaultVaultSchema, deleteManagedSource, detectVaultVersion, discoverLocalWhisperBinary, downloadWhisperModel, estimatePageTokens, estimateTokens, evaluateCandidateForPromotion, expectedModelPath, explainGraphVault, exploreVault, exportGraphFormat, exportGraphHtml, exportGraphReportHtml, exportObsidianCanvas, exportObsidianVault, getGitHookStatus, getProviderForTask, getWatchStatus, getWebSearchAdapterForTask, getWorkspaceInfo, graphDiff, guideManagedSource, guideSourceScope, importInbox, ingestDirectory, ingestInput, ingestInputDetailed, initVault, initWorkspace, installAgent, installConfiguredAgents, installGitHooks, lintVault, listApprovals, listCandidates, listGodNodes, listGraphHyperedges, listManagedSourceRecords, listManifests, listPages, listSchedules, listTrackedRepoRoots, listWatchedRoots, loadVaultConfig, loadVaultSchema, loadVaultSchemas, lookupPresetCapabilities, markSuperseded, modelDownloadUrl, pathGraphVault, persistDecayFrontmatter, planMigration, previewCandidatePromotions, promoteCandidate, providerCapabilitySchema, providerTypeSchema, pushGraphNeo4j, queryGraphVault, queryVault, readApproval, readExtractedText, readGraphReport, readPage, registerLocalWhisperProvider, rejectApproval, reloadManagedSources, removeWatchedRoot, renderGraphShareBundleFiles, renderGraphShareMarkdown, renderGraphSharePreviewHtml, renderGraphShareSvg, resetDecay, resolveConsolidationConfig, resolveDecayConfig, resolveLargeRepoDefaults, resolvePaths, resolveRedactionPatterns, resolveWatchedRepoRoots, resumeSourceSession, reviewManagedSource, reviewSourceScope, runAutoPromotion, runConsolidation, runDecayPass, runMigration, runSchedule, runWatchCycle, searchVault, serveSchedules, stageGeneratedOutputPages, startGraphServer, startMcpServer, summarizeLocalWhisperSetup, syncTrackedRepos, syncTrackedReposForWatch, synthesizeHyperedgeHubs, trimToTokenBudget, uninstallGitHooks, watchVault, webSearchProviderTypeSchema, withCapabilityFallback };
|
package/dist/index.js
CHANGED
|
@@ -7388,6 +7388,94 @@ function renderGraphShareSvg(artifact) {
|
|
|
7388
7388
|
];
|
|
7389
7389
|
return lines.join("\n");
|
|
7390
7390
|
}
|
|
7391
|
+
function renderGraphSharePreviewHtml(artifact) {
|
|
7392
|
+
const rawSvg = renderGraphShareSvg(artifact);
|
|
7393
|
+
const xmlDeclaration = '<?xml version="1.0" encoding="UTF-8"?>\n';
|
|
7394
|
+
const svg = rawSvg.startsWith(xmlDeclaration) ? rawSvg.slice(xmlDeclaration.length) : rawSvg;
|
|
7395
|
+
const topHubs = artifact.highlights.topHubs.slice(0, 5).map((node) => `<li>${escapeXml(node.degree ? `${node.label} (${node.degree})` : node.label)}</li>`).join("\n");
|
|
7396
|
+
const questions = artifact.highlights.suggestedQuestions.slice(0, 3).map((question) => `<li>${escapeXml(question)}</li>`).join("\n");
|
|
7397
|
+
const title = `SwarmVault Share Kit - ${artifact.vaultName}`;
|
|
7398
|
+
return [
|
|
7399
|
+
"<!doctype html>",
|
|
7400
|
+
'<html lang="en">',
|
|
7401
|
+
"<head>",
|
|
7402
|
+
' <meta charset="utf-8">',
|
|
7403
|
+
' <meta name="viewport" content="width=device-width, initial-scale=1">',
|
|
7404
|
+
` <title>${escapeXml(title)}</title>`,
|
|
7405
|
+
` <meta name="description" content="${escapeXml(artifact.tagline)}">`,
|
|
7406
|
+
" <style>",
|
|
7407
|
+
" :root { color-scheme: dark; font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif; background: #020617; color: #e2e8f0; }",
|
|
7408
|
+
" body { margin: 0; min-height: 100vh; background: #020617; }",
|
|
7409
|
+
" main { width: min(1120px, calc(100% - 32px)); margin: 0 auto; padding: 32px 0 48px; }",
|
|
7410
|
+
" header { margin-bottom: 24px; }",
|
|
7411
|
+
" h1 { margin: 0 0 8px; font-size: 34px; line-height: 1.15; letter-spacing: 0; color: #f8fafc; }",
|
|
7412
|
+
" p { margin: 0; color: #94a3b8; line-height: 1.6; }",
|
|
7413
|
+
" .preview { display: block; width: 100%; max-width: 960px; margin: 0 auto 28px; border: 1px solid #1e293b; background: #020617; }",
|
|
7414
|
+
" .preview svg { display: block; width: 100%; height: auto; }",
|
|
7415
|
+
" .grid { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(280px, 0.8fr); gap: 18px; }",
|
|
7416
|
+
" section { border: 1px solid #1e293b; background: #0f172a; padding: 18px; }",
|
|
7417
|
+
" h2 { margin: 0 0 12px; font-size: 16px; color: #86efac; letter-spacing: 0; }",
|
|
7418
|
+
" pre { white-space: pre-wrap; overflow-wrap: anywhere; margin: 0; color: #d1fae5; font-size: 14px; line-height: 1.55; }",
|
|
7419
|
+
" ul { margin: 0; padding-left: 20px; color: #cbd5e1; line-height: 1.6; }",
|
|
7420
|
+
" code { color: #d1fae5; }",
|
|
7421
|
+
" .cta { margin-top: 14px; padding: 12px 14px; background: #020617; border: 1px solid #334155; color: #d1fae5; font-weight: 700; overflow-wrap: anywhere; }",
|
|
7422
|
+
" @media (max-width: 760px) { main { width: min(100% - 24px, 1120px); padding-top: 20px; } .grid { grid-template-columns: 1fr; } h1 { font-size: 26px; } section { padding: 14px; } }",
|
|
7423
|
+
" </style>",
|
|
7424
|
+
"</head>",
|
|
7425
|
+
"<body>",
|
|
7426
|
+
' <main aria-labelledby="share-title">',
|
|
7427
|
+
" <header>",
|
|
7428
|
+
` <h1 id="share-title">${escapeXml(artifact.vaultName)}</h1>`,
|
|
7429
|
+
` <p>${escapeXml(artifact.tagline)}</p>`,
|
|
7430
|
+
" </header>",
|
|
7431
|
+
' <section class="preview" aria-label="Visual share card">',
|
|
7432
|
+
svg.split("\n").map((line) => ` ${line}`).join("\n"),
|
|
7433
|
+
" </section>",
|
|
7434
|
+
' <div class="grid">',
|
|
7435
|
+
' <section aria-labelledby="share-post-title">',
|
|
7436
|
+
' <h2 id="share-post-title">Share Post</h2>',
|
|
7437
|
+
` <pre>${escapeXml(artifact.shortPost)}</pre>`,
|
|
7438
|
+
" </section>",
|
|
7439
|
+
' <section aria-labelledby="share-details-title">',
|
|
7440
|
+
' <h2 id="share-details-title">Highlights</h2>',
|
|
7441
|
+
` <ul>${topHubs || "<li>Top hubs are still emerging.</li>"}</ul>`,
|
|
7442
|
+
' <h2 style="margin-top:18px">Ask Next</h2>',
|
|
7443
|
+
` <ul>${questions || "<li>Add more sources, run compile, then ask what changed.</li>"}</ul>`,
|
|
7444
|
+
' <div class="cta">npm install -g @swarmvaultai/cli && swarmvault scan ./your-repo</div>',
|
|
7445
|
+
" </section>",
|
|
7446
|
+
" </div>",
|
|
7447
|
+
" </main>",
|
|
7448
|
+
"</body>",
|
|
7449
|
+
"</html>",
|
|
7450
|
+
""
|
|
7451
|
+
].join("\n");
|
|
7452
|
+
}
|
|
7453
|
+
function renderGraphShareBundleFiles(artifact) {
|
|
7454
|
+
return [
|
|
7455
|
+
{
|
|
7456
|
+
relativePath: "share-card.md",
|
|
7457
|
+
content: renderGraphShareMarkdown(artifact)
|
|
7458
|
+
},
|
|
7459
|
+
{
|
|
7460
|
+
relativePath: "share-post.txt",
|
|
7461
|
+
content: `${artifact.shortPost}
|
|
7462
|
+
`
|
|
7463
|
+
},
|
|
7464
|
+
{
|
|
7465
|
+
relativePath: "share-card.svg",
|
|
7466
|
+
content: renderGraphShareSvg(artifact)
|
|
7467
|
+
},
|
|
7468
|
+
{
|
|
7469
|
+
relativePath: "share-preview.html",
|
|
7470
|
+
content: renderGraphSharePreviewHtml(artifact)
|
|
7471
|
+
},
|
|
7472
|
+
{
|
|
7473
|
+
relativePath: "share-artifact.json",
|
|
7474
|
+
content: `${JSON.stringify(artifact, null, 2)}
|
|
7475
|
+
`
|
|
7476
|
+
}
|
|
7477
|
+
];
|
|
7478
|
+
}
|
|
7391
7479
|
|
|
7392
7480
|
// src/graph-query-core.ts
|
|
7393
7481
|
var NODE_TYPE_PRIORITY = {
|
|
@@ -23040,7 +23128,8 @@ async function buildGraphOrientationPages(graph, paths, schemaHash, previousComp
|
|
|
23040
23128
|
return {
|
|
23041
23129
|
records: [reportRecord, shareRecord, ...communityRecords],
|
|
23042
23130
|
report,
|
|
23043
|
-
shareSvg: renderGraphShareSvg(shareArtifact)
|
|
23131
|
+
shareSvg: renderGraphShareSvg(shareArtifact),
|
|
23132
|
+
shareBundleFiles: renderGraphShareBundleFiles(shareArtifact)
|
|
23044
23133
|
};
|
|
23045
23134
|
}
|
|
23046
23135
|
async function writePage(wikiDir, relativePath, content, changedPages) {
|
|
@@ -23050,6 +23139,11 @@ async function writePage(wikiDir, relativePath, content, changedPages) {
|
|
|
23050
23139
|
changedPages.push(relativePath);
|
|
23051
23140
|
}
|
|
23052
23141
|
}
|
|
23142
|
+
async function writeGraphShareBundle(wikiDir, files) {
|
|
23143
|
+
for (const file of files) {
|
|
23144
|
+
await writeFileIfChanged(path26.join(wikiDir, "graph", "share-kit", file.relativePath), file.content);
|
|
23145
|
+
}
|
|
23146
|
+
}
|
|
23053
23147
|
function aggregateItems(analyses, kind) {
|
|
23054
23148
|
const grouped = /* @__PURE__ */ new Map();
|
|
23055
23149
|
for (const analysis of analyses) {
|
|
@@ -23662,6 +23756,7 @@ async function syncVaultArtifacts(rootDir, input) {
|
|
|
23662
23756
|
await writeJsonFile(paths.graphPath, graph);
|
|
23663
23757
|
await writeJsonFile(path26.join(paths.wikiDir, "graph", "report.json"), graphOrientation.report);
|
|
23664
23758
|
await writeFileIfChanged(path26.join(paths.wikiDir, "graph", "share-card.svg"), graphOrientation.shareSvg);
|
|
23759
|
+
await writeGraphShareBundle(paths.wikiDir, graphOrientation.shareBundleFiles);
|
|
23665
23760
|
await writeJsonFile(paths.codeIndexPath, input.codeIndex);
|
|
23666
23761
|
await writeJsonFile(paths.compileStatePath, {
|
|
23667
23762
|
generatedAt: graph.generatedAt,
|
|
@@ -23720,7 +23815,7 @@ async function refreshIndexesAndSearch(rootDir, pages) {
|
|
|
23720
23815
|
compileState?.generatedAt,
|
|
23721
23816
|
[],
|
|
23722
23817
|
config
|
|
23723
|
-
) : { records: [], report: null, shareSvg: "" };
|
|
23818
|
+
) : { records: [], report: null, shareSvg: "", shareBundleFiles: [] };
|
|
23724
23819
|
const dashboardRecords = currentGraph ? await buildDashboardRecords(
|
|
23725
23820
|
config,
|
|
23726
23821
|
paths,
|
|
@@ -23857,6 +23952,7 @@ async function refreshIndexesAndSearch(rootDir, pages) {
|
|
|
23857
23952
|
if (graphOrientation.report) {
|
|
23858
23953
|
await writeJsonFile(path26.join(paths.wikiDir, "graph", "report.json"), graphOrientation.report);
|
|
23859
23954
|
await writeFileIfChanged(path26.join(paths.wikiDir, "graph", "share-card.svg"), graphOrientation.shareSvg);
|
|
23955
|
+
await writeGraphShareBundle(paths.wikiDir, graphOrientation.shareBundleFiles);
|
|
23860
23956
|
}
|
|
23861
23957
|
const existingProjectIndexPaths = (await listFilesRecursive(paths.projectsDir)).filter((absolutePath) => absolutePath.endsWith(".md")).map((absolutePath) => toPosix(path26.relative(paths.wikiDir, absolutePath)));
|
|
23862
23958
|
const allowedProjectIndexPaths = /* @__PURE__ */ new Set([
|
|
@@ -23867,7 +23963,11 @@ async function refreshIndexesAndSearch(rootDir, pages) {
|
|
|
23867
23963
|
existingProjectIndexPaths.filter((relativePath) => !allowedProjectIndexPaths.has(relativePath)).map((relativePath) => fs22.rm(path26.join(paths.wikiDir, relativePath), { force: true }))
|
|
23868
23964
|
);
|
|
23869
23965
|
const existingGraphPages = (await listFilesRecursive(path26.join(paths.wikiDir, "graph").replace(/\/$/, "")).catch(() => [])).filter((absolutePath) => absolutePath.endsWith(".md")).map((absolutePath) => toPosix(path26.relative(paths.wikiDir, absolutePath)));
|
|
23870
|
-
const allowedGraphPages = /* @__PURE__ */ new Set([
|
|
23966
|
+
const allowedGraphPages = /* @__PURE__ */ new Set([
|
|
23967
|
+
"graph/index.md",
|
|
23968
|
+
"graph/share-kit/share-card.md",
|
|
23969
|
+
...graphOrientation.records.map((record) => record.page.path)
|
|
23970
|
+
]);
|
|
23871
23971
|
await Promise.all(
|
|
23872
23972
|
existingGraphPages.filter((relativePath) => !allowedGraphPages.has(relativePath)).map((relativePath) => fs22.rm(path26.join(paths.wikiDir, relativePath), { force: true }))
|
|
23873
23973
|
);
|
|
@@ -27014,7 +27114,7 @@ async function getWatchStatus(rootDir) {
|
|
|
27014
27114
|
}
|
|
27015
27115
|
|
|
27016
27116
|
// src/mcp.ts
|
|
27017
|
-
var SERVER_VERSION = "1.
|
|
27117
|
+
var SERVER_VERSION = "1.4.0";
|
|
27018
27118
|
async function createMcpServer(rootDir) {
|
|
27019
27119
|
const server = new McpServer({
|
|
27020
27120
|
name: "swarmvault",
|
|
@@ -30547,7 +30647,9 @@ export {
|
|
|
30547
30647
|
rejectApproval,
|
|
30548
30648
|
reloadManagedSources,
|
|
30549
30649
|
removeWatchedRoot,
|
|
30650
|
+
renderGraphShareBundleFiles,
|
|
30550
30651
|
renderGraphShareMarkdown,
|
|
30652
|
+
renderGraphSharePreviewHtml,
|
|
30551
30653
|
renderGraphShareSvg,
|
|
30552
30654
|
resetDecay,
|
|
30553
30655
|
resolveConsolidationConfig,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@swarmvaultai/engine",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.4.0",
|
|
4
4
|
"description": "Core engine for SwarmVault: ingest, compile, query, lint, and provider abstractions.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "dist/index.js",
|
|
@@ -39,13 +39,6 @@
|
|
|
39
39
|
"engines": {
|
|
40
40
|
"node": ">=24.0.0"
|
|
41
41
|
},
|
|
42
|
-
"scripts": {
|
|
43
|
-
"build": "test -f ../viewer/dist/index.html || pnpm --dir ../viewer build; tsup src/index.ts --format esm --dts && tsup --config tsup.hooks.config.ts && rm -rf dist/viewer && mkdir -p dist/viewer && cp -R ../viewer/dist/. dist/viewer/",
|
|
44
|
-
"pretest": "tsup --config tsup.hooks.config.ts",
|
|
45
|
-
"test": "SWARMVAULT_ALLOW_PRIVATE_URLS=1 vitest run",
|
|
46
|
-
"typecheck": "tsc --noEmit",
|
|
47
|
-
"prepublishOnly": "node ../../scripts/check-release-sync.mjs && node ../../scripts/check-published-manifests.mjs"
|
|
48
|
-
},
|
|
49
42
|
"dependencies": {
|
|
50
43
|
"@asciidoctor/core": "^3.0.4",
|
|
51
44
|
"@modelcontextprotocol/sdk": "^1.29.0",
|
|
@@ -95,5 +88,11 @@
|
|
|
95
88
|
"graphology-types": "^0.24.8",
|
|
96
89
|
"tsup": "^8.5.0",
|
|
97
90
|
"vitest": "^3.2.4"
|
|
91
|
+
},
|
|
92
|
+
"scripts": {
|
|
93
|
+
"build": "test -f ../viewer/dist/index.html || pnpm --dir ../viewer build; tsup src/index.ts --format esm --dts && tsup --config tsup.hooks.config.ts && rm -rf dist/viewer && mkdir -p dist/viewer && cp -R ../viewer/dist/. dist/viewer/",
|
|
94
|
+
"pretest": "tsup --config tsup.hooks.config.ts",
|
|
95
|
+
"test": "SWARMVAULT_ALLOW_PRIVATE_URLS=1 vitest run",
|
|
96
|
+
"typecheck": "tsc --noEmit"
|
|
98
97
|
}
|
|
99
|
-
}
|
|
98
|
+
}
|