Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
86 changes: 81 additions & 5 deletions bun.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion bunfig.toml
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
[test]
preload = ["./test/setup.ts"]
preload = ["./packages/core/test/setup.ts"]
42 changes: 10 additions & 32 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,48 +1,26 @@
{
"name": "opencode-lore",
"version": "0.9.1",
"name": "lore-monorepo",
"private": true,
"type": "module",
"license": "MIT",
"description": "Three-tier memory architecture for OpenCode — distillation, not summarization",
"main": "src/index.ts",
"exports": {
".": "./src/index.ts"
},
"description": "Monorepo root for Lore — three-tier memory architecture",
"workspaces": [
"packages/*"
],
"scripts": {
"typecheck": "bun run tsc --noEmit",
"test": "bun test"
},
"peerDependencies": {
"@opencode-ai/plugin": ">=1.1.0"
},
"dependencies": {
"remark": "^15.0.1",
"uuidv7": "^1.1.0",
"zod": "^4.3.6"
"typecheck": "bun --filter '*' typecheck",
"test": "bun test",
"build": "bun --filter '*' build"
},
"devDependencies": {
"@opencode-ai/plugin": "^1.1.39",
"@opencode-ai/sdk": "^1.1.39",
"@types/bun": "^1.2.0",
"esbuild": "^0.25.12",
"fast-check": "^4.5.3",
"typescript": "^5.8.0"
},
"files": [
"src/",
"README.md",
"LICENSE"
],
"repository": {
"type": "git",
"url": "git+https://github.com/BYK/opencode-lore.git"
},
"keywords": [
"opencode",
"plugin",
"memory",
"agent",
"distillation",
"llm"
],
"author": "BYK"
}
58 changes: 58 additions & 0 deletions packages/core/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
{
"name": "@loreai/core",
"version": "0.9.1",
"type": "module",
"license": "MIT",
"description": "Shared memory engine for Lore — three-tier storage, distillation, gradient context management",
"main": "./src/index.ts",
"types": "./src/index.ts",
"exports": {
".": {
"types": "./src/index.ts",
"bun": "./src/index.ts",
"default": "./dist/node/index.js"
}
},
"imports": {
"#db/driver": {
"bun": "./src/db/driver.bun.ts",
"default": "./src/db/driver.node.ts"
}
},
"scripts": {
"typecheck": "tsc --noEmit",
"build": "bun run script/build.ts"
},
"dependencies": {
"remark": "^15.0.1",
"uuidv7": "^1.1.0",
"zod": "^4.3.6"
},
"devDependencies": {
"@opencode-ai/sdk": "^1.1.39",
"@types/mdast": "^4.0.4"
},
"files": [
"src/",
"dist/",
"README.md",
"LICENSE"
],
"engines": {
"node": ">=22.5"
},
"repository": {
"type": "git",
"url": "git+https://github.com/BYK/opencode-lore.git",
"directory": "packages/core"
},
"keywords": [
"lore",
"memory",
"llm",
"sqlite",
"fts5",
"distillation"
],
"author": "BYK"
}
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
80 changes: 80 additions & 0 deletions packages/core/src/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,80 @@
// @loreai/core — shared memory engine for Lore.
//
// This barrel re-exports every core module so hosts (the OpenCode plugin, the
// Pi extension, or any future adapter) can import from a single entry:
//
// import { ltm, temporal, gradient, ... } from "@loreai/core"
//
// Modules that are intentionally not re-exported:
// - `db.ts` internals are exposed via specific functions (db(), ensureProject(), etc.)
// - No Plugin/Hooks surface — those live in host-specific packages.

export * as temporal from "./temporal";
export * as ltm from "./ltm";
export * as distillation from "./distillation";
export * as curator from "./curator";
export * as embedding from "./embedding";
export * as latReader from "./lat-reader";
export * as log from "./log";

export { load, config, type LoreConfig } from "./config";
export {
db,
ensureProject,
isFirstRun,
projectId,
projectName,
loadForceMinLayer,
saveForceMinLayer,
close,
} from "./db";
export {
transform,
setModelLimits,
needsUrgentDistillation,
calibrate,
setLtmTokens,
getLtmTokens,
getLtmBudget,
setForceMinLayer,
getLastTransformedCount,
getLastTransformEstimate,
} from "./gradient";
export {
formatKnowledge,
formatDistillations,
DISTILLATION_SYSTEM,
distillationUser,
RECURSIVE_SYSTEM,
recursiveUser,
CURATOR_SYSTEM,
curatorUser,
CONSOLIDATION_SYSTEM,
consolidationUser,
QUERY_EXPANSION_SYSTEM,
} from "./prompt";
export { shouldImport, importFromFile, exportToFile } from "./agents-file";
export { workerSessionIDs, promptWorker, isWorkerSession } from "./worker";
export {
ftsQuery,
ftsQueryOr,
EMPTY_QUERY,
reciprocalRankFusion,
expandQuery,
extractTopTerms,
} from "./search";
export {
serialize,
inline,
h,
p,
ul,
lip,
liph,
t,
root,
strong,
normalize,
sanitizeSurrogates,
unescapeMarkdown,
} from "./markdown";
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Loading
Loading