moving
Some checks failed
Installer Smoke / installer-smoke (push) Has been cancelled

This commit is contained in:
Oleg Maslov
2026-09-02 10:10:29 +02:00
commit 0c3e2ead3b
3841 changed files with 970576 additions and 0 deletions

159
packages/core/src/index.ts Normal file
View File

@@ -0,0 +1,159 @@
// @waggle/core — Waggle-specific orchestration layer.
//
// As of CC Sesija B 2026-04-30 (PM Q3 Plan A ratification), the substrate
// (mind/ + harvest/ + logger + injection-scanner) lives in @waggle/hive-mind-core
// and is distributed as Apache 2.0 OSS via subtree-split. This barrel re-exports
// substrate symbols for backward compatibility — existing consumers (packages/agent,
// apps/web, packages/server, etc.) keep their `import { ... } from '@waggle/core'`
// imports unchanged.
//
// Waggle-specific (non-extracted) modules below the substrate re-exports stay
// in this package: config, multi-mind, workspace orchestration, vault, telemetry,
// install-audit, cron-store, skill-hashes, team-sync, file-store, file-indexer,
// memory-import, optimization-log, compliance/.
// ── Substrate re-exports from @waggle/hive-mind-core (Apache 2.0 OSS) ──
export {
// Logger + injection scanner
createCoreLogger, type CoreLogger,
scanForInjection, type ScanResult,
// 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,
SuppressionStore, type SuppressedSubject,
type MemoryFrame, type FrameType, type Importance, type FrameSource,
SessionStore, type Session,
HybridSearch, type SearchResult,
// D1 (oss-drift triage, 2026-06-11) — chunk-level retrieval (flag-gated, default OFF)
chunkRetrievalEnabled, rechunkAllFrames, type RechunkResult,
chunkText, type ChunkOptions, type FrameChunk,
KnowledgeGraph, type Entity, type Relation, type ValidationSchema,
SCHEMA_SQL, VEC_TABLE_SQL, CHUNKS_VEC_TABLE_SQL, SCHEMA_VERSION,
vecTableSqlForDim, chunksVecTableSqlForDim,
computeRelevance,
computeTemporalScore,
computePopularityScore,
computeContextualScore,
computeImportanceScore,
SCORING_PROFILES,
type ScoringProfile,
type ScoringWeights,
type Embedder,
createLiteLLMEmbedder, type LiteLLMEmbedderConfig,
createInProcessEmbedder, normalizeDimensions, type InProcessEmbedderConfig,
createOllamaEmbedder, type OllamaEmbedderConfig,
createApiEmbedder, type ApiEmbedderConfig,
createEmbeddingProvider, EmbeddingQuotaExceededError, getMinimumTierForProvider,
type EmbeddingProviderConfig, type EmbeddingProviderStatus, type EmbeddingProviderType,
type EmbeddingProviderInstance, type EmbeddingQuotaStatus,
normalizeEntityName, findDuplicates, isNoiseName, isLikelyAcronym,
Ontology, validateEntity, type EntitySchema, type ValidationResult,
ImprovementSignalStore,
type ImprovementSignal, type ActionableSignal, type SignalCategory, type ActionableThresholds,
ExecutionTraceStore, EXECUTION_TRACES_TABLE_SQL,
type ExecutionTrace, type ParsedExecutionTrace, type TraceOutcome,
type TracePayload, type TraceToolCall, type TraceReasoningStep,
type StartTraceInput, type FinalizeTraceInput, type TraceQueryFilter,
EvolutionRunStore, EVOLUTION_RUNS_TABLE_SQL,
type EvolutionRun, type EvolutionRunStatus, type EvolutionRunTarget,
type CreateEvolutionRunInput, type EvolutionRunFilter,
reconcileIndexes, reconcileFtsIndex, reconcileVecIndex, cleanOrphanVectors, cleanOrphanFts,
type ReconcileResult,
ConceptTracker, CONCEPT_MASTERY_TABLE_SQL,
type ConceptEntry, type ConceptUpdate,
// recall-context — temporal rendering helpers (W4.1 production port)
TEMPORAL_GUIDANCE, toDatePrefix, renderDatedSnippet, referenceDate, renderReferenceDateLine,
parseDateWindow, type DateWindow,
resolveRelativeDate, type ResolvedDate,
createInProcessReranker, type Reranker, type InProcessRerankerConfig,
// harvest/ — universal memory ingestion pipeline
HarvestSourceStore,
HarvestRunStore, type HarvestRun, type HarvestRunStatus,
ChatGPTAdapter,
ClaudeAdapter,
ClaudeCodeAdapter,
GeminiAdapter,
UniversalAdapter,
MarkdownAdapter,
PlaintextAdapter,
UrlAdapter,
PdfAdapter,
HarvestPipeline, type LLMCallFn, type PipelineOptions,
extractMemoryLanes, writeMemoryLaneFrames,
MIND_FACT_PREFIX, MIND_EVENT_PREFIX, MIND_PROFILE_PREFIX,
type MemoryLaneExtraction, type ExtractedEvent, type ExtractedFact, type ExtractedProfile,
type WriteLaneFramesResult,
// D2 — LLM-based KG entity extraction (oss-drift triage, 2026-06-11)
extractKgEntities, writeKgEntities, KG_ENTITY_TYPES,
type KgEntity, type KgEntityType, type KgEntityExtraction, type WriteKgEntitiesResult,
// W4.6 — raw-turn storage + RAWDETAIL recall lane
writeRawTurnFrames, rawTurnHeader, parseRawTurnHeader, rawTurnConvKey,
MIND_RAWTURN_PREFIX, MAX_TURNS_PER_ITEM, RAWDETAIL_KILL_SWITCH,
type WriteRawTurnsResult, type ParsedRawTurnHeader,
fetchRawDetailLane, rawTurnBody, RAW_DETAIL_K,
type RawTurnHit, type RawDetailLaneOptions,
dedup, harvestSetHash,
HARVEST_FRAME_CONTENT_CAP,
type ImportSourceType, type ImportItemType, type UniversalImportItem, type DistilledKnowledge,
type HarvestPipelineResult, type HarvestSource, type SourceAdapter, type FilesystemAdapter,
type ClassifiedItem, type ExtractedContent, type KnowledgeProvenance,
// 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,
type ConsolidationLlm, type Observation, type SupersessionChain,
type EntityGroup, type ConsolidationResult, type CollectObservationsOptions,
} from '@waggle/hive-mind-core';
// ── Waggle-specific orchestration (stays in @waggle/core) ──
export { WaggleConfig, type ProviderEntry, type TeamServerConfig } from './config.js';
export { needsMigration, migrateToMultiMind } from './migration.js';
export { TeamSync, frameToEntity, entityToSyncedFrame, type TeamSyncConfig, type SyncedFrame } from './team-sync.js';
export {
InstallAuditStore, INSTALL_AUDIT_TABLE_SQL,
type InstallAuditEntry, type RecordAuditInput,
type AuditAction, type AuditRiskLevel, type AuditTrustSource,
type AuditApprovalClass, type AuditInitiator, type AuditCapabilityType,
} from './install-audit.js';
export {
CronStore, CRON_SCHEDULES_TABLE_SQL, CRON_RUN_LEASES_TABLE_SQL, VALID_JOB_TYPES, cronExprError,
type CronSchedule, type CreateScheduleInput, type CronJobType,
type CronExecutionRow, type CronRunLeaseRow,
type PendingActionRow, type PendingActionStatus, type SavePendingActionInput,
} from './cron-store.js';
export { VaultStore, type VaultEntry } from './vault.js';
export { TelemetryStore, TelemetryCollector, TELEMETRY_EVENTS, type TelemetryEvent, type TelemetrySummary } from './telemetry.js';
export {
SkillHashStore, computeSkillHash, SKILL_HASHES_TABLE_SQL,
type SkillHash,
} from './skill-hashes.js';
export { processImport, parseChatGPTExport, parseClaudeExport, extractKnowledge } from './memory-import.js';
export { createFileStore, LocalFileStore, LinkedDirStore, S3FileStore, isSensitiveFilePath, type FileStore, type FileEntry, type StorageInfo, type S3Config } from './file-store.js';
export { FileIndexer, MAX_CONTENT_BYTES, type FileIndexRow, type FileIndexResult } from './file-indexer.js';
export type { ImportSource, ImportResult, ExtractedKnowledge, ParsedConversation, ConversationMessage } from './memory-import.js';
export {
OptimizationLogStore, OPTIMIZATION_LOG_TABLE_SQL,
type OptimizationLogEntry, type CreateOptimizationLogInput,
} from './optimization-log.js';
// ── Compliance (AI Act) — stays in @waggle/core (NOT extracted per .github/sync.md) ──
export { InteractionStore } from './compliance/interaction-store.js';
export { ComplianceStatusChecker } from './compliance/status-checker.js';
export { ReportGenerator, type ReportGeneratorDeps } from './compliance/report-generator.js';
export { ComplianceTemplateStore, KVARK_TEMPLATE_NAME } from './compliance/template-store.js';
export { TEMPLATE_RISK_MAP } from './compliance/types.js';
export type {
AIActRiskLevel, HumanAction, AIInteraction, RecordInteractionInput,
ComplianceStatus, ArticleStatus, AuditReport, AuditReportRequest,
ModelInventoryEntry, OversightLogEntry, HarvestProvenanceEntry,
ComplianceTemplate, ComplianceTemplateSections,
CreateComplianceTemplateInput, UpdateComplianceTemplateInput,
} from './compliance/types.js';