@swarmvaultai/engine 0.11.0 → 1.0.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/dist/index.d.ts +97 -1
- package/dist/index.js +714 -381
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -2024,6 +2024,102 @@ declare function startMcpServer(rootDir: string, stdin?: Readable, stdout?: Writ
|
|
|
2024
2024
|
close: () => Promise<void>;
|
|
2025
2025
|
}>;
|
|
2026
2026
|
|
|
2027
|
+
interface MigrationStepContext {
|
|
2028
|
+
rootDir: string;
|
|
2029
|
+
paths: {
|
|
2030
|
+
wikiDir: string;
|
|
2031
|
+
stateDir: string;
|
|
2032
|
+
rootDir: string;
|
|
2033
|
+
};
|
|
2034
|
+
}
|
|
2035
|
+
interface MigrationStep {
|
|
2036
|
+
id: string;
|
|
2037
|
+
fromVersion: string;
|
|
2038
|
+
toVersion: string;
|
|
2039
|
+
description: string;
|
|
2040
|
+
apply(ctx: MigrationStepContext, options: {
|
|
2041
|
+
dryRun: boolean;
|
|
2042
|
+
}): Promise<{
|
|
2043
|
+
changed: string[];
|
|
2044
|
+
}>;
|
|
2045
|
+
}
|
|
2046
|
+
interface MigrationPlan {
|
|
2047
|
+
fromVersion: string | null;
|
|
2048
|
+
toVersion: string;
|
|
2049
|
+
steps: MigrationStep[];
|
|
2050
|
+
}
|
|
2051
|
+
interface MigrationResult {
|
|
2052
|
+
planned: number;
|
|
2053
|
+
applied: Array<{
|
|
2054
|
+
id: string;
|
|
2055
|
+
changed: string[];
|
|
2056
|
+
}>;
|
|
2057
|
+
skipped: Array<{
|
|
2058
|
+
id: string;
|
|
2059
|
+
reason: string;
|
|
2060
|
+
}>;
|
|
2061
|
+
dryRun: boolean;
|
|
2062
|
+
fromVersion: string | null;
|
|
2063
|
+
toVersion: string;
|
|
2064
|
+
}
|
|
2065
|
+
interface VaultVersionRecord {
|
|
2066
|
+
version: string;
|
|
2067
|
+
migratedAt: string;
|
|
2068
|
+
appliedSteps: string[];
|
|
2069
|
+
}
|
|
2070
|
+
declare const ALL_MIGRATIONS: readonly MigrationStep[];
|
|
2071
|
+
declare function detectVaultVersion(rootDir: string): Promise<string | null>;
|
|
2072
|
+
declare function planMigration(rootDir: string, targetVersion?: string): Promise<MigrationPlan>;
|
|
2073
|
+
declare function runMigration(rootDir: string, options?: {
|
|
2074
|
+
targetVersion?: string;
|
|
2075
|
+
dryRun?: boolean;
|
|
2076
|
+
}): Promise<MigrationResult>;
|
|
2077
|
+
|
|
2078
|
+
/**
|
|
2079
|
+
* Canonical capability matrix for the OpenAI-compatible provider family.
|
|
2080
|
+
*
|
|
2081
|
+
* OpenAI-compatible implementations differ substantially in which endpoints
|
|
2082
|
+
* they support, how strict their structured-output adherence is, and whether
|
|
2083
|
+
* they can handle vision or audio tasks. This matrix records the community
|
|
2084
|
+
* consensus so downstream code can query support before issuing requests
|
|
2085
|
+
* instead of discovering the gap via a runtime error.
|
|
2086
|
+
*
|
|
2087
|
+
* Entries are normative defaults, not contractual guarantees — a user who
|
|
2088
|
+
* configures `capabilities: [...]` on a `ProviderConfig` always wins over
|
|
2089
|
+
* the defaults.
|
|
2090
|
+
*/
|
|
2091
|
+
interface ProviderPresetCapability {
|
|
2092
|
+
readonly presetId: string;
|
|
2093
|
+
readonly apiStyle: "chat" | "responses";
|
|
2094
|
+
readonly capabilities: readonly ProviderCapability[];
|
|
2095
|
+
readonly notes: string;
|
|
2096
|
+
}
|
|
2097
|
+
declare const OPENAI_COMPATIBLE_CAPABILITY_MATRIX: Readonly<Record<string, ProviderPresetCapability>>;
|
|
2098
|
+
type OpenAiCompatiblePresetId = keyof typeof OPENAI_COMPATIBLE_CAPABILITY_MATRIX;
|
|
2099
|
+
/**
|
|
2100
|
+
* Look up the canonical capability list for a known preset id. Returns `null`
|
|
2101
|
+
* when the preset is unknown (e.g., `custom` adapters) so callers can decide
|
|
2102
|
+
* whether to trust the adapter's declared capability set instead.
|
|
2103
|
+
*/
|
|
2104
|
+
declare function lookupPresetCapabilities(presetId: string): ProviderPresetCapability | null;
|
|
2105
|
+
type DegradeReason = "unsupported" | "unknown";
|
|
2106
|
+
interface DegradationOutcome<T> {
|
|
2107
|
+
readonly supported: boolean;
|
|
2108
|
+
readonly reason: DegradeReason | null;
|
|
2109
|
+
readonly value: T | null;
|
|
2110
|
+
}
|
|
2111
|
+
/**
|
|
2112
|
+
* Safe-degradation helper: if the provider advertises the requested
|
|
2113
|
+
* capability, run `run()`. Otherwise return the caller-supplied fallback
|
|
2114
|
+
* and explain why.
|
|
2115
|
+
*
|
|
2116
|
+
* This is intentionally a thin wrapper — the cost of misusing it is a
|
|
2117
|
+
* silent failure, so it forces the caller to supply an explicit fallback
|
|
2118
|
+
* and logs the reason so callers can surface a warning instead of
|
|
2119
|
+
* hallucinating a result.
|
|
2120
|
+
*/
|
|
2121
|
+
declare function withCapabilityFallback<T>(provider: Pick<ProviderAdapter, "capabilities" | "type">, capability: ProviderCapability, run: () => Promise<T>, fallback: () => T | Promise<T>): Promise<DegradationOutcome<T>>;
|
|
2122
|
+
|
|
2027
2123
|
declare function createProvider(id: string, config: ProviderConfig, rootDir: string): Promise<ProviderAdapter>;
|
|
2028
2124
|
declare function getProviderForTask(rootDir: string, task: keyof Awaited<ReturnType<typeof loadVaultConfig>>["config"]["tasks"]): Promise<ProviderAdapter>;
|
|
2029
2125
|
declare function assertProviderCapability(provider: ProviderAdapter, capability: ProviderCapability): void;
|
|
@@ -2333,4 +2429,4 @@ declare function createWebSearchAdapter(id: string, config: WebSearchProviderCon
|
|
|
2333
2429
|
type WebSearchTaskId = "deepLintProvider" | "queryProvider" | "exploreProvider";
|
|
2334
2430
|
declare function getWebSearchAdapterForTask(rootDir: string, task: WebSearchTaskId): Promise<WebSearchAdapter>;
|
|
2335
2431
|
|
|
2336
|
-
export { 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 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 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, type LintFinding, type LintOptions, type ManagedSourceAddOptions, type ManagedSourceAddResult, type ManagedSourceDeleteResult, type ManagedSourceKind, type ManagedSourceRecord, type ManagedSourceReloadOptions, type ManagedSourceReloadResult, type ManagedSourceStatus, type ManagedSourceSyncCounts, type ManagedSourcesArtifact, type MemoryTier, type Neo4jGraphSinkConfig, 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 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 WatchConfig, type WatchController, type WatchOptions, type WatchRepoSyncResult, type WatchRunRecord, type WatchStatusResult, type WebSearchAdapter, type WebSearchProviderConfig, type WebSearchProviderType, type WebSearchResult, acceptApproval, addInput, addManagedSource, addWatchedRoot, agentTypeSchema, applyDecayToPages, archiveCandidate, assertProviderCapability, autoCommitWikiChanges, benchmarkVault, blastRadius, blastRadiusVault, bootstrapDemo, buildConfiguredRedactor, buildRedactor, compileVault, computeDecayScore, consolidateVault, createMcpServer, createProvider, createSupersessionEdge, createWebSearchAdapter, defaultVaultConfig, defaultVaultSchema, deleteManagedSource, estimatePageTokens, estimateTokens, evaluateCandidateForPromotion, 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, markSuperseded, pathGraphVault, persistDecayFrontmatter, previewCandidatePromotions, promoteCandidate, providerCapabilitySchema, providerTypeSchema, pushGraphNeo4j, queryGraphVault, queryVault, readApproval, readExtractedText, readGraphReport, readPage, rejectApproval, reloadManagedSources, removeWatchedRoot, resetDecay, resolveConsolidationConfig, resolveDecayConfig, resolveLargeRepoDefaults, resolvePaths, resolveRedactionPatterns, resolveWatchedRepoRoots, resumeSourceSession, reviewManagedSource, reviewSourceScope, runAutoPromotion, runConsolidation, runDecayPass, runSchedule, runWatchCycle, searchVault, serveSchedules, stageGeneratedOutputPages, startGraphServer, startMcpServer, syncTrackedRepos, syncTrackedReposForWatch, synthesizeHyperedgeHubs, trimToTokenBudget, uninstallGitHooks, watchVault, webSearchProviderTypeSchema };
|
|
2432
|
+
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 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, type LintFinding, type LintOptions, 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 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, acceptApproval, addInput, addManagedSource, addWatchedRoot, agentTypeSchema, applyDecayToPages, archiveCandidate, assertProviderCapability, autoCommitWikiChanges, benchmarkVault, blastRadius, blastRadiusVault, bootstrapDemo, buildConfiguredRedactor, buildRedactor, compileVault, computeDecayScore, consolidateVault, createMcpServer, createProvider, createSupersessionEdge, createWebSearchAdapter, defaultVaultConfig, defaultVaultSchema, deleteManagedSource, detectVaultVersion, estimatePageTokens, estimateTokens, evaluateCandidateForPromotion, 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, pathGraphVault, persistDecayFrontmatter, planMigration, previewCandidatePromotions, promoteCandidate, providerCapabilitySchema, providerTypeSchema, pushGraphNeo4j, queryGraphVault, queryVault, readApproval, readExtractedText, readGraphReport, readPage, rejectApproval, reloadManagedSources, removeWatchedRoot, resetDecay, resolveConsolidationConfig, resolveDecayConfig, resolveLargeRepoDefaults, resolvePaths, resolveRedactionPatterns, resolveWatchedRepoRoots, resumeSourceSession, reviewManagedSource, reviewSourceScope, runAutoPromotion, runConsolidation, runDecayPass, runMigration, runSchedule, runWatchCycle, searchVault, serveSchedules, stageGeneratedOutputPages, startGraphServer, startMcpServer, syncTrackedRepos, syncTrackedReposForWatch, synthesizeHyperedgeHubs, trimToTokenBudget, uninstallGitHooks, watchVault, webSearchProviderTypeSchema, withCapabilityFallback };
|