feat(core): give Waggle its own database, apart from memory (P1.5)
Waggle kept its own tables in the memory database. Before the memory
engine can be replaced by mem0 they need a home of their own.
- add WaggleDB (<dataDir>/waggle.db). Automations, notifications, held
actions, skill hashes, thumbs feedback, cost tracking, the profile card
and awareness items live there. Their stores take a WaggleDB, so passing
a memory database is a type error.
- the profile card and awareness items are now per scope ('personal' or
'workspace:<id>') in one table each, instead of one table per .mind file
- on the first start, copy these tables from personal.mind and every
workspace.mind (importLegacyMindData). The legacy files are only read,
each scope is copied once and a table only while its target is empty.
- copy the logger, injection scanner, external-memory ingress guard,
WorkspaceManager and the embedders from @waggle/hive-mind-core into
@waggle/core, which now re-exports its own copies
- point the server, agent orchestrator and CLI at waggle.db; update the
tests that seeded these tables in a memory database
ADR-0007 records the layout and the licensing question about the copied
files.
This commit is contained in:
@@ -14,19 +14,51 @@
|
||||
// install-audit, cron-store, skill-hashes, team-sync, file-store, file-indexer,
|
||||
// memory-import.
|
||||
|
||||
// ── Substrate re-exports from @waggle/hive-mind-core (Apache 2.0 OSS) ──
|
||||
// ── Waggle infrastructure (not memory) ──
|
||||
// Copied from @waggle/hive-mind-core so the rest of Waggle no longer depends on
|
||||
// the memory substrate for them (P1.5). The substrate keeps its own copies until
|
||||
// the package is removed.
|
||||
export { createCoreLogger, type CoreLogger } from './logger.js';
|
||||
export { scanForInjection, type ScanResult } from './injection-scanner.js';
|
||||
export {
|
||||
// Logger + injection scanner
|
||||
createCoreLogger, type CoreLogger,
|
||||
scanForInjection, type ScanResult,
|
||||
evaluateExternalMemoryIngress, projectExternalMemoryContent,
|
||||
type ExternalMemoryIngressDecision, type ExternalMemoryIngressInput,
|
||||
type ExternalMemoryProjectionInput,
|
||||
} from './memory-ingress-guard.js';
|
||||
export { WorkspaceManager, type WorkspaceConfig, type CreateWorkspaceOptions } from './workspace-manager.js';
|
||||
export type { Embedder } from './embeddings/embeddings.js';
|
||||
export { createLiteLLMEmbedder, type LiteLLMEmbedderConfig } from './embeddings/litellm-embedder.js';
|
||||
export { createInProcessEmbedder, normalizeDimensions, type InProcessEmbedderConfig } from './embeddings/inprocess-embedder.js';
|
||||
export { createOllamaEmbedder, type OllamaEmbedderConfig } from './embeddings/ollama-embedder.js';
|
||||
export { createApiEmbedder, type ApiEmbedderConfig } from './embeddings/api-embedder.js';
|
||||
export {
|
||||
createEmbeddingProvider,
|
||||
type EmbeddingProviderConfig, type EmbeddingProviderStatus, type EmbeddingProviderType,
|
||||
type EmbeddingProviderInstance, type EmbeddingQuotaStatus,
|
||||
} from './embeddings/embedding-provider.js';
|
||||
|
||||
// ── waggle.db — Waggle's own data, apart from memory (ADR-0007) ──
|
||||
export {
|
||||
WaggleDB, WAGGLE_DB_FILE, PERSONAL_DATA_SCOPE, workspaceDataScope, type DataScope,
|
||||
} from './waggle-db.js';
|
||||
export { IdentityLayer, PROFILES_TABLE_SQL, type Identity } from './identity.js';
|
||||
export {
|
||||
AwarenessLayer, AWARENESS_ITEMS_TABLE_SQL,
|
||||
type AwarenessItem, type AwarenessCategory, type AwarenessMetadata,
|
||||
} from './awareness.js';
|
||||
export {
|
||||
ExecutionTraceStore, EXECUTION_TRACES_TABLE_SQL,
|
||||
type ExecutionTrace, type ParsedExecutionTrace, type TraceOutcome,
|
||||
type TracePayload, type TraceToolCall, type TraceReasoningStep,
|
||||
type StartTraceInput, type FinalizeTraceInput, type TraceQueryFilter,
|
||||
} from './execution-traces.js';
|
||||
export { importLegacyMindData, type LegacyMindSource, type LegacyImportReport } from './waggle-db-import.js';
|
||||
|
||||
// ── Substrate re-exports from @waggle/hive-mind-core (Apache 2.0 OSS) ──
|
||||
export {
|
||||
// mind/ — memory substrate
|
||||
MindDB, EmbeddingDimMismatchError,
|
||||
type EmbeddingFingerprint, type FingerprintCheck,
|
||||
IdentityLayer, type Identity,
|
||||
AwarenessLayer, type AwarenessItem, type AwarenessCategory,
|
||||
FrameStore, stripHmPrefix, hashFrameContent,
|
||||
RawArchive, hashRaw, readArchiveUids, withArchiveUid, type RawArchiveRow, type ArchiveInput,
|
||||
MindErasure, type EraseResult,
|
||||
@@ -48,20 +80,8 @@ export {
|
||||
SCORING_PROFILES,
|
||||
type ScoringProfile,
|
||||
type ScoringWeights,
|
||||
type Embedder,
|
||||
createLiteLLMEmbedder, type LiteLLMEmbedderConfig,
|
||||
createInProcessEmbedder, normalizeDimensions, type InProcessEmbedderConfig,
|
||||
createOllamaEmbedder, type OllamaEmbedderConfig,
|
||||
createApiEmbedder, type ApiEmbedderConfig,
|
||||
createEmbeddingProvider,
|
||||
type EmbeddingProviderConfig, type EmbeddingProviderStatus, type EmbeddingProviderType,
|
||||
type EmbeddingProviderInstance, type EmbeddingQuotaStatus,
|
||||
normalizeEntityName, findDuplicates, isNoiseName, isLikelyAcronym,
|
||||
Ontology, validateEntity, type EntitySchema, type ValidationResult,
|
||||
ExecutionTraceStore, EXECUTION_TRACES_TABLE_SQL,
|
||||
type ExecutionTrace, type ParsedExecutionTrace, type TraceOutcome,
|
||||
type TracePayload, type TraceToolCall, type TraceReasoningStep,
|
||||
type StartTraceInput, type FinalizeTraceInput, type TraceQueryFilter,
|
||||
reconcileIndexes, reconcileFtsIndex, reconcileVecIndex, cleanOrphanVectors, cleanOrphanFts,
|
||||
type ReconcileResult,
|
||||
ConceptTracker, CONCEPT_MASTERY_TABLE_SQL,
|
||||
@@ -105,7 +125,6 @@ export {
|
||||
// Plan A AMENDMENT 2026-04-30 — multi-workspace orchestration
|
||||
MultiMind, type MultiMindSearchResult, type MindSource, type SearchScope,
|
||||
MultiMindCache, type MultiMindCacheConfig,
|
||||
WorkspaceManager, type WorkspaceConfig, type CreateWorkspaceOptions,
|
||||
// Supersession (P) + bridge (B) frame producer (mono-parity 2026-07-05)
|
||||
detectSupersessionChains, detectEntityGroups, applyConsolidation,
|
||||
collectObservations, getCurrentValues,
|
||||
|
||||
Reference in New Issue
Block a user